• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP menu类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中menu的典型用法代码示例。如果您正苦于以下问题:PHP menu类的具体用法?PHP menu怎么用?PHP menu使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了menu类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: check_power

function check_power()
{
    global $global;
    $flag = 0;
    if ($global['admin_id']) {
        $obj = new admin();
        $obj->set_where('adm_id = ' . $global['admin_id']);
        $one = $obj->get_one();
        if ($one['adm_power'] == 'all') {
            $flag = 1;
        } elseif ($one['adm_power'] != '') {
            $val = $global['channel'] . '/mod-' . $global['mod'];
            $urls = explode('|', $one['adm_power']);
            for ($i = 0; $i < count($urls); $i++) {
                if ($urls[$i] == '/' . $val . '/') {
                    $flag = 1;
                    break;
                }
            }
            if ($flag == 0) {
                $obj = new menu();
                $obj->set_where('');
                $obj->set_where("men_url like '%" . $val . "%'");
                if ($obj->get_count() == 0) {
                    $flag = 1;
                }
            }
        }
    }
    return $flag;
}
开发者ID:jechiy,项目名称:xiu-cms,代码行数:31,代码来源:common.func.php


示例2: active

 function active($id = 0, $value)
 {
     $menu = new menu($id);
     if (!$menu->exists()) {
         show_404();
     }
     $menu->active = ($menu->active + 1) % 2;
     $menu->save();
     flash_message('success', "Kích hoạt thành công.");
     redirect($this->admin . 'menus/list_all/');
 }
开发者ID:lxthien,项目名称:batdongsan,代码行数:11,代码来源:menus.php


示例3: get_power_arr

function get_power_arr()
{
    $arr = array();
    $obj = new menu();
    $obj->set_where('');
    $obj->set_where("left(men_type,6) = 'admin_'");
    $list = $obj->get_list();
    for ($i = 0; $i < count($list); $i++) {
        $arr[$i]['name'] = $list[$i]['men_name'];
        $arr[$i]['url'] = '/' . $list[$i]['men_url'];
        $arr[$i]['set'] = 0;
    }
    return $arr;
}
开发者ID:jechiy,项目名称:xiu-cms,代码行数:14,代码来源:admin_power.php


示例4: add_nav

function add_nav()
{
    global $smarty, $lang;
    $type = post('type');
    $word = post('word');
    $link = post('link');
    $obj = new menu();
    $obj->set_value('men_type', $type);
    $obj->set_value('men_name', $word);
    $obj->set_value('men_url', $link);
    $obj->add();
    $smarty->assign('info_text', '添加导航成功');
    $smarty->assign('link_text', $lang['return_list']);
    $smarty->assign('link_href', url(array('channel' => 'super', 'mod' => 'nav_list')));
}
开发者ID:jechiy,项目名称:xiu-cms,代码行数:15,代码来源:deal.php


示例5: module_footer

function module_footer()
{
    global $smarty;
    $obj = new menu();
    $obj->set_where("men_type = 'footer'");
    $smarty->assign('footer_nav', $obj->get_list());
    $obj = new varia();
    $site['domain'] = $obj->get_value('site_domain');
    $site['record'] = $obj->get_value('site_record');
    $site['record_url'] = $obj->get_value('site_record_url');
    $site['tech'] = $obj->get_value('site_tech');
    $site['tech_url'] = $obj->get_value('site_tech_url');
    $site['statistical_code'] = im_filter($obj->get_value('statistical_code', true));
    $smarty->assign('site', $site);
}
开发者ID:jechiy,项目名称:xiu-cms,代码行数:15,代码来源:footer.php


示例6: save

 function save($object = '', $related_field = '')
 {
     if (!$this->exists()) {
         $o = new menu();
         $o->select_max('position');
         $o->get();
         if (count($o->all) != 0) {
             $max = $o->position + 1;
             $this->position = $max;
         } else {
             $this->postion = 1;
         }
     }
     return parent::save($object, $related_field);
 }
开发者ID:lxthien,项目名称:batdongsan,代码行数:15,代码来源:menu.php


示例7: mainpage

 function mainpage($mydata)
 {
     $this->data['mytitle'] = 'Monitoring website';
     $this->data['diagnostic'] = $diagnostic;
     foreach ($mydata as $key => $variable) {
         $this->data[$key] = $variable;
     }
     //here's the menu class
     $fred = new menu();
     $this->load->library('session');
     $mysess = $this->session->userdata('session_id');
     if (isset($this->status) && $this->status > 0) {
         $this->data['menu'] = $fred->show_menu($this->status);
     }
     $this->load->view('basic_view', $this->data);
 }
开发者ID:songzhihai,项目名称:rapid-php-application-development,代码行数:16,代码来源:My+Display+Model.php


示例8: mainpage

 function mainpage($mydata)
 {
     Display();
     $this->data['title'] = 'Monitoring website';
     foreach ($mydata as $key => $variable) {
         $this->data[$key] = $variable;
     }
     /*here's the menu class we looked at in Chapter 3*/
     $fred = new menu();
     $this->load->library('session');
     $mysess = $this->session->userdata('session_id');
     if (isset($this->status) && $this->status > 0) {
         $this->data['menu'] = $fred->show_menu($this->status);
     }
     $this->load->view('header.tpl.php', $this->data);
 }
开发者ID:rose1988c,项目名称:insky,代码行数:16,代码来源:display.php


示例9: module_nav_list

function module_nav_list()
{
    global $smarty;
    $obj = new varia();
    $obj->set_where("left(var_name,10) = 'nav_stage_'");
    $arr = $obj->get_list();
    for ($i = 0; $i < count($arr); $i++) {
        $name = substr($arr[$i]['var_name'], 10);
        $obj = new menu();
        $obj->set_where("men_type = '{$name}'");
        $list[$name] = $obj->get_list();
        $nav[$i]['type'] = $name;
        $nav[$i]['name'] = $arr[$i]['var_value'];
    }
    $smarty->assign('nav', $nav);
    $smarty->assign('list', $list);
}
开发者ID:jechiy,项目名称:xiu-cms,代码行数:17,代码来源:nav_list.php


示例10: actionAddUser

 function actionAddUser($view)
 {
     $view->menu = menu::getDataMenu();
     $userDataArray = array();
     $userDataArray['login'] = $_POST['login'];
     $userDataArray['password'] = $_POST['password'];
     $userDataArray['dblPassword'] = $_POST['dblPassword'];
     $userDataArray['email'] = $_POST['email'];
     $userDataArray['user_name'] = $_POST['user_name'];
     $userDataArray['user_surname'] = $_POST['user_surname'];
     if ($userDataArray['password'] !== $userDataArray['dblPassword']) {
         $view->userDataArray = $userDataArray;
         $view->message = " Пароли не совпадают !";
         echo $view->render('registration.php');
         return false;
     }
     if (!$userDataArray['login'] || !$userDataArray['password'] || !$userDataArray['dblPassword'] || !$userDataArray['email'] || !$userDataArray['user_name'] || !$userDataArray['user_surname']) {
         $view->userDataArray = $userDataArray;
         $view->message = " Введены не все данные !";
         echo $view->render('registration.php');
         return false;
     }
     $userDataArray = checkClass::checkAll($userDataArray);
     $query = "SELECT user_id FROM user WHERE user.user_login =" . $userDataArray['login'] . ";";
     if (getDataBase::getData($query, 1)) {
         $view->userDataArray = $userDataArray;
         $view->message = " Данный логи занят";
         echo $view->render('registration.php');
         return false;
     }
     $query = "INSERT INTO  `maket`.`user` (`user_id` ,`user_login` ,`user_password` ,`user_status` ,`user_block`)\r\n                  VALUES (NULL ,  '" . $userDataArray['login'] . "','" . $userDataArray['dblPassword'] . "',  'student',  '0');";
     if (!self::addData($query)) {
         $view->userDataArray = $userDataArray;
         $view->message = " Регистрация не удалась, попробуйте позже";
         echo $view->render('registration.php');
         return false;
     }
     $query = "SELECT user_id FROM user WHERE user.user_login =" . $userDataArray['login'] . ";";
     $id = getDataBase::getData($query, 1);
     if (!$id) {
         $view->userDataArray = $userDataArray;
         $view->message = " Регистрация не удалась, попробуйте позже";
         echo $view->render('registration.php');
         return false;
     }
     $query = "INSERT INTO `maket`.`user_data` (`user_data_id`, `user_id`, `user_data_name`, `user_data_surname`,\r\n                    `user_data_email`, `user_data_secret_w`, `user_data_secret_a`, `user_data_cantry`, `user_data_sity`)\r\n                    VALUES (NULL, '" . $id . "', '" . $userDataArray['user_name'] . "', '" . $userDataArray['user_surname'] . "',\r\n                     '" . $userDataArray['email'] . "', \\'апап\\', \\'апа\\', \\'Беларусь\\', \\'Минск\\');";
     if (!self::addData($query)) {
         $view->userDataArray = $userDataArray;
         $view->message = " Регистрация не удалась, попробуйте позже";
         echo $view->render('registration.php');
         return false;
     }
     $view->message = " Регистрация не удалась, попробуйте позже";
     echo $view->render('addUser.php');
 }
