本文整理汇总了PHP中cms_utils::get_theme_object方法的典型用法代码示例。如果您正苦于以下问题:PHP cms_utils::get_theme_object方法的具体用法?PHP cms_utils::get_theme_object怎么用?PHP cms_utils::get_theme_object使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cms_utils
的用法示例。
在下文中一共展示了cms_utils::get_theme_object方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cge_CreateInputSubmit
function cge_CreateInputSubmit(&$mod, $id, $name, $value = '', $addtext = '', $image = '', $confirmtext = '', $class = '', $alt = '', $elid = '')
{
$real_image = '';
if (!empty($image)) {
$config = cms_config::get_instance();
// check image_directories first
if (isset($mod->_image_directories) && !empty($mod->_image_directories)) {
foreach ($mod->_image_directories as $dir) {
$url = cms_join_path($dir, $image);
$path = cms_join_path($config['root_path'], $url);
if (is_readable($path)) {
$real_image = $url;
}
}
}
$theme = cms_utils::get_theme_object();
if (empty($real_image)) {
$path = $config['root_path'] . '/' . $config['admin_dir'] . '/themes/' . $theme->themeName . '/images/';
if (file_exists($path . $image)) {
// its a theme image
$real_image = $config['admin_dir'] . "/themes/" . $theme->themeName . '/images/' . $image;
}
}
if (empty($real_image)) {
if (is_object($theme)) {
// we're in the admin
if (!$alt) {
$alt = $value;
}
$txt = $theme->DisplayImage($image, $alt, '', '', $class);
$real_image = $theme->imageLink[$image];
}
}
$addtext .= ' title="' . $value . '"';
}
if (!empty($class)) {
$addtext .= ' class="' . $class . '"';
}
return $mod->CreateInputSubmit($id, $name, $value, $addtext, $real_image, $confirmtext);
}
示例2: cms_admin_sendheaders
<?php
cms_admin_sendheaders();
$orig_memory = function_exists('memory_get_usage') ? memory_get_usage() : 0;
$starttime = microtime();
if (!(isset($USE_OUTPUT_BUFFERING) && $USE_OUTPUT_BUFFERING == false)) {
@ob_start();
}
$gCms = cmsms();
$config = $gCms->GetConfig();
$userid = get_userid();
if (isset($USE_THEME) && $USE_THEME == false) {
//echo '<!-- admin theme disabled -->';
} else {
debug_buffer('before theme load');
$themeObject = cms_utils::get_theme_object();
debug_buffer('after theme load');
if (isset($headtext) && $headtext != '') {
$themeObject->set_value('headertext', $headtext);
}
// Display notification stuff from modules
// should be controlled by preferences or something
$ignoredmodules = explode(',', get_preference($userid, 'ignoredmodules'));
if (get_site_preference('enablenotifications', 1) && get_preference($userid, 'enablenotifications', 1)) {
debug_buffer('before notifications');
if ($data = get_site_preference('__NOTIFICATIONS__')) {
$data = unserialize($data);
if (is_array($data) && count($data)) {
foreach ($data as $item) {
$old = $item->html;
$regex = '/' . CMS_SECURE_PARAM_NAME . '\\=[0-9a-z]{8}/';
示例3: _DisplayTemplateList
function _DisplayTemplateList(&$module, $id, $returnid, $prefix, $defaulttemplatepref, $active_tab, $defaultprefname, $title, $info = '', $destaction = 'defaultadmin')
{
// we're gonna allow multiple templates here
// but we're gonna prefix them all with something
$falseimage1 = cms_utils::get_theme_object()->DisplayImage('icons/system/false.gif', 'make default', '', '', 'systemicon');
$trueimage1 = cms_utils::get_theme_object()->DisplayImage('icons/system/true.gif', 'default', '', '', 'systemicon');
$alltemplates = cge_template_utils::get_templates_by_prefix($module, $prefix, true);
$rowarray = array();
$rowclass = 'row1';
foreach ($alltemplates as $onetemplate) {
if ($prefix . $onetemplate == $defaulttemplatepref) {
continue;
}
// don't show the system default.
$tmp = $onetemplate;
$row = new StdClass();
$row->name = $this->_module->CreateLink($id, 'edittemplate', $returnid, $tmp, array('template' => $tmp, 'destaction' => $destaction, 'cg_activetab' => $active_tab, 'title' => $title, 'info' => $info, 'prefix' => $prefix, 'modname' => $module->GetName(), 'moddesc' => $module->GetFriendlyName(), 'mode' => 'edit'));
$row->rowclass = $rowclass;
$row->default = null;
if ($defaultprefname) {
$default = $module->GetPreference($defaultprefname) == $tmp ? true : false;
if ($default) {
$row->default = $trueimage1;
} else {
$row->default = $this->_module->CreateLink($id, 'makedefaulttemplate', $returnid, $falseimage1, array('template' => $tmp, 'destaction' => $destaction, 'defaultprefname' => $defaultprefname, 'modname' => $module->GetName(), 'cg_activetab' => $active_tab));
}
}
$row->editlink = $this->_module->CreateImageLink($id, 'edittemplate', $returnid, $this->_module->Lang('prompt_edittemplate'), 'icons/system/edit.gif', array('template' => $tmp, 'destaction' => $destaction, 'cg_activetab' => $active_tab, 'prefix' => $prefix, 'title' => $title, 'info' => $info, 'modname' => $module->GetName(), 'moddesc' => $module->GetFriendlyName(), 'mode' => 'edit'));
if ($defaultprefname && $default) {
$row->deletelink = ' ';
} else {
$row->deletelink = $this->_module->CreateImageLink($id, 'deletetemplate', $returnid, $this->_module->Lang('prompt_deletetemplate'), 'icons/system/delete.gif', array('template' => $onetemplate, 'prefix' => $prefix, 'modname' => $module->GetName(), 'destaction' => $destaction, 'cg_activetab' => $active_tab), '', $this->_module->Lang('areyousure'));
}
$rowarray[] = $row;
$rowclass == "row1" ? $rowclass = "row2" : ($rowclass = "row1");
}
$mod = \cms_utils::get_module(MOD_CGEXTENSIONS);
$tpl = $mod->CreateSmartyTemplate('listtemplates.tpl');
$tpl->assign('parent_module_name', $module->GetFriendlyName());
$tpl->assign('items', $rowarray);
$tpl->assign('nameprompt', $this->_module->Lang('prompt_name'));
$tpl->assign('defaultprompt', $this->_module->Lang('prompt_default'));
$tpl->assign('newtemplatelink', $this->_module->CreateImageLink($id, 'edittemplate', $returnid, $this->_module->Lang('prompt_newtemplate'), 'icons/system/newobject.gif', array('prefix' => $prefix, 'destaction' => $destaction, 'cg_activetab' => $active_tab, 'modname' => $module->GetName(), 'moddesc' => $module->GetFriendlyName(), 'title' => $title, 'info' => $info, 'mode' => 'add', 'defaulttemplatepref' => $defaulttemplatepref), '', '', false));
//$tpl->assign($this->_module->CreateFormEnd());
return $tpl->fetch();
}
示例4: array
}
}
$tplvars['tabsheader'] = $this->StartTabHeaders() . $this->SetTabHeader('main', $this->Lang('title_maintab'), $indx == 0) . $this->SetTabHeader('settings', $this->Lang('title_settingstab'), $indx == 1) . $this->EndTabHeaders() . $this->StartTabContent();
//NOTE CMSMS 2+ barfs if EndTab() is called before EndTabContent() - some craziness there !!!
$tplvars = $tplvars + array('tabsfooter' => $this->EndTabContent(), 'tab_end' => $this->EndTab(), 'form_end' => $this->CreateFormEnd());
$jsincs = array();
$jsfuncs = array();
$jsloads = array();
$baseurl = $this->GetModuleURLPath();
if (!empty($params['message'])) {
$tplvars['message'] = $params['message'];
}
//~~~~~~~~~~~~~~~ ACCOUNTS TAB ~~~~~~~~~~~~~~~~
$tplvars['tabstart_main'] = $this->StartTab('main');
$tplvars['formstart_main'] = $this->CreateFormStart($id, 'process');
$theme = $this->before20 ? cmsms()->get_variable('admintheme') : cms_utils::get_theme_object();
if ($mod) {
$icon_open = $theme->DisplayImage('icons/system/edit.gif', $this->Lang('tip_edit'), '', '', 'systemicon');
$t = $this->Lang('tip_toggle');
$icon_yes = $theme->DisplayImage('icons/system/true.gif', $t, '', '', 'systemicon');
$icon_no = $theme->DisplayImage('icons/system/false.gif', $t, '', '', 'systemicon');
$icon_export = $theme->DisplayImage('icons/system/export.gif', $this->Lang('tip_export'), '', '', 'systemicon');
$t = $this->Lang('tip_admin');
$icon_admin = '<img src="' . $baseurl . '/images/administer.png" alt="' . $t . '" title="' . $t . '" class="systemicon" />';
} else {
$icon_open = $theme->DisplayImage('icons/system/view.gif', $this->Lang('tip_view'), '', '', 'systemicon');
$yes = $this->Lang('yes');
$no = $this->Lang('no');
}
if ($pdel) {
$icon_del = $theme->DisplayImage('icons/system/delete.gif', $this->Lang('tip_delete'), '', '', 'systemicon');
示例5: AddEditForm
function AddEditForm($id, $returnid, $tab, $message = '')
{
$gCms = cmsms();
$mod = $this->module_ptr;
$config = $mod->GetConfig();
if (!empty($message)) {
$mod->smarty->assign('message', $mod->ShowMessage($message));
}
$mod->smarty->assign('formstart', $mod->CreateFormStart($id, 'admin_store_form', $returnid));
$mod->smarty->assign('formid', $mod->CreateInputHidden($id, 'form_id', $this->Id));
# fixes for CMSMS 2 compatibility (JM)
if (!formbuilder_utils::is_CMS2()) {
$mod->smarty->assign('tab_start', $mod->StartTabHeaders() . $mod->SetTabHeader('maintab', $mod->Lang('tab_main'), 'maintab' == $tab ? true : false) . $mod->SetTabHeader('submittab', $mod->Lang('tab_submit'), 'submittab' == $tab ? true : false) . $mod->SetTabHeader('symboltab', $mod->Lang('tab_symbol'), 'symboltab' == $tab ? true : false) . $mod->SetTabHeader('captchatab', $mod->Lang('tab_captcha'), 'captchatab' == $tab ? true : false) . $mod->SetTabHeader('udttab', $mod->Lang('tab_udt'), 'udttab' == $tab ? true : false) . $mod->SetTabHeader('templatelayout', $mod->Lang('tab_templatelayout'), 'templatelayout' == $tab ? true : false) . $mod->SetTabHeader('submittemplate', $mod->Lang('tab_submissiontemplate'), 'submittemplate' == $tab ? true : false) . $mod->EndTabHeaders() . $mod->StartTabContent());
$mod->smarty->assign('tabs_end', $mod->EndTabContent());
$mod->smarty->assign('maintab_start', $mod->StartTab("maintab"));
$mod->smarty->assign('submittab_start', $mod->StartTab("submittab"));
$mod->smarty->assign('symboltab_start', $mod->StartTab("symboltab"));
$mod->smarty->assign('udttab_start', $mod->StartTab("udttab"));
$mod->smarty->assign('templatetab_start', $mod->StartTab("templatelayout"));
$mod->smarty->assign('submittemplatetab_start', $mod->StartTab("submittemplate"));
$mod->smarty->assign('captchatab_start', $mod->StartTab("captchatab"));
$mod->smarty->assign('tab_end', $mod->EndTab());
}
$mod->smarty->assign('form_end', $mod->CreateFormEnd());
$mod->smarty->assign('title_form_name', $mod->Lang('title_form_name'));
$mod->smarty->assign('input_form_name', $mod->CreateInputText($id, 'fbrp_form_name', $this->Name, 50));
$mod->smarty->assign('title_load_template', $mod->Lang('title_load_template'));
$modLink = $mod->CreateLink($id, 'admin_get_template', $returnid, '', array(), '', true);
$mod->smarty->assign('security_key', CMS_SECURE_PARAM_NAME . '=' . $_SESSION[CMS_USER_KEY]);
$templateList = array($mod->Lang('select_source_template') => '', $mod->Lang('default_template') => 'RenderFormDefault.tpl', $mod->Lang('table_left_template') => 'RenderFormTableTitleLeft.tpl', $mod->Lang('table_top_template') => 'RenderFormTableTitleTop.tpl');
$allForms = $mod->GetForms();
foreach ($allForms as $thisForm) {
if ($thisForm['form_id'] != $this->Id) {
$templateList[$mod->Lang('form_template_name', $thisForm['name'])] = $thisForm['form_id'];
}
}
$mod->smarty->assign('input_load_template', $mod->CreateInputDropdown($id, 'fbrp_fb_template_load', $templateList, -1, '', 'id="fb_template_load" onchange="jQuery(this).fb_get_template(\'' . $mod->Lang('template_are_you_sure') . '\',\'' . $modLink . '\');"'));
$mod->smarty->assign('help_template_variables', $mod->Lang('template_variable_help'));
$mod->smarty->assign('title_form_unspecified', $mod->Lang('title_form_unspecified'));
$mod->smarty->assign('input_form_unspecified', $mod->CreateInputText($id, 'fbrp_forma_unspecified', $this->GetAttr('unspecified', $mod->Lang('unspecified')), 50));
$mod->smarty->assign('title_form_status', $mod->Lang('title_form_status'));
$mod->smarty->assign('text_ready', $mod->Lang('title_ready_for_deployment'));
$mod->smarty->assign('title_form_alias', $mod->Lang('title_form_alias'));
$mod->smarty->assign('input_form_alias', $mod->CreateInputText($id, 'fbrp_form_alias', $this->Alias, 50));
$mod->smarty->assign('title_form_css_class', $mod->Lang('title_form_css_class'));
$mod->smarty->assign('input_form_css_class', $mod->CreateInputText($id, 'fbrp_forma_css_class', $this->GetAttr('css_class', 'formbuilderform'), 50, 50));
$mod->smarty->assign('title_form_fields', $mod->Lang('title_form_fields'));
$mod->smarty->assign('title_form_main', $mod->Lang('title_form_main'));
if ($mod->GetPreference('show_fieldids', 0) != 0) {
$mod->smarty->assign('title_field_id', $mod->Lang('title_field_id'));
}
if ($mod->GetPreference('show_fieldaliases', 1) != 0) {
$mod->smarty->assign('title_field_alias', $mod->Lang('title_field_alias_short'));
}
$mod->smarty->assign('back', $mod->CreateLink($id, 'defaultadmin', '', $mod->Lang('back_top'), array()));
$mod->smarty->assign('title_field_name', $mod->Lang('title_field_name'));
$mod->smarty->assign('title_field_type', $mod->Lang('title_field_type'));
$mod->smarty->assign('title_field_type', $mod->Lang('title_field_type'));
$mod->smarty->assign('title_form_template', $mod->Lang('title_form_template'));
$mod->smarty->assign('title_list_delimiter', $mod->Lang('title_list_delimiter'));
$mod->smarty->assign('title_redirect_page', $mod->Lang('title_redirect_page'));
$mod->smarty->assign('title_submit_action', $mod->Lang('title_submit_action'));
$mod->smarty->assign('title_submit_response', $mod->Lang('title_submit_response'));
$mod->smarty->assign('title_must_save_order', $mod->Lang('title_must_save_order'));
$mod->smarty->assign('title_inline_form', $mod->Lang('title_inline_form'));
//JM
$admintheme = cms_utils::get_theme_object();
//
$mod->smarty->assign('title_submit_actions', $mod->Lang('title_submit_actions'));
$mod->smarty->assign('title_submit_labels', $mod->Lang('title_submit_labels'));
$mod->smarty->assign('title_submit_javascript', $mod->Lang('title_submit_javascript'));
$mod->smarty->assign('title_submit_help', $mod->Lang('title_submit_help'));
$mod->smarty->assign('title_submit_response_help', $mod->Lang('title_submit_response_help'));
$submitActions = array($mod->Lang('display_text') => 'text', $mod->Lang('redirect_to_page') => 'redir');
$mod->smarty->assign('input_submit_action', $mod->CreateInputRadioGroup($id, 'fbrp_forma_submit_action', $submitActions, $this->GetAttr('submit_action', 'text')));
$captcha = $mod->getModuleInstance('Captcha');
if ($captcha == null) {
$mod->smarty->assign('title_install_captcha', $mod->Lang('title_captcha_not_installed'));
$mod->smarty->assign('captcha_installed', 0);
} else {
$mod->smarty->assign('title_use_captcha', $mod->Lang('title_use_captcha'));
$mod->smarty->assign('captcha_installed', 1);
$mod->smarty->assign('input_use_captcha', $mod->CreateInputHidden($id, 'fbrp_forma_use_captcha', '0') . $mod->CreateInputCheckbox($id, 'fbrp_forma_use_captcha', '1', $this->GetAttr('use_captcha', '0')) . $mod->Lang('title_use_captcha_help'));
}
$mod->smarty->assign('title_information', $mod->Lang('information'));
$mod->smarty->assign('title_order', $mod->Lang('order'));
$mod->smarty->assign('title_field_required_abbrev', $mod->Lang('title_field_required_abbrev'));
$mod->smarty->assign('hasdisposition', $this->HasDisposition() ? 1 : 0);
$maxOrder = 1;
if ($this->Id > 0) {
$mod->smarty->assign('fb_hidden', $mod->CreateInputHidden($id, 'fbrp_form_op', $mod->Lang('updated')) . $mod->CreateInputHidden($id, 'fbrp_sort', '', 'class="fbrp_sort"'));
$mod->smarty->assign('adding', 0);
$mod->smarty->assign('save_button', $mod->CreateInputSubmit($id, 'fbrp_submit', $mod->Lang('save')));
$mod->smarty->assign('submit_button', $mod->CreateInputHidden($id, 'active_tab', '', 'id="fbr_atab"') . $mod->CreateInputSubmit($id, 'fbrp_submit', $mod->Lang('save_and_continue'), 'onclick="jQuery(this).fb_set_tab()"'));
$fieldList = array();
$currow = "row1";
$count = 1;
$last = $this->GetFieldCount();
foreach ($this->Fields as $thisField) {
$oneset = new stdClass();
//.........这里部分代码省略.........
示例6: ShowErrors
/**
* ShowErrors
* Outputs errors in a nice error box with a troubleshooting link to the wiki
*
* @final
* @param errors - array or string of errors to be shown
* @return string
*/
function ShowErrors($errors)
{
$theme = cms_utils::get_theme_object();
if (is_object($theme)) {
return $theme->ShowErrors($errors);
}
return '';
}
示例7: GetHeaderHTML
public function GetHeaderHTML()
{
$config = cmsms()->GetConfig();
if (version_compare(CMS_VERSION, '1.11') < 0) {
# backward compatibility
if (version_compare(CMS_VERSION, '1.9') < 0) {
$this->smarty->assign('bc', true);
}
$this->smarty->assign('jq_ui_css', $config['root_url'] . '/modules/' . $this->GetName() . '/css/jquery-ui/base/jquery.ui.all.css');
$themeName = get_class(cmsms()->variables['admintheme']);
if (endswith($themeName, 'Theme')) {
$themeName = substr($themeName, 0, strlen($themeName) - 5);
}
$admin_url = $config['root_url'] . '/' . $config['admin_dir'];
} else {
$themeName = cms_utils::get_theme_object()->themeName;
$admin_url = $config['admin_url'];
}
$this->smarty->assign('expand_img', $admin_url . '/themes/' . $themeName . '/images/icons/system/expand.gif', '', '', '', 'systemicon');
$this->smarty->assign('contract_img', $admin_url . '/themes/' . $themeName . '/images/icons/system/contract.gif', '', '', '', 'systemicon');
$this->smarty->assign('module_id', 'm1_');
$this->smarty->assign('debug', $config['debug']);
$this->smarty->assign('locale', substr(get_preference(get_userid(), 'default_cms_language'), 0, 2));
return $this->ProcessTemplate('header.tpl');
}
示例8: cmsms
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Or read it online: http://www.gnu.org/licenses/licenses.html#GPL
#-------------------------------------------------------------------------
if (!is_object(@cmsms())) {
exit;
}
$admintheme = cms_utils::get_theme_object();
$smarty = cmsms()->GetSmarty();
// and a list of all the existent forms.
$forms = $this->GetForms();
$num_forms = count($forms);
if (!formbuilder_utils::is_CMS2()) {
$smarty->assign('tabheaders', $this->StartTabHeaders() . $this->SetTabHeader('forms', $this->Lang('forms')) . $this->SetTabHeader('config', $this->Lang('configuration')) . $this->EndTabHeaders() . $this->StartTabContent());
$smarty->assign('start_formtab', $this->StartTab("forms"));
$smarty->assign('start_configtab', $this->StartTab("config"));
$smarty->assign('end_tab', $this->EndTab());
$smarty->assign('end_tabs', $this->EndTabContent());
}
$smarty->assign('start_configform', $this->CreateFormStart($id, 'admin_update_config', $returnid));
$smarty->assign('frmbld', $this);
$smarty->assign('title_form_name', $this->Lang('title_form_name'));
$smarty->assign('title_form_alias', $this->Lang('title_form_alias'));
示例9: offsetGet
public function offsetGet($key)
{
if ($key == 'admintheme') {
// special case, for compatibility.
return cms_utils::get_theme_object();
}
if (!in_array($key, $this->_allowed_variables)) {
trigger_error('Retrival of unauthorized internal variables is deprecated: ' . $key, E_USER_NOTICE);
return;
}
if (isset($this->_data[$key])) {
return $this->_data[$key];
}
switch ($key) {
case 'convertclass':
$this->_data[$key] = new ConvertClass();
return $this->_data[$key];
}
}