当前位置: 首页>>代码示例>>PHP>>正文


PHP cmsCore::getWidgetOptionsForm方法代码示例

本文整理汇总了PHP中cmsCore::getWidgetOptionsForm方法的典型用法代码示例。如果您正苦于以下问题:PHP cmsCore::getWidgetOptionsForm方法的具体用法?PHP cmsCore::getWidgetOptionsForm怎么用?PHP cmsCore::getWidgetOptionsForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cmsCore的用法示例。


在下文中一共展示了cmsCore::getWidgetOptionsForm方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 public function run($binded_id = false)
 {
     if (!$this->request->isAjax()) {
         cmsCore::error404();
     }
     if (!$binded_id) {
         cmsCore::error404();
     }
     $template = cmsTemplate::getInstance();
     $widgets_model = cmsCore::getModel('widgets');
     $widget = $widgets_model->getWidgetBinding($binded_id);
     cmsCore::loadWidgetLanguage($widget['name'], $widget['controller']);
     $form = cmsCore::getWidgetOptionsForm($widget['name'], $widget['controller'], $widget['options']);
     return $template->render('widgets_settings', array('form' => $form, 'widget' => $widget, 'errors' => false));
 }
开发者ID:asphix,项目名称:icms2,代码行数:15,代码来源:widgets_edit.php

示例2: __construct

 public function __construct($widget)
 {
     $this->name = $widget['name'];
     $this->controller = $widget['controller'];
     $form = cmsCore::getWidgetOptionsForm($this->name, $this->controller, $widget['options']);
     $data = $form->parse(new cmsRequest($widget), true);
     foreach ($data as $field => $value) {
         $this->{$field} = $value;
     }
     $this->css_class = $widget['class'];
     $this->css_class_title = empty($widget['class_title']) ? '' : $widget['class_title'];
     $this->css_class_wrap = empty($widget['class_wrap']) ? '' : $widget['class_wrap'];
     $this->links = $widget['links'];
     $this->position = $widget['position'];
     $this->template = $this->name;
     if (!empty($widget['tpl_wrap'])) {
         $this->setWrapper($widget['tpl_wrap']);
     }
     if (!empty($widget['tpl_body'])) {
         $this->setTemplate($widget['tpl_body']);
     }
 }
开发者ID:asphix,项目名称:icms2,代码行数:22,代码来源:widget.php

示例3: run

 public function run()
 {
     if (!$this->request->isAjax()) {
         cmsCore::error404();
     }
     $widget_id = $this->request->get('widget_id', 0);
     $page_id = $this->request->get('page_id', 0);
     $position = $this->request->get('position', '');
     $template = $this->request->get('template', '');
     $tpls = cmsCore::getTemplates();
     if (!$template || !in_array($template, $tpls)) {
         $template = cmsConfig::get('template');
     }
     $widgets_model = cmsCore::getModel('widgets');
     $widget = $widgets_model->getWidget($widget_id);
     $binded_id = $widgets_model->addWidgetBinding($widget, $page_id, $position, $template);
     $bind_widget = $widgets_model->getWidgetBinding($binded_id);
     cmsCore::loadWidgetLanguage($bind_widget['name'], $bind_widget['controller']);
     $form = cmsCore::getWidgetOptionsForm($bind_widget['name'], $bind_widget['controller'], false, $bind_widget['template']);
     $data = $form->parse(new cmsRequest($bind_widget));
     $widgets_model->updateWidgetBinding($binded_id, $data);
     $this->cms_template->renderJSON(array('error' => !(bool) $binded_id, 'id' => $binded_id));
 }
开发者ID:Val-Git,项目名称:icms2,代码行数:23,代码来源:widgets_add.php

示例4: run

 public function run()
 {
     if (!$this->request->isAjax()) {
         cmsCore::error404();
     }
     if (!$this->request->has('id')) {
         cmsCore::error404();
     }
     $template = cmsTemplate::getInstance();
     $widgets_model = cmsCore::getModel('widgets');
     $widget_id = $this->request->get('id');
     $widget = $widgets_model->getWidgetBinding($widget_id);
     cmsCore::loadWidgetLanguage($widget['name'], $widget['controller']);
     $form = cmsCore::getWidgetOptionsForm($widget['name'], $widget['controller'], false);
     $widget = $form->parse($this->request, true);
     $errors = $form->validate($this, $widget);
     if (!$errors) {
         $widgets_model->updateWidgetBinding($widget_id, $widget);
         $template->renderJSON(array('errors' => false, 'callback' => 'widgetUpdated'));
     }
     if ($errors) {
         $template->renderJSON(array('errors' => $errors));
     }
 }
开发者ID:asphix,项目名称:icms2,代码行数:24,代码来源:widgets_update.php


注:本文中的cmsCore::getWidgetOptionsForm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。