Enhance module

This commit is contained in:
Michael RICOIS 2017-11-03 10:14:28 +01:00
parent 4071c0d4d7
commit d777e89f81
12 changed files with 232 additions and 5 deletions

View File

@ -1,12 +1,14 @@
<?php
if (!defined('_PS_VERSION_'))
if (!defined('_PS_VERSION_')) {
exit;
}
require_once(__DIR__.'/classes/GuideCategory.php');
class PurchaseGuide extends Module
class PurchaseGuide extends Module
{
public function __construct() {
public function __construct()
{
$this->name = 'purchaseguide';
$this->tab = 'front_office_features';
$this->author = 'Antadis';
@ -18,7 +20,7 @@ class PurchaseGuide extends Module
}
public function install()
public function install()
{
if(!parent::install()
|| !$this->installTabs()
@ -33,7 +35,7 @@ class PurchaseGuide extends Module
}
public function uninstall()
public function uninstall()
{
$this->uninstallTabs();
$this->dropTables();

View File

@ -0,0 +1,29 @@
<label>{$input.title} : </label>
<div class="margin-form">
{if $input.file_path != ''}
{if $input.html_file == 'img'}
<div style="margin-bottom:20px;width: 200px; height:150px; background:url('{$input.file_path}');background-size:cover;background-repeat: no-repeat;">
</div>
{/if}
{/if}
<input type="file" style="width: 260px" name="{$input.name}" id="{$input.name}" value="{$input.name}" {$input.html_attrs} >
{if isset($input.required) && $input.required}
<sup> *</sup>
{/if}
<p>
{if $input.allowed_format}
{l s='Format'} : {$input.allowed_format}.
{/if}
{if $input.max_size}
File size'} :
{$input.max_size} {l s='max'}.
{/if}
</p>
<p class="clear"></p>
</div>

View File

@ -0,0 +1,38 @@
<form action="{$form_action}" method="post" enctype="multipart/form-data">
<input name="{$id_name}" value="{$id}" type="hidden">
<fieldset style="width:520px"><legend><img src="../img/admin/tab-categories.gif">{$page_title}</legend>
{foreach from=$form_inputs key=input_name item=input_data}
{include file=$input_data.template
input=$input_data
langs=$langs
current_id_lang=$current_id_lang}
{/foreach}
<div class="margin-form">
<input class="button" name="{$button_submit.name}" value="{$button_submit.value}" type="submit">
</div>
<div class="small"><sup>*</sup> {l s='Required fields'}</div>
</fieldset>
</form>
<link type="text/css" rel="stylesheet" href="{$module_dir}/bulkupdate/chosen.min.css" />
<script type="text/javascript" src="{$module_dir}/bulkupdate/chosen.jquery.min.js"></script>
<script type="text/javascript">
$(".chosen-select").chosen(
{
allow_single_deselect:true,
placeholder_text_single : "",
no_results_text : "",
enable_split_word_search : true,
search_contains : true,
width: "100%",
}
);
var copyField2friendlyURL = function(id_source, id_target)
{
$('#'+ id_target +'_'+ id_language).val(str2url($('#'+id_source+'_' + id_language).val().replace(/^[0-9]+\./, ''), 'UTF-8'));
}
</script>

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,25 @@
<label>{$input.title} : </label>
<div class="margin-form">
<select id="{$input.name}" name="{$input.name}" class="chosen-select" {$input.html_attrs} >
{if isset($input.empty_option) && $input.empty_option}
<option value="{$input.empty_option.value}" {if $input.value == '0'}selected="selected"{/if}>{$input.empty_option.label}</option>
{/if}
{foreach from=$input.options item=option}
<option value="{$option.value}" {if $input.value == $option.value}selected="selected"{/if}>
{$option.label}
</option>
{/foreach}
</select>
{if isset($input.required) && $input.required}
<sup> *</sup>
{/if}
</div>

View File

@ -0,0 +1,26 @@
<label>{$input.title} : </label>
<div class="margin-form translatable">
{foreach from=$langs item=lang}
<div class="lang_{$lang.id_lang}" style="display: {if $lang.id_lang == $current_id_lang}block {else} none{/if}; float: left;">
<input
type="text"
style="width: 260px"
name="{$input.name}_{$lang.id_lang}" id="{$input.name}_{$lang.id_lang}"
value="{if isset($input.value[$lang.id_lang])}{$input.value[$lang.id_lang]}{/if}"
{$input.html_attrs}
>
{if isset($input.required) && $input.required}
<sup> *</sup>
{/if}
<span class="hint" name="help_box">Caractères interdits : &lt;&gt;;=#{}<span class="hint-pointer">&nbsp;</span></span>
</div>
{/foreach}
<p class="clear"></p>
</div>

View File

@ -0,0 +1,20 @@
<label>{$input.title} : </label>
<div class="margin-form translatable">
{foreach from=$langs item=lang}
<div class="lang_{$lang.id_lang}" style="display: {if $lang.id_lang == $current_id_lang}block {else} none{/if}; float: left;">
<textarea {if isset($input.enable_rte) && $input.enable_rte}class="rte"{/if} name="{$input.name}_{$lang.id_lang}" rows="5" cols="40" {$input.html_attrs} >{if isset($input.value[$lang.id_lang])}{$input.value[$lang.id_lang]}{/if}</textarea>
</div>
{/foreach}
{if isset($input.required) && $input.required}
<sup> *</sup>
{/if}
<p class="clear"></p>
</div>
<div class="clear"><br></div>

View File

@ -0,0 +1,27 @@
<label>{$input.title} : </label>
<div class="margin-form translatable">
{foreach from=$langs item=lang}
<div class="lang_{$lang.id_lang}" style="display: {if $lang.id_lang == $current_id_lang}block {else} none{/if}; float: left;">
<textarea class="rte" name="{$input.name}_{$lang.id_lang}" rows="30" cols="80" {$input.html_attrs} >{if isset($input.value[$lang.id_lang])}{$input.value[$lang.id_lang]}{/if}</textarea>
</div>
{/foreach}
{if isset($input.required) && $input.required}
<sup> *</sup>
{/if}
<p class="clear"></p>
</div>
<div class="clear"><br></div>
<script type="text/javascript">
var iso = '{$input.iso}';
var pathCSS = '{$input.path_theme_css}';
var ad = '{$input.ad}' ;
</script>
<script type="text/javascript" src="{$input.base_uri}js/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="{$input.base_uri}js/tinymce.inc.js"></script>'

View File

@ -0,0 +1,15 @@
<label>{$input.title} : </label>
<div class="margin-form">
<input name="{$input.name}" id="{$input.name}_on" value="1" type="radio" {if $input.value == '1'}checked="checked"{/if} {$input.html_attrs} >
<label class="t" for="{$input.name}_on" ><img src="../img/admin/enabled.gif" alt="Activé" title="Activé"></label>
<input name="{$input.name}" id="{$input.name}_off" value="0" type="radio" {if $input.value != '1'}checked="checked"{/if} {$input.html_attrs} >
<label class="t" for="{$input.name}_off"><img src="../img/admin/disabled.gif" alt="Désactivé" title="Désactivé"></label>
{if isset($input.required) && $input.required}
<sup> *</sup>
{/if}
</div>

View File

@ -0,0 +1,9 @@
<br /><br />
<fieldset>
<legend><img src="../img/admin/tab-tools.gif" alt="" />{l s='URL Rewriting settings'}</legend>
<p>{l s='Add the following text to the custom rewriting rules (Tools > Generators)'} :</p>
<p> </p>
<textarea style="width: 850px; height: 120px;" readonly="true">{$rewrite_rules}</textarea>
</fieldset>