Просмотр исходного кода

#162 undefined constants in profiles modules

Alex Trofimov 11 лет назад
Родитель
Сommit
ca61bfbc23

+ 0 - 1
inc/classes/BxDolProfile.php

@@ -410,7 +410,6 @@ class BxDolProfile extends BxDol implements iBxDolProfile
 
         if ($aInfo['type'] == 'system' && count($aProfiles) == 1) {
             $sUrl = BxDolPermalinks::getInstance()->permalink('page.php?i=account-profile-switcher');
-
             $oInformer->add('sys-account-profile-system', _t('_sys_txt_account_profile_system', $sUrl), BX_INFORMER_ALERT);
         }
     }

+ 6 - 9
modules/base/profile/classes/BxBaseModProfilePageEntry.php

@@ -23,8 +23,6 @@ class BxBaseModProfilePageEntry extends BxBaseModGeneralPageEntry
 
         $CNF = &$this->_oModule->_oConfig->CNF;
 
-        $aInformers = array ();
-
         // get profile info
         $iProfileId = bx_process_input(bx_get('profile_id'), BX_DATA_INT);
         $iContentId = bx_process_input(bx_get('id'), BX_DATA_INT);
@@ -58,7 +56,9 @@ class BxBaseModProfilePageEntry extends BxBaseModGeneralPageEntry
         $this->addMarkers(array('profile_link' => $this->_oProfile->getUrl())); // profile link
 
         // display message if profile isn't active
-        if (bx_get_logged_profile_id() == $this->_oProfile->id() && !empty($CNF['INFORMERS']['status'])) {
+        $aInformers = array ();
+        $oInformer = BxDolInformer::getInstance($this->_oTemplate);
+        if (bx_get_logged_profile_id() == $this->_oProfile->id() && !empty($CNF['INFORMERS']['status']) && $oInformer) {
             $sStatus = $this->_aContentInfo['profile_status'];
             if (isset($CNF['INFORMERS']['status']['map'][$sStatus]))
                 $aInformers[] = array ('name' => $CNF['INFORMERS']['status']['name'], 'msg' => _t($CNF['INFORMERS']['status']['map'][$sStatus]), 'type' => BX_INFORMER_ALERT);
@@ -70,12 +70,9 @@ class BxBaseModProfilePageEntry extends BxBaseModGeneralPageEntry
             $oProfile->checkSwitchToProfile($this->_oTemplate);
 
         // add informers
-        if ($aInformers) {
-            $oInformer = BxDolInformer::getInstance($this->_oTemplate);
-            if ($oInformer) {
-                foreach ($aInformers as $a)
-                    $oInformer->add($a['name'], $this->_replaceMarkers($a['msg']), $a['type']);
-            }
+        if ($aInformers && $oInformer) {
+            foreach ($aInformers as $a)
+                $oInformer->add($a['name'], $this->_replaceMarkers($a['msg']), $a['type']);
         }
     }