Fixed links in dynamic boxes
authorMarcel Werk <burntime@woltlab.com>
Thu, 30 Jun 2016 14:51:52 +0000 (16:51 +0200)
committerMarcel Werk <burntime@woltlab.com>
Thu, 30 Jun 2016 14:51:52 +0000 (16:51 +0200)
wcfsetup/install/files/lib/data/box/Box.class.php

index 66f3cc5688eaed6cd9f69ef655bc2791cbf4c144..f1f1cace407b63ffe2381ca7e7272517791396c9 100644 (file)
@@ -380,6 +380,13 @@ class Box extends DatabaseObject {
         * @return      string
         */
        public function getLink() {
+               if ($this->boxType == 'system') {
+                       return $this->getController()->getLink();
+               }
+               else if ($this->boxType == 'menu') {
+                       return '';
+               }
+               
                if ($this->linkPageObjectID) {
                        $handler = $this->getLinkPageHandler();
                        if ($handler && $handler instanceof ILookupPageHandler) {
@@ -401,6 +408,13 @@ class Box extends DatabaseObject {
         * @return      boolean
         */
        public function hasLink() {
+               if ($this->boxType == 'system') {
+                       return $this->getController()->hasLink();
+               }
+               else if ($this->boxType == 'menu') {
+                       return false;
+               }
+               
                return ($this->linkPageID || !empty($this->externalURL));
        }