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


PHP Layout::plug方法代码示例

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


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

示例1: loadNavBar

 public static function loadNavBar()
 {
     $auth = \Current_User::getAuthorization();
     $vars['is_admin'] = \Current_User::allow('election');
     $vars['logout_uri'] = $auth->logout_link;
     $vars['username'] = \Current_User::getDisplayName();
     $template = new \Template($vars);
     $template->setModuleTemplate('election', 'navbar.html');
     $content = $template->get();
     \Layout::plug($content, 'NAV_LINKS');
 }
开发者ID:AppStateESS,项目名称:election,代码行数:11,代码来源:User.php

示例2: plug

 public static function plug()
 {
     $tpl = array();
     $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Menu', 'intern');
     $tpl['ADD_LINK'] = PHPWS_Text::moduleLink('Add Student', 'intern', array('action' => 'edit_internship'));
     $tpl['SEARCH_LINK'] = PHPWS_Text::moduleLink('Search', 'intern', array('action' => 'search'));
     $auth = Current_User::getAuthorization();
     $tpl['USER_FULL_NAME'] = Current_User::getDisplayName();
     $tpl['LOGOUT_URI'] = $auth->logout_link;
     $adminOptions = array();
     // Edit list of majors
     if (Current_User::allow('intern', 'edit_major')) {
         $adminOptions['EDIT_MAJORS_LINK'] = PHPWS_Text::secureLink('Edit Undergraduate Majors', 'intern', array('action' => MAJOR_EDIT));
     }
     // Edit list grad programs
     if (Current_User::allow('intern', 'edit_grad_prog')) {
         $adminOptions['EDIT_GRAD_LINK'] = PHPWS_Text::secureLink('Edit Graduate Programs', 'intern', array('action' => GRAD_PROG_EDIT));
     }
     // Edit departments
     if (Current_User::allow('intern', 'edit_dept')) {
         $adminOptions['EDIT_DEPARTMENTS_LINK'] = PHPWS_Text::secureLink('Edit Departments', 'intern', array('action' => DEPT_EDIT));
     }
     // Edit list of states
     if (Current_User::allow('intern', 'edit_states')) {
         $adminOptions['EDIT_STATES_LINK'] = PHPWS_Text::secureLink('Edit States', 'intern', array('action' => STATE_EDIT));
     }
     if (Current_User::isDeity()) {
         $adminOptions['CONTROL_PANEL'] = PHPWS_Text::secureLink('Control Panel', 'controlpanel');
         $adminOptions['EDIT_ADMINS_LINK'] = PHPWS_Text::secureLink('Edit Administrators', 'intern', array('action' => 'edit_admins'));
     }
     // If any admin options were added, them show the dropdown and merge those
     // links into the main set of template tags
     if (sizeof($adminOptions) > 0) {
         $tpl['ADMIN_OPTIONS'] = '';
         // dummy var to show dropdown menu in template
         $tpl = array_merge($tpl, $adminOptions);
     }
     Layout::plug(PHPWS_Template::process($tpl, 'intern', 'top.tpl'), 'NAV_LINKS');
 }
开发者ID:jeffrafter,项目名称:InternshipInventory,代码行数:39,代码来源:TopUI.php

示例3: javascript

<?php

javascript('jquery');
Layout::plug(Layout::getPageTitle(TRUE), 'SITE_TITLE');
Layout::addJSHeader('<script type="text/javascript" src="' . PHPWS_SOURCE_HTTP . 'themes/bootstrap/js/bootstrap.min.js"></script>', 'bootstrap');
Layout::addJSHeader('<script type="text/javascript" src="' . PHPWS_SOURCE_HTTP . 'themes/bootstrap/js/modal_fix.js"></script>', 'fix');
$key = Key::getCurrent();
if (!is_null($key)) {
    Layout::plug('active', 'CONTENT_PAGE');
}
开发者ID:HaldunA,项目名称:phpwebsite,代码行数:10,代码来源:theme.php

示例4: addNavLinks

 /**
  * This function adds links to the navigation bar at the top of the page.
  * This function assumes that there is a NAV_LINKS tag in the main theme template.
  */
 private function addNavLinks()
 {
     // Link to the pages. One nav button for each link.
     $viewStats = array("LINK" => "index.php?module=faxmaster&op=show_stats", "TEXT" => "View Statistics");
     $viewArchive = array("LINK" => "index.php?module=faxmaster&op=show_archive", "TEXT" => "View Archive");
     $settings = array("LINK" => "index.php?module=faxmaster&op=settings", "TEXT" => "Settings");
     $actionLog = array("LINK" => "index.php?module=faxmaster&op=showActionLog", "TEXT" => "Action Log");
     // Fill the links array
     $links = array();
     $links['repeat_nav_links'][] = $viewStats;
     // view stats button
     // Only show 'View Archive' button if user has permission to view the archive
     if (Current_User::allow('faxmaster', 'viewArchive')) {
         $links['repeat_nav_links'][] = $viewArchive;
         // view archive button
     }
     // Only show 'Settings' button if user has proper permissions
     if (Current_User::allow('faxmaster', 'settings')) {
         $links['repeat_nav_links'][] = $settings;
         // settings button
     }
     $links['repeat_nav_links'][] = $actionLog;
     $links['BRAND'] = 'Fax Server';
     $links['BRAND_LINK'] = 'index.php';
     if (Current_User::isDeity()) {
         $links['CONTROL_PANEL'] = PHPWS_Text::secureLink('Control Panel', 'controlpanel');
         $links['ADMIN_OPTIONS'] = '';
         //dummy tag to show dropdown menu in template
     }
     $links['USER_FULL_NAME'] = Current_User::getDisplayName();
     $auth = Current_User::getAuthorization();
     $links['LOGOUT_URI'] = $auth->logout_link;
     // Plug the navlinks into the navbar
     $navLinks = PHPWS_Template::process($links, 'faxmaster', 'navLinks.tpl');
     Layout::plug($navLinks, 'NAV_LINKS');
 }
开发者ID:sinkdb,项目名称:faxserv,代码行数:40,代码来源:Faxmaster.php

示例5: loadAdminBar

 public static function loadAdminBar()
 {
     $auth = \Current_User::getAuthorization();
     $nav_vars['is_deity'] = \Current_user::isDeity();
     $nav_vars['logout_uri'] = $auth->logout_link;
     $nav_vars['username'] = \Current_User::getDisplayName();
     if (\Current_User::allow('systemsinventory', 'edit')) {
         $nav_vars['add'] = '<a href="systemsinventory/system/add"><i class="fa fa-plus"></i> Add System</a>';
     }
     if (\Current_User::allow('systemsinventory', 'view')) {
         $nav_vars['search'] = '<a href="systemsinventory/search"><i class="fa fa-search"></i> Search Systems</a>';
     }
     if (\Current_User::allow('systemsinventory', 'reports')) {
         $nav_vars['reports'] = '<a href="systemsinventory/reports"><i class="fa fa-area-chart"></i> Reports</a>';
     }
     if (\Current_User::allow('systemsinventory', 'settings')) {
         $nav_vars['settings'] = '<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"><i class="fa fa-cog"></i> Settings</a>';
     }
     $nav_bar = new \Template($nav_vars);
     $nav_bar->setModuleTemplate('systemsinventory', 'navbar.html');
     $content = $nav_bar->get();
     \Layout::plug($content, 'NAV_LINKS');
 }
开发者ID:AppStateESS,项目名称:systemsinventory,代码行数:23,代码来源:System.php


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