Minor changes on plugin categories
This commit is contained in:
parent
23b1bc6b2e
commit
03374adb28
|
@ -4,6 +4,5 @@
|
||||||
"name": "Categories",
|
"name": "Categories",
|
||||||
"description": "Shows all categories on the system on the sidebar."
|
"description": "Shows all categories on the system on the sidebar."
|
||||||
},
|
},
|
||||||
"categories-without-content": "Categories without content",
|
"hide-categories-without-content": "Hide Categories without content"
|
||||||
"show-the-categories-without-content": "Show the categories without content."
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ class pluginCategories extends Plugin {
|
||||||
// Fields and default values for the database of this plugin
|
// Fields and default values for the database of this plugin
|
||||||
$this->dbFields = array(
|
$this->dbFields = array(
|
||||||
'label'=>'Categories',
|
'label'=>'Categories',
|
||||||
'showCero'=>false
|
'hideCero'=>true
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,12 +23,11 @@ class pluginCategories extends Plugin {
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
$html .= '<div>';
|
$html .= '<div>';
|
||||||
$html .= '<label>'.$Language->get('Categories without content').'</label>';
|
$html .= '<label>'.$Language->get('Hide Categories without content').'</label>';
|
||||||
$html .= '<select name="showCero">';
|
$html .= '<select name="hideCero">';
|
||||||
$html .= '<option value="true" '.($this->getValue('showCero')===true?'selected':'').'>Enabled</option>';
|
$html .= '<option value="true" '.($this->getValue('hideCero')===true?'selected':'').'>'.$Language->get('Enabled').'</option>';
|
||||||
$html .= '<option value="false" '.($this->getValue('showCero')===false?'selected':'').'>Disabled</option>';
|
$html .= '<option value="false" '.($this->getValue('hideCero')===false?'selected':'').'>'.$Language->get('Disabled').'</option>';
|
||||||
$html .= '</select>';
|
$html .= '</select>';
|
||||||
$html .= '<span class="tip">'.$Language->get('Show the categories without content').'</span>';
|
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|
||||||
return $html;
|
return $html;
|
||||||
|
@ -49,7 +48,7 @@ class pluginCategories extends Plugin {
|
||||||
// By default the database of categories are alphanumeric sorted
|
// By default the database of categories are alphanumeric sorted
|
||||||
foreach ($dbCategories->db as $key=>$fields) {
|
foreach ($dbCategories->db as $key=>$fields) {
|
||||||
$count = count($fields['list']);
|
$count = count($fields['list']);
|
||||||
if($this->getValue('showCero') || $count>0) {
|
if (!$this->getValue('hideCero') || $count>0) {
|
||||||
$html .= '<li>';
|
$html .= '<li>';
|
||||||
$html .= '<a href="'.DOMAIN_CATEGORIES.$key.'">';
|
$html .= '<a href="'.DOMAIN_CATEGORIES.$key.'">';
|
||||||
$html .= $fields['name'];
|
$html .= $fields['name'];
|
||||||
|
|
Loading…
Reference in New Issue