From: <rob...@us...> - 2012-07-17 13:09:11
|
Revision: 42398 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=42398&view=rev Author: robertplummer Date: 2012-07-17 13:09:00 +0000 (Tue, 17 Jul 2012) Log Message: ----------- [ENH] to public and private where possible [FIX] check if np is true vs false, where both are set Modified Paths: -------------- trunk/lib/core/WikiPlugin/ConditionBase.php trunk/lib/core/WikiPlugin/HtmlBase.php trunk/lib/core/WikiPlugin/expandingoutline.php trunk/lib/core/WikiPlugin/maketoc.php trunk/lib/core/WikiPlugin/oohtml.php Modified: trunk/lib/core/WikiPlugin/ConditionBase.php =================================================================== --- trunk/lib/core/WikiPlugin/ConditionBase.php 2012-07-17 10:38:28 UTC (rev 42397) +++ trunk/lib/core/WikiPlugin/ConditionBase.php 2012-07-17 13:09:00 UTC (rev 42398) @@ -7,22 +7,22 @@ abstract class WikiPlugin_ConditionBase { - var $name; - var $type; - var $documentation; - var $description; - var $format; - var $prefs; - var $body; - var $validate; - var $filter = 'rawhtml_unsafe'; - var $icon = 'img/icons/mime/html.png'; - var $tags = array( 'basic' ); - var $params = array( + public static $name; + public static $description; + public static $body; + public static $params = array(); - ); + public $type; + public $documentation; + public $prefs = array(); + public $parserLevel = 0; - var $np = true; + private $format; + private $validate; + private $filter = 'rawhtml_unsafe'; + private $icon = 'img/icons/mime/html.png'; + private $tags = array( 'basic' ); + private $np = true; public function info() { @@ -57,7 +57,7 @@ $data = str_replace('<x>', '', $data); $data = $this->output($data, $params, $index, $parser); - if ($this->np) { + if ($this->np == true) { return '~np~'.$data.'~/np~'; } else { return $data; Modified: trunk/lib/core/WikiPlugin/HtmlBase.php =================================================================== --- trunk/lib/core/WikiPlugin/HtmlBase.php 2012-07-17 10:38:28 UTC (rev 42397) +++ trunk/lib/core/WikiPlugin/HtmlBase.php 2012-07-17 13:09:00 UTC (rev 42398) @@ -7,25 +7,25 @@ abstract class WikiPlugin_HtmlBase { - var $name; - var $type; - var $documentation; - var $description; - var $format; - var $prefs = array(); - var $body; - var $validate; - var $filter = 'rawhtml_unsafe'; - var $icon = 'img/icons/mime/html.png'; - var $tags = array( 'basic' ); - var $params = array(); - var $htmlTagType = 'div'; - var $hasHtmlBody = true; - var $htmlAttributes = array(); + public static $name; + public static $description; + public static $body; + public static $params = array(); - var $np = true; + public $type; + public $documentation; + public $prefs = array(); + public $parserLevel = 0; - var $parserLevel = 0; + private $format; + private $validate; + private $filter = 'rawhtml_unsafe'; + private $icon = 'img/icons/mime/html.png'; + private $tags = array( 'basic' ); + private $htmlTagType = 'div'; + private $hasHtmlBody = true; + private $htmlAttributes = array(); + private $np = true; static $style = array( '@keyframes' => array('filter' => 'text', 'default' => ''), @@ -347,7 +347,7 @@ $output .= ' />'; } - if ($this->np) { + if ($this->np == true) { return '~np~'.$output.'~/np~'; } else { return $output; Modified: trunk/lib/core/WikiPlugin/expandingoutline.php =================================================================== --- trunk/lib/core/WikiPlugin/expandingoutline.php 2012-07-17 10:38:28 UTC (rev 42397) +++ trunk/lib/core/WikiPlugin/expandingoutline.php 2012-07-17 13:09:00 UTC (rev 42398) @@ -7,22 +7,23 @@ class WikiPlugin_expandingoutline extends WikiPlugin_HtmlBase { - var $type = 'outline'; - var $validate = 'all'; - var $prefs = array('wikiplugin_outline'); - var $filter = 'rawhtml_unsafe'; - var $icon = 'img/icons/mime/html.png'; - var $tags = array( 'basic' ); + public $type = 'expandingoutline'; + public $documentation = 'PluginExpandingOutline'; + public $prefs = array('wikiplugin_expandingoutline'); + private $validate = 'all'; + private $filter = 'rawhtml_unsafe'; + private $icon = 'img/icons/mime/html.png'; + private $tags = array( 'basic' ); + function __construct() { - $this->name = tra('Outline'); - $this->documentation = 'PluginOutline'; - $this->description = tra('Turns wiki syntax or html of list items into an expandable outline'); - $this->body = tra('HTML code'); - $this->params = array( - - ); + if (empty(self::$name)) { + self::$name = tra('Expanding Outline'); + self::$description = tra('Turns wiki syntax or html of list items into an expandable outline'); + self::$body = tra('HTML code'); + self::$params = array(); + } } function output(&$data, &$params, &$index, &$parser) Modified: trunk/lib/core/WikiPlugin/maketoc.php =================================================================== --- trunk/lib/core/WikiPlugin/maketoc.php 2012-07-17 10:38:28 UTC (rev 42397) +++ trunk/lib/core/WikiPlugin/maketoc.php 2012-07-17 13:09:00 UTC (rev 42398) @@ -7,27 +7,30 @@ class WikiPlugin_maketoc extends WikiPlugin_HtmlBase { - var $type = 'toc'; - var $validate; - var $filter = 'rawhtml_unsafe'; - var $icon = 'img/icons/text_list_numbers.png'; - var $tags = array( 'basic' ); - var $parserLevel = 1; //0 is standard, we put this after the others + public $type = 'toc'; + public $documentation = 'PluginMaketoc'; + private $validate; + private $filter = 'rawhtml_unsafe'; + private $icon = 'img/icons/text_list_numbers.png'; + private $tags = array( 'basic' ); + private $parserLevel = 1; //0 is standard, we put this after the others + function __construct() { - $this->name = tr('Table of contents for a page'); - $this->documentation = 'PluginMaketoc'; - $this->description = tr('Add a table of contents to a page'); - $this->params = array( - 'type', - 'maxdepth', - 'title', - 'showhide', - 'nolinks', - 'nums', - 'levels' - ); + if (empty(self::$name)) { + self::$name = tr('Table of contents for a page'); + self::$description = tr('Add a table of contents to a page'); + self::$params = array( + 'type', + 'maxdepth', + 'title', + 'showhide', + 'nolinks', + 'nums', + 'levels' + ); + } } function output(&$data, &$params, &$index, &$parser) Modified: trunk/lib/core/WikiPlugin/oohtml.php =================================================================== --- trunk/lib/core/WikiPlugin/oohtml.php 2012-07-17 10:38:28 UTC (rev 42397) +++ trunk/lib/core/WikiPlugin/oohtml.php 2012-07-17 13:09:00 UTC (rev 42398) @@ -7,33 +7,36 @@ class WikiPlugin_oohtml extends WikiPlugin_HtmlBase { - var $type = 'oohtml'; - var $validate = 'all'; - var $prefs = array('wikiplugin_html'); - var $filter = 'rawhtml_unsafe'; - var $icon = 'img/icons/mime/html.png'; - var $tags = array( 'basic' ); + public $type = 'oohtml'; + public $documentation = 'PluginHTML'; + public $prefs = array('wikiplugin_html'); + private $validate = 'all'; + private $filter = 'rawhtml_unsafe'; + private $icon = 'img/icons/mime/html.png'; + private $tags = array( 'basic' ); + function __construct() { - $this->name = tra('Object oriented version of the html wiki plugin'); - $this->documentation = 'PluginHTML'; - $this->description = tra('Add HTML to a page'); - $this->body = tra('HTML code'); - $this->params = array( - 'wiki' => array( - 'required' => false, - 'name' => tra('Wiki Syntax'), - 'description' => tra('Parse wiki syntax within the HTML code.'), - 'options' => array( - array('text' => '', 'value' => ''), - array('text' => tra('No'), 'value' => 0), - array('text' => tra('Yes'), 'value' => 1), + if (empty(self::$name)) { + self::$name = tra('Object oriented version of the html wiki plugin'); + self::$description = tra('Add HTML to a page'); + self::$body = tra('HTML code'); + self::$params = array( + 'wiki' => array( + 'required' => false, + 'name' => tra('Wiki Syntax'), + 'description' => tra('Parse wiki syntax within the HTML code.'), + 'options' => array( + array('text' => '', 'value' => ''), + array('text' => tra('No'), 'value' => 0), + array('text' => tra('Yes'), 'value' => 1), + ), + 'filter' => 'int', + 'default' => '0', ), - 'filter' => 'int', - 'default' => '0', - ), - ); + ); + } } function output(&$data, &$params, &$index, &$parser) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |