当前位置: 首页>>代码示例>>PHP>>正文


PHP admin::show方法代码示例

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


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

示例1: theme

 function action_login($args)
 {
     global $manager, $tree, $user, $config, $lang;
     if ($config->get('inlineLogin')) {
         $page = new theme();
         $t = new Template($this->getTemplate('inline.template'));
         $l =& $lang;
     } else {
         $page = new admin();
         $t = new Template($this->getTemplate('form.template'));
         $l =& $user->lang;
     }
     if (count($args)) {
         $id = array_shift($args);
         // Check if the id contains an file extension
         if (preg_match('/(.*)\\.([a-z0-9]+)$/i', $id, $matches)) {
             $id = $matches[1];
         }
         $t->set('url', url::item($id, 'login'));
         if ($_SERVER['REQUEST_METHOD'] == 'POST') {
             $user->login(url::item($id));
             // If we end up here, we did not properly login... probably
             // username or password not correct...
             $t->set('error', $l->s('passwordnotcorrect'));
         } else {
             if (!$config->get('redirectToLogin')) {
                 $page->template->set('error', $l->s('notenoughrights') . ' ' . $l->s('logintoview'));
             }
         }
     } else {
         $t->set('url', url::action('login'));
         if ($_SERVER['REQUEST_METHOD'] == 'POST') {
             $user->login();
             // If we end up here, we did not properly login... probably
             // username or password not correct...
             $t->set('error', $l->s('passwordnotcorrect'));
         }
     }
     // Notify plugins of a PreSkinParse event;
     $data = array('page' => &$page, 'template' => &$page->template, 'type' => null, 'params' => array('action' => 'login', 'id' => null, 'args' => $args));
     $manager->handleEvent('PreSkinParse', $data);
     $page->template->set('title', $l->s('login'));
     $page->template->set('content', $t->fetch());
     $page->template->set('type', 'login');
     $page->show();
 }
开发者ID:KasaiDot,项目名称:Dashboard2,代码行数:46,代码来源:plugin.php

示例2: uasort

 function action_settings($args)
 {
     global $manager, $tree, $user, $lang;
     /* Get all admins */
     $admins = $manager->adminHandlers;
     /* Sort admins based on position */
     $compare_position = create_function('$a, $b', 'return ($a["position"] == $b["position"]) ? 0 : (($a["position"] < $b["position"]) ? -1 : 1);');
     uasort($admins, $compare_position);
     /* Decode arguments */
     $current = '';
     if (count($args)) {
         $current = array_shift($args);
     }
     if ($current == '' && count($admins)) {
         $current = key($admins);
     }
     reset($admins);
     // Setup template
     $page = new admin();
     // Notify plugins of a PreSkinParse event;
     $data = array('page' => &$page, 'template' => &$page->template, 'type' => 'admin', 'params' => array('action' => 'admin', 'args' => $args));
     $manager->handleEvent('PreSkinParse', $data);
     // Handle authorisation
     $ticket = false;
     if (isset($_REQUEST['ticket'])) {
         if (ticket::authorize($_REQUEST['ticket']) == $current) {
             $ticket = true;
         }
     }
     if ($ticket || $user->root() || $user->admin() && $admins[$current]['public']) {
         $t = new Template($this->getTemplate('tab.template'));
         $t->set('tabs', $admins);
         $t->set('current', $current);
         $page->template->set('tabs', $t->fetch());
         $manager->handleAdmin($current, $data);
         $page->show();
     } else {
         header('Location: ' . url::root());
         exit;
     }
 }
开发者ID:KasaiDot,项目名称:Dashboard2,代码行数:41,代码来源:plugin.php

示例3: header

 function action_view($args)
 {
     global $manager, $tree, $config, $user, $lang;
     // If no arguments are provided redirect
     if (!count($args)) {
         $id = $tree->getHome();
         if (!is_null($id)) {
             header('Location: ' . url::item($id));
             exit;
         }
         // There are no pages
         $id = 0;
         $type = '';
         $ext = '';
         $item = null;
         if ($user->admin()) {
             // Allow admins to add pages...
             $action = 'edit';
             $page = new admin();
             // Notify plugins of a PreSkinParse event;
             $data = array('page' => &$page, 'template' => &$page->template, 'type' => $type, 'params' => array('action' => $action, 'id' => $id, 'ext' => $ext, 'args' => $args));
             $manager->handleEvent('PreSkinParse', $data);
             $page->show();
             exit;
         } else {
             if ($lang->id != _DEFAULT_LANGUAGE_) {
                 // Redirect to the default language
                 header('Location: ' . url::language(_DEFAULT_LANGUAGE_));
             } else {
                 // Show error message that website is offline
                 $config = new config();
                 $lang = new language(_DEFAULT_LANGUAGE_, _DEFAULT_SITE_, true);
                 $page = new theme();
                 $page->showError(_OFFLINE_MESSAGE_, 4);
             }
         }
     } else {
         // Decode argumenst
         $id = array_shift($args);
         // Check if the id contains an file extension
         if (preg_match('/(.*)\\.([a-z0-9]+)$/i', $id, $matches)) {
             $id = $matches[1];
             $ext = $matches[2];
         } else {
             $ext = '';
         }
         // Load the page
         $item =& $tree->getItemById($id);
         $id = $item['id'];
         $type = $item['type'];
         $action = 'view';
         // Setup Theme
         $page = new theme($id, $type);
     }
     // Notify plugins of a PreSkinParse event;
     $data = array('page' => &$page, 'template' => &$page->template, 'type' => $type, 'params' => array('action' => $action, 'id' => $id, 'ext' => $ext, 'args' => $args));
     $manager->handleEvent('PreSkinParse', $data);
     // Handle authorisation
     $ticket = false;
     if (isset($_REQUEST['ticket'])) {
         if (ticket::authorize($_REQUEST['ticket']) == $data['params']['id']) {
             $ticket = true;
         }
     }
     if ($ticket || $tree->_hasRights('view', $item['rights'])) {
         $page->title->set($item['name']);
         if ($item['title'] != '') {
             $page->title->set($item['title']);
         }
         $manager->handleType($type, $data);
         $page->template->set('action', $action);
         $page->template->set('id', $id);
         $page->template->set('slug', isset($item['slug']) ? $item['slug'] : '');
         $page->template->set('type', $type);
         if (isset($item)) {
             if (!isset($manager->types[$item['type']]['generated']) || !$manager->types[$item['type']]['generated']) {
                 if ($config->get('showLastModified')) {
                     $page->template->set('modified', revisions::getModificationDate($id, $item['revision']));
                 }
             }
         }
     } else {
         if ($config->get('redirectToLogin') && $user->anonymous()) {
             array_unshift($args, $id);
             $manager->handleAction('login', $args);
             //header ('Location: ' . url::item($id, 'login'));
             exit;
         } else {
             $page->template->set('error', $lang->s('notenoughrights'));
         }
     }
     $page->show();
 }
开发者ID:KasaiDot,项目名称:Dashboard2,代码行数:93,代码来源:plugin.php


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