Add index.php file to googlemerchant XML module with redirect headers

This commit introduces a new index.php file in the googlemerchant XML module. The file contains headers to prevent caching and redirects users to the parent directory. This is part of the module's structure to ensure proper access control and user experience.
This commit is contained in:
2026-02-16 22:37:27 +01:00
parent 85dbd5041e
commit 8d14e5d95c
48 changed files with 14455 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<?php
define('_PS_ADMIN_DIR_', getcwd().'/..');
define('_PRESTA_DIR_', dirname(dirname(dirname($_SERVER['SCRIPT_FILENAME']))));
require_once(_PRESTA_DIR_ . '/config/config.inc.php');
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'x13googlemerchant.php');
if(class_exists('Context', false))
if( !Context::getContext()->employee->isLoggedBack() ) { die('Zostałeś wylogowany.'); }
if(Tools::isSubmit('data')) {
if(isset($_POST['data']['method'])) {
$id_shop = (int)$_POST['data']['data']['id_shop'];
$id_lang = (int)$_POST['data']['data']['id_lang'];
switch($_POST['data']['method']) {
case 'setGoogleName': {
$id_category = (int)$_POST['data']['data']['id_category'];
$google_name = $_POST['data']['data']['google_name'];
if(_x13googlemerchant::assignCategoryName($id_category, $id_lang, $id_shop, $google_name)) die('ok');
die('name-error');
} break;
case 'setGoogleStatus': {
parse_str($_POST['data']['data']['param'], $var_array);
$id_category = $var_array['id_category'];
$active = $_POST['data']['data']['active'];
if(_x13googlemerchant::assignCategoryStatus($id_category, $id_shop, $active)) die('ok'.$active);
die('active-error');
} break;
default : {
die('Nieprawidłowa metoda.');
}
}
}
else {
die('Brak metoday');
}
}

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>x13googlemerchant</name>
<displayName><![CDATA[Google merchant XML]]></displayName>
<version><![CDATA[1.5.10]]></version>
<description><![CDATA[Umożliwia eksport produkt&oacute;w sklepu do pliku XML dla Google Merchant Center.]]></description>
<author><![CDATA[x13.pl]]></author>
<tab><![CDATA[export]]></tab>
<is_configurable>1</is_configurable>
<need_instance>1</need_instance>
<limited_countries></limited_countries>
</module>

View File

@@ -0,0 +1,25 @@
<?php
class Helper {
protected function l($string, $class = 'AdminTab', $addslashes = false, $htmlentities = true)
{
// if the class is extended by a module, use modules/[module_name]/xx.php lang file
$currentClass = get_class($this);
if (Module::getModuleNameFromClass($currentClass))
{
$string = str_replace('\'', '\\\'', $string);
return Module::findTranslation(Module::$classInModule[$currentClass], $string, $currentClass);
}
global $_LANGADM;
if ($class == __CLASS__)
$class = 'AdminTab';
$key = md5(str_replace('\'', '\\\'', $string));
$str = (key_exists(get_class($this).$key, $_LANGADM)) ? $_LANGADM[get_class($this).$key] : ((key_exists($class.$key, $_LANGADM)) ? $_LANGADM[$class.$key] : $string);
$str = $htmlentities ? htmlentities($str, ENT_QUOTES, 'utf-8') : $str;
return str_replace('"', '&quot;', ($addslashes ? addslashes($str) : stripslashes($str)));
}
}

View File

@@ -0,0 +1,240 @@
<?php
class helperForm extends Module {
public function generateForm($fields_form) {
return $this->displayForm($fields_form);
}
public function displayForm($fields_form)
{
global $currentIndex, $cookie;
$html = '';
$allowEmployeeFormLang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0;
if ($allowEmployeeFormLang && !$cookie->employee_form_lang)
$cookie->employee_form_lang = (int)_PS_LANG_DEFAULT_;
$useLangFromCookie = false;
$this->_languages = Language::getLanguages(false);
if ($allowEmployeeFormLang)
foreach ($this->_languages as $lang)
if ($cookie->employee_form_lang == $lang['id_lang'])
$useLangFromCookie = true;
if (!$useLangFromCookie)
$this->_defaultFormLanguage = (int)(Configuration::get('PS_LANG_DEFAULT'));
else
$this->_defaultFormLanguage = (int)$cookie->employee_form_lang;
$html .= '
<script type="text/javascript">
$(document).ready(function() {
id_language = '.$this->_defaultFormLanguage.';
languages = new Array();';
foreach ($this->_languages as $k => $language)
$html .= '
languages['.$k.'] = {
id_lang: '.(int)$language['id_lang'].',
iso_code: \''.$language['iso_code'].'\',
name: \''.htmlentities($language['name'], ENT_COMPAT, 'UTF-8').'\'
};';
$html .= '
displayFlags(languages, id_language, '.$allowEmployeeFormLang.');
});
</script>';
//definiowanie pól wielojęzykowych
foreach($fields_form as $ff) {
foreach($ff['form']['input'] as $field) {
if($field['lang']) $lang_fields[] = $field['name'];
}
}
if(isset($lang_fields))
$langtags = implode('¤', $lang_fields);
else
$langtags = '';
$html .= '
<form action="'.$this->currentIndex.'&token='.$this->token.'" method="post" enctype="multipart/form-data">
<script type="text/javascript" src="../js/jquery/jquery-colorpicker.js"></script>
';
//TO_DO: hint, desc, suffix, required
foreach($fields_form as $ff) {
$html .= '
<fieldset style="width: 905px;">
<legend>'.$ff['form']['legend']['title'].'</legend>
';
if(isset($ff['form']['input'])) {
foreach($ff['form']['input'] as $field) {
$html .= '
<label'.(($field['type'] == 'hidden') ? ' style="display:none;"' : '').'>'.$field['label'].'</label>
<div class="margin-form"'.(($field['type'] == 'hidden') ? ' style="display:none;"' : '').'>
';
switch($field['type']) {
case 'hidden' : {
$html .= '
<input type="text" size="'.(!empty($field['size']) ? $field['size'] : '').'" name="'.$field['name'].'" value="'.htmlentities($this->fields_value[$field['name']], ENT_COMPAT, 'UTF-8').'" />
';
} break;
case 'radio' : {
foreach($field['values'] as $value) {
$html .= '
<input type="radio" name="'.$field['name'].'" id="'.$field['name'].'_'.$value['id'].'" value="'.$value['value'].'" '.(($this->fields_value[$field['name']] == $value['value']) ? 'checked="checked" ' : '').'/>
';
if($value['label'] == 'Enabled')
$html .= '
<label class="t" for="'.$value['id'].'"> <img src="../img/admin/enabled.gif" alt="'.$value['label'].'" title="'.$value['label'].'" /></label>
';
elseif($value['label'] == 'Disabled')
$html .= '
<label class="t" for="'.$value['id'].'"> <img src="../img/admin/disabled.gif" alt="'.$value['label'].'" title="'.$value['label'].'" /></label>
';
else
$html .= '
<label class="t" for="'.$value['id'].'">'.$value['label'].'</label>
';
}
} break;
case 'checkbox' : {
//todo in future
} break;
case 'select' : {
$html .= '<select name="'.$field['name'].'" id="'.$field['name'].'" style="width:40%">';
foreach($field['options']['query'] as $option) {
$html .= '
<option value="'.$option[$field['options']['id']].'" '.(($this->fields_value[$field['name']] == $option[$field['options']['id']]) ? ' selected="selected"' : '').'>'.$option[$field['options']['name']].'</option>
';
}
$html .= '</select>';
} break;
case 'date' : {
$date_fields[] = $field['name'];
$html .= '
<input name="'.$field['name'].'" id="'.$field['name'].'" type="text" style="text-align: center" value="'.htmlentities($this->fields_value[$field['name']], ENT_COMPAT, 'UTF-8').'"></input>
';
} break;
case 'color' : {
$html .= '
<div>
<input width="20px" type="color" data-hex="true" class="color mColorPickerInput mColorPicker" name="'.$field['name'].'" value="'.htmlentities($this->fields_value[$field['name']], ENT_COMPAT, 'UTF-8').'" />
</div>';
} break;
case 'textarea' : {
if(isset($field['class']) && strpos($field['class'], 'rte') !== false) {
$attrs = 'class="rte" cols="100" rows="10"';
}
else {
$attrs = 'class="'.(!empty($field['class']) ? $field['class'] : '').'" cols="'.(!empty($field['cols']) ? (int)$field['cols'] : 94).'" rows="'.(!empty($field['rows']) ? (int)$field['rows'] : 10).'"';
}
if($field['lang']) {
$html .= '<div class="translatable">';
foreach ($this->_languages as $language) {
$html .= '
<div style="display: '.($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none').'; float: left;">
<textarea '.$attrs.' id="'.$field['name'].'_'.$language['id_lang'].'" name="'.$field['name'].'_'.$language['id_lang'].'">'.htmlentities($this->fields_value[$field['name']][$language['id_lang']], ENT_COMPAT, 'UTF-8').'</textarea>
</div>
';
}
$this->displayFlags($this->_languages, $this->_defaultFormLanguage, $langtags, $field['name']);
$html .= '</div>';
$html .= '
<p class="preference_description" style="clear:both;">'.(isset($field['desc']) ? $field['desc'] : '').'</p>
';
$html .= '<div class="clear"></div>';
}
else {
$html .= '
<div>
<textarea '.$attrs.' name="'.$field['name'].'">'.htmlentities($this->fields_value[$field['name']], ENT_COMPAT, 'UTF-8').'</textarea>
</div>
';
}
} break;
default : { // text
if($field['lang']) {
foreach ($this->_languages as $language)
$html .= '
<div id="'.$field['name'].'_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none').'; float: left;">
<input size="'.(!empty($field['size']) ? (int)$field['size'] : 90).'" maxlength="'.(!empty($field['maxlength']) ? (int)$field['maxlength'] : '').'" type="text" name="'.$field['name'].'_'.$language['id_lang'].'" id="'.$field['name'].'_'.$language['id_lang'].'" value="'.htmlentities($this->fields_value[$field['name']][$language['id_lang']], ENT_COMPAT, 'UTF-8').'" />
</div>';
$this->displayFlags($this->_languages, $this->_defaultFormLanguage, $langtags, $field['name']);
$html .= '<div class="clear"></div>';
}
else {
$html .= '
<input size="'.(!empty($field['size']) ? (int)$field['size'] : 90).'" maxlength="'.(!empty($field['maxlength']) ? (int)$field['maxlength'] : '').'" type="text" name="'.$field['name'].'" id="'.$field['name'].'" value="'.htmlentities($this->fields_value[$field['name']], ENT_COMPAT, 'UTF-8').'" />
';
}
}
}
$html .= '
</div>
<div style="clear:both"></div>
';
}
}
$html .= '
<div class="margin-form">
';
if(isset($ff['form']['buttons'])) {
foreach($ff['form']['buttons'] as $button) {
$html .= '
<a class="button" style="font-size:12px;padding:4px" href="'.$button['href'].'">'.$button['title'].'</a>
';
}
}
if(isset($ff['form']['submit'])) {
$html .= '
<input type="submit" value="'.$ff['form']['submit']['title'].'" name="'.$this->submit_action.'" class="button" />
';
}
$html .= '</div>';
$html .= '
<div class="small"><sup>*</sup> '.$this->l('Required field').'</div>
</fieldset>
';
}
$html .= '
</form>
';
//dołączanie pickera do daty
if(isset($date_fields)) {
include_once('functions.php');
includeDatepicker($date_fields, true);
}
//dołączanie edytora TinyMCE
$iso = Language::getIsoById((int)($cookie->id_lang));
$isoTinyMCE = (file_exists(_PS_ROOT_DIR_.'/js/tiny_mce/langs/'.$iso.'.js') ? $iso : 'en');
$ad = dirname($_SERVER["PHP_SELF"]);
$html .= '
<script type="text/javascript">
var iso = \''.$isoTinyMCE.'\' ;
var pathCSS = \''._THEME_CSS_DIR_.'\' ;
var ad = \''.$ad.'\' ;
</script>
<script type="text/javascript" src="'.__PS_BASE_URI__.'js/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="'.__PS_BASE_URI__.'js/tinymce.inc.js"></script>
';
return $html;
}
}
?>

View File

