فهرست منبع

Ticket #255 - Clean up: Description block for Profile modules.

AntonLV 10 سال پیش
والد
کامیت
9572849838

+ 14 - 0
modules/base/general/classes/BxBaseModGeneralFormsEntryHelper.php

@@ -44,6 +44,20 @@ class BxBaseModGeneralFormsEntryHelper extends BxDolProfileForms
         return BxDolForm::getObjectInstance($this->_oModule->_oConfig->CNF['OBJECT_FORM_ENTRY'], $this->_oModule->_oConfig->CNF['OBJECT_FORM_ENTRY_DISPLAY_DELETE'], $this->_oModule->_oTemplate);
         return BxDolForm::getObjectInstance($this->_oModule->_oConfig->CNF['OBJECT_FORM_ENTRY'], $this->_oModule->_oConfig->CNF['OBJECT_FORM_ENTRY_DISPLAY_DELETE'], $this->_oModule->_oTemplate);
     }
     }
 
 
+    public function viewDataEntry ($iContentId)
+    {
+        // get content data and profile info
+        list ($oProfile, $aContentInfo) = $this->_getProfileAndContentData($iContentId);
+        if (!$aContentInfo)
+            return MsgBox(_t('_sys_txt_error_entry_is_not_defined'));
+
+        // check access
+        if (CHECK_ACTION_RESULT_ALLOWED !== ($sMsg = $this->_oModule->checkAllowedView($aContentInfo)))
+            return MsgBox($sMsg);
+
+        return $this->_oModule->_oTemplate->entryText($aContentInfo);
+    }
+
     public function addDataForm ()
     public function addDataForm ()
     {
     {
         $CNF = &$this->_oModule->_oConfig->CNF;
         $CNF = &$this->_oModule->_oConfig->CNF;

+ 5 - 0
modules/base/general/classes/BxBaseModGeneralModule.php

@@ -119,6 +119,11 @@ class BxBaseModGeneralModule extends BxDolModule
         return $this->_serviceEntityForm ('deleteDataForm', $iContentId);
         return $this->_serviceEntityForm ('deleteDataForm', $iContentId);
     }
     }
 
 
+    public function serviceEntityTextBlock ($iContentId = 0)
+    {
+        return $this->_serviceEntityForm ('viewDataEntry', $iContentId);
+    }
+
     public function serviceEntityInfo ($iContentId = 0)
     public function serviceEntityInfo ($iContentId = 0)
     {
     {
         return $this->_serviceEntityForm ('viewDataForm', $iContentId);
         return $this->_serviceEntityForm ('viewDataForm', $iContentId);

+ 25 - 0
modules/base/general/classes/BxBaseModGeneralTemplate.php

@@ -50,6 +50,31 @@ class BxBaseModGeneralTemplate extends BxDolModuleTemplate
         return !$bWrap ? $sContent : $this->_wrapInTagJsCode($sContent);
         return !$bWrap ? $sContent : $this->_wrapInTagJsCode($sContent);
     }
     }
 
 
+	function entryText ($aData, $sTemplateName = 'entry-text.html')
+    {
+        $CNF = &$this->getModule()->_oConfig->CNF;
+
+        $aVars = $aData;
+        $aVars['entry_title'] = !empty($CNF['FIELD_TITLE']) && isset($aData[$CNF['FIELD_TITLE']]) ? bx_process_output($aData[$CNF['FIELD_TITLE']]) : '';
+        $aVars['entry_text'] = !empty($CNF['FIELD_TEXT']) && isset($aData[$CNF['FIELD_TEXT']]) ? $aData[$CNF['FIELD_TEXT']] : '';
+
+        if (!empty($CNF['OBJECT_METATAGS'])) {
+            $oMetatags = BxDolMetatags::getObjectInstance($CNF['OBJECT_METATAGS']);
+    
+            // keywords
+            if ($oMetatags->keywordsIsEnabled()) {
+                $aFields = $oMetatags->keywordsFields($aData, $CNF, $CNF['OBJECT_FORM_ENTRY_DISPLAY_VIEW']);
+                foreach ($aFields as $sField)
+                    $aVars[$sField] = $oMetatags->keywordsParse($aData[$CNF['FIELD_ID']], $aVars[$sField]);
+            }
+
+            // location
+            $aVars['location'] = $oMetatags->locationsIsEnabled() ? $oMetatags->locationsString($aData[$CNF['FIELD_ID']]) : '';
+        }
+
+        return $this->parseHtmlByName($sTemplateName, $aVars);
+    }
+
     function entryLocation ($iContentId)
     function entryLocation ($iContentId)
     {
     {
         $CNF = &$this->getModule()->_oConfig->CNF;
         $CNF = &$this->getModule()->_oConfig->CNF;

+ 0 - 17
modules/base/text/classes/BxBaseModTextFormsEntryHelper.php

@@ -38,23 +38,6 @@ class BxBaseModTextFormsEntryHelper extends BxBaseModGeneralFormsEntryHelper
         return $aContentInfo[$CNF['FIELD_TEXT']];
         return $aContentInfo[$CNF['FIELD_TEXT']];
     }
     }
 
 
