plugin:condition
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:condition [2014-06-22 19:00] – Aleksandr | 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: | ||
- | downloadurl: | + | downloadurl: |
- | bugtracker : | + | bugtracker : https:// |
sourcerepo : https:// | sourcerepo : https:// | ||
donationurl: | donationurl: | ||
---- | ---- | ||
- | ===== Description ===== | ||
- | The Syntax [[plugins|Plugin]] allows to parse a content only if a specific | + | :!: Replace curly brackets string indices with square brackets in line 84 and 149 of '' |
+ | |||
+ | ===== Description ===== | ||
- | __**Warning :**__ //This plugin must not be considered as a way to securely hide data from users since a hit on the "show source" | + | The Syntax Plugin allows |
===== Syntax ===== | ===== Syntax ===== | ||
Line 32: | Line 34: | ||
</ | </ | ||
- | '' | + | '' |
'' | '' | ||
Line 44: | 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 69: | 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 81: | Line 81: | ||
==== syntax.php ==== | ==== syntax.php ==== | ||
- | <code php> | + | <file php syntax.php> |
<?php | <?php | ||
/** | /** | ||
Line 140: | Line 140: | ||
// Handle the match | // Handle the match | ||
- | function handle($match, | + | function handle($match, |
if($state != DOKU_LEXER_UNMATCHED) return false; | if($state != DOKU_LEXER_UNMATCHED) return false; | ||
Line 278: | Line 278: | ||
* Create output | * Create output | ||
*/ | */ | ||
- | function render($mode, | + | function render($mode, |
global $INFO; | global $INFO; | ||
if(count($data) != 2) return false; | if(count($data) != 2) return false; | ||
Line 426: | Line 426: | ||
} //class | } //class | ||
?> | ?> | ||
- | </code> | + | </file> |
==== base_tester.php ==== | ==== base_tester.php ==== | ||
- | <code php> | + | <file php base_tester.php> |
<?php | <?php | ||
/* | /* | ||
Line 723: | 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 738: | Line 738: | ||
</ | </ | ||
- | To add the test with the key " | + | To add the test with the key " |
<code php> | <code php> | ||
Line 759: | Line 759: | ||
</ | </ | ||
- | So that test can be used as : | + | So that test can be used as: |
< | < | ||
<if foo=bar> | <if foo=bar> | ||
Line 767: | 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 777: | Line 777: | ||
</ | </ | ||
- | This test is valid if " | + | This test is valid if " |
< | < | ||
<if foo>Page is under " | <if foo>Page is under " | ||
Line 784: | 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 822: | Line 819: | ||
// | // | ||
- | :!: I have the same error, but this code doesn´t solve the problem. If I use the condition-plugin some where in the page all headings get lost for the TOC up to the line where you use the condition plugin. The next heading is used as first heading. If no heading is left, filename is used. // | + | :!: I have the same error, but this code doesn´t solve the problem. If I use the condition-plugin some where in the page all headings get lost for the TOC up to the line where you use the condition plugin. The next heading is used as first heading. If no heading is left, filename is used. |
+ | |||
+ | // | ||
+ | |||
+ | :!: The plugin **does not** work with my installation. I traced the [[https:// | ||
+ | // | ||
plugin/condition.1403456430.txt.gz · Last modified: 2014-06-22 19:00 by Aleksandr