plugin:actionlink
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:actionlink [2010-12-22 13:07] – [subscribe-unsubscribe link] 82.140.120.164 | plugin:actionlink [2023-10-31 00:30] (current) – Klap-in | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Actionlink | + | ====== Actionlink |
---- plugin ---- | ---- plugin ---- | ||
Line 6: | Line 6: | ||
email : nowotnypl@gmail.com | email : nowotnypl@gmail.com | ||
type : syntax | type : syntax | ||
- | lastupdate : 2006-05-26 | + | lastupdate : 2018-02-04 |
- | compatible : | + | compatible : Anteater, Rincewind, Angua, Adora Belle, Weatherwax, Binky, Ponder Stibbons, Hrun, Detritus, Elenor of Tsort, Frusterick Manners |
depends | depends | ||
conflicts | conflicts | ||
similar | similar | ||
- | tags : links | + | tags : links, actions |
- | downloadurl: | + | downloadurl: |
- | bugtracker : | + | bugtracker : https:// |
- | sourcerepo : | + | sourcerepo : https:// |
donationurl: | donationurl: | ||
---- | ---- | ||
+ | ---- | ||
+ | | **Not compatible with PHP 8.1** \\ Error message: \\ 2023-03-24 06: | ||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | :!: When building actionlinks for ' | ||
===== Syntax ===== | ===== Syntax ===== | ||
Line 28: | Line 35: | ||
* history - old revisions | * history - old revisions | ||
* recent | * recent | ||
+ | * :recent, /recent - recent changes from the root namespace | ||
* login - login/ | * login - login/ | ||
* index - the index | * index - the index | ||
Line 34: | Line 42: | ||
* back - a 'back to parent' | * back - a 'back to parent' | ||
* backlink - list of backlinks | * backlink - list of backlinks | ||
- | \\ | + | * search |
+ | * purge | ||
+ | * subscribe | ||
+ | * addtobook | ||
+ | * cite | ||
+ | * infomail | ||
+ | * export_odt | ||
+ | * export_pdf | ||
+ | |||
+ | (Of course, for these last commands to work, those plugins should be installed.) | ||
The **title** element is optional. It lets you specify a custom string to be used instead of the default 'Edit this page', 'Old revisions', | The **title** element is optional. It lets you specify a custom string to be used instead of the default 'Edit this page', 'Old revisions', | ||
Line 50: | Line 68: | ||
===== Installation ===== | ===== Installation ===== | ||
- | You can install | + | Search and install |
- | \\ | + | |
- | Sources: [[http:// | + | |
+ | Sources: | ||
- | To install manually: create a folder '' | + | To install manually: create a folder '' |
<code php><? | <code php><? | ||
/** | /** | ||
Line 192: | Line 211: | ||
$renderer-> | $renderer-> | ||
return true; | return true; | ||
+ | default: | ||
+ | if(!isset($title)) $title=''; | ||
+ | $renderer-> | ||
+ | return true; | ||
+ | } | ||
+ | } | ||
+ | return false; | ||
+ | } | ||
+ | function tpll_link($url, | ||
+ | $link='< | ||
+ | if ($more) $link.=' | ||
+ | $link.="> | ||
+ | return $link; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | //Setup VIM: ex: et ts=4 enc=utf-8 : | ||
+ | </ | ||
+ | |||
+ | extended version with some plugins: | ||
+ | |||
+ | <code php> | ||
+ | <?php | ||
+ | /** | ||
+ | * Action link plugin. Lets you use action links in your wiki syntax. | ||
+ | * Based on the core function - tpl_actionlink(). | ||
+ | * | ||
+ | * @license | ||
+ | * @author Andreas Gohr < | ||
+ | * @author Matthias Grimm < | ||
+ | * @author nowotny < | ||
+ | */ | ||
+ | |||
+ | if(!defined(' | ||
+ | if(!defined(' | ||
+ | require_once(DOKU_PLUGIN.' | ||
+ | require_once(DOKU_INC.' | ||
+ | |||
+ | class syntax_plugin_actionlink extends DokuWiki_Syntax_Plugin { | ||
+ | |||
+ | function getInfo(){ | ||
+ | return array( | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | Basic syntax: {{actionlink> | ||
+ | ' | ||
+ | ); | ||
+ | } | ||
+ | |||
+ | function getType(){ | ||
+ | return ' | ||
+ | } | ||
+ | |||
+ | function getSort(){ | ||
+ | return 306; | ||
+ | } | ||
+ | |||
+ | function connectTo($mode) { | ||
+ | $this-> | ||
+ | } | ||
+ | |||
+ | function handle($match, | ||
+ | $match = substr($match, | ||
+ | $matches=explode(' | ||
+ | return array(' | ||
+ | } | ||
+ | |||
+ | function render($mode, | ||
+ | if($mode == ' | ||
+ | |||
+ | if(!empty($data[' | ||
+ | else $action=''; | ||
+ | if(!empty($data[' | ||
+ | |||
+ | global $ID; | ||
+ | global $INFO; | ||
+ | global $REV; | ||
+ | global $ACT; | ||
+ | global $conf; | ||
+ | global $lang; | ||
+ | global $auth; | ||
+ | |||
+ | switch($action){ | ||
+ | case ' | ||
+ | #most complicated type - we need to decide on current action | ||
+ | if($ACT == ' | ||
+ | if($INFO[' | ||
+ | if($INFO[' | ||
+ | if(!isset($title)) $title=$lang[' | ||
+ | $renderer-> | ||
+ | $title, | ||
+ | ' | ||
+ | }else{ | ||
+ | if(!isset($title)) $title=$lang[' | ||
+ | $renderer-> | ||
+ | $title, | ||
+ | ' | ||
+ | } | ||
+ | }else{ | ||
+ | if(!isset($title)) $title=$lang[' | ||
+ | $renderer-> | ||
+ | $title, | ||
+ | ' | ||
+ | } | ||
+ | }else{ | ||
+ | if(!isset($title)) $title=$lang[' | ||
+ | $renderer-> | ||
+ | $title, | ||
+ | ' | ||
+ | } | ||
+ | return true; | ||
+ | case ' | ||
+ | if(!isset($title)) $title=$lang[' | ||
+ | $renderer-> | ||
+ | return true; | ||
+ | case ' | ||
+ | if(!isset($title)) $title=$lang[' | ||
+ | $renderer-> | ||
+ | return true; | ||
+ | case ' | ||
+ | if(!isset($title)) $title=$lang[' | ||
+ | $renderer-> | ||
+ | return true; | ||
+ | case ' | ||
+ | if(!isset($title)) $title=$lang[' | ||
+ | $renderer-> | ||
+ | return true; | ||
+ | case ' | ||
+ | if ($ID = tpl_getparent($ID)) { | ||
+ | if(!isset($title)) $title=$lang[' | ||
+ | $renderer-> | ||
+ | return true; | ||
+ | } | ||
+ | return false; | ||
+ | case ' | ||
+ | if($conf[' | ||
+ | if($_SERVER[' | ||
+ | if(!isset($title)) $title=$lang[' | ||
+ | $renderer-> | ||
+ | }else{ | ||
+ | if(!isset($title)) $title=$lang[' | ||
+ | $renderer-> | ||
+ | } | ||
+ | return true; | ||
+ | } | ||
+ | return false; | ||
+ | case ' | ||
+ | if($INFO[' | ||
+ | if(!isset($title)) $title=$lang[' | ||
+ | $renderer-> | ||
+ | return true; | ||
+ | } | ||
+ | return false; | ||
+ | case ' | ||
+ | if(!isset($title)) $title=$lang[' | ||
+ | $renderer-> | ||
+ | return true; | ||
+ | case ' | ||
+ | if(!isset($title)) $title=$lang[' | ||
+ | $renderer-> | ||
+ | return true; | ||
+ | case ' | ||
+ | if(!isset($title)) $title=$lang[' | ||
+ | $renderer-> | ||
+ | return true; | ||
+ | case ' | ||
+ | if(!isset($title)) $title=$lang[' | ||
+ | $renderer-> | ||
+ | return true; | ||
+ | case ' | ||
+ | if(!isset($title)) $title=$lang[' | ||
+ | $renderer-> | ||
+ | return true; | ||
+ | case ' | ||
+ | if(!isset($title)) $title=$lang[' | ||
+ | $renderer-> | ||
+ | return true; | ||
+ | case ' | ||
+ | if(!isset($title)) $title=$lang[' | ||
+ | $renderer-> | ||
+ | return true; | ||
+ | case ' | ||
+ | if(!isset($title)) $title=$lang[' | ||
+ | $renderer-> | ||
+ | return true; | ||
default: | default: | ||
if(!isset($title)) $title=''; | if(!isset($title)) $title=''; | ||
Line 299: | Line 506: | ||
===== use NOCACHE ===== | ===== use NOCACHE ===== | ||
- | When builing | + | When building |
\\ | \\ | ||
%%~~NOCACHE~~%%\\ | %%~~NOCACHE~~%%\\ |
plugin/actionlink.1293019621.txt.gz · Last modified: 2010-12-22 13:07 by 82.140.120.164