Example #1
1
    public function getContent()
    {
        // If we try to update the settings
        $output = '';
        if (isset($_POST['submitModule'])) {
            Configuration::updateValue('blocksocial_facebook', $_POST['facebook_url'] != '' ? $_POST['facebook_url'] : '');
            Configuration::updateValue('blocksocial_twitter', $_POST['twitter_url'] != '' ? $_POST['twitter_url'] : '');
            Configuration::updateValue('blocksocial_rss', $_POST['rss_url'] != '' ? $_POST['rss_url'] : '');
            $output = '<div class="conf confirm">' . $this->l('Configuration updated') . '</div>';
        }
        return '
		<h2>' . $this->displayName . '</h2>
		' . $output . '
		<form action="' . Tools::htmlentitiesutf8($_SERVER['REQUEST_URI']) . '" method="post">
			<fieldset class="width2">				
				<label for="facebook_url">' . $this->l('Facebook URL: ') . '</label>
				<input type="text" id="facebook_url" name="facebook_url" value="' . Tools::safeOutput(Configuration::get('blocksocial_facebook') != "" ? Configuration::get('blocksocial_facebook') : "") . '" />
				<div class="clear">&nbsp;</div>		
				<label for="twitter_url">' . $this->l('Twitter URL: ') . '</label>
				<input type="text" id="twitter_url" name="twitter_url" value="' . Tools::safeOutput(Configuration::get('blocksocial_twitter') != "" ? Configuration::get('blocksocial_twitter') : "") . '" />
				<div class="clear">&nbsp;</div>		
				<label for="rss_url">' . $this->l('RSS URL: ') . '</label>
				<input type="text" id="rss_url" name="rss_url" value="' . Tools::safeOutput(Configuration::get('blocksocial_rss') != "" ? Configuration::get('blocksocial_rss') : "") . '" />
				<div class="clear">&nbsp;</div>						
				<br /><center><input type="submit" name="submitModule" value="' . $this->l('Update settings') . '" class="button" /></center>
			</fieldset>
		</form>';
    }
 public function install()
 {
     if (parent::install() == false or $this->registerHook('header') == false or $this->registerHook('footer') == false or Configuration::updateValue('BLANK_FONT', 'Almelo') == false or Configuration::updateValue('BLANK_COLOUR', 'white') == false) {
         return false;
     }
     return true;
 }
Example #3
0
    public function getContent()
    {
        $html = '';
        // If we try to update the settings
        if (Tools::isSubmit('submitModule')) {
            Configuration::updateValue('blockcontact_telnumber', Tools::getValue('telnumber'));
            Configuration::updateValue('blockcontact_email', Tools::getValue('email'));
            $html .= '<div class="confirm">' . $this->l('Configuration updated') . '</div>';
        }
        $html .= '
		<h2>' . $this->displayName . '</h2>
		<form action="' . Tools::htmlentitiesutf8($_SERVER['REQUEST_URI']) . '" method="post">
			<fieldset>			
				<label for="telnumber">' . $this->l('Telephone number:') . '</label>
				<input type="text" id="telnumber" name="telnumber" value="' . (Configuration::get('blockcontact_telnumber') != '' ? Tools::safeOutput(Configuration::get('blockcontact_telnumber')) : '') . '" />
				<div class="clear">&nbsp;</div>
				<label for="email">' . $this->l('Email:') . '</label>
				<input type="text" id="email" name="email" value="' . (Configuration::get('blockcontact_email') != '' ? Tools::safeOutput(Configuration::get('blockcontact_email')) : '') . '" />
				<div class="clear">&nbsp;</div>
				<div class="margin-form">
					<input type="submit" name="submitModule" value="' . $this->l('Update settings') . '" class="button" /></center>
				</div>
			</fieldset>
		</form>';
        return $html;
    }
Example #4
0
 public function getContent()
 {
     $output = '<h2>' . $this->displayName . '</h2>';
     if (Tools::isSubmit('submitBlockRss')) {
         $urlfeed = strval(Tools::getValue('urlfeed'));
         $title = strval(Tools::getValue('title'));
         $nbr = intval(Tools::getValue('nbr'));
         if ($urlfeed and !Validate::isUrl($urlfeed)) {
             $errors[] = $this->l('Invalid feed URL');
         } elseif (!$title or empty($title) or !Validate::isGenericName($title)) {
             $errors[] = $this->l('Invalid title');
         } elseif (!$nbr or $nbr <= 0 or !Validate::isInt($nbr)) {
             $errors[] = $this->l('Invalid number of feeds');
         } else {
             Configuration::updateValue('RSS_FEED_URL', $urlfeed);
             Configuration::updateValue('RSS_FEED_TITLE', $title);
             Configuration::updateValue('RSS_FEED_NBR', $nbr);
         }
         if (isset($errors) and sizeof($errors)) {
             $output .= $this->displayError(implode('<br />', $errors));
         } else {
             $output .= $this->displayConfirmation($this->l('Settings updated'));
         }
     }
     return $output . $this->displayForm();
 }
