Esempio n. 1
0
function navigation_shortcode($parm = '')
{
    $types = array('main' => 1, 'side' => 2, 'footer' => 3, 'alt' => 4, 'alt5' => 5, 'alt6' => 6);
    $category = varset($types[$parm], 1);
    $tmpl = vartrue($parm, 'main');
    $nav = e107::getNav();
    $template = e107::getCoreTemplate('navigation', $tmpl);
    $data = $nav->initData($category);
    //	$data 			= $nav->collection($category);
    return $nav->render($data, $template);
}
Esempio n. 2
0
/**
 * Display admin menu
 *
 * @return string menu
 */
function admin_list_config_adminmenu()
{
    $act = "";
    unset($var);
    $var = array();
    //$var['general']['text'] = LIST_ADMIN_OPT_1;
    $var['list-new-recent-page']['text'] = LIST_ADMIN_OPT_2;
    $var['list-new-recent-menu']['text'] = LIST_ADMIN_OPT_3;
    $var['list-new-new-page']['text'] = LIST_ADMIN_OPT_4;
    $var['list-new-new-menu']['text'] = LIST_ADMIN_OPT_5;
    e107::getNav()->admin(LIST_ADMIN_OPT_6 . '--id--list_new', 'list-new-recent-page', $var);
}
Esempio n. 3
0
 /**
  * Page Navigation
  * @example {PAGE_NAVIGATION: template=navdoc&auto=1} in your Theme template. 
  */
 function sc_page_navigation($parm = '')
 {
     //	$parm = eHelper::scParams($parm);
     $tmpl = e107::getCoreTemplate('chapter', vartrue($parm['template'], 'nav'), true, true);
     // always merge
     $template = $tmpl['showPage'];
     $request = $this->request;
     if ($request && is_array($request)) {
         switch ($request['action']) {
             case 'listBooks':
                 $parm['cbook'] = 'all';
                 $template = $tmpl['listBooks'];
                 if (e107::getPref('listBooks', false) == false) {
                     return false;
                 }
                 break;
             case 'listChapters':
                 $parm['cbook'] = $request['id'];
                 $template = $tmpl['listChapters'];
                 break;
             case 'listPages':
                 $parm['cchapter'] = $request['id'];
                 $template = $tmpl['listPages'];
                 break;
             case 'showPage':
                 $parm['cpage'] = $request['id'];
                 break;
         }
     }
     if ($parm) {
         $parm = http_build_query($parm, null, '&');
     } else {
         $parm = '';
     }
     $links = e107::getAddon('page', 'e_sitelink');
     $data = $links->pageNav($parm);
     if (isset($data['title']) && !vartrue($template['noAutoTitle'])) {
         // use chapter title
         $template['caption'] = $data['title'];
         $data = $data['body'];
     }
     if (empty($data)) {
         return;
     }
     return e107::getNav()->render($data, $template);
 }
