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


PHP Vtiger_Widget_Model::getInstanceWithWidgetId方法代码示例

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


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

示例1: process

 public function process(Vtiger_Request $request, $widget = NULL)
 {
     global $log;
     $log->debug("Entering ./dashboards/MiniList.php::process");
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     // Initialize Widget to the right-state of information
     if ($widget && !$request->has('widgetid')) {
         $widgetId = $widget->get('id');
     } else {
         $widgetId = $request->get('widgetid');
     }
     $widget = Vtiger_Widget_Model::getInstanceWithWidgetId($widgetId, $currentUser->getId());
     $minilistWidgetModel = new Vtiger_MiniList_Model();
     $minilistWidgetModel->setWidgetModel($widget);
     $viewer->assign('WIDGET', $widget);
     $viewer->assign('MODULE_NAME', $moduleName);
     $viewer->assign('MINILIST_WIDGET_MODEL', $minilistWidgetModel);
     $viewer->assign('BASE_MODULE', $minilistWidgetModel->getTargetModule());
     $viewer->assign('SCRIPTS', $this->getHeaderScripts());
     $content = $request->get('content');
     if (!empty($content)) {
         $viewer->view('dashboards/MiniListContents.tpl', $moduleName);
     } else {
         $widget->set('title', $minilistWidgetModel->getTitle());
         $viewer->view('dashboards/MiniList.tpl', $moduleName);
     }
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:29,代码来源:MiniList.php

示例2: process

 public function process(Vtiger_Request $request, $widget = NULL)
 {
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     // Initialize Widget to the right-state of information
     if ($widget && !$request->has('widgetid')) {
         $widgetId = $widget->get('id');
     } else {
         $widgetId = $request->get('widgetid');
     }
     $widget = Vtiger_Widget_Model::getInstanceWithWidgetId($widgetId, $currentUser->getId());
     if (!$request->has('owner')) {
         $owner = Settings_WidgetsManagement_Module_Model::getDefaultUserId($widget);
     } else {
         $owner = $request->get('owner');
     }
     $minilistWidgetModel = new Vtiger_MiniList_Model();
     $minilistWidgetModel->setWidgetModel($widget);
     $viewer->assign('WIDGET', $widget);
     $viewer->assign('MODULE_NAME', $moduleName);
     $viewer->assign('USER', $owner);
     $viewer->assign('CURRENTUSER', $currentUser);
     $viewer->assign('MINILIST_WIDGET_MODEL', $minilistWidgetModel);
     $viewer->assign('BASE_MODULE', $minilistWidgetModel->getTargetModule());
     $viewer->assign('SCRIPTS', $this->getFooterScripts());
     $content = $request->get('content');
     if (!empty($content)) {
         $viewer->view('dashboards/MiniListContents.tpl', $moduleName);
     } else {
         $widget->set('title', $minilistWidgetModel->getTitle());
         $viewer->view('dashboards/MiniList.tpl', $moduleName);
     }
 }
开发者ID:rcrrich,项目名称:YetiForceCRM,代码行数:34,代码来源:MiniList.php

示例3: process

 public function process(Vtiger_Request $request)
 {
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $linkId = $request->get('linkid');
     $response = new Vtiger_Response();
     if ($request->has('widgetid')) {
         $widget = Vtiger_Widget_Model::getInstanceWithWidgetId($request->get('widgetid'), $currentUser->getId());
     } else {
         $widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId());
     }
     if (!$widget->isDefault()) {
         $widget->remove();
         $response->setResult(array('linkid' => $linkId, 'name' => $widget->getName(), 'url' => $widget->getUrl(), 'title' => vtranslate($widget->getTitle(), $request->getModule())));
     } else {
         $response->setError(vtranslate('LBL_CAN_NOT_REMOVE_DEFAULT_WIDGET', $moduleName));
     }
     $response->emit();
 }
开发者ID:nouphet,项目名称:vtigercrm-6.0.0-ja,代码行数:18,代码来源:RemoveWidget.php


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