public function install()
 {
     // Install SQL
     include dirname(__FILE__) . '/sql/install.php';
     foreach ($sql as $s) {
         if (!Db::getInstance()->execute($s)) {
             return false;
         }
     }
     // Install Tabs
     if (!(int) Tab::getIdFromClassName('AdminPosMenu')) {
         $parent_tab = new Tab();
         // Need a foreach for the language
         $parent_tab->name[$this->context->language->id] = $this->l('PosExtentions');
         $parent_tab->class_name = 'AdminPosMenu';
         $parent_tab->id_parent = 0;
         // Home tab
         $parent_tab->module = $this->name;
         $parent_tab->add();
     }
     $tab = new Tab();
     // Need a foreach for the language
     foreach (Language::getLanguages() as $language) {
         $tab->name[$language['id_lang']] = $this->l('Manage Staticblocks');
     }
     $tab->class_name = 'AdminPosstaticblocks';
     $tab->id_parent = (int) Tab::getIdFromClassName('AdminPosMenu');
     $tab->module = $this->name;
     $tab->add();
     // Set some defaults
     return parent::install() && $this->registerHook('top') && $this->registerHook('brandSlider') && $this->registerHook('bannerSlide') && $this->registerHook('blockPosition1') && $this->registerHook('blockPosition2') && $this->registerHook('blockPosition3') && $this->registerHook('blockPosition4') && $this->registerHook('blockPosition5') && $this->registerHook('blockPosition6') && $this->registerHook('bannerTabcate') && $this->registerHook('blockDetailProduct') && $this->registerHook('leftColumn') && $this->registerHook('rightColumn') && $this->registerHook('home') && $this->registerHook('footer') && $this->registerHook('displayHeader') && $this->registerHook('displayBackOfficeHeader');
 }
Пример #2
0
 public function install()
 {
     // Prepare tab
     $tab = new Tab();
     $tab->active = 1;
     $tab->class_name = "AdminBlockCategories";
     $tab->name = array();
     foreach (Language::getLanguages(true) as $lang) {
         $tab->name[$lang['id_lang']] = 'BlockCategories';
     }
     $tab->id_parent = -1;
     $tab->module = $this->name;
     if (!$tab->add() || !parent::install() || !$this->registerHook('footer') || !$this->registerHook('header') || !$this->registerHook('categoryAddition') || !$this->registerHook('categoryUpdate') || !$this->registerHook('categoryDeletion') || !$this->registerHook('actionAdminMetaControllerUpdate_optionsBefore') || !$this->registerHook('actionAdminLanguagesControllerStatusBefore') || !$this->registerHook('displayBackOfficeCategory') || !Configuration::updateValue('BLOCK_CATEG_MAX_DEPTH', 4) || !Configuration::updateValue('BLOCK_CATEG_DHTML', 1) || !Configuration::updateValue('BLOCK_CATEG_ROOT_CATEGORY', 1)) {
         return false;
     }
     // Hook the module either on the left or right column
     $theme = new Theme(Context::getContext()->shop->id_theme);
     if ((!$theme->default_left_column || !$this->registerHook('leftColumn')) && (!$theme->default_right_column || !$this->registerHook('rightColumn'))) {
         // If there are no colums implemented by the template, throw an error and uninstall the module
         $this->_errors[] = $this->l('This module need to be hooked in a column and your theme does not implement one');
         parent::uninstall();
         return false;
     }
     return true;
 }
 /**
  * @return boolean
  */
 public function install()
 {
     if (Shop::isFeatureActive()) {
         Shop::setContext(Shop::CONTEXT_ALL);
     }
     // Install invisible tab
     $tab = new Tab();
     $tab->name[$this->context->language->id] = $this->l('SecurionPay');
     $tab->class_name = 'AdminSecurionPay';
     $tab->id_parent = -1;
     // No parent tab
     $tab->module = $this->name;
     $tab->add();
     //Init
     Configuration::updateValue('SECURIONPAY_CONF', '');
     if (!parent::install()) {
         return false;
     }
     if (!Configuration::updateValue(self::MODE, self::MODE_TEST)) {
         return false;
     }
     if (!$this->registerHook('payment') || !$this->registerHook('displayAdminOrder')) {
         return false;
     }
     return true;
 }
