Wiki Plume Community : UsabilityMenu

HomePage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register
By Gérard Mendes



function pxPrimaryCategories($s = '<ul>%s</ul>')
{
global $_PX_website_config, $_PX_config;
$ordermanual = $GLOBALS['_PX_render']['m']->getParam('order_cat_manual');
$remove_numbers = $GLOBALS['_PX_render']['m']->getParam('remove_numbers');
$order = 'ORDER BY category_path';
if ($ordermanual) {
$order = 'ORDER BY category_name';
}
$rootcat = $GLOBALS['_PX_render']['m']->getCategory('/');
$prim = $GLOBALS['_PX_render']['m']->getCategories($rootcat->f('category_id'), $order);
$isFirst = true;

$cats = '';
while (!$prim->EOF()) {
//if ($prim->f('category_path') != '/') {
$cat ='<li class="';
$name = $prim->f('category_name');
if ($remove_numbers) {
$name = px_removeNumbers($name);
}
$path = $_PX_website_config['rel_url'];
if ($_PX_config['url_format'] == 'simple') {
$path .= '/?';
}
if ($GLOBALS['_PX_render']['m']->cat != NULL)
$isCurrent = $prim->f('category_path') == $GLOBALS['_PX_render']['m']->cat->f('category_path');
else
$isCurrent = false;
$path .= $prim->f('category_path');
$cat .= $isCurrent ? 'current ' : '';
$cat .= $isFirst ? 'first' : '';
$cat .= '">';
$cat .= (($isCurrent && $GLOBALS['_PX_render']['mode'] != 'cat') || !$isCurrent) ? '<a href="'.$path.'">'.$name.'</a>' : $name;
$cats .= $cat.'</li>';
//}
$prim->moveNext();
$isFirst = false;
}
echo sprintf($s, $cats);
} 
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.1
Page was generated in 0.1770 seconds