本文整理汇总了PHP中ApplicationLogs::getLastActivities方法的典型用法代码示例。如果您正苦于以下问题:PHP ApplicationLogs::getLastActivities方法的具体用法?PHP ApplicationLogs::getLastActivities怎么用?PHP ApplicationLogs::getLastActivities使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ApplicationLogs
的用法示例。
在下文中一共展示了ApplicationLogs::getLastActivities方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: explode
<?php
$options = explode(",",user_config_option("filters_dashboard"));
$activities = ApplicationLogs::getLastActivities();
$limit = $options[2];
$acts = array();
$acts['data'] = array();
foreach($activities as $activity){
$user = Contacts::findById($activity->getCreatedById());
if ($activity->getLogData() == 'member deleted') {
$object = Members::findById($activity->getRelObjectId());
$member_deleted = true;
} else {
$object = Objects::findObject($activity->getRelObjectId());
}
if($object || $member_deleted){
$key = $activity->getRelObjectId() . "-" . $activity->getCreatedById();
if(count($acts['data']) < ($limit*2)){
if(!array_key_exists($key, $acts['data'])){
$acts['data'][$key] = $object;
$acts['created_by'][$key] = $user;
$acts['act_data'][$key] = $activity->getActivityDataView($user,$object);
$acts['date'][$key] = $activity->getCreatedOn() instanceof DateTimeValue ? friendly_date($activity->getCreatedOn()) : lang('n/a');
}else{
$acts['data'][$key] = $object;
$acts['created_by'][$key] = $user;
$acts['act_data'][$key] = $activity->getActivityDataView($user,$object,true);
$acts['date'][$key] = $activity->getCreatedOn() instanceof DateTimeValue ? friendly_date($activity->getCreatedOn()) : lang('n/a');
}
示例2: array
$tempParent = $x->getParentId();
$ant = $x;
$x = $x->getParentWorkspace();
}
if (!$x instanceof Project) {
$tempParent = 0;
$sub_wss[] = $w;
}
}
}
$sub_wss_csv = array();
foreach ($sub_wss as $sub_ws) {
$sub_wss_csv[] = $sub_ws->getId();
}
$linked_object_actions = array();
$activities = ApplicationLogs::getLastActivities($ws, active_tag(), user_config_option('activity widget elements'));
$groups = array();
$first = null;
$obj_wss_cache = array();
foreach ($activities as $act) {
$user = Users::findById($act->getCreatedById());
$object = get_object_by_manager_and_id($act->getRelObjectId(), $act->getRelObjectManager());
if (!$user || !$object) {
continue;
}
/* if ($user && $object && $act->getAction() != 'login' && $act->getAction() != 'logout'
&& !can_access($user, $object, ACCESS_LEVEL_READ)) continue;
*/
$avatar_url = $user->getAvatarUrl();
$date = $act->getCreatedOn() instanceof DateTimeValue ? friendly_date($act->getCreatedOn()) : lang('n/a');
$dontshow = false;