Skip to content
Snippets Groups Projects
Commit 85c0d5a9 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

improve features list order

parent 9f784749
Branches
Tags
No related merge requests found
Pipeline #2556 passed with stage
in 22 minutes and 33 seconds
......@@ -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 =
......
......@@ -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)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment