diff --git a/application/modules/admin/views/scripts/feature/index.phtml b/application/modules/admin/views/scripts/feature/index.phtml index 748a54af926fd7dc56a8a536d31d5380969d8e90..9162964d6bd16f7c781c3c20c5669065d45d7935 100644 --- a/application/modules/admin/views/scripts/feature/index.phtml +++ b/application/modules/admin/views/scripts/feature/index.phtml @@ -20,24 +20,6 @@ $description = (new Class_TableDescription('features')) return $feature->getCategory(); }) - ->addRowAction(function($feature) - { - return $this->tagAnchor($feature->getWiki(), - $this->tagImg(Class_Admin_Skin::current() - ->getIconUrl('actions', - 'help')), - ['target' => '_blank', - 'title' => $this->_('Documentation')]); - }) - - ->addRowAction(function($feature) - { - if(!$feature->getTest()) - return ''; - return $this->tagPreview(Class_Url::relative($feature->getTest()), - $this->_('Essayer')); - }) - ->addRowAction(function($feature) { $hide = $this->tagAnchor(['module' => 'admin', @@ -62,6 +44,24 @@ $description = (new Class_TableDescription('features')) ? $hide : $show; }) + + ->addRowAction(function($feature) + { + return $this->tagAnchor($feature->getWiki(), + $this->tagImg(Class_Admin_Skin::current() + ->getIconUrl('actions', + 'help')), + ['target' => '_blank', + 'title' => $this->_('Documentation')]); + }) + + ->addRowAction(function($feature) + { + if(!$feature->getTest()) + return ''; + return $this->tagPreview(Class_Url::relative($feature->getTest()), + $this->_('Essayer')); + }) ; $html = diff --git a/library/Class/Feature.php b/library/Class/Feature.php index bfadd212c88d0033ada0884c40721428401bedf4..52275e54812b0be9eb3cb220c1d42faa20fe3ad9 100644 --- a/library/Class/Feature.php +++ b/library/Class/Feature.php @@ -39,7 +39,11 @@ class Class_Feature { public function findAll() { - return $this->_getFeatures(); + if(static::$_features) + return static::$_features; + + $features = (new Class_Feature_List)->getFeatures(); + return static::$_features = array_reverse(array_map([$this, '_createInstances'], array_keys($features), $features)); } @@ -99,15 +103,6 @@ class Class_Feature { } - protected function _getFeatures() { - if(static::$_features) - return static::$_features; - - $features = (new Class_Feature_List)->getFeatures(); - return static::$_features = array_map([$this, '_createInstances'], array_keys($features), $features); - } - - protected function _createInstances($id, $feature) { return (new Class_Feature_Description) ->setId($id)