48 lines
1.0 KiB
PHP
Executable File
48 lines
1.0 KiB
PHP
Executable File
<?php
|
|
if(!defined('_PS_VERSION_')) {
|
|
exit;
|
|
}
|
|
|
|
|
|
class EANManager extends Module {
|
|
public $_html = '';
|
|
|
|
function __construct() {
|
|
$this->name = 'eanmanager';
|
|
$this->tab = 'administration';
|
|
$this->version = '1.0';
|
|
$this->author = 'Antadis';
|
|
$this->need_instance = 0;
|
|
|
|
parent::__construct();
|
|
|
|
$this->displayName = $this->l('EAN Manager');
|
|
$this->description = $this->l('Allows to manage products EAN codes');
|
|
}
|
|
|
|
function install() {
|
|
# Add admin tabs
|
|
$tabs_i18n = array(
|
|
'fr' => 'EAN',
|
|
'en' => 'EAN',
|
|
);
|
|
|
|
$t = new Tab();
|
|
$t->id_parent = (int) Tab::getIdFromClassName('AdminCatalog');
|
|
$st->position = (int) Tab::getNewLastPosition($st->id_parent);
|
|
$t->active = TRUE;
|
|
$t->module = 'eanmanager';
|
|
$t->class_name = 'AdminEANManager';
|
|
foreach(Language::getLanguages() as $lang) {
|
|
if(isset($tabs_i18n[$lang['iso_code']])) {
|
|
$t->name[$lang['id_lang']] = $tabs_i18n[$lang['iso_code']];
|
|
} else {
|
|
$t->name[$lang['id_lang']] = $tabs_i18n['en'];
|
|
}
|
|
}
|
|
$t->save();
|
|
|
|
return parent::install();
|
|
}
|
|
}
|