]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/helper/web/links/class_WebLinkHelper.php
generateUniqueId() and more useless/deprecated methods removed, code speed-up, link...
[shipsimu.git] / inc / classes / main / helper / web / links / class_WebLinkHelper.php
index 4121cd2a2cdce5f9c0f9eb74e39e1292b2168292..f90636757aacf41bc76772cb20c107b02b9a6a69 100644 (file)
@@ -35,9 +35,6 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate {
        protected function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
-
-               // Set part description
-               $this->setObjectDescription("A helper for generating web links");
        }
 
        /**
@@ -84,9 +81,45 @@ class WebLinkHelper extends BaseWebHelper implements HelpableTemplate {
         * Flush the content out,e g. to a template variable
         *
         * @return      void
+        * @todo        Completely unimplemented
         */
        public function flushContent () {
-               $this->partialStub("Please implement this method.");
+               // Needed to be implemented!
+       }
+
+       /**
+        * Adds a link group (like the form group is) with some raw language to the
+        * helper.
+        *
+        * @param       $groupId        Id string of the group
+        * @param       $groupText      Text for this group to add
+        * @return      void
+        */
+       public function addLinkGroup ($groupId, $groupText) {
+               // Is a group with that name open?
+               if ($this->ifGroupIsOpened($groupId)) {
+                       // Then close it here
+                       $this->closeGroupById($groupId);
+               } else {
+                       // Open the new group
+                       $this->openGroupByIdText($groupId, $groupText);
+               }
+       }
+
+       /**
+        * Adds text (note) to the previously opened group or throws an exception
+        * if no previous group was opened.
+        *
+        * @param       $groupNote      Note to be added to a group
+        * @return      void
+        * @throws      NoGroupOpenedException  If no previous group was opened
+        */
+       public function addLinkNote ($groupNote) {
+               // Check if a previous group was opened
+               if (!$this->ifGroupOpenedPreviously()) {
+                       // No group was opened before!
+                       throw new NoGroupOpenedException(array($this, $groupNote), self::EXCEPTION_GROUP_NOT_OPENED);
+               }
        }
 }