Пример #4
0
 public function install()
 {
     // Install SQL
     include dirname(__FILE__) . '/sql/install.php';
     foreach ($sql as $s) {
         if (!Db::getInstance()->execute($s)) {
             return false;
         }
     }
     // Install Tabs
     if (!(int) Tab::getIdFromClassName('AdminPosMenu')) {
         $parent_tab = new Tab();
         // Need a foreach for the language
         $parent_tab->name[$this->context->language->id] = $this->l('PosExtentions');
         $parent_tab->class_name = 'AdminPosMenu';
         $parent_tab->id_parent = 0;
         // Home tab
         $parent_tab->module = $this->name;
         $parent_tab->add();
     }
     $tab = new Tab();
     // Need a foreach for the language
     foreach (Language::getLanguages() as $language) {
         $tab->name[$language['id_lang']] = $this->l('Manage Static Footer');
     }
     $tab->class_name = 'AdminPosstaticfooter';
     $tab->id_parent = (int) Tab::getIdFromClassName('AdminPosMenu');
     $tab->module = $this->name;
     $tab->add();
     // Set some defaults
     return parent::install() && $this->registerHook('footer') && $this->_installHookCustomer() && $this->registerHook('blockFooter1') && $this->registerHook('blockFooter2') && $this->registerHook('blockFooter3') && $this->registerHook('displayBackOfficeHeader');
 }
Пример #5
0
 public function install()
 {
     Configuration::updateValue('PS_DASHGOALS_CURRENT_YEAR', date('Y'));
     for ($month = '01'; $month <= 12; $month = sprintf('%02d', $month + 1)) {
         $key = Tools::strtoupper('dashgoals_traffic_' . $month . '_' . date('Y'));
         if (!ConfigurationKPI::get($key)) {
             ConfigurationKPI::updateValue($key, 600);
         }
         $key = Tools::strtoupper('dashgoals_conversion_' . $month . '_' . date('Y'));
         if (!ConfigurationKPI::get($key)) {
             ConfigurationKPI::updateValue($key, 2);
         }
         $key = Tools::strtoupper('dashgoals_avg_cart_value_' . $month . '_' . date('Y'));
         if (!ConfigurationKPI::get($key)) {
             ConfigurationKPI::updateValue($key, 80);
         }
     }
     // Prepare tab
     $tab = new Tab();
     $tab->active = 1;
     $tab->class_name = 'AdminDashgoals';
     $tab->name = array();
     foreach (Language::getLanguages(true) as $lang) {
         $tab->name[$lang['id_lang']] = 'Dashgoals';
     }
     $tab->id_parent = -1;
     $tab->module = $this->name;
     return $tab->add() && parent::install() && $this->registerHook('dashboardZoneTwo') && $this->registerHook('dashboardData') && $this->registerHook('actionAdminControllerSetMedia');
 }
Пример #6
0
 /**
  * @see Module::install()
  */
 public function install()
 {
     // Prepare tab
     $tab = new Tab();
     $tab->active = 1;
     $tab->class_name = 'AdminLeoSliderLayer';
     $tab->name = array();
     foreach (Language::getLanguages(true) as $lang) {
         $tab->name[$lang['id_lang']] = 'LeoSliderLayer';
     }
     $tab->id_parent = -1;
     $tab->module = $this->name;
     /* Adds Module */
     if ($tab->add() && parent::install() && Configuration::updateValue('LEOSLIDERLAYER_GROUP_DE', '1')) {
         $res = true;
         $res &= $this->registerHook('header');
         $res &= $this->registerHook('actionShopDataDuplication');
         foreach ($this->_hookSupport as $value) {
             $res &= $this->registerHook($value);
         }
         /* Sets up configuration */
         /* Creates tables */
         $res &= $this->createTables();
         return (bool) $res;
     }
     return false;
 }