Example #5
0
 public function getContent()
 {
     $output = '';
     $errors = array();
     if (Tools::isSubmit('submitHomeFeatured')) {
         $nbr = Tools::getValue('HOME_FEATURED_NBR');
         if (!Validate::isInt($nbr) || $nbr <= 0) {
             $errors[] = $this->l('The number of products is invalid. Please enter a positive number.');
         }
         $cat = Tools::getValue('HOME_FEATURED_CAT');
         if (!Validate::isInt($cat) || $cat <= 0) {
             $errors[] = $this->l('The category ID is invalid. Please choose an existing category ID.');
         }
         $rand = Tools::getValue('HOME_FEATURED_RANDOMIZE');
         if (!Validate::isBool($rand)) {
             $errors[] = $this->l('Invalid value for the "randomize" flag.');
         }
         if (isset($errors) && count($errors)) {
             $output = $this->displayError(implode('<br />', $errors));
         } else {
             Configuration::updateValue('HOME_FEATURED_NBR', (int) $nbr);
             Configuration::updateValue('HOME_FEATURED_CAT', (int) $cat);
             Configuration::updateValue('HOME_FEATURED_RANDOMIZE', (bool) $rand);
             Tools::clearCache(Context::getContext()->smarty, $this->getTemplatePath('homefeatured.tpl'));
             $output = $this->displayConfirmation($this->l('Your settings have been updated.'));
         }
     }
     return $output . $this->renderForm();
 }
Example #6
0
 public function getContent()
 {
     $this->_html = '<h2>CCAvenue MCPG</h2>';
     if (isset($_POST['submitccavenue'])) {
         if (empty($_POST['merchant_id'])) {
             $this->_postErrors[] = $this->l('CCAvenue Merchant id is required.');
         }
         if (empty($_POST['access_code'])) {
             $this->_postErrors[] = $this->l('CCAvenue Access Code is required.');
         }
         if (empty($_POST['encryption_key'])) {
             $this->_postErrors[] = $this->l('CCAvenue Encryption Key is required.');
         }
         if (!sizeof($this->_postErrors)) {
             Configuration::updateValue('CCAVENUE_MERCHANT_ID', strval($_POST['merchant_id']));
             Configuration::updateValue('CCAVENUE_ACCESS_CODE', strval($_POST['access_code']));
             Configuration::updateValue('CCAVENUE_ENCRYPTION_KEY', strval($_POST['encryption_key']));
             Configuration::updateValue('CCAVENUE_TITLE', strval($_POST['ccavenue_title']));
             $this->displayConf();
         } else {
             $this->displayErrors();
         }
     }
     $this->displayccavenue();
     $this->displayFormSettings();
     return $this->_html;
 }
Example #7
0
 public function install()
 {
     if (!parent::install()) {
         return false;
     }
     $carrier = new Carrier(null, $this->context->language->id);
     $carrier->name = 'My carrier';
     $carrier->active = 1;
     $carrier->isFree = false;
     $carrier->url = '';
     $carrier->shipping_handling = false;
     $carrier->shipping_method = 0;
     $carrier->max_width = 0;
     $carrier->max_height = 0;
     $carrier->max_depth = 0;
     $carrier->max_weight = 0;
     $carrier->grade = 0;
     $carrier->external_module_name = 'mycarrier';
     $carrier->is_module = true;
     $carrier->deleted = false;
     $carrier->delay = 'string';
     if (!$carrier->add()) {
         return false;
     }
     if (!Configuration::updateValue('MY_CARRIER_ID', $carrier->id)) {
         return false;
     }
     return true;
 }
 public function install()
 {
     if (!parent::install() || !$this->registerHook('top') || !$this->registerHook('possearch') || !$this->registerHook('header') || !Configuration::updateValue('CATE_ON', 1)) {
         return false;
     }
     return true;
 }
Example #9
0
 public function getContent()
 {
     $this->_html = '<h2>Paypal</h2>';
     if (isset($_POST['submitPaypal'])) {
         if (empty($_POST['business'])) {
             $this->_postErrors[] = $this->l('Paypal business e-mail address is required.');
         } elseif (!Validate::isEmail($_POST['business'])) {
             $this->_postErrors[] = $this->l('Paypal business must be an e-mail address.');
         }
         if (!isset($_POST['sandbox'])) {
             $_POST['sandbox'] = 1;
         }
         if (!sizeof($this->_postErrors)) {
             Configuration::updateValue('PAYPAL_BUSINESS', strval($_POST['business']));
             Configuration::updateValue('PAYPAL_SANDBOX', intval($_POST['sandbox']));
             Configuration::updateValue('PAYPAL_HEADER', strval($_POST['header']));
             $this->displayConf();
         } else {
             $this->displayErrors();
         }
     }
     $this->displayPayPal();
     $this->displayFormSettings();
     return $this->_html;
 }
