From c2b9771a2c4f3934d170bc387b7fd0137cdb2c93 Mon Sep 17 00:00:00 2001
From: Andreas Gohr <andi@splitbrain.org>
Date: Fri, 19 May 2017 15:47:17 +0200
Subject: [PATCH] fix base dir for images

---
 inc/Menu/AbstractMenu.php      | 2 ++
 inc/Menu/Item/AbstractItem.php | 2 +-
 inc/Menu/Item/Backlink.php     | 2 +-
 inc/Menu/Item/Edit.php         | 2 +-
 inc/Menu/Item/ImgBackto.php    | 2 +-
 inc/Menu/Item/MediaManager.php | 2 +-
 inc/Menu/Item/Revert.php       | 2 +-
 inc/Menu/Item/Revisions.php    | 2 +-
 inc/Menu/Item/Subscribe.php    | 2 +-
 inc/Menu/Item/Top.php          | 2 +-
 10 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/inc/Menu/AbstractMenu.php b/inc/Menu/AbstractMenu.php
index b1f34a14a..7680d2bac 100644
--- a/inc/Menu/AbstractMenu.php
+++ b/inc/Menu/AbstractMenu.php
@@ -66,6 +66,7 @@ abstract class AbstractMenu {
      * output, use getItems() and build the HTML yourself
      *
      * @param string|false $classprefix create a class from type with this prefix, false for no class
+     * @return string
      */
     public function getListItems($classprefix = '') {
         $html = '';
@@ -80,6 +81,7 @@ abstract class AbstractMenu {
             $html .= $item->asHtmlLink(false);
             $html .= '</li>';
         }
+        return $html;
     }
 
 }
diff --git a/inc/Menu/Item/AbstractItem.php b/inc/Menu/Item/AbstractItem.php
index c999cb919..f47cd0ef2 100644
--- a/inc/Menu/Item/AbstractItem.php
+++ b/inc/Menu/Item/AbstractItem.php
@@ -34,7 +34,7 @@ abstract class AbstractItem {
     protected $nofollow    = true;
     protected $replacement = '';
     protected $category    = 'page';
-    protected $svg         = DOKU_BASE . 'lib/images/menu/00-default_checkbox-blank-circle-outline.svg';
+    protected $svg         = DOKU_INC . 'lib/images/menu/00-default_checkbox-blank-circle-outline.svg';
     protected $label       = '';
     protected $context     = self::CTX_ALL;
 
diff --git a/inc/Menu/Item/Backlink.php b/inc/Menu/Item/Backlink.php
index 5d4901753..3a39426fc 100644
--- a/inc/Menu/Item/Backlink.php
+++ b/inc/Menu/Item/Backlink.php
@@ -4,6 +4,6 @@ namespace dokuwiki\Menu\Item;
 
 class Backlink extends AbstractItem {
 
-    protected $svg = DOKU_BASE . 'lib/images/menu/08-backlink_link-variant.svg';
+    protected $svg = DOKU_INC . 'lib/images/menu/08-backlink_link-variant.svg';
 
 }
diff --git a/inc/Menu/Item/Edit.php b/inc/Menu/Item/Edit.php
index 45a05eb1e..eb9705673 100644
--- a/inc/Menu/Item/Edit.php
+++ b/inc/Menu/Item/Edit.php
@@ -52,7 +52,7 @@ class Edit extends AbstractItem {
             'source' => '05-source_file-xml.svg',
         );
         if(isset($icons[$this->type])) {
-            $this->svg = DOKU_BASE . 'lib/images/menu/' . $icons[$this->type];
+            $this->svg = DOKU_INC . 'lib/images/menu/' . $icons[$this->type];
         }
     }
 
