Example #1
0
function upgrade_module_1_2_2_5($object)
{
    Configuration::updateGlobalValue('PH_BLOG_COMMENT_STUFF_HIGHLIGHT', 1);
    Configuration::updateGlobalValue('PH_BLOG_COMMENT_ALLOW', 0);
    Configuration::updateGlobalValue('PH_BLOG_COMMENT_NOTIFY_EMAIL', Configuration::get('PS_SHOP_EMAIL'));
    return true;
}
 public function install($keep = true)
 {
     if ($keep) {
         if (!file_exists(dirname(__FILE__) . '/' . self::INSTALL_SQL_FILE)) {
             return false;
         } else {
             if (!($sql = file_get_contents(dirname(__FILE__) . '/' . self::INSTALL_SQL_FILE))) {
                 return false;
             }
         }
         $sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql);
         $sql = preg_split("/;\\s*[\r\n]+/", trim($sql));
         foreach ($sql as $query) {
             if (!DB::getInstance()->execute(trim($query))) {
                 return false;
             }
         }
     }
     if (!parent::install() || !$this->registerHook('displayHeader') || !$this->registerHook('displayGroupFashions') || !$this->registerHook('actionProductAdd') || !$this->registerHook('actionProductAttributeDelete') || !$this->registerHook('actionProductAttributeUpdate') || !$this->registerHook('actionProductDelete') || !$this->registerHook('actionProductSave') || !$this->registerHook('actionProductUpdate') || !$this->registerHook('actionCartSave') || !$this->registerHook('actionCategoryAdd') || !$this->registerHook('actionCategoryDelete') || !$this->registerHook('displayGroupFoods') || !$this->registerHook('displayGroupSports')) {
         return false;
     }
     if (!Configuration::updateGlobalValue('MOD_GROUP_CATEGORY', '1')) {
         return false;
     }
     //$this->cache->cleanup();
     $this->clearCache();
     $this->moduleUpdatePosition();
     return true;
 }
Example #3
0
function upgrade_module_1_2_2_6($object)
{
    Configuration::updateGlobalValue('PH_BLOG_FACEBOOK_MODERATOR', '');
    Configuration::updateGlobalValue('PH_BLOG_FACEBOOK_APP_ID', '');
    Configuration::updateGlobalValue('PH_BLOG_FACEBOOK_COLOR_SCHEME', 'light');
    return true;
}
Example #4
0
 public function install()
 {
     Configuration::updateGlobalValue('smartpostperpage', '5');
     Configuration::updateGlobalValue('smartshowauthorstyle', '1');
     Configuration::updateGlobalValue('smartmainblogurl', 'smartblog');
     Configuration::updateGlobalValue('smartusehtml', '1');
     Configuration::updateGlobalValue('smartshowauthorstyle', '1');
     Configuration::updateGlobalValue('smartenablecomment', '1');
     Configuration::updateGlobalValue('smartcaptchaoption', '1');
     Configuration::updateGlobalValue('smartshowviewed', '1');
     Configuration::updateGlobalValue('smartshownoimg', '1');
     Configuration::updateGlobalValue('smartshowcolumn', '3');
     Configuration::updateGlobalValue('smartacceptcomment', '1');
     Configuration::updateGlobalValue('smartcustomcss', '');
     Configuration::updateGlobalValue('smartdisablecatimg', '1');
     Configuration::updateGlobalValue('smartblogmetatitle', 'Smart Bolg Title');
     Configuration::updateGlobalValue('smartblogmetakeyword', 'smart,blog,smartblog,prestashop blog,prestashop,blog');
     Configuration::updateGlobalValue('smartblogmetadescrip', 'Prestashop powerfull blog site developing module. It has hundrade of extra plugins. This module developed by SmartDataSoft.com');
     $this->addquickaccess();
     $langs = Language::getLanguages();
     if (!parent::install() || !$this->registerHook('displayHeader') || !$this->SmartHookInsert() || !$this->registerHook('moduleRoutes') || !$this->registerHook('displayBackOfficeHeader')) {
         return false;
     }
     $sql = array();
     require_once dirname(__FILE__) . '/sql/install.php';
     foreach ($sql as $sq) {
         if (!Db::getInstance()->Execute($sq)) {
             return false;
         }
     }
     $this->CreateSmartBlogTabs();
     $this->SampleDataInstall();
     return true;
 }