Пример #7
0
function upgrade_module_1_0_3($object)
{
    $sql = array();
    $sql[] = 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'simpleblog_tag` (
            `id_simpleblog_tag` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT,
            `id_lang` INT( 11 ) unsigned NOT NULL,
            `name` VARCHAR(60) NOT NULL,
            PRIMARY KEY (`id_simpleblog_tag`)
        ) ENGINE = ' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8';
    $sql[] = 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'simpleblog_post_tag` (
            `id_simpleblog_post` INT( 11 ) unsigned NOT NULL,
            `id_simpleblog_tag` INT( 11 ) unsigned NOT NULL,
            PRIMARY KEY (`id_simpleblog_tag`)
        ) ENGINE = ' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8';
    foreach ($sql as $s) {
        if (!Db::getInstance()->Execute($s)) {
            return false;
        }
    }
    $context = Context::getContext();
    $tab = new Tab();
    $tab->name[$context->language->id] = $object->l('Tags');
    $tab->class_name = 'AdminSimpleBlogTags';
    $tab->id_parent = Tab::getIdFromClassName('AdminSimpleBlog');
    $tab->module = $object->name;
    $tab->add();
    return true;
}
 public function install()
 {
     if (!parent::install() || !$this->registerHook('displayHeader') || !$this->registerHook('displayBackOfficeHeader') || !$this->installDB()) {
         return false;
     }
     if (!$this->backupAllModulesHook('hook_module', 'ovic_backup_hook_module')) {
         return false;
     }
     $result = true;
     foreach (self::$OptionHookAssign as $hookname) {
         if (!$this->registerHook($hookname)) {
             $result &= false;
             break;
         }
     }
     if (!$result || !$this->registerHook('actionModuleRegisterHookAfter') || !$this->installSampleData()) {
         return false;
     }
     //$defaultfont  = htmlentities("<link href='http://fonts.googleapis.com/css?family=Cuprum' rel='stylesheet' type='text/css'>");
     //        if (is_string($defaultfont) === true)
     //        	$defaultfont = urldecode(preg_replace('/((\%5C0+)|(\%00+))/i', '', urlencode($defaultfont)));
     //        $defaultfont = !is_string($defaultfont)? $defaultfont : stripslashes($defaultfont);
     //        Configuration::updateValue('OVIC_FONT_LINK', $defaultfont);
     //        Configuration::updateValue('OVIC_MAIN_COLOR','#fe983d');
     //        Configuration::updateValue('OVIC_BTN_COLOR','#333');
     //        Configuration::updateValue('OVIC_BTN_HOVER_COLOR','#000');
     //        Configuration::updateValue('OVIC_BTN_TEXT_COLOR','#fff');
     //        Configuration::updateValue('OVIC_BTN_TEXT_HOVER_COLOR','#fff');
     $langs = Language::getLanguages();
     $tab = new Tab();
     $tab->class_name = "AdminThemeConfig";
     foreach ($langs as $l) {
         $tab->name[$l['id_lang']] = $this->l('Ovic Theme config');
     }
     $tab->module = '';
     $tab->id_parent = 0;
     //Root tab
     $tab->save();
     $tab_id = $tab->id;
     $newtab = new Tab();
     $newtab->class_name = "AdminLayoutSetting";
     foreach ($langs as $l) {
         $newtab->name[$l['id_lang']] = $this->l('Layout Control');
     }
     $newtab->module = $this->name;
     $newtab->id_parent = $tab_id;
     $newtab->add();
     $newtab = new Tab();
     $newtab->class_name = "AdminLayoutBuilder";
     foreach ($langs as $l) {
         $newtab->name[$l['id_lang']] = $this->l('Layout Builder');
     }
     $newtab->module = $this->name;
     $newtab->id_parent = $tab_id;
     $newtab->add();
     return true;
 }
 private function adminInstall($idParentTab = "7")
 {
         $tab = new Tab();
         $tab->class_name = 'AdminNewsletter';
         $tab->id_parent = $idParentTab;
         $tab->module = 'newslettertabmodule';
         $tab->name[(int)(Configuration::get('PS_LANG_DEFAULT'))] = $this->l('Newsletters');
         return $tab->add();
 }            
