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


PHP CActivityStream::getActivityContent方法代码示例

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


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

示例1: ajaxGetContent

 /**
  * Get content for activity based on the activity id.
  *
  *	@params	$activityId	Int	Activity id	 
  **/
 public function ajaxGetContent($activityId)
 {
     $my = CFactory::getUser();
     $showMore = true;
     $objResponse = new JAXResponse();
     $model = CFactory::getModel('Activities');
     CFactory::load('libraries', 'privacy');
     CFactory::load('libraries', 'activities');
     // These core apps has default privacy issues with it
     $coreapps = array('photos', 'walls', 'videos', 'groups');
     // make sure current user has access to the content item
     // For known apps, we can filter this manually
     $activity = $model->getActivity($activityId);
     if (in_array($activity->app, $coreapps)) {
         CFactory::load('helpers', 'privacy');
         switch ($activity->app) {
             case 'walls':
                 // make sure current user has permission to the profile
                 $showMore = CPrivacy::isAccessAllowed($my->id, $activity->target, 'user', 'privacyProfileView');
                 break;
             case 'videos':
                 // Each video has its own privacy setting within the video itself
                 CFactory::load('models', 'videos');
                 $video = JTable::getInstance('Video', 'CTable');
                 $video->load($activity->cid);
                 $showMore = CPrivacy::isAccessAllowed($my->id, $activity->actor, 'custom', $video->permissions);
                 break;
             case 'photos':
                 // for photos, we uses the actor since the target is 0 and he
                 // is doing the action himself
                 $showMore = CPrivacy::isAccessAllowed($my->id, $activity->actor, 'user', 'privacyPhotoView');
                 break;
             case 'groups':
         }
     } else {
         // if it is not one of the core apps, we should allow plugins to decide
         // if they want to block the 'more' view
     }
     if ($showMore) {
         $act = $model->getActivity($activityId);
         $content = CActivityStream::getActivityContent($act);
         $objResponse->addScriptCall('joms.activities.setContent', $activityId, $content);
     } else {
         $content = JText::_('CC ACCESS FORBIDDEN');
         $content = nl2br($content);
         $content = JString::str_ireplace("\n", '', $content);
         $objResponse->addScriptCall('joms.activities.setContent', $activityId, $content);
     }
     $objResponse->addScriptCall('joms.tooltip.setup();');
     return $objResponse->sendResponse();
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:56,代码来源:activities.php


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