Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
        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');
Exemplo n.º 3
0
 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);
 }