本文整理汇总了PHP中BxDolStudioTemplate类的典型用法代码示例。如果您正苦于以下问题:PHP BxDolStudioTemplate类的具体用法?PHP BxDolStudioTemplate怎么用?PHP BxDolStudioTemplate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BxDolStudioTemplate类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: activate
function activate($sTemplate)
{
$aTemplate = BxDolModuleQuery::getInstance()->getModuleByName($sTemplate);
if (empty($aTemplate) || !is_array($aTemplate)) {
return array('code' => 1, 'message' => _t('_adm_err_operation_failed'));
}
$aTemplates = array();
$iTemplates = $this->oDb->getTemplatesBy(array('type' => 'active'), $aTemplates);
if ($iTemplates == 1 && $aTemplates[0]['name'] == $sTemplate) {
return array('code' => 1, 'message' => _t('_adm_dsg_err_last_active'));
}
$sTemplateDefault = getParam('template');
if ($aTemplate['uri'] == $sTemplateDefault) {
return array('code' => 2, 'message' => _t('_adm_dsg_err_deactivate_default'));
}
$oInstallerUtils = BxDolStudioInstallerUtils::getInstance();
$aResult = (int) $aTemplate['enabled'] == 0 ? $oInstallerUtils->perform($aTemplate['path'], 'enable') : $oInstallerUtils->perform($aTemplate['path'], 'disable');
if ($aResult['code'] != 0) {
return $aResult;
}
$oTemplate = BxDolStudioTemplate::getInstance();
$aResult = array('code' => 0, 'message' => _t('_adm_scs_operation_done'));
if ((int) $aTemplate['enabled'] == 0) {
$aResult['content'] = $oTemplate->parseHtmlByName('page_content_2_col.html', array('page_menu_code' => $this->getPageMenu(), 'page_main_code' => $this->getPageCode()));
} else {
$aResult['content'] = "";
}
return $aResult;
}
示例2: getCode
function getCode()
{
bx_import('BxTemplStudioMenu');
$aTmplVars = array();
foreach ($this->aItems as $sPosition => $mixedItems) {
if (!$this->aVisible[$sPosition]) {
continue;
}
$sContent = "";
if (is_array($mixedItems)) {
$oMenu = new BxTemplStudioMenu(array('template' => 'menu_top_toolbar.html', 'menu_items' => $mixedItems));
$sContent = $oMenu->getCode();
} else {
if (is_string($mixedItems) && !empty($mixedItems)) {
$sContent = $mixedItems;
}
}
$aTmplVars[] = array('name' => $sPosition, 'content' => $sContent);
}
if (empty($aTmplVars)) {
return '';
}
$oTemplate = BxDolStudioTemplate::getInstance();
$oTemplate->addJs($this->getJs());
$oTemplate->addCss($this->getCss());
return $oTemplate->parseHtmlByName('menu_top.html', array('bx_repeat:menus' => $aTmplVars));
}
示例3: _action
protected function _action($sCache, $sMode = 'clear')
{
$sFuncCacheObject = $sMode == 'clear' ? '_clearObject' : '_getSizeObject';
$sFuncCacheFile = $sMode == 'clear' ? '_clearFile' : '_getSizeFile';
$mixedResult = false;
switch ($sCache) {
case 'db':
if (getParam('sys_db_cache_enable') != 'on') {
break;
}
$oCacheDb = BxDolDb::getInstance()->getDbCacheObject();
$mixedResult = $this->{$sFuncCacheObject}($oCacheDb, 'db_');
break;
case 'template':
if (getParam('sys_template_cache_enable') != 'on') {
break;
}
$oCacheTemplates = BxDolTemplate::getInstance()->getTemplatesCacheObject();
$mixedResult = $this->{$sFuncCacheObject}($oCacheTemplates, BxDolStudioTemplate::getInstance()->getCacheFilePrefix($sCache));
break;
case 'css':
if (getParam('sys_template_cache_css_enable') != 'on') {
break;
}
$mixedResult = $this->{$sFuncCacheFile}(BxDolStudioTemplate::getInstance()->getCacheFilePrefix($sCache), BX_DIRECTORY_PATH_CACHE_PUBLIC);
break;
case 'js':
if (getParam('sys_template_cache_js_enable') != 'on') {
break;
}
$mixedResult = $this->{$sFuncCacheFile}(BxDolStudioTemplate::getInstance()->getCacheFilePrefix($sCache), BX_DIRECTORY_PATH_CACHE_PUBLIC);
break;
}
return $mixedResult;
}
示例4: __construct
function __construct($iTimeStart)
{
parent::__construct();
$this->oConfig = new BxProfilerConfig($GLOBALS['bx_profiler_module']);
$this->oTemplate = new BxProfilerTemplate($this->oConfig);
$this->oTemplateAdmin = BxDolStudioTemplate::getInstance();
$aCss = array('profiler.css', BX_DIRECTORY_PATH_PLUGINS_PUBLIC . 'jush/|jush.css');
$aJs = array('jquery.tablesorter.min.js', 'profiler.js', 'jush/jush.js');
foreach ($aCss as $sCssUrl) {
$this->oTemplate->addCss($sCssUrl);
$this->oTemplateAdmin->addCss($sCssUrl);
}
foreach ($aJs as $sJsUrl) {
$this->oTemplate->addJs($sJsUrl);
$this->oTemplateAdmin->addJs($sJsUrl);
}
if (getParam('bx_profiler_long_sql_queries_log')) {
$this->aConf['long_query'] = getParam('bx_profiler_long_sql_queries_time');
}
if (getParam('bx_profiler_long_module_query_log')) {
$this->aConf['long_module'] = getParam('bx_profiler_long_module_query_time');
}
if (getParam('bx_profiler_long_page_log')) {
$this->aConf['long_page'] = getParam('bx_profiler_long_page_time');
}
$this->_iTimeStart = $iTimeStart;
}
示例5: getSettings
protected function getSettings()
{
$oTemplate = BxDolStudioTemplate::getInstance();
bx_import('BxTemplStudioSettings');
$oPage = new BxTemplStudioSettings($this->sModule);
$aTmplVars = array('bx_repeat:blocks' => $oPage->getPageCode());
return $oTemplate->parseHtmlByName('module.html', $aTmplVars);
}
示例6: getGrid
protected function getGrid($sObjectName)
{
$oGrid = BxDolGrid::getObjectInstance($sObjectName);
if (!$oGrid) {
return '';
}
return BxDolStudioTemplate::getInstance()->parseHtmlByName('polyglot.html', array('content' => $this->getBlockCode(array('items' => $oGrid->getCode()))));
}
示例7: getGrid
protected function getGrid($sObjectName)
{
$oGrid = BxDolGrid::getObjectInstance($sObjectName);
if (!$oGrid) {
return '';
}
$aTmplVars = array('js_object' => $this->getPageJsObject(), 'bx_repeat:blocks' => array(array('caption' => '', 'panel_top' => '', 'items' => $oGrid->getCode(), 'panel_bottom' => '')));
return BxDolStudioTemplate::getInstance()->parseHtmlByName('permissions.html', $aTmplVars);
}
示例8: __construct
function __construct()
{
parent::__construct();
$oTemplate = BxDolStudioTemplate::getInstance();
$this->aVisible[BX_DOL_STUDIO_MT_LEFT] = true;
$this->aVisible[BX_DOL_STUDIO_MT_RIGHT] = true;
$this->aItems[BX_DOL_STUDIO_MT_LEFT] = $oTemplate->parseHtmlByName('splash_logo.html', array());
$this->aItems[BX_DOL_STUDIO_MT_RIGHT] = array('site' => array('name' => 'profile', 'icon' => 'user', 'link' => BxDolPermalinks::getInstance()->permalink('page.php?i=create-account'), 'title' => ''));
}
示例9: getIcon
protected function getIcon(&$aWidget)
{
$oTemplate = BxDolStudioTemplate::getInstance();
$sUrl = $oTemplate->getIconUrl($aWidget['icon']);
if (empty($sUrl)) {
$aModule = BxDolModuleQuery::getInstance()->getModuleByName($aWidget['module']);
$sUrl = BxDolStudioUtils::getIconDefault($aModule['type']);
}
return $sUrl;
}
示例10: getGrid
protected function getGrid($sObjectName)
{
$oTemplate = BxDolStudioTemplate::getInstance();
bx_import('BxDolGrid');
$oGrid = BxDolGrid::getObjectInstance($sObjectName);
if (!$oGrid) {
return '';
}
$aTmplVars = array('bx_repeat:blocks' => array(array('caption' => '', 'panel_top' => '', 'items' => $oGrid->getCode(), 'panel_bottom' => '')));
return $oTemplate->parseHtmlByName('polyglot.html', $aTmplVars);
}
示例11: serviceGetCacheUpdater
public function serviceGetCacheUpdater()
{
check_logged();
if (!isAdmin()) {
return '';
}
$oTemplate = BxDolStudioTemplate::getInstance();
$sContent = $oTemplate->addJs('launcher.js', true);
$sContent .= $oTemplate->parseHtmlByName('launcher_cache_updater.html', array('js_object' => $this->getPageJsObject()));
return $sContent;
}
示例12: getLanguagesInfo
function getLanguagesInfo($bIdAsKey = false, $bActiveOnly = false)
{
$aLanguages = array();
$this->oDb->getLanguagesBy(array('type' => 'all'), $aLanguages, false);
if (!is_array($aLanguages) || empty($aLanguages)) {
return $aLanguages;
}
$oTemplate = BxDolStudioTemplate::getInstance();
foreach ($aLanguages as $iKey => $aLanguage) {
$aLanguages[$iKey]['icon'] = $oTemplate->getIconUrl('sys_fl_' . $aLanguage['flag'] . '.gif');
}
return $aLanguages;
}
示例13: getLanguagesInfo
function getLanguagesInfo($bIdAsKey = false, $bActiveOnly = false)
{
$aLanguages = array();
$this->oDb->getLanguagesBy(array('type' => 'all'), $aLanguages, false);
if (!is_array($aLanguages) || empty($aLanguages)) {
return $aLanguages;
}
$oTemplate = BxDolStudioTemplate::getInstance();
foreach ($aLanguages as $iKey => $aLanguage) {
$aLanguages[$iKey]['icon'] = genFlag($aLanguage['name'], $oTemplate);
}
return $aLanguages;
}
示例14: getLoginForm
function getLoginForm()
{
$oTemplate = BxDolStudioTemplate::getInstance();
$sUrlRelocate = bx_get('relocate');
if (empty($sUrlRelocate) || basename($sUrlRelocate) == 'index.php') {
$sUrlRelocate = '';
}
$oTemplate->addJsTranslation(array('_adm_txt_login_username', '_adm_txt_login_password'));
$sHtml = $oTemplate->parseHtmlByName('login_form.html', array('role' => BX_DOL_ROLE_ADMIN, 'csrf_token' => BxDolForm::genCsrfToken(true), 'relocate_url' => bx_html_attribute($sUrlRelocate), 'action_url' => BX_DOL_URL_ROOT . 'member.php', 'forgot_password_url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password')));
$sHtml = $oTemplate->parseHtmlByName('login.html', array('form' => $this->transBox('bx-std-login-form-box', $sHtml, true)));
$oTemplate->setPageNameIndex(BX_PAGE_CLEAR);
$oTemplate->setPageParams(array('css_name' => array('forms.css', 'login.css'), 'js_name' => array('jquery-ui/jquery.ui.position.min.js', 'jquery.form.min.js', 'jquery.dolPopup.js', 'login.js'), 'header' => _t('_adm_page_cpt_login')));
$oTemplate->setPageContent('page_main_code', $sHtml);
$oTemplate->getPageCode();
}
示例15: __construct
function __construct($iTimeStart)
{
parent::__construct();
$this->oConfig = new BxProfilerConfig($GLOBALS['bx_profiler_module']);
$this->oTemplate = new BxProfilerTemplate($this->oConfig);
$this->oTemplateAdmin = BxDolStudioTemplate::getInstance();
if (getParam('bx_profiler_long_sql_queries_log')) {
$this->aConf['long_query'] = getParam('bx_profiler_long_sql_queries_time');
}
if (getParam('bx_profiler_long_module_query_log')) {
$this->aConf['long_module'] = getParam('bx_profiler_long_module_query_time');
}
if (getParam('bx_profiler_long_page_log')) {
$this->aConf['long_page'] = getParam('bx_profiler_long_page_time');
}
$this->_iTimeStart = $iTimeStart;
}