本文整理汇总了PHP中cmsCore::loadAllControllersLanguages方法的典型用法代码示例。如果您正苦于以下问题:PHP cmsCore::loadAllControllersLanguages方法的具体用法?PHP cmsCore::loadAllControllersLanguages怎么用?PHP cmsCore::loadAllControllersLanguages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cmsCore
的用法示例。
在下文中一共展示了cmsCore::loadAllControllersLanguages方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run($id = false)
{
if (!$id) {
cmsCore::error404();
}
$widgets_model = cmsCore::getModel('widgets');
cmsCore::loadAllControllersLanguages();
$page = $widgets_model->getPage($id);
if (!$page) {
cmsCore::error404();
}
$form = $this->getForm('widgets_page');
if (!$page['is_custom']) {
$form->removeField('title', 'title');
}
$is_submitted = $this->request->has('submit');
if ($is_submitted) {
$page = $form->parse($this->request, $is_submitted);
$errors = $form->validate($this, $page);
if (!$errors) {
$widgets_model->updatePage($id, $page);
$this->redirectToAction('widgets');
}
if ($errors) {
cmsUser::addSessionMessage(LANG_FORM_ERRORS, 'error');
}
}
return cmsTemplate::getInstance()->render('widgets_page', array('do' => 'edit', 'page' => $page, 'form' => $form, 'errors' => isset($errors) ? $errors : false));
}
示例2: run
public function run($do = false)
{
// если нужно, передаем управление другому экшену
if ($do) {
$this->runAction('widgets_' . $do, array_slice($this->params, 1));
return;
}
cmsCore::loadAllControllersLanguages();
$widgets_model = cmsCore::getModel('widgets');
$controllers = $widgets_model->getPagesControllers();
$widgets_list = $widgets_model->getAvailableWidgets();
$template = cmsTemplate::getInstance();
$scheme_html = $this->getSchemeHTML();
return $template->render('widgets', array('controllers' => $controllers, 'widgets_list' => $widgets_list, 'scheme_html' => $scheme_html));
}
示例3: run
public function run()
{
if (!$this->request->isAjax()) {
cmsCore::error404();
}
cmsCore::loadAllControllersLanguages();
$grid = $this->loadDataGrid('controllers');
$this->model->setPerPage(admin::perpage);
$filter = array();
$filter_str = $this->request->get('filter', '');
$filter_str = cmsUser::getUPSActual('admin.grid_filter.controllers', $filter_str);
if ($filter_str) {
parse_str($filter_str, $filter);
$this->model->applyGridFilter($grid, $filter);
}
$total = $this->model->getInstalledControllersCount();
$pages = ceil($total / admin::perpage);
$controllers = $this->model->getInstalledControllers();
cmsTemplate::getInstance()->renderGridRowsJSON($grid, $controllers, $total, $pages);
$this->halt();
}
示例4: run
public function run($do = false)
{
// если нужно, передаем управление другому экшену
if ($do) {
$this->runAction('widgets_' . $do, array_slice($this->params, 1));
return;
}
cmsCore::loadAllControllersLanguages();
$widgets_model = cmsCore::getModel('widgets');
$controllers = $widgets_model->getPagesControllers();
$widgets_list = $widgets_model->getAvailableWidgets();
$tpls = cmsCore::getTemplates();
$template_name = $this->request->get('template_name', '');
if (!$template_name || !in_array($template_name, $tpls)) {
$template_name = cmsConfig::get('template');
}
foreach ($tpls as $tpl) {
$templates[$tpl] = $tpl;
}
$scheme_html = $this->getSchemeHTML($template_name);
return $this->cms_template->render('widgets', array('controllers' => $controllers, 'template_name' => $template_name, 'templates' => $templates, 'widgets_list' => $widgets_list, 'scheme_html' => $scheme_html));
}