Merge branch 'bootstrap' of https://github.com/PrestaShop/PrestaShop into bootstrap
This commit is contained in:
@@ -348,7 +348,7 @@
|
||||
// res.status = cache or refresh
|
||||
if (data == 'OK')
|
||||
{
|
||||
el.parent('div').find('.toggle_favorite').toggle();
|
||||
el.parent('li').find('.toggle_favorite').toggle();
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
@@ -150,8 +150,6 @@
|
||||
<a class="action_module action_unfavorite toggle_favorite" data-module="{$module->name}" data-value="0" href="#">
|
||||
<i class="icon-star"></i> {l s='Remove from Favorites'}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="action_module action_favorite toggle_favorite" data-module="{$module->name}" data-value="1" href="#" style="display: none;">
|
||||
<i class="icon-star"></i> {l s='Mark as Favorite'}
|
||||
</a>
|
||||
@@ -161,8 +159,6 @@
|
||||
<a class="action_module action_unfavorite toggle_favorite" data-module="{$module->name}" data-value="0" href="#" style="display: none;">
|
||||
<i class="icon-star"></i> {l s='Remove from Favorites'}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="action_module action_favorite toggle_favorite" data-module="{$module->name}" data-value="1" href="#">
|
||||
<i class="icon-star"></i> {l s='Mark as Favorite'}
|
||||
</a>
|
||||
|
||||
@@ -156,64 +156,6 @@ class AdminFeaturesControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* method call when ajax request is made with the details row action
|
||||
* @see AdminController::postProcess()
|
||||
*/
|
||||
/*public function ajaxProcessDetails()
|
||||
{
|
||||
if (($id = Tools::getValue('id')))
|
||||
{
|
||||
$this->setTypeValue();
|
||||
$this->lang = true;
|
||||
|
||||
// override attributes
|
||||
$this->display = 'list';
|
||||
|
||||
// Action for list
|
||||
$this->addRowAction('edit');
|
||||
$this->addRowAction('delete');
|
||||
|
||||
if (!Validate::isLoadedObject($obj = new Feature((int)$id)))
|
||||
$this->errors[] = Tools::displayError('An error occurred while updating the status for an object.').' <b>'.$this->table.'</b> '.Tools::displayError('(cannot load object)');
|
||||
|
||||
$this->fields_list = array(
|
||||
'id_feature_value' => array(
|
||||
'title' => $this->l('ID'),
|
||||
'width' => 25
|
||||
),
|
||||
'value' => array(
|
||||
'title' => $this->l('Value')
|
||||
)
|
||||
);
|
||||
|
||||
$this->_where = sprintf('AND `id_feature` = %d', (int)$id);
|
||||
|
||||
// get list and force no limit clause in the request
|
||||
$this->getList($this->context->language->id);
|
||||
|
||||
// Render list
|
||||
$helper = new HelperList();
|
||||
$helper->actions = $this->actions;
|
||||
$helper->no_link = true;
|
||||
$helper->shopLinkType = '';
|
||||
$helper->identifier = $this->identifier;
|
||||
$helper->toolbar_scroll = false;
|
||||
$helper->orderBy = 'position';
|
||||
$helper->orderWay = 'ASC';
|
||||
$helper->currentIndex = self::$currentIndex;
|
||||
$helper->token = $this->token;
|
||||
$helper->table = $this->table;
|
||||
$helper->simple_header = true;
|
||||
$helper->show_toolbar = false;
|
||||
$helper->bulk_actions = $this->bulk_actions;
|
||||
$content = $helper->generateList($this->_list, $this->fields_list);
|
||||
|
||||
echo Tools::jsonEncode(array('use_parent_structure' => false, 'data' => $content));
|
||||
exit;
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
* AdminController::renderForm() override
|
||||
* @see AdminController::renderForm()
|
||||
|
||||
@@ -70,10 +70,10 @@ class HomeFeatured extends Module
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
$output = '<h2>'.$this->displayName.'</h2>';
|
||||
$output = '';
|
||||
if (Tools::isSubmit('submitHomeFeatured'))
|
||||
{
|
||||
$nbr = (int)Tools::getValue('nbr');
|
||||
$nbr = (int)Tools::getValue('HOME_FEATURED_NBR');
|
||||
if (!$nbr OR $nbr <= 0 OR !Validate::isInt($nbr))
|
||||
$errors[] = $this->l('An invalid number of products has been specified.');
|
||||
else
|
||||
@@ -83,25 +83,7 @@ class HomeFeatured extends Module
|
||||
else
|
||||
$output .= $this->displayConfirmation($this->l('Your settings have been updated.'));
|
||||
}
|
||||
return $output.$this->displayForm();
|
||||
}
|
||||
|
||||
public function displayForm()
|
||||
{
|
||||
$output = '
|
||||
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post">
|
||||
<fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend>
|
||||
<p>'.$this->l('To add products to your homepage, simply add them to the "home" category.').'</p><br />
|
||||
<label>'.$this->l('Define the number of products to be displayed.').'</label>
|
||||
<div class="margin-form">
|
||||
<input type="text" size="5" name="nbr" value="'.Tools::safeOutput(Tools::getValue('nbr', (int)(Configuration::get('HOME_FEATURED_NBR')))).'" />
|
||||
<p class="clear">'.$this->l('Define the number of products that you would like to display on homepage (default: 8).').'</p>
|
||||
|
||||
</div>
|
||||
<center><input type="submit" name="submitHomeFeatured" value="'.$this->l('Save').'" class="button" /></center>
|
||||
</fieldset>
|
||||
</form>';
|
||||
return $output;
|
||||
return $output.$this->renderForm();
|
||||
}
|
||||
|
||||
public function hookDisplayHeader($params)
|
||||
@@ -146,4 +128,56 @@ class HomeFeatured extends Module
|
||||
{
|
||||
$this->_clearCache('homefeatured.tpl');
|
||||
}
|
||||
|
||||
public function renderForm()
|
||||
{
|
||||
$fields_form = array(
|
||||
'form' => array(
|
||||
'legend' => array(
|
||||
'title' => $this->l('Settings'),
|
||||
'icon' => 'icon-cogs'
|
||||
),
|
||||
'description' => $this->l('To add products to your homepage, simply add them to the "home" category.'),
|
||||
'input' => array(
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Define the number of products to be displayed.'),
|
||||
'name' => 'HOME_FEATURED_NBR',
|
||||
'class' => 'fixed-width-xs',
|
||||
'desc' => $this->l('Define the number of products that you would like to display on homepage (default: 8).'),
|
||||
),
|
||||
),
|
||||
'submit' => array(
|
||||
'title' => $this->l('Save'),
|
||||
'class' => 'btn btn-primary')
|
||||
),
|
||||
);
|
||||
|
||||
$helper = new HelperForm();
|
||||
$helper->show_toolbar = false;
|
||||
$helper->table = $this->table;
|
||||
$lang = new Language((int)Configuration::get('PS_LANG_DEFAULT'));
|
||||
$helper->default_form_language = $lang->id;
|
||||
$helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0;
|
||||
$this->fields_form = array();
|
||||
$helper->id = (int)Tools::getValue('id_carrier');
|
||||
$helper->identifier = $this->identifier;
|
||||
$helper->submit_action = 'submitHomeFeatured';
|
||||
$helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false).'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name;
|
||||
$helper->token = Tools::getAdminTokenLite('AdminModules');
|
||||
$helper->tpl_vars = array(
|
||||
'fields_value' => $this->getConfigFieldsValues(),
|
||||
'languages' => $this->context->controller->getLanguages(),
|
||||
'id_language' => $this->context->language->id
|
||||
);
|
||||
|
||||
return $helper->generateForm(array($fields_form));
|
||||
}
|
||||
|
||||
public function getConfigFieldsValues()
|
||||
{
|
||||
return array(
|
||||
'HOME_FEATURED_NBR' => Tools::getValue('HOME_FEATURED_NBR', Configuration::get('HOME_FEATURED_NBR')),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user