This commit is contained in:
Michael RICOIS 2018-02-22 15:30:03 +01:00
parent 681fb29f74
commit 3ad6f43fbf
2 changed files with 29 additions and 29 deletions

View File

@ -42,38 +42,38 @@ class HelperFormBootstrap
public function renderStyle() public function renderStyle()
{ {
$this->_style .= '<style type="text/css">'; $this->_style .= "\n" . '<style type="text/css">' . "\n";
$this->_style .= '@import url("'.__PS_BASE_URI__.$this->pathAssets. $this->_style .= '@import url("'.__PS_BASE_URI__.$this->pathAssets.
'/ui-1.12.1/jquery-ui.min.css"); '; '/ui-1.12.1/jquery-ui.min.css"); ' . "\n";
$this->_style .= '@import url("'.__PS_BASE_URI__.$this->pathAssets. $this->_style .= '@import url("'.__PS_BASE_URI__.$this->pathAssets.
'/bootstrap-3.3.7/css/bootstrap.min.css"); '; '/bootstrap-3.3.7/css/bootstrap.min.css"); ' . "\n";
if ($this->_select2) { if ($this->_select2) {
$this->_style .= '@import url("'.__PS_BASE_URI__.$this->pathAssets. $this->_style .= '@import url("'.__PS_BASE_URI__.$this->pathAssets.
'/select2-4.0.5/css/select2.min.css"); '; '/select2-4.0.5/css/select2.min.css"); ' . "\n";
} }
if ($this->_dateTimePicker) { if ($this->_dateTimePicker) {
$this->_style .= '@import url("'.__PS_BASE_URI__.$this->pathAssets. $this->_style .= '@import url("'.__PS_BASE_URI__.$this->pathAssets.
'/bootstrap-datetimepicker-4.17.47/css/bootstrap-datetimepicker.min.css"); '; '/bootstrap-datetimepicker-4.17.47/css/bootstrap-datetimepicker.min.css"); ' . "\n";
} }
if ($this->_inputTag) { if ($this->_inputTag) {
$this->_style .= '@import url("'.__PS_BASE_URI__.$this->pathAssets. $this->_style .= '@import url("'.__PS_BASE_URI__.$this->pathAssets.
'/tagsinput-1.3.6/jquery.tagsinput.min.css"); '; '/tagsinput-1.3.6/jquery.tagsinput.min.css"); ' . "\n";
} }
if ($this->_inputSwitch) { if ($this->_inputSwitch) {
$this->_style .= '@import url("'.__PS_BASE_URI__.$this->pathAssets. $this->_style .= '@import url("'.__PS_BASE_URI__.$this->pathAssets.
'/switchery-0.8.2/switchery.min.css"); '; '/switchery-0.8.2/switchery.min.css"); ' . "\n";
} }
$this->_style .= '@import url("'.__PS_BASE_URI__.$this->pathAssets.'/custom.css"); '; $this->_style .= '@import url("'.__PS_BASE_URI__.$this->pathAssets.'/custom.css"); ' . "\n";
$this->_style .= $this->_css; $this->_style .= $this->_css;
$this->_style .= '</style>'; $this->_style .= '</style>' . "\n";
return $this->_style; return $this->_style;
} }
@ -81,49 +81,49 @@ class HelperFormBootstrap
public function renderScript() public function renderScript()
{ {
$this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.$this->pathAssets. $this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.$this->pathAssets.
'/jquery-3.3.1.min.js"></script>'; '/jquery-3.3.1.min.js"></script>' . "\n";
$this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.$this->pathAssets. $this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.$this->pathAssets.
'/ui-1.12.1/jquery-ui.min.js"></script>'; '/ui-1.12.1/jquery-ui.min.js"></script>' . "\n";
$this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.$this->pathAssets. $this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.$this->pathAssets.
'/bootstrap-3.3.7/js/bootstrap.min.js"></script>'; '/bootstrap-3.3.7/js/bootstrap.min.js"></script>' . "\n";
if ($this->_select2) { if ($this->_select2) {
$this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.$this->pathAssets. $this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.$this->pathAssets.
'/select2-4.0.5/js/select2.full.min.js"></script>'; '/select2-4.0.5/js/select2.full.min.js"></script>' . "\n";
} }
if ($this->_dateTimePicker) { if ($this->_dateTimePicker) {
$this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.$this->pathAssets. $this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.$this->pathAssets.
'/moment-with-locales.min.js"></script>'; '/moment-with-locales.min.js"></script>' . "\n";
$this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.$this->pathAssets. $this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.$this->pathAssets.
'/bootstrap-datetimepicker-4.17.47/js/bootstrap-datetimepicker.min.js"></script>'; '/bootstrap-datetimepicker-4.17.47/js/bootstrap-datetimepicker.min.js"></script>' . "\n";
} }
if ($this->_inputMask) { if ($this->_inputMask) {
$this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.$this->pathAssets. $this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.$this->pathAssets.
'/inputmask-3.3.11/jquery.inputmask.bundle.min.js"></script>'; '/inputmask-3.3.11/jquery.inputmask.bundle.min.js"></script>' . "\n";
} }
if ($this->_inputTag) { if ($this->_inputTag) {
$this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.$this->pathAssets. $this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.$this->pathAssets.
'/tagsinput-1.3.6/jquery.tagsinput.min.js"></script>'; '/tagsinput-1.3.6/jquery.tagsinput.min.js"></script>' . "\n";
} }
if ($this->_inputSwitch) { if ($this->_inputSwitch) {
$this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.$this->pathAssets. $this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.$this->pathAssets.
'/switchery-0.8.2/switchery.min.js"></script>'; '/switchery-0.8.2/switchery.min.js"></script>' . "\n";
} }
if ($this->_inputWizard) { if ($this->_inputWizard) {
$this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.$this->pathAssets. $this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.$this->pathAssets.
'/smartwizard-3.3.1/js/jquery.smartWizard.js"></script>'; '/smartwizard-3.3.1/js/jquery.smartWizard.js"></script>' . "\n";
} }
$this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.$this->pathAssets.'/custom.js"></script>'; $this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.$this->pathAssets.'/custom.js"></script>' . "\n";
$this->_script .= $this->_js; $this->_script .= $this->_js . "\n";
return $this->_script; return $this->_script;
} }
@ -477,7 +477,7 @@ class HelperFormBootstrap
if(isset($p['multiple']) && $p['multiple']){ if(isset($p['multiple']) && $p['multiple']){
$this->_html .='<script> $this->_html .='<script>
$(document).ready(function() { $(function() {
$("#'.(isset($p['id']) ? $p['id'] : $p['name']).'").select2({ $("#'.(isset($p['id']) ? $p['id'] : $p['name']).'").select2({
maximumSelectionLength: '.count($p['options']).', maximumSelectionLength: '.count($p['options']).',
placeholder: "'.(isset($p['placeholder'])?$p['placeholder']:'').'", placeholder: "'.(isset($p['placeholder'])?$p['placeholder']:'').'",
@ -495,7 +495,7 @@ class HelperFormBootstrap
</script>'; </script>';
} else { } else {
$this->_html .='<script> $this->_html .='<script>
$(document).ready(function() { $(function() {
$("#'.(isset($p['id']) ? $p['id'] : $p['name']).'").select2({ $("#'.(isset($p['id']) ? $p['id'] : $p['name']).'").select2({
placeholder: "'.(isset($p['placeholder'])?$p['placeholder']:'').'", placeholder: "'.(isset($p['placeholder'])?$p['placeholder']:'').'",
allowClear: true allowClear: true
@ -599,13 +599,13 @@ class HelperFormBootstrap
<div class="form-group"> <div class="form-group">
<label class="control-label '.(isset($p['label-class']) ? $p['label-class'] : '').'"> <label class="control-label '.(isset($p['label-class']) ? $p['label-class'] : '').'">
<span class="pull-left">'.$p['label'].'</span>' <span class="pull-left">'.$p['label'].'</span>'
.$this->displayFlags($p['languages'], $defaultLanguage, $p['id_langs'], $p['name'],true,false,$p['link_flag_img']).' .$this->displayFlags($p['languages'], $defaultLanguage, $p['id_langs'], $p['name'], true, false, $p['link_flag_img']).'
<div class="clearfix"></div> <div class="clearfix"></div>
</label>'; </label>';
$this->_js .= ' $this->_js .= '
<script> <script>
id_language = '.(int)$defaultLanguage.'; id_language = '.(int)$defaultLanguage.';
$(function() {'; $(function() {';
foreach ($p['languages'] as $language) { foreach ($p['languages'] as $language) {
$this->_html .=' $this->_html .='

View File

@ -140,8 +140,8 @@ abstract class AdminTabCore
/** @var bool Redirect or not ater a creation */ /** @var bool Redirect or not ater a creation */
protected $_redirect = true; protected $_redirect = true;
protected $_languages = NULL; protected $_languages = NULL;
protected $_defaultFormLanguage = NULL; protected $_defaultFormLanguage = NULL;
protected $_includeObj = array(); protected $_includeObj = array();
protected $_includeVars = false; protected $_includeVars = false;