Esempio n. 4
0
function db_adminmenu()
{
    global $st;
    foreach ($st->_options as $key => $val) {
        $var[$key]['text'] = $val['label'];
        $var[$key]['link'] = e_SELF . "?mode=" . $key;
    }
    e107::getNav()->admin(DBLAN_10, $_GET['mode'], $var);
}
Esempio n. 5
0
function admin_content_config_adminmenu()
{
    global $pref;
    if (!isset($pref['plug_installed']['content'])) {
        return '';
    }
    global $sql, $plugintable, $aa;
    //toggle to show categories in admin right hand menu
    $showadmincat = TRUE;
    if (e_QUERY) {
        $qs = explode(".", e_QUERY);
    }
    if (isset($qs[0]) && $qs[0] == "cat" && isset($qs[1]) && $qs[1] == "create") {
        $act = $qs[0] . "." . $qs[1];
    } elseif (isset($qs[0]) && $qs[0] == "content" && isset($qs[1]) && $qs[1] == "create") {
        $act = $qs[0] . "." . $qs[1];
    } else {
        $act = isset($qs[0]) ? $qs[0] : "";
    }
    if ($act == "") {
        $act = "content";
    }
    $var['content']['text'] = CONTENT_ADMIN_MENU_LAN_0;
    $var['content']['link'] = e_SELF;
    $var['content.create']['text'] = CONTENT_ADMIN_MENU_LAN_1;
    $var['content.create']['link'] = e_SELF . "?content.create";
    $var['cat']['text'] = CONTENT_ADMIN_MENU_LAN_2;
    $var['cat']['link'] = e_SELF . "?cat";
    $var['cat.create']['text'] = CONTENT_ADMIN_MENU_LAN_3;
    $var['cat.create']['link'] = e_SELF . "?cat.create";
    $var['order']['text'] = CONTENT_ADMIN_MENU_LAN_15;
    $var['order']['link'] = e_SELF . "?order";
    $var['option']['text'] = CONTENT_ADMIN_MENU_LAN_6;
    $var['option']['link'] = e_SELF . "?options";
    if (getperms("0")) {
        $var['manager']['text'] = CONTENT_ADMIN_MENU_LAN_17;
        $var['manager']['link'] = e_SELF . "?manager";
    }
    if ($submittedcontents = $sql->db_Count($plugintable, "(*)", "WHERE content_refer ='sa' ")) {
        $var['submitted']['text'] = CONTENT_ADMIN_MENU_LAN_4 . " (" . $submittedcontents . ")";
        $var['submitted']['link'] = e_SELF . "?submitted";
    }
    $mainmenuact = $act;
    $mainmenuvar = $var;
    /*  THIS IS ONLY WAY I FOUND TO BE ABLE USE SEPARATE MENUS WITH ITS OWN HASHES */
    $E_OPTIONS_MENU['start'] = '<ul id="admin-ui-nav-menu" class="plugin-navigation-options nav nav-list">';
    $E_OPTIONS_MENU['button'] = '<li><a class="link{LINK_CLASS}" href="{LINK_URL}"{ID}{ONCLICK}>&nbsp;{LINK_TEXT}</a>{SUB_MENU}</li>';
    $E_OPTIONS_MENU['button_active'] = '<li class="active"><a class="link-active{LINK_CLASS}" href="{LINK_URL}"{ID}{ONCLICK}>&nbsp;{LINK_TEXT}</a>{SUB_MENU}</li>';
    $E_OPTIONS_MENU['start_sub'] = '<ul class="plugin-navigation-sub{SUB_CLASS}"{SUB_ID}>';
    $E_OPTIONS_MENU['button_sub'] = '<li><a class="link" href="{LINK_URL}">&nbsp;{LINK_TEXT}</a>{SUB_MENU}</li>';
    $E_OPTIONS_MENU['button_active_sub'] = '<li><a class="link-active" href="{LINK_URL}">&nbsp;{LINK_TEXT}</a>{SUB_MENU}</li>';
    $E_OPTIONS_MENU['end_sub'] = '</ul>';
    $E_OPTIONS_MENU['end'] = '</ul>';
    $E_OPTIONS_MENU['divider'] = '<li role="separator" class="divider"></li>';
    $E_PAGES_MENU = $E_OPTIONS_MENU;
    $E_PAGES_MENU['start'] = '<ul id="admin-ui-nav-menu" class="plugin-navigation-pages nav nav-list">';
    if (isset($qs[0]) && $qs[0] == "options" && isset($qs[1])) {
        unset($var);
        $var = array();
        $act = "";
        $var['creation']['text'] = CONTENT_ADMIN_MENU_LAN_7;
        //$text_creation
        $var['catcreation']['text'] = CONTENT_ADMIN_MENU_LAN_23;
        //$text_catcreation
        $var['submission']['text'] = CONTENT_ADMIN_MENU_LAN_8;
        //$text_submission
        $var['paththeme']['text'] = CONTENT_ADMIN_MENU_LAN_9;
        //$text_paththeme
        $var['general']['text'] = CONTENT_ADMIN_MENU_LAN_10;
        //$text_general
        $var['menu']['text'] = CONTENT_ADMIN_MENU_LAN_14;
        //$text_menu
        $var['recentpages']['text'] = CONTENT_ADMIN_MENU_LAN_11;
        //$text_recentpages
        $var['catpages']['text'] = CONTENT_ADMIN_MENU_LAN_12;
        //$text_catpages
        $var['contentpages']['text'] = CONTENT_ADMIN_MENU_LAN_13;
        //$text_contentpages
        $var['authorpage']['text'] = CONTENT_ADMIN_MENU_LAN_18;
        //$text_authorpage
        $var['archivepage']['text'] = CONTENT_ADMIN_MENU_LAN_16;
        //$text_archivepage
        $var['toppage']['text'] = CONTENT_ADMIN_MENU_LAN_20;
        //$text_toppage
        $var['scorepage']['text'] = CONTENT_ADMIN_MENU_LAN_22;
        //$text_scorepage
        $sql = new db();
        $sql = e107::getDb();
        $content_heading = $sql->retrieve($plugintable, "content_heading", "content_id='" . $qs[1] . "' ");
        e107::getNav()->admin(CONTENT_ADMIN_MENU_LAN_6 . ": " . $content_heading . "", 'creation', $var, $E_OPTIONS_MENU);
    }
    show_admin_menu(CONTENT_ADMIN_MENU_LAN_6, $mainmenuact, $mainmenuvar);
    if ($showadmincat) {
        $sql2 = new db();
        if ($category_total = $sql2->db_Select($plugintable, "content_id, content_heading", "content_parent='0' ")) {
            while ($row = $sql2->db_Fetch()) {
                unset($var);
                $var = array();
                $array = $aa->getCategoryTree("", $row['content_id'], FALSE);
                //get all categories from each main parent
                $newarray = array_merge_recursive($array);
                $newparent = array();
                for ($a = 0; $a < count($newarray); $a++) {
                    for ($b = 0; $b < count($newarray[$a]); $b++) {
                        $newparent[$newarray[$a][$b]] = $newarray[$a][$b + 1];
                        $b++;
                    }
                }
                foreach ($newparent as $key => $value) {
                    $var['c' . $key]['text'] = $value;
                    $var['c' . $key]['link'] = e_SELF . "?content." . $key;
                }
                if (isset($qs[0]) && $qs[0] == "content" && isset($qs[1]) && $qs[1] == "create") {
                    $act = "";
                } elseif (isset($qs[0]) && $qs[0] == "cat" && isset($qs[1]) && ($qs[1] == "create" || $qs[1] == "edit")) {
                    $act = "";
                } elseif (isset($qs[0]) && $qs[0] == "order") {
                    $act = "";
                } elseif (isset($qs[0]) && $qs[0] == "manager") {
                    $act = "";
                } else {
                    if (isset($qs[0]) && isset($qs[1])) {
                        $act = "c" . $qs[1];
                    } else {
                        $act = "c";
                    }
                }
                show_admin_menu(CONTENT_ADMIN_MENU_LAN_5 . " : " . $row['content_heading'] . "", $act, $var);
            }
        }
    }
}
Esempio n. 6
0
File: admin.php Progetto: gitye/e107
function render_links($link, $title, $description, $perms, $icon = FALSE, $mode = FALSE)
{
    return e107::getNav()->renderAdminButton($link, $title, $description, $perms, $icon, $mode);
}
Esempio n. 7
0
 function show_admin_menu($title, $active_page, $e107_vars, $js = FALSE, $sub_link = FALSE, $sortlist = FALSE)
 {
     return e107::getNav()->admin($title, $active_page, $e107_vars, false, false, $sortlist);
 }
