Serveur preprod f0c0c48223 first push
2016-04-14 16:14:31 +02:00

72 lines
1.7 KiB
PHP
Executable File

<?php
if (!defined('_PS_VERSION_'))
exit;
class ant_multi_cartrule extends Module
{
const ANT_CARTRULE_CLASS = 'AdminAntMultiCartRule';
public function __construct()
{
$this->name = 'ant_multi_cartrule';
$this->tab = 'others';
$this->version = 0.1;
$this->author = 'Antadis';
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
parent::__construct();
$this->displayName = $this->l('Antadis creation de bons en masse');
}
public function install()
{
return (
parent::install()
);
}
public function uninstall()
{
return (
parent::uninstall()
);
}
public static function createTab($id_parent, $module, $name, $class_name, $status=True)
{
$tab = new Tab();
$tab->module = $module;
foreach (Language::getLanguages(True) as $languages)
{
$tab->name[$languages['id_lang']] = $name;
}
if (!is_numeric($id_parent))
{
$id_parent = Tab::getIdFromClassName($id_parent);
}
$tab->id_parent = $id_parent;
$tab->class_name = $class_name;
$tab->active = $status;
$r = $tab->save();
if ($r === False)
return False;
return $tab->id;
}
public function deleteTab($class_name)
{
if ($id_tab = Tab::getIdFromClassName($class_name))
{
$tab = new Tab((int)$id_tab);
$tab->delete();
}
return True;
}
}