// Themeconfigurator

This commit is contained in:
Jerome Nadaud
2013-11-18 22:16:26 +01:00
parent fb0118e456
commit 639a56421a
8 changed files with 44 additions and 8 deletions
@@ -29,7 +29,7 @@
height: 50px;
left: 215px;
position: fixed;
top: 90px;
top: 150px;
width: 50px;
z-index: 20;
}
@@ -43,7 +43,7 @@
#tool_customization{
position: fixed;
left: 0;
top: 90px;
top: 150px;
z-index: 20;
height: auto;
width: 215px;
@@ -1,183 +0,0 @@
body {
background: #282828;
}
.header-container,
.columns-container {
background: #f6f6f6;
}
#header {
background: none;
}
#header .header-row {
background: #dadada;
}
#header .header-row .shop-phone {
color: #333333;
}
#header .header-row .shop-phone i,
#header .header-row .shop-phone strong {
color: #f44051;
}
#header #currencies-block-top,
#header #languages-block-top,
#header .header-row #header_user_info {
border-color: #c6c6c6;
}
#header #currencies-block-top div.current,
#header #languages-block-top div.current,
#header .header-row #header_user_info a {
color: #333333;
}
#header #currencies-block-top div.current:hover, #header #currencies-block-top div.current.active,
#header #languages-block-top div.current:hover,
#header #languages-block-top div.current.active,
#header .header-row #header_user_info a:hover,
#header .header-row #header_user_info a.active {
background: #b7b7b7;
color: white;
}
#header #currencies-block-top div.current strong,
#header #languages-block-top div.current strong {
color: #333333;
}
#header #currencies-block-top div.current:hover strong, #header #currencies-block-top div.current:hover:after, #header #currencies-block-top div.current.active strong, #header #currencies-block-top div.current.active:after,
#header #languages-block-top div.current:hover strong,
#header #languages-block-top div.current:hover:after,
#header #languages-block-top div.current.active strong,
#header #languages-block-top div.current.active:after {
background: #b7b7b7;
color: white;
}
#header #contact-link {
border-color: #c6c6c6;
}
#header #contact-link a {
color: #333333;
}
#header #contact-link a:hover, #header #contact-link a.active {
background: #b7b7b7;
color: white;
}
#search_block_top .btn.button-search {
background: #f44051;
}
#search_block_top .btn.button-search:hover {
color: white;
background: #333333;
}
#header_right #header_user #shopping_cart a {
background: #f44051;
color: white;
}
#header_right #header_user #shopping_cart a:after {
color: white;
}
#header_right #header_user #shopping_cart a:hover {
color: white;
background: #333333;
}
.sf-menu {
background: white;
border-bottom: 3px solid #e8e8e8;
}
.sf-menu > li {
border-right: 1px solid #e8e8e8;
}
.sf-menu > li a {
border-bottom: 3px solid #e8e8e8;
}
.sf-menu > li.sfHover > a, .sf-menu > li > a:hover, .sf-menu > li.sfHoverForce > a {
color: #fff;
background: #f44051;
border-bottom-color: #ce2434;
}
#home-page-tabs {
background: #f6f6f6;
}
#home-page-tabs > li.active a,
#home-page-tabs > li a:hover {
background: #f44051;
color: white;
}
.new,
.sale {
background: #f44051;
}
.new:before, .new:after,
.sale:before,
.sale:after {
border-color: #ad2b34 transparent transparent transparent;
}
ul.product_list.grid > li .product-container {
background: #f6f6f6;
}
ul.product_list.grid > li .product-container .product-image-container {
background: white;
}
ul.product_list.grid > li .product-container .product-image-container .product_img_link {
background: #fbfbfb;
}
ul.product_list.grid > li .product-container .product-image-container .product_img_link img {
background: #fbfbfb;
}
.button.lnk_view {
text-shadow: none;
padding: 0;
border: none;
}
.button.lnk_view span {
border: none;
padding: 12px 16px;
background: #333333;
color: white;
}
.button.lnk_view:hover span {
background: #f44051;
}
#cmsinfo_block em {
background: #f44051;
}
#facebook_block, #cmsinfo_block {
background: #e8e8e8;
}
#cmsinfo_block,
#cmsinfo_block > div + div {
border-color: #d0d0d0;
}
.footer-container #footer #social_block {
background: #1b1b1b;
padding-bottom: 15px;
}
.footer-container {
background: #1b1b1b;
}
@media (min-width: 768px) {
.footer-container {
background: url(../img/footer-bg1.gif) repeat-x;
}
}
#footer #newsletter_block_left .form-group .form-control {
background: #1b1b1b;
}
#footer #newsletter_block_left .form-group .button-small {
color: #f44051;
}
.footer-container #footer #social_block ul li a:hover {
color: #f44051;
}
@@ -1,200 +0,0 @@
body {
background: #232323;
}
.header-container,
.columns-container {
background: #333333;
}
#header {
background: none;
}
#header .header-row {
background: #545454;
}
#header .header-row .shop-phone {
color: white;
text-shadow: 0 1px #404040;
}
#header .header-row .shop-phone i,
#header .header-row .shop-phone strong {
color: #aaaaaa;
text-shadow: 0 1px #404040;
}
#header #currencies-block-top,
#header #languages-block-top,
#header .header-row #header_user_info {
border-color: #656565;
}
#header #currencies-block-top div.current,
#header #languages-block-top div.current,
#header .header-row #header_user_info a {
color: white;
}
#header #currencies-block-top div.current:hover, #header #currencies-block-top div.current.active,
#header #languages-block-top div.current:hover,
#header #languages-block-top div.current.active,
#header .header-row #header_user_info a:hover,
#header .header-row #header_user_info a.active {
color: white;
}
#header #currencies-block-top div.current,
#header #languages-block-top div.current {
padding-bottom: 11px;
}
#header #currencies-block-top div.current strong, #header #currencies-block-top div.current:after,
#header #languages-block-top div.current strong,
#header #languages-block-top div.current:after {
color: white;
}
#header #currencies-block-top div.current:hover strong, #header #currencies-block-top div.current:hover:after, #header #currencies-block-top div.current.active strong, #header #currencies-block-top div.current.active:after,
#header #languages-block-top div.current:hover strong,
#header #languages-block-top div.current:hover:after,
#header #languages-block-top div.current.active strong,
#header #languages-block-top div.current.active:after {
background: #2b2b2b;
color: white;
}
#header #contact-link {
border-color: #656565;
}
#header #contact-link a {
color: white;
}
#header #contact-link a:hover, #header #contact-link a.active {
background: #2b2b2b;
color: white;
}
#search_block_top .btn.button-search {
background: #666666;
}
#search_block_top .btn.button-search:hover {
color: white;
background: #333333;
}
#search_block_top #search_query_top {
background: white;
color: #333333;
}
#header_right #header_user #shopping_cart a {
background: #666666;
color: white;
}
#header_right #header_user #shopping_cart a:after {
color: white;
}
#header_right #header_user #shopping_cart a:hover {
color: white;
background: #333333;
}
.sf-menu {
background: white;
border: 1px solid #f2f2f2;
border-bottom: 3px solid #f2f2f2;
}
.sf-menu > li {
border-right: 1px solid #d6d4d4;
}
.sf-menu > li a {
border-bottom: 3px solid #f2f2f2;
}
.sf-menu > li.sfHover > a, .sf-menu > li > a:hover, .sf-menu > li.sfHoverForce > a {
color: #fff;
background: #666666;
border-bottom-color: #666666;
}
#home-page-tabs {
background: white;
}
#home-page-tabs > li.active a,
#home-page-tabs > li a:hover {
background: #333333;
color: white;
}
.new,
.sale {
background: #f44051;
}
.new:before, .new:after,
.sale:before,
.sale:after {
border-color: #f44051 transparent transparent transparent;
}
ul.product_list.grid > li .product-container {
background: white;
}
ul.product_list.grid > li .product-container .product-image-container {
background: #474747;
}
ul.product_list.grid > li .product-container .product-image-container .product_img_link {
background: #474747;
}
ul.product_list.grid > li .product-container .product-image-container .product_img_link img {
background: #474747;
}
ul.product_list.grid > li:hover .product-container {
background: #5c5c5c;
}
ul.product_list.grid > li:hover .product-container .product-name {
color: #aaa;
}
ul.product_list.grid > li:hover .product-container .functional-buttons div a, ul.product_list.grid > li:hover .product-container ul.product_list.grid > li .product-container .functional-buttons div label {
color: #aaa;
}
ul.product_list.grid > li:hover .product-container .functional-buttons div a:hover, ul.product_list.grid > li:hover .product-container ul.product_list.grid > li .product-container .functional-buttons div label:hover {
color: #fff;
}
#cmsinfo_block em {
background: #666666;
}
#facebook_block, #cmsinfo_block {
background: #454545;
}
#facebook_block h4, #cmsinfo_block h4 {
color: white;
}
#cmsinfo_block h3,
#cmsinfo_block .dark {
color: white;
}
#cmsinfo_block,
#cmsinfo_block > div + div {
border-color: #1b1b1b;
}
.footer-container {
background: #1b1b1b;
}
@media (min-width: 768px) {
.footer-container {
background: url(../img/footer-bg1.gif) repeat-x;
}
}
.footer-container #footer #social_block {
background: #1b1b1b;
}
#footer #newsletter_block_left .form-group .form-control {
background: #1b1b1b;
}
#footer #newsletter_block_left .form-group .button-small {
color: #666666;
}
.footer-container #footer #social_block ul li a:hover {
color: white;
}
@@ -1,222 +0,0 @@
body {
background: #333333;
}
.header-container,
.columns-container {
background: #fff;
}
#header {
background: none;
}
#header .header-row {
background: #333333;
}
#header .header-row .shop-phone {
color: #777;
}
#header .header-row .shop-phone i,
#header .header-row .shop-phone strong {
color: #719f41;
}
#header #currencies-block-top,
#header #languages-block-top,
#header .header-row #header_user_info {
border-color: #515151;
}
#header #currencies-block-top div.current,
#header #languages-block-top div.current,
#header .header-row #header_user_info a {
color: white;
}
#header #currencies-block-top div.current:hover, #header #currencies-block-top div.current.active,
#header #languages-block-top div.current:hover,
#header #languages-block-top div.current.active,
#header .header-row #header_user_info a:hover,
#header .header-row #header_user_info a.active {
background: #2b2b2b;
color: white;
}
#header #currencies-block-top div.current strong,
#header #languages-block-top div.current strong {
color: #333333;
}
#header #currencies-block-top div.current:after,
#header #currencies-block-top div.current strong,
#header #languages-block-top div.current:after,
#header #languages-block-top div.current strong {
color: white;
}
#header #currencies-block-top div.current:hover strong, #header #currencies-block-top div.current:hover:after, #header #currencies-block-top div.current.active strong, #header #currencies-block-top div.current.active:after,
#header #languages-block-top div.current:hover strong,
#header #languages-block-top div.current:hover:after,
#header #languages-block-top div.current.active strong,
#header #languages-block-top div.current.active:after {
color: white;
}
#header #contact-link {
border-color: #515151;
}
#header #contact-link a {
color: white;
}
#header #contact-link a:hover, #header #contact-link a.active {
background: #2b2b2b;
color: white;
}
#search_block_top .btn.button-search {
background: #719f41;
text-shadow: 0 1px #567931;
}
#search_block_top .btn.button-search:hover {
color: white;
background: #333333;
text-shadow: 0 1px #333;
}
#search_block_top #search_query_top {
color: #686666;
}
#header_right #header_user #shopping_cart a {
background: #719f41;
color: white;
text-shadow: 0 1px #567931;
}
#header_right #header_user #shopping_cart a:after {
color: white;
}
#header_right #header_user #shopping_cart a:hover {
color: white;
text-shadow: 0 1px #333;
background: #333333;
}
.sf-menu {
background: #f6f6f6;
border-bottom: 3px solid #e9e9e9;
}
.sf-menu > li {
border-right: 1px solid #d6d4d4;
}
.sf-menu > li a {
border-bottom: 3px solid #e9e9e9;
}
.sf-menu > li.sfHover > a, .sf-menu > li > a:hover, .sf-menu > li.sfHoverForce > a {
color: #fff;
background: #719f41;
border-bottom-color: #598b24;
}
#home-page-tabs {
background: white;
}
#home-page-tabs > li.active a,
#home-page-tabs > li a:hover {
background: #719f41;
color: white;
}
.new,
.sale {
background: #719f41;
}
.new:before, .new:after,
.sale:before,
.sale:after {
border-color: #719f41 transparent transparent transparent;
}
ul.product_list.grid > li .product-container {
background: white;
}
ul.product_list.grid > li .product-container .product-image-container {
background: white;
}
ul.product_list.grid > li .product-container .product-image-container .product_img_link {
background: white;
}
ul.product_list.grid > li .product-container .product-image-container .product_img_link img {
background: white;
}
.price.product-price {
color: #719f41;
}
.price-percent-reduction {
background: #719f41;
border-color: #719f41;
}
.button.lnk_view {
text-shadow: none;
padding: 0;
border: none;
}
.button.lnk_view span {
border: none;
padding: 12px 16px;
background: #333333;
color: white;
}
.button.lnk_view:hover span {
background: #719f41;
}
#cmsinfo_block em {
background: #333333;
}
#facebook_block, #cmsinfo_block {
background: #e8e8e8;
}
#cmsinfo_block,
#cmsinfo_block > div + div {
border-color: #d0d0d0;
}
.footer-container #footer #social_block {
background: #3f3f3f;
padding-bottom: 15px;
}
.footer-container {
background: #3f3f3f;
}
@media (min-width: 768px) {
.footer-container {
background: url(../img/footer-bg.gif) repeat-x;
}
}
.footer-container #footer #social_block ul li a:hover {
color: #719f41;
}
#footer #newsletter_block_left .form-group .form-control {
background: #3f3f3f;
}
#footer #newsletter_block_left h4,
.footer-container #footer #social_block h4 {
color: #fff;
}
.footer-container #footer h4,
.footer-container #footer h4 a {
color: #719f41;
}
.footer-container #footer .bottom-footer {
color: #719f41;
}
.footer-container #footer .bottom-footer a {
color: #719f41;
}
.footer-container #footer .bottom-footer a:hover {
color: #fff;
}
@@ -1,183 +0,0 @@
body {
background: #282828;
}
.header-container,
.columns-container {
background: #f7f5eb;
}
#header {
background: none;
}
#header .header-row {
background: #333333;
}
#header .header-row .shop-phone {
color: white;
}
#header .header-row .shop-phone i,
#header .header-row .shop-phone strong {
color: #eea200;
}
#header #currencies-block-top,
#header #languages-block-top,
#header .header-row #header_user_info {
border-color: #515151;
}
#header #currencies-block-top div.current,
#header #languages-block-top div.current,
#header .header-row #header_user_info a {
color: white;
}
#header #currencies-block-top div.current:hover, #header #currencies-block-top div.current.active,
#header #languages-block-top div.current:hover,
#header #languages-block-top div.current.active,
#header .header-row #header_user_info a:hover,
#header .header-row #header_user_info a.active {
background: #b7b7b7;
color: white;
}
#header #currencies-block-top div.current strong,
#header #languages-block-top div.current strong {
color: white;
}
#header #currencies-block-top div.current:hover strong, #header #currencies-block-top div.current:hover:after, #header #currencies-block-top div.current.active strong, #header #currencies-block-top div.current.active:after,
#header #languages-block-top div.current:hover strong,
#header #languages-block-top div.current:hover:after,
#header #languages-block-top div.current.active strong,
#header #languages-block-top div.current.active:after {
background: #b7b7b7;
color: white;
}
#header #contact-link {
border-color: #515151;
}
#header #contact-link a {
color: white;
}
#header #contact-link a:hover, #header #contact-link a.active {
background: #b7b7b7;
color: white;
}
#search_block_top .btn.button-search {
background: #eea200;
}
#search_block_top .btn.button-search:hover {
color: white;
background: #b7b7b7;
}
#header_right #header_user #shopping_cart a {
background: #eea200;
color: white;
}
#header_right #header_user #shopping_cart a:after {
color: white;
}
#header_right #header_user #shopping_cart a:hover {
color: white;
background: #b7b7b7;
}
.sf-menu {
background: #fffef6;
border-bottom: 3px solid #e2dec8;
}
.sf-menu > li {
border-right: 1px solid #e2dec8;
}
.sf-menu > li a {
border-bottom: 3px solid #e2dec8;
}
.sf-menu > li.sfHover > a, .sf-menu > li > a:hover, .sf-menu > li.sfHoverForce > a {
color: #fff;
background: #eea200;
border-bottom-color: #da9400;
}
#home-page-tabs {
background: none;
}
#home-page-tabs > li.active a,
#home-page-tabs > li a:hover {
background: #eea200;
color: white;
}
.new,
.sale {
background: #eea200;
}
.new:before, .new:after,
.sale:before,
.sale:after {
border-color: #eea200 transparent transparent transparent;
}
ul.product_list.grid > li .product-container {
background: none;
}
ul.product_list.grid > li .product-container .product-image-container {
background: white;
}
ul.product_list.grid > li .product-container .product-image-container .product_img_link {
background: #f1e8e3;
}
ul.product_list.grid > li .product-container .product-image-container .product_img_link img {
background: #f1e8e3;
}
.button.lnk_view {
text-shadow: none;
padding: 0;
border: none;
}
.button.lnk_view span {
border: 1px solid #9a9a9a;
padding: 12px 16px;
background: #f2f2f2;
color: white;
}
.button.lnk_view:hover span {
background: #b7b7b7;
}
#cmsinfo_block em {
background: #eea200;
}
#facebook_block, #cmsinfo_block {
background: #f0eee1;
}
#cmsinfo_block,
#cmsinfo_block > div + div {
border-color: #e9e6d6;
}
.footer-container #footer #social_block {
background: none;
padding-bottom: 15px;
}
.footer-container {
background: #3f3f3f;
}
@media (min-width: 768px) {
.footer-container {
background: url(../img/footer-bg.gif) repeat-x;
}
}
#footer #newsletter_block_left .form-group .form-control {
background: #3c3c3c;
}
#footer #newsletter_block_left .form-group .button-small {
color: #eea200;
}
.footer-container #footer #social_block ul li a:hover {
color: #eea200;
}
@@ -30,6 +30,7 @@ $(document).ready(
function()
{
$('#theme').val($(this).attr('class'));
$(this).closest('form').submit();
}
);
@@ -80,5 +81,20 @@ $(document).ready(
}
}
);
$('#font').change(
function()
{
$(document.body).css('font-family', $('#font option:selected').text());
}
);
$('#reset').click(
function()
{
$('#theme').val('');
$(this).closest('form').submit();
}
);
}
);
@@ -189,7 +189,18 @@ class ThemeConfigurator extends Module
public function hookdisplayHeader($params)
{
$this->context->controller->addCss($this->_path.'views/css/hooks.css', 'all');
$this->context->controller->addCss($this->_path.'views/css/hooks.css', 'all');
if ((int)Tools::getValue('live_configurator', 0) == 1)
{
if (Tools::getValue('theme'))
$this->context->controller->addCss($this->smarty->smarty->tpl_vars['css_dir']->value.Tools::getValue('theme').'.css', 'all');
}
else
{
if (Configuration::get('PS_TC_THEME') != '')
$this->context->controller->addCss($this->smarty->smarty->tpl_vars['css_dir']->value.Tools::getValue('theme').'.css', 'all');
}
}
public function hookDisplayTop()
@@ -208,6 +219,7 @@ class ThemeConfigurator extends Module
$this->smarty->assign(array(
'themes' => unserialize(Configuration::get('PS_TC_THEMES')),
'fonts' => unserialize(Configuration::get('PS_TC_FONTS')),
'theme' => Tools::getValue('theme', ''),
'advertisement_image' => $this->_path.'/img/'.$this->context->language->iso_code.'/advertisement.png',
'advertisement_text' => $this->l('Over 500+ PrestaShop Premium Templates! Browse Now!')
));
@@ -532,6 +544,12 @@ class ThemeConfigurator extends Module
),
);
}
$inputs[] = array(
'type' => 'free',
'label' => $this->l('Live configurator'),
'name' => 'live-conf'
);
$fields_form = array(
'form' => array(
@@ -559,7 +577,8 @@ class ThemeConfigurator extends Module
$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(),
'fields_value' => array_merge($this->getConfigFieldsValues(),
array('live-conf' => '<a href="'.$this->context->link->getPageLink('index').'?live_configurator=1" class="btn btn-default" onclick="return !window.open($(this).attr(\'href\'));"><i class="icon-cogs"></i> Live configurator</a>')),
'languages' => $this->context->controller->getLanguages(),
'id_language' => $this->context->language->id
);
@@ -26,8 +26,8 @@
<div id="gear-right">
<i class="icon-cogs icon-2x icon-light"></i>
</div>
<form action="" method="post">
<input type="hidden" name="theme" id="theme" />
<form action="?live_configurator=1" method="post">
<input type="hidden" name="theme" id="theme" value="{$theme}"/>
<div id="tool_customization">
<p>
{l s='The customization tool allows you to make color and font changes in your theme.' mod='themeconfigurator'}<br /><br />
@@ -61,14 +61,15 @@
</div>
<div id="font-box">
<p>{l s='Global' mod='themeconfigurator'}</p>
<select name="font" class="font-list">
<select name="font" id="font" class="font-list">
<option value="">{l s='Choose a font' mod='themeconfigurator'}</option>
{foreach $fonts as $key => $font}
<option value="{$key}">{$font}</option>
{/foreach}
</select>
</div>
<div class="btn-tools">
<button type="reset" class="btn btn-1">{l s='Reset' mod='themeconfigurator'}</button>
<button type="reset" class="btn btn-1" id="reset">{l s='Reset' mod='themeconfigurator'}</button>
<button type="submit" class="btn btn-2" name="submitLiveConfigurator">{l s='Save' mod='themeconfigurator'}</button>
</div>
<div id="block-advertisement">