diff --git a/inc/Menu/Item/ImgBackto.php b/inc/Menu/Item/ImgBackto.php
index 79fda098a..0d5f726f2 100644
--- a/inc/Menu/Item/ImgBackto.php
+++ b/inc/Menu/Item/ImgBackto.php
@@ -9,7 +9,7 @@ class ImgBackto extends AbstractItem {
         global $ID;
         parent::__construct();
 
-        $this->svg = DOKU_BASE . 'lib/images/menu/12-back_arrow-left.svg';
+        $this->svg = DOKU_INC . 'lib/images/menu/12-back_arrow-left.svg';
         $this->type = 'img_backto';
         $this->params = array();
         $this->accesskey = 'b';
diff --git a/inc/Menu/Item/MediaManager.php b/inc/Menu/Item/MediaManager.php
index e8a44e0f3..eef9ec581 100644
--- a/inc/Menu/Item/MediaManager.php
+++ b/inc/Menu/Item/MediaManager.php
@@ -4,7 +4,7 @@ namespace dokuwiki\Menu\Item;
 
 class MediaManager extends AbstractItem {
 
-    protected $svg = DOKU_BASE . 'lib/images/menu/11-mediamanager_folder-image.svg';
+    protected $svg = DOKU_INC . 'lib/images/menu/11-mediamanager_folder-image.svg';
 
     /** @inheritdoc */
     public function __construct() {
diff --git a/inc/Menu/Item/Revert.php b/inc/Menu/Item/Revert.php
index d1fc8f34c..83072e469 100644
--- a/inc/Menu/Item/Revert.php
+++ b/inc/Menu/Item/Revert.php
@@ -15,7 +15,7 @@ class Revert extends AbstractItem {
         }
         $this->params['rev'] = $REV;
         $this->params['sectok'] = getSecurityToken();
-        $this->svg = DOKU_BASE . 'lib/images/menu/06-revert_replay.svg';
+        $this->svg = DOKU_INC . 'lib/images/menu/06-revert_replay.svg';
     }
 
 }
diff --git a/inc/Menu/Item/Revisions.php b/inc/Menu/Item/Revisions.php
index 415eaddd7..63b0b94a5 100644
--- a/inc/Menu/Item/Revisions.php
+++ b/inc/Menu/Item/Revisions.php
@@ -10,7 +10,7 @@ class Revisions extends AbstractItem {
 
         $this->type = 'revs';
         $this->params['do'] = 'revs';
-        $this->svg = DOKU_BASE . 'lib/images/menu/07-revisions_history.svg';
+        $this->svg = DOKU_INC . 'lib/images/menu/07-revisions_history.svg';
     }
 
 }
diff --git a/inc/Menu/Item/Subscribe.php b/inc/Menu/Item/Subscribe.php
index b2c2492f9..f71414ade 100644
--- a/inc/Menu/Item/Subscribe.php
+++ b/inc/Menu/Item/Subscribe.php
@@ -4,7 +4,7 @@ namespace dokuwiki\Menu\Item;
 
 class Subscribe extends AbstractItem {
 
-    protected $svg = DOKU_BASE . 'lib/images/menu/09-subscribe_email-outline.svg';
+    protected $svg = DOKU_INC . 'lib/images/menu/09-subscribe_email-outline.svg';
 
     /** @inheritdoc */
     public function __construct() {
diff --git a/inc/Menu/Item/Top.php b/inc/Menu/Item/Top.php
index 7d67fd4ba..6c5307e45 100644
--- a/inc/Menu/Item/Top.php
+++ b/inc/Menu/Item/Top.php
@@ -4,7 +4,7 @@ namespace dokuwiki\Menu\Item;
 
 class Top extends AbstractItem {
 
-    protected $svg       = DOKU_BASE . 'lib/images/menu/10-top_arrow-up.svg';
+    protected $svg       = DOKU_INC . 'lib/images/menu/10-top_arrow-up.svg';
     protected $accesskey = 't';
     protected $params    = array('do' => '');
     protected $id        = '#dokuwiki__top';
-- 
GitLab