From: <sy...@us...> - 2011-02-16 15:07:50
|
Revision: 32864 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=32864&view=rev Author: sylvieg Date: 2011-02-16 15:07:42 +0000 (Wed, 16 Feb 2011) Log Message: ----------- [NEW]categories: ass a param to have the categ linking to a page with its name Modified Paths: -------------- trunk/modules/mod-func-categories.php Modified: trunk/modules/mod-func-categories.php =================================================================== --- trunk/modules/mod-func-categories.php 2011-02-16 14:40:05 UTC (rev 32863) +++ trunk/modules/mod-func-categories.php 2011-02-16 15:07:42 UTC (rev 32864) @@ -43,6 +43,11 @@ 'description' => tra('Show only these categories and the immediate child categories of these. Example values: 3,5,6.'), 'filter' => 'striptags' ), + 'selflink' => array( + 'name' => tra('Category links to a page named as the category'), + 'description' => 'y|n .'.tra('If y, category links to a page named as the category'), + 'filter' => 'alpha' + ), ), ); } @@ -99,10 +104,16 @@ include_once ('lib/tree/categ_browse_tree.php'); $tree_nodes = array(); foreach ($categories as $cat) { + if (isset($module_params['selflink']) && $module_params['selflink'] == 'y') { + include_once('tiki-sefurl.php'); + $url = filter_out_sefurl('tiki-index.php?page='.$cat['name'], $smarty); + } else { + $url = 'tiki-browse_categories.php?parentId=' . $cat['categId'] .$urlEnd; + } $tree_nodes[] = array( "id" => $cat["categId"], "parent" => $cat["parentId"], - "data" => '<a class="catname" href="tiki-browse_categories.php?parentId=' . $cat["categId"] .$urlEnd.'">' . $cat["name"] . '</a><br />' + "data" => '<a class="catname" href="'.$url.'">' . $cat['name'] . '</a><br />' ); } $tm = new CatBrowseTreeMaker("mod_categ"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |