diff --git a/e107_plugins/tagcloud/tagcloud_menu.php b/e107_plugins/tagcloud/tagcloud_menu.php index f66180fd2..4d4b8e7ca 100644 --- a/e107_plugins/tagcloud/tagcloud_menu.php +++ b/e107_plugins/tagcloud/tagcloud_menu.php @@ -1,3 +1,4 @@ + template = e107::getTemplate('tagcloud','tagcloud_menu','default'); + } function render($parm=null) { - - $cloud = new TagCloud(); + + $cloud = new TagCloud(); $sql = e107::getDb(); e107::getCache()->setMD5(e_LANGUAGE); @@ -65,7 +69,17 @@ class tagcloud_menu $cloud->setHtmlizeTagFunction( function($tag, $size) { - return "".$tag['tag']." "; + $tp = e107::getParser(); + $var = array('TAG_URL' => $tag['url'], + 'TAG_SIZE' => $size, + 'TAG_NAME' => $tag['tag'], + 'TAG_COUNT' => $tag['size'], + ); + + $text = $tp->simpleParse($this->template['item'], $var); + //$text = "".$tag['tag']." "; + + return $text; }); $cloud->setOrder('size','DESC'); @@ -78,7 +92,7 @@ class tagcloud_menu e107::getCache()->set('tagcloud', $text, true); - $text .= "
"; + //$text .= "
"; moved to $template['default']['end'] return $text; @@ -88,7 +102,7 @@ class tagcloud_menu } - +/* TODO: add template type as parm, now always default */ $tag = new tagcloud_menu; $text = $tag->render($parm); @@ -106,9 +120,14 @@ else $caption = LAN_PLUGIN_TAGCLOUD_NAME; } +$var = array('TAGCLOUD_MENU_CAPTION' => $caption); - -e107::getRender()->tablerender($caption, "
".$text."
", 'tagcloud_menu'); +$caption = e107::getParser()->simpleParse($tag->template['caption'], $var); + +$start = $tag->template['start']; +$end = $tag->template['end']; + +e107::getRender()->tablerender($caption, $start.$text.$end, 'tagcloud_menu'); diff --git a/e107_plugins/tagcloud/templates/tagcloud_menu_template.php b/e107_plugins/tagcloud/templates/tagcloud_menu_template.php new file mode 100644 index 000000000..735cd5320 --- /dev/null +++ b/e107_plugins/tagcloud/templates/tagcloud_menu_template.php @@ -0,0 +1,14 @@ +'; +$TAGCLOUD_MENU_TEMPLATE['default']['item'] = "{TAG_NAME}"; +$TAGCLOUD_MENU_TEMPLATE['default']['end'] = '
'; + + /* example for the same size tag +$TAGCLOUD_MENU_TEMPLATE['default']['caption'] = '{TAGCLOUD_MENU_CAPTION}'; +$TAGCLOUD_MENU_TEMPLATE['default']['start'] = '
'; +$TAGCLOUD_MENU_TEMPLATE['default']['item'] = '{TAG_NAME} ({TAG_COUNT})'; +$TAGCLOUD_MENU_TEMPLATE['default']['end'] = '
'; + */ \ No newline at end of file