Пример #10
0
 public function install()
 {
     if (!parent::install() || !$this->installDB()) {
         return false;
     }
     if (!$this->registerHook('displayHeader') || !$this->registerHook('displayBackOfficeHeader') || !$this->registerHook('displayProductListReviews')) {
         return false;
     }
     if (!$this->backupAllModulesHook('hook_module', 'ovic_backup_hook_module')) {
         return false;
     }
     $result = true;
     foreach (self::$OptionHookAssign as $hookname) {
         if (!$this->registerHook($hookname)) {
             $result &= false;
             break;
         }
     }
     if (!$result || !$this->registerHook('actionModuleRegisterHookAfter')) {
         return false;
     }
     if (!$this->installSampleData()) {
         return false;
     }
     $langs = Language::getLanguages();
     $tab = new Tab();
     $tab->class_name = "AdminThemeConfig";
     foreach ($langs as $l) {
         $tab->name[$l['id_lang']] = $this->l('Ovic Theme config');
     }
     $tab->module = '';
     $tab->id_parent = 0;
     //Root tab
     $tab->save();
     $tab_id = $tab->id;
     $newtab = new Tab();
     $newtab->class_name = "AdminLayoutSetting";
     foreach ($langs as $l) {
         $newtab->name[$l['id_lang']] = $this->l('Layout Control');
     }
     $newtab->module = $this->name;
     $newtab->id_parent = $tab_id;
     $newtab->add();
     $newtab = new Tab();
     $newtab->class_name = "AdminLayoutBuilder";
     foreach ($langs as $l) {
         $newtab->name[$l['id_lang']] = $this->l('Layout Builder');
     }
     $newtab->module = $this->name;
     $newtab->id_parent = $tab_id;
     $newtab->add();
     //Theme::getThemeInfo($this->context->shop->id_theme)
     return true;
 }
Пример #11
0
 public function installTab()
 {
     $tab = new Tab();
     $tab->active = 1;
     $tab->class_name = 'AdminAccountBank';
     foreach (Language::getLanguages(true) as $lang) {
         $tab->name[$lang['id_lang']] = 'Account Bank';
     }
     $tab->id_parent = (int) Tab::getIdFromClassName('AdminParentOrders');
     $tab->module = $this->name;
     return $tab->add();
 }
Пример #12
0
 public function installTab()
 {
     $tab = new Tab();
     $tab->active = 1;
     $tab->class_name = 'AdminOnboarding';
     $tab->name = array();
     foreach (Language::getLanguages(true) as $lang) {
         $tab->name[$lang['id_lang']] = 'Onboarding';
     }
     $tab->id_parent = 99999;
     $tab->module = $this->name;
     return $tab->add();
 }
 public function installTab()
 {
     $tab = new Tab();
     $tab->active = 1;
     $tab->class_name = 'AdminGetresponse';
     $tab->name = array();
     foreach (Language::getLanguages(true) as $lang) {
         $tab->name[$lang['id_lang']] = 'GetResponse';
     }
     $tab->id_parent = (int) Tab::getIdFromClassName('AdminAdmin');
     $tab->module = $this->name;
     return $tab->add();
 }
 public function install()
 {
     // Install Tabs
     $parent_tab = new Tab();
     // Need a foreach for the language
     $parent_tab->name[(int) Configuration::get('PS_LANG_DEFAULT')] = $this->l('Newsletter2Go');
     $parent_tab->class_name = 'Newsletter2GoTab';
     $parent_tab->id_parent = 0;
     // Home tab
     $parent_tab->module = $this->name;
     $parent_tab->add();
     return parent::install() && $this->registerUrls() && $this->registerHook('backOfficeHeader');
 }
