diff --git a/admin-dev/themes/default/css/admin-theme.css b/admin-dev/themes/default/css/admin-theme.css index 0257590a4..ad9bff087 100644 --- a/admin-dev/themes/default/css/admin-theme.css +++ b/admin-dev/themes/default/css/admin-theme.css @@ -3538,7 +3538,6 @@ a.link-social:hover { text-decoration: none; } #nav-mobile ul.menu li a:hover { background-color: #686d7d; color: white; } #nav-mobile ul.menu li a:hover i { color: white; } #nav-mobile ul.submenu { display: none; } -#nav-mobile #nav-mobile-submenu { z-index: 1200; } #nav-mobile #nav-mobile-submenu a:not(#nav-mobile-submenu-back) { font-size: 1.2em; padding-left: 50px; text-transform: none; } #nav-mobile a#nav-mobile-submenu-back { background-color: #454953; font-size: 1.5em; } #nav-mobile ul.menu.menu-close { -webkit-animation: fadeOutLeft 0.2s 0.2s ease both; -moz-animation: fadeOutLeft 0.2s 0.2s ease both; -ms-animation: fadeOutLeft 0.2s 0.2s ease both; -o-animation: fadeOutLeft 0.2s 0.2s ease both; animation: fadeOutLeft 0.2s 0.2s ease both; } @@ -3695,7 +3694,7 @@ td.actions { min-width: 200px; } label.control-label { font-size: 13px; font-weight: normal; color: #666666; } -label.control-label span.label-tooltip { text-decoration: none; font-size: 13px; background-color: #ebebeb; border: none; border-bottom: solid 1px #dfdfdf; padding: 0 5px; -webkit-border-radius: 3px; -moz-border-radius: 3px; -ms-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; } +label.control-label span.label-tooltip { text-decoration: none; font-size: 13px; color: #3586ae; background-color: #edf7fb; border: none; border-bottom: solid 1px #d8edf7; padding: 0 5px; -webkit-border-radius: 3px; -moz-border-radius: 3px; -ms-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; } label.required:before { content: "*"; color: red; font-size: 14px; position: relative; line-height: 12px; } @@ -3768,7 +3767,7 @@ textarea:focus, input[type="text"]:focus, input[type="password"]:focus, input[ty .switch .slide-button, .toggle p span { display: none; } -.switch { background-color: #d2d2d2; border-radius: 3px; } +.switch { background-color: #e9e9e9; border-radius: 3px; } .switch label { padding: 0; cursor: pointer; } @media only screen { .toggle { position: relative; padding: 0; margin-left: 100px; } @@ -3802,10 +3801,10 @@ textarea:focus, input[type="text"]:focus, input[type="password"]:focus, input[ty .toggle input:checked ~ .slide-button { right: 50%; } .toggle input:focus ~ .slide-button, .switch input:focus + label { outline: 1px dotted #888888; } .switch, .toggle { -webkit-animation: bugfix infinite 1s; } - .prestashop-switch { min-width: 150px; color: #666666; text-align: center; border-radius: 3px; -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 2px 5px 1px inset; box-shadow: rgba(0, 0, 0, 0.2) 0 2px 5px 1px inset; } + .prestashop-switch { min-width: 150px; color: #999999; text-align: center; border-radius: 3px; -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 2px 5px 1px inset; box-shadow: rgba(0, 0, 0, 0.2) 0 2px 5px 1px inset; } .prestashop-switch label { padding-top: 0 !important; font-weight: 500; } .prestashop-switch input:checked + label { color: #333333 !important; text-shadow: rgba(255, 255, 255, 0.7) 1px 1px 0; } - .prestashop-switch input:not(:checked) + label i { color: #666666 !important; } + .prestashop-switch input:not(:checked) + label i { color: #999999 !important; } .prestashop-switch .slide-button { position: relative; margin-right: 3px; color: white; } .prestashop-switch p { color: #333333; } .prestashop-switch span { color: white; } } diff --git a/admin-dev/themes/default/js/admin-theme.js b/admin-dev/themes/default/js/admin-theme.js index dd8081508..203774ebf 100755 --- a/admin-dev/themes/default/js/admin-theme.js +++ b/admin-dev/themes/default/js/admin-theme.js @@ -100,7 +100,6 @@ $( document ).ready(function() { function mobileNav() { //clean actual menu type - //$('body').removeClass('page-sidebar').removeClass('page-topbar').removeClass('page-sidebar-closed'); // get it in navigation whatever type it is. var navigation = $('#nav-sidebar,#nav-topbar'); var submenu = ""; @@ -137,7 +136,8 @@ $( document ).ready(function() { }); navigation.on('click.back','#nav-mobile-submenu-back',function(e){ e.preventDefault(); - navigation.find('.menu').removeClass('menu-close').show(submenu.addClass('menu-close')); + submenu.remove(); + navigation.find('.menu').removeClass('menu-close').show(); }); } @@ -147,10 +147,10 @@ $( document ).ready(function() { $('span.menu-collapse').html(''); navigation.off(); if ($('body').hasClass('page-sidebar')){ - navigation.attr('id',"nav-sidebar") + navigation.attr('id',"nav-sidebar"); navSidebar(); } else if ($('body').hasClass('page-sidebar')){ - navigation.attr('id',"nav-topbar") + navigation.attr('id',"nav-topbar"); navTopbar(); } } diff --git a/admin-dev/themes/default/js/modernizr-loads.js b/admin-dev/themes/default/js/modernizr-loads.js new file mode 100644 index 000000000..299598385 --- /dev/null +++ b/admin-dev/themes/default/js/modernizr-loads.js @@ -0,0 +1,8 @@ +Modernizr.load([ + { + test: window.matchMedia, + nope: ["themes/default/js/vendor/matchMedia.js", "themes/default/js/vendor/matchMedia.addListener.js"] + }, + "themes/default/js/vendor/enquire.js", + "themes/default/js/admin-theme.js" +]); \ No newline at end of file diff --git a/admin-dev/themes/default/js/vendor/matchMedia.addListener.js b/admin-dev/themes/default/js/vendor/matchMedia.addListener.js new file mode 100644 index 000000000..764232d94 --- /dev/null +++ b/admin-dev/themes/default/js/vendor/matchMedia.addListener.js @@ -0,0 +1,75 @@ +/*! matchMedia() polyfill addListener/removeListener extension. Author & copyright (c) 2012: Scott Jehl. Dual MIT/BSD license */ +(function(){ + // Bail out for browsers that have addListener support + if (window.matchMedia && window.matchMedia('all').addListener) { + return false; + } + + var localMatchMedia = window.matchMedia, + hasMediaQueries = localMatchMedia('only all').matches, + isListening = false, + timeoutID = 0, // setTimeout for debouncing 'handleChange' + queries = [], // Contains each 'mql' and associated 'listeners' if 'addListener' is used + handleChange = function(evt) { + // Debounce + clearTimeout(timeoutID); + + timeoutID = setTimeout(function() { + for (var i = 0, il = queries.length; i < il; i++) { + var mql = queries[i].mql, + listeners = queries[i].listeners || [], + matches = localMatchMedia(mql.media).matches; + + // Update mql.matches value and call listeners + // Fire listeners only if transitioning to or from matched state + if (matches !== mql.matches) { + mql.matches = matches; + + for (var j = 0, jl = listeners.length; j < jl; j++) { + listeners[j].call(window, mql); + } + } + } + }, 30); + }; + + window.matchMedia = function(media) { + var mql = localMatchMedia(media), + listeners = [], + index = 0; + + mql.addListener = function(listener) { + // Changes would not occur to css media type so return now (Affects IE <= 8) + if (!hasMediaQueries) { + return; + } + + // Set up 'resize' listener for browsers that support CSS3 media queries (Not for IE <= 8) + // There should only ever be 1 resize listener running for performance + if (!isListening) { + isListening = true; + window.addEventListener('resize', handleChange, true); + } + + // Push object only if it has not been pushed already + if (index === 0) { + index = queries.push({ + mql : mql, + listeners : listeners + }); + } + + listeners.push(listener); + }; + + mql.removeListener = function(listener) { + for (var i = 0, il = listeners.length; i < il; i++){ + if (listeners[i] === listener){ + listeners.splice(i, 1); + } + } + }; + + return mql; + }; +}()); diff --git a/admin-dev/themes/default/js/vendor/matchMedia.js b/admin-dev/themes/default/js/vendor/matchMedia.js new file mode 100644 index 000000000..0bfca11e6 --- /dev/null +++ b/admin-dev/themes/default/js/vendor/matchMedia.js @@ -0,0 +1,46 @@ +/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license */ + +window.matchMedia || (window.matchMedia = function() { + "use strict"; + + // For browsers that support matchMedium api such as IE 9 and webkit + var styleMedia = (window.styleMedia || window.media); + + // For those that don't support matchMedium + if (!styleMedia) { + var style = document.createElement('style'), + script = document.getElementsByTagName('script')[0], + info = null; + + style.type = 'text/css'; + style.id = 'matchmediajs-test'; + + script.parentNode.insertBefore(style, script); + + // 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers + info = ('getComputedStyle' in window) && window.getComputedStyle(style, null) || style.currentStyle; + + styleMedia = { + matchMedium: function(media) { + var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }'; + + // 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers + if (style.styleSheet) { + style.styleSheet.cssText = text; + } else { + style.textContent = text; + } + + // Test if media query is true or false + return info.width === '1px'; + } + }; + } + + return function(media) { + return { + matches: styleMedia.matchMedium(media || 'all'), + media: media || 'all' + }; + }; +}()); diff --git a/admin-dev/themes/default/js/vendor/modernizr.js b/admin-dev/themes/default/js/vendor/modernizr.js new file mode 100644 index 000000000..f67462315 --- /dev/null +++ b/admin-dev/themes/default/js/vendor/modernizr.js @@ -0,0 +1,4 @@ +/* Modernizr 2.6.3 (Custom Build) | MIT & BSD + * Build: http://modernizr.com/download/#-shiv-cssclasses-load + */ +;window.Modernizr=function(a,b,c){function u(a){j.cssText=a}function v(a,b){return u(prefixes.join(a+";")+(b||""))}function w(a,b){return typeof a===b}function x(a,b){return!!~(""+a).indexOf(b)}function y(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:w(f,"function")?f.bind(d||b):f}return!1}var d="2.6.3",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m={},n={},o={},p=[],q=p.slice,r,s={}.hasOwnProperty,t;!w(s,"undefined")&&!w(s.call,"undefined")?t=function(a,b){return s.call(a,b)}:t=function(a,b){return b in a&&w(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=q.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(q.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(q.call(arguments)))};return e});for(var z in m)t(m,z)&&(r=z.toLowerCase(),e[r]=m[z](),p.push((e[r]?"":"no-")+r));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)t(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},u(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+p.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f diff --git a/admin-dev/themes/default/template/controllers/modules/page.tpl b/admin-dev/themes/default/template/controllers/modules/page.tpl index 0761f1188..73f895cf5 100644 --- a/admin-dev/themes/default/template/controllers/modules/page.tpl +++ b/admin-dev/themes/default/template/controllers/modules/page.tpl @@ -37,7 +37,7 @@ {l s='Module file'} -
+
diff --git a/admin-dev/themes/default/template/controllers/products/helpers/uploader/ajax.tpl b/admin-dev/themes/default/template/controllers/products/helpers/uploader/ajax.tpl new file mode 100644 index 000000000..a80ab4b6b --- /dev/null +++ b/admin-dev/themes/default/template/controllers/products/helpers/uploader/ajax.tpl @@ -0,0 +1,180 @@ +{* +* 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 +*} +
+
+ + + +
+
+ + + + \ No newline at end of file diff --git a/admin-dev/themes/default/template/controllers/products/helpers/uploader/index.php b/admin-dev/themes/default/template/controllers/products/helpers/uploader/index.php new file mode 100644 index 000000000..c9b153f1b --- /dev/null +++ b/admin-dev/themes/default/template/controllers/products/helpers/uploader/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2013 PrestaShop SA +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 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/admin-dev/themes/default/template/controllers/products/images.tpl b/admin-dev/themes/default/template/controllers/products/images.tpl index caa7686c7..dc9458b16 100644 --- a/admin-dev/themes/default/template/controllers/products/images.tpl +++ b/admin-dev/themes/default/template/controllers/products/images.tpl @@ -35,40 +35,52 @@
- {l s='File:'} -
- -
-
- - - {if Tools::getValue('id_image')} - - {/if} + {$image_uploader}
-
- {foreach from=$languages item=language} -
- id}disabled="disabled"{/if} id="legend_{$language.id_lang}" name="legend_{$language.id_lang}" value="{$product->name[$language.id_lang]|escape:'htmlall':'UTF-8'}"/> -
{l s='Invalid characters:'} <>;=#{}
+ {foreach from=$languages item=language} + {if $languages|count > 1} +
+
+ {/if} + id}disabled="disabled"{/if} /> + {if $languages|count > 1} +
+
+ + +
- {/foreach} -
+ {/if} + {/foreach}
@@ -95,7 +107,7 @@ - image_id + legend legend @@ -129,6 +141,28 @@ var current_shop_id = {$current_shop_id|intval}; {literal} //Ready Function + + function imageLine(id, path, position, cover, shops, legend) + { + line = $("#lineType").html(); + line = line.replace(/image_id/g, id); + line = line.replace(/[a-z]{0,2}-default-small_default/g, path+'-small_default'); + line = line.replace(/image_path/g, path); + line = line.replace(/image_position/g, position); + line = line.replace(/legend/g, legend); + line = line.replace(/icon-check-empty/g, cover); + line = line.replace(//gi, ""); + line = line.replace(/<\/tbody>/gi, ""); + if (shops != false) + { + $.each(shops, function(key, value){ + if (value == 1) + line = line.replace('id="' + key + '' + id + '"','id="' + key + '' + id + '" checked=checked'); + }); + } + $("#imageList").append(line); + } + $(document).ready(function(){ {/literal} {foreach from=$images item=image} @@ -165,66 +199,6 @@ updateImagePosition(image_up); } }); - var filecheck = 1; - var params = new Array; - params['id_product'] = {/literal}{$id_product|intval}{literal}; - params['id_category'] = {/literal}{$id_category_default|intval}{literal}; - params['token'] = "{/literal}{$token}{literal}"; - params['tab'] = "AdminProducts"; - params['action'] = "addImage"; - params['ajax'] = 1; - uploader = new qq.FileUploader( - { - element: document.getElementById("file-uploader"), - action: "ajax-tab.php", - debug: false, - onComplete: function(id, fileName, responseJSON) - { - var percent = ((filecheck * 100) / nbfile); - $("#progressBarImage").progressbar({value: percent}); - if (percent != 100) - { - $("#imageUpload").html(parseInt(filecheck)); - $("#imageTotal").html(" / " + parseInt(nbfile) + " {/literal}{l s='Images'}{literal}"); - $("#progressBarImage").show(); - $("#showCounter").show(); - } - else - { - $("#progressBarImage").progressbar({value: 0}); - $("#progressBarImage").hide(); - $("#showCounter").hide(); - nbfile = 0; - filecheck = 0; - } - if (responseJSON.status == 'ok') - { - cover = "icon-check-empty"; - if (responseJSON.cover == "1") - cover = "icon-check-sign"; - imageLine(responseJSON.id, responseJSON.path, responseJSON.position, cover, responseJSON.shops, responseJSON.legend[{/literal}{$default_language|intval}{literal}]) - $("#imageTable tr:last").after(responseJSON.html); - $("#countImage").html(parseInt($("#countImage").html()) + 1); - $("#img" + id).remove(); - $("#imageTable").tableDnDUpdate(); - showSuccessMessage(responseJSON.name + " " + success_add); - } - else - showErrorMessage(responseJSON.error); - filecheck++; - }, - onSubmit: function(id, filename) - { - $('input[id^="legend_"]').each(function() - { - id = $(this).prop("id").replace("legend_", "legend[") + "]"; - params[id] = $(this).val(); - }); - uploader.setParams(params); - $("#imageTable").show(); - $("#listImage").append("
  • " + filename + "
  • "); - } - }); /** * on success function @@ -327,28 +301,11 @@ $("#img" + id).remove(); } - function imageLine(id, path, position, cover, shops, legend) - { - line = $("#lineType").html(); - line = line.replace(/image_id/g, legend); - line = line.replace(/[a-z]{0,2}-default-small_default/g, path+'-small_default'); - line = line.replace(/image_path/g, path); - line = line.replace(/image_position/g, position); - line = line.replace(/legend/g, legend); - line = line.replace(/icon-check-empty/g, cover); - line = line.replace(//gi, ""); - line = line.replace(/<\/tbody>/gi, ""); - if (shops != false) - { - $.each(shops, function(key, value){ - if (value == 1) - line = line.replace('id="' + key + '' + id + '"','id="' + key + '' + id + '" checked=checked'); - }); - } - $("#imageList").append(line); - } + $('.fancybox').fancybox(); }); + + hideOtherLanguage(default_language); {/literal}
    diff --git a/admin-dev/themes/default/template/helpers/uploader/ajax.tpl b/admin-dev/themes/default/template/helpers/uploader/ajax.tpl index e5ae31901..edec4e359 100644 --- a/admin-dev/themes/default/template/helpers/uploader/ajax.tpl +++ b/admin-dev/themes/default/template/helpers/uploader/ajax.tpl @@ -61,7 +61,7 @@ -
    @@ -195,7 +195,7 @@ $('#{$id}-add-button').on('click', function() { $('#{$id}-success').html('').parent().hide(); $('#{$id}-errors').html('').parent().hide(); - $('#{$id}-files-list').html('').parent().hide(); + $('#{$id}-files-list').parent().hide(); {$id}_total_files = 0; $('#{$id}').trigger('click'); }); diff --git a/admin-dev/themes/default/template/helpers/uploader/simple.tpl b/admin-dev/themes/default/template/helpers/uploader/simple.tpl index 0c1510d3e..8da9a642d 100644 --- a/admin-dev/themes/default/template/helpers/uploader/simple.tpl +++ b/admin-dev/themes/default/template/helpers/uploader/simple.tpl @@ -43,13 +43,6 @@
    {/if} -{if isset($thumb) && $thumb} -
    -
    - {$title} -
    -
    -{/if} {if isset($max_files) && $files|count >= $max_files}
    {l s='You have reached the limit (%s) of files to upload, please remove files to continue uploading' sprintf=$max_files}
    diff --git a/cache/class_index.php b/cache/class_index.php index 6eb35fa3f..aaa444638 100644 --- a/cache/class_index.php +++ b/cache/class_index.php @@ -366,6 +366,8 @@ 'HelperFormCore' => 'classes/helper/HelperForm.php', 'HelperHelpAccess' => '', 'HelperHelpAccessCore' => 'classes/helper/HelperHelpAccess.php', + 'HelperImageUploader' => '', + 'HelperImageUploaderCore' => 'classes/helper/HelperImageUploader.php', 'HelperKpi' => '', 'HelperKpiCore' => 'classes/helper/HelperKpi.php', 'HelperKpiRow' => '', diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index 16a1c5f9a..0908bf0fa 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -52,6 +52,7 @@ class AdminControllerCore extends Controller /** @var string Object identifier inside the associated table */ protected $identifier = false; + protected $identifier_name = 'name'; /** @var string Tab name */ public $className; @@ -1119,8 +1120,6 @@ class AdminControllerCore extends Controller if (!is_array($this->toolbar_title)) $this->toolbar_title = array($this->toolbar_title); - $title = implode(' '.Configuration::get('PS_NAVIGATION_PIPE').' ', $this->toolbar_title); - switch ($this->display) { case 'view': @@ -1135,9 +1134,14 @@ class AdminControllerCore extends Controller 'href' => $back, 'desc' => $this->l('Back to list') ); + $obj = $this->loadObject(true); + if (Validate::isLoadedObject($obj) && isset($obj->{$this->identifier_name}) && !empty($obj->{$this->identifier_name})) + { + array_pop($this->toolbar_title); + $this->toolbar_title[] = is_array($obj->{$this->identifier_name}) ? $obj->{$this->identifier_name}[$this->context->employee->id_lang] : $obj->{$this->identifier_name}; + } break; case 'add': - case 'edit': // Default save button - action dynamically handled in javascript $this->page_header_toolbar_btn['save'] = array( 'href' => '#', @@ -1154,6 +1158,14 @@ class AdminControllerCore extends Controller 'href' => $back, 'desc' => $this->l('Cancel') ); + case 'edit': + $obj = $this->loadObject(true); + if (Validate::isLoadedObject($obj) && isset($obj->{$this->identifier_name}) && !empty($obj->{$this->identifier_name})) + { + array_pop($this->toolbar_title); + $this->toolbar_title[] = sprintf($this->l('Edit: %s'), + is_array($obj->{$this->identifier_name}) ? $obj->{$this->identifier_name}[$this->context->employee->id_lang] : $obj->{$this->identifier_name}); + } break; case 'options': // Default save button - action dynamically handled in javascript @@ -1163,6 +1175,8 @@ class AdminControllerCore extends Controller ); } + $title = implode(' '.Configuration::get('PS_NAVIGATION_PIPE').' ', $this->toolbar_title); + if (is_array($this->page_header_toolbar_btn) && $this->page_header_toolbar_btn instanceof Traversable || trim($title) != '') @@ -1959,8 +1973,8 @@ class AdminControllerCore extends Controller //loads specific javascripts for the admin theme, bootstrap.js should be moved into /js root directory $this->addJS(__PS_BASE_URI__.$admin_webpath.'/themes/'.$this->bo_theme.'/js/vendor/bootstrap.js'); - $this->addJS(__PS_BASE_URI__.$admin_webpath.'/themes/'.$this->bo_theme.'/js/vendor/enquire.js'); - $this->addJS(__PS_BASE_URI__.$admin_webpath.'/themes/'.$this->bo_theme.'/js/admin-theme.js'); + $this->addJS(__PS_BASE_URI__.$admin_webpath.'/themes/'.$this->bo_theme.'/js/vendor/modernizr.js'); + $this->addJS(__PS_BASE_URI__.$admin_webpath.'/themes/'.$this->bo_theme.'/js/modernizr-loads.js'); if (!Tools::getValue('submitFormAjax')) { diff --git a/classes/helper/HelperForm.php b/classes/helper/HelperForm.php index 0c8554a4a..ec1c69178 100644 --- a/classes/helper/HelperForm.php +++ b/classes/helper/HelperForm.php @@ -140,9 +140,14 @@ class HelperFormCore extends Helper 'download_url' => isset($params['file'])?$params['file']:null ))); - $uploader->setThumb(isset($params['thumb'])?$params['thumb']:null); - $uploader->setTitle(isset($params['title'])?$params['title']:null); + if (isset($params['thumb']) && $params['thumb']) // Use for retrocompatibility + $uploader->setFiles(array( + 0 => array( + 'type' => HelperUploader::TYPE_IMAGE, + 'image' => isset($params['thumb'])?''.$params['title'].'':null, + ))); + $uploader->setTitle(isset($params['title'])?$params['title']:null); $params['file'] = $uploader->render(); break; diff --git a/classes/helper/HelperOptions.php b/classes/helper/HelperOptions.php index e17667357..5f2ba5904 100644 --- a/classes/helper/HelperOptions.php +++ b/classes/helper/HelperOptions.php @@ -126,7 +126,13 @@ class HelperOptionsCore extends Helper 'download_url' => isset($field['file'])?$field['file']:null ))); - $uploader->setThumb(isset($field['thumb'])?$field['thumb']:null); + if (isset($field['thumb']) && $field['thumb']) // Use for retrocompatibility + $uploader->setFiles(array( + 0 => array( + 'type' => HelperUploader::TYPE_IMAGE, + 'image' => isset($field['thumb'])?''.$field['title'].'':null, + ))); + $uploader->setTitle(isset($field['title'])?$field['title']:null); $field['file'] = $uploader->render(); } diff --git a/classes/helper/HelperUploader.php b/classes/helper/HelperUploader.php index daea1b146..9c844596d 100644 --- a/classes/helper/HelperUploader.php +++ b/classes/helper/HelperUploader.php @@ -42,7 +42,6 @@ class HelperUploaderCore extends Uploader protected $_template; private $_template_directory; private $_title; - private $_thumb; private $_url; private $_use_ajax; @@ -90,7 +89,7 @@ class HelperUploaderCore extends Uploader public function setMaxFiles($value) { - $this->_max_files = intval($value); + $this->_max_files = isset($value) ? intval($value) : $value; return $this; } @@ -193,17 +192,6 @@ class HelperUploaderCore extends Uploader return $this->_title; } - public function setThumb($value) - { - $this->_thumb = $value; - return $this; - } - - public function getThumb() - { - return $this->_thumb; - } - public function setUrl($value) { $this->_url = (string)$value; @@ -248,9 +236,7 @@ class HelperUploaderCore extends Uploader $html .= ''; $html .= ''; - $html .= ''; - $html .= ''; + .'/themes/'.$bo_theme.'/js/jquery.fileupload-validate.js">'; } else { @@ -265,8 +251,8 @@ class HelperUploaderCore extends Uploader .'/themes/'.$bo_theme.'/js/jquery.fileupload-process.js'); $this->getContext()->controller->addJs(__PS_BASE_URI__.$admin_webpath .'/themes/'.$bo_theme.'/js/jquery.fileupload-validate.js'); - $this->getContext()->controller->addJs(__PS_BASE_URI__.'/js/vendor/spin.js'); - $this->getContext()->controller->addJs(__PS_BASE_URI__.'/js/vendor/ladda.js'); + $this->getContext()->controller->addJs('js/vendor/spin.js'); + $this->getContext()->controller->addJs('js/vendor/ladda.js'); } if ($this->useAjax()) @@ -282,7 +268,6 @@ class HelperUploaderCore extends Uploader 'url' => $this->getUrl(), 'multiple' => $this->isMultiple(), 'files' => $this->getFiles(), - 'thumb' => $this->getThumb(), 'title' => $this->getTitle(), 'max_files' => $this->getMaxFiles(), 'post_max_size' => $this->getPostMaxSizeBytes() diff --git a/controllers/admin/AdminCategoriesController.php b/controllers/admin/AdminCategoriesController.php index 6ee52154d..de4877ab0 100644 --- a/controllers/admin/AdminCategoriesController.php +++ b/controllers/admin/AdminCategoriesController.php @@ -160,16 +160,14 @@ class AdminCategoriesControllerCore extends AdminController public function initPageHeaderToolbar() { - if (empty($this->display)) - { + parent::initPageHeaderToolbar(); + + if ($this->display != 'add') $this->page_header_toolbar_btn['new_category'] = array( 'href' => self::$currentIndex.'&addcategory&token='.$this->token, 'desc' => $this->l('Add new category'), 'icon' => 'process-icon-new' ); - } - - parent::initPageHeaderToolbar(); } public function initContent() diff --git a/controllers/admin/AdminEmployeesController.php b/controllers/admin/AdminEmployeesController.php index 28d83105f..d4152e260 100644 --- a/controllers/admin/AdminEmployeesController.php +++ b/controllers/admin/AdminEmployeesController.php @@ -150,6 +150,8 @@ class AdminEmployeesControllerCore extends AdminController public function initPageHeaderToolbar() { + parent::initPageHeaderToolbar(); + if (empty($this->display)) $this->page_header_toolbar_btn['new_employee'] = array( 'href' => self::$currentIndex.'&addemployee&token='.$this->token, @@ -157,7 +159,16 @@ class AdminEmployeesControllerCore extends AdminController 'icon' => 'process-icon-new' ); - parent::initPageHeaderToolbar(); + if ($this->display == 'edit') + { + $obj = $this->loadObject(true); + if (Validate::isLoadedObject($obj)) + { + array_pop($this->toolbar_title); + $this->toolbar_title[] = sprintf($this->l('Edit: %1$s %2$s'), $obj->lastname, $obj->firstname); + $this->page_header_toolbar_title = implode(' '.Configuration::get('PS_NAVIGATION_PIPE').' ', $this->toolbar_title); + } + } } public function renderList() diff --git a/controllers/admin/AdminMetaController.php b/controllers/admin/AdminMetaController.php index 92aa510e6..75eea4162 100644 --- a/controllers/admin/AdminMetaController.php +++ b/controllers/admin/AdminMetaController.php @@ -36,6 +36,7 @@ class AdminMetaControllerCore extends AdminController parent::__construct(); $this->bootstrap = true; + $this->identifier_name = 'page'; $this->ht_file = _PS_ROOT_DIR_.'/.htaccess'; $this->rb_file = _PS_ROOT_DIR_.'/robots.txt'; $this->sm_file = _PS_ROOT_DIR_.'/sitemap.xml'; diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 3c5bdae86..b8deeb6ba 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -1321,7 +1321,9 @@ class AdminProductsControllerCore extends AdminController _PS_JS_DIR_.'jquery/plugins/treeview-categories/jquery.treeview-categories.edit.js', _PS_JS_DIR_.'admin-categories-tree.js', _PS_JS_DIR_.'jquery/ui/jquery.ui.progressbar.min.js', - _PS_JS_DIR_.'jquery/plugins/timepicker/jquery-ui-timepicker-addon.js' + _PS_JS_DIR_.'jquery/plugins/timepicker/jquery-ui-timepicker-addon.js', + _PS_JS_DIR_.'vendor/spin.js', + _PS_JS_DIR_.'vendor/ladda.js' )); $this->addCSS(array( @@ -1331,42 +1333,6 @@ class AdminProductsControllerCore extends AdminController } } - /* @todo rename to processaddproductimage */ - public function ajaxProcessAddImage() - { - self::$currentIndex = 'index.php?tab=AdminProducts'; - $allowedExtensions = array('jpeg', 'gif', 'png', 'jpg'); - // max file size in bytes - $uploader = new FileUploader($allowedExtensions, $this->max_image_size); - $result = $uploader->handleUpload(); - if (isset($result['success'])) - { - $obj = new Image((int)$result['success']['id_image']); - // Associate image to shop from context - $shops = Shop::getContextListShopID(); - $obj->associateTo($shops); - $json_shops = array(); - foreach ($shops as $id_shop) - $json_shops[$id_shop] = true; - - $json = array( - 'name' => $result['success']['name'], - 'status' => 'ok', - 'id'=>$obj->id, - 'path' => $obj->getExistingImgPath(), - 'position' => $obj->position, - 'legend' => $obj->legend, - 'cover' => $obj->cover, - 'shops' => $json_shops, - ); - @unlink(_PS_TMP_IMG_DIR_.'product_'.(int)$obj->id_product.'.jpg'); - @unlink(_PS_TMP_IMG_DIR_.'product_mini_'.(int)$obj->id_product.'_'.$this->context->shop->id.'.jpg'); - die(Tools::jsonEncode($json)); - } - else - die(Tools::jsonEncode($result)); - } - public function ajaxProcessDeleteProductAttribute() { if (!Combination::isFeatureActive()) @@ -3650,6 +3616,108 @@ class AdminProductsControllerCore extends AdminController } } + public function ajaxProcessaddProductImage() + { + self::$currentIndex = 'index.php?tab=AdminProducts'; + $product = new Product((int)Tools::getValue('id_product')); + $legends = Tools::getValue('legend'); + + if (!is_array($legends)) + $legends = (array)$legends; + + if (!Validate::isLoadedObject($product)) + { + $files = array(); + $files[0]['error'] = Tools::displayError('Cannot add image because product creation failed.'); + } + + $image_uploader = new HelperImageUploader('file'); + $image_uploader->setAcceptTypes(array('jpeg', 'gif', 'png', 'jpg'))->setMaxSize($this->max_image_size); + $files = $image_uploader->process(); + + foreach ($files as &$file) + { + $image = new Image(); + $image->id_product = (int)($product->id); + $image->position = Image::getHighestPosition($product->id) + 1; + + foreach ($legends as $key => $legend) + if (!empty($legend)) + $image->legend[(int)$key] = $legend; + + if (!Image::getCover($image->id_product)) + $image->cover = 1; + else + $image->cover = 0; + + if (!$image->add()) + $file['error'] = Tools::displayError('Error while creating additional image'); + else + { + if (!$new_path = $image->getPathForCreation()) + { + $file['error'] = Tools::displayError('An error occurred during new folder creation'); + continue; + } + + if (!ImageManager::resize($file['save_path'], $new_path.'.'.$image->image_format)) + { + $file['error'] = Tools::displayError('An error occurred while copying image.'); + continue; + } + else + { + $imagesTypes = ImageType::getImagesTypes('products'); + foreach ($imagesTypes as $imageType) + { + /* + $theme = (Shop::isFeatureActive() ? '-'.$imageType['id_theme'] : ''); + if (!ImageManager::resize($tmpName, $new_path.'-'.stripslashes($imageType['name']).$theme.'.'.$image->image_format, $imageType['width'], $imageType['height'], $image->image_format)) + return array('error' => Tools::displayError('An error occurred while copying image:').' '.stripslashes($imageType['name'])); + */ + if (!ImageManager::resize($file['save_path'], $new_path.'-'.stripslashes($imageType['name']).'.'.$image->image_format, $imageType['width'], $imageType['height'], $image->image_format)) + { + $file['error'] = Tools::displayError('An error occurred while copying image:').' '.stripslashes($imageType['name']); + continue; + } + } + } + + unlink($file['save_path']); + //Necesary to prevent hacking + unset($file['save_path']); + Hook::exec('actionWatermark', array('id_image' => $image->id, 'id_product' => $product->id)); + + if (!$image->update()) + { + $file['error'] = Tools::displayError('Error while updating status'); + continue; + } + + // Associate image to shop from context + $shops = Shop::getContextListShopID(); + $image->associateTo($shops); + $json_shops = array(); + + foreach ($shops as $id_shop) + $json_shops[$id_shop] = true; + + $file['status'] = 'ok'; + $file['id'] = $image->id; + $file['position'] = $image->position; + $file['cover'] = $image->cover; + $file['legend'] = $image->legend; + $file['path'] = $image->getExistingImgPath(); + $file['shops'] = $json_shops; + + @unlink(_PS_TMP_IMG_DIR_.'product_'.(int)$product->id.'.jpg'); + @unlink(_PS_TMP_IMG_DIR_.'product_mini_'.(int)$product->id.'_'.$this->context->shop->id.'.jpg'); + } + } + + die(Tools::jsonEncode(array($image_uploader->getName() => $files))); + } + public function initFormImages($obj) { $data = $this->createTemplate($this->tpl_form); @@ -3688,6 +3756,10 @@ class AdminProductsControllerCore extends AdminController $current_shop_id = 0; $languages = Language::getLanguages(true); + $image_uploader = new HelperImageUploader('file'); + $image_uploader->setMultiple(true)->setUseAjax(true)->setUrl( + Context::getContext()->link->getAdminLink('AdminProducts').'&ajax=1&id_product='.(int)$obj->id + .'&action=addProductImage'); $data->assign(array( 'countImages' => $count_images, @@ -3702,7 +3774,8 @@ class AdminProductsControllerCore extends AdminController 'currency' => $this->context->currency, 'current_shop_id' => $current_shop_id, 'languages' => $this->_languages, - 'default_language' => (int)Configuration::get('PS_LANG_DEFAULT') + 'default_language' => (int)Configuration::get('PS_LANG_DEFAULT'), + 'image_uploader' => $image_uploader->render() )); $type = ImageType::getByNameNType('%', 'products', 'height'); diff --git a/controllers/admin/AdminSearchConfController.php b/controllers/admin/AdminSearchConfController.php index 0f9346dba..b7e601225 100644 --- a/controllers/admin/AdminSearchConfController.php +++ b/controllers/admin/AdminSearchConfController.php @@ -199,7 +199,7 @@ class AdminSearchConfControllerCore extends AdminController 'desc' => $this->l('Add new alias'), 'icon' => 'process-icon-new' ); - + $this->identifier_name = 'alias'; parent::initPageHeaderToolbar(); } diff --git a/controllers/admin/AdminSearchEnginesController.php b/controllers/admin/AdminSearchEnginesController.php index 7a571324b..df28cdcfc 100644 --- a/controllers/admin/AdminSearchEnginesController.php +++ b/controllers/admin/AdminSearchEnginesController.php @@ -86,6 +86,8 @@ class AdminSearchEnginesControllerCore extends AdminController 'desc' => $this->l('Add new search engine'), 'icon' => 'process-icon-new' ); + + $this->identifier_name = 'server'; parent::initPageHeaderToolbar(); } diff --git a/modules/blockcmsinfo/blockcmsinfo.php b/modules/blockcmsinfo/blockcmsinfo.php new file mode 100644 index 000000000..e8ce8fbb9 --- /dev/null +++ b/modules/blockcmsinfo/blockcmsinfo.php @@ -0,0 +1,315 @@ + +* @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 +*/ + +if (!defined('_PS_VERSION_')) + exit; + +include_once _PS_MODULE_DIR_.'blockcmsinfo/infoClass.php'; + +class Blockcmsinfo extends Module +{ + public function __construct() + { + $this->name = 'blockcmsinfo'; + $this->tab = 'front_office_features'; + $this->version = '1.0'; + $this->bootstrap = true; + $this->need_instance = 0; + parent::__construct(); + $this->displayName = $this->l('Customer cms information block'); + $this->description = $this->l('Adds an information block customers in your store.'); + } + + public function install() + { + return parent::install() && + $this->installDB() && + Configuration::updateValue('blockcmsinfo_nbblocks', 2) && + $this->registerHook('home') && $this->installFixtures(); + } + + public function installDB() + { + $return = true; + $return &= Db::getInstance()->execute(' + CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'info` ( + `id_info` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `id_shop` int(10) unsigned NOT NULL , + PRIMARY KEY (`id_info`) + ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8 ;'); + + $return &= Db::getInstance()->execute(' + CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'info_lang` ( + `id_info` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `id_lang` int(10) unsigned NOT NULL , + `text` text NOT NULL, + PRIMARY KEY (`id_info`, `id_lang`) + ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8 ;'); + + return $return; + } + + public function uninstall() + { + // Delete configuration + return Configuration::deleteByName('blockcmsinfo_nbblocks') && + $this->uninstallDB() && + parent::uninstall(); + } + + public function uninstallDB() + { + return Db::getInstance()->execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'info`') && Db::getInstance()->execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'info_lang`'); + } + + public function addToDB() + { + if (isset($_POST['nbblocks'])) + { + for ($i = 1; $i <= (int)$_POST['nbblocks']; $i++) + { + + Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'info` (`text`) + VALUES ("'.((isset($_POST['info'.$i.'_text']) && $_POST['info'.$i.'_text'] != '') ? pSQL($_POST['info'.$i.'_text']) : '').'")'); + } + return true; + } else + return false; + } + + public function removeFromDB() + { + return Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'info`'); + } + + public function getContent() + { + $html = ''; + $id_info = (int)Tools::getValue('id_info'); + + if (Tools::isSubmit('saveblockcmsinfo')) + { + if ($id_info = Tools::getValue('id_info')) + $info = new infoClass((int)$id_info); + else + $info = new infoClass(); + $info->copyFromPost(); + $info->id_shop = $this->context->shop->id; + + if ($info->validateFields(false) && $info->validateFieldsLang(false)) + { + $info->save(); + $this->_clearCache('blockcmsinfo.tpl'); + } + else + $html .= '
    '.$this->l('An error occurred while attempting to save.').'
    '; + } + + if (Tools::isSubmit('updateblockcmsinfo') || Tools::isSubmit('addblockcmsinfo')) + { + $helper = $this->initForm(); + foreach (Language::getLanguages(false) as $lang) + if ($id_info) + { + $info = new infoClass((int)$id_info); + $helper->fields_value['text'][(int)$lang['id_lang']] = $info->text[(int)$lang['id_lang']]; + } + else + $helper->fields_value['text'][(int)$lang['id_lang']] = Tools::getValue('text_'.(int)$lang['id_lang'], ''); + if ($id_info = Tools::getValue('id_info')) + { + $this->fields_form[0]['form']['input'][] = array('type' => 'hidden', 'name' => 'id_info'); + $helper->fields_value['id_info'] = (int)$id_info; + } + + return $html.$helper->generateForm($this->fields_form); + } + else if (Tools::isSubmit('deleteblockcmsinfo')) + { + $info = new infoClass((int)$id_info); + $info->delete(); + $this->_clearCache('blockcmsinfo.tpl'); + Tools::redirectAdmin(AdminController::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules')); + } + else + { + $helper = $this->initList(); + return $html.$helper->generateList($this->getListContent((int)Configuration::get('PS_LANG_DEFAULT')), $this->fields_list); + } + + if (isset($_POST['submitModule'])) + { + Configuration::updateValue('blockcmsinfo_nbblocks', ((isset($_POST['nbblocks']) && $_POST['nbblocks'] != '') ? (int)$_POST['nbblocks'] : '')); + if ($this->removeFromDB() && $this->addToDB()) + { + $this->_clearCache('blockcmsinfo.tpl'); + $output = '
    '.$this->l('The block configuration has been updated.').'
    '; + } + else + $output = '
    '.$this->l('An error occurred while attempting to save.').'
    '; + } + } + + protected function getListContent($id_lang) + { + return Db::getInstance()->executeS(' + SELECT r.`id_info`, r.`id_shop`, rl.`text` + FROM `'._DB_PREFIX_.'info` r + LEFT JOIN `'._DB_PREFIX_.'info_lang` rl ON (r.`id_info` = rl.`id_info`) + WHERE `id_lang` = '.(int)$id_lang.' '.Shop::addSqlRestrictionOnLang()); + } + + protected function initForm() + { + $default_lang = (int)Configuration::get('PS_LANG_DEFAULT'); + $this->fields_form[0]['form'] = array( + 'tinymce' => true, + 'legend' => array( + 'title' => $this->l('New cms custom block.'), + ), + 'input' => array( + array( + 'type' => 'textarea', + 'label' => $this->l('Text:'), + 'lang' => true, + 'name' => 'text', + 'cols' => 40, + 'rows' => 10, + 'class' => 'rte', + 'autoload_rte' => true, + + ) + ), + 'submit' => array( + 'title' => $this->l('Save'), + 'class' => 'button' + ) + ); + + $helper = new HelperForm(); + $helper->module = $this; + $helper->name_controller = 'blockcmsinfo'; + $helper->identifier = $this->identifier; + $helper->token = Tools::getAdminTokenLite('AdminModules'); + foreach (Language::getLanguages(false) as $lang) + $helper->languages[] = array( + 'id_lang' => $lang['id_lang'], + 'iso_code' => $lang['iso_code'], + 'name' => $lang['name'], + 'is_default' => ($default_lang == $lang['id_lang'] ? 1 : 0) + ); + + $helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name; + $helper->default_form_language = $default_lang; + $helper->allow_employee_form_lang = $default_lang; + $helper->toolbar_scroll = true; + $helper->title = $this->displayName; + $helper->submit_action = 'saveblockcmsinfo'; + $helper->toolbar_btn = array( + 'save' => + array( + 'desc' => $this->l('Save'), + 'href' => AdminController::$currentIndex.'&configure='.$this->name.'&save'.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules'), + ), + 'back' => + array( + 'href' => AdminController::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules'), + 'desc' => $this->l('Back to list') + ) + ); + return $helper; + } + + protected function initList() + { + + + $this->fields_list = array( + + 'id_info' => array( + 'title' => $this->l('Custom block #'), + 'width' => 40, + 'type' => 'text', + ), + + ); + + if (Shop::isFeatureActive()) + $this->fields_list['id_shop'] = array('title' => $this->l('ID Shop'), 'align' => 'center', 'width' => 25, 'type' => 'int'); + + $helper = new HelperList(); + $helper->shopLinkType = ''; + $helper->simple_header = true; + $helper->identifier = 'id_info'; + $helper->actions = array('edit', 'delete'); + $helper->show_toolbar = true; + $helper->imageType = 'jpg'; + $helper->toolbar_btn['new'] = array( + 'href' => AdminController::$currentIndex.'&configure='.$this->name.'&add'.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules'), + 'desc' => $this->l('Add new') + ); + + $helper->title = $this->displayName; + $helper->table = $this->name; + $helper->token = Tools::getAdminTokenLite('AdminModules'); + $helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name; + return $helper; + } + + public function hookHome($params) + { + // Check if not a mobile theme + if ($this->context->getMobileDevice() != false) + return false; + + $this->context->controller->addCSS($this->_path.'style.css', 'all'); + if (!$this->isCached('blockcmsinfo.tpl', $this->getCacheId())) + { + $infos = $this->getListContent($this->context->language->id); + $this->context->smarty->assign(array('infos' => $infos, 'nbblocks' => count($infos))); + } + return $this->display(__FILE__, 'blockcmsinfo.tpl', $this->getCacheId()); + } + + public function installFixtures() + { + $return = true; + $tab_texts = array( + array('text' => $this->l('Custom text.')), + array('text' => $this->l('Custom text.')), + ); + foreach($tab_texts as $tab) + { + $info = new infoClass(); + foreach (Language::getLanguages(false) as $lang) + $info->text[$lang['id_lang']] = $tab['text']; + $info->id_shop = $this->context->shop->id; + $return &= $info->save(); + } + return $return; + } +} diff --git a/modules/blockcmsinfo/blockcmsinfo.tpl b/modules/blockcmsinfo/blockcmsinfo.tpl new file mode 100644 index 000000000..258f37f06 --- /dev/null +++ b/modules/blockcmsinfo/blockcmsinfo.tpl @@ -0,0 +1,33 @@ +{* +* 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 +*} +{if $infos|@count > 0} + +
    + {foreach from=$infos item=info} +
    {$info.text}
    + {/foreach} +
    + +{/if} \ No newline at end of file diff --git a/modules/blockcmsinfo/config.xml b/modules/blockcmsinfo/config.xml new file mode 100644 index 000000000..745747fb8 --- /dev/null +++ b/modules/blockcmsinfo/config.xml @@ -0,0 +1,12 @@ + + + blockcmsinfo + + + + + + 1 + 0 + + \ No newline at end of file diff --git a/modules/blockcmsinfo/index.php b/modules/blockcmsinfo/index.php new file mode 100644 index 000000000..07830d90c --- /dev/null +++ b/modules/blockcmsinfo/index.php @@ -0,0 +1,35 @@ + +* @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/blockcmsinfo/infoClass.php b/modules/blockcmsinfo/infoClass.php new file mode 100644 index 000000000..5722a4d17 --- /dev/null +++ b/modules/blockcmsinfo/infoClass.php @@ -0,0 +1,69 @@ + +* @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 +*/ + +class infoClass extends ObjectModel +{ + /** @var integer info id*/ + public $id; + + /** @var integer info id shop*/ + public $id_shop; + + /** @var string info text*/ + public $text; + + /** + * @see ObjectModel::$definition + */ + public static $definition = array( + 'table' => 'info', + 'primary' => 'id_info', + 'multilang' => true, + 'fields' => array( + 'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isunsignedInt', 'required' => true), + // Lang fields + 'text' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isString', 'required' => true), + ) + ); + + public function copyFromPost() + { + /* Classical fields */ + foreach ($_POST AS $key => $value) + if (key_exists($key, $this) AND $key != 'id_'.$this->table) + $this->{$key} = $value; + + /* Multilingual fields */ + if (sizeof($this->fieldsValidateLang)) + { + $languages = Language::getLanguages(false); + foreach ($languages AS $language) + foreach ($this->fieldsValidateLang AS $field => $validation) + if (isset($_POST[$field.'_'.(int)($language['id_lang'])])) + $this->{$field}[(int)($language['id_lang'])] = $_POST[$field.'_'.(int)($language['id_lang'])]; + } + } +} diff --git a/modules/blockcmsinfo/logo.gif b/modules/blockcmsinfo/logo.gif new file mode 100644 index 000000000..b29d6badd Binary files /dev/null and b/modules/blockcmsinfo/logo.gif differ diff --git a/modules/blockcmsinfo/logo.png b/modules/blockcmsinfo/logo.png new file mode 100644 index 000000000..7d46528a8 Binary files /dev/null and b/modules/blockcmsinfo/logo.png differ diff --git a/modules/blockcmsinfo/style.css b/modules/blockcmsinfo/style.css new file mode 100644 index 000000000..76bfc7331 --- /dev/null +++ b/modules/blockcmsinfo/style.css @@ -0,0 +1,2 @@ +/* BLOCK #info_block ******************************************************************** */ +#cmsinfo_block {} diff --git a/modules/blockcmsinfo/translations/index.php b/modules/blockcmsinfo/translations/index.php new file mode 100644 index 000000000..3f6561f72 --- /dev/null +++ b/modules/blockcmsinfo/translations/index.php @@ -0,0 +1,35 @@ + +* @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/blockfacebook/blockfacebook.php b/modules/blockfacebook/blockfacebook.php new file mode 100644 index 000000000..7f9b2d98c --- /dev/null +++ b/modules/blockfacebook/blockfacebook.php @@ -0,0 +1,143 @@ + +* @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 +*/ + +if (!defined('_PS_VERSION_')) + exit; + +class Blockfacebook extends Module +{ + public function __construct() + { + $this->name = 'blockfacebook'; + $this->tab = 'front_office_features'; + $this->version = '1.0'; + + $this->bootstrap = true; + parent::__construct(); + $this->displayName = $this->l('Block Facebook'); + $this->description = $this->l('Display block facebook on the home page'); + } + + +public function install() + { + return parent::install() + && Configuration::updateValue('blockfacebook_url', 'prestashop') + && $this->registerHook('displayHome') + && $this->registerHook('displayHeader'); + } + + public function uninstall() + { + // Delete configuration + return Configuration::deleteByName('blockfacebook_url') && parent::uninstall(); + } + + public function getContent() + { + $html = ''; + // If we try to update the settings + if (Tools::isSubmit('submitModule')) + { + Configuration::updateValue('blockfacebook_url', Tools::getValue('blockfacebook_url')); + $this->_clearCache('blockfacebook.tpl'); + $html .= $this->displayConfirmation($this->l('Configuration updated')); + } + + $html .= $this->renderForm(); + + return $html; + } + + public function hookDisplayHeader() + { + + } + + public function hookDisplayHome() + { + global $smarty; + if (!$this->isCached('blockfacebook.tpl', $this->getCacheId())) + $smarty->assign(array( + 'facebookurl' => Configuration::get('blockfacebook_url'), + )); + return $this->display(__FILE__, 'blockfacebook.tpl', $this->getCacheId()); + } + + + + public function renderForm() + { + $fields_form = array( + 'form' => array( + 'legend' => array( + 'title' => $this->l('Settings'), + 'icon' => 'icon-cogs' + ), + 'input' => array( + array( + 'type' => 'text', + 'label' => $this->l('Facebook name'), + 'name' => 'blockfacebook_url', + ), + ), + 'submit' => array( + 'title' => $this->l('Save'), + 'class' => 'btn btn-default') + ), + ); + + $helper = new HelperForm(); + $helper->show_toolbar = false; + $helper->table = $this->table; + $lang = new Language((int)Configuration::get('PS_LANG_DEFAULT')); + $helper->default_form_language = $lang->id; + $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0; + $this->fields_form = array(); + + $helper->identifier = $this->identifier; + $helper->submit_action = 'submitModule'; + $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(), + 'languages' => $this->context->controller->getLanguages(), + 'id_language' => $this->context->language->id + ); + + return $helper->generateForm(array($fields_form)); + } + + public function getConfigFieldsValues() + { + return array( + 'blockfacebook_url' => Tools::getValue('blockfacebook_url', Configuration::get('blockfacebook_url')), + ); + } + + + +} \ No newline at end of file diff --git a/modules/blockfacebook/blockfacebook.tpl b/modules/blockfacebook/blockfacebook.tpl new file mode 100644 index 000000000..4e15962c0 --- /dev/null +++ b/modules/blockfacebook/blockfacebook.tpl @@ -0,0 +1,10 @@ +{if $facebookurl != ''} +
    +

    {l s='Follow us on facebook' mod='blockfacebook'}

    + +
    +{/if} + + diff --git a/modules/blockfacebook/config.xml b/modules/blockfacebook/config.xml new file mode 100644 index 000000000..c11e6ffae --- /dev/null +++ b/modules/blockfacebook/config.xml @@ -0,0 +1,12 @@ + + + blockfacebook + + + + + + 1 + 1 + + \ No newline at end of file diff --git a/modules/blockfacebook/logo.gif b/modules/blockfacebook/logo.gif new file mode 100644 index 000000000..4614741f5 Binary files /dev/null and b/modules/blockfacebook/logo.gif differ diff --git a/modules/blockfacebook/logo.png b/modules/blockfacebook/logo.png new file mode 100644 index 000000000..63f5b2917 Binary files /dev/null and b/modules/blockfacebook/logo.png differ diff --git a/modules/blockfacebook/translations/index.php b/modules/blockfacebook/translations/index.php new file mode 100644 index 000000000..3f6561f72 --- /dev/null +++ b/modules/blockfacebook/translations/index.php @@ -0,0 +1,35 @@ + +* @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/homeslider/homeslider.php b/modules/homeslider/homeslider.php index 096fd593f..29daad463 100644 --- a/modules/homeslider/homeslider.php +++ b/modules/homeslider/homeslider.php @@ -674,7 +674,11 @@ class HomeSlider extends Module $this->context->controller->addJS($this->_path.'js/homeslider.js'); return $this->display(__FILE__, 'homeslider.tpl', $this->getCacheId()); } - + + public function hookTop() + { + return $this->hookDisplayHome(); + } public function clearCache() { $this->_clearCache('homeslider.tpl'); diff --git a/modules/homeslider/images/32fcdb2dfcdde00ac046b0b3b5f69170.jpg b/modules/homeslider/images/32fcdb2dfcdde00ac046b0b3b5f69170.jpg new file mode 100644 index 000000000..673b89940 Binary files /dev/null and b/modules/homeslider/images/32fcdb2dfcdde00ac046b0b3b5f69170.jpg differ diff --git a/modules/homeslider/images/3a7640ba4e3975b54126c6aa69a2bbc1.jpg b/modules/homeslider/images/3a7640ba4e3975b54126c6aa69a2bbc1.jpg new file mode 100644 index 000000000..673b89940 Binary files /dev/null and b/modules/homeslider/images/3a7640ba4e3975b54126c6aa69a2bbc1.jpg differ diff --git a/modules/homeslider/images/611a2b3ae96bde7ea3f8ca97c00ffe8c.jpg b/modules/homeslider/images/611a2b3ae96bde7ea3f8ca97c00ffe8c.jpg new file mode 100644 index 000000000..673b89940 Binary files /dev/null and b/modules/homeslider/images/611a2b3ae96bde7ea3f8ca97c00ffe8c.jpg differ diff --git a/modules/themeconfigurator/config.xml b/modules/themeconfigurator/config.xml index f95c52038..9130fdd00 100644 --- a/modules/themeconfigurator/config.xml +++ b/modules/themeconfigurator/config.xml @@ -9,4 +9,4 @@ 1 1 - + \ No newline at end of file diff --git a/modules/themeconfigurator/themeconfigurator.php b/modules/themeconfigurator/themeconfigurator.php index 7f9c4b69f..a2531c613 100644 --- a/modules/themeconfigurator/themeconfigurator.php +++ b/modules/themeconfigurator/themeconfigurator.php @@ -162,6 +162,27 @@ class ThemeConfigurator extends Module 'value' => (int)(Validate::isLoadedObject($module = Module::getInstanceByName('addsharethis')) && $module->active), 'is_module' => true, ), + array( + 'label' => $this->l('Display facebook block on the home page'), + 'name' => 'blockfacebook', + 'desc' => ''.$this->l('Configure').'', + 'value' => (int)(Validate::isLoadedObject($module = Module::getInstanceByName('blockfacebook')) && $module->active), + 'is_module' => true, + ), + array( + 'label' => $this->l('Customer cms information block'), + 'name' => 'blockcmsinfo', + 'desc' => ''.$this->l('Configure').'', + 'value' => (int)(Validate::isLoadedObject($module = Module::getInstanceByName('blockcmsinfo')) && $module->active), + 'is_module' => true, + ), + array( + 'label' => $this->l('Customer banner information block'), + 'name' => 'tmhtmlcontent', + 'desc' => ''.$this->l('Configure').'', + 'value' => (int)(Validate::isLoadedObject($module = Module::getInstanceByName('tmhtmlcontent')) && $module->active), + 'is_module' => true, + ), array( 'label' => $this->l('Enable Quick view'), 'name' => 'quick_view', diff --git a/modules/tmhtmlcontent/config.xml b/modules/tmhtmlcontent/config.xml new file mode 100644 index 000000000..e888346f6 --- /dev/null +++ b/modules/tmhtmlcontent/config.xml @@ -0,0 +1,12 @@ + + + tmhtmlcontent + + + + + + 1 + 1 + + \ No newline at end of file diff --git a/modules/tmhtmlcontent/images/4124625121355c962edd8c86ef14f3ee.jpg b/modules/tmhtmlcontent/images/4124625121355c962edd8c86ef14f3ee.jpg new file mode 100644 index 000000000..368ac88e8 Binary files /dev/null and b/modules/tmhtmlcontent/images/4124625121355c962edd8c86ef14f3ee.jpg differ diff --git a/modules/tmhtmlcontent/images/471dd22ba78685f12e457c16c9e3a005.jpg b/modules/tmhtmlcontent/images/471dd22ba78685f12e457c16c9e3a005.jpg new file mode 100644 index 000000000..2a114607c Binary files /dev/null and b/modules/tmhtmlcontent/images/471dd22ba78685f12e457c16c9e3a005.jpg differ diff --git a/modules/tmhtmlcontent/images/4f15eb95ccf54ffc141222224b86b2ac.jpg b/modules/tmhtmlcontent/images/4f15eb95ccf54ffc141222224b86b2ac.jpg new file mode 100644 index 000000000..adaf02324 Binary files /dev/null and b/modules/tmhtmlcontent/images/4f15eb95ccf54ffc141222224b86b2ac.jpg differ diff --git a/modules/tmhtmlcontent/images/67d43d531b80880be4bf34fa50c3c2d5.jpg b/modules/tmhtmlcontent/images/67d43d531b80880be4bf34fa50c3c2d5.jpg new file mode 100644 index 000000000..428a289c1 Binary files /dev/null and b/modules/tmhtmlcontent/images/67d43d531b80880be4bf34fa50c3c2d5.jpg differ diff --git a/modules/tmhtmlcontent/images/73c2f0d3133082d7d2879648d7b72e8d.jpg b/modules/tmhtmlcontent/images/73c2f0d3133082d7d2879648d7b72e8d.jpg new file mode 100644 index 000000000..3a3cfcde6 Binary files /dev/null and b/modules/tmhtmlcontent/images/73c2f0d3133082d7d2879648d7b72e8d.jpg differ diff --git a/modules/tmhtmlcontent/images/86a740c6973b2c0fdd9211583fb51dc3.jpg b/modules/tmhtmlcontent/images/86a740c6973b2c0fdd9211583fb51dc3.jpg new file mode 100644 index 000000000..45256d5b0 Binary files /dev/null and b/modules/tmhtmlcontent/images/86a740c6973b2c0fdd9211583fb51dc3.jpg differ diff --git a/modules/tmhtmlcontent/images/eb27ba8719f4206d861d8ce84dad7891.jpg b/modules/tmhtmlcontent/images/eb27ba8719f4206d861d8ce84dad7891.jpg new file mode 100644 index 000000000..d0c7fa27d Binary files /dev/null and b/modules/tmhtmlcontent/images/eb27ba8719f4206d861d8ce84dad7891.jpg differ diff --git a/modules/tmhtmlcontent/images/index.php b/modules/tmhtmlcontent/images/index.php new file mode 100644 index 000000000..803f6c658 --- /dev/null +++ b/modules/tmhtmlcontent/images/index.php @@ -0,0 +1,8 @@ +name = 'tmhtmlcontent'; // Defines module name + $this->tab = 'other'; // Defines module tab name/module category in the admin panel + $this->author = 'TemplateMonster'; // Defines module author + $this->version = '1.0'; // Defines module version + $this->secure_key = Tools::encrypt($this->name); + + $this->_defaultLanguage = Language::getLanguage(Configuration::get('PS_LANG_DEFAULT')); + $this->_languages = Language::getLanguages(); + + parent::__construct(); + + $this->displayName = $this->l('TM HTML content'); + $this->desctiption = $this->l('Module for HTML content with images and links.'); + + // Paths + $this->module_path = _PS_MODULE_DIR_.$this->name.'/'; + $this->uploads_path = _PS_MODULE_DIR_.$this->name.'/images/'; + $this->admin_tpl_path = _PS_MODULE_DIR_.$this->name.'/views/templates/admin/'; + $this->hooks_tpl_path = _PS_MODULE_DIR_.$this->name.'/views/templates/hooks/'; + } + + private function installDB() { + + Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'tmhtmlcontent`'); + + if (!Db::getInstance()->Execute(' + CREATE TABLE `'._DB_PREFIX_.'tmhtmlcontent` ( + `id_item` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_shop` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `item_order` int(10) unsigned NOT NULL, + `title` VARCHAR(100), + `title_use` tinyint(1) unsigned NOT NULL DEFAULT \'0\', + `hook` VARCHAR(100), + `url` VARCHAR(100), + `target` tinyint(1) unsigned NOT NULL DEFAULT \'0\', + `image` VARCHAR(100), + `image_w` VARCHAR(10), + `image_h` VARCHAR(10), + `html` TEXT, + `active` tinyint(1) unsigned NOT NULL DEFAULT \'1\', + PRIMARY KEY (`id_item`) + ) ENGINE = '._MYSQL_ENGINE_.' DEFAULT CHARSET=UTF8;')) + return false; + + return true; + } + + public function install() { + /* Adds Module */ + if (!parent::install() || + $this->installDB() && + !$this->registerHook('displayHeader') || + !$this->registerHook('displayTop') || + !$this->registerHook('displayLeftColumn') || + !$this->registerHook('displayRightColumn') || + !$this->registerHook('displayHome') || + !$this->registerHook('displayFooter') || + !$this->registerHook('displayBackOfficeHeader')) + return false; + return true; + } + + public function uninstall() { + + $images = Db::getInstance()->ExecuteS('SELECT image FROM `'._DB_PREFIX_.'tmhtmlcontent`'); + foreach ($images as $image) + $this->_deleteImages($image); + + + if (!Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'tmhtmlcontent`') OR + !parent::uninstall()) + return false; + return true; + } + + public function getContent() { + $this->context->smarty->assign('error', 0); + $this->context->smarty->assign('confirmation', 0); + + if (Tools::isSubmit('newItem')){ + $this->_addItem(); + } elseif (Tools::isSubmit('updateItem')){ + $this->_updateItem(); + } elseif (Tools::isSubmit('removeItem')) { + $this->_removeItem(); + } + return $this->_displayForm(); + } + + private function _displayForm() { + + $id_shop = (int)$this->context->shop->id; + $items = array(); + + $this->context->smarty->assign('htmlcontent', array( + 'admin_tpl_path' => $this->admin_tpl_path, + 'hooks_tpl_path' => $this->hooks_tpl_path, + + 'info' => array( + 'module' => $this->name, + 'name' => $this->displayName, + 'version' => $this->version, + 'psVersion' => _PS_VERSION_, + 'context' => (Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE') == 0) ? 1 : ($this->context->shop->getTotalShops() != 1) ? $this->context->shop->getContext() : 1 + ) + )); + + foreach ($this->_languages as $language) { + $hooks[$language['id_lang']] = array('home', 'top', 'left', 'right', 'footer'); + foreach ($hooks[$language['id_lang']] as $hook) { + $items[$language['id_lang']][$hook] = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'tmhtmlcontent` WHERE id_shop = '.$id_shop.' AND id_lang = '.$language['id_lang'].' AND hook = \''.$hook.'\' ORDER BY item_order ASC'); + } + } + + $this->context->smarty->assign('htmlitems', array( + 'items' => $items, + 'lang' => array( + 'default' => $this->_defaultLanguage, + 'all' => $this->_languages, + 'lang_dir' => _THEME_LANG_DIR_, + 'user' => $this->context->language->id + ), + 'postAction' => 'index.php?tab=AdminModules&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules').'&tab_module=other&module_name='.$this->name.'', + 'id_shop' => $id_shop + )); + + return $this->display(__FILE__, 'views/templates/admin/admin.tpl'); + } + + + private function _addItem() { + $id_shop = (int)$this->context->shop->id; + $lastOrder = Db::getInstance()->ExecuteS('SELECT item_order FROM `'._DB_PREFIX_.'tmhtmlcontent` WHERE id_shop = '.$id_shop.' AND id_lang = '.(int)Tools::getValue('lang_id').' AND hook = \''.Tools::getValue('item_hook').'\' ORDER BY item_order DESC LIMIT 1'); + $currentOrder = ($lastOrder) ? $lastOrder[0]['item_order']+1 : 1 ; + + $image_w = (is_numeric(Tools::getValue('item_img_w'))) ? intval(Tools::getValue('item_img_w')) : ''; + $image_h = (is_numeric(Tools::getValue('item_img_h'))) ? intval(Tools::getValue('item_img_h')) : ''; + + if(!empty($_FILES['item_img']['name'])){ + $image = $this->_uploadImage($_FILES['item_img'], $image_w, $image_h); + if(empty($image)) + return false; + } else { + $image = ''; + $image_w = ''; + $image_h = ''; + } + + $insert = Db::getInstance()->Execute(' + INSERT INTO `'._DB_PREFIX_.'tmhtmlcontent` ( + `id_shop`, `id_lang`, `item_order`, `title`, `title_use`, `hook`, `url`, `target`, `image`, `image_w`, `image_h`, `html`, `active` + ) VALUES ( + \''.$id_shop.'\', + \''.(int)Tools::getValue('lang_id').'\', + \''.$currentOrder.'\', + \''.Tools::getValue('item_title').'\', + \''.(int)Tools::getValue('item_title_use').'\', + \''.Tools::getValue('item_hook').'\', + \''.Tools::getValue('item_url').'\', + \''.(int)Tools::getValue('item_target').'\', + \''.$image.'\', + \''.$image_w.'\', + \''.$image_h.'\', + \''.str_replace("'", "´", Tools::getValue('item_html')).'\', + 1) + '); + + if(!$insert){ + $this->_deleteImages($image); + $this->context->smarty->assign('error', $this->l('An error occured while saving data.')); + return false; + } + + $this->context->smarty->assign('confirmation', $this->l('New item added successfull.')); + } + + private function _updateItem() { + + $newImage = ''; + + $image_w = (is_numeric(Tools::getValue('item_img_w'))) ? intval(Tools::getValue('item_img_w')) : ''; + $image_h = (is_numeric(Tools::getValue('item_img_h'))) ? intval(Tools::getValue('item_img_h')) : ''; + + if(!empty($_FILES['item_img']['name'])){ + if ($oldImage = Db::getInstance()->ExecuteS('SELECT image FROM `'._DB_PREFIX_.'tmhtmlcontent` WHERE id_item = '.(int)Tools::getValue('item_id'))) + $this->_deleteImages($oldImage[0]); + + $image = $this->_uploadImage($_FILES['item_img'], $image_w, $image_h); + if(empty($image)) + return false; + $newImage = 'image = \''.$image.'\','; + } else { + $image_w = ''; + $image_h = ''; + } + $update = Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'tmhtmlcontent` SET + title = \''.Tools::getValue('item_title').'\', + title_use = \''.(int)Tools::getValue('item_title_use').'\', + hook = \''.Tools::getValue('item_hook').'\', + url = \''.Tools::getValue('item_url').'\', + target = \''.(int)Tools::getValue('item_target').'\', + '.$newImage.' + image_w = \''.$image_w.'\', + image_h = \''.$image_h.'\', + active = \''.(int)Tools::getValue('item_active').'\', + html = \''.str_replace("'", "´", Tools::getValue('item_html')).'\' + WHERE id_item = '.(int)Tools::getValue('item_id')); + + if(!$update){ + if ($newImage = Db::getInstance()->ExecuteS('SELECT image FROM `'._DB_PREFIX_.'tmhtmlcontent` WHERE id_item = '.(int)Tools::getValue('item_id'))) + $this->_deleteImages($oldImage[0]); + $this->context->smarty->assign('error', $this->l('An error occured while saving data.')); + return false; + } + + $this->context->smarty->assign('confirmation', $this->l('Saved succsessfull.')); + + } + + public function _removeItem() { + $id_shop = (int)$this->context->shop->id; + if ($delImage = Db::getInstance()->ExecuteS('SELECT image FROM `'._DB_PREFIX_.'tmhtmlcontent` WHERE id_item = '.(int)Tools::getValue('item_id'))) + $this->_deleteImages($delImage[0]); + + Db::getInstance()->delete(_DB_PREFIX_.'tmhtmlcontent', 'id_item = '.(int)Tools::getValue('item_id')); + + if(Db::getInstance()->Affected_Rows() == 1){ + Db::getInstance()->Execute(' + UPDATE `'._DB_PREFIX_.'tmhtmlcontent` + SET item_order = item_order-1 + WHERE ( + item_order > '.Tools::getValue('item_order').' AND + id_shop = '.$id_shop.' AND + hook = \''.Tools::getValue('item_hook').'\') + '); + + $this->context->smarty->assign('confirmation', $this->l('Deleted succsessfull.')); + }else{ + $this->context->smarty->assign('error', $this->l('Cant delete slide data from database.')); + } + } + + + private function _uploadImage($image, $image_w = '', $image_h = '') { + /* Uploads image */ + + $type = @strtolower(substr(strrchr($image['name'], '.'), 1)); + $imagesize = array(); + $imagesize = @getimagesize($image['tmp_name']); + Configuration::set('PS_IMAGE_QUALITY','png_all'); + $salt = sha1(microtime()); + + if (isset($image) && + isset($image['tmp_name']) && + !empty($image['tmp_name']) && + !empty($imagesize) && + in_array(strtolower(substr(strrchr($imagesize['mime'], '/'), 1)), array('jpg', 'gif', 'jpeg', 'png')) && + in_array($type, array('jpg', 'gif', 'jpeg', 'png'))) + { + $temp_name = tempnam(_PS_TMP_IMG_DIR_, 'PS'); + + if ($error = ImageManager::validateUpload($image)) + $errors[] = $error; + elseif (!$temp_name || !move_uploaded_file($image['tmp_name'], $temp_name)) + return false; + elseif (ImageManager::resize($temp_name, dirname(__FILE__).'/images/'.Tools::encrypt($image['name'].$salt).'.'.$type, $image_w, $image_h)) + return Tools::encrypt($image['name'].$salt).'.'.$type; + else + $this->context->smarty->assign('error', $this->l('An error occurred during the image upload.')); + if (isset($temp_name)) + @unlink($temp_name); + } + } + + + private function _deleteImages($image) { + if ($image && $image['image']!='' && is_file($this->uploads_path.$image['image'])) + unlink($this->uploads_path.$image['image']); + } + + + + public function hookDisplayBackOfficeHeader() { + // Check if module is loaded + if (Tools::getValue('configure') != $this->name) + return false; + + // CSS + $this->context->controller->addCSS($this->_path.'views/css/admin.css'); + // JS + $this->context->controller->addJquery(); + $this->context->controller->addJS($this->_path.'views/js/admin.js'); + } + + + public function hookdisplayHeader($params) { + $this->context->controller->addCss($this->_path.'views/css/hooks.css', 'all'); + } + + + public function hookDisplayTop() { + $id_shop = (int)$this->context->shop->id; + $id_lang = $this->context->language->id; + $hook_name = 'top'; + $items = array(); + $items = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'tmhtmlcontent` WHERE id_shop = '.$id_shop.' AND id_lang = '.$id_lang.' AND hook = \''.$hook_name.'\' AND active = 1 ORDER BY item_order ASC'); + + $this->context->smarty->assign('htmlitems', array( + 'items' => $items + )); + + return $this->display(__FILE__, 'views/templates/hooks/top.tpl'); + } + + + public function hookDisplayHome() { + $id_shop = (int)$this->context->shop->id; + $id_lang = $this->context->language->id; + $hook_name = 'home'; + $items = array(); + $items = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'tmhtmlcontent` WHERE id_shop = '.$id_shop.' AND id_lang = '.$id_lang.' AND hook = \''.$hook_name.'\' AND active = 1 ORDER BY item_order ASC'); + + $this->context->smarty->assign('htmlitems', array( + 'items' => $items + )); + + return $this->display(__FILE__, 'views/templates/hooks/home.tpl'); + } + + public function hookDisplayLeftColumn() { + $id_shop = (int)$this->context->shop->id; + $id_lang = $this->context->language->id; + $hook_name = 'left'; + $items = array(); + $items = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'tmhtmlcontent` WHERE id_shop = '.$id_shop.' AND id_lang = '.$id_lang.' AND hook = \''.$hook_name.'\' AND active = 1 ORDER BY item_order ASC'); + + $this->context->smarty->assign('htmlitems', array( + 'items' => $items + )); + + return $this->display(__FILE__, 'views/templates/hooks/left.tpl'); + } + + public function hookDisplayRightColumn() { + $id_shop = (int)$this->context->shop->id; + $id_lang = $this->context->language->id; + $hook_name = 'right'; + $items = array(); + $items = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'tmhtmlcontent` WHERE id_shop = '.$id_shop.' AND id_lang = '.$id_lang.' AND hook = \''.$hook_name.'\' AND active = 1 ORDER BY item_order ASC'); + + $this->context->smarty->assign('htmlitems', array( + 'items' => $items + )); + + return $this->display(__FILE__, 'views/templates/hooks/right.tpl'); + } + + public function hookDisplayFooter() { + $id_shop = (int)$this->context->shop->id; + $id_lang = $this->context->language->id; + $hook_name = 'footer'; + $items = array(); + $items = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'tmhtmlcontent` WHERE id_shop = '.$id_shop.' AND id_lang = '.$id_lang.' AND hook = \''.$hook_name.'\' AND active = 1 ORDER BY item_order ASC'); + + $this->context->smarty->assign('htmlitems', array( + 'items' => $items + )); + + return $this->display(__FILE__, 'views/templates/hooks/footer.tpl'); + } + +} \ No newline at end of file diff --git a/modules/tmhtmlcontent/translations/index.php b/modules/tmhtmlcontent/translations/index.php new file mode 100644 index 000000000..198b35f62 --- /dev/null +++ b/modules/tmhtmlcontent/translations/index.php @@ -0,0 +1,10 @@ + li .icon-li { + width: 0.7142857142857143em; + display: inline-block; + text-align: center; +} +[class^="icon-"].hide, +[class*=" icon-"].hide { + display: none; +} +.icon-muted { + color: #eeeeee; +} +.icon-light { + color: #ffffff; +} +.icon-dark { + color: #333333; +} +.icon-border { + border: solid 1px #eeeeee; + padding: .2em .25em .15em; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.icon-2x { + font-size: 2em; +} +.icon-2x.icon-border { + border-width: 2px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.icon-3x { + font-size: 3em; +} +.icon-3x.icon-border { + border-width: 3px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} +.icon-4x { + font-size: 4em; +} +.icon-4x.icon-border { + border-width: 4px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} +.icon-5x { + font-size: 5em; +} +.icon-5x.icon-border { + border-width: 5px; + -webkit-border-radius: 7px; + -moz-border-radius: 7px; + border-radius: 7px; +} +.pull-right { + float: right; +} +.pull-left { + float: left; +} +[class^="icon-"].pull-left, +[class*=" icon-"].pull-left { + margin-right: .3em; +} +[class^="icon-"].pull-right, +[class*=" icon-"].pull-right { + margin-left: .3em; +} +/* BOOTSTRAP SPECIFIC CLASSES + * -------------------------- */ +/* Bootstrap 2.0 sprites.less reset */ +[class^="icon-"], +[class*=" icon-"] { + display: inline; + width: auto; + height: auto; + line-height: normal; + vertical-align: baseline; + background-image: none; + background-position: 0% 0%; + background-repeat: repeat; + margin-top: 0; +} +/* more sprites.less reset */ +.icon-white, +.nav-pills > .active > a > [class^="icon-"], +.nav-pills > .active > a > [class*=" icon-"], +.nav-list > .active > a > [class^="icon-"], +.nav-list > .active > a > [class*=" icon-"], +.navbar-inverse .nav > .active > a > [class^="icon-"], +.navbar-inverse .nav > .active > a > [class*=" icon-"], +.dropdown-menu > li > a:hover > [class^="icon-"], +.dropdown-menu > li > a:hover > [class*=" icon-"], +.dropdown-menu > .active > a > [class^="icon-"], +.dropdown-menu > .active > a > [class*=" icon-"], +.dropdown-submenu:hover > a > [class^="icon-"], +.dropdown-submenu:hover > a > [class*=" icon-"] { + background-image: none; +} +/* keeps Bootstrap styles with and without icons the same */ +.btn [class^="icon-"].icon-large, +.nav [class^="icon-"].icon-large, +.btn [class*=" icon-"].icon-large, +.nav [class*=" icon-"].icon-large { + line-height: .9em; +} +.btn [class^="icon-"].icon-spin, +.nav [class^="icon-"].icon-spin, +.btn [class*=" icon-"].icon-spin, +.nav [class*=" icon-"].icon-spin { + display: inline-block; +} +.nav-tabs [class^="icon-"], +.nav-pills [class^="icon-"], +.nav-tabs [class*=" icon-"], +.nav-pills [class*=" icon-"], +.nav-tabs [class^="icon-"].icon-large, +.nav-pills [class^="icon-"].icon-large, +.nav-tabs [class*=" icon-"].icon-large, +.nav-pills [class*=" icon-"].icon-large { + line-height: .9em; +} +.btn [class^="icon-"].pull-left.icon-2x, +.btn [class*=" icon-"].pull-left.icon-2x, +.btn [class^="icon-"].pull-right.icon-2x, +.btn [class*=" icon-"].pull-right.icon-2x { + margin-top: .18em; +} +.btn [class^="icon-"].icon-spin.icon-large, +.btn [class*=" icon-"].icon-spin.icon-large { + line-height: .8em; +} +.btn.btn-small [class^="icon-"].pull-left.icon-2x, +.btn.btn-small [class*=" icon-"].pull-left.icon-2x, +.btn.btn-small [class^="icon-"].pull-right.icon-2x, +.btn.btn-small [class*=" icon-"].pull-right.icon-2x { + margin-top: .25em; +} +.btn.btn-large [class^="icon-"], +.btn.btn-large [class*=" icon-"] { + margin-top: 0; +} +.btn.btn-large [class^="icon-"].pull-left.icon-2x, +.btn.btn-large [class*=" icon-"].pull-left.icon-2x, +.btn.btn-large [class^="icon-"].pull-right.icon-2x, +.btn.btn-large [class*=" icon-"].pull-right.icon-2x { + margin-top: .05em; +} +.btn.btn-large [class^="icon-"].pull-left.icon-2x, +.btn.btn-large [class*=" icon-"].pull-left.icon-2x { + margin-right: .2em; +} +.btn.btn-large [class^="icon-"].pull-right.icon-2x, +.btn.btn-large [class*=" icon-"].pull-right.icon-2x { + margin-left: .2em; +} +/* EXTRAS + * -------------------------- */ +/* Stacked and layered icon */ +.icon-stack { + position: relative; + display: inline-block; + width: 2em; + height: 2em; + line-height: 2em; + vertical-align: -35%; +} +.icon-stack [class^="icon-"], +.icon-stack [class*=" icon-"] { + display: block; + text-align: center; + position: absolute; + width: 100%; + height: 100%; + font-size: 1em; + line-height: inherit; + *line-height: 2em; +} +.icon-stack .icon-stack-base { + font-size: 2em; + *line-height: 1em; +} +/* Animated rotating icon */ +.icon-spin { + display: inline-block; + -moz-animation: spin 2s infinite linear; + -o-animation: spin 2s infinite linear; + -webkit-animation: spin 2s infinite linear; + animation: spin 2s infinite linear; +} +@-moz-keyframes spin { + 0% { + -moz-transform: rotate(0deg); + } + 100% { + -moz-transform: rotate(359deg); + } +} +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + } +} +@-o-keyframes spin { + 0% { + -o-transform: rotate(0deg); + } + 100% { + -o-transform: rotate(359deg); + } +} +@-ms-keyframes spin { + 0% { + -ms-transform: rotate(0deg); + } + 100% { + -ms-transform: rotate(359deg); + } +} +@keyframes spin { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(359deg); + } +} +/* Icon rotations and mirroring */ +.icon-rotate-90:before { + -webkit-transform: rotate(90deg); + -moz-transform: rotate(90deg); + -ms-transform: rotate(90deg); + -o-transform: rotate(90deg); + transform: rotate(90deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); +} +.icon-rotate-180:before { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + -ms-transform: rotate(180deg); + -o-transform: rotate(180deg); + transform: rotate(180deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); +} +.icon-rotate-270:before { + -webkit-transform: rotate(270deg); + -moz-transform: rotate(270deg); + -ms-transform: rotate(270deg); + -o-transform: rotate(270deg); + transform: rotate(270deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); +} +.icon-flip-horizontal:before { + -webkit-transform: scale(-1, 1); + -moz-transform: scale(-1, 1); + -ms-transform: scale(-1, 1); + -o-transform: scale(-1, 1); + transform: scale(-1, 1); +} +.icon-flip-vertical:before { + -webkit-transform: scale(1, -1); + -moz-transform: scale(1, -1); + -ms-transform: scale(1, -1); + -o-transform: scale(1, -1); + transform: scale(1, -1); +} +/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen + readers do not read off random characters that represent icons */ +.icon-glass:before { + content: "\f000"; +} +.icon-music:before { + content: "\f001"; +} +.icon-search:before { + content: "\f002"; +} +.icon-envelope:before { + content: "\f003"; +} +.icon-heart:before { + content: "\f004"; +} +.icon-star:before { + content: "\f005"; +} +.icon-star-empty:before { + content: "\f006"; +} +.icon-user:before { + content: "\f007"; +} +.icon-film:before { + content: "\f008"; +} +.icon-th-large:before { + content: "\f009"; +} +.icon-th:before { + content: "\f00a"; +} +.icon-th-list:before { + content: "\f00b"; +} +.icon-ok:before { + content: "\f00c"; +} +.icon-remove:before { + content: "\f00d"; +} +.icon-zoom-in:before { + content: "\f00e"; +} +.icon-zoom-out:before { + content: "\f010"; +} +.icon-off:before { + content: "\f011"; +} +.icon-signal:before { + content: "\f012"; +} +.icon-cog:before { + content: "\f013"; +} +.icon-trash:before { + content: "\f014"; +} +.icon-home:before { + content: "\f015"; +} +.icon-file:before { + content: "\f016"; +} +.icon-time:before { + content: "\f017"; +} +.icon-road:before { + content: "\f018"; +} +.icon-download-alt:before { + content: "\f019"; +} +.icon-download:before { + content: "\f01a"; +} +.icon-upload:before { + content: "\f01b"; +} +.icon-inbox:before { + content: "\f01c"; +} +.icon-play-circle:before { + content: "\f01d"; +} +.icon-repeat:before, +.icon-rotate-right:before { + content: "\f01e"; +} +/* F020 doesn't work in Safari. all shifted one down */ +.icon-refresh:before { + content: "\f021"; +} +.icon-list-alt:before { + content: "\f022"; +} +.icon-lock:before { + content: "\f023"; +} +.icon-flag:before { + content: "\f024"; +} +.icon-headphones:before { + content: "\f025"; +} +.icon-volume-off:before { + content: "\f026"; +} +.icon-volume-down:before { + content: "\f027"; +} +.icon-volume-up:before { + content: "\f028"; +} +.icon-qrcode:before { + content: "\f029"; +} +.icon-barcode:before { + content: "\f02a"; +} +.icon-tag:before { + content: "\f02b"; +} +.icon-tags:before { + content: "\f02c"; +} +.icon-book:before { + content: "\f02d"; +} +.icon-bookmark:before { + content: "\f02e"; +} +.icon-print:before { + content: "\f02f"; +} +.icon-camera:before { + content: "\f030"; +} +.icon-font:before { + content: "\f031"; +} +.icon-bold:before { + content: "\f032"; +} +.icon-italic:before { + content: "\f033"; +} +.icon-text-height:before { + content: "\f034"; +} +.icon-text-width:before { + content: "\f035"; +} +.icon-align-left:before { + content: "\f036"; +} +.icon-align-center:before { + content: "\f037"; +} +.icon-align-right:before { + content: "\f038"; +} +.icon-align-justify:before { + content: "\f039"; +} +.icon-list:before { + content: "\f03a"; +} +.icon-indent-left:before { + content: "\f03b"; +} +.icon-indent-right:before { + content: "\f03c"; +} +.icon-facetime-video:before { + content: "\f03d"; +} +.icon-picture:before { + content: "\f03e"; +} +.icon-pencil:before { + content: "\f040"; +} +.icon-map-marker:before { + content: "\f041"; +} +.icon-adjust:before { + content: "\f042"; +} +.icon-tint:before { + content: "\f043"; +} +.icon-edit:before { + content: "\f044"; +} +.icon-share:before { + content: "\f045"; +} +.icon-check:before { + content: "\f046"; +} +.icon-move:before { + content: "\f047"; +} +.icon-step-backward:before { + content: "\f048"; +} +.icon-fast-backward:before { + content: "\f049"; +} +.icon-backward:before { + content: "\f04a"; +} +.icon-play:before { + content: "\f04b"; +} +.icon-pause:before { + content: "\f04c"; +} +.icon-stop:before { + content: "\f04d"; +} +.icon-forward:before { + content: "\f04e"; +} +.icon-fast-forward:before { + content: "\f050"; +} +.icon-step-forward:before { + content: "\f051"; +} +.icon-eject:before { + content: "\f052"; +} +.icon-chevron-left:before { + content: "\f053"; +} +.icon-chevron-right:before { + content: "\f054"; +} +.icon-plus-sign:before { + content: "\f055"; +} +.icon-minus-sign:before { + content: "\f056"; +} +.icon-remove-sign:before { + content: "\f057"; +} +.icon-ok-sign:before { + content: "\f058"; +} +.icon-question-sign:before { + content: "\f059"; +} +.icon-info-sign:before { + content: "\f05a"; +} +.icon-screenshot:before { + content: "\f05b"; +} +.icon-remove-circle:before { + content: "\f05c"; +} +.icon-ok-circle:before { + content: "\f05d"; +} +.icon-ban-circle:before { + content: "\f05e"; +} +.icon-arrow-left:before { + content: "\f060"; +} +.icon-arrow-right:before { + content: "\f061"; +} +.icon-arrow-up:before { + content: "\f062"; +} +.icon-arrow-down:before { + content: "\f063"; +} +.icon-share-alt:before, +.icon-mail-forward:before { + content: "\f064"; +} +.icon-resize-full:before { + content: "\f065"; +} +.icon-resize-small:before { + content: "\f066"; +} +.icon-plus:before { + content: "\f067"; +} +.icon-minus:before { + content: "\f068"; +} +.icon-asterisk:before { + content: "\f069"; +} +.icon-exclamation-sign:before { + content: "\f06a"; +} +.icon-gift:before { + content: "\f06b"; +} +.icon-leaf:before { + content: "\f06c"; +} +.icon-fire:before { + content: "\f06d"; +} +.icon-eye-open:before { + content: "\f06e"; +} +.icon-eye-close:before { + content: "\f070"; +} +.icon-warning-sign:before { + content: "\f071"; +} +.icon-plane:before { + content: "\f072"; +} +.icon-calendar:before { + content: "\f073"; +} +.icon-random:before { + content: "\f074"; +} +.icon-comment:before { + content: "\f075"; +} +.icon-magnet:before { + content: "\f076"; +} +.icon-chevron-up:before { + content: "\f077"; +} +.icon-chevron-down:before { + content: "\f078"; +} +.icon-retweet:before { + content: "\f079"; +} +.icon-shopping-cart:before { + content: "\f07a"; +} +.icon-folder-close:before { + content: "\f07b"; +} +.icon-folder-open:before { + content: "\f07c"; +} +.icon-resize-vertical:before { + content: "\f07d"; +} +.icon-resize-horizontal:before { + content: "\f07e"; +} +.icon-bar-chart:before { + content: "\f080"; +} +.icon-twitter-sign:before { + content: "\f081"; +} +.icon-facebook-sign:before { + content: "\f082"; +} +.icon-camera-retro:before { + content: "\f083"; +} +.icon-key:before { + content: "\f084"; +} +.icon-cogs:before { + content: "\f085"; +} +.icon-comments:before { + content: "\f086"; +} +.icon-thumbs-up:before { + content: "\f087"; +} +.icon-thumbs-down:before { + content: "\f088"; +} +.icon-star-half:before { + content: "\f089"; +} +.icon-heart-empty:before { + content: "\f08a"; +} +.icon-signout:before { + content: "\f08b"; +} +.icon-linkedin-sign:before { + content: "\f08c"; +} +.icon-pushpin:before { + content: "\f08d"; +} +.icon-external-link:before { + content: "\f08e"; +} +.icon-signin:before { + content: "\f090"; +} +.icon-trophy:before { + content: "\f091"; +} +.icon-github-sign:before { + content: "\f092"; +} +.icon-upload-alt:before { + content: "\f093"; +} +.icon-lemon:before { + content: "\f094"; +} +.icon-phone:before { + content: "\f095"; +} +.icon-check-empty:before { + content: "\f096"; +} +.icon-bookmark-empty:before { + content: "\f097"; +} +.icon-phone-sign:before { + content: "\f098"; +} +.icon-twitter:before { + content: "\f099"; +} +.icon-facebook:before { + content: "\f09a"; +} +.icon-github:before { + content: "\f09b"; +} +.icon-unlock:before { + content: "\f09c"; +} +.icon-credit-card:before { + content: "\f09d"; +} +.icon-rss:before { + content: "\f09e"; +} +.icon-hdd:before { + content: "\f0a0"; +} +.icon-bullhorn:before { + content: "\f0a1"; +} +.icon-bell:before { + content: "\f0a2"; +} +.icon-certificate:before { + content: "\f0a3"; +} +.icon-hand-right:before { + content: "\f0a4"; +} +.icon-hand-left:before { + content: "\f0a5"; +} +.icon-hand-up:before { + content: "\f0a6"; +} +.icon-hand-down:before { + content: "\f0a7"; +} +.icon-circle-arrow-left:before { + content: "\f0a8"; +} +.icon-circle-arrow-right:before { + content: "\f0a9"; +} +.icon-circle-arrow-up:before { + content: "\f0aa"; +} +.icon-circle-arrow-down:before { + content: "\f0ab"; +} +.icon-globe:before { + content: "\f0ac"; +} +.icon-wrench:before { + content: "\f0ad"; +} +.icon-tasks:before { + content: "\f0ae"; +} +.icon-filter:before { + content: "\f0b0"; +} +.icon-briefcase:before { + content: "\f0b1"; +} +.icon-fullscreen:before { + content: "\f0b2"; +} +.icon-group:before { + content: "\f0c0"; +} +.icon-link:before { + content: "\f0c1"; +} +.icon-cloud:before { + content: "\f0c2"; +} +.icon-beaker:before { + content: "\f0c3"; +} +.icon-cut:before { + content: "\f0c4"; +} +.icon-copy:before { + content: "\f0c5"; +} +.icon-paper-clip:before { + content: "\f0c6"; +} +.icon-save:before { + content: "\f0c7"; +} +.icon-sign-blank:before { + content: "\f0c8"; +} +.icon-reorder:before { + content: "\f0c9"; +} +.icon-list-ul:before { + content: "\f0ca"; +} +.icon-list-ol:before { + content: "\f0cb"; +} +.icon-strikethrough:before { + content: "\f0cc"; +} +.icon-underline:before { + content: "\f0cd"; +} +.icon-table:before { + content: "\f0ce"; +} +.icon-magic:before { + content: "\f0d0"; +} +.icon-truck:before { + content: "\f0d1"; +} +.icon-pinterest:before { + content: "\f0d2"; +} +.icon-pinterest-sign:before { + content: "\f0d3"; +} +.icon-google-plus-sign:before { + content: "\f0d4"; +} +.icon-google-plus:before { + content: "\f0d5"; +} +.icon-money:before { + content: "\f0d6"; +} +.icon-caret-down:before { + content: "\f0d7"; +} +.icon-caret-up:before { + content: "\f0d8"; +} +.icon-caret-left:before { + content: "\f0d9"; +} +.icon-caret-right:before { + content: "\f0da"; +} +.icon-columns:before { + content: "\f0db"; +} +.icon-sort:before { + content: "\f0dc"; +} +.icon-sort-down:before { + content: "\f0dd"; +} +.icon-sort-up:before { + content: "\f0de"; +} +.icon-envelope-alt:before { + content: "\f0e0"; +} +.icon-linkedin:before { + content: "\f0e1"; +} +.icon-undo:before, +.icon-rotate-left:before { + content: "\f0e2"; +} +.icon-legal:before { + content: "\f0e3"; +} +.icon-dashboard:before { + content: "\f0e4"; +} +.icon-comment-alt:before { + content: "\f0e5"; +} +.icon-comments-alt:before { + content: "\f0e6"; +} +.icon-bolt:before { + content: "\f0e7"; +} +.icon-sitemap:before { + content: "\f0e8"; +} +.icon-umbrella:before { + content: "\f0e9"; +} +.icon-paste:before { + content: "\f0ea"; +} +.icon-lightbulb:before { + content: "\f0eb"; +} +.icon-exchange:before { + content: "\f0ec"; +} +.icon-cloud-download:before { + content: "\f0ed"; +} +.icon-cloud-upload:before { + content: "\f0ee"; +} +.icon-user-md:before { + content: "\f0f0"; +} +.icon-stethoscope:before { + content: "\f0f1"; +} +.icon-suitcase:before { + content: "\f0f2"; +} +.icon-bell-alt:before { + content: "\f0f3"; +} +.icon-coffee:before { + content: "\f0f4"; +} +.icon-food:before { + content: "\f0f5"; +} +.icon-file-alt:before { + content: "\f0f6"; +} +.icon-building:before { + content: "\f0f7"; +} +.icon-hospital:before { + content: "\f0f8"; +} +.icon-ambulance:before { + content: "\f0f9"; +} +.icon-medkit:before { + content: "\f0fa"; +} +.icon-fighter-jet:before { + content: "\f0fb"; +} +.icon-beer:before { + content: "\f0fc"; +} +.icon-h-sign:before { + content: "\f0fd"; +} +.icon-plus-sign-alt:before { + content: "\f0fe"; +} +.icon-double-angle-left:before { + content: "\f100"; +} +.icon-double-angle-right:before { + content: "\f101"; +} +.icon-double-angle-up:before { + content: "\f102"; +} +.icon-double-angle-down:before { + content: "\f103"; +} +.icon-angle-left:before { + content: "\f104"; +} +.icon-angle-right:before { + content: "\f105"; +} +.icon-angle-up:before { + content: "\f106"; +} +.icon-angle-down:before { + content: "\f107"; +} +.icon-desktop:before { + content: "\f108"; +} +.icon-laptop:before { + content: "\f109"; +} +.icon-tablet:before { + content: "\f10a"; +} +.icon-mobile-phone:before { + content: "\f10b"; +} +.icon-circle-blank:before { + content: "\f10c"; +} +.icon-quote-left:before { + content: "\f10d"; +} +.icon-quote-right:before { + content: "\f10e"; +} +.icon-spinner:before { + content: "\f110"; +} +.icon-circle:before { + content: "\f111"; +} +.icon-reply:before, +.icon-mail-reply:before { + content: "\f112"; +} +.icon-folder-close-alt:before { + content: "\f114"; +} +.icon-folder-open-alt:before { + content: "\f115"; +} +.icon-expand-alt:before { + content: "\f116"; +} +.icon-collapse-alt:before { + content: "\f117"; +} +.icon-smile:before { + content: "\f118"; +} +.icon-frown:before { + content: "\f119"; +} +.icon-meh:before { + content: "\f11a"; +} +.icon-gamepad:before { + content: "\f11b"; +} +.icon-keyboard:before { + content: "\f11c"; +} +.icon-flag-alt:before { + content: "\f11d"; +} +.icon-flag-checkered:before { + content: "\f11e"; +} +.icon-terminal:before { + content: "\f120"; +} +.icon-code:before { + content: "\f121"; +} +.icon-reply-all:before { + content: "\f122"; +} +.icon-mail-reply-all:before { + content: "\f122"; +} +.icon-star-half-full:before, +.icon-star-half-empty:before { + content: "\f123"; +} +.icon-location-arrow:before { + content: "\f124"; +} +.icon-crop:before { + content: "\f125"; +} +.icon-code-fork:before { + content: "\f126"; +} +.icon-unlink:before { + content: "\f127"; +} +.icon-question:before { + content: "\f128"; +} +.icon-info:before { + content: "\f129"; +} +.icon-exclamation:before { + content: "\f12a"; +} +.icon-superscript:before { + content: "\f12b"; +} +.icon-subscript:before { + content: "\f12c"; +} +.icon-eraser:before { + content: "\f12d"; +} +.icon-puzzle-piece:before { + content: "\f12e"; +} +.icon-microphone:before { + content: "\f130"; +} +.icon-microphone-off:before { + content: "\f131"; +} +.icon-shield:before { + content: "\f132"; +} +.icon-calendar-empty:before { + content: "\f133"; +} +.icon-fire-extinguisher:before { + content: "\f134"; +} +.icon-rocket:before { + content: "\f135"; +} +.icon-maxcdn:before { + content: "\f136"; +} +.icon-chevron-sign-left:before { + content: "\f137"; +} +.icon-chevron-sign-right:before { + content: "\f138"; +} +.icon-chevron-sign-up:before { + content: "\f139"; +} +.icon-chevron-sign-down:before { + content: "\f13a"; +} +.icon-html5:before { + content: "\f13b"; +} +.icon-css3:before { + content: "\f13c"; +} +.icon-anchor:before { + content: "\f13d"; +} +.icon-unlock-alt:before { + content: "\f13e"; +} +.icon-bullseye:before { + content: "\f140"; +} +.icon-ellipsis-horizontal:before { + content: "\f141"; +} +.icon-ellipsis-vertical:before { + content: "\f142"; +} +.icon-rss-sign:before { + content: "\f143"; +} +.icon-play-sign:before { + content: "\f144"; +} +.icon-ticket:before { + content: "\f145"; +} +.icon-minus-sign-alt:before { + content: "\f146"; +} +.icon-check-minus:before { + content: "\f147"; +} +.icon-level-up:before { + content: "\f148"; +} +.icon-level-down:before { + content: "\f149"; +} +.icon-check-sign:before { + content: "\f14a"; +} +.icon-edit-sign:before { + content: "\f14b"; +} +.icon-external-link-sign:before { + content: "\f14c"; +} +.icon-share-sign:before { + content: "\f14d"; +} diff --git a/modules/tmhtmlcontent/views/css/font/fontawesome-webfont.eot b/modules/tmhtmlcontent/views/css/font/fontawesome-webfont.eot new file mode 100644 index 000000000..c080283bd Binary files /dev/null and b/modules/tmhtmlcontent/views/css/font/fontawesome-webfont.eot differ diff --git a/modules/tmhtmlcontent/views/css/font/fontawesome-webfont.svg b/modules/tmhtmlcontent/views/css/font/fontawesome-webfont.svg new file mode 100644 index 000000000..10a1e1bbf --- /dev/null +++ b/modules/tmhtmlcontent/views/css/font/fontawesome-webfont.svg @@ -0,0 +1,339 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/modules/tmhtmlcontent/views/css/font/fontawesome-webfont.ttf b/modules/tmhtmlcontent/views/css/font/fontawesome-webfont.ttf new file mode 100644 index 000000000..908f69ec9 Binary files /dev/null and b/modules/tmhtmlcontent/views/css/font/fontawesome-webfont.ttf differ diff --git a/modules/tmhtmlcontent/views/css/font/fontawesome-webfont.woff b/modules/tmhtmlcontent/views/css/font/fontawesome-webfont.woff new file mode 100644 index 000000000..a33af950a Binary files /dev/null and b/modules/tmhtmlcontent/views/css/font/fontawesome-webfont.woff differ diff --git a/modules/tmhtmlcontent/views/css/font/museo_slab_300-webfont.eot b/modules/tmhtmlcontent/views/css/font/museo_slab_300-webfont.eot new file mode 100644 index 000000000..332499946 Binary files /dev/null and b/modules/tmhtmlcontent/views/css/font/museo_slab_300-webfont.eot differ diff --git a/modules/tmhtmlcontent/views/css/font/museo_slab_300-webfont.ttf b/modules/tmhtmlcontent/views/css/font/museo_slab_300-webfont.ttf new file mode 100644 index 000000000..9248b9a4e Binary files /dev/null and b/modules/tmhtmlcontent/views/css/font/museo_slab_300-webfont.ttf differ diff --git a/modules/tmhtmlcontent/views/css/font/museo_slab_500-webfont.eot b/modules/tmhtmlcontent/views/css/font/museo_slab_500-webfont.eot new file mode 100644 index 000000000..2eb7a8977 Binary files /dev/null and b/modules/tmhtmlcontent/views/css/font/museo_slab_500-webfont.eot differ diff --git a/modules/tmhtmlcontent/views/css/font/museo_slab_500-webfont.ttf b/modules/tmhtmlcontent/views/css/font/museo_slab_500-webfont.ttf new file mode 100644 index 000000000..bf78a2aef Binary files /dev/null and b/modules/tmhtmlcontent/views/css/font/museo_slab_500-webfont.ttf differ diff --git a/modules/tmhtmlcontent/views/css/font/proximanova-sbold-webfont.eot b/modules/tmhtmlcontent/views/css/font/proximanova-sbold-webfont.eot new file mode 100644 index 000000000..ecf0cb15e Binary files /dev/null and b/modules/tmhtmlcontent/views/css/font/proximanova-sbold-webfont.eot differ diff --git a/modules/tmhtmlcontent/views/css/font/proximanova-sbold-webfont.ttf b/modules/tmhtmlcontent/views/css/font/proximanova-sbold-webfont.ttf new file mode 100644 index 000000000..564f1aae7 Binary files /dev/null and b/modules/tmhtmlcontent/views/css/font/proximanova-sbold-webfont.ttf differ diff --git a/modules/tmhtmlcontent/views/css/font/proximanova-webfont.eot b/modules/tmhtmlcontent/views/css/font/proximanova-webfont.eot new file mode 100644 index 000000000..1f28b415c Binary files /dev/null and b/modules/tmhtmlcontent/views/css/font/proximanova-webfont.eot differ diff --git a/modules/tmhtmlcontent/views/css/font/proximanova-webfont.ttf b/modules/tmhtmlcontent/views/css/font/proximanova-webfont.ttf new file mode 100644 index 000000000..e9aa413bb Binary files /dev/null and b/modules/tmhtmlcontent/views/css/font/proximanova-webfont.ttf differ diff --git a/modules/tmhtmlcontent/views/css/hooks.css b/modules/tmhtmlcontent/views/css/hooks.css new file mode 100644 index 000000000..fdff4e144 --- /dev/null +++ b/modules/tmhtmlcontent/views/css/hooks.css @@ -0,0 +1,37 @@ +/* Home hook CSS */ +#htmlcontent_home { +} + +ul.htmlcontent-home { +} + +li.htmlcontent-item { +} + +li.htmlcontent-item a.item-link { +} + +li.htmlcontent-item img.item-img { +} + +li.htmlcontent-item h3.item-title { +} + +li.htmlcontent-item div.item-html { +} + +/* Top hook CSS */ +#htmlcontent_top { +} + +/* Left hook CSS */ +#htmlcontent_left { +} + +/* Right hook CSS */ +#htmlcontent_right { +} + +/* Footer hook CSS */ +#htmlcontent_footer { +} diff --git a/modules/tmhtmlcontent/views/index.php b/modules/tmhtmlcontent/views/index.php new file mode 100644 index 000000000..198b35f62 --- /dev/null +++ b/modules/tmhtmlcontent/views/index.php @@ -0,0 +1,10 @@ + +

    {$htmlcontent.info.name} (v.{$htmlcontent.info.version})

    + + {if $error} + {include file="{$htmlcontent.admin_tpl_path}messages.tpl" id="main" text=$error class='error'} + {/if} + {if $confirmation} + {include file="{$htmlcontent.admin_tpl_path}messages.tpl" id="main" text=$confirmation class='conf'} + {/if} + + + {include file="{$htmlcontent.admin_tpl_path}new.tpl"} + + {include file="{$htmlcontent.admin_tpl_path}items.tpl"} + +
    \ No newline at end of file diff --git a/modules/tmhtmlcontent/views/templates/admin/index.php b/modules/tmhtmlcontent/views/templates/admin/index.php new file mode 100644 index 000000000..198b35f62 --- /dev/null +++ b/modules/tmhtmlcontent/views/templates/admin/index.php @@ -0,0 +1,10 @@ + + {foreach from=$htmlitems.lang.all item=lang} +
  • {$lang.name} {$lang.name}
  • + {/foreach} + +
    +{foreach name=langs from=$htmlitems.items key=lang item=langItems} + +
    + {foreach name=hooks from=$langItems key=hook item=hookItems} + +

    {l s='Hook' mod='tmhtmlcontent'} "{$hook}"

    + {if $hookItems} +
      + {foreach name=items from=$hookItems item=hItem} +
    • + {if $hItem.item_order le 9}0{/if}{$hItem.item_order} + + {$hItem.title} + {l s='Edit' mod='tmhtmlcontent'} + {l s='Close' mod='tmhtmlcontent'} + +
      +
      + + + +
      + + +
      +
      + + +
      +
      + + +
      +
      + + +
      +
      + + +
      +
      + +
      +
      + +
      +
      +
      + + +
      +
      + + +
      +
      + + +
      +
      + + +
      + + +
      +
      +
    • + {/foreach} +
    + {else} +
    + {l s='No items available' mod='tmhtmlcontent'} +
    + {/if} + {/foreach} +
    +{/foreach} +
    diff --git a/modules/tmhtmlcontent/views/templates/admin/messages.tpl b/modules/tmhtmlcontent/views/templates/admin/messages.tpl new file mode 100644 index 000000000..45f30c839 --- /dev/null +++ b/modules/tmhtmlcontent/views/templates/admin/messages.tpl @@ -0,0 +1,3 @@ +
    +
    {if isset($text)}{$text}{/if}
    +
    \ No newline at end of file diff --git a/modules/tmhtmlcontent/views/templates/admin/new.tpl b/modules/tmhtmlcontent/views/templates/admin/new.tpl new file mode 100644 index 000000000..3df5064f6 --- /dev/null +++ b/modules/tmhtmlcontent/views/templates/admin/new.tpl @@ -0,0 +1,57 @@ +
    + {l s='Add item' mod='tmhtmlcontent'} +
    +
    +
    + +
      + {foreach from=$htmlitems.lang.all item=lang} +
    • {$lang.name}
    • + {/foreach} +
    + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    +
    +
    + +
    +
    + + +
    +
    + + +
    +
    + + +
    + +
    +
    +
    diff --git a/modules/tmhtmlcontent/views/templates/hooks/footer.tpl b/modules/tmhtmlcontent/views/templates/hooks/footer.tpl new file mode 100644 index 000000000..ddf20e55d --- /dev/null +++ b/modules/tmhtmlcontent/views/templates/hooks/footer.tpl @@ -0,0 +1,27 @@ +{if isset($htmlitems.items) && $htmlitems.items} + +{/if} diff --git a/modules/tmhtmlcontent/views/templates/hooks/home.tpl b/modules/tmhtmlcontent/views/templates/hooks/home.tpl new file mode 100644 index 000000000..285b07aea --- /dev/null +++ b/modules/tmhtmlcontent/views/templates/hooks/home.tpl @@ -0,0 +1,27 @@ +{if isset($htmlitems.items) && $htmlitems.items} + +{/if} diff --git a/modules/tmhtmlcontent/views/templates/hooks/left.tpl b/modules/tmhtmlcontent/views/templates/hooks/left.tpl new file mode 100644 index 000000000..afc5afbb6 --- /dev/null +++ b/modules/tmhtmlcontent/views/templates/hooks/left.tpl @@ -0,0 +1,27 @@ +{if isset($htmlitems.items) && $htmlitems.items} + +{/if} \ No newline at end of file diff --git a/modules/tmhtmlcontent/views/templates/hooks/right.tpl b/modules/tmhtmlcontent/views/templates/hooks/right.tpl new file mode 100644 index 000000000..6fe8b6c57 --- /dev/null +++ b/modules/tmhtmlcontent/views/templates/hooks/right.tpl @@ -0,0 +1,27 @@ +{if isset($htmlitems.items) && $htmlitems.items} + +{/if} \ No newline at end of file diff --git a/modules/tmhtmlcontent/views/templates/hooks/top.tpl b/modules/tmhtmlcontent/views/templates/hooks/top.tpl new file mode 100644 index 000000000..e9f9f958c --- /dev/null +++ b/modules/tmhtmlcontent/views/templates/hooks/top.tpl @@ -0,0 +1,27 @@ +{if isset($htmlitems.items) && $htmlitems.items} + +{/if} \ No newline at end of file diff --git a/modules/tmhtmlcontent/views/templates/index.php b/modules/tmhtmlcontent/views/templates/index.php new file mode 100644 index 000000000..198b35f62 --- /dev/null +++ b/modules/tmhtmlcontent/views/templates/index.php @@ -0,0 +1,10 @@ + li { + position: static; +} +#categories_block_top .sf-menu > li > ul { + width: 100%; + top: 60px; + margin: 0 20px; +} +#categories_block_top .sf-menu > li > ul > li { + display: block; + float: left; + width: 20%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + padding: 0 10px; +} +#categories_block_top .sf-menu > li > ul > .category_thumb { + display: block; + clear: both; + overflow: hidden; + width: 100%; +} +#categories_block_top .sf-menu > li > ul > .category_thumb img { + display: inline-block; + width: 33%; +} +#categories_block_top .sf-menu > li h4 a { + font-size: 1.1em; +} +#categories_block_top .sf-menu > li h4 a:before { + display: none; +} +#categories_block_top .sf-menu > li .main-level-submenus { + position: relative; + display: block !important; + visibility: visible !important; + top: 0; + background: none; + box-shadow: none; + padding: 0; + left: 0; +} +#categories_block_top .sf-menu .category_thumb { + display: none; +} + #categories_block_left .block_content > ul { border-top: 1px solid #d6d4d4; } @@ -1334,11 +1390,19 @@ ul.footer_links li + li { display: block; padding: 4px 0; } +@media (max-width: 767px) { + .top-pagination-content ul.pagination li.pagination_previous > a b, .top-pagination-content ul.pagination li.pagination_previous > span b, .top-pagination-content ul.pagination li.pagination_next > a b, .top-pagination-content ul.pagination li.pagination_next > span b, .bottom-pagination-content ul.pagination li.pagination_previous > a b, .bottom-pagination-content ul.pagination li.pagination_previous > span b, .bottom-pagination-content ul.pagination li.pagination_next > a b, .bottom-pagination-content ul.pagination li.pagination_next > span b { + display: none; + } +} .top-pagination-content ul.pagination li.pagination_previous > a span, .top-pagination-content ul.pagination li.pagination_previous > span span, .top-pagination-content ul.pagination li.pagination_next > a span, .top-pagination-content ul.pagination li.pagination_next > span span, .bottom-pagination-content ul.pagination li.pagination_previous > a span, .bottom-pagination-content ul.pagination li.pagination_previous > span span, .bottom-pagination-content ul.pagination li.pagination_next > a span, .bottom-pagination-content ul.pagination li.pagination_next > span span { border: none; padding: 0; background: none; } +.top-pagination-content ul.pagination li.pagination_previous > a b, .top-pagination-content ul.pagination li.pagination_previous > span b, .top-pagination-content ul.pagination li.pagination_next > a b, .top-pagination-content ul.pagination li.pagination_next > span b, .bottom-pagination-content ul.pagination li.pagination_previous > a b, .bottom-pagination-content ul.pagination li.pagination_previous > span b, .bottom-pagination-content ul.pagination li.pagination_next > a b, .bottom-pagination-content ul.pagination li.pagination_next > span b { + font-weight: bold; +} .top-pagination-content ul.pagination li.pagination_previous, .bottom-pagination-content ul.pagination li.pagination_previous { margin-right: 10px; } @@ -1552,7 +1616,7 @@ ul.step li.step_done { } ul.step li.step_done a { color: white; - text-shadow: 1px 1px rgba(0, 0, 0, 0); + text-shadow: 1px 1px rgba(0, 0, 0, 0.3); border: 1px solid; border-color: #8b8a8a; background: #727171; @@ -1791,7 +1855,7 @@ div.star_hover a, div.star a:hover { font-weight: bold; padding: 8px 10px 10px 10px; color: white; - text-shadow: 1px 1px rgba(0, 0, 0, 0); + text-shadow: 1px 1px rgba(0, 0, 0, 0.2); } @media (max-width: 479px) { #header #currencies-block-top div.current, #header #languages-block-top div.current { @@ -1862,7 +1926,7 @@ div.star_hover a, div.star a:hover { color: white; font-weight: bold; padding: 8px 10px 11px 10px; - text-shadow: 1px 1px rgba(0, 0, 0, 0); + text-shadow: 1px 1px rgba(0, 0, 0, 0.2); } @media (max-width: 479px) { #header #contact-link a { @@ -1994,7 +2058,7 @@ div.star_hover a, div.star a:hover { } .footer-container #footer ul li a { font-weight: bold; - text-shadow: 1px 1px 0px rgba(0, 0, 0, 0); + text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.4); } .footer-container #footer #block_contact_infos { border-left: 1px solid #515151; @@ -2736,7 +2800,6 @@ p.cheque-indent { #manufacturers_list.list li .mansup-container, #suppliers_list.list li .mansup-container { border-top: 1px solid #d6d4d4; padding: 31px 0 30px 0; - /* < 768 */ } @media (max-width: 767px) { #manufacturers_list.list li .mansup-container, #suppliers_list.list li .mansup-container { @@ -2755,7 +2818,6 @@ p.cheque-indent { } #manufacturers_list.list li .middle-side, #suppliers_list.list li .middle-side { padding-left: 0; - /* < 768 */ } @media (max-width: 767px) { #manufacturers_list.list li .middle-side, #suppliers_list.list li .middle-side { @@ -2767,7 +2829,6 @@ p.cheque-indent { border-left: 1px solid #d6d4d4; padding: 0 0 32px 31px; min-height: 108px; - /* < 768 */ } @media (max-width: 767px) { #manufacturers_list.list li .right-side-content, #suppliers_list.list li .right-side-content { @@ -2780,18 +2841,12 @@ p.cheque-indent { position: relative; top: -6px; margin-bottom: 12px; - /* < 768 */ } @media (max-width: 767px) { #manufacturers_list.list li .right-side-content .product-counter, #suppliers_list.list li .right-side-content .product-counter { top: 0; } } -#manufacturers_list.grid, #suppliers_list.grid { - /* > 1199 */ - /*768 -> 1199*/ - /*< 768 */ -} #manufacturers_list.grid li, #suppliers_list.grid li { text-align: center; } @@ -2844,7 +2899,6 @@ p.cheque-indent { } #manufacturer .bottom-pagination-content #pagination .showall, #manufacturer .top-pagination-content #pagination .showall, #supplier .bottom-pagination-content #pagination .showall, #supplier .top-pagination-content #pagination .showall { margin-right: 0; - /* > 1199 */ } @media (min-width: 1200px) { #manufacturer .bottom-pagination-content #pagination .showall, #manufacturer .top-pagination-content #pagination .showall, #supplier .bottom-pagination-content #pagination .showall, #supplier .top-pagination-content #pagination .showall { @@ -2873,9 +2927,6 @@ table.discount i.icon-remove { /***************************************************************************************************** GUEST TRACKING ******************************************************************************************************/ -#guestTracking { - /* > 1200px */ -} #guestTracking .form-control { max-width: 271px; } @@ -2943,7 +2994,6 @@ table.discount i.icon-remove { max-width: 293px; display: inline-block; margin-right: 5px; - /* max 767px */ } @media (max-width: 767px) { #pagenotfound .pagenotfound .form-control { @@ -3172,3 +3222,139 @@ div.star_hover a, div.star a:hover { content: ""; font-family: "FontAwesome"; } + +/********************************************* Homepage pre-footer *****************************************/ +#facebook_block, #cmsinfo_block { + margin-top: 40px; + overflow: hidden; + background: #f2f2f2; + min-height: 344px; + padding-right: 29px; + padding-left: 29px; +} +@media (max-width: 991px) { + #facebook_block, #cmsinfo_block { + padding-left: 15px; + padding-right: 15px; + } +} +@media (max-width: 767px) { + #facebook_block, #cmsinfo_block { + width: 100%; + min-height: 1px; + } +} +#facebook_block h4, #cmsinfo_block h4 { + font: 600 21px/25px "Open Sans", sans-serif; + color: #555454; + margin-bottom: 26px; +} +@media (max-width: 991px) { + #facebook_block h4, #cmsinfo_block h4 { + font-size: 16px; + } +} +@media (max-width: 767px) { + #facebook_block h4, #cmsinfo_block h4 { + padding-top: 20px !important; + } +} + +#facebook_block h4 { + padding-top: 44px; +} +#facebook_block .facebook-fanbox { + background: white; + border: 1px solid #aaaaaa; + padding-bottom: 10px; +} + +#cmsinfo_block { + border-left: 1px solid #d9d9d9; +} +@media (max-width: 767px) { + #cmsinfo_block { + border: none; + margin-top: 10px; + } +} +#cmsinfo_block > div { + padding-top: 45px; + padding-left: 0; +} +@media (max-width: 767px) { + #cmsinfo_block > div { + padding-top: 20px; + } +} +@media (max-width: 479px) { + #cmsinfo_block > div { + width: 100%; + border-top: 1px solid #d9d9d9; + } +} +#cmsinfo_block > div + div { + border-left: 1px solid #d9d9d9; + min-height: 344px; + padding-left: 29px; +} +@media (max-width: 479px) { + #cmsinfo_block > div + div { + border-left: none; + padding-left: 10px; + min-height: 1px; + padding-bottom: 15px; + } +} +#cmsinfo_block > div + div h3 { + margin-bottom: 12px; +} +#cmsinfo_block em { + float: left; + font-size: 35px; + color: white; + width: 59px; + height: 59px; + line-height: 59px; + text-align: center; + background: #333333; + -webkit-border-radius: 100px; + -moz-border-radius: 100px; + -ms-border-radius: 100px; + -o-border-radius: 100px; + border-radius: 100px; + margin: 3px 10px 0 0; +} +@media (max-width: 991px) { + #cmsinfo_block em { + width: 30px; + height: 30px; + line-height: 30px; + font-size: 20px; + } +} +#cmsinfo_block .type-text { + overflow: hidden; +} +#cmsinfo_block h3 { + font: 600 21px/25px "Open Sans", sans-serif; + color: #555454; +} +@media (max-width: 1199px) { + #cmsinfo_block h3 { + font-size: 18px; + } +} +#cmsinfo_block ul li { + padding-bottom: 22px; +} +@media (max-width: 1199px) { + #cmsinfo_block ul li { + padding-bottom: 10px; + } +} +@media (max-width: 991px) { + #cmsinfo_block ul li { + padding-bottom: 0; + } +} diff --git a/themes/default-bootstrap/css/modules/blocklayered/blocklayered-15.css b/themes/default-bootstrap/css/modules/blocklayered/blocklayered-15.css index d7448b880..c898ef199 100644 --- a/themes/default-bootstrap/css/modules/blocklayered/blocklayered-15.css +++ b/themes/default-bootstrap/css/modules/blocklayered/blocklayered-15.css @@ -10,7 +10,7 @@ padding-bottom: 11px; } #enabled_filters li { - padding: 1px 0; + padding: 1px 15px 1px 0; color: #9c9b9b; cursor: pointer; position: relative; diff --git a/themes/default-bootstrap/css/modules/homeslider/bx_styles.css b/themes/default-bootstrap/css/modules/homeslider/bx_styles.css index e7e8fd7a0..cc8d96652 100644 --- a/themes/default-bootstrap/css/modules/homeslider/bx_styles.css +++ b/themes/default-bootstrap/css/modules/homeslider/bx_styles.css @@ -16,11 +16,20 @@ #homepage-slider { padding-left: 0; padding-right: 0; - padding-top: 29px; - margin-bottom: 35px; + padding-top: 50px; + margin-bottom: 14px; + width: 66.6%; max-width: 779px; position: relative; z-index: 1; + float: left; +} +@media (max-width: 767px) { + #homepage-slider { + width: 100%; + max-width: 100%; + padding-top: 20px; + } } #homepage-slider #homeslider { margin: 0 auto; diff --git a/themes/default-bootstrap/css/modules/tmhtmlcontent/views/css/hooks.css b/themes/default-bootstrap/css/modules/tmhtmlcontent/views/css/hooks.css new file mode 100644 index 000000000..e851709ae --- /dev/null +++ b/themes/default-bootstrap/css/modules/tmhtmlcontent/views/css/hooks.css @@ -0,0 +1,72 @@ +@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic,800,800italic); +/* Home hook CSS */ +#htmlcontent_home ul { + margin: 0 -5px; +} +#htmlcontent_home ul li { + padding: 0 5px 10px; +} +@media (max-width: 479px) { + #htmlcontent_home ul li { + width: 100%; + } +} +#htmlcontent_home ul li img { + max-width: 100%; + height: auto; +} +@media (max-width: 479px) { + #htmlcontent_home ul li img { + min-width: 100%; + } +} +#htmlcontent_home ul li.htmlcontent-item-4 { + width: 66.6667%; +} +@media (max-width: 479px) { + #htmlcontent_home ul li.htmlcontent-item-4 { + width: 100%; + } +} + +/* Top hook CSS */ +#htmlcontent_top { + float: left; + padding-top: 40px; + width: 33.4%; + max-width: 391px; + padding-left: 10px; +} +@media (max-width: 767px) { + #htmlcontent_top { + width: 100%; + max-width: 100%; + padding-left: 0; + padding-top: 0px; + } +} +@media (max-width: 767px) { + #htmlcontent_top ul { + margin: 0 -5px; + } +} +#htmlcontent_top ul li { + padding-top: 10px; + width: 100%; +} +@media (max-width: 767px) { + #htmlcontent_top ul li { + float: left; + padding-left: 5px; + padding-right: 5px; + width: 50%; + } +} +#htmlcontent_top ul li img { + max-width: 100%; + height: auto; +} + +/* Left hook CSS */ +/* Right hook CSS */ +/* Footer hook CSS */ diff --git a/themes/default-bootstrap/header.tpl b/themes/default-bootstrap/header.tpl index 3caaf49c9..be2963702 100644 --- a/themes/default-bootstrap/header.tpl +++ b/themes/default-bootstrap/header.tpl @@ -40,7 +40,17 @@ - + + +