+ ';
+
+ // 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 = '
+
-@author Mikko Lammi, www.maagit.fi (based on QuickManager by Urique
-Dertlian, urique@unix.am)
+@author Mikko Lammi, www.maagit.fi/quickmanager-plus
@license GNU General Public
License (GPL v3), www.gnu.org/copyleft/gpl.html
-@version 1.3.4.1 updated 4/2/2010
+@version 1.5.3 updated 12/10/2010
@requirements MODx 1.0.0+
@@ -20,25 +40,7 @@
QuickMa
Description
-QuickManager+ is an alternative to QuickEdit to quick access and
-control content from front-end.
-
-
-
-This is a heavily modified version of the original QuickManager plugin
-with extensive set of configuration options.
-
-
-
-Known issues:
-
-
-
Parent selection doesn't work at all with QuickManager+ due
-missing menu tree frame.
-
Couple harmless JavaScript errors due missing menu tree
-which is normally present in MODx manager.
-
-$arr = explode(",", $disabled );
+NOTICE: Make sure QuickManager+ is the first plugin on OnParseDocument
+event: Elements > Manage Elements > Plugins > Edit Plugin
+Execution Order by Event > OnParseDocument
+
5. Copy paste plugin default configuration:
+
+
+
+
&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
+
+
+
+
6. Save plugin.
+
+
+ 7. Rich text editors (optional)
+
+If you don't need inline template variable buttons you can skip this.
+
+You don't need to change anything if your rich text editor version is at least:
+- TinyMCE 3.3.6r2 for MODx
+- CKEditor 3.3 for modx alpha 3
-
-if (in_array($modx->documentIdentifier, $arr)) {
+ 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.
+
-
-$show = FALSE;
+TinyMCE 3.2.4.1 (MODx 1.0.2 and below):
+
-
-}
+In MODx manager go to: Elements > Manage Elements > Plugins > TinyMCE
+
- }
+Replace line:
+if(isset($forfrontend)||$modx->isFrontend()){
-
+
+With:
- if ($show) {
+if(isset($forfrontend)||($modx->isFrontend()
+&& (intval($_GET['quickmanagertv'] != 1) &&
+!(isset($_SESSION['mgrValidated']))))){
+
-
-include_once($modx->config['base_path'].'assets/plugins/qm/qm.inc.php');
+TinyMCE 3.3.2 (MODx 1.0.3) and 3.3.5.1 (MODX 1.0.4):
+
-
-$qm = new Qm($modx, $jqpath, $loadmanagerjq, $loadfrontendjq,
-$noconflictjq, $loadtb, $tbwidth, $tbheight, $hidefields, $hidetabs,
-$hidesections, $addbutton, $tpltype, $tplid, $custombutton,
-$managerbutton, $logout, $autohide);
+In MODx manager go to: Elements > Manage Elements > Plugins > TinyMCE
+
- }
-
-
-
+Replace line:
-
-
&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;manager &disabled=Plugin disabled on
-documents;text; &autohide=Autohide toolbar;list;true,false;true
-
-
-
-
6. Save plugin.
Configuration
@@ -213,7 +287,7 @@
Configuration
front-end
true
true || false
-
Prevent loading modal box (ColorBox) twice if you are already
+
Prevent loading the modal box JavaScript (ColorBox) twice if you are already
using
it in your site
template.
@@ -238,12 +312,15 @@
Configuration
text
Separate fields with commas, for example:
parent,template,menuindex
+
Parent selection doesn't work at all with QuickManager+ due
missing menu tree
frame, so it should be hidden from front-end editors.
+
Possible fields to hide: content, pagetitle,
longtitle, menuindex, parent, description, alias, link_attributes,
introtext, template, menutitle
+
NOTICE! Hiding document fields may not work if fields are moved to
other tabs with ManagerManager plugin.
@@ -253,10 +330,11 @@
Configuration
text
-
Separate tabs with commas, for example:
-meta,settings
-Possible tabs to hide: general, settings, meta
-NOTICE! Hiding tabs may not work if tab
+
Separate tabs with commas, for example: settings,access
+
+Possible tabs to hide: general, settings, access
+
+NOTICE! Hiding tabs may not work properly if tab
order is changed with ManagerManager plugin.
@@ -266,10 +344,12 @@
Configuration
text
Separate sections with commas, for example:
-content,access
-Possible sections to hide: docsettings, content, tvs, access
-NOTICE! Hiding sections may not work if you are hiding sections
-with ManagerManager plugin
+content,tvs
+
+Possible sections to hide: docsettings, content, tvs
+
+NOTICE! Hiding sections may not work properly if you are hiding sections
+with ManagerManager plugin.
Show add document here
@@ -311,22 +391,29 @@
Configuration
Define custom buttons, for example add document to site
root or add news document
-- Define new document button: 'button title','new','parent
-id','template id','visible for user role ids'
-- Define link button: 'button
-title','link','http://www.example.com','','visible for user role ids'
-- Define modal button: 'button
-title','modal','http://www.example.com','','visible for user role ids'
-
+- New document button: 'button title','new','parent
+id','template id','visible for user role ids'
+
+- Link button: 'button
+title','link','http://www.example.com','','visible for user role ids'
+
+- Modal button: 'button
+title','modal','http://www.example.com','','visible for user role ids'
+ MODx link tag, e.g. [~23~], works for link and modal button links. MODx id tag [*id*] works, e.g. http://www.example.com?refererMODxPageId=[*id*]
+Every custom button has individual CSS class, e.g. qm-custom-"index"
+
Visible for user role ids: leave empty to accept all roles, role 1 =
Administrator
+
Separate different buttons with ||
Define if toolbar hides automatically or is always visible (manually close the toolbar by clicking MODx logo or X button)
+
+
Inline edit buttons
+
+
false
+
+
true || false
+
Define if special edit buttons are searched inside content.
+
+Purpose:
+Edit any page from other page, e.g. for editing ditto listings.
+
+How it works:
+- Add anywhere in to your page: <!-- "Edit button CSS class" "document id to be edited" '"Button title"' -->
+- This will create an edit button inside your page when logged in manager
+- For regular visitors it will be shown as a regular HTML comment visible only in the HTML source code
+
+Basic example:
+- Add in to your template <!-- qm-edit 1 'Edit this' -->
+- Creates button to edit page id 1
+
+Advanced example:
+- Add in to your Ditto template chunk: <!-- qm-edit [+id+] 'Edit news item' -->
+- Creates edit buttons for news listings etc. inside the container page
+
+NOTICE! Button title will fail if you use accented characters. Use HTML entities instead, for example ä
+
+
+
Edit button CSS class
+
qm-edit
+
+
text
+
+
Default qm-edit class can be found at: assets/plugins/qm/css/style.css
+
+You can use your own class if you want to make your own edit button or for added security measure.
+
+
+
+
Inline new resource buttons
+
false
+
+
true || false
+
Define if special new resource buttons are searched inside content.
+
+
+
+Purpose:
+
+Create any page from other page, e.g. create new news items.
+
+
+
+How it works:
+
+- Add anywhere in to your page: <!-- "New resource button CSS class" "parent id" "template id" '"Button title"' -->
+
+- This will create an new resource button inside your page when logged in manager
+
+- For regular visitors it will be shown as a regular HTML comment visible only in the HTML source code
+
+
+
+Basic example:
+
+- Add in to your template <!-- qm-new 1 3 'New news item' -->
+
+- Creates new resource button
+- Parent id: 1 (new resource will be created under document id 1)
+- Template id: 3 (uses template id 3)
+- Button title: New news item
+
+NOTICE! Button title will fail if you use accented characters. Use HTML entities instead, for example ä
+
+
+
+
New resource button CSS class
+
qm-new
+
+
text
+
+
Default qm-new class can be found at: assets/plugins/qm/css/style.css
+
+
+
+You can use your own class if you want to make your own new resource button or for added security measure.
+
+
+
Inline template variable buttons
+
false
+
+
true || false
+
Define if special template variable buttons are searched inside content.
+
+
+
+Purpose:
+
+Edit any template variable.
+
+
+Editable default MODx fields:
+ pagetitle, longtitle, description, content, menutitle, introtext
+
+
+How it works:
+
+- Add anywhere in to your page: [*#tvName*], notice the "#"
+ OR
+
+- Add anywhere in to your page: <!-- "Template variable button CSS class" "tvName" -->
+
+- This will create a template variable button inside your page when logged in manager
+
+- For regular visitors it will be shown as a regular HTML comment visible only in the HTML source code
+
+
+
+Basic example:
+
+- Add in to your template [*#tvName*]
+
+- Creates button to edit tvName template variable (and outputs the template variable)
+
+
+
+Advanced example:
+
+- Add in to your template: <!-- qm-tv tvName -->
+
+- Creates button to edit tvName template variable
+
+
+
+
Template variable button CSS class
+
qm-tv
+
text
+
+
Default qm-tv class can be found at: assets/plugins/qm/css/style.css
+
+
+
+You can use your own class if you want to make your own template variable button or for added security measure.
+
+
+
@@ -369,8 +601,103 @@
Configuration
How to use
-Just login, open frontend and enjoy!
-
Changelog
1.3.4.1
+Just login, open frontend and enjoy!
+
+
+Known issues
+
+
+
Parent selection is hidden and doesn't work at all with QuickManager+ due
+missing menu tree frame.
+
+
Special thanks
+
+
QuickManager+ is orginally based on QuickManager by Urique
+Dertlian
+
Template variable editing ideas from QuickEdit by Adam Crownoble
+
+
+
+
+
Changelog
1.5.3 - 12/10/2010
+
+
+
+
Changed: Plugin code checks immeditally at start if user is in manager to save processing time
+
+
Fixed: Inline template variable edit/save was causing error if "'" mark was used
+
+
+
+1.5.2 - 14/09/2010
+
+
+
Added: CSS classes to toolbar buttons, also li elements: qmCustom, qmManager, qmLogout
+
Changed: Inline buttons div => span, validates correctly
+
+
Fixed: Inline template variable editing when TV type is checkbox
+
+
+1.5.1 - 02/08/2010
+
+
Added: CSS classes to toolbar buttons: qmCustom, qmManager, qmLogout
+
+
Fixed: Updated ColorBox to 1.3.9 that solves TinyMCE image align problems with IE6 and IE7
+
+
+1.5
+
+
+
Added: Inline template variable buttons!!! Edit template variables with QuickEdit style. Off by default though.
+
+
+
Added: OnParseDocument plugin event
+
Added: Image TV preview
+
Added: Preserve alias on save
+
Added: "documentDirty=false;" to cancel button to prevent unnecessary MODx manager alert message
+
Added: Custom buttons now support standard MODx [*id*] tag, e.g. http://www.example.com?refererMODxPageId=[*id*]
+
Added: Individual CSS class for every custom button, e.g. qm-custom-"index"
+
+
+
+
+
+
+
Changed: Plugin content
+
Changed: TV access routine
+
+
Fixed: TV edit form button labels
+
Removed: close.php => now implemented with OnWebPagePrerender event to preserve alias
+
+
+
+
+1.4.1
+
+
Added: Individual user language check, previously QM+ used global language setting for all users
+
+
Changed: Edit buttons in content => Inline edit buttons, New resource buttons in content => Inline new resource buttons
+
Changed: Inline edit buttons "placeholder markup" changed to: <!-- "Edit button CSS class" "document id to be edited" '"Button title"' -->
+
Fixed: Inline edit/new buttons access control
+
+
+1.4
+
+
Added: Edit buttons inside content. Edit any page from other page, e.g. for editing ditto listings.
+
Added: New resource buttons inside content. Create any page from other page, e.g. create new news item.
+
Added: Custom buttons works now with default MODx links, e.g. [~23~]
+
+
Added: Show friendly alias after saving the document. Notice: This is still an experimental feature in is off by default.
+
+
Changed: Multiple CSS tweaks mainly for IE
+
Changed: close.php uses now sessions instead of JavaScript cookies
+
+
Fixed: PHP4 support fixed (Thanks yama!)
+
Fixed: Hiding tabs and sections fixed (access -tab and docsettings -section)
+
Removed: .htaccess file under qm -folder that was accidentally left there is not needed at all.
+
+
+1.3.4.1
Changed: CSS tweaks for IE, opacity now works fine with IE8 but unfortunately with IE7 ugly fonts remain (Thanks again uxello!)
diff --git a/install/assets/plugins/qm.tpl b/install/assets/plugins/qm.tpl
index 734c9577f3..435eb2487d 100644
--- a/install/assets/plugins/qm.tpl
+++ b/install/assets/plugins/qm.tpl
@@ -2,27 +2,44 @@
/**
* Quick Manager+
*
- * Enables QuickManager front end content editing support
+ * Enables QuickManager+ front end content editing support
*
* @category plugin
- * @version 1.3.4.1
+ * @version 1.5.3-GA
* @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;manager &disabled=Plugin disabled on documents;text; &autohide=Autohide toolbar;list;true,false;true
- * @internal @events OnWebPagePrerender,OnDocFormPrerender,OnDocFormSave,OnManagerLogout
+ * @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 OnParseDocument,OnWebPagePrerender,OnDocFormPrerender,OnDocFormSave,OnManagerLogout
* @internal @modx_category Manager and Admin
* @internal @legacy_names QM+
*/
-$show = TRUE;
-if ($disabled != '') {
- $arr = explode(",", $disabled );
- if (in_array($modx->documentIdentifier, $arr)) {
- $show = FALSE;
- }
-}
+// In manager
+if (isset($_SESSION['mgrValidated'])) {
-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);
+ $show = TRUE;
+
+ if ($disabled != '') {
+ $arr = explode(",", $disabled );
+ if (in_array($modx->documentIdentifier, $arr)) {
+ $show = FALSE;
+ }
+ }
+
+ if ($show) {
+ // Replace [*#tv*] with QM+ edit TV button placeholders
+ if ($tvbuttons == 'true') {
+ $e = $modx->Event;
+ if ($e->name == 'OnParseDocument') {
+ $output = &$modx->documentOutput;
+ $output = preg_replace('~\[\*#(.*?)\*\]~', '[*$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);
+ }
+ }
}
\ No newline at end of file