59 lines
1.4 KiB
PHP
Executable File
59 lines
1.4 KiB
PHP
Executable File
<?php
|
|
if (!defined('_CAN_LOAD_FILES_'))
|
|
exit;
|
|
|
|
class Antadis_Export extends Module
|
|
{
|
|
public function __construct()
|
|
{
|
|
$this->name = 'antadis_export';
|
|
$this->tab = 'administration';
|
|
$this->version = '1.0';
|
|
$this->author = 'Antadis';
|
|
$this->need_instance = 0;
|
|
|
|
parent::__construct();
|
|
|
|
$this->displayName = $this->l('Antadis Export');
|
|
$this->description = $this->l('Realiser des exports en CSV des commandes');
|
|
$this->secure_key = Tools::encrypt($this->name);
|
|
|
|
$this->confirmUninstall = $this->l('Are you sure ?');
|
|
}
|
|
|
|
public function install(){
|
|
|
|
$new_tab = new Tab();
|
|
$new_tab->class_name = 'AdminAntadisExport';
|
|
$new_tab->id_parent = Tab::getCurrentParentId();
|
|
$new_tab->module = $this->name;
|
|
$languages = Language::getLanguages();
|
|
foreach ($languages as $language) {
|
|
$new_tab->name[$language['id_lang']] = 'Antadis Exports';
|
|
}
|
|
|
|
$new_tab->add();
|
|
|
|
if ( !parent::install() ){
|
|
$this->uninstall();
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
public function uninstall(){
|
|
if( !parent::uninstall()){
|
|
return false;
|
|
}
|
|
|
|
$idTab = Tab::getIdFromClassName('AdminAntadisExport');
|
|
if ($idTab) {
|
|
$tab = new Tab($idTab);
|
|
$tab->delete();
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|