diff --git a/engine/Plugin/Navigation.php b/engine/Plugin/Navigation.php index af78b0a..c46ca57 100644 --- a/engine/Plugin/Navigation.php +++ b/engine/Plugin/Navigation.php @@ -110,4 +110,86 @@ class Navigation } } + /** + * Draw items + * + * + * Navigation::draw('content'); + * Navigation::draw('top', Navigation::TOP); + * + * + * @param string $category Category + * @param integer $type Type. Default is LEFT + */ + public static function get($category, $type = Navigation::LEFT) { + + // Sort items by priority + $items = Arr::subvalSort(Navigation::$items, 'priority'); + + // Draw left navigation + if ($type == Navigation::LEFT) { + + // Loop trough the items + foreach ($items as $item) { + + // If current plugin id == selected item id then set class to current + if (Request::get('id') == $item['id'] && $item['external'] == false) $class = 'class = "current" '; else $class = ''; + + // If current category == item category and navigation type is left them draw this item + if ($item['category'] == $category && $item['type'] == Navigation::LEFT) { + + // Is external item id or not ? + if ($item['external'] == false) { + echo '
  • '.$item['name'].'
  • '; + } else { + echo '
  • '.$item['name'].'
  • '; + } + } + } + } elseif ($type == Navigation::TOP) { + // Draw top navigation + foreach ($items as $item) { + if ($item['category'] == $category && $item['type'] == Navigation::TOP) { + if ($item['external'] == false) { + echo ''.$item['name'].''.Html::nbsp(2); + } else { + echo ''.$item['name'].''.Html::nbsp(2); + } + } + } + } + + } + + /** + * Draw dropdown items + * + * + * Navigation::getDropdown('content'); + * + * + * @param string $category Category + */ + public static function getDropdown($category) { + + // Sort items by priority + $items = Arr::subvalSort(Navigation::$items, 'priority'); + + // Loop trough the items + foreach ($items as $item) { + + // If current plugin id == selected item id then set class to current + if (Request::get('id') == $item['id'] && $item['external'] == false) $class = 'selected = "selected" '; else $class = ''; + + // If current category == item category and navigation type is left them draw this item + if ($item['category'] == $category && $item['type'] == Navigation::LEFT) { + + // Is external item id or not ? + if ($item['external'] == false) { + echo ''; + } + } + } + } + } diff --git a/plugins/box/filesmanager/views/backend/index.view.php b/plugins/box/filesmanager/views/backend/index.view.php index 0dfd973..9174228 100755 --- a/plugins/box/filesmanager/views/backend/index.view.php +++ b/plugins/box/filesmanager/views/backend/index.view.php @@ -40,8 +40,8 @@ - - + + @@ -73,10 +73,10 @@ > '_blank'));?> - + - + diff --git a/plugins/box/users/views/backend/index.view.php b/plugins/box/users/views/backend/index.view.php index 6c61daa..1347e77 100755 --- a/plugins/box/users/views/backend/index.view.php +++ b/plugins/box/users/views/backend/index.view.php @@ -20,9 +20,9 @@ - - - + + + @@ -32,13 +32,13 @@ - + - + - +