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 displayForm()
    {
        return '
		<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('Maximum depth') . '</label>
				<div class="margin-form">
					<input type="text" name="maxDepth" value="' . Configuration::get('BLOCK_CATEG_MAX_DEPTH') . '" />
					<p class="clear">' . $this->l('Set the maximum depth of sublevels displayed in this block (0 = infinite)') . '</p>
				</div>
				<label>' . $this->l('Dynamic') . '</label>

				<div class="margin-form">
					<input type="radio" name="dhtml" id="dhtml_on" value="1" ' . (Tools::getValue('dhtml', Configuration::get('BLOCK_CATEG_DHTML')) ? 'checked="checked" ' : '') . '/>
					<label class="t" for="dhtml_on"> <img src="../img/admin/enabled.gif" alt="' . $this->l('Enabled') . '" title="' . $this->l('Enabled') . '" /></label>
					<input type="radio" name="dhtml" id="dhtml_off" value="0" ' . (!Tools::getValue('dhtml', Configuration::get('BLOCK_CATEG_DHTML')) ? 'checked="checked" ' : '') . '/>
					<label class="t" for="dhtml_off"> <img src="../img/admin/disabled.gif" alt="' . $this->l('Disabled') . '" title="' . $this->l('Disabled') . '" /></label>
					<p class="clear">' . $this->l('Activate dynamic (animated) mode for sublevels') . '</p>
				</div>
				<label>' . $this->l('Footer columns number') . '</label>			
				<div class="margin-form">
					<input type="text" name="nbrColumns" value="' . Configuration::get('BLOCK_CATEG_NBR_COLUMN_FOOTER') . '" />
					<p class="clear">' . $this->l('Set the number of footer columns') . '</p>
				</div>
				<center><input type="submit" name="submitBlockCategories" value="' . $this->l('Save') . '" class="button" /></center>
			</fieldset>
		</form>';
    }
Example #3
0
 /**
  * constructor
  *
  * @param string $path the path to a file or folder
  */
 function __construct($path = null)
 {
     if (!is_null($path)) {
         if (file_exists($path)) {
             $this->filePath = $path;
             if (is_file($this->filePath)) {
                 $this->fileStat = @stat($path);
                 $this->fileInfo['size'] = $this->fileStat[7];
                 $this->fileInfo['atime'] = $this->fileStat[8];
                 $this->fileInfo['ctime'] = $this->fileStat[10];
                 $this->fileInfo['mtime'] = $this->fileStat[9];
                 $this->fileInfo['path'] = addslashes($path);
                 $this->fileInfo['name'] = addslashes(basename($path));
                 $this->fileInfo['is_writable'] = $this->isWritable();
                 $this->fileInfo['is_readable'] = $this->isReadable();
             } elseif (is_dir($this->filePath)) {
                 $this->fileStat = @stat($path);
                 $this->fileInfo['name'] = addslashes(basename($path));
                 $this->fileInfo['path'] = addslashes($path);
                 $this->fileInfo['atime'] = $this->fileStat[8];
                 $this->fileInfo['ctime'] = $this->fileStat[10];
                 $this->fileInfo['mtime'] = $this->fileStat[9];
                 $this->fileInfo['is_writable'] = $this->isWritable();
                 $this->fileInfo['is_readable'] = $this->isReadable();
             }
         } else {
             trigger_error('No such file exists. ' . Tools::safeOutput($path), E_USER_NOTICE);
         }
     }
 }
    public function hookAdminStatsModules($params)
    {
        $graphParams = array('layers' => 2, 'type' => 'line', 'option' => 3);
        $totalVisits = $this->getTotalVisits();
        $totalGuests = $this->getTotalGuests();
        if (Tools::getValue('export')) {
            $this->csvExport(array('layers' => 2, 'type' => 'line', 'option' => 3));
        }
        $this->html = '
		<div class="blocStats"><h2 class="icon-' . $this->name . '"><span></span>' . $this->displayName . '</h2>
			<p>
				<img src="../img/admin/down.gif" />' . $this->l('A visit corresponds to an internet user coming to your shop, and until the end of their session, only one visit is counted.') . '
				' . $this->l('A visitor is an unknown person who has not registered or logged into your store. A visitor can also be considered a person who has visited your shop multiple times.') . '
			</p>
			<div style="margin-top:20px"></div>
			<p>' . $this->l('Total visits:') . ' <span class="totalStats">' . $totalVisits . '</span></p>
			<p>' . $this->l('Total visitors:') . ' <span class="totalStats">' . $totalGuests . '</span></p>
			' . ($totalVisits ? $this->engine($graphParams) . '<p><a class="button export-csv" href="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '&export=1"><span>' . $this->l('CSV Export') . '</span></a></p>' : '') . '
		</div>
		<br />
		<div class="blocStats"><h2 class="icon-guide"><span></span>' . $this->l('Guide') . '</h2>
				<h2>' . $this->l('Determine the interest of a visit.') . '</h2>
				' . $this->l('The visitors\' evolution graph strongly resembles the visits\' graph, but provides additional information:') . '<br />
				<ul>
					<li>' . $this->l('If this is the case, congratulations, your website is well planned and pleasing. Glad to see that you\'ve been paying attention.') . '</li>
					<li>' . $this->l('Otherwise, the conclusion is not so simple. The problem can be aesthetic or ergonomic. It is also possible that many visitors have mistakenly visited your URL without possessing a particular interest in your shop. This strange and ever-confusing phenomenon is most likely cause by search engines. If this is the case, you should consider revising your SEO structure.') . '</li>
				</ul>
				' . $this->l('This information is mostly qualitative. It is up to you to determine the interest of a disjointed visit.') . '<br />
		</div>';
        return $this->html;
    }
    /**
     * Render form
     * @return string
     */
    public function renderList()
    {
        $this->form = '
			<div class="row">
				<table class="table">
					<thead>
						<tr>
							<th><span class="title_box ">Test</span></th>
							<th><span class="title_box ">Test</span></th>
							<th><span class="title_box ">Test</span></th>
						</tr>
					</thead>
					<tbody>
					</tbody>
				</table>
			</div>
			<div class="row">
				<div class="col-lg-12">
					<a class="btn btn-default pull-right" href="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '&refresh=1&refreshType=1">
						<i class="icon-refresh"></i> ' . $this->l('Refresh') . '
					</a>
				</div>
			</div>';
        $this->context->smarty->assign('form', $this->form);
        $this->output .= $this->context->smarty->fetch($this->path . 'views/templates/admin/socialuserheaderadmin.tpl');
        //$this->context->smarty->assign('current_url', '?controller=AdminXlsProductImport2&amp;token='.Tools::getAdminTokenLite('AdminSocialUserProfile'));
        return $this->output . parent::renderList();
    }
    public function displayForm()
    {
        $orders = array('date_add' => $this->l('Date Add'), 'date_add DESC' => $this->l('Date Add DESC'), 'name' => $this->l('Name'), 'name DESC' => $this->l('Name DESC'), 'quantity' => $this->l('Quantity'), 'quantity DESC' => $this->l('Quantity DESC'), 'price' => $this->l('Price'), 'price DESC' => $this->l('Price DESC'));
        return '
		<form action="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '" method="post">
			<fieldset>
				<legend><img src="' . $this->_path . 'logo.gif" alt="" title="" />' . $this->l('Settings') . '</legend>
				
			
				 
				<div class="row-form">
					' . $this->params->selectTag($orders, "Order By", 'porder', $this->params->get('porder')) . '
					<p class="clear">' . $this->l('The maximum number of products in each page Carousel (default: 3).') . '</p>
				</div>
			
				<div class="row-form">
					' . $this->params->inputTag('Items Per Page', 'itemspage', $this->params->get('itemspage')) . '
					<p class="clear">' . $this->l('The maximum number of products in each page Carousel (default: 3).') . '</p>
				</div>
				<div class="row-form">
					' . $this->params->inputTag('Colums In Each Carousel', 'columns', $this->params->get('columns')) . '
					<p class="clear">' . $this->l('The maximum column products in each page Carousel (default: 3).') . '</p>
				</div>
				<div class="row-form">
					' . $this->params->inputTag('Items In all Carousels', 'itemstab', $this->params->get('itemstab')) . '
					<p class="clear">' . $this->l('The maximum number of products in each Carousel (default: 6).') . '</p>
				</div>
				
				 
				<center><input type="submit" name="submitSpecials" value="' . $this->l('Save') . '" class="button" /></center>
			</fieldset>
		</form>';
    }