Esempio n. 8
0
 /**
  * Generic Admin Menu Generator
  * @return string
  */
 function renderMenu()
 {
     $tp = e107::getParser();
     $var = array();
     $selected = false;
     foreach ($this->adminMenu as $key => $val) {
         if (isset($val['perm']) && $val['perm'] !== '' && !getperms($val['perm'])) {
             continue;
         }
         $tmp = explode('/', trim($key, '/'), 3);
         // sync with mode/route access
         if (!$this->checkModeAccess($tmp[0]) || !$this->checkRouteAccess($tmp[0] . '/' . $tmp[1])) {
             continue;
         }
         // custom 'selected' check
         if (isset($val['selected']) && $val['selected']) {
             $selected = $val['selected'] === true ? $key : $val['selected'];
         }
         foreach ($val as $k => $v) {
             switch ($k) {
                 case 'caption':
                     $k2 = 'text';
                     $v = defset($v, $v);
                     break;
                 case 'url':
                     $k2 = 'link';
                     $v = $tp->replaceConstants($v, 'abs') . '?mode=' . $tmp[0] . '&amp;action=' . $tmp[1];
                     break;
                 case 'uri':
                     $k2 = 'link';
                     $v = $tp->replaceConstants($v, 'abs');
                     break;
                 default:
                     $k2 = $k;
                     break;
             }
             $var[$key][$k2] = $v;
         }
         // TODO slide down menu options?
         if (!vartrue($var[$key]['link'])) {
             $var[$key]['link'] = e_SELF . '?mode=' . $tmp[0] . '&amp;action=' . $tmp[1];
             // FIXME - URL based on $modes, remove url key
         }
         if (varset($val['tab'])) {
             $var[$key]['link'] .= "&amp;tab=" . $val['tab'];
         }
         /*$var[$key]['text'] = $val['caption'];
         		$var[$key]['link'] = (vartrue($val['url']) ? $tp->replaceConstants($val['url'], 'abs') : e_SELF).'?mode='.$tmp[0].'&action='.$tmp[1];
         		$var[$key]['perm'] = $val['perm'];	*/
         if (!empty($val['modal'])) {
             $var[$key]['link_class'] = ' e-modal';
             if (!empty($val['modal-caption'])) {
                 $var[$key]['link_data'] = array('data-modal-caption' => $val['modal-caption']);
             }
         }
     }
     if (empty($var)) {
         return '';
     }
     $request = $this->getRequest();
     if (!$selected) {
         $selected = $request->getMode() . '/' . $request->getAction();
     }
     $selected = vartrue($this->adminMenuAliases[$selected], $selected);
     return e107::getNav()->admin($this->menuTitle, $selected, $var);
 }
Esempio n. 9
0
function admin_banner_adminmenu()
{
    $qry = e_QUERY;
    $act = vartrue($qry, 'main');
    $var['main']['text'] = LAN_MANAGE;
    $var['main']['link'] = e_SELF;
    $var['create']['text'] = LAN_CREATE;
    $var['create']['link'] = e_SELF . "?create";
    $var['menu']['text'] = BNRLAN_35;
    $var['menu']['link'] = e_SELF . "?menu";
    e107::getNav()->admin(LAN_PLUGIN_BANNER_NAME, $act, $var);
}
Esempio n. 10
0
 function render2()
 {
     $mes = e107::getMessage();
     $admin_cat = e107::getNav()->adminCats();
     $text = "<div class='center'>\n        \t   \n        \t\t\t<ul class='nav nav-tabs'>";
     foreach ($admin_cat['id'] as $cat_key => $cat_id) {
         // $text .= "<li id='tab-main_".$cat_key."' ><span style='white-space:nowrap'><img class='icon S16' src='".$admin_cat['img'][$cat_key]."' alt='' style='margin-right:3px' /><a href='#core-main_".$cat_key."'>".$admin_cat['title'][$cat_key]."</a></span></li>";
         $text .= "<li id='tab-main_" . $cat_key . "' ><a data-toggle='tab' href='#core-main_" . $cat_key . "'>" . $admin_cat['title'][$cat_key] . "</a></li>";
     }
     $text .= "</ul>";
     $text .= "<div id='tab-content'>";
     print_a($admin_cat);
     foreach ($admin_cat['id'] as $cat_key => $cat_id) {
         $text_check = FALSE;
         $text_cat = "";
         if ($cat_key != 5) {
             foreach ($newarray as $key => $funcinfo) {
                 if ($funcinfo[4] == $cat_key) {
                     $text_rend = e107::getNav()->renderAdminButton($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[6], 'div');
                     if ($text_rend) {
                         $text_check = TRUE;
                     }
                     $text_cat .= $text_rend;
                 }
             }
         } else {
             $text_rend = e107::getNav()->pluginLinks(E_32_PLUGMANAGER, "div");
             if ($text_rend) {
                 $text_check = TRUE;
             }
             $text_cat .= $text_rend;
         }
         //$text_cat .= render_clean();
         if ($text_check) {
             $text .= "<div class='tab-pane adminform' id='core-main_" . $cat_key . "'>\n";
             $text .= " <div class='main_caption bevel'><b>" . $admin_cat['title'][$cat_key] . "</b></div>";
             $text .= $text_cat;
             $text .= "</div><!-- End tab-pane -->";
         }
     }
     $text .= "</div></div>";
     $ns->tablerender(ADLAN_47 . " " . ADMINNAME, $mes->render() . $text);
 }
