本文整理汇总了PHP中Layout::add方法的典型用法代码示例。如果您正苦于以下问题:PHP Layout::add方法的具体用法?PHP Layout::add怎么用?PHP Layout::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Layout
的用法示例。
在下文中一共展示了Layout::add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: plugInternship
/**
* Loads the form's fields with the internship's information.
* TODO: Use getter methods instead of just accessing Internship member variables directly.
*/
public function plugInternship()
{
$this->plugStudent();
$this->plugDept();
$this->plugFaculty();
$this->plugAgency();
$this->plugInternInfo();
$this->plugCourseInfo();
// We're editing an internship...
// If this internship's term is in the past, then replace the term list with just that term
if (!in_array($this->intern->term, array_keys(Term::getFutureTermsAssoc()))) {
// Remove the term dropdown and repalce it
$this->form->dropElement('term');
$this->form->addSelect('term', array($this->intern->term => Term::rawToRead($this->intern->term)));
$this->form->setLabel('term', 'Select Term');
$this->form->addCssClass('term', 'form-control');
}
$this->form->setMatch('term', $this->intern->term);
$this->form->setMatch('experience_type', $this->intern->getExperienceType());
// Plug
$this->form->plugIn($this->formVals);
/**
* *
* Emergency Contacts
*/
//javascript('jquery');
PHPWS_Core::initModClass('intern', 'EmergencyContactFactory.php');
$contacts = EmergencyContactFactory::getContactsForInternship($this->intern);
$emgContactJson = json_encode($contacts);
Layout::add(javascriptMod('intern', 'emergencyContact', array('existing_contacts_json' => $emgContactJson)));
}
示例2: showFP
function showFP()
{
$db = new PHPWS_DB('ps_page');
$db->addWhere('front_page', 1);
if ($db->isTableColumn('deleted')) {
$db->addWhere('deleted', 0);
}
Key::restrictView($db, 'pagesmith');
$db->loadClass('pagesmith', 'PS_Page.php');
$result = $db->getObjects('PS_Page');
if (!PHPWS_Error::logIfError($result) && !empty($result)) {
PHPWS_Core::initModClass('pagesmith', 'PageSmith.php');
foreach ($result as $page) {
$content = $page->view();
if ($content && !PHPWS_Error::logIfError($content)) {
if (Current_User::allow('pagesmith', 'edit_page', $page->id)) {
$content .= sprintf('<p class="pagesmith-edit">%s</p>', $page->editLink());
}
Layout::add($content, 'pagesmith', 'view_' . $page->id, TRUE);
}
}
} else {
return null;
}
}
示例3: main
public function main()
{
$auth = Current_User::getAuthorization();
if (!Current_User::isLogged() || !$auth->local_user) {
PHPWS_Core::errorPage('403');
}
$result = $this->init();
if (PHPWS_Error::isError($result)) {
PHPWS_Error::log($result);
Layout::add(PHPWS_ControlPanel::display(dgettext('users', 'The is a problem with My Page.')));
return;
} elseif (!$result) {
Layout::add(PHPWS_ControlPanel::display(dgettext('users', 'No modules are registered to My Page.')));
return;
}
$panel = My_Page::cpanel();
$module = $panel->getCurrentTab();
if (!$this->moduleIsRegistered($module)) {
Layout::add(dgettext('users', 'This module is not registered with My Page'));
return;
}
$content = My_Page::userOption($module);
if (PHPWS_Error::isError($content)) {
$content = $content->getMessage();
}
Layout::add(PHPWS_ControlPanel::display($content));
}
示例4: process
public static function process()
{
if (!Current_User::authorized('analytics')) {
Current_User::disallow();
}
$panel = self::cpanel();
if (isset($_REQUEST['command'])) {
$command = $_REQUEST['command'];
} else {
$command = $panel->getCurrentTab();
}
switch ($command) {
case 'list':
$panel->setContent(self::listTrackers());
break;
case 'new':
$panel->setContent(self::newTracker());
break;
case 'create':
$panel->setContent(self::createTracker());
break;
case 'edit':
$panel->setContent(self::editTracker());
break;
case 'delete':
$panel->setContent(self::deleteTracker());
break;
case 'save_tracker':
$panel->setContent(self::saveTracker());
break;
}
Layout::add(PHPWS_ControlPanel::display($panel->display()));
}
示例5: show
public function show($archive = FALSE)
{
javascript('/jquery/');
javascript('/jquery_ui/');
$tpl = array();
$tpl['PAGER'] = $this->pager->get();
Layout::add(PHPWS_Template::process($tpl, 'faxmaster', 'faxList.tpl'));
}
示例6: showHMS
public function showHMS($content)
{
$tpl = array();
$tpl['MAIN'] = $content;
$navbar = new NavBar();
$tpl['NAVBAR'] = $navbar->show();
\Layout::addStyle('hms', 'css/hms.css');
\Layout::add(\PHPWS_Template::process($tpl, 'hms', 'hms.tpl'));
}
示例7: display
private function display()
{
\Layout::addStyle('properties');
$tpl['TITLE'] = $this->title;
$tpl['CONTENT'] = $this->content;
$tpl['MESSAGE'] = $this->message;
$final_content = \PHPWS_Template::process($tpl, 'properties', 'admin.tpl');
\Layout::add(\PHPWS_ControlPanel::display($this->panel->display($final_content)));
}
示例8: shortcuts
public static function shortcuts()
{
if (!Current_User::allow('access')) {
Current_User::disallow();
return;
}
$modal = new Modal('access-shortcut', null, dgettext('access', 'Shortcuts'));
$modal->sizeSmall();
$button = '<button class="btn btn-success" id="save-shortcut">Save</button>';
$modal->addButton($button);
\Layout::add((string) $modal);
javascript('jquery');
\Layout::includeJavascript('mod/access/javascript/access.min.js');
PHPWS_Core::initModClass('access', 'Shortcut.php');
PHPWS_Core::initCoreClass('DBPager.php');
$pager = new DBPager('access_shortcuts', 'Access_Shortcut');
$pager->setModule('access');
$pager->setTemplate('forms/shortcut_list.tpl');
$pager->setLink('index.php?module=access&tab=shortcuts');
$pager->addToggle('class="bgcolor1"');
$pager->setSearch('keyword');
$form = new PHPWS_Form('shortcut_list');
$form->addHidden('module', 'access');
$form->addHidden('command', 'post_shortcut_list');
$options['none'] = '';
if (Current_User::allow('access', 'admin_options')) {
$options['active'] = dgettext('access', 'Activate');
$options['deactive'] = dgettext('access', 'Deactivate');
}
$options['delete'] = dgettext('access', 'Delete');
$form->addSelect('list_action', $options);
$page_tags = $form->getTemplate();
$page_tags['MENU_FIX'] = PHPWS_Text::secureLink(dgettext('access', 'Update menu links'), 'access', array('command' => 'menu_fix'));
$page_tags['PAGE_FIX'] = PHPWS_Text::secureLink(dgettext('access', 'Shortcut all pages'), 'access', array('command' => 'page_fix'));
if (PHPWS_Settings::get('access', 'forward_ids')) {
$page_tags['PAGE_FORWARDING'] = PHPWS_Text::secureLink(dgettext('access', 'Turn OFF autoforwarding of Pagesmith id pages'), 'access', array('command' => 'autoforward_off'));
} else {
$page_tags['PAGE_FORWARDING'] = PHPWS_Text::secureLink(dgettext('access', 'Turn ON autoforwarding of Pagesmith id pages'), 'access', array('command' => 'autoforward_on'));
}
$page_tags['MENU_WARNING'] = dgettext('menu', 'This change is irreversable. Please backup menu_links prior to running it.');
$page_tags['URL_LABEL'] = dgettext('access', 'Url');
$page_tags['ACTIVE_LABEL'] = dgettext('access', 'Active?');
$page_tags['ACTION_LABEL'] = dgettext('access', 'Action');
$page_tags['CHECK_ALL_SHORTCUTS'] = javascript('check_all', array('checkbox_name' => 'shortcut[]'));
$js_vars['value'] = dgettext('access', 'Go');
$js_vars['select_id'] = $form->getId('list_action');
$js_vars['action_match'] = 'delete';
$js_vars['message'] = dgettext('access', 'Are you sure you want to delete the checked shortcuts?');
$page_tags['SUBMIT'] = javascript('select_confirm', $js_vars);
$pager->addPageTags($page_tags);
$pager->addRowTags('rowTags');
$content = $pager->get();
return $content;
}
示例9: showFeeds
public static function showFeeds()
{
PHPWS_Core::initModClass('rss', 'Feed.php');
$db = new PHPWS_DB('rss_feeds');
$db->addWhere('display', 1);
$result = $db->getObjects('RSS_Feed');
if (empty($result)) {
return;
}
foreach ($result as $feed) {
$listing[] = $feed->view();
}
Layout::add(implode('', $listing), 'rss', 'feeds');
}
示例10: userStatusSidebar
public static function userStatusSidebar()
{
$game = Factory::getCurrent();
if (empty($game)) {
$vars['current_game'] = 'No game scheduled. Check back later.';
} else {
$vars['current_game'] = Factory::getGameStatus($game);
}
$vars['student_status'] = \tailgate\Factory\Lottery::getStudentStatus();
$template = new \Template();
$template->addVariables($vars);
$template->setModuleTemplate('tailgate', 'User/sidebar.html');
$content = $template->get();
\Layout::add($content, 'tailgate', 'user_info');
}
示例11: view
public function view()
{
$key = \Key::getCurrent();
if (!\Key::checkKey($key)) {
return;
}
$tpl = array();
$allSettings = $this->settings->getAll();
foreach ($allSettings as $key => $value) {
if ($value == 1) {
$tpl[$key] = "";
// dummy template
}
}
$content = \PHPWS_Template::process($tpl, 'addthis', 'addThis.tpl');
\Layout::add($content, 'addthis', 'DEFAULT');
}
示例12: process
public function process()
{
// This hack is the most awful hack ever. Fix phpWebSite so that
// user logins are logged separately.
if (Current_User::isLogged() && !isset($_SESSION['HMS_LOGGED_THE_LOGIN'])) {
$username = strtolower(Current_User::getUsername());
HMS_Activity_Log::log_activity($username, ACTIVITY_LOGIN, $username, NULL);
$_SESSION['HMS_LOGGED_THE_LOGIN'] = $username;
}
if (!Current_User::isLogged() && $this->context->get('action') != 'ShowFrontPage') {
NQ::simple('hms', hms\NotificationView::ERROR, 'You must be logged in to do that.');
$action = 'ShowFrontPage';
} else {
$action = $this->context->get('action');
}
$cmd = CommandFactory::getCommand($action);
if (HMS_DEBUG) {
$cmd->execute($this->context);
} else {
try {
$cmd->execute($this->context);
} catch (PermissionException $p) {
NQ::Simple('hms', hms\NotificationView::ERROR, 'You do not have permission to perform that action. If you believe this is an error, please contact University Housing.');
$nv = new hms\NotificationView();
$nv->popNotifications();
Layout::add($nv->show());
} catch (Exception $e) {
try {
$message = $this->formatException($e);
NQ::Simple('hms', hms\NotificationView::ERROR, 'An internal error has occurred, and the authorities have been notified. We apologize for the inconvenience.');
$this->emailError($message);
$nv = new hms\NotificationView();
$nv->popNotifications();
Layout::add($nv->show());
} catch (Exception $e) {
$message2 = $this->formatException($e);
echo "HMS has experienced a major internal error. Attempting to email an admin and then exit.";
$message = "Something terrible has happened, and the exception catch-all threw an exception.\n\nThe first exception was:\n\n{$message}\n\nThe second exception was:\n\n{$message2}";
mail(FROM_ADDRESS, 'A Major HMS Error Has Occurred', $message);
exit;
}
}
}
}
示例13: showBlocks
public static function showBlocks($key)
{
$db = new PHPWS_DB('block');
$db->addWhere('block_pinned.key_id', $key->id);
$db->addWhere('id', 'block_pinned.block_id');
Key::restrictView($db, 'block');
$result = $db->getObjects('Block_Item');
if (PHPWS_Error::isError($result)) {
PHPWS_Error::log($result);
return NULL;
}
if (empty($result)) {
return NULL;
}
foreach ($result as $block) {
$block->setPinKey($key);
Layout::add($block->view(), 'block', $block->getContentVar());
$GLOBALS['Current_Blocks'][$block->id] = TRUE;
}
}
示例14: view
public function view()
{
$tpl = array();
/*
foreach($allSettings as $key=>$value){
if($value == 1){
$tpl[$key] = ""; // dummy template
}
}
*/
if ($this->settings->get('enabled') === true) {
return;
}
$tpl['fb_url'] = $this->settings->get('fb_url');
$tpl['width'] = $this->settings->get('width');
$tpl['height'] = $this->settings->get('height');
if ($this->settings->get('show_header') == 1) {
$tpl['show_header'] = 'true';
} else {
$tpl['show_header'] = 'false';
}
if ($this->settings->get('show_border') == 1) {
$tpl['show_border'] = 'true';
} else {
$tpl['show_border'] = 'false';
}
if ($this->settings->get('show_stream') == 1) {
$tpl['show_stream'] = 'true';
} else {
$tpl['show_stream'] = 'false';
}
if ($this->settings->get('show_faces') == 1) {
$tpl['show_faces'] = 'true';
} else {
$tpl['show_faces'] = 'false';
}
$content = PHPWS_Template::process($tpl, 'likebox', 'likebox.tpl');
Layout::add($content, 'likebox', 'DEFAULT');
}
示例15: action
public static function action()
{
if (!Current_User::allow('block')) {
Current_User::disallow();
return;
}
$panel = Block_Admin::cpanel();
if (isset($_REQUEST['action'])) {
$action = $_REQUEST['action'];
} else {
$tab = $panel->getCurrentTab();
if (empty($tab)) {
$action = 'new';
} else {
$action =& $tab;
}
}
$content = Block_Admin::route($action);
$panel->setContent($content);
$finalPanel = $panel->display();
Layout::add(PHPWS_ControlPanel::display($finalPanel));
}