|
|
@@ -68,11 +68,13 @@ class BxBaseDashboardServices extends BxDol
|
|
|
$iProfileId = (int)bx_get_logged_profile_id();
|
|
|
$iV1 = $bEmpty ? 0 : BxDolConnection::getObjectInstance('sys_profiles_friends')->getConnectedContentCount($iProfileId, true);
|
|
|
$iV2 =$bEmpty ? 0 : BxDolConnection::getObjectInstance('sys_profiles_friends')->getConnectedContentCount($iProfileId, true, $iStartDate);
|
|
|
- $aData['friends'] = ['title' => 'Friends', 'key' => 'friends', 'type' => 'growth', 'url' =>'/friends', 'current' => $iV1, 'prev' => $iV2, 'growth' => $iV2 > 0 ? round(($iV1 - $iV2)/$iV2*100, 2) : 0];
|
|
|
+ $aData[] = ['title' => 'Friends', 'key' => 'friends', 'type' => 'growth', 'url' =>'/friends', 'current' => $iV1, 'prev' => $iV2, 'growth' => $iV2 > 0 ? round(($iV1 - $iV2)/$iV2*100, 2) : 0];
|
|
|
|
|
|
$iV1 = $bEmpty ? 0 : BxDolConnection::getObjectInstance('sys_profiles_subscriptions')->getConnectedContentCount($iProfileId, false);
|
|
|
$iV2 = $bEmpty ? 0 : BxDolConnection::getObjectInstance('sys_profiles_subscriptions')->getConnectedContentCount($iProfileId, false, $iStartDate);
|
|
|
- $aData['followers'] = ['title' =>'Followers', 'key' => 'followers', 'type' => 'growth', 'url' =>'/followers', 'current' => $iV1, 'prev' => $iV2, 'growth' => $iV2 > 0 ? round(($iV1 - $iV2)/$iV2*100 ,2) : 0];
|
|
|
+ $aData[] = ['title' =>'Followers', 'key' => 'followers', 'type' => 'growth', 'url' =>'/followers', 'current' => $iV1, 'prev' => $iV2, 'growth' => $iV2 > 0 ? round(($iV1 - $iV2)/$iV2*100 ,2) : 0];
|
|
|
+
|
|
|
+ $oPermalink = BxDolPermalinks::getInstance();
|
|
|
|
|
|
$aModules = bx_srv('system', 'get_modules_by_type', ['content']);
|
|
|
foreach($aModules as $aModule) {
|
|
|
@@ -81,10 +83,10 @@ class BxBaseDashboardServices extends BxDol
|
|
|
if (method_exists($oModule->_oDb, 'getStatByProfile')){
|
|
|
$a = $bEmpty ? [] : $oModule->_oDb->getStatByProfile($iProfileId);
|
|
|
$aIcon = explode($CNF['ICON'], ' ');
|
|
|
- $aData[$aModule['name']] = array_merge(['key' => $aModule['name'], 'title' => $aModule['title'], 'url' => $CNF['URL_HOME'], 'icon' => $CNF['ICON'], 'type' => 'simple'], $a);
|
|
|
+ $aData[] = array_merge(['key' => $aModule['name'], 'title' => $aModule['title'], 'add_url' => $CNF['URI_ADD_ENTRY'], 'url' => $oPermalink->permalink($CNF['URL_HOME']), 'action' => 'views', 'icon' => $CNF['ICON'], 'type' => 'simple'], $a);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$aModules = bx_srv('system', 'get_modules_by_type', ['context']);
|
|
|
foreach($aModules as $aModule) {
|
|
|
$oModule = BxDolModule::getInstance($aModule['name']);
|
|
|
@@ -104,14 +106,16 @@ class BxBaseDashboardServices extends BxDol
|
|
|
$iMembers += $oConnection->getConnectedInitiatorsCount($oProfile->id(), true);
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- $aData[$aModule['name']] = array_merge(['key' => $aModule['name'], 'title' => $aModule['title'], 'url' => $CNF['URL_HOME'], 'icon' => $CNF['ICON'], 'type' => 'simple', 'members' => $iMembers], $a);
|
|
|
+ }
|
|
|
+ $aData[] = array_merge(['key' => $aModule['name'], 'title' => $aModule['title'], 'url' => $oPermalink->permalink($CNF['URL_HOME']), 'add_url' => str_replace('edit-', 'create-',$CNF['URI_EDIT_ENTRY']), 'action' => 'member', 'icon' => $CNF['ICON'], 'type' => 'simple', 'members' => $iMembers], $a);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$bApi = bx_is_api();
|
|
|
- if($bApi)
|
|
|
- return [bx_api_get_block('dashboard_stat', $aData)];
|
|
|
+ if($bApi){
|
|
|
+ $oMenu = BxDolMenu::getObjectInstance('sys_account_dashboard_manage_tools');
|
|
|
+ return [bx_api_get_block('dashboard_stat', ['modules' => $aData, 'manage' => $oMenu->getCodeAPI()])];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public function serviceManageAudit()
|