Esempio n. 11
0
function search_adminmenu()
{
    $query = e_QUERY;
    $action = vartrue($query, 'main');
    $var['main']['text'] = SEALAN_41;
    $var['main']['link'] = e_SELF;
    $var['settings']['text'] = LAN_PREFS;
    $var['settings']['link'] = e_SELF . "?settings";
    e107::getNav()->admin(SEALAN_40, $action, $var);
}
Esempio n. 12
0
function prefs_adminmenu()
{
    $var['core-prefs-main']['text'] = PRFLAN_1;
    $var['core-prefs-email']['text'] = PRFLAN_254;
    $var['core-prefs-registration']['text'] = PRFLAN_28;
    $var['core-prefs-signup']['text'] = PRFLAN_19;
    //	$var['core-prefs-sociallogin']['text'] = "Social Options"; // Moved into plugin.
    $var['core-prefs-comments']['text'] = PRFLAN_210;
    $var['core-prefs-uploads']['text'] = PRFLAN_255;
    $var['core-prefs-header1']['header'] = PRFLAN_256;
    $var['core-prefs-display']['text'] = PRFLAN_13;
    $var['core-prefs-admindisp']['text'] = PRFLAN_77;
    $var['core-prefs-textpost']['text'] = PRFLAN_101;
    $var['core-prefs-security']['text'] = PRFLAN_47;
    $var['core-prefs-date']['text'] = PRFLAN_21;
    $var['core-prefs-javascript']['text'] = PRFLAN_257;
    $var['core-prefs-advanced']['text'] = PRFLAN_149;
    e107::getNav()->admin("Basic " . LAN_OPTIONS . '--id--prev_nav', 'core-prefs-main', $var);
}
Esempio n. 13
0
function fileinspector_adminmenu()
{
    $var['setup']['text'] = "Setup";
    $var['setup']['link'] = e_SELF . "?mode=setup";
    $var['run']['text'] = "Results";
    $var['run']['link'] = e_SELF . "?mode=run";
    e107::getNav()->admin(FC_LAN_1, $_GET['mode'], $var);
}
Esempio n. 14
0
 * Copyright (C) 2008-2014 e107 Inc (e107.org)
 * Released under the terms and conditions of the
 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
 *
 * Administration menu
 *
*/
if (!defined('e107_INIT')) {
    exit;
}
if (ADMIN == TRUE) {
    e107::lan('core', 'admin', true);
    // We're not in admin - load generic admin phrases
    $tp = e107::getParser();
    $pref = e107::getPref();
    $ns = e107::getRender();
    $nav = e107::getNav();
    $array_functions = $nav->adminLinks();
    $amtext = "<div class='text-center' style='text-align:center'>\n\t<select name='activate' onchange='urljump(this.options[selectedIndex].value)' class='tbox form-control'>\n\t<option>" . LAN_SELECT . "</option>\n";
    foreach ($array_functions as $link_value) {
        $amtext .= render_admin_links($link_value['link'], $link_value['title'], $link_value['perms']);
    }
    $amtext .= "</select>\n\t</div>";
    $ns->tablerender(LAN_ADMIN, $amtext, 'admin_menu');
}
function render_admin_links($link, $title, $perms)
{
    if (getperms($perms)) {
        return "<option value='" . $link . "'>" . $title . "</option>";
    }
}
Esempio n. 15
0
function admin_log_adminmenu()
{
    if (e_QUERY) {
        $tmp = explode(".", e_QUERY);
        $action = $tmp[0];
    }
    if ($action == "") {
        $action = "adminlog";
    }
    $var['adminlog']['text'] = RL_LAN_030;
    $var['adminlog']['link'] = "admin_log.php?adminlog";
    $var['auditlog']['text'] = RL_LAN_062;
    $var['auditlog']['link'] = "admin_log.php?auditlog";
    $var['rolllog']['text'] = RL_LAN_002;
    $var['rolllog']['link'] = "admin_log.php?rolllog";
    $var['downlog']['text'] = RL_LAN_067;
    $var['downlog']['link'] = "admin_log.php?downlog";
    $var['detailed']['text'] = RL_LAN_091;
    $var['detailed']['link'] = "admin_log.php?detailed";
    // Deprecated by Comments Manager.
    /*
    	$var['comments']['text'] = 'Comments';
    	$var['comments']['link'] = "admin_log.php?comments";
    */
    $var['config']['text'] = LAN_OPTIONS;
    $var['config']['link'] = "admin_log.php?config";
    /* XXX - why?!
    	if($action == 'comments')
    	{
    		$var['users']['text'] = RL_LAN_115;
    		$var['users']['link'] = "users.php";
    	}
    	*/
    e107::getNav()->admin(RL_LAN_005, $action, $var);
}
Esempio n. 16
0
 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
 *
 * $URL$
 * $Id$
 */
if (!defined('e107_INIT')) {
    exit;
}
$mes = e107::getMessage();
$newarray = e107::getNav()->adminLinks('core');
$buts = "";
$text = "<div style='text-align:center'>\n\t<table class='table'>";
while (list($key, $funcinfo) = each($newarray)) {
    $buts .= e107::getNav()->renderAdminButton($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[5], 'default');
}
$text .= $buts;
$text_cat = '';
while ($td <= 5) {
    $text_cat .= "<td class='td' style='width:20%;' ></td>";
    $td++;
}
$td = 1;
$text .= "</tr></table></div>";
if ($buts != "") {
    $ns->tablerender(ADLAN_47 . " " . ADMINNAME, $mes->render() . $text);
}
$text = "<div style='text-align:center'>\n\t<table class='table'>";
$text .= e107::getNav()->pluginLinks(E_16_PLUGMANAGER, 'default');
$text .= "</tr>\n\t</table></div>";
$ns->tablerender(ADLAN_CL_7, $text);
echo admin_info();
Esempio n. 17
0
function theme_adminmenu()
{
    //global $mode;
    $mode = varset($_GET['mode'], 'main');
    // 	$e107 = &e107::getInstance();
    $var['main']['text'] = TPVLAN_33;
    $var['main']['link'] = e_SELF;
    $var['admin']['text'] = TPVLAN_34;
    $var['admin']['link'] = e_SELF . "?mode=admin";
    $var['choose']['text'] = TPVLAN_51;
    $var['choose']['link'] = e_SELF . "?mode=choose";
    $var['online']['text'] = "Find Themes";
    $var['online']['link'] = e_SELF . "?mode=online";
    $var['upload']['text'] = TPVLAN_38;
    $var['upload']['link'] = e_SELF . "?mode=upload";
    $var['convert']['text'] = "Convert";
    $var['convert']['link'] = e_SELF . "?mode=convert";
    //  $selected = (e_QUERY) ? e_QUERY : "main";
    e107::getNav()->admin(TPVLAN_26, $mode, $var);
}
Esempio n. 18
0
/*
 * e107 website system
 *
 * Copyright (C) 2008-2013 e107 Inc (e107.org)
 * Released under the terms and conditions of the
 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
 *
 * $URL$
 * $Id$
 */
