diff --git a/assets/plugins/qm/qm.inc.php b/assets/plugins/qm/qm.inc.php
index e398a54425..f28b16db2c 100755
--- a/assets/plugins/qm/qm.inc.php
+++ b/assets/plugins/qm/qm.inc.php
@@ -24,7 +24,7 @@ function Qm(&$modx, $jqpath='', $loadmanagerjq='', $loadfrontendjq='', $noconfli
$this->loadtb = $loadtb;
$this->tbwidth = $tbwidth;
$this->tbheight = $tbheight;
- $this->usemm = $usemm;
+ $this->usemm = null;
$this->hidefields = $hidefields;
$this->hidetabs = $hidetabs;
$this->hidesections = $hidesections;
diff --git a/manager/actions/messages.static.php b/manager/actions/messages.static.php
index 7afd11239c..ceb9f340a9 100644
--- a/manager/actions/messages.static.php
+++ b/manager/actions/messages.static.php
@@ -10,7 +10,7 @@
config['manager_tree_width'])) $modx->config['manager_tree_width'] = '260';
?>
->
+>
- (MODX CMS Manager)
diff --git a/manager/frames/menu.php b/manager/frames/menu.php
index 6dce737aab..5eac3dc52f 100644
--- a/manager/frames/menu.php
+++ b/manager/frames/menu.php
@@ -3,6 +3,7 @@
if (!array_key_exists('mail_check_timeperiod', $modx->config) || !is_numeric($modx->config['mail_check_timeperiod'])) {
$modx->config['mail_check_timeperiod'] = 5;
}
+$modx_textdir = isset($modx_textdir) ? $modx_textdir : null;
if ($manager_theme) $manager_theme .= '/';
$mxla = $modx_lang_attribute ? $modx_lang_attribute : 'en';
?>
diff --git a/manager/frames/nodes.php b/manager/frames/nodes.php
index 8ec8d810ca..b3679386a7 100644
--- a/manager/frames/nodes.php
+++ b/manager/frames/nodes.php
@@ -6,116 +6,116 @@
*/
if(IN_MANAGER_MODE!="true") die("
INCLUDE_ORDERING_ERRORPlease use the MODx Content Manager instead of accessing this file directly.");
- // save folderstate
- if (isset($_GET['opened'])) $_SESSION['openedArray'] = $_GET['opened'];
- if (isset($_GET['savestateonly'])) {
- echo 'send some data'; //??
- exit;
+// save folderstate
+if (isset($_GET['opened'])) $_SESSION['openedArray'] = $_GET['opened'];
+if (isset($_GET['savestateonly'])) {
+ echo 'send some data'; //??
+ exit;
+}
+
+$indent = $_GET['indent'];
+$parent = $_GET['parent'];
+$expandAll = $_GET['expandAll'];
+$output = "";
+$theme = $manager_theme ? "$manager_theme/":"";
+
+// setup sorting
+if(isset($_REQUEST['tree_sortby'])) {
+ $_SESSION['tree_sortby'] = $_REQUEST['tree_sortby'];
+}
+if(isset($_REQUEST['tree_sortdir'])) {
+ $_SESSION['tree_sortdir'] = $_REQUEST['tree_sortdir'];
+}
+
+// icons by content type
+
+$icons = array(
+ 'application/rss+xml' => $_style["tree_page_rss"],
+ 'application/pdf' => $_style["tree_page_pdf"],
+ 'application/vnd.ms-word' => $_style["tree_page_word"],
+ 'application/vnd.ms-excel' => $_style["tree_page_excel"],
+ 'text/css' => $_style["tree_page_css"],
+ 'text/html' => $_style["tree_page_html"],
+ 'text/plain' => $_style["tree_page"],
+ 'text/xml' => $_style["tree_page_xml"],
+ 'text/javascript' => $_style["tree_page_js"],
+ 'image/gif' => isset($_style["tree_page_gif"]) ? $_style["tree_page_gif"] : $_style["tree_page"],
+ 'image/jpg' => isset($_style["tree_page_jpg"]) ? $_style["tree_page_jpg"] : $_style["tree_page"],
+ 'image/png' => isset($_style["tree_page_png"]) ? $_style["tree_page_png"] : $_style["tree_page"]
+);
+$iconsPrivate = array(
+ 'application/rss+xml' => $_style["tree_page_rss_secure"],
+ 'application/pdf' => $_style["tree_page_pdf_secure"],
+ 'application/vnd.ms-word' => $_style["tree_page_word_secure"],
+ 'application/vnd.ms-excel' => $_style["tree_page_excel_secure"],
+ 'text/css' => $_style["tree_page_css_secure"],
+ 'text/html' => $_style["tree_page_html_secure"],
+ 'text/plain' => $_style["tree_page_secure"],
+ 'text/xml' => $_style["tree_page_xml_secure"],
+ 'text/javascript' => $_style["tree_page_js_secure"],
+ 'image/gif' => isset($_style["tree_page_gif_secure"]) ? $_style["tree_page_gif_secure"] : $_style["tree_page_secure"],
+ 'image/jpg' => isset($_style["tree_page_jpg_secure"]) ? $_style["tree_page_jpg_secure"] : $_style["tree_page_secure"],
+ 'image/png' => isset($_style["tree_page_png_secure"]) ? $_style["tree_page_png_secure"] : $_style["tree_page_secure"]
+);
+
+if (isset($_SESSION['openedArray'])) {
+ $opened = explode("|", $_SESSION['openedArray']);
+} else {
+ $opened = array();
+}
+$opened2 = array();
+$closed2 = array();
+
+makeHTML($indent,$parent,$expandAll,$theme);
+echo $output;
+
+// check for deleted documents on reload
+if ($expandAll==2) {
+ $sql = "SELECT COUNT(*) FROM $dbase.`".$table_prefix."site_content` WHERE deleted=1";
+ $rs = mysql_query($sql);
+ $row = mysql_fetch_row($rs);
+ $count = $row[0];
+ if ($count>0) echo '
'; // add a special element to let system now that the bin is full
+}
+
+function makeHTML($indent,$parent,$expandAll,$theme) {
+ global $modx;
+ global $icons, $iconsPrivate, $theme, $_style;
+ global $modxDBConn, $output, $dbase, $table_prefix, $_lang, $opened, $opened2, $closed2; //added global vars
+
+ $pad = " ";
+
+ // setup spacer
+ $spacer = "";
+ for ($i = 1; $i <= $indent; $i++){
+ $spacer .= " ";
}
- $indent = $_GET['indent'];
- $parent = $_GET['parent'];
- $expandAll = $_GET['expandAll'];
- $output = "";
- $theme = $manager_theme ? "$manager_theme/":"";
-
- // setup sorting
- if(isset($_REQUEST['tree_sortby'])) {
- $_SESSION['tree_sortby'] = $_REQUEST['tree_sortby'];
- }
- if(isset($_REQUEST['tree_sortdir'])) {
- $_SESSION['tree_sortdir'] = $_REQUEST['tree_sortdir'];
+ if (!isset($_SESSION['tree_sortby']) && !isset($_SESSION['tree_sortdir'])) {
+ // This is the first startup, set default sort order
+ $_SESSION['tree_sortby'] = 'menuindex';
+ $_SESSION['tree_sortdir'] = 'ASC';
}
-
- // icons by content type
-
- $icons = array(
- 'application/rss+xml' => $_style["tree_page_rss"],
- 'application/pdf' => $_style["tree_page_pdf"],
- 'application/vnd.ms-word' => $_style["tree_page_word"],
- 'application/vnd.ms-excel' => $_style["tree_page_excel"],
- 'text/css' => $_style["tree_page_css"],
- 'text/html' => $_style["tree_page_html"],
- 'text/plain' => $_style["tree_page"],
- 'text/xml' => $_style["tree_page_xml"],
- 'text/javascript' => $_style["tree_page_js"],
- 'image/gif' => $_style["tree_page_gif"],
- 'image/jpg' => $_style["tree_page_jpg"],
- 'image/png' => $_style["tree_page_png"]
- );
- $iconsPrivate = array(
- 'application/rss+xml' => $_style["tree_page_rss_secure"],
- 'application/pdf' => $_style["tree_page_pdf_secure"],
- 'application/vnd.ms-word' => $_style["tree_page_word_secure"],
- 'application/vnd.ms-excel' => $_style["tree_page_excel_secure"],
- 'text/css' => $_style["tree_page_css_secure"],
- 'text/html' => $_style["tree_page_html_secure"],
- 'text/plain' => $_style["tree_page_secure"],
- 'text/xml' => $_style["tree_page_xml_secure"],
- 'text/javascript' => $_style["tree_page_js_secure"],
- 'image/gif' => $_style["tree_page_gif_secure"],
- 'image/jpg' => $_style["tree_page_jpg_secure"],
- 'image/png' => $_style["tree_page_png_secure"]
- );
-
- if (isset($_SESSION['openedArray'])) {
- $opened = explode("|", $_SESSION['openedArray']);
- } else {
- $opened = array();
+ $orderby = $_SESSION['tree_sortby']." ".$_SESSION['tree_sortdir'];
+
+ // Folder sorting gets special setup ;) Add menuindex and pagetitle
+ if($_SESSION['tree_sortby'] == 'isfolder') $orderby .= ", menuindex ASC, pagetitle";
+
+ $tblsc = $dbase.".`".$table_prefix."site_content`";
+ $tbldg = $dbase.".`".$table_prefix."document_groups`";
+ $tbldgn = $dbase.".`".$table_prefix."documentgroup_names`";
+ // get document groups for current user
+ $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(",",$_SESSION['mgrDocgroups']) : '';
+ $showProtected= false;
+ if (isset ($modx->config['tree_show_protected'])) {
+ $showProtected= (boolean) $modx->config['tree_show_protected'];
}
- $opened2 = array();
- $closed2 = array();
-
- makeHTML($indent,$parent,$expandAll,$theme);
- echo $output;
-
- // check for deleted documents on reload
- if ($expandAll==2) {
- $sql = "SELECT COUNT(*) FROM $dbase.`".$table_prefix."site_content` WHERE deleted=1";
- $rs = mysql_query($sql);
- $row = mysql_fetch_row($rs);
- $count = $row[0];
- if ($count>0) echo '
'; // add a special element to let system now that the bin is full
+ $mgrRole= (isset ($_SESSION['mgrRole']) && (string) $_SESSION['mgrRole']==='1') ? '1' : '0';
+ if ($showProtected == false) {
+ $access = "AND (1={$mgrRole} OR sc.privatemgr=0".
+ (!$docgrp ? ")":" OR dg.document_group IN ({$docgrp}))");
}
-
- function makeHTML($indent,$parent,$expandAll,$theme) {
- global $modx;
- global $icons, $iconsPrivate, $theme, $_style;
- global $modxDBConn, $output, $dbase, $table_prefix, $_lang, $opened, $opened2, $closed2; //added global vars
-
- $pad = " ";
-
- // setup spacer
- $spacer = "";
- for ($i = 1; $i <= $indent; $i++){
- $spacer .= " ";
- }
-
- if (!isset($_SESSION['tree_sortby']) && !isset($_SESSION['tree_sortdir'])) {
- // This is the first startup, set default sort order
- $_SESSION['tree_sortby'] = 'menuindex';
- $_SESSION['tree_sortdir'] = 'ASC';
- }
- $orderby = $_SESSION['tree_sortby']." ".$_SESSION['tree_sortdir'];
-
- // Folder sorting gets special setup ;) Add menuindex and pagetitle
- if($_SESSION['tree_sortby'] == 'isfolder') $orderby .= ", menuindex ASC, pagetitle";
-
- $tblsc = $dbase.".`".$table_prefix."site_content`";
- $tbldg = $dbase.".`".$table_prefix."document_groups`";
- $tbldgn = $dbase.".`".$table_prefix."documentgroup_names`";
- // get document groups for current user
- if($_SESSION['mgrDocgroups']) $docgrp = implode(",",$_SESSION['mgrDocgroups']);
- $showProtected= false;
- if (isset ($modx->config['tree_show_protected'])) {
- $showProtected= (boolean) $modx->config['tree_show_protected'];
- }
- $mgrRole= (isset ($_SESSION['mgrRole']) && (string) $_SESSION['mgrRole']==='1') ? '1' : '0';
- if ($showProtected == false) {
- $access = "AND (1={$mgrRole} OR sc.privatemgr=0".
- (!$docgrp ? ")":" OR dg.document_group IN ({$docgrp}))");
- }
- $sql = "SELECT DISTINCT sc.id, pagetitle, parent, isfolder, published, deleted, type, menuindex, hidemenu, alias, contentType, privateweb, privatemgr,
+ $sql = "SELECT DISTINCT sc.id, pagetitle, parent, isfolder, published, deleted, type, menuindex, hidemenu, alias, contentType, privateweb, privatemgr,
MAX(IF(1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? "":" OR dg.document_group IN ({$docgrp})") . ", 1, 0)) AS has_access
FROM {$tblsc} AS sc
LEFT JOIN {$tbldg} dg on dg.document = sc.id
@@ -123,85 +123,85 @@ function makeHTML($indent,$parent,$expandAll,$theme) {
$access
GROUP BY sc.id
ORDER BY {$orderby}";
- $result = mysql_query($sql, $modxDBConn);
- if(mysql_num_rows($result)==0) {
- $output .= '
'.$spacer.$pad.'
'.$_lang['empty_folder'].'';
- }
+ $result = mysql_query($sql, $modxDBConn);
+ if(mysql_num_rows($result)==0) {
+ $output .= '
'.$spacer.$pad.'
'.$_lang['empty_folder'].'';
+ }
- // Make sure to pass in the $modx_textdir variable to the node builder
- global $modx_textdir;
-
- while(list($id,$pagetitle,$parent,$isfolder,$published,$deleted,$type,$menuindex,$hidemenu,$alias,$contenttype,$privateweb,$privatemgr,$hasAccess) = mysql_fetch_row($result))
- {
- $pagetitle = htmlspecialchars(str_replace(array("\r\n", "\n", "\r"), '', $pagetitle));
- $protectedClass = $hasAccess==0 ? ' protectedNode' : '';
- $pagetitleDisplay = $published==0 ? "
$pagetitle" : ($hidemenu==1 ? "":"
$pagetitle");
- $pagetitleDisplay = $deleted==1 ? "
$pagetitle" : $pagetitleDisplay;
- $weblinkDisplay = $type=="reference" ? '

' : '' ;
- $pageIdDisplay = '
('.($modx_textdir ? '':'').$id.')';
- $url = $modx->makeUrl($id);
-
- $alt = !empty($alias) ? $_lang['alias'].": ".$alias : $_lang['alias'].": -";
- $alt.= " ".$_lang['resource_opt_menu_index'].": ".$menuindex;
- $alt.= " ".$_lang['resource_opt_show_menu'].": ".($hidemenu==1 ? $_lang['no']:$_lang['yes']);
- $alt.= " ".$_lang['page_data_web_access'].": ".($privateweb ? $_lang['private']:$_lang['public']);
- $alt.= " ".$_lang['page_data_mgr_access'].": ".($privatemgr ? $_lang['private']:$_lang['public']);
-
- if (!$isfolder) {
- $icon = ($privateweb||$privatemgr) ? $_style["tree_page_secure"] : $_style["tree_page"];
-
- if ($privateweb||$privatemgr) {
- if (isset($iconsPrivate[$contenttype])) {
- $icon = $iconsPrivate[$contenttype];
- }
- } else {
- if (isset($icons[$contenttype])) {
- $icon = $icons[$contenttype];
- }
+ // Make sure to pass in the $modx_textdir variable to the node builder
+ global $modx_textdir;
+
+ while(list($id,$pagetitle,$parent,$isfolder,$published,$deleted,$type,$menuindex,$hidemenu,$alias,$contenttype,$privateweb,$privatemgr,$hasAccess) = mysql_fetch_row($result))
+ {
+ $pagetitle = htmlspecialchars(str_replace(array("\r\n", "\n", "\r"), '', $pagetitle));
+ $protectedClass = $hasAccess==0 ? ' protectedNode' : '';
+ $pagetitleDisplay = $published==0 ? "
$pagetitle" : ($hidemenu==1 ? "":"
$pagetitle");
+ $pagetitleDisplay = $deleted==1 ? "
$pagetitle" : $pagetitleDisplay;
+ $weblinkDisplay = $type=="reference" ? '

' : '' ;
+ $pageIdDisplay = '
('.($modx_textdir ? '':'').$id.')';
+ $url = $modx->makeUrl($id);
+
+ $alt = !empty($alias) ? $_lang['alias'].": ".$alias : $_lang['alias'].": -";
+ $alt.= " ".$_lang['resource_opt_menu_index'].": ".$menuindex;
+ $alt.= " ".$_lang['resource_opt_show_menu'].": ".($hidemenu==1 ? $_lang['no']:$_lang['yes']);
+ $alt.= " ".$_lang['page_data_web_access'].": ".($privateweb ? $_lang['private']:$_lang['public']);
+ $alt.= " ".$_lang['page_data_mgr_access'].": ".($privatemgr ? $_lang['private']:$_lang['public']);
+
+ if (!$isfolder) {
+ $icon = ($privateweb||$privatemgr) ? $_style["tree_page_secure"] : $_style["tree_page"];
+
+ if ($privateweb||$privatemgr) {
+ if (isset($iconsPrivate[$contenttype])) {
+ $icon = $iconsPrivate[$contenttype];
+ }
+ } else {
+ if (isset($icons[$contenttype])) {
+ $icon = $icons[$contenttype];
+ }
+ }
+ if($id == $modx->config['site_start']) $icon = $_style["tree_page_home"];
+ elseif($id == $modx->config['error_page']) $icon = $_style["tree_page_404"];
+ elseif($id == $modx->config['site_unavailable_page']) $icon = $_style["tree_page_hourglass"];
+ elseif($id == $modx->config['unauthorized_page']) $icon = $_style["tree_page_info"];
+ $output .= '
'.$spacer.$pad.'
!['.$_lang['click_to_context'].']('.$icon.')
';
+ $output .= '
'.$pagetitleDisplay.$weblinkDisplay.' '.$pageIdDisplay.'
';
+ }
+ else {
+ // expandAll: two type for partial expansion
+ if ($expandAll ==1 || ($expandAll == 2 && in_array($id, $opened)))
+ {
+ if ($expandAll == 1) {
+ array_push($opened2, $id);
}
if($id == $modx->config['site_start']) $icon = $_style["tree_page_home"];
elseif($id == $modx->config['error_page']) $icon = $_style["tree_page_404"];
elseif($id == $modx->config['site_unavailable_page']) $icon = $_style["tree_page_hourglass"];
elseif($id == $modx->config['unauthorized_page']) $icon = $_style["tree_page_info"];
- $output .= '
'.$spacer.$pad.'
!['.$_lang['click_to_context'].']('.$icon.')
';
- $output .= '
'.$pagetitleDisplay.$weblinkDisplay.' '.$pageIdDisplay.'
';
+ $output .= '
'.$spacer.'
!['.$_lang['click_to_context'].']('.(($privateweb == 1 || $privatemgr == 1) ? $_style[)
';
+ $output .= '
'.$pagetitleDisplay.$weblinkDisplay.' '.$pageIdDisplay.'
';
+ makeHTML($indent+1,$id,$expandAll,$theme);
+ $output .= '
';
}
else {
- // expandAll: two type for partial expansion
- if ($expandAll ==1 || ($expandAll == 2 && in_array($id, $opened)))
- {
- if ($expandAll == 1) {
- array_push($opened2, $id);
- }
- if($id == $modx->config['site_start']) $icon = $_style["tree_page_home"];
- elseif($id == $modx->config['error_page']) $icon = $_style["tree_page_404"];
- elseif($id == $modx->config['site_unavailable_page']) $icon = $_style["tree_page_hourglass"];
- elseif($id == $modx->config['unauthorized_page']) $icon = $_style["tree_page_info"];
- $output .= '
'.$spacer.'
!['.$_lang['click_to_context'].']('.(($privateweb == 1 || $privatemgr == 1) ? $_style[)
';
- $output .= '
'.$pagetitleDisplay.$weblinkDisplay.' '.$pageIdDisplay.'
';
- makeHTML($indent+1,$id,$expandAll,$theme);
- $output .= '
';
- }
- else {
- $output .= '
'.$spacer.'
!['.$_lang['click_to_context'].']('.(($privateweb == 1 || $privatemgr == 1) ? $_style[)
';
- $output .= '
'.$pagetitleDisplay.$weblinkDisplay.' '.$pageIdDisplay.'
';
- array_push($closed2, $id);
- }
+ $output .= '
'.$spacer.'
!['.$_lang['click_to_context'].']('.(($privateweb == 1 || $privatemgr == 1) ? $_style[)
';
+ $output .= '
'.$pagetitleDisplay.$weblinkDisplay.' '.$pageIdDisplay.'
';
+ array_push($closed2, $id);
}
- // store vars in Javascript
- if ($expandAll == 1) {
- echo ' ';
- } elseif ($expandAll == 0) {
- echo ' ';
+ }
+ // store vars in Javascript
+ if ($expandAll == 1) {
+ echo ' ';
+ } elseif ($expandAll == 0) {
+ echo ' ';
}
}
+}
?>
\ No newline at end of file
diff --git a/manager/frames/tree.php b/manager/frames/tree.php
index 50dd3f60c5..ad74b63a50 100755
--- a/manager/frames/tree.php
+++ b/manager/frames/tree.php
@@ -1,7 +1,7 @@
INCLUDE_ORDERING_ERROR
Please use the MODx Content Manager instead of accessing this file directly.");
$theme = $manager_theme ? "$manager_theme/":"";
-
+ $modx_textdir = isset($modx_textdir) ? $modx_textdir : null;
function constructLink($action, $img, $text, $allowed) {
if($allowed==1) { ?>