summaryrefslogtreecommitdiff
path: root/lib/plugins/extension/helper/extension.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2013-08-09 13:43:35 +0200
committerAndreas Gohr <andi@splitbrain.org>2013-08-09 13:43:35 +0200
commit55332151e03b99bbfd15e0fbaae391aae454d9eb (patch)
tree0b7696bcd85525f95b46adc709ef2b95ab0bc6c8 /lib/plugins/extension/helper/extension.php
parente8dda2c3faf5eb61b68d5afcbea13c5802484b4a (diff)
downloadrpg-55332151e03b99bbfd15e0fbaae391aae454d9eb.tar.gz
rpg-55332151e03b99bbfd15e0fbaae391aae454d9eb.tar.bz2
some initial go at the search tab
Diffstat (limited to 'lib/plugins/extension/helper/extension.php')
-rw-r--r--lib/plugins/extension/helper/extension.php29
1 files changed, 23 insertions, 6 deletions
diff --git a/lib/plugins/extension/helper/extension.php b/lib/plugins/extension/helper/extension.php
index 296b81ac5..53753fcc1 100644
--- a/lib/plugins/extension/helper/extension.php
+++ b/lib/plugins/extension/helper/extension.php
@@ -14,8 +14,9 @@ if(!defined('DOKU_TPLLIB')) define('DOKU_TPLLIB', DOKU_INC.'lib/tpl/');
* Class helper_plugin_extension_extension represents a single extension (plugin or template)
*/
class helper_plugin_extension_extension extends DokuWiki_Plugin {
+ private $id;
private $name;
- private $is_template;
+ private $is_template = false;
private $localInfo;
private $remoteInfo;
private $managerData;
@@ -32,13 +33,18 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin {
/**
* Set the name of the extension this instance shall represents, triggers loading the local and remote data
*
- * @param string $name The base name of the extension
- * @param bool $is_template If the extension is a template
+ * @param string $id The id of the extension (prefixed with template: for templates)
* @return bool If some (local or remote) data was found
*/
- public function setExtension($name, $is_template) {
- $this->name = $name;
- $this->is_template = $is_template;
+ public function setExtension($id) {
+ $this->id = $id;
+ $this->name = $id;
+
+ if(substr($id, 0 , 9) == 'template'){
+ $this->name = substr($id, 10);
+ $this->is_template = true;
+ }
+
$this->localInfo = array();
$this->managerData = array();
$this->remoteInfo = array();
@@ -129,6 +135,17 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin {
}
/**
+ * Get the ID of the extension
+ *
+ * This is the same as getName() for plugins, for templates it's getName() prefixed with 'template:'
+ *
+ * @return string
+ */
+ public function getID() {
+ return $this->id;
+ }
+
+ /**
* Get the name of the installation directory
*
* @return string The name of the installation directory