if (!defined('e107_INIT')) {
    exit;
}
$mes = e107::getMessage();
$buts = "";
$newarray = e107::getNav()->adminLinks('core');
while (list($key, $funcinfo) = each($newarray)) {
    $buts .= e107::getNav()->renderAdminButton($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[6], "classis");
}
if ($buts != "") {
    $text = "<div style='text-align:center'>\n\t\t\t<table class='table'>";
    $text .= $buts;
    $text .= render_clean();
    $text .= "</table></div>";
    $ns->tablerender(ADLAN_47 . " " . ADMINNAME, $mes->render() . $text);
}
$text = "<div style='text-align:center'>\n\t<table class='table'>";
$text .= e107::getNav()->pluginLinks(E_32_PLUGMANAGER, "classis");
$text .= render_clean();
$text .= "</table></div>";
$ns->tablerender(ADLAN_CL_7, $text, 'infopanel');
Esempio n. 19
0
 function sc_admin_menumanager()
 {
     global $pref;
     $action = "";
     $var['menumanager']['text'] = LAN_MENULAYOUT;
     $var['menumanager']['link'] = e_ADMIN_ABS . 'menus.php';
     $var['nothing']['divider'] = true;
     if (vartrue($pref['menuconfig_list'])) {
         foreach ($pref['menuconfig_list'] as $name => $val) {
             $var[$name]['text'] = str_replace(":", " / ", $val['name']);
             $var[$name]['link'] = e_PLUGIN_ABS . $val['link'];
         }
     }
     foreach ($var as $key => $link) {
         if (varset($link['link']) && strpos(e_SELF, $link['link'])) {
             $action = $key;
         }
     }
     if (!$action) {
         return;
     }
     //		$keys = array_keys($var);
     //	$action = (in_array($this->action,$keys)) ? $this->action : "installed";
     e107::getNav()->admin("Menu Manager", $action, $var);
     //  e_admin/_menu(ADLAN_6,$action, $var);
 }
Esempio n. 20
0
 function show_options($action)
 {
     $action = varset($_GET['mode'], 'list');
     $var['list']['text'] = $this->listCaption;
     $var['list']['link'] = e_SELF . "?mode=list";
     $var['list']['perm'] = "0";
     $var['create']['text'] = $this->createCaption;
     $var['create']['link'] = e_SELF . "?mode=create";
     $var['create']['perm'] = 0;
     /*
     		$var['options']['text'] = LAN_OPTIONS;
     		$var['options']['link'] = e_SELF."?options";
     		$var['options']['perm'] = "0";*/
     e107::getNav()->admin($this->pluginTitle, $action, $var);
 }
Esempio n. 21
0
/**
 *	Admin menu options
 */
function banlist_adminmenu()
{
    $action = e_QUERY ? e_QUERY : 'list';
    $var['list']['text'] = BANLAN_14;
    // List existing bans
    $var['list']['link'] = e_SELF . '?list';
    $var['list']['perm'] = '4';
    $var['add']['text'] = BANLAN_25;
    // Add a new ban
    $var['add']['link'] = e_SELF . '?add';
    $var['add']['perm'] = '4';
    $var['white']['text'] = BANLAN_52;
    // List existing whitelist entries
    $var['white']['link'] = e_SELF . '?white';
    $var['white']['perm'] = '4';
    $var['whadd']['text'] = BANLAN_53;
    // Add a new whitelist entry
    $var['whadd']['link'] = e_SELF . '?whadd';
    $var['whadd']['perm'] = '4';
    $var['transfer']['text'] = BANLAN_35;
    $var['transfer']['link'] = e_SELF . '?transfer';
    $var['transfer']['perm'] = '4';
    if (getperms('0')) {
        $var['times']['text'] = BANLAN_15;
        $var['times']['link'] = e_SELF . '?times';
        $var['times']['perm'] = '0';
        $var['options']['text'] = LAN_OPTIONS;
        $var['options']['link'] = e_SELF . '?options';
        $var['options']['perm'] = '0';
        $var['banlog']['text'] = BANLAN_81;
        $var['banlog']['link'] = e_SELF . '?banlog';
        $var['banlog']['perm'] = '0';
    }
    e107::getNav()->admin(BANLAN_16, $action, $var);
}
Esempio n. 22
0
 /**
  * Return the parsed sublinks of the current link
  * @return string
  */
 function sc_link_sub($parm = '')
 {
     if (!varset($this->var['link_sub'])) {
         return;
     }
     $text = e107::getParser()->parseTemplate(str_replace('{LINK_SUB}', '', $this->template['submenu_start']), true, $this);
     foreach ($this->var['link_sub'] as $val) {
         $active = e107::getNav()->isActive($val, $this->activeSubFound, true) ? "_active" : "";
         $this->setVars($val);
         // isActive is allowed to alter data
         $tmpl = vartrue($val['link_sub']) ? varset($this->template['submenu_loweritem' . $active]) : varset($this->template['submenu_item' . $active]);
         $text .= e107::getParser()->parseTemplate($tmpl, TRUE, $this);
         if ($active) {
             $this->activeSubFound = true;
         }
     }
     $text .= e107::getParser()->parseTemplate(str_replace('{LINK_SUB}', '', $this->template['submenu_end']), true, $this);
     return $text;
 }
