本文整理汇总了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);
}
}
示例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);
}
}
示例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();
}