Example #10
0
 /**
  * Prestashop config page
  */
 public function getContent()
 {
     global $smarty;
     $errors = array();
     if (Tools::isSubmit('submitMtgox')) {
         foreach ($this->getConfigFields() as $field) {
             $field_val = Tools::getValue(strtolower($field['config_name']));
             if (isset($field['empty']) and $field['empty'] == false) {
                 if ($field_val != '0' and empty($field_val)) {
                     $errors[] = $this->l($field['display_name'] . ' field cannot be empty');
                     continue;
                 }
             }
             if (isset($field['boolean']) and $field['boolean'] == true) {
                 if (!in_array($field_val, array('0', '1'))) {
                     $errors[] = $this->l($field['display_name'] . ' field must be a string containing 0 or 1');
                     continue;
                 }
             }
             Configuration::updateValue($field['config_name'], $field_val);
         }
         if (!$errors) {
             // Retro 1.4
             global $currentIndex;
             $curr_index = Tools::property_exists('AdminController', 'currentIndex') ? AdminController::$currentIndex : $currentIndex;
             Tools::redirectAdmin($curr_index . '&configure=mtgox&token=' . Tools::safeOutput(Tools::getValue('token')) . '&conf=4');
         }
     }
     $smarty->assign(array('displayName' => $this->displayName, 'requestUrl' => Tools::safeOutput($_SERVER['REQUEST_URI']), 'merchantId' => Tools::safeOutput(Tools::getValue('mtgox_merchant_id', Configuration::get('MTGOX_MERCHANT_ID'))), 'apiKey' => Tools::safeOutput(Tools::getValue('mtgox_api_key', Configuration::get('MTGOX_API_KEY'))), 'apiSecretKey' => Tools::safeOutput(Tools::getValue('mtgox_api_secret_key', Configuration::get('MTGOX_API_SECRET_KEY'))), 'paymentDescription' => Tools::safeOutput(Tools::getValue('mtgox_payment_description', Configuration::get('MTGOX_PAYMENT_DESCRIPTION'))), 'autosell' => Tools::safeOutput(Tools::getValue('mtgox_autosell', Configuration::get('MTGOX_AUTOSELL'))), 'email' => Tools::safeOutput(Tools::getValue('mtgox_email_on_success', Configuration::get('MTGOX_EMAIL_ON_SUCCESS'))), 'instantonly' => Tools::safeOutput(Tools::getValue('mtgox_instant_only', Configuration::get('MTGOX_INSTANT_ONLY'))), 'submit' => Tools::isSubmit('submitMtgox'), 'errors' => $errors));
     return $this->display(__FILE__, 'views/templates/back/configure.tpl');
 }
Example #11
0
 public function install()
 {
     /* Before creating a new tab "AdminSelfUpgrade" we need to remove any existing "AdminUpgrade" tab (present in v1.4.4.0 and v1.4.4.1) */
     if ($id_tab = Tab::getIdFromClassName('AdminUpgrade')) {
         $tab = new Tab((int) $id_tab);
         if (!$tab->delete()) {
             $this->_errors[] = sprintf($this->l('Unable to delete outdated AdminUpgrade tab %d'), (int) $id_tab);
         }
     }
     /* If the "AdminSelfUpgrade" tab does not exist yet, create it */
     if (!($id_tab = Tab::getIdFromClassName('AdminSelfUpgrade'))) {
         $tab = new Tab();
         $tab->class_name = 'AdminSelfUpgrade';
         $tab->module = 'autoupgrade';
         $tab->id_parent = (int) Tab::getIdFromClassName('AdminTools');
         foreach (Language::getLanguages(false) as $lang) {
             $tab->name[(int) $lang['id_lang']] = '1-Click Upgrade';
         }
         if (!$tab->save()) {
             return $this->_abortInstall($this->l('Unable to create the "AdminSelfUpgrade" tab'));
         }
         if (!@copy(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'logo.gif', _PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'img' . DIRECTORY_SEPARATOR . 't' . DIRECTORY_SEPARATOR . 'AdminSelfUpgrade.gif')) {
             return $this->_abortInstall(sprintf($this->l('Unable to copy logo.gif in %s'), _PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'img' . DIRECTORY_SEPARATOR . 't' . DIRECTORY_SEPARATOR));
         }
     } else {
         $tab = new Tab((int) $id_tab);
     }
     /* Update the "AdminSelfUpgrade" tab id in database or exit */
     if (Validate::isLoadedObject($tab)) {
         Configuration::updateValue('PS_AUTOUPDATE_MODULE_IDTAB', (int) $tab->id);
     } else {
         return $this->_abortInstall($this->l('Unable to load the "AdminSelfUpgrade" tab'));
     }
     /* Check that the 1-click upgrade working directory is existing or create it */
     $autoupgrade_dir = _PS_ADMIN_DIR_ . DIRECTORY_SEPARATOR . 'autoupgrade';
     if (!file_exists($autoupgrade_dir) && !@mkdir($autoupgrade_dir, 0755)) {
         return $this->_abortInstall(sprintf($this->l('Unable to create the directory "%s"'), $autoupgrade_dir));
     }
     /* Make sure that the 1-click upgrade working directory is writeable */
     if (!is_writable($autoupgrade_dir)) {
         return $this->_abortInstall(sprintf($this->l('Unable to write in the directory "%s"'), $autoupgrade_dir));
     }
     /* If a previous version of ajax-upgradetab.php exists, delete it */
     if (file_exists($autoupgrade_dir . DIRECTORY_SEPARATOR . 'ajax-upgradetab.php')) {
         @unlink($autoupgrade_dir . DIRECTORY_SEPARATOR . 'ajax-upgradetab.php');
     }
     /* Then, try to copy the newest version from the module's directory */
     if (!@copy(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'ajax-upgradetab.php', $autoupgrade_dir . DIRECTORY_SEPARATOR . 'ajax-upgradetab.php')) {
         return $this->_abortInstall(sprintf($this->l('Unable to copy ajax-upgradetab.php in %s'), $autoupgrade_dir));
     }
     /* Make sure that the XML config directory exists */
     if (!file_exists(_PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'xml') && !@mkdir(_PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'xml', 0755)) {
         return $this->_abortInstall(sprintf($this->l('Unable to create the directory "%s"'), _PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'xml'));
     }
     /* Create a dummy index.php file in the XML config directory to avoid directory listing */
     if (!file_exists(_PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'xml' . DIRECTORY_SEPARATOR . 'index.php') && (file_exists(_PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'index.php') && !@copy(_PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'index.php', _PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'xml' . DIRECTORY_SEPARATOR . 'index.php'))) {
         return $this->_abortInstall(sprintf($this->l('Unable to create the directory "%s"'), _PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'xml'));
     }
     return parent::install();
 }