Example #5
0
 public function uninstall()
 {
     if (!parent::uninstall() || !$this->uninstallTab() || !$this->uninstallDb() || !Configuration::updateGlobalValue('GF_CURRENT_LEVEL', 1) || !Configuration::updateGlobalValue('GF_NOTIFICATION', 0) || !Configuration::updateGlobalValue('GF_INSTALL_CALC', 0) || !Configuration::updateGlobalValue('GF_CURRENT_LEVEL_PERCENT', 0)) {
         return false;
     }
     return true;
 }
Example #6
0
 public function install($keep = true)
 {
     if (!parent::install()) {
         return false;
     }
     if (!Configuration::updateGlobalValue('MOD_VERTICAL_MEGA_MENUS', '1')) {
         return false;
     }
     if (!$this->registerHook('displayHeader') || !$this->registerHook('displayVerticalMenu')) {
         return false;
     }
     if ($keep) {
         if (!file_exists(dirname(__FILE__) . '/' . self::INSTALL_SQL_FILE)) {
             return false;
         } else {
             if (!($sql = file_get_contents(dirname(__FILE__) . '/' . self::INSTALL_SQL_FILE))) {
                 return false;
             }
         }
         $sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql);
         $sql = preg_split("/;\\s*[\r\n]+/", trim($sql));
         foreach ($sql as $query) {
             if (!DB::getInstance()->execute(trim($query))) {
                 return false;
             }
         }
     }
     $this->moduleUpdatePosition();
     return true;
 }
Example #7
0
 public static function updateGlobalValue($key, $values, $html = false)
 {
     ConfigurationKPI::setKpiDefinition();
     $r = parent::updateGlobalValue($key, $values, $html);
     ConfigurationKPI::unsetKpiDefinition();
     return $r;
 }
Example #8
0
 public function install($keep = true)
 {
     if ($keep) {
         if (!file_exists(dirname(__FILE__) . '/' . self::INSTALL_SQL_FILE)) {
             return false;
         } else {
             if (!($sql = file_get_contents(dirname(__FILE__) . '/' . self::INSTALL_SQL_FILE))) {
                 return false;
             }
         }
         $sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql);
         $sql = preg_split("/;\\s*[\r\n]+/", trim($sql));
         foreach ($sql as $query) {
             if (!Db::getInstance()->execute(trim($query))) {
                 return false;
             }
         }
     }
     if (!parent::install() || !$this->registerHook('displayHomeTopColumn') || !$this->registerHook('displayHome') || !$this->registerHook('displayLeftColumn') || !$this->registerHook('displayRightColumn') || !$this->registerHook('displayHeader') || !$this->registerHook('displayHomeBottomColumn')) {
         return false;
     }
     if (!Configuration::updateGlobalValue('FLEX_BANNER', '1')) {
         return false;
     }
     $this->importSameData();
     return true;
 }
 public function install()
 {
     if (!parent::install() || !Configuration::updateGlobalValue('MOD_BLOCKTOPMENU_ITEMS', 'CAT1,CMS1,CMS2,PRD1') || !Configuration::updateGlobalValue('MOD_BLOCKTOPMENU_HOME', '1') || !$this->registerHook('actionObjectCategoryUpdateAfter') || !$this->registerHook('actionObjectCategoryDeleteAfter') || !$this->registerHook('actionObjectCmsUpdateAfter') || !$this->registerHook('actionObjectCmsDeleteAfter') || !$this->registerHook('actionObjectSupplierUpdateAfter') || !$this->registerHook('actionObjectSupplierDeleteAfter') || !$this->registerHook('actionObjectManufacturerUpdateAfter') || !$this->registerHook('actionObjectManufacturerDeleteAfter') || !$this->registerHook('actionObjectProductUpdateAfter') || !$this->registerHook('actionObjectProductDeleteAfter') || !$this->registerHook('categoryUpdate') || !$this->registerHook('actionShopDataDuplication') || !$this->registerHook('displayNavigationBar') || !$this->installDB()) {
         return false;
     }
     return true;
 }
