[modx-ja] r623 committed - [#446] QuickManagerを最新の1.5.1にアップデート

5 views
Skip to first unread message

mod...@googlecode.com

unread,
Aug 20, 2010, 10:22:43 AM8/20/10
to mod...@googlegroups.com
Revision: 623
Author: yama.kyms
Date: Fri Aug 20 07:21:43 2010
Log: [#446] QuickManagerを最新の1.5.1にアップデート
http://code.google.com/p/modx-ja/source/detail?r=623

Added:
/trunk/assets/plugins/qm/css/images/input-bg.gif
/trunk/assets/plugins/qm/css/images/stop.png
Deleted:
/trunk/assets/plugins/qm/.htaccess
/trunk/assets/plugins/qm/close.php
/trunk/assets/plugins/qm/images
/trunk/assets/plugins/qm/qm.plugin.txt
Modified:
/trunk/assets/plugins/qm/css/ie.css
/trunk/assets/plugins/qm/css/ie7.css
/trunk/assets/plugins/qm/css/style.css
/trunk/assets/plugins/qm/js/jquery.colorbox-min.js
/trunk/assets/plugins/qm/mcc.class.php
/trunk/assets/plugins/qm/qm.inc.php
/trunk/assets/plugins/qm/readme.html
/trunk/install/assets/plugins/qm.tpl

=======================================
--- /dev/null
+++ /trunk/assets/plugins/qm/css/images/input-bg.gif Fri Aug 20 07:21:43
2010
@@ -0,0 +1,1 @@
+GIF89a ¢ ÿÿÿýýýüüüúúúùùù÷÷÷õõõììì!ù ÿ , xfDò Ê™ ;
=======================================
--- /dev/null
+++ /trunk/assets/plugins/qm/css/images/stop.png Fri Aug 20 07:21:43 2010
Binary file, no diff available.
=======================================
--- /trunk/assets/plugins/qm/.htaccess Sat Jun 12 02:14:38 2010
+++ /dev/null
@@ -1,4 +0,0 @@
-# Restrict direct access to script file types and templates
-# <FilesMatch "\.(php|tpl|inc)$">
-# Allow from all
-# </FilesMatch>
=======================================
--- /trunk/assets/plugins/qm/close.php Wed Mar 31 21:41:24 2010
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-/**
- * Qm+ — QuickManager+ clearer page
- *
- * @author Mikko Lammi, www.maagit.fi
- * @license GNU General Public License (GPL),
http://www.gnu.org/copyleft/gpl.html
- * @version 1.3.4 updated 7/10/2009
- */
-
-// Get parameters
-if (isset($_GET['id'])) $id = intval($_GET['id']);
-else $id = '';
-
-print <<<HTML
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="content-type" content="text/html; charset=utf-8" />
-<title></title>
-<script type="text/javascript">
-function getCookie(cookieName)
-{
- var results = document.cookie.match ( "(^|;) ?" + cookieName
+ "=([^;]*)(;|$)" );
-
- if (results) return (unescape(results[2]));
- else return null;
-}
-
-function getUrl()
-{
- var protocol = window.location.protocol;
- var host = window.location.host;
- var baseUrl = getCookie("baseUrlQM");
-
- return protocol + "//" + host + baseUrl + "index.php?id={$id}";
-}
-
-</script>
-
-</head>
-<body onload="javascript: parent.location.href = getUrl();">
-</body>
-</html>
-HTML;
-
-?>
=======================================
--- /trunk/assets/plugins/qm/qm.plugin.txt Wed Mar 31 21:41:24 2010
+++ /dev/null
@@ -1,13 +0,0 @@
-$show = TRUE;
-
-if ($disabled != '') {
- $arr = explode(",", $disabled );
- if (in_array($modx->documentIdentifier, $arr)) {
- $show = FALSE;
- }
-}
-
-if ($show) {
-
include_once($modx->config['base_path'].'assets/plugins/qm/qm.inc.php');
- $qm = new Qm($modx, $jqpath, $loadmanagerjq, $loadfrontendjq,
$noconflictjq, $loadtb, $tbwidth, $tbheight, $hidefields, $hidetabs,
$hidesections, $addbutton, $tpltype, $tplid, $custombutton, $managerbutton,
$logout, $autohide);
-}
=======================================
--- /trunk/assets/plugins/qm/css/ie.css Wed Mar 31 21:41:24 2010
+++ /trunk/assets/plugins/qm/css/ie.css Fri Aug 20 07:21:43 2010
@@ -1,4 +1,16 @@
#qmEditor, #qmEditorClosed
{
- padding: 3px 3px 1px 3px;
-}
+ padding: 5px 3px 1px 0px;
+}
+
+#qmEditor li
+{
+ margin-top: -2px;
+}
+
+#qmEditor #qmClose
+{
+ padding: 7px 5px 4px 7px;
+ margin-bottom: 3px;
+ margin-top: -1px;
+}
=======================================
--- /trunk/assets/plugins/qm/css/ie7.css Wed Mar 31 21:41:24 2010
+++ /trunk/assets/plugins/qm/css/ie7.css Fri Aug 20 07:21:43 2010
@@ -1,4 +1,17 @@
#qmEditor, #qmEditorClosed
{
- padding: 2px 3px 3px 3px !important;
-}
+ padding: 3px 3px 1px 3px;
+
+}
+
+#qmEditor #qmClose
+{
+ padding: 6px 4px 5px 6px;
+ margin-bottom: 2px;
+ margin-top: -1px;
+}
+
+#qmEditor li
+{
+ margin-top: -1px;
+}
=======================================
--- /trunk/assets/plugins/qm/css/style.css Sun Aug 8 05:14:30 2010
+++ /trunk/assets/plugins/qm/css/style.css Fri Aug 20 07:21:43 2010
@@ -1,10 +1,176 @@
-#qmEditor, #qmEditorClosed
-{
- height: 28px;
+/* Edit buttons in content, e.g. for Ditto listings */
+
+.qm-edit
+{
+ display: block;
+ float: right;
+ font-family: Helvetica, Arial, sans-serif;
+ font-size: 12px;
+ margin: 5px 0 5px 5px;
+ line-height: 1em;
+ padding: 0 !important;
+}
+
+.qm-edit a
+{
+ display: block;
+ color: #3b454f;
+ text-decoration: none;
+ border: none;
+ line-height: 1em;
+ padding: 6px 6px;
+}
+
+
+/* New document buttons in content */
+
+.qm-new, .qm-tv
+{
+ display: block;
+ float: right;
+ font-family: Helvetica, Arial, sans-serif;
+ font-size: 12px;
+ margin: 5px 0 5px 5px;
+ line-height: 1em;
+ padding: 0 !important;
+}
+
+.qm-new a, .qm-tv a
+{
+ display: block;
+ color: #3b454f;
+ text-decoration: none;
+ border: none;
+ padding: 6px 6px;
+}
+
+
+/* TV edit form */
+
+#qm-tv-body
+{
+ font-family: Helvetica, Arial, sans-serif;
+ color: #111;
+ font-size: 1em;
+}
+
+#qm-tv-tv
+{
+ font-size: 80%;
+}
+
+.qm-save, .qm-cancel
+{
+ display: block;
+ float: right;
+ font-family: Helvetica, Arial, sans-serif;
+ font-size: 12px;
+ margin: 5px 0 5px 5px;
+ line-height: 1em;
+ padding: 0 !important;
+}
+
+.qm-save a, .qm-cancel a
+{
+ display: block;
+ color: #3b454f;
+ text-decoration: none;
+ border: none;
+ padding: 6px 6px;
+}
+
+.qm-cancel span
+{
+ background: transparent url(images/stop.png) no-repeat left center;
+ padding-left: 20px;
+}
+
+.qm-save
+{
+ margin-right: 5px;
+}
+
+.qm-cancel
+{
+ margin-right: 20px;
+}
+
+#qm-tv-actions
+{
+ position: fixed;
+ top: 10px;
+ right: 0;
+ z-index: 100;
+ margin: 0;
+ text-align: right;
+}
+
+#qm-tv-body h1
+{
+ font-size: 120%;
+ letter-spacing: 1px;
+ color: #333333;
+ font-weight: normal;
+ margin-bottom: 20px;
+}
+
+#qm-tv-description
+{
+ margin-bottom: 20px;
+ font-size: 80%;
+}
+
+.qm-tv-text input, .qm-tv-textarea textarea, .qm-tv-image
input[type=text], .qm-tv-file input[type=text]
+{
+ border: 1px solid #ddd;
+ border-left-color: #c3c3c3;
+ border-top-color: #7c7c7c;
+ padding: 4px 4px 4px 4px;
+ background: #fff url(images/input-bg.gif) repeat-x top left;
+}
+
+.qm-tv-text input
+{
+ width: 400px !important;
+}
+
+.qm-tv-textarea textarea
+{
+ width: 400px !important;
+ height: 200px;
+ font-family: monospace;
+}
+
+.qm-tv-image input[type=text]
+{
+ width: 400px !important;
+}
+
+#qm-tv-image-preview
+{
+ margin-top: 15px;
+}
+
+#qm-tv-image-preview img
+{
+ max-width: 200px;
+ max-height: 200px;
+}
+
+
+/* Toolbar */
+
+*:focus, *:active
+{
+ outline: none !important;
+}
+
+#qmEditor, #qmEditorClosed
+{
font-family: Helvetica, Arial, sans-serif !important;
top:0;
left:0;
- padding: 4px 3px 3px 3px;
+ padding: 3px;
position: fixed;
width: 100%;
line-height:1;
@@ -18,8 +184,8 @@
-webkit-transition-duration: 0.7s;
-moz-transition-duration: 0.7s;
transition-duration: 0.7s;
-}
-
+}
+
#qmEditor *:focus, #qmEditor *:active
{
outline: none !important;
@@ -32,28 +198,35 @@

#qmEditor a
{
- display: inline;
+ display: block;
}

-.qmEdit span
+#qmEditor .qmEdit span, .qm-edit span, .qm-save span, .qm-tv span
{
background: transparent url(images/save.png) no-repeat left center;
padding-left: 20px;
}
+
+#qmEditor .qmButton span
+{
+
+}

#qmEditorClosed
{
+ height: 28px;
display: none;
width: 40px !important;
cursor: pointer !important;
}

-#qmClose
+#qmEditor #qmClose
{
display: block;
float: right;
- margin-right: 10px;
- margin-top: 2px;
+ margin-right: 7px;
+ margin-top: 0px;
+ padding: 6px 8px;
}

#qmLogoClose
@@ -62,13 +235,13 @@
float: left;
height: 28px;
width: 40px;
- margin-top: -6px;
- margin-right: 5px;
+ margin-top: 0;
+ margin-right: 0px;
text-decoration: none !important;
border: 0 !important;
background: transparent url(images/transparent.gif) repeat;
}
-
+
#qmEditor:hover, #qmEditorClosed:hover
{
opacity:1;
@@ -86,46 +259,39 @@
#qmEditor ul
{ /* .actionButtons --> #qmEditor */
margin: 0;
- padding: 7px 10px 0px 0px;
+ padding: 0px 10px 0px 0px;
+ list-style-type: none;
}

#qmEditor li
-{ /* .actionButtons --> #qmEditor */
- display: inline;
- list-style-type: none;
- margin-right: 6px;
- margin-top: 6px;
+{ /* .actionButtons --> #qmEditor */
+ margin-right: 8px;
+ float: left;
+ height: 15px;
+ line-height: 15px;
padding: 0;
}

-#qmEditor .qmButton
+#qmEditor .qmButton, .qm-edit, .qm-new, .qm-tv, .qm-save, .qm-cancel
{
color: #3b454f;
font-weight: bold;
font-size: 12px;
background: #c7ced2 url(images/button-gradient.png) repeat-x 0px -6px;
- padding: 4px 6px;
+ padding: 4px 6px;
white-space: nowrap;
- vertical-align: top;
text-decoration: none;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
-webkit-text-shadow: 1px 1px 0 #fff;
- -moz-text-shadow: 1px 1px 0 #fff;
- text-shadow: 1px 1px 0 #fff;
+ -moz-text-shadow: 0 1px 1px #fff;
+ text-shadow: 0 1px 1px #fff;
border: 1px solid #8ea4be;
outline: none;
}

-#qmEditor .qmButton img
-{
- vertical-align: top;
- margin-top: -2px;
- border: 0;
-}
-
-#qmEditor .qmButton:hover
+#qmEditor .qmButton:hover, .qm-edit:hover, .qm-new:hover, .qm-tv:hover, .qm-save:hover, .qm-cancel:hover
{
background-position: bottom left;
-webkit-box-shadow: 0 0 10px #b8c7d6;
=======================================
--- /trunk/assets/plugins/qm/js/jquery.colorbox-min.js Wed Mar 31 21:41:24
2010
+++ /trunk/assets/plugins/qm/js/jquery.colorbox-min.js Fri Aug 20 07:21:43
2010
@@ -1,2 +1,4 @@
-/* ColorBox v1.3.6 - a full featured, light-weight, customizable lightbox
based on jQuery 1.3 */
-(function(c){function r(b,d){d=d==="x"?m.width():m.height();return typeof
b==="string"?Math.round(b.match(/%/)?d/100*parseInt(b,10):parseInt(b,10)):b}function
M(b){b=c.isFunction(b)?b.call(i):b;return a.photo||b.match(/\.(gif|png|jpg|
jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)}function Y(){for(var b in
a)if(c.isFunction(a[b])&&b.substring(0,2)!=="on")a[b]=a[b].call(i);a.rel=a.rel|
|i.rel;a.href=a.href||i.href;a.title=a.title||i.title}function
Z(b){i=b;a=c(i).data(q);Y();if(a.rel&&a.rel!=="nofollow"){g=
c(".cboxElement").filter(function(){return(c(this).data(q).rel||
this.rel)===a.rel});j=g.index(i);if(j<0){g=g.add(i);j=g.length-1}}else{g=c(i);j=0}if(!B){C=B=n;N=i;N.blur();c(document).bind("keydown.cbox_close",function(d){if(d.keyCode===27){d.preventDefault();e.close()}}).bind("keydown.cbox_arrows",function(d){if(g.length>1)if(d.keyCode===37){d.preventDefault();D.click()}else
if(d.keyCode===39){d.preventDefault();E.click()}});a.overlayClose&&s.css({cursor:"pointer"}).one("click",e.close);c.event.trigger(aa);
a.onOpen&&a.onOpen.call(i);s.css({opacity:a.opacity}).show();a.w=r(a.initialWidth,"x");a.h=r(a.initialHeight,"y");e.position(0);O&&m.bind("resize.cboxie6
scroll.cboxie6",function(){s.css({width:m.width(),height:m.height(),top:m.scrollTop(),left:m.scrollLeft()})}).trigger("scroll.cboxie6")}P.add(D).add(E).add(t).add(Q).hide();R.html(a.close).show();e.slideshow();e.load()}var
q="colorbox",F="hover",n=true,e,x=!c.support.opacity,O=x&&!window.XMLHttpRequest,aa="cbox_open",H="cbox_load",S="cbox_complete",
T="resize.cbox_resize",s,k,u,p,U,V,W,X,g,m,l,I,J,K,Q,P,t,E,D,R,y,z,v,w,i,N,j,a,B,C,$={transition:"elastic",speed:350,width:false,height:false,innerWidth:false,innerHeight:false,initialWidth:"400",initialHeight:"400",maxWidth:false,maxHeight:false,scalePhotos:n,scrolling:n,inline:false,html:false,iframe:false,photo:false,href:false,title:false,rel:false,opacity:0.9,preloading:n,current:"image
{current} of
{total}",previous:"previous",next:"next",close:"close",open:false,overlayClose:n,slideshow:false,
slideshowAuto:n,slideshowSpeed:2500,slideshowStart:"start
slideshow",slideshowStop:"stop
slideshow",onOpen:false,onLoad:false,onComplete:false,onCleanup:false,onClosed:false};e=c.fn.colorbox=function(b,d){var
h=this;if(!h.length)if(h.selector===""){h=c("<a/>");b.open=n}else return
this;h.each(function(){var
f=c.extend({},c(this).data(q)?c(this).data(q):$,b);c(this).data(q,f).addClass("cboxElement");if(d)c(this).data(q).onComplete=d});b&&b.open&&Z(h);return
this};e.init=function(){function b(d){return c('<div id="cbox'+
d+'"/>')}m=c(window);k=c('<div
id="colorbox"/>');s=b("Overlay").hide();u=b("Wrapper");p=b("Content").append(l=b("LoadedContent").css({width:0,height:0}),J=b("LoadingOverlay"),K=b("LoadingGraphic"),Q=b("Title"),P=b("Current"),t=b("Slideshow"),E=b("Next"),D=b("Previous"),R=b("Close"));u.append(c("<div/>").append(b("TopLeft"),U=b("TopCenter"),b("TopRight")),c("<div/>").append(V=b("MiddleLeft"),p,W=b("MiddleRight")),c("<div/>").append(b("BottomLeft"),X=b("BottomCenter"),b("BottomRight"))).children().children().css({"float":"left"});
I=c("<div style='position:absolute; top:0; left:0; width:9999px;
height:0;'/>");c("body").prepend(s,k.append(u,I));if(x){k.addClass("cboxIE");O&&s.css("position","absolute")}p.children().bind("mouseover
mouseout",function(){c(this).toggleClass(F)}).addClass(F);y=U.height()+X.height()+p.outerHeight(n)-p.height();z=V.width()+W.width()+p.outerWidth(n)-p.width();v=l.outerHeight(n);w=l.outerWidth(n);k.css({"padding-bottom":y,"padding-right":z}).hide();E.click(e.next);D.click(e.prev);R.click(e.close);p.children().removeClass(F);
c(".cboxElement").live("click",function(d){if(d.button!==0&&typeof
d.button!=="undefined")return n;else{Z(this);return
false}})};e.position=function(b,d){function
h(A){U[0].style.width=X[0].style.width=p[0].style.width=A.style.width;K[0].style.height=J[0].style.height=p[0].style.height=V[0].style.height=W[0].style.height=A.style.height}var
f=m.height();f=Math.max(f-a.h-v-y,0)/2+m.scrollTop();var
o=Math.max(document.documentElement.clientWidth-a.w-w-z,0)/2+m.scrollLeft();b=k.width()===a.w+w&&k.height()===
a.h+v?0:b;u[0].style.width=u[0].style.height="9999px";k.dequeue().animate({width:a.w+w,height:a.h+v,top:f,left:o},{duration:b,complete:function(){h(this);C=false;u[0].style.width=a.w+w+z+"px";u[0].style.height=a.h+v+y+"px";d&&d()},step:function(){h(this)}})};e.resize=function(b){function
d(){a.w=a.w||l.width();a.w=a.mw&&a.mw<a.w?a.mw:a.w;return a.w}function
h(){a.h=a.h||l.height();a.h=a.mh&&a.mh<a.h?a.mh:a.h;return a.h}function
f(G){e.position(G,function(){if(B){if(x){A&&l.fadeIn(100);k[0].style.removeAttribute("filter")}if(a.iframe)l.append("<iframe
id='cboxIframe'"+ (a.scrolling?" ":"scrolling='no'")+" name='iframe_"+(new
Date).getTime()+"' frameborder=0
src='"+a.href+"' "+(x?"allowtransparency='true'":"")+"
/>");l.show();Q.show().html(a.title);if(g.length>1){P.html(a.current.replace(/\{current\}/,j+1).replace(/\{total\}/,g.length)).show();E.html(a.next).show();D.html(a.previous).show();a.slideshow&&t.show()}J.hide();K.hide();c.event.trigger(S);a.onComplete&&a.onComplete.call(i);a.transition==="fade"&&k.fadeTo(L,1,function(){x&&k[0].style.removeAttribute("filter")});
m.bind(T,function(){e.position(0)})}})}if(B){var
o,A,L=a.transition==="none"?0:a.speed;m.unbind(T);if(b){l.remove();l=c('<div
id="cboxLoadedContent"/>').html(b);l.hide().appendTo(I).css({width:d(),overflow:a.scrolling?"auto":"hidden"}).css({height:h()}).prependTo(p);c("#cboxPhoto").css({cssFloat:"none"});O&&c("select:not(#colorbox
select)").filter(function(){return
this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("cbox_cleanup",function(){this.style.visibility="inherit"});a.transition=== "fade"&&k.fadeTo(L,0,function(){f(0)})|
|
f(L);if(a.preloading&&g.length>1){b=j>0?g[j-1]:g[g.length-1];o=j<g.length-1?g[j+1]:g[0];o=c(o).data(q).href|
|o.href;b=c(b).data(q).href||b.href;M(o)&&c("<img
/>").attr("src",o);M(b)&&c("<img />").attr("src",b)}}else
setTimeout(function(){var G=l.wrapInner("<div
style='overflow:auto'></div>").children();a.h=G.height();l.css({height:a.h});G.replaceWith(G.children());e.position(L)},1)}};e.load=function(){var
b,d,h,f=e.resize;C=n;i=g[j];a=c(i).data(q);Y();c.event.trigger(H);
a.onLoad&&a.onLoad.call(i);a.h=a.height?r(a.height,"y")-v-y:a.innerHeight?r(a.innerHeight,"y"):false;a.w=a.width?r(a.width,"x")-w-z:a.innerWidth?r(a.innerWidth,"x"):false;a.mw=a.w;a.mh=a.h;if(a.maxWidth){a.mw=r(a.maxWidth,"x")-w-z;a.mw=a.w&&a.w<a.mw?a.w:a.mw}if(a.maxHeight){a.mh=r(a.maxHeight,"y")-v-y;a.mh=a.h&&a.h<a.mh?a.h:a.mh}b=a.href;J.show();K.show();if(a.inline){c('<div
id="cboxInlineTemp" />').hide().insertBefore(c(b)[0]).bind(H+"
cbox_cleanup",function(){c(this).replaceWith(l.children())}); f(c(b))}else
if(a.iframe)f(" ");else if(a.html)f(a.html);else if(M(b)){d=new
Image;d.onload=function(){var
o;d.onload=null;d.id="cboxPhoto";c(d).css({margin:"auto",border:"none",display:"block",cssFloat:"left"});if(a.scalePhotos){h=function(){d.height-=d.height*o;d.width-=d.width*o};if(a.mw&&d.width>a.mw){o=(d.width-a.mw)/d.width;h()}if(a.mh&&d.height>a.mh){o=(d.height-a.mh)/d.height;h()}}if(a.h)d.style.marginTop=Math.max(a.h-d.height,0)/2+"px";f(d);g.length>1&&c(d).css({cursor:"pointer"}).click(e.next);
if(x)d.style.msInterpolationMode="bicubic"};d.src=b}else c("<div
/>").appendTo(I).load(b,function(o,A){A==="success"?f(this):f(c("<p>Request
unsuccessful.</p>"))})};e.next=function(){if(!C){j=j<g.length-1?j+1:0;e.load()}};e.prev=function(){if(!C){j=j>0?j-1:g.length-1;e.load()}};e.slideshow=function(){function
b(){t.text(a.slideshowStop).bind(S,function(){h=setTimeout(e.next,a.slideshowSpeed)}).bind(H,function(){clearTimeout(h)}).one("click",function(){d();c(this).removeClass(F)});k.removeClass(f+ "off").addClass(f+"on")}var
d,h,f="cboxSlideshow_";t.bind("cbox_closed",function(){t.unbind();clearTimeout(h);k.removeClass(f+"off "+f+"on")});d=function(){clearTimeout(h);t.text(a.slideshowStart).unbind(S+" "+H).one("click",function(){b();h=setTimeout(e.next,a.slideshowSpeed);c(this).removeClass(F)});k.removeClass(f+"on").addClass(f+"off")};if(a.slideshow&&g.length>1)a.slideshowAuto?b():d()};e.close=function(){c.event.trigger("cbox_cleanup");a.onCleanup&&a.onCleanup.call(i);B=false;c(document).unbind("keydown.cbox_close
keydown.cbox_arrows"); m.unbind(T+" resize.cboxie6
scroll.cboxie6");s.css({cursor:"auto"}).fadeOut("fast");k.stop(n,false).fadeOut("fast",function(){c("#colorbox
iframe").attr("src","about:blank");l.remove();k.css({opacity:1});try{N.focus()}catch(b){}c.event.trigger("cbox_closed");a.onClosed&&a.onClosed.call(i)})};e.element=function(){return
c(i)};e.settings=$;c(e.init)})(jQuery);
+// ColorBox v1.3.9 - a full featured, light-weight, customizable lightbox
based on jQuery 1.3
+// c) 2009 Jack Moore - www.colorpowered.com - ja...@colorpowered.com
+// Licensed under the MIT license:
http://www.opensource.org/licenses/mit-license.php
+(function(b,gb){var
v="none",t="click",N="LoadedContent",d=false,x="resize.",o="y",u="auto",f=true,M="nofollow",q="on",n="x";function
e(a,c){a=a?' id="'+k+a+'"':"";c=c?' style="'+c+'"':"";return
b("<div"+a+c+"/>")}function p(a,b){b=b===n?m.width():m.height();return
typeof
a==="string"?Math.round(a.match(/%/)?b/100*parseInt(a,10):parseInt(a,10)):a}function
Q(c){c=b.isFunction(c)?c.call(h):c;return a.photo||c.match(/\.(gif|png|jpg|
jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)}function cb(){for(var c in
a)if(b.isFunction(a[c])&&c.substring(0,2)!==q)a[c]=a[c].call(h);a.rel=a.rel|
|h.rel||M;a.href=a.href||b(h).attr("href");a.title=a.title||
h.title}function
db(d){h=d;a=b.extend({},b(h).data(r));cb();if(a.rel!==M){i=b("."+H).filter(function(){return
(b(this).data(r).rel||
this.rel)===a.rel});g=i.index(h);if(g===-1){i=i.add(h);g=i.length-1}}else{i=b(h);g=0}if(!w){w=F=f;R=h;try{R.blur()}catch(e){}b.event.trigger(hb);a.onOpen&&a.onOpen.call(h);y.css({opacity:+a.opacity,cursor:a.overlayClose?"pointer":u}).show();a.w=p(a.initialWidth,n);a.h=p(a.initialHeight,o);c.position(0);S&&m.bind(x+O+"
scroll."+O,function(){y.css({width:m.width(),height:m.height(),top:m.scrollTop(),left:m.scrollLeft()})}).trigger("scroll."+O)}T.add(I).add(J).add(z).add(U).hide();V.html(a.close).show();c.slideshow();c.load()}var
eb={transition:"elastic",speed:300,width:d,initialWidth:"600",innerWidth:d,maxWidth:d,height:d,initialHeight:"450",innerHeight:d,maxHeight:d,scalePhotos:f,scrolling:f,inline:d,html:d,iframe:d,photo:d,href:d,title:d,rel:d,opacity:.9,preloading:f,current:"image
{current} of
{total}",previous:"previous",next:"next",close:"close",open:d,loop:f,slideshow:d,slideshowAuto:f,slideshowSpeed:2500,slideshowStart:"start
slideshow",slideshowStop:"stop
slideshow",onOpen:d,onLoad:d,onComplete:d,onCleanup:d,onClosed:d,overlayClose:f,escKey:f,arrowKey:f},r="colorbox",k="cbox",hb=k+"_open",P=k+"_load",W=k+"_complete",X=k+"_cleanup",fb=k+"_closed",G=b.browser.msie&&!b.support.opacity,S=G&&b.browser.version<7,O=k+"_IE6",y,j,E,s,Y,Z,ab,bb,i,m,l,K,L,U,T,z,J,I,V,C,D,A,B,h,R,g,a,w,F,c,H=k+"Element";c=b.fn[r]=b[r]=function(c,d){var
a=this;if(!a[0]&&a.selector)return a;c=c||{};if(d)c.onComplete=d;if(!a[0]||
a.selector===undefined){a=b("<a/>");c.open=f}a.each(function(){b(this).data(r,b.extend({},b(this).data(r)|
|eb,c)).addClass(H)});c.open&&db(a[0]);return a};c.init=function(){var
h="hover";m=b(gb);j=e().attr({id:r,"class":G?k+"IE":""});y=e("Overlay",S?"position:absolute":"").hide();E=e("Wrapper");s=e("Content").append(l=e(N,"width:0;
height:0"),L=e("LoadingOverlay").add(e("LoadingGraphic")),U=e("Title"),T=e("Current"),J=e("Next"),I=e("Previous"),z=e("Slideshow"),V=e("Close"));E.append(e().append(e("TopLeft"),Y=e("TopCenter"),e("TopRight")),e().append(Z=e("MiddleLeft"),s,ab=e("MiddleRight")),e().append(e("BottomLeft"),bb=e("BottomCenter"),e("BottomRight"))).children().children().css({"float":"left"});K=e(d,"position:absolute;
width:9999px; visibility:hidden;
display:none");b("body").prepend(y,j.append(E,K));s.children().hover(function(){b(this).addClass(h)},function(){b(this).removeClass(h)}).addClass(h);C=Y.height()+bb.height()+s.outerHeight(f)-s.height();D=Z.width()+ab.width()+s.outerWidth(f)-s.width();A=l.outerHeight(f);B=l.outerWidth(f);j.css({"padding-bottom":C,"padding-right":D}).hide();J.click(c.next);I.click(c.prev);V.click(c.close);s.children().removeClass(h);b("."+H).live(t,function(a){if(a.button!==0&&typeof
a.button!=="undefined"||a.ctrlKey||a.shiftKey||a.altKey)return
f;else{db(this);return
d}});y.click(function(){a.overlayClose&&c.close()});b(document).bind("keydown",function(b){if(w&&a.escKey&&b.keyCode===27){b.preventDefault();c.close()}if(w&&a.arrowKey&&!F&&i[1])if(b.keyCode===37&&(g|
|a.loop)){b.preventDefault();I.click()}else
if(b.keyCode===39&&(g<i.length-1||
a.loop)){b.preventDefault();J.click()}})};c.remove=function(){j.add(y).remove();b("."+H).die(t).removeData(r).removeClass(H)};c.position=function(f,b){function
c(a){Y[0].style.width=bb[0].style.width=s[0].style.width=a.style.width;L[0].style.height=L[1].style.height=s[0].style.height=Z[0].style.height=ab[0].style.height=a.style.height}var
e,h=Math.max(m.height()-a.h-A-C,0)/2+m.scrollTop(),g=Math.max(m.width()-a.w-B-D,0)/2+m.scrollLeft();e=j.width()===a.w+B&&j.height()===a.h+A?0:f;E[0].style.width=E[0].style.height="9999px";j.dequeue().animate({width:a.w+B,height:a.h+A,top:h,left:g},{duration:e,complete:function(){c(this);F=d;E[0].style.width=a.w+B+D+"px";E[0].style.height=a.h+A+C+"px";b&&b()},step:function(){c(this)}})};c.resize=function(b){if(w){b=b|
|
{};if(b.width)a.w=p(b.width,n)-B-D;if(b.innerWidth)a.w=p(b.innerWidth,n);l.css({width:a.w});if(b.height)a.h=p(b.height,o)-A-C;if(b.innerHeight)a.h=p(b.innerHeight,o);if(!b.innerHeight&&!b.height){b=l.wrapInner("<div
style='overflow:auto'></div>").children();a.h=b.height();b.replaceWith(b.children())}l.css({height:a.h});c.position(a.transition===v?0:a.speed)}};c.prep=function(o){var
d="hidden";function n(t){var
o,q,s,n,d=i.length,e=a.loop;c.position(t,function(){function
t(){G&&j[0].style.removeAttribute("filter")}if(w){G&&p&&l.fadeIn(100);a.iframe&&b("<iframe
frameborder=0"+(a.scrolling?"":" scrolling='no'")+(G?"
allowtransparency='true'":"")+"/>").attr({src:a.href,name:(new
Date).getTime()}).appendTo(l);l.show();U.show().html(a.title);if(d>1){T.html(a.current.replace(/\{current\}/,g+1).replace(/\{total\}/,d)).show();J[e|
|g<d-1?"show":"hide"]().html(a.next);I[e||
g?"show":"hide"]().html(a.previous);o=g?i[g-1]:i[d-1];s=g<d-1?i[g+1]:i[0];if(a.slideshow){z.show();g===d-1&&!e&&j.is("."+k+"Slideshow_on")&&z.click()}if(a.preloading){n=b(s).data(r).href|
|s.href;q=b(o).data(r).href||
o.href;if(Q(n))b("<img/>")[0].src=n;if(Q(q))b("<img/>")[0].src=q}}L.hide();a.transition==="fade"?j.fadeTo(f,1,function(){t()}):t();m.bind(x+k,function(){c.position(0)});b.event.trigger(W);a.onComplete&&a.onComplete.call(h)}})}if(w){var
p,f=a.transition===v?0:a.speed;m.unbind(x+k);l.remove();l=e(N).html(o);l.hide().appendTo(K.show()).css({width:function(){a.w=a.w|
|l.width();a.w=a.mw&&a.mw<a.w?a.mw:a.w;return
a.w}(),overflow:a.scrolling?u:d}).css({height:function(){a.h=a.h||
l.height();a.h=a.mh&&a.mh<a.h?a.mh:a.h;return
a.h}()}).prependTo(s);K.hide();b("#"+k+"Photo").css({cssFloat:v});S&&b("select").not(j.find("select")).filter(function(){return
this.style.visibility!==d}).css({visibility:d}).one(X,function(){this.style.visibility="inherit"});a.transition==="fade"?j.fadeTo(f,0,function(){n(0)}):n(f)}};c.load=function(){var
j,d,q,m=c.prep;F=f;h=i[g];a=b.extend({},b(h).data(r));cb();b.event.trigger(P);a.onLoad&&a.onLoad.call(h);a.h=a.height?p(a.height,o)-A-C:a.innerHeight&&p(a.innerHeight,o);a.w=a.width?p(a.width,n)-B-D:a.innerWidth&&p(a.innerWidth,n);a.mw=a.w;a.mh=a.h;if(a.maxWidth){a.mw=p(a.maxWidth,n)-B-D;a.mw=a.w&&a.w<a.mw?a.w:a.mw}if(a.maxHeight){a.mh=p(a.maxHeight,o)-A-C;a.mh=a.h&&a.h<a.mh?a.h:a.mh}j=a.href;L.show();if(a.inline){e("InlineTemp").hide().insertBefore(b(j)[0]).bind(P+" "+X,function(){b(this).replaceWith(l.children())});m(b(j))}else
if(a.iframe)m(" ");else if(a.html)m(a.html);else if(Q(j)){d=new
Image;d.onload=function(){var
e;d.onload=null;d.id=k+"Photo";b(d).css({margin:u,border:v,display:"block",cssFloat:"left"});if(a.scalePhotos){q=function(){d.height-=d.height*e;d.width-=d.width*e};if(a.mw&&d.width>a.mw){e=(d.width-a.mw)/d.width;q()}if(a.mh&&d.height>a.mh){e=(d.height-a.mh)/d.height;q()}}if(a.h)d.style.marginTop=Math.max(a.h-d.height,0)/2+"px";setTimeout(function(){m(d)},1);i[1]&&(g<i.length-1|
|
a.loop)&&b(d).css({cursor:"pointer"}).click(c.next);if(G)d.style.msInterpolationMode="bicubic"};d.src=j}else
e().appendTo(K).load(j,function(c,a,b){m(a==="error"?"Request
unsuccessful: "+b.statusText:this)})};c.next=function(){if(!F){g=g<i.length-1?g+1:0;c.load()}};c.prev=function(){if(!F){g=g?g-1:i.length-1;c.load()}};c.slideshow=function(){function
f(){z.text(a.slideshowStop).bind(W,function(){d=setTimeout(c.next,a.slideshowSpeed)}).bind(P,function(){clearTimeout(d)}).one(t,function(){e()});j.removeClass(b+"off").addClass(b+q)}var
e,d,b=k+"Slideshow_";z.bind(fb,function(){z.unbind();clearTimeout(d);j.removeClass(b+"off "+b+q)});e=function(){clearTimeout(d);z.text(a.slideshowStart).unbind(W+" "+P).one(t,function(){f();d=setTimeout(c.next,a.slideshowSpeed)});j.removeClass(b+q).addClass(b+"off")};if(a.slideshow&&i[1])a.slideshowAuto?f():e()};c.close=function(){if(w){w=d;b.event.trigger(X);a.onCleanup&&a.onCleanup.call(h);m.unbind("."+k+" ."+O);y.fadeTo("fast",0);j.stop().fadeTo("fast",0,function(){j.find("iframe").attr("src","about:blank");l.remove();j.add(y).css({opacity:1,cursor:u}).hide();try{R.focus()}catch(c){}setTimeout(function(){b.event.trigger(fb);a.onClosed&&a.onClosed.call(h)},1)})}};c.element=function(){return
b(h)};c.settings=eb;b(c.init)})(jQuery,this)
=======================================
--- /trunk/assets/plugins/qm/mcc.class.php Wed Mar 31 21:41:24 2010
+++ /trunk/assets/plugins/qm/mcc.class.php Fri Aug 20 07:21:43 2010
@@ -1,10 +1,10 @@
<?php
/**
- * Mc - Manager Control Class for MODx / Qm+
+ * QuickManager+ Manager Control Class
*
- * @author Mikko Lammi, www.maagit.fi (based on QuickManager by
Urique Dertlian, uri...@unix.am)
+ * @author Mikko Lammi, www.maagit.fi
* @license GNU General Public License (GPL),
http://www.gnu.org/copyleft/gpl.html
- * @version 1.3.4 updated 06/08/2009
+ * @version 1.5.1 updated 02/08/2010
*/

if(!class_exists('Mcc')) {
@@ -20,14 +20,13 @@
$this->tabs = array(
'general' => array('index'=>1,'id'=>'tabGeneral'),
'settings' => array('index'=>2,'id'=>'tabSettings'),
- 'meta' => array('index'=>3,'id'=>'tabMeta')
+ 'access' => array('index'=>3,'id'=>'tabAccess')
);

$this->sections = array(
'docsettings' => array('index'=>0,'name'=>'DocSettings'),
'content' => array('index'=>1,'name'=>'Content'),
- 'tvs' => array('index'=>2,'name'=>'TVs'),
- 'access' => array('index'=>3,'name'=>'Access')
+ 'tvs' => array('index'=>2,'name'=>'TVs')
);

$this->fields =
array('content','pagetitle','longtitle','menuindex','parent','description','alias','link_attributes','introtext','template','menutitle');
@@ -73,6 +72,13 @@
if(!isset($this->sections[$section])) return;
$sectionBodyIndex = $this->sections[$section]['index'];
$sectionHeaderIndex = $sectionBodyIndex -1;
+
+ // Handle docsettings
+ if ($sectionHeaderIndex == -1) {
+ $this->addLine('$("#tabGeneral table:eq(0)").hide()');
+ return;
+ }
+

$this->addLine('$("div.sectionHeader:eq('.$sectionHeaderIndex.')").hide()');

$this->addLine('$("div.sectionBody:eq('.$sectionBodyIndex.')").hide()');
}
=======================================
--- /trunk/assets/plugins/qm/qm.inc.php Sat Jun 12 02:14:38 2010
+++ /trunk/assets/plugins/qm/qm.inc.php Fri Aug 20 07:21:43 2010
@@ -1,10 +1,10 @@
<?php
/**
- * Qm+ QuickManager+
+ * QuickManager+
*
- * @author Mikko Lammi, www.maagit.fi (based on QuickManager by
Urique Dertlian, uri...@unix.am)
+ * @author Mikko Lammi, www.maagit.fi
* @license GNU General Public License (GPL),
http://www.gnu.org/copyleft/gpl.html
- * @version 1.3.4 updated 3/2/2010
+ * @version 1.5.1 updated 2/08/2010
*/

if(!class_exists('Qm')) {
@@ -13,7 +13,7 @@
var $modx;

//_______________________________________________________
- function Qm(&$modx, $jqpath, $loadmanagerjq, $loadfrontendjq,
$noconflictjq, $loadtb, $tbwidth, $tbheight, $hidefields, $hidetabs,
$hidesections, $addbutton, $tpltype, $tplid, $custombutton, $managerbutton,
$logout, $autohide) {
+ function Qm(&$modx, $jqpath='', $loadmanagerjq='', $loadfrontendjq='',
$noconflictjq='', $loadtb='', $tbwidth='', $tbheight='', $hidefields='',
$hidetabs='', $hidesections='', $addbutton='', $tpltype='', $tplid='',
$custombutton='', $managerbutton='', $logout='', $autohide='',
$editbuttons='', $editbclass='', $newbuttons='', $newbclass='',
$tvbuttons='', $tvbclass='') {
$this->modx = $modx;

// Get plugin parameters
@@ -33,8 +33,14 @@
$this->tplid = $tplid;
$this->custombutton = $custombutton;
$this->managerbutton = $managerbutton;
- $this->logout = $logout;
- $this->autohide = $autohide;
+ $this->logout = $logout;
+ $this->autohide = $autohide;
+ $this->editbuttons = $editbuttons;
+ $this->editbclass = $editbclass;
+ $this->newbuttons = $newbuttons;
+ $this->newbclass = $newbclass;
+ $this->tvbuttons = $tvbuttons;
+ $this->tvbclass = $tvbclass;

// Includes

include_once($this->modx->config['base_path'].'assets/plugins/qm/mcc.class.php');
@@ -51,7 +57,15 @@

// Get manager language
$manager_language = $this->modx->config['manager_language'];
-
+
+ // Individual user language setting (if set)
+ $query = 'SELECT setting_name, setting_value
FROM '.$this->modx->getFullTableName('user_settings').' WHERE
setting_name=\'manager_language\' AND user='.$_SESSION['mgrInternalKey'];
+ $records = $this->modx->db->query($query);
+ if ($this->modx->db->getRecordCount($records) > 0) {
+ $record = $this->modx->db->getRow($records);
+ $manager_language = $record['setting_value'];
+ }
+
// Include_once the language file
if(!isset($manager_language) |
| !file_exists(MODX_MANAGER_PATH."includes/lang/".$manager_language.".inc.php"))
{
$manager_language = "english"; // if not set, get the english
language file.
@@ -65,7 +79,7 @@
}

// Get event
- $e = & $this->modx->Event;
+ $e = &$this->modx->Event;

// Run plugin based on event
switch ($e->name) {
@@ -90,287 +104,523 @@
secureMgrDocument($key);

// Clear cache
- include_once
$this->modx->config['base_path']."manager/processors/cache_sync.class.processor.php";
- $sync = new synccache();
-
$sync->setCachepath($this->modx->config['base_path']."assets/cache/");
- $sync->setReport(true);
- $sync->emptyCache();
+ $this->clearCache();
+
+ // Different doc to be refreshed than the one we are
editing?
+ if (isset($_POST['qmrefresh'])) {
+ $id = intval($_POST['qmrefresh']);
+ }

// Redirect to clearer page which refreshes parent
window and closes modal box frame
-
$this->modx->sendRedirect($this->modx->config['base_url'].'assets/plugins/qm/close.php?id='.$id,
0, 'REDIRECT_HEADER', 'HTTP/1.1 301 Moved Permanently');
+
$this->modx->sendRedirect($this->modx->config['base_url'].'index.php?id='.$id.'&quickmanagerclose=1',
0, 'REDIRECT_HEADER', 'HTTP/1.1 301 Moved Permanently');
}

break;

// Display page in front-end
case 'OnWebPagePrerender':
-
- // If logged in manager but not in manager preview show
control buttons
- if(isset($_SESSION['mgrValidated']) &&
$_REQUEST['z'] != 'manprev') {
-
- $output = &$this->modx->documentOutput;
-
- // If logout break here
- if(isset($_REQUEST['logout'])) {
- $this->Logout();
- break;
- }
-
- $userID = $_SESSION['mgrInternalKey'];
- $docID = $this->modx->documentIdentifier;
- $doc = $this->modx->getDocument($docID);
-
- // Edit button
-
- $editButton = '
- <li>
- <a class="qmButton qmEdit colorbox"
href="'.$this->modx->config['site_url'].'manager/index.php?a=27&amp;id='.$docID.'&amp;quickmanager=1"><span> '.$_lang['edit_resource'].'</span></a>
- </li>
- ';
-
- // Check if user has manager access to current document
- $access = $this->checkAccess();
-
- // Does user have permissions to edit document
- if($access) $controls .= $editButton;
-
- if ($this->addbutton == 'true' && $access) {
- // Add button
- $addButton = '
+
+ // Get document id
+ $docID = $this->modx->documentIdentifier;
+
+ // Get page output
+ $output = &$this->modx->documentOutput;
+
+ // Close modal box after saving (previously close.php)
+ if (isset($_GET['quickmanagerclose'])) {
+
+ // Set url to refresh
+ $url = $this->modx->makeUrl($docID, '', '', 'full');
+
+ $output = '
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ <html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="content-type" content="text/html;
charset=utf-8" />
+ <title></title>
+ </head>
+ <body onload="javascript: parent.location.href =
\''.$url.'\';">
+ </body>
+ </html>
+ ';
+
+ break;
+ }
+
+ // QM+ TV edit
+ if(intval($_GET['quickmanagertv'] == 1) &&
$_GET['tvname'] != '' && $this->tvbuttons == 'true') {
+
+ $tvName = '';
+ $locked = FALSE;
+ $access = FALSE;
+ $save = 0;
+ $imagePreview = '';
+
+ // Includes
+ $manager_path = 'manager/';
+
include_once($manager_path.'includes/tmplvars.inc.php');
+
include_once($manager_path.'includes/tmplvars.commands.inc.php');
+
include_once($manager_path.'includes/tmplvars.format.inc.php');
+
+ // Get save status
+ if (isset($_POST['save'])) $save =
intval($_POST['save']);
+
+ // Get TV name
+ if (preg_match('/^([A-Za-z0-9&:;_\-]+)/i',
$_GET['tvname'])) $tvName = $_GET['tvname'];
+
+ // Get TV array
+ $tv = $this->modx->getTemplateVar($tvName, '*',
$docID);
+
+ // Handle default TVs
+ switch ($tvName) {
+ case 'pagetitle' : $tv['type'] = 'text';
$tv['caption'] = $this->getDefaultTvCaption($tvName); $access = TRUE; break;
+ case 'longtitle' : $tv['type'] = 'text';
$tv['caption'] = $this->getDefaultTvCaption($tvName); $access = TRUE; break;
+ case 'description' : $tv['type'] = 'text';
$tv['caption'] = $this->getDefaultTvCaption($tvName); $access = TRUE; break;
+ case 'content' : $tv['type'] = 'richtext';
$tv['caption'] = $this->getDefaultTvCaption($tvName); $access = TRUE; break;
+ case 'menutitle' : $tv['type'] = 'text';
$tv['caption'] = $this->getDefaultTvCaption($tvName); $access = TRUE; break;
+ case 'introtext' : $tv['type'] = 'textarea';
$tv['caption'] = $this->getDefaultTvCaption($tvName); $access = TRUE; break;
+ }
+
+ // Check TV access
+ if (!$access) { $access =
$this->checkTvAccess($tv['id']); }
+
+ // User can access TV
+ if ($access) {
+
+ // Show TV form
+ if ($save == 0) {
+
+ // Check is document locked? Someone else is
editing the document... //$_lang['lock_msg']
+ if ($this->checkLocked()) $locked = TRUE;
+
+ // Set document locked
+ else $this->setLocked(1);
+
+ // Handle RTE
+ if($tv['type'] == 'richtext') {
+ // Invoke OnRichTextEditorInit event
+ $eventOutput =
$this->modx->invokeEvent("OnRichTextEditorInit",
array('editor'=>$this->modx->config['which_editor'], 'elements'=>array('tv'.$tvName)));
+
+ if(is_array($eventOutput)) {
+ $editorHtml = implode("",$eventOutput);
+ }
+ }
+
+ // Render TV html
+ $tvHtml = renderFormElement($tv['type'],
$tv['name'], $tv['default_text'], $tv['elements'], $tv['value']);
+
+ // Get jQuery conflict mode
+ if ($this->noconflictjq == 'true') $jq_mode = '$j';
+ else $jq_mode = '$';
+ }
+
+ // Save TV
+ else {
+ // Remove document locked
+ $this->setLocked(0);
+
+ // Save TV
+ $this->saveTv($tvName);
+ }
+
+ // Page output: header
+ $output = '
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ <html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="content-type"
content="text/html; charset=utf-8" />
+ <title></title>
+ <link rel="stylesheet" type="text/css"
href="'.$this->modx->config['site_url'].'assets/plugins/qm/css/style.css" />
+ <!--[if IE]><link rel="stylesheet" type="text/css"
href="'.$this->modx->config['site_url'].'assets/plugins/qm/css/ie.css"
/><![endif]-->
+ <!--[if lte IE 7]><link rel="stylesheet"
type="text/css"
href="'.$this->modx->config['site_url'].'assets/plugins/qm/css/ie7.css"
/><![endif]-->
+ <script
src="'.$this->modx->config['site_url'].$this->jqpath.'"
type="text/javascript"></script>
+ </head>
+ ';
+
+ // Page output: TV form
+ if ($save == 0) {
+ $output .= '
+ <body id="qm-tv-body">
+ ';
+
+ // Document is locked message
+ if ($locked) {
+ $output .= '
+ <h1>'.$_lang['locked'].'</h1>
+ <div
id="qm-tv-description">'.$_lang['lock_msg'].'</div>
+ ';
+ }
+
+ // Normal form
+ else {
+ // Image preview
+ if ($tv['type'] == 'image') {
+ $imagePreview = '
+ <div id="qm-tv-image-preview"><img
class="qm-tv-image-preview-drskip qm-tv-image-preview-skip"
src="'.$this->modx->config['site_url'].$tv['value'].'" alt="" /></div>
+ <script type="text/javascript"
charset="UTF-8">
+
+ $(document).ready(function() {
+
+ var previewImage
= "#tv'.$tvName.'";
+ var siteUrl
= "'.$this->modx->config['site_url'].'";
+
+ OriginalSetUrl = SetUrl; // Copy
the existing Image browser SetUrl function
+ SetUrl = function(url, width, height, alt)
{ // Redefine it to also tell the preview to update
+ OriginalSetUrl(url, width, height, alt);
+ $(previewImage).trigger("change");
+ }
+
+ $(previewImage).change(function() {
+
$("#qm-tv-image-preview").empty();
+ if ($(previewImage).val()!=""
){
+
$("#qm-tv-image-preview").append("<img class=\"qm-tv-image-preview-drskip
qm-tv-image-preview-skip\" src=\"" + siteUrl + $(previewImage).val() + "\"
alt=\"\" />");
+ }
+ else{
+
$("#qm-tv-image-preview").append("");
+ }
+ });
+ });
+
+ </script>
+ ';
+ }
+
+ $output .= '
+ <form id="qm-tv-form" name="mutate"
method="post" enctype="multipart/form-data"
action="'.$this->modx->config['site_url'].'index.php?id='.$docID.'&amp;quickmanagertv=1&amp;tvname='.$tvName.'">
+ <input type="hidden" name="tvid"
value="'.$tv['id'].'" />
+ <input id="save" type="hidden" name="save"
value="1" />
+
+ <div id="qm-tv-actions">
+ <div class="qm-cancel"><a href="#"
onclick="parent.'.$jq_mode.'.fn.colorbox.close(); return
false;"><span>'.$_lang['cancel'].'</span></a></div>
+ <div class="qm-save"><a href="#"
onclick="document.forms[\'mutate\'].submit(); return
false;"><span>'.$_lang['save'].'</span></a></div>
+ </div>
+
+ <h1>'.$tv['caption'].'</h1>
+
+ <div
id="qm-tv-description">'.$tv['description'].'</div>
+
+ <div id="qm-tv-tv"
class="qm-tv-'.$tv['type'].'">
+ '.$tvHtml.'
+ </div>
+
+ '.$imagePreview.'
+
+ </form>
+ '.$editorHtml.'
+ ';
+ }
+ }
+
+ // Page output: close modal box and refresh parent
frame
+ else $output .= '<body
onload="parent.location.reload();">';
+
+ // Page output: footer
+ $output .= '
+ </body>
+ </html>
+ ';
+ }
+
+ else {
+ $output = 'Error: Access denied.';
+ }
+ }
+
+ // QM+ with toolbar
+ else {
+
+ if(isset($_SESSION['mgrValidated']) &&
$_REQUEST['z'] != 'manprev') {
+
+ // If logout break here
+ if(isset($_REQUEST['logout'])) {
+ $this->Logout();
+ break;
+ }
+
+ $userID = $_SESSION['mgrInternalKey'];
+ //$docID = $this->modx->documentIdentifier;
+ $doc = $this->modx->getDocument($docID);
+
+ // Edit button
+
+ $editButton = '
<li>
- <a class="qmButton colorbox"
href="'.$this->modx->config['site_url'].'manager/index.php?a=4&amp;pid='.$docID.'&amp;quickmanager=1">'.$_lang['create_resource_here'].'</a>
+ <a class="qmButton qmEdit colorbox"
href="'.$this->modx->config['site_url'].'manager/index.php?a=27&amp;id='.$docID.'&amp;quickmanager=1"><span> '.$_lang['edit_resource'].'</span></a>
</li>
';

- // Does user have permissions to add document
- if($this->modx->hasPermission('new_document'))
$controls .= $addButton;
- }
-
- // Custom add buttons if not empty and enough
permissions
- if ($this->custombutton != '') {
-
- $buttons = explode("||", $this->custombutton); //
Buttons are divided by "#"
-
- // Parse buttons
- foreach($buttons as $key => $field) {
- $field = substr($field, 1, -1); // Trim "'"
from beginning and from end
- $buttonParams = explode("','", $field); //
Button params are divided by "','"
-
- $buttonTitle = $buttonParams[0];
- $buttonAction = $buttonParams[1]; // Contains
URL if this is not add button
- $buttonParentId = $buttonParams[2]; // Is
empty is this is not add button
- $buttonTplId = $buttonParams[3];
-
- // Button visible for all
- if ($buttonParams[4] == '') {
- $showButton = TRUE;
- }
- // Button is visible for specific user roles
- else {
- $showButton = FALSE;
-
- // Get user roles the button is visible for
- $buttonRoles = explode(",",
$buttonParams[4]); // Roles are divided by ','
-
- // Check if user role is found
- foreach($buttonRoles as $key => $field) {
- if ($field == $_SESSION['mgrRole']) {
- $showButton = TRUE;
+ // Check if user has manager access to current
document
+ $access = $this->checkAccess();
+
+ // Does user have permissions to edit document
+ if($access) $controls .= $editButton;
+
+ if ($this->addbutton == 'true' && $access) {
+ // Add button
+ $addButton = '
+ <li>
+ <a class="qmButton qmAdd colorbox"
href="'.$this->modx->config['site_url'].'manager/index.php?a=4&amp;pid='.$docID.'&amp;quickmanager=1"><span>'.$_lang['create_resource_here'].'</span></a>
+ </li>
+ ';
+
+ // Does user have permissions to add document
+ if($this->modx->hasPermission('new_document'))
$controls .= $addButton;
+ }
+
+ // Custom add buttons if not empty and enough
permissions
+ if ($this->custombutton != '') {
+
+ // Replace [*id*] with current doc id
+ $this->custombutton = str_replace("[*id*]",
$docID, $this->custombutton);
+
+ // Handle [~id~] links
+ $this->custombutton =
$this->modx->rewriteUrls($this->custombutton);
+
+ $buttons = explode("||", $this->custombutton);
// Buttons are divided by "||"
+
+ // Custom buttons class index
+ $i = 0;
+
+ // Parse buttons
+ foreach($buttons as $key => $field) {
+ $i++;
+
+ $field = substr($field, 1, -1); //
Trim "'" from beginning and from end
+ $buttonParams = explode("','", $field); //
Button params are divided by "','"
+
+ $buttonTitle = $buttonParams[0];
+ $buttonAction = $buttonParams[1]; //
Contains URL if this is not add button
+ $buttonParentId = $buttonParams[2]; // Is
empty is this is not add button
+ $buttonTplId = $buttonParams[3];
+
+ // Button visible for all
+ if ($buttonParams[4] == '') {
+ $showButton = TRUE;
+ }
+ // Button is visible for specific user
roles
+ else {
+ $showButton = FALSE;
+
+ // Get user roles the button is
visible for
+ $buttonRoles = explode(",",
$buttonParams[4]); // Roles are divided by ','
+
+ // Check if user role is found
+ foreach($buttonRoles as $key =>
$field) {
+ if ($field ==
$_SESSION['mgrRole']) {
+ $showButton = TRUE;
+ }
}
}
- }
-
- // Show custom button
- if ($showButton) {
- switch ($buttonAction)
- {
- case 'new':
- $customButton = '
- <li>
- <a class="qmButton colorbox"
href="'.$this->modx->config['site_url'].'manager/index.php?a=4&amp;pid='.$buttonParentId.'&amp;quickmanager=1&amp;customaddtplid='.$buttonTplId.'">'.$buttonTitle.'</a>
- </li>
- ';
- break;
-
- case 'link':
- $customButton = '
- <li>
- <a class="qmButton"
href="'.$buttonParentId.'" >'.$buttonTitle.'</a>
- </li>
- ';
- break;
-
- case 'modal':
- $customButton = '
- <li>
- <a class="qmButton colorbox"
href="'.$buttonParentId.'" >'.$buttonTitle.'</a>
- </li>
- ';
- break;
- }
- $controls .= $customButton;
- }
- }
- }
-
- // Not implemented yet
- //$delButton = '<a class="button delete"
title="'.$doc['pagetitle'].'&raquo; '.$_lang['delete_document'].'" href="#"
onclick="if(confirm(\'`'.$doc['pagetitle'].'`\n\n'.$_lang['confirm_delete_document'].'\')==true)
document.location.href=\''.$this->modx->config['site_url'].'manager/index.php?a=4&id='.$docID.'\';return
false;">'.$_lang['delete_document'].'</a>';
- //if($this->modx->hasPermission('delete_document'))
$controls.=$delButton;
-
- // Go to Manager button
- if ($this->managerbutton == 'true') {
- $managerButton = '
+
+ // Show custom button
+ if ($showButton) {
+ switch ($buttonAction)
+ {
+ case 'new':
+ $customButton = '
+ <li class="qm-custom-'.$i.'">
+ <a class="qmButton qmCustom
colorbox"
href="'.$this->modx->config['site_url'].'manager/index.php?a=4&amp;pid='.$buttonParentId.'&amp;quickmanager=1&amp;customaddtplid='.$buttonTplId.'"><span>'.$buttonTitle.'</span></a>
+ </li>
+ ';
+ break;
+
+ case 'link':
+ $customButton = '
+ <li class="qm-custom-'.$i.'">
+ <a class="qmButton qmCustom"
href="'.$buttonParentId.'" ><span>'.$buttonTitle.'</span></a>
+ </li>
+ ';
+ break;
+
+ case 'modal':
+ $customButton = '
+ <li class="qm-custom-'.$i.'">
+ <a class="qmButton qmCustom
colorbox" href="'.$buttonParentId.'" ><span>'.$buttonTitle.'</span></a>
+ </li>
+ ';
+ break;
+ }
+ $controls .= $customButton;
+ }
+ }
+ }
+
+ // Go to Manager button
+ if ($this->managerbutton == 'true') {
+ $managerButton = '
+ <li>
+ <a class="qmButton qmManager"
title="'.$_lang['manager'].'"
href="'.$this->modx->config['site_url'].'manager/"
><span>'.$_lang['manager'].'</span></a>
+ </li>
+ ';
+ $controls .= $managerButton;
+ }
+
+ // Logout button
+ $logout =
$this->modx->config['site_url'].'manager/index.php?a=8&amp;quickmanager=logout&amp;logoutid='.$docID;
+ $logoutButton = '
<li>
- <a class="qmButton" title="'.$_lang['manager'].'"
href="'.$this->modx->config['site_url'].'manager/"
>'.$_lang['manager'].'</a>
+ <a id="qmLogout" class="qmButton qmLogout"
title="'.$_lang['logout'].'" href="'.$logout.'"
><span>'.$_lang['logout'].'</span></a>
</li>
';
- $controls .= $managerButton;
- }
-
- // Logout button
- $logout =
$this->modx->config['site_url'].'manager/index.php?a=8&amp;quickmanager=logout&amp;logoutid='.$docID;
- $logoutButton = '
- <li>
- <a id="qmLogout" class="qmButton"
title="'.$_lang['logout'].'" href="'.$logout.'" >'.$_lang['logout'].'</a>
- </li>
- ';
- $controls .= $logoutButton;
-
- // Add action buttons
- $editor = '
- <div id="qmEditorClosed"></div>
-
- <div id="qmEditor">
-
- <a id="qmClose" class="qmButton qmClose" href="#"
onclick="javascript: return false;">X</a>
-
- <ul>
- <li><a id="qmLogoClose" class="qmClose" href="#"
onclick="javascript: return false;"></a></li>
- '.$controls.'
- </ul>
- </div>';
-
- $css = '
- <link rel="stylesheet" type="text/css"
href="'.$this->modx->config['site_url'].'assets/plugins/qm/css/style.css" />
- <!--[if IE]><link rel="stylesheet" type="text/css"
href="'.$this->modx->config['site_url'].'assets/plugins/qm/css/ie.css"
/><![endif]-->
- <!--[if lte IE 7]><link rel="stylesheet"
type="text/css"
href="'.$this->modx->config['site_url'].'assets/plugins/qm/css/ie7.css"
/><![endif]-->
- ';
-
- // Autohide toolbar? Default: true
- if ($this->autohide == 'false') {
- $css .= '
- <style type="text/css">
- #qmEditor, #qmEditorClosed { top: 0px; }
- </style>
- ';
- }
-
- // Insert jQuery and ColorBox in head if needed
- if ($this->loadfrontendjq == 'true') $head .= '<script
src="'.$this->modx->config['site_url'].$this->jqpath.'"
type="text/javascript"></script>';
- if ($this->loadtb == 'true') {
- $head .= '
- <link type="text/css" media="screen"
rel="stylesheet"
href="'.$this->modx->config['site_url'].'assets/plugins/qm/css/colorbox.css"
/>
-
- <style type="text/css">
- .cboxIE #cboxTopLeft{background:transparent;
filter:
progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.$this->modx->config['site_url'].'assets/plugins/qm/css/images/internet_explorer/borderTopLeft.png,
sizingMethod=\'scale\');}
- .cboxIE #cboxTopCenter{background:transparent;
filter:
progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.$this->modx->config['site_url'].'assets/plugins/qm/css/images/internet_explorer/borderTopCenter.png,
sizingMethod=\'scale\');}
- .cboxIE #cboxTopRight{background:transparent;
filter:
progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.$this->modx->config['site_url'].'assets/plugins/qm/css/images/internet_explorer/borderTopRight.png,
sizingMethod=\'scale\');}
- .cboxIE #cboxBottomLeft{background:transparent;
filter:
progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.$this->modx->config['site_url'].'assets/plugins/qm/css/images/internet_explorer/borderBottomLeft.png,
sizingMethod=\'scale\');}
- .cboxIE #cboxBottomCenter{background:transparent;
filter:
progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.$this->modx->config['site_url'].'assets/plugins/qm/css/images/internet_explorer/borderBottomCenter.png,
sizingMethod=\'scale\');}
- .cboxIE #cboxBottomRight{background:transparent;
filter:
progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.$this->modx->config['site_url'].'assets/plugins/qm/css/images/internet_explorer/borderBottomRight.png,
sizingMethod=\'scale\');}
- .cboxIE #cboxMiddleLeft{background:transparent;
filter:
progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.$this->modx->config['site_url'].'assets/plugins/qm/css/images/internet_explorer/borderMiddleLeft.png,
sizingMethod=\'scale\');}
- .cboxIE #cboxMiddleRight{background:transparent;
filter:
progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.$this->modx->config['site_url'].'assets/plugins/qm/css/images/internet_explorer/borderMiddleRight.png,
sizingMethod=\'scale\');}
- </style>
-
- <script type="text/javascript"
src="'.$this->modx->config['site_url'].'assets/plugins/qm/js/jquery.colorbox-min.js"></script>
+ $controls .= $logoutButton;
+
+ // Add action buttons
+ $editor = '
+ <div id="qmEditorClosed"></div>
+
+ <div id="qmEditor">
+
+ <a id="qmClose" class="qmButton qmClose" href="#"
onclick="javascript: return false;">X</a>
+
+ <ul>
+ <li><a id="qmLogoClose" class="qmClose" href="#"
onclick="javascript: return false;"></a></li>
+ '.$controls.'
+ </ul>
+ </div>';
+
+ $css = '
+ <link rel="stylesheet" type="text/css"
href="'.$this->modx->config['site_url'].'assets/plugins/qm/css/style.css" />
+ <!--[if IE]><link rel="stylesheet" type="text/css"
href="'.$this->modx->config['site_url'].'assets/plugins/qm/css/ie.css"
/><![endif]-->
+ <!--[if lte IE 7]><link rel="stylesheet"
type="text/css"
href="'.$this->modx->config['site_url'].'assets/plugins/qm/css/ie7.css"
/><![endif]-->
';
- }
-
- // Insert ColorBox jQuery definitions for QuickManager+
- $head .= '
- <script type="text/javascript">
- ';
-
- // jQuery in noConflict mode
- if ($this->noconflictjq == 'true')
- {
+
+ // Autohide toolbar? Default: true
+ if ($this->autohide == 'false') {
+ $css .= '
+ <style type="text/css">
+ #qmEditor, #qmEditorClosed { top: 0px; }
+ </style>
+ ';
+ }
+
+ // Insert jQuery and ColorBox in head if needed
+ if ($this->loadfrontendjq == 'true')
$head .= '<script src="'.$this->modx->config['site_url'].$this->jqpath.'"
type="text/javascript"></script>';
+ if ($this->loadtb == 'true') {
+ $head .= '
+ <link type="text/css" media="screen"
rel="stylesheet"
href="'.$this->modx->config['site_url'].'assets/plugins/qm/css/colorbox.css"
/>
+
+ <style type="text/css">
+ .cboxIE #cboxTopLeft{background:transparent;
filter:
progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.$this->modx->config['site_url'].'assets/plugins/qm/css/images/internet_explorer/borderTopLeft.png,
sizingMethod=\'scale\');}
+ .cboxIE #cboxTopCenter{background:transparent;
filter:
progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.$this->modx->config['site_url'].'assets/plugins/qm/css/images/internet_explorer/borderTopCenter.png,
sizingMethod=\'scale\');}
+ .cboxIE #cboxTopRight{background:transparent;
filter:
progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.$this->modx->config['site_url'].'assets/plugins/qm/css/images/internet_explorer/borderTopRight.png,
sizingMethod=\'scale\');}
+ .cboxIE
#cboxBottomLeft{background:transparent; filter:
progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.$this->modx->config['site_url'].'assets/plugins/qm/css/images/internet_explorer/borderBottomLeft.png,
sizingMethod=\'scale\');}
+ .cboxIE
#cboxBottomCenter{background:transparent; filter:
progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.$this->modx->config['site_url'].'assets/plugins/qm/css/images/internet_explorer/borderBottomCenter.png,
sizingMethod=\'scale\');}
+ .cboxIE
#cboxBottomRight{background:transparent; filter:
progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.$this->modx->config['site_url'].'assets/plugins/qm/css/images/internet_explorer/borderBottomRight.png,
sizingMethod=\'scale\');}
+ .cboxIE
#cboxMiddleLeft{background:transparent; filter:
progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.$this->modx->config['site_url'].'assets/plugins/qm/css/images/internet_explorer/borderMiddleLeft.png,
sizingMethod=\'scale\');}
+ .cboxIE
#cboxMiddleRight{background:transparent; filter:
progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.$this->modx->config['site_url'].'assets/plugins/qm/css/images/internet_explorer/borderMiddleRight.png,
sizingMethod=\'scale\');}
+ </style>
+
+ <script type="text/javascript"
src="'.$this->modx->config['site_url'].'assets/plugins/qm/js/jquery.colorbox-min.js"></script>
+ ';
+ }
+
+ // Insert ColorBox jQuery definitions for
QuickManager+
$head .= '
- var $j = jQuery.noConflict();
- $j(document).ready(function($)
- ';
-
- $jvar = 'j';
- }
-
- // jQuery in normal mode
- else {
- $head .= '$(document).ready(function($)';
-
- $jvar = '';
- }
-
- $head .= '
- {
-
$("a.colorbox").colorbox({width:"'.$this->tbwidth.'",
height:"'.$this->tbheight.'", iframe:true, overlayClose:false, opacity:0.5,
transition:"fade", speed:150});
-
- // Bindings
- $().bind("cbox_open", function(){
- $("body").css({"overflow":"hidden"});
- $("html").css({"overflow":"hidden"});
- $("#qmEditor").css({"display":"none"});
- });
- $().bind("cbox_closed", function(){
- $("body").css({"overflow":"auto"});
- $("html").css({"overflow":"auto"});
- $("#qmEditor").css({"display":"block"});
- // Remove manager lock by going to home
page
- $'.$jvar.'.ajax({ type: "GET",
url: "'.$this->modx->config['site_url'].'manager/index.php?a=2" });
- });
-
- // Hide QM+ if cookie found
- if (getCookie("hideQM") == 1)
- {
- $("#qmEditor").css({"display":"none"});
-
$("#qmEditorClosed").css({"display":"block"});
- }
-
- // Hide QM+
- $(".qmClose").click(function () {
- $("#qmEditor").hide("normal");
- $("#qmEditorClosed").show("normal");
- document.cookie = "hideQM=1; path=/;";
- });
-
- // Show QM+
- $("#qmEditorClosed").click(function () {
- {
- $("#qmEditorClosed").hide("normal");
- $("#qmEditor").show("normal");
- document.cookie = "hideQM=0; path=/;";
- }
+ <script type="text/javascript">
+ ';
+
+ // jQuery in noConflict mode
+ if ($this->noconflictjq == 'true')
+ {
+ $head .= '
+ var $j = jQuery.noConflict();
+ $j(document).ready(function($)
+ ';
+
+ $jvar = 'j';
+ }
+
+ // jQuery in normal mode
+ else {
+ $head .= '$(document).ready(function($)';
+
+ $jvar = '';
+ }
+
+ $head .= '
+ {
+
$("a.colorbox").colorbox({width:"'.$this->tbwidth.'",
height:"'.$this->tbheight.'", iframe:true, overlayClose:false, opacity:0.5,
transition:"fade", speed:150});
+
+ // Bindings
+ $().bind("cbox_open", function(){
+ $("body").css({"overflow":"hidden"});
+ $("html").css({"overflow":"hidden"});
+ $("#qmEditor").css({"display":"none"});
+ });
+ $().bind("cbox_closed", function(){
+ $("body").css({"overflow":"auto"});
+ $("html").css({"overflow":"auto"});
+
$("#qmEditor").css({"display":"block"});
+ // Remove manager lock by going to
home page
+ $'.$jvar.'.ajax({ type: "GET",
url: "'.$this->modx->config['site_url'].'manager/index.php?a=2" });
+ });
+
+ // Hide QM+ if cookie found
+ if (getCookie("hideQM") == 1)
+ {
+ $("#qmEditor").css({"display":"none"});
+
$("#qmEditorClosed").css({"display":"block"});
+ }
+
+ // Hide QM+
+ $(".qmClose").click(function () {
+ $("#qmEditor").hide("normal");
+ $("#qmEditorClosed").show("normal");
+ document.cookie = "hideQM=1; path=/;";
+ });
+
+ // Show QM+
+ $("#qmEditorClosed").click(function () {
+ {
+
$("#qmEditorClosed").hide("normal");
+ $("#qmEditor").show("normal");
+ document.cookie = "hideQM=0;
path=/;";
+ }
+ });
+
});
-
- });
-
- function getCookie(cookieName)
- {
- var results = document.cookie.match
( "(^|;) ?" + cookieName + "=([^;]*)(;|$)" );
-
- if (results) return (unescape(results[2]));
- else return null;
- }
-
- </script>
- ';
-
- // Insert QM+ css in head
- $head .= $css;
-
- // Place Qm head information in head, just before
</head> tag
- $output = preg_replace('~(</head>)~i', $head . '\1',
$output);
-
- // Insert editor toolbar right after <body> tag
- $output = preg_replace('~(<body[^>]*>)~i', '\1' .
$editor, $output);
+
+ function getCookie(cookieName)
+ {
+ var results = document.cookie.match
( "(^|;) ?" + cookieName + "=([^;]*)(;|$)" );
+
+ if (results) return (unescape(results[2]));
+ else return null;
+ }
+
+ </script>
+ ';
+
+ // Insert QM+ css in head
+ $head .= $css;
+
+ // Place QM+ head information in head, just before
</head> tag
+ $output = preg_replace('~(</head>)~i',
$head . '\1', $output);
+
+ // Insert editor toolbar right after <body> tag
+ $output = preg_replace('~(<body[^>]*>)~i', '\1' .
$editor, $output);
+
+ // Search and create edit buttons in to the content
+ if ($this->editbuttons == 'true' && $access) {
+ $output =
preg_replace('/<!-- '.$this->editbclass.' ([0-9]+) \'([A-Za-z0-9&:;_\-
]+)\' -->/', '<div class="'.$this->editbclass.'"><a class="colorbox"
href="'.$this->modx->config['site_url'].'manager/index.php?a=27&amp;id=$1&amp;quickmanager=1&amp;qmrefresh='.$docID.'"><span>$2</span></a></div>',
$output);
+ }
+
+ // Search and create new document buttons in to
the content
+ if ($this->newbuttons == 'true' && $access) {
+ $output =
preg_replace('/<!-- '.$this->newbclass.' ([0-9]+) ([0-9]+)
\'([A-Za-z0-9&:;_\- ]+)\' -->/', '<div class="'.$this->newbclass.'"><a
class="colorbox"
href="'.$this->modx->config['site_url'].'manager/index.php?a=4&amp;pid=$1&amp;quickmanager=1&amp;customaddtplid=$2"><span>$3</span></a></div>',
$output);
+ }
+
+ // Search and create new document buttons in to
the content
+ if ($this->tvbuttons == 'true' && $access) {
+ // Set and get user doc groups for TV
permissions
+ $this->docGroup = '';
+ $mrgDocGroups = $_SESSION['mgrDocgroups'];
+ if (!empty($mrgDocGroups)) $this->docGroup =
implode(",", $mrgDocGroups);
+
+ // Create TV buttons and check TV permissions
+ $output =
preg_replace_callback('/<!-- '.$this->tvbclass.' ([A-Za-z0-9&:;_\- ]+)
-->/', array(&$this, 'createTvButtons'), $output);
+ }
+ }
}

break;
@@ -448,7 +698,7 @@
else $jq_mode = '$';

// Add action buttons
- $mc->addLine('var controls = "<div style=\"padding:4px
0;position:fixed;top:10px;right:-10px;z-index:1000\" id=\"qmcontrols\"
class=\"actionButtons\"><ul><li><a href=\"#\"
onclick=\"setBaseUrl(\''.$this->modx->config['base_url'].'\');
documentDirty=false;document.mutate.save.click();return false;\"><img
src=\"media/style/'.$qm_theme.'/images/icons/save.png\"
/>'.$_lang['save'].'</a></li><li><a href=\"#\"
onclick=\"parent.'.$jq_mode.'.fn.colorbox.close(); return false;\"><img
src=\"media/style/'.$qm_theme.'/images/icons/stop.png\"/>'.$_lang['cancel'].'</a></li></ul></div>";');
+ $mc->addLine('var controls = "<div style=\"padding:4px
0;position:fixed;top:10px;right:-10px;z-index:1000\" id=\"qmcontrols\"
class=\"actionButtons\"><ul><li><a href=\"#\"
onclick=\"documentDirty=false;document.mutate.save.click();return
false;\"><img src=\"media/style/'.$qm_theme.'/images/icons/save.png\"
/>'.$_lang['save'].'</a></li><li><a href=\"#\"
onclick=\"documentDirty=false; parent.'.$jq_mode.'.fn.colorbox.close();
return false;\"><img
src=\"media/style/'.$qm_theme.'/images/icons/stop.png\"/>'.$_lang['cancel'].'</a></li></ul></div>";');

// Modify head
$mc->head = '<script
type="text/javascript">document.body.style.display="none";</script>';
@@ -483,23 +733,17 @@
$mc->hideSection($field);
}
}
-
- // Set active doc script (needed if alias is changed)
- $setActiveDoc = '
- <script type="text/javascript">
- function setBaseUrl(baseUrl)
- {
- // Set base url
- document.cookie = "baseUrlQM=" + baseUrl + ";
path=/;";
- }
- </script>
- ';
-
- // Hidden field to verify that QM+ call exists
- $hiddenField = '<input type="hidden"
name="quickmanager" value="1" />';
+
+ // Hidden field to verify that QM+ call exists
+ $hiddenFields = '<input type="hidden"
name="quickmanager" value="1" />';
+
+ // Different doc to be refreshed?
+ if (isset($_REQUEST['qmrefresh'])) {
+ $hiddenFields .= '<input type="hidden"
name="qmrefresh" value="'.intval($_REQUEST['qmrefresh']).'" />';
+ }

// Output
- $e->output($mc->Output().$setActiveDoc.$hiddenField);
+ $e->output($mc->Output().$hiddenFields);
}

break;
@@ -543,7 +787,7 @@
// Get document groups for current user
$mrgDocGroups = $_SESSION['mgrDocgroups'];
if (!empty($mrgDocGroups)) {
- $docGroup= implode(",", $mrgDocGroups);
+ $docGroup = implode(",", $mrgDocGroups);

// Check if user has access to current document
$sql= "SELECT id FROM {$table} WHERE document =
{$docID} AND document_group IN ({$docGroup})";
@@ -561,6 +805,244 @@

return $access;
}
+
+ // Function from: manager/processors/cache_sync.class.processor.php
+ //_____________________________________________________
+ function getParents($id, $path = '') { // modx:returns child's parent
+ global $modx;
+ if(empty($this->aliases)) {
+ $sql = "SELECT id, IF(alias='', id, alias) AS alias, parent
FROM ".$modx->getFullTableName('site_content');
+ $qh = $modx->db->query($sql);
+ if ($qh && $modx->db->getRecordCount($qh) > 0) {
+ while ($row = $modx->db->getRow($qh)) {
+ $this->aliases[$row['id']] = $row['alias'];
+ $this->parents[$row['id']] = $row['parent'];
+ }
+ }
+ }
+ if (isset($this->aliases[$id])) {
+ $path = $this->aliases[$id] . ($path != '' ? '/' : '') . $path;
+ return $this->getParents($this->parents[$id], $path);
+ }
+ return $path;
+ }
+
+ // Create TV buttons if user has permissions to TV
+ //_____________________________________________________
+ function createTvButtons($matches) {
+
+ $access = FALSE;
+ $table = $this->modx->getFullTableName('site_tmplvar_access');
+ $docID = $this->modx->documentIdentifier;
+
+ // Get TV caption for button title
+ $tv = $this->modx->getTemplateVar($matches[1]);
+ $caption = $tv['caption'];
+
+ // If caption is empty this must be a "build-in-tv-field" like
pagetitle etc.
+ if ($caption == '') {
+
+ // Allowed for all
+ $access = TRUE;
+
+ // Resolve caption
+ $caption = $this->getDefaultTvCaption($matches[1]);
+ }
+
+ // Check TV access
+ else {
+ $access = $this->checkTvAccess($tv['id']);
+ }
+
+ // Return TV button link if access
+ if ($access && $caption != '') {
+ return '<div class="'.$this->tvbclass.'"><a class="colorbox"
href="'.$this->modx->config['site_url'].'index.php?id='.$docID.'&amp;quickmanagertv=1&amp;tvname='.$matches[1].'"><span>'.$caption.'</span></a></div>';
+ }
+ }
+
+ // Check user access to TV
+ //_____________________________________________________
+ function checkTvAccess($tvId) {
+ $access = FALSE;
+ $table = $this->modx->getFullTableName('site_tmplvar_access');
+
+ // If user is admin (role = 1)
+ if ($_SESSION['mgrRole'] == 1 && !$access) { $access = TRUE; }
+
+ // Check permission to TV, is TV in document group?
+ if (!$access) {
+ $sql = "SELECT id FROM {$table} WHERE tmplvarid = {$tvId}";
+ $result = $this->modx->db->query($sql);
+ $rowCount = $this->modx->recordCount($result);
+ // TV is not in any document group
+ if ($rowCount == 0) { $access = TRUE; }
+ }
+
+ // Check permission to TV, TV is in document group
+ if (!$access && $this->docGroup != '') {
+ $sql = "SELECT id FROM {$table} WHERE tmplvarid = {$tvId} AND
documentgroup IN ({$this->docGroup})";
+ $result = $this->modx->db->query($sql);
+ $rowCount = $this->modx->recordCount($result);
+ if ($rowCount >= 1) { $access = TRUE; }
+ }
+
+ return $access;
+ }
+
+ // Get default TV ("build-in" TVs) captions
+ //_____________________________________________________
+ function getDefaultTvCaption($name) {
+
+ global $_lang;
+ $caption = '';
+
+ switch ($name) {
+ case 'pagetitle' : $caption = $_lang['resource_title'];
break;
***The diff for this file has been truncated for email.***
=======================================
--- /trunk/assets/plugins/qm/readme.html Sat Jun 12 03:07:15 2010
+++ /trunk/assets/plugins/qm/readme.html Fri Aug 20 07:21:43 2010
@@ -2,17 +2,32 @@
<html lang="en"><head>


+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

<meta content="text/html; charset=UTF-8"
http-equiv="content-type"><title>QuickManager+</title></head><body
style="font-family: verdana,helvetica; line-height: 20px; font-size: 14px;">
<h1 style="border-bottom: 1px solid rgb(0, 0, 0); padding-bottom:
12px;">QuickManager+</h1>

-@author&nbsp;Mikko Lammi, <a href="http://www.maagit.fi"
target="_blank">www.maagit.fi</a> (based on QuickManager by Urique
-Dertlian, uri...@unix.am)<br>
+@author&nbsp;Mikko Lammi, <a href="http://www.maagit.fi/quickmanager-plus"
target="_blank">www.maagit.fi/quickmanager-plus</a><br>

@license GNU General Public
License (GPL v3),&nbsp;<a href="http://www.gnu.org/copyleft/gpl.html"
target="_blank">www.gnu.org/copyleft/gpl.html</a><br>

-@version 1.3.4.1 updated 4/2/2010<br>
+@version 1.5.1 updated 02/08/2010<br>

@requirements MODx 1.0.0+

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
@@ -20,25 +35,7 @@

<h2>Description</h2>

-QuickManager+ is an alternative to QuickEdit to quick access and
-control content from front-end.<br>
-
-<br>
-
-This is a heavily modified version of the original QuickManager plugin
-with extensive set of configuration options.<br>
-
-<br>
-
-Known issues:
-<ul>
-
- <li>Parent selection doesn't work at all with QuickManager+ due
-missing menu tree frame.</li>
- <li>Couple harmless JavaScript errors due missing menu tree
-which is normally present in MODx manager.</li>
-</ul>
-
+QuickManager+ enables front-end content editing.<br>
<h2>Installation</h2>

If this is an update from earlier version delete first your old
@@ -54,109 +51,175 @@
<ul>

<li>Name: QuickManager+ </li>
- <li>Description: &lt;strong&gt;1.3.4.1&lt;/strong&gt; Enables front-end
-content editing support</li>
+ <li>Description: &lt;strong&gt;1.5.1&lt;/strong&gt; Enables front-end
+content editing<br>
+</li>
</ul>

<h3>3. Copy paste plugin code:</h3>
<table style="text-align: left; width: 100%;" border="1" cellpadding="2"
cellspacing="2">
<tbody>
<tr>
- <td style="vertical-align: top;"><span style="font-family: Courier
New,Courier,monospace;">$show = TRUE;</span><br style="font-family: Courier
New,Courier,monospace;">
-
-
- <br style="font-family: Courier New,Courier,monospace;">
-
-
- <span style="font-family: Courier New,Courier,monospace;">if
-($disabled&nbsp; != '') {</span><br style="font-family: Courier
New,Courier,monospace;">
-
-
- <span style="font-family: Courier
New,Courier,monospace;">&nbsp;&nbsp;&nbsp;
-$arr = explode(",", $disabled );</span><br style="font-family: Courier
New,Courier,monospace;">
-
-
- <span style="font-family: Courier
New,Courier,monospace;">&nbsp;&nbsp;&nbsp;
-if (in_array($modx-&gt;documentIdentifier, $arr)) {</span><br
style="font-family: Courier New,Courier,monospace;">
-
-
- <span style="font-family: Courier
New,Courier,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-$show = FALSE;</span><br style="font-family: Courier
New,Courier,monospace;">
+ <td style="vertical-align: top;"><span style="font-family: Courier
New,Courier,monospace;">/**<br>
+&nbsp;* QuickManager+<br>
+&nbsp;*<br>
+&nbsp;* @author Mikko Lammi, www.maagit.fi/quickmanager-plus<br>
+&nbsp;* @license GNU General Public License (GPL),
http://www.gnu.org/copyleft/gpl.html<br>
+&nbsp;* @version 1.5.1 updated 02/08/2010&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>
+&nbsp;*/<br>
+ <br>
+$show = TRUE;<br>
+ <br>
+if ($disabled&nbsp; != '') {<br>
+&nbsp;&nbsp;&nbsp; $arr = explode(",", $disabled );<br>
+&nbsp;&nbsp;&nbsp; if (in_array($modx-&gt;documentIdentifier, $arr)) {<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $show = FALSE;<br>
+&nbsp;&nbsp;&nbsp; }<br>
+}<br>
+ <br>
+if ($show) {<br>
+&nbsp;&nbsp;&nbsp; // Replace [*#tv*] with QM+ edit TV button
placeholders<br>
+&nbsp;&nbsp;&nbsp; if ($tvbuttons == 'true') {<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $e = $modx-&gt;Event;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($e-&gt;name
== 'OnParseDocument') {<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+$output =
+&amp;$modx-&gt;documentOutput;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+$output = preg_replace('~\[\*#(.*?)\*\]~', '&lt;!-- '.$tvbclass.' $1
+--&gt;[*$1*]', $output);&nbsp;&nbsp;&nbsp; <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$modx-&gt;documentOutput = $output;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;
<br>
+&nbsp;&nbsp;&nbsp;&nbsp; }<br>
+&nbsp;&nbsp;&nbsp; // In manager<br>
+&nbsp;&nbsp;&nbsp; if (isset($_SESSION['mgrValidated'])) {<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
include_once($modx-&gt;config['base_path'].'assets/plugins/qm/qm.inc.php');<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $qm = new Qm($modx, $jqpath,
+$loadmanagerjq, $loadfrontendjq, $noconflictjq, $loadtb, $tbwidth,
+$tbheight, $hidefields, $hidetabs, $hidesections, $addbutton, $tpltype,
+$tplid, $custombutton, $managerbutton, $logout, $autohide,
+$editbuttons, $editbclass, $newbuttons, $newbclass, $tvbuttons,
+$tvbclass);<br>
+&nbsp;&nbsp;&nbsp; }<br>
+}</span><span style="font-family: Courier
New,Courier,monospace;"></span></td>
+ </tr>
+ </tbody>
+</table>
+
+<span style="font-family: Courier New,Courier,monospace;"></span><span
style="font-family: Courier New,Courier,monospace;"></span><span
style="font-family: Courier New,Courier,monospace;"></span>
+<h3>4. Check events:</h3>
+
+<ul>
+
+ <li>OnParseDocument<br>
+</li>
+ <li>OnWebPagePrerender</li>
+
+ <li>OnDocFormPrerender</li>
+ <li>OnDocFormSave</li>
+
+ <li>OnManagerLogout&nbsp;<br>
+ </li>
+
+</ul>
+
+NOTICE: Make sure QuickManager+ is the first plugin on OnParseDocument
+event: Elements &gt; Manage Elements &gt; Plugins &gt; Edit Plugin
+Execution Order by Event &gt; OnParseDocument
+<h3>5. Copy paste plugin default configuration:</h3>
+
+<table style="text-align: left; width: 100%;" border="1" cellpadding="2"
cellspacing="2">
+ <tbody>
+ <tr>
+ <td style="vertical-align: top;"><span style="font-family: Courier
New,Courier,monospace;">&amp;jqpath=Path
+to jQuery;text;assets/js/jquery-1.3.2.min.js &amp;loadmanagerjq=Load
+jQuery in manager;list;true,false;false &amp;loadfrontendjq=Load jQuery
+in front-end;list;true,false;true &amp;noconflictjq=jQuery noConflict
+mode in front-end;list;true,false;false &amp;loadtb=Load modal box in
+front-end;list;true,false;true &amp;tbwidth=Modal box window
+width;text;80% &amp;tbheight=Modal box window height;text;90%
+&amp;hidefields=Hide document fields from front-end editors;text;parent
+&amp;hidetabs=Hide document tabs from front-end editors;text;
+&amp;hidesections=Hide document sections from front-end editors;text;
+&amp;addbutton=Show add document here button;list;true,false;true
+&amp;tpltype=New document template type;list;parent,id,selected;parent
+&amp;tplid=New document template id;int;3&nbsp;
+&amp;custombutton=Custom buttons;textarea; &amp;1=undefined;;
+&amp;managerbutton=Show go to manager button;list;true,false;true
+&amp;logout=Logout to;list;manager,front-end;manager
+&amp;disabled=Plugin disabled on documents;text; &amp;autohide=Autohide
+toolbar;list;true,false;true &amp;editbuttons=Inline edit
buttons;list;true,false;false &amp;editbclass=Edit button CSS
+class;text;qm-edit &amp;newbuttons=</span><span style="font-family:
Courier New,Courier,monospace;">Inline </span><span style="font-family:
Courier New,Courier,monospace;">new
+resource buttons;list;true,false;false &amp;newbclass=New resource
+button CSS
+class;text;qm-new &amp;tvbuttons=Inline template variable
+buttons;list;true,false;false &amp;tvbclass=Template variable button CSS
+class;text;qm-tv </span><span style="font-family: Courier
New,Courier,monospace;"></span></td>
+ </tr>
+ </tbody>
+</table><br>
+<h3>6. Save plugin.&nbsp;&nbsp;&nbsp; <br>
+</h3>
+<h3>+ 7. Rich text editors (optional)<br>
+</h3>
+<span style="font-weight: bold;">If you don't need inline template
variable buttons you can skip this.</span><br>
+<br>
+You don't need to change anything if your rich text editor version is at
least:<br>
+- TinyMCE 3.3.6r2 for MODx<br>
+- CKEditor 3.3 for modx alpha 3 <br>
+
+<br>Now the hardest part. To get rich text editors to work properly
+with
+QuickManager+ inline template variable buttons you will need to edit
+the rich text editor plugin code. If you won't do this change the rich
+text editors will use web theme buttons when editing richtext template
+variables.<br>
+
+<br>
+
+<span style="font-weight: bold;">TinyMCE 3.2.4.1 (MODx 1.0.2 and below):
</span><br>
+<br>


- <span style="font-family: Courier
New,Courier,monospace;">&nbsp;&nbsp;&nbsp;
-}</span><br style="font-family: Courier New,Courier,monospace;">
-
-
- <span style="font-family: Courier
New,Courier,monospace;">}</span><br style="font-family: Courier
New,Courier,monospace;">
-
-
- <br style="font-family: Courier New,Courier,monospace;">
-
-
- <span style="font-family: Courier New,Courier,monospace;">if ($show)
{</span><br style="font-family: Courier New,Courier,monospace;">
-
-
- <span style="font-family: Courier
New,Courier,monospace;">&nbsp;&nbsp;&nbsp;
-include_once($modx-&gt;config['base_path'].'assets/plugins/qm/qm.inc.php');</span><br
style="font-family:
Courier New,Courier,monospace;">
+In MODx manager go to: Elements &gt; Manage Elements &gt; Plugins &gt;
TinyMCE<br>
+
+<br>
+
+Replace line: <br>
+
+<span style="font-family: Courier
New,Courier,monospace;">if(isset($forfrontend)||
$modx-&gt;isFrontend()){</span><br>
+
+<br>
+
+With: <br>
+
+<span style="font-family: Courier
New,Courier,monospace;">if(isset($forfrontend)||($modx-&gt;isFrontend()
+&amp;&amp; (intval($_GET['quickmanagertv'] != 1) &amp;&amp;
+!(isset($_SESSION['mrgValidated']))))){</span><br>
+
+<br>
+
+<span style="font-weight: bold;">TinyMCE 3.3.2 (MODx 1.0.3) and 3.3.5.1
(MODX 1.0.4): </span><br>
+<br>


- <span style="font-family: Courier
New,Courier,monospace;">&nbsp;&nbsp;&nbsp;
-$qm = new Qm($modx, $jqpath, $loadmanagerjq, $loadfrontendjq,
-$noconflictjq, $loadtb, $tbwidth, $tbheight, $hidefields, $hidetabs,
-$hidesections, $addbutton, $tpltype, $tplid, $custombutton,
-$managerbutton, $logout, $autohide);</span><br style="font-family: Courier
New,Courier,monospace;">
-
-
- <span style="font-family: Courier
New,Courier,monospace;">}</span></td>
- </tr>
- </tbody>
-</table>
-
-<span style="font-family: Courier New,Courier,monospace;"></span><span
style="font-family: Courier New,Courier,monospace;"></span><span
style="font-family: Courier New,Courier,monospace;"></span>
-<h3>4. Check events:</h3>
-
-<ul>
-
- <li>OnWebPagePrerender</li>
- <li>OnDocFormPrerender</li>
- <li>OnDocFormSave</li>
- <li>OnManagerLogout&nbsp;<br>
- </li>
-</ul>
-
-<h3>5. Copy paste plugin default configuration:</h3>
-<table style="text-align: left; width: 100%;" border="1" cellpadding="2"
cellspacing="2">
- <tbody>
- <tr>
- <td style="vertical-align: top;"><span style="font-family: Courier
New,Courier,monospace;">&amp;jqpath=Path
-to jQuery;text;assets/js/jquery-1.3.2.min.js
-&amp;loadmanagerjq=Load jQuery in manager;list;true,false;true
-&amp;loadfrontendjq=Load jQuery in
-front-end;list;true,false;true&nbsp;&amp;noconflictjq=jQuery noConflict
-mode in front-end;list;true,false;true
-&amp;loadtb=Load modal box in
-front-end;list;true,false;true
-&amp;tbwidth=Modal box
-window&nbsp;width;text;80%&nbsp;&amp;tbheight=Modal box window
-height;text;90%
-&amp;hidefields=Hide document fields from front-end
-editors;text;parent&nbsp;&amp;hidetabs=Hide document tabs from
-front-end
-editors;text; &amp;hidesections=Hide document sections from front-end
-editors;text; &amp;addbutton=Show add document here
-button;list;true,false;true &amp;tpltype=New document template
-type;list;parent,id,selected;parent &amp;tplid=New document
-template id;int;3&nbsp;
-&amp;custombutton=Custom&nbsp;buttons;textarea; &amp;managerbutton=Show
-go to manager
-button;list;true,false;true &amp;logout=Logout
-to;list;manager,front-end;manager &amp;disabled=Plugin disabled on
-documents;text; </span><span style="font-family: Courier
New,Courier,monospace;">&amp;autohide=Autohide
toolbar;list;true,false;true</span></td>
- </tr>
- </tbody>
-</table>
-<h3>6. Save plugin.&nbsp;&nbsp; &nbsp;</h3>
+In MODx manager go to: Elements &gt; Manage Elements &gt; Plugins &gt;
TinyMCE<br>
+
+<br>
+
+Replace line:<br>
+
+<span style="font-family: Courier
New,Courier,monospace;">if($modx-&gt;isBackend())</span><br>
+
+
+<br>
+
+
+With:<br>
+
+<span style="font-family: Courier
New,Courier,monospace;">if($modx-&gt;isBackend() ||
(intval($_GET['quickmanagertv']) == 1 &amp;&amp;
isset($_SESSION['mrgValidated'])))</span><br>
+

<h2>Configuration</h2>

@@ -213,7 +276,7 @@
front-end&nbsp;</td>
<td>true</td>
<td>true || false &nbsp;</td>
- <td>Prevent loading modal box (ColorBox) twice if you are already
+ <td>Prevent loading the modal box JavaScript (ColorBox) twice if you
are already
using
it in your site
template.</td>
@@ -238,12 +301,15 @@
<td>text</td>
<td>Separate fields with commas, for example:
parent,template,menuindex<br>
+<br>
Parent selection doesn't work at all with&nbsp;QuickManager+ due
missing menu tree
frame, so it should be hidden from front-end editors.<br>
+<br>
Possible fields to hide: content, pagetitle,
longtitle, menuindex, parent, description, alias, link_attributes,
introtext, template, menutitle<br>
+<br>
NOTICE! Hiding document fields may not work if fields are moved to
other tabs with ManagerManager plugin. </td>
</tr>
@@ -253,10 +319,11 @@
<td><br>
</td>
<td>text</td>
- <td>Separate&nbsp;tabs with commas, for example:
-meta,settings<br>
-Possible tabs to hide: general, settings, meta<br>
-NOTICE! Hiding tabs may not work&nbsp;if&nbsp;tab
+ <td>Separate&nbsp;tabs with commas, for example: settings,access<br>
+<br>
+Possible tabs to hide: general, settings, access<br>
+<br>
+NOTICE! Hiding tabs may not work properly if&nbsp;tab
order is changed with ManagerManager plugin.</td>
</tr>
<tr>
@@ -266,10 +333,12 @@
</td>
<td>text</td>
<td>Separate sections with commas, for example:
-content,access<br>
-Possible sections to hide: docsettings, content, tvs, access<br>
-NOTICE! Hiding sections may not work if you are&nbsp;hiding sections
-with ManagerManager plugin</td>
+content,tvs<br>
+<br>
+Possible sections to hide: docsettings, content, tvs<br>
+<br>
+NOTICE! Hiding sections may not work properly if you are&nbsp;hiding
sections
+with ManagerManager plugin.</td>
</tr>
<tr>
<td>Show add document here
@@ -311,22 +380,29 @@
<td>Define custom&nbsp;buttons, for example add document to site
root or add news document<br>
<br>
-- Define&nbsp;new document button: 'button title','new','parent
-id','template id','visible for user role ids' <br>
-- Define link button: 'button
-title','link','http://www.example.com','','visible for user role ids'<br>
-- Define modal button: 'button
-title','modal','http://www.example.com','','visible for user role ids'<br>
- <br>
+- New document button: <span style="font-family: Courier
New,Courier,monospace;">'button title','new','parent
+id','template id','visible for user role ids' </span><br>
+<br>
+- Link button: <span style="font-family: Courier
New,Courier,monospace;">'button
+title','link','http://www.example.com','','visible for user role
ids'</span><br>
+<br>
+- Modal button: <span style="font-family: Courier
New,Courier,monospace;">'button
+title','modal','http://www.example.com','','visible for user role
ids'</span><br>
+ <br>MODx link tag, e.g. [~23~], works for link and modal button
links.<br>MODx id tag [*id*] works, e.g.
http://www.example.com?refererMODxPageId=[*id*]<br>
+Every custom button has individual CSS class, e.g. qm-custom-"index"<br>
+<br>
Visible for user role ids: leave empty to accept all roles, role 1 =
Administrator<br>
+<br>
Separate different buttons with ||<br>
<br>
-Example:
+Basic example:<br><span style="font-family: Courier
New,Courier,monospace;">
+'Site
statistics','link','http://www.google.com/analytics/','',''</span><br>
+<br>Advanced example:
+ <br><span style="font-family: Courier New,Courier,monospace;">
'New root document','new','0','3',''||'Add
-news','new','10','4','4,5,6'||'Site
-statistics','link','http://www.google.com/analytics/','','1,4'||'Site
-statistics','modal','http://www.google.com/analytics/','','1,4'</td>
+news','new','10','4','4,5,6'||'For admins only','link','[~45~]','','1,4'|
|'Site
+statistics','modal','http://www.google.com/analytics/','','1,4'</span></td>
</tr>
<tr>
<td>Show go to manager
@@ -360,7 +436,152 @@
<td style="vertical-align: top;">true || false</td>
<td style="vertical-align: top;">Define if toolbar hides
automatically or is always visible (manually close the toolbar by clicking
MODx logo or X button)<br>
</td>
+ </tr><tr>
+ <td style="vertical-align: top;">Inline edit buttons<br>
+</td>
+ <td style="vertical-align: top;">false<br>
+ </td>
+ <td style="vertical-align: top;">true || false</td>
+ <td style="vertical-align: top;">Define if special edit buttons are
searched inside content. <br>
+ <br>
+Purpose:<br>
+Edit any page from other page, e.g. for editing ditto listings.<br>
+ <br>
+How it works:<br>
+- Add anywhere in to your page: <span style="font-family: Courier
New,Courier,monospace;">&lt;!-- "Edit button CSS class" "document id to be
edited" </span><span style="font-family: Courier
New,Courier,monospace;">'"Button title"'</span><span style="font-family:
Courier New,Courier,monospace;"> --&gt;</span><br>
+- This will create an edit button inside your page when logged in
manager<br>
+- For regular visitors it will be shown as a regular HTML comment visible
only in the HTML source code<br>
+ <br>
+Basic example:<br>
+- Add in to your template <span style="font-family: Courier
New,Courier,monospace;">&lt;!-- qm-edit 1 'Edit this' --&gt;</span><br>
+- Creates button to edit page id 1<br>
+ <br>
+Advanced example:<br>
+- Add in to your Ditto template chunk: <span style="font-family: Courier
New,Courier,monospace;">&lt;!-- qm-edit [+id+] 'Edit news item'
--&gt;</span><br>
+- Creates edit buttons for news listings etc. inside the container page<br>
+ <br>
+NOTICE! Button title will fail if you use accented characters. Use HTML
entities instead, for example &amp;auml;<br>
+ </td>
</tr>
+ <tr>
+ <td style="vertical-align: top;">Edit button CSS class</td>
+ <td style="vertical-align: top;">qm-edit<br>
+ </td>
+ <td style="vertical-align: top;">text<br>
+ </td>
+ <td style="vertical-align: top;">Default qm-edit class can be found
at: assets/plugins/qm/css/style.css<br>
+ <br>
+You can use your own class if you want to make your own edit button or for
added security measure.<br>
+ </td>
+ </tr>
+ <tr>
+ <td style="vertical-align: top;">Inline new resource buttons</td>
+ <td style="vertical-align: top;">false<br>
+ </td>
+ <td style="vertical-align: top;">true || false</td>
+ <td style="vertical-align: top;">Define if special new resource
buttons are searched inside content. <br>
+
+ <br>
+
+Purpose:<br>
+
+Create any page from other page, e.g. create new news items.<br>
+
+ <br>
+
+How it works:<br>
+
+- Add anywhere in to your page: <span style="font-family: Courier
New,Courier,monospace;">&lt;!-- "New resource button CSS class" "parent
id" "template id" '"Button title"' --&gt;</span><br>
+
+- This will create an new resource button inside your page when logged in
manager<br>
+
+- For regular visitors it will be shown as a regular HTML comment visible
only in the HTML source code<br>
+
+ <br>
+
+Basic example:<br>
+
+- Add in to your template <span style="font-family: Courier
New,Courier,monospace;">&lt;!-- qm-new 1 3 'New news item' --&gt;</span><br>
+
+- Creates new resource button<br>
+- Parent id: 1 (new resource will be created under document id 1)<br>
+- Template id: 3 (uses template id 3)<br>
+- Button title: New news item<br>
+ <br>
+NOTICE! Button title will fail if you use accented characters. Use HTML
entities instead, for example &amp;auml;<br>
+ </td>
+ </tr>
+ <tr>
+ <td style="vertical-align: top;">New resource button CSS class</td>
+ <td style="vertical-align: top;">qm-new<br>
+ </td>
+ <td style="vertical-align: top;">text<br>
+ </td>
+ <td style="vertical-align: top;">Default qm-new class can be found
at: assets/plugins/qm/css/style.css<br>
+
+ <br>
+
+You can use your own class if you want to make your own new resource
button or for added security measure.</td>
+ </tr>
+ <tr>
+ <td style="vertical-align: top;">Inline template variable
buttons</td>
+ <td style="vertical-align: top;">false<br>
+ </td>
+ <td style="vertical-align: top;">true || false</td>
+ <td style="vertical-align: top;">Define if special template variable
buttons are searched inside content. <br>
+
+ <br>
+
+Purpose:<br>
+
+Edit any template variable.<br>
+
+ <br>
+Editable default MODx fields:<br>
+ <span style="font-family: Courier New,Courier,monospace;">pagetitle,
longtitle, description, content, menutitle, introtext</span><br>
+<br>
+
+How it works:<br>
+
+- Add anywhere in to your page: <span style="font-family: Courier
New,Courier,monospace;">[*#tvName*],</span> notice the "#"<br>
+&nbsp; OR<br>
+
+- Add anywhere in to your page: <span style="font-family: Courier
New,Courier,monospace;">&lt;!-- "Template variable button CSS
class" "tvName"</span><span style="font-family: Courier
New,Courier,monospace;"></span><span style="font-family: Courier
New,Courier,monospace;"> --&gt;</span><br>
+
+- This will create a template variable button inside your page when logged
in manager<br>
+
+- For regular visitors it will be shown as a regular HTML comment visible
only in the HTML source code<br>
+
+ <br>
+
+Basic example:<br>
+
+- Add in to your template <span style="font-family: Courier
New,Courier,monospace;">[*#tvName*]</span><span style="font-family: Courier
New,Courier,monospace;"></span><br>
+
+- Creates button to edit tvName template variable (and outputs the
template variable)<br>
+
+ <br>
+
+Advanced example:<br>
+
+- Add in to your template<span style="font-family: Courier
New,Courier,monospace;"></span><span style="font-family: Courier
New,Courier,monospace;"></span>: <span style="font-family: Courier
New,Courier,monospace;">&lt;!-- qm-tv tvName --&gt;</span><br>
+
+- Creates button to edit tvName template variable<br>
+ </td>
+ </tr>
+ <tr>
+ <td style="vertical-align: top;">Template variable button CSS
class</td>
+ <td style="vertical-align: top;">qm-tv</td>
+ <td style="vertical-align: top;">text<br>
+ </td>
+ <td style="vertical-align: top;">Default qm-tv class can be found
at: assets/plugins/qm/css/style.css<br>
+
+ <br>
+
+You can use your own class if you want to make your own template variable
button or for added security measure.</td>
+ </tr>
+
+

</tbody>
</table>
@@ -369,8 +590,84 @@

<h2>How to use</h2>

-Just login, open frontend and enjoy!
-<h2>Changelog</h2>1.3.4.1<br>
+Just login, open frontend and enjoy!<br>
+<h2>
+
+Known issues
+</h2>
+<ul>
+<li>Parent selection is hidden and doesn't work at all with QuickManager+
due
+missing menu tree frame.</li>
+</ul>
+<h2>Special thanks</h2>
+<ul>
+ <li>QuickManager+ is orginally based on QuickManager by Urique
+Dertlian</li>
+ <li>Template variable editing ideas from QuickEdit by Adam Crownoble<br>
+ </li>
+</ul>
+
+
+<h2>Changelog</h2>1.5.1 - 02/08/2010<br>
+<ul>
+ <li>Added: CSS classes to toolbar buttons: qmCustom, qmManager,
qmLogout<br>
+ </li>
+ <li>Fixed: Updated ColorBox to 1.3.9 that solves TinyMCE image align
problems with IE6 and IE7<br>
+ </li>
+</ul>
+1.5<br>
+
+<ul>
+ <li>Added: Inline template variable buttons!!! Edit template variables
with QuickEdit style. Off by default though.<br>
+ </li>
+
+ <li>Added: OnParseDocument plugin event</li>
+ <li>Added: Image TV preview</li>
+ <li>Added: Preserve alias on save</li>
+ <li>Added: "documentDirty=false;" to cancel button to prevent
unnecessary MODx manager alert message</li>
+ <li>Added: Custom buttons now support standard MODx [*id*] tag, e.g.
http://www.example.com?refererMODxPageId=[*id*]</li>
+ <li>Added: Individual CSS class for every custom button, e.g.
qm-custom-"index"<br>
+ </li>
+
+
+
+
+
+<li>Changed: Plugin content</li>
+ <li>Changed: TV access routine<br>
+ </li>
+ <li>Fixed: TV edit form button labels</li>
+ <li>Removed: close.php =&gt; now implemented with OnWebPagePrerender
event to preserve alias<br>
+ </li>
+
+
+</ul>
+1.4.1<br>
+<ul>
+ <li>Added: Individual user language check, previously QM+ used global
language setting for all users<br>
+ </li>
+ <li>Changed: Edit buttons in content =&gt; Inline edit buttons, New
resource buttons in content =&gt; Inline new resource buttons</li>
+ <li>Changed: Inline edit buttons "placeholder markup" changed to: <span
style="font-family: Courier New,Courier,monospace;">&lt;!-- "Edit button
CSS class" "document id to be edited" </span><span style="font-family:
Courier New,Courier,monospace;">'"Button title"'</span><span
style="font-family: Courier New,Courier,monospace;"> --&gt;</span></li>
+ <li>Fixed: Inline edit/new buttons access control<br>
+ </li>
+</ul>
+1.4<br>
+<ul>
+ <li>Added: Edit buttons inside content. Edit any page from other page,
e.g. for editing ditto listings.</li>
+ <li>Added: New resource buttons inside content. Create any page from
other page, e.g. create new news item.</li>
+ <li>Added: Custom buttons works now with default MODx links, e.g.
[~23~]<br>
+ </li>
+ <li>Added: Show friendly alias after saving the document. Notice: This
is still an experimental feature in is off by default.<br>
+ </li>
+ <li>Changed: Multiple CSS tweaks mainly for IE</li>
+ <li>Changed: close.php uses now sessions instead of JavaScript
cookies<br>
+ </li>
+ <li>Fixed: PHP4 support fixed (Thanks yama!)</li>
+ <li>Fixed: Hiding tabs and sections fixed (access -tab and docsettings
-section)</li>
+ <li>Removed: .htaccess file under qm -folder that was accidentally left
there is not needed at all.<br>
+ </li>
+</ul>
+1.3.4.1<br>
<ul>
<li>Changed: CSS tweaks for IE, opacity now works fine with IE8 but
unfortunately with IE7 ugly fonts remain (Thanks again uxello!)</li>
</ul>
=======================================
--- /trunk/install/assets/plugins/qm.tpl Thu Apr 1 10:27:22 2010
+++ /trunk/install/assets/plugins/qm.tpl Fri Aug 20 07:21:43 2010
@@ -5,12 +5,13 @@
* 管理画面へのアクセス不要。今開いているページから編集ウィンドウを開きます
*
* @category plugin
- * @version 1.3.4.1
- * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL)
- * @internal @properties &jqpath=Path to
jQuery;text;assets/js/jquery-1.3.2.min.js &loadmanagerjq=Load jQuery in
manager;list;true,false;true &loadfrontendjq=Load jQuery in
front-end;list;true,false;true &noconflictjq=jQuery noConflict mode in
front-end;list;true,false;true &loadtb=Load modal box in
front-end;list;true,false;true &tbwidth=Modal box window width;text;80%
&tbheight=Modal box window height;text;90% &hidefields=Hide document fields
from front-end editors;text;parent &hidetabs=Hide document tabs from
front-end editors;text; &hidesections=Hide document sections from front-end
editors;text; &addbutton=Show add document here button;list;true,false;true
&tpltype=New document template type;list;parent,id,selected;parent
&tplid=New document template id;int;3 &custombutton=Custom
buttons;textarea; &managerbutton=Show go to manager
button;list;true,false;true &logout=Logout
to;list;manager,front-end;front-end &disabled=Plugin disabled on
documents;text; &autohide=Autohide toolbar;list;true,false;true
- * @internal @events
OnWebPagePrerender,OnDocFormPrerender,OnDocFormSave,OnManagerLogout
+ * @version 1.5.1
+ * @license GNU General Public License (GPL),
http://www.gnu.org/copyleft/gpl.html
+ * @internal @properties &jqpath=Path to
jQuery;text;assets/js/jquery-1.3.2.min.js &loadmanagerjq=Load jQuery in
manager;list;true,false;false &loadfrontendjq=Load jQuery in
front-end;list;true,false;true &noconflictjq=jQuery noConflict mode in
front-end;list;true,false;false &loadtb=Load modal box in
front-end;list;true,false;true &tbwidth=Modal box window width;text;80%
&tbheight=Modal box window height;text;90% &hidefields=Hide document fields
from front-end editors;text;parent &hidetabs=Hide document tabs from
front-end editors;text; &hidesections=Hide document sections from front-end
editors;text; &addbutton=Show add document here button;list;true,false;true
&tpltype=New document template type;list;parent,id,selected;parent
&tplid=New document template id;int;3 &custombutton=Custom
buttons;textarea; &1=undefined;; &managerbutton=Show go to manager
button;list;true,false;true &logout=Logout
to;list;manager,front-end;manager &disabled=Plugin disabled on
documents;text; &autohide=Autohide toolbar;list;true,false;true
&editbuttons=Inline edit buttons;list;true,false;false &editbclass=Edit
button CSS class;text;qm-edit &newbuttons=Inline new resource
buttons;list;true,false;false &newbclass=New resource button CSS
class;text;qm-new &tvbuttons=Inline template variable
buttons;list;true,false;false &tvbclass=Template variable button CSS
class;text;qm-tv
+ * @internal @events
nParseDocument,OnWebPagePrerender,OnDocFormPrerender,OnDocFormSave,OnManagerLogout
* @internal @modx_category Manager and Admin
* @internal @legacy_names QM+
+ * @author Mikko Lammi, www.maagit.fi/quickmanager-plus updated 02/08/2010
*/

$show = TRUE;
@@ -23,6 +24,18 @@
}

if ($show) {
-
include_once($modx->config['base_path'].'assets/plugins/qm/qm.inc.php');
- $qm = new Qm($modx, $jqpath, $loadmanagerjq, $loadfrontendjq,
$noconflictjq, $loadtb, $tbwidth, $tbheight, $hidefields, $hidetabs,
$hidesections, $addbutton, $tpltype, $tplid, $custombutton, $managerbutton,
$logout, $autohide);
-}
+ // Replace [*#tv*] with QM+ edit TV button placeholders
+ if ($tvbuttons == 'true') {
+ $e = $modx->Event;
+ if ($e->name == 'OnParseDocument') {
+ $output = &$modx->documentOutput;
+ $output =
preg_replace('~\[\*#(.*?)\*\]~', '<!-- '.$tvbclass.' $1 -->[*$1*]',
$output);
+ $modx->documentOutput = $output;
+ }
+ }
+ // In manager
+ if (isset($_SESSION['mgrValidated'])) {
+
include_once($modx->config['base_path'].'assets/plugins/qm/qm.inc.php');
+ $qm = new Qm($modx, $jqpath, $loadmanagerjq, $loadfrontendjq,
$noconflictjq, $loadtb, $tbwidth, $tbheight, $hidefields, $hidetabs,
$hidesections, $addbutton, $tpltype, $tplid, $custombutton, $managerbutton,
$logout, $autohide, $editbuttons, $editbclass, $newbuttons, $newbclass,
$tvbuttons, $tvbclass);
+ }
+}
Reply all
Reply to author
Forward
0 new messages