Esempio n. 23
0
 function pluginMenuOptions()
 {
     //	$e107 = &e107::getInstance();
     $var['installed']['text'] = EPL_ADLAN_22;
     $var['installed']['link'] = e_SELF;
     $var['avail']['text'] = EPL_ADLAN_23;
     $var['avail']['link'] = e_SELF . "?avail";
     $var['online']['text'] = EPL_ADLAN_220;
     $var['online']['link'] = e_SELF . "?mode=online";
     if (E107_DEBUG_LEVEL > 0) {
         $var['upload']['text'] = EPL_ADLAN_38;
         $var['upload']['link'] = e_SELF . "?mode=upload";
     }
     $var['create']['text'] = EPL_ADLAN_114;
     $var['create']['link'] = e_SELF . "?mode=create";
     $keys = array_keys($var);
     $action = in_array($this->action, $keys) ? $this->action : "installed";
     if ($this->action == 'lans') {
         $action = 'create';
     }
     e107::getNav()->admin(ADLAN_98, $action, $var);
 }
Esempio n. 24
0
 function pageNav($parm = '')
 {
     $frm = e107::getForm();
     $options = array();
     if (vartrue($parm)) {
         parse_str($parm, $options);
     }
     $sql = e107::getDb();
     $sublinks = array();
     $arr = array();
     // map current when in auto mode
     if (vartrue($options['auto'])) {
         // current book found, top book not set
         if (vartrue($options['cbook']) && !vartrue($options['book'])) {
             $options['book'] = $options['cbook'];
         }
         // current chapter found, top chapter not set
         if (vartrue($options['cchapter']) && !vartrue($options['chapter'])) {
             $options['chapter'] = $options['cchapter'];
         }
         // current chapter found, top chapter not set
         if (vartrue($options['cpage']) && !vartrue($options['page'])) {
             $options['page'] = $options['cpage'];
         }
     }
     // find the chapter if required
     if (vartrue($options['page']) && !vartrue($options['chapter'])) {
         $options['chapter'] = $sql->retrieve('page', 'page_chapter', 'page_id=' . intval($options['page']));
     }
     $query = "SELECT * FROM #page WHERE ";
     $q = array();
     if (vartrue($options['chapter'])) {
         $q[] = "page_title !='' AND page_chapter = " . intval($options['chapter']);
     } elseif (vartrue($options['book'])) {
         $q[] = "page_title !='' && page_chapter IN (SELECT chapter_id FROM #page_chapters WHERE chapter_parent=" . intval($options['book']) . ")";
     }
     // XXX discuss FIXED remove DB check, use default title - AND page_title !=''
     $q[] = "page_class IN (" . USERCLASS_LIST . ")";
     $query .= implode(' AND ', $q) . " ORDER BY page_order";
     $data = $sql->retrieve($query, true);
     $_pdata = array();
     foreach ($data as $row) {
         $pid = $row['page_chapter'];
         $row['chapter_sef'] = $this->getSef($row['page_chapter']);
         $book = $this->getParent($row['page_chapter']);
         $row['book_sef'] = $this->getSef($book);
         if (!vartrue($row['page_sef'])) {
             $row['page_sef'] = '--sef-not-assigned--';
         }
         $sublinks[$pid][] = $_pdata[] = array('link_id' => $row['page_id'], 'link_name' => $row['page_title'] ? $row['page_title'] : 'No title', 'link_url' => e107::getUrl()->create('page/view', $row, array('allow' => 'page_sef,page_title,page_id,chapter_sef,book_sef')), 'link_description' => '', 'link_button' => $row['menu_image'], 'link_category' => '', 'link_order' => $row['page_order'], 'link_parent' => $row['page_chapter'], 'link_open' => '', 'link_class' => intval($row['page_class']), 'link_active' => isset($options['cpage']) && $row['page_id'] == $options['cpage'], 'link_identifier' => 'page-nav-' . intval($row['page_id']));
     }
     $filter = "chapter_visibility IN (" . USERCLASS_LIST . ") ";
     if (vartrue($options['chapter'])) {
         //$filter = "chapter_id > ".intval($options['chapter']);
         $title = $sql->retrieve('page_chapters', 'chapter_name', 'chapter_id=' . intval($options['chapter']) . ' AND chapter_visibility IN (' . USERCLASS_LIST . ')');
         $outArray = array();
         if (!$title) {
             return e107::getNav()->compile($_pdata, $outArray, $options['chapter']);
         }
         return array('title' => $title, 'body' => e107::getNav()->compile($_pdata, $outArray, $options['chapter']));
     }
     $parent = 0;
     $title = false;
     if (vartrue($options['book'])) {
         // XXX discuss the idea here
         //$filter = "chapter_id > ".intval($options['book']);
         $filter = "chapter_parent = " . intval($options['book']);
         $parent = intval($options['book']);
         $title = $sql->retrieve('page_chapters', 'chapter_name', 'chapter_id=' . intval($options['book']));
         //	print_a('parent='.$parent);
     }
     $books = $sql->retrieve("SELECT * FROM #page_chapters WHERE " . $filter . " ORDER BY chapter_order ASC", true);
     foreach ($books as $row) {
         $row['book_sef'] = $this->getSef($row['chapter_parent']);
         if (!vartrue($row['chapter_sef'])) {
             $row['chapter_sef'] = '--sef-not-assigned--';
         }
         $arr[] = array('link_id' => $row['chapter_id'], 'link_name' => $row['chapter_name'], 'link_url' => $row['chapter_parent'] == 0 ? e107::getUrl()->create('page/book/index', $row) : e107::getUrl()->create('page/chapter/index', $row), 'link_description' => '', 'link_button' => $row['chapter_icon'], 'link_category' => '', 'link_order' => $row['chapter_order'], 'link_parent' => $row['chapter_parent'], 'link_open' => '', 'link_class' => 0, 'link_sub' => !vartrue($options['book']) && !vartrue($options['auto']) ? varset($sublinks[$row['chapter_id']]) : '', 'link_active' => $row['chapter_parent'] == 0 ? isset($options['cbook']) && $options['cbook'] == $row['chapter_id'] : isset($options['cchapter']) && $options['cchapter'] == $row['chapter_id'], 'link_identifier' => 'page-nav-' . intval($row['chapter_id']));
     }
     $outArray = array();
     $parent = vartrue($options['book']) ? intval($options['book']) : 0;
     $ret = e107::getNav()->compile($arr, $outArray, $parent);
     if (!$title) {
         return $ret;
     }
     return array('title' => $title, 'body' => $ret);
 }