Пример #15
0
 public function installTab()
 {
     $tab = new Tab();
     $tab->active = 1;
     $tab->class_name = "AdminLinkWidget";
     $tab->name = array();
     foreach (Language::getLanguages(true) as $lang) {
         $tab->name[$lang['id_lang']] = "Link Widget";
     }
     $tab->id_parent = (int) Tab::getIdFromClassName('AdminParentThemes');
     $tab->module = $this->name;
     return $tab->add();
 }
Пример #16
0
 public function installAdminTab($class_name, $parent = null, $active = true)
 {
     $tab = new Tab();
     $tab->class_name = $class_name;
     $tab->active = $active;
     $tab->name = array();
     foreach (Language::getLanguages(true) as $lang) {
         $tab->name[$lang['id_lang']] = $this->module->displayName;
     }
     $tab->id_parent = (int) Tab::getIdFromClassName($parent == null ? 'AdminParentModules' : $parent);
     $tab->module = $this->module->name;
     return $tab->add();
 }
 public function installTab($parent, $class_name, $name)
 {
     //create new admin tab
     $tab = new Tab();
     $tab->id_parent = (int) Tab::getIdFromClassName($parent);
     $tab->name = [];
     foreach (Language::getLanguages(true) as $lang) {
         $tab->name[$lang['id_lang']] = $name;
     }
     $tab->class_name = $class_name;
     $tab->module = $this->name;
     $tab->active = 1;
     return $tab->add();
 }
