[+] BO: htaccess is now automatically generated when friendly url option is activated
This commit is contained in:
@@ -51,7 +51,7 @@ class AdminMetaControllerCore extends AdminController
|
|||||||
'general' => array(
|
'general' => array(
|
||||||
'title' => $this->l('URLs Setup'),
|
'title' => $this->l('URLs Setup'),
|
||||||
'fields' => array(
|
'fields' => array(
|
||||||
'PS_REWRITING_SETTINGS' => array('title' => $this->l('Friendly URL'), 'desc' => $this->l('Enable only if your server allows URL rewriting (recommended)').'<div class="optionsDescription">'.$this->l('If you turn on this feature, you must').' <a href="?tab=AdminGenerator&token='.Tools::getAdminToken('AdminGenerator'.(int)(Tab::getIdFromClassName('AdminGenerator')).(int)$this->context->employee->id).'">'.$this->l('generate a .htaccess file').'</a></div>', 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'),
|
'PS_REWRITING_SETTINGS' => array('title' => $this->l('Friendly URL'), 'desc' => $this->l('Enable only if your server allows URL rewriting (recommended)'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'),
|
||||||
'PS_CANONICAL_REDIRECT' => array('title' => $this->l('Automatically redirect to Canonical url'), 'desc' => $this->l('Recommended but your theme must be compliant'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'),
|
'PS_CANONICAL_REDIRECT' => array('title' => $this->l('Automatically redirect to Canonical url'), 'desc' => $this->l('Recommended but your theme must be compliant'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'),
|
||||||
),
|
),
|
||||||
'submit' => array()
|
'submit' => array()
|
||||||
@@ -247,6 +247,15 @@ class AdminMetaControllerCore extends AdminController
|
|||||||
Configuration::updateValue('PS_ROUTE_'.$routeID, $rule);
|
Configuration::updateValue('PS_ROUTE_'.$routeID, $rule);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when PS_REWRITING_SETTINGS option is saved
|
||||||
|
*/
|
||||||
|
public function updateOptionPsRewritingSettings()
|
||||||
|
{
|
||||||
|
Configuration::updateValue('PS_REWRITING_SETTINGS', (int)Tools::getValue('PS_REWRITING_SETTINGS'));
|
||||||
|
Tools::generateHtaccess();
|
||||||
|
}
|
||||||
|
|
||||||
public function updateOptionPsRouteProductRule()
|
public function updateOptionPsRouteProductRule()
|
||||||
{
|
{
|
||||||
$this->checkAndUpdateRoute('product_rule');
|
$this->checkAndUpdateRoute('product_rule');
|
||||||
|
|||||||
Reference in New Issue
Block a user