Example #10
0
 public function install()
 {
     if (!parent::install() || !$this->registerHook('displayTop') || !Configuration::updateGlobalValue('MOD_BLOCKTOPMENU_ITEMS', 'CAT3,CAT26') || !Configuration::updateGlobalValue('MOD_BLOCKTOPMENU_SEARCH', '1') || !$this->registerHook('actionObjectCategoryUpdateAfter') || !$this->registerHook('actionObjectCategoryDeleteAfter') || !$this->registerHook('actionObjectCategoryAddAfter') || !$this->registerHook('actionObjectCmsUpdateAfter') || !$this->registerHook('actionObjectCmsDeleteAfter') || !$this->registerHook('actionObjectCmsAddAfter') || !$this->registerHook('actionObjectSupplierUpdateAfter') || !$this->registerHook('actionObjectSupplierDeleteAfter') || !$this->registerHook('actionObjectSupplierAddAfter') || !$this->registerHook('actionObjectManufacturerUpdateAfter') || !$this->registerHook('actionObjectManufacturerDeleteAfter') || !$this->registerHook('actionObjectManufacturerAddAfter') || !$this->registerHook('actionObjectProductUpdateAfter') || !$this->registerHook('actionObjectProductDeleteAfter') || !$this->registerHook('actionObjectProductAddAfter') || !$this->registerHook('categoryUpdate') || !$this->registerHook('actionShopDataDuplication') || !$this->installDB()) {
         return false;
     }
     return true;
 }
Example #11
0
 public function install($keep = true)
 {
     if ($keep) {
         if (!file_exists(dirname(__FILE__) . '/' . self::INSTALL_SQL_FILE)) {
             return false;
         } else {
             if (!($sql = file_get_contents(dirname(__FILE__) . '/' . self::INSTALL_SQL_FILE))) {
                 return false;
             }
         }
         $sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql);
         $sql = preg_split("/;\\s*[\r\n]+/", trim($sql));
         foreach ($sql as $query) {
             if (!DB::getInstance()->execute(trim($query))) {
                 return false;
             }
         }
     }
     if (!parent::install() || !$this->registerHook('displayHeader') || !$this->registerHook('displayCustomBanner1') || !$this->registerHook('displayCustomBanner2') || !$this->registerHook('displayCustomBanner3') || !$this->registerHook('displayGroupFashions') || !$this->registerHook('displayGroupFoods') || !$this->registerHook('displayGroupSports')) {
         return false;
     }
     if (!Configuration::updateGlobalValue('MOD_CUSTOM_BANNER', '1')) {
         return false;
     }
     $this->clearCache();
     $this->moduleUpdatePosition();
     return true;
 }
 public function install()
 {
     if (!parent::install() || !$this->registerHook('leftColumn') || !$this->registerHook('displaySmartBlogLeft') || !$this->registerHook('actionsbdeletepost') || !$this->registerHook('actionsbnewpost') || !$this->registerHook('actionsbupdatepost') || !$this->registerHook('actionsbtogglepost')) {
         return false;
     }
     Configuration::updateGlobalValue('smartshowrecentpost', 5);
     return true;
 }
Example #13
0
 /**
  * Update configuration
  * @var string  Configuration key
  * @var mixed   Configuration value
  * @var boolean If is global configuration
  */
 public static function updateConfiguration($key, $value, $global = false)
 {
     if (version_compare(_PS_VERSION_, '1.5', '>=') && $global) {
         Configuration::updateGlobalValue($key, $value);
     } else {
         Configuration::updateValue($key, $value);
     }
 }
Example #14
0
function upgrade_module_1_3_1_9($object)
{
    Configuration::updateGlobalValue('PH_BLOG_LOAD_FONT_AWESOME', 1);
    Configuration::updateGlobalValue('PH_BLOG_LOAD_BXSLIDER', 1);
    Configuration::updateGlobalValue('PH_BLOG_LOAD_MASONRY', 1);
    Configuration::updateGlobalValue('PH_BLOG_LOAD_FITVIDS', 1);
    return true;
}
Example #15
0
function upgrade_module_1_4_0($object)
{
    if (Configuration::get('PH_BLOG_NATIVE_COMMENTS')) {
        Configuration::updateGlobalValue('PH_BLOG_COMMENTS_SYSTEM', 'native');
    } else {
        Configuration::updateGlobalValue('PH_BLOG_COMMENTS_SYSTEM', 'facebook');
    }
    return true;
}
Example #16
0
 public function delete()
 {
     $this->deleteZoneProducts();
     $this->deleteCategories();
     if (parent::delete()) {
         return $this->deleteImage() && Configuration::updateGlobalValue('PS_SCENE_FEATURE_ACTIVE', Scene::isCurrentlyUsed($this->def['table'], true));
     }
     return false;
 }
Example #17
0
function upgrade_module_1_3_2_8()
{
    Configuration::updateGlobalValue('PH_BLOG_COMMENT_ALLOW_GUEST', false);
    Configuration::updateGlobalValue('PH_BLOG_COMMENTS_RECAPTCHA', true);
    Configuration::updateGlobalValue('PH_BLOG_COMMENTS_RECAPTCHA_SITE_KEY', '');
    Configuration::updateGlobalValue('PH_BLOG_COMMENTS_RECAPTCHA_SECRET_KEY', '');
    Configuration::updateGlobalValue('PH_BLOG_COMMENTS_RECAPTCHA_THEME', 'light');
    return true;
}
 public function delete()
 {
     if (parent::delete()) {
         // Refresh cache of feature detachable
         Configuration::updateGlobalValue('PS_ALIAS_FEATURE_ACTIVE', Alias::isCurrentlyUsed($this->def['table'], true));
         return true;
     }
     return false;
 }