Esempio n. 25
0
function language_adminmenu()
{
    $pref = e107::getPref();
    $action = e_QUERY;
    if ($action == "") {
        $action = getperms('0') ? "main" : "tools";
    }
    if ($action == "modify") {
        $action = "db";
    }
    if (getperms('0')) {
        $var['main']['text'] = LAN_PREFS;
        $var['main']['link'] = e_SELF;
        if (isset($pref['multilanguage']) && $pref['multilanguage']) {
            $var['db']['text'] = LANG_LAN_03;
            $var['db']['link'] = e_SELF . "?db";
        }
    }
    //	$lcnt = explode(",", e_LANLIST);
    //	if (count($lcnt) > 1)
    //	{
    $var['tools']['text'] = LANG_LAN_21;
    $var['tools']['link'] = e_SELF . "?tools";
    //	}
    e107::getNav()->admin(ADLAN_132, $action, $var);
}
Esempio n. 26
0
    }
}
$expandable = vartrue($parm['expandable']);
if ($parm) {
    $parm = http_build_query($parm, null, '&');
} else {
    $parm = '';
}
### Retrieve
$links = e107::getAddon('page', 'e_sitelink');
$data = $links->pageNav($parm);
if (isset($data['title']) && !vartrue($template['noAutoTitle'])) {
    // use chapter title
    $template['caption'] = $data['title'];
    $data = $data['body'];
}
if (empty($data)) {
    return;
}
$text = e107::getNav()->render($data, $template);
/**
 * Expandable menu support. 
 * @see jquery.page.navigation.js . activate with expandable=1 in the page-navigation menu. 
 * For best results include: e107::css('page', 'css/page.navigation.css', 'jquery'); in theme.php 
 */
