예제 #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;
 }
예제 #2
0
파일: index.php 프로젝트: HackerMajor/root
#
# DotClear is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with DotClear; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# ***** END LICENSE BLOCK *****
if (!defined('DC_CONTEXT_ADMIN')) {
    exit;
}
require dirname(__FILE__) . '/class.dc.blogmenu.php';
$menu = new dcBlogMenu($core->blog);
if (!empty($_REQUEST['edit']) && !empty($_REQUEST['id'])) {
    include dirname(__FILE__) . '/edit.php';
    return;
}
$default_tab = '';
$link_title = $link_href = $link_desc = $link_lang = '';
$cat_title = '';
# Add link
if (!empty($_POST['add_link'])) {
    $link_title = $_POST['link_title'];
    $link_href = $_POST['link_href'];
    $link_desc = $_POST['link_desc'];
    $link_lang = $_POST['link_lang'];
    try {
        $menu->addLink($link_title, $link_href, $link_desc, $link_lang);
예제 #3
0
파일: index.php 프로젝트: mrbidon/menu
<?php

# -- BEGIN LICENSE BLOCK ----------------------------------
# This file is part of Menu, a plugin for Dotclear 2.
#
# Copyright (c) 2009-2015 Benoît Grelier and contributors
# Licensed under the GPL version 2.0 license.
# See LICENSE file or
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
if (!defined('DC_CONTEXT_ADMIN')) {
    return;
}
require dirname(__FILE__) . '/class.dc.blogmenu.php';
$menu = new dcBlogMenu($core->blog);
$page_title = __('Menu');
if (!empty($_REQUEST['edit']) && !empty($_REQUEST['id'])) {
    include dirname(__FILE__) . '/edit.php';
    return;
}
$default_tab = 'menu';
$link_title = $link_href = $link_desc = $link_lang = $link_class = '';
$link_level = $link_auto = 0;
# Add link
if (!empty($_POST['add_link'])) {
    # auto link
    //	$links_auto_combo = array(
    //		'-' => '0',
    //	__('categories') => '1',
    //	__('tags') => '2',
예제 #4
0
파일: _public.php 프로젝트: mrbidon/menu
 public static function getLevels($params)
 {
     $menu = new dcBlogMenu($GLOBALS['core']->blog);
     try {
         $linkslevels = $menu->getLinksLevels($params);
     } catch (Exception $e) {
         return false;
     }
     return $linkslevels;
 }