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


PHP Portlet::doesPortletExistByViewTypeLayoutIdAndUser方法代码示例

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


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

示例1: actionAdd

 /**
  * Add portlet to first column, first position
  * and if there are other portlets in the first
  * column, shift their postion by 1 to accomodate
  * the new portlet
  *
  */
 public function actionAdd()
 {
     assert('!empty($_GET["uniqueLayoutId"])');
     assert('!empty($_GET["portletType"])');
     $isPortletAlreadyAdded = Portlet::doesPortletExistByViewTypeLayoutIdAndUser($_GET['portletType'], $_GET['uniqueLayoutId'], Yii::app()->user->userModel->id);
     $maximumColumns = $this->resolveMaximumColumnsByDashboardId();
     if ($isPortletAlreadyAdded === false) {
         $portletCollection = Portlet::getByLayoutIdAndUserSortedByColumnIdAndPosition($_GET['uniqueLayoutId'], Yii::app()->user->userModel->id, array());
         if (!empty($portletCollection)) {
             foreach ($portletCollection[$maximumColumns] as $position => $portlet) {
                 $portlet->position = $portlet->position + 1;
                 $portlet->save();
             }
         }
     }
     if (!empty($_GET['dashboardId'])) {
         $dashboardId = $_GET['dashboardId'];
     } else {
         $dashboardId = '';
     }
     Portlet::makePortletUsingViewType($_GET['portletType'], $_GET['uniqueLayoutId'], Yii::app()->user->userModel, $maximumColumns);
     $this->redirect(array('default/dashboardDetails', 'id' => $dashboardId));
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:30,代码来源:DefaultPortletController.php

示例2: actionAdd

 /**
  * Add portlet to first column, first position
  * and if there are other portlets in the first
  * column, shift their postion by 1 to accomodate
  * the new portlet
  *
  */
 public function actionAdd()
 {
     assert('!empty($_GET["uniqueLayoutId"])');
     assert('!empty($_GET["portletType"])');
     $isPortletAlreadyAdded = Portlet::doesPortletExistByViewTypeLayoutIdAndUser($_GET['portletType'], $_GET['uniqueLayoutId'], Yii::app()->user->userModel->id);
     $maximumColumns = $this->resolveMaximumColumnsByLayoutId();
     if ($isPortletAlreadyAdded === false) {
         $this->resetPortletsInColumnToAccomodateNewPortlet($maximumColumns);
         Portlet::makePortletUsingViewType($_GET['portletType'], $_GET['uniqueLayoutId'], Yii::app()->user->userModel, intval($maximumColumns));
     }
     if (!empty($_GET['modelId'])) {
         $dashboardId = $_GET['modelId'];
     } else {
         $dashboardId = '';
     }
     //Please see @link:AccountDetailsAndRelationsPortletViewTest
     if (isset($_GET['redirect'])) {
         return;
     }
     $this->redirect(array('/' . $this->resolveAndGetModuleId() . '/default/details', 'id' => $dashboardId));
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:28,代码来源:ZurmoPortletController.php


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