Example #7
0
    public function displayForm()
    {
        $output = '
		<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('Use a plain-text list.') . '</label>
				<div class="margin-form">
					<input type="radio" name="text_list" id="text_list_on" value="1" ' . (Tools::getValue('text_list', Configuration::get('MANUFACTURER_DISPLAY_TEXT')) ? 'checked="checked" ' : '') . '/>
					<label class="t" for="text_list_on"> <img src="../img/admin/enabled.gif" alt="' . $this->l('Enabled') . '" title="' . $this->l('Enabled') . '" /></label>
					<input type="radio" name="text_list" id="text_list_off" value="0" ' . (!Tools::getValue('text_list', Configuration::get('MANUFACTURER_DISPLAY_TEXT')) ? 'checked="checked" ' : '') . '/>
					<label class="t" for="text_list_off"> <img src="../img/admin/disabled.gif" alt="' . $this->l('Disabled') . '" title="' . $this->l('Disabled') . '" /></label>
					&nbsp;&nbsp;&nbsp;' . $this->l('Display') . ' <input type="text" size="2" name="text_nb" value="' . (int) Tools::getValue('text_nb', Configuration::get('MANUFACTURER_DISPLAY_TEXT_NB')) . '" /> ' . $this->l('Elements') . '
					<p class="clear">' . $this->l('Display manufacturers in a plain-text list') . '</p>
				</div>
				<label>' . $this->l('Use a drop-down list.') . '</label>
				<div class="margin-form">
					<input type="radio" name="form_list" id="form_list_on" value="1" ' . (Tools::getValue('form_list', Configuration::get('MANUFACTURER_DISPLAY_FORM')) ? 'checked="checked" ' : '') . '/>
					<label class="t" for="form_list_on"> <img src="../img/admin/enabled.gif" alt="' . $this->l('Enabled') . '" title="' . $this->l('Enabled') . '" /></label>
					<input type="radio" name="form_list" id="form_list_off" value="0" ' . (!Tools::getValue('form_list', Configuration::get('MANUFACTURER_DISPLAY_FORM')) ? 'checked="checked" ' : '') . '/>
					<label class="t" for="form_list_off"> <img src="../img/admin/disabled.gif" alt="' . $this->l('Disabled') . '" title="' . $this->l('Disabled') . '" /></label>
					<p class="clear">' . $this->l('Display manufacturers in a drop-down list.') . '</p>
				</div>
				<center><input type="submit" name="submitBlockManufacturers" value="' . $this->l('Save') . '" class="button" /></center>
			</fieldset>
		</form>';
        return $output;
    }
    public function __construct()
    {
        $this->bootstrap = true;
        $this->table = 'alias';
        $this->className = 'Alias';
        $this->lang = false;
        parent::__construct();
        // Alias fields
        $this->addRowAction('edit');
        $this->addRowAction('delete');
        if (!Tools::getValue('realedit')) {
            $this->deleted = false;
        }
        $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'), 'icon' => 'icon-trash'));
        $this->fields_list = array('alias' => array('title' => $this->l('Aliases')), 'search' => array('title' => $this->l('Search')), 'active' => array('title' => $this->l('Status'), 'class' => 'fixed-width-sm', 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false));
        // Search options
        $current_file_name = array_reverse(explode('/', $_SERVER['SCRIPT_NAME']));
        $cron_url = Tools::getHttpHost(true, true) . __PS_BASE_URI__ . basename(_PS_ADMIN_DIR_) . '/searchcron.php?full=1&token=' . substr(_COOKIE_KEY_, 34, 8);
        list($total, $indexed) = Db::getInstance()->getRow('SELECT COUNT(*) as "0", SUM(product_shop.indexed) as "1" FROM ' . _DB_PREFIX_ . 'product p ' . Shop::addSqlAssociation('product', 'p') . ' WHERE product_shop.`visibility` IN ("both", "search") AND product_shop.`active` = 1');
        $this->fields_options = array('indexation' => array('title' => $this->l('Indexing'), 'icon' => 'icon-cogs', 'info' => '<p>' . $this->l('The "indexed" products have been analyzed by PrestaShop and will appear in the results of a Front Office search.') . '<br />
						' . $this->l('Indexed products') . ' <strong>' . (int) $indexed . ' / ' . (int) $total . '</strong>.
						</p>
						<p>' . $this->l('Building the product index may take a few minutes.') . $this->l('If your server stops before the process ends, you can resume the indexing by clicking "Add missing products."') . '</p>
						<a href="searchcron.php?token=' . substr(_COOKIE_KEY_, 34, 8) . '&amp;redirect=1" class="btn-link"><i class="icon-external-link-sign"></i> ' . $this->l('Add missing products to the index.') . '</a><br />
						<a href="searchcron.php?full=1&amp;token=' . substr(_COOKIE_KEY_, 34, 8) . '&amp;redirect=1" class="btn-link"><i class="icon-external-link-sign"></i> ' . $this->l('Re-build the entire index.') . '</a><br /><br />
						' . $this->l('You can set a cron job that will rebuild your index using the following URL:') . ' <a href="' . Tools::safeOutput($cron_url) . '"><i class="icon-external-link-sign"></i> ' . Tools::safeOutput($cron_url) . '</a>', 'fields' => array('PS_SEARCH_INDEXATION' => array('title' => $this->l('Indexing'), 'validation' => 'isBool', 'type' => 'bool', 'cast' => 'intval', 'desc' => $this->l('Enable the automatic indexing of products. If you enable this feature, the products will be indexed in the search automatically when they are saved. If the feature is disabled, you will have to index products manually by using the links provided in the field set.'))), 'submit' => array('title' => $this->l('Save'))), 'search' => array('title' => $this->l('Search'), 'icon' => 'icon-search', 'fields' => array('PS_SEARCH_AJAX' => array('title' => $this->l('Ajax search'), 'validation' => 'isBool', 'type' => 'bool', 'cast' => 'intval', 'hint' => array($this->l('Enable ajax search for your visitors.'), $this->l('With ajax search, the first 10 products matching the user query will appear in real time below the input field.'))), 'PS_INSTANT_SEARCH' => array('title' => $this->l('Instant search'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'hint' => array($this->l('Enable instant search for your visitors?'), $this->l('With instant search, the results will appear immediately as the user writes a query.'))), 'PS_SEARCH_MINWORDLEN' => array('title' => $this->l('Minimum word length (in characters)'), 'hint' => $this->l('Only words this size or larger will be indexed.'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_BLACKLIST' => array('title' => $this->l('Blacklisted words'), 'validation' => 'isGenericName', 'hint' => $this->l('Please enter the index words separated by a "|".'), 'type' => 'textLang')), 'submit' => array('title' => $this->l('Save'))), 'relevance' => array('title' => $this->l('Weight'), 'icon' => 'icon-cogs', 'info' => $this->l('The "weight" represents its importance and relevance for the ranking of the products when completing a new search.') . '<br />
						' . $this->l('A word with a weight of eight will have four times more value than a word with a weight of two.') . '<br /><br />
						' . $this->l('We advise you to set a greater weight for words which appear in the name or reference of a product. This will allow the search results to be as precise and relevant as possible.') . '<br /><br />
						' . $this->l('Setting a weight to 0 will exclude that field from search index. Re-build of the entire index is required when changing to or from 0'), 'fields' => array('PS_SEARCH_WEIGHT_PNAME' => array('title' => $this->l('Product name weight'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_REF' => array('title' => $this->l('Reference weight'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_SHORTDESC' => array('title' => $this->l('Short description weight'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_DESC' => array('title' => $this->l('Description weight'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_CNAME' => array('title' => $this->l('Category weight'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_MNAME' => array('title' => $this->l('Manufacturer weight'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_TAG' => array('title' => $this->l('Tags weight'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_ATTRIBUTE' => array('title' => $this->l('Attributes weight'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval'), 'PS_SEARCH_WEIGHT_FEATURE' => array('title' => $this->l('Features weight'), 'validation' => 'isUnsignedInt', 'type' => 'text', 'cast' => 'intval')), 'submit' => array('title' => $this->l('Save'))));
    }
 public function __construct()
 {
     global $cookie;
     $this->className = 'Configuration';
     $this->table = 'configuration';
     $max_upload = (int) ini_get('upload_max_filesize');
     $max_post = (int) ini_get('post_max_size');
     $upload_mb = min($max_upload, $max_post);
     $timezones = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT name FROM ' . _DB_PREFIX_ . 'timezone');
     $taxes[] = array('id' => 0, 'name' => $this->l('None'));
     foreach (Tax::getTaxes((int) $cookie->id_lang) as $tax) {
         $taxes[] = array('id' => $tax['id_tax'], 'name' => $tax['name']);
     }
     $order_process_type = array(array('value' => PS_ORDER_PROCESS_STANDARD, 'name' => $this->l('Standard (5 steps)')), array('value' => PS_ORDER_PROCESS_OPC, 'name' => $this->l('One page checkout')));
     $round_mode = array(array('value' => PS_ROUND_UP, 'name' => $this->l('superior')), array('value' => PS_ROUND_DOWN, 'name' => $this->l('inferior')), array('value' => PS_ROUND_HALF, 'name' => $this->l('classical')));
     $cms_tab = array(0 => array('id' => 0, 'name' => $this->l('None')));
     foreach (CMS::listCms($cookie->id_lang) as $cms_file) {
         $cms_tab[] = array('id' => $cms_file['id_cms'], 'name' => $cms_file['meta_title']);
     }
     $this->_fieldsGeneral = array('PS_SHOP_ENABLE' => array('title' => $this->l('Enable Shop'), 'desc' => $this->l('Activate or deactivate your shop. Deactivate your shop while you perform maintenance on it. Please note that the webservice will not be disabled'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_MAINTENANCE_IP' => array('title' => $this->l('Maintenance IP'), 'desc' => $this->l('IP addresses allowed to access the Front Office even if shop is disabled. Use a comma to separate them (e.g., 42.24.4.2,127.0.0.1,99.98.97.96)'), 'validation' => 'isGenericName', 'type' => 'maintenance_ip', 'size' => 30, 'default' => ''), 'PS_SSL_ENABLED' => array('title' => $this->l('Enable SSL'), 'desc' => $this->l('If your hosting provider allows SSL, you can activate SSL encryption (https://) for customer account identification and order processing'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_COOKIE_CHECKIP' => array('title' => $this->l('Check IP on the cookie'), 'desc' => $this->l('Check the IP address of the cookie in order to avoid your cookie being stolen'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_COOKIE_LIFETIME_FO' => array('title' => $this->l('Lifetime of the Front Office cookie'), 'desc' => $this->l('Indicate the number of hours'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text', 'default' => '480'), 'PS_COOKIE_LIFETIME_BO' => array('title' => $this->l('Lifetime of the Back Office cookie'), 'desc' => $this->l('Indicate the number of hours'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text', 'default' => '480'), 'PS_TOKEN_ENABLE' => array('title' => $this->l('Increase Front Office security'), 'desc' => $this->l('Enable or disable token on the Front Office in order to improve PrestaShop security'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_HELPBOX' => array('title' => $this->l('Back Office help boxes'), 'desc' => $this->l('Enable yellow help boxes which are displayed under form fields in the Back Office'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_ORDER_PROCESS_TYPE' => array('title' => $this->l('Order process type'), 'desc' => $this->l('You can choose the order process type as either standard (5 steps) or One Page Checkout'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $order_process_type, 'identifier' => 'value'), 'PS_GUEST_CHECKOUT_ENABLED' => array('title' => $this->l('Enable guest checkout'), 'desc' => $this->l('Your guest can make an order without registering'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_CONDITIONS' => array('title' => $this->l('Terms of service'), 'desc' => $this->l('Require customers to accept or decline terms of service before processing the order'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'js' => array('on' => 'onchange="changeCMSActivationAuthorization()"', 'off' => 'onchange="changeCMSActivationAuthorization()"')), 'PS_CONDITIONS_CMS_ID' => array('title' => $this->l('Conditions of use of CMS page'), 'desc' => $this->l('Choose the Conditions of use of CMS page'), 'validation' => 'isInt', 'type' => 'select', 'list' => $cms_tab, 'identifier' => 'id', 'cast' => 'intval'), 'PS_GIFT_WRAPPING' => array('title' => $this->l('Offer gift-wrapping'), 'desc' => $this->l('Suggest gift-wrapping to customer and possibility of leaving a message'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_GIFT_WRAPPING_PRICE' => array('title' => $this->l('Gift-wrap pricing'), 'desc' => $this->l('Set a price for gift-wrapping'), 'validation' => 'isPrice', 'cast' => 'floatval', 'type' => 'price'), 'PS_GIFT_WRAPPING_TAX' => array('title' => $this->l('Gift-wrapping tax'), 'desc' => $this->l('Set a tax for gift-wrapping'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $taxes, 'identifier' => 'id'), 'PS_ATTACHMENT_MAXIMUM_SIZE' => array('title' => $this->l('Maximum attachment size'), 'desc' => $this->l('Set the maximum size of attached files (in Megabytes ).') . ' ' . $this->l('Maximum:') . ' ' . ((int) str_replace('M', '', ini_get('post_max_size')) > (int) str_replace('M', '', ini_get('upload_max_filesize')) ? ini_get('upload_max_filesize') : ini_get('post_max_size')), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text', 'default' => '2'), 'PS_RECYCLABLE_PACK' => array('title' => $this->l('Offer recycled packaging'), 'desc' => $this->l('Suggest recycled packaging to customer'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_CART_FOLLOWING' => array('title' => $this->l('Save cart content and re-display it at login'), 'desc' => $this->l('Recall and display contents of shopping cart following customer login'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_PRICE_ROUND_MODE' => array('title' => $this->l('Round mode'), 'desc' => $this->l('You can choose how to round prices: always round superior; always round inferior, or classic rounding'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $round_mode, 'identifier' => 'value'), 'PRESTASTORE_LIVE' => array('title' => $this->l('Automatically check for module updates'), 'desc' => $this->l('New modules and updates are displayed on the modules page'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_HIDE_OPTIMIZATION_TIPS' => array('title' => $this->l('Hide optimization tips'), 'desc' => $this->l('Hide optimization tips on the back office homepage'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_DISPLAY_SUPPLIERS' => array('title' => $this->l('Display suppliers and manufacturers'), 'desc' => $this->l('Display manufacturers and suppliers list even if corresponding blocks are disabled'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_FORCE_SMARTY_2' => array('title' => $this->l('Use Smarty 2 instead of 3'), 'desc' => $this->l('Enable if your theme is incompatible with Smarty 3 (you should update your theme, since Smarty 2 will be unsupported from PrestaShop v1.5)'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_LIMIT_UPLOAD_FILE_VALUE' => array('title' => $this->l('Limit upload file value'), 'desc' => $this->l('Define the limit upload for a downloadable product, this value has to be inferior or equal to your server\'s maximum upload file ') . sprintf('(%s MB).', $upload_mb), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'limit', 'default' => '1'), 'PS_LIMIT_UPLOAD_IMAGE_VALUE' => array('title' => $this->l('Limit upload image value'), 'desc' => $this->l('Define the limit upload for an image, this value has to be inferior or equal to your server\'s maximum upload file ') . sprintf('(%s MB).', $upload_mb), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'limit', 'default' => '1'));
     if (function_exists('date_default_timezone_set')) {
         $this->_fieldsGeneral['PS_TIMEZONE'] = array('title' => $this->l('Time Zone:'), 'validation' => 'isAnything', 'type' => 'select', 'list' => $timezones, 'identifier' => 'name');
     }
     // No HTTPS activation if you haven't already.
     if (!Tools::usingSecureMode() && !_PS_SSL_ENABLED_) {
         $this->_fieldsGeneral['PS_SSL_ENABLED']['type'] = 'disabled';
         $this->_fieldsGeneral['PS_SSL_ENABLED']['disabled'] = '<a href="https://' . Tools::getShopDomainSsl() . Tools::safeOutput($_SERVER['REQUEST_URI']) . '">' . $this->l('Please click here to use HTTPS protocol before enabling SSL.') . '</a>';
     }
     parent::__construct();
 }
    public function displayForm()
    {
        return '
		<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('Theamer') . '</label>
				<div class="margin-form">
				     <select name="font" id="font">
				     <option value="almelo" ' . (Tools::getValue('font', Configuration::get('BLANK_FONT')) == "almelo" ? 'selected="selected" ' : '') . '>' . $this->l('Almelo') . '</option>
				     <option value="jura" ' . (Tools::getValue('font', Configuration::get('BLANK_FONT')) == "jura" ? 'selected="selected" ' : '') . '>' . $this->l('Jura') . '</option>
				     <option value="gabo" ' . (Tools::getValue('font', Configuration::get('BLANK_FONT')) == "gabo" ? 'selected="selected" ' : '') . '>' . $this->l('Gabo') . '</option>
				     <option value="economica" ' . (Tools::getValue('font', Configuration::get('BLANK_FONT')) == "economica" ? 'selected="selected" ' : '') . '>' . $this->l('Economica') . '</option>
				     <option value="ubuntu" ' . (Tools::getValue('font', Configuration::get('BLANK_FONT')) == "ubuntu" ? 'selected="selected" ' : '') . '>' . $this->l('Ubuntu') . '</option>
				     
				     </select>
				    
				</div>
					<div class="margin-form">
				     <select name="colour" id="colour">
				     <option value="white" ' . (Tools::getValue('colour', Configuration::get('BLANK_COLOUR')) == "white" ? 'selected="selected" ' : '') . '>' . $this->l('White') . '</option>
				     <option value="beige" ' . (Tools::getValue('colour', Configuration::get('BLANK_COLOUR')) == "beige" ? 'selected="selected" ' : '') . '>' . $this->l('Beige') . '</option>
				     </select>
				    
				</div>

				<center><input type="submit" name="submitTheamer" value="' . $this->l('Save') . '" class="button" /></center>
			</fieldset>
		</form>';
    }
    private function _displayForm()
    {
        $this->_html .= '
		<form method="post" action="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '">
			<fieldset>
				<legend><img src="' . $this->_path . 'logo.gif" />' . $this->l('Settings') . '</legend>
				<label>' . $this->l('Display configuration in a new page?') . '</label>
				<div class="margin-form">
					<input type="radio" name="new_page" value="1" ' . (Configuration::get('NW_CONFIRMATION_NEW_PAGE') ? 'checked="checked" ' : '') . '/>' . $this->l('yes') . '
					<input type="radio" name="new_page" value="0" ' . (!Configuration::get('NW_CONFIRMATION_NEW_PAGE') ? 'checked="checked" ' : '') . '/>' . $this->l('no') . '
				</div>
				<div class="clear"></div>
				<label>' . $this->l('Send confirmation e-mail after subscription?') . '</label>
				<div class="margin-form">
					<input type="radio" name="conf_email" value="1" ' . (Configuration::get('NW_CONFIRMATION_EMAIL') ? 'checked="checked" ' : '') . '/>' . $this->l('yes') . '
					<input type="radio" name="conf_email" value="0" ' . (!Configuration::get('NW_CONFIRMATION_EMAIL') ? 'checked="checked" ' : '') . '/>' . $this->l('no') . '
				</div>
				<div class="clear"></div>
				<label>' . $this->l('Welcome voucher code') . '</label>
				<div class="margin-form">
					<input type="text" name="voucher" value="' . Configuration::get('NW_VOUCHER_CODE') . '" />
					<p>' . $this->l('Leave blank for disabling') . '</p>
				</div>
				<div class="margin-form clear pspace"><input type="submit" name="submitUpdate" value="' . $this->l('Update') . '" class="button" /></div>
			</fieldset>
		</form>';
        return $this->_html;
    }
Example #12
0
 public function postProcess()
 {
     // Update the cart ONLY if $this->cookies are available, in order to avoid ghost carts created by bots
     if ($this->context->cookie->exists() && !$this->errors && !($this->context->customer->isLogged() && !$this->isTokenValid())) {
         if (Tools::getIsset('add') || Tools::getIsset('update')) {
             $this->processChangeProductInCart();
         } elseif (Tools::getIsset('delete')) {
             $this->processDeleteProductInCart();
         } elseif (Tools::getIsset('changeAddressDelivery')) {
             $this->processChangeProductAddressDelivery();
         } elseif (Tools::getIsset('allowSeperatedPackage')) {
             $this->processAllowSeperatedPackage();
         } elseif (Tools::getIsset('duplicate')) {
             $this->processDuplicateProduct();
         }
         // Make redirection
         if (!$this->errors && !$this->ajax) {
             $queryString = Tools::safeOutput(Tools::getValue('query', null));
             if ($queryString && !Configuration::get('PS_CART_REDIRECT')) {
                 Tools::redirect('index.php?controller=search&search=' . $queryString);
             }
             // Redirect to previous page
             if (isset($_SERVER['HTTP_REFERER'])) {
                 preg_match('!http(s?)://(.*)/(.*)!', $_SERVER['HTTP_REFERER'], $regs);
                 if (isset($regs[3]) && !Configuration::get('PS_CART_REDIRECT')) {
                     $url = preg_replace('/(\\?)+content_only=1/', '', $_SERVER['HTTP_REFERER']);
                     Tools::redirect($url);
                 }
             }
             Tools::redirect('index.php?controller=order&' . (isset($this->id_product) ? 'ipa=' . $this->id_product : ''));
         }
     } elseif (!$this->isTokenValid()) {
         Tools::redirect('index.php');
     }
 }
 public function initContent()
 {
     if ((empty($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) == 'off') && Configuration::get('PS_SSL_ENABLED')) {
         // You can uncomment these lines if you want to force https even from localhost and automatically redirect
         // header('HTTP/1.1 301 Moved Permanently');
         // header('Location: '.Tools::getShopDomainSsl(true).$_SERVER['REQUEST_URI']);
         // exit();
         $clientIsMaintenanceOrLocal = in_array(Tools::getRemoteAddr(), array_merge(array('127.0.0.1'), explode(',', Configuration::get('PS_MAINTENANCE_IP'))));
         // If ssl is enabled, https protocol is required. Exception for maintenance and local (127.0.0.1) IP
         if ($clientIsMaintenanceOrLocal) {
             $this->errors[] = Tools::displayError('SSL is activated. However, your IP is allowed to use unsecure mode (Maintenance or local IP).');
         } else {
             $warningSslMessage = Tools::displayError('SSL is activated. Please connect using the following url to log in in secure mode (https).');
             $warningSslMessage .= '<a href="https://' . Tools::safeOutput(Tools::getServerName()) . Tools::safeOutput($_SERVER['REQUEST_URI']) . '">https://' . Tools::safeOutput(Tools::getServerName()) . Tools::safeOutput($_SERVER['REQUEST_URI']) . '</a>';
             $this->context->smarty->assign(array('warningSslMessage' => $warningSslMessage));
         }
     }
     if (file_exists(_PS_ADMIN_DIR_ . '/../install') || file_exists(_PS_ADMIN_DIR_ . '/../admin')) {
         $this->context->smarty->assign(array('randomNb' => rand(100, 999), 'wrong_folder_name' => true));
     }
     // Redirect to admin panel
     if (Tools::isSubmit('redirect') && Validate::isControllerName(Tools::getValue('redirect'))) {
         $this->context->smarty->assign('redirect', Tools::getValue('redirect'));
     } else {
         $tab = new Tab((int) $this->context->employee->default_tab);
         $this->context->smarty->assign('redirect', $this->context->link->getAdminLink($tab->class_name));
     }
     if ($nb_errors = count($this->errors)) {
         $this->context->smarty->assign(array('errors' => $this->errors, 'nbErrors' => $nb_errors, 'shop_name' => Tools::safeOutput(Configuration::get('PS_SHOP_NAME')), 'disableDefaultErrorOutPut' => true));
     }
     $this->setMedia();
     $this->initHeader();
     parent::initContent();
     $this->initFooter();
 }
Example #14
0
    public function hookAdminStatsModules($params)
    {
        $totalVisits = $this->getTotalVisits();
        $totalGuests = $this->getTotalGuests();
        if (Tools::getValue('export')) {
            $this->csvExport(array('layers' => 2, 'type' => 'line', 'option' => 3));
        }
        $this->_html = '
		<fieldset class="width3"><legend><img src="../modules/' . $this->name . '/logo.gif" /> ' . $this->displayName . '</legend>
			<p><center>
				<img src="../img/admin/down.gif" />' . $this->l('A visit corresponds to an internet user coming to your shop. Until the end of their session, only one visit is counted.') . '
				' . $this->l('A visitor is an unknown person, who has not registered or logged on, surfing on your shop. A visitor can come and visit your shop many times.') . '
			</center></p>
			<div style="margin-top:20px"></div>
			<p>' . $this->l('Total visits:') . ' ' . $totalVisits . '</p>
			<p>' . $this->l('Total visitors:') . ' ' . $totalGuests . '</p>
			' . ($totalVisits ? ModuleGraph::engine(array('layers' => 2, 'type' => 'line', 'option' => 3)) . '<p><a href="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '&export=1"><img src="../img/admin/asterisk.gif" />' . $this->l('CSV Export') . '</a></p>' : '') . '
			
		</fieldset>
		<br class="clear" />
		<fieldset class="width3"><legend><img src="../img/admin/comment.gif" /> ' . $this->l('Guide') . '</legend>
				<h2>' . $this->l('Determine the interest of a visit') . '</h2>
				' . $this->l('The visitors\' evolution graph strongly resembles the visits\' graph, but provides additional information:') . '<br />
				<ul>
					<li>' . $this->l('If this is the case, congratulations, your website is well planned and pleasing.') . '</li>
					<li>' . $this->l('Otherwise, the conclusion is not so simple. The problem can be aesthetic or ergonomic, or else the offer is not sufficient. It is also possible that these visitors mistakenly came here with no particular interest for your shop; this can happen frequently when using search engines.') . '</li>
				</ul>
				' . $this->l('This information is mostly qualitative: you\'re the one that really needs to determine the interest of a one-off visit.') . '<br />
		</fieldset>';
        return $this->_html;
    }
Example #15
0
    public function hookAdminStatsModules($params)
    {
        $graphParams = array('layers' => 2, 'type' => 'line', 'option' => 3);
        $totalVisits = $this->getTotalVisits();
        $totalGuests = $this->getTotalGuests();
        if (Tools::getValue('export')) {
            $this->csvExport(array('layers' => 2, 'type' => 'line', 'option' => 3));
        }
        $this->html = '
		<div class="blocStats"><h2 class="icon-' . $this->name . '"><span></span>' . $this->displayName . '</h2>
			<p>
				<img src="../img/admin/down.gif" />' . $this->l('A visit corresponds to an internet user coming to your shop. Until the end of their session, only one visit is counted.') . '
				' . $this->l('A visitor is an unknown person, who has not registered or logged on, surfing on your shop. A visitor can come and visit your shop many times.') . '
			</p>
			<div style="margin-top:20px"></div>
			<p>' . $this->l('Total visits:') . ' <span class="totalStats">' . $totalVisits . '</span></p>
			<p>' . $this->l('Total visitors:') . ' <span class="totalStats">' . $totalGuests . '</span></p>
			' . ($totalVisits ? $this->engine($graphParams) . '<p><a class="button export-csv" href="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '&export=1"><span>' . $this->l('CSV Export') . '</span></a></p>' : '') . '
		</div>
		<br />
		<div class="blocStats"><h2 class="icon-guide"><span></span>' . $this->l('Guide') . '</h2>
				<h2>' . $this->l('Determine the interest of a visit') . '</h2>
				' . $this->l('The visitors\' evolution graph strongly resembles the visits\' graph, but provides additional information:') . '<br />
				<ul>
					<li>' . $this->l('If this is the case, congratulations, your website is well planned and pleasing.') . '</li>
					<li>' . $this->l('Otherwise, the conclusion is not so simple. The problem can be aesthetic or ergonomic, or else the offer is not sufficient. It is also possible that these visitors mistakenly came here without particular interest for your shop; this phenomenon often happens with the search engines.') . '</li>
				</ul>
				' . $this->l('This information is mostly qualitative: you have to determine the interest of a disjointed visit.') . '<br />
		</div>';
        return $this->html;
    }
    public function getContent()
    {
        $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', (int) Tools::getValue('id_cms'));
                $this->_clearCache('blockpaymentlogo.tpl');
                $html .= $this->displayConfirmation($this->l('The settings have been updated.'));
            }
        }
        $cmss = CMS::listCms($this->context->language->id);
        if (!count($cmss)) {
            $html .= $this->displayError($this->l('No CMS page is available.'));
        } else {
            $html .= '
			<form action="' . Tools::safeOutput($_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"><option value="0">(' . $this->l('Select a page') . ')</option>';
            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;
    }
Example #17
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 #18
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;
    }
    private function postProcess()
    {
        $result = false;
        if (Tools::isSubmit('submitExport') && ($action = Tools::getValue('action'))) {
            $result = $this->getCustomers();
        }
        if ($result) {
            if (!($nb = count($result))) {
                $this->html .= $this->displayError($this->l('No customers found with these filters!'));
            } elseif ($fd = @fopen(dirname(__FILE__) . '/' . strval(preg_replace('#\\.{2,}#', '.', Tools::getValue('action'))) . '_' . $this->file, 'w')) {
                $header = array('id', 'shop_name', 'gender', 'lastname', 'firstname', 'email', 'subscribed', 'subscribed_on');
                $array_to_export = array_merge(array($header), $result);
                foreach ($array_to_export as $tab) {
                    $this->myFputCsv($fd, $tab);
                }
                fclose($fd);
                $this->html .= $this->displayConfirmation(sprintf($this->l('The .CSV file has been successfully exported: %d customers found.'), $nb) . '<br />
				<a href="../modules/newsletter/' . Tools::safeOutput(strval(Tools::getValue('action'))) . '_' . $this->file . '">
				<b>' . $this->l('Download the file') . ' ' . $this->file . '</b>
				</a>
				<br />
				<ol style="margin-top: 10px;">
					<li style="color: red;">' . $this->l('WARNING: When opening this .csv file with Excel, choose UTF-8 encoding to avoid strange characters.') . '</li>
				</ol>');
            } else {
                $this->html .= $this->displayError($this->l('Error: Write access limited') . ' ' . dirname(__FILE__) . '/' . strval(Tools::getValue('action')) . '_' . $this->file . ' !');
            }
        }
    }
 public function process()
 {
     if ($id_supplier = Tools::getValue('id_supplier')) {
         $this->supplier = new Supplier((int) $id_supplier, self::$cookie->id_lang);
         if (Validate::isLoadedObject($this->supplier) and $this->supplier->active) {
             $nbProducts = $this->supplier->getProducts($id_supplier, NULL, NULL, NULL, $this->orderBy, $this->orderWay, true);
             $this->pagination((int) $nbProducts);
             self::$smarty->assign(array('nb_products' => $nbProducts, 'products' => $this->supplier->getProducts($id_supplier, (int) self::$cookie->id_lang, (int) $this->p, (int) $this->n, $this->orderBy, $this->orderWay), 'path' => $this->supplier->active ? Tools::safeOutput($this->supplier->name) : '', 'supplier' => $this->supplier));
         } else {
             header('HTTP/1.1 404 Not Found');
             header('Status: 404 Not Found');
             $this->errors[] = Tools::displayError('Supplier does not exist');
         }
     } else {
         if (Configuration::get('PS_DISPLAY_SUPPLIERS')) {
             $data = call_user_func(array('Supplier', 'getSuppliers'), true, (int) self::$cookie->id_lang, true);
             $nbProducts = count($data);
             $this->pagination($nbProducts);
             $data = call_user_func(array('Supplier', 'getSuppliers'), true, (int) self::$cookie->id_lang, true, $this->p, $this->n);
             $imgDir = _PS_MANU_IMG_DIR_;
             foreach ($data as &$item) {
                 $item['image'] = !file_exists($imgDir . '/' . $item['id_supplier'] . '-medium.jpg') ? Language::getIsoById((int) self::$cookie->id_lang) . '-default' : $item['id_supplier'];
             }
             self::$smarty->assign(array('pages_nb' => ceil($nbProducts / (int) $this->n), 'nbSuppliers' => $nbProducts, 'mediumSize' => Image::getSize('medium'), 'suppliers' => $data, 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY')));
         } else {
             self::$smarty->assign('nbSuppliers', 0);
         }
     }
 }
 public function __construct()
 {
     $this->bootstrap = true;
     $this->context = Context::getContext();
     $this->className = 'Configuration';
     $this->table = 'configuration';
     // Prevent classes which extend AdminPreferences to load useless data
     if (get_class($this) == 'AdminPreferencesController') {
         $round_mode = array(array('value' => PS_ROUND_UP, 'name' => $this->l('superior')), array('value' => PS_ROUND_DOWN, 'name' => $this->l('inferior')), array('value' => PS_ROUND_HALF, 'name' => $this->l('classical')));
         $activities1 = array(0 => $this->l('-- Please choose your main activity --'), 2 => $this->l('Animals and Pets'), 3 => $this->l('Art and Culture'), 4 => $this->l('Babies'), 5 => $this->l('Beauty and Personal Care'), 6 => $this->l('Cars'), 7 => $this->l('Computer Hardware and Software'), 8 => $this->l('Download'), 9 => $this->l('Fashion and accessories'), 10 => $this->l('Flowers, Gifts and Crafts'), 11 => $this->l('Food and beverage'), 12 => $this->l('HiFi, Photo and Video'), 13 => $this->l('Home and Garden'), 14 => $this->l('Home Appliances'), 15 => $this->l('Jewelry'), 1 => $this->l('Lingerie and Adult'), 16 => $this->l('Mobile and Telecom'), 17 => $this->l('Services'), 18 => $this->l('Shoes and accessories'), 19 => $this->l('Sport and Entertainment'), 20 => $this->l('Travel'));
         $activities2 = array();
         foreach ($activities1 as $value => $name) {
             $activities2[] = array('value' => $value, 'name' => $name);
         }
         $fields = array('PS_SSL_ENABLED' => array('title' => $this->l('Enable SSL'), 'desc' => $this->l('If your hosting provider allows SSL, you can activate SSL encryption (https://) for customer account identification and order processing.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'));
         if (Tools::getValue('PS_SSL_ENABLED', Configuration::get('PS_SSL_ENABLED'))) {
             $fields['PS_SSL_ENABLED_EVERYWHERE'] = array('title' => $this->l('Force the SSL on all the pages'), 'desc' => $this->l('Force all your store to use SSL.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0');
         }
         $fields = array_merge($fields, array('PS_TOKEN_ENABLE' => array('title' => $this->l('Increase Front Office security'), 'desc' => $this->l('Enable or disable token in the Front Office to improve PrestaShop\'s security.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0', 'visibility' => Shop::CONTEXT_ALL), 'PS_ALLOW_HTML_IFRAME' => array('title' => $this->l('Allow iframes on HTML fields'), 'desc' => $this->l('Allow iframes on text fields like product description. We recommend that you leave this option disabled.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_USE_HTMLPURIFIER' => array('title' => $this->l('Use HTMLPurifier Library'), 'desc' => $this->l('Clean the HTML content on text fields. We recommend that you leave this option enabled.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_PRICE_ROUND_MODE' => array('title' => $this->l('Round mode'), 'desc' => $this->l('You can choose how to round prices: always round up, always round down or classic rounding (up if > .5, down if < .5).'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $round_mode, 'identifier' => 'value'), 'PS_DISPLAY_SUPPLIERS' => array('title' => $this->l('Display suppliers and manufacturers'), 'desc' => $this->l('Enable suppliers and manufacturers pages on your Front Office even when their respective modules are disabled.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_DISPLAY_BEST_SELLERS' => array('title' => $this->l('Display best sellers'), 'desc' => $this->l('Enable best sellers page on your Front Office even when it\'s respective module is disabled.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_MULTISHOP_FEATURE_ACTIVE' => array('title' => $this->l('Enable Multistore'), 'desc' => $this->l('The multistore feature allows you to manage several e-shops with one Back Office. If this feature is enabled, a "Multistore" page will be available in the "Advanced Parameters" menu.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'visibility' => Shop::CONTEXT_ALL), 'PS_SHOP_ACTIVITY' => array('title' => $this->l('Main Shop Activity'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $activities2, 'identifier' => 'value')));
         // No HTTPS activation if you haven't already.
         if (!Tools::usingSecureMode() && !Configuration::get('PS_SSL_ENABLED')) {
             $fields['PS_SSL_ENABLED']['type'] = 'disabled';
             $fields['PS_SSL_ENABLED']['disabled'] = '<a class="btn btn-link" href="https://' . Tools::getShopDomainSsl() . Tools::safeOutput($_SERVER['REQUEST_URI']) . '">' . $this->l('Please click here to use HTTPS protocol before enabling SSL.') . '</a>';
         }
         $this->fields_options = array('general' => array('title' => $this->l('General'), 'icon' => 'icon-cogs', 'fields' => $fields, 'submit' => array('title' => $this->l('Save'))));
     }
     parent::__construct();
 }
 public function __construct()
 {
     $this->bootstrap = true;
     $this->className = 'Configuration';
     $this->table = 'configuration';
     parent::__construct();
     // Prevent classes which extend AdminPreferences to load useless data
     if (get_class($this) == 'AdminPreferencesController') {
         $round_mode = array(array('value' => PS_ROUND_HALF_UP, 'name' => $this->trans('Round up away from zero, when it is half way there (recommended)', array(), 'Admin.ShopParameters.Feature')), array('value' => PS_ROUND_HALF_DOWN, 'name' => $this->trans('Round down towards zero, when it is half way there', array(), 'Admin.ShopParameters.Feature')), array('value' => PS_ROUND_HALF_EVEN, 'name' => $this->trans('Round towards the next even value', array(), 'Admin.ShopParameters.Feature')), array('value' => PS_ROUND_HALF_ODD, 'name' => $this->trans('Round towards the next odd value', array(), 'Admin.ShopParameters.Feature')), array('value' => PS_ROUND_UP, 'name' => $this->trans('Round up to the nearest value', array(), 'Admin.ShopParameters.Feature')), array('value' => PS_ROUND_DOWN, 'name' => $this->trans('Round down to the nearest value', array(), 'Admin.ShopParameters.Feature')));
         $activities1 = array(0 => $this->trans('-- Please choose your main activity --', array(), 'Install'), 2 => $this->trans('Animals and Pets', array(), 'Install'), 3 => $this->trans('Art and Culture', array(), 'Install'), 4 => $this->trans('Babies', array(), 'Install'), 5 => $this->trans('Beauty and Personal Care', array(), 'Install'), 6 => $this->trans('Cars', array(), 'Install'), 7 => $this->trans('Computer Hardware and Software', array(), 'Install'), 8 => $this->trans('Download', array(), 'Install'), 9 => $this->trans('Fashion and accessories', array(), 'Install'), 10 => $this->trans('Flowers, Gifts and Crafts', array(), 'Install'), 11 => $this->trans('Food and beverage', array(), 'Install'), 12 => $this->trans('HiFi, Photo and Video', array(), 'Install'), 13 => $this->trans('Home and Garden', array(), 'Install'), 14 => $this->trans('Home Appliances', array(), 'Install'), 15 => $this->trans('Jewelry', array(), 'Install'), 1 => $this->trans('Lingerie and Adult', array(), 'Install'), 16 => $this->trans('Mobile and Telecom', array(), 'Install'), 17 => $this->trans('Services', array(), 'Install'), 18 => $this->trans('Shoes and accessories', array(), 'Install'), 19 => $this->trans('Sport and Entertainment', array(), 'Install'), 20 => $this->trans('Travel', array(), 'Install'));
         $activities2 = array();
         foreach ($activities1 as $value => $name) {
             $activities2[] = array('value' => $value, 'name' => $name);
         }
         $fields = array('PS_SSL_ENABLED' => array('title' => $this->trans('Enable SSL', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('If you own an SSL certificate for your shop\'s domain name, you can activate SSL encryption (https://) for customer account identification and order processing.', array(), 'Admin.ShopParameters.Help'), 'hint' => $this->trans('If you want to enable SSL on all the pages of your shop, activate the "Enable on all the pages" option below.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'));
         $fields['PS_SSL_ENABLED_EVERYWHERE'] = array('title' => $this->trans('Enable SSL on all pages', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('When enabled, all the pages of your shop will be SSL-secured.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0', 'disabled' => Tools::getValue('PS_SSL_ENABLED', Configuration::get('PS_SSL_ENABLED')) ? false : true);
         $fields = array_merge($fields, array('PS_TOKEN_ENABLE' => array('title' => $this->trans('Increase front office security', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('Enable or disable token in the Front Office to improve PrestaShop\'s security.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0', 'visibility' => Shop::CONTEXT_ALL), 'PS_ALLOW_HTML_IFRAME' => array('title' => $this->trans('Allow iframes on HTML fields', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('Allow iframes on text fields like product description. We recommend that you leave this option disabled.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_USE_HTMLPURIFIER' => array('title' => $this->trans('Use HTMLPurifier Library', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('Clean the HTML content on text fields. We recommend that you leave this option enabled.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0'), 'PS_PRICE_ROUND_MODE' => array('title' => $this->trans('Round mode', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('You can choose among 6 different ways of rounding prices. "Round up away from zero ..." is the recommended behavior.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $round_mode, 'identifier' => 'value'), 'PS_ROUND_TYPE' => array('title' => $this->trans('Round type', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('You can choose when to round prices: either on each item, each line or the total (of an invoice, for example).', array(), 'Admin.ShopParameters.Help'), 'cast' => 'intval', 'type' => 'select', 'list' => array(array('name' => $this->trans('Round on each item', array(), 'Admin.ShopParameters.Feature'), 'id' => Order::ROUND_ITEM), array('name' => $this->trans('Round on each line', array(), 'Admin.ShopParameters.Feature'), 'id' => Order::ROUND_LINE), array('name' => $this->trans('Round on the total', array(), 'Admin.ShopParameters.Feature'), 'id' => Order::ROUND_TOTAL)), 'identifier' => 'id'), 'PS_PRICE_DISPLAY_PRECISION' => array('title' => $this->trans('Number of decimals', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('Choose how many decimals you want to display', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isUnsignedInt', 'cast' => 'intval', 'type' => 'text', 'class' => 'fixed-width-xxl'), 'PS_DISPLAY_SUPPLIERS' => array('title' => $this->trans('Display brands and suppliers', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('Enable brands and suppliers pages on your front office even when their respective modules are disabled.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_DISPLAY_BEST_SELLERS' => array('title' => $this->trans('Display best sellers', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('Enable best sellers page on your front office even when its respective module is disabled.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'PS_MULTISHOP_FEATURE_ACTIVE' => array('title' => $this->trans('Enable Multistore', array(), 'Admin.ShopParameters.Feature'), 'desc' => $this->trans('The multistore feature allows you to manage several e-shops with one Back Office. If this feature is enabled, a "Multistore" page will be available in the "Advanced Parameters" menu.', array(), 'Admin.ShopParameters.Help'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'visibility' => Shop::CONTEXT_ALL), 'PS_SHOP_ACTIVITY' => array('title' => $this->trans('Main Shop Activity', array(), 'Admin.ShopParameters.Feature'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $activities2, 'identifier' => 'value')));
         // No HTTPS activation if you haven't already.
         if (!Tools::usingSecureMode() && !Configuration::get('PS_SSL_ENABLED')) {
             $fields['PS_SSL_ENABLED']['type'] = 'disabled';
             $fields['PS_SSL_ENABLED']['disabled'] = '<a class="btn btn-link" href="https://' . Tools::getShopDomainSsl() . Tools::safeOutput($_SERVER['REQUEST_URI']) . '">' . $this->trans('Please click here to check if your shop supports HTTPS.', array(), 'Admin.ShopParameters.Feature') . '</a>';
         }
         $this->fields_options = array('general' => array('title' => $this->trans('General', array(), 'Admin.Global'), 'icon' => 'icon-cogs', 'fields' => $fields, 'submit' => array('title' => $this->trans('Save', array(), 'Admin.Actions'))));
     }
 }
Example #23
0
    public function hookAdminStatsModules($params)
    {
        $sql = 'SELECT COUNT(o.`id_order`) as total
				FROM `' . _DB_PREFIX_ . 'orders` o
				WHERE o.`date_add` BETWEEN ' . ModuleGraph::getDateBetween() . '
					' . Shop::addSqlRestriction(Shop::SHARE_ORDER, 'o') . '
					' . ((int) Tools::getValue('id_order_state') ? 'AND (SELECT oh.id_order_state FROM `' . _DB_PREFIX_ . 'order_history` oh WHERE o.id_order = oh.id_order ORDER BY oh.date_add DESC, oh.id_order_history DESC LIMIT 1) = ' . (int) Tools::getValue('id_order_state') : '');
        $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql);
        $states = OrderState::getOrderStates($this->context->language->id);
        if (Tools::getValue('export')) {
            $this->csvExport(array('type' => 'pie', 'option' => Tools::getValue('id_order_state')));
        }
        $this->_html = '
			<div class="blocStats"><h2 class="icon-' . $this->name . '"><span></span>' . $this->displayName . '</h2>
			<form action="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '" method="post" style="float: right;">
				<select name="id_order_state">
					<option value="0"' . (!Tools::getValue('id_order_state') ? ' selected="selected"' : '') . '>' . $this->l('All') . '</option>';
        foreach ($states as $state) {
            $this->_html .= '<option value="' . $state['id_order_state'] . '"' . ($state['id_order_state'] == Tools::getValue('id_order_state') ? ' selected="selected"' : '') . '>' . $state['name'] . '</option>';
        }
        $this->_html .= '</select>
				<input type="submit" name="submitState" value="' . $this->l('Filter') . '" class="button" />
			</form>
			<p><img src="../img/admin/down.gif" />' . $this->l('This graph represents the carrier distribution for your orders. You can also limit it to orders in one state.') . '</p>
			' . ($result['total'] ? $this->engine(array('type' => 'pie', 'option' => Tools::getValue('id_order_state'))) . '<br /><br /> <a href="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '&export=1&exportType=language"><img src="../img/admin/asterisk.gif" />' . $this->l('CSV Export') . '</a>' : $this->l('No valid orders for this period.')) . '
		</div>';
        return $this->_html;
    }
Example #24
0
    public function hookAdminStatsModules($params)
    {
        $engine_params = array('id' => 'id_customer', 'title' => $this->displayName, 'columns' => $this->columns, 'defaultSortColumn' => $this->default_sort_column, 'defaultSortDirection' => $this->default_sort_direction, 'emptyMessage' => $this->empty_message, 'pagingMessage' => $this->paging_message);
        if (Tools::getValue('export')) {
            $this->csvExport($engine_params);
        }
        $this->html = '
		<div class="panel-heading">
			' . $this->displayName . '
		</div>
		<h4>' . $this->l('Guide') . '</h4>
			<div class="alert alert-warning">
				<h4>' . $this->l('Develop clients\' loyalty') . '</h4>
				<div>
					' . $this->l('Keeping a client can be more profitable than gaining a new one. That is one of the many reasons it is necessary to cultivate customer loyalty.') . ' <br />
					' . $this->l('Word of mouth is also a means for getting new, satisfied clients. A dissatisfied customer can hurt your e-reputation and obstruct future sales goals.') . '<br />
					' . $this->l('In order to achieve this goal, you can organize:') . '
					<ul>
						<li>' . $this->l('Punctual operations: commercial rewards (personalized special offers, product or service offered), non commercial rewards (priority handling of an order or a product), pecuniary rewards (bonds, discount coupons, payback).') . '</li>
						<li>' . $this->l('Sustainable operations: loyalty points or cards, which not only justify communication between merchant and client, but also offer advantages to clients (private offers, discounts).') . '</li>
					</ul>
					' . $this->l('These operations encourage clients to buy products and visit your online store more regularly.') . '
				</div>
			</div>
		' . $this->engine($engine_params) . '
		<a class="btn btn-default export-csv" href="' . Tools::safeOutput($_SERVER['REQUEST_URI'] . '&export=') . '1">
			<i class="icon-cloud-upload"></i> ' . $this->l('CSV Export') . '
		</a>';
        return $this->html;
    }
Example #25
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;
    }
    public function hookAdminStatsModules($params)
    {
        if (Module::isInstalled('blocknewsletter')) {
            $totals = $this->getTotals();
            if (Tools::getValue('export')) {
                $this->csvExport(array('type' => 'line', 'layers' => 3));
            }
            $this->_html = '
			<div class="panel-heading">
				' . $this->displayName . '
			</div>
			<div class="row row-margin-bottom">
				<div class="col-lg-12">
					<div class="col-lg-8">
						' . $this->engine(array('type' => 'line', 'layers' => 3)) . '
					</div>
					<div class="col-lg-4">
						<ul class="list-unstyled">
							<li>' . $this->l('Customer registrations:') . ' ' . (int) $totals['customers'] . '</li>
							<li>' . $this->l('Visitor registrations: ') . ' ' . (int) $totals['visitors'] . '</li>
							<li>' . $this->l('Both:') . ' ' . (int) $totals['both'] . '</li>
						</ul>
						<hr/>
						<a class="btn btn-default export-csv" href="' . Tools::safeOutput($_SERVER['REQUEST_URI'] . '&export=1') . '">
							<i class="icon-cloud-upload"></i> ' . $this->l('CSV Export') . '
						</a>
					</div>
				</div>
			</div>';
        } else {
            $this->_html = '<p>' . $this->l('The "Newsletter block" module must be installed.') . '</p>';
        }
        return $this->_html;
    }
Example #27
0
    private function _displayForm()
    {
        $this->_html .= '
        <form method="post" action="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '">
			<fieldset>
				<legend><img src="' . $this->_path . 'logo.png" width="16" height="16"/>' . $this->l('Settings') . '</legend> 
				
                <label>' . $this->l('Carrier') . '</label>
				<div class="margin-form">
                    <select name="STORE_DELIVERY_CARRIER">';
        foreach (Carrier::getCarriers($this->context->language->id) as $carrier) {
            $this->_html .= '<option value="' . $carrier['id_carrier'] . '"' . ($carrier['id_carrier'] == Configuration::get('STORE_DELIVERY_CARRIER') ? ' selected="selected"' : '') . '>' . $carrier['name'] . '</option>';
        }
        $this->_html .= '</select>
                    <p class="clear">' . $this->l('Choose here a carrier used for the delivery in store') . '</p>
                </div>
				<div class="clear"></div>
                
                <label>' . $this->l('Send email to store to prevent new order') . '</label>
				<div class="margin-form">
                    <input type="radio" name="STORE_DELIVERY_SEND_MAIL" id="sendmail_on" value="1" ' . (Configuration::get('STORE_DELIVERY_SEND_MAIL') == '1' ? 'checked="checked" ' : '') . '/>
					<label class="t" for="sendmail_on"><img src="../img/admin/enabled.gif" alt="' . $this->l('Enabled') . '" title="' . $this->l('Enabled') . '" /></label>
					<input type="radio" name="STORE_DELIVERY_SEND_MAIL" id="sendmail_off" value="0" ' . (Configuration::get('STORE_DELIVERY_SEND_MAIL') == '0' ? 'checked="checked" ' : '') . '/>
					<label class="t" for="sendmail_off"><img src="../img/admin/disabled.gif" alt="' . $this->l('Disabled') . '" title="' . $this->l('Disabled') . '" /></label>
					<p class="clear">' . $this->l('You must enter email address in each store admin') . '</p>
				</div>
				<div class="clear"></div>
                
                <label>' . $this->l('Display Google Map') . '</label>
				<div class="margin-form">
                    <input type="radio" name="STORE_DELIVERY_DISPLAY_MAP" id="map_on" value="1" ' . (Configuration::get('STORE_DELIVERY_DISPLAY_MAP') == '1' ? 'checked="checked" ' : '') . '/>
					<label class="t" for="map_on"><img src="../img/admin/enabled.gif" alt="' . $this->l('Enabled') . '" title="' . $this->l('Enabled') . '" /></label>
					<input type="radio" name="STORE_DELIVERY_DISPLAY_MAP" id="map_off" value="0" ' . (Configuration::get('STORE_DELIVERY_DISPLAY_MAP') == '0' ? 'checked="checked" ' : '') . '/>
					<label class="t" for="map_off"><img src="../img/admin/disabled.gif" alt="' . $this->l('Disabled') . '" title="' . $this->l('Disabled') . '" /></label>
					<p class="clear">' . $this->l("You can display a map of stores. Don't forgot to change default latitude/longitude in Store Contact page (under Preference/Store Contact admin page)") . '</p>
				</div>
				<div class="clear"></div>
                
                <label>' . $this->l('Height of Google map') . '</label>
				<div class="margin-form">
					<input type="text" name="STORE_DELIVERY_HEIGHT_MAP" value="' . Configuration::get('STORE_DELIVERY_HEIGHT_MAP') . '"/>
                        <p class="clear">' . $this->l('Height of map in px (for exemple enter "300px")') . '</p>
                </div>
				<div class="clear"></div>
                
                <label>' . $this->l('Width of Google map') . '</label>
				<div class="margin-form">
					<input type="text" name="STORE_DELIVERY_WIDTH_MAP" value="' . Configuration::get('STORE_DELIVERY_WIDTH_MAP') . '"/>
                    <p class="clear">' . $this->l('Width of map in px or % (for exemple enter "725px" or "100%"...)') . '</p>
                </div>
				<div class="clear"></div>
                
				<div class="margin-form clear pspace">
                    <input type="submit" name="submitUpdate" value="' . $this->l('Update') . '" class="button" />
                </div>
			</fieldset>
		</form>';
        return $this->_html;
    }
Example #28
0
    public function hookAdminStatsModules($params)
    {
        $this->_html = '<fieldset class="width3"><legend><img src="../modules/' . $this->name . '/logo.gif" /> ' . $this->displayName . '</legend>';
        if (sizeof(Customer::getCustomers())) {
            if (Tools::getValue('export')) {
                if (Tools::getValue('exportType') == 'gender') {
                    $this->csvExport(array('type' => 'pie', 'option' => 'gender'));
                } elseif (Tools::getValue('exportType') == 'age') {
                    $this->csvExport(array('type' => 'pie', 'option' => 'age'));
                } elseif (Tools::getValue('exportType') == 'country') {
                    $this->csvExport(array('type' => 'pie', 'option' => 'country'));
                } elseif (Tools::getValue('exportType') == 'currency') {
                    $this->csvExport(array('type' => 'pie', 'option' => 'currency'));
                } elseif (Tools::getValue('exportType') == 'language') {
                    $this->csvExport(array('type' => 'pie', 'option' => 'language'));
                }
            }
            $this->_html .= '
			
				<center><p><img src="../img/admin/down.gif" />' . $this->l('Gender distribution allows you to determine the percentage of men and women among your customers.') . '</p>
				' . ModuleGraph::engine(array('type' => 'pie', 'option' => 'gender')) . '<br /></center>
				<p><a href="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '&export=1&exportType=gender"><img src="../img/admin/asterisk.gif" />' . $this->l('CSV Export') . '</a></p>
				<br class="clear" /><br />
				<center><p><img src="../img/admin/down.gif" />' . $this->l('Age ranges allows you to determine in which age range your customers are.') . '</p>
				' . ModuleGraph::engine(array('type' => 'pie', 'option' => 'age')) . '<br /></center>
				<p><a href="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '&export=1&exportType=age"><img src="../img/admin/asterisk.gif" />' . $this->l('CSV Export') . '</a></p><br /><br />
				<center><p><img src="../img/admin/down.gif" />' . $this->l('Country distribution allows you to determine in which part of the world your customers are shopping from.') . '</p>
				' . ModuleGraph::engine(array('type' => 'pie', 'option' => 'country')) . '<br /></center>
				<p><a href="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '&export=1&exportType=country"><img src="../img/admin/asterisk.gif" />' . $this->l('CSV Export') . '</a></p><br /><br />
				<center><p><img src="../img/admin/down.gif" />' . $this->l('Currency ranges allows you to determine which currencies your customers are using.') . '</p>
				' . ModuleGraph::engine(array('type' => 'pie', 'option' => 'currency')) . '<br /></center>
				<p><a href="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '&export=1&exportType=currency"><img src="../img/admin/asterisk.gif" />' . $this->l('CSV Export') . '</a></p><br /><br />
				<center><p><img src="../img/admin/down.gif" />' . $this->l('Language distribution allows you to determine the general languages your customers are using on your shop.') . '</p>
				' . ModuleGraph::engine(array('type' => 'pie', 'option' => 'language')) . '<br /></center>
				<p><a href="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '&export=1&exportType=language"><img src="../img/admin/asterisk.gif" />' . $this->l('CSV Export') . '</a></p>
			</center>';
        } else {
            $this->_html .= '<p>' . $this->l('No customers registered yet.') . '</p>';
        }
        $this->_html .= '
		</fieldset><br />
		<fieldset class="width3"><legend><img src="../img/admin/comment.gif" /> ' . $this->l('Guide') . '</legend>
			<h2>' . $this->l('Target your audience') . '</h2>
			<p>
				' . $this->l('In order for each message to have an impact, you need to know to whom it should be addressed.') . '
				' . $this->l('Addressing the right audience is essential for choosing the right tools to win them over.') . '
				' . $this->l('It is best to limit action to a group or groups of clients.') . '
				' . $this->l('Registered customer information allows you to accurately define the typical customer profile so that you can adapt your specials to various criteria.') . '
			</p><br />
			<p>
				' . $this->l('You should use this information to increase your sales by') . '
				<ul>
					<li class="bullet">' . $this->l('launching ad campaigns addressed to specific customers who might be interested in a particular offer at specific dates and times.') . '</li>
					<li class="bullet">' . $this->l('Contacting a group of clients by e-mail / newsletter.') . '</li>
				</ul>
			</p><br />
		</fieldset>';
        return $this->_html;
    }
Example #29
0
    public function getContent()
    {
        global $cookie;
        $lang = new Language((int) $cookie->id_lang);
        if (!in_array($lang->iso_code, array('fr', 'en', 'es'))) {
            $lang->iso_code = 'en';
        }
        $output = '<p style="margin-bottom: 20px;"><img src="' . __PS_BASE_URI__ . 'modules/' . $this->name . '/logo-iadvize.gif" alt="" /></p>';
        if (Tools::isSubmit('submitiAdvize')) {
            Configuration::updateValue('IADVIZE_SID', (int) Tools::getValue('iadvize_sid'));
            Configuration::updateValue('IADVIZE_BID', (int) Tools::getValue('iadvize_bid'));
            Configuration::updateValue('IADVIZE_BUTTON', (int) Tools::getValue('iadvize_button'));
            $output .= '
			<div class="conf confirm">
				<img src="../img/admin/ok.gif" alt="" title="" />
				' . $this->l('Settings updated') . '<img src="http://www.prestashop.com/modules/iadvize.png?sid=' . urlencode(Tools::getValue('iadvize_sid')) . '" style="float:right" />
			</div>';
        }
        $output .= '
		<div style="float: left; width: 550px;">
			<p style="margin: 15px 0 30px 0; width: 540px; line-height: 18px; text-align: justify;">
				<b>' . $this->l('iAdvize is an interactive live chat') . '</b> ' . $this->l('allowing you to respond directly to your visitors and direct them towards the product that meets their needs.') . '
				<br />
				<a href="http://www.iadvize.com/offre_prestashop.html" target="_blank">' . $this->l('For more information, click here') . '</a>
			</p>
			<form action="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '" method="post">
				<fieldset class="width2">
					<legend><img src="../img/admin/cog.gif" alt="" class="middle" />' . $this->l('Settings') . '</legend>
					<label>' . $this->l('iAdvize merchant ID:') . '</label>
					<div class="margin-form">
						<input type="text" name="iadvize_sid" value="' . (int) Tools::getValue('iadvize_sid', Configuration::get('IADVIZE_SID')) . '" /> <sup>*</sup>
					</div>
					<hr size="1" style="margin-bottom: 20px;" noshade />
					<label>' . $this->l('iAdvize "Call button" ID:') . '</label>
					<div class="margin-form">
						<input type="text" name="iadvize_bid" value="' . (int) Tools::getValue('iadvize_bid', Configuration::get('IADVIZE_BID')) . '" />
						<p class="clear">' . $this->l('Leave empty if you do not want to enable this feature.') . '</p>
					</div>
					<label style="vertical-align: middle;">' . $this->l('"Call button" location:') . '</label>
					<div class="margin-form" style="margin-top: 5px;">
						<input type="radio" name="iadvize_button" value="0" style="vertical-align: middle;" /> ' . $this->l('No call button') . '&nbsp;
						<input type="radio" name="iadvize_button" value="1" style="vertical-align: middle;" /> ' . $this->l('Left column') . '&nbsp;
						<input type="radio" name="iadvize_button" value="2" style="vertical-align: middle;" /> ' . $this->l('Right column') . '
					</div>
					<hr size="1" style="margin-bottom: 20px;" noshade />
					<center><input type="submit" name="submitiAdvize" value="' . $this->l('Update settings') . '" class="button" /></center>
				</fieldset>
				<p style="font-size: 10px;"><sup>*</sup> ' . $this->l('Required fields') . '</p>
			</form>
		</div>
		<div style="float: left; margin-left: 50px; width: 200px;">
			' . (file_exists(dirname(__FILE__) . '/offer-' . $lang->iso_code . '.jpg') ? '
			<p><a href="http://www.iadvize.com/offre_prestashop.html" target="_blank"><img src="' . __PS_BASE_URI__ . 'modules/' . $this->name . '/offer-' . $lang->iso_code . '.jpg"></a></p>
			' : '') . '
		</div>
		<div class="clear"></div>';
        return $output;
    }
Example #30
0
 /**
  * Assign template vars if displaying one manufacturer
  */
 protected function assignOne()
 {
     $this->manufacturer->description = Tools::nl2br(trim($this->manufacturer->description));
     $nbProducts = $this->manufacturer->getProducts($this->manufacturer->id, null, null, null, $this->orderBy, $this->orderWay, true);
     $this->pagination((int) $nbProducts);
     $products = $this->manufacturer->getProducts($this->manufacturer->id, $this->context->language->id, (int) $this->p, (int) $this->n, $this->orderBy, $this->orderWay);
     $this->addColorsToProductList($products);
     $this->context->smarty->assign(array('nb_products' => $nbProducts, 'products' => $products, 'path' => $this->manufacturer->active ? Tools::safeOutput($this->manufacturer->name) : '', 'manufacturer' => $this->manufacturer, 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM'), 'body_classes' => array($this->php_self . '-' . $this->manufacturer->id, $this->php_self . '-' . $this->manufacturer->link_rewrite)));
 }