]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/helper/class_BaseHelper.php
Final fixes for helper sub/groups
[shipsimu.git] / inc / classes / main / helper / class_BaseHelper.php
index 0e21d884cedef39181e8496dac304067c6f02b68..3993e984015ac37ad37fd779e1de72c51a18258d 100644 (file)
@@ -89,7 +89,29 @@ class BaseHelper extends BaseFrameworkSystem {
         * @return      void
         */
        protected final function addContent ($newContent) {
-               $this->content .= (string) trim($newContent) . "\r\n";
+               $this->content .= (string) trim($newContent)."\n";
+       }
+
+       /**
+        * Add header content to the helper
+        *
+        * @param       $content        Content to to the base
+        * @return      void
+        */
+       protected function addHeaderContent ($content) {
+               // Add the header content
+               $this->groups['header']['content'] = (string) trim($content);
+       }
+
+       /**
+        * Add footer content to the helper
+        *
+        * @param       $content        Content to to the base
+        * @return      void
+        */
+       protected function addFooterContent ($content) {
+               // Add the footer content
+               $this->groups['footer']['content'] = (string) trim($content);
        }
 
        /**
@@ -317,8 +339,17 @@ class BaseHelper extends BaseFrameworkSystem {
         * @return      $content        Rendered HTML content
         */
        public function renderContent () {
+               // Initialize content
+               $content = "";
+
+               // Is header content there?
+               if (isset($this->groups['header'])) {
+                       // Then add it
+                       $content .= $this->groups['header']['content']."\n";
+               } // END - if
+
                // Initiate content
-               $content = $this->getContent();
+               $content .= $this->getContent();
 
                // Now "walk" through all groups and sub-groups
                for ($idx = 1; $idx <= $this->totalCounter; $idx++) {
@@ -340,6 +371,12 @@ class BaseHelper extends BaseFrameworkSystem {
 
                } // END - for
 
+               // Is footer content there?
+               if (isset($this->groups['footer'])) {
+                       // Then add it
+                       $content .= $this->groups['footer']['content']."\n";
+               } // END - if
+
                // Return it
                //* DEBUG: */ echo "content=<pre>".htmlentities($content)."</pre> (".strlen($content).")<br />\n";
                return $content;