Example #12
0
 public function getContent()
 {
     $output = '';
     $errors = array();
     if (Tools::isSubmit('submitBlockTags')) {
         $tagsNbr = Tools::getValue('BLOCKTAGS_NBR');
         if (!strlen($tagsNbr)) {
             $errors[] = $this->l('Please complete the "Displayed tags" field.');
         } elseif (!Validate::isInt($tagsNbr) || (int) $tagsNbr <= 0) {
             $errors[] = $this->l('Invalid number.');
         }
         $tagsLevels = Tools::getValue('BLOCKTAGS_MAX_LEVEL');
         if (!strlen($tagsLevels)) {
             $errors[] = $this->l('Please complete the "Tag levels" field.');
         } elseif (!Validate::isInt($tagsLevels) || (int) $tagsLevels <= 0) {
             $errors[] = $this->l('Invalid value for "Tag levels". Choose a positive integer number.');
         }
         $randomize = Tools::getValue('BLOCKTAGS_RANDOMIZE');
         if (!strlen($randomize)) {
             $errors[] = $this->l('Please complete the "Randomize" field.');
         } elseif (!Validate::isBool($randomize)) {
             $errors[] = $this->l('Invalid value for "Randomize". It has to be a boolean.');
         }
         if (count($errors)) {
             $output = $this->displayError(implode('<br />', $errors));
         } else {
             Configuration::updateValue('BLOCKTAGS_NBR', (int) $tagsNbr);
             Configuration::updateValue('BLOCKTAGS_MAX_LEVEL', (int) $tagsLevels);
             Configuration::updateValue('BLOCKTAGS_RANDOMIZE', (bool) $randomize);
             $output = $this->displayConfirmation($this->l('Settings updated'));
         }
     }
     return $output . $this->renderForm();
 }
Example #13
0
 public function install()
 {
     if (Shop::isFeatureActive()) {
         Shop::setContext(Shop::CONTEXT_ALL);
     }
     //Ajout d'un onglet à la racine du site
     $parentTab = Tab::getIdFromClassName('AdminImporter');
     if (empty($parentTab)) {
         $parentTab = self::createTab(0, $this->name, 'EDC feeds importer', 'AdminImporter');
     }
     self::createTab($parentTab, $this->name, 'Import des produits', 'AdminImporterRunning');
     self::createTab($parentTab, $this->name, 'Configuration', 'AdminImporterConfiguration');
     self::createTab($parentTab, $this->name, 'Counter', 'AdminImporterCounter');
     self::createTab($parentTab, $this->name, 'Labo', 'AdminImporterLab');
     // self::createTab($parentTab, $this->name, 'CRON', 'AdminImporterCron');
     Configuration::updateValue('IMPORTER_URL_FULL_FEED', 'http://graphics.edc-internet.nl/b2b_feed.php?key=[KEY]&sort=xml&type=xml&lang=[LANG]&version=2015');
     Configuration::updateValue('IMPORTER_URL_NEW_PRODUCTS', 'http://graphics.edc-internet.nl/b2b_feed.php?key=[KEY]&sort=xml&type=xml&lang=[LANG]&version=2015&new=1');
     Configuration::updateValue('IMPORTER_URL_STOCK', 'http://graphics.edc-internet.nl/xml/eg_xml_feed_stock.xml');
     Configuration::updateValue('IMPORTER_DISCONTINUED', 'http://graphics.edc-internet.nl/xml/deleted_products.xml');
     Configuration::updateValue('IMPORTER_IMPORT_CURRENT_STEP', 0);
     Configuration::updateValue('IMPORTER_IMPORT_CURRENT_KEY_IN_XML', 0);
     Configuration::updateValue('IMPORTER_XML_FILE', '');
     Configuration::updateValue('IMPORTER_XML_COUNT');
     //Créer le dossier import
     if (!parent::install() || !$this->installDb()) {
         return false;
     }
     return true;
 }
