[+] BO : BO width can now be fixed or flexible (you can set it up in your employee account)

This commit is contained in:
dMetzger
2012-02-23 14:42:23 +00:00
parent b3a0ab03e8
commit ad41e83fbc
6 changed files with 17 additions and 2 deletions
+2 -2
View File
@@ -92,11 +92,11 @@
}
</style>
</head>
<body{if $bo_color} style="background:{$bo_color}"{/if}>
<body style="{if $bo_color}background:{$bo_color};{/if}{if $bo_width > 0}text-align:center;{/if}">
{if $display_header}
<div id="ajax_running"><img src="../img/admin/ajax-loader-yellow.gif" alt="" /> {l s='Loading...'}</div>
<div id="top_container">
<div id="top_container" {if $bo_width > 0}style="margin:auto;width:{$bo_width}px"{/if}>
<div id="container">
{* begin HEADER *}
<div id="header">
+4
View File
@@ -59,6 +59,9 @@ class EmployeeCore extends ObjectModel
/** @var string employee's chosen theme */
public $bo_theme;
/** @var integer employee desired screen width */
public $bo_width;
/** @var bool, true */
public $bo_show_screencast;
@@ -84,6 +87,7 @@ class EmployeeCore extends ObjectModel
'id_profile' => array('type' => self::TYPE_INT, 'validate' => 'isInt', 'required' => true),
'bo_color' => array('type' => self::TYPE_STRING, 'validate' => 'isColor', 'size' => 32),
'bo_theme' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 32),
'bo_width' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
'bo_show_screencast' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
'stats_date_from' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
'stats_date_to' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
+1
View File
@@ -1282,6 +1282,7 @@ class AdminControllerCore extends Controller
'brightness' => Tools::getBrightness($bo_color) < 128 ? 'white' : '#383838',
'lang_iso' => $this->context->language->iso_code,
'link' => $this->context->link,
'bo_width' => (int)$this->context->employee->bo_width,
'bo_color' => isset($this->context->employee->bo_color) ? Tools::htmlentitiesUTF8($this->context->employee->bo_color) : null,
'shop_name' => Configuration::get('PS_SHOP_NAME'),
'show_new_orders' => Configuration::get('PS_SHOW_NEW_ORDERS'),
@@ -188,6 +188,13 @@ class AdminEmployeesControllerCore extends AdminController
'size' => 20,
'desc' => $this->l('Back office background will be displayed in this color. HTML colors only (e.g.,').' "lightblue", "#CC6600")'
),
array(
'type' => 'text',
'label' => $this->l('Back office width'),
'name' => 'bo_width',
'size' => 10,
'desc' => $this->l('Back office width, in pixels. The value "0" means that the back office width will be flexible.')
),
array(
'type' => 'select',
'label' => $this->l('Language:'),
+1
View File
@@ -692,6 +692,7 @@ CREATE TABLE `PREFIX_employee` (
`stats_date_to` date default NULL,
`bo_color` varchar(32) default NULL,
`bo_theme` varchar(32) default NULL,
`bo_width` int(10) unsigned NOT NULL DEFAULT 0,
`bo_show_screencast` tinyint(1) NOT NULL default '1',
`active` tinyint(1) unsigned NOT NULL default '0',
`id_last_order` tinyint(1) unsigned NOT NULL default '0',
+2
View File
@@ -5,3 +5,5 @@ SET NAMES 'utf8';
ALTER TABLE `PREFIX_cart_rule` ADD `gift_product_attribute` int(10) unsigned NOT NULL default 0 AFTER `gift_product`;
UPDATE `PREFIX_product` set is_virtual = 1 WHERE id_product IN (SELECT id_product FROM `PREFIX_product_download` WHERE active = 1);
ALTER TABLE `PREFIX_employee` ADD `bo_width` int(10) unsigned NOT NULL DEFAULT 0 AFTER `bo_theme`;