فهرست منبع

Merge branch 'master' of https://github.com/unaio/una

AntonLV 2 سال پیش
والد
کامیت
0d34bbd71a

+ 6 - 1
modules/base/general/classes/BxBaseModGeneralGridAdministration.php

@@ -324,7 +324,12 @@ class BxBaseModGeneralGridAdministration extends BxTemplGrid
     protected function _getCellHeaderReports ($sKey, $aField)
     {
         $s = parent::_getCellHeaderDefault($sKey, $aField);
-        return preg_replace ('/<a(.*?)>(.*?)<\/a>/', '<a$1 title="' . bx_html_attribute(_t('_sys_txt_reports_title')) . '"><i class="sys-icon exclamation-triangle"></i></a>', $s);
+        return $this->_bIsApi ? [
+                    'name' => bx_process_output($aField['name']),
+                    'title' => bx_process_output($aField['title']),
+                    'width' => $aField['width']
+                ] : preg_replace ('/<a(.*?)>(.*?)<\/a>/', '<a$1 title="' . bx_html_attribute(_t('_sys_txt_reports_title')) . '"><i class="sys-icon exclamation-triangle"></i></a>', $s);
+        
     }
     
     protected function _getCellReports($mixedValue, $sKey, $aField, $aRow)

+ 4 - 0
modules/base/groups/classes/BxBaseModGroupsGridAdministration.php

@@ -107,6 +107,10 @@ class BxBaseModGroupsGridAdministration extends BxBaseModProfileGridAdministrati
     protected function _getCellName($mixedValue, $sKey, $aField, $aRow)
     {
         $oProfile = $this->_getProfileObject($aRow['id']);
+        
+        if (bx_is_api()){
+            return ['type' => 'profile', 'data' => BxDolProfile::getData($oProfile->id())];
+        }
 
         return parent::_getCellDefault($oProfile->getUnit(0, array('template' => 'unit_wo_cover')), $sKey, $aField, $aRow);
     }

+ 18 - 0
modules/base/profile/classes/BxBaseModProfileGridAdministration.php

@@ -164,6 +164,17 @@ class BxBaseModProfileGridAdministration extends BxBaseModGeneralGridAdministrat
 
     	return $this->_getActionDefault ($sType, $sKey, $a, $isSmall, $isDisabled, $aRow);
     }
+    
+    protected function _getActionSettings($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
+    {
+        if (bx_is_api()){
+
+            return array_merge($a, ['name' => 'delete', 'type' => 'callback', 'action' => 'delete','on_callback' => 'hide_row', 'confirm' => 1,  'params' => '&id=' . $aRow[$this->_aOptions['field_id']] ]);
+        }
+        else{
+            return $this->_getActionDefault ($sType, $sKey, $a, $isSmall, $isDisabled, $aRow);
+        }
+    }
 
     protected function _getActionDeleteWithContent($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
     {
@@ -243,12 +254,19 @@ class BxBaseModProfileGridAdministration extends BxBaseModGeneralGridAdministrat
     protected function _getCellFullname($mixedValue, $sKey, $aField, $aRow)
     {
     	$oProfile = $this->_getProfileObject($aRow['id']);
+        
+        if (bx_is_api()){
+            return ['type' => 'profile', 'data' => BxDolProfile::getData($oProfile->id())];
+        }
 
         return parent::_getCellDefault($oProfile->getUnit(), $sKey, $aField, $aRow);
     }
 
     protected function _getCellLastOnline($mixedValue, $sKey, $aField, $aRow)
     {
+        if (bx_is_api()){
+            return ['type' => 'time', 'data' => $mixedValue];
+        }
         return parent::_getCellDefault(bx_time_js($mixedValue), $sKey, $aField, $aRow);
     }
 

+ 4 - 0
modules/boonex/timeline/classes/BxTimelineGridManageTools.php

@@ -44,6 +44,10 @@ class BxTimelineGridManageTools extends BxBaseModGeneralGridAdministration
         if($sType == 'single' && $this->_sManageType == BX_DOL_MANAGE_TOOLS_ADMINISTRATION && $this->_oModule->isAllowedDelete($aRow) !== true)
             return '';
 
+        
+        if (bx_is_api()){
+            return array_merge($a, ['type' => 'callback', 'on_callback' => 'hide_row', 'params' => '&id=' . $aRow[$this->_aOptions['field_id']] ]);
+        }
     	return $this->_getActionDefault($sType, $sKey, $a, $isSmall, $isDisabled, $aRow);
     }
 

+ 3 - 0
template/scripts/BxBasePage.php

@@ -500,6 +500,9 @@ class BxBasePage extends BxDolPage
                 'url' => bx_api_get_relative_url($o->getUrl()),
                 'avatar' => $o->getAvatar(),
                 'settings' => $o->getSettings(),
+                //'level' => BxDolAcl::getInstance()->getMemberMembershipInfo($o->id()),
+                'moderator' => (bool)BxDolAcl::getInstance()->isMemberLevelInSet([MEMBERSHIP_ID_ADMINISTRATOR, MEMBERSHIP_ID_MODERATOR], $o->id()),
+                'operator' => isAdmin(),
                 //'info' => $o->getInfo(),
                 'confirmed' => $oAccount->isConfirmed(),
                 'notifications' => 0,