Пример #18
0
function upgrade_module_1_0_5($object)
{
    $object->registerHook('displayLeftColumn');
    $object->registerHook('displayRightColumn');
    $tab = new Tab();
    $tab->name[Context::getContext()->language->id] = $object->l('Settings');
    $tab->class_name = 'AdminSimpleBlogSettings';
    $tab->id_parent = Tab::getIdFromClassName('AdminSimpleBlog');
    $tab->module = $object->name;
    $tab->add();
    Configuration::updateValue('PH_BLOG_POSTS_PER_PAGE', '10');
    Configuration::updateValue('PH_BLOG_FB_COMMENTS', '1');
    return true;
}
Пример #19
0
 public function install()
 {
     //create folder blocklogo
     $path = _PS_IMG_DIR_ . 'blocklogo';
     if (!file_exists($path)) {
         mkdir($path, 0777, true);
     }
     // Install SQL
     include dirname(__FILE__) . '/sql/install.php';
     foreach ($sql as $s) {
         if (!Db::getInstance()->execute($s)) {
             return false;
         }
     }
     // Install Tabs
     if (!(int) Tab::getIdFromClassName('AdminPosMenu')) {
         $parent_tab = new Tab();
         // Need a foreach for the language
         $parent_tab->name[$this->context->language->id] = $this->l('PosExtentions');
         $parent_tab->class_name = 'AdminPosMenu';
         $parent_tab->id_parent = 0;
         // Home tab
         $parent_tab->module = $this->name;
         $parent_tab->add();
     }
     $tab = new Tab();
     // Need a foreach for the language
     //$tab->name[$this->context->language->id] = $this->l('Manage Logo');
     foreach (Language::getLanguages() as $language) {
         $tab->name[$language['id_lang']] = $this->l('Manage Logo');
     }
     $tab->class_name = 'AdminPosLogo';
     $tab->id_parent = (int) Tab::getIdFromClassName('AdminPosMenu');
     $tab->module = $this->name;
     $tab->add();
     Configuration::updateValue($this->name . '_auto', 0);
     Configuration::updateValue($this->name . '_speed_slide', '1000');
     Configuration::updateValue($this->name . '_a_speed', '600');
     Configuration::updateValue($this->name . '_qty_products', 12);
     Configuration::updateValue($this->name . '_qty_items', 6);
     Configuration::updateValue($this->name . '_width_item', 170);
     Configuration::updateValue($this->name . '_show_nextback', 1);
     Configuration::updateValue($this->name . '_show_control', 0);
     Configuration::updateValue($this->name . '_min_item', 5);
     Configuration::updateValue($this->name . '_max_item', 7);
     Configuration::updateValue($this->name . '_mode_dir', 'vertical');
     // Set some defaults
     return parent::install() && $this->registerHook('top') && $this->registerHook('leftColumn') && $this->registerHook('rightColumn') && $this->_installHookCustomer() && $this->registerHook('brandSlider') && $this->registerHook('displayFooter') && $this->registerHook('displayHeader');
 }
 public function createAjaxController()
 {
     $tab = new Tab();
     $tab->active = 1;
     $languages = Language::getLanguages(false);
     if (is_array($languages)) {
         foreach ($languages as $language) {
             $tab->name[$language['id_lang']] = 'themeconfigurator';
         }
     }
     $tab->class_name = 'AdminThemeConfigurator';
     $tab->module = $this->name;
     $tab->id_parent = -1;
     return (bool) $tab->add();
 }
 public function install()
 {
     // Install SQL
     include dirname(__FILE__) . '/sql/install.php';
     foreach ($sql as $s) {
         if (!Db::getInstance()->execute($s)) {
             return false;
         }
     }
     // Install Tabs
     $parent_tab = new Tab();
     //$parent_tab->name = 'Op\'art Slideshow';
     $parent_tab->name = array();
     foreach (Language::getLanguages() as $language) {
         $parent_tab->name[$language['id_lang']] = 'Op\'art Slideshow';
     }
     $parent_tab->class_name = 'AdminMainOpart';
     $parent_tab->id_parent = 0;
     $parent_tab->module = $this->name;
     $parent_tab->add();
     $tab1 = new Tab();
     //$tab1->name = 'Slideshow';
     $tab1->name = array();
     foreach (Language::getLanguages() as $language) {
         $tab1->name[$language['id_lang']] = 'Slideshow';
     }
     $tab1->class_name = 'AdminSlideshow';
     $tab1->id_parent = $parent_tab->id;
     $tab1->module = $this->name;
     $tab1->add();
     $tab2 = new Tab();
     //$tab2->name = 'Images';
     $tab2->name = array();
     foreach (Language::getLanguages() as $language) {
         $tab2->name[$language['id_lang']] = 'Images';
     }
     $tab2->class_name = 'AdminSlideshowImage';
     $tab2->id_parent = $parent_tab->id;
     $tab2->module = $this->name;
     $tab2->add();
     //Init
     Configuration::updateValue('OPART_SLIDESHOW_CONF', '');
     // Install Module
     if (parent::install() == false or !$this->registerHook('displayTop') or !$this->registerHook('displayLeftColumn') or !$this->registerHook('displayRightColumn') or !$this->registerHook('displayHome') or !$this->registerHook('displayOpartSlideshowHook') or !$this->registerHook('displayHeader')) {
         return false;
     }
     return true;
 }
Пример #22
0
 /**
  * @see Module::install()
  */
 public function install()
 {
     // Install Tabs
     $tab = new Tab();
     // Need a foreach for the language
     $tab->name[$this->context->language->id] = $this->l('Glossary');
     $tab->class_name = 'AdminGlossary';
     $tab->id_parent = 0;
     // Home tab
     $tab->module = $this->name;
     $tab->add();
     if (!parent::install() || !$this->createTables() || !Configuration::updateValue('LXK_PAGE_TITLE', 'Glossary')) {
         return false;
     }
     return true;
 }
