本文整理汇总了PHP中BxDolStudioTemplate类的典型用法代码示例。如果您正苦于以下问题:PHP BxDolStudioTemplate类的具体用法?PHP BxDolStudioTemplate怎么用?PHP BxDolStudioTemplate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BxDolStudioTemplate类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:blas-dmx,项目名称:trident,代码行数:29,代码来源:BxDolStudioDesign.php
示例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));
}
开发者ID:Baloo7super,项目名称:dolphin,代码行数:27,代码来源:BxBaseStudioMenuTop.php
示例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;
}
开发者ID:Baloo7super,项目名称:dolphin,代码行数:35,代码来源:BxDolCacheUtilities.php
示例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;
}
开发者ID:blas-dmx,项目名称:trident,代码行数:27,代码来源:BxProfiler.php
示例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);
}
开发者ID:blas-dmx,项目名称:trident,代码行数:8,代码来源:BxBaseStudioModule.php
示例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()))));
}
开发者ID:blas-dmx,项目名称:trident,代码行数:8,代码来源:BxBaseStudioPolyglot.php
示例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);
}
开发者ID:blas-dmx,项目名称:trident,代码行数:9,代码来源:BxBaseStudioPermissions.php
示例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' => ''));
}
开发者ID:blas-dmx,项目名称:trident,代码行数:9,代码来源:splash.php
示例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;
}
开发者ID:blas-dmx,项目名称:trident,代码行数:10,代码来源:BxBaseStudioWidgets.php
示例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);
}
开发者ID:Baloo7super,项目名称:dolphin,代码行数:11,代码来源:BxBaseStudioPolyglot.php
示例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;
}
开发者ID:blas-dmx,项目名称:trident,代码行数:11,代码来源:BxBaseStudioLauncher.php
示例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;
}
开发者ID:blas-dmx,项目名称:trident,代码行数:13,代码来源:BxDolStudioLanguagesUtils.php
示例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;
}
开发者ID:blas-dmx,项目名称:trident,代码行数:13,代码来源:BxDolStudioLanguagesUtils.php
示例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();
}
开发者ID:blas-dmx,项目名称:trident,代码行数:15,代码来源:BxBaseStudioFunctions.php
示例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;
}
开发者ID:blas-dmx,项目名称:trident,代码行数:17,代码来源:BxProfiler.php
示例16: getUpdates
public function getUpdates()
{
$aUpdates = array();
bx_import('BxDolStudioTemplate');
$oTemplate = BxDolStudioTemplate::getInstance();
$aInstalledPathes = $aInstalledInfo = array();
$this->getInstalledInfo($aInstalledPathes, $aInstalledInfo);
$sPath = BX_DIRECTORY_PATH_MODULES;
if (($rHandleVendor = opendir($sPath)) !== false) {
while (($sVendor = readdir($rHandleVendor)) !== false) {
if (substr($sVendor, 0, 1) == '.' || !is_dir($sPath . $sVendor)) {
continue;
}
if (($rHandleModule = opendir($sPath . $sVendor . '/')) !== false) {
while (($sModule = readdir($rHandleModule)) !== false) {
if (!is_dir($sPath . $sVendor . '/' . $sModule) || substr($sModule, 0, 1) == '.') {
continue;
}
if (($rHandleUpdate = @opendir($sPath . $sVendor . '/' . $sModule . '/updates/')) !== false) {
while (($sUpdate = readdir($rHandleUpdate)) !== false) {
if (!is_dir($sPath . $sVendor . '/' . $sModule . '/updates/' . $sUpdate) || substr($sUpdate, 0, 1) == '.') {
continue;
}
$sConfigPathModule = $sPath . $sVendor . '/' . $sModule . '/install/config.php';
$sConfigPathUpdate = $sPath . $sVendor . '/' . $sModule . '/updates/' . $sUpdate . '/install/config.php';
$aUpdate = $this->getConfigUpdate($sConfigPathModule, $sConfigPathUpdate, $aInstalledPathes, $aInstalledInfo);
if (empty($aUpdate) || !is_array($aUpdate) || version_compare($aUpdate['module_version'], $aUpdate['version_from']) != 0) {
continue;
}
$aUpdates[$aUpdate['title']] = $aUpdate;
}
closedir($rHandleUpdate);
}
}
closedir($rHandleModule);
}
}
closedir($rHandleVendor);
}
ksort($aUpdates);
return $aUpdates;
}
开发者ID:Baloo7super,项目名称:dolphin,代码行数:42,代码来源:BxDolStudioInstallerUtils.php
示例17: performActionEdit
public function performActionEdit()
{
$oTemplate = BxDolStudioTemplate::getInstance();
$aIds = bx_get('ids');
if (!$aIds || !is_array($aIds)) {
$iId = (int) bx_get('id');
if (!$iId) {
$this->_echoResultJson(array());
exit;
}
$aIds = array($iId);
}
$iId = $aIds[0];
$sAction = 'edit';
$aLanguages = array();
$iLanguages = $this->oDb->getLanguagesBy(array('type' => 'all_key_id'), $aLanguages);
$aKey = $this->oDb->getKeyFullInfo($iId);
$aForm = array('form_attrs' => array('id' => 'adm-lang-edit-key-form', 'action' => BX_DOL_URL_ROOT . 'grid.php?o=' . $this->_sObject . '&a=' . $sAction, 'method' => 'post'), 'params' => array('db' => array('table' => 'sys_localization_keys', 'key' => 'ID', 'uri' => '', 'uri_title' => '', 'submit_name' => 'do_submit')), 'inputs' => array('id' => array('type' => 'hidden', 'name' => 'id', 'value' => $iId, 'db' => array('pass' => 'Int'))));
foreach ($aLanguages as $aLanguage) {
$sName = 'language_' . $aLanguage['id'];
$aForm['inputs'][$sName] = array('type' => 'textarea', 'name' => $sName, 'caption' => $aLanguage['title'], 'value' => isset($aKey['strings'][$aLanguage['name']]) ? $aKey['strings'][$aLanguage['name']]['string'] : '', 'db' => array('pass' => 'XssHtml'));
}
$aForm['inputs'] = array_merge($aForm['inputs'], array('languages' => array('type' => 'hidden', 'name' => 'languages', 'value' => implode(',', array_keys($aLanguages)), 'db' => array('pass' => 'Xss')), 'controls' => array('name' => 'controls', 'type' => 'input_set', array('type' => 'submit', 'name' => 'do_submit', 'value' => _t('_adm_pgt_btn_nkp_save')), array('type' => 'reset', 'name' => 'close', 'value' => _t('_adm_pgt_btn_nkp_close'), 'attrs' => array('onclick' => "\$('.bx-popup-applied:visible').dolPopupHide()", 'class' => 'bx-def-margin-sec-left')))));
bx_import('BxTemplStudioFormView');
$oForm = new BxTemplStudioFormView($aForm);
$oForm->initChecker();
if ($oForm->isSubmittedAndValid()) {
$mixedResult = $this->edit($oForm);
if (is_int($mixedResult)) {
$aRes = array('grid' => $this->getCode(false), 'blink' => $mixedResult);
} else {
$aRes = array('msg' => $mixedResult);
}
$this->_echoResultJson($aRes, true);
} else {
bx_import('BxTemplStudioFunctions');
$sContent = BxTemplStudioFunctions::getInstance()->popupBox('adm-lang-edit-key-popup', _t('_adm_pgt_txt_nkp_edit_popup', $aKey['key']), $this->_oTemplate->parseHtmlByName('pgt_new_key.html', array('form_id' => $aForm['form_attrs']['id'], 'form' => $oForm->getCode(true), 'object' => $this->_sObject, 'action' => $sAction)));
$this->_echoResultJson(array('popup' => array('html' => $sContent, 'options' => array('closeOnOuterClick' => false))), true);
}
}
开发者ID:Baloo7super,项目名称:dolphin,代码行数:40,代码来源:BxBaseStudioPolyglotKeys.php
示例18: getModuleIcon
public static function getModuleIcon($mixedModule, $sType = 'menu', $bReturnAsUrl = true)
{
$aType2Prefix = array('menu' => 'mi', 'page' => 'pi', 'store' => 'si');
if (!is_array($mixedModule)) {
$aModule = BxDolModuleQuery::getInstance()->getModuleByName($mixedModule);
} else {
$aModule = $mixedModule;
}
$sDefaultIcon = self::getIconDefault(isset($aModule['type']) ? $aModule['type'] : '');
if (empty($aModule)) {
return $sDefaultIcon;
}
$sModuleIcon = '';
if (isset($aModule['path'])) {
$sModuleIcon = $aModule['name'] . '@modules/' . $aModule['path'] . '|std-' . $aType2Prefix[$sType] . '.png';
} else {
if (isset($aModule['dir'])) {
$sModuleIcon = $aModule['name'] . '@modules/' . $aModule['dir'] . '|std-' . $aType2Prefix[$sType] . '.png';
}
}
$sModuleIconUrl = BxDolStudioTemplate::getInstance()->getIconUrl($sModuleIcon);
return !empty($sModuleIcon) && !empty($sModuleIconUrl) ? $bReturnAsUrl ? $sModuleIconUrl : $sModuleIcon : $sDefaultIcon;
}
开发者ID:blas-dmx,项目名称:trident,代码行数:23,代码来源:BxDolStudioUtils.php
示例19: serviceGetBlockCache
public function serviceGetBlockCache()
{
$sJsObject = $this->getPageJsObject();
$sChartData = $this->getCacheChartData();
$bChartData = $sChartData !== false;
$aMenu = array();
if ($bChartData) {
foreach ($this->aItemsCache as $aItem) {
$aMenu[] = array('name' => $aItem['name'], 'title' => _t('_adm_dbd_txt_c_clear_' . $aItem['name']), 'link' => 'javascript:void(0)', 'onclick' => $sJsObject . ".clearCache('" . $aItem['name'] . "')");
}
}
$sContent = BxDolStudioTemplate::getInstance()->parseHtmlByName('dbd_cache.html', array('bx_if:show_chart' => array('condition' => $bChartData, 'content' => array('js_object' => $sJsObject, 'chart_data' => $sChartData)), 'bx_if:show_empty' => array('condition' => !$bChartData, 'content' => array('message' => MsgBox(_t('_adm_dbd_msg_c_all_disabled'))))));
return array('content' => $sContent, 'menu' => $aMenu);
}
开发者ID:blas-dmx,项目名称:trident,代码行数:14,代码来源:BxBaseStudioDashboard.php
示例20: getPageCaptionHelp
protected function getPageCaptionHelp()
{
$oTemplate = BxDolStudioTemplate::getInstance();
$sContent = '<a href="' . BX_DOL_URL_STUDIO . 'module.php?name=bx_smtp&page=help">' . _t('_bx_smtp_help') . "</a>";
return $oTemplate->parseHtmlByName('page_caption_help.html', array('content' => $sContent));
}
开发者ID:Baloo7super,项目名称:dolphin,代码行数:6,代码来源:BxSMTPStudioPage.php
注:本文中的BxDolStudioTemplate类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论