[*] BO : #PSFV-94 - added AdminPPreferencesController

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9636 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean
2011-10-25 15:00:59 +00:00
parent a9fb7e1eb9
commit 75cc00c082
2 changed files with 11 additions and 17 deletions
+1 -1
View File
@@ -115,7 +115,7 @@ class HelperOptionsCore extends Helper
// Is at least one required field present? // Is at least one required field present?
if (isset($field['required']) && $field['required']) if (isset($field['required']) && $field['required'])
$this->required = true; $required_fields = true;
} }
// Assign the modifications back to parent array // Assign the modifications back to parent array
$option_list[$category] = $category_data; $option_list[$category] = $category_data;
@@ -25,9 +25,7 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*/ */
include_once(_PS_ADMIN_DIR_.'/tabs/AdminPreferences.php'); class AdminPPreferencesControllerCore extends AdminController
class AdminPPreferences extends AdminPreferences
{ {
public function __construct() public function __construct()
{ {
@@ -36,11 +34,10 @@ class AdminPPreferences extends AdminPreferences
parent::__construct(); parent::__construct();
$this->optionsList = array( $this->options = array(
'products' => array( 'products' => array(
'title' => $this->l('Products'), 'title' => $this->l('Products'),
'icon' => 'tab-orders', 'icon' => 'tab-orders',
'class' => 'width3',
'fields' => array( 'fields' => array(
'PS_CATALOG_MODE' => array('title' => $this->l('Catalog mode:'), 'desc' => $this->l('When active, all features for shopping will be disabled'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => true, 'type' => 'bool'), 'PS_CATALOG_MODE' => array('title' => $this->l('Catalog mode:'), 'desc' => $this->l('When active, all features for shopping will be disabled'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => true, 'type' => 'bool'),
'PS_ORDER_OUT_OF_STOCK' => array('title' => $this->l('Allow ordering out-of-stock product:'), 'desc' => $this->l('Add to cart button is hidden when product is unavailable'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => true, 'type' => 'bool'), 'PS_ORDER_OUT_OF_STOCK' => array('title' => $this->l('Allow ordering out-of-stock product:'), 'desc' => $this->l('Add to cart button is hidden when product is unavailable'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => true, 'type' => 'bool'),
@@ -72,8 +69,10 @@ class AdminPPreferences extends AdminPreferences
'PS_PRODUCT_PICTURE_WIDTH' => array('title' => $this->l('Product pictures width:'), 'desc' => $this->l('The maximum width of pictures uploadable by customers'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', 'type' => 'text', 'visibility' => Shop::CONTEXT_ALL), 'PS_PRODUCT_PICTURE_WIDTH' => array('title' => $this->l('Product pictures width:'), 'desc' => $this->l('The maximum width of pictures uploadable by customers'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', 'type' => 'text', 'visibility' => Shop::CONTEXT_ALL),
'PS_PRODUCT_PICTURE_HEIGHT' => array('title' => $this->l('Product pictures height:'), 'desc' => $this->l('The maximum height of pictures uploadable by customers'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', 'type' => 'text', 'visibility' => Shop::CONTEXT_ALL), 'PS_PRODUCT_PICTURE_HEIGHT' => array('title' => $this->l('Product pictures height:'), 'desc' => $this->l('The maximum height of pictures uploadable by customers'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', 'type' => 'text', 'visibility' => Shop::CONTEXT_ALL),
'PS_LEGACY_IMAGES' => array('title' => $this->l('Use the legacy image filesystem:'), 'desc' => $this->l('This should be set to yes unless you successfully moved images in Preferences > Images tab'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => true, 'type' => 'bool', 'visibility' => Shop::CONTEXT_ALL), 'PS_LEGACY_IMAGES' => array('title' => $this->l('Use the legacy image filesystem:'), 'desc' => $this->l('This should be set to yes unless you successfully moved images in Preferences > Images tab'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => true, 'type' => 'bool', 'visibility' => Shop::CONTEXT_ALL),
'PS_QTY_DISCOUNT_ON_COMBINATION' => array('title' => $this->l('Quantity discounts based on:'), 'desc' => $this->l('How to calculate quantity discounts'), 'cast' => 'intval', 'show' => true, 'required' => true, 'type' => 'radio', 'validation' => 'isBool', 'choices' => array(0 => $this->l('Products'), 1 => $this->l('Combinations'))) 'PS_QTY_DISCOUNT_ON_COMBINATION' => array('title' => $this->l('Quantity discounts based on:'), 'desc' => $this->l('How to calculate quantity discounts'), 'cast' => 'intval', 'show' => true, 'required' => true, 'type' => 'radio', 'validation' => 'isBool', 'choices' => array(0 => $this->l('Products'), 1 => $this->l('Combinations')))
), ),
'bottom' => '<script type="text/javascript">stockManagementActivationAuthorization();</script>',
'submit' => array()
), ),
); );
} }
@@ -86,9 +85,4 @@ class AdminPPreferences extends AdminPreferences
$_POST['PS_DISPLAY_QTIES'] = 0; $_POST['PS_DISPLAY_QTIES'] = 0;
} }
} }
public function displayBottomOptionCategory($category, $categoryData)
{
echo '<script type="text/javascript">stockManagementActivationAuthorization();</script>';
}
} }