开发者ID:Jluct,项目名称:obuceisea,代码行数:55,代码来源:registrationController.php


示例11: getData

 public function getData($cnd = " = 0")
 {
     $data = array();
     foreach (menu::model()->findAll('parent_id' . $cnd) as $model) {
         $row['text'] = $model->title;
         $row['id'] = $model->id;
         $row['children'] = Menu::getData(' =' . $model->id);
         $data[] = $row;
     }
     return $data;
 }
开发者ID:kit9,项目名称:ERP_Accounting_Indonesia,代码行数:11,代码来源:menu.php


示例12: addItem

 public function addItem()
 {
     $output = "<div class='col-md-8 col-md-offset-2'>\n                <div class='alert alert-danger'>\n                    <p>This function is still in development.</p>\n                </div>\n            </div>";
     try {
         //  $beer = new beer('Bud Light');
         $menu = new menu($this->registry->db);
         $beerList = $menu->getJSON();
         $this->registry->template->menuItems = $beerList;
         $this->registry->template->error = $output;
         $this->registry->template->show('dashboard');
         /*
                     } else {
                         $this->registry->template->body = "An error occurred";
                         $this->registry->template->show('index');
                     } */
     } catch (Exception $e) {
         $this->registry->template->body = "An error occurred {$e->getMessage()}";
         $this->registry->template->show('dashboard');
     }
 }
开发者ID:astonecipher,项目名称:Bar-Menu,代码行数:20,代码来源:dashboardController.php


示例13: module_header

function module_header()
{
    global $smarty;
    $obj = new varia();
    $obj->set_where("var_name = 'languages'");
    $list = $obj->get_list();
    for ($i = 0; $i < count($list); $i++) {
        $arr = explode('{v}', $list[$i]['var_value']);
        $list[$i]['pack_name'] = $arr[0];
        $list[$i]['index_entrance'] = $arr[1];
        $list[$i]['admin_entrance'] = $arr[2];
        $list[$i]['chinese_name'] = $arr[3];
        $list[$i]['foreign_name'] = $arr[4];
    }
    $smarty->assign('lang_pack', $list);
    $obj = new menu();
    $obj->set_where("men_type = 'header'");
    $obj->set_field('men_name,men_url');
    $smarty->assign('nav', $obj->get_list());
}
开发者ID:jechiy,项目名称:xiu-cms,代码行数:20,代码来源:header.php


示例14: index

 function index()
 {
     $usuario = new usuario();
     $adm = $usuario->esAdm();
     $this->registry->template->adm = $adm;
     $series = new series();
     $this->registry->template->seccion = $series->obtenerSeccionDeParaCajas();
     $this->registry->template->exp_id = "";
     $this->registry->template->ete_id = "";
     $menu = new menu();
     $liMenu = $menu->imprimirMenu(VAR1, $_SESSION['USU_ID']);
     $this->registry->template->men_titulo = $liMenu;
     $this->registry->template->PATH_WEB = PATH_WEB;
     $this->registry->template->PATH_DOMAIN = PATH_DOMAIN;
     $this->registry->template->PATH_EVENT = "view";
     $this->registry->template->GRID_SW = "false";
     $this->registry->template->PATH_J = "jquery";
     $this->registry->template->show('headerG');
     $this->registry->template->show('etiexpediente/tab_etiqexpedienteg.tpl');
     $this->registry->template->show('footer');
 }
