default_options = & $default_options; // init $this->options = $default_options; global $plugin_tag_name; $this->plugin_tag = new $plugin_tag_name(); } function PluginTaglist() { $this->__construct(); } var $plugin_tag; var $default_options; var $options; var $plugin = 'taglist'; function action() // taglist { global $vars; if (isset($vars['tag'])) { $this->options['tag'] = $vars['tag']; $msg = htmlsc($this->options['tag']); } elseif (isset($vars['related'])) { $this->options['related'] = $vars['related']; $msg = htmlsc($this->options['related']); } else { $msg = _('Taglist'); } $body = $this->taglist($this->options['tag'], $this->options['related']); return array('msg'=>$msg, 'body'=>$body); } function convert() // taglist { $args = func_get_args(); ///// Support old versions (The 1st arg is tagtok) /// $fisrtIsOption = FALSE; foreach ($this->options as $key => $val) { if (strpos($args[0], $key) === 0) { $firstIsOption = TRUE; break; } } if (func_num_args() >= 1 && ! $firstIsOption) { $this->options['tag'] = array_shift($args); } ////////////////////////////////////////////////////// parse_options($args, $this->options); return $this->taglist($this->options['tag'], $this->options['related']); } /** * Body Function of this plugin */ function taglist($tagtok = '', $relate_tag = NULL) { if ($tagtok !== '') { $pages = $this->plugin_tag->get_taggedpages($tagtok); $html = $this->display_pagelist($pages); } else { $html = $this->display_tagpagelist($relate_tag); } return $html; } /** * Display tags and tagged pages * * Future Work: Use a common function with lsx.inc.php * * @param array $relate_tag Show only related tags of this * @return string HTML */ function display_tagpagelist($relate_tag = NULL, $cssclass = 'taglist tags') { $tagcloud = $this->plugin_tag->get_tagcloud(NULL, $relate_tag); $html = '