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


PHP Widgets::retrieveWidgetListByTag方法代码示例

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


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

示例1: getWidgetList

 /**
  * The getWidgetList action acts as a service and should be triggered through an XML HTTP GET Request in order
  * to get the lists of widgets that are available for the user-agent's owner (the currently logged in user).
  *
  * @param string $format The output format that will be written in the HTTP Response. It must 'json' or 'xml'.
  * @param string $tag If set, will search the widgets to put in the resulting output by tag name.
  * @param integer $cat If set, will search the widgets to put in the resulting output by category id.
  */
 public function getWidgetList($format, $tag = null, $cat = null)
 {
     if (!Auth::isAuth()) {
         throw new ServiceException(MwwException::CONTROLLER, 'getWidgetList', ServiceException::SERV_AUTH);
     }
     if (isset($tag)) {
         // We have to search widgets by tag name.
         $widgets = Widgets::retrieveWidgetListByTag(Auth::getUserId(), $tag, Auth::getUserLevel(), $format);
     } else {
         if (isset($cat)) {
             // We have to search widgets by category id.
             $widgets = Widgets::retrieveWidgetListByCategory(Auth::getUserId(), $cat, Auth::getUserLevel(), $format);
         } else {
             // We have to get all widgets relevant to the authenticated user.
             $widgets = Widgets::retrieveWidgetList(Auth::getUserId(), Auth::getUserLevel(), $format);
         }
     }
     echo $widgets;
 }
开发者ID:ripplecrpht,项目名称:ripplecrpht,代码行数:27,代码来源:Engine.class.php


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