if ($expandable) {
    e107::js('page', 'js/jquery.page.navigation.js', 'jquery');
    $template['caption'] .= "<span class='btn-group pull-right'><a class='btn btn-default btn-xs btn-mini' id='page-nav-expand'>+</a><a class='btn btn-default btn-xs btn-mini' id='page-nav-collapse'>-</a></span>";
}
### Render
e107::getRender()->tablerender($template['caption'], $text, 'page-navigation-menu');
Esempio n. 27
0
    function render()
    {
        $tp = e107::getParser();
        $ns = e107::getRender();
        $sql = e107::getDb();
        $mes = e107::getMessage();
        $pref = e107::getPref();
        $frm = e107::getForm();
        //	XXX Check Bootstrap bug is fixed.
        /*
        	echo '
                  <ul class="thumbnails">
                    <li class="span4">
                      <a href="#" class="thumbnail">
                        <img src="http://placehold.it/360x270" alt="">
                      </a>
                    </li>
                     <li class="span4">
                      <a href="#" class="thumbnail">
                        <img src="http://placehold.it/360x270" alt="">
                      </a>
                    </li>
                     <li class="span4">
                      <a href="#" class="thumbnail">
                        <img src="http://placehold.it/360x270" alt="">
                      </a>
                    </li>
                     <li class="span4">
                      <a href="#" class="thumbnail">
                        <img src="http://placehold.it/360x270" alt="">
                      </a>
                    </li>
                     <li class="span4">
                      <a href="#" class="thumbnail">
                        <img src="http://placehold.it/360x270" alt="">
                      </a>
                    </li>
                     <li class="span4">
                      <a href="#" class="thumbnail">
                        <img src="http://placehold.it/360x270" alt="">
                      </a>
                    </li>
                  </ul>
        
        	';
        */
        //TODO LANs throughout.
        global $style, $user_pref;
        // ---------------------- Start Panel --------------------------------
        //		$text = "<div >";
        if (getperms('0') && !vartrue($user_pref['core-infopanel-mye107'])) {
            $defArray = array(0 => 'e-administrator', 1 => 'e-cpage', 2 => 'e-frontpage', 3 => 'e-mailout', 4 => 'e-image', 5 => 'e-menus', 6 => 'e-meta', 7 => 'e-newspost', 8 => 'e-plugin', 9 => 'e-prefs', 10 => 'e-links', 11 => 'e-theme', 12 => 'e-userclass2', 13 => 'e-users', 14 => 'e-wmessage');
            $user_pref['core-infopanel-mye107'] = vartrue($pref['core-infopanel-default'], $defArray);
        }
        //	"<form method='post' action='".e_SELF."?".e_QUERY."'>";
        $tp->parseTemplate("{SETSTYLE=core-infopanel}");
        // Personalized Panel
        // Rendering the saved configuration.
        $mainPanel = "\n\t\t<div id='core-infopanel_mye107' >\n\t\t";
        /*
        		$mainPanel .= '<span class="pull-right">
        		          <span class="options">
        		            <div class="btn-group">
        		              <a class="dropdown-toggle" data-toggle="dropdown"><i class="icon-cog"></i></a>
        		              <ul class="dropdown-menu black-box-dropdown dropdown-right">
        		                <li>'.$this->render_infopanel_icons().'</li>
        		              </ul>
        		            </div>
        		          </span>
        		        </span>';
        */
        //	print_a($user_pref['core-infopanel-mye107']);
        $mainPanel .= "\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t<div class='left'>";
        foreach ($this->iconlist as $key => $val) {
            if (!vartrue($user_pref['core-infopanel-mye107']) || in_array($key, $user_pref['core-infopanel-mye107'])) {
                $mainPanel .= e107::getNav()->renderAdminButton($val['link'], $val['title'], $val['caption'], $val['perms'], $val['icon_32'], "div");
            }
        }
        $mainPanel .= "<div class='clear'>&nbsp;</div>";
        $mainPanel .= "</div>\n\t      \n\t\t\t</div>";
        $text = $ns->tablerender(ucwords(USERNAME) . "'s Control Panel", $mainPanel, "core-infopanel_mye107", true);
        //  ------------------------------- e107 News --------------------------------
        $text2 = $ns->tablerender("e107 News", "<div id='e-adminfeed'></div><div class='right'><a rel='external' href='" . ADMINFEEDMORE . "'>" . LAN_MORE . "</a></div>", "core-infopanel_news", true);
        // ---------------------Latest Stuff ---------------------------
        //require_once (e_CORE."shortcodes/batch/admin_shortcodes.php");
        e107::getScBatch('admin');
        $text2 .= $ns->tablerender("Website Status", $this->renderWebsiteStatus(), "", true);
        //	$text .= $ns->tablerender(ADLAN_LAT_1,$tp->parseTemplate("{ADMIN_LATEST=norender}"),"core-infopanel_latest",true);
        //	$text .= $ns->tablerender(LAN_STATUS,$tp->parseTemplate("{ADMIN_STATUS=norender}"),"core-infopanel_latest",true);
        /*
        	
        			$text .= "<li class='span6'>
        				".$tp->parseTemplate("{ADMIN_LATEST=norender}").
        				$tp->parseTemplate("{ADMIN_STATUS=norender}")."
        						</div>";
        */
        $text .= $this->renderLatestComments();
        // ---------------------- Who's Online  ------------------------
        // TODO Could use a new _menu item instead.
        //	$text2 .= $ns->tablerender('Visitors Online : '.vartrue($nOnline), $panelOnline,'core-infopanel_online',true);
        // --------------------- User Selected Menus -------------------
        if (varset($pref['core-infopanel-menus'])) {
            foreach ($pref['core-infopanel-menus'] as $val) {
                $id = $frm->name2id('core-infopanel_' . $val);
                $inc = $tp->parseTemplate("{PLUGIN={$val}|TRUE}");
                $text .= $inc;
                // $text .= $ns->tablerender("", $inc, $id,true);
            }
        }
        //	$text .= "<div class='clear'>&nbsp;</div>";
        $text .= $this->render_infopanel_options();
        //	$text .= "</div>";
        if (vartrue($_GET['mode']) != 'customize') {
            // $ns->tablerender(ADLAN_47." ".ADMINNAME, $emessage->render().$text);
            echo $mes->render() . '

			<!-- INFOPANEL -->
			<div class="span6 col-md-6">
			 <ul class="thumbnails">' . $text . '</ul>
			 </div>
			 
			 <div class="span6 col-md-6">
			 <ul class="thumbnails">' . $text2 . '</ul>
			 </div>
						 
			<!--  -->  
			 
			 
			 ';
        } else {
            echo $frm->open('infopanel', 'post', e_SELF);
            echo $this->render_infopanel_options(true);
            echo $frm->close();
        }
    }
Esempio n. 28
0
    $text_check = FALSE;
    $text_cat = "<tr><td class='fcaption' colspan='2'>" . $admin_cat['title'][$cat_key] . "</td></tr>\n\t\t<tr><td class='forumheader3' style='text-align: center; vertical-align: middle; width: 72px; height: 48px'>" . $admin_cat['lrg_img'][$cat_key] . "</td><td class='forumheader3'>\n\t\t<table style='width:100%'>";
    if ($cat_key != 5) {
        foreach ($newarray as $key => $funcinfo) {
            if ($funcinfo[4] == $cat_key) {
                $text_rend = e107::getNav()->renderAdminButton($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[5], 'default');
                if ($text_rend) {
                    $text_check = TRUE;
                }
                $text_cat .= $text_rend;
            }
        }
    } else {
        $text_rend = e107::getNav()->renderAdminButton(e_ADMIN . "plugin.php", ADLAN_98, ADLAN_99, "Z", E_16_PLUGMANAGER, 'default');
        if ($text_rend) {
            $text_check = TRUE;
        }
        $text_cat .= $text_rend;
        foreach ($plugin_array as $plug_key => $plug_value) {
            $text_cat .= e107::getNav()->renderAdminButton($plug_value['link'], $plug_value['title'], $plug_value['caption'], $plug_value['perms'], $plug_value['icon'], 'default');
        }
    }
    $text_cat .= render_clean();
    $text_cat .= "</table>\n\t\t</td></tr>";
    if ($text_check) {
        $text .= $text_cat;
    }
}
$text .= "</table></div>";
$ns->tablerender(ADLAN_47 . " " . ADMINNAME, $mes->render() . $text);
echo admin_info();