Пример #23
0
function moduleControllerRegistration()
{
    $tab = new Tab(null, Configuration::get('PS_LANG_DEAFULT'), Configuration::get('PS_SHOP_DEAFULT'));
    $tab->class_name = 'Revolutionslider_ajax';
    $tab->id_parent = 0;
    $tab->module = 'revsliderprestashop';
    $tab->name = "Revolutionslider Ajax Controller";
    $tab->position = 10;
    $tab->active = 0;
    $tab->add();
    if (!$tab->id) {
        return FALSE;
    }
    Configuration::updateValue('REVOLUTION_CONTROLLER_TABS', json_encode(array($tab->id)));
    return true;
}
Пример #24
0
 public function install()
 {
     // Prepare tab
     $tab = new Tab();
     $tab->active = 1;
     $tab->class_name = 'AdminBlockCategories';
     $tab->name = array();
     foreach (Language::getLanguages(true) as $lang) {
         $tab->name[$lang['id_lang']] = 'BlockCategories';
     }
     $tab->id_parent = -1;
     $tab->module = $this->name;
     if (!$tab->add() || !parent::install() || !$this->registerHook('footer') || !$this->registerHook('header') || !$this->registerHook('leftColumn') || !$this->registerHook('v') || !$this->registerHook('categoryAddition') || !$this->registerHook('categoryUpdate') || !$this->registerHook('categoryDeletion') || !$this->registerHook('actionAdminMetaControllerUpdate_optionsBefore') || !$this->registerHook('actionAdminLanguagesControllerStatusBefore') || !$this->registerHook('displayBackOfficeCategory') || !Configuration::updateValue('BLOCK_CATEG_MAX_DEPTH', 4) || !Configuration::updateValue('BLOCK_CATEG_DHTML', 1) || !Configuration::updateValue('BLOCK_CATEG_ROOT_CATEGORY', 1)) {
         return false;
     }
     return true;
 }
Пример #25
0
function upgrade_module_2_9_1($object)
{
    $id_tab = (int) Tab::getIdFromClassName('AdminBlockCategories');
    if (!$id_tab) {
        $tab = new Tab();
        $tab->active = 1;
        $tab->class_name = 'AdminBlockCategories';
        $tab->name = array();
        foreach (Language::getLanguages(true) as $lang) {
            $tab->name[$lang['id_lang']] = 'BlockCategories';
        }
        $tab->id_parent = -1;
        $tab->module = $object->name;
        return $tab->add();
    }
    return true;
}
 function install()
 {
     $tab = new Tab();
     $tab->id_parent = 1;
     $tab->name = array(Language::getIdByIso('fr') => 'Carrousel d\'images', Language::getIdByIso('en') => 'Images carrousel');
     $tab->class_name = 'AdminGallerySlider';
     $tab->module = 'quadragalleryslider';
     $tab->add();
     if (!parent::install()) {
         return false;
     }
     Configuration::updateValue('PS_QUADRA_SLIDER_HEIGHT', 200);
     Configuration::updateValue('PS_QUADRA_SLIDER_WIDTH', 500);
     Configuration::updateValue('PS_QUADRA_V_DISPLAY', 0);
     //creation de la table
     $this->createTable();
     return $this->registerHook('home');
 }
Пример #27
0
 public function install()
 {
     // Database Table
     include dirname(__FILE__) . '/sql/install.php';
     // Token for "wget" style crons
     Configuration::updateGlobalValue('AUTOZIP_TOKEN_NAME', Tools::passwdGen(10));
     Configuration::updateGlobalValue('AUTOZIP_TOKEN_KEY', Tools::passwdGen(10));
     // Module Tab
     $tab = new Tab();
     $tab->active = 1;
     $tab->class_name = 'AdminAutozip';
     $tab->name = array();
     foreach (Language::getLanguages(true) as $lang) {
         $tab->name[$lang['id_lang']] = 'AutoZip';
     }
     $tab->module = $this->name;
     $tab->id_parent = (int) Tab::getIdFromClassName('AdminCatalog');
     return parent::install() && $tab->add();
 }