-    /**
-     * @return main content text
-     */
-    public function viewDataEntry ($iContentId)
-    {
-        // get content data and profile info
-        list ($oProfile, $aContentInfo) = $this->_getProfileAndContentData($iContentId);
-        if (!$aContentInfo)
-            return MsgBox(_t('_sys_txt_error_entry_is_not_defined'));
-
-        // check access
-        if (CHECK_ACTION_RESULT_ALLOWED !== ($sMsg = $this->_oModule->checkAllowedView($aContentInfo)))
-            return MsgBox($sMsg);
-
-        return $this->_oModule->_oTemplate->entryText($aContentInfo);
-    }
-
     /**
     /**
      * @return array of profile object and content info
      * @return array of profile object and content info
      */
      */

+ 0 - 8
modules/base/text/classes/BxBaseModTextModule.php

@@ -109,14 +109,6 @@ class BxBaseModTextModule extends BxBaseModGeneralModule
         return $this->_oTemplate->entryAllActions('', $this->serviceEntitySocialSharing($iContentId));
         return $this->_oTemplate->entryAllActions('', $this->serviceEntitySocialSharing($iContentId));
     }
     }
 
 
-    /**
-     * Entry text with some additional controls
-     */
-    public function serviceEntityTextBlock ($iContentId = 0)
-    {
-        return $this->_serviceEntityForm ('viewDataEntry', $iContentId);
-    }
-
     /**
     /**
      * Entry location info
      * Entry location info
      */
      */

+ 0 - 25
modules/base/text/classes/BxBaseModTextTemplate.php

@@ -28,31 +28,6 @@ class BxBaseModTextTemplate extends BxBaseModGeneralTemplate
 		return $this->parseHtmlByName($sTemplateName, $this->getUnit($aData, $aParams));
 		return $this->parseHtmlByName($sTemplateName, $this->getUnit($aData, $aParams));
     }
     }
 
 
-    function entryText ($aData, $sTemplateName = 'entry-text.html')
-    {
-        $CNF = &$this->getModule()->_oConfig->CNF;
-
-        $aVars = $aData;
-        $aVars['entry_title'] = isset($aData[$CNF['FIELD_TITLE']]) ? bx_process_output($aData[$CNF['FIELD_TITLE']]) : '';
-        $aVars['entry_text'] = $aData[$CNF['FIELD_TEXT']];
-
-        if (!empty($CNF['OBJECT_METATAGS'])) {
-            $oMetatags = BxDolMetatags::getObjectInstance($CNF['OBJECT_METATAGS']);
-    
-            // keywords
-            if ($oMetatags->keywordsIsEnabled()) {
-                $aFields = $oMetatags->keywordsFields($aData, $CNF, $CNF['OBJECT_FORM_ENTRY_DISPLAY_VIEW']);
-                foreach ($aFields as $sField)
-                    $aVars[$sField] = $oMetatags->keywordsParse($aData[$CNF['FIELD_ID']], $aVars[$sField]);
-            }
-
-            // location
-            $aVars['location'] = $oMetatags->locationsIsEnabled() ? $oMetatags->locationsString($aData[$CNF['FIELD_ID']]) : '';
-        }
-
-        return $this->parseHtmlByName($sTemplateName, $aVars);
-    }
-
     function entryAuthor ($aData, $iProfileId = false, $sFuncAuthorDesc = 'getAuthorDesc', $sTemplateName = 'author.html', $sFuncAuthorAddon = 'getAuthorAddon')
     function entryAuthor ($aData, $iProfileId = false, $sFuncAuthorDesc = 'getAuthorDesc', $sTemplateName = 'author.html', $sFuncAuthorAddon = 'getAuthorAddon')
     {
     {
         $CNF = &$this->getModule()->_oConfig->CNF;
         $CNF = &$this->getModule()->_oConfig->CNF;