开发者ID:acastellon,项目名称:pasajes_viaticos,代码行数:21,代码来源:etiqexpedienteController.php


示例15: initMenu

function initMenu($menuname, $skipCache = false)
{
    global $_GROUPS, $_TABLES, $_USER;
    $menu = NULL;
    $cacheInstance = 'menuobject_' . $menuname . '_' . CACHE_security_hash() . '__data';
    if ($skipCache == false) {
        $retval = CACHE_check_instance($cacheInstance, 0);
        if ($retval) {
            $menu = unserialize($retval);
            return $menu;
        }
    }
    $mbadmin = SEC_hasRights('menu.admin');
    $root = SEC_inGroup('Root');
    if (COM_isAnonUser()) {
        $uid = 1;
    } else {
        $uid = $_USER['uid'];
    }
    $result = DB_query("SELECT * FROM {$_TABLES['menu']} WHERE menu_active=1 AND menu_name='" . DB_escapeString($menuname) . "'", 1);
    $menuRow = DB_fetchArray($result);
    if ($menuRow) {
        $menu = new menu();
        $menu->id = $menuRow['id'];
        $menu->name = $menuRow['menu_name'];
        $menu->type = $menuRow['menu_type'];
        $menu->active = $menuRow['menu_active'];
        $menu->group_id = $menuRow['group_id'];
        if ($mbadmin || $root) {
            $menu->permission = 3;
        } else {
            if ($menuRow['group_id'] == 998) {
                if (COM_isAnonUser()) {
                    $menu->permission = 3;
                } else {
                    $menu->permission = 0;
                    return NULL;
                }
            } else {
                if (in_array($menuRow['group_id'], $_GROUPS)) {
                    $menu->permission = 3;
                } else {
                    return NULL;
                }
            }
        }
        $menu->getElements();
        $cacheMenu = serialize($menu);
        CACHE_create_instance($cacheInstance, $cacheMenu, 0);
    }
    return $menu;
}
开发者ID:spacequad,项目名称:glfusion,代码行数:52,代码来源:lib-menu.php


示例16: checkAuthority

 /**
  * 检查页面权限
  * @param unknown $authority        	
  * @param unknown $checkvalue        	
  * @return boolean
  */
 public function checkAuthority($authority, $checkvalue)
 {
     if (empty($authority)) {
         return false;
     }
     //超管直接返回成功
     if ($authority == '-1') {
         return true;
     }
     Doo::loadClassAt('Menu', 'default');
     $menu = new menu(DBproxy::getManage());
     $menuList = $menu->getMenuArray();
     foreach ($menuList as $key => $var) {
         if (empty($var['url'])) {
             continue;
         }
         if (strpos($var['url'], '/') !== 0) {
             continue;
         }
         $menuid = -2;
         if (strpos($var['url'], '/') === 0) {
             $first = '';
         } else {
             $first = '/';
         }
         // var_dump($_SERVER['REDIRECT_URL'] , trim('/'.Doo::conf()->adminRoute.$first.$var['url']),'<br>');
         //寻找后台菜单URL和当前URL 是否匹配。
         if ($_SERVER['REDIRECT_URL'] == trim('/' . Doo::conf()->adminRoute . $first . $var['url'])) {
             $menuid = $var['id'];
             // echo '<pre>';var_dump($_SESSION['authory'],isset($authority[$menuid]),$var);
             // var_dump($authority,$menuid,$checkvalue);die;
         }
         if (isset($authority[$menuid]) && ($authority[$menuid] & $checkvalue) == $checkvalue) {
             return true;
         }
     }
     return false;
 }
开发者ID:aising,项目名称:ding,代码行数:44,代码来源:PageAuth.php


