本文整理汇总了PHP中TBGSettings::isMaintenanceModeEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP TBGSettings::isMaintenanceModeEnabled方法的具体用法?PHP TBGSettings::isMaintenanceModeEnabled怎么用?PHP TBGSettings::isMaintenanceModeEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TBGSettings
的用法示例。
在下文中一共展示了TBGSettings::isMaintenanceModeEnabled方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __
<option value=0<?php
if (!TBGSettings::isMaintenanceModeEnabled()) {
?>
selected<?php
}
?>
><?php
echo __('No');
?>
</option>
</select>
<?php
} else {
?>
<?php
echo TBGSettings::isMaintenanceModeEnabled() ? __('Yes') : __('No');
?>
<?php
}
?>
</td>
<tr>
<td class="config_explanation" colspan="2"><?php
echo __('In maintenance mode, access to The Bug Genie will be disabled, except for the Configuration pages. This allows you to perform upgrades and other maintance without interruption. Please remember that if you log out, you will be unable to log back in again whilst maintenace mode is enabled.');
?>
</td>
</tr>
<tr>
<td><label for="offline_msg"><?php
echo __('Maintenance mode message');
?>
示例2: image_tag
$link = TBGSettings::getHeaderLink() == '' ? TBGContext::getTBGPath() : TBGSettings::getHeaderLink();
?>
<a class="logo" href="<?php
print $link;
?>
"><?php
echo image_tag(TBGSettings::getHeaderIconUrl(), array('style' => 'max-height: 24px;'), TBGSettings::isUsingCustomHeaderIcon());
?>
</a>
<div class="logo_name"><?php
echo TBGSettings::getTBGname();
?>
</div>
</div>
<?php
if (!TBGSettings::isMaintenanceModeEnabled()) {
?>
<?php
if (TBGEvent::createNew('core', 'header_mainmenu_decider')->trigger()->getReturnValue() !== false) {
?>
<?php
require THEBUGGENIE_CORE_PATH . 'templates/headermainmenu.inc.php';
?>
<?php
}
?>
<nav class="tab_menu header_menu" id="header_userinfo">
<div class="notifications" id="user_notifications">
<h1>
<?php
echo __('Your notifications');
示例3: performAction
//.........这里部分代码省略.........
// we continue on to rendering the template file for that specific action
TBGLogging::log('...done');
TBGLogging::log('Displaying template');
// Check to see if we have a translated version of the template
if ($method != 'notFound' && (!self::isReadySetup() || ($templateName = self::getI18n()->hasTranslatedTemplate(self::getResponse()->getTemplate())) === false)) {
// Check to see if any modules provide an alternate template
$event = TBGEvent::createNew('core', "TBGContext::performAction::renderTemplate")->triggerUntilProcessed(array('class' => $actionClassName, 'action' => $actionToRunName));
if ($event->isProcessed()) {
$templateName = $event->getReturnValue();
}
// Check to see if the template has been changed, and whether it's in a
// different module, specified by "module/templatename"
if (mb_strpos(self::getResponse()->getTemplate(), '/')) {
$newPath = explode('/', self::getResponse()->getTemplate());
$templateName = THEBUGGENIE_MODULES_PATH . $newPath[0] . DS . 'templates' . DS . $newPath[1] . '.' . TBGContext::getRequest()->getRequestedFormat() . '.php';
} else {
$templateName = $templatePath . self::getResponse()->getTemplate();
}
}
// Check to see if the template exists and throw an exception otherwise
if (!file_exists($templateName)) {
TBGLogging::log('The template file for the ' . $method . ' action ("' . self::getResponse()->getTemplate() . '") does not exist', 'core', TBGLogging::LEVEL_FATAL);
throw new TBGTemplateNotFoundException('The template file for the ' . $method . ' action ("' . self::getResponse()->getTemplate() . '") does not exist');
}
self::loadLibrary('common');
// Present template for current action
TBGActionComponent::presentTemplate($templateName, $action->getParameterHolder());
$content = ob_get_clean();
TBGLogging::log('...completed');
}
} elseif (self::$_debug_mode) {
$time = explode(' ', microtime());
$posttime = $time[1] + $time[0];
TBGContext::visitPartial($visited_templatename, $posttime - $pretime);
}
if (!isset($tbg_response)) {
/**
* @global TBGRequest The request object
*/
$tbg_request = self::getRequest();
/**
* @global TBGUser The user object
*/
$tbg_user = self::getUser();
/**
* @global TBGResponse The action object
*/
$tbg_response = self::getResponse();
// Load the "ui" library, since this is used a lot
self::loadLibrary('ui');
}
self::loadLibrary('common');
TBGLogging::log('rendering final content');
if (TBGSettings::isMaintenanceModeEnabled() && !mb_strstr(self::getRouting()->getCurrentRouteName(), 'configure')) {
if (!file_exists(THEBUGGENIE_CORE_PATH . 'templates/offline.inc.php')) {
throw new TBGTemplateNotFoundException('Can not find offline mode template');
}
ob_start('mb_output_handler');
ob_implicit_flush(0);
require THEBUGGENIE_CORE_PATH . 'templates/offline.inc.php';
$content = ob_get_clean();
}
// Render output in correct order
self::getResponse()->renderHeaders();
if (self::getResponse()->getDecoration() == TBGResponse::DECORATE_DEFAULT && !self::getRequest()->isAjaxCall()) {
ob_start('mb_output_handler');
ob_implicit_flush(0);
require THEBUGGENIE_CORE_PATH . 'templates/layout.php';
ob_flush();
} else {
// Render header template if any, and store the output in a variable
if (!self::getRequest()->isAjaxCall() && self::getResponse()->doDecorateHeader()) {
TBGLogging::log('decorating with header');
if (!file_exists(self::getResponse()->getHeaderDecoration())) {
throw new TBGTemplateNotFoundException('Can not find header decoration: ' . self::getResponse()->getHeaderDecoration());
}
require self::getResponse()->getHeaderDecoration();
}
echo $content;
TBGLogging::log('...done (rendering content)');
// Render footer template if any
if (!self::getRequest()->isAjaxCall() && self::getResponse()->doDecorateFooter()) {
TBGLogging::log('decorating with footer');
if (!file_exists(self::getResponse()->getFooterDecoration())) {
throw new TBGTemplateNotFoundException('Can not find footer decoration: ' . self::getResponse()->getFooterDecoration());
}
require self::getResponse()->getFooterDecoration();
}
TBGLogging::log('...done');
}
TBGLogging::log('done (rendering final content)');
if (self::isReadySetup() && self::isDebugMode()) {
self::getI18n()->addMissingStringsToStringsFile();
}
return true;
} else {
TBGLogging::log("Cannot find the method {$actionToRunName}() in class {$actionClassName}.", 'core', TBGLogging::LEVEL_FATAL);
throw new TBGActionNotFoundException("Cannot find the method {$actionToRunName}() in class {$actionClassName}. Make sure the method exists.");
}
}