plugin:condition
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:condition [2015-08-26 20:35] – old revision restored (2015-05-27 22:25) rnck | plugin:condition [2022-10-02 17:47] (current) – [condition Plugin] thalueng | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== condition | + | ====== condition |
---- plugin ---- | ---- plugin ---- | ||
- | description: | + | description: |
author | author | ||
email : etienne.meleard@free.fr | email : etienne.meleard@free.fr | ||
type : Syntax | type : Syntax | ||
- | lastupdate : 2014-01-22 | + | lastupdate : 2017-11-30 |
compatible : | compatible : | ||
depends | depends | ||
conflicts | conflicts | ||
- | similar | + | similar |
tags : condition if syntax | tags : condition if syntax | ||
securitywarning: | securitywarning: | ||
- | downloadurl: | + | downloadurl: |
bugtracker : https:// | bugtracker : https:// | ||
sourcerepo : https:// | sourcerepo : https:// | ||
donationurl: | donationurl: | ||
---- | ---- | ||
+ | |||
+ | :!: Replace curly brackets string indices with square brackets in line 84 and 149 of '' | ||
+ | |||
===== Description ===== | ===== Description ===== | ||
- | The Syntax | + | The Syntax Plugin allows to parse a content only if a specific condition (or multiple condition) is fulfilled. Some basic tests are provided and users can add new tests just by implementing a file in the template directory. |
===== Syntax ===== | ===== Syntax ===== | ||
Line 31: | Line 34: | ||
</ | </ | ||
- | '' | + | '' |
'' | '' | ||
Line 43: | Line 46: | ||
- '' | - '' | ||
- | '' | + | '' |
- | * '' | + | * '' |
- | * '' | + | * '' |
* ... | * ... | ||
(browse base_tester.php for test_* methods for more information) | (browse base_tester.php for test_* methods for more information) | ||
- | '' | + | '' |
- | DokuWiki code can contain DokuWiki syntax but be careful with high-level syntax (containers, | + | DokuWiki code can contain DokuWiki syntax but be careful with high-level syntax (containers, |
- | bug reports are welcome ... | + | |
- | **It is now sure that using the plugin inside a table cell won't work, working on it now, any help is welcome ...** | + | **It is now sure that using the plugin inside a table cell won't work, working on it now, any help is welcome...** |
- | Example : | + | Example: |
< | < | ||
<if user>You are **connected**< | <if user>You are **connected**< | ||
Line 68: | Line 70: | ||
===== Download and Installation ===== | ===== Download and Installation ===== | ||
- | Download | + | Search |
* Latest Version: [[https:// | * Latest Version: [[https:// | ||
* Old Version: [[http:// | * Old Version: [[http:// | ||
- | |||
===== Sources ===== | ===== Sources ===== | ||
Line 80: | Line 81: | ||
==== syntax.php ==== | ==== syntax.php ==== | ||
- | <code php> | + | <file php syntax.php> |
<?php | <?php | ||
/** | /** | ||
Line 425: | Line 426: | ||
} //class | } //class | ||
?> | ?> | ||
- | </code> | + | </file> |
==== base_tester.php ==== | ==== base_tester.php ==== | ||
- | <code php> | + | <file php base_tester.php> |
<?php | <?php | ||
/* | /* | ||
Line 722: | Line 723: | ||
} | } | ||
?> | ?> | ||
- | </code> | + | </file> |
- | ==== How can I implement some other tests ? ==== | + | ==== How can I implement some other tests? ==== |
- | You must create the // | + | You must create the // |
<code php> | <code php> | ||
Line 737: | Line 738: | ||
</ | </ | ||
- | To add the test with the key " | + | To add the test with the key " |
<code php> | <code php> | ||
Line 758: | Line 759: | ||
</ | </ | ||
- | So that test can be used as : | + | So that test can be used as: |
< | < | ||
<if foo=bar> | <if foo=bar> | ||
Line 766: | Line 767: | ||
</ | </ | ||
- | If your test don't take a parameter you can define it as follows : | + | If your test don't take a parameter you can define it as follows: |
<code php> | <code php> | ||
Line 776: | Line 777: | ||
</ | </ | ||
- | This test is valid if " | + | This test is valid if " |
< | < | ||
<if foo>Page is under " | <if foo>Page is under " | ||
Line 783: | Line 784: | ||
==== TODO ==== | ==== TODO ==== | ||
- | * Allow multiple user custom test files (plugin style) ? | + | * Allow multiple user custom test files (plugin style)? |
* Ensure this works well with top-level containers | * Ensure this works well with top-level containers | ||
- | * clean-up and simplify code (mainly reduce calls to preg_replace/ | + | * clean-up and simplify code (mainly reduce calls to preg_replace/ |
- | ===== Discussion ===== | + | |
- | + | ||
- | ~~DISCUSSION~~ | + | |
==== While discussion isn't working ==== | ==== While discussion isn't working ==== | ||
Line 828: | Line 826: | ||
// | // | ||
- | |||
- | |||
- | |||
plugin/condition.1440614139.txt.gz · Last modified: 2015-08-26 20:35 by rnck