Example #19
0
 public function update($null_values = false)
 {
     if (parent::update($null_values)) {
         // Refresh cache of feature detachable because the row can be deactive
         Configuration::updateGlobalValue('PS_VIRTUAL_PROD_FEATURE_ACTIVE', ProductDownload::isCurrentlyUsed($this->def['table'], true));
         return true;
     }
     return false;
 }
Example #20
0
function upgrade_module_1_3_1_6($object)
{
    if (function_exists('date_default_timezone_get')) {
        $timezone = @date_default_timezone_get();
    } else {
        $timezone = 'Europe/Warsaw';
    }
    Configuration::updateGlobalValue('PH_BLOG_TIMEZONE', $timezone);
    return true;
}
 public function install()
 {
     $langs = Language::getLanguages();
     $id_lang = (int) Configuration::get('PS_LANG_DEFAULT');
     if (!parent::install() || !$this->registerHook('displayTopNews') || !$this->registerHook('displayPreFooter') || !$this->registerHook('displayHome') || !$this->registerHook('actionsbdeletepost') || !$this->registerHook('actionsbnewpost') || !$this->registerHook('actionsbupdatepost') || !$this->registerHook('actionsbtogglepost')) {
         return false;
     }
     Configuration::updateGlobalValue('smartshowhomepost', 4);
     return true;
 }
 public function install()
 {
     if (!parent::install() || !$this->registerHook('footer') || !$this->registerHook('payment') || !$this->registerHook('paymentReturn') || !$this->registerHook('displayAdminOrder') || !$this->registerHook('header') || !$this->registerHook('displayBackOfficeHeader') || !HipayLogger::createTables() || !$this->_installOrderState()) {
         return false;
     }
     Configuration::updateGlobalValue('HIPAY_PROCESSING_QUEUE', 0);
     Configuration::updateGlobalValue('HIPAY_LAST_PROCESS', time());
     HipayLogger::createTables();
     return true;
 }
Example #23
0
 public function install()
 {
     $langs = Language::getLanguages();
     $id_lang = (int) Configuration::get('PS_LANG_DEFAULT');
     if (!parent::install() || !$this->registerHook('leftColumn') || !$this->registerHook('actionsbdeletepost') || !$this->registerHook('actionsbnewpost') || !$this->registerHook('actionsbupdatepost') || !$this->registerHook('actionsbtogglepost') || !$this->registerHook('displaySmartBlogLeft')) {
         return false;
     }
     Configuration::updateGlobalValue('smartshowposttag', 5);
     return true;
 }
Example #24
0
 public static function isFeatureActive()
 {
     $isFeatureActive = parent::isFeatureActive();
     if (!Module::isInstalled('agilemultipleseller')) {
         return $isFeatureActive;
     }
     if ($isFeatureActive) {
         Configuration::updateGlobalValue('PS_MULTISHOP_FEATURE_ACTIVE', 0);
     }
     return false;
 }
/**
 * Upgrades the module to version 1.1.0.
 *
 * Creates 'nostotagging_customer_link' db table.
 * Registers hooks 'actionPaymentConfirmation', 'displayPaymentTop' and 'displayHome'.
 * Sets default value for "inject category and search page recommendations" to 1.
 * Removes unused "NOSTOTAGGING_SERVER_ADDRESS" config variable.
 *
 * @param NostoTagging $object
 * @return bool
 */
