diff --git a/modules/themeconfigurator/css/index.php b/modules/themeconfigurator/css/index.php new file mode 100644 index 000000000..69b76d92d --- /dev/null +++ b/modules/themeconfigurator/css/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2013 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../../../'); +exit; \ No newline at end of file diff --git a/modules/themeconfigurator/css/live_configurator.css b/modules/themeconfigurator/css/live_configurator.css new file mode 100644 index 000000000..f7cd40dc2 --- /dev/null +++ b/modules/themeconfigurator/css/live_configurator.css @@ -0,0 +1,183 @@ +/* +* 2007-2013 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2013 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +#gear-right{ + background: #333333; + display: block; + height: 50px; + left: 215px; + position: fixed; + top: 90px; + width: 50px; + z-index: 20; +} + +#gear-right i{ + display: block; + padding-top: 10px; + text-align: center; +} + +#tool_customization{ + position: fixed; + left: 0; + top: 90px; + z-index: 20; + height: auto; + width: 215px; + background: #333333 +} + +#tool_customization p{ + padding: 15px; + color:#ffffff; + font-size: 13px; + text-shadow: 0.1em 0.1em 0.05em #000000 +} + +#tool_customization p span{ + color:#8d8c8c; + font-size: 11px; +} + +#tool_customization .list-tools{ + background: #484848; + border:1px solid #595959; + border-left: none; + border-right:none; + height:50px; +} + +#tool_customization .list-tools p{font-weight: bold;} + +#tool_customization .list-tools i{padding-top: 3px} + +#tool_customization #color-box{padding: 15px} + +#tool_customization #color-box ul li{ + display: inline-block; + border: 1px solid #595959; + height:27px; + width: 27px; + margin:5px 5px 5px 0; +} + +#tool_customization #color-box .color-theme1{ + display:block; + width:0px; + height:0px; + border-left-color:transparent !important; + border-top-color:transparent !important; + position: relative; + z-index: 1 +} + +#tool_customization #color-box .color-theme2{ + display:block; + width:25px; + height:25px; + position: relative; + top: -26px; +} + +#tool_customization #color-box .theme1 .color1{border:13px solid #ffffff;} +#tool_customization #color-box .theme1 .color2{background: #484848;} + +#tool_customization #color-box .theme2 .color1{border:13px solid #f6f6f6;} +#tool_customization #color-box .theme2 .color2{background: #f2404e;} + +#tool_customization #color-box .theme3 .color1{border:13px solid #333333;} +#tool_customization #color-box .theme3 .color2{background: #545454;} + +#tool_customization #color-box .theme4 .color1{border:13px solid #272727;} +#tool_customization #color-box .theme4 .color2{background: #eac22d;} + +#tool_customization #color-box .theme5 .color1{border:13px solid #ffffff;} +#tool_customization #color-box .theme5 .color2{background: #729f42;} + +#tool_customization #color-box .theme6 .color1{border:13px solid #f5f1e8;} +#tool_customization #color-box .theme6 .color2{background: #b04444;} + +#tool_customization #color-box .theme7 .color1{border:13px solid #f1f1f1;} +#tool_customization #color-box .theme7 .color2{background: #317081;} + +#tool_customization #color-box .theme8 .color1{border:13px solid #fcfcfc;} +#tool_customization #color-box .theme8 .color2{background: #43bebc;} + +#tool_customization #color-box .theme9 .color1{border:13px solid #f9f6ed;} +#tool_customization #color-box .theme9 .color2{background: #eea200;} + +#tool_customization #font-box{padding:0 15px 15px;} +#tool_customization #font-box p{ + padding:0; + margin: 15px 0 5px; + color:#9c9b9b; +} + +#tool_customization #font-box .font-list{ + background: #484848; + border:1px solid #595959; + height:30px; + width:180px; + color:#ffffff; +} + +#tool_customization #font-box .font-list li{clear:both;padding-right: 10px;} + +#tool_customization #font-box .font-list li p{ + display: inline-block; + margin: 0; + padding: 5px 15px; + color:#9c9b9b; + text-shadow: 0 0 0 transparent; +} + +#tool_customization #font-box .font-list li i{padding-top: 6px} + + +#tool_customization .btn-tools{ + background: #484848; + border:1px solid #595959; + border-left: none; + border-right:none; + height: 56px; + padding: 10px 15px; +} + +#tool_customization .btn{font-weight: bold;} + +#tool_customization .btn-1{ + background: #727171; + color: #ffffff; + text-shadow: 0.1em 0.1em 0.05em #000000 +} +#tool_customization .btn-2{ + background: #ffffff; + color: #3a3939; +} + +#tool_customization #block-advertisement{ + padding: 15px +} \ No newline at end of file diff --git a/modules/themeconfigurator/img/en/advertisement.png b/modules/themeconfigurator/img/en/advertisement.png new file mode 100644 index 000000000..0fc600890 Binary files /dev/null and b/modules/themeconfigurator/img/en/advertisement.png differ diff --git a/modules/themeconfigurator/img/en/index.php b/modules/themeconfigurator/img/en/index.php new file mode 100644 index 000000000..54b3024eb --- /dev/null +++ b/modules/themeconfigurator/img/en/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2013 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../../../../'); +exit; \ No newline at end of file diff --git a/modules/themeconfigurator/img/index.php b/modules/themeconfigurator/img/index.php new file mode 100644 index 000000000..69b76d92d --- /dev/null +++ b/modules/themeconfigurator/img/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2013 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../../../'); +exit; \ No newline at end of file diff --git a/modules/themeconfigurator/js/live_configurator.js b/modules/themeconfigurator/js/live_configurator.js new file mode 100644 index 000000000..83a073d80 --- /dev/null +++ b/modules/themeconfigurator/js/live_configurator.js @@ -0,0 +1,36 @@ +/* +* 2007-2013 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2013 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +$(document).ready( + function () + { + $('#color-box').find('li').click( + function() + { + $('#theme').val($(this).attr('class')); + } + ); + } +); \ No newline at end of file diff --git a/modules/themeconfigurator/themeconfigurator.php b/modules/themeconfigurator/themeconfigurator.php index 97114461e..ca1f0def3 100644 --- a/modules/themeconfigurator/themeconfigurator.php +++ b/modules/themeconfigurator/themeconfigurator.php @@ -40,7 +40,55 @@ class ThemeConfigurator extends Module $this->bootstrap = true; } - + public function install() + { + $themes_colors = array('theme1', 'theme2', 'theme3', 'theme4', 'theme5', 'theme6', 'theme7', 'theme8', 'theme9'); + $themes_fonts = array( + 'Georgia, serif', + '"Palatino Linotype", "Book Antiqua", Palatino, serif', + '"Times New Roman", Times, serif', + 'Arial, Helvetica, sans-serif', + '"Arial Black", Gadget, sans-serif', + 'Impact, Charcoal, sans-serif', + '"Lucida Sans Unicode", "Lucida Grande", sans-serif', + 'Tahoma, Geneva, sans-serif', + '"Trebuchet MS", Helvetica, sans-serif', + 'Verdana, Geneva, sans-serif', + '"Courier New", Courier, monospace', + '"Lucida Console", Monaco, monospace' + ); + + return (parent::install() + && $this->registerHook('top') + && Configuration::updateValue('PS_TC_THEMES', serialize($themes_colors)) + && Configuration::updateValue('PS_TC_THEMES_FONTS', serialize($themes_fonts))); + } + + public function hookTop($params) + { + if ((int)Tools::getValue('live_configurator', 0) == 1) + { + if (Tools::isSubmit('submitLiveConfigurator')) + { + Configuration::updateValue('PS_TC_THEME', Tools::getValue('theme')); + Configuration::updateValue('PS_TC_TEXT_PAGE_FONT', Tools::getValue('text-page-font')); + Configuration::updateValue('PS_TC_TEXT_MENU_FONT', Tools::getValue('text-menu-font')); + Configuration::updateValue('PS_TC_PRODUCT_NAME_FONT', Tools::getValue('product-name-font')); + } + + $this->context->controller->addCSS($this->_path.'css/live_configurator.css'); + $this->context->controller->addJS($this->_path.'js/live_configurator.js'); + + $this->smarty->assign(array( + 'themes_colors' => unserialize(Configuration::get('PS_TC_THEMES_COLORS')), + 'themes_fonts' => unserialize(Configuration::get('PS_TC_THEMES_FONTS')), + 'advertisement_image' => $this->_path.'/img/'.$this->context->language->iso_code.'/advertisement.png', + 'advertisement_text' => $this->l('Over 500+ PrestaShop Premium Templates! Browse Now!') + )); + return $this->display(__FILE__, 'live_configurator.tpl'); + } + } + public function getContent() { if (Tools::isSubmit('submitModule')) @@ -76,7 +124,6 @@ class ThemeConfigurator extends Module public function renderForm() { - $inputs = array(); foreach ($this->getConfigurableModules() as $module) $inputs[] = array( @@ -107,7 +154,7 @@ class ThemeConfigurator extends Module 'input' => $inputs, 'submit' => array( 'title' => $this->l('Save'), - 'class' => 'btn btn-primary') + 'class' => 'btn btn-default') ), ); diff --git a/modules/themeconfigurator/views/index.php b/modules/themeconfigurator/views/index.php new file mode 100644 index 000000000..69b76d92d --- /dev/null +++ b/modules/themeconfigurator/views/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2013 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../../../'); +exit; \ No newline at end of file diff --git a/modules/themeconfigurator/views/templates/hook/index.php b/modules/themeconfigurator/views/templates/hook/index.php new file mode 100644 index 000000000..422fa9d45 --- /dev/null +++ b/modules/themeconfigurator/views/templates/hook/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2013 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../../../../../'); +exit; \ No newline at end of file diff --git a/modules/themeconfigurator/views/templates/hook/live_configurator.tpl b/modules/themeconfigurator/views/templates/hook/live_configurator.tpl new file mode 100644 index 000000000..06e8b9e63 --- /dev/null +++ b/modules/themeconfigurator/views/templates/hook/live_configurator.tpl @@ -0,0 +1,90 @@ +{* +* 2007-2013 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2013 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +
+ +
+
+ +
+

+ {l s='The customization tool allows you to make color and font changes in your theme.' mod='themeconfigurator'}

+ + {l s='Only you, as a merchant can see this tool (as you are currently logged in your Back-office), your visitors will not see this tool.' mod='themeconfigurator'} + +

+
+

+ {l s='Color theme' mod='themeconfigurator'} + +

+
+ {if isset($themes_colors)} +
+
    + {foreach $themes_colors as $theme} +
  • +
    +
    +
  • + {/foreach} +
+
+ {/if} +
+

+ {l s='Font' mod='themeconfigurator'} + +

+
+
+

{l s='Text page' mod='themeconfigurator'}

+ +

{l s='Text menu parrent normal' mod='themeconfigurator'}

+ +

{l s='Product name' mod='themeconfigurator'}

+ +
+
+ + +
+
+ {$advertisement_text} +
+
+
\ No newline at end of file diff --git a/modules/themeconfigurator/views/templates/index.php b/modules/themeconfigurator/views/templates/index.php new file mode 100644 index 000000000..54b3024eb --- /dev/null +++ b/modules/themeconfigurator/views/templates/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2013 PrestaShop SA + +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../../../../'); +exit; \ No newline at end of file