Пример #28
0
 public function installSubTab()
 {
     $tab = new Tab();
     $tab1 = new Tab();
     $tab->active = 1;
     $tab1->active = 1;
     //nombre del controlador para el validador
     $tab->class_name = 'ValidatorPSMGen';
     $tab1->class_name = 'AdminPSMGen';
     $tab->name = array();
     $tab1->name = array();
     foreach (Language::getLanguages(true) as $lang) {
         $tab->name[$lang['id_lang']] = PSMGen::l('ValidatorPSMGen', (int) $lang['id_lang']);
         $tab1->name[$lang['id_lang']] = PSMGen::l('PSMGen', (int) $lang['id_lang']);
     }
     $tab->id_parent = (int) Tab::getIdFromClassName('AdminPSMGen');
     $tab1->id_parent = (int) Tab::getIdFromClassName('AdminPSMGen');
     $tab->module = $this->name;
     $tab1->module = $this->name;
     return $tab1->add() && $tab->add();
 }
 /**
  * Don't forget to create update methods if needed:
  * http://doc.prestashop.com/display/PS16/Enabling+the+Auto-Update
  */
 public function install()
 {
     Configuration::updateValue('BANDEAUPROMO_LIVE_MODE', false);
     include dirname(__FILE__) . '/sql/install.php';
     $status = parent::install() && $this->registerHook('header') && $this->registerHook('displayFooter') && $this->registerHook('displayBanner') && $this->registerHook('displayTop');
     if ($status) {
         $tab = new Tab();
         $tab->active = 1;
         $tab->class_name = 'AdminBandeauxPromo';
         $tab->name = array();
         foreach (Language::getLanguages(true) as $lang) {
             $tab->name[$lang['id_lang']] = 'bandeaux promotionnels';
         }
         // sous l'onglet catalogue
         $tab->id_parent = (int) Tab::getIdFromClassName('AdminCatalog');
         $tab->position = 99;
         $tab->module = $this->name;
         $status &= $tab->add();
     }
     return $status;
 }
Пример #30
0
 public function install()
 {
     //create folder blocklogo
     $path = _PS_MODULE_DIR_ . 'possequence/images';
     if (!file_exists($path)) {
         mkdir($path, 0777, true);
     }
     // Install SQL
     include dirname(__FILE__) . '/sql/install.php';
     foreach ($sql as $s) {
         if (!Db::getInstance()->execute($s)) {
             return false;
         }
     }
     // Install Tabs
     if (!(int) Tab::getIdFromClassName('AdminPosMenu')) {
         $parent_tab = new Tab();
         // Need a foreach for the language
         $parent_tab->name[$this->context->language->id] = $this->l('PosExtentions');
         $parent_tab->class_name = 'AdminPosMenu';
         $parent_tab->id_parent = 0;
         // Home tab
         $parent_tab->module = $this->name;
         $parent_tab->add();
     }
     $tab = new Tab();
     // Need a foreach for the language
     foreach (Language::getLanguages() as $language) {
         $tab->name[$language['id_lang']] = $this->l('Manage Banner Sequence');
     }
     $tab->class_name = 'AdminPossequence';
     $tab->id_parent = (int) Tab::getIdFromClassName('AdminPosMenu');
     $tab->module = $this->name;
     $tab->add();
     if (!Configuration::updateValue($this->name . '_pause_time', 3000) or !Configuration::updateValue($this->name . '_animation_speed', 3000) or !Configuration::updateValue($this->name . '_show_arrow', 1) or !Configuration::updateValue($this->name . '_show_navigation', 0) or !Configuration::updateValue($this->name . '_auto_slide', 1) or !Configuration::updateValue($this->name . '_hover', 0)) {
         return false;
     }
     // Set some defaults
     return parent::install() && $this->registerHook('actionObjectSlideshowAddAfter') && $this->registerHook('top') && $this->registerHook('leftColumn') && $this->registerHook('bannerSequence') && $this->registerHook('displayHeader');
 }