@@ -0,0 +1,449 @@
<?php
class helperList extends Module{
public $fields_list;
public $fields_values;
private $_html = '';
public function generateList($fields_values, $fields_list) {
$this->_list = $fields_values;
$this->_listTotal = $this->listTotal;
$this->_pagination = array(5,10,20,50,100);
$this->view = isset($this->actions) && in_array('view', $this->actions);
$this->edit = isset($this->actions) && in_array('edit', $this->actions);
$this->delete = isset($this->actions) && in_array('delete', $this->actions);
$this->duplicate = isset($this->actions) && in_array('duplicate', $this->actions);
$this->fieldsDisplay = $fields_list;
$this->identifiersDnd = array();
$this->displayList();
return $this->_html;
}
public function displayTop() {
//do nothing
}
public function displayList() {
$this->displayTop();
if (isset($this->toolbar_btn)) {
$this->_html .= '<br />';
foreach($this->toolbar_btn as $toolbar_btn) {
$this->_html .= '<a href="'.$toolbar_btn['href'].'"><img src="../img/admin/add.gif" border="0" /> '.$toolbar_btn['desc'].'</a> &nbsp;&nbsp;&nbsp; ';
}
$this->_html .= '<br /><br />';
}
/* Append when we get a syntax error in SQL query */
if ($this->_list === false) {
$this->displayWarning($this->l('Bad SQL query').'<br />'.htmlspecialchars($this->_list_error));
return false;
}
/* Display list header (filtering, pagination and column names) */
$this->displayListHeader();
if (!sizeof($this->_list)) {
$this->_html .= '<tr><td class="center" colspan="'.(sizeof($this->fieldsDisplay) + 2).'">'.$this->l('No items found').'</td></tr>';
}
/* Show the content of the table */
$this->displayListContent();
/* Close list table and submit button */
$this->displayListFooter();
}
public function displayListHeader($token = null) {
global $context;
$isCms = false;
if (preg_match('/cms/Ui', $this->identifier))
$isCms = true;
$id_cat = Tools::getValue('id_'.($isCms ? 'cms_' : '').'category');
if (!isset($token) OR empty($token))
$token = $this->token;
/* Determine total page number */
//$totalPages = ceil($this->_listTotal / Tools::getValue('pagination', (isset($context->cookie->{$this->table.'_pagination'}) ? $context->cookie->{$this->table.'_pagination'} : $this->_pagination[0])));
//if (!$totalPages) $totalPages = 1;
$totalPages = 1;
$this->_html .= '<a name="'.$this->table.'">&nbsp;</a>';
$this->_html .= '<form method="post" action="'.$this->currentIndex;
if (Tools::getIsset($this->identifier))
$this->_html .= '&'.$this->identifier.'='.(int)(Tools::getValue($this->identifier));
$this->_html .= '&token='.$token;
if (Tools::getIsset($this->table.'Orderby'))
$this->_html .= '&'.$this->table.'Orderby='.urlencode($this->_orderBy).'&'.$this->table.'Orderway='.urlencode(strtolower($this->_orderWay));
$this->_html .= '#'.$this->table.'" class="form">
<input type="hidden" id="submitFilter'.$this->table.'" name="submitFilter'.$this->table.'" value="0">
<table style="width:100%;">
<tr>
<td style="vertical-align: bottom;">';
if ($this->listTotal) {
$this->_html .= '<span style="float: left;">';
/* Determine current page number */
$page = (int)(Tools::getValue('submitFilter'.$this->table));
if (!$page) $page = 1;
if ($page > 1) {
$this->_html .= '
<input type="image" src="../img/admin/list-prev2.gif" onclick="getE(\'submitFilter'.$this->table.'\').value=1"/>
&nbsp;
<input type="image" src="../img/admin/list-prev.gif" onclick="getE(\'submitFilter'.$this->table.'\').value='.($page - 1).'"/>
';
}
$this->_html .= $this->l('Page').' <b>'.$page.'</b> / '.$totalPages;
if ($page < $totalPages) {
$this->_html .= '
<input type="image" src="../img/admin/list-next.gif" onclick="getE(\'submitFilter'.$this->table.'\').value='.($page + 1).'"/>
&nbsp;
<input type="image" src="../img/admin/list-next2.gif" onclick="getE(\'submitFilter'.$this->table.'\').value='.$totalPages.'"/>
';
}
$this->_html .= '
| '.$this->l('Display').'
<select name="pagination">
';
/* Choose number of results per page */
$selectedPagination = Tools::getValue('pagination', (isset($context->cookie->{$this->table.'_pagination'}) ? $context->cookie->{$this->table.'_pagination'} : null));
foreach ($this->_pagination as $value) {
$this->_html .= '<option value="'.(int)($value).'"'.($selectedPagination == $value ? ' selected="selected"' : (($selectedPagination == null && $value == $this->_pagination[1]) ? ' selected="selected2"' : '')).'>'.(int)($value).'</option>';
}
$this->_html .= '
</select>
/ '.(int)($this->_listTotal).' '.$this->l('result(s)').'
</span>
';
}
$this->_html .='
<span style="float: right;">
<input type="submit" name="submitReset'.$this->table.'" value="'.$this->l('Reset').'" class="button" />
<input type="submit" id="submitFilterButton_'.$this->table.'" name="submitFilter" value="'.$this->l('Filter').'" class="button" />
</span>
<span class="clear"></span>
</td>
</tr>
<tr>
<td>';
/* Display column names and arrows for ordering (ASC, DESC) */
if (array_key_exists($this->identifier,$this->identifiersDnd) AND $this->_orderBy == 'position') {
$this->_html .= '
<script type="text/javascript" src="../js/jquery/jquery.tablednd_0_5.js"></script>
<script type="text/javascript">
var token = \''.($token != null ? $token : $this->token).'\';
var come_from = \''.$this->table.'\';
var alternate = \''.($this->_orderWay == 'DESC' ? '1' : '0' ).'\';
</script>
<script type="text/javascript" src="../js/admin-dnd.js"></script>
';
}
$this->_html .= '<table'.(array_key_exists($this->identifier,$this->identifiersDnd) ? ' id="'.(((int)(Tools::getValue($this->identifiersDnd[$this->identifier], 1))) ? substr($this->identifier,3,strlen($this->identifier)) : '').'"' : '' ).' class="table'.((array_key_exists($this->identifier,$this->identifiersDnd) AND ($this->_listTotal >= 2 && $this->_orderBy != 'position 'AND $this->_orderWay != 'DESC')) ? ' tableDnD' : '' ).'" cellpadding="0" cellspacing="0" style="width:100%;">
<thead>
<tr class="nodrag nodrop">
<th>';
if ($this->delete)
$this->_html .= '<input type="checkbox" name="checkme" class="noborder" onclick="checkDelBoxes(this.form, \''.$this->table.'Box[]\', this.checked)" />';
$this->_html .= '</th>';
foreach ($this->fieldsDisplay as $key => $params) {
$this->_html .= ' <th '.(isset($params['widthColumn']) ? 'style="width: '.$params['widthColumn'].'px"' : '').'>'.$params['title'];
if (!isset($params['orderby']) OR $params['orderby']) {
// Cleaning links
if (Tools::getValue($this->table.'Orderby') && Tools::getValue($this->table.'Orderway'))
$this->currentIndex = preg_replace('/&'.$this->table.'Orderby=([a-z _]*)&'.$this->table.'Orderway=([a-z]*)/i', '', $this->currentIndex);
if ($this->_listTotal >= 2) {
$this->_html .= '
<br />
<a href="'.$this->currentIndex.'&'.$this->identifier.'='.(int)$id_cat.'&'.$this->table.'Orderby='.urlencode($key).'&'.$this->table.'Orderway=desc&token='.$token.'"><img border="0" src="../img/admin/down'.((isset($this->_orderBy) && ($key == $this->_orderBy) && ($this->_orderWay == 'DESC')) ? '_d' : '').'.gif" /></a>
<a href="'.$this->currentIndex.'&'.$this->identifier.'='.(int)$id_cat.'&'.$this->table.'Orderby='.urlencode($key).'&'.$this->table.'Orderway=asc&token='.$token.'"><img border="0" src="../img/admin/up'.((isset($this->_orderBy) && ($key == $this->_orderBy) && ($this->_orderWay == 'ASC')) ? '_d' : '').'.gif" /></a>
';
}
}
$this->_html .= '</th>';
}
/* Check if object can be modified, deleted or detailed */
if ($this->edit OR $this->delete OR ($this->view AND $this->view !== 'noActionColumn'))
$this->_html .= '<th style="width: 52px">'.$this->l('Actions').'</th>';
$this->_html .= '</tr>
<tr class="nodrag nodrop" style="height: 35px;">
<td class="center">';
if ($this->delete)
$this->_html .= '--';
$this->_html .= '</td>';
/* Javascript hack in order to catch ENTER keypress event */
$keyPress = 'onkeypress="formSubmit(event, \'submitFilterButton_'.$this->table.'\');"';
/* Filters (input, select, date or bool) */
foreach ($this->fieldsDisplay as $key => $params) {
$width = (isset($params['width']) ? ' style="width: '.(int)($params['width']).'px;"' : '');
$this->_html .= '<td'.(isset($params['align']) ? ' class="'.$params['align'].'"' : '').'>';
if (!isset($params['type']))
$params['type'] = 'text';
$value = Tools::getValue($this->table.'Filter_'.(array_key_exists('filter_key', $params) ? $params['filter_key'] : $key));
if (isset($params['search']) AND !$params['search'])
{
$this->_html .= '--</td>';
continue;
}
switch ($params['type'])
{
case 'bool':
$this->_html .= '
<select name="'.$this->table.'Filter_'.$key.'">
<option value="">--</option>
<option value="1"'.($value == 1 ? ' selected="selected"' : '').'>'.$this->l('Yes').'</option>
<option value="0"'.(($value == 0 AND $value != '') ? ' selected="selected"' : '').'>'.$this->l('No').'</option>
</select>';
break;
case 'date':
case 'datetime':
if (is_string($value))
$value = unserialize($value);
if (!Validate::isCleanHtml($value[0]) OR !Validate::isCleanHtml($value[1]))
$value = '';
$name = $this->table.'Filter_'.(isset($params['filter_key']) ? $params['filter_key'] : $key);
$nameId = str_replace('!', '__', $name);
includeDatepicker(array($nameId.'_0', $nameId.'_1'));
$this->_html .= $this->l('From').' <input style="width:90%;" type="text" id="'.$nameId.'_0" name="'.$name.'[0]" value="'.(isset($value[0]) ? $value[0] : '').'"'.$width.' '.$keyPress.' /><br />
'.$this->l('To').' <input style="width:90%;" type="text" id="'.$nameId.'_1" name="'.$name.'[1]" value="'.(isset($value[1]) ? $value[1] : '').'"'.$width.' '.$keyPress.' />';
break;
case 'select':
if (isset($params['filter_key']))
{
$this->_html .= '<select onchange="$(\'#submitFilter'.$this->table.'\').focus();$(\'#submitFilter'.$this->table.'\').click();" name="'.$this->table.'Filter_'.$params['filter_key'].'" '.(isset($params['width']) ? 'style="width: '.$params['width'].'px"' : '').'>
<option value=""'.(($value == 0 AND $value != '') ? ' selected="selected"' : '').'>--</option>';
if (isset($params['select']) AND is_array($params['select']))
foreach ($params['select'] as $optionValue => $optionDisplay)
$this->_html .= '<option value="'.$optionValue.'"'.((isset($_POST[$this->table.'Filter_'.$params['filter_key']]) AND Tools::getValue($this->table.'Filter_'.$params['filter_key']) == $optionValue AND Tools::getValue($this->table.'Filter_'.$params['filter_key']) != '') ? ' selected="selected"' : '').'>'.$optionDisplay.'</option>';
$this->_html .= '</select>';
break;
}
break;
case 'text':
default:
if (!Validate::isCleanHtml($value))
$value = '';
$this->_html .= '<input style="width:90%;" type="text" name="'.$this->table.'Filter_'.(isset($params['filter_key']) ? $params['filter_key'] : $key).'" value="'.htmlentities($value, ENT_COMPAT, 'UTF-8').'"'.$width.' '.$keyPress.' />';
}
$this->_html .= '</td>';
}
if ($this->edit OR $this->delete OR ($this->view AND $this->view !== 'noActionColumn'))
$this->_html .= '<td class="center">--</td>';
$this->_html .= '</tr>
</thead>';
}
public function displayListContent($token = null) {
global $cookie;
$currency = new Currency((int)Configuration::get('PS_CURRENCY_DEFAULT'));
$id_category = 1; // default categ
$irow = 0;
if ($this->_list AND isset($this->fieldsDisplay['position']))
{
$positions = array_map(create_function('$elem', 'return (int)($elem[\'position\']);'), $this->_list);
sort($positions);
}
if ($this->_list)
{
$isCms = false;
if (preg_match('/cms/Ui', $this->identifier))
$isCms = true;
$keyToGet = 'id_'.($isCms ? 'cms_' : '').'category'.(in_array($this->identifier, array('id_category', 'id_cms_category')) ? '_parent' : '');
foreach ($this->_list as $tr)
{
$id = $tr[$this->identifier];
$this->_html .= '<tr'.(array_key_exists($this->identifier,$this->identifiersDnd) ? ' id="tr_'.(($id_category = (int)(Tools::getValue('id_'.($isCms ? 'cms_' : '').'category', '1'))) ? $id_category : '').'_'.$id.'_'.$tr['position'].'"' : '').($irow++ % 2 ? ' class="alt_row"' : '').' '.((isset($tr['color']) AND $this->colorOnBackground) ? 'style="background-color: '.$tr['color'].'"' : '').'>
<td class="center">';
if ($this->delete AND (!isset($this->_listSkipDelete) OR !in_array($id, $this->_listSkipDelete)))
$this->_html .= '<input type="checkbox" name="'.$this->table.'Box[]" value="'.$id.'" class="noborder" />';
$this->_html .= '</td>';
foreach ($this->fieldsDisplay as $key => $params)
{
$tmp = explode('!', $key);
$key = isset($tmp[1]) ? $tmp[1] : $tmp[0];
$this->_html .= '
<td '.(isset($params['position']) ? ' id="td_'.(isset($id_category) AND $id_category ? $id_category : 0).'_'.$id.'"' : '').' class="'.((!isset($this->no_link) OR !$this->no_link) ? 'pointer' : '').((isset($params['position']) AND $this->_orderBy == 'position')? ' dragHandle' : ''). (isset($params['align']) ? ' '.$params['align'] : ''). (isset($params['class']) ? ' '.$params['class'] : '').'" ';
if (!isset($params['position']) AND (!isset($this->no_link) OR !$this->no_link))
$this->_html .= ' onclick="document.location = \''.$this->currentIndex.'&'.$this->identifier.'='.$id.($this->view? '&view' : '&update').$this->table.'&token='.($token != null ? $token : $this->token).'\'">'.(isset($params['prefix']) ? $params['prefix'] : '');
else
$this->_html .= '>';
if (isset($params['active']) AND isset($tr[$key]))
$this->_displayEnableLink($token, $id, $tr[$key], $params['active'], Tools::getValue('id_category'), Tools::getValue('id_product'));
elseif (isset($params['activeVisu']) AND isset($tr[$key]))
$this->_html .= '<img src="../img/admin/'.($tr[$key] ? 'enabled.gif' : 'disabled.gif').'"
alt="'.($tr[$key] ? $this->l('Enabled') : $this->l('Disabled')).'" title="'.($tr[$key] ? $this->l('Enabled') : $this->l('Disabled')).'" />';
elseif (isset($params['position']))
{
if ($this->_orderBy == 'position' AND $this->_orderWay != 'DESC')
{
$this->_html .= '<a'.(!($tr[$key] != $positions[sizeof($positions) - 1]) ? ' style="display: none;"' : '').' href="'.$this->currentIndex.
'&'.$keyToGet.'='.(int)($id_category).'&'.$this->identifiersDnd[$this->identifier].'='.$id.'
&way=1&position='.(int)($tr['position'] + 1).'&token='.($token != null ? $token : $this->token).'">
<img src="../img/admin/'.($this->_orderWay == 'ASC' ? 'down' : 'up').'.gif"
alt="'.$this->l('Down').'" title="'.$this->l('Down').'" /></a>';
$this->_html .= '<a'.(!($tr[$key] != $positions[0]) ? ' style="display: none;"' : '').' href="'.$this->currentIndex.
'&'.$keyToGet.'='.(int)($id_category).'&'.$this->identifiersDnd[$this->identifier].'='.$id.'
&way=0&position='.(int)($tr['position'] - 1).'&token='.($token != null ? $token : $this->token).'">
<img src="../img/admin/'.($this->_orderWay == 'ASC' ? 'up' : 'down').'.gif"
alt="'.$this->l('Up').'" title="'.$this->l('Up').'" /></a>'; }
else
$this->_html .= (int)($tr[$key] + 1);
}
elseif (isset($params['image']))
{
// item_id is the product id in a product image context, else it is the image id.
$item_id = isset($params['image_id']) ? $tr[$params['image_id']] : $id;
// If it's a product image
if (isset($tr['id_image']))
{
$image = new Image((int)$tr['id_image']);
$path_to_image = _PS_IMG_DIR_.$params['image'].'/'.$image->getExistingImgPath().'.'.$this->imageType;
}else
$path_to_image = _PS_IMG_DIR_.$params['image'].'/'.$item_id.(isset($tr['id_image']) ? '-'.(int)($tr['id_image']) : '').'.'.$this->imageType;
$this->_html .= cacheImage($path_to_image, $this->table.'_mini_'.$item_id.'.'.$this->imageType, 45, $this->imageType);
}
elseif (isset($params['icon']) AND (isset($params['icon'][$tr[$key]]) OR isset($params['icon']['default'])))
$this->_html .= '<img src="../img/admin/'.(isset($params['icon'][$tr[$key]]) ? $params['icon'][$tr[$key]] : $params['icon']['default'].'" alt="'.$tr[$key]).'" title="'.$tr[$key].'" />';
elseif (isset($params['price']))
$this->_html .= Tools::displayPrice($tr[$key], (isset($params['currency']) ? Currency::getCurrencyInstance((int)($tr['id_currency'])) : $currency), false);
elseif (isset($params['float']))
$this->_html .= rtrim(rtrim($tr[$key], '0'), '.');
elseif (isset($params['type']) AND $params['type'] == 'date')
$this->_html .= $tr[$key];
//$this->_html .= Tools::displayDate($tr[$key], (int)$cookie->id_lang);
elseif (isset($params['type']) AND $params['type'] == 'datetime')
$this->_html .= Tools::displayDate($tr[$key], (int)$cookie->id_lang, true);
elseif (isset($params['type']) AND $params['type'] == 'editable') {
// google merchant fix
if ($key == 'google_name') {
$languages = Language::getLanguages();
foreach ($languages as $language) {
$fieldName = $key . '_' . $tr['id'] . '_' . $language['id_lang'];
$googleName = 'google_name_' . $language['id_lang'];
$this->_html .= '<div class="translatable-field lang-' . $language['id_lang'] . ' clearfix">';
$this->_html .= '<div class="tf tf-input">';
$this->_html .= '<input type="text" id="' . $fieldName . '" name="' . $fieldName . '" class="' . $key . '" data-lang="'.$language['id_lang'].'" value="' . (isset($tr[$googleName]) ? $tr[$googleName] : '') . '" size="' . (isset($params['size']) ? $params['size'] : '') . '">';
$this->_html .= '</div>';
$this->_html .= '<div class="tf tf-list">';
$this->_html .= '<button type="button" data-toggle="dropdown" tabindex="-1">' . $language['iso_code'] . '<span class="caret"></span></button>';
foreach ($languages as $language) {
$this->_html .= '<a href="javascript:hideOtherLanguage(' . $language['id_lang'] . ');">';
$this->_html .= '<img class="language_current pointer" src="../img/l/' . $language['id_lang'] . '.jpg" alt="' . $language['name'] . '">';
$this->_html .= '</a>';
}
$this->_html .= '</div>';
$this->_html .= '</div>';
}
}
else {
$this->_html .= '<input type="text" size="' . (isset($params['size']) ? $params['size'] : '') . '" name="'.$key.'_'.$tr['id'].'" value="'.$tr[$key].'" class="'.$key.'" />';
}
}
elseif (isset($tr[$key]))
{
$echo = ($key == 'price' ? round($tr[$key], 2) : isset($params['maxlength']) ? Tools::substr($tr[$key], 0, $params['maxlength']).'...' : $tr[$key]);
$this->_html .= isset($params['callback']) ? call_user_func_array(array($this->className, $params['callback']), array($echo, $tr)) : $echo;
}
else
$this->_html .= '--';
$this->_html .= (isset($params['suffix']) ? $params['suffix'] : '').
'</td>';
}
if ($this->edit OR $this->delete OR ($this->view AND $this->view !== 'noActionColumn')) {
$this->_html .= '<td class="center" style="white-space: nowrap;">';
if ($this->view)
$this->_displayViewLink($token, $id);
if ($this->edit)
$this->_displayEditLink($token, $id);
if ($this->delete)
$this->_displayDeleteLink($token, $id);
if ($this->duplicate)
$this->_displayDuplicate($token, $id);
$this->_html .= '</td>';
}
$this->_html .= '</tr>';
}
}
}
public function displayListFooter($token = null) {
$this->_html .= '</table>';
if ($this->delete)
$this->_html .= '<p><input type="submit" class="button" name="submitDel'.$this->table.'" value="'.$this->l('Delete selection').'" onclick="return confirm(\''.$this->l('Delete selected items?', __CLASS__, true, false).'\');" /></p>';
$this->_html .= '
</td>
</tr>
</table>
<input type="hidden" name="token" value="'.($token ? $token : $this->token).'" />
</form>
<script>
var default_language = ' . (int)Configuration::get('PS_LANG_DEFAULT') . ';
hideOtherLanguage(default_language);
</script>';
if (isset($this->_includeTab) && count($this->_includeTab))
$this->_html .= '<br /><br />';
}
protected function _displayEnableLink($token, $id, $value, $active, $id_category = null, $id_product = null) {
$this->_html .= '
<a href="'.$this->currentIndex.'&'.$this->identifier.'='.$id.'&'.$active.$this->table.
(((int)$id_category && (int)$id_product) ? '&id_category='.$id_category : '').'&token='.($token ? $token : $this->token).'">
<img src="../img/admin/'.($value ? 'enabled.gif' : 'disabled.gif').'" alt="'.($value ? $this->l('Enabled') : $this->l('Disabled')).'" title="'.($value ? $this->l('Enabled') : $this->l('Disabled')).'" />
</a>
';
}
protected function _displayDuplicate($token = null, $id) {
$_cacheLang['Duplicate'] = $this->l('Duplicate');
$duplicate = $this->currentIndex.'&'.$this->identifier.'='.$id.'&duplicate'.$this->table;
$this->_html .= '
<a class="pointer" onclick="document.location = \''.$duplicate.'&token='.($token ? $token : $this->token).'\';">
<img src="../img/admin/duplicate.png" alt="'.$_cacheLang['Duplicate'].'" title="'.$_cacheLang['Duplicate'].'" />
</a>
';
}
protected function _displayViewLink($token = null, $id) {
$_cacheLang['View'] = $this->l('View');
$this->_html .= '
<a href="'.$this->currentIndex.'&'.$this->identifier.'='.$id.'&view'.$this->table.'&token='.($token ? $token : $this->token).'">
<img src="../img/admin/details.gif" alt="'.$_cacheLang['View'].'" title="'.$_cacheLang['View'].'" />
</a>
';
}
protected function _displayEditLink($token = null, $id) {
$_cacheLang['Edit'] = $this->l('Edit');
$this->_html .= '
<a href="'.$this->currentIndex.'&'.$this->identifier.'='.$id.'&update'.$this->table.'&token='.($token ? $token : $this->token).'">
<img src="../img/admin/edit.gif" alt="" title="'.$_cacheLang['Edit'].'" />
</a>
';
}
protected function _displayDeleteLink($token = null, $id) {
$_cacheLang['Delete'] = $this->l('Delete');
$_cacheLang['DeleteItem'] = $this->l('Delete item #', __CLASS__, true, false);
$this->_html .= '
<a href="'.$this->currentIndex.'&'.$this->identifier.'='.$id.'&delete'.$this->table.'&token='.($token ? $token : $this->token).'" onclick="return confirm(\''.$_cacheLang['DeleteItem'].$id.' ?'.
(isset($this->specificConfirmDelete) ? '\r'.$this->specificConfirmDelete : '').'\');">
<img src="../img/admin/delete.gif" alt="'.$_cacheLang['Delete'].'" title="'.$_cacheLang['Delete'].'" />
</a>
';
}
}
?>

View File

@@ -0,0 +1,192 @@
<?php
class HelperOptions {
/**
* Display flags in forms for translations
*
* @param array $languages All languages available
* @param int $default_language Default language id
* @param string $ids Multilingual div ids in form
* @param string $id Current div id]
* @param bool $return define the return way : false for a display, true for a return
* @param bool $use_vars_instead_of_ids use an js vars instead of ids seperate by "¤"
*/
public function displayFlags($languages, $default_language, $ids, $id, $return = false, $use_vars_instead_of_ids = false)
{
if (count($languages) == 1) {
return false;
}
$output = '
<div class="displayed_flag">
<img src="../img/l/'.$default_language.'.jpg" class="pointer" id="language_current_'.$id.'" onclick="toggleLanguageFlags(this);" alt="" />
</div>
<div id="languages_'.$id.'" class="language_flags">
Wybierz język<br /><br />';
foreach ($languages as $language) {
if ($use_vars_instead_of_ids) {
$output .= '<img src="../img/l/'.(int)($language['id_lang']).'.jpg" class="pointer" alt="'.$language['name'].'" title="'.$language['name'].'" onclick="changeLanguage(\''.$id.'\', '.$ids.', '.$language['id_lang'].', \''.$language['iso_code'].'\');" /> ';
} else {
$output .= '<img src="../img/l/'.(int)($language['id_lang']).'.jpg" class="pointer" alt="'.$language['name'].'" title="'.$language['name'].'" onclick="changeLanguage(\''.$id.'\', \''.$ids.'\', '.$language['id_lang'].', \''.$language['iso_code'].'\');" /> ';
}
}
$output .= '</div>';
if ($return) {
return $output;
}
echo $output;
}
public function generateOptions($fields_options) {
return $this->displayOptionsList($fields_options);
}
public function displayOptionsList($fields_options) {
global $currentIndex, $cookie, $tab;
$html = '';
$this->_fieldsOptions = $fields_options;
if (!isset($this->_fieldsOptions) || !count($this->_fieldsOptions))
return false;
$defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT'));
$this->_languages = Language::getLanguages(false);
$tabAdmin = Tab::getTab((int)$cookie->id_lang, Tab::getIdFromClassName($tab));
$html .= '
<script type="text/javascript">
id_language = Number('.$defaultLanguage.');
</script>
<form action="'.$this->currentIndex.'&token='.$this->token.'" method="post">';
foreach ($this->_fieldsOptions as $key_fieldset => $fieldset) {
$html .= '<fieldset>';
$html .= (isset($fieldset['title']) ? '<legend><img src="'.(!empty($tabAdmin['module']) && file_exists($_SERVER['DOCUMENT_ROOT']._MODULE_DIR_.$tabAdmin['module'].'/'.$tabAdmin['class_name'].'.gif') ? _MODULE_DIR_.$tabAdmin['module'].'/' : '../img/t/').$tabAdmin['class_name'].'.gif" />'.$fieldset['title'].'</legend>' : '');
foreach ($fieldset['fields'] as $key => $field) {
$val = Tools::getValue($key, Configuration::get($key));
if ($field['type'] != 'textLang')
if (!Validate::isCleanHtml($val))
$val = Configuration::get($key);
$html .= '
<label>'.$field['title'].' </label>
<div class="margin-form">';
switch ($field['type']) {
case 'select':
$html .= '<select name="'.$key.'">';
foreach ($field['list'] as $value)
$html .= '<option value="'.(isset($field['cast']) ? $field['cast']($value[$field['identifier']]) : $value[$field['identifier']]).'"'.($val == $value[$field['identifier']] ? ' selected="selected"' : '').'>'.$value['name'].'</option>';
$html .= '</select>';
break;
case 'bool':
$html .= '<label class="t" for="'.$key.'_on"><img src="../img/admin/enabled.gif" alt="tak" title="tak" /></label>
<input type="radio" name="'.$key.'" id="'.$key.'_on" value="1"'.($val ? ' checked="checked"' : '').' />
<label class="t" for="'.$key.'_on"> tak </label>
<label class="t" for="'.$key.'_off"><img src="../img/admin/disabled.gif" alt="nie" title="nie" style="margin-left: 10px;" /></label>
<input type="radio" name="'.$key.'" id="'.$key.'_off" value="0" '.(!$val ? 'checked="checked"' : '').'/>
<label class="t" for="'.$key.'_off"> nie </label>';
break;
case 'radio' : {
foreach($field['choices'] as $id => $value) {
$html .= '
<input type="radio" name="'.$key.'" id="'.$key.'_'.$id.'" value="'.$id.'" '.(($val == $id) ? 'checked="checked" ' : '').'/>
';
$html .= '
<label class="t" for="'.$key.'_'.$id.'">'.$value.'</label>
';
}
} break;
case 'color' : {
$html .= '
<div>
<input width="20px" type="color" data-hex="true" class="color mColorPickerInput mColorPicker" name="'.$field['name'].'" value="'.htmlentities($val, ENT_COMPAT, 'UTF-8').'" />
</div>';
} break;
case 'textLang':
foreach ($this->_languages as $language){
$val = Tools::getValue($key.'_'.$language['id_lang'], Configuration::get($key, $language['id_lang']));
if (!Validate::isCleanHtml($val))
$val = Configuration::get($key);
$html .= '
<div id="'.$key.'_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $defaultLanguage ? 'block' : 'none').'; float: left;">
<input size="'.$field['size'].'" type="text" name="'.$key.'_'.(int)$language['id_lang'].'" value="'.$val.'" />
</div>';
}
$this->displayFlags($this->_languages, $defaultLanguage, $key, $key);
$html .= '<br style="clear:both">';
break;
case 'textareaLang':
foreach ($this->_languages as $language)
{
$val = Configuration::get($key, $language['id_lang']);
$html .= '
<div id="'.$key.'_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $defaultLanguage ? 'block' : 'none').'; float: left;">
<textarea rows="'.(int)($field['rows']).'" cols="'.(int)($field['cols']).'" name="'.$key.'_'.$language['id_lang'].'">'.str_replace('\r\n', "\n", $val).'</textarea>
</div>';
}
$this->displayFlags($this->_languages, $defaultLanguage, $key, $key);
$html .= '<br style="clear:both">';
break;
case 'textarea' :
$html .= '<textarea rows="'.(int)($field['rows']).'" cols="'.(int)($field['cols']).'" name="'.$key.'">'.str_replace('\r\n', "\n", $val).'</textarea>';
break;
case 'checkboxmultiple' :
if(isset($val))
$checked_values = explode(',', $val);
else
$checked_values = array();
foreach($field['choices'] AS $k => $v) {
$html .= '
<p class="checkbox">
<label for="'.$key.$k.'_on" style="float:none;text-align:left;">
<input type="checkbox" name="'.$key.'[]" id="'.$key.$k.'_on" value="'.$k.'"'.(in_array($k, $checked_values) ? ' checked="checked"' : '').' '.(isset($field['js'][$k]) ? $field['js'][$k] : '').'/>
'.$v.'
</label>
</p>';
}
break;
case 'text':
default:
$html .= '<input type="text" name="'.$key.'" value="'.$val.'" size="'.$field['size'].'" />'.(isset($field['suffix']) ? $field['suffix'] : '');
}
if (isset($field['required']) AND $field['required'])
$html .= ' <sup>*</sup>';
$html .= (isset($field['desc']) ? '<p>'.$field['desc'].'</p>' : '');
$html .= '</div>';
}
if(isset($fieldset['submit'])) {
$html .=
'<div class="margin-form">
<input type="hidden" value="Zapisz" name="'.$fieldset['submit']['name'].'"/>
<input type="submit" value="Zapisz" name="'.$fieldset['submit']['name'].'" class="button" />
</div>';
}
$html .= '</fieldset>';
}
$html .= '
<input type="hidden" name="token" value="'.$this->token.'" />
</form>
<br>
';
return $html;
}
}
?>

View File

@@ -0,0 +1,36 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 7233 $
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,36 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 7233 $
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,24 @@
Server restriction: kikiriki.sklep.pl,www.kikiriki.sklep.pl,*.kikiriki.sklep.pl,*.local,*.loc,*.localhost,*.test,dev.*,*.dev,*.dev.*
------ LICENSE FILE DATA -------
75W58U7TdHLH9lhndmy2ddAz24sN8vzw
3F9HPnWPqRV0pmTV1Fs9F7mkNCTYdfP/
IrnzVgdfgdbL8C7WxHjzBeYmdIbLPL5R
jlJB42+CD//ENH+qQIqVAzxlii+Et8gL
Q3BOcufUn3jAFXIweZJjfx8bkCwitC3m
mpTsx0eJuwIsZM4Z3KufHTtPqIz0rTFI
UWx0s0fwYKyPr2LBso5NtMWZFw11Aibg
lUG2t8bwLeTg6U1NEqHz1DrF1ETWVrlh
inwF8/L+Pw4GtU8+O7jEhV6+Sus4dIUe
Qit/I72PP1VJ25KMVbnPYABd1Co1tPdl
u4zXP99DcIPRzp3YwS9CM4lJDmAmGcTv
7AhJCyL7mFmUofBsAr8BqLh+i1jjd45z
DF84Is+mo6qkCfBzJW+4Nfie9xJXoN5J
ytbVR/0H22O6qGeDPvgnm3XuahqcYNv6
ntg4Yi9daIBPn/G8AQEbRTudHjpWi8+V
p575p/1DAPBUlais7NGHjTsLIP9z5TZh
NbY6bHsYSML6ICH18BqZDzwf3Negb0xM
o78LiCNwHpeMjNVFq9SX3lo40Y12rOFh
U0u4McL8VHBUVzOhV0rylPA2QaLALv/+
HytqeUmvQPDuoMLrD6VqPDHKBs7E
--------------------------------

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,36 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 7233 $
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,36 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 7233 $
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,8 @@
<?php
global $_MODULE;
$_MODULE = array();
$_MODULE['<{x13googlemerchant}prestashop>x13googlemerchant.core_c59147ee3f94b74dcdf50b2e30d2a28e'] = 'Niepoprawna licencja';
$_MODULE['<{x13googlemerchant}prestashop>x13googlemerchant.core_645a8f5e684d30d8fbd0bfe119a38e4b'] = 'Nieprawidłowa licencja lub domena';
$_MODULE['<{x13googlemerchant}prestashop>x13googlemerchant.core_2551177e854b13489a7e44c68c73efd1'] = 'Licencja wygasła';
$_MODULE['<{x13googlemerchant}prestashop>x13googlemerchant.core_40f1f1582f7b97c35280276271fbeb81'] = 'Nowa wersja modułu %s jest już dostępna! - pobierz ją z x13.pl';

View File

@@ -0,0 +1,36 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 7233 $
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,26 @@
<?php
if (!defined('_PS_VERSION_')) {
exit;
}
require_once (dirname(__FILE__) . '/../x13googlemerchant.php');
function upgrade_module_1_3_3($module)
{
$module->registerHook('displayAdminProductsExtra');
$module->registerHook('actionProductSave');
$module->registerHook('actionProductDelete');
Db::getInstance()->execute('
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'x13googlemerchant_product`(
`id_product` INT(10) UNSIGNED NOT NULL,
`id_lang` INT(10) UNSIGNED NOT NULL,
`id_shop` INT(10) UNSIGNED NOT NULL DEFAULT 0,
`custom_label` TEXT NULL,
PRIMARY KEY(`id_product`, `id_lang`, `id_shop`)
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8'
);
return true;
}

View File

@@ -0,0 +1,48 @@
<?php
if (!defined('_PS_VERSION_')) {
exit;
}
require_once (dirname(__FILE__) . '/../x13googlemerchant.php');
function upgrade_module_1_4_0($module)
{
Configuration::updateValue('X13_GOOGLEMERCHANT_USE_TAX', 1);
Configuration::updateValue('X13_GOOGLEMERCHANT_LANG_SUFFIX', 0);
Configuration::updateValue('X13_GOOGLEMERCHANT_EXPORT_CUSTOM', 0);
Configuration::updateValue('X13_GOOGLEMERCHANT_EXCLUDE_OOS', 0);
Configuration::updateValue('X13_GOOGLEMERCHANT_CRON_TOKEN', 0);
Configuration::updateValue('X13_GOOGLEMERCHANT_TOKEN', Tools::passwdGen());
Db::getInstance()->execute('
ALTER TABLE `'._DB_PREFIX_.'x13googlemerchant` DROP INDEX `id_category`;
ALTER TABLE `'._DB_PREFIX_.'x13googlemerchant`
ADD `id_shop` INT(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `id_lang`,
ADD UNIQUE INDEX (`id_category`, `id_lang`, `id_shop`);
ALTER TABLE `'._DB_PREFIX_.'x13googlemerchant_product` RENAME `'._DB_PREFIX_.'x13googlemerchant_product_lang`;
ALTER TABLE `'._DB_PREFIX_.'x13googlemerchant_product_lang`
ADD `custom_title` char(255) NULL;
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'x13googlemerchant_product`(
`id_product` INT(10) UNSIGNED NOT NULL,
`id_shop` INT(10) UNSIGNED NOT NULL DEFAULT 0,
`export` tinyint(1) unsigned NULL,
PRIMARY KEY(`id_product`, `id_shop`),
INDEX(`export`)
) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;'
);
if (version_compare(_PS_VERSION_, '1.5' , '>=')) {
Db::getInstance()->execute('
UPDATE `'._DB_PREFIX_.'x13googlemerchant`
SET `id_shop` = ' . (int)Configuration::get('PS_SHOP_DEFAULT')
);
}
return true;
}

View File

@@ -0,0 +1,14 @@
<?php
if (!defined('_PS_VERSION_')) {
exit;
}
require_once (dirname(__FILE__) . '/../x13googlemerchant.php');
function upgrade_module_1_4_3($module)
{
Configuration::updateValue('X13_GOOGLEMERCHANT_EXCLUDE_EAN', 0);
return true;
}

View File

@@ -0,0 +1,11 @@
<?php
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_5_0($module)
{
$module->registerHook('displayBackOfficeHeader');
return true;
}

View File

@@ -0,0 +1,12 @@
<?php
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_5_2($module)
{
Configuration::updateValue('X13_GOOGLEMERCHANT_ATTR_TITLE', 1);
Configuration::updateValue('X13_GOOGLEMERCHANT_ATTR_DESC', 1);
return true;
}

View File

@@ -0,0 +1,16 @@
<?php
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_5_5()
{
Configuration::updateValue('X13_GOOGLEMERCHANT_CURRENCY_URL', 1);
// fix for not set shipping handling method
if (!Configuration::get('X13_GOOGLEMERCHANT_SHIP_BEHAVIOR')) {
Configuration::updateValue('X13_GOOGLEMERCHANT_SHIP_BEHAVIOR', 1);
}
return true;
}

View File

@@ -0,0 +1,11 @@
<?php
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_5_6()
{
Configuration::updateValue('X13_GOOGLEMERCHANT_NOTAX_CURRENCIES', '');
return true;
}

View File

@@ -0,0 +1,49 @@
input.markup{
width:100px !important;
}
/* htmnet-autocomplete */
.htmnet-autocomplete {
position:absolute !important;
background:#FFF;
max-height:300px;
box-sizing:border-box;
border:1px solid #999;
border-top:1px solid #D9D9D9;
border-bottom-right-radius:3px;
border-bottom-left-radius:3px;
box-shadow:0px 8px 8px rgba(0, 0, 0, 0.25);
overflow:auto;
z-index:100;
}
.htmnet-autocomplete p{
font-size:0.8em;
margin:0;
padding:4px;
border-top:1px solid #D9D9D9;
cursor:pointer;
}
.htmnet-autocomplete p:first-child{
border:0;
}
.htmnet-autocomplete p.active{
color:#FFF;
background-color:#00AFF0;
}
.x13googlemerchant .tf {
position: relative;
float: left;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.x13googlemerchant .tf-input {
width: 80%;
}
.x13googlemerchant .tf-list {
width: 20%;
}

View File

@@ -0,0 +1,36 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 7233 $
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

View File

@@ -0,0 +1,294 @@
$(document).ready(function(){
if (typeof x13googlemerchant_bo_url !== 'undefined') {
$('#desc-module-back').attr('href', x13googlemerchant_bo_url);
}
if (!x13googlemerchant_15)
{
$('.shipment-exclude').parents('.form-group').addClass('shipment-exclude-block');
$('.country-shipping-price').parents('.form-group').addClass('country-shipping-price-block');
$('.shipment-country-include').parents('.form-group').addClass('shipment-country-include-block');
}
customTitleFormat();
$('select[name="X13_GOOGLEMERCHANT_TITLE_TYPE"]').on('change', customTitleFormat);
function customTitleFormat()
{
var $element = $('.custom_title_format');
$element.hide();
$val = $('select[name="X13_GOOGLEMERCHANT_TITLE_TYPE"]').val();
if (parseInt($val, 10) === 3) {
$element.show();
} else {
$element.hide();
}
}
addingCombinationNameToElements();
$('select[name="X13_GOOGLEMERCHANT_SKIP_ATTR"]').on('change', addingCombinationNameToElements);
function addingCombinationNameToElements()
{
var $element = $('.adding_combination_name');
$element.hide();
$val = $('select[name="X13_GOOGLEMERCHANT_SKIP_ATTR"]').val();
if (parseInt($val, 10) === 0 || parseInt($val, 10) === 2) {
$element.show();
} else {
$element.hide();
}
}
shipmentBehaviorChange($('#shipment_behavior').val());
$('#shipment_behavior').on('change', function() {
shipmentBehaviorChange($(this).val());
});
function shipmentBehaviorChange(val)
{
if (val == 1) {
$('.country-shipping-price-block').show();
$('.shipment-exclude-block').hide();
$('.shipment-country-include-block').hide();
}
else {
$('.country-shipping-price-block').hide();
$('.shipment-exclude-block').show();
$('.shipment-country-include-block').show();
}
}
$('.process-icon-downloadxml').bind('click', function(e){
e.preventDefault();
$('#x13googlemerchant-generate-form').slideToggle('fast');
});
$('.change_status a, #top_container .x13googlemerchant > tbody > tr > td.center > a').bind('click', function(e){
e.preventDefault();
var _t = $(this);
var post_obj = {
'data' : {
'method' : 'setGoogleStatus',
'data' : {
'id_shop' : x13googlemerchant_shop,
'id_lang' : x13googlemerchant_lang,
'active' : (_t.hasClass('action-disabled') || (_t.children('img').attr('src') == '../img/admin/disabled.gif')) ? 1 : 0,
'param' : _t.attr('href')
}
}
};
$.post(x13googlemerchant_path + 'ajax.php', post_obj, function(d){
if(d == 'ok1') {
_t.removeClass('action-disabled').addClass('action-enabled');
_t.blur().children('i').toggleClass('hidden');
//1.5
_t.attr('title', 'Włączone').children('img').attr('src', '../img/admin/enabled.gif');
}
else if(d == 'ok0') {
_t.removeClass('action-enabled').addClass('action-disabled');
_t.blur().children('i').toggleClass('hidden');
//1.5
_t.attr('title', 'Wyłączone').children('img').attr('src', '../img/admin/disabled.gif');
}
else {
alert(d);
}
});
});
$('.google_name').each(function(){
if($(this).val() != '') $(this).addClass('has-cat').attr('title', $(this).val());
});
$('body')
.delegate('.google_name', 'focusin', function(){
var _t = $(this);
_t.data('old', $(this).val());
var i, j = 0;
var ab = '';
var thisLang = _t.data('lang');
ab += '<div class="htmnet-autocomplete">';
for(i in google_categories[thisLang]) {
if(google_categories[thisLang][i].toLowerCase().indexOf(_t.val()) != -1) {
_ab += '<p>'+google_categories[thisLang][i]+'</p>';
if(++j > 50) break;
}
}
ab += '</div>';
;
var _ab = $(ab);
_ab.width(_t.outerWidth()-2).insertAfter(_t).hide();
})
.delegate('.google_name', 'blur', function(){
var _t = $(this);
setTimeout(function(){
if(!_t.hasClass('has-cat'))
_t.val('');
if(_t.data('old') != _t.val()) {
var post_obj = {
'data' : {
'method' : 'setGoogleName',
'data' : {
'id_shop' : x13googlemerchant_shop,
'id_lang' : _t.data('lang'),
'id_category' : _t.attr('name').replace('google_name_row_', ''),
'google_name' : _t.val()
}
}
};
if(_t.attr('id') != 'mass_taxonomy') {
$.post(x13googlemerchant_path + 'ajax.php', post_obj, function(d){
if(d != 'ok') {
alert(d);
}
});
}
}
_t.siblings('.htmnet-autocomplete').remove();
}, 500);
})
.delegate('.google_name', 'keydown', function(e){
if(e.which == 13) e.preventDefault();
})
.delegate('.google_name', 'keyup', function(e){
var _t = $(this);
var thisLang = _t.data('lang');
var _ab = $(this).siblings('.htmnet-autocomplete');
var ab_height = _ab.height();
switch(e.which) {
case 13 : { //enter
e.preventDefault();
if(_ab.find('.active').length > 0) {
var text = _ab.find('.active').text();
_t.addClass('has-cat').val(text).attr('title', text);
_ab.hide();
}
} break;
/*
case 27 : { //esc
if(!_t.hasClass('has-cat'))
_t.val('');
_ab.hide();
} break;
*/
case 38 : { //up
if(_ab.find('.active').length > 0)
_ab.find('.active').removeClass('active').prev('p').addClass('active');
else
_ab.find('p').last().addClass('active');
var pos = _ab.find('.active').position();
if(pos)
_ab.scrollTop(pos.top + _ab.scrollTop());
else
_ab.scrollTop(0);
} break;
case 40 : { //down
if(_ab.find('.active').length > 0)
_ab.find('.active').removeClass('active').next('p').addClass('active');
else
_ab.find('p').first().addClass('active');
var pos = _ab.find('.active').position();
if(pos)
_ab.scrollTop(pos.top + _ab.scrollTop());
else
_ab.scrollTop(0);
} break;
default : {
if(_t.val() != _t.data('old')) _t.removeClass('has-cat');
var _p = '';
var i, j = 0;
for(i in google_categories[thisLang]) {
if(google_categories[thisLang][i].search(new RegExp(_t.val(), "i")) != -1) {
_p += '<p>'+google_categories[thisLang][i]+'</p>';
if(++j > 50) break;
}
}
if(_p != '')
_ab.empty().html(_p).show();
else
_ab.hide();
}
}
});
$('body')
.delegate('.htmnet-autocomplete p', 'mouseenter', function(){
$(this).addClass('active').siblings('active').removeClass('active');
})
.delegate('.htmnet-autocomplete p', 'mouseleave', function(){
$(this).removeClass('active').siblings('active').removeClass('active');
})
.delegate('.htmnet-autocomplete p', 'click', function(e){
e.preventDefault();
var text = $(this).text();
$(this).parent().siblings('.google_name').addClass('has-cat').val(text).attr('title', text);
$(this).parent().remove();
});
if($('.setMassTaxonomy').length > 0) {
var mass_quantity_trigger = $('.setMassTaxonomy').parent();
}
else if($('[name="submitBulksetMassTaxonomyx13googlemerchant"]').length > 0) {
var mass_quantity_trigger = $('[name="submitBulksetMassTaxonomyx13googlemerchant"]');
}
else {
var mass_quantity_trigger = false;
}
if(mass_quantity_trigger) {
mass_quantity_trigger.removeAttr('onclick');
mass_quantity_trigger.bind('click', function(e){
e.preventDefault();
var ids = '0';
$('[name="x13googlemerchantBox\[]\"]:checked').each(function(){
ids += ',' + $(this).val();
});
var langOptions = '';
x13languages.forEach(function(el, i) {
langOptions += '<option value="'+el.id_lang+'" '+ (el.id_lang == x13googlemerchant_lang ? 'selected="selected"' : '') +'>'+el.name+'</option>';
});
var content =
'<form action="'+$(this).closest('form').attr('action')+'" method="post">'+
'<input type="hidden" name="masstaxonomyx13pdfoffer_product" value="">'+
'<input type="hidden" name="ids" value="' + ids + '">'+
'<div class="bootstrap">'+
'<div class="row clearfix" style="margin:0 0 5px 0">'+
'<label for="mass_language" style="padding-top:4px">Wybierz język:</label>'+
'<select id="mass_language" name="mass_language" onchange="javascript:changeMassLanguage(this.value)">'+
langOptions +
'</select>'+
'</div>'+
'<div class="row clearfix" style="margin:0 0 5px 0">'+
'<label for="mass_taxonomy" style="padding-top:4px">Wybierz kategorię:</label>'+
'<div>'+
'<input autocomplete="off" type="text" name="mass_taxonomy" id="mass_taxonomy" class="google_name" data-lang="'+x13googlemerchant_lang+'">'+
'</div>'+
'</div><hr>'+
'<div class="row clearfix" style="margin:0 0 5px 0">'+
'<button type="submit" class="btn btn-default">Zastosuj</button>'+
'</div>'+
'</div>'+
'</form>'
;
$.fancybox(content, {'autoDimensions': false, 'autoSize': false, 'width': 500, 'height': '370px', 'openEffect': 'fadeIn', 'closeEffect': 'fadeOut'} );
});
}
});
function changeMassLanguage(id)
{
$('.fancybox-overlay input#mass_taxonomy').data('lang', parseInt(id)).attr('data-lang', parseInt(id));
}
if (typeof hideOtherLanguage === 'undefined') {
function hideOtherLanguage(id)
{
$('.translatable-field').hide();
$('.lang-' + id).show();
}
}

View File

@@ -0,0 +1,39 @@
{extends file="helpers/list/list_content.tpl"}
{block name="td_content"}
{if isset($params.type) && $params.type == 'editable' && isset($tr.id)}
{foreach from=$languages item=language}
<div class="translatable-field lang-{$language.id_lang} clearfix">
<div class="tf tf-input">
{assign var='google_name_key' value="google_name_{$language.id_lang}"}
<input autocomplete="off" type="text" id="{$key}_{$tr.id}_{$language.id_lang}" name="{$key}_{$tr.id}_{$language.id_lang}" class="{$key}" data-lang="{$language.id_lang}" value="{if isset($tr.$google_name_key)}{$tr.$google_name_key|escape:'html':'UTF-8'}{else}{/if}">
</div>
<div class="tf tf-list">
<button type="button" class="{if !version_compare($smarty.const._PS_VERSION_, '1.6.0.0', '<')}btn btn-default dropdown-toggle{/if}" data-toggle="dropdown" tabindex="-1">
{$language.iso_code}
<span class="caret"></span>
</button>
{if version_compare($smarty.const._PS_VERSION_, '1.6.0.0', '<')}
{foreach from=$languages item=language}
<a href="javascript:hideOtherLanguage({$language.id_lang});">
<img class="language_current pointer" src="../img/l/{$language.id_lang}.jpg" alt="{$language.name}">
</a>
{/foreach}
{else}
<ul class="dropdown-menu">
{foreach from=$languages item=language}
<li>
<a href="javascript:hideOtherLanguage({$language.id_lang});">{$language.name}</a>
</li>
{/foreach}
</ul>
{/if}
</div>
</div>
{/foreach}
{else}
{$smarty.block.parent}
{/if}
{/block}

View File

@@ -0,0 +1,8 @@
{extends file="helpers/list/list_footer.tpl"}
{block name="after"}
<script>
var default_language = '{$default_language}';
hideOtherLanguage(default_language);
</script>
{/block}

View File

@@ -0,0 +1,596 @@
{*
* 2007-2015 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2015 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<div class="leadin">{block name="leadin"}{/block}</div>
<script type="text/javascript">
id_language = Number({$current_id_lang});
{if isset($tabs) && $tabs|count}
var helper_tabs= {$tabs|json_encode};
var unique_field_id = '{$table}_';
{/if}
</script>
{block name="defaultOptions"}
{if $is_bootstrap}
{if isset($table_bk) && $table_bk == $table}{capture name='table_count'}{counter name='table_count'}{/capture}{/if}
{assign var='table_bk' value=$table scope='parent'}
<form action="{$current|escape:'html':'UTF-8'}&amp;token={$token|escape:'html':'UTF-8'}" id="{if $table == null}configuration_form{else}{$table}_form{/if}{if isset($smarty.capture.table_count) && $smarty.capture.table_count}_{$smarty.capture.table_count|intval}{/if}" method="post" enctype="multipart/form-data" class="form-horizontal">
{foreach $option_list AS $category => $categoryData}
{if isset($categoryData['top'])}{$categoryData['top']}{/if}
<div class="panel {if isset($categoryData['class'])}{$categoryData['class']}{/if}" id="{$table}_fieldset_{$category}">
{* Options category title *}
<div class="panel-heading">
<i class="{if isset($categoryData['icon'])}{$categoryData['icon']}{else}icon-cogs{/if}"></i>
{if isset($categoryData['title'])}{$categoryData['title']}{else}{l s='Options'}{/if}
</div>
{* Category description *}
{if (isset($categoryData['description']) && $categoryData['description'])}
<div class="alert alert-info">{$categoryData['description']}</div>
{/if}
{* Category info *}
{if (isset($categoryData['info']) && $categoryData['info'])}
<div>{$categoryData['info']}</div>
{/if}
{if !$categoryData['hide_multishop_checkbox'] && $use_multishop}
<div class="well clearfix">
<label class="control-label col-lg-3">
<i class="icon-sitemap"></i> {l s='Multistore'}
</label>
<div class="col-lg-9">
<span class="switch prestashop-switch fixed-width-lg">
{strip}
<input type="radio" name="{$table}_multishop_{$category}" id="{$table}_multishop_{$category}_on" value="1" onclick="toggleAllMultishopDefaultValue($('#{$table}_fieldset_{$category}'), true)"/>
<label for="{$table}_multishop_{$category}_on">
{l s='Yes'}
</label>
<input type="radio" name="{$table}_multishop_{$category}" id="{$table}_multishop_{$category}_off" value="0" checked="checked" onclick="toggleAllMultishopDefaultValue($('#{$table}_fieldset_{$category}'), false)"/>
<label for="{$table}_multishop_{$category}_off">
{l s='No'}
</label>
{/strip}
<a class="slide-button btn"></a>
</span>
<div class="row">
<div class="col-lg-12">
<p class="help-block">
<strong>{l s='Check / Uncheck all'}</strong><br />
{l s='You are editing this page for a specific shop or group. Click "Yes" to check all fields, "No" to uncheck all.'}<br />
{l s='If you check a field, change its value, and save, the multistore behavior will not apply to this shop (or group), for this particular parameter.'}
</p>
</div>
</div>
</div>
</div>
{/if}
<div class="form-wrapper">
{foreach $categoryData['fields'] AS $key => $field}
{if $field['type'] == 'hidden'}
<input type="hidden" name="{$key}" value="{$field['value']}" />
{else}
<div class="form-group{if isset($field.form_group_class)} {$field.form_group_class}{/if}"{if isset($tabs) && isset($field.tab)} data-tab-id="{$field.tab}"{/if}>
<div id="conf_id_{$key}"{if $field['is_invisible']} class="isInvisible"{/if}>
{block name="label"}
{if isset($field['title']) && isset($field['hint']) && $field['type'] != 'separator'}
<label class="control-label col-lg-3{if isset($field['required']) && $field['required'] && $field['type'] != 'radio'} required{/if}">
{if !$categoryData['hide_multishop_checkbox'] && $field['multishop_default'] && empty($field['no_multishop_checkbox'])}
<input type="checkbox" name="multishopOverrideOption[{$key}]" value="1"{if !$field['is_disabled']} checked="checked"{/if} onclick="toggleMultishopDefaultValue(this, '{$key}')"/>
{/if}
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title="
{if is_array($field['hint'])}
{foreach $field['hint'] as $hint}
{if is_array($hint)}
{$hint.text}
{else}
{$hint}
{/if}
{/foreach}
{else}
{$field['hint']}
{/if}
" data-html="true">
{$field['title']}
</span>
</label>
{elseif isset($field['title']) && $field['type'] != 'separator'}
<label class="control-label col-lg-3">
{if !$categoryData['hide_multishop_checkbox'] && $field['multishop_default'] && empty($field['no_multishop_checkbox'])}
<input type="checkbox" name="multishopOverrideOption[{$key}]" value="1"{if !$field['is_disabled']} checked="checked"{/if} onclick="checkMultishopDefaultValue(this, '{$key}')" />
{/if}
{$field['title']}
</label>
{/if}
{/block}
{block name="field"}
{block name="input"}
{if $field['type'] == 'select'}
<div class="col-lg-9">
{if $field['list']}
<select class="form-control fixed-width-xxl {if isset($field['class'])}{$field['class']}{/if}" name="{$key}"{if isset($field['js'])} onchange="{$field['js']}"{/if} id="{$key}" {if isset($field['size'])} size="{$field['size']}"{/if}>
{foreach $field['list'] AS $k => $option}
<option value="{$option[$field['identifier']]}"{if $field['value'] == $option[$field['identifier']]} selected="selected"{/if}>{$option['name']}</option>
{/foreach}
</select>
{else if isset($input.empty_message)}
{$input.empty_message}
{/if}
</div>
{elseif $field['type'] == 'bool'}
<div class="col-lg-9">
<span class="switch prestashop-switch fixed-width-lg">
{strip}
<input type="radio" name="{$key}" id="{$key}_on" value="1" {if $field['value']} checked="checked"{/if}{if isset($field['js']['on'])} {$field['js']['on']}{/if}{if isset($field['disabled']) && (bool)$field['disabled']} disabled="disabled"{/if}/>
<label for="{$key}_on" class="radioCheck">
{l s='Yes'}
</label>
<input type="radio" name="{$key}" id="{$key}_off" value="0" {if !$field['value']} checked="checked"{/if}{if isset($field['js']['off'])} {$field['js']['off']}{/if}{if isset($field['disabled']) && (bool)$field['disabled']} disabled="disabled"{/if}/>
<label for="{$key}_off" class="radioCheck">
{l s='No'}
</label>
{/strip}
<a class="slide-button btn"></a>
</span>
</div>
{elseif $field['type'] == 'radio'}
<div class="col-lg-9">
{foreach $field['choices'] AS $k => $v}
<p class="radio">
{strip}
<label for="{$key}_{$k}">
<input type="radio" name="{$key}" id="{$key}_{$k}" value="{$k}"{if $k == $field['value']} checked="checked"{/if}{if isset($field['js'][$k])} {$field['js'][$k]}{/if}/>
{$v}
</label>
{/strip}
</p>
{/foreach}
</div>
{elseif $field['type'] == 'checkbox'}
<div class="col-lg-9">
{foreach $field['choices'] AS $k => $v}
<p class="checkbox">
{strip}
<label class="col-lg-3" for="{$key}{$k}_on">
<input type="checkbox" name="{$key}" id="{$key}{$k}_on" value="{$k|intval}"{if $k == $field['value']} checked="checked"{/if}{if isset($field['js'][$k])} {$field['js'][$k]}{/if}/>
{$v}
</label>
{/strip}
</p>
{/foreach}
</div>
{elseif $field['type'] == 'checkboxmultiple'}
{assign var=checked_values value=explode(',', $field['value'])}
<div class="col-lg-9">
{foreach $field['choices'] AS $k => $v}
<p class="checkbox">
{strip}
<label for="{$key}{$k}_on">
<input type="checkbox" name="{$key}[]" id="{$key}{$k}_on" value="{$k}"{if in_array($k, $checked_values)} checked="checked"{/if}{if isset($field['js'][$k])} {$field['js'][$k]}{/if}/>
{$v}
</label>
{/strip}
</p>
{/foreach}
</div>
{elseif $field['type'] == 'text'}
<div class="col-lg-9">{if isset($field['suffix'])}<div class="input-group{if isset($field.class)} {$field.class}{/if}">{/if}
<input class="form-control {if isset($field['class'])}{$field['class']}{/if}" type="{$field['type']}"{if isset($field['id'])} id="{$field['id']}"{/if} size="{if isset($field['size'])}{$field['size']|intval}{else}5{/if}" name="{$key}" value="{$field['value']|escape:'html':'UTF-8'}" {if isset($field['autocomplete']) && !$field['autocomplete']}autocomplete="off"{/if}/>
{if isset($field['suffix'])}
<span class="input-group-addon">
{$field['suffix']|strval}
</span>
{/if}
{if isset($field['suffix'])}</div>{/if}
</div>
{elseif $field['type'] == 'separator'}
<label class="control-label col-lg-3 col-lg-push-3" style="text-align:left;">
<hr>
<h2>{$field['title']}</h2>
</label>
{elseif $field['type'] == 'password'}
<div class="col-lg-9">{if isset($field['suffix'])}<div class="input-group{if isset($field.class)} {$field.class}{/if}">{/if}
<input type="{$field['type']}"{if isset($field['id'])} id="{$field['id']}"{/if} size="{if isset($field['size'])}{$field['size']|intval}{else}5{/if}" name="{$key}" value=""{if isset($field['autocomplete']) && !$field['autocomplete']} autocomplete="off"{/if} />
{if isset($field['suffix'])}
<span class="input-group-addon">
{$field['suffix']|strval}
</span>
{/if}
{if isset($field['suffix'])}</div>{/if}
</div>
{elseif $field['type'] == 'textarea'}
<div class="col-lg-9">
<textarea class="textarea-autosize" name={$key} cols="{$field['cols']}" rows="{$field['rows']}">{$field['value']|escape:'html':'UTF-8'}</textarea>
</div>
{elseif $field['type'] == 'file'}
<div class="col-lg-9">
{$field['file']}
</div>
{elseif $field['type'] == 'color'}
<div class="col-lg-2">
<div class="input-group">
<input type="color" size="{$field['size']}" data-hex="true" {if isset($input.class)}class="{$field['class']}" {else}class="color mColorPickerInput"{/if} name="{$field['name']}" class="{if isset($field['class'])}{$field['class']}{/if}" value="{$field['value']|escape:'html':'UTF-8'}" />
</div>
</div>
{elseif $field['type'] == 'price'}
<div class="col-lg-9">
<div class="input-group fixed-width-lg">
<span class="input-group-addon">{$currency_left_sign}{$currency_right_sign} {l s='(tax excl.)'}</span>
<input type="text" size="{if isset($field['size'])}{$field['size']|intval}{else}5{/if}" name="{$key}" value="{$field['value']|escape:'html':'UTF-8'}" />
</div>
</div>
{elseif $field['type'] == 'textLang' || $field['type'] == 'textareaLang' || $field['type'] == 'selectLang'}
{if $field['type'] == 'textLang'}
<div class="col-lg-9">
<div class="row">
{foreach $field['languages'] AS $id_lang => $value}
{if $field['languages']|count > 1}
<div class="translatable-field lang-{$id_lang}" {if $id_lang != $current_id_lang}style="display:none;"{/if}>
<div class="col-lg-9">
{else}
<div class="col-lg-12">
{/if}
<input type="text"
name="{$key}_{$id_lang}"
value="{$value|escape:'html':'UTF-8'}"
{if isset($input.class)}class="{$input.class}"{/if}
/>
{if $field['languages']|count > 1}
</div>
<div class="col-lg-2">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
{foreach $languages as $language}
{if $language.id_lang == $id_lang}{$language.iso_code}{/if}
{/foreach}
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
{foreach $languages as $language}
<li>
<a href="javascript:hideOtherLanguage({$language.id_lang});">{$language.name}</a>
</li>
{/foreach}
</ul>
</div>
</div>
{else}
</div>
{/if}
{/foreach}
</div>
</div>
{elseif $field['type'] == 'textareaLang'}
<div class="col-lg-9">
{foreach $field['languages'] AS $id_lang => $value}
<div class="row translatable-field lang-{$id_lang}" {if $id_lang != $current_id_lang}style="display:none;"{/if}>
<div id="{$key}_{$id_lang}" class="col-lg-9" >
<textarea class="textarea-autosize" name="{$key}_{$id_lang}">{$value|replace:'\r\n':"\n"}</textarea>
</div>
<div class="col-lg-2">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
{foreach $languages as $language}
{if $language.id_lang == $id_lang}{$language.iso_code}{/if}
{/foreach}
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
{foreach $languages as $language}
<li>
<a href="javascript:hideOtherLanguage({$language.id_lang});">{$language.name}</a>
</li>
{/foreach}
</ul>
</div>
</div>
{/foreach}
<script type="text/javascript">
$(document).ready(function() {
$(".textarea-autosize").autosize();
});
</script>
</div>
{elseif $field['type'] == 'selectLang'}
{foreach $languages as $language}
<div id="{$key}_{$language.id_lang}" style="display: {if $language.id_lang == $current_id_lang}block{else}none{/if};" class="col-lg-9">
<select name="{$key}_{$language.iso_code|upper}">
{foreach $field['list'] AS $k => $v}
<option value="{if isset($v.cast)}{$v.cast[$v[$field.identifier]]}{else}{$v[$field.identifier]}{/if}"
{if $field['value'][$language.id_lang] == $v['name']} selected="selected"{/if}>
{$v['name']}
</option>
{/foreach}
</select>
</div>
{/foreach}
{/if}
{/if}
{if isset($field['desc']) && !empty($field['desc'])}
<div class="col-lg-9 col-lg-offset-3">
<div class="help-block">
{if is_array($field['desc'])}
{foreach $field['desc'] as $p}
{if is_array($p)}
<span id="{$p.id}">{$p.text}</span><br />
{else}
{$p}<br />
{/if}
{/foreach}
{else}
{$field['desc']}
{/if}
</div>
</div>
{/if}
{/block}{* end block input *}
{if $field['is_invisible']}
<div class="col-lg-9 col-lg-offset-3">
<p class="alert alert-warning row-margin-top">
{l s='You can\'t change the value of this configuration field in the context of this shop.'}
</p>
</div>
{/if}
{/block}{* end block field *}
</div>
</div>
{/if}
{/foreach}
</div><!-- /.form-wrapper -->
{if isset($categoryData['bottom'])}{$categoryData['bottom']}{/if}
{block name="footer"}
{if isset($categoryData['submit']) || isset($categoryData['buttons'])}
<div class="panel-footer">
{if isset($categoryData['submit']) && !empty($categoryData['submit'])}
<button type="{if isset($categoryData['submit']['type'])}{$categoryData['submit']['type']}{else}submit{/if}" {if isset($categoryData['submit']['id'])}id="{$categoryData['submit']['id']}"{/if} class="btn btn-default pull-right" name="{if isset($categoryData['submit']['name'])}{$categoryData['submit']['name']}{else}submitOptions{$table}{/if}"><i class="process-icon-{if isset($categoryData['submit']['imgclass'])}{$categoryData['submit']['imgclass']}{else}save{/if}"></i> {$categoryData['submit']['title']}</button>
{/if}
{if isset($categoryData['buttons'])}
{foreach from=$categoryData['buttons'] item=btn key=k}
{if isset($btn.href) && trim($btn.href) != ''}
<a href="{$btn.href|escape:'html':'UTF-8'}" {if isset($btn['id'])}id="{$btn['id']}"{/if} class="btn btn-default{if isset($btn['class'])} {$btn['class']}{/if}" {if isset($btn.js) && $btn.js} onclick="{$btn.js}"{/if}>{if isset($btn['icon'])}<i class="{$btn['icon']}" ></i> {/if}{$btn.title}</a>
{else}
<button type="{if isset($btn['type'])}{$btn['type']}{else}button{/if}" {if isset($btn['id'])}id="{$btn['id']}"{/if} class="{if isset($btn['class'])}{$btn['class']}{else}btn btn-default{/if}" name="{if isset($btn['name'])}{$btn['name']}{else}submitOptions{$table}{/if}"{if isset($btn.js) && $btn.js} onclick="{$btn.js}"{/if}>{if isset($btn['icon'])}<i class="{$btn['icon']}" ></i> {/if}{$btn.title}</button>
{/if}
{/foreach}
{/if}
</div>
{/if}
{/block}
</div>
{/foreach}
{hook h='displayAdminOptions'}
{if isset($name_controller)}
{capture name=hookName assign=hookName}display{$name_controller|ucfirst}Options{/capture}
{hook h=$hookName}
{elseif isset($smarty.get.controller)}
{capture name=hookName assign=hookName}display{$smarty.get.controller|ucfirst|htmlentities}Options{/capture}
{hook h=$hookName}
{/if}
</form>
{else}
<form action="{$current}&token={$token}"
id="{if $table == null}configuration_form{else}{$table}_form{/if}"
{if isset($categoryData['name'])} name={$categoryData['name']}{/if}
{if isset($categoryData['id'])} id={$categoryData['id']} {/if}
method="post"
enctype="multipart/form-data">
{foreach $option_list AS $category => $categoryData}
{if isset($categoryData['top'])}{$categoryData['top']}{/if}
<fieldset {if isset($categoryData['class'])}class="{$categoryData['class']}"{/if}>
{* Options category title *}
<legend>
<img src="{$categoryData['image']}"/>
{if isset($categoryData['title'])}{$categoryData['title']}{else}{l s='Options'}{/if}
</legend>
{* Category description *}
{if (isset($categoryData['description']) && $categoryData['description'])}
<div class="optionsDescription">{$categoryData['description']}</div>
{/if}
{* Category info *}
{if (isset($categoryData['info']) && $categoryData['info'])}
<p>{$categoryData['info']}</p>
{/if}
{if !$categoryData['hide_multishop_checkbox'] && $use_multishop}
<input type="checkbox" style="vertical-align: text-top" onclick="checkAllMultishopDefaultValue(this)" /> <b>{l s='Check/uncheck all'}</b> {l s='(Check boxes if you want to set a custom value for this shop or group shop context)'}
<div class="separation"></div>
{/if}
{foreach $categoryData['fields'] AS $key => $field}
{if $field['type'] == 'hidden'}
<input type="hidden" name="{$key}" value="{$field['value']}" />
{else}
<div style="clear: both; padding-top:15px;" id="conf_id_{$key}" {if $field['is_invisible']} class="isInvisible"{/if}>
{if !$categoryData['hide_multishop_checkbox'] && $field['multishop_default'] && empty($field['no_multishop_checkbox'])}
<div class="preference_default_multishop">
<input type="checkbox" name="multishopOverrideOption[{$key}]" value="1" {if !$field['is_disabled']}checked="checked"{/if} onclick="checkMultishopDefaultValue(this, '{$key}')" />
</div>
{/if}
{block name="label"}
{if isset($field['title'])}
<label class="conf_title">
{$field['title']}</label>
{/if}
{/block}
{block name="field"}
<div class="margin-form">
{block name="input"}
{if $field['type'] == 'select'}
{if $field['list']}
<select name="{$key}"{if isset($field['js'])} onchange="{$field['js']}"{/if} id="{$key}" {if isset($field['size'])} size="{$field['size']}"{/if}>
{foreach $field['list'] AS $k => $option}
<option value="{$option[$field['identifier']]}"{if $field['value'] == $option[$field['identifier']]} selected="selected"{/if}>{$option['name']}</option>
{/foreach}
</select>
{else if isset($input.empty_message)}
{$input.empty_message}
{/if}
{elseif $field['type'] == 'bool'}
<label class="t" for="{$key}_on"><img src="../img/admin/enabled.gif" alt="{l s='Yes'}" title="{l s='Yes'}" /></label>
<input type="radio" name="{$key}" id="{$key}_on" value="1" {if $field['value']} checked="checked"{/if}{if isset($field['js']['on'])} {$field['js']['on']}{/if}/>
<label class="t" for="{$key}_on"> {l s='Yes'}</label>
<label class="t" for="{$key}_off"><img src="../img/admin/disabled.gif" alt="{l s='No'}" title="{l s='No'}" style="margin-left: 10px;" /></label>
<input type="radio" name="{$key}" id="{$key}_off" value="0" {if !$field['value']} checked="checked"{/if}{if isset($field['js']['off'])} {$field['js']['off']}{/if}/>
<label class="t" for="{$key}_off"> {l s='No'}</label>
{elseif $field['type'] == 'radio'}
{foreach $field['choices'] AS $k => $v}
<input type="radio" name="{$key}" id="{$key}_{$k}" value="{$k}"{if $k == $field['value']} checked="checked"{/if}{if isset($field['js'][$k])} {$field['js'][$k]}{/if}/>
<label class="t" for="{$key}_{$k}"> {$v}</label><br />
{/foreach}
<br />
{elseif $field['type'] == 'checkbox'}
{foreach $field['choices'] AS $k => $v}
<input type="checkbox" name="{$key}" id="{$key}{$k}_on" value="{$k|intval}"{if $k == $field['value']} checked="checked"{/if}{if isset($field['js'][$k])} {$field['js'][$k]}{/if}/>
<label class="t" for="{$key}{$k}_on"> {$v}</label><br />
{/foreach}
<br />
{elseif $field['type'] == 'checkboxmultiple'}
{assign var=checked_values value=explode(',', $field['value'])}
{foreach $field['choices'] AS $k => $v}
<input type="checkbox" name="{$key}[]" id="{$key}{$k}_on" value="{$k}"{if in_array($k, $checked_values)} checked="checked"{/if}{if isset($field['js'][$k])} {$field['js'][$k]}{/if}/>
<label class="t" for="{$key}{$k}_on">{$v}</label><br />
{/foreach}
{elseif $field['type'] == 'text'}
<input type="{$field['type']}"{if isset($field['id'])} id="{$field['id']}"{/if} size="{if isset($field['size'])}{$field['size']|intval}{else}5{/if}" name="{$key}" value="{$field['value']|escape:'htmlall':'UTF-8'}" {if isset($field['autocomplete']) && !$field['autocomplete']}autocomplete="off"{/if}/>
{if isset($field['suffix'])}&nbsp;{$field['suffix']|strval}{/if}
{elseif $field['type'] == 'password'}
<input type="{$field['type']}"{if isset($field['id'])} id="{$field['id']}"{/if} size="{if isset($field['size'])}{$field['size']|intval}{else}5{/if}" name="{$key}" value="" {if isset($field['autocomplete']) && !$field['autocomplete']}autocomplete="off"{/if} />
{if isset($field['suffix'])}&nbsp;{$field['suffix']|strval}{/if}
{elseif $field['type'] == 'textarea'}
<textarea name={$key} cols="{$field['cols']}" rows="{$field['rows']}">{$field['value']|escape:'htmlall':'UTF-8'}</textarea>
{elseif $field['type'] == 'file'}
{if isset($field['thumb']) && $field['thumb']}
<img src="{$field['thumb']}" alt="{$field['title']}" title="{$field['title']}" /><br />
{/if}
<input type="file" name="{$key}" />
{elseif $field['type'] == 'color'}
<input type="color"
size="{$field['size']}"
data-hex="true"
{if isset($input.class)}class="{$field['class']}"
{else}class="color mColorPickerInput"{/if}
name="{$field['name']}"
class="{if isset($field['class'])}{$field['class']}{/if}"
value="{$field['value']|escape:'htmlall':'UTF-8'}" />
{elseif $field['type'] == 'price'}
{$currency_left_sign}<input type="text" size="{if isset($field['size'])}{$field['size']|intval}{else}5{/if}" name="{$key}" value="{$field['value']|escape:'htmlall':'UTF-8'}" />{$currency_right_sign} {l s='(tax excl.)'}
{elseif $field['type'] == 'textLang' || $field['type'] == 'textareaLang' || $field['type'] == 'selectLang'}
{if $field['type'] == 'textLang'}
{foreach $field['languages'] AS $id_lang => $value}
<div id="{$key}_{$id_lang}" style="margin-bottom:8px; display: {if $id_lang == $current_id_lang}block{else}none{/if}; float: left; vertical-align: top;">
<input type="text" size="{if isset($field['size'])}{$field['size']|intval}{else}5{/if}" name="{$key}_{$id_lang}" value="{$value|escape:'htmlall':'UTF-8'}" />
</div>
{/foreach}
{elseif $field['type'] == 'textareaLang'}
{foreach $field['languages'] AS $id_lang => $value}
<div id="{$key}_{$id_lang}" style="display: {if $id_lang == $current_id_lang}block{else}none{/if}; float: left;">
<textarea rows="{$field['rows']}" cols="{$field['cols']|intval}" name="{$key}_{$id_lang}">{$value|replace:'\r\n':"\n"}</textarea>
</div>
{/foreach}
{elseif $field['type'] == 'selectLang'}
{foreach $languages as $language}
<div id="{$key}_{$language.id_lang}" style="margin-bottom:8px; display: {if $language.id_lang == $current_id_lang}block{else}none{/if}; float: left; vertical-align: top;">
<select name="{$key}_{$language.iso_code|upper}">
{foreach $field['list'] AS $k => $v}
<option value="{if isset($v.cast)}{$v.cast[$v[$field.identifier]]}{else}{$v[$field.identifier]}{/if}"
{if $field['value'][$language.id_lang] == $v['name']} selected="selected"{/if}>
{$v['name']}
</option>
{/foreach}
</select>
</div>
{/foreach}
{/if}
{if count($languages) > 1}
<div class="displayed_flag">
<img src="../img/l/{$current_id_lang}.jpg"
class="pointer"
id="language_current_{$key}"
onclick="toggleLanguageFlags(this);" />
</div>
<div id="languages_{$key}" class="language_flags">
{l s='Choose language:'}<br /><br />
{foreach $languages as $language}
<img src="../img/l/{$language.id_lang}.jpg"
class="pointer"
alt="{$language.name}"
title="{$language.name}"
onclick="changeLanguage('{$key}', '{if isset($custom_key)}{$custom_key}{else}{$key}{/if}', {$language.id_lang}, '{$language.iso_code}');" />
{/foreach}
</div>
{/if}
<br style="clear:both">
{/if}
{if isset($field['required']) && $field['required'] && $field['type'] != 'radio'}
<sup>*</sup>
{/if}
{if isset($field['hint'])}<span class="hint" name="help_box">{$field['hint']}<span class="hint-pointer">&nbsp;</span></span>{/if}
{/block}{* end block input *}
{if isset($field['desc'])}<p class="preference_description">{$field['desc']}</p>{/if}
{if $field['is_invisible']}<p class="warn">{l s='You can\'t change the value of this configuration field in the context of this shop.'}</p>{/if}
</div>
</div>
<div class="clear"></div>
{/block}{* end block field *}
{/if}
{/foreach}
{if isset($categoryData['submit'])}
<div class="margin-form">
<input type="submit"
value="{if isset($categoryData['submit']['title'])}{$categoryData['submit']['title']}{else}{l s='Save'}{/if}"
name="{if isset($categoryData['submit']['name'])}{$categoryData['submit']['name']}{else}submitOptions{$table}{/if}"
class="{if isset($categoryData['submit']['class'])}{$categoryData['submit']['class']}{else}button{/if}"
id="{$table}_form_submit_btn"
/>
</div>
{/if}
{if isset($categoryData['required_fields']) && $categoryData['required_fields']}
<div class="small"><sup>*</sup> {l s='Required field'}</div>
{/if}
{if isset($categoryData['bottom'])}{$categoryData['bottom']}{/if}
</fieldset><br />
{/foreach}
{hook h='displayAdminOptions'}
{if isset($name_controller)}
{capture name=hookName assign=hookName}display{$name_controller|ucfirst}Options{/capture}
{hook h=$hookName}
{elseif isset($smarty.get.controller)}
{capture name=hookName assign=hookName}display{$smarty.get.controller|ucfirst|htmlentities}Options{/capture}
{hook h=$hookName}
{/if}
</form>
{/if}
{/block}
{block name="after"}{/block}

View File

@@ -0,0 +1,5 @@
{if version_compare($smarty.const._PS_VERSION_, '1.6.0.0', '<')}
{include file="./tab_15.tpl"}
{else}
{include file="./tab_16.tpl"}
{/if}

View File

@@ -0,0 +1,81 @@
<h4>{l s='Google merchant XML' mod='x13googlemerchant'}</h4>
<div class="separation"></div>
<input type="hidden" name="x13googlemerchant_product_extra" value="1">
<table cellpadding="5" style="width:100%">
<tbody>
<tr>
<td>
<table style="margin-top: 15px;">
<tbody>
<tr>
<td class="col-left"><label>{l s='Nazwa produktu' mod='x13googlemerchant'}</label></td>
<td style="padding-bottom:5px;" class="translatable">
{foreach from=$languages item=language}
<div class="lang_{$language.id_lang}" style="{if $language.id_lang != $default_language}display: none;{/if} float: left;">
<input type="text" id="custom_title_{$language.id_lang}" name="custom_title[{$language.id_lang}]" value="{if isset($custom_title[$language.id_lang])}{$custom_title[$language.id_lang]}{/if}">
</div>
{/foreach}
</td>
</tr>
<tr>
<td class="col-left"></td>
<td style="padding-bottom:5px;">
<p class="preference_description">
{l s='{product_name} - Nazwa produktu' mod='x13googlemerchant'}<br />
{l s='{product_name_attribute} - Nazwa atrybutu' mod='x13googlemerchant'}<br /><br />
{l s='Pozostawiając te pole puste zostanie ustawiona domyślna nazwa produktu' mod='x13googlemerchant'}
</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table style="margin-top: 15px;">
<tbody>
<tr>
<td class="col-left"><label>{l s='Eksportuj' mod='x13googlemerchant'}</label></td>
<td style="padding-bottom:5px;">
<label class="t" for="custom_export_on"><img src="../img/admin/enabled.gif" alt="{l s='Yes'}" title="{l s='Yes'}" /></label>
<input type="radio" name="custom_export" id="custom_export_on" value="1" {if $custom_export}checked="checked"{/if} {if !$is_custom_export}disabled="disabled"{/if} />
<label class="t" for="custom_export_off"><img src="../img/admin/disabled.gif" alt="{l s='No'}" title="{l s='No'}" /></label>
<input type="radio" name="custom_export" id="custom_export_off" value="0" {if !$custom_export}checked="checked"{/if} {if !$is_custom_export}disabled="disabled"{/if} />
<p class="preference_description">{l s='Jeśli opcja jest nieaktywna, wysłane będą wszystkie produkty - jeśli chcesz wybrać konkretny produkt - zmień to w konfiguracji modułu' mod='x13googlemerchant'}</p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table style="margin-top: 15px;">
<tbody>
{for $i = 0 to 4}
<tr>
<td class="col-left"><label>{l s='Etykieta niestandardowa' mod='x13googlemerchant'} {$i+1}</label></td>
<td style="padding-bottom:5px;" class="translatable">
{foreach from=$languages item=language}
<div class="lang_{$language.id_lang}" style="{if $language.id_lang != $default_language}display: none;{/if} float: left;">
<input type="text" id="custom_label_{$i}_{$language.id_lang}" name="custom_label[{$language.id_lang}][{$i}]" value="{if isset($custom_labels[$language.id_lang][$i])}{$custom_labels[$language.id_lang][$i]}{else}{/if}">
</div>
{/foreach}
</td>
</tr>
{/for}
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<script type="text/javascript">
displayFlags(languages, id_language, allowEmployeeFormLang);
</script>

View File

@@ -0,0 +1,110 @@
<div class="panel clearfix" {if version_compare($smarty.const._PS_VERSION_, '1.7.0.0', '>')}style="padding: 10px;"{/if}>
{if version_compare($smarty.const._PS_VERSION_, '1.7', '>=')}
{else}
<h3>{l s='Google merchant XML' mod='x13googlemerchant'}</h3>
{/if}
<div class="form-group clearfix">
<label for="" class="control-label form-control-label col-lg-3">
<span>{l s='Eksportuj' mod='x13allegro'}</span>
</label>
<div class="col-lg-5">
{if version_compare($smarty.const._PS_VERSION_, '1.7', '>=')}
<span class="ps-switch">
<input type="radio" name="custom_export" id="custom_export_off" class="ps-switch" value="0" {if !$custom_export}checked="checked"{/if} {if !$is_custom_export}disabled="disabled"{/if} />
{strip}<label for="custom_export_off">{l s='No'}</label>{/strip}
<input type="radio" name="custom_export" id="custom_export_on" class="ps-switch" value="1" {if $custom_export}checked="checked"{/if} {if !$is_custom_export}disabled="disabled"{/if} />
{strip}<label for="custom_export_on">{l s='Yes'}</label>{/strip}
<span class="slide-button"></span>
</span>
{else}
<span class="switch prestashop-switch fixed-width-lg">
<input type="radio" name="custom_export" id="custom_export_on" value="1" {if $custom_export}checked="checked"{/if} {if !$is_custom_export}disabled="disabled"{/if} />
{strip}<label for="custom_export_on">{l s='Yes'}</label>{/strip}
<input type="radio" name="custom_export" id="custom_export_off" value="0" {if !$custom_export}checked="checked"{/if} {if !$is_custom_export}disabled="disabled"{/if} />
{strip}<label for="custom_export_off">{l s='No'}</label>{/strip}
<a class="slide-button btn"></a>
</span>
{/if}
<div class="help-block form-text">{l s='Jeśli opcja jest nieaktywna, wysłane będą wszystkie produkty - jeśli chcesz wybrać konkretny produkt - zmień to w konfiguracji modułu' mod='x13googlemerchant'}</div>
</div>
</div>
<div class="form-group clearfix">
<label for="custom_title" class="control-label form-control-label col-lg-3">
<span>{l s='Nazwa produktu' mod='x13googlemerchant'}</span>
</label>
<div class="col-lg-9">
{foreach from=$languages item=language}
<div class="translatable-field lang-{$language.id_lang} row clearfix" style="{if $language.id_lang != $default_language}display: none;{/if}">
<div class="col-lg-5">
<input type="text" class="form-control" id="custom_title_{$language.id_lang}" name="custom_title[{$language.id_lang}]" value="{if isset($custom_title[$language.id_lang])}{$custom_title[$language.id_lang]}{/if}">
</div>
<div class="col-lg-2">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" tabindex="-1">
{$language.iso_code}
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
{foreach from=$languages item=language}
<li>
<a href="javascript:hideOtherLanguage({$language.id_lang});">{$language.name}</a>
</li>
{/foreach}
</ul>
</div>
</div>
{/foreach}
</div>
<div class="col-lg-9 col-lg-offset-3">
<div class="help-block form-text">
{l s='{product_name} - Nazwa produktu' mod='x13googlemerchant'}<br />
{l s='{product_name_attribute} - Nazwa atrybutu' mod='x13googlemerchant'}<br /><br />
{l s='Pozostawiając te pole puste zostanie ustawiona domyślna nazwa produktu' mod='x13googlemerchant'}
</div>
</div>
</div>
{for $i = 0 to 4}
<div class="form-group clearfix">
<label class="control-label form-control-label col-lg-3">{l s='Etykieta niestandardowa' mod='x13googlemerchant'} {$i+1}</label>
<div class="col-lg-9">
{foreach from=$languages item=language}
<div class="translatable-field lang-{$language.id_lang} row clearfix" style="{if $language.id_lang != $default_language}display: none;{/if}">
<div class="col-lg-8">
<input type="text" class="form-control" id="custom_label_{$i}_{$language.id_lang}" name="custom_label[{$language.id_lang}][{$i}]" value="{if isset($custom_labels[$language.id_lang][$i])}{$custom_labels[$language.id_lang][$i]}{else}{/if}">
</div>
<div class="col-lg-2">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" tabindex="-1">
{$language.iso_code}
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
{foreach from=$languages item=language}
<li>
<a href="javascript:hideOtherLanguage({$language.id_lang});">{$language.name}</a>
</li>
{/foreach}
</ul>
</div>
</div>
{/foreach}
</div>
</div>
{/for}
<input type="hidden" name="x13googlemerchant_product_extra" value="1">
{if version_compare($smarty.const._PS_VERSION_, '1.7.0.0', '<')}
<div class="panel-footer">
<a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}" class="btn btn-default"><i class="process-icon-cancel"></i> {l s='Cancel'}</a>
<button type="submit" name="submitAddproduct" class="btn btn-default pull-right"><i class="process-icon-loading"></i> {l s='Save'}</button>
<button type="submit" name="submitAddproductAndStay" class="btn btn-default pull-right"><i class="process-icon-loading"></i> {l s='Save and stay'}</button>
</div>
{/if}
</div>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,138 @@
<?php
if (!defined('_PS_VERSION_')) {
exit;
}
if (!extension_loaded('ionCube Loader')) {
$errors[] = '<b>x13googlemerchant</b> <span style="color: red;">Brak zainstalowanego rozszerzenia "<b>ionCube Loader</b>" na serwerze, który jest niezbędny aby korzystać z tego modułu. Jeśli chcesz korzystać z modułu i widzisz tę wiadomość, skontaktuj się z administratorem Twojego serwera i poproś o instalację/aktywację tego rozszerzenia</span>.';
} else {
if (!defined('X13_ION_VERSION_GM')){
if (PHP_VERSION_ID >= 70100) {
$x13IonVer = '-71';
} else if (PHP_VERSION_ID >= 70000) {
$x13IonVer = '-7';
} else {
$x13IonVer = '';
}
if (file_exists(_PS_MODULE_DIR_.'x13googlemerchant/dev')) {
$x13IonVer = '';
}
define('X13_ION_VERSION_GM', $x13IonVer);
}
require_once(_PS_MODULE_DIR_ . 'x13googlemerchant/x13googlemerchant.db' . X13_ION_VERSION_GM . '.php');
require_once(_PS_MODULE_DIR_ . 'x13googlemerchant/x13googlemerchant.core' . X13_ION_VERSION_GM . '.php');
require_once(_PS_MODULE_DIR_ . 'x13googlemerchant/x13googlemerchant.schema' . X13_ION_VERSION_GM . '.php');
class x13googlemerchant extends x13googlemerchantCore
{
public function __construct()
{
$this->name = 'x13googlemerchant';
$this->tab = 'export';
$this->version = '1.5.10';
$this->author = 'x13.pl';
$this->bootstrap = true;
$this->need_instance = 1;
parent::__construct();
$this->ps_version = (float)substr(_PS_VERSION_,0,3);
// Retrocompatibility
if($this->ps_version < 1.5) {
$this->initContext();
require_once(_PS_MODULE_DIR_.'x13googlemerchant/helpers.1.4/helper.php');
require_once(_PS_MODULE_DIR_.'x13googlemerchant/helpers.1.4/helper_list.php');
require_once(_PS_MODULE_DIR_.'x13googlemerchant/helpers.1.4/helper_option.php');
require_once(_PS_MODULE_DIR_.'x13googlemerchant/helpers.1.4/helper_form.php');
}
if($this->ps_version == 1.5) {
$this->bootstrap = false;
$this->context->smarty->assign('is_bootstrap', false);
}
else {
$this->bootstrap = true;
$this->context->smarty->assign('is_bootstrap', true);
}
$this->displayName = $this->l('Google merchant XML');
$this->description = $this->l('Umożliwia eksport produktów sklepu do pliku XML dla Google Merchant Center.');
}
public function hookDisplayAdminProductsExtra($params)
{
if (version_compare(_PS_VERSION_, '1.7', '>')) {
$id_product = (int)$params['id_product'];
}
else {
$id_product = (int)Tools::getValue('id_product');
}
$product = new Product($id_product);
if (!Validate::isLoadedObject($product)) {
return '<div></div>';
}
$this->context->smarty->assign(array(
'languages' => Language::getLanguages(false),
'default_language' => (int)Configuration::get('PS_LANG_DEFAULT'),
'custom_labels' => _x13googlemerchant::getCustomLabels($product->id, (class_exists('Context', false) ? $this->context->shop->id : null)),
'custom_export' => _x13googlemerchant::getCustomExport($product->id, (class_exists('Context', false) ? $this->context->shop->id : null)),
'custom_title' => _x13googlemerchant::getCustomTitle($product->id, (class_exists('Context', false) ? $this->context->shop->id : null)),
'is_custom_export' => Configuration::get('X13_GOOGLEMERCHANT_EXPORT_CUSTOM')
));
return $this->display(__FILE__, 'views/templates/admin/tab.tpl');
}
public function hookActionProductSave($params)
{
if (!isset($params['id_product']) || !Tools::getValue('x13googlemerchant_product_extra')) {
return false;
}
return _x13googlemerchant::assignCustomProduct(
$params['id_product'],
Tools::getValue('custom_label', array()),
Tools::getValue('custom_title', array()),
(int)Tools::getValue('custom_export', 0),
(class_exists('Context', false) ? $this->context->shop->id : null)
);
}
public function hookActionProductDelete($params)
{
if (!isset($params['product']) || !Validate::isLoadedObject($params['product'])) {
return false;
}
return _x13googlemerchant::unassignCustomProduct(
$params['product']->id,
(class_exists('Context', false) ? $this->context->shop->id : null)
);
}
/**
* Retrocompatibility 1.4/1.5
*/
private function initContext()
{
if (class_exists('Context'))
$this->context = Context::getContext();
else {
global $smarty, $cookie;
$this->context = new StdClass();
$this->context->smarty = $smarty;
$this->context->cookie = $cookie;
}
}
}
}

Binary file not shown.

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<currentVersion><![CDATA[1.5.10]]></currentVersion>
</module>

View File

@@ -0,0 +1,20 @@
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
define('_PRESTA_DIR_', dirname(dirname(dirname($_SERVER['SCRIPT_FILENAME']))));
require_once(_PRESTA_DIR_ . '/config/config.inc.php');
if (Configuration::get('X13_GOOGLEMERCHANT_CRON_TOKEN') && Tools::getValue('token') != Configuration::get('X13_GOOGLEMERCHANT_TOKEN')) {
echo 'Token error';
exit;
}
$x13googlemerchant = Module::getInstanceByName('x13googlemerchant');
$id_lang = (Tools::getIsset('id_lang')) ? (int)Tools::getValue('id_lang') : (int)Configuration::get('PS_DEFAULT_LANG');
$id_shop = (Tools::getIsset('id_shop')) ? (int)Tools::getValue('id_shop') : Context::getContext()->shop->id;
$id_currency = (Tools::getIsset('id_currency')) ? (int)Tools::getValue('id_currency') : (int)Configuration::get('PS_DEFAULT_CURRENCY');
$x13googlemerchant->createXml($id_lang, $id_shop, $id_currency, 1);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,36 @@
<?php
/*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 7233 $
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;