示例17: index

 function index()
 {
     $tseries = new series();
     $series = "";
     if ($_SESSION["ROL_COD"] == "AA" || $_SESSION["ROL_COD"] == "AC" || $_SESSION["ROL_COD"] == "AI") {
         $series = $tseries->obtenerSelectTodas();
     } else {
         $series = $tseries->obtenerSelectSeries();
     }
     $departamento = new departamento();
     $this->registry->template->dep_id = $departamento->obtenerSelect();
     $fondo = new fondo();
     $this->registry->template->fon_id = $fondo->obtenerSelectFondos();
     $this->registry->template->uni_id = "";
     $this->registry->template->ser_id = "";
     //$this->registry->template->exp_id = "";
     $this->registry->template->tra_id = "";
     $this->registry->template->cue_id = "";
     $tmenu = new menu();
     $liMenu = $tmenu->imprimirMenu("buscarArchivo", $_SESSION['USU_ID']);
     $this->registry->template->men_titulo = $liMenu;
     $this->registry->template->UNI_ID = $_SESSION['UNI_ID'];
     $this->registry->template->PATH_WEB = PATH_WEB;
     $this->registry->template->PATH_DOMAIN = PATH_DOMAIN;
     $this->registry->template->PATH_EVENT = "search";
     $this->registry->template->PATH_EVENT2 = "verifpass";
     $this->registry->template->PATH_EVENT_VERIF_PASS = "verifpass";
     $this->registry->template->PATH_EVENT3 = "download";
     $this->registry->template->PATH_EVENT4 = "getConfidencialidad";
     $this->registry->template->PATH_EVENT_EXPORT = "exportar";
     $this->registry->template->GRID_SW = "false";
     $this->registry->template->PATH_J = "jquery-1.4.1";
     $this->registry->template->show('headerBuscador');
     $this->registry->template->show('archivo/buscarArchivo.tpl');
     $this->registry->template->show('footer');
 }
开发者ID:acastellon,项目名称:pasajes_viaticos,代码行数:36,代码来源:buscarArchivoController.php


示例18: module_left

function module_left()
{
    global $global, $smarty;
    if ($global['channel'] == 'about' || $global['channel'] == 'recruit' || $global['channel'] == 'download') {
        $type = 'article';
    } else {
        $type = $global['channel'];
    }
    $obj = new menu();
    $obj->set_field('men_name,men_url');
    $obj->set_where('');
    $obj->set_where("men_lang = 'none'");
    $obj->set_where("men_type = 'admin_" . $type . "'");
    $obj->set_where("men_show = 1");
    $smarty->assign('nav_left', $obj->get_list());
}
开发者ID:jechiy,项目名称:xiu-cms,代码行数:16,代码来源:left.php


示例19: to_node

 private static function to_node($row)
 {
     $url = menu::get_url($row["url"]);
     $data = array('id' => $row["id"], 'text' => $row["name"], 'leaf' => empty($row["children"]));
     if ($data["leaf"] == true) {
         $data['iconCls'] = 'icon-cls';
         $data['url'] = $url;
         $data['qtip'] = $url;
     } else {
         $data['iconCls'] = 'icon-pkg';
         $data["singleClickExpand"] = true;
         foreach ($row["children"] as $k => $v) {
             $row["children"][$k] = self::to_node($v);
         }
         $data['children'] = $row["children"];
     }
     return $data;
 }
开发者ID:RenzcPHP,项目名称:3dproduct,代码行数:18,代码来源:menu_tree.php


示例20: jsonMenu

 public static function jsonMenu()
 {
     $menus = Menu::where('depth', 1)->where('status', 1)->get();
     $submenus = menu::where('depth', 2)->where('status', 1)->get();
     function getSubs($subs, $mid)
     {
         $submenu = array();
         foreach ($subs as $sub) {
             if ($sub->parent_id == $mid) {
                 array_push($submenu, $sub);
             }
         }
         return $submenu;
     }
     $subList = array();
     foreach ($menus as $menu) {
         $subList[$menu->id] = getSubs($submenus, $menu->id);
     }
     return ['menus' => $menus, 'submenus' => $subList];
 }
开发者ID:Rogerz-sh,项目名称:Creatures,代码行数:20,代码来源:AccountController.php



注:本文中的menu类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP menus类代码示例发布时间:2022-05-23
下一篇:
PHP member类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap