* @copyright PrestaShop
* @license http://www.opensource.org/licenses/osl-3.0.php Open-source licence 3.0
* @version 1.3
*
*/
include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php');
include_once(PS_ADMIN_DIR.'/tabs/AdminFeaturesValues.php');
class AdminFeatures extends AdminTab
{
public function __construct()
{
$this->adminFeaturesValues = new AdminFeaturesValues();
$this->table = 'feature';
$this->className = 'Feature';
$this->lang = true;
$this->edit = true;
$this->delete = true;
$this->fieldsDisplay = array(
'name' => array('title' => $this->l('Name'), 'width' => 128),
'value' => array('title' => $this->l('Values'), 'width' => 255, 'orderby' => false, 'search' => false));
parent::__construct();
}
public function display()
{
global $currentIndex;
if ((isset($_POST['submitAddfeature_value']) AND sizeof($this->adminFeaturesValues->_errors))
OR isset($_GET['updatefeature_value']) OR isset($_GET['addfeature_value']))
{
$this->adminFeaturesValues->displayForm($this->token);
echo '
'.$this->l('Back to list').'
';
}
else
parent::display();
}
/* Report to AdminTab::displayList() for more details */
public function displayList()
{
global $currentIndex;
echo '
'.$this->l('Add feature').'
'.$this->l('Add feature value').'
'.$this->l('Click on the feature name to view its values. Click again to hide them.').'
';
$this->displayListHeader();
echo '';
if (!sizeof($this->_list))
echo '