- Password* :
+ Password * :
@@ -33,11 +33,11 @@
$options = Array (
'upgrade' => 'Upgrade In-Portal',
- 'clean_reinstall' => 'Clean out the In-Portal database and reinstall',
- 2 => 'Install to a new database',
+ 'clean_reinstall' => 'Reinstall In-Portal',
+ 2 => 'Install In-Portal to a New Database',
'update_license' => 'Update License Information',
- 'db_reconfig' => 'Change Database Configuration',
- 'fix_paths' => 'Fix Paths',
+ 'db_reconfig' => 'Update Database Configuration',
+ 'fix_paths' => 'Update Installation Paths',
);
$upgradable_modules = $this->GetUpgradableModules();
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_modify_f3.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/login.tpl
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/admin_templates/login.tpl (.../login.tpl) (revision 12127)
+++ branches/5.1.x/core/admin_templates/login.tpl (.../login.tpl) (revision 12657)
@@ -1,7 +1,8 @@
+
-
+
")
-/* The main calendar widget. DIV containing a table. */
-
Index: branches/5.1.x/themes/default2009/platform/img/languages_separator.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/themes/default2009/platform/img/ic_addtofav.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/themes/default2009/platform/inc/jquery/jquery.pack.js
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/inc/jquery/jquery.pack.js (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/inc/jquery/jquery.pack.js (revision 0)
@@ -1,19 +0,0 @@
-/*
- * jQuery JavaScript Library v1.3.2
- * http://jquery.com/
- *
- * Copyright (c) 2009 John Resig
- * Dual licensed under the MIT and GPL licenses.
- * http://docs.jquery.com/License
- *
- * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
- * Revision: 6246
- */
-(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,""]||!O.indexOf(""," "]||(!O.indexOf(""," "]||!O.indexOf(""," "]||!o.support.htmlSerialize&&[1,"div","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
-/*
- * Sizzle CSS Selector Engine - v0.9.3
- * Copyright 2009, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- * More information: http://sizzlejs.com/
- */
-(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V ";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML=" ";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="
";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(Fa text ';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
").append(M.responseText.replace(/
-
-
-
-
- ">
-
-
-
-
-
- " id=" " value="" tabindex=" " style=" " />
-
-
-
-
-
-
-
- ">
-
-
-
-
-
- " tabindex=" " style=" ">
-
- ( )
-
- [upload]" value=" " />
-
-
-
-
-
-
- ">
-
-
-
-
-
-
- " target="_blank">
-
-
-
-
-
- " tabindex=" " style=" ">
- [upload]" value=" " />
- " value=" " style=" ">
-
-
-
-
-
-
- ">
-
-
-
-
-
-
- ">
-
-
-
-
-
- " tabindex=" " style=" ">
- [upload]" value=" " />
-
-
-
-
-
-
- " id=" " value=" " />
-
-
-
- ">
-
-
-
-
-
- " id=" " value=" " tabindex=" " size=" " style=" " datepickerIcon=" img/calendar_icon.gif"> ( )
-
- " id=" " value="" />
-
-
-
-
-
-
- ">
-
-
-
-
-
- " id=" " value=" " tabindex=" " size=" " style=" ">
- ( )
-
- " id=" " value="" />
-
-
-
-
-
-
- ">
-
-
-
-
-
- " id=" " value=" " tabindex=" " size=" " style=" " datepickerIcon=" core/admin_templates/img/calendar_icon.gif">
- ( )
-
- " id=" " value=" " tabindex=" " size=" " style=" "> ( )
-
-
-
-
-
-
- ">
-
-
-
-
-
- " name=" " cols=" " rows=" " style=" ">
-
-
-
-
-
-
-
-
-
_input" style="display: none;" >
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ">
-
-
-
-
-
-
-
-
-
-
-
-
- " >
-
-
-
- " >
-
-
-
- ">
-
-
-
-
-
- " name=" " style=" ">
-
-
-
-
-
-
-
-
-
-
-
-
- " style=" " name=" " id=" _ " value=" "> _ ">
-
-
-
- " style=" " name=" " id=" _ " value=" "> _ ">
-
-
-
- ">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ">
-
-
-
-
-
- " alt=" "/>
- img/s.gif" width="1" height="5" alt=""/>
- " value=" " tabindex=" " style=" ">
-
-
-
-
-
-
- ">
-
-
-
-
-
- " name=" " value=" " />
- " type="checkbox" id="_cb_ " name="_cb_ " style=" " onchange="update_checkbox(this, document.getElementById(' '));">
-
-
-
-
-
-
-
-
-
- ">
-
-
-
-
-
-
-
- " id=" _select" style=" ">
-
-
-
-
- " onclick="$ItemCategories.AddCategory('» ', $delete_button, );"/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ">
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
Index: branches/5.1.x/themes/default2009/platform/elements/html_head.elm.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/elements/html_head.elm.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/elements/html_head.elm.tpl (revision 0)
@@ -1,31 +0,0 @@
-
-
- " />
-
- " />
- " />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Index: branches/5.1.x/themes/default2009/platform/elements/pagination.elm.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/elements/pagination.elm.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/elements/pagination.elm.tpl (revision 0)
@@ -1,52 +0,0 @@
-
- img/pagenation_left.gif" width="5" height="5" alt="" />
-
-
-
- img/pagenation_right.gif" width="5" height="5" alt="" />
-
-
-
-
-
-
-
- img/s.gif" width="1" height="1" alt="" />
-
-
-
-
-
-
-img/s.gif" width="1" height="1" alt="" />
-
-
-
-
-
-
- :
-
-
-
-
-
-
-
- :
-
-
-
-
-
Index: branches/5.1.x/themes/default2009/platform/elements/footer.elm.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/elements/footer.elm.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/elements/footer.elm.tpl (revision 0)
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
Index: branches/5.1.x/themes/default2009/platform/elements/menu.elm.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/elements/menu.elm.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/elements/menu.elm.tpl (revision 0)
@@ -1,104 +0,0 @@
-
\ No newline at end of file
Index: branches/5.1.x/themes/default2009/platform/elements/navigation_bar.elm.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/elements/navigation_bar.elm.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/elements/navigation_bar.elm.tpl (revision 0)
@@ -1,38 +0,0 @@
-
-
-
- img/icon_home.gif" width="9" height="9" alt=""/> ">
-
-
-
-
- ">
-
-
-
-
-
- ">
-
- ">
-
-
-
-
-
- ">
-
-
-
-
-
-
-
-
\ No newline at end of file
Index: branches/5.1.x/themes/default2009/platform/elements/side_boxes/recommend_site.elm.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/elements/side_boxes/recommend_site.elm.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/elements/side_boxes/recommend_site.elm.tpl (revision 0)
@@ -1,16 +0,0 @@
-
-
-
-
-
- img/s.gif" alt="" width="1" height="5" border="0" />
-
-
\ No newline at end of file
Index: branches/5.1.x/themes/default2009/platform/elements/side_boxes/search.elm.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/elements/side_boxes/search.elm.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/elements/side_boxes/search.elm.tpl (revision 0)
@@ -1,51 +0,0 @@
-
-
-
-
-">
-
-
-
-
- !" />
-
-
-
\ No newline at end of file
Index: branches/5.1.x/themes/default2009/platform/elements/side_boxes/related_searches.elm.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/elements/side_boxes/related_searches.elm.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/elements/side_boxes/related_searches.elm.tpl (revision 0)
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
- ">
-
-
-
-
-
\ No newline at end of file
Index: branches/5.1.x/themes/default2009/platform/elements/content_boxes/nothing_found.elm.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/elements/content_boxes/nothing_found.elm.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/elements/content_boxes/nothing_found.elm.tpl (revision 0)
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
- img/warning_icon.gif" width="21" height="18" alt=""/>
-
-
-
-
-
-
-
-
-
- !
-
- !
-
-
-
-
\ No newline at end of file
Index: branches/5.1.x/themes/default2009/platform/elements/content_boxes/sub_categories.elm.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/elements/content_boxes/sub_categories.elm.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/elements/content_boxes/sub_categories.elm.tpl (revision 0)
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ( )
-
-
-
-
-
- : | :
-
-
- :
-
-
-
-
- img/s.gif" width="1" height="4" alt="" />
- img/grey_pix.gif" width="100%" height="1" alt="" />
-
-
-
-
-
-
-
-
\ No newline at end of file
Index: branches/5.1.x/themes/default2009/platform/elements/side_boxes/login.elm.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/elements/side_boxes/login.elm.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/elements/side_boxes/login.elm.tpl (revision 0)
@@ -1,125 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- ">
-
-
-
-
-
-
- img/not_logged.gif" alt="" width="11" height="11" border="0" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- img/menu-li-2-level.gif" alt="" width="4" height="4" border="0" />
-
-
- ">
-
-
-
-
-
- img/s.gif" alt="" width="1" height="7" border="0" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Index: branches/5.1.x/themes/default2009/platform/elements/content_boxes/related_items.elm.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/elements/content_boxes/related_items.elm.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/elements/content_boxes/related_items.elm.tpl (revision 0)
@@ -1,7 +0,0 @@
-
-
-
-
-
\ No newline at end of file
Index: branches/5.1.x/themes/default2009/platform/elements/side_boxes/mailing_list.elm.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/elements/side_boxes/mailing_list.elm.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/elements/side_boxes/mailing_list.elm.tpl (revision 0)
@@ -1,21 +0,0 @@
-
-
-
-
-
- img/s.gif" alt="" width="1" height="5" border="0" />
-
-
Index: branches/5.1.x/themes/default2009/platform/elements/content_boxes/no_favorites.elm.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/elements/content_boxes/no_favorites.elm.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/elements/content_boxes/no_favorites.elm.tpl (revision 0)
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
Index: branches/5.1.x/themes/default2009/platform/inc/captcha_image.elm.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/inc/captcha_image.elm.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/inc/captcha_image.elm.tpl (revision 0)
@@ -1 +0,0 @@
-
\ No newline at end of file
Index: branches/5.1.x/themes/default2009/platform/my_account/preferences_tab.elm.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/my_account/preferences_tab.elm.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/my_account/preferences_tab.elm.tpl (revision 0)
@@ -1 +0,0 @@
-
Index: branches/5.1.x/themes/default2009/platform/designs/popup_design.des.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/designs/popup_design.des.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/designs/popup_design.des.tpl (revision 0)
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- " />
-
-
-
-
-
- img/s.gif" width="1" height="1" alt="" />
-
-
-
-
-
\ No newline at end of file
Index: branches/5.1.x/themes/default2009/platform/designs/default_design.des.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/designs/default_design.des.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/designs/default_design.des.tpl (revision 0)
@@ -1,123 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- ::
-
-
-
-
-
-
-
-
-
-
-
-
-
-
img/s.gif" width="1" height="1" alt=""/>
-
img/grey_pix.gif" width="100%" height="1" alt=""/>
-
img/s.gif" width="1" height="1" alt=""/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- img/s.gif" width="3" height="1" alt=""/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- img/s.gif" width="3" height="1" alt=""/>
-
-
-
-
-
-
-
-
- REMOVE THIS LINE TO UNCOMMENT ##-->
-
-
-
-
-
-
-
-
-
\ No newline at end of file
Index: branches/5.1.x/themes/default2009/platform/designs/default_design_ajax.des.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/designs/default_design_ajax.des.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/designs/default_design_ajax.des.tpl (revision 0)
@@ -1,4 +0,0 @@
-
-
-
-
Index: branches/5.1.x/themes/default2009/platform/elements/users.elm.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/elements/users.elm.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/elements/users.elm.tpl (revision 0)
@@ -1,35 +0,0 @@
-
-
-
-
-
-
- img/s.gif" width="1" height="1" alt="" />
-
-
-
-
- ">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
Index: branches/5.1.x/themes/default2009/platform/elements/side_boxes.elm.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/elements/side_boxes.elm.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/elements/side_boxes.elm.tpl (revision 0)
@@ -1,14 +0,0 @@
-
-
-
\ No newline at end of file
Index: branches/5.1.x/themes/default2009/platform/elements/content_boxes.elm.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/elements/content_boxes.elm.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/elements/content_boxes.elm.tpl (revision 0)
@@ -1,175 +0,0 @@
-
-
-
-
-
- img/s.gif" width="1" height="20" alt=""/>
-
-
-
-
-
- img/s.gif" width="13" height="1" alt=""/>
-
-
-
-
-
- img/s.gif" width="13" height="1" alt=""/>
-
-
-
-
-
-
-
-
-
-
-
- img/s.gif" width="1" height="20" alt=""/>
-
-
-
-
-
- img/s.gif" width="13" height="1" alt=""/>
-
-
-
-
-
- img/s.gif" width="13" height="1" alt=""/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- img/menu_active_border.gif" width="1" height="37" alt=""/>
-
-
-
-
- img/menu_active_border.gif" width="1" height="37" alt=""/>
-
-
-
- img/s.gif" width="1" height="37" alt=""/>
-
-
-
-
- img/s.gif" width="1" height="37" alt=""/>
-
-
-
-
-
-
-
- img/menu-li-2-level.gif" alt="" width="4" height="4" border="0" />
-
-
-
- ">
-
- ">
-
-
-
-
-
-
-
-
- : [ ]
- :
-
-
-
-
-
-
- img/star_rate .gif" width="10" height="11" alt=""/>
-
-
-
-
-
-
-
-
-
-
- " title=" " alt=" " border="0" align=" " />
-
-
-
- active-tab inactive-tab">
- ">
-
-
-
-
-
-
-
-
-
- img/file_icons/ " alt=" " border="0" />
-
-
-
-
-
-
\ No newline at end of file
Index: branches/5.1.x/themes/default2009/platform/elements/preferences.elm.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/elements/preferences.elm.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/elements/preferences.elm.tpl (revision 0)
@@ -1,35 +0,0 @@
-
-
-
-
-
- " name=" " value=" "/>
- " onchange="update_checkbox(this, document.getElementById(' '));"/>
-
-
-
-
-
- img/s.gif" width="3" height="1" alt=""/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- img/s.gif" width="3" height="1" alt=""/>
-
-
-
-
-
\ No newline at end of file
Index: branches/5.1.x/themes/default2009/platform/elements/categories.elm.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/elements/categories.elm.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/elements/categories.elm.tpl (revision 0)
@@ -1,126 +0,0 @@
-
-
-
-
-
-
-
- img/directory_icon.gif" width="22" height="17" alt="" />
-
-
-
- ( : )
-
-
-
- " class="text-title"> @ ( / )
-
- " class="text-title"> ( / )
-
-
-
-
- img/icon_new.gif" alt=" "/>
- img/icon_pick.gif" alt=" "/>
-
-
- img/s.gif" width="1" height="4" alt="" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- " class="text-title"> @
-
- " class="text-title">
-
-
-
-
-
-
-
- ">
-
-
-
-
-
- ">
-
-
-
-
- " onclick="$ItemCategories.DeleteCategory( );"/>
-
-
-
-
-
-
-
-
- " class="sub-category"> ...
-
-
-
-
-
- " class="sub-category"> 1
-
-
-
-
-
- " class="sub-category">
-
-
-
-
-
-
-
-
-
- " class="sub-category">
-
-
-
-
-
-
-
-
-
- " class="sub-category"> (level 2)
-
-
-
-
-
-
-
-
-
Index: branches/5.1.x/themes/default2009/platform/elements/search_results.elm.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/elements/search_results.elm.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/elements/search_results.elm.tpl (revision 0)
@@ -1,20 +0,0 @@
-
- :
- img/s.gif" width="1" height="5" alt="">
- ">
-
- %" bgcolor=" "> img/s.gif" width="1" height="5" alt="">
- %" bgcolor=" "> img/s.gif" width="1" height="5" alt="">
-
-
-
-
-
- :
- img/s.gif" width="1" height="5" alt="">
-
-
- "> img/s.gif" width="1" height="5" alt="">
-
-
-
\ No newline at end of file
Index: branches/5.1.x/themes/default2009/platform/designs/general.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/designs/general.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/designs/general.tpl (revision 0)
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
Index: branches/5.1.x/themes/default2009/platform/designs/form.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/designs/form.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/designs/form.tpl (revision 0)
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- *
-
-
-
-
-
-
- img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />
-
-
">
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
Index: branches/5.1.x/themes/default2009/platform/img/menu_inedit.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/themes/default2009/platform/elements/dynamic_forms.elm.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/elements/dynamic_forms.elm.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/elements/dynamic_forms.elm.tpl (revision 0)
@@ -1,58 +0,0 @@
-
- " />
-
-
-
-
- " id="verify_ " value="" />
-
-
-
- " >
-
-
-
-
-
-
-
-
-
- ">
- " name="_cb_ " class=" " onclick="document.getElementById(' ').value = this.checked ? 1:0">
-
-
-
- >
-
-
-
- name=" " id=" _ " value=" "> _ ">
-
-
-
-
-
-
-
-
-
- * :
-
-
-
-
-
-
-
-
-
-
-
-
-
- img/s.gif" width="3" height="1" alt=""/>
-
-
-
-
\ No newline at end of file
Index: branches/5.1.x/themes/default2009/platform/img/page_icon.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/themes/default2009/platform/elements/menu_subsections.xml.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/elements/menu_subsections.xml.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/elements/menu_subsections.xml.tpl (revision 0)
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
-
- "
- orient="V" showicon="true" showsubicon="true" stlprf=""
- submenuic="[' img/arrow_white.gif']">
-
-
- " url=" " enb="true"
-
-
- subid="subpages "
- suburl=" "
-
-
- >]]>
-
-
-
-
-
-
\ No newline at end of file
Index: branches/5.1.x/themes/default2009/platform/elements/menu_sections.xml.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/elements/menu_sections.xml.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/elements/menu_sections.xml.tpl (revision 0)
@@ -1,19 +0,0 @@
-
-
- "
- url=" "
-
- ico="[' ']"
-
- ico="[' img/menu_inedit.gif']"
-
- enb="true" title=""
- subid="subpages "
- suburl=" " >]]>
-
-
\ No newline at end of file
Index: branches/5.1.x/themes/default2009/.smsignore
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/.smsignore (revision 12127)
+++ branches/5.1.x/themes/default2009/.smsignore (revision 0)
@@ -1 +0,0 @@
-phrases_edit\.tpl
\ No newline at end of file
Index: branches/5.1.x/themes/default2009/platform/designs/.smsignore
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/designs/.smsignore (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/designs/.smsignore (revision 0)
@@ -1 +0,0 @@
-.*\.tpl
\ No newline at end of file
Index: branches/5.1.x/themes/default2009/platform/elements/.smsignore
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/elements/.smsignore (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/elements/.smsignore (revision 0)
@@ -1 +0,0 @@
-.*\.xml\.tpl
\ No newline at end of file
Index: branches/5.1.x/themes/default2009/platform/img/language_icons/russian_off.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/themes/default2009/platform/img/language_icons/russian_on.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/themes/default2009/platform/img/language_icons/english_on.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/themes/default2009/platform/img/language_icons/english_off.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/themes/default2009/platform/sitemap.tpl
===================================================================
diff -u -N
--- branches/5.1.x/themes/default2009/platform/sitemap.tpl (revision 12127)
+++ branches/5.1.x/themes/default2009/platform/sitemap.tpl (revision 0)
@@ -1,57 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_infinity_f2.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/tab_left.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/install/install_schema.sql
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/install/install_schema.sql (.../install_schema.sql) (revision 12127)
+++ branches/5.1.x/core/install/install_schema.sql (.../install_schema.sql) (revision 12657)
@@ -48,7 +48,7 @@
heading varchar(255) default NULL,
prompt varchar(255) default NULL,
element_type varchar(20) NOT NULL default '',
- validation varchar(255) default NULL,
+ Validation text,
ValueList text,
DisplayOrder double NOT NULL default '0',
GroupDisplayOrder double NOT NULL default '0',
@@ -107,14 +107,16 @@
Event varchar(40) NOT NULL default '',
ReplacementTags text,
Enabled int(11) NOT NULL default '1',
- FromUserId int(11) NOT NULL default '-1',
+ FrontEndOnly tinyint(3) unsigned NOT NULL default '0',
+ FromUserId int(11) default NULL,
Module varchar(40) NOT NULL default '',
Description varchar(255) NOT NULL default '',
- Type int(11) NOT NULL default '0',
+ `Type` int(11) NOT NULL default '0',
PRIMARY KEY (EventId),
- KEY Type (Type),
+ KEY `Type` (`Type`),
KEY Enabled (Enabled),
- KEY Event (Event)
+ KEY Event (Event),
+ KEY FrontEndOnly (FrontEndOnly)
);
CREATE TABLE IdGenerator (
@@ -175,18 +177,20 @@
);
CREATE TABLE Phrase (
- Phrase varchar(255) NOT NULL default '',
+ Phrase varchar(255) NOT NULL DEFAULT '',
+ PhraseKey varchar(255) NOT NULL,
Translation text NOT NULL,
- PhraseType int(11) NOT NULL default '0',
- PhraseId int(11) NOT NULL auto_increment,
- LanguageId int(11) NOT NULL default '0',
- LastChanged int(10) unsigned NOT NULL default '0',
- LastChangeIP varchar(15) NOT NULL default '',
- Module varchar(30) NOT NULL default 'In-Portal',
- PRIMARY KEY (PhraseId),
+ PhraseType int(11) NOT NULL DEFAULT '0',
+ PhraseId int(11) NOT NULL AUTO_INCREMENT,
+ LanguageId int(11) NOT NULL DEFAULT '0',
+ LastChanged int(10) unsigned NOT NULL DEFAULT '0',
+ LastChangeIP varchar(15) NOT NULL DEFAULT '',
+ Module varchar(30) NOT NULL DEFAULT 'In-Portal',
+ PRIMARY KEY (PhraseId),
UNIQUE KEY LanguageId_2 (LanguageId,Phrase),
KEY LanguageId (LanguageId),
- KEY Phrase_Index (Phrase)
+ KEY Phrase_Index (Phrase),
+ KEY PhraseKey (PhraseKey)
);
CREATE TABLE PhraseCache (
@@ -318,21 +322,21 @@
);
CREATE TABLE UserSession (
- SessionKey int(10) unsigned NOT NULL default '0',
- CurrentTempKey int(10) unsigned default NULL,
- PrevTempKey int(10) unsigned default NULL,
- LastAccessed int(10) unsigned NOT NULL default '0',
- PortalUserId int(11) NOT NULL default '-2',
- `Language` int(11) NOT NULL default '1',
- Theme int(11) NOT NULL default '1',
- GroupId int(11) NOT NULL default '0',
- IpAddress varchar(20) NOT NULL default '0.0.0.0',
- `Status` int(11) NOT NULL default '1',
- GroupList varchar(255) default NULL,
- tz int(11) default NULL,
- PRIMARY KEY (SessionKey),
+ SessionKey int(10) unsigned NOT NULL DEFAULT '0',
+ LastAccessed int(10) unsigned NOT NULL DEFAULT '0',
+ PortalUserId int(11) NOT NULL DEFAULT '-2',
+ `Language` int(11) NOT NULL DEFAULT '1',
+ Theme int(11) NOT NULL DEFAULT '1',
+ GroupId int(11) NOT NULL DEFAULT '0',
+ IpAddress varchar(20) NOT NULL DEFAULT '0.0.0.0',
+ `Status` int(11) NOT NULL DEFAULT '1',
+ GroupList varchar(255) DEFAULT NULL,
+ tz int(11) DEFAULT NULL,
+ BrowserSignature varchar(32) NOT NULL,
+ PRIMARY KEY (SessionKey),
KEY UserId (PortalUserId),
- KEY LastAccessed (LastAccessed)
+ KEY LastAccessed (LastAccessed),
+ KEY BrowserSignature (BrowserSignature)
);
CREATE TABLE EmailLog (
@@ -412,7 +416,7 @@
Modified int(11) NOT NULL default '0',
ModifiedById int(11) NOT NULL default '0',
CachedTemplate varchar(255) NOT NULL,
- Template varchar(255) default NULL,
+ Template varchar(255) NOT NULL default '#inherit#',
UseExternalUrl tinyint(3) unsigned NOT NULL default '0',
ExternalUrl varchar(255) NOT NULL default '',
UseMenuIconUrl tinyint(3) unsigned NOT NULL default '0',
Index: branches/5.1.x/core/admin_templates/img/tab_active_back.jpg
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/catalog/catalog_counters.tpl
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/admin_templates/catalog/catalog_counters.tpl (.../catalog_counters.tpl) (revision 12127)
+++ branches/5.1.x/core/admin_templates/catalog/catalog_counters.tpl (.../catalog_counters.tpl) (revision 12657)
@@ -5,7 +5,7 @@
$Catalog.ParentCategoryID =
;
-
+
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_reset_to_pending_f2.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_reset_to_pending.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_affiliate_payment_type.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/itemicons/icon16_cat_deleted.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/icons/icon24_summary_logs.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/kernel/languages/phrases_cache.php
===================================================================
diff -u -N -r12453 -r12657
--- branches/5.1.x/core/kernel/languages/phrases_cache.php (.../phrases_cache.php) (revision 12453)
+++ branches/5.1.x/core/kernel/languages/phrases_cache.php (.../phrases_cache.php) (revision 12657)
@@ -1,6 +1,6 @@
Conn =& $this->Application->GetADODBConnection();
+
+ if (defined('DEBUG_MODE') && DEBUG_MODE && $this->Application->IsAdmin()) {
+ // only has effect in admin, because on front-end phrases are translated in "Content Mode"
+ $this->_editMissing = defined('DBG_PHRASES') && DBG_PHRASES;
+ }
+
+ // now we use admin phrase editing template even on front-end
+ $this->_phraseEditTemplate = 'regional/phrases_edit';
}
+ /**
+ * Sets phrase editing mode, that corresponds current editing mode
+ *
+ */
+ function setPhraseEditing()
+ {
+ if (!$this->Application->IsAdmin() && (EDITING_MODE == EDITING_MODE_CONTENT)) {
+ $this->_editExisting = true;
+ $this->_editMissing = true;
+ $this->_simpleEditingMode = true;
+ $this->_translateHtmlTag = 'span';
+ }
+ }
+
function Init($prefix, $special = '')
{
if (constOn('IS_INSTALL')) {
@@ -62,11 +128,13 @@
function GetCachedIds()
{
- $query = sprintf("SELECT PhraseList, ConfigVariables FROM %s WHERE Template = %s",
- TABLE_PREFIX.'PhraseCache',
- $this->Conn->Qstr(md5($this->Application->GetVar('t').$this->Application->GetVar('m_theme').$this->Application->GetVar('m_lang'))));
- $res = $this->Conn->GetRow($query);
+ $cache_key = md5($this->Application->GetVar('t') . $this->Application->GetVar('m_theme') . $this->Application->GetVar('m_lang'));
+ $sql = 'SELECT PhraseList, ConfigVariables
+ FROM ' . TABLE_PREFIX . 'PhraseCache
+ WHERE Template = ' . $this->Conn->qstr($cache_key);
+ $res = $this->Conn->GetRow($sql);
+
if ($res && $res['ConfigVariables']) {
$this->Application->OriginalConfigCacheIds = explode(',', $res['ConfigVariables']);
$this->Application->ConfigCacheIds = $this->Application->OriginalConfigCacheIds;
@@ -77,24 +145,30 @@
function LoadPhrases($ids)
{
- if ( !is_array($ids) || !implode('', $ids) ) return;
- $query = sprintf("SELECT Translation,UPPER(Phrase) AS Phrase FROM %s WHERE LanguageId = %s AND PhraseId IN (%s)",
- TABLE_PREFIX.'Phrase',
- $this->LanguageId,
- join(',', $ids));
- $this->Phrases = $this->Conn->GetCol($query,'Phrase');
+ if ( !is_array($ids) || !implode('', $ids) ) {
+ return;
+ }
+
+ $sql = 'SELECT Translation, UPPER(Phrase) AS Phrase
+ FROM ' . TABLE_PREFIX . 'Phrase
+ WHERE (LanguageId = ' . $this->LanguageId . ') AND PhraseId IN (' . implode(',', $ids) . ')';
+ $this->Phrases = $this->Conn->GetCol($sql, 'Phrase');
+
/*foreach($phrases as $phrase => $tanslation)
{
$this->AddCachedPhrase(mb_strtoupper($phrase), $tanslation);
}*/
+
$this->Ids = $ids;
$this->OriginalIds = $ids;
}
- function AddCachedPhrase($label, $value)
+ function AddCachedPhrase($label, $value, $allow_editing = true)
{
- $label = mb_strtoupper($label);
- $this->Phrases[$label] = $value;
+ // uppercase phrase name for cases, when this method is called outside this class
+ $cache_key = ($allow_editing ? '' : 'NE:') . mb_strtoupper($label);
+
+ $this->Phrases[$cache_key] = $value;
}
function NeedsCacheUpdate()
@@ -125,11 +199,13 @@
}
}
- function GetPhrase($label)
+ function GetPhrase($label, $allow_editing = true)
{
- if (!isset($this->LanguageId)) return 'impossible case';
- //actually possible when custom field contains references to language labels and its being rebuilt in OnAfterConfigRead
- //which is triggered by Sections rebuild, which in turn read all the configs and all of that happens BEFORE seeting the language...
+ if (!isset($this->LanguageId)) {
+ //actually possible when custom field contains references to language labels and its being rebuilt in OnAfterConfigRead
+ //which is triggered by Sections rebuild, which in turn read all the configs and all of that happens BEFORE seeting the language...
+ return 'impossible case';
+ }
// cut exclamation marks - depricated form of passing phrase name from templates
$label = preg_replace('/^!(.*)!$/', '\\1', $label);
@@ -140,81 +216,64 @@
$original_label = $label;
$label = mb_strtoupper($label);
- if(isset($this->Phrases[$label])) {
- $translated_label = $this->Phrases[$label];
- // debug mode is checked directly to improve performance
- if (defined('DEBUG_MODE') && DEBUG_MODE && constOn('DBG_PHRASES_HIGHLIGHT')) {
- if (!$this->Application->isDebugMode()) return $translated_label;
- if ($this->Application->IsAdmin()) {
- $sql = 'SELECT Module
- FROM '.TABLE_PREFIX.'Phrase
- WHERE (LanguageId = '.$this->LanguageId.') AND (Phrase = '.$this->Conn->qstr($label).')';
- $this->Application->Debugger->appendHTML('Phrase: '.$label.' ; Module: '.$this->Conn->GetOne($sql).' ');
-// $translated_label = $translated_label.' [m: '.$this->Conn->GetOne($sql).'; l: '.$label.']';
- }
- else {
- // highlight text created via translated phrase (used to detect if text on screen is phrase or not)
- $translated_label = ''.$translated_label.' '.$original_label.' ';
- }
+ $cache_key = ($allow_editing ? '' : 'NE:') . $label;
- }
+ if (array_key_exists($cache_key, $this->Phrases)) {
+ $translated_label = $this->Phrases[$cache_key];
- if (defined('DEBUG_MODE') && DEBUG_MODE &&
- (($this->Application->IsAdmin() && constOn('DBG_PHRASES_EDIT_ADMIN')) || (!$this->Application->IsAdmin() && constOn('DBG_PHRASES_EDIT_FRONT')) ) ) {
+ if ($this->_editExisting && $allow_editing && !array_key_exists($label, $this->_missingPhrases)) {
// option to change translation for Labels
- list($edit_tpl, $index_file) = $this->Application->IsAdmin() ? Array('regional/phrases_edit', 'index.php') : Array('phrases_edit', 'index.php');
+ $edit_url = 'javascript:translate_phrase(\'' . addslashes($original_label) . '\', \'' . $this->_phraseEditTemplate . '\', {event: \'OnPrepareUpdate\', simple_mode: ' . ($this->_simpleEditingMode ? 'true' : 'false') . '});';
+ $translated_label = '<' . $this->_translateHtmlTag . ' href="' . $edit_url . '" name="cms-translate-phrase" title="Edit translation">' . $translated_label . '' . $this->_translateHtmlTag . '>';
- if ($this->Application->IsAdmin() && $this->Application->ConfigValue('UsePopups')) {
- // link to popup when using popups (only in admin)
- $edit_url = 'javascript:translate_phrase(\''.addslashes($translated_label).'\', \''.$edit_tpl.'\');';
+ if ($this->fromTag) {
+ $translated_label = $this->escapeTagReserved($translated_label);
}
- else {
- // direct link, when not using popups OR on frontend
- $edit_url = $this->Application->HREF($edit_tpl,'',Array('m_opener'=>'d','phrases_label'=>$original_label,'phrases_event'=>'OnPrepareUpdate', 'pass'=>'all,phrases'), $index_file );
- }
- $translated_label = '!'.$translated_label.'! ';
}
return $translated_label;
}
- $this->LoadPhraseByLabel($label, $original_label);
- return $this->GetPhrase($label);
+ $this->LoadPhraseByLabel($label, $original_label, $allow_editing);
+
+ return $this->GetPhrase($label, $allow_editing);
}
- function LoadPhraseByLabel($label, $original_label)
+ function LoadPhraseByLabel($label, $original_label, $allow_editing = true)
{
- $query = sprintf("SELECT PhraseId, Translation FROM %s WHERE LanguageId = %s AND UPPER(Phrase) = UPPER(%s)",
- TABLE_PREFIX.'Phrase',
- $this->LanguageId,
- $this->Conn->qstr($label));
- $res = $this->Conn->GetRow($query);
- if ($res === false || count($res) == 0)
- {
- $translation = '!'.$label.'!';
- if($this->Application->isDebugMode() && constOn('DBG_PHRASES')) {
- list($edit_tpl, $index_file) = $this->Application->IsAdmin() ? Array('regional/phrases_edit', 'index.php') : Array('phrases_edit', 'index.php');
+ // bug: MySQL don't use index on Phrase column, when function is used on it's value (e.g. UPPER, like in this case)
+ $sql = 'SELECT PhraseId, Translation
+ FROM ' . TABLE_PREFIX . 'Phrase
+ WHERE (LanguageId = ' . $this->LanguageId . ') AND (PhraseKey = ' . $this->Conn->qstr($label) . ')';
+ $res = $this->Conn->GetRow($sql);
- if ($this->Application->IsAdmin() && $this->Application->ConfigValue('UsePopups')) {
- // link to popup when using popups (only in admin)
- $edit_url = 'javascript:translate_phrase(\''.addslashes($original_label).'\', \''.$edit_tpl.'\');';
+ if ($res === false || count($res) == 0) {
+ $translation = '!' . $label . '!';
+
+ if ($this->_editMissing && $allow_editing) {
+ $edit_url = 'javascript:translate_phrase(\'' . addslashes($original_label) . '\', \'' . $this->_phraseEditTemplate . '\', {event: \'OnNew\', simple_mode: ' . ($this->_simpleEditingMode ? 'true' : 'false') . '});';
+ $translation = '<' . $this->_translateHtmlTag . ' href="' . $edit_url . '" name="cms-translate-phrase" title="Translate">!' . $label . '!' . $this->_translateHtmlTag . '>';
+
+ if ($this->fromTag) {
+ $translation = $this->escapeTagReserved($translation);
}
- else {
- // direct link, when not using popups OR on frontend
- $edit_url = $this->Application->HREF($edit_tpl,'',Array('m_opener'=>'d','phrases_label'=>$original_label,'phrases_event'=>'OnNew', 'pass'=>'all,phrases'), $index_file );
- }
- $translation = '!'.$label.'! ';
- if($this->fromTag) $translation = $this->escapeTagReserved($translation);
+ $this->_missingPhrases[$label] = true; // add as key for faster accessing
}
- $this->AddCachedPhrase($label, $translation); //add it as already cached, as long as we dont need to cache not found phrase
+
+ // add it as already cached, as long as we dont need to cache not found phrase
+ $this->AddCachedPhrase($label, $translation, $allow_editing);
+
return false;
}
- $this->Phrases[$label] = $res['Translation'];
+ $cache_key = ($allow_editing ? '' : 'NE:') . $label;
+ $this->Phrases[$cache_key] = $res['Translation'];
+
array_push($this->Ids, $res['PhraseId']);
- $this->Ids = array_unique($this->Ids); //just to make sure
+ $this->Ids = array_unique($this->Ids); // just to make sure
+
return true;
}
@@ -242,23 +301,29 @@
* @return string
* @access public
*/
- function ReplaceLanguageTags($text,$forse_escaping=null)
+ function ReplaceLanguageTags($text, $forse_escaping = null)
{
$this->fromTag = true;
- if( isset($forse_escaping) ) $this->fromTag = $forse_escaping;
+ if( isset($forse_escaping) ) {
+ $this->fromTag = $forse_escaping;
+ }
+
preg_match_all("(!(la|lu)[^!]+!)", $text, $res, PREG_PATTERN_ORDER);
$language_tags = $res[0];
- uasort($language_tags, Array(&$this, 'CmpParams') );
+ uasort($language_tags, Array(&$this, 'CmpParams'));
- $values = Array();
$i = 0;
+ $values = Array();
+
foreach ($language_tags as $label) {
array_push($values, $this->GetPhrase($label) );
//array_push($values, $this->Application->Phrase($label) );
$language_tags[$i] = '/' . $language_tags[$i] . '/';
$i++;
}
+
$this->fromTag = false;
+
return preg_replace($language_tags, $values, $text);
}
@@ -276,7 +341,4 @@
return str_replace($reserved,$replacement,$text);
}
-}
-
-
-?>
\ No newline at end of file
+}
\ No newline at end of file
Index: branches/5.1.x/core/units/general/libchart/classes/model/XYDataSet.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/units/general/libchart/classes/model/XYDataSet.php (.../XYDataSet.php) (revision 12127)
+++ branches/5.1.x/core/units/general/libchart/classes/model/XYDataSet.php (.../XYDataSet.php) (revision 12657)
@@ -17,6 +17,8 @@
*
*/
+ defined('FULL_PATH') or die('restricted access!');
+
/**
* Set of data in the form of (x, y) items.
*
@@ -52,5 +54,4 @@
public function getPointList() {
return $this->pointList;
}
- }
-?>
\ No newline at end of file
+ }
\ No newline at end of file
Index: branches/5.1.x/core/admin_templates/img/icons/icon24_server_info.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/icons/icon24_banlist.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/units/logs/change_logs/changes_formatter.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/units/logs/change_logs/changes_formatter.php (.../changes_formatter.php) (revision 12127)
+++ branches/5.1.x/core/units/logs/change_logs/changes_formatter.php (.../changes_formatter.php) (revision 12657)
@@ -1,6 +1,6 @@
$data) {
- $fld_translation = $this->Application->Phrase('la_fld_'.$field);
+ $res = '';
+ if (!$changes) {
+ return ;
+ }
- // remove translation link (added in debug mode)
- $fld_translation = preg_replace('/(.*?)<\/a>/', '\\2', $fld_translation);
+ foreach ($changes as $field => $data) {
+ $fld_translation = $this->Application->Phrase('la_fld_'.$field);
- if ($fld_translation == '!'.strtoupper('la_fld_'.$field).'!') {
- // when phrase is not translated use field name as label
- $fld_translation = $field;
- }
+ // remove translation link (added in debug mode)
+ $fld_translation = preg_replace('/ (.*?)<\/a>/', '\\2', $fld_translation);
- if (is_array($data) && isset($data['old']) && isset($data['new'])) {
- $res .= "$fld_translation: {$data['old']} => {$data['new']} \n";
+ if ($fld_translation == '!'.strtoupper('la_fld_'.$field).'!') {
+ // when phrase is not translated use field name as label
+ $fld_translation = $field;
+ }
+
+ if (is_array($data) && isset($data['old']) && isset($data['new'])) {
+ $res .= "$fld_translation: {$data['old']} => {$data['new']} \n";
+ }
+ else {
+ $res .= "$fld_translation: {$data['new']} \n";
+ }
}
- else {
- $res .= "$fld_translation: {$data['new']} \n";
- }
+ return $res;
}
- return $res;
- }
-}
\ No newline at end of file
+ }
\ No newline at end of file
Index: branches/5.1.x/core/admin_templates/img/icons/icon46_list_search_log.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_style.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/itemicons/icon16_cat_pick.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/config/config_email.tpl
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/admin_templates/config/config_email.tpl (.../config_email.tpl) (revision 12127)
+++ branches/5.1.x/core/admin_templates/config/config_email.tpl (.../config_email.tpl) (revision 12657)
@@ -7,43 +7,77 @@
+
+
+ Root
+
+
+
+
+
-
+
\ No newline at end of file
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_manufacturer_f2.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/itemicons/icon16_language_disabled.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/units/modules/modules_event_handler.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/units/modules/modules_event_handler.php (.../modules_event_handler.php) (revision 12127)
+++ branches/5.1.x/core/units/modules/modules_event_handler.php (.../modules_event_handler.php) (revision 12657)
@@ -1,6 +1,6 @@
SetDBField($status_field, $event->Name == 'OnMassApprove' ? 1 : 0);
if ($object->Update()) {
- $event->status = erSUCCESS;
+ $sql = 'UPDATE ' . TABLE_PREFIX . 'ImportScripts
+ SET Status = ' . ($event->Name == 'OnMassApprove' ? STATUS_ACTIVE : STATUS_DISABLED) . '
+ WHERE Module = "' . $object->GetDBField('Name') . '"';
+ $this->Conn->Query($sql);
+
+ $event->status = erSUCCESS;
$event->redirect_params = Array('opener' => 's'); //stay!
}
else {
@@ -109,7 +116,7 @@
parent::OnAfterListQuery($event);
$new_modules = $this->_getNewModules();
- if (!$new_modules) {
+ if (!$new_modules || $this->Application->RecallVar('user_id') != -1) {
return ;
}
@@ -123,8 +130,10 @@
foreach ($new_modules as $module) {
$module_record = Array (
'Name' => $toolkit->getModuleName($module),
- 'Loaded' => 0,
+ 'Path' => $module . '/',
'Version' => $toolkit->GetMaxModuleVersion($module),
+ 'Loaded' => 0,
+ 'BuildDate' => null,
);
$object->addRecord($module_record);
@@ -174,6 +183,4 @@
{
return file_exists($folder . '/install.php') && file_exists($folder . '/install/install_schema.sql');
}
- }
-
-?>
\ No newline at end of file
+ }
\ No newline at end of file
Index: branches/5.1.x/core/admin_templates/themes/themes_list.tpl
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/admin_templates/themes/themes_list.tpl (.../themes_list.tpl) (revision 12127)
+++ branches/5.1.x/core/admin_templates/themes/themes_list.tpl (.../themes_list.tpl) (revision 12657)
@@ -14,7 +14,7 @@
}
var a_toolbar = new ToolBar();
- a_toolbar.AddButton( new ToolBarButton('new_theme', ' :: ',
+ a_toolbar.AddButton( new ToolBarButton('new_item', ' :: ',
function() {
std_precreate_item('theme', 'themes/themes_edit')
} ) );
@@ -28,12 +28,12 @@
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
- a_toolbar.AddButton( new ToolBarButton('primary_theme', ' :: ', function() {
+ a_toolbar.AddButton( new ToolBarButton('setprimary', ' ', function() {
submit_event('theme','OnSetPrimary');
}
) );
- a_toolbar.AddButton( new ToolBarButton('rescan_themes', ' :: ', function() {
+ a_toolbar.AddButton( new ToolBarButton('refresh', ' :: ', function() {
submit_event('adm', 'OnRebuildThemes');
}
) );
@@ -56,7 +56,7 @@
\ No newline at end of file
Index: branches/5.1.x/core/units/relationship/relationship_tp.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/units/relationship/relationship_tp.php (.../relationship_tp.php) (revision 12127)
+++ branches/5.1.x/core/units/relationship/relationship_tp.php (.../relationship_tp.php) (revision 12657)
@@ -1,6 +1,6 @@
_language =& $this->Application->recallObject('lang.current');
- /* @var $lang kDBItem */
-
- $this->_decimalSeparator = $this->_language->GetDBField('DecimalPoint');
- $this->_thousandsSeparator = $this->_language->GetDBField('ThousandSep');
- }
-
- function InitHelper($min_field, $max_field, $default_values, $default_start_value = null)
- {
- $this->min_field = $min_field;
- $this->max_field = $max_field;
- $this->default_values = $default_values;
-
- if (isset($default_start_value)) {
- $this->defaultStartValue = $default_start_value;
- }
- }
-
- /**
- * Converts number to operatable form
- *
- * @param string $value
- * @return float
- */
- function _parseNumber($value)
- {
- $value = str_replace($this->_thousandsSeparator, '', $value);
- $value = str_replace($this->_decimalSeparator, '.', $value);
-
- return $value;
- }
-
- /**
- * Returns brackets from form with all numbers parsed
- *
- * @param kEvent $event
- * @return Array
- */
- function getBrackets(&$event)
- {
- $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
-
- return $this->parseBrackets($items_info);
- }
-
- function parseBrackets($brackets)
- {
- if (!$brackets) {
- return $brackets;
- }
-
- foreach ($brackets as $id => $field_values) {
- if (strlen($brackets[$id][$this->min_field])) {
- $brackets[$id][$this->min_field] = (float)$this->_parseNumber($brackets[$id][$this->min_field]);
- }
-
- if (strlen($brackets[$id][$this->max_field])) {
- $brackets[$id][$this->max_field] = (float)$this->_parseNumber($brackets[$id][$this->max_field]);
- }
- }
-
- return $brackets;
- }
-
- /**
- * Formats given brackets and sets them back to request
- *
- * @param kEvent $event
- * @param Array $brackets
- */
- function setBrackets(&$event, $brackets)
- {
- $brackets = $this->formatBrackets($brackets);
-
- $this->Application->SetVar($event->getPrefixSpecial(true), $brackets);
- }
-
- function formatBrackets($brackets)
- {
- if (!$brackets) {
- return $brackets;
- }
-
- foreach ($brackets as $id => $field_values) {
- if (strlen($brackets[$id][$this->min_field])) {
- $brackets[$id][$this->min_field] = $this->_language->formatNumber($brackets[$id][$this->min_field]);
- }
-
- if (strlen($brackets[$id][$this->max_field])) {
- $brackets[$id][$this->max_field] = $this->_language->formatNumber($brackets[$id][$this->max_field]);
- }
- }
-
- return $brackets;
- }
-
- /**
- * Adds 5 more empty brackets to brackets
- *
- * @param kEvent $event
- */
- function OnMoreBrackets(&$event)
- {
- $field_values = $this->getBrackets($event);
-
- $object =& $event->getObject();
-
- foreach($field_values as $id => $record)
- {
- if($record[$this->max_field] == '∞') $field_values[$id][$this->max_field] = -1;
- }
-
- $new_id = (int)$this->Conn->GetOne('SELECT MIN('.$object->IDField.') FROM '.$object->TableName);
- if($new_id > 0) $new_id = 0;
- do
- {
- $new_id--;
- }while( $this->arraySearch($field_values, $object->IDField, $new_id) );
-
-
- $last_max_qty = $this->Conn->GetOne('SELECT MAX('.$this->max_field.') FROM '.$object->TableName);
- $min_qty = $this->Conn->GetOne('SELECT MIN('.$this->max_field.') FROM '.$object->TableName);
-
- if($min_qty == -1) $last_max_qty = -1;
- if(!$last_max_qty) $last_max_qty = $this->defaultStartValue;
-
-
- for($i = $new_id; $i > $new_id - 5; $i--)
- {
- $field_values[$i][$object->IDField] = $i;
- $field_values[$i][$this->min_field] = ($i == $new_id-4 && $last_max_qty != -1) ? $last_max_qty : '';
- $field_values[$i][$this->max_field] = ($i == $new_id-4 && $last_max_qty != -1) ? -1 : '';
- $field_values[$i] = array_merge_recursive2($field_values[$i], $this->default_values);
- }
-
- $event->CallSubEvent('OnPreSaveBrackets');
-
- $this->setBrackets($event, $field_values);
- }
-
- /**
- * Adds infinity bracket
- *
- * @param kEvent $event
- */
- function OnInfinity(&$event)
- {
- $object =& $event->getObject();
- $infinite_exists = $this->Conn->GetOne('SELECT COUNT(*) FROM '.$object->TableName.' WHERE '.$this->max_field.' = -1');
- $field_values = $this->getBrackets($event);
- /*if(is_array($field_values))
- {
- foreach($field_values as $values)
- {
- $infinite_exists = $infinite_exists || ($values[$this->max_field] == -1);
- }
- }*/
-
- if ($infinite_exists == 0) {
- reset($field_values);
- $last_bracket = end($field_values);
- $new_id = (int)$this->Conn->GetOne('SELECT MIN('.$object->IDField.') FROM '.$object->TableName);
-
- $brackets_exist = (int)$this->Conn->GetOne('SELECT COUNT(*) FROM '.$object->TableName);
-
- if($new_id > 0) $new_id = 0;
- do
- {
- $new_id--;
- }while( $this->arraySearch($field_values, $object->IDField, $new_id) );
-
- $infinite_bracket[$object->IDField] = $new_id;
- $infinite_bracket[$this->min_field] = ($brackets_exist > 0) ? $last_bracket[$this->max_field] : $this->defaultStartValue;
- $infinite_bracket[$this->max_field] = '-1';
- $infinite_bracket = array_merge_recursive2($infinite_bracket, $this->default_values);
-
- $field_values[$new_id] = $infinite_bracket;
- reset($field_values);
-
- $this->setBrackets($event, $field_values);
- }
- }
-
- /**
- * Saves brackets to database
- *
- * @param kEvent $event
- */
- function OnPreSaveBrackets(&$event)
- {
- $items_info = $this->getBrackets($event);
- if ($items_info) {
- $object =& $event->getObject();
-
- $linked_info = $object->getLinkedInfo();
- $stored_ids = $this->Conn->GetCol('SELECT '.$object->IDField.' FROM '.$object->TableName.' WHERE '.$linked_info['ForeignKey'].' = '.$linked_info['ParentId']);
-
- uasort($items_info, Array(&$this, 'compareBrackets') );
-
- foreach ($items_info as $item_id => $values) {
-
- if (in_array($item_id, $stored_ids)) { //if it's already exist
- $object->SetDefaultValues();
- $object->Load($item_id);
- $object->SetFieldsFromHash($values);
- if (!$object->Validate()) {
- unset($stored_ids[array_search($item_id, $stored_ids)]);
- $event->redirect = false;
- continue;
- }
- if( $object->Update($item_id) )
- {
- $event->status = erSUCCESS;
- }
- else
- {
- $event->status = erFAIL;
- $event->redirect = false;
- break;
- }
- unset( $stored_ids[ array_search($item_id, $stored_ids) ] );
- }
- else {
- $object->SetDefaultValues();
- $object->SetFieldsFromHash($values);
- $object->SetDBField($linked_info['ForeignKey'], $linked_info['ParentId']);
-
- if( $object->Create() )
- {
- $object->setTempID();
- $event->status = erSUCCESS;
- }
- }
- }
-
- // delete
- foreach ($stored_ids as $stored_id)
- {
- $this->Conn->Query('DELETE FROM '.$object->TableName.' WHERE '.$object->IDField.' = '.$stored_id);
- }
-
- }
- }
-
- function arrangeBrackets(&$event)
- {
- $object =& $event->getObject();
-
- $temp = $this->getBrackets($event);
-
- foreach($temp as $id => $record)
- {
- if( $record[$this->max_field] == '∞' )
- {
- $temp[$id][$this->max_field] = -1;
- }
- }
-
- $temp_orig = $temp;
- reset($temp);
- if( is_array($temp) )
- {
- // array to store max values (2nd column)
- $end_values = Array();
-
- // get minimal value of Min
- $first_elem = current($temp);
- $start = $first_elem[$this->min_field];
- if (!strlen($start)) {
- $start = $this->defaultStartValue;
- }
-
- foreach($temp as $id => $record)
- {
- if(
- // MAX is less than start
- ($record[$this->max_field] <= $start && $record[$this->max_field] != -1) ||
- // Max is empty
- !strlen($record[$this->max_field]) ||
- // Max already defined in $end_values
- (array_search($record[$this->max_field], $end_values) !== false)
- ) { // then delete from brackets list
- unset($temp[$id]);
- }
- else { // this is when ok - add to end_values list
- $end_values[] = $record[$this->max_field];
- }
- }
-
- // sort brackets by 2nd column (Max values)
- uasort($temp, Array(&$this, 'compareBrackets') );
- reset($temp);
- $first_item = each($temp);
- $first_item_key = $first_item['key'];
-
- $linked_info = $object->getLinkedInfo();
- $sql = 'SELECT %s FROM %s WHERE %s = %s';
- $ids = $this->Conn->GetCol( sprintf($sql, $object->IDField, $object->TableName, $linked_info['ForeignKey'], $linked_info['ParentId']) );
- if( is_array($ids) )
- {
- usort($ids, Array(&$this, 'sortBracketIDs') );
- }
-
-// $min_id = min( min($ids) - 1, -1 );
-
- foreach($temp as $key => $record)
- {
- $temp[$key][$this->min_field] = $start;
- $start = $temp[$key][$this->max_field];
- }
- }
-
- $this->setBrackets($event, $temp);
-
- return $temp;
- }
-
- function compareBrackets($bracket1, $bracket2) // ap_bracket_comp
- {
- $bracket1_min = $bracket1[$this->min_field];
- $bracket1_max = $bracket1[$this->max_field];
-
- $bracket2_min = $bracket2[$this->min_field];
- $bracket2_max = $bracket2[$this->max_field];
-
- // limits
- if( ($bracket1_min != '') && ($bracket1_max == '') && ($bracket2_min != '') && ($bracket2_max != '') ) return 1;
- if( ($bracket1_min != '') && ($bracket1_max == '') && ($bracket2_min == '') && ($bracket2_max == '') ) return -1;
- if( ($bracket1_max == '') && ($bracket2_max != '') ) return 1;
- if( ($bracket1_max != '') && ($bracket2_max == '') ) return -1;
-
-
- if( ( ($bracket1_max > $bracket2_max) && ($bracket2_max != -1) ) || ( ($bracket1_max == -1) && ($bracket2_max != -1) ) )
- {
- return 1;
- }
- elseif( ($bracket1_max < $bracket2_max) || ( ($bracket2_max == -1) && ($bracket1_max != -1) ) )
- {
- return -1;
- }
- else
- {
- return 0;
- }
- }
-
- function sortBracketIDs($first_id, $second_id) // pr_bracket_id_sort
- {
- $first_abs = abs($first_id);
- $second_abs = abs($second_id);
-
- $first_sign = ($first_id == 0) ? 0 : $first_id / $first_abs;
- $second_sign = ($second_id == 0) ? 0 : $second_id / $second_abs;
-
- if($first_sign != $second_sign)
- {
- if($first_id > $second_id)
- {
- $bigger =& $first_abs;
- $smaller =& $second_abs;
- }
- else
- {
- $bigger =& $second_abs;
- $smaller =& $first_abs;
- }
- $smaller = $bigger + $smaller;
- }
-
- return ($first_abs > $second_abs) ? 1 : ($first_abs < $second_abs ? -1 : 0);
- }
-
- /**
- * Searches through submitted grid data to find record with specific value in specific field
- *
- * @param Array $records // grid data from REQUEST
- * @param string $field
- * @param string $value
- * @return bool
- */
- function arraySearch($records, $field, $value) // check_array
- {
- foreach ($records as $record)
- {
- if ($record[$field] == $value)
- {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Replate infinity mark with -1 before saving to db
- *
- * @param kEvent $event
- */
- function replaceInfinity(&$event)
- {
- $object =& $event->getObject();
- if($object->GetDBField($this->max_field) == '∞') $object->SetDBField($this->max_field, -1);
- }
-
- }
-
-?>
\ No newline at end of file
Index: branches/5.1.x/core/admin_templates/img/icons/icon24_site.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_form_submission_f2.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/units/fck/fck_eh.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/units/fck/fck_eh.php (.../fck_eh.php) (revision 12127)
+++ branches/5.1.x/core/units/fck/fck_eh.php (.../fck_eh.php) (revision 12657)
@@ -1,6 +1,6 @@
array('self' => true),
- 'OnLoadResources' => array('self' => true),
- 'OnRenameFile' => array('self' => true),
- 'OnDeleteFiles' => array('self' => true),
- 'OnGetFoldersFilesList' => array('self' => true),
- 'OnCreateFolder' => array('self' => true),
- 'OnUploadFile' => array('self' => true),
- );
-
- $this->permMapping = array_merge($this->permMapping, $permissions);
- }
-
/**
* Checks permissions of user
*
@@ -40,6 +24,7 @@
function CheckPermission(&$event)
{
if ($this->Application->LoggedIn() && $this->Application->IsAdmin()) {
+ // this limits all event execution only to logged-in users in admin
return true;
}
@@ -98,106 +83,106 @@
}
- function OnRenameFile(&$event)
- {
- $event->status = erSTOP;
- $old_name = $this->Application->GetVar('old_name');
- $new_name = $this->Application->GetVar('new_name');
- $folder = $this->Application->GetVar('folder');
- $sServerDir = WRITEABLE.'/user_files/'.$folder.'/';
+ function OnRenameFile(&$event)
+ {
+ $event->status = erSTOP;
+ $old_name = $this->Application->GetVar('old_name');
+ $new_name = $this->Application->GetVar('new_name');
+ $folder = $this->Application->GetVar('folder');
+ $sServerDir = WRITEABLE . '/user_files/' . $folder . '/';
- if (!file_exists($sServerDir.$old_name) || !is_file($sServerDir.$old_name)) {
- echo 204;
- return;
- }
+ if (!file_exists($sServerDir.$old_name) || !is_file($sServerDir.$old_name)) {
+ echo 204;
+ return;
+ }
- $fck_helper =& $this->Application->recallObject('FCKHelper');
- /* @var fck_helper fckFCKHelper*/
+ $fck_helper =& $this->Application->recallObject('FCKHelper');
+ /* @var fck_helper fckFCKHelper*/
- if (!$fck_helper->IsAllowedExtension($folder, $new_name)) {
- echo 203;
- return;
- }
+ if (!$fck_helper->IsAllowedExtension($folder, $new_name)) {
+ echo 203;
+ return;
+ }
- if (!rename($sServerDir.$old_name,$sServerDir.$new_name)) {
-// echo $sServerDir.$old_name.' -> '.$sServerDir.$new_name;
- echo 205;
- return;
+ if (!rename($sServerDir.$old_name,$sServerDir.$new_name)) {
+ // echo $sServerDir.$old_name.' -> '.$sServerDir.$new_name;
+ echo 205;
+ return;
+ }
+
+ echo '0';
}
- echo '0';
- }
+ function OnDeleteFiles(&$event)
+ {
+ $event->status = erSTOP;
+ $files = trim($this->Application->GetVar('files'),'|');
+ // echo $files;
+ $a_files = explode('|', $files);
+ $folder = $this->Application->GetVar('folder');
+ $sServerDir = WRITEABLE . '/user_files/' . $folder . '/';
- function OnDeleteFiles(&$event)
- {
- $event->status = erSTOP;
- $files = trim($this->Application->GetVar('files'),'|');
-// echo $files;
- $a_files = explode('|', $files);
- $folder = $this->Application->GetVar('folder');
- $sServerDir = WRITEABLE.'/user_files/'.$folder.'/';
+ foreach ($a_files AS $file) {
+ @unlink($sServerDir.$file);
+ }
- foreach ($a_files AS $file) {
- @unlink($sServerDir.$file);
+ // print_r($a_files);
}
-// print_r($a_files);
- }
+ function OnGetFoldersFilesList(&$event)
+ {
+ $this->CreateXmlHeader();
+ $fck_helper =& $this->Application->recallObject('FCKHelper');
+ /* @var fck_helper fckFCKHelper*/
- function OnGetFoldersFilesList(&$event)
- {
- $this->CreateXmlHeader();
- $fck_helper =& $this->Application->recallObject('FCKHelper');
- /* @var fck_helper fckFCKHelper*/
+ $ret = ''."\n" ;
+ $ret .= ""."\n";
+ $ret .= $fck_helper->PrintFolders();
+ $ret .= $fck_helper->PrintFiles();
+ $ret .= " "."\n";
+ echo $ret;
+ exit;
+ }
- $ret = ''."\n" ;
- $ret .= ""."\n";
- $ret .= $fck_helper->PrintFolders();
- $ret .= $fck_helper->PrintFiles();
- $ret .= " "."\n";
- echo $ret;
- exit;
- }
+ function OnCreateFolder(&$event)
+ {
+ $event->status = erSTOP;
- function OnCreateFolder(&$event)
- {
- $event->status = erSTOP;
+ $new_folder = $this->Application->GetVar('new_folder');
+ $current_folder = $this->Application->GetVar('current_folder');
+ $folderPath = WRITEABLE . '/user_files' . '/' . $current_folder . "/" . $new_folder;
+ if ( file_exists( $folderPath ) && is_dir($folderPath)) {
+ echo "101";
+ }
- $new_folder = $this->Application->GetVar('new_folder');
- $current_folder = $this->Application->GetVar('current_folder');
- $folderPath = WRITEABLE.'/user_files'.'/'.$current_folder."/".$new_folder;
- if ( file_exists( $folderPath ) && is_dir($folderPath)) {
- echo "101";
+ if ( !file_exists( $folderPath ) )
+ {
+ // Turn off all error reporting.
+ error_reporting( 0 ) ;
+ // Enable error tracking to catch the error.
+ ini_set( 'track_errors', '1' ) ;
+ // To create the folder with 0777 permissions, we need to set umask to zero.
+ $oldumask = umask(0) ;
+ mkdir( $folderPath, 0777 ) ;
+ umask( $oldumask ) ;
+ $sErrorMsg = $php_errormsg ;
+ // Restore the configurations.
+ ini_restore( 'track_errors' ) ;
+ ini_restore( 'error_reporting' ) ;
+ if ($sErrorMsg)
+ echo $sErrorMsg ;
+ else
+ echo '0';
+ }
}
- if ( !file_exists( $folderPath ) )
+ function OnUploadFile(&$event)
{
- // Turn off all error reporting.
- error_reporting( 0 ) ;
- // Enable error tracking to catch the error.
- ini_set( 'track_errors', '1' ) ;
- // To create the folder with 0777 permissions, we need to set umask to zero.
- $oldumask = umask(0) ;
- mkdir( $folderPath, 0777 ) ;
- umask( $oldumask ) ;
- $sErrorMsg = $php_errormsg ;
- // Restore the configurations.
- ini_restore( 'track_errors' ) ;
- ini_restore( 'error_reporting' ) ;
- if ($sErrorMsg)
- echo $sErrorMsg ;
- else
- echo '0';
+ $event->status = erSTOP;
+ $fck_helper =& $this->Application->recallObject('FCKHelper');
+ /* @var fck_helper fckFCKHelper*/
+ $fck_helper->UploadFile();
}
- }
-
- function OnUploadFile(&$event)
- {
- $event->status = erSTOP;
- $fck_helper =& $this->Application->recallObject('FCKHelper');
- /* @var fck_helper fckFCKHelper*/
- $fck_helper->UploadFile();
- }
-}
+ }
\ No newline at end of file
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_theme.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_primary_group_f2.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/tab_back3.jpg
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_more_brackets.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/units/admin/admin_tag_processor.php
===================================================================
diff -u -N -r12453 -r12657
--- branches/5.1.x/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 12453)
+++ branches/5.1.x/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 12657)
@@ -1,6 +1,6 @@
Application->ConfigValue('UsePopups') || $this->Application->GetVar('_force_popup');
+ if ($this->Application->GetVar('_force_popup')) {
+ return true;
+ }
+
+ $use_popups = (int)$this->Application->ConfigValue('UsePopups');
+
+ if (array_key_exists('mode', $params)) {
+ $mode_mapping = Array ('popup' => 1, 'modal' => 2);
+ return $use_popups == $mode_mapping[ $params['mode'] ];
+ }
+
+ return $use_popups;
}
function UseToolbarLabels($params)
@@ -805,68 +824,10 @@
function AdminSkin($params)
{
- static $style;
- if (!isset($style)) {
- $style = $this->Conn->GetRow('SELECT * FROM '.TABLE_PREFIX.'Skins WHERE IsPrimary = 1');
- }
+ $skin_helper =& $this->Application->recallObject('SkinHelper');
+ /* @var $skin_helper SkinHelper */
- $css_path = (defined('WRITEABLE') ? WRITEABLE : FULL_PATH. DIRECTORY_SEPARATOR . 'kernel') . DIRECTORY_SEPARATOR . 'user_files';
- $css_url = $this->Application->BaseURL(defined('WRITEBALE_BASE') ? str_replace(DIRECTORY_SEPARATOR, '/', WRITEBALE_BASE) : '/kernel') . 'user_files/';
-
- $type = array_key_exists('type', $params) ? $params['type'] : false;
- if ($type == 'logo') {
- $type = 'Logo';
- }
-
- if ($type == 'Logo' || $type == 'LogoBottom' || $type == 'LogoLogin') {
- return $style[$type] ? $css_url.$style[$type] : '';
- }
-
- $last_compiled = $style['LastCompiled'];
-
- $style_name = mb_strtolower( $style['Name'] );
-
- if( file_exists($css_path.'/'.'admin-'.$style_name.'-'.$last_compiled.'.css') )
- {
- $ret = $css_url.'admin-'.$style_name.'-'.$last_compiled.'.css';
-
- }
- else
- {
- // search for previously compiled stylesheet
- $last_compiled = 0;
- if( $dh = opendir($css_path) )
- {
- while( ($file = readdir($dh)) !== false )
- {
- if( preg_match('/admin-(.*)-([\d]+).css/', $file, $rets) )
- {
- if( $rets[1] == $style_name && $rets[2] > $last_compiled ) $last_compiled = $rets[2];
- }
- }
- closedir($dh);
- }
- if ($last_compiled) {
- // found
- $ret = $css_url.'admin-'.$style_name.'-'.$last_compiled.'.css';
- }
- else {
- // not found (try to compile on the fly)
- $object =& $this->Application->recallObject('skin.-item', null, Array ('skip_autoload' => true));
- /* @var $object kDBItem */
-
- $skin_eh =& $this->Application->recallObject('skin_EventHandler');
- /* @var $skin_eh SkinEventHandler */
-
- $object->Load(1, 'IsPrimary');
- $skin_eh->Compile($object);
- $ret = $css_url.'admin-'.$style_name.'-'.adodb_mktime().'.css';
- }
- }
-
- if (isset($params['file_only'])) return $ret;
-
- return ' ';
+ return $skin_helper->AdminSkinTag($params);
}
function PrintCompileErrors($params)
@@ -1148,6 +1109,65 @@
$this->Application->Phrases->LanguageId = $params['language_id'];
$this->Application->Phrases->LoadPhrases( $this->Application->Caches['PhraseList'] );
}
- }
-?>
\ No newline at end of file
+ /**
+ * Performs HTTP Authentification for administrative console
+ *
+ * @param Array $params
+ */
+ function HTTPAuth($params)
+ {
+ if (!$this->Application->ConfigValue('UseHTTPAuth')) {
+ // http authentification not required
+ return true;
+ }
+
+ $super_admin_ips = defined('SA_IP') ? SA_IP : false;
+ $auth_bypass_ips = $this->Application->ConfigValue('HTTPAuthBypassIPs');
+
+ if (($auth_bypass_ips && ipMatch($auth_bypass_ips)) || ($super_admin_ips && ipMatch($super_admin_ips))) {
+ // user ip is in ip bypass list
+ return true;
+ }
+
+ if (!array_key_exists('PHP_AUTH_USER', $_SERVER)) {
+ // ask user to authentificate, when not authentificated before
+ return $this->_httpAuthentificate();
+ }
+ else {
+ // validate user credentials (browsers remembers user/password
+ // and sends them each time page is visited, so no need to save
+ // authentification result in session)
+ if ($this->Application->ConfigValue('HTTPAuthUsername') != $_SERVER['PHP_AUTH_USER']) {
+ // incorrect username
+ return $this->_httpAuthentificate();
+ }
+
+ $password_formatter =& $this->Application->recallObject('kPasswordFormatter');
+ /* @var $password_formatter kPasswordFormatter */
+
+ $password = $password_formatter->EncryptPassword($_SERVER['PHP_AUTH_PW'], 'b38');
+
+ if ($this->Application->ConfigValue('HTTPAuthPassword') != $password) {
+ // incorrect password
+ return $this->_httpAuthentificate();
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Ask user to authentificate
+ *
+ * @return false
+ */
+ function _httpAuthentificate()
+ {
+ $realm = strip_tags( $this->Application->ConfigValue('Site_Name') );
+ header('WWW-Authenticate: Basic realm="' . $realm . '"');
+ header('HTTP/1.0 401 Unauthorized');
+
+ return false;
+ }
+ }
\ No newline at end of file
Index: branches/5.1.x/core/units/selectors/selectors_event_handler.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/units/selectors/selectors_event_handler.php (.../selectors_event_handler.php) (revision 12127)
+++ branches/5.1.x/core/units/selectors/selectors_event_handler.php (.../selectors_event_handler.php) (revision 12657)
@@ -1,6 +1,6 @@
\ No newline at end of file
+ }
\ No newline at end of file
Index: branches/5.1.x/system/cache/dummy
===================================================================
diff -u -N
--- branches/5.1.x/system/cache/dummy (revision 12127)
+++ branches/5.1.x/system/cache/dummy (revision 0)
@@ -1 +0,0 @@
-dummy
\ No newline at end of file
Index: branches/5.1.x/core/units/configuration/configuration_event_handler.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/units/configuration/configuration_event_handler.php (.../configuration_event_handler.php) (revision 12127)
+++ branches/5.1.x/core/units/configuration/configuration_event_handler.php (.../configuration_event_handler.php) (revision 12657)
@@ -1,6 +1,6 @@
addFilter('module_filter', '%1$s.ModuleOwner = '.$this->Conn->qstr($module));
$object->addFilter('section_filter', '%1$s.Section = '.$this->Conn->qstr($section));
+ if (!$this->Application->ConfigValue('AllowAdminConsoleInterfaceChange')) {
+ $object->addFilter('interface_change_filter', '%1$s.VariableName <> "AdminConsoleInterface"');
+ }
+
if (defined('IS_INSTALL') && IS_INSTALL) {
$object->addFilter('install_filter', 'ca.Install = 1');
}
@@ -57,8 +61,23 @@
*/
function OnBeforeItemUpdate(&$event)
{
+ static $default_field_options = null;
+
$object =& $event->getObject();
+ /* @var $object kDBItem */
+ // ability to validate each configuration variable separately
+ if (!isset($default_field_options)) {
+ $default_field_options = $object->GetFieldOptions('VariableValue');
+ }
+
+ $new_field_options = $default_field_options;
+ $validation = $object->GetDBField('Validation');
+ if ($validation) {
+ $new_field_options = array_merge($new_field_options, unserialize($validation));
+ }
+ $object->SetFieldOptions('VariableValue', $new_field_options);
+
// if password field is empty, then don't update
if ($object->GetDBField('element_type') == 'password') {
if (trim($object->GetDBField('VariableValue')) == '') {
@@ -71,20 +90,25 @@
}
}
- $field_values = $this->Application->GetVar($event->getPrefixSpecial(true));
+ $field_values = $this->Application->GetVar( $event->getPrefixSpecial(true) );
- $state_country_hash = Array(
- 'Comm_State' => 'Comm_Country',
- 'Comm_Shipping_State' => 'Comm_Shipping_Country'
- );
+ $state_country_hash = Array (
+ 'Comm_State' => 'Comm_Country',
+ 'Comm_Shipping_State' => 'Comm_Shipping_Country'
+ );
$field_name = $object->GetDBField('VariableName');
- if (isset($state_country_hash[$field_name])) {
+ if (array_key_exists($field_name, $state_country_hash)) {
// if this is state field
+ $sql = 'SELECT VariableId
+ FROM ' . $this->Application->getUnitOption('conf', 'TableName') . '
+ WHERE VariableName = "' . $state_country_hash[$field_name] . '"';
+ $country_variable_id = $this->Conn->GetOne($sql);
+
$check_state = $object->GetDBField('VariableValue');
- $check_country = $field_values[ $state_country_hash[$field_name] ]['VariableValue'];
+ $check_country = $field_values[$country_variable_id]['VariableValue'];
- if (!($check_country && $check_state)) {
+ if (!$check_country || !$check_state) {
return true;
}
@@ -93,19 +117,20 @@
if ($state_iso !== false) {
$object->SetDBField('VariableValue', $state_iso);
}
- else
- {
- $errormsgs = $this->Application->GetVar('errormsgs');
- $errors = !$errormsgs || !isset($errormsgs[$event->Prefix_Special]) ? Array() : $errormsgs[$event->Prefix_Special];
+ else {
+ // selected state doesn't belong to selected country
+ $object->SetError('VariableValue', 'invalid_state', 'la_InvalidState');
+ }
+ }
- $errors[$field_name] = 'la_InvalidState';
- $errormsgs[$event->Prefix_Special] = $errors;
+ if ($object->GetDBField('VariableName') == 'AdminConsoleInterface') {
+ $can_change = $this->Application->ConfigValue('AllowAdminConsoleInterfaceChange');
- $this->Application->SetVar('errormsgs', $errormsgs);
- $event->status = erFAIL;
+ if (($object->GetDBField('VariableValue') != $object->GetOriginalField('VariableValue')) && !$can_change) {
+ $object->SetError('VariableValue', 'not_allowed', 'la_error_NotAllowed');
}
- }
+ }
}
/**
@@ -116,13 +141,53 @@
function OnAfterItemUpdate(&$event)
{
$object =& $event->getObject();
+ /* @var $object kDBItem */
+
if ($object->GetDBField('element_type') == 'password') {
if (trim($object->GetDBField('VariableValue')) == '') {
$field_options = $object->GetFieldOptions('VariableValue');
unset($field_options['skip_empty']);
$object->SetFieldOptions('VariableValue', $field_options);
}
}
+
+ // allows to check if variable's value was changed now
+ $variable_name = $object->GetDBField('VariableName');
+ $variable_value = $object->GetDBField('VariableValue');
+ $watch_variables = Array (
+ 'Require_AdminSSL', 'AdminSSL_URL', 'AdvancedUserManagement',
+ 'Site_Name', 'AdminConsoleInterface'
+ );
+
+ if (in_array($variable_name, $watch_variables)) {
+ $changed = $this->Application->GetVar($event->getPrefixSpecial() . '_changed', Array ());
+
+ if ($variable_value != $object->GetOriginalField('VariableValue')) {
+ $changed[] = $variable_name;
+ $this->Application->SetVar($event->getPrefixSpecial() . '_changed', $changed);
+ }
+
+ switch ($variable_name) {
+ case 'Require_AdminSSL':
+ case 'AdminSSL_URL':
+ static $skin_deleted = false;
+
+ if (in_array($variable_name, $changed) && !$skin_deleted) {
+ // when administrative console is moved to SSL mode, then delete skin
+ $skin_helper =& $this->Application->recallObject('SkinHelper');
+ /* @var $skin_helper SkinHelper */
+
+ $skin_file = $skin_helper->getSkinPath();
+ if (file_exists($skin_file)) {
+ unlink($skin_file);
+ }
+
+ $skin_deleted = true;
+ }
+ break;
+ }
+ }
+
}
/**
@@ -133,56 +198,70 @@
function OnUpdate(&$event)
{
if (!$this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) {
+ $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
// 1. save user selected module root category
- $items_info = $this->Application->GetVar($event->getPrefixSpecial(true));
$new_category_id = getArrayValue($items_info, 'ModuleRootCategory', 'VariableValue');
if ($new_category_id !== false) {
unset($items_info['ModuleRootCategory']);
- $this->Application->SetVar($event->getPrefixSpecial(true), $items_info);
}
- parent::OnUpdate($event);
+ $object =& $event->getObject( Array('skip_autoload' => true) );
+ /* @var $object kDBItem */
- if ($event->status == erSUCCESS && $new_category_id !== false) {
- // root category was submitted
- $module = $this->Application->GetVar('module');
- $root_category_id = $this->Application->findModule('Name', $module, 'RootCat');
+ if ($items_info) {
+ $has_error = false;
+ foreach ($items_info as $id => $field_values) {
+ $object->Clear(); // clear validation errors from previous variable
+ $object->Load($id);
+ $object->SetFieldsFromHash($field_values);
- if ($root_category_id != $new_category_id) {
- // root category differs from one in db
- $fields_hash = Array('RootCat' => $new_category_id);
- $this->Conn->doUpdate($fields_hash, TABLE_PREFIX.'Modules', 'Name = '.$this->Conn->qstr($module));
+ if (!$object->Update($id)) {
+ // don't stop when error found !
+ $has_error = true;
+ }
}
+
+ $event->status = $has_error ? erFAIL : erSUCCESS;
}
- if ($event->status == erSUCCESS) { // reset cache
- $refresh_sections = false;
- if ($items_info) {
- $id_field = $this->Application->getUnitOption($event->Prefix, 'IDField');
- $table_name = $this->Application->getUnitOption($event->Prefix, 'TableName');
+ if ($event->status == erSUCCESS) {
+ if ($new_category_id !== false) {
+ // root category was submitted
+ $module = $this->Application->GetVar('module');
+ $root_category_id = $this->Application->findModule('Name', $module, 'RootCat');
- $sql = 'SELECT ' . $id_field . '
- FROM ' . $table_name . '
- WHERE ' . $id_field . ' IN (' . implode(',', array_keys($items_info)) . ') AND (VariableName = "AdvancedUserManagement")';
- $refresh_sections = $this->Conn->GetCol($sql);
+ if ($root_category_id != $new_category_id) {
+ // root category differs from one in db
+ $fields_hash = Array('RootCat' => $new_category_id);
+ $this->Conn->doUpdate($fields_hash, TABLE_PREFIX.'Modules', 'Name = '.$this->Conn->qstr($module));
+ }
}
- if ($refresh_sections) {
+ // reset cache
+ $changed = $this->Application->GetVar($event->getPrefixSpecial() . '_changed', Array ());
+ $require_refresh = Array (
+ 'AdvancedUserManagement', 'Site_Name', 'AdminConsoleInterface'
+ );
+
+ $refresh_sections = array_intersect($require_refresh, $changed);
+ $require_full_refresh = Array ('Site_Name', 'AdminConsoleInterface');
+
+ if (array_intersect($require_full_refresh, $changed)) {
+ $event->SetRedirectParam('refresh_all', 1);
+ } elseif ($refresh_sections) {
// reset sections too, because of AdvancedUserManagement
$event->SetRedirectParam('refresh_tree', 1);
}
$this->Application->UnitConfigReader->ResetParsedData($refresh_sections ? true : false);
}
+ elseif ($this->Application->GetVar('errors_' . $event->getPrefixSpecial())) {
+ // because we have list out there, and this is item
+ $this->Application->removeObject( $event->getPrefixSpecial() );
+ }
}
- if ($this->Application->GetVar('errormsgs')) {
- // because we have list out there, and this is item
- $this->Application->removeObject($event->getPrefixSpecial());
- $event->redirect = false;
- }
-
// keeps module and section in REQUEST to ensure, that last admin template will work
$event->SetRedirectParam('module', $this->Application->GetVar('module'));
$event->SetRedirectParam('section', $this->Application->GetVar('section'));
@@ -223,8 +302,4 @@
$event->SetRedirectParam('opener', 'u');
}
- }
-
-
-
-?>
\ No newline at end of file
+ }
\ No newline at end of file
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_primary_currency_f3.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/icons/icon46_reviews.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_import_language_f3.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/units/files/file_tp.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/units/files/file_tp.php (.../file_tp.php) (revision 12127)
+++ branches/5.1.x/core/units/files/file_tp.php (.../file_tp.php) (revision 12657)
@@ -1,6 +1,6 @@
\ No newline at end of file
+ }
\ No newline at end of file
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_modify.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/kernel/utility/cache.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/kernel/utility/cache.php (.../cache.php) (revision 12127)
+++ branches/5.1.x/core/kernel/utility/cache.php (.../cache.php) (revision 12657)
@@ -1,6 +1,6 @@
_filename = (defined('WRITEABLE') ? WRITEABLE.'/cache' : FULL_PATH.'/kernel/cache') . '/' . $filename;
+ $this->_filename = WRITEABLE . '/cache' . '/' . $filename;
if (file_exists($this->_filename)) {
$cache_data = unserialize(file_get_contents($this->_filename));
@@ -284,6 +286,4 @@
return $ret;
}
- }
-
-?>
\ No newline at end of file
+ }
\ No newline at end of file
Index: branches/5.1.x/core/admin_templates/img/icons/icon46_list_usergroups.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/js/tree.js
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/admin_templates/js/tree.js (.../tree.js) (revision 12127)
+++ branches/5.1.x/core/admin_templates/js/tree.js (.../tree.js) (revision 12657)
@@ -84,8 +84,8 @@
TreeItem.prototype.appendIcon = function (td)
{
img = document.createElement('img');
- img.style.width = '24px';
- img.style.height = '22px';
+// img.style.width = '24px';
+// img.style.height = '22px';
if (this.Icon.indexOf('http://') != -1) {
img.src = this.Icon;
}
@@ -133,8 +133,11 @@
}
else {
// ensures, that click is made before AJAX request will be sent
- if (res === true) {
- // only in case of "true" is returned, used in catalog
+ var $res_type = Object.prototype.toString.call(res);
+
+ if ((res === true) || ($res_type == '[object Object]')) {
+ // in case of "true" is returned, used in catalog
+ // in case of object (tree node) is returned, used in advanced view
if (this.treeItem.isContainer()) {
this.href = this.treeItem.locateFirstItem().Url;
}
@@ -145,7 +148,15 @@
if (!this.treeItem.Expanded && this.treeItem.isFolder()) {
if (this.treeItem.folderClick());
}
- this.treeItem.highLight();
+
+ if ($res_type == '[object Object]') {
+ // highlight returned tree node instead of clicked one
+ res.highLight(false); // don't expand such node
+ }
+ else {
+ this.treeItem.highLight();
+ }
+
return false;
}
}
@@ -167,7 +178,7 @@
TreeItem.prototype.display = function()
{
- this.Tr.style.display = is.ie ? 'block' : 'table-row';
+ this.Tr.style.display = ''; // is.ie ? 'block' : 'table-row';
this.Displayed = true;
var do_sub = TreeManager.isExpanded(this.Key);
@@ -186,21 +197,29 @@
this.Displayed = false;
}
-TreeItem.prototype.highLight = function()
+TreeItem.prototype.highLight = function($auto_expand)
{
- if (last_hightlighted) last_hightlighted.Tr.className = '';
+ if ($auto_expand === undefined) {
+ $auto_expand = true;
+ }
+
+ if (last_hightlighted) {
+ last_hightlighted.Tr.className = '';
+ }
+
if (this.Children && this.Children.length > 0 && this.isContainer()) {
- if (!this.Expanded) {
+ if (!this.Expanded && $auto_expand) {
this.expand();
}
- this.Children[0].highLight();
+
+ this.Children[0].highLight($auto_expand);
return;
}
this.Tr.className = "highlighted";
last_hightlighted = this;
last_highlighted_key = this.Key;
- if (!this.Expanded) {
+ if (!this.Expanded && $auto_expand) {
this.expand();
}
}
Index: branches/5.1.x/core/admin_templates/img/icons/icon46_list_settings_search.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/categories/categories_edit_relations.tpl
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/admin_templates/categories/categories_edit_relations.tpl (.../categories_edit_relations.tpl) (revision 12127)
+++ branches/5.1.x/core/admin_templates/categories/categories_edit_relations.tpl (.../categories_edit_relations.tpl) (revision 12657)
@@ -35,7 +35,7 @@
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
//Relations related:
- a_toolbar.AddButton( new ToolBarButton('new_relation', ' ',
+ a_toolbar.AddButton( new ToolBarButton('new_item', ' :: ',
function() {
openSelector('c-rel', ' ', 'TargetId', '950x600');
} ) );
Index: branches/5.1.x/core/admin_templates/img/icons/icon24_advanced_view.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_theme_f2.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/logs/change_logs/change_log_list.tpl
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/admin_templates/logs/change_logs/change_log_list.tpl (.../change_log_list.tpl) (revision 12127)
+++ branches/5.1.x/core/admin_templates/logs/change_logs/change_log_list.tpl (.../change_log_list.tpl) (revision 12657)
@@ -18,7 +18,7 @@
std_edit_item('change-log', 'logs/change_logs/change_log_edit');
}
- a_toolbar.AddButton( new ToolBarButton('view_item', ' :: ', edit) );
+ a_toolbar.AddButton( new ToolBarButton('edit', ' :: ', edit) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
@@ -73,7 +73,7 @@
\ No newline at end of file
Index: branches/5.1.x/core/units/general/cat_dbitem_export.php
===================================================================
diff -u -N
--- branches/5.1.x/core/units/general/cat_dbitem_export.php (revision 12127)
+++ branches/5.1.x/core/units/general/cat_dbitem_export.php (revision 0)
@@ -1,1444 +0,0 @@
-cacheTable = TABLE_PREFIX.'ImportCache';
- }
-
- /**
- * Returns value from cache if found or false otherwise
- *
- * @param string $type
- * @param int $key
- * @return mixed
- */
- function getFromCache($type, $key)
- {
- return getArrayValue($this->cache, $type, $key);
- }
-
- /**
- * Adds value to be cached
- *
- * @param string $type
- * @param int $key
- * @param mixed $value
- */
- function addToCache($type, $key, $value, $is_new = true)
- {
-// if (!isset($this->cache[$type])) $this->cache[$type] = Array();
- $this->cache[$type][$key] = $value;
- if ($is_new) {
- $this->cacheStatus[$type][$key] = true;
- }
- }
-
- function storeCache($cache_types)
- {
- $cache_types = explode(',', $cache_types);
-
- $values_sql = '';
- foreach ($cache_types as $cache_type) {
- $sql_mask = '('.$this->Conn->qstr($cache_type).',%s,%s),';
- $cache = getArrayValue($this->cacheStatus, $cache_type);
- if (!$cache) $cache = Array();
- foreach ($cache as $var_name => $cache_status) {
- $var_value = $this->cache[$cache_type][$var_name];
- $values_sql .= sprintf($sql_mask, $this->Conn->qstr($var_name), $this->Conn->qstr($var_value) );
- }
- }
- $values_sql = preg_replace('/(.*),$/', '\\1', $values_sql);
- if ($values_sql) {
- $sql = 'INSERT INTO '.$this->cacheTable.'(`CacheName`,`VarName`,`VarValue`) VALUES '.$values_sql;
- $this->Conn->Query($sql);
- }
-
- }
-
- function loadCache()
- {
- $sql = 'SELECT * FROM '.$this->cacheTable;
- $records = $this->Conn->Query($sql);
-
- $this->cache = Array();
- foreach ($records as $record) {
- $this->addToCache($record['CacheName'], $record['VarName'], $record['VarValue'], false);
- }
- }
-
- /**
- * Fill required fields with dummy values
- *
- * @param kEvent $event
- */
- function fillRequiredFields(&$event, &$object, $set_status = false)
- {
- if ($object == $this->false) {
- $object =& $event->getObject();
- }
-
- $has_empty = false;
- $fields = array_keys($object->Fields);
- foreach ($fields as $field_name)
- {
- $field_options =& $object->Fields[$field_name];
- if (isset($object->VirtualFields[$field_name]) || !getArrayValue($field_options, 'required') ) continue;
- if ( $object->GetDBField($field_name) ) continue;
-
- $formatter_class = getArrayValue($field_options, 'formatter');
- if ($formatter_class) // not tested
- {
- $formatter =& $this->Application->recallObject($formatter_class);
- $sample_value = $formatter->GetSample($field_name, $field_options, $object);
- }
-
- $has_empty = true;
- $object->SetField($field_name, isset($sample_value) && $sample_value ? $sample_value : 'no value');
- }
- $object->UpdateFormattersSubFields();
-
- if ($set_status && $has_empty) {
- $object->SetDBField('Status', 0);
- }
- }
-
- /**
- * Verifies that all user entered export params are correct
- *
- * @param kEvent $event
- */
- function verifyOptions(&$event)
- {
- if ($this->Application->RecallVar($event->getPrefixSpecial().'_ForceNotValid'))
- {
- $this->Application->StoreVar($event->getPrefixSpecial().'_ForceNotValid', 0);
- return false;
- }
-
- $this->fillRequiredFields($event, $this->false);
-
- $object =& $event->getObject();
- $cross_unique_fields = Array('FieldsSeparatedBy', 'FieldsEnclosedBy');
- if (($object->GetDBField('CategoryFormat') == 1) || ($event->Special == 'import')) // in one field
- {
- $object->setRequired('CategorySeparator', true);
- $cross_unique_fields[] = 'CategorySeparator';
- }
-
- $ret = $object->Validate();
-
- // check if cross unique fields has no same values
- foreach ($cross_unique_fields as $field_index => $field_name)
- {
- if (getArrayValue($object->FieldErrors, $field_name, 'pseudo') == 'required') continue;
-
- $check_fields = $cross_unique_fields;
- unset($check_fields[$field_index]);
-
- foreach ($check_fields as $check_field)
- {
- if ($object->GetDBField($field_name) == $object->GetDBField($check_field))
- {
- $object->SetError($check_field, 'unique');
- }
- }
- }
-
- if ($event->Special == 'import')
- {
- $this->exportOptions = $this->loadOptions($event);
-
- $automatic_fields = ($object->GetDBField('FieldTitles') == 1);
- $object->setRequired('ExportColumns', !$automatic_fields);
- $category_prefix = '__CATEGORY__';
- if ( $automatic_fields && ($this->exportOptions['SkipFirstRow']) ) {
- $this->openFile($event);
- $this->exportOptions['ExportColumns'] = $this->readRecord();
-
- if (!$this->exportOptions['ExportColumns']) {
- $this->exportOptions['ExportColumns'] = Array ();
- }
-
- $this->closeFile();
-
- // remove additional (non-parseble columns)
- foreach ($this->exportOptions['ExportColumns'] as $field_index => $field_name) {
- if (!$this->validateField($field_name, $object)) {
- unset($this->exportOptions['ExportColumns'][$field_index]);
- }
- }
- $category_prefix = '';
- }
-
- // 1. check, that we have column definitions
- if (!$this->exportOptions['ExportColumns']) {
- $object->setError('ExportColumns', 'required');
- $ret = false;
- }
- else {
- // 1.1. check that all required fields are present in imported file
- $missing_columns = Array();
- foreach ($object->Fields as $field_name => $field_options) {
- if ($object->skipField($field_name)) continue;
- if (getArrayValue($field_options, 'required') && !in_array($field_name, $this->exportOptions['ExportColumns']) ) {
- $missing_columns[] = $field_name;
- $object->setError('ExportColumns', 'required_fields_missing', 'la_error_RequiredColumnsMissing');
- $ret = false;
- }
- }
-
- if (!$ret && $this->Application->isDebugMode()) {
- $this->Application->Debugger->appendHTML('Missing required for import/export:');
- $this->Application->Debugger->dumpVars($missing_columns);
- }
- }
-
-
- // 2. check, that we have only mixed category field or only separated category fields
- $category_found['mixed'] = false;
- $category_found['separated'] = false;
-
- foreach ($this->exportOptions['ExportColumns'] as $import_field) {
- if (preg_match('/^'.$category_prefix.'Category(Path|[0-9]+)/', $import_field, $rets)) {
- $category_found[$rets[1] == 'Path' ? 'mixed' : 'separated'] = true;
- }
- }
- if ($category_found['mixed'] && $category_found['separated']) {
- $object->SetError('ExportColumns', 'unique_category', 'la_error_unique_category_field');
- $ret = false;
- }
-
- // 3. check, that duplicates check fields are selected & present in imported fields
- if ($this->exportOptions['ReplaceDuplicates']) {
- if ($this->exportOptions['CheckDuplicatesMethod'] == 1) {
- $check_fields = Array($object->IDField);
- }
- else {
- $check_fields = $this->exportOptions['DuplicateCheckFields'] ? explode('|', substr($this->exportOptions['DuplicateCheckFields'], 1, -1)) : Array();
- $object =& $event->getObject();
-
- $language_id = $this->Application->GetDefaultLanguageId();
- foreach ($check_fields as $index => $check_field) {
- foreach ($object->Fields as $field_name => $field_options) {
- if ($field_name == 'l'.$language_id.'_'.$check_field) {
- $check_fields[$index] = 'l'.$language_id.'_'.$check_field;
- break;
- }
- }
- }
- }
- $this->exportOptions['DuplicateCheckFields'] = $check_fields;
-
- if (!$check_fields) {
- $object->setError('CheckDuplicatesMethod', 'required');
- $ret = false;
- }
- else {
- foreach ($check_fields as $check_field) {
- $check_field = preg_replace('/^cust_(.*)/', 'Custom_\\1', $check_field);
- if (!in_array($check_field, $this->exportOptions['ExportColumns'])) {
- $object->setError('ExportColumns', 'required');
- $ret = false;
- break;
- }
- }
- }
- }
- $this->saveOptions($event);
- }
-
- return $ret;
- }
-
- /**
- * Returns filename to read import data from
- *
- * @return string
- */
- function getImportFilename()
- {
- if ($this->exportOptions['ImportSource'] == 1)
- {
- $ret = $this->exportOptions['ImportFilename']; // ['name']; commented by Kostja
- }
- else {
- $ret = $this->exportOptions['ImportLocalFilename'];
- }
- return EXPORT_PATH.'/'.$ret;
- }
-
- /**
- * Returns filename to write export data to
- *
- * @return string
- */
- function getExportFilename()
- {
- return EXPORT_PATH.'/'.$this->exportOptions['ExportFilename'].'.'.$this->getFileExtension();
- }
-
- /**
- * Opens file required for export/import operations
- *
- * @param kEvent $event
- */
- function openFile(&$event)
- {
- if ($event->Special == 'export') {
- $write_mode = ($this->exportOptions['start_from'] == 0) ? 'w' : 'a';
- $this->filePointer = fopen($this->getExportFilename(), $write_mode);
- }
- else {
- $this->filePointer = fopen($this->getImportFilename(), 'r');
- }
-
- // skip UTF-8 BOM Modifier
- $first_chars = fread($this->filePointer, 3);
- if (bin2hex($first_chars) != 'efbbbf') {
- fseek($this->filePointer, 0);
- }
- }
-
- /**
- * Closes opened file
- *
- */
- function closeFile()
- {
- fclose($this->filePointer);
- }
-
- function getCustomSQL()
- {
- $ml_formatter =& $this->Application->recallObject('kMultiLanguage');
-
- $custom_sql = '';
- foreach ($this->customFields as $custom_id => $custom_name) {
- $custom_sql .= 'custom_data.'.$ml_formatter->LangFieldName('cust_'.$custom_id).' AS cust_'.$custom_name.', ';
- }
-
- return preg_replace('/(.*), /', '\\1', $custom_sql);
- }
-
- function getPlainExportSQL($count_only = false) {
- if ($count_only && isset($this->exportOptions['ForceCountSQL'])) {
- $sql = $this->exportOptions['ForceCountSQL'];
- }
- elseif (!$count_only && isset($this->exportOptions['ForceSelectSQL'])) {
- $sql = $this->exportOptions['ForceSelectSQL'];
- }
- else {
- $items_list =& $this->Application->recallObject($this->curItem->Prefix.'.export-items-list', $this->curItem->Prefix.'_List');
- $items_list->SetPerPage(-1);
-
- if ($options['export_ids'] != '') {
- $items_list->AddFilter('export_ids', $items_list->TableName.'.'.$items_list->IDField.' IN ('.implode(',',$options['export_ids']).')');
- }
-
- if ($count_only) {
- $sql = $items_list->getCountSQL( $items_list->GetSelectSQL(true,false) );
- }
- else {
- $sql = $items_list->GetSelectSQL();
- }
- }
-
- if (!$count_only)
- {
- $sql .= ' LIMIT '.$this->exportOptions['start_from'].','.EXPORT_STEP;
- }
-// else {
-// $sql = preg_replace("/^.*SELECT(.*?)FROM(?!_)/is", "SELECT COUNT(*) AS count FROM ", $sql);
-// }
-
- return $sql;
- }
-
- function getExportSQL($count_only = false)
- {
- if (!$this->Application->getUnitOption($this->curItem->Prefix, 'CatalogItem')) {
- return $this->GetPlainExportSQL($count_only); // in case this is not a CategoryItem
- }
-
- if ($this->exportOptions['export_ids'] === false)
- {
- // get links from current category & all it's subcategories
- $join_clauses = Array();
-
- $custom_sql = $this->getCustomSQL();
- if ($custom_sql) {
- $custom_table = $this->Application->getUnitOption($this->curItem->Prefix.'-cdata', 'TableName');
- $join_clauses[$custom_table.' custom_data'] = 'custom_data.ResourceId = item_table.ResourceId';
- }
-
- $join_clauses[TABLE_PREFIX.'CategoryItems ci'] = 'ci.ItemResourceId = item_table.ResourceId';
- $join_clauses[TABLE_PREFIX.'Category c'] = 'c.CategoryId = ci.CategoryId';
-
- $sql = 'SELECT item_table.*, ci.CategoryId'.($custom_sql ? ', '.$custom_sql : '').'
- FROM '.$this->curItem->TableName.' item_table';
-
- foreach ($join_clauses as $table_name => $join_expression) {
- $sql .= ' LEFT JOIN '.$table_name.' ON '.$join_expression;
- }
- $sql .= ' WHERE ';
-
- if ($this->exportOptions['export_cats_ids'][0] == 0)
- {
- $sql .= '1';
- }
- else {
- foreach ($this->exportOptions['export_cats_ids'] as $category_id) {
- $sql .= '(c.ParentPath LIKE "%|'.$category_id.'|%") OR ';
- }
- $sql = preg_replace('/(.*) OR $/', '\\1', $sql);
- }
-
- $sql .= ' ORDER BY ci.PrimaryCat DESC'; // NEW
- }
- else {
- // get only selected links
- $sql = 'SELECT item_table.*, '.$this->exportOptions['export_cats_ids'][0].' AS CategoryId
- FROM '.$this->curItem->TableName.' item_table
- WHERE '.$this->curItem->IDField.' IN ('.implode(',', $this->exportOptions['export_ids']).')';
- }
-
- if (!$count_only)
- {
- $sql .= ' LIMIT '.$this->exportOptions['start_from'].','.EXPORT_STEP;
- }
- else {
- $sql = preg_replace("/^.*SELECT(.*?)FROM(?!_)/is", "SELECT COUNT(*) AS count FROM ", $sql);
- }
-
- return $sql;
- }
-
- /**
- * Enter description here...
- *
- * @param kEvent $event
- */
- function performExport(&$event)
- {
- $this->exportOptions = $this->loadOptions($event);
- $this->exportFields = $this->exportOptions['ExportColumns'];
- $this->curItem =& $event->getObject( Array('skip_autoload' => true) );
- $this->customFields = $this->Application->getUnitOption($event->Prefix, 'CustomFields');
- $this->openFile($event);
-
- if ($this->exportOptions['start_from'] == 0) // first export step
- {
- if (!getArrayValue($this->exportOptions, 'IsBaseCategory')) {
- $this->exportOptions['IsBaseCategory'] = 0;
- }
-
- if ($this->exportOptions['IsBaseCategory'] ) {
- $sql = 'SELECT ParentPath
- FROM '.TABLE_PREFIX.'Category
- WHERE CategoryId = '.$this->Application->GetVar('m_cat_id');
- $parent_path = $this->Conn->GetOne($sql);
- $parent_path = explode('|', substr($parent_path, 1, -1));
- if ($parent_path && $parent_path[0] == $this->Application->findModule('Name', 'Core', 'RootCat')) {
- array_shift($parent_path);
- }
-
- $this->exportOptions['BaseLevel'] = count($parent_path); // level to cut from other categories
- }
-
- // 1. export field titles if required
- if ($this->exportOptions['IncludeFieldTitles'])
- {
- $data_array = Array();
- foreach ($this->exportFields as $export_field)
- {
- $data_array = array_merge($data_array, $this->getFieldCaption($export_field));
- }
- $this->writeRecord($data_array);
- }
- $this->exportOptions['total_records'] = $this->Conn->GetOne( $this->getExportSQL(true) );
- }
-
- // 2. export data
- $records = $this->Conn->Query( $this->getExportSQL() );
- $records_exported = 0;
- foreach ($records as $record_info) {
- $this->curItem->Clear();
- $this->curItem->SetDBFieldsFromHash($record_info);
- $this->setCurrentID();
- $this->curItem->raiseEvent('OnAfterItemLoad', $this->curItem->GetID() );
-
- $data_array = Array();
- foreach ($this->exportFields as $export_field)
- {
- $data_array = array_merge($data_array, $this->getFieldValue($export_field) );
- }
- $this->writeRecord($data_array);
- $records_exported++;
- }
- $this->closeFile();
-
- $this->exportOptions['start_from'] += $records_exported;
- $this->saveOptions($event);
-
- return $this->exportOptions;
- }
-
- function getItemFields()
- {
- // just in case dummy user selected automtic mode & moved columns too :(
- return array_merge($this->curItem->Fields['AvailableColumns']['options'], $this->curItem->Fields['ExportColumns']['options']);
- }
-
- /**
- * Checks if field really belongs to importable field list
- *
- * @param string $field_name
- * @param kCatDBItem $object
- * @return bool
- */
- function validateField($field_name, &$object)
- {
- // 1. convert custom field
- $field_name = preg_replace('/^Custom_(.*)/', '__CUSTOM__\\1', $field_name);
-
- // 2. convert category field (mixed version & serparated version)
- $field_name = preg_replace('/^Category(Path|[0-9]+)/', '__CATEGORY__Category\\1', $field_name);
-
- $valid_fields = $object->getPossibleExportColumns();
- return isset($valid_fields[$field_name]) || isset($valid_fields['__VIRTUAL__'.$field_name]);
- }
-
- /**
- * Enter description here...
- *
- * @param kEvent $event
- */
- function performImport(&$event)
- {
- if (!$this->exportOptions) {
- // load import options in case if not previously loaded in verification function
- $this->exportOptions = $this->loadOptions($event);
- }
-
- $backup_category_id = $this->Application->GetVar('m_cat_id');
- $this->Application->SetVar('m_cat_id', (int)$this->Application->RecallVar('ImportCategory') );
-
- $this->openFile($event);
-
- $bytes_imported = 0;
- if ($this->exportOptions['start_from'] == 0) // first export step
- {
- // 1st time run
- if ($this->exportOptions['SkipFirstRow']) {
- $this->readRecord();
- $this->exportOptions['start_from'] = ftell($this->filePointer);
- $bytes_imported = ftell($this->filePointer);
- }
-
- $current_category_id = $this->Application->GetVar('m_cat_id');
- if ($current_category_id > 0) {
- $sql = 'SELECT ParentPath FROM '.TABLE_PREFIX.'Category WHERE CategoryId = '.$current_category_id;
- $this->exportOptions['ImportCategoryPath'] = $this->Conn->GetOne($sql);
- }
- else {
- $this->exportOptions['ImportCategoryPath'] = '';
- }
- $this->exportOptions['total_records'] = filesize($this->getImportFilename());
- }
- else {
- $this->loadCache();
- }
-
- $this->exportFields = $this->exportOptions['ExportColumns'];
- $this->addToCache('category_parent_path', $this->Application->GetVar('m_cat_id'), $this->exportOptions['ImportCategoryPath']);
-
- // 2. import data
- $this->dummyCategory =& $this->Application->recallObject('c.-tmpitem', 'c', Array('skip_autoload' => true));
- fseek($this->filePointer, $this->exportOptions['start_from']);
-
- $items_processed = 0;
- while (($bytes_imported < IMPORT_CHUNK && $items_processed < IMPORT_STEP) && !feof($this->filePointer)) {
- $data = $this->readRecord();
- if ($data) {
- if ($this->exportOptions['ReplaceDuplicates']) {
- // set fields used as keys for replace duplicates code
- $this->resetImportObject($event, IMPORT_TEMP, $data);
- }
-
- $this->processCurrentItem($event, $data);
- }
- $bytes_imported = ftell($this->filePointer) - $this->exportOptions['start_from'];
- $items_processed++;
- }
-
- $this->closeFile();
- $this->Application->SetVar('m_cat_id', $backup_category_id);
-
- $this->exportOptions['start_from'] += $bytes_imported;
- $this->storeCache('new_ids');
-
- $this->saveOptions($event);
-
- if ($this->exportOptions['start_from'] == $this->exportOptions['total_records']) {
- $this->Conn->Query('TRUNCATE TABLE '.$this->cacheTable);
- }
-
- return $this->exportOptions;
- }
-
- function setCurrentID()
- {
- $this->curItem->setID( $this->curItem->GetDBField($this->curItem->IDField) );
- }
-
- function setFieldValue($field_index, $value)
- {
- if (empty($value)) {
- $value = null;
- }
-
- $field_name = getArrayValue($this->exportFields, $field_index);
- if ($field_name == 'ResourceId') {
- return false;
- }
-
- if (substr($field_name, 0, 7) == 'Custom_') {
- $field_name = 'cust_'.substr($field_name, 7);
- $this->curItem->SetField($field_name, $value);
- }
- elseif ($field_name == 'CategoryPath' || $field_name == '__CATEGORY__CategoryPath') {
- $this->curItem->CategoryPath = $value ? explode($this->exportOptions['CategorySeparator'], $value) : Array();
- }
- elseif (substr($field_name, 0, 8) == 'Category') {
- $this->curItem->CategoryPath[ (int)substr($field_name, 8) - 1 ] = $value;
- }
- elseif (substr($field_name, 0, 20) == '__CATEGORY__Category') {
- $this->curItem->CategoryPath[ (int)substr($field_name, 20) ] = $value;
- }
- elseif (substr($field_name, 0, 11) == '__VIRTUAL__') {
- $field_name = substr($field_name, 11);
- $this->curItem->SetField($field_name, $value);
- }
- else {
- $this->curItem->SetField($field_name, $value);
- }
-
- $pseudo_error = getArrayValue($this->curItem->FieldErrors, $field_name, 'pseudo');
- if ($pseudo_error) {
- $this->curItem->SetDBField($field_name, null);
- unset($this->curItem->FieldErrors[$field_name]);
- }
- }
-
- function resetImportObject(&$event, $object_type, $record_data = null)
- {
- switch ($object_type) {
- case IMPORT_TEMP:
- $this->curItem =& $event->getObject( Array('skip_autoload' => true) );
- break;
-
- case IMPORT_LIVE:
- $this->curItem =& $this->Application->recallObject($event->Prefix.'.-tmpitem'.$event->Special, $event->Prefix, Array('skip_autoload' => true));
- break;
- }
- $this->curItem->Clear();
- $this->customFields = $this->Application->getUnitOption($event->Prefix, 'CustomFields');
-
- if (isset($record_data)) {
- $this->setImportData($record_data);
- }
- }
-
- function setImportData($record_data)
- {
- foreach ($record_data as $field_index => $field_value) {
- $this->setFieldValue($field_index, $field_value);
- }
- $this->setCurrentID();
- }
-
-
- function getItemCategory()
- {
- static $lang_prefix = null;
- $backup_category_id = $this->Application->GetVar('m_cat_id');
-
- $category_id = $this->getFromCache('category_names', implode(':', $this->curItem->CategoryPath));
- if ($category_id) {
- $this->Application->SetVar('m_cat_id', $category_id);
- return $category_id;
- }
-
- if (is_null($lang_prefix)) {
- $lang_prefix = 'l'.$this->Application->GetVar('m_lang').'_';
- }
-
- foreach ($this->curItem->CategoryPath as $category_index => $category_name) {
- if (!$category_name) continue;
- $category_key = crc32( implode(':', array_slice($this->curItem->CategoryPath, 0, $category_index + 1) ) );
-
- $category_id = $this->getFromCache('category_names', $category_key);
- if ($category_id === false) {
- // get parent category path to search only in it
- $current_category_id = $this->Application->GetVar('m_cat_id');
-// $parent_path = $this->getParentPath($current_category_id);
-
- // get category id from database by name
- $sql = 'SELECT CategoryId
- FROM '.TABLE_PREFIX.'Category
- WHERE ('.$lang_prefix.'Name = '.$this->Conn->qstr($category_name).') AND (ParentId = '.$current_category_id.')';
- $category_id = $this->Conn->GetOne($sql);
-
- if ($category_id === false) {
- // category not in db -> create
- $category_fields = Array( $lang_prefix.'Name' => $category_name, $lang_prefix.'Description' => $category_name,
- 'Status' => STATUS_ACTIVE, 'ParentId' => $current_category_id, 'AutomaticFilename' => 1
- );
- $this->dummyCategory->SetDBFieldsFromHash($category_fields);
- if ($this->dummyCategory->Create()) {
- $category_id = $this->dummyCategory->GetID();
- $this->addToCache('category_parent_path', $category_id, $this->dummyCategory->GetDBField('ParentPath'));
- $this->addToCache('category_names', $category_key, $category_id);
- }
- }
- else {
- $this->addToCache('category_names', $category_key, $category_id);
- }
- }
-
- if ($category_id) {
- $this->Application->SetVar('m_cat_id', $category_id);
- }
- }
- if (!$this->curItem->CategoryPath) {
- $category_id = $backup_category_id;
- }
-
- return $category_id;
- }
-
- /**
- * Enter description here...
- *
- * @param kEvent $event
- */
- function processCurrentItem(&$event, $record_data)
- {
- $save_method = 'Create';
- $load_keys = Array();
-
- // create/update categories
- $backup_category_id = $this->Application->GetVar('m_cat_id');
-
- // perform replace duplicates code
- if ($this->exportOptions['ReplaceDuplicates']) {
- // get replace keys first, then reset current item to empty one
- $category_id = $this->getItemCategory();
- if ($this->exportOptions['CheckDuplicatesMethod'] == 1) {
- if ($this->curItem->GetID()) {
- $load_keys = Array($this->curItem->IDField => $this->curItem->GetID());
- }
- }
- else {
- $key_fields = $this->exportOptions['DuplicateCheckFields'];
- foreach ($key_fields as $key_field) {
- $load_keys[$key_field] = $this->curItem->GetDBField($key_field);
- }
- }
-
- $this->resetImportObject($event, IMPORT_LIVE);
-
- if (count($load_keys)) {
- $where_clause = '';
- foreach ($load_keys as $field_name => $field_value) {
- if (preg_match('/^cust_(.*)/', $field_name, $regs)) {
- $custom_id = array_search($regs[1], $this->customFields);
- $field_name = 'l'.$this->Application->GetVar('m_lang').'_cust_'.$custom_id;
- $where_clause .= '(custom_data.`'.$field_name.'` = '.$this->Conn->qstr($field_value).') AND ';
- }
- else {
- $where_clause .= '(item_table.`'.$field_name.'` = '.$this->Conn->qstr($field_value).') AND ';
- }
-
- }
- $where_clause = preg_replace('/(.*) AND $/', '\\1', $where_clause);
-
- $item_id = $this->getFromCache('new_ids', crc32($where_clause));
- if (!$item_id) {
- if ($this->exportOptions['CheckDuplicatesMethod'] == 2) {
- // by other fields
- $parent_path = $this->getParentPath($category_id);
- $where_clause = '(c.ParentPath LIKE "'.$parent_path.'%") AND '.$where_clause;
- }
-
- $cdata_table = $this->Application->getUnitOption($event->Prefix.'-cdata', 'TableName');
- $sql = 'SELECT '.$this->curItem->IDField.'
- FROM '.$this->curItem->TableName.' item_table
- LEFT JOIN '.$cdata_table.' custom_data ON custom_data.ResourceId = item_table.ResourceId
- LEFT JOIN '.TABLE_PREFIX.'CategoryItems ci ON ci.ItemResourceId = item_table.ResourceId
- LEFT JOIN '.TABLE_PREFIX.'Category c ON c.CategoryId = ci.CategoryId
- WHERE '.$where_clause;
- $item_id = $this->Conn->GetOne($sql);
- }
- $save_method = $item_id && $this->curItem->Load($item_id) ? 'Update' : 'Create';
- if ($save_method == 'Update') {
- // replace id from csv file with found id (only when ID is found in cvs file)
- if (in_array($this->curItem->IDField, $this->exportFields)) {
- $record_data[ array_search($this->curItem->IDField, $this->exportFields) ] = $item_id;
- }
- }
- }
-
- $this->setImportData($record_data);
- }
- else {
- $this->resetImportObject($event, IMPORT_LIVE, $record_data);
- $category_id = $this->getItemCategory();
- }
-
- // create main record
- if ($save_method == 'Create') {
- $this->fillRequiredFields($this->false, $this->curItem, true);
- }
-
-// $sql_start = getmicrotime();
- if (!$this->curItem->$save_method()) {
- $this->Application->SetVar('m_cat_id', $backup_category_id);
- return false;
- }
-// $sql_end = getmicrotime();
-// $this->saveLog('SQL ['.$save_method.'] Time: '.($sql_end - $sql_start).'s');
-
- if ($load_keys && ($save_method == 'Create') && $this->exportOptions['ReplaceDuplicates']) {
- // map new id to old id
- $this->addToCache('new_ids', crc32($where_clause), $this->curItem->GetID() );
- }
-
- // assign item to categories
- $this->curItem->assignToCategory($category_id, false);
-
- $this->Application->SetVar('m_cat_id', $backup_category_id);
- return true;
- }
-
- /*function saveLog($msg)
- {
- static $first_time = true;
-
- $fp = fopen(FULL_PATH.'/sqls.log', $first_time ? 'w' : 'a');
- fwrite($fp, $msg."\n");
- fclose($fp);
-
- $first_time = false;
- }*/
-
- /**
- * Returns category parent path, if possible, then from cache
- *
- * @param int $category_id
- * @return string
- */
- function getParentPath($category_id)
- {
- $parent_path = $this->getFromCache('category_parent_path', $category_id);
- if ($parent_path === false) {
- $sql = 'SELECT ParentPath
- FROM '.TABLE_PREFIX.'Category
- WHERE CategoryId = '.$category_id;
- $parent_path = $this->Conn->GetOne($sql);
- $this->addToCache('category_parent_path', $category_id, $parent_path);
- }
- return $parent_path;
- }
-
- function getFileExtension()
- {
- return $this->exportOptions['ExportFormat'] == 1 ? 'csv' : 'xml';
- }
-
- function getLineSeparator($option = 'LineEndings')
- {
- return $this->exportOptions[$option] == 1 ? "\r\n" : "\n";
- }
-
- /**
- * Returns field caption for any exported field
- *
- * @param string $field
- * @return string
- */
- function getFieldCaption($field)
- {
- if (substr($field, 0, 10) == '__CUSTOM__')
- {
- $ret = 'Custom_'.substr($field, 10, strlen($field) );
- }
- elseif (substr($field, 0, 12) == '__CATEGORY__')
- {
- return $this->getCategoryTitle();
- }
- elseif (substr($field, 0, 11) == '__VIRTUAL__') {
- $ret = substr($field, 11);
- }
- else
- {
- $ret = $field;
- }
-
- return Array($ret);
- }
-
- /**
- * Returns requested field value (including custom fields and category fields)
- *
- * @param string $field
- * @return string
- */
- function getFieldValue($field)
- {
- if (substr($field, 0, 10) == '__CUSTOM__') {
- $field = 'cust_'.substr($field, 10, strlen($field));
- $ret = $this->curItem->GetField($field);
- }
- elseif (substr($field, 0, 12) == '__CATEGORY__') {
- return $this->getCategoryPath();
- }
- elseif (substr($field, 0, 11) == '__VIRTUAL__') {
- $field = substr($field, 11);
- $ret = $this->curItem->GetField($field);
- }
- else
- {
- $ret = $this->curItem->GetField($field);
- }
-
- $ret = str_replace("\r\n", $this->getLineSeparator('LineEndingsInside'), $ret);
- return Array($ret);
- }
-
- /**
- * Returns category field(-s) caption based on export mode
- *
- * @return string
- */
- function getCategoryTitle()
- {
- // category path in separated fields
- $category_count = $this->getMaxCategoryLevel();
- if ($this->exportOptions['CategoryFormat'] == 1)
- {
- // category path in one field
- return $category_count ? Array('CategoryPath') : Array();
- }
- else
- {
- $i = 0;
- $ret = Array();
- while ($i < $category_count) {
- $ret[] = 'Category'.($i + 1);
- $i++;
- }
- return $ret;
- }
- }
-
- /**
- * Returns category path in required format for current link
- *
- * @return string
- */
- function getCategoryPath()
- {
- $category_id = $this->curItem->GetDBField('CategoryId');
- $category_path = $this->getFromCache('category_path', $category_id);
- if (!$category_path)
- {
- $ml_formatter =& $this->Application->recallObject('kMultiLanguage');
- $sql = 'SELECT '.$ml_formatter->LangFieldName('CachedNavbar').'
- FROM '.TABLE_PREFIX.'Category
- WHERE CategoryId = '.$category_id;
- $category_path = $this->Conn->GetOne($sql);
-
- $category_path = $category_path ? explode('&|&', $category_path) : Array();
- if ($category_path && strtolower($category_path[0]) == 'content') {
- array_shift($category_path);
- }
-
- if ($this->exportOptions['IsBaseCategory']) {
- $i = $this->exportOptions['BaseLevel'];
- while ($i > 0) {
- array_shift($category_path);
- $i--;
- }
- }
-
- $category_count = $this->getMaxCategoryLevel();
- if ($this->exportOptions['CategoryFormat'] == 1) {
- // category path in single field
- $category_path = $category_count ? Array( implode($this->exportOptions['CategorySeparator'], $category_path) ) : Array();
- }
- else {
- // category path in separated fields
- $levels_used = count($category_path);
- if ($levels_used < $category_count)
- {
- $i = 0;
- while ($i < $category_count - $levels_used) {
- $category_path[] = '';
- $i++;
- }
- }
- }
- $this->addToCache('category_path', $category_id, $category_path);
- }
-
- return $category_path;
- }
-
- /**
- * Get maximal category deep level from links beeing exported
- *
- * @return int
- */
- function getMaxCategoryLevel()
- {
- static $max_level = -1;
-
- if ($max_level != -1)
- {
- return $max_level;
- }
-
- $sql = 'SELECT IF(c.CategoryId IS NULL, 0, MAX( LENGTH(c.ParentPath) - LENGTH( REPLACE(c.ParentPath, "|", "") ) - 1 ))
- FROM '.$this->curItem->TableName.' item_table
- LEFT JOIN '.TABLE_PREFIX.'CategoryItems ci ON item_table.ResourceId = ci.ItemResourceId
- LEFT JOIN '.TABLE_PREFIX.'Category c ON c.CategoryId = ci.CategoryId
- WHERE (ci.PrimaryCat = 1) AND ';
-
- $where_clause = '';
- if ($this->exportOptions['export_ids'] === false) {
- // get links from current category & all it's subcategories
- if ($this->exportOptions['export_cats_ids'][0] == 0) {
- $where_clause = 1;
- }
- else {
- foreach ($this->exportOptions['export_cats_ids'] as $category_id) {
- $where_clause .= '(c.ParentPath LIKE "%|'.$category_id.'|%") OR ';
- }
- $where_clause = preg_replace('/(.*) OR $/', '\\1', $where_clause);
- }
- }
- else {
- // get only selected links
- $where_clause = $this->curItem->IDField.' IN ('.implode(',', $this->exportOptions['export_ids']).')';
- }
-
- $max_level = $this->Conn->GetOne($sql.'('.$where_clause.')');
-
- if ($this->exportOptions['IsBaseCategory'] ) {
- $max_level -= $this->exportOptions['BaseLevel'];
- }
-
- return $max_level;
- }
-
- /**
- * Saves one record to export file
- *
- * @param Array $fields_hash
- */
- function writeRecord($fields_hash)
- {
- fputcsv2($this->filePointer, $fields_hash, $this->exportOptions['FieldsSeparatedBy'], $this->exportOptions['FieldsEnclosedBy'], $this->getLineSeparator() );
- }
-
- function readRecord()
- {
- return fgetcsv($this->filePointer, 10000, $this->exportOptions['FieldsSeparatedBy'], $this->exportOptions['FieldsEnclosedBy']);
- }
-
- function saveOptions(&$event, $options = null)
- {
- if (!isset($options)) {
- $options = $this->exportOptions;
- }
- $this->Application->StoreVar($event->getPrefixSpecial().'_options', serialize($options) );
- }
-
- function loadOptions(&$event)
- {
- return unserialize($this->Application->RecallVar($event->getPrefixSpecial().'_options'));
- }
-
- /**
- * Sets correct available & export fields
- *
- * @param kEvent $event
- */
- function prepareExportColumns(&$event)
- {
- $object =& $event->getObject( Array('skip_autoload' => true) );
-
- if (!array_key_exists('ExportColumns', $object->Fields)) {
- // import/export prefix was used (see kDBEventHandler::prepareObject) but object don't plan to be imported/exported
- return ;
- }
-
- $available_columns = Array();
-
- if ($this->Application->getUnitOption($event->Prefix, 'CatalogItem')) {
- // category field (mixed)
- $available_columns['__CATEGORY__CategoryPath'] = 'CategoryPath';
-
- if ($event->Special == 'import') {
- // category field (separated fields)
- $max_level = $this->Application->ConfigValue('MaxImportCategoryLevels');
- $i = 0;
- while ($i < $max_level) {
- $available_columns['__CATEGORY__Category'.($i + 1)] = 'Category'.($i + 1);
- $i++;
- }
- }
- }
-
- // db fields
- foreach ($object->Fields as $field_name => $field_options)
- {
- if (!$object->skipField($field_name))
- {
- $available_columns[$field_name] = $field_name.(getArrayValue($field_options, 'required') ? '*' : '');
- }
- }
-
- $handler =& $this->Application->recallObject($event->Prefix.'_EventHandler');
- $available_columns = array_merge_recursive2($available_columns, $handler->getCustomExportColumns($event));
-
- // custom fields
- foreach ($object->customFields as $custom_id => $custom_name)
- {
- $available_columns['__CUSTOM__'.$custom_name] = $custom_name;
- }
-
- // columns already in use
- $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
- if ($items_info)
- {
- list($item_id, $field_values) = each($items_info);
- $export_keys = $field_values['ExportColumns'];
- $export_keys = $export_keys ? explode('|', substr($export_keys, 1, -1) ) : Array();
- }
- else {
- $export_keys = Array();
- }
-
- $export_columns = Array();
- foreach ($export_keys as $field_key)
- {
- $field_name = $this->getExportField($field_key);
- $export_columns[$field_key] = $field_name;
- unset($available_columns[$field_key]);
- }
-
- $options = $object->GetFieldOptions('ExportColumns');
- $options['options'] = $export_columns;
- $object->SetFieldOptions('ExportColumns', $options);
-
- $options = $object->GetFieldOptions('AvailableColumns');
- $options['options'] = $available_columns;
- $object->SetFieldOptions('AvailableColumns', $options);
-
- $this->updateImportFiles($event);
- $this->PrepareExportPresets($event);
- }
-
- function PrepareExportPresets(&$event)
- {
- $object =& $event->getObject( Array('skip_autoload' => true) );
- $options = $object->GetFieldOptions('ExportPresets');
-
- $export_settings = $this->Application->RecallPersistentVar('export_settings');
- if (!$export_settings) return ;
- $export_settings = unserialize($export_settings);
-
- if (!isset($export_settings[$event->Prefix])) return ;
-
-
- $export_presets = array(''=>'');
- foreach ($export_settings[$event->Prefix] as $key => $val) {
- $export_presets[implode('|', $val['ExportColumns'])] = $key;
- }
-
- $options['options'] = $export_presets;
- $object->SetFieldOptions('ExportPresets', $options);
- }
-
- function getExportField($field_key)
- {
- $prepends = Array('__CUSTOM__', '__CATEGORY__');
- foreach ($prepends as $prepend)
- {
- if (substr($field_key, 0, strlen($prepend) ) == $prepend)
- {
- $field_key = substr($field_key, strlen($prepend), strlen($field_key) );
- break;
- }
- }
- return $field_key;
- }
-
- /**
- * Updates uploaded files list
- *
- * @param kEvent $event
- */
- function updateImportFiles(&$event)
- {
- if ($event->Special != 'import') {
- return false;
- }
-
- $object =& $event->getObject();
-
- $import_filenames = Array();
-
- if ($folder_handle = opendir(EXPORT_PATH)) {
- while (false !== ($file = readdir($folder_handle))) {
- if (is_dir(EXPORT_PATH.'/'.$file) || substr($file, 0, 1) == '.' || strtolower($file) == 'cvs' || strtolower($file) == 'dummy' || filesize(EXPORT_PATH.'/'.$file) == 0) continue;
-
- $file_size = formatSize( filesize(EXPORT_PATH.'/'.$file) );
- $import_filenames[$file] = $file.' ('.$file_size.')';
- }
- closedir($folder_handle);
- }
-
- $options = $object->GetFieldOptions('ImportLocalFilename');
- $options['options'] = $import_filenames;
- $object->SetFieldOptions('ImportLocalFilename', $options);
- }
-
- /**
- * Returns module folder
- *
- * @param kEvent $event
- * @return string
- */
- function getModuleFolder(&$event)
- {
- return $this->Application->getUnitOption($event->Prefix, 'ModuleFolder');
- }
-
- /**
- * Export form validation & processing
- *
- * @param kEvent $event
- */
- function OnExportBegin(&$event)
- {
- $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
- if (!$items_info)
- {
- $items_info = unserialize( $this->Application->RecallVar($event->getPrefixSpecial().'_ItemsInfo') );
- $this->Application->SetVar($event->getPrefixSpecial(true), $items_info);
- }
-
- list($item_id, $field_values) = each($items_info);
-
- $object =& $event->getObject( Array('skip_autoload' => true) );
- $object->SetFieldsFromHash($field_values);
- $field_values['ImportFilename'] = $object->GetDBField('ImportFilename'); //if upload formatter has renamed the file during moving !!!
-
- $object->setID($item_id);
- $this->setRequiredFields($event);
-
- $export_object =& $this->Application->recallObject('CatItemExportHelper');
-
- // save export/import options
- if ($event->Special == 'export')
- {
- $export_ids = $this->Application->RecallVar($event->Prefix.'_export_ids');
- $export_cats_ids = $this->Application->RecallVar($event->Prefix.'_export_cats_ids');
-
- // used for multistep export
- $field_values['export_ids'] = $export_ids ? explode(',', $export_ids) : false;
- $field_values['export_cats_ids'] = $export_cats_ids ? explode(',', $export_cats_ids) : Array( $this->Application->GetVar('m_cat_id') );
- }
-
- $field_values['ExportColumns'] = $field_values['ExportColumns'] ? explode('|', substr($field_values['ExportColumns'], 1, -1) ) : Array();
- $field_values['start_from'] = 0;
-
- $this->Application->HandleEvent($nevent, $event->Prefix.':OnBeforeExportBegin', array('options'=>$field_values));
- $field_values = $nevent->getEventParam('options');
-
- $export_object->saveOptions($event, $field_values);
-
- if( $export_object->verifyOptions($event) )
- {
- if ($this->_getExportSavePreset($object)) {
- $name = $object->GetDBField('ExportPresetName');
-
- $export_settings = $this->Application->RecallPersistentVar('export_settings');
- $export_settings = $export_settings ? unserialize($export_settings) : array();
- $export_settings[$event->Prefix][$name] = $field_values;
- $this->Application->StorePersistentVar('export_settings', serialize($export_settings));
- }
-
- $progress_t = $this->Application->RecallVar('export_progress_t');
- if ($progress_t) {
- $this->Application->RemoveVar('export_progress_t');
- }
- else {
- $progress_t = $export_object->getModuleFolder($event).'/'.$event->Special.'_progress';
- }
- $event->redirect = $progress_t;
-
- if ($event->Special == 'import') {
- $import_category = (int)$this->Application->RecallVar('ImportCategory');
-
- // in future could use module root category if import category will be unavailable :)
- $event->SetRedirectParam('m_cat_id', $import_category); // for template permission checking
- $this->Application->StoreVar('m_cat_id', $import_category); // for event permission checking
- }
- }
- else
- {
- // make uploaded file local & change source selection
- $filename = getArrayValue($field_values, 'ImportFilename');
- if ($filename) {
- $export_object->updateImportFiles($event);
- $object->SetDBField('ImportSource', 2);
- $field_values['ImportSource'] = 2;
- $object->SetDBField('ImportLocalFilename', $filename);
- $field_values['ImportLocalFilename'] = $filename;
- $export_object->saveOptions($event, $field_values);
- }
-
- $event->status = erFAIL;
- $event->redirect = false;
- }
- }
-
- /**
- * Returns export save preset name, when used at all
- *
- * @param kDBItem $object
- * @return string
- */
- function _getExportSavePreset(&$object)
- {
- if (!array_key_exists('ExportSavePreset', $object->Fields)) {
- return '';
- }
-
- return $object->GetDBField('ExportSavePreset');
- }
-
- /**
- * set required fields based on import or export params
- *
- * @param kEvent $event
- */
- function setRequiredFields(&$event)
- {
- $required_fields['common'] = Array('FieldsSeparatedBy', 'LineEndings', 'CategoryFormat');
-
- $required_fields['export'] = Array('ExportFormat', 'ExportFilename','ExportColumns');
-
- $object =& $event->getObject();
- if ($this->_getExportSavePreset($object)) {
- $required_fields['export'][] = 'ExportPresetName';
- }
-
- $required_fields['import'] = Array('FieldTitles', 'ImportSource', 'CheckDuplicatesMethod'); // ImportFilename, ImportLocalFilename
-
- if ($event->Special == 'import')
- {
- $import_source = Array(1 => 'ImportFilename', 2 => 'ImportLocalFilename');
- $used_field = $import_source[ $object->GetDBField('ImportSource') ];
-
- $required_fields[$event->Special][] = $used_field;
- $object->Fields[$used_field]['error_field'] = 'ImportSource';
-
- if ($object->GetDBField('FieldTitles') == 2) $required_fields[$event->Special][] = 'ExportColumns'; // manual field titles
- }
-
- $required_fields = array_merge($required_fields['common'], $required_fields[$event->Special]);
- foreach ($required_fields as $required_field) {
- $object->setRequired($required_field, true);
- }
- }
-
- }
-
-?>
Index: branches/5.1.x/core/admin_templates/img/itemicons/icon16_image_disabled.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/js/catalog.js
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/admin_templates/js/catalog.js (.../catalog.js) (revision 12127)
+++ branches/5.1.x/core/admin_templates/js/catalog.js (.../catalog.js) (revision 12657)
@@ -24,12 +24,22 @@
this.searchInfo = {}; // information about search (for each tab)
}
-Catalog.prototype.Init = function () {
+Catalog.prototype.Init = function ($auto_hide_tabs) {
var $prefix = this.queryTabRegistry('prefix', this.ActivePrefix, 'prefix');
if ($prefix !== this.ActivePrefix && this.TabRegistry.length > 0) {
// ActivePrefix not set or has non-existing prefix value
this.ActivePrefix = this.TabRegistry[0]['prefix'];
}
+
+ if ($auto_hide_tabs === undefined) {
+ $auto_hide_tabs = true;
+ }
+
+ if ((this.TabRegistry.length == 1) && $auto_hide_tabs) {
+ // only one tab -> hide all tab bar
+ $('div.tab-viewport').parents('table:first').hide();
+ }
+
this.SetAlternativeTabs();
this.AfterInit();
}
@@ -368,14 +378,28 @@
}
Catalog.prototype.displaySearch = function ($prefix) {
- var $search_input = document.getElementById('search_keyword')
+ var $search_input = $('#search_keyword');
- $search_input.setAttribute('PrefixSpecial', $prefix);
+ $search_input.attr('PrefixSpecial', $prefix);
if (this.searchInfo[$prefix]) {
- $search_input.value = this.searchInfo[$prefix].keyword;
- $search_input.setAttribute('Grid', this.searchInfo[$prefix].grid);
+ $search_input
+ .val(this.searchInfo[$prefix].keyword)
+ .attr('Grid', this.searchInfo[$prefix].grid);
+
+ if (this.searchInfo[$prefix].keyword) {
+ // catalog tab found and keyword present
+ $search_input.addClass('filter-active');
+ }
+ else {
+ // catalog tab found and keyword missing
+ $search_input.removeClass('filter-active');
+ }
}
+ else {
+ // catalog tab not found
+ $search_input.removeClass('filter-active');
+ }
}
Catalog.prototype.setCurrentCategory = function($prefix, $category_id) {
Index: branches/5.1.x/core/admin_templates/img/icons/icon46_server_info.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/icons/icon46_banlist.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/units/general/libchart/classes/view/color/ColorSet.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/units/general/libchart/classes/view/color/ColorSet.php (.../ColorSet.php) (revision 12127)
+++ branches/5.1.x/core/units/general/libchart/classes/view/color/ColorSet.php (.../ColorSet.php) (revision 12657)
@@ -17,6 +17,8 @@
*
*/
+ defined('FULL_PATH') or die('restricted access!');
+
/**
* A set of colors, used for drawing series of data.
*
@@ -79,5 +81,4 @@
public function currentShadowColor() {
return current($this->shadowColorList);
}
- }
-?>
\ No newline at end of file
+ }
\ No newline at end of file
Index: branches/5.1.x/core/units/captcha/captcha_eh.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/units/captcha/captcha_eh.php (.../captcha_eh.php) (revision 12127)
+++ branches/5.1.x/core/units/captcha/captcha_eh.php (.../captcha_eh.php) (revision 12657)
@@ -1,6 +1,6 @@
Application->recallObject('CaptchaHelper');
/* @var $captcha_helper kCaptchaHelper */
- // generate captcha code
- $captcha_helper->prepareCode($event->MasterEvent);
-
// create field for captcha code storage
$virtual_fields = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'VirtualFields');
$virtual_fields['Captcha'] = Array ('type' => 'string', 'default' => '');
Index: branches/5.1.x/core/units/dummy
===================================================================
diff -u -N
--- branches/5.1.x/core/units/dummy (revision 12127)
+++ branches/5.1.x/core/units/dummy (revision 0)
@@ -1 +0,0 @@
-dummy
\ No newline at end of file
Index: branches/5.1.x/core/admin_templates/img/icons/icon46_list_conf_regional.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/submissions/submission_view.tpl
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/admin_templates/submissions/submission_view.tpl (.../submission_view.tpl) (revision 12127)
+++ branches/5.1.x/core/admin_templates/submissions/submission_view.tpl (.../submission_view.tpl) (revision 12657)
@@ -1,6 +1,8 @@
-
+
+
+
+
+
\ No newline at end of file
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_update_rates.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_view_item_f3.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_affiliate_payment_type_f2.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/units/email_events/email_events_config.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/units/email_events/email_events_config.php (.../email_events_config.php) (revision 12127)
+++ branches/5.1.x/core/units/email_events/email_events_config.php (.../email_events_config.php) (revision 12657)
@@ -1,6 +1,6 @@
'emailevents',
- 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
- 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
- 'EventHandlerClass' => Array('class'=>'EmailEventsEventsHandler','file'=>'email_events_event_handler.php','build_event'=>'OnBuild'),
- 'TagProcessorClass' => Array('class'=>'kDBTagProcessor','file'=>'','build_event'=>'OnBuild'),
- 'AutoLoad' => true,
+defined('FULL_PATH') or die('restricted access!');
- 'QueryString' => Array(
- 1 => 'id',
- 2 => 'page',
- 3 => 'event',
- ),
+ $config = Array (
+ 'Prefix' => 'emailevents',
+ 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array ('class' => 'EmailEventsEventsHandler', 'file' => 'email_events_event_handler.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
- 'IDField' => 'EventId',
+ 'AutoLoad' => true,
- 'StatusField' => Array('Enabled'),
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
- 'TitleField' => 'Event',
+ 'IDField' => 'EventId',
+ 'StatusField' => Array ('Enabled'),
+ 'TitleField' => 'Event',
- 'TitlePresets' => Array(
- 'email_settings_list' => Array('prefixes' => Array('emailevents.module_List'), 'format' => '!la_title_EmailSettings!'),
+ 'TitlePresets' => Array (
+ 'default' => Array (
+ 'edit_status_labels' => Array ('emailevents' => '!la_title_EditingEmailEvent!'),
+ ),
- 'email_send_form' => Array('prefixes' => Array(), 'format' => '!la_title_SendEmail!'),
- 'email_prepare' => Array('prefixes' => Array(), 'format' => '!la_title_PreparingEmailsForSending!. !la_title_PleaseWait!'),
- 'email_send' => Array('prefixes' => Array(), 'format' => '!la_title_SendingPreparedEmails!. !la_title_PleaseWait!'),
- 'email_send_complete' => Array('prefixes' => Array(), 'format' => '!la_title_SendMailComplete!'),
- ),
+ 'email_settings_list' => Array ('prefixes' => Array ('emailevents.module_List'), 'format' => '!la_title_EmailSettings!'),
- 'PermSection' => Array('main' => 'in-portal:configure_lang'),
+ 'email_settings_edit' => Array (
+ 'prefixes' => Array ('emailevents'), 'format' => "#emailevents_status# '#emailevents_titlefield#'",
+ 'toolbar_buttons' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
+ ),
- 'FilterMenu' => Array(
- 'Groups' => Array(
- Array('mode' => 'AND', 'filters' => Array('show_enabled','show_disabled','show_frontonly'), 'type' => WHERE_FILTER),
- ),
- 'Filters' => Array(
- 'show_enabled' => Array('label' =>'la_Enabled', 'on_sql' => '', 'off_sql' => '%1$s.Enabled != 1' ),
- 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Enabled != 0' ),
- 'show_frontonly' => Array('label' => 'la_Text_FrontOnly', 'on_sql' => '', 'off_sql' => '%1$s.Enabled != 2' ),
- )
- ),
+ 'email_send_form' => Array ('prefixes' => Array (), 'format' => '!la_title_SendEmail!'),
+ 'email_prepare' => Array ('prefixes' => Array (), 'format' => '!la_title_PreparingEmailsForSending!. !la_title_PleaseWait!'),
+ 'email_send' => Array ('prefixes' => Array (), 'format' => '!la_title_SendingPreparedEmails!. !la_title_PleaseWait!'),
+ 'email_send_complete' => Array ('prefixes' => Array (), 'format' => '!la_title_SendMailComplete!'),
+ ),
- 'TableName' => TABLE_PREFIX.'Events',
+ 'PermSection' => Array ('main' => 'in-portal:configure_lang'),
- 'CalculatedFields' => Array(
- '' => Array (
- 'FromUser' => 'u.Login',
- )
- ),
+ 'FilterMenu' => Array (
+ 'Groups' => Array (
+ Array ('mode' => 'AND', 'filters' => Array ('show_enabled', 'show_disabled', 'show_frontonly'), 'type' => WHERE_FILTER),
+ ),
- 'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s
- FROM %1$s
- LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.FromUserId = u.PortalUserId',
- ), // key - special, value - list select sql),
+ 'Filters' => Array (
+ 'show_enabled' => Array ('label' =>'la_Enabled', 'on_sql' => '', 'off_sql' => '%1$s.Enabled != 1' ),
+ 'show_disabled' => Array ('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Enabled != 0' ),
+ 'show_frontonly' => Array ('label' => 'la_Text_FrontOnly', 'on_sql' => '', 'off_sql' => '%1$s.Enabled != 2' ),
+ )
+ ),
- 'ItemSQLs' => Array( ''=>'SELECT * FROM %s'),
+ 'TableName' => TABLE_PREFIX . 'Events',
- 'ListSortings' => Array(
- '' => Array('Sorting' => Array('Module' => 'asc', 'Description' => 'asc') ),
+ 'CalculatedFields' => Array (
+ '' => Array (
+ 'FromUser' => 'u.Login',
+ )
+ ),
- 'module' => Array('Sorting' => Array('Description' => 'asc') ),
- ),
+ 'ListSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN ' . TABLE_PREFIX . 'PortalUser u ON %1$s.FromUserId = u.PortalUserId',
+ ),
- 'Fields' => Array(
- 'EventId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
- 'Event' => Array('type' => 'string','not_null' => '1','default' => ''),
- 'ReplacementTags' => Array ('type' => 'string', 'default' => NULL),
- 'Enabled' => Array('type'=>'int', 'formatter'=>'kOptionsFormatter', 'options' => Array(1 => 'la_Enabled', 0 => 'la_Disabled', 2 => 'la_Text_FrontOnly'), 'use_phrases' => 1, 'default' => 1, 'not_null' => 1),
- 'FromUserId' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(-1=>'root'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'required'=>1, 'not_null' => 1, 'default' => -1),
- 'Module' => Array('type' => 'string','not_null' => '1','default' => ''),
- 'Description' => Array('type' => 'string','not_null' => '1','default' => ''),
- 'Type' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'options' => Array (1 => 'la_Text_Admin', 0 => 'la_Text_User'), 'use_phrases' => 1, 'default' => 0, 'not_null' => 1),
- ),
- 'VirtualFields' => Array(
- 'FromUser' => Array(),
- ),
+ 'ListSortings' => Array (
+ '' => Array ('Sorting' => Array ('Module' => 'asc', 'Description' => 'asc')),
+ 'module' => Array ('Sorting' => Array ('Description' => 'asc') ),
+ ),
- 'Grids' => Array(
- 'Default' => Array (
- 'Icons' => Array('default'=>'icon16_custom.gif'),
- 'Fields' => Array(
- 'EventId' => Array('title' => 'la_col_Id', 'filter_block' => 'grid_range_filter'),
- 'Description' => Array( 'title'=>'la_col_Description', 'data_block' => 'label_grid_checkbox_td', 'filter_block' => 'grid_like_filter'),
- 'Event' => Array( 'title'=>'la_col_Event', 'filter_block' => 'grid_like_filter'),
- 'Module' => Array( 'title'=>'la_col_Module', 'filter_block' => 'grid_like_filter'),
- 'Type' => Array( 'title'=>'la_col_Type', 'filter_block' => 'grid_options_filter'),
- 'Enabled' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter'),
- ),
- ),
+ 'Fields' => Array (
+ 'EventId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Event' => Array ('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''),
+ 'ReplacementTags' => Array ('type' => 'string', 'default' => NULL),
- 'EmailSettings' => Array (
- 'Icons' => Array('default'=>'icon16_custom.gif'),
- 'Fields' => Array(
- 'EventId' => Array('title' => 'la_col_Id', 'filter_block' => 'grid_range_filter'),
- 'Description' => Array('title'=>'la_col_Description', 'data_block' => 'label_grid_checkbox_td' ),
- 'Type' => Array('title'=>'la_col_Type', 'filter_block' => 'grid_options_filter'),
- 'Enabled' => Array('title'=>'la_col_Status', 'filter_block' => 'grid_options_filter'),
- 'FromUser' => Array('title'=>'la_col_FromToUser', 'filter_block' => 'grid_like_filter'),
- ),
- ),
- ),
+ 'Enabled' => Array (
+ 'type' => 'int',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1,
+ 'not_null' => 1, 'default' => 1
+ ),
+
+ 'FrontEndOnly' => Array (
+ 'type' => 'int',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1,
+ 'not_null' => 1, 'default' => 0
+ ),
+
+ 'FromUserId' => Array (
+ 'type' => 'int',
+ 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (-1 => 'root'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login',
+ 'default' => NULL
+ ),
+
+ 'Module' => Array ('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''),
+ 'Description' => Array ('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''),
+ 'Type' => Array (
+ 'type' => 'int',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Text_Admin', 0 => 'la_Text_User'), 'use_phrases' => 1,
+ 'not_null' => 1, 'required' => 1, 'default' => 0
+ ),
+ ),
+
+ 'VirtualFields' => Array (
+ 'FromUser' => Array ('type' => 'string', 'default' => ''),
+ ),
+
+ 'Grids' => Array (
+ 'Default' => Array (
+ 'Icons' => Array (
+ 'default' => 'icon16_item.png',
+ 0 => 'icon16_disabled.png',
+ 1 => 'icon16_item.png',
+ ),
+ 'Fields' => Array (
+ 'EventId' => Array ('title' => 'la_col_Id', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
+ 'Description' => Array ( 'title' => 'la_col_Description', 'data_block' => 'label_grid_checkbox_td', 'filter_block' => 'grid_like_filter', 'width' => 250, ),
+ 'Event' => Array ( 'title' => 'la_col_Event', 'filter_block' => 'grid_like_filter', 'width' => 250, ),
+ 'Module' => Array ( 'title' => 'la_col_Module', 'filter_block' => 'grid_like_filter', 'width' => 100, ),
+ 'Type' => Array ( 'title' => 'la_col_Type', 'filter_block' => 'grid_options_filter', 'width' => 120, ),
+ 'Enabled' => Array ( 'title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 80, ),
+ ),
+ ),
+
+ 'EmailSettings' => Array (
+ 'Icons' => Array (
+ 'default' => 'icon16_item.png',
+ 0 => 'icon16_disabled.png',
+ 1 => 'icon16_item.png',
+ ),
+ 'Fields' => Array (
+ 'EventId' => Array ('title' => 'la_col_Id', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
+ 'Description' => Array ('title' => 'la_col_EventDescription', 'data_block' => 'label_grid_checkbox_td', 'width' => 250, ),
+ 'FromUser' => Array ('title' => 'la_col_FromToUser', 'data_block' => 'from_user_td', 'filter_block' => 'grid_like_filter', 'width' => 150, ),
+ 'Type' => Array ('title' => 'la_col_RecipientType', 'filter_block' => 'grid_options_filter', 'width' => 120, ),
+ 'FrontEndOnly' => Array ('title' => 'la_col_FrontEndOnly', 'filter_block' => 'grid_options_filter', 'width' => 120, ),
+ 'Enabled' => Array ('title' => 'la_col_Enabled', 'filter_block' => 'grid_options_filter', 'width' => 80, ),
+ ),
+ ),
+ ),
);
\ No newline at end of file
Index: branches/5.1.x/core/units/thesaurus/thesaurus_tp.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/units/thesaurus/thesaurus_tp.php (.../thesaurus_tp.php) (revision 12127)
+++ branches/5.1.x/core/units/thesaurus/thesaurus_tp.php (.../thesaurus_tp.php) (revision 12657)
@@ -1,6 +1,6 @@
Index: branches/5.1.x/core/admin_templates/img/icons/icon46_settings_general.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/kernel/db/cat_dbitem.php
===================================================================
diff -u -N -r12535 -r12657
--- branches/5.1.x/core/kernel/db/cat_dbitem.php (.../5.0.x/core/kernel/db/cat_dbitem.php) (revision 12535)
+++ branches/5.1.x/core/kernel/db/cat_dbitem.php (.../5.1.x/core/kernel/db/cat_dbitem.php) (revision 12657)
@@ -1,6 +1,6 @@
ValidateFileName($this->FullPath, $real_name, $files2delete);
$file_name = $this->FullPath.$real_name;
- $tmp_file = (defined('WRITEABLE') ? WRITEABLE.'/tmp/' : FULL_PATH.'/kernel/cache/').$swf_uploaded_ids[$i].'_'.$swf_uploaded_names[$i];
+ $tmp_file = WRITEABLE . '/tmp/' . $swf_uploaded_ids[$i].'_'.$swf_uploaded_names[$i];
rename($tmp_file, $file_name);
@chmod($file_name, 0666);
Index: branches/5.1.x/core/admin_templates/skins/skin_list.tpl
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/admin_templates/skins/skin_list.tpl (.../skin_list.tpl) (revision 12127)
+++ branches/5.1.x/core/admin_templates/skins/skin_list.tpl (.../skin_list.tpl) (revision 12657)
@@ -35,7 +35,7 @@
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
- a_toolbar.AddButton( new ToolBarButton('primary_theme', ' :: ', function() {
+ a_toolbar.AddButton( new ToolBarButton('setprimary', ' :: ', function() {
submit_event('skin','OnSetPrimary');
}
) );
@@ -66,7 +66,7 @@
\ No newline at end of file
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_primary_file_f3.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_image_f2.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/itemicons/icon16_image.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/js/script.js
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/admin_templates/js/script.js (.../script.js) (revision 12127)
+++ branches/5.1.x/core/admin_templates/js/script.js (.../script.js) (revision 12657)
@@ -23,8 +23,12 @@
replaceFireBug();
}
-function use_popups($prefix_special, $event) {
- return $use_popups;
+function use_popups($prefix_special, $event, $mode) {
+ if ($mode === undefined || $mode == 'popup') {
+ return $use_popups;
+ }
+
+ return $modal_windows;
}
function getArrayValue()
@@ -538,9 +542,37 @@
);
}
-function translate_phrase($label, $template) {
+function translate_phrase($label, $edit_template, $options) {
set_hidden_field('phrases_label', $label);
- open_popup('phrases', 'OnNew', $template);
+ var $event = $options.event === undefined ? 'OnNew' : $options.event;
+
+ if ($options.simple_mode !== undefined) {
+ Application.SetVar('simple_mode', $options.simple_mode ? 1 : 0);
+
+ if ($options.simple_mode) {
+ Application.SetVar('front', 1);
+ }
+ }
+ else {
+ Application.SetVar('front', null);
+ Application.SetVar('simple_mode', null);
+ Application.SetVar('phrases_label', null);
+ }
+
+ if (use_popups('phrases', $event)) {
+ open_popup('phrases', $event, $edit_template, null, function() {
+ Application.SetVar('front', null);
+ Application.SetVar('simple_mode', null);
+ });
+ }
+ else {
+ opener_action('d');
+ submit_event('phrases', $event, $edit_template);
+
+ Application.SetVar('front', null);
+ Application.SetVar('simple_mode', null);
+ Application.SetVar('phrases_label', null);
+ }
}
function direct_edit($prefix_special, $url) {
@@ -850,7 +882,7 @@
$window.top.document.title = (main_title.length ? main_title + ' - ' : '') + $title;
if ($modal_windows) {
- $window.TB.setWindowTitle($title);
+ $window.TB.setWindowTitle('');
}
}
Index: branches/5.1.x/core/kernel/db/cat_dblist.php
===================================================================
diff -u -N -r12343 -r12657
--- branches/5.1.x/core/kernel/db/cat_dblist.php (.../5.0.x/core/kernel/db/cat_dblist.php) (revision 12343)
+++ branches/5.1.x/core/kernel/db/cat_dblist.php (.../5.1.x/core/kernel/db/cat_dblist.php) (revision 12657)
@@ -1,6 +1,6 @@
" />
Index: branches/5.1.x/core/admin_templates/img/icons/icon24_tool_restore.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/icons/icon46_community.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_primary_paymenttype_f3.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/kernel/globals.php
===================================================================
diff -u -N -r12453 -r12657
--- branches/5.1.x/core/kernel/globals.php (.../globals.php) (revision 12453)
+++ branches/5.1.x/core/kernel/globals.php (.../globals.php) (revision 12657)
@@ -1,6 +1,6 @@
\ No newline at end of file
+ }
\ No newline at end of file
Index: branches/5.1.x/core/kernel/utility/unit_config_reader.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 12127)
+++ branches/5.1.x/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 12657)
@@ -1,6 +1,6 @@
_directorySeparator = preg_quote(DIRECTORY_SEPARATOR);
+ $this->_directorySeparator = preg_quote( DIRECTORY_SEPARATOR );
$this->_skipFolders[] = trim(WRITEBALE_BASE, '/'); // system folder (where web server can write)
- $this->_skipFolders[] = array_pop( explode('/', trim(EDITOR_PATH, '/')) ); // last of cmseditor folders
+
+ $editor_path = explode('/', trim(EDITOR_PATH, '/'));
+ $this->_skipFolders[] = array_pop($editor_path); // last of cmseditor folders
}
function CacheParsedData()
@@ -69,7 +73,8 @@
$config_vars = Array (
'SessionTimeout',
'SessionCookieName',
- 'SessionReferrerCheck',
+ 'SessionBrowserSignatureCheck',
+ 'SessionIPAddressCheck',
'CookieSessions',
'UseCronForRegularEvent',
'User_GuestGroup',
@@ -82,6 +87,7 @@
'Config_Server_Time',
'Config_Site_Time',
'UseChangeLog',
+ 'UseVisitorTracking',
);
foreach ($config_vars as $var) {
@@ -105,6 +111,7 @@
'Application.ConfigCacheIds' => $this->Application->ConfigCacheIds,
'Application.ConfigHash' => $this->Application->ConfigHash,
'Application.ReplacementTemplates' => $this->Application->ReplacementTemplates,
+ 'Application.RewriteListeners' => $this->Application->RewriteListeners,
'Application.ModuleInfo' => $this->Application->ModuleInfo,
);
@@ -153,6 +160,7 @@
$this->Application->ConfigCacheIds = $cache['Application.ConfigCacheIds'];
$this->Application->ReplacementTemplates = $cache['Application.ReplacementTemplates'];
+ $this->Application->RewriteListeners = $cache['Application.RewriteListeners'];
$this->Application->ModuleInfo = $cache['Application.ModuleInfo'];
@@ -216,6 +224,9 @@
$base_folder = FULL_PATH . $folderPath . DIRECTORY_SEPARATOR;
$sub_folders = glob($base_folder . '*', GLOB_ONLYDIR);
+ if (!$sub_folders) {
+ return ;
+ }
if ($level == 0) {
// don't scan Front-End themes because of extensive directory structure
@@ -234,8 +245,10 @@
continue;
}
- if (file_exists(FULL_PATH . $this->getConfigName($folderPath . DIRECTORY_SEPARATOR . $sub_folder))) {
- $this->configFiles[] = $this->getConfigName($folderPath . DIRECTORY_SEPARATOR . $sub_folder);
+ $config_name = $this->getConfigName($folderPath . DIRECTORY_SEPARATOR . $sub_folder);
+
+ if (file_exists(FULL_PATH . $config_name)) {
+ $this->configFiles[] = $config_name;
}
$this->findConfigFiles($full_path, $level + 1);
@@ -254,27 +267,22 @@
$conn =& $this->Application->GetADODBConnection();
if (!isset($this->Application->Memcached) || !($data = $this->Application->Memcached->get('master:config_files'))) {
- $data = $conn->GetOne('SELECT Data FROM '.TABLE_PREFIX.'Cache WHERE VarName = "config_files"');
+ $data = $conn->GetOne('SELECT Data FROM ' . TABLE_PREFIX . 'Cache WHERE VarName = "config_files"');
}
+
if ($cache && $data) {
$this->configFiles = unserialize($data);
shuffle($this->configFiles);
}
else {
- $old_kernel_path = FULL_PATH . DIRECTORY_SEPARATOR . 'kernel' . DIRECTORY_SEPARATOR . 'kernel4';
- if (file_exists($old_kernel_path)) {
- // when we got both kernel (one from "kernel/kernel4" and other from "core/kernel") version after upgrade
- die('Please remove "' . $old_kernel_path . '" folder.');
- }
-
$this->findConfigFiles($folderPath); // search from base directory
}
foreach ($this->configFiles as $filename)
{
$prefix = $this->PreloadConfigFile($filename);
if (!$prefix) {
- trigger_error('Prefix not defined in config file '.$filename, E_USER_ERROR);
+ trigger_error('Prefix not defined in config file ' . $filename, E_USER_ERROR);
}
}
}
@@ -333,12 +341,14 @@
if ($store_cache || (defined('IS_INSTALL') && IS_INSTALL)) {
// cache is not stored during install, but dynamic clones should be processed in any case
$this->processDynamicClones();
+ $this->retrieveCollections();
}
if ($store_cache) {
+ $this->_sortRewriteListeners();
$this->CacheParsedData();
- if ($this->Application->isDebugMode(false) && constOn('DBG_VALIDATE_CONFIGS')) {
+ if (defined('DEBUG_MODE') && DEBUG_MODE && defined('DBG_VALIDATE_CONFIGS') && DBG_VALIDATE_CONFIGS) {
// validate configs here to have changes from OnAfterConfigRead hooks to prefixes
foreach ($this->configData as $prefix => $config) {
if (!isset($config['TableName'])) continue;
@@ -352,6 +362,34 @@
}
/**
+ * Sort rewrite listeners according to RewritePriority (non-prioritized listeners goes first)
+ *
+ */
+ function _sortRewriteListeners()
+ {
+ $listeners = Array ();
+ $prioritized_listeners = Array ();
+
+ // process non-prioritized listeners
+ foreach ($this->Application->RewriteListeners as $prefix => $listener_data) {
+ if ($listener_data['priority'] === false) {
+ $listeners[$prefix] = $listener_data;
+ }
+ else {
+ $prioritized_listeners[$prefix] = $listener_data['priority'];
+ }
+ }
+
+ // process prioritized listeners
+ asort($prioritized_listeners);
+ foreach ($prioritized_listeners as $prefix => $priority) {
+ $listeners[$prefix] = $this->Application->RewriteListeners[$prefix];
+ }
+
+ $this->Application->RewriteListeners = $listeners;
+ }
+
+ /**
* Re-reads all configs
*
*/
@@ -376,6 +414,7 @@
$this->ParseConfigs();
$this->AfterConfigRead(false);
$this->processDynamicClones();
+ $this->retrieveCollections();
}
/**
@@ -405,6 +444,32 @@
}
/**
+ * Process all collectable unit config options here to also catch ones, defined from OnAfterConfigRead events
+ *
+ */
+ function retrieveCollections()
+ {
+ foreach ($this->configData as $prefix => $config) {
+ // collect replacement templates
+ if (array_key_exists('ReplacementTemplates', $config) && $config['ReplacementTemplates']) {
+ $this->Application->ReplacementTemplates = array_merge($this->Application->ReplacementTemplates, $config['ReplacementTemplates']);
+ }
+
+ // collect rewrite listeners
+ if (array_key_exists('RewriteListener', $config) && $config['RewriteListener']) {
+ $rewrite_listener = $config['RewriteListener'];
+ if (strpos($rewrite_listener, ':') === false) {
+ $rewrite_listener = $prefix . '_EventHandler:' . $rewrite_listener;
+ }
+
+ $rewrite_priority = array_key_exists('RewritePriority', $config) ? $config['RewritePriority'] : false;
+
+ $this->Application->RewriteListeners[$prefix] = Array ('listener' => $rewrite_listener, 'priority' => $rewrite_priority);
+ }
+ }
+ }
+
+ /**
* Register nessasary classes
* This method should only process the data which is cached!
*
@@ -415,6 +480,7 @@
{
$config =& $this->configData[$prefix];
$event_manager =& $this->Application->recallObject('EventManager');
+ /* @var $event_manager kEventManager */
$register_classes = getArrayValue($config,'RegisterClasses');
if (!$register_classes) $register_classes = Array();
@@ -451,11 +517,10 @@
}
$regular_events = getArrayValue($config, 'RegularEvents');
- if($regular_events)
- {
- foreach($regular_events as $short_name => $regular_event_info)
- {
- $event_manager->registerRegularEvent( $short_name, $config['Prefix'].':'.$regular_event_info['EventName'], $regular_event_info['RunInterval'], $regular_event_info['Type'] );
+ if ($regular_events) {
+ foreach ($regular_events as $short_name => $regular_event_info) {
+ $event_status = array_key_exists('Status', $regular_event_info) ? $regular_event_info['Status'] : STATUS_ACTIVE;
+ $event_manager->registerRegularEvent( $short_name, $config['Prefix'].':'.$regular_event_info['EventName'], $regular_event_info['RunInterval'], $regular_event_info['Type'], $event_status);
}
}
@@ -513,11 +578,6 @@
$this->Application->registerAggregateTag($aggregate_tag);
}
}
-
- if (isset($config['ReplacementTemplates']) && $config['ReplacementTemplates']) {
- // replacement templates defined in this config
- $this->Application->ReplacementTemplates = array_merge_recursive2($this->Application->ReplacementTemplates, $config['ReplacementTemplates']);
- }
}
function ValidateConfig($prefix)
@@ -721,8 +781,18 @@
$config['AdminTemplatePath'] = $module_templates . $config['AdminTemplatePath'];
}
+ if (array_key_exists($prefix, $this->prefixFiles) && ($this->prefixFiles[$prefix] != $filename)) {
+ trigger_error(
+ 'Single unit config prefix "' . $prefix . ' " ' .
+ 'is used in multiple unit config files: ' .
+ '"' . $this->prefixFiles[$prefix] . ' ", "' . $filename . ' "',
+ E_USER_WARNING
+ );
+ }
+
$this->configData[$prefix] = $config;
$this->prefixFiles[$prefix] = $filename;
+
return $prefix;
}
elseif ($prefix = array_search($filename, $this->prefixFiles)) {
@@ -919,7 +989,4 @@
}
}
-}
-
-
-?>
\ No newline at end of file
+}
\ No newline at end of file
Index: branches/5.1.x/core/units/general/libchart/classes/view/chart/Chart.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/units/general/libchart/classes/view/chart/Chart.php (.../Chart.php) (revision 12127)
+++ branches/5.1.x/core/units/general/libchart/classes/view/chart/Chart.php (.../Chart.php) (revision 12657)
@@ -17,6 +17,8 @@
*
*/
+ defined('FULL_PATH') or die('restricted access!');
+
/*! \mainpage Libchart
*
* This is the reference API, automatically compiled by Doxygen .
@@ -98,5 +100,4 @@
public function setTitle($title) {
$this->plot->setTitle($title);
}
- }
-?>
\ No newline at end of file
+ }
\ No newline at end of file
Index: branches/5.1.x/core/units/configuration/configuration.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/units/configuration/configuration.php (.../configuration.php) (revision 12127)
+++ branches/5.1.x/core/units/configuration/configuration.php (.../configuration.php) (revision 12657)
@@ -1,6 +1,6 @@
IDField] = $this->ID;
return parent::GetKeyClause($method, $keys_hash);
}
-
- }
-?>
\ No newline at end of file
+ /**
+ * Set's field error, if pseudo passed not found then create it with message text supplied.
+ * Don't owerrite existing pseudo translation.
+ *
+ * @param string $field
+ * @param string $pseudo
+ * @param string $error_label
+ */
+ function SetError($field, $pseudo, $error_label = null, $error_params = null)
+ {
+ if (!parent::SetError($field, $pseudo, $error_label, $error_params)) {
+ // this field already has an error -> don't overwrite it
+ return false;
+ }
+
+ $list_errors = $this->Application->GetVar('errors_' . $this->getPrefixSpecial(), Array ());
+ $list_errors[ $this->GetDBField('VariableName') ] = $this->GetErrorMsg($field);
+ $this->Application->SetVar('errors_' . $this->getPrefixSpecial(), $list_errors);
+ }
+
+ }
\ No newline at end of file
Index: branches/5.1.x/core/units/themes/themes_tag_processor.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/units/themes/themes_tag_processor.php (.../themes_tag_processor.php) (revision 12127)
+++ branches/5.1.x/core/units/themes/themes_tag_processor.php (.../themes_tag_processor.php) (revision 12657)
@@ -1,6 +1,6 @@
Application->BaseURL((defined('WRITEBALE_BASE') ? WRITEBALE_BASE : '/kernel') . '/stylesheets');
- $css_path = rtrim( str_replace( $this->Application->BaseURL(), FULL_PATH.'/', $css_url), '/' );
+ $css_url = $this->Application->BaseURL(WRITEBALE_BASE . '/stylesheets');
+ $css_path = rtrim( str_replace( $this->Application->BaseURL(), FULL_PATH . '/', $css_url), '/' );
$last_compiled = $object->GetDBField('LastCompiled');
@@ -74,4 +76,3 @@
return $object->GetDBField('ThemeId') == $themes_helper->getCurrentThemeId();
}
}
-?>
\ No newline at end of file
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_manufacturer.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/units/general/libchart/classes/view/chart/VerticalBarChart.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/units/general/libchart/classes/view/chart/VerticalBarChart.php (.../VerticalBarChart.php) (revision 12127)
+++ branches/5.1.x/core/units/general/libchart/classes/view/chart/VerticalBarChart.php (.../VerticalBarChart.php) (revision 12657)
@@ -17,6 +17,8 @@
*
*/
+ defined('FULL_PATH') or die('restricted access!');
+
/**
* Chart composed of vertical bars.
*
@@ -209,5 +211,4 @@
$this->plot->render($fileName);
}
- }
-?>
\ No newline at end of file
+ }
\ No newline at end of file
Index: branches/5.1.x/core/admin_templates/img/icons/icon46_users_settings.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/icons/icon46_list_users_settings.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_user_f2.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/units/mailing_lists/mailing_lists_config.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/units/mailing_lists/mailing_lists_config.php (.../mailing_lists_config.php) (revision 12127)
+++ branches/5.1.x/core/units/mailing_lists/mailing_lists_config.php (.../mailing_lists_config.php) (revision 12657)
@@ -1,6 +1,6 @@
'mailing-list',
'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
@@ -59,20 +61,21 @@
'Sections' => Array (
'in-portal:mailing_folder' => Array (
'parent' => 'in-portal:users',
- 'icon' => 'custom',
+ 'icon' => 'mailing_list',
'label' => 'la_title_MailingLists',
+ 'use_parent_header' => 1,
'permissions' => Array (),
- 'priority' => 7,
+ 'priority' => 5,
'type' => stTREE,
),
'in-portal:mailing_lists' => Array (
'parent' => 'in-portal:mailing_folder',
- 'icon' => 'custom',
+ 'icon' => 'mailing_list',
'label' => 'la_title_MailingLists',
'url' => Array('t' => 'mailing_lists/mailing_list_list', 'pass' => 'm'),
'permissions' => Array('view', 'add', 'edit', 'delete'),
- 'priority' => 7.1,
+ 'priority' => 5.1, // ., because this section replaces parent in tree
'type' => stTAB,
),
),
@@ -104,7 +107,7 @@
'Attachments' => Array (
'type' => 'string',
'formatter' => 'kUploadFormatter', 'upload_dir' => ITEM_FILES_PATH, 'max_size' => 50000000,
- 'multiple' => 10, 'direct_links' => true, 'file_types' => '*.*', 'files_description' => 'All Files',
+ 'multiple' => 10, 'direct_links' => true, 'file_types' => '*.*', 'files_description' => '!la_hint_AllFiles!',
'default' => NULL
),
@@ -125,16 +128,16 @@
'Grids' => Array (
'Default' => Array (
- 'Icons' => Array ('default' => 'icon16_custom.gif'),
+ 'Icons' => Array ('default' => 'icon16_item.png'),
'Fields' => Array (
- 'MailingId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', ),
- 'Subject' => Array ('title' => 'la_col_Subject', 'filter_block' => 'grid_like_filter', ),
- 'MessageText' => Array ('title' => 'la_col_MessageText', 'filter_block' => 'grid_like_filter', 'cut_first' => 100),
- 'MessageHtml' => Array ('title' => 'la_col_MessageHtml', 'filter_block' => 'grid_like_filter', 'cut_first' => 100),
- 'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter',),
- 'EmailsQueued' => Array ('title' => 'la_col_EmailsQueued', 'filter_block' => 'grid_range_filter',),
- 'EmailsSent' => Array ('title' => 'la_col_EmailsSent', 'filter_block' => 'grid_range_filter',),
- 'EmailsTotal' => Array ('title' => 'la_col_EmailsTotal', 'filter_block' => 'grid_range_filter',),
+ 'MailingId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
+ 'Subject' => Array ('title' => 'la_col_Subject', 'filter_block' => 'grid_like_filter', 'width' => 200, ),
+ 'MessageText' => Array ('title' => 'la_col_MessageText', 'filter_block' => 'grid_like_filter', 'cut_first' => 100, 'width' => 120, ),
+ 'MessageHtml' => Array ('title' => 'la_col_MessageHtml', 'filter_block' => 'grid_like_filter', 'cut_first' => 100, 'width' => 120, ),
+ 'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 100, ),
+ 'EmailsQueued' => Array ('title' => 'la_col_EmailsQueued', 'filter_block' => 'grid_range_filter', 'width' => 80, ),
+ 'EmailsSent' => Array ('title' => 'la_col_EmailsSent', 'filter_block' => 'grid_range_filter', 'width' => 80, ),
+ 'EmailsTotal' => Array ('title' => 'la_col_EmailsTotal', 'filter_block' => 'grid_range_filter', 'width' => 80, ),
),
),
),
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_view_item_f2.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/tab_back.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/units/pdf/pdf_renderer_tcpdf.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/units/pdf/pdf_renderer_tcpdf.php (.../pdf_renderer_tcpdf.php) (revision 12127)
+++ branches/5.1.x/core/units/pdf/pdf_renderer_tcpdf.php (.../pdf_renderer_tcpdf.php) (revision 12657)
@@ -1,6 +1,6 @@
IncludeTCPDF();
-
+
$this->PDF = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true);
$this->PDF->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$this->PDF->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$this->PDF->setPrintHeader(false);
$this->PDF->setPrintFooter(false);
$this->PDF->AddPage();
-
+
// $this->PDF->SetX(50);
// $this->PDF->SetY(200);
// $this->PDF->wr
}
-
+
function IncludeTCPDF()
{
static $included = false;
@@ -88,26 +90,26 @@
$included = true;
}
}
-
+
function NextPage()
{
$this->PDF->AddPage();
}
-
+
function GetWidth()
{
return $this->PDF->getPageWidth();
}
-
+
function GetHeight()
{
return $this->PDF->getPageHeight();
}
-
+
function SetFont($family, $size, $weight=400, $style='normal', $variant='normal')
{
$this->CurFontSize = $size;
-
+
$family = strtolower($family);
switch ($family) {
case 'serif':
@@ -127,19 +129,19 @@
$font = 'FreeSans';
break;
}
-
+
$bold = $weight >= 700 ? 'B' : '';
$italic = preg_match('/italic|oblique/i', $style) ? 'I' : '';
-
+
return $this->PDF->SetFont($font, $bold.$italic, $size);
}
-
+
function SetFontSize($size)
{
$this->CurFontSize = $size;
$this->PDF->SetFontSize($size);
}
-
+
function ProcessHTMLColor($color) {
$mapping = array(
'maroon' => '#800000',
@@ -173,30 +175,30 @@
return array(255,255,0);
}
-
+
function SetFillColor($color)
{
list($r,$g,$b) = $this->ProcessHTMLColor($color);
$this->PDF->SetFillColor($r,$g,$b);
$this->PDF->SetTextColor($r,$g,$b);
}
-
+
function SetLineColor($color)
{
list($r,$g,$b) = $this->ProcessHTMLColor($color);
return $this->PDF->SetDrawColor($r,$g,$b);
}
-
- function SetLineWidth($width)
+
+ function SetLineWidth($width)
{
return $this->PDF->setLineWidth($width);
}
-
+
function DrawLine($x1, $y1, $x2, $y2)
{
return $this->PDF->Line($x1, $y1, $x2, $y2);
}
-
+
function DrawRectangle($x1, $y1, $x2, $y2, $mode='D')
{
switch ($mode) {
@@ -209,18 +211,18 @@
case kPDFRenderer::SHAPE_DRAW_FILL_AND_STROKE :
$mode = 'DF';
break;
-
+
}
$w = $x2-$x1;
$h = $y2-$y1;
return $this->PDF->Rect($x1, $y1, $w, $h, $mode);
}
-
+
function DrawText($text, $x, $y)
{
return $this->PDF->text($x, $y, $text);
}
-
+
function DrawImage($filepath, $x, $y, $w=0, $h=0)
{
$info = pathinfo($filepath);
@@ -237,36 +239,36 @@
$im = @imagecreatefromgif ($filepath);
imagepng($im, $converted_filepath);
}
-
+
return $this->PDF->Image($converted_filepath, $x, $y, $w, $h);
}
}
-
+
function GetPDFString()
{
return $this->PDF->Output('', 'S');
}
-
+
function GetAscent()
{
//$this->CurrentFont['desc']
$font = $this->PDF->GetFont();
return ($font['desc']['Ascent'] / 1000) * $this->CurFontSize;
}
-
+
function GetDescent()
{
$font = $this->PDF->GetFont();
return ($font['desc']['Descent'] / 1000) * $this->CurFontSize;
}
-
+
function GetLineGap()
{
return 0;
$font = $this->PDF->GetFont();
return (($font['Ascent'] - $font['Descent'])*0 / 1000) * $this->CurFontSize;
}
-
+
function GetStringWidth($string)
{
return $this->PDF->GetStringWidth($string);
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_primary_affiliate_payment_type.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/users/admins_edit.tpl
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/admin_templates/users/admins_edit.tpl (.../admins_edit.tpl) (revision 12127)
+++ branches/5.1.x/core/admin_templates/users/admins_edit.tpl (.../admins_edit.tpl) (revision 12657)
@@ -51,13 +51,6 @@
a_toolbar.DisableButton('prev');
-
- addLoadEvent(
- function() {
- // fixes Firefox 2.0+ bug will password autocomplete
- document.getElementById(' ').value = '';
- }
- );
Index: branches/5.1.x/core/admin_templates/img/icons/icon46_visits.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/units/logs/email_logs/email_logs_config.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/units/logs/email_logs/email_logs_config.php (.../email_logs_config.php) (revision 12127)
+++ branches/5.1.x/core/units/logs/email_logs/email_logs_config.php (.../email_logs_config.php) (revision 12657)
@@ -1,6 +1,6 @@
'email-log',
'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
@@ -72,14 +74,14 @@
'Grids' => Array (
'Default' => Array (
- 'Icons' => Array ('default' => 'icon16_custom.gif'),
+ 'Icons' => Array ('default' => 'icon16_item.png'),
'Fields' => Array (
- 'EmailLogId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter',),
- 'fromuser' => Array ('title' => 'la_prompt_FromUsername', 'filter_block' => 'grid_like_filter', ),
- 'addressto' => Array ('title' => 'la_prompt_AddressTo', 'filter_block' => 'grid_like_filter', ),
- 'subject' => Array ('title' => 'la_col_Subject', 'filter_block' => 'grid_like_filter', ),
- 'event' => Array ('title' => 'la_col_Event', 'filter_block' => 'grid_like_filter', ),
- 'timestamp' => Array ('title' => 'la_prompt_SentOn', 'filter_block' => 'grid_date_range_filter', ),
+ 'EmailLogId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 50, ),
+ 'fromuser' => Array ('title' => 'la_prompt_FromUsername', 'filter_block' => 'grid_like_filter', 'width' => 200, ),
+ 'addressto' => Array ('title' => 'la_prompt_AddressTo', 'filter_block' => 'grid_like_filter', 'width' => 200, ),
+ 'subject' => Array ('title' => 'la_col_Subject', 'filter_block' => 'grid_like_filter', 'width' => 200, ),
+ 'event' => Array ('title' => 'la_col_Event', 'filter_block' => 'grid_like_filter', 'width' => 170, ),
+ 'timestamp' => Array ('title' => 'la_prompt_SentOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
// 'EventParams' => Array ('title' => 'la_col_EventParams', 'filter_block' => 'grid_like_filter', ),
),
),
Index: branches/5.1.x/core/admin_templates/img/logo_bg.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_update_rates_f3.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/units/email_messages/email_message_tp.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/units/email_messages/email_message_tp.php (.../email_message_tp.php) (revision 12127)
+++ branches/5.1.x/core/units/email_messages/email_message_tp.php (.../email_message_tp.php) (revision 12657)
@@ -1,6 +1,6 @@
Conn->GetCol($sql);
}
- }
-?>
\ No newline at end of file
+ /**
+ * Removes "Enabled" column, when not in debug mode
+ *
+ * @param Array $params
+ */
+ function ModifyUnitConfig($params)
+ {
+ if (!$this->Application->isDebugMode()) {
+ $grids = $this->Application->getUnitOption($this->Prefix, 'Grids');
+
+ foreach ($grids as $grid_name => $grid_data) {
+ if (array_key_exists('Enabled', $grid_data['Fields'])) {
+ unset($grids[$grid_name]['Fields']['Enabled']);
+ }
+ }
+
+ $this->Application->setUnitOption($this->Prefix, 'Grids', $grids);
+ }
+ }
+ }
\ No newline at end of file
Index: branches/5.1.x/core/admin_templates/img/icons/icon24_settings_custom.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_primary_file_f2.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/users/user_edit_images.tpl
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/admin_templates/users/user_edit_images.tpl (.../user_edit_images.tpl) (revision 12127)
+++ branches/5.1.x/core/admin_templates/users/user_edit_images.tpl (.../user_edit_images.tpl) (revision 12657)
@@ -41,7 +41,7 @@
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
- a_toolbar.AddButton( new ToolBarButton('new_image', ' ',
+ a_toolbar.AddButton( new ToolBarButton('new_item', ' :: ',
function() {
std_new_item('u-img', 'users/image_edit')
} ) );
@@ -54,6 +54,25 @@
a_toolbar.AddButton( new ToolBarSeparator('sep3') );
+ a_toolbar.AddButton( new ToolBarButton('approve', ' ', function() {
+ submit_event('u-img', 'OnMassApprove');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('decline', ' ', function() {
+ submit_event('u-img', 'OnMassDecline');
+ }
+ ) );
+
+
+ a_toolbar.AddButton( new ToolBarButton('setprimary', ' ', function() {
+ submit_event('u-img','OnSetPrimary');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep4') );
+
+
a_toolbar.AddButton( new ToolBarButton('move_up', ' ', function() {
submit_event('u-img','OnMassMoveUp');
}
@@ -64,12 +83,8 @@
}
) );
- a_toolbar.AddButton( new ToolBarButton('primary_image', ' ', function() {
- submit_event('u-img','OnSetPrimary');
- }
- ) );
- a_toolbar.AddButton( new ToolBarSeparator('sep4') );
+ a_toolbar.AddButton( new ToolBarSeparator('sep5') );
a_toolbar.AddButton( new ToolBarButton('view', ' ', function() {
show_viewmenu(a_toolbar,'view');
@@ -100,7 +115,7 @@
\ No newline at end of file
Index: branches/5.1.x/core/install.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/install.php (.../install.php) (revision 12127)
+++ branches/5.1.x/core/install.php (.../install.php) (revision 12657)
@@ -1,6 +1,6 @@
Array ('check_paths', 'db_config', 'select_license', 'download_license', 'select_domain', 'root_password', 'choose_modules', 'post_config', 'select_theme', 'finish'),
- 'clean_reinstall' => Array ('check_paths', 'clean_db', 'db_config', 'select_license', 'download_license', 'select_domain', 'root_password', 'choose_modules', 'post_config', 'select_theme', 'finish'),
+ 'fresh_install' => Array ('check_paths', 'db_config', 'select_license', /*'download_license',*/ 'select_domain', 'root_password', 'choose_modules', 'post_config', 'select_theme', 'security', 'finish'),
+ 'clean_reinstall' => Array ('check_paths', 'clean_db', 'db_config', 'select_license', /*'download_license',*/ 'select_domain', 'root_password', 'choose_modules', 'post_config', 'select_theme', 'security', 'finish'),
'already_installed' => Array ('check_paths', 'install_setup'),
- 'upgrade' => Array ('check_paths', 'install_setup', 'upgrade_modules', 'finish'),
- 'update_license' => Array ('check_paths', 'install_setup', 'select_license', 'download_license', 'select_domain', 'finish'),
- 'db_reconfig' => Array ('check_paths', 'install_setup', 'db_reconfig', 'finish'),
- 'fix_paths' => Array ('check_paths', 'install_setup', 'fix_paths', 'finish'),
+ 'upgrade' => Array ('check_paths', 'install_setup', 'upgrade_modules', 'security', 'finish'),
+ 'update_license' => Array ('check_paths', 'install_setup', 'select_license', /*'download_license',*/ 'select_domain', 'security', 'finish'),
+ 'db_reconfig' => Array ('check_paths', 'install_setup', 'db_reconfig', 'security', 'finish'),
+ 'fix_paths' => Array ('check_paths', 'install_setup', 'fix_paths', 'security', 'finish'),
);
/**
* Steps, that doesn't required admin to be logged-in to proceed
*
* @var Array
*/
- var $skipLoginSteps = Array ('check_paths', 'select_license', 'download_license', 'select_domain', 'root_password', 'choose_modules', 'post_config', 'select_theme', 'finish', -1);
+ var $skipLoginSteps = Array ('check_paths', 'select_license', /*'download_license',*/ 'select_domain', 'root_password', 'choose_modules', 'post_config', 'select_theme', 'security', 'finish', -1);
/**
* Steps, on which kApplication should not be initialized, because of missing correct db table structure
@@ -106,6 +106,8 @@
'$1/images/emoticons', // for "In-Bulletin"
'$1/images/manufacturers', // for "In-Commerce"
'$1/images/manufacturers/resized', // for "In-Commerce"
+ '$1/images/polls', // for "In-Bulletin"
+ '$1/images/polls/resized', // for "In-Bulletin"
'$1/backupdata',
'$1/export',
'$1/stylesheets',
@@ -250,7 +252,7 @@
foreach ($this->writeableFolders as $folder_path) {
$file_path = FULL_PATH . str_replace('$1', $writeable_base, $folder_path);
if (file_exists($file_path) && !is_writable($file_path)) {
- $this->errorMessage = 'Install cannot write to specified folder in the root directory of your installation';
+ $this->errorMessage = ' Installation can not continue until all required permissions are set correctly';
break;
}
}
@@ -387,6 +389,59 @@
$this->errorMessage = 'Please select action to perform';
}
break;
+
+ case 'security':
+ // perform write check
+ if ($this->Application->GetVar('skip_security_check')) {
+ // administrator intensionally skips security checks
+ break;
+ }
+
+ $write_check = true;
+ $check_paths = Array ('/', '/index.php', '/config.php', ADMIN_DIRECTORY . '/index.php');
+ foreach ($check_paths as $check_path) {
+ $path_check_status = $this->toolkit->checkWritePermissions(FULL_PATH . $check_path);
+
+ if (is_bool($path_check_status) && $path_check_status) {
+ $write_check = false;
+ break;
+ }
+ }
+
+ // script execute check
+ if (file_exists(WRITEABLE . '/install_check.php')) {
+ unlink(WRITEABLE . '/install_check.php');
+ }
+
+ $fp = fopen(WRITEABLE . '/install_check.php', 'w');
+ fwrite($fp, "Application->recallObject('CurlHelper');
+ /* @var $curl_helper kCurlHelper */
+
+ $output = $curl_helper->Send($this->Application->BaseURL(WRITEBALE_BASE) . 'install_check.php');
+ unlink(WRITEABLE . '/install_check.php');
+ $execute_check = ($output !== 'OK');
+
+ $directive_check = true;
+ $ini_vars = Array ('register_globals' => false, 'open_basedir' => true, 'allow_url_fopen' => false);
+ foreach ($ini_vars as $var_name => $var_value) {
+ $current_value = ini_get($var_name);
+
+ if (($var_value && !$current_value) || (!$var_value && $current_value)) {
+ $directive_check = false;
+ break;
+ }
+ }
+
+ if (!$write_check || !$execute_check || !$directive_check) {
+ $this->errorMessage = true;
+ }
+ /*else {
+ $this->currentStep = $this->GetNextStep();
+ }*/
+ break;
}
$this->PerformValidation(); // returns validation status (just in case)
@@ -457,20 +512,20 @@
break;
case 'choose_modules':
+ break;
+
case 'upgrade_modules':
$modules = $this->Application->GetVar('modules');
if (!$modules) {
$modules = Array ();
$this->errorMessage = 'Please select module(-s) to ' . ($this->currentStep == 'choose_modules' ? 'install' : 'upgrade');
}
- if ($this->currentStep == 'choose_modules') {
- // don't check interface modules during install, only for during upgrade
- break;
- }
-
// check interface module
- if (!in_array('core', $modules)) {
+ $upgrade_data = $this->GetUpgradableModules();
+
+ if (array_key_exists('core', $upgrade_data) && !in_array('core', $modules)) {
+ // core can be upgraded, but isn't selected
$this->errorMessage = 'Please select "Core" as interface module';
}
@@ -531,6 +586,9 @@
// set module "Core" version after install (based on upgrade scripts)
$this->toolkit->SetModuleVersion('Core');
+
+ // for now we set "In-Portal" module version to "Core" module version (during clean install)
+ $this->toolkit->SetModuleVersion('In-Portal', $this->toolkit->GetMaxModuleVersion('Core'));
}
break;
@@ -680,7 +738,7 @@
if ($domain != '') {
if (strstr($domain, $license_domain) || $modules_helper->_IsLocalSite($domain)) {
- $this->toolkit->setSystemConfig('Intechnic', 'Domain', $domain);
+ $this->toolkit->setSystemConfig('Misc', 'Domain', $domain);
$this->toolkit->SaveConfig();
}
else {
@@ -700,11 +758,18 @@
'RootPass' => $password,
'Site_Path' => BASE_PATH.'/', // set Site_Path (for SSL & old in-portal code)
'Backup_Path' => FULL_PATH . $this->toolkit->getSystemConfig('Misc', 'WriteablePath') . DIRECTORY_SEPARATOR . 'backupdata',
- 'Smtp_AdminMailFrom' => 'portal@' . $this->toolkit->getSystemConfig('Intechnic', 'Domain')
+ 'Smtp_AdminMailFrom' => 'portal@' . $this->toolkit->getSystemConfig('Misc', 'Domain')
);
$this->toolkit->saveConfigValues($config_values);
+ // login as "root", when no errors on password screen
+ $this->Application->SetVar('login', 'root');
+ $this->Application->SetVar('password', $this->Application->GetVar('root_password'));
+
+ $login_event = new kEvent('u.current:OnLogin');
+ $this->Application->HandleEvent($login_event);
+
// import base language for core (english)
$this->toolkit->ImportLanguage('/core/install/english');
@@ -824,6 +889,11 @@
// after upgrade sqls are executed update version and upgrade language pack
$this->toolkit->SetModuleVersion($module_name, $module_info['ToVersion']);
}
+
+ // for now we set "In-Portal" module version to "Core" module version (during upgrade)
+ if (in_array('core', $modules)) {
+ $this->toolkit->SetModuleVersion('In-Portal', $upgrade_data['core']['ToVersion']);
+ }
}
break;
@@ -1074,8 +1144,8 @@
if (!isset($modules)) {
$modules = Array();
$fh = opendir(MODULES_PATH);
- while (($sub_folder = readdir($fh))) {
- $folder_path = MODULES_PATH.'/'.$sub_folder;
+ while ( ($sub_folder = readdir($fh)) ) {
+ $folder_path = MODULES_PATH . '/'.$sub_folder;
if ($sub_folder != '.' && $sub_folder != '..' && is_dir($folder_path)) {
if ($sub_folder == 'core') {
// skip modules here
@@ -1336,5 +1406,32 @@
$this->Done($errstr);
}
}
+
+ /**
+ * Checks, that given button should be visible on current installation step
+ *
+ * @param string $name
+ * @return bool
+ */
+ function buttonVisible($name)
+ {
+ $button_visibility = Array (
+ 'continue' => $this->GetNextStep() != -1 || ($this->stepsPreset == 'already_installed'),
+ 'refresh' => in_array($this->currentStep, Array ('check_paths', 'security')),
+ 'back' => in_array($this->currentStep, Array (/*'select_license',*/ 'download_license', 'select_domain')),
+ );
+
+ if ($name == 'any') {
+ foreach ($button_visibility as $button_name => $button_visible) {
+ if ($button_visible) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ return array_key_exists($name, $button_visibility) ? $button_visibility[$name] : true;
+ }
}
?>
\ No newline at end of file
Index: branches/5.1.x/core/admin_templates/js/forms.js
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/admin_templates/js/forms.js (.../forms.js) (revision 12127)
+++ branches/5.1.x/core/admin_templates/js/forms.js (.../forms.js) (revision 12657)
@@ -62,8 +62,8 @@
// process all FCKEditor instances
var iframes = document.getElementsByTagName('IFRAME');
- for (var i=0; iValidate()) return false;
- $this->SetDBField('ResourceId', $this->Application->NextResourceId());
+ class GroupsItem extends kDBItem {
- return parent::Create();
- }
+ function Create($force_id = false, $system_create = false)
+ {
+ if (!$this->Validate()) return false;
+ $this->SetDBField('ResourceId', $this->Application->NextResourceId());
- function Update($id = null, $system_update = false)
- {
- $this->VirtualFields['ResourceId'] = Array();
- $ret = parent::Update($id, $system_update);
- unset($this->VirtualFields['ResourceId']);
-
- return $ret;
- }
-}
+ return parent::Create();
+ }
-?>
\ No newline at end of file
+ function Update($id = null, $system_update = false)
+ {
+ $this->VirtualFields['ResourceId'] = Array();
+ $ret = parent::Update($id, $system_update);
+ unset($this->VirtualFields['ResourceId']);
+
+ return $ret;
+ }
+ }
\ No newline at end of file
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_option.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/icons/icon24_catalog.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/install/install_toolkit.php
===================================================================
diff -u -N -r12453 -r12657
--- branches/5.1.x/core/install/install_toolkit.php (.../install_toolkit.php) (revision 12453)
+++ branches/5.1.x/core/install/install_toolkit.php (.../install_toolkit.php) (revision 12657)
@@ -1,6 +1,6 @@
Conn->Query($sql);
}
@@ -305,13 +308,27 @@
}
$sqls = str_replace("\r\n", "\n", $sqls); // convert to linux line endings
- $sqls = preg_replace("/#([^;]*?)\n/", '', $sqls); // remove all comments
- $sqls = explode(";\n", $sqls . "\n"); // ensures that last sql won't have ";" in it
+ $no_comment_sqls = preg_replace("/#\s([^;]*?)\n/is", '', $sqls); // remove all comments "#" on new lines
+ if ($no_comment_sqls === null) {
+ // "ini.pcre.backtrack-limit" reached and error happened
+ $sqls = explode(";\n", $sqls . "\n"); // ensures that last sql won't have ";" in it
+ $sqls = array_map('trim', $sqls);
+
+ // remove all comments "#" on new lines (takes about 2 seconds for 53000 sqls)
+ $sqls = preg_replace("/#\s([^;]*?)/", '', $sqls);
+ }
+ else {
+ $sqls = explode(";\n", $no_comment_sqls . "\n"); // ensures that last sql won't have ";" in it
+ $sqls = array_map('trim', $sqls);
+ }
+
+ $sql_count = count($sqls);
$db_collation = $this->getSystemConfig('Database', 'DBCollation');
- for ($i=$start_from; $iApplication->getUnitOption('theme', 'TableName');
$sql = 'SELECT Name, ' . $id_field . '
- FROM ' . $table_name;
+ FROM ' . $table_name . 'ORDER BY Name ASC';
return $this->Conn->GetCol($sql, $id_field);
}
@@ -539,14 +556,88 @@
*/
function getModuleName($module_folder)
{
- if ($module_folder == 'kernel') {
- $module_folder = 'in-portal';
+ return implode('-', array_map('ucfirst', explode('-', $module_folder)));
+ }
+
+ /**
+ * Returns information about module (based on "install/module_info.xml" file)
+ *
+ * @param string $module_folder
+ * @return Array
+ */
+ function getModuleInfo($module_folder)
+ {
+ $info_file = MODULES_PATH . '/' . $module_folder . '/install/module_info.xml';
+
+ if (!file_exists($info_file)) {
+ return Array ();
}
- return implode('-', array_map('ucfirst', explode('-', $module_folder)));
+ $xml_helper =& $this->Application->recallObject('kXMLHelper');
+ /* @var $xml_helper kXMLHelper */
+
+ $root_node =& $xml_helper->Parse( file_get_contents($info_file) );
+
+ if (!is_object($root_node) || !preg_match('/^kxmlnode/i', get_class($root_node)) || ($root_node->Name == 'ERROR')) {
+ // non-valid xml file
+ return Array ();
+ }
+
+ $ret = Array ();
+ $current_node =& $root_node->firstChild;
+
+ do {
+ $ret[ strtolower($current_node->Name) ] = trim($current_node->Data);
+ } while (($current_node =& $current_node->NextSibling()));
+
+ return $ret;
}
/**
+ * Returns nice module string to be used on install/upgrade screens
+ *
+ * @param string $module_folder
+ * @param string $version_string
+ * @return string
+ */
+ function getModuleString($module_folder, $version_string)
+ {
+ // image (if exists) ( )
+
+ $ret = Array ();
+ $module_info = $this->getModuleInfo($module_folder);
+
+ if (array_key_exists('name', $module_info) && $module_info['name']) {
+ $module_name = $module_info['name'];
+ }
+ else {
+ $module_name = $this->getModuleName($module_folder);
+ }
+
+ if (array_key_exists('image', $module_info) && $module_info['image']) {
+ $image_src = $module_info['image'];
+
+ if (!preg_match('/^(http|https):\/\//', $image_src)) {
+ // local image -> make absolute url
+ $image_src = $this->Application->BaseURL() . $image_src;
+ }
+
+ $ret[] = ' ';
+ }
+
+ if (array_key_exists('description', $module_info) && $module_info['description']) {
+ $ret[] = $module_info['description'];
+ }
+ else {
+ $ret[] = $module_name;
+ }
+
+ $ret[] = '(' . $module_name . ' ' . $version_string . ')';
+
+ return implode(' ', $ret);
+ }
+
+ /**
* Creates module root category in "Home" category using given data and returns it
*
* @param string $name
@@ -571,7 +662,7 @@
$category_fields = Array (
$fields['name'] => $name, 'Filename' => $name, 'AutomaticFilename' => 1,
- $fields['description'] => $description, 'Status' => $status, 'Priority' => -9999,
+ $fields['description'] => $description, 'Status' => STATUS_ACTIVE, 'Priority' => -9999,
);
$category_fields['ParentId'] = $this->Application->findModule('Name', 'Core', 'RootCat');
@@ -732,4 +823,21 @@
{
$this->Application->HandleEvent($themes_event, 'adm:OnRebuildThemes');
}
+
+ /**
+ * Checks that file is writable by group or others
+ *
+ * @param string $file
+ * @return boolean
+ */
+ function checkWritePermissions($file)
+ {
+ if (DIRECTORY_SEPARATOR == '\\') {
+ // windows doen't allow to check permissions (always returns null)
+ return null;
+ }
+
+ $permissions = fileperms($file);
+ return $permissions & 0x0010 || $permissions & 0x0002;
+ }
}
\ No newline at end of file
Index: branches/5.1.x/core/admin_templates/img/tab_back.jpg
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/units/pdf/pdf_config.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/units/pdf/pdf_config.php (.../pdf_config.php) (revision 12127)
+++ branches/5.1.x/core/units/pdf/pdf_config.php (.../pdf_config.php) (revision 12657)
@@ -1,6 +1,6 @@
'pdf',
'EventHandlerClass' => Array('class' => 'kEventHandler', 'file' => '', 'build_event' => 'OnBuild'),
Index: branches/5.1.x/core/units/user_profile/user_profile_tp.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/units/user_profile/user_profile_tp.php (.../user_profile_tp.php) (revision 12127)
+++ branches/5.1.x/core/units/user_profile/user_profile_tp.php (.../user_profile_tp.php) (revision 12657)
@@ -1,6 +1,6 @@
\ No newline at end of file
+ }
\ No newline at end of file
Index: branches/5.1.x/core/admin_templates/img/icons/icon24_sessions_log.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/icons/icon46_email_log.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/units/statistics/statistics_config.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/units/statistics/statistics_config.php (.../statistics_config.php) (revision 12127)
+++ branches/5.1.x/core/units/statistics/statistics_config.php (.../statistics_config.php) (revision 12657)
@@ -1,6 +1,6 @@
'stat',
'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
'ListClass' => Array('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
@@ -61,7 +63,7 @@
'Grids' => Array(
'Default' => Array(
- 'Icons' => Array('default' => 'icon16_custom.gif'),
+ 'Icons' => Array('default' => 'icon16_item.png'),
'Fields' => Array(
'Login' => Array('title' => 'la_col_Username', 'data_block' => 'grid_checkbox_td'),
'LastName' => Array( 'title'=>'la_col_LastName'),
@@ -72,6 +74,4 @@
),
- );
-
-?>
\ No newline at end of file
+ );
\ No newline at end of file
Index: branches/5.1.x/core/admin_templates/tools/backup3.tpl
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/admin_templates/tools/backup3.tpl (.../backup3.tpl) (revision 12127)
+++ branches/5.1.x/core/admin_templates/tools/backup3.tpl (.../backup3.tpl) (revision 12657)
@@ -34,7 +34,7 @@
">
-
+
M
Index: branches/5.1.x/core/admin_templates/img/icons/icon46_list_conf.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/tools/cron.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/tools/cron.php (.../cron.php) (revision 12127)
+++ branches/5.1.x/tools/cron.php (.../cron.php) (revision 12657)
@@ -1,6 +1,6 @@
/tools/cron.php -O /dev/null > /dev/null 2>&1
+ // Use this line to invoke from cron.
+ // wget http:///tools/cron.php -O /dev/null > /dev/null 2>&1
-define('FULL_PATH', realpath(dirname(__FILE__).'/..'));
-define('REL_PATH', 'tools/');
-define('ADMIN', 1);
+ $start = getmicrotime();
-include_once(FULL_PATH.'/core/kernel/startup.php');
+ define('CRON', 1);
+ define('ADMIN', 1);
+ define('REL_PATH', 'tools');
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/..'));
+ define('CMD_MODE', isset($argv) && count($argv) ? 1 : 0);
-$application =& kApplication::Instance();
-$application->Init();
+ if (CMD_MODE) {
+ define('DBG_SKIP_REPORTING', 1);
+ $_SERVER['HTTP_USER_AGENT'] = 'gecko';
+ $_SERVER['HTTP_HOST'] = 'localhost';
+ }
-$event_manager =& $application->recallObject('EventManager');
-$event_manager->RunRegularEvents(reBEFORE, true);
-$event_manager->RunRegularEvents(reAFTER, true);
+ include_once(FULL_PATH . '/core/kernel/startup.php');
-function getmicrotime()
-{
- list($usec, $sec) = explode(" ", microtime());
- return ((float)$usec + (float)$sec);
-}
+ $application =& kApplication::Instance();
+ $application->Init();
-?>
\ No newline at end of file
+ // events from request are not processed, only predefined regular events
+ $application->EventManager->RunRegularEvents(reBEFORE, true);
+ $application->EventManager->RunRegularEvents(reAFTER, true);
+
+ $application->Done();
+
+ $end = getmicrotime();
+
+ function getmicrotime()
+ {
+ list($usec, $sec) = explode(" ", microtime());
+ return ((float)$usec + (float)$sec);
+ }
\ No newline at end of file
Index: branches/5.1.x/core/admin_templates/img/itemicons/icon16_cat_new.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/units/mailing_lists/mailing_list_tp.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/units/mailing_lists/mailing_list_tp.php (.../mailing_list_tp.php) (revision 12127)
+++ branches/5.1.x/core/units/mailing_lists/mailing_list_tp.php (.../mailing_list_tp.php) (revision 12657)
@@ -1,6 +1,6 @@
Prefix != 'c') {
- return parent::ItemIcon($params);
+ $grids = $this->Application->getUnitOption($this->Prefix, 'Grids');
+ $grid = $grids[ $params['grid'] ];
+
+ if (!array_key_exists('Icons', $grid)) {
+ return '';
}
+ $icons = $grid['Icons'];
+
+ if (array_key_exists('name', $params)) {
+ $icon_name = $params['name'];
+ return array_key_exists($icon_name, $icons) ? $icons[$icon_name] : '';
+ }
+
$object =& $this->getObject($params);
- if ($object->GetDBField('IsMenu')) {
- $status = $object->GetDBField('Status');
- if ($status == 1) {
- $ret = $object->GetDBField('IsNew') ? 'icon16_cat_new.gif' : 'icon16_folder.gif';
- }
- else {
- $ret = $status ? 'icon16_cat_pending.gif' : 'icon16_cat_disabled.gif';
- }
+ /* @var $object kDBList */
+
+ if ($object->GetDBField('CreatedBySystem')) {
+ return 'icon16_section_system.png';
}
- else {
- $ret = 'icon16_folder-red.gif';
+
+ $status = $object->GetDBField('Status');
+
+ if ($status == STATUS_DISABLED) {
+ return 'icon16_section_disabled.png';
}
- return $ret;
+ if (!$object->GetDBField('IsMenu')) {
+ return 'icon16_section_menuhidden.png';
+ }
+
+ if ($status == STATUS_PENDING) {
+ return 'icon16_section_pending.png';
+ }
+
+ if ($object->GetDBField('IsNew')) {
+ return 'icon16_section_new.png';
+ }
+
+ return 'icon16_section.png';
}
function ItemCount($params)
@@ -182,7 +202,7 @@
$cat_object =& $this->Application->recallObject($this->getPrefixSpecial(), $this->Prefix.'_List');
$sql = 'SELECT '.$this->getTitleField().'
FROM '.$cat_object->TableName.'
- WHERE CategoryId = '.$this->Application->GetVar('m_cat_id');
+ WHERE CategoryId = '.(int)$this->Application->GetVar('m_cat_id');
return $this->Conn->GetOne($sql);
}
@@ -601,10 +621,13 @@
function CatalogItemCount($params)
{
+ $params['skip_quering'] = true;
$object =& $this->GetList($params);
+
if (!$object->Counted) {
$object->CountRecs();
}
+
return $object->NoFilterCount != $object->RecordsCount ? $object->RecordsCount.' / '.$object->NoFilterCount : $object->RecordsCount;
}
@@ -673,7 +696,7 @@
if (!isset($current_path)) {
$sql = 'SELECT ParentPath
FROM ' . TABLE_PREFIX . 'Category
- WHERE CategoryId = ' . $this->Application->GetVar('m_cat_id');
+ WHERE CategoryId = ' . (int)$this->Application->GetVar('m_cat_id');
$current_path = $this->Conn->GetOne($sql);
}
@@ -1033,7 +1056,12 @@
}
else {
// no relation with current category object -> query from db
- $sql = 'SELECT l' . $this->Application->GetVar('m_lang') . '_CachedNavbar
+ $language_id = (int)$this->Application->GetVar('m_lang');
+ if (!$language_id) {
+ $language_id = 1;
+ }
+
+ $sql = 'SELECT l' . $language_id . '_CachedNavbar
FROM ' . $object->TableName . '
WHERE ' . $object->IDField . ' = ' . $category_id;
$cached_navbar = $this->Conn->GetOne($sql);
@@ -1135,7 +1163,7 @@
$edit_code_before = $edit_code_after = '';
- if (EDITING_MODE == EDITING_MODE_CMS) {
+ if (EDITING_MODE == EDITING_MODE_CONTENT) {
$bg_color = isset($params['bgcolor']) ? $params['bgcolor'] : '#ffffff';
$url_params = Array (
'pass' => 'm,c,content',
@@ -1162,11 +1190,11 @@
$edit_url = $this->Application->HREF('categories/edit_content', ADMIN_DIRECTORY, $url_params, 'index.php');
$edit_code_before = '
-
+
-
+
-
Edit '.(defined('DEBUG_MODE') && DEBUG_MODE ? " - #{$num}" : '').'
+
' . $this->Application->Phrase('la_btn_EditContent', false) . ' '.(defined('DEBUG_MODE') && DEBUG_MODE ? " - #{$num}" : '').'
';
@@ -1331,7 +1359,7 @@
$ret = '
' . "\n";
$ret .= '
' . "\n";
- if (EDITING_MODE == EDITING_MODE_LAYOUT) {
+ if (EDITING_MODE == EDITING_MODE_DESIGN) {
$ret .= ' ';
@@ -1345,49 +1373,56 @@
$ret .= '' . "\n";
$ret .= '' . "\n";
$ret .= '' . "\n";
- // add form, so admin scripts could work
- $ret .= '
';
+ if (EDITING_MODE != EDITING_MODE_BROWSE) {
+ // add form, so admin scripts could work
+ $ret .= '
';
+ }
return $ret;
}
@@ -1409,48 +1444,79 @@
$page =& $this->_getPage($params);
- if (!$page->isLoaded()) {
+ if (!$page->isLoaded() || (($display_mode != 'end') && (EDITING_MODE == EDITING_MODE_BROWSE))) {
// when "EditingScripts" tag is not used, make sure, that scripts are also included
return $this->EditingScripts($params);
}
// show "EditPage" button only for pages, that exists in structure
if ($display_mode != 'end') {
- $url_params = Array(
- 'pass' => 'm,c',
- 'm_opener' => 'd',
- 'c_id' => $page->GetID(),
- 'c_mode' => 't',
- 'c_event' => 'OnEdit',
- 'front' => 1,
- '__URLENCODE__' => 1,
- '__NO_REWRITE__'=> 1,
- 'escape' => 1,
- 'index_file' => 'index.php',
- );
+ $edit_btn = '';
- $edit_url = $this->Application->HREF('categories/categories_edit', '/admin', $url_params);
+ if (EDITING_MODE == EDITING_MODE_CONTENT) {
+ $url_params = Array(
+ 'pass' => 'm,c',
+ 'm_opener' => 'd',
+ 'c_id' => $page->GetID(),
+ 'c_mode' => 't',
+ 'c_event' => 'OnEdit',
+ 'front' => 1,
+ '__URLENCODE__' => 1,
+ '__NO_REWRITE__'=> 1,
+ 'escape' => 1,
+ 'index_file' => 'index.php',
+ );
- $edit_btn = '';
+ $edit_url = $this->Application->HREF('categories/categories_edit', ADMIN_DIRECTORY, $url_params);
- if (EDITING_MODE == EDITING_MODE_LAYOUT) {
$edit_btn .= '
-
+
-
+
-
Save Layout
+
' . $this->Application->Phrase('la_btn_SectionProperties', false) . '
' . "\n";
- }
+ } elseif (EDITING_MODE == EDITING_MODE_DESIGN) {
+ $url_params = Array(
+ 'pass' => 'm,theme',
+ 'm_opener' => 'd',
+ 'theme_id' => $this->Application->GetVar('m_theme'),
+ 'theme_mode' => 't',
+ 'theme_event' => 'OnEdit',
+ 'theme-file_id' => $this->_getThemeFileId(),
+ 'front' => 1,
+ '__URLENCODE__' => 1,
+ '__NO_REWRITE__'=> 1,
+ 'escape' => 1,
+ 'index_file' => 'index.php',
+ );
- $edit_btn .= '
-
-
-
+ $edit_url = $this->Application->HREF('themes/file_edit', ADMIN_DIRECTORY, $url_params);
+
+ $edit_btn .= '
+
+
+
+
+
+
' . $this->Application->Phrase('la_btn_SaveChanges', false) . '
+
+
+
+
+
+
' . $this->Application->Phrase('la_btn_Cancel', false) . '
+
-
Section Properties
-
' . "\n";
+
+
+
+
+
' . $this->Application->Phrase('la_btn_SectionTemplate', false) . '
+
' . "\n";
+ }
+
if ($display_mode == 'start') {
// button with border around the page
$edit_code .= '
' . $edit_btn . '
';
@@ -1477,6 +1543,26 @@
return $edit_code;
}
+ function _getThemeFileId()
+ {
+ $template = $this->Application->GetVar('t');
+
+ if (!$this->Application->TemplatesCache->TemplateExists($template) && !$this->Application->IsAdmin()) {
+ $cms_handler =& $this->Application->recallObject($this->Prefix . '_EventHandler');
+ /* @var $cms_handler CategoriesEventHandler */
+
+ $template = ltrim($cms_handler->GetDesignTemplate(), '/');
+ }
+
+ $file_path = dirname($template) == '.' ? '' : '/' . dirname($template);
+ $file_name = basename($template);
+
+ $sql = 'SELECT FileId
+ FROM ' . TABLE_PREFIX . 'ThemeFiles
+ WHERE (FilePath = ' . $this->Conn->qstr($file_path) . ') AND (FileName = ' . $this->Conn->qstr($file_name . '.tpl') . ')';
+ return $this->Conn->GetOne($sql);
+ }
+
/**
* Builds cached menu version
*
@@ -1736,10 +1822,18 @@
{
$object =& $this->getObject($params);
- $template = $object->GetDBField('NamedParentPath');
- $url_params = Array ('admin' => 1, 'pass' => 'm', 'm_cat_id' => $object->GetID(), 'index_file' => 'index.php');
+ $themes_helper =& $this->Application->recallObject('ThemesHelper');
+ /* @var $themes_helper kThemesHelper */
- return $this->Application->HREF($template, '_FRONT_END_', $url_params);
+ $url_params = Array (
+ 'm_cat_id' => $object->GetID(),
+ 'm_theme' => $themes_helper->getCurrentThemeId(),
+ 'pass' => 'm',
+ 'admin' => 1,
+ 'index_file' => 'index.php'
+ );
+
+ return $this->Application->HREF($object->GetDBField('NamedParentPath'), '_FRONT_END_', $url_params);
}
/**
@@ -1941,8 +2035,12 @@
$id_field = $this->Application->getUnitOption($this->Prefix, 'IDField');
$table_name = $this->Application->getUnitOption($this->Prefix, 'TableName');
- $language = $this->Application->GetVar('m_lang');
+ $language = (int)$this->Application->GetVar('m_lang');
+ if (!$language) {
+ $language = 1;
+ }
+
$sql = 'SELECT l'.$language.'_Name AS Name, NamedParentPath
FROM '.$table_name.'
WHERE '.$id_field.' IN ('.implode(',', $category_ids).')';
Index: branches/5.1.x/core/admin_templates/img/icons/icon24_structure.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/admin/index.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/admin/index.php (.../index.php) (revision 12127)
+++ branches/5.1.x/admin/index.php (.../index.php) (revision 12657)
@@ -1,6 +1,6 @@
It\'s not safe to run with write permissions (777) on "/config.php" file and root folder of In-Portal installation! Please change permissions from 777 to 775 (or 755) and try again! ');
- }
- }
-
$application =& kApplication::Instance();
$application->Init();
$application->Run();
@@ -39,19 +29,4 @@
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
- }
-
- //update_memory_check_script();
-
- function update_memory_check_script() {
- $files = get_included_files();
- $script = '$files = Array('."\n";
- foreach ($files as $file_name) {
- $script .= "\t\t'".str_replace(FULL_PATH, '', $file_name)."',\n";
- }
- $script .= ");\n";
- echo "
";
- echo $script;
- echo " ";
- }
-?>
\ No newline at end of file
+ }
\ No newline at end of file
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_new_spelling_dictionary.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/icons/icon24_users_settings.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/themes/template_edit.tpl
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/admin_templates/themes/template_edit.tpl (.../template_edit.tpl) (revision 12127)
+++ branches/5.1.x/core/admin_templates/themes/template_edit.tpl (.../template_edit.tpl) (revision 12657)
@@ -15,10 +15,19 @@
}
) );
- a_toolbar.AddButton( new ToolBarButton('cancel', '
', function() {
- submit_event('theme-file', 'OnGoBack');
+ a_toolbar.AddButton(
+ new ToolBarButton(
+ 'cancel',
+ '
',
+ function() {
+
+ window_close();
+
+ submit_event('theme-file', 'OnGoBack');
+
}
- ) );
+ )
+ );
a_toolbar.Render();
@@ -39,7 +48,13 @@
Index: branches/5.1.x/core/admin_templates/img/itemicons/icon16_agent.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/units/general/libchart/classes/view/caption/Caption.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/units/general/libchart/classes/view/caption/Caption.php (.../Caption.php) (revision 12127)
+++ branches/5.1.x/core/units/general/libchart/classes/view/caption/Caption.php (.../Caption.php) (revision 12657)
@@ -17,6 +17,8 @@
*
*/
+ defined('FULL_PATH') or die('restricted access!');
+
/**
* Caption.
*
@@ -108,5 +110,4 @@
public function setColorSet($colorSet) {
$this->colorSet = $colorSet;
}
- }
-?>
\ No newline at end of file
+ }
\ No newline at end of file
Index: branches/5.1.x/core/admin_templates/img/toolbar/tool_primary_theme_f3.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/itemicons/icon16_theme_primary.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/admin_templates/img/icons/icon24_visits.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/kernel/utility/debugger/debugger_responce.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/kernel/utility/debugger/debugger_responce.php (.../debugger_responce.php) (revision 12127)
+++ branches/5.1.x/core/kernel/utility/debugger/debugger_responce.php (.../debugger_responce.php) (revision 12657)
@@ -1,6 +1,6 @@
\ No newline at end of file
+ }
\ No newline at end of file
Index: branches/5.1.x/core/admin_templates/img/icons/icon24_link_editor.gif
===================================================================
diff -u -N -r12127 -r12657
Binary files differ
Index: branches/5.1.x/core/units/files/files_config.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/units/files/files_config.php (.../files_config.php) (revision 12127)
+++ branches/5.1.x/core/units/files/files_config.php (.../files_config.php) (revision 12657)
@@ -1,6 +1,6 @@
'#file',
'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
@@ -83,14 +85,12 @@
'Grids' => Array (
'Default' => Array (
- 'Icons' => Array (1 => 'icon16_file.gif', 0 => 'icon16_file_disabled.gif'),
+ 'Icons' => Array (1 => 'icon16_item.png', 0 => 'icon16_disabled.png'),
'Fields' => Array(
'FileId' => Array ('title' => 'la_col_Id' , 'data_block' => 'grid_checkbox_td', 'module' => 'In-Portal', 'filter_block' => 'grid_range_filter'),
'FileName' => Array ('title' => 'la_col_FileName', 'filter_block' => 'grid_like_filter'),
'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter'),
),
),
),
- );
-
-?>
\ No newline at end of file
+ );
\ No newline at end of file
Index: branches/5.1.x/core/admin_templates/js/uploader/uploader.js
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/admin_templates/js/uploader/uploader.js (.../uploader.js) (revision 12127)
+++ branches/5.1.x/core/admin_templates/js/uploader/uploader.js (.../uploader.js) (revision 12657)
@@ -207,7 +207,7 @@
this.swf.addVariable('debugEnabled', escape('true')); // flash var
}
- if (this.params.buttonPlaceholderId === false) {
+ if (this.params.buttonPlaceholderId === false || !UploadsManager.useTransparency) {
// only write flash, when button placeholder is not used
this.swf.write(holder);
this.flash = document.getElementById(this.flash_id);
@@ -234,7 +234,7 @@
Uploader.prototype.moveOutside = function() {
// move flash outside scroll_container, but keeps it's position on screen
- if (!UploadsManager.useTransparency) {
+ if (!UploadsManager.useTransparency || this._moved) {
// moving only needed when transparency us used (e.g. in admin)
return ;
}
@@ -364,7 +364,7 @@
this._prepareFiles();
// sync position of all uploaders below current, because file queue height change will not affect their positions
- UploadsManager.iterate('syncBrowseButton');
+ UploadsManager.iterate('syncBrowseButton', 0);
}
Uploader.prototype.removeFile = function (file) {
Index: branches/5.1.x/core/kernel/db/db_event_handler.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 12127)
+++ branches/5.1.x/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 12657)
@@ -1,6 +1,6 @@
Array('self' => 'view', 'subitem' => 'view'),
'OnItemBuild' => Array('self' => 'view', 'subitem' => 'view'),
+ 'OnSuggestValues' => Array('self' => 'view', 'subitem' => 'view'),
'OnBuild' => Array('self' => true),
@@ -267,9 +270,17 @@
$ids = $event->getEventParam('ids');
if (isset($direct_ids) || ($ids !== false)) {
- // save ids directly if they given
- $this->Application->StoreVar($session_name, implode(',', $direct_ids ? $direct_ids : $ids));
- return $direct_ids ? $direct_ids : $ids;
+ // save ids directly if they given + reset array indexes
+ $resulting_ids = $direct_ids ? array_values($direct_ids) : ($ids ? array_values($ids) : false);
+ if ($resulting_ids) {
+ $this->Application->SetVar($event->getPrefixSpecial() . '_selected_ids', implode(',', $resulting_ids));
+ $this->Application->LinkVar($event->getPrefixSpecial() . '_selected_ids', $session_name);
+ $this->Application->SetVar($event->getPrefixSpecial() . '_id', $resulting_ids[0]);
+
+ return $resulting_ids;
+ }
+
+ return Array ();
}
$ret = Array();
@@ -298,7 +309,7 @@
$ret = array_unique(array_merge($ret, $ids));
$this->Application->SetVar($event->getPrefixSpecial().'_selected_ids', implode(',',$ret));
- $this->Application->LinkVar($event->getPrefixSpecial().'_selected_ids', $session_name);
+ $this->Application->LinkVar($event->getPrefixSpecial().'_selected_ids', $session_name, '', !$ret); // optional when IDs are missing
// This is critical - otherwise getPassedID will return last ID stored in session! (not exactly true)
// this smells... needs to be refactored
@@ -465,6 +476,8 @@
$this->Application->SetVar('t', $error_template);
$this->Application->SetVar('m_cat_id', $themes_helper->getPageByTemplate($error_template));
+ // in case if missing item is recalled first from event (not from template)
+ $this->Application->InitParser();
$this->Application->HTML = $this->Application->ParseBlock( Array ('name' => $error_template) );
$this->Application->Done();
exit;
@@ -499,7 +512,10 @@
$this->LoadItem($event);
$status_checked = true;
- if ($user_id != -1 && !$this->Application->IsAdmin() && !$this->checkItemStatus($event)) {
+ $editing_mode = defined('EDITING_MODE') ? EDITING_MODE : false;
+
+ if ($user_id != -1 && !$this->Application->IsAdmin() && !($editing_mode || $this->checkItemStatus($event))) {
+ // non-root user AND on front-end AND (not editing mode || incorrect status)
$perm_status = false;
}
}
@@ -699,7 +715,7 @@
$object =& $event->getObject();
$object->SetPerPage($per_page);
- $this->Application->StoreVarDefault($event->getPrefixSpecial().'_Page', 1);
+ $this->Application->StoreVarDefault($event->getPrefixSpecial().'_Page', 1, true); // true for optional
$page = $this->Application->GetVar($event->getPrefixSpecial().'_Page');
if (!$page) {
@@ -1144,27 +1160,25 @@
$object =& $event->getObject( Array('skip_autoload' => true) );
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
- if($items_info)
- {
- foreach($items_info as $id => $field_values)
- {
+ if ($items_info) {
+ foreach ($items_info as $id => $field_values) {
$object->Load($id);
$object->SetFieldsFromHash($field_values);
$this->customProcessing($event, 'before');
- if( $object->Update($id) )
- {
+
+ if ( $object->Update($id) ) {
$this->customProcessing($event, 'after');
- $event->status=erSUCCESS;
+ $event->status = erSUCCESS;
}
- else
- {
- $event->status=erFAIL;
- $event->redirect=false;
+ else {
+ $event->status = erFAIL;
+ $event->redirect = false;
break;
}
}
}
- $event->redirect_params = Array('opener'=>'u');
+
+ $event->SetRedirectParam('opener', 'u');
}
/**
@@ -2304,7 +2318,7 @@
return ;
}
- $tmp_path = defined('WRITEABLE') ? WRITEABLE.'/tmp/' : FULL_PATH.'/kernel/cache/';
+ $tmp_path = WRITEABLE . '/tmp/';
$fname = $value['name'];
$id = $this->Application->GetVar('id');
if ($id) {
@@ -2385,18 +2399,28 @@
*/
function OnViewFile(&$event)
{
- if (strpos($this->Application->GetVar('file'), '../') !== false) return ;
+ $file = $this->Application->GetVar('file');
+ if ((strpos($file, '../') !== false) || (trim($file) !== $file)) {
+ // when relative paths or special chars are found template names from url, then it's hacking attempt
+ return ;
+ }
+
if ($this->Application->GetVar('tmp')) {
- $path = (defined('WRITEABLE') ? WRITEABLE.'/tmp/' : FULL_PATH.'/kernel/cache/').$this->Application->GetVar('id').'_'.$this->Application->GetVar('file');
+ $path = WRITEABLE . '/tmp/' . $this->Application->GetVar('id') . '_' . $this->Application->GetVar('file');
}
else {
$object =& $event->getObject(array('skip_autoload'=>true));
$options = $object->GetFieldOptions($this->Application->GetVar('field'));
- $path = FULL_PATH.$options['upload_dir'].$this->Application->GetVar('file');
+ $path = FULL_PATH.$options['upload_dir'].$file;
}
$path = str_replace('/', DIRECTORY_SEPARATOR, $path);
+
+ if (!file_exists($path)) {
+ exit;
+ }
+
$type = mime_content_type($path);
header('Content-Length: '.filesize($path));
@@ -2428,35 +2452,44 @@
*/
function OnSuggestValues(&$event)
{
- $this->Application->XMLHeader();
+ if (!$this->Application->IsAdmin() || !$this->Application->LoggedIn()) {
+ // very careful here, because this event allows to
+ // view every object field -> limit only to logged-in admins
+ return ;
+ }
+ $event->status = erSTOP;
+
$field = $this->Application->GetVar('field');
$cur_value = $this->Application->GetVar('cur_value');
- if (!$field || !$cur_value) {
- exit;
+
+ $object =& $event->getObject();
+
+ if (!$field || !$cur_value || !array_key_exists($field, $object->Fields)) {
+ return ;
}
$limit = $this->Application->GetVar('limit');
if (!$limit) {
$limit = 20;
}
- $object =& $event->getObject();
$sql = 'SELECT DISTINCT '.$field.'
FROM '.$object->TableName.'
WHERE '.$field.' LIKE '.$this->Conn->qstr($cur_value.'%').'
ORDER BY '.$field.'
LIMIT 0,' . $limit;
-
$data = $this->Conn->GetCol($sql);
+ $this->Application->XMLHeader();
+
echo '
';
+
foreach ($data as $item) {
echo '- ' . htmlspecialchars($item) . '
';
}
- echo ' ';
- $event->status = erSTOP;
+ echo '';
}
/**
@@ -2495,7 +2528,4 @@
// abstract, for hooking
}
- }
-
-
-?>
\ No newline at end of file
+ }
\ No newline at end of file
Index: branches/5.1.x/core/units/form_fields/form_fields_config.php
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/units/form_fields/form_fields_config.php (.../form_fields_config.php) (revision 12127)
+++ branches/5.1.x/core/units/form_fields/form_fields_config.php (.../form_fields_config.php) (revision 12657)
@@ -1,6 +1,6 @@
'formflds',
'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
@@ -62,7 +64,11 @@
'FieldLabel' => Array('type' => 'string', 'required' => 1, 'default' => null),
'Heading' => Array('type' => 'string', 'default' => null),
'Prompt' => Array('type' => 'string', 'default' => null, 'required' => 1),
- 'ElementType' => Array('required'=>'1', 'type'=>'string', 'not_null '=> 1, 'default'=>'', 'formatter'=>'kOptionsFormatter', 'use_phrases' => 1, 'options'=>Array('' => 'la_EmptyValue', 'text' => 'la_type_text', 'select' => 'la_type_select', 'radio' => 'la_type_radio', 'checkbox' => 'la_type_SingleCheckbox', 'password' => 'la_type_password', 'textarea' => 'la_type_textarea', 'label' => 'la_type_label')),
+ 'ElementType' => Array(
+ 'type' => 'string',
+ 'formatter' => 'kOptionsFormatter', 'options' => Array ('' => 'la_EmptyValue', 'text' => 'la_type_text', 'select' => 'la_type_select', 'radio' => 'la_type_radio', 'checkbox' => 'la_type_SingleCheckbox', 'password' => 'la_type_password', 'textarea' => 'la_type_textarea', 'label' => 'la_type_label'), 'use_phrases' => 1,
+ 'required' => 1, 'not_null' => 1, 'default' => '',
+ ),
'ValueList' => Array('type' => 'string','default' => null),
'Priority' => Array('type' => 'int','not_null' => 1, 'default' => 0),
'IsSystem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
@@ -80,18 +86,16 @@
),
'Grids' => Array(
'Default' => Array(
- 'Icons' => Array('default'=>'icon16_custom.gif'),
+ 'Icons' => Array('default'=>'icon16_item.png'),
'Fields' => Array(
- 'FormFieldId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter'),
- 'FieldName' => Array( 'title'=>'la_prompt_FieldName', 'filter_block' => 'grid_like_filter'),
- 'FieldLabel' => Array( 'title'=>'la_prompt_FieldLabel', 'data_block' => 'label_grid_data_td', 'filter_block' => 'grid_like_filter'),
- 'Priority' => Array('title' => 'la_prompt_Priority', 'filter_block' => 'grid_range_filter'),
+ 'FormFieldId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60 ),
+ 'FieldName' => Array( 'title'=>'la_prompt_FieldName', 'filter_block' => 'grid_like_filter', 'width' => 100 ),
+ 'FieldLabel' => Array( 'title'=>'la_prompt_FieldLabel', 'data_block' => 'label_grid_data_td', 'filter_block' => 'grid_like_filter', 'width' => 150 ),
+ 'Priority' => Array('title' => 'la_prompt_Priority', 'filter_block' => 'grid_range_filter', 'width' => 80 ),
'ElementType' => Array('title' => 'la_prompt_ElementType', 'filter_block' => 'grid_options_filter'),
'Required' => Array('title' => 'la_prompt_Required', 'filter_block' => 'grid_options_filter'),
- 'DisplayInGrid' => Array('title' => 'la_prompt_DisplayInGrid', 'filter_block' => 'grid_options_filter'),
+ 'DisplayInGrid' => Array('title' => 'la_prompt_DisplayInGrid', 'filter_block' => 'grid_options_filter', 'width' => 150 ),
),
),
),
- );
-
-?>
\ No newline at end of file
+ );
\ No newline at end of file
Index: branches/5.1.x/core/admin_templates/regional/languages_list.tpl
===================================================================
diff -u -N -r12127 -r12657
--- branches/5.1.x/core/admin_templates/regional/languages_list.tpl (.../languages_list.tpl) (revision 12127)
+++ branches/5.1.x/core/admin_templates/regional/languages_list.tpl (.../languages_list.tpl) (revision 12657)
@@ -15,7 +15,7 @@
}
var a_toolbar = new ToolBar();
- a_toolbar.AddButton( new ToolBarButton('new_language', '
::
',
+ a_toolbar.AddButton( new ToolBarButton('new_item', '
::
',
function() {
std_precreate_item('lang', 'regional/languages_edit')
} ) );
@@ -29,18 +29,18 @@
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
- a_toolbar.AddButton( new ToolBarButton('primary_language', '
::
', function() {
+ a_toolbar.AddButton( new ToolBarButton('setprimary', '
', function() {
submit_event('lang','OnSetPrimary');
}
) );
- a_toolbar.AddButton( new ToolBarButton('import_language', '
::
', function() {
+ a_toolbar.AddButton( new ToolBarButton('import', '