function upgrade_module_1_1_0($object)
{
    $create_table = 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'nostotagging_customer_link` (
						`id_customer` INT(10) UNSIGNED NOT NULL,
						`id_nosto_customer` VARCHAR(255) NOT NULL,
						`date_add` DATETIME NOT NULL,
						`date_upd` DATETIME NULL,
						PRIMARY KEY (`id_customer`, `id_nosto_customer`)
					) ENGINE ' . _MYSQL_ENGINE_;
    return Db::getInstance()->execute($create_table) && $object->registerHook('actionPaymentConfirmation') && $object->registerHook('displayPaymentTop') && $object->registerHook('displayHome') && Configuration::updateGlobalValue('NOSTOTAGGING_INJECT_SLOTS', 1) && Configuration::deleteByName('NOSTOTAGGING_SERVER_ADDRESS') && Configuration::deleteByName('NOSTOTAGGING_TOP_SELLERS_CMS_ID');
}
 public function install()
 {
     Configuration::updateGlobalValue('BLOCKADVERT_LINK', 'http://www.prestashop.com/');
     Configuration::updateGlobalValue('BLOCKADVERT_TITLE', 'PrestaShop');
     // Try to update with the extension of the image that exists in the module directory
     foreach (scandir(_PS_MODULE_DIR_ . $this->name) as $file) {
         if (in_array($file, array('advertising.jpg', 'advertising.gif', 'advertising.png'))) {
             Configuration::updateGlobalValue('BLOCKADVERT_IMG_EXT', substr($file, strrpos($file, '.') + 1));
         }
     }
     return parent::install() && $this->registerHook('leftColumn');
 }
 public function uninstall()
 {
     Configuration::deleteByName('POSVEGAMENU');
     Configuration::updateGlobalValue('MOD_BLOCKPOSVENU_ITEMS', 'CAT1');
     $this->uninstallDb();
     // Uninstall Module
     if (!parent::uninstall()) {
         return false;
     }
     // !$this->unregisterHook('actionObjectExampleDataAddAfter')
     return true;
 }
Example #28
0
 public function setGlobalDefaultConfig($key, $default)
 {
     ${"GLOBALS"}["kqpqsalickg"] = "key";
     ${${"GLOBALS"}["flwsbxyuiauz"]} = ${${"GLOBALS"}["hutikr"]};
     if (array_key_exists(${${"GLOBALS"}["kqpqsalickg"]}, $this->configs) && strlen($this->configs[${${"GLOBALS"}["cspotkidrqr"]}]) > 0) {
         ${"GLOBALS"}["qqoboxpeqaq"] = "key";
         ${${"GLOBALS"}["flwsbxyuiauz"]} = $this->configs[${${"GLOBALS"}["qqoboxpeqaq"]}];
     }
     ${"GLOBALS"}["yxpghsgyoyb"] = "value";
     ${"GLOBALS"}["txsztug"] = "key";
     return Configuration::updateGlobalValue(${${"GLOBALS"}["txsztug"]}, ${${"GLOBALS"}["yxpghsgyoyb"]});
 }
Example #29
0
function upgrade_module_2_0_1($object)
{
    upgrade_addquickaccess();
    Db::getInstance()->execute('ALTER TABLE `' . _DB_PREFIX_ . 'smart_blog_post` ADD is_featured int(11) DEFAULT NULL');
    $smartblog = new smartblog();
    $smartblog->registerHook('displayBackOfficeHeader');
    $smartblog->SmartHookInsert();
    Configuration::updateGlobalValue('smartshowviewed', '1');
    Configuration::updateGlobalValue('smartcaptchaoption', '1');
    Configuration::updateGlobalValue('smartdisablecatimg', '1');
    return true;
}
Example #30
0
 public function install($delete_params = true)
 {
     if (!parent::install() || !$this->registerHook('displayTop') || !$this->registerHook('actionObjectCategoryUpdateAfter') || !$this->registerHook('actionObjectCategoryDeleteAfter') || !$this->registerHook('actionObjectCategoryAddAfter') || !$this->registerHook('actionObjectCmsUpdateAfter') || !$this->registerHook('actionObjectCmsDeleteAfter') || !$this->registerHook('actionObjectCmsAddAfter') || !$this->registerHook('actionObjectSupplierUpdateAfter') || !$this->registerHook('actionObjectSupplierDeleteAfter') || !$this->registerHook('actionObjectSupplierAddAfter') || !$this->registerHook('actionObjectManufacturerUpdateAfter') || !$this->registerHook('actionObjectManufacturerDeleteAfter') || !$this->registerHook('actionObjectManufacturerAddAfter') || !$this->registerHook('actionObjectProductUpdateAfter') || !$this->registerHook('actionObjectProductDeleteAfter') || !$this->registerHook('actionObjectProductAddAfter') || !$this->registerHook('categoryUpdate') || !$this->registerHook('actionShopDataDuplication')) {
         return false;
     }
     $this->clearMenuCache();
     if ($delete_params) {
         if (!$this->installDb() || !Configuration::updateGlobalValue('MOD_blocktopmenu2_ITEMS', 'CAT3,CAT26') || !Configuration::updateGlobalValue('MOD_blocktopmenu2_SEARCH', '1')) {
             return false;
         }
     }
     return true;
 }