function add_order_state($conf_name, $name, $invoice, $send_email, $color, $unremovable, $logable, $delivery, $template = null)
{
    $name_lang = array();
    $template_lang = array();
    foreach (explode('|', $name) as $item) {
        $temp = explode(':', $item);
        $name_lang[$temp[0]] = $temp[1];
    }
    if ($template) {
        foreach (explode('|', $template) as $item) {
            $temp = explode(':', $item);
            $template_lang[$temp[0]] = $temp[1];
        }
    }
    Db::getInstance()->Execute('
		INSERT INTO `' . _DB_PREFIX_ . 'order_state` (`invoice`, `send_email`, `color`, `unremovable`, `logable`, `delivery`) 
		VALUES (' . (int) $invoice . ', ' . (int) $send_email . ', \'' . pSQL($color) . '\', ' . (int) $unremovable . ', ' . (int) $logable . ', ' . (int) $delivery . ')');
    $id_order_state = Db::getInstance()->getValue('
		SELECT MAX(`id_order_state`)
		FROM `' . _DB_PREFIX_ . 'order_state`
	');
    foreach (Language::getLanguages() as $lang) {
        Db::getInstance()->Execute('
		INSERT IGNORE INTO `' . _DB_PREFIX_ . 'order_state_lang` (`id_lang`, `id_order_state`, `name`, `template`) 
		VALUES (' . (int) $lang['id_lang'] . ', ' . (int) $id_order_state . ', \'' . pSQL(isset($name_lang[$lang['iso_code']]) ? $name_lang[$lang['iso_code']] : $name_lang['en']) . '\', \'' . pSQL(isset($template_lang[$lang['iso_code']]) ? $template_lang[$lang['iso_code']] : (isset($template_lang['en']) ? $template_lang['en'] : '')) . '\')
		');
    }
    Configuration::updateValue($conf_name, $id_order_state);
}
Example #15
0
    public function getContent()
    {
        $html = '';
        // If we try to update the settings
        if (isset($_POST['submitModule'])) {
            Configuration::updateValue('blockcontactinfos_company', isset($_POST['company']) && $_POST['company'] != '' ? $_POST['company'] : Configuration::get('PS_SHOP_NAME'));
            Configuration::updateValue('blockcontactinfos_address', isset($_POST['address']) && $_POST['address'] != '' ? $_POST['address'] : '');
            Configuration::updateValue('blockcontactinfos_phone', isset($_POST['phone']) && $_POST['phone'] != '' ? $_POST['phone'] : '');
            Configuration::updateValue('blockcontactinfos_email', isset($_POST['email']) && $_POST['email'] != '' ? $_POST['email'] : Configuration::get('PS_SHOP_EMAIL'));
            $html .= '<div class="confirm">' . $this->l('Configuration updated') . '</div>';
        }
        $html .= '
		<h2>' . $this->displayName . '</h2>
		<form action="' . Tools::htmlentitiesutf8($_SERVER['REQUEST_URI']) . '" method="post">
			<fieldset>	
				<p><label for="company">' . $this->l('Company name') . ' :</label>
				<input type="text" id="company" name="company" value="' . Tools::safeOutput(Configuration::get('blockcontactinfos_company')) . '" /></p>
				<p><label for="address">' . $this->l('Address') . ' :</label>
				<textarea id="address" name="address" cols="60" rows="4">' . Tools::safeOutput(Configuration::get('blockcontactinfos_address')) . '</textarea></p>
				<p><label for="phone">' . $this->l('Phone number') . ' :</label>
				<input type="text" id="phone" name="phone" value="' . Tools::safeOutput(Configuration::get('blockcontactinfos_phone')) . '" /></p>
				<p><label for="email">' . $this->l('Email') . ' :</label>
				<input type="text" id="email" name="email" value="' . Tools::safeOutput(Configuration::get('blockcontactinfos_email')) . '" />	</p>
				<div class="margin-form">
					<input type="submit" name="submitModule" value="' . $this->l('Update settings') . '" class="button" /></center>
				</div>
			</fieldset>
		</form>
		';
        return $html;
    }
 function install()
 {
     if (!parent::install() or !$this->registerHook('home') or Configuration::updateValue('BLOCK_CATEG_MAX_DEPTH', 1) == false) {
         return false;
     }
     return true;
 }
Example #17
0
function upgrade_module_2_8_4($object, $install = false)
{
    // update value so url mobile
    Configuration::updateValue('SOCOLISSIMO_URL_MOBILE', 'http://ws-mobile.colissimo.fr/');
    Configuration::updateValue('SOCOLISSIMO_VERSION', '2.8.4');
    return true;
}
Example #18
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');
 }
    public function getContent()
    {
        $this->_html = '<h2>' . $this->displayName . '</h2>
		<p><img src="../modules/alliedwallet/alliedwallet.gif" alt="alliedwallet"/></p>
		<fieldset style="margin-bottom:10px">
<b>' . $this->l('Accept payments with Allied Wallet now.') . '</b><br/><br/>' . $this->l('Are you ready to begin accepting 164 different currencies in nearly every card brand, direct debit, and ACH?') . '<br/>' . $this->l('Are you ready to protect your business with state-of-the-art security?') . '<br/>' . $this->l('Are you ready to see more ease in your business with our tracking and reporting?') . '<br/><br/>' . $this->l('Pair your PrestaShop store with the most innovative and fully-featured payment solution available. See your profit today and use the module below.') . '<br/><br/>' . $this->l('If you don\'t have an Allied Wallet account yet,') . ' <a target="_BLANK" style="color:blue;text-decoration:underline" href="https://www.alliedwallet.com/sign-up"><b>' . $this->l('sign up today') . '</b></a> ' . $this->l('and begin processing in as little as 24 hours at a rate starting as low as 1.95%.') . '</fieldset>';
        if (isset($_POST['submitAlliedwallet'])) {
            if (empty($_POST['merchant_id'])) {
                $this->_postErrors[] = $this->l('Allied Wallet Merchant ID is required');
            }
            if (empty($_POST['site_id'])) {
                $this->_postErrors[] = $this->l('Allied Wallet Site ID is required');
            }
            if (empty($_POST['return_url'])) {
                $this->_postErrors[] = $this->l('Complete URL is required and must be correct.');
            }
            if (!sizeof($this->_postErrors)) {
                Configuration::updateValue('ALLIEDWALLET_MERCHANT_ID', $_POST['merchant_id']);
                Configuration::updateValue('ALLIEDWALLET_SITE_ID', $_POST['site_id']);
                Configuration::updateValue('ALLIEDWALLET_RETURN_PAGE', $_POST['return_url']);
                $this->displayConf();
            } else {
                $this->displayErrors();
            }
        }
        $this->displayFormSettings();
        return $this->_html;
    }
Example #20
0
 public function getContent()
 {
     if (Tools::isSubmit('submit')) {
         if (!sizeof($this->_postErrors)) {
             $t = getdate();
             $date = $t["year"] . "-" . $t["mon"] . "-" . $t["mday"] . "(" . $t["hours"] . ":" . $t["minutes"] . ":" . $t["seconds"] . ")";
             Configuration::updateValue('gw_alipay_mer_id', Tools::getValue('shop_code'), true);
             Configuration::updateValue('gw_alipay_encryption', Tools::getValue('encryption_code'), true);
             $this->_html .= '<div class="conf confirm">' . $this->l('Success Updata') . "   " . $date . '</div>';
         } else {
             foreach ($this->_postErrors as $err) {
                 $this->_html .= '<div class"alert error">' . $err . "</div>";
             }
         }
     }
     //如果Configuration資料庫已經有greenworld_vacc_encryption_code 與 greenworld_vacc_shop_code
     //的值,則直接抓取出來資料並顯示。
     if (!Configuration::get($this->name . '_encry_code') == null) {
         $this->_encryption_code = Configuration::get($this->name . '_encry_code');
     } else {
         $this->_encryption_code = 'Enter Encryption Code';
     }
     if (!Configuration::get($this->name . '_shop_code') == null) {
         $this->_shop_code = Configuration::get($this->name . '_shop_code');
     } else {
         $this->_shop_code = 'Enter Shop Code';
     }
     $this->_displayForm();
     return $this->_html;
 }
 public function install()
 {
     if (!parent::install() || !$this->registerHook('leftColumn') || !$this->registerHook('header') || !Configuration::updateValue('PRODUCTMIRROR_NAME', 'Product Mirror')) {
         return false;
     }
     return true;
 }
Example #22
0
 public function install()
 {
     if (parent::install() && $this->registerHook('productTab') && $this->registerHook('productTabContent') && $this->registerHook('extraRight')) {
         if (substr_count(_PS_VERSION_, '1.6') > 0) {
             $tab_type = 1;
         } else {
             $tab_type = 2;
         }
         $faq_email = Configuration::get('PS_SHOP_EMAIL');
         $res = true;
         /* Creates tables */
         $res &= $this->createTableConsultas();
         $res &= $this->createTableRespuestas();
         $res &= $this->createTabs();
         $res &= Configuration::updateValue('LG_CONSULTAS_EMAIL', $faq_email);
         $res &= Configuration::updateValue('LG_CONSULTAS_TAB_CONTENT', $tab_type);
         $res &= Configuration::updateValue('LG_CONSULTAS_EXTRA_RIGHT', 1);
         $res &= Configuration::updateValue('LG_CONSULTAS_ICON_DISPLAY', 1);
         $res &= Configuration::updateValue('LG_CONSULTAS_ICON_COLOR', 1);
         $res &= Configuration::updateValue('LG_CONSULTAS_DEFAULT', 3);
         $res &= Configuration::updateValue('LG_CONSULTAS_EXTRA', 10);
         $res &= Configuration::updateValue('LG_CONSULTAS_CMS', 3);
         return $res;
     }
     return false;
 }
Example #23
0
    public function getContent()
    {
        $this->_html = '';
        if (Tools::isSubmit('submitCross') and Tools::getValue('displayPrice') != 0 and Tools::getValue('displayPrice') != 1) {
            $this->_html .= $this->displayError('Invalid displayPrice');
        } elseif (Tools::isSubmit('submitCross')) {
            Configuration::updateValue('CROSSSELLING_DISPLAY_PRICE', (int) Tools::getValue('displayPrice'));
            $this->_html .= $this->displayConfirmation($this->l('Settings updated successfully'));
        }
        $this->_html .= '
		<form action="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '" method="post">
		<fieldset><legend><img src="' . $this->_path . 'logo.gif" alt="" title="" />' . $this->l('Settings') . '</legend>
			<label>' . $this->l('Display price on products') . '</label>
			<div class="margin-form">
				<input type="radio" name="displayPrice" id="display_on" value="1" ' . (Configuration::get('CROSSSELLING_DISPLAY_PRICE') ? 'checked="checked" ' : '') . '/>
				<label class="t" for="display_on"> <img src="../img/admin/enabled.gif" alt="' . $this->l('Enabled') . '" title="' . $this->l('Enabled') . '" /></label>
				<input type="radio" name="displayPrice" id="display_off" value="0" ' . (!Configuration::get('CROSSSELLING_DISPLAY_PRICE') ? 'checked="checked" ' : '') . '/>
				<label class="t" for="display_off"> <img src="../img/admin/disabled.gif" alt="' . $this->l('Disabled') . '" title="' . $this->l('Disabled') . '" /></label>
				<p class="clear">' . $this->l('Show the price on the products in the block.') . '</p>
			</div>
			<center><input type="submit" name="submitCross" value="' . $this->l('Save') . '" class="button" /></center>
		</fieldset>
		</form>';
        return $this->_html;
    }
Example #24
0
 public function install($keep = true)
 {
     if (!parent::install() || !Configuration::updateValue('EGORMATEKPROD_MANUF', 0) || !$this->registerHook('displayTopColumn') || !$this->registerHook('displayBackOfficeHeader')) {
         return false;
     }
     return true;
 }
Example #25
0
 public function install()
 {
     if (!parent::install()) {
         return false;
     }
     return Configuration::updateValue('PS_STATS_RENDER', $this->name);
 }
Example #26
0
    public function getContent()
    {
        // If we try to update the settings
        if (isset($_POST['submitModule'])) {
            Configuration::updateValue('blocksocial_facebook', $_POST['facebook_url'] != '' ? $_POST['facebook_url'] : '');
            Configuration::updateValue('blocksocial_twitter', $_POST['twitter_url'] != '' ? $_POST['twitter_url'] : '');
            Configuration::updateValue('blocksocial_rss', $_POST['rss_url'] != '' ? $_POST['rss_url'] : '');
            echo '<div class="conf confirm"><img src="../img/admin/ok.gif"/>' . $this->l('Configuration updated') . '</div>';
        }
        return '
		<h2>' . $this->displayName . '</h2>
		<form action="' . Tools::htmlentitiesutf8($_SERVER['REQUEST_URI']) . '" method="post">
			<fieldset class="width2">				
				<label for="facebook_url">' . $this->l('Facebook URL : ') . '</label>
				<input type="text" id="facebook_url" name="facebook_url" value="' . (Configuration::get('blocksocial_facebook') != "" ? Configuration::get('blocksocial_facebook') : "") . '" />
				<div class="clear">&nbsp;</div>		
				<label for="twitter_url">' . $this->l('Twitter URL : ') . '</label>
				<input type="text" id="twitter_url" name="twitter_url" value="' . (Configuration::get('blocksocial_twitter') != "" ? Configuration::get('blocksocial_twitter') : "") . '" />
				<div class="clear">&nbsp;</div>		
				<label for="rss_url">' . $this->l('RSS URL : ') . '</label>
				<input type="text" id="rss_url" name="rss_url" value="' . (Configuration::get('blocksocial_rss') != "" ? Configuration::get('blocksocial_rss') : "") . '" />
				<div class="clear">&nbsp;</div>						
				<br /><center><input type="submit" name="submitModule" value="' . $this->l('Update settings') . '" class="button" /></center>
			</fieldset>
		</form>
		<div class="clear">&nbsp;</div>
		<fieldset>
			<legend>Addons</legend>
			' . $this->l('This module has been developped by PrestaShop and can only be sold through') . ' <a href="http://addons.prestashop.com">addons.prestashop.com</a>.<br />
			' . $this->l('Please report all bugs to') . ' <a href="mailto:addons@prestashop.com">addons@prestashop.com</a> ' . $this->l('or using our') . ' <a href="http://addons.prestashop.com/contact-form.php">' . $this->l('contact form') . '</a>.
		</fieldset>';
    }
 /**
  * Enable / disable multishop menu if multishop feature is activated
  *
  * @param string $value
  */
 public function updateOptionPsMultishopFeatureActive($value)
 {
     Configuration::updateValue('PS_MULTISHOP_FEATURE_ACTIVE', $value);
     $tab = Tab::getInstanceFromClassName('AdminShopGroup');
     $tab->active = (bool) Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE');
     $tab->update();
 }
 public function install()
 {
     if (!parent::install()) {
         return false;
     }
     // Insert currencies availability
     if ($this->currencies_mode == 'checkbox') {
         if (!$this->addCheckboxCurrencyRestrictionsForModule()) {
             return false;
         }
     } elseif ($this->currencies_mode == 'radio') {
         if (!$this->addRadioCurrencyRestrictionsForModule()) {
             return false;
         }
     } else {
         Tools::displayError('No currency mode for payment module');
     }
     // Insert countries availability
     $return = $this->addCheckboxCountryRestrictionsForModule();
     if (!Configuration::get('CONF_' . strtoupper($this->name) . '_FIXED')) {
         Configuration::updateValue('CONF_' . strtoupper($this->name) . '_FIXED', '0.2');
     }
     if (!Configuration::get('CONF_' . strtoupper($this->name) . '_VAR')) {
         Configuration::updateValue('CONF_' . strtoupper($this->name) . '_VAR', '2');
     }
     if (!Configuration::get('CONF_' . strtoupper($this->name) . '_FIXED_FOREIGN')) {
         Configuration::updateValue('CONF_' . strtoupper($this->name) . '_FIXED_FOREIGN', '0.2');
     }
     if (!Configuration::get('CONF_' . strtoupper($this->name) . '_VAR_FOREIGN')) {
         Configuration::updateValue('CONF_' . strtoupper($this->name) . '_VAR_FOREIGN', '2');
     }
     return $return;
 }
    public function getContent()
    {
        global $cookie;
        $html = '
		<h2>' . $this->l('Payment logo') . '</h2>
		';
        if (Tools::isSubmit('submitConfiguration')) {
            if (Validate::isUnsignedInt(Tools::getValue('id_cms'))) {
                Configuration::updateValue('PS_PAYMENT_LOGO_CMS_ID', intval(Tools::getValue('id_cms')));
                $html .= $this->displayConfirmation($this->l('Settings are updated'));
            }
        }
        $cmss = CMS::listCms(intval($cookie->id_lang));
        if (!sizeof($cmss)) {
            $html .= $this->displayError($this->l('No CMS page is available'));
        } else {
            $html .= '
			<form action="' . $_SERVER['REQUEST_URI'] . '" method="post">
				<fieldset>
					<legend><img src="' . $this->_path . '/logo.gif" alt="" /> ' . $this->l('Configure') . '</legend>
					<label>' . $this->l('Page CMS for link') . ':</label>
					<div class="margin-form">
						<select name="id_cms">';
            foreach ($cmss as $cms) {
                $html .= '<option value="' . $cms['id_cms'] . '"' . (Configuration::get('PS_PAYMENT_LOGO_CMS_ID') == $cms['id_cms'] ? ' selected="selected"' : '') . '>' . $cms['meta_title'] . '</option>';
            }
            $html .= '</select>
					</div>
					<p class="center"><input class="button" type="submit" name="submitConfiguration" value="' . $this->l('Save settings') . '" /></p>
				</fieldset>
			</form>
			';
        }
        return $html;
    }
 public function getContent()
 {
     $output = '<h2>' . $this->displayName . '</h2>';
     if (Tools::isSubmit('submitBlockManufacturers')) {
         $text_list = (int) Tools::getValue('text_list');
         $text_nb = (int) Tools::getValue('text_nb');
         $form_list = (int) Tools::getValue('form_list');
         if ($text_list && !Validate::isUnsignedInt($text_nb)) {
             $errors[] = $this->l('There is an invalid number of elements');
         } elseif (!$text_list && !$form_list) {
             $errors[] = $this->l('Please activate at least one system list.');
         } else {
             Configuration::updateValue('MANUFACTURER_DISPLAY_TEXT', $text_list);
             Configuration::updateValue('MANUFACTURER_DISPLAY_TEXT_NB', $text_nb);
             Configuration::updateValue('MANUFACTURER_DISPLAY_FORM', $form_list);
             $this->_clearCache('blockmanufacturer.tpl');
         }
         if (isset($errors) && count($errors)) {
             $output .= $this->displayError(implode('<br />', $errors));
         } else {
             $output .= $this->displayConfirmation($this->l('Settings updated'));
         }
     }
     return $output . $this->displayForm();
 }