public static function getList($category = '<h3>%s</h3>', $block = '<ul class="menu">%s</ul>', $item = '<li>%s</li>') { require_once dirname(__FILE__) . '/class.dc.blogmenu.php'; $menu = new dcBlogMenu($GLOBALS['core']->blog); try { $links = $menu->getLinks(); } catch (Exception $e) { return false; } $res = ''; foreach ($menu->getLinksHierarchy($links) as $k => $v) { if ($k != '') { $res .= sprintf($category, html::escapeHTML($k)) . "\n"; } $res .= self::getLinksList($v, $block, $item); } return $res; }
foreach ($_POST['levels'] as $k => $v) { try { $menu->updateLevel($k, $v); } catch (Exception $e) { $core->error->add($e->getMessage()); break; } } } if (!$core->error->flag()) { http::redirect($p_url . '&newconfig=1'); } } # Get links try { $rs = $menu->getLinks(); } catch (Exception $e) { $core->error->add($e->getMessage()); } ?> <html> <head> <title><?php echo $page_title; ?> </title> <?php echo dcPage::jsToolMan(); ?> <?php echo dcPage::jsConfirmClose('links-form', 'add-link-form');
public static function getList($block = '<ul>%s</ul>', $item = '<li>%s</li>', $level = 1, $style_theme = array()) { $params['level'] = $level; $params['desc'] = true; $menu = new dcBlogMenu($GLOBALS['core']->blog); try { $links = $menu->getLinks($params); } catch (Exception $e) { return false; } return self::getLinksList($links, $block, $item, $style_theme); }