From f00cd32f051cd4eb5d497086c2f2ecddcdf920a3 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Tue, 30 Jan 2018 11:58:32 +0100 Subject: [PATCH 001/274] Fix tree buttons JS "if (document.getElementById('treeMenu')) {" this line was lost when some permissions wasn't set, cousing JS error (unable to open manage files/images popup window). --- manager/frames/1.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/manager/frames/1.php b/manager/frames/1.php index 4b3315260c..5a310b0822 100644 --- a/manager/frames/1.php +++ b/manager/frames/1.php @@ -526,9 +526,10 @@ function constructLink($action, $img, $text, $allowed) ?> "; } else { @@ -312,7 +312,7 @@ function jsAlert($msg) { * @return bool */ function login($username, $givenPassword, $dbasePassword) { - global $modx; + $modx = evolutionCMS(); return $modx->phpass->CheckPassword($givenPassword, $dbasePassword); } @@ -324,7 +324,7 @@ function login($username, $givenPassword, $dbasePassword) { * @return bool */ function loginV1($internalKey, $givenPassword, $dbasePassword, $username) { - global $modx; + $modx = evolutionCMS(); $user_algo = $modx->manager->getV1UserHashAlgorithm($internalKey); @@ -354,7 +354,7 @@ function loginV1($internalKey, $givenPassword, $dbasePassword, $username) { * @return bool */ function loginMD5($internalKey, $givenPassword, $dbasePassword, $username) { - global $modx; + $modx = evolutionCMS(); if($dbasePassword != md5($givenPassword)) { return false; @@ -368,7 +368,7 @@ function loginMD5($internalKey, $givenPassword, $dbasePassword, $username) { * @param string $password */ function updateNewHash($username, $password) { - global $modx; + $modx = evolutionCMS(); $field = array(); $field['password'] = $modx->phpass->HashPassword($password); @@ -382,7 +382,7 @@ function updateNewHash($username, $password) { * @param int $blocked_minutes */ function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes) { - global $modx; + $modx = evolutionCMS(); $failedlogins += 1; diff --git a/manager/processors/move_document.processor.php b/manager/processors/move_document.processor.php index 4cd1a3a1ba..c0a8c390fd 100644 --- a/manager/processors/move_document.processor.php +++ b/manager/processors/move_document.processor.php @@ -43,7 +43,7 @@ * @return array */ function allChildren($currDocID) { - global $modx; + $modx = evolutionCMS(); $children= array(); $currDocID = $modx->db->escape($currDocID); $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent = '{$currDocID}'"); diff --git a/manager/processors/save_module.processor.php b/manager/processors/save_module.processor.php index 44ab6638b9..ada5f818de 100644 --- a/manager/processors/save_module.processor.php +++ b/manager/processors/save_module.processor.php @@ -185,7 +185,7 @@ */ function saveUserGroupAccessPermissons() { - global $modx; + $modx = evolutionCMS(); global $id, $newid; global $use_udperms; diff --git a/manager/processors/save_plugin.processor.php b/manager/processors/save_plugin.processor.php index 30c0127088..1d25a72b8e 100755 --- a/manager/processors/save_plugin.processor.php +++ b/manager/processors/save_plugin.processor.php @@ -173,7 +173,7 @@ # Save Plugin Event Listeners function saveEventListeners($id, $sysevents, $mode) { - global $modx; + $modx = evolutionCMS(); // save selected system events $formEventList = array(); foreach ($sysevents as $evtId) { @@ -219,7 +219,7 @@ function saveEventListeners($id, $sysevents, $mode) */ function getEventIdByName($name) { - global $modx; + $modx = evolutionCMS(); static $eventIds=array(); if(isset($eventIds[$name])) return $eventIds[$name]; diff --git a/manager/processors/save_template.processor.php b/manager/processors/save_template.processor.php index 4e20f7998d..ed4dca716c 100644 --- a/manager/processors/save_template.processor.php +++ b/manager/processors/save_template.processor.php @@ -149,7 +149,7 @@ */ function saveTemplateAccess($id) { - global $modx; + $modx = evolutionCMS(); if ($_POST['tvsDirty'] == 1) { $newAssignedTvs = $_POST['assignedTv']; diff --git a/manager/processors/save_tmplvars.processor.php b/manager/processors/save_tmplvars.processor.php index 6180168ec2..c25265386e 100755 --- a/manager/processors/save_tmplvars.processor.php +++ b/manager/processors/save_tmplvars.processor.php @@ -179,7 +179,7 @@ function saveTemplateVarAccess() { global $id, $newid; - global $modx; + $modx = evolutionCMS(); if ($newid) { $id = $newid; @@ -212,7 +212,7 @@ function saveTemplateVarAccess() function saveDocumentAccessPermissons() { global $id, $newid; - global $modx, $use_udperms; + $modx = evolutionCMS(); global $use_udperms; $tbl_site_tmplvar_templates = $modx->getFullTableName('site_tmplvar_access'); diff --git a/manager/processors/save_user.processor.php b/manager/processors/save_user.processor.php index 73ba0821a9..b853ee0b06 100644 --- a/manager/processors/save_user.processor.php +++ b/manager/processors/save_user.processor.php @@ -357,7 +357,7 @@ * @param string $ufn */ function sendMailMessage($email, $uid, $pwd, $ufn) { - global $modx, $_lang, $signupemail_message; + $modx = evolutionCMS(); global $_lang, $signupemail_message; global $emailsubject, $emailsender; global $site_name; $manager_url = MODX_MANAGER_URL; @@ -390,7 +390,7 @@ function sendMailMessage($email, $uid, $pwd, $ufn) { * @param int $id */ function saveUserSettings($id) { - global $modx; + $modx = evolutionCMS(); $tbl_user_settings = $modx->getFullTableName('user_settings'); $ignore = array( diff --git a/manager/processors/save_web_user.processor.php b/manager/processors/save_web_user.processor.php index 05c6c0162d..afca6521db 100644 --- a/manager/processors/save_web_user.processor.php +++ b/manager/processors/save_web_user.processor.php @@ -360,7 +360,7 @@ function save_user_quoted_printable($string) { * @param string $ufn */ function sendMailMessage($email, $uid, $pwd, $ufn) { - global $modx, $_lang, $websignupemail_message; + $modx = evolutionCMS(); global $_lang, $websignupemail_message; global $emailsubject, $emailsender; global $site_name, $site_url; $message = sprintf($websignupemail_message, $uid, $pwd); // use old method @@ -388,7 +388,7 @@ function sendMailMessage($email, $uid, $pwd, $ufn) { // Save User Settings function saveUserSettings($id) { - global $modx; + $modx = evolutionCMS(); $tbl_web_user_settings = $modx->getFullTableName('web_user_settings'); $settings = array( @@ -436,7 +436,7 @@ function generate_password($length = 10) { } function sanitize($str = '', $safecount = 0) { - global $modx; + $modx = evolutionCMS(); $safecount++; if(1000 < $safecount) { exit("error too many loops '{$safecount}'"); diff --git a/manager/processors/undelete_content.processor.php b/manager/processors/undelete_content.processor.php index 6ddbc713f6..84cdc95f72 100644 --- a/manager/processors/undelete_content.processor.php +++ b/manager/processors/undelete_content.processor.php @@ -49,7 +49,7 @@ */ function getChildren($parent) { - global $modx; + $modx = evolutionCMS(); global $children; global $deltime; diff --git a/manager/processors/user_documents_permissions.class.php b/manager/processors/user_documents_permissions.class.php index 54ceaf6535..50fdf27bbe 100755 --- a/manager/processors/user_documents_permissions.class.php +++ b/manager/processors/user_documents_permissions.class.php @@ -26,7 +26,7 @@ public function checkPermissions() { global $udperms_allowroot; - global $modx; + $modx = evolutionCMS(); $tblsc = $modx->getFullTableName('site_content'); $tbldg = $modx->getFullTableName('document_groups'); From 74d537ac6f7134ee645c526931c937b89343b8db Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Tue, 30 Jan 2018 11:58:32 +0100 Subject: [PATCH 005/274] Fix tree buttons JS "if (document.getElementById('treeMenu')) {" this line was lost when some permissions wasn't set, cousing JS error (unable to open manage files/images popup window). --- manager/frames/1.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/manager/frames/1.php b/manager/frames/1.php index 4b3315260c..5a310b0822 100644 --- a/manager/frames/1.php +++ b/manager/frames/1.php @@ -526,9 +526,10 @@ function constructLink($action, $img, $text, $allowed) ?> - -

- - - -
-
-
- -

-
-
:
-
-
-
-
:
-
-
- -
-
-
+INCLUDE_ORDERING_ERROR

Please use the EVO Content Manager instead of accessing this file directly."); +} +if(!$modx->hasPermission('change_password')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); +} +?> + + + +

+ + + +
+
+
+ +

+
+
:
+
+
+
+
:
+
+
+ +
+
+
From af7a29d2f2ff6f2a55b2398b38d8bf3564c3063d Mon Sep 17 00:00:00 2001 From: Nicola Date: Mon, 12 Feb 2018 11:41:40 +0100 Subject: [PATCH 029/274] moved page icon to style.php moved page icon to style.php (started moving all fontawesome icons to theme style.php) - help - sysinfo - schedule - settings - eventlog --- manager/actions/eventlog.dynamic.php | 318 +++++----- manager/actions/help.static.php | 106 ++-- manager/actions/logging.static.php | 646 ++++++++++---------- manager/actions/mutate_settings.dynamic.php | 272 ++++----- manager/actions/site_schedule.static.php | 274 ++++----- manager/actions/sysinfo.static.php | 304 ++++----- 6 files changed, 960 insertions(+), 960 deletions(-) diff --git a/manager/actions/eventlog.dynamic.php b/manager/actions/eventlog.dynamic.php index 6e3e28de88..b1ac8616e2 100644 --- a/manager/actions/eventlog.dynamic.php +++ b/manager/actions/eventlog.dynamic.php @@ -1,159 +1,159 @@ -INCLUDE_ORDERING_ERROR

Please use the EVO Content Manager instead of accessing this file directly."); -} -if(!$modx->hasPermission('view_eventlog')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); -} - -// Get table Names (alphabetical) -$tbl_event_log = $modx->getFullTableName('event_log'); -$tbl_manager_users = $modx->getFullTableName('manager_users'); -$tbl_web_users = $modx->getFullTableName('web_users'); - -// initialize page view state - the $_PAGE object -$modx->manager->initPageViewState(); - -// get and save search string -if($_REQUEST['op'] == 'reset') { - $sqlQuery = $query = ''; - $_PAGE['vs']['search'] = ''; -} else { - $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; - if(!is_numeric($sqlQuery)) { - $sqlQuery = $modx->db->escape($query); - } - $_PAGE['vs']['search'] = $query; -} - -// get & save listmode -$listmode = isset($_REQUEST['listmode']) ? $_REQUEST['listmode'] : $_PAGE['vs']['lm']; -$_PAGE['vs']['lm'] = $listmode; - -// context menu -include_once MODX_MANAGER_PATH . "includes/controls/contextmenu.php"; -$cm = new ContextMenu("cntxm", 150); -$cm->addItem($_lang['view_log'], "js:menuAction(1)", $_style['actions_preview']); -$cm->addSeparator(); -$cm->addItem($_lang['delete'], "js:menuAction(2)", $_style['actions_delete'], (!$modx->hasPermission('delete_eventlog') ? 1 : 0)); -echo $cm->render(); - -?> - -
- - - - -

- -

- -
-
-
- -
- -
- -
-
- db->select("el.id, ELT(el.type , 'text-info {$_style['actions_info']}' , 'text-warning {$_style['actions_triangle']}' , 'text-danger {$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el - LEFT JOIN {$tbl_manager_users} AS mu ON mu.id=el.user AND el.usertype=0 - LEFT JOIN {$tbl_web_users} AS wu ON wu.id=el.user AND el.usertype=1", ($sqlQuery ? "" . (is_numeric($sqlQuery) ? "(eventid='{$sqlQuery}') OR " : '') . "(source LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "createdon DESC"); - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items - $grd->pagerClass = ''; - $grd->pageClass = 'page-item'; - $grd->selPageClass = 'page-item active'; - $grd->noRecordMsg = $_lang['no_records_found']; - $grd->cssClass = "table data nowrap"; - $grd->columnHeaderClass = "tableHeader"; - $grd->itemClass = "tableItem"; - $grd->altItemClass = "tableAltItem"; - $grd->fields = "type,source,createdon,eventid,username"; - $grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid']; - $grd->colWidths = "1%,,1%,1%,1%"; - $grd->colAligns = "center,,,center,center"; - $grd->colTypes = "template:||template:[+source+]||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p'; - if($listmode == '1') { - $grd->pageSize = 0; - } - if($_REQUEST['op'] == 'reset') { - $grd->pageNumber = 1; - } - // render grid - echo $grd->render(); - ?> -
-
-
-
-
+INCLUDE_ORDERING_ERROR

Please use the EVO Content Manager instead of accessing this file directly."); +} +if(!$modx->hasPermission('view_eventlog')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); +} + +// Get table Names (alphabetical) +$tbl_event_log = $modx->getFullTableName('event_log'); +$tbl_manager_users = $modx->getFullTableName('manager_users'); +$tbl_web_users = $modx->getFullTableName('web_users'); + +// initialize page view state - the $_PAGE object +$modx->manager->initPageViewState(); + +// get and save search string +if($_REQUEST['op'] == 'reset') { + $sqlQuery = $query = ''; + $_PAGE['vs']['search'] = ''; +} else { + $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; + if(!is_numeric($sqlQuery)) { + $sqlQuery = $modx->db->escape($query); + } + $_PAGE['vs']['search'] = $query; +} + +// get & save listmode +$listmode = isset($_REQUEST['listmode']) ? $_REQUEST['listmode'] : $_PAGE['vs']['lm']; +$_PAGE['vs']['lm'] = $listmode; + +// context menu +include_once MODX_MANAGER_PATH . "includes/controls/contextmenu.php"; +$cm = new ContextMenu("cntxm", 150); +$cm->addItem($_lang['view_log'], "js:menuAction(1)", $_style['actions_preview']); +$cm->addSeparator(); +$cm->addItem($_lang['delete'], "js:menuAction(2)", $_style['actions_delete'], (!$modx->hasPermission('delete_eventlog') ? 1 : 0)); +echo $cm->render(); + +?> + +
+ + + + +

+ +

+ +
+
+
+ +
+ +
+ +
+
+ db->select("el.id, ELT(el.type , 'text-info {$_style['actions_info']}' , 'text-warning {$_style['actions_triangle']}' , 'text-danger {$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el + LEFT JOIN {$tbl_manager_users} AS mu ON mu.id=el.user AND el.usertype=0 + LEFT JOIN {$tbl_web_users} AS wu ON wu.id=el.user AND el.usertype=1", ($sqlQuery ? "" . (is_numeric($sqlQuery) ? "(eventid='{$sqlQuery}') OR " : '') . "(source LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "createdon DESC"); + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items + $grd->pagerClass = ''; + $grd->pageClass = 'page-item'; + $grd->selPageClass = 'page-item active'; + $grd->noRecordMsg = $_lang['no_records_found']; + $grd->cssClass = "table data nowrap"; + $grd->columnHeaderClass = "tableHeader"; + $grd->itemClass = "tableItem"; + $grd->altItemClass = "tableAltItem"; + $grd->fields = "type,source,createdon,eventid,username"; + $grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid']; + $grd->colWidths = "1%,,1%,1%,1%"; + $grd->colAligns = "center,,,center,center"; + $grd->colTypes = "template:||template:[+source+]||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p'; + if($listmode == '1') { + $grd->pageSize = 0; + } + if($_REQUEST['op'] == 'reset') { + $grd->pageNumber = 1; + } + // render grid + echo $grd->render(); + ?> +
+
+
+
+
diff --git a/manager/actions/help.static.php b/manager/actions/help.static.php index 2b8a6adc82..e3a0fa5d4d 100644 --- a/manager/actions/help.static.php +++ b/manager/actions/help.static.php @@ -1,53 +1,53 @@ -INCLUDE_ORDERING_ERROR

Please use the EVO Content Manager instead of accessing this file directly."); -} -$helpBasePath = "actions/help/"; -?> - -

- -

- -
-
- - - $v) { - - $helpname = substr($v, 0, strrpos($v, '.')); - - $prefix = substr($helpname, 0, 2); - if(is_numeric($prefix)) { - $helpname = substr($helpname, 2, strlen($helpname) - 1); - } - - $hnLower = strtolower($helpname); - $helpname = isset($_lang[$hnLower]) ? $_lang[$hnLower] : str_replace('_', ' ', $helpname); - - echo '
'; - echo '

' . $helpname . '

'; - echo ''; - include_once($helpBasePath . "{$v}"); - echo '
'; - } - ?> -
-
- +INCLUDE_ORDERING_ERROR

Please use the EVO Content Manager instead of accessing this file directly."); +} +$helpBasePath = "actions/help/"; +?> + +

+ +

+ +
+
+ + + $v) { + + $helpname = substr($v, 0, strrpos($v, '.')); + + $prefix = substr($helpname, 0, 2); + if(is_numeric($prefix)) { + $helpname = substr($helpname, 2, strlen($helpname) - 1); + } + + $hnLower = strtolower($helpname); + $helpname = isset($_lang[$hnLower]) ? $_lang[$hnLower] : str_replace('_', ' ', $helpname); + + echo '
'; + echo '

' . $helpname . '

'; + echo ''; + include_once($helpBasePath . "{$v}"); + echo '
'; + } + ?> +
+
+ diff --git a/manager/actions/logging.static.php b/manager/actions/logging.static.php index a61d41f3e9..9126ab9b0b 100644 --- a/manager/actions/logging.static.php +++ b/manager/actions/logging.static.php @@ -1,323 +1,323 @@ -INCLUDE_ORDERING_ERROR

Please use the EVO Content Manager instead of accessing this file directly."); -} -if (!$modx->hasPermission('logs')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); -} - -function array_unique_multi($array, $checkKey) -{ - // Use the builtin if we're not a multi-dimensional array - if (!is_array(current($array)) || empty($checkKey)) { - return array_unique($array); - } - - $ret = array(); - $checkValues = array(); // contains the unique key Values - foreach ($array as $key => $current) { - if (in_array($current[$checkKey], $checkValues)) { - continue; - } // duplicate - - $checkValues[] = $current[$checkKey]; - $ret[$key] = $current; - } - return $ret; -} - -function record_sort($array, $key) -{ - $hash = array(); - foreach ($array as $k => $v) { - $hash[$k] = $v[$key]; - } - - natsort($hash); - - $records = array(); - foreach ($hash as $k => $row) { - $records[$k] = $array[$k]; - } - - return $records; -} - -$rs = $modx->db->select('DISTINCT internalKey, username, action, itemid, itemname', $modx->getFullTableName('manager_log')); -$logs = $modx->db->makeArray($rs); -?> -

- -

- -
-
-
- -
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
-
- " /> - " title=""> -
-
-
-
-
-
-
- " /> - " title=""> -
-
-
-
-
-
- -
-
- - "> - "> - - " style="display:none;" /> -
- -
-
- - - -
-
- -db->escape($_REQUEST['itemname']) . "'"; - } - if ($_REQUEST['message'] != "") { - $sqladd[] = "message LIKE '%" . $modx->db->escape($_REQUEST['message']) . "%'"; - } - // date stuff - if ($_REQUEST['datefrom'] != "") { - $sqladd[] = "timestamp>" . $modx->toTimeStamp($_REQUEST['datefrom']); - } - if ($_REQUEST['dateto'] != "") { - $sqladd[] = "timestamp<" . $modx->toTimeStamp($_REQUEST['dateto']); - } - - // If current position is not set, set it to zero - if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) { - $int_cur_position = 0; - } else { - $int_cur_position = $_REQUEST['int_cur_position']; - } - - // Number of result to display on the page, will be in the LIMIT of the sql query also - $int_num_result = is_numeric($_REQUEST['nrresults']) ? $_REQUEST['nrresults'] : $number_of_logs; - - $extargv = "&a=13&searchuser=" . $_REQUEST['searchuser'] . "&action=" . $_REQUEST['action'] . "&itemid=" . $_REQUEST['itemid'] . "&itemname=" . $_REQUEST['itemname'] . "&message=" . $_REQUEST['message'] . "&dateto=" . $_REQUEST['dateto'] . "&datefrom=" . $_REQUEST['datefrom'] . "&nrresults=" . $int_num_result . "&log_submit=" . $_REQUEST['log_submit']; // extra argv here (could be anything depending on your page) - - // build the sql - $limit = $num_rows = $modx->db->getValue($modx->db->select('COUNT(*)', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''))); - - $rs = $modx->db->select('*', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''), 'timestamp DESC, id DESC', "{$int_cur_position}, {$int_num_result}"); - -if ($limit < 1) { - echo '

' . $_lang["mgrlog_emptysrch"] . '

'; -} else { - echo '

' . $_lang["mgrlog_sortinst"] . '

'; - - include_once "paginate.inc.php"; - // New instance of the Paging class, you can modify the color and the width of the html table - $p = new Paging($num_rows, $int_cur_position, $int_num_result, $extargv); - - // Load up the 2 array in order to display result - $array_paging = $p->getPagingArray(); - $array_row_paging = $p->getPagingRowArray(); - $current_row = $int_cur_position / $int_num_result; - - // Display the result as you like... - print "

" . $_lang["paging_showing"] . " " . $array_paging['lower']; - print " " . $_lang["paging_to"] . " " . $array_paging['upper']; - print " (" . $array_paging['total'] . " " . $_lang["paging_total"] . ")
"; - $paging = $array_paging['first_link'] . $_lang["paging_first"] . (isset($array_paging['first_link']) ? " " : " "); - $paging .= $array_paging['previous_link'] . $_lang["paging_prev"] . (isset($array_paging['previous_link']) ? " " : " "); - $pagesfound = sizeof($array_row_paging); - if ($pagesfound > 6) { - $paging .= $array_row_paging[$current_row - 2]; // ." "; - $paging .= $array_row_paging[$current_row - 1]; // ." "; - $paging .= $array_row_paging[$current_row]; // ." "; - $paging .= $array_row_paging[$current_row + 1]; // ." "; - $paging .= $array_row_paging[$current_row + 2]; // ." "; - } else { - for ($i = 0; $i < $pagesfound; $i++) { - $paging .= $array_row_paging[$i] . " "; - } - } - $paging .= $array_paging['next_link'] . $_lang["paging_next"] . (isset($array_paging['next_link']) ? " " : " ") . " "; - $paging .= $array_paging['last_link'] . $_lang["paging_last"] . (isset($array_paging['last_link']) ? " " : " ") . " "; - // The above exemple print somethings like: - // Results 1 to 20 of 597 <<< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 >>> - // Of course you can now play with array_row_paging in order to print - // only the results you would like... - ?> - - - -

- -
-
- - - - - - - - - - - - db->getRow($rs)) { - if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) { - $item = '
-
'; - } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) { - $item = '' . $logentry['itemname'] . ''; - } else { - $item = $logentry['itemname']; - } - //index.php?a=13&searchuser=' . $logentry['internalKey'] . '&action=' . $logentry['action'] . '&itemname=' . $logentry['itemname'] . '&log_submit=true' - $user_drill = 'index.php?a=13&searchuser=' . $logentry['internalKey'] . '&itemname=0&log_submit=true'; - ?> - - - - - - - - - -
' . $logentry['username'] . '' ?>toDateFormat($logentry['timestamp'] + $server_offset_time) ?>
-
-
- - - -
-
- INCLUDE_ORDERING_ERROR

Please use the EVO Content Manager instead of accessing this file directly."); +} +if (!$modx->hasPermission('logs')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); +} + +function array_unique_multi($array, $checkKey) +{ + // Use the builtin if we're not a multi-dimensional array + if (!is_array(current($array)) || empty($checkKey)) { + return array_unique($array); + } + + $ret = array(); + $checkValues = array(); // contains the unique key Values + foreach ($array as $key => $current) { + if (in_array($current[$checkKey], $checkValues)) { + continue; + } // duplicate + + $checkValues[] = $current[$checkKey]; + $ret[$key] = $current; + } + return $ret; +} + +function record_sort($array, $key) +{ + $hash = array(); + foreach ($array as $k => $v) { + $hash[$k] = $v[$key]; + } + + natsort($hash); + + $records = array(); + foreach ($hash as $k => $row) { + $records[$k] = $array[$k]; + } + + return $records; +} + +$rs = $modx->db->select('DISTINCT internalKey, username, action, itemid, itemname', $modx->getFullTableName('manager_log')); +$logs = $modx->db->makeArray($rs); +?> +

+ +

+ +
+
+
+ +
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+ " /> + " title=""> +
+
+
+
+
+
+
+ " /> + " title=""> +
+
+
+
+
+
+ +
+
+ + "> + "> + + " style="display:none;" /> +
+ +
+
+ + + +
+
+ +db->escape($_REQUEST['itemname']) . "'"; + } + if ($_REQUEST['message'] != "") { + $sqladd[] = "message LIKE '%" . $modx->db->escape($_REQUEST['message']) . "%'"; + } + // date stuff + if ($_REQUEST['datefrom'] != "") { + $sqladd[] = "timestamp>" . $modx->toTimeStamp($_REQUEST['datefrom']); + } + if ($_REQUEST['dateto'] != "") { + $sqladd[] = "timestamp<" . $modx->toTimeStamp($_REQUEST['dateto']); + } + + // If current position is not set, set it to zero + if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) { + $int_cur_position = 0; + } else { + $int_cur_position = $_REQUEST['int_cur_position']; + } + + // Number of result to display on the page, will be in the LIMIT of the sql query also + $int_num_result = is_numeric($_REQUEST['nrresults']) ? $_REQUEST['nrresults'] : $number_of_logs; + + $extargv = "&a=13&searchuser=" . $_REQUEST['searchuser'] . "&action=" . $_REQUEST['action'] . "&itemid=" . $_REQUEST['itemid'] . "&itemname=" . $_REQUEST['itemname'] . "&message=" . $_REQUEST['message'] . "&dateto=" . $_REQUEST['dateto'] . "&datefrom=" . $_REQUEST['datefrom'] . "&nrresults=" . $int_num_result . "&log_submit=" . $_REQUEST['log_submit']; // extra argv here (could be anything depending on your page) + + // build the sql + $limit = $num_rows = $modx->db->getValue($modx->db->select('COUNT(*)', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''))); + + $rs = $modx->db->select('*', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''), 'timestamp DESC, id DESC', "{$int_cur_position}, {$int_num_result}"); + +if ($limit < 1) { + echo '

' . $_lang["mgrlog_emptysrch"] . '

'; +} else { + echo '

' . $_lang["mgrlog_sortinst"] . '

'; + + include_once "paginate.inc.php"; + // New instance of the Paging class, you can modify the color and the width of the html table + $p = new Paging($num_rows, $int_cur_position, $int_num_result, $extargv); + + // Load up the 2 array in order to display result + $array_paging = $p->getPagingArray(); + $array_row_paging = $p->getPagingRowArray(); + $current_row = $int_cur_position / $int_num_result; + + // Display the result as you like... + print "

" . $_lang["paging_showing"] . " " . $array_paging['lower']; + print " " . $_lang["paging_to"] . " " . $array_paging['upper']; + print " (" . $array_paging['total'] . " " . $_lang["paging_total"] . ")
"; + $paging = $array_paging['first_link'] . $_lang["paging_first"] . (isset($array_paging['first_link']) ? " " : " "); + $paging .= $array_paging['previous_link'] . $_lang["paging_prev"] . (isset($array_paging['previous_link']) ? " " : " "); + $pagesfound = sizeof($array_row_paging); + if ($pagesfound > 6) { + $paging .= $array_row_paging[$current_row - 2]; // ." "; + $paging .= $array_row_paging[$current_row - 1]; // ." "; + $paging .= $array_row_paging[$current_row]; // ." "; + $paging .= $array_row_paging[$current_row + 1]; // ." "; + $paging .= $array_row_paging[$current_row + 2]; // ." "; + } else { + for ($i = 0; $i < $pagesfound; $i++) { + $paging .= $array_row_paging[$i] . " "; + } + } + $paging .= $array_paging['next_link'] . $_lang["paging_next"] . (isset($array_paging['next_link']) ? " " : " ") . " "; + $paging .= $array_paging['last_link'] . $_lang["paging_last"] . (isset($array_paging['last_link']) ? " " : " ") . " "; + // The above exemple print somethings like: + // Results 1 to 20 of 597 <<< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 >>> + // Of course you can now play with array_row_paging in order to print + // only the results you would like... + ?> + + + +

+ +
+
+ + + + + + + + + + + + db->getRow($rs)) { + if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) { + $item = '
-
'; + } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) { + $item = '' . $logentry['itemname'] . ''; + } else { + $item = $logentry['itemname']; + } + //index.php?a=13&searchuser=' . $logentry['internalKey'] . '&action=' . $logentry['action'] . '&itemname=' . $logentry['itemname'] . '&log_submit=true' + $user_drill = 'index.php?a=13&searchuser=' . $logentry['internalKey'] . '&itemname=0&log_submit=true'; + ?> + + + + + + + + + +
' . $logentry['username'] . '' ?>toDateFormat($logentry['timestamp'] + $server_offset_time) ?>
+
+
+ + + +
+
+ INCLUDE_ORDERING_ERROR
Please use the EVO Content Manager instead of accessing this file directly."); -} -if(!$modx->hasPermission('settings')) { - $modx->webAlertAndQuit($_lang['error_no_privileges']); -} - -include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/functions.inc.php'); - -// check to see the edit settings page isn't locked -$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=17 AND internalKey!='" . $modx->getLoginUserID() . "'"); -if($username = $modx->db->getValue($rs)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username)); -} -// end check for lock - -// reload system settings from the database. -// this will prevent user-defined settings from being saved as system setting -$settings = array(); -include_once(MODX_MANAGER_PATH . 'includes/default_config.php'); -$rs = $modx->db->select('setting_name, setting_value', '[+prefix+]system_settings'); -while($row = $modx->db->getRow($rs)) { - $settings[$row['setting_name']] = $row['setting_value']; -} -$settings['filemanager_path'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['filemanager_path']); -$settings['rb_base_dir'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['rb_base_dir']); - -extract($settings, EXTR_OVERWRITE); - -// load languages and keys -$lang_keys = array(); -$dir = dir('includes/lang'); -while($file = $dir->read()) { - if(strpos($file, '.inc.php') > 0) { - $endpos = strpos($file, '.'); - $languagename = substr($file, 0, $endpos); - $lang_keys[$languagename] = get_lang_keys($file); - } -} -$dir->close(); -$displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; -?> - - -
- -

- -

- - - -
- - - - getVersionData('version')) { ?> -

- -
- - - -
-
-
- -tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );'; -} +INCLUDE_ORDERING_ERROR
Please use the EVO Content Manager instead of accessing this file directly."); +} +if(!$modx->hasPermission('settings')) { + $modx->webAlertAndQuit($_lang['error_no_privileges']); +} + +include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/functions.inc.php'); + +// check to see the edit settings page isn't locked +$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=17 AND internalKey!='" . $modx->getLoginUserID() . "'"); +if($username = $modx->db->getValue($rs)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username)); +} +// end check for lock + +// reload system settings from the database. +// this will prevent user-defined settings from being saved as system setting +$settings = array(); +include_once(MODX_MANAGER_PATH . 'includes/default_config.php'); +$rs = $modx->db->select('setting_name, setting_value', '[+prefix+]system_settings'); +while($row = $modx->db->getRow($rs)) { + $settings[$row['setting_name']] = $row['setting_value']; +} +$settings['filemanager_path'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['filemanager_path']); +$settings['rb_base_dir'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['rb_base_dir']); + +extract($settings, EXTR_OVERWRITE); + +// load languages and keys +$lang_keys = array(); +$dir = dir('includes/lang'); +while($file = $dir->read()) { + if(strpos($file, '.inc.php') > 0) { + $endpos = strpos($file, '.'); + $languagename = substr($file, 0, $endpos); + $lang_keys[$languagename] = get_lang_keys($file); + } +} +$dir->close(); +$displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; +?> + + +
+ +

+ +

+ + + +
+ + + + getVersionData('version')) { ?> +

+ +
+ + + +
+
+
+ +tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );'; +} diff --git a/manager/actions/site_schedule.static.php b/manager/actions/site_schedule.static.php index 80861bfc38..d783454b1c 100644 --- a/manager/actions/site_schedule.static.php +++ b/manager/actions/site_schedule.static.php @@ -1,137 +1,137 @@ -INCLUDE_ORDERING_ERROR

Please use the EVO Content Manager instead of accessing this file directly."); -} -if(!$modx->hasPermission('view_eventlog')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); -} -?> - - -

- -

- -
-
-
- - db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC'); - $limit = $modx->db->getRecordCount($rs); - if($limit < 1) { - ?> -

- -
- - - - - - - - - - db->getRow($rs)) { - ?> - - - - - - - -
toDateFormat($row['pub_date'] + $server_offset_time) ?>
-
- -
-
- - db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC'); - $limit = $modx->db->getRecordCount($rs); - if($limit < 1) { - ?> -

- -
- - - - - - - - - - db->getRow($rs)) { - ?> - - - - - - - -
toDateFormat($row['unpub_date'] + $server_offset_time) ?>
-
- -
-
- - db->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC"); - $limit = $modx->db->getRecordCount($rs); - if($limit < 1) { - ?> -

- -
- - - - - - - - - - - db->getRow($rs)) { - ?> - - - - - - - - -
toDateFormat($row['pub_date'] + $server_offset_time) ?>toDateFormat($row['unpub_date'] + $server_offset_time) ?>
-
- -
-
-
+INCLUDE_ORDERING_ERROR

Please use the EVO Content Manager instead of accessing this file directly."); +} +if(!$modx->hasPermission('view_eventlog')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); +} +?> + + +

+ +

+ +
+
+
+ + db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC'); + $limit = $modx->db->getRecordCount($rs); + if($limit < 1) { + ?> +

+ +
+ + + + + + + + + + db->getRow($rs)) { + ?> + + + + + + + +
toDateFormat($row['pub_date'] + $server_offset_time) ?>
+
+ +
+
+ + db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC'); + $limit = $modx->db->getRecordCount($rs); + if($limit < 1) { + ?> +

+ +
+ + + + + + + + + + db->getRow($rs)) { + ?> + + + + + + + +
toDateFormat($row['unpub_date'] + $server_offset_time) ?>
+
+ +
+
+ + db->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC"); + $limit = $modx->db->getRecordCount($rs); + if($limit < 1) { + ?> +

+ +
+ + + + + + + + + + + db->getRow($rs)) { + ?> + + + + + + + + +
toDateFormat($row['pub_date'] + $server_offset_time) ?>toDateFormat($row['unpub_date'] + $server_offset_time) ?>
+
+ +
+
+
diff --git a/manager/actions/sysinfo.static.php b/manager/actions/sysinfo.static.php index fc938efec4..7162b48ecc 100644 --- a/manager/actions/sysinfo.static.php +++ b/manager/actions/sysinfo.static.php @@ -1,152 +1,152 @@ -INCLUDE_ORDERING_ERROR

Please use the EVO Content Manager instead of accessing this file directly."); -} -if (!$modx->hasPermission('logs')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); -} - -$res = $modx->db->query("show variables like 'character_set_database'"); -$charset = $modx->db->getRow($res, 'num'); -$res = $modx->db->query("show variables like 'collation_database'"); -$collation = $modx->db->getRow($res, 'num'); - -$serverArr = array( - $_lang['modx_version'] => $modx->getVersionData('version') . ' ' . $newversiontext, - $_lang['release_date'] => $modx->getVersionData('release_date'), - 'PHP Version' => phpversion(), - 'phpInfo()' => '' . $_lang['view'] . '', - $_lang['access_permissions'] => ($use_udperms == 1 ? $_lang['enabled'] : $_lang['disabled']), - $_lang['servertime'] => strftime('%H:%M:%S', time()), - $_lang['localtime'] => strftime('%H:%M:%S', time() + $server_offset_time), - $_lang['serveroffset'] => $server_offset_time / (60 * 60) . ' h', - $_lang['database_name'] => trim($dbase, '`'), - $_lang['database_server'] => $database_server, - $_lang['database_version'] => $modx->db->getVersion(), - $_lang['database_charset'] => $charset[1], - $_lang['database_collation'] => $collation[1], - $_lang['table_prefix'] => $modx->db->config['table_prefix'], - $_lang['cfg_base_path'] => MODX_BASE_PATH, - $_lang['cfg_base_url'] => MODX_BASE_URL, - $_lang['cfg_manager_url'] => MODX_MANAGER_URL, - $_lang['cfg_manager_path'] => MODX_MANAGER_PATH, - $_lang['cfg_site_url'] => MODX_SITE_URL -); -?> - -

- -

- - - - -
-
-

Server

-
-
- - - $value) { - ?> - - - - - - - -
 
-
-
-
-
- -

 

- - -
-
-

-
-
- - - - - - - - - - - - - - - db->escape($modx->db->config['table_prefix']) . "%';"; - $rs = $modx->db->query($sql); - $i = 0; - while ($log_status = $modx->db->getRow($rs)) { - ?> - - - - - - db->config['table_prefix'] . 'event_log', - $modx->db->config['table_prefix'] . 'manager_log', - ); - if ($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) { - echo ""; - } else { - echo ""; - } - - if ($modx->hasPermission('settings')) { - echo ""; - } else { - echo ""; - } - ?> - - - - - - - - - - - - - -
' : '') ?>"; - echo "" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . ""; - echo "" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . "" . ($log_status['Data_free'] > 0 ? "" . $modx->nicesize($log_status['Data_free']) . "" : "-") . "" . ($log_status['Data_free'] > 0 ? $modx->nicesize($log_status['Data_free']) : "-") . "nicesize($log_status['Data_length'] - $log_status['Data_free']) ?>nicesize($log_status['Index_length']) ?>nicesize($log_status['Index_length'] + $log_status['Data_length'] + $log_status['Data_free']) ?>
  0 ? "" . $modx->nicesize($totaloverhead) . "
(" . number_format($totaloverhead) . " B)" : "-" ?>
 " . $modx->nicesize($total) . "
(" . number_format($total) . " B)" ?>
-
-
- 0) { ?> -
-

- -
-
+INCLUDE_ORDERING_ERROR

Please use the EVO Content Manager instead of accessing this file directly."); +} +if (!$modx->hasPermission('logs')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); +} + +$res = $modx->db->query("show variables like 'character_set_database'"); +$charset = $modx->db->getRow($res, 'num'); +$res = $modx->db->query("show variables like 'collation_database'"); +$collation = $modx->db->getRow($res, 'num'); + +$serverArr = array( + $_lang['modx_version'] => $modx->getVersionData('version') . ' ' . $newversiontext, + $_lang['release_date'] => $modx->getVersionData('release_date'), + 'PHP Version' => phpversion(), + 'phpInfo()' => '' . $_lang['view'] . '', + $_lang['access_permissions'] => ($use_udperms == 1 ? $_lang['enabled'] : $_lang['disabled']), + $_lang['servertime'] => strftime('%H:%M:%S', time()), + $_lang['localtime'] => strftime('%H:%M:%S', time() + $server_offset_time), + $_lang['serveroffset'] => $server_offset_time / (60 * 60) . ' h', + $_lang['database_name'] => trim($dbase, '`'), + $_lang['database_server'] => $database_server, + $_lang['database_version'] => $modx->db->getVersion(), + $_lang['database_charset'] => $charset[1], + $_lang['database_collation'] => $collation[1], + $_lang['table_prefix'] => $modx->db->config['table_prefix'], + $_lang['cfg_base_path'] => MODX_BASE_PATH, + $_lang['cfg_base_url'] => MODX_BASE_URL, + $_lang['cfg_manager_url'] => MODX_MANAGER_URL, + $_lang['cfg_manager_path'] => MODX_MANAGER_PATH, + $_lang['cfg_site_url'] => MODX_SITE_URL +); +?> + +

+ +

+ + + + +
+
+

Server

+
+
+ + + $value) { + ?> + + + + + + + +
 
+
+
+
+
+ +

 

+ + +
+
+

+
+
+ + + + + + + + + + + + + + + db->escape($modx->db->config['table_prefix']) . "%';"; + $rs = $modx->db->query($sql); + $i = 0; + while ($log_status = $modx->db->getRow($rs)) { + ?> + + + + + + db->config['table_prefix'] . 'event_log', + $modx->db->config['table_prefix'] . 'manager_log', + ); + if ($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) { + echo ""; + } else { + echo ""; + } + + if ($modx->hasPermission('settings')) { + echo ""; + } else { + echo ""; + } + ?> + + + + + + + + + + + + + +
' : '') ?>"; + echo "" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . ""; + echo "" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . "" . ($log_status['Data_free'] > 0 ? "" . $modx->nicesize($log_status['Data_free']) . "" : "-") . "" . ($log_status['Data_free'] > 0 ? $modx->nicesize($log_status['Data_free']) : "-") . "nicesize($log_status['Data_length'] - $log_status['Data_free']) ?>nicesize($log_status['Index_length']) ?>nicesize($log_status['Index_length'] + $log_status['Data_length'] + $log_status['Data_free']) ?>
  0 ? "" . $modx->nicesize($totaloverhead) . "
(" . number_format($totaloverhead) . " B)" : "-" ?>
 " . $modx->nicesize($total) . "
(" . number_format($total) . " B)" ?>
+
+
+ 0) { ?> +
+

+ +
+
From 1a0f039af4c4f8ab9ec11c8929fe62779dce9b21 Mon Sep 17 00:00:00 2001 From: Pathologic Date: Tue, 13 Feb 2018 23:22:44 +0300 Subject: [PATCH 030/274] fix Store module unparsed placeholders --- assets/modules/store/lang/russian-UTF8.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/assets/modules/store/lang/russian-UTF8.php b/assets/modules/store/lang/russian-UTF8.php index 02b8d3b696..e524a59c2d 100755 --- a/assets/modules/store/lang/russian-UTF8.php +++ b/assets/modules/store/lang/russian-UTF8.php @@ -35,6 +35,12 @@ $_Lang['s2_2_down'] = "Возрастание"; $_Lang['search'] = "Поиск по категории: "; +/* Installation by file-upload */ +$_Lang['install_file'] = "Установка из архива"; +$_Lang['choose_file_msg'] = "Выберите файл"; +$_Lang['install_file_btn'] = "Установить"; +$_Lang['install_file_success'] = "Установка завершена"; + /* faq */ $_Lang['faq'] = '
  • Зачем свой репозиторий
  • From d2de52b8f424fa2797c27a7bb51be45a50d0d7ff Mon Sep 17 00:00:00 2001 From: Pathologic Date: Fri, 16 Feb 2018 00:50:20 +0300 Subject: [PATCH 031/274] single entry point --- assets/modules/store/installer/index.php | 11 +---------- .../modules/store/installer/instprocessor-fast.php | 9 +++------ assets/modules/store/installer/instprocessor.php | 12 ++---------- 3 files changed, 6 insertions(+), 26 deletions(-) diff --git a/assets/modules/store/installer/index.php b/assets/modules/store/installer/index.php index 4924d5bcac..ef0a06ab0e 100755 --- a/assets/modules/store/installer/index.php +++ b/assets/modules/store/installer/index.php @@ -4,19 +4,10 @@ define('MODX_BASE_PATH',realpath('../../../../').'/'); include_once(MODX_BASE_PATH."assets/cache/siteManager.php"); define('MGR',MODX_BASE_PATH.MGR_DIR); -$autoloader = realpath(MODX_BASE_PATH . 'vendor/autoload.php'); -if (file_exists($autoloader) && is_readable($autoloader)) { - include_once($autoloader); -} - define('MODX_API_MODE', true); -include_once MGR.'/includes/config.inc.php'; -include_once MGR.'/includes/document.parser.class.inc.php'; -$modx = new DocumentParser; +include_once (MODX_BASE_PATH . 'index.php'); $modx->db->connect(); $modx->getSettings(); -startCMSSession(); -$modx->minParserPasses=2; $modx->invokeEvent('OnManagerPageInit'); if(IN_MANAGER_MODE!='true' && !$modx->hasPermission('exec_module')) die('INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly.'); diff --git a/assets/modules/store/installer/instprocessor-fast.php b/assets/modules/store/installer/instprocessor-fast.php index 769eecc604..f5a5175607 100644 --- a/assets/modules/store/installer/instprocessor-fast.php +++ b/assets/modules/store/installer/instprocessor-fast.php @@ -53,13 +53,10 @@ define('MODX_API_MODE', true); -include_once MGR.'/includes/config.inc.php'; -include_once MGR.'/includes/document.parser.class.inc.php'; -$modx = new DocumentParser; +include_once (MODX_BASE_PATH . 'index.php'); $modx->db->connect(); $modx->getSettings(); -startCMSSession(); -$modx->minParserPasses=2; + $modx->invokeEvent('OnManagerPageInit'); global $moduleName; global $moduleVersion; @@ -618,4 +615,4 @@ function getCreateDbCategory($category) { } } return $category_id; -} \ No newline at end of file +} diff --git a/assets/modules/store/installer/instprocessor.php b/assets/modules/store/installer/instprocessor.php index cd17708920..555c9f472e 100644 --- a/assets/modules/store/installer/instprocessor.php +++ b/assets/modules/store/installer/instprocessor.php @@ -6,18 +6,10 @@ $sqlParser = ''; define('MODX_API_MODE', true); -$autoloader = realpath(MODX_BASE_PATH .'vendor/autoload.php'); -if (file_exists($autoloader) && is_readable($autoloader)) { - include_once($autoloader); -} -include_once MGR.'/includes/protect.inc.php'; -include_once MGR.'/includes/config.inc.php'; -include_once MGR.'/includes/document.parser.class.inc.php'; -$modx = new DocumentParser; +include_once (MODX_BASE_PATH . 'index.php'); $modx->db->connect(); $modx->getSettings(); -startCMSSession(); -$modx->minParserPasses=2; + $modx->invokeEvent('OnManagerPageInit'); global $moduleName; global $moduleVersion; From f6616316b4ab0ea3d026f97f801cb9aa732db5db Mon Sep 17 00:00:00 2001 From: Pathologic Date: Fri, 16 Feb 2018 01:32:08 +0300 Subject: [PATCH 032/274] fixed something --- .../store/installer/instprocessor-fast.php | 32 ------------------- .../modules/store/installer/instprocessor.php | 20 ------------ 2 files changed, 52 deletions(-) diff --git a/assets/modules/store/installer/instprocessor-fast.php b/assets/modules/store/installer/instprocessor-fast.php index f5a5175607..09d09226f0 100644 --- a/assets/modules/store/installer/instprocessor-fast.php +++ b/assets/modules/store/installer/instprocessor-fast.php @@ -2,13 +2,7 @@ if(IN_MANAGER_MODE!='true' && !$modx->hasPermission('exec_module')) die('INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly.'); error_reporting(E_ALL & ~E_NOTICE); -define('MODX_BASE_PATH',realpath('../../../../').'/'); -include_once(MODX_BASE_PATH."assets/cache/siteManager.php"); define('MGR',MODX_BASE_PATH.MGR_DIR); -$autoloader = realpath(MODX_BASE_PATH .'vendor/autoload.php'); -if (file_exists($autoloader) && is_readable($autoloader)) { - include_once($autoloader); -} $moduleurl = 'assets/modules/store/installer/index.php'; $modulePath = dirname(__FILE__); $self = $modulePath.'/index.php'; @@ -17,14 +11,11 @@ $_lang = array(); $_params = array(); require_once($modulePath."/lang/russian-UTF8.inc.php"); -include_once(MODX_BASE_PATH."assets/cache/siteManager.php"); -require_once(MGR.'/includes/version.inc.php'); // start session //session_start(); $_SESSION['test'] = 1; install_sessionCheck(); - $moduleName = "MODX"; $moduleVersion = $modx_branch.' '.$modx_version; $moduleRelease = $modx_release_date; @@ -50,28 +41,6 @@ $_POST['installmode'] = 1; //$_POST['installdata'] = 0; $sqlParser = ''; - - -define('MODX_API_MODE', true); -include_once (MODX_BASE_PATH . 'index.php'); -$modx->db->connect(); -$modx->getSettings(); - -$modx->invokeEvent('OnManagerPageInit'); -global $moduleName; -global $moduleVersion; -global $moduleSQLBaseFile; -global $moduleSQLDataFile; - -global $moduleChunks; -global $moduleTemplates; -global $moduleSnippets; -global $modulePlugins; -global $moduleModules; -global $moduleTVs; - -global $errors; - $create = false; // set timout limit @@ -352,7 +321,6 @@ function parseProperties($propertyString) { } // Install Plugins - if (count($modulePlugins )>0) { echo "

    " . $_lang['plugins'] . ":

    "; $selPlugs = $_POST['plugin']; diff --git a/assets/modules/store/installer/instprocessor.php b/assets/modules/store/installer/instprocessor.php index 555c9f472e..0b0a7f5635 100644 --- a/assets/modules/store/installer/instprocessor.php +++ b/assets/modules/store/installer/instprocessor.php @@ -5,26 +5,6 @@ //$_POST['installdata'] = 0; $sqlParser = ''; -define('MODX_API_MODE', true); -include_once (MODX_BASE_PATH . 'index.php'); -$modx->db->connect(); -$modx->getSettings(); - -$modx->invokeEvent('OnManagerPageInit'); -global $moduleName; -global $moduleVersion; -global $moduleSQLBaseFile; -global $moduleSQLDataFile; - -global $moduleChunks; -global $moduleTemplates; -global $moduleSnippets; -global $modulePlugins; -global $moduleModules; -global $moduleTVs; - -global $errors; - $create = false; // set timout limit From 740b38ddf188d5d45c19881e5e98a90c03d9edf6 Mon Sep 17 00:00:00 2001 From: Pathologic Date: Fri, 16 Feb 2018 01:33:33 +0300 Subject: [PATCH 033/274] single entry point --- assets/modules/docmanager/tv.ajax.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/assets/modules/docmanager/tv.ajax.php b/assets/modules/docmanager/tv.ajax.php index 35ea6dd2ba..b51ce802df 100644 --- a/assets/modules/docmanager/tv.ajax.php +++ b/assets/modules/docmanager/tv.ajax.php @@ -2,16 +2,14 @@ /** * This file includes slightly modified code from the MODX core distribution. */ - -include_once("../../cache/siteManager.php"); - -require_once '../../../' . MGR_DIR . '/includes/protect.inc.php'; -include_once('../../../' . MGR_DIR . '/includes/config.inc.php'); -include_once(MODX_MANAGER_PATH . 'includes/document.parser.class.inc.php'); -include_once(MODX_BASE_PATH . 'assets/modules/docmanager/classes/docmanager.class.php'); -$modx = new DocumentParser; +define('MODX_API_MODE', true); +include_once ('../../../index.php'); +$modx->db->connect(); $modx->getSettings(); +$modx->invokeEvent('OnManagerPageInit'); +if (!isset($_SESSION['mgrValidated'])) die(''); +include_once(MODX_BASE_PATH . 'assets/modules/docmanager/classes/docmanager.class.php'); $dm = new DocManager($modx); $dm->getLang(); $dm->getTheme(); From 335129f521fc6b9298daac30fcda47b8d5423cc1 Mon Sep 17 00:00:00 2001 From: Pathologic Date: Fri, 16 Feb 2018 01:58:53 +0300 Subject: [PATCH 034/274] single entry point --- .../ddmultiplefields/richtext/index.php | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/assets/plugins/managermanager/widgets/ddmultiplefields/richtext/index.php b/assets/plugins/managermanager/widgets/ddmultiplefields/richtext/index.php index 5755ba94ac..ac9a76e0ff 100755 --- a/assets/plugins/managermanager/widgets/ddmultiplefields/richtext/index.php +++ b/assets/plugins/managermanager/widgets/ddmultiplefields/richtext/index.php @@ -1,35 +1,26 @@ db->connect(); +$modx->getSettings(); +$modx->invokeEvent('OnManagerPageInit'); if ($_SESSION['mgrValidated']){ - define('IN_MANAGER_MODE', true); - //Setup the MODx API - define('MODX_API_MODE', true); - //Initiate a new document parser - require_once($richtextIncludeDirectory.'includes/document.parser.class.inc.php'); - $modx = new DocumentParser; - - //Provide the MODx DBAPI - $modx->db->connect(); - //Provide the $modx->documentMap and user settings - $modx->getSettings(); - + $mmDir = 'assets/plugins/managermanager/'; $windowDir = $mmDir.'widgets/ddmultiplefields/richtext/'; @@ -52,4 +43,4 @@ }else{ echo file_get_contents(dirname(__FILE__).'/index.html'); } -?> \ No newline at end of file +?> From f963a9ed097c06e16147d8c613b99f2fb465b6c7 Mon Sep 17 00:00:00 2001 From: Pathologic Date: Fri, 16 Feb 2018 02:08:31 +0300 Subject: [PATCH 035/274] single entry point --- manager/includes/active_user_locks.php | 29 ++++++++++---------------- manager/includes/session_keepalive.php | 24 +++++++++------------ manager/index.php | 2 +- 3 files changed, 22 insertions(+), 33 deletions(-) diff --git a/manager/includes/active_user_locks.php b/manager/includes/active_user_locks.php index 1535fe2d97..26e4539052 100644 --- a/manager/includes/active_user_locks.php +++ b/manager/includes/active_user_locks.php @@ -4,24 +4,17 @@ * * This page is requested by several actions to keep elements/resources locked */ -include_once(dirname(__FILE__).'/../../assets/cache/siteManager.php'); -require_once(dirname(__FILE__).'/protect.inc.php'); - +define('IN_MANAGER_MODE', true); +define('MODX_API_MODE', true); +include_once('/../../index.php'); +$modx->db->connect(); +$modx->getSettings(); +$modx->invokeEvent('OnManagerPageInit'); $ok = false; -if ($rt = @ include_once('config.inc.php')) { -// Keep it alive - startCMSSession(); - if(isset($_SESSION['mgrToken']) && $_GET['tok'] == $_SESSION['mgrToken']) { - define('IN_MANAGER_MODE','true'); - include_once(dirname(__FILE__).'/document.parser.class.inc.php'); - $modx = new DocumentParser; - $modx->db->connect(); - - if($modx->elementIsLocked($_GET['type'], $_GET['id'], true)) { - $modx->lockElement($_GET['type'], $_GET['id'], true); - $ok = true; - } - } + +if($modx->elementIsLocked($_GET['type'], $_GET['id'], true)) { + $modx->lockElement($_GET['type'], $_GET['id'], true); + $ok = true; } header('Content-type: application/json'); @@ -29,4 +22,4 @@ echo '{status:"ok"}'; } else { echo '{status:"null"}'; -} \ No newline at end of file +} diff --git a/manager/includes/session_keepalive.php b/manager/includes/session_keepalive.php index 185d787467..34c64a21f9 100644 --- a/manager/includes/session_keepalive.php +++ b/manager/includes/session_keepalive.php @@ -4,22 +4,18 @@ * * This page is requested every 10min to keep the session alive and kicking */ -include_once(dirname(__FILE__).'/../../assets/cache/siteManager.php'); -require_once(dirname(__FILE__).'/protect.inc.php'); - +define('IN_MANAGER_MODE', true); +define('MODX_API_MODE', true); +include_once('/../../index.php'); +$modx->db->connect(); +$modx->getSettings(); +$modx->invokeEvent('OnManagerPageInit'); $ok = false; -if ($rt = @ include_once('config.inc.php')) { -// Keep it alive - startCMSSession(); - if(isset($_SESSION['mgrToken']) && $_GET['tok'] == $_SESSION['mgrToken']) { - $ok = true; - define('IN_MANAGER_MODE','true'); - include_once(dirname(__FILE__).'/document.parser.class.inc.php'); - $modx = new DocumentParser; - $modx->db->connect(); - $modx->updateValidatedUserSession(); - } +if(isset($_SESSION['mgrToken']) && $_GET['tok'] == $_SESSION['mgrToken']) { + $ok = true; + $modx->updateValidatedUserSession(); } + header('Content-type: application/json'); if($ok) { echo '{"status":"ok"}'; diff --git a/manager/index.php b/manager/index.php index 95d81569ff..fde431615b 100644 --- a/manager/index.php +++ b/manager/index.php @@ -80,7 +80,7 @@ // we use this to make sure files are accessed through // the manager instead of seperately. if (!defined('IN_MANAGER_MODE')) { - define("IN_MANAGER_MODE", "true"); + define("IN_MANAGER_MODE", true); } // harden it From 05a19e6b25bf1fb6c1f27392e9d3bfd2ff7999a8 Mon Sep 17 00:00:00 2001 From: Pathologic Date: Fri, 16 Feb 2018 02:23:21 +0300 Subject: [PATCH 036/274] single entry point --- index.php | 6 +++--- manager/processors/login.processor.php | 25 +++++++------------------ 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/index.php b/index.php index 095d27eca2..97f0062baf 100644 --- a/index.php +++ b/index.php @@ -82,9 +82,9 @@ * Function: This file loads and executes the parser. * */ -define("IN_PARSER_MODE", "true"); +define("IN_PARSER_MODE", true); if (!defined('IN_MANAGER_MODE')) { - define("IN_MANAGER_MODE", "false"); + define("IN_MANAGER_MODE", false); } if (!defined('MODX_API_MODE')) { define('MODX_API_MODE', false); @@ -128,4 +128,4 @@ if (!MODX_API_MODE) { $modx->executeParser(); } -?> \ No newline at end of file +?> diff --git a/manager/processors/login.processor.php b/manager/processors/login.processor.php index 73b0514a02..be3b687c4d 100755 --- a/manager/processors/login.processor.php +++ b/manager/processors/login.processor.php @@ -3,27 +3,16 @@ header('HTTP/1.0 404 Not Found'); exit('error'); } -include_once(dirname(__FILE__) . '/../../assets/cache/siteManager.php'); -require_once(strtr(realpath(dirname(__FILE__)), '\\', '/') . '/../includes/protect.inc.php'); - -set_include_path(get_include_path() . PATH_SEPARATOR . '../includes/'); - -define('IN_MANAGER_MODE', 'true'); // we use this to make sure files are accessed through -// the manager instead of seperately. -// include the database configuration file -include_once('../includes/config.inc.php'); -$core_path = MODX_MANAGER_PATH . 'includes/'; - -// start session -startCMSSession(); - - -include_once("{$core_path}document.parser.class.inc.php"); -$modx = new DocumentParser; +define('IN_MANAGER_MODE', true); // we use this to make sure files are accessed through +define('MODX_API_MODE', true); +include_once(__DIR__ . '/../../index.php'); +$modx->db->connect(); +$modx->getSettings(); +$modx->invokeEvent('OnManagerPageInit'); $modx->loadExtension('ManagerAPI'); $modx->loadExtension('phpass'); -$modx->getSettings(); +$core_path = MODX_MANAGER_PATH . 'includes/'; // include_once the language file $_lang = array(); include_once("{$core_path}lang/english.inc.php"); From 72d3b2a5abb7541fd3fd0c87b46bc15d8a988eb8 Mon Sep 17 00:00:00 2001 From: Pathologic Date: Fri, 16 Feb 2018 04:11:12 +0300 Subject: [PATCH 037/274] fixes --- manager/includes/active_user_locks.php | 2 +- manager/includes/session_keepalive.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/includes/active_user_locks.php b/manager/includes/active_user_locks.php index 26e4539052..9f8fd7e50c 100644 --- a/manager/includes/active_user_locks.php +++ b/manager/includes/active_user_locks.php @@ -6,7 +6,7 @@ */ define('IN_MANAGER_MODE', true); define('MODX_API_MODE', true); -include_once('/../../index.php'); +include_once('../../index.php'); $modx->db->connect(); $modx->getSettings(); $modx->invokeEvent('OnManagerPageInit'); diff --git a/manager/includes/session_keepalive.php b/manager/includes/session_keepalive.php index 34c64a21f9..900ed47a4b 100644 --- a/manager/includes/session_keepalive.php +++ b/manager/includes/session_keepalive.php @@ -6,7 +6,7 @@ */ define('IN_MANAGER_MODE', true); define('MODX_API_MODE', true); -include_once('/../../index.php'); +include_once('../../index.php'); $modx->db->connect(); $modx->getSettings(); $modx->invokeEvent('OnManagerPageInit'); From 506330a780569de4aa3542ef60f0a569daed1014 Mon Sep 17 00:00:00 2001 From: Serg <64j@mail.ru> Date: Sat, 17 Feb 2018 16:58:44 +0300 Subject: [PATCH 038/274] fix russian lang extrascheck --- assets/plugins/extrascheck/lang/russian-UTF8.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/plugins/extrascheck/lang/russian-UTF8.php b/assets/plugins/extrascheck/lang/russian-UTF8.php index 7619b54b9b..56ec6ec348 100644 --- a/assets/plugins/extrascheck/lang/russian-UTF8.php +++ b/assets/plugins/extrascheck/lang/russian-UTF8.php @@ -13,7 +13,7 @@ // $_oec_lang['title'] = 'Проверка совместимости дополнений'; -$_oec_lang['isoutdated'] = ' устаревший и больше не совместим с'; +$_oec_lang['isoutdated'] = ' устаревший и больше не совместим с'; $_oec_lang['please_update'] = 'Обновить'; $_oec_lang['please_delete'] = 'Пожалуйста, удалите'; $_oec_lang["to_latest"] = 'до последней версии'; @@ -23,4 +23,4 @@ $_oec_lang['or_move_to'] = 'или перейти к'; $_oec_lang['not_used'] = 'больше не используется'; $_oec_lang['from_folder'] = 'из папки'; -$_oec_lang['if_dont_use'] = 'Если вы не используете для других целей'; \ No newline at end of file +$_oec_lang['if_dont_use'] = 'Если вы не используете для других целей'; From cc3606feff0af47bf85f52d1083321fda5ce917d Mon Sep 17 00:00:00 2001 From: 64j <64j@mail.ru> Date: Sat, 17 Feb 2018 18:11:12 +0300 Subject: [PATCH 039/274] fix error session "nrtotalmessages" for role editor --- manager/actions/welcome.static.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manager/actions/welcome.static.php b/manager/actions/welcome.static.php index a3c1c6e29f..14105762e3 100644 --- a/manager/actions/welcome.static.php +++ b/manager/actions/welcome.static.php @@ -12,6 +12,8 @@ // set placeholders $ph = $_lang; +$_SESSION['nrtotalmessages'] = 0; +$_SESSION['nrnewmessages'] = 0; // setup message info if($modx->hasPermission('messages')) { From 533ee93c2d2a1a6c9cc42aa0b11210d54c12f988 Mon Sep 17 00:00:00 2001 From: 64j <64j@mail.ru> Date: Sun, 18 Feb 2018 05:03:19 +0300 Subject: [PATCH 040/274] fix #484 need permission for editing documents --- manager/frames/1.php | 118 +++++++++++++++++++++++-------------------- 1 file changed, 64 insertions(+), 54 deletions(-) diff --git a/manager/frames/1.php b/manager/frames/1.php index 4dbea8b5c7..a7b46d7200 100644 --- a/manager/frames/1.php +++ b/manager/frames/1.php @@ -100,6 +100,8 @@ } } +$modx->config['global_tabs'] = (int)($modx->config['global_tabs'] && ($user['role'] == 1 || $modx->hasPermission('edit_document'))); + ?> > @@ -148,7 +150,7 @@ which_browser: '', layout: , textdir: '', - global_tabs: config['global_tabs'] && $user['role'] == 1 ? 1 : 0 ?> + global_tabs: config['global_tabs'] ?> }, lang: { already_deleted: "", @@ -409,7 +411,7 @@
    - config['global_tabs'] && $user['role'] == 1): ?> + config['global_tabs']): ?>

    @@ -528,63 +530,71 @@ function constructLink($action, $img, $text, $allowed) config['show_fullscreen_btn'] != "0") { ?> From 651aef447e9b92dfe222bf36435f7f2d219ab295 Mon Sep 17 00:00:00 2001 From: 64j <64j@mail.ru> Date: Sun, 18 Feb 2018 05:08:21 +0300 Subject: [PATCH 041/274] fix #484 need permission for editing documents (reverted from commit 3738d46a56186e587ad7c5de076ded890f0b5d6c) --- manager/frames/1.php | 118 ++++++++++++++++++++----------------------- 1 file changed, 54 insertions(+), 64 deletions(-) diff --git a/manager/frames/1.php b/manager/frames/1.php index a7b46d7200..4dbea8b5c7 100644 --- a/manager/frames/1.php +++ b/manager/frames/1.php @@ -100,8 +100,6 @@ } } -$modx->config['global_tabs'] = (int)($modx->config['global_tabs'] && ($user['role'] == 1 || $modx->hasPermission('edit_document'))); - ?> > @@ -150,7 +148,7 @@ which_browser: '', layout: , textdir: '', - global_tabs: config['global_tabs'] ?> + global_tabs: config['global_tabs'] && $user['role'] == 1 ? 1 : 0 ?> }, lang: { already_deleted: "", @@ -411,7 +409,7 @@
    - config['global_tabs']): ?> + config['global_tabs'] && $user['role'] == 1): ?>

    @@ -530,71 +528,63 @@ function constructLink($action, $img, $text, $allowed) config['show_fullscreen_btn'] != "0") { ?> From dc8b83f34447e0312b71f65a5701160d2035c2aa Mon Sep 17 00:00:00 2001 From: 64j <64j@mail.ru> Date: Sun, 18 Feb 2018 05:12:43 +0300 Subject: [PATCH 042/274] fix #484 need permission for editing templates or chunks or snippets or plugins --- manager/frames/1.php | 118 +++++++++++++++++++++++-------------------- 1 file changed, 64 insertions(+), 54 deletions(-) diff --git a/manager/frames/1.php b/manager/frames/1.php index 4dbea8b5c7..74ba24086f 100644 --- a/manager/frames/1.php +++ b/manager/frames/1.php @@ -100,6 +100,8 @@ } } +$modx->config['global_tabs'] = (int)($modx->config['global_tabs'] && ($user['role'] == 1 || $modx->hasPermission('edit_template') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_plugin'))); + ?> > @@ -148,7 +150,7 @@ which_browser: '', layout: , textdir: '', - global_tabs: config['global_tabs'] && $user['role'] == 1 ? 1 : 0 ?> + global_tabs: config['global_tabs'] ?> }, lang: { already_deleted: "", @@ -409,7 +411,7 @@
    - config['global_tabs'] && $user['role'] == 1): ?> + config['global_tabs']): ?>

    @@ -528,63 +530,71 @@ function constructLink($action, $img, $text, $allowed) config['show_fullscreen_btn'] != "0") { ?> From 90d8801f07556a1ec0714d64f3016483738fced9 Mon Sep 17 00:00:00 2001 From: Pathologic Date: Sun, 18 Feb 2018 18:06:27 +0300 Subject: [PATCH 043/274] some fix --- install/config.inc.tpl | 7 ++- manager/includes/preload.functions.inc.php | 67 ++++++++++++++-------- 2 files changed, 48 insertions(+), 26 deletions(-) diff --git a/install/config.inc.tpl b/install/config.inc.tpl index 71422ece0a..8c2a277312 100644 --- a/install/config.inc.tpl +++ b/install/config.inc.tpl @@ -14,8 +14,13 @@ $table_prefix = '[+table_prefix+]'; $lastInstallTime = '[+lastInstallTime+]'; $https_port = '443'; +$coreClass = '\DocumentParser'; +$session_cookie_path = ''; +$session_cookie_domain = ''; -if(!defined('MGR_DIR')) define('MGR_DIR', 'manager'); +if (!defined('MGR_DIR')) { + define('MGR_DIR', 'manager'); +} // automatically assign base_path and base_url if(empty($base_path)||empty($base_url)||$_REQUEST['base_path']||$_REQUEST['base_url']) { diff --git a/manager/includes/preload.functions.inc.php b/manager/includes/preload.functions.inc.php index ab5834fdb6..a04537c7e3 100644 --- a/manager/includes/preload.functions.inc.php +++ b/manager/includes/preload.functions.inc.php @@ -3,48 +3,65 @@ global $site_sessionname; $site_sessionname = genEvoSessionName(); // For legacy extras not using startCMSSession -function genEvoSessionName() { +/** + * @return string + */ +function genEvoSessionName() +{ $_ = crc32(__FILE__); $_ = sprintf('%u', $_); - return 'evo' . base_convert($_,10,36); + + return 'evo' . base_convert($_, 10, 36); } -function startCMSSession(){ - - global $site_sessionname, $https_port; - +/** + * @return void + */ +function startCMSSession() +{ + global $site_sessionname, $https_port, $session_cookie_path, $session_cookie_domain; + if(MODX_CLI) return; + session_name($site_sessionname); removeInvalidCmsSessionIds($site_sessionname); - session_start(); - $cookieExpiration= 0; + $cookieExpiration = 0; $secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port); - - if (isset($_SESSION['mgrValidated'])) $context = 'mgr'; - elseif(isset($_SESSION['webValidated'])) $context = 'web'; - else { - setcookie($site_sessionname, session_id(), $cookieExpiration, MODX_BASE_URL, null, $secure, true); - return; - } - - $key = "modx.{$context}.session.cookie.lifetime"; + $cookiePath = !empty($session_cookie_path) ? $session_cookie_path : MODX_BASE_URL; + $cookieDomain = !empty($session_cookie_domain) ? $session_cookie_domain : ''; + session_set_cookie_params($cookieExpiration, $cookiePath, $cookieDomain, $secure, true); + session_start(); + $key = "modx.mgr.session.cookie.lifetime"; if (isset($_SESSION[$key]) && is_numeric($_SESSION[$key])) { - $cookieLifetime= intval($_SESSION[$key]); - if($cookieLifetime) $cookieExpiration = $_SERVER['REQUEST_TIME']+$cookieLifetime; + $cookieLifetime = (int)$_SESSION[$key]; + if ($cookieLifetime) { + $cookieExpiration = $_SERVER['REQUEST_TIME'] + $cookieLifetime; + } + setcookie(session_name(), session_id(), $cookieExpiration, $cookiePath, $cookieDomain, $secure, true); } if (!isset($_SESSION['modx.session.created.time'])) { $_SESSION['modx.session.created.time'] = $_SERVER['REQUEST_TIME']; } - setcookie($site_sessionname, session_id(), $cookieExpiration, MODX_BASE_URL, null, $secure, true); } -function removeInvalidCmsSessionFromStorage(&$storage, $session_name) { - if (isset($storage[$session_name]) && ($storage[$session_name] === '' || $storage[$session_name] === 'deleted')) - { - unset($storage[$session_name]); +/** + * @param $storage + * @param $session_name + * @return void + */ +function removeInvalidCmsSessionFromStorage(&$storage, $session_name) +{ + if (isset($storage[$session_name]) && ($storage[$session_name] === '' || $storage[$session_name] === 'deleted')) { + unset($storage[$session_name]); } } -function removeInvalidCmsSessionIds($session_name) { +/** + * @param $session_name + * @return void + */ +function removeInvalidCmsSessionIds($session_name) +{ + if(MODX_CLI) return; // session ids is invalid iff it is empty string // storage priorioty can see in PHP source ext/session/session.c removeInvalidCmsSessionFromStorage($_COOKIE, $session_name); From 2c10fe98d0d4368c76e8a3c11677e54cc70f49a2 Mon Sep 17 00:00:00 2001 From: 64j <64j@mail.ru> Date: Sun, 18 Feb 2018 20:49:07 +0300 Subject: [PATCH 044/274] fixed #484 --- manager/frames/1.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/manager/frames/1.php b/manager/frames/1.php index 74ba24086f..63286f8da9 100644 --- a/manager/frames/1.php +++ b/manager/frames/1.php @@ -151,6 +151,7 @@ layout: , textdir: '', global_tabs: config['global_tabs'] ?> + }, lang: { already_deleted: "", @@ -213,6 +214,7 @@ plugins: { ElementsInTree: pluginCache['ElementsInTree']) ? 1 : 0 ?>, EVOmodal: pluginCache['EVO.modal']) ? 1 : 0 ?> + }, extend: function() { for (var i = 1; i < arguments.length; i++) { @@ -530,7 +532,6 @@ function constructLink($action, $img, $text, $allowed) From fdd07aa9f0024aa0ee1a2ea8919f9d9845cf85d2 Mon Sep 17 00:00:00 2001 From: Pathologic Date: Mon, 19 Feb 2018 03:36:07 +0300 Subject: [PATCH 046/274] fix #397 --- install/actions/tpl_connection.html | 478 ++++++++++++++-------------- 1 file changed, 241 insertions(+), 237 deletions(-) diff --git a/install/actions/tpl_connection.html b/install/actions/tpl_connection.html index acf587285c..d5fd520e2d 100644 --- a/install/actions/tpl_connection.html +++ b/install/actions/tpl_connection.html @@ -1,100 +1,105 @@
    -
      -
    • [%choose_language%]
    • -
    • [%installation_mode%]
    • -
    • [%optional_items%]
    • -
    • [%preinstall_validation%]
    • -
    • [%install_results%]
    • -
    -
    +
      +
    • [%choose_language%]
    • +
    • [%installation_mode%]
    • +
    • [%optional_items%]
    • +
    • [%preinstall_validation%]
    • +
    • [%install_results%]
    • +
    +
    - - - - - -

    [%connection_screen_database_info%]

    -

    [%connection_screen_server_connection_information%]

    -

    [%connection_screen_server_connection_note%]

    - -

    - -

    -

    - -

    -

    - -

    - - - -
    - - -
    -
    -

    [%connection_screen_database_connection_information%]

    -

    [%connection_screen_database_connection_note%]

    -

    - -

    -

    - -

    -

    -

    - -
    -

    -

    -

    - -
    -

    - -
    - → [%connection_screen_database_test_connection%] + + + + +

    [%connection_screen_database_info%]

    +

    [%connection_screen_server_connection_information%]

    +

    [%connection_screen_server_connection_note%]

    +

    + + +

    +

    + + +

    +

    + + +

    + + +
    + +
    +
    +

    [%connection_screen_database_connection_information%]

    +

    [%connection_screen_database_connection_note%]

    +

    + + +

    +

    + + +

    +

    + +

    + +
    +

    +

    + +

    + +
    +

    + +
     
    -
     
    -
    -
    -
    -

    [%connection_screen_defaults%]

    -

    [%connection_screen_default_admin_user%]

    -

    [%connection_screen_default_admin_note%]

    -

    - -

    -

    - -

    -

    - -

    -

    - -

    - -

    [%default_language%]

    -

    [%default_language_description%]

    -

    -

    -

    +
    +
    +

    [%connection_screen_defaults%]

    +

    [%connection_screen_default_admin_user%]

    +

    [%connection_screen_default_admin_note%]

    +

    + + +

    +

    + + +

    +

    + + +

    +

    + + +

    +

    [%default_language%]

    +

    [%default_language_description%]

    +

    + + +
    +
    +

    +
    -
    - - -

    [%default_language%]

    - +} + +$('prevlink').addEvent('click', function(e) { + document.getElementById('install_form').action = 'index.php?action=mode'; + document.getElementById('install_form').submit(); +}); + +$('nextlink').addEvent('click', function(e) { + var alpha = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + if (alpha.indexOf(f.tableprefix.value.charAt(0), 0) == -1) { + alert("[%alert_table_prefixes%]"); + f.tableprefix.focus(); + return false; + } + dbs = document.getElementById('databasestatus'); + dbsv = dbs.innerHTML; + if (dbsv.length == 0 || dbsv == ' ') { + alert("[%alert_database_test_connection%]"); + return false; + } + if (dbsv.indexOf("failed") >= 0) { + alert("[%alert_database_test_connection_failed%]"); + return false; + } + if (f.cmsadmin && f.cmsadmin.value == "") { + alert("[%alert_enter_adminlogin%]"); + f.cmsadmin.focus(); + return false; + } + if (f.cmspassword && f.cmspassword.value == "") { + alert("[%alert_enter_adminpassword%]"); + f.cmspassword.focus(); + return false; + } + if (f.cmspassword && f.cmspassword.value != f.cmspasswordconfirm.value) { + alert("[%alert_enter_adminconfirm%]"); + f.cmspassword.focus(); + return false; + } + document.getElementById('install_form').action = 'index.php?action=options'; + document.getElementById('install_form').submit(); +}); + \ No newline at end of file From 82af27f27a647636a022eb4d4a8c752b39e2363b Mon Sep 17 00:00:00 2001 From: Deesen Date: Tue, 20 Feb 2018 18:46:30 +0100 Subject: [PATCH 047/274] [F] #481 Fix export of Static-HTML with FURLs enabled --- manager/includes/extenders/export.class.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/manager/includes/extenders/export.class.inc.php b/manager/includes/extenders/export.class.inc.php index d2feb7af7e..6ad8ae7ee5 100644 --- a/manager/includes/extenders/export.class.inc.php +++ b/manager/includes/extenders/export.class.inc.php @@ -261,6 +261,7 @@ function curl_get_contents($url, $timeout = 30 ) curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true ); curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $result = curl_exec($ch); curl_close($ch); return $result; From 2dd694578ff5106344e6b4e13c23e4e8adf88d4e Mon Sep 17 00:00:00 2001 From: Deesen Date: Thu, 22 Feb 2018 20:03:06 +0100 Subject: [PATCH 048/274] Commented "plugin locks" / lock-file --- manager/includes/document.parser.class.inc.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index 51a2f08d66..9b28b37798 100644 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -1780,6 +1780,8 @@ function evalPlugin($pluginCode, $params) extract($params, EXTR_SKIP); } /* if uncomment incorrect work plugin, cant understend where use this code and for what? + // This code will avoid further execution of plugins in case they cause a fatal-error. clearCache() will delete those locks to allow execution of locked plugins again. + // Related to https://github.com/modxcms/evolution/issues/1130 $lock_file_path = MODX_BASE_PATH . 'assets/cache/lock_' . str_replace(' ','-',strtolower($this->event->activePlugin)) . '.pageCache.php'; if($this->isBackend()) { if(is_file($lock_file_path)) { @@ -1793,6 +1795,7 @@ function evalPlugin($pluginCode, $params) eval($pluginCode); $msg = ob_get_contents(); ob_end_clean(); + // When reached here, no fatal error occured so the lock should be removed. /*if(is_file($lock_file_path)) unlink($lock_file_path);*/ if ((0 < $this->config['error_reporting']) && $msg && isset($php_errormsg)) { From 10d2e1dc3a7c52e5add9ebfb0da79945b8aa1d3c Mon Sep 17 00:00:00 2001 From: Vitaliy Rudnyh Date: Fri, 23 Feb 2018 17:05:58 +0500 Subject: [PATCH 049/274] Check exists mysqi extension --- install/connection.collation.php | 9 ++++-- install/connection.servertest.php | 37 ++++++++++++++----------- install/lang/bulgarian.inc.php | 1 + install/lang/czech.inc.php | 1 + install/lang/danish.inc.php | 1 + install/lang/english.inc.php | 1 + install/lang/finnish-utf8.inc.php | 1 + install/lang/francais-utf8.inc.php | 1 + install/lang/german.inc.php | 1 + install/lang/hebrew.inc.php | 1 + install/lang/italian.inc.php | 1 + install/lang/japanese-utf8.inc.php | 1 + install/lang/nederlands-utf8.inc.php | 1 + install/lang/norwegian.inc.php | 1 + install/lang/persian.inc.php | 1 + install/lang/polish-utf8.inc.php | 1 + install/lang/portuguese-br-utf8.inc.php | 1 + install/lang/portuguese.inc.php | 1 + install/lang/russian-UTF8.inc.php | 6 ++-- install/lang/spanish-utf8.inc.php | 1 + install/lang/svenska.inc.php | 1 + 21 files changed, 50 insertions(+), 20 deletions(-) diff --git a/install/connection.collation.php b/install/connection.collation.php index a91eac19df..e9636e36b5 100644 --- a/install/connection.collation.php +++ b/install/connection.collation.php @@ -14,8 +14,13 @@ } require_once('lang.php'); -$conn = mysqli_connect($host, $uid, $pwd); -if(!$conn) exit('can not connect'); +if(function_exists('mysqli_connect')) { + $conn = mysqli_connect($host, $uid, $pwd); + if(!$conn) exit('can not connect'); +} +else { + exit('undefined function mysqli_connect()'); +} // get collation $rs = mysqli_query($conn, "SHOW COLLATION"); diff --git a/install/connection.servertest.php b/install/connection.servertest.php index 91024c9f95..a1a43ac29d 100644 --- a/install/connection.servertest.php +++ b/install/connection.servertest.php @@ -15,26 +15,31 @@ require_once("lang.php"); $output = $_lang["status_connecting"]; -if (!$conn = @mysqli_connect($host, $uid, $pwd)) { - $output .= ' '.$_lang['status_failed'].''; -} -else { - $output .= ' '.$_lang['status_passed_server'].''; - - // Mysql version check - if ( version_compare(mysqli_get_server_info($conn), '5.0.51', '=') ) { - $output .= '
    '.$_lang['mysql_5051'].''; +if(function_exists('mysqli_connect')) { + if (!$conn = @mysqli_connect($host, $uid, $pwd)) { + $output .= ' '.$_lang['status_failed'].''; } - // Mode check - $mysqlmode = mysqli_query($conn, "SELECT @@session.sql_mode"); - if (@mysqli_num_rows($mysqlmode) > 0){ - $modes = mysqli_fetch_array($mysqlmode, MYSQLI_NUM); - $strictMode = false; - foreach ($modes as $mode) { + else { + $output .= ' '.$_lang['status_passed_server'].''; + + // Mysql version check + if ( version_compare(mysqli_get_server_info($conn), '5.0.51', '=') ) { + $output .= '
    '.$_lang['mysql_5051'].''; + } + // Mode check + $mysqlmode = mysqli_query($conn, "SELECT @@session.sql_mode"); + if (@mysqli_num_rows($mysqlmode) > 0){ + $modes = mysqli_fetch_array($mysqlmode, MYSQLI_NUM); + $strictMode = false; + foreach ($modes as $mode) { if (stristr($mode, "STRICT_TRANS_TABLES") !== false || stristr($mode, "STRICT_ALL_TABLES") !== false) $strictMode = true; + } + if ($strictMode) $output .= '
    '.$_lang['strict_mode'].''; } - if ($strictMode) $output .= '
    '.$_lang['strict_mode'].''; } } +else { + $output .= ' '.$_lang['status_failed_mysqli'].''; +} echo $output; ?> \ No newline at end of file diff --git a/install/lang/bulgarian.inc.php b/install/lang/bulgarian.inc.php index c408e297bf..d9f3da4b69 100644 --- a/install/lang/bulgarian.inc.php +++ b/install/lang/bulgarian.inc.php @@ -165,6 +165,7 @@ $_lang["status_failed_could_not_create_database"] = 'Неуспешно - не може да бъде създадена БД'; $_lang["status_failed_database_collation_does_not_match"] = 'failed - database collation mismatch; use SET NAMES or choose %s'; $_lang["status_failed_table_prefix_already_in_use"] = 'Неуспешно - префикса на таблицата вече се използва!'; +$_lang['status_failed_mysqli'] = 'error - mysqli extension for PHP is not installed!'; $_lang["status_passed"] = 'Успешно - БД е избрана'; $_lang["status_passed_database_created"] = 'Успешно - БД е създадена'; $_lang["status_passed_server"] = 'Успешно - колациите са достъпни'; diff --git a/install/lang/czech.inc.php b/install/lang/czech.inc.php index 71e2e6e660..e0b08bb719 100644 --- a/install/lang/czech.inc.php +++ b/install/lang/czech.inc.php @@ -165,6 +165,7 @@ $_lang["status_failed_could_not_create_database"] = 'nezdařilo se - nelze vytvořit databázi'; $_lang["status_failed_database_collation_does_not_match"] = 'nezdařilo se - nesoulad porovnání databáze; použijte SET NAMES nebo vyberte %s'; $_lang["status_failed_table_prefix_already_in_use"] = 'nezdařilo se - zvolený prefix tabulek se již používá!'; +$_lang['status_failed_mysqli'] = 'error - mysqli extension for PHP is not installed!'; $_lang["status_passed"] = 'v pořádku - databáze vybrána'; $_lang["status_passed_database_created"] = 'v pořádku - databáze vytvořena'; $_lang["status_passed_server"] = 'v pořádku - porovnání je dostupné'; diff --git a/install/lang/danish.inc.php b/install/lang/danish.inc.php index f3a77dd99e..0c1fc8967b 100644 --- a/install/lang/danish.inc.php +++ b/install/lang/danish.inc.php @@ -166,6 +166,7 @@ $_lang["status_failed_could_not_create_database"] = 'fejlede - kunne ikke oprette databasen'; $_lang["status_failed_database_collation_does_not_match"] = 'fejlede - databasens collation stemmer ikke overens; brug SET NAMES eller vælg %s'; $_lang["status_failed_table_prefix_already_in_use"] = 'fejlede - tabellernes præfiks eksisterer allerede!'; +$_lang['status_failed_mysqli'] = 'error - mysqli extension for PHP is not installed!'; $_lang["status_passed"] = 'gennemført - databasen er valgt'; $_lang["status_passed_database_created"] = 'gennemført - databasen er oprettet'; $_lang["status_passed_server"] = 'gennemført - collations er nu tilgængelige'; diff --git a/install/lang/english.inc.php b/install/lang/english.inc.php index 8278669f18..2226d88679 100644 --- a/install/lang/english.inc.php +++ b/install/lang/english.inc.php @@ -170,6 +170,7 @@ $_lang["status_failed_could_not_create_database"] = 'failed - could not create database'; $_lang["status_failed_database_collation_does_not_match"] = 'failed - database collation mismatch; use SET NAMES or choose %s'; $_lang["status_failed_table_prefix_already_in_use"] = 'failed - table prefix already in use!'; +$_lang['status_failed_mysqli'] = 'error - mysqli extension for PHP is not installed!'; $_lang["status_passed"] = 'passed - database selected'; $_lang["status_passed_database_created"] = 'passed - database created'; $_lang["status_passed_server"] = 'passed - collations now available'; diff --git a/install/lang/finnish-utf8.inc.php b/install/lang/finnish-utf8.inc.php index 2fa7327045..a98089e2f8 100644 --- a/install/lang/finnish-utf8.inc.php +++ b/install/lang/finnish-utf8.inc.php @@ -165,6 +165,7 @@ $_lang["status_failed_could_not_create_database"] = 'epäonnistui - tietokantaa ei voitu luoda'; $_lang["status_failed_database_collation_does_not_match"] = 'epäonnistui - tietokannan merkistön yhteensopivuus ongelma. Käytä "SET NAMES" tai valitse %s'; $_lang["status_failed_table_prefix_already_in_use"] = 'epäonnistui - tietokannan taulujen etuliite on jo käytössä!'; +$_lang['status_failed_mysqli'] = 'error - mysqli extension for PHP is not installed!'; $_lang["status_passed"] = 'onnistui - tietokanta valittu'; $_lang["status_passed_database_created"] = 'onnistui - tietokanta luotu'; $_lang["status_passed_server"] = 'onnistui - merkistöt ovat nyt käytettävissä'; diff --git a/install/lang/francais-utf8.inc.php b/install/lang/francais-utf8.inc.php index c17286158e..79be3ea898 100644 --- a/install/lang/francais-utf8.inc.php +++ b/install/lang/francais-utf8.inc.php @@ -167,6 +167,7 @@ $_lang["status_failed_could_not_create_database"] = 'échec - impossible de créer la base de données'; $_lang["status_failed_database_collation_does_not_match"] = 'échec - collation différente; utilisez SET NAMES ou choisir %s'; $_lang["status_failed_table_prefix_already_in_use"] = 'échec - préfixe de table déjà utilisé!'; +$_lang['status_failed_mysqli'] = 'error - mysqli extension for PHP is not installed!'; $_lang["status_passed"] = 'succès - base sélectionnée'; $_lang["status_passed_database_created"] = 'succès - base créée'; $_lang["status_passed_server"] = 'succès - collations maintenant disponibles'; diff --git a/install/lang/german.inc.php b/install/lang/german.inc.php index 325f1cee09..51e8482f48 100644 --- a/install/lang/german.inc.php +++ b/install/lang/german.inc.php @@ -169,6 +169,7 @@ $_lang["status_failed_could_not_create_database"] = 'fehlgeschlagen – konnte Datenbank nicht erstellen'; $_lang["status_failed_database_collation_does_not_match"] = 'fehlgeschlagen – Unterschied in der Datenbank-Kollation; benutzen Sie SET NAMES oder wählen Sie %s'; $_lang["status_failed_table_prefix_already_in_use"] = 'fehlgeschlagen – Tabellen-Präfix bereits verwendet!'; +$_lang['status_failed_mysqli'] = 'error - mysqli extension for PHP is not installed!'; $_lang["status_passed"] = 'In Ordnung – Datenbank ausgewählt'; $_lang["status_passed_database_created"] = 'In Ordnung – Datenbank erstellt'; $_lang["status_passed_server"] = 'In Ordung – Kollationen sind nun auswählbar'; diff --git a/install/lang/hebrew.inc.php b/install/lang/hebrew.inc.php index c546965c77..24c51b745d 100644 --- a/install/lang/hebrew.inc.php +++ b/install/lang/hebrew.inc.php @@ -165,6 +165,7 @@ $_lang["status_failed_could_not_create_database"] = 'נכשל - לא ניתן ליצור את מסד הנתונים'; $_lang["status_failed_database_collation_does_not_match"] = 'נכשל - אוסף הנתונים לא תואם; השתמש ב SET NAMES או בחר %s'; $_lang["status_failed_table_prefix_already_in_use"] = 'failed - table prefix already in use!'; +$_lang['status_failed_mysqli'] = 'error - mysqli extension for PHP is not installed!'; $_lang["status_passed"] = 'עבר - מסד נתונים נבחר'; $_lang["status_passed_database_created"] = 'עבר - יצירת מסד נתונים'; $_lang["status_passed_server"] = 'עבר - אוסף נתונים זמין'; diff --git a/install/lang/italian.inc.php b/install/lang/italian.inc.php index 3c4d5de5d8..e9c903a2a0 100644 --- a/install/lang/italian.inc.php +++ b/install/lang/italian.inc.php @@ -170,6 +170,7 @@ $_lang["status_failed_could_not_create_database"] = 'fallita - impossibile creare il database'; $_lang["status_failed_database_collation_does_not_match"] = 'fallita - problemi con la collation del database; usate SET NAMES o scegliete %s'; $_lang["status_failed_table_prefix_already_in_use"] = 'fallita - il prefisso scelto per le tabelle é già in uso!'; +$_lang['status_failed_mysqli'] = 'error - mysqli extension for PHP is not installed!'; $_lang["status_passed"] = 'successo - il database é stato selezionato'; $_lang["status_passed_database_created"] = 'successo - il database é stato creato'; $_lang["status_passed_server"] = 'successo - la collation del database é disponibile'; diff --git a/install/lang/japanese-utf8.inc.php b/install/lang/japanese-utf8.inc.php index e4b427718b..344777c3f1 100644 --- a/install/lang/japanese-utf8.inc.php +++ b/install/lang/japanese-utf8.inc.php @@ -167,6 +167,7 @@ $_lang["status_failed_could_not_create_database"] = 'データベースを作成できません'; $_lang["status_failed_database_collation_does_not_match"] = '問題があります - データベース側の照合順序のデフォルト値が「%s」になっています。phpMyAdminが利用できる場合は、該当データベースの「操作」タブで照合順序のデフォルト値を変更してください。'; $_lang["status_failed_table_prefix_already_in_use"] = '接続できません - このTableプリフィクスはすでに使われています。異なるTableプリフィクスを指定するか、phpMyAdminなどを利用し関連Tableを削除してください。'; +$_lang['status_failed_mysqli'] = 'error - mysqli extension for PHP is not installed!'; $_lang["status_passed"] = '問題ありません'; $_lang["status_passed_database_created"] = 'データベースを作成できます'; $_lang["status_passed_server"] = '接続できます'; diff --git a/install/lang/nederlands-utf8.inc.php b/install/lang/nederlands-utf8.inc.php index 90b4ffab86..ef602e1fe1 100644 --- a/install/lang/nederlands-utf8.inc.php +++ b/install/lang/nederlands-utf8.inc.php @@ -170,6 +170,7 @@ $_lang["status_failed_could_not_create_database"] = 'mislukt - kan database niet aanmaken'; $_lang["status_failed_database_collation_does_not_match"] = 'mislukt - database coalitie klopt niet; gebruik SET NAMES of kies% s'; $_lang["status_failed_table_prefix_already_in_use"] = 'mislukt - tabel prefix is al in gebruik!'; +$_lang['status_failed_mysqli'] = 'error - mysqli extension for PHP is not installed!'; $_lang["status_passed"] = 'gelukt - database geselecteerd'; $_lang["status_passed_database_created"] = 'gelukt - database is aangemaakt'; $_lang["status_passed_server"] = 'gelukt - coalitie nu beschikbaar'; diff --git a/install/lang/norwegian.inc.php b/install/lang/norwegian.inc.php index 24d7b7e826..5e80243869 100644 --- a/install/lang/norwegian.inc.php +++ b/install/lang/norwegian.inc.php @@ -165,6 +165,7 @@ $_lang["status_failed_could_not_create_database"] = 'mislyktes - kunne ikke opprette database'; $_lang["status_failed_database_collation_does_not_match"] = 'mislyktes - database collation ulikhet; bruk SET NAMES eller velg %s'; $_lang["status_failed_table_prefix_already_in_use"] = 'mislyktes - tabellprefixet er allerede i bruk!'; +$_lang['status_failed_mysqli'] = 'error - mysqli extension for PHP is not installed!'; $_lang["status_passed"] = 'godkjent - databasen valgt'; $_lang["status_passed_database_created"] = 'godkjent - database opprettet'; $_lang["status_passed_server"] = 'godkjent - kollasjoneringer er nå tilgjengelig'; diff --git a/install/lang/persian.inc.php b/install/lang/persian.inc.php index c886bd6795..ced0026954 100644 --- a/install/lang/persian.inc.php +++ b/install/lang/persian.inc.php @@ -166,6 +166,7 @@ $_lang["status_failed_could_not_create_database"] = 'ناموفق - قادر به ایجاد پایگاه داده نمی باشیم'; $_lang["status_failed_database_collation_does_not_match"] = 'failed - database collation mismatch; use SET NAMES or choose %s'; $_lang["status_failed_table_prefix_already_in_use"] = 'ناموفق - پیشوند جدول هایی که انتخاب کردید پیش از این موجود می باشد'; +$_lang['status_failed_mysqli'] = 'error - mysqli extension for PHP is not installed!'; $_lang["status_passed"] = 'موفقیت آمیز - پایگاه دادهی انتخاب شد!'; $_lang["status_passed_database_created"] = 'موفقیت آمیز - پایگاه داده ایجاد شد'; $_lang["status_passed_server"] = 'موفقیت آمیز - تطبیق ها تهیه شد!'; diff --git a/install/lang/polish-utf8.inc.php b/install/lang/polish-utf8.inc.php index ab9bad4250..c87804946e 100644 --- a/install/lang/polish-utf8.inc.php +++ b/install/lang/polish-utf8.inc.php @@ -170,6 +170,7 @@ $_lang["status_failed_could_not_create_database"] = 'BŁĄD! - nie można utworzyć bazy danych'; $_lang["status_failed_database_collation_does_not_match"] = 'BŁĄD! - niezgodność systemów porównań; użyj SET NAMES lub wybierz %s'; $_lang["status_failed_table_prefix_already_in_use"] = 'BŁĄD! - wybrany prefiks tabeli jest już wykorzystywany!'; +$_lang['status_failed_mysqli'] = 'error - mysqli extension for PHP is not installed!'; $_lang["status_passed"] = 'OK - baza danych została wybrana'; $_lang["status_passed_database_created"] = 'OK - baza danych utworzona'; $_lang["status_passed_server"] = 'OK - system porównań dostępny'; diff --git a/install/lang/portuguese-br-utf8.inc.php b/install/lang/portuguese-br-utf8.inc.php index 3cfe1a7ea0..48ac95393f 100644 --- a/install/lang/portuguese-br-utf8.inc.php +++ b/install/lang/portuguese-br-utf8.inc.php @@ -165,6 +165,7 @@ $_lang["status_failed_could_not_create_database"] = 'falhou - não foi possível criar a base de dadose'; $_lang["status_failed_database_collation_does_not_match"] = 'failed - database collation mismatch; use SET NAMES or choose %s'; $_lang["status_failed_table_prefix_already_in_use"] = 'falhou - o table prefix já está em uso!'; +$_lang['status_failed_mysqli'] = 'error - mysqli extension for PHP is not installed!'; $_lang["status_passed"] = 'sucesso - Base de Dados selecionada'; $_lang["status_passed_database_created"] = 'sucesso - Base de Dados criada'; $_lang["status_passed_server"] = 'sucesso - collations agora disponíveis'; diff --git a/install/lang/portuguese.inc.php b/install/lang/portuguese.inc.php index de991a74d7..df76a36868 100644 --- a/install/lang/portuguese.inc.php +++ b/install/lang/portuguese.inc.php @@ -165,6 +165,7 @@ $_lang["status_failed_could_not_create_database"] = 'falhou - não foi possível criar a base de dadose'; $_lang["status_failed_database_collation_does_not_match"] = 'failed - database collation mismatch; use SET NAMES or choose %s'; $_lang["status_failed_table_prefix_already_in_use"] = 'falhou - o table prefix já está em uso!'; +$_lang['status_failed_mysqli'] = 'error - mysqli extension for PHP is not installed!'; $_lang["status_passed"] = 'sucesso - Base de Dados selecionada'; $_lang["status_passed_database_created"] = 'sucesso - Base de Dados criada'; $_lang["status_passed_server"] = 'sucesso - collations agora disponíveis'; diff --git a/install/lang/russian-UTF8.inc.php b/install/lang/russian-UTF8.inc.php index 557b10baba..91b0161174 100644 --- a/install/lang/russian-UTF8.inc.php +++ b/install/lang/russian-UTF8.inc.php @@ -4,9 +4,10 @@ * * @author Pertsev Dmitriy * @author Safronovich Victor + * @author Rudnykh Vitalii * @author Russian EVO Community - * @version 1.0.15 - * @date 2014/02/24 + * @version 1.5.0 + * @date 2018/02/23 * * @language Russian * @package modx @@ -168,6 +169,7 @@ $_lang["status_failed_could_not_create_database"] = 'ошибка - не удается создать базу данных'; $_lang["status_failed_database_collation_does_not_match"] = 'ошибка - сопоставление базы данных не соответствует; используйте SET NAMES или выберите %s'; $_lang["status_failed_table_prefix_already_in_use"] = 'ошибка - префикс таблицы уже используется!'; +$_lang['status_failed_mysqli'] = 'ошибка - расширение mysqli для php не установлено'; $_lang["status_passed"] = 'успех - база данных выбрана'; $_lang["status_passed_database_created"] = 'успех - база данных создана'; $_lang["status_passed_server"] = 'успех - сопоставление базы данных доступно'; diff --git a/install/lang/spanish-utf8.inc.php b/install/lang/spanish-utf8.inc.php index 787d1a6720..7888ef20d2 100644 --- a/install/lang/spanish-utf8.inc.php +++ b/install/lang/spanish-utf8.inc.php @@ -165,6 +165,7 @@ $_lang["status_failed_could_not_create_database"] = 'falló - no se pudo crear la base de datos'; $_lang["status_failed_database_collation_does_not_match"] = 'falló - no coincide la compaginación de la base de datos; usa SET NAMES o elige %s'; $_lang["status_failed_table_prefix_already_in_use"] = 'falló - el prefijo de tabla ya existe'; +$_lang['status_failed_mysqli'] = 'error - mysqli extension for PHP is not installed!'; $_lang["status_passed"] = 'pasó - base de datos seleccionada'; $_lang["status_passed_database_created"] = 'pasó - base de datos creada'; $_lang["status_passed_server"] = 'pasó - compaginaciones ahora disponibles'; diff --git a/install/lang/svenska.inc.php b/install/lang/svenska.inc.php index 0c2a47cd9e..d10f632dfd 100644 --- a/install/lang/svenska.inc.php +++ b/install/lang/svenska.inc.php @@ -166,6 +166,7 @@ $_lang["status_failed_could_not_create_database"] = 'misslyckades - kunde inte skapa databas'; $_lang["status_failed_database_collation_does_not_match"] = 'misslyckades - databaskollationeringen stämmer inte; använd SET_NAMES eller välj %s'; $_lang["status_failed_table_prefix_already_in_use"] = 'misslyckades - tabellprefixet används redan!'; +$_lang['status_failed_mysqli'] = 'error - mysqli extension for PHP is not installed!'; $_lang["status_passed"] = 'godkänd - databasen valdes'; $_lang["status_passed_database_created"] = 'godkänd - databas skapades'; $_lang["status_passed_server"] = 'godkänd - kollationeringar finns nu tillgängliga'; From daa83478a3977ffe42ea3b15c4f78c317c0d88f0 Mon Sep 17 00:00:00 2001 From: Pathologic Date: Sun, 25 Feb 2018 15:47:00 +0300 Subject: [PATCH 050/274] fix #102 --- manager/includes/preload.functions.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/includes/preload.functions.inc.php b/manager/includes/preload.functions.inc.php index a04537c7e3..490aa08bfd 100644 --- a/manager/includes/preload.functions.inc.php +++ b/manager/includes/preload.functions.inc.php @@ -30,7 +30,7 @@ function startCMSSession() $cookieDomain = !empty($session_cookie_domain) ? $session_cookie_domain : ''; session_set_cookie_params($cookieExpiration, $cookiePath, $cookieDomain, $secure, true); session_start(); - $key = "modx.mgr.session.cookie.lifetime"; + $key = "modx.session.cookie.lifetime"; if (isset($_SESSION[$key]) && is_numeric($_SESSION[$key])) { $cookieLifetime = (int)$_SESSION[$key]; if ($cookieLifetime) { From 050177a6ebd60b87cbbe603aa09f2d344190504c Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Thu, 1 Mar 2018 22:01:44 +0200 Subject: [PATCH 051/274] single entry point --- manager/includes/veriword.php | 95 +++++++++++++++++------------------ 1 file changed, 45 insertions(+), 50 deletions(-) diff --git a/manager/includes/veriword.php b/manager/includes/veriword.php index 63a242040e..bbfb511ec7 100755 --- a/manager/includes/veriword.php +++ b/manager/includes/veriword.php @@ -1,11 +1,9 @@ db->connect(); $modx->getSettings(); +$modx->invokeEvent('OnWebPageInit'); $vword = new VeriWord(148,60); $vword->output_image(); @@ -34,11 +32,11 @@ ######## ## ## USAGE -## create some image with noise texture, put in image directory, +## create some image with noise texture, put in image directory, ## rename to noise_#, see examples -## put some true type font into font directory, +## put some true type font into font directory, ## rename to font_#, see exmplae -## you can search and put free font you like +## you can search and put free font you like ## ## see sample.php for test and usage ## sample URL: http://www.program-ruti.org/veriword/ @@ -46,37 +44,36 @@ class VeriWord { /* path to font directory*/ - var $dir_font = "ttf/"; + public $dir_font = "ttf/"; /* path to background image directory*/ - var $dir_noise = "noises/"; - var $word = ""; - var $im_width = 0; - var $im_height = 0; + public $dir_noise = "noises/"; + public $word = ""; + public $im_width = 0; + public $im_height = 0; - function __construct($w=200, $h=80) { + public function __construct($w=200, $h=80) { /* create session to set word for verification */ - startCMSSession(); $this->set_veriword(); $this->dir_font = dirname(__FILE__) . '/' . $this->dir_font; $this->im_width = $w; $this->im_height = $h; } - function set_veriword() { - /* create session variable for verification, + public function set_veriword() { + /* create session variable for verification, you may change the session variable name */ - $this->word = $this->pick_word(); + $this->word = $this->pick_word(); $_SESSION['veriword'] = $this->word; } - function output_image() { - /* output the image as jpeg */ + public function output_image() { + /* output the image as jpeg */ $this->draw_image(); header("Content-type: image/jpeg"); imagejpeg($this->im); } - function pick_word() { + public function pick_word() { global $modx; // set default words $words="MODX,Access,Better,BitCode,Chunk,Cache,Desc,Design,Excell,Enjoy,URLs,TechView,Gerald,Griff,Humphrey,Holiday,Intel,Integration,Joystick,Join(),Oscope,Genetic,Light,Likeness,Marit,Maaike,Niche,Netherlands,Ordinance,Oscillo,Parser,Phusion,Query,Question,Regalia,Righteous,Snippet,Sentinel,Template,Thespian,Unity,Enterprise,Verily,Veri,Website,WideWeb,Yap,Yellow,Zebra,Zygote"; @@ -85,9 +82,9 @@ function pick_word() { /* pick one randomly for text verification */ return (string) $arr_words[array_rand($arr_words)].rand(10,999); - } + } - function draw_text() { + public function draw_text() { $dir = dir($this->dir_font); $fontstmp = array(); while (false !== ($file = $dir->read())) { @@ -108,7 +105,7 @@ function draw_text() { $text_height= $box[5]-$box[3]; //text height /* adjust text size */ - $text_size = round((20 * $this->im_width)/$text_width); + $text_size = round((20 * $this->im_width)/$text_width); /* recalculate text width and height */ $box = imagettfbbox ( $text_size, $text_angle, $text_font, $this->word); @@ -118,10 +115,10 @@ function draw_text() { /* calculate center position of text */ $text_x = ($this->im_width - $text_width)/2; $text_y = ($this->im_height - $text_height)/2; - + /* create canvas for text drawing */ - $im_text = imagecreate ($this->im_width, $this->im_height); - $bg_color = imagecolorallocate ($im_text, 255, 255, 255); + $im_text = imagecreate ($this->im_width, $this->im_height); + $bg_color = imagecolorallocate ($im_text, 255, 255, 255); /* pick color for text */ $text_color = imagecolorallocate ($im_text, 0, 51, 153); @@ -132,53 +129,51 @@ function draw_text() { $text_angle, $text_x, $text_y, - $text_color, - $text_font, + $text_color, + $text_font, $this->word); /* remove background color */ imagecolortransparent($im_text, $bg_color); return $im_text; - imagedestroy($im_text); } - function draw_image() { - + public function draw_image() { + /* pick one background image randomly from image directory */ $img_file = $this->dir_noise."noise".rand(1,4).".jpg"; /* create "noise" background image from your image stock*/ $noise_img = @imagecreatefromjpeg ($img_file); - $noise_width = imagesx($noise_img); - $noise_height = imagesy($noise_img); - + $noise_width = imagesx($noise_img); + $noise_height = imagesy($noise_img); + /* resize the background image to fit the size of image output */ - $this->im = imagecreatetruecolor($this->im_width,$this->im_height); - imagecopyresampled ($this->im, - $noise_img, - 0, 0, 0, 0, - $this->im_width, - $this->im_height, - $noise_width, + $this->im = imagecreatetruecolor($this->im_width,$this->im_height); + imagecopyresampled ($this->im, + $noise_img, + 0, 0, 0, 0, + $this->im_width, + $this->im_height, + $noise_width, $noise_height); /* put text image into background image */ - imagecopymerge ( $this->im, - $this->draw_text(), - 0, 0, 0, 0, - $this->im_width, - $this->im_height, + imagecopymerge ( $this->im, + $this->draw_text(), + 0, 0, 0, 0, + $this->im_width, + $this->im_height, 70 ); return $this->im; } - function destroy_image() { + public function destroy_image() { imagedestroy($this->im); } -} -?> \ No newline at end of file +} \ No newline at end of file From 49b804830c552b54237316faab411941ff71effe Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Thu, 1 Mar 2018 22:03:40 +0200 Subject: [PATCH 052/274] fix --- assets/modules/store/installer/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/modules/store/installer/index.php b/assets/modules/store/installer/index.php index ef0a06ab0e..56fc6e60b5 100755 --- a/assets/modules/store/installer/index.php +++ b/assets/modules/store/installer/index.php @@ -5,6 +5,7 @@ include_once(MODX_BASE_PATH."assets/cache/siteManager.php"); define('MGR',MODX_BASE_PATH.MGR_DIR); define('MODX_API_MODE', true); +define('IN_MANAGER_MODE', true); include_once (MODX_BASE_PATH . 'index.php'); $modx->db->connect(); $modx->getSettings(); From 12b30af40558031a46bbf8138bb6d30b8ea39f02 Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Thu, 1 Mar 2018 22:06:43 +0200 Subject: [PATCH 053/274] version 1.4.1 --- manager/includes/version.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/includes/version.inc.php b/manager/includes/version.inc.php index b01eb12d7b..f98bd4bb5a 100755 --- a/manager/includes/version.inc.php +++ b/manager/includes/version.inc.php @@ -1,5 +1,5 @@ Date: Fri, 26 Jan 2018 13:45:37 +0100 Subject: [PATCH 054/274] updater 0.8.4 --- install/assets/plugins/updater.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/assets/plugins/updater.tpl b/install/assets/plugins/updater.tpl index 7f4f370105..c4d55ee0dd 100644 --- a/install/assets/plugins/updater.tpl +++ b/install/assets/plugins/updater.tpl @@ -5,13 +5,13 @@ * show message about outdated CMS version * * @category plugin - * @version 0.8.3 + * @version 0.8.4 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) * @package evo * @author Dmi3yy (dmi3yy.com) * @internal @events OnManagerWelcomeHome,OnPageNotFound,OnSiteRefresh * @internal @modx_category Manager and Admin - * @internal @properties &version=Version:;text;evolution-cms/evolution &wdgVisibility=Show widget for:;menu;All,AdminOnly,AdminExcluded,ThisRoleOnly,ThisUserOnly;All &ThisRole=Show only to this role id:;string;;;enter the role id &ThisUser=Show only to this username:;string;;;enter the username &showButton=Show Update Button:;menu;show,hide,AdminOnly;AdminOnly &type=Type:;menu;tags,releases,commits;tags + * @internal @properties &version=Version:;text;evolution-cms/evolution &wdgVisibility=Show widget for:;menu;All,AdminOnly,AdminExcluded,ThisRoleOnly,ThisUserOnly;All &ThisRole=Show only to this role id:;string;;;enter the role id &ThisUser=Show only to this username:;string;;;enter the username &showButton=Show Update Button:;menu;show,hide,AdminOnly;AdminOnly &type=Type:;menu;tags,releases,commits;tags &branch=Commit branch:;text;develop * @internal @legacy_names MODX.Evolution.updateNotify * @internal @installset base * @internal @disabled 0 From f77f9ed2b9562b60e8365964c9f42efd308a6d7e Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Thu, 1 Mar 2018 22:27:41 +0200 Subject: [PATCH 055/274] some fix with code style --- assets/.thumbs/.htaccess | 5 + assets/{cache/images => backup}/.htaccess | 0 assets/cache/images/ht.access | 2 - assets/cache/updater/ht.access | 2 - assets/docs/.htaccess | 6 +- assets/export/.htaccess | 5 + assets/files/.htaccess | 5 + assets/images/.htaccess | 5 + assets/import/.htaccess | 5 + assets/js/fileapi/.gitignore | 2 - assets/lib/class.modxRTEbridge.php | 72 +++---- .../docmanager/classes/dm_backend.class.php | 116 ++++++----- assets/modules/store/core.php | 58 +++--- .../store/installer/action.install.php | 8 +- .../store/installer/action.options.php | 6 +- assets/modules/store/installer/index.php | 4 +- .../store/installer/instprocessor-fast.php | 30 +-- .../modules/store/installer/instprocessor.php | 26 +-- assets/modules/store/installer/setup.info.php | 12 +- .../elementsintree/includes/functions.inc.php | 50 ++--- .../plugins/tinymce4/bridge.tinymce4.inc.php | 38 ++-- .../connector.tinymce4.saveProcessor.php | 4 +- .../tinymce4/connector.tinymce4.templates.php | 4 +- assets/plugins/updater/lang/english.php | 5 +- assets/plugins/updater/plugin.updater.php | 183 ++++++++++++------ assets/site/.htaccess | 5 + {assets/cache/updater => vendor}/.htaccess | 0 vendor/index.html | 2 + 28 files changed, 384 insertions(+), 276 deletions(-) create mode 100644 assets/.thumbs/.htaccess rename assets/{cache/images => backup}/.htaccess (100%) delete mode 100644 assets/cache/images/ht.access delete mode 100644 assets/cache/updater/ht.access create mode 100644 assets/export/.htaccess create mode 100644 assets/files/.htaccess create mode 100644 assets/images/.htaccess create mode 100644 assets/import/.htaccess delete mode 100755 assets/js/fileapi/.gitignore mode change 100755 => 100644 assets/modules/store/installer/action.install.php mode change 100755 => 100644 assets/modules/store/installer/action.options.php mode change 100755 => 100644 assets/modules/store/installer/index.php mode change 100755 => 100644 assets/modules/store/installer/setup.info.php mode change 100755 => 100644 assets/plugins/tinymce4/connector.tinymce4.saveProcessor.php mode change 100755 => 100644 assets/plugins/tinymce4/connector.tinymce4.templates.php create mode 100644 assets/site/.htaccess rename {assets/cache/updater => vendor}/.htaccess (100%) create mode 100644 vendor/index.html diff --git a/assets/.thumbs/.htaccess b/assets/.thumbs/.htaccess new file mode 100644 index 0000000000..6c1cc6e2da --- /dev/null +++ b/assets/.thumbs/.htaccess @@ -0,0 +1,5 @@ +IndexIgnore */* + + Order Deny,Allow + Deny from all + diff --git a/assets/cache/images/.htaccess b/assets/backup/.htaccess similarity index 100% rename from assets/cache/images/.htaccess rename to assets/backup/.htaccess diff --git a/assets/cache/images/ht.access b/assets/cache/images/ht.access deleted file mode 100644 index 8f91d28b69..0000000000 --- a/assets/cache/images/ht.access +++ /dev/null @@ -1,2 +0,0 @@ -order deny,allow -allow from all \ No newline at end of file diff --git a/assets/cache/updater/ht.access b/assets/cache/updater/ht.access deleted file mode 100644 index 8f91d28b69..0000000000 --- a/assets/cache/updater/ht.access +++ /dev/null @@ -1,2 +0,0 @@ -order deny,allow -allow from all \ No newline at end of file diff --git a/assets/docs/.htaccess b/assets/docs/.htaccess index 7ec3cfae9a..1fce156e5a 100644 --- a/assets/docs/.htaccess +++ b/assets/docs/.htaccess @@ -2,4 +2,8 @@ IndexIgnore */* Order Allow,Deny Deny from all - \ No newline at end of file + + + Order Deny,Allow + Deny from all + diff --git a/assets/export/.htaccess b/assets/export/.htaccess new file mode 100644 index 0000000000..6c1cc6e2da --- /dev/null +++ b/assets/export/.htaccess @@ -0,0 +1,5 @@ +IndexIgnore */* + + Order Deny,Allow + Deny from all + diff --git a/assets/files/.htaccess b/assets/files/.htaccess new file mode 100644 index 0000000000..6c1cc6e2da --- /dev/null +++ b/assets/files/.htaccess @@ -0,0 +1,5 @@ +IndexIgnore */* + + Order Deny,Allow + Deny from all + diff --git a/assets/images/.htaccess b/assets/images/.htaccess new file mode 100644 index 0000000000..6c1cc6e2da --- /dev/null +++ b/assets/images/.htaccess @@ -0,0 +1,5 @@ +IndexIgnore */* + + Order Deny,Allow + Deny from all + diff --git a/assets/import/.htaccess b/assets/import/.htaccess new file mode 100644 index 0000000000..6c1cc6e2da --- /dev/null +++ b/assets/import/.htaccess @@ -0,0 +1,5 @@ +IndexIgnore */* + + Order Deny,Allow + Deny from all + diff --git a/assets/js/fileapi/.gitignore b/assets/js/fileapi/.gitignore deleted file mode 100755 index eb79dd5fc7..0000000000 --- a/assets/js/fileapi/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -.idea diff --git a/assets/lib/class.modxRTEbridge.php b/assets/lib/class.modxRTEbridge.php index f7704c996e..f32d9b65c1 100644 --- a/assets/lib/class.modxRTEbridge.php +++ b/assets/lib/class.modxRTEbridge.php @@ -42,7 +42,7 @@ public function __construct($editorKey = NULL, $bridgeConfig=array(), $tvOptions // Object to pass vars between multiple plugin-events if(!isset($modx->modxRTEbridge)) $modx->modxRTEbridge = array(); - + // Init language before bridge so bridge can alter translations via $this->setLang() $this->initLang($basePath); @@ -76,7 +76,7 @@ public function __construct($editorKey = NULL, $bridgeConfig=array(), $tvOptions 'custom_plugins', 'custom_buttons1', 'custom_buttons2', 'custom_buttons3', 'custom_buttons4', 'template_docs', 'template_chunks' ); - + // Add defaultCheckbox-Values for user-settings $settingsRows = array(); include($basePath . 'gsettings/gsettings.rows.inc.php'); @@ -87,7 +87,7 @@ public function __construct($editorKey = NULL, $bridgeConfig=array(), $tvOptions $this->modxParams[$param . '_useglobal'] = !empty($editorConfig[$useGlobalName]) || (isset($editorConfig[$useGlobalName]) && is_null($editorConfig[$useGlobalName])) ? '1' : '0'; } } - + // Add custom settings from bridge foreach ($this->gSettingsCustom as $param => $row) { if (!in_array($param, $modxParamsArr)) $modxParamsArr[] = $param; @@ -233,7 +233,7 @@ public function getEditorScript() // Allows bridging elements+TV-options etc before looping $this->renderBridgeParams('initBridge'); - + // Now loop through tvs foreach ($this->pluginParams['elements'] as $selector) { @@ -271,15 +271,15 @@ public function getEditorScript() } } else { - // No elements given - create Config-Object only + // No elements given - create Config-Object only $this->theme = $this->tvOptions['theme']; $this->initTheme('noselector'); $this->renderBridgeParams('noselector'); - + // Prepare config output $ph = $this->prepareDefaultPlaceholders(); $ph = array_merge($ph, $this->customPlaceholders, $this->mergeParamArrays()); // Big list.. - + if (!defined($this->editorKey . '_INIT_CONFIG_' . $this->theme)) { define($this->editorKey . '_INIT_CONFIG_' . $this->theme, 1); $output .= file_get_contents("{$this->pluginParams['base_path']}tpl/tpl.{$this->editorKey}.config.html") ."\n"; @@ -317,13 +317,15 @@ public function prepareDefaultPlaceholders($selector='', $render=true) $ph['themeKey'] = $this->theme; $ph['selector'] = $selector; $ph['documentIdentifier'] = $modx->documentIdentifier; + $ph['base_path'] = MODX_BASE_PATH; + $ph['base_url'] = MODX_BASE_URL; $ph['manager_path'] = MGR_DIR; $ph['site_manager_url'] = MODX_MANAGER_URL; $ph['which_browser'] = !empty($modx->config['which_browser']) ? $modx->config['which_browser'] : 'mcpuk'; return $ph; } - + // Init/load theme public function initTheme($selector) { @@ -332,7 +334,7 @@ public function initTheme($selector) $this->theme = isset($this->tvOptions[$selector]['theme']) ? $this->tvOptions[$selector]['theme'] : $this->theme; // Load theme for user or webuser - if ($modx->isBackend() || (intval($_GET['quickmanagertv']) == 1 || isset($_SESSION['mgrValidated']))) { + if ($modx->isBackend() || ((int)$_GET['quickmanagertv'] == 1 || isset($_SESSION['mgrValidated']))) { // User is logged into Manager // Load base first to assure Modx settings like entermode, editor_css_path are given set, can be overwritten in custom theme include("{$this->pluginParams['base_path']}theme/theme.{$this->editorKey}.base.inc.php"); @@ -348,7 +350,7 @@ public function initTheme($selector) $this->pluginParams['language'] = !isset($this->pluginParams['language']) ? $this->lang('lang_code') : $this->pluginParams['language']; } } - + // Call bridge-functions and receive optional bridged-values // $selector = "initBridge" allows executing bridging function without modifying $this->themeConfig public function renderBridgeParams($selector) @@ -377,10 +379,10 @@ public function renderBridgeParams($selector) public function renderConfigString() { global $modx; - + $config = array(); $defaultPhs = $this->prepareDefaultPlaceholders('',false); - + // Build config-string as per themeConfig $raw = ''; foreach ($this->themeConfig as $key => $conf) { @@ -390,7 +392,7 @@ public function renderConfigString() if ($value === NULL) { continue; }; // Skip none-allowed empty settings $value = is_string($value) ? $modx->parseText($value, $defaultPhs) : $value; // Allow default-placeholders like [+which_browser+] in theme-param-values - + // Escape quotes if (!is_array($value) && strpos($value, "'") !== false && !in_array($conf['type'], array('raw','object','obj')) ) $value = str_replace("'", "\\'", $value); @@ -446,8 +448,8 @@ public function renderConfigRawString() return $raw; } - - // Get final value of editor-config + + // Get final value of editor-config public function determineValue($key, $conf=NULL) { if($conf == NULL) { $conf = $this->themeConfig[$key]; }; @@ -525,10 +527,10 @@ public function getModxSettings() // Prepare setting "skin" $ph['skin_options'] = $this->getSkinNames(); - + // Prepare setting "skin-theme" $ph['skintheme_options'] = $this->getSkinThemeNames(); - + // Prepare setting "entermode_options" $entermode = !empty($ph[$this->editorKey . '_entermode']) ? $ph[$this->editorKey . '_entermode'] : 'p'; $ph['entermode_options'] = '
    '; @@ -580,9 +582,9 @@ public function getModxSettings() if ($row == NULL) { continue; }; // Skip disabled config-settings - + $row = array_merge($this->langArr, $row); - + $row['name'] = $this->editorKey . '_' . $name; $row['editorKey'] = $this->editorKey; $row['title'] = $this->lang($row['title']); @@ -591,7 +593,7 @@ public function getModxSettings() // Prepare displaying of default values $row['default'] = isset($this->gSettingsDefaultValues[$name]) ? '' . $this->lang('default') . '' . $this->gSettingsDefaultValues[$name] . '' : ''; - + // Prepare Default-Checkboxes for user-settings if(in_array($modx->manager->action, array(11,12)) && isset($row['defaultCheckbox']) && $row['defaultCheckbox']) { $useGlobalName = $name . '_useglobal'; @@ -601,7 +603,7 @@ public function getModxSettings() } else { $row['defaultCheckbox'] = ''; } - + // Nested parsing $output = $settingsRowTpl; $bt=md5(''); @@ -610,7 +612,7 @@ public function getModxSettings() $output = $this->parsePlaceholders($output, $row); // Replace general translations $output = $this->parsePlaceholders($output, $ph); // Replace values / settings } - + $ph['rows'] .= $output . "\n"; }; @@ -623,12 +625,12 @@ public function getModxSettings() return $settingsBody; } - + public function parsePlaceholders($content, $ph) { foreach($ph as $key=>$value) $content = str_replace('[+'.$key.'+]', $value, $content); return $content; } - + // Replace all translation-placeholders public function replaceTranslations($output) { @@ -667,9 +669,9 @@ public function getThemeNames() //$file = str_replace('\\', '/', $file); $file = str_replace($themeDir, '', $file); $file = str_replace('theme.' . $this->editorKey . '.', '', $file); - + if(in_array($file,array('index.html'))) continue; - + $theme = trim(str_replace('.inc.php', '', $file)); if ($theme == 'base') continue; // Why should user select base-theme? $label = $this->lang("theme_{$theme}", true) ? $this->lang("theme_{$theme}") : $theme; // Get optional translation or show raw themeKey @@ -747,7 +749,7 @@ public function getSkinThemeNames() foreach (glob("{$themeDir}*") as $theme) { //$file = str_replace('\\', '/', $file); $theme = str_replace($themeDir, '', $theme); - + if(in_array($theme,array('index.html'))) continue; $selected = $this->selected($theme == $this->modxParams['skintheme']); @@ -810,14 +812,14 @@ public function initLang($basePath) public function mergeParamArrays() { $p = array(); - foreach($this->pluginParams as $param=>$value) { $p['pp.'.$param] = is_array($value) ? join(',',$value) : $value; }; - foreach($this->modxParams as $param=>$value) { $p['mp.'.$param] = is_array($value) ? join(',',$value) : $value; }; + foreach($this->pluginParams as $param=>$value) { $p['pp.'.$param] = is_array($value) ? implode(',',$value) : $value; }; + foreach($this->modxParams as $param=>$value) { $p['mp.'.$param] = is_array($value) ? implode(',',$value) : $value; }; foreach($this->themeConfig as $param=>$arr) { if (isset($arr['force'])) $p['tc.' . $param] = $arr['force']; elseif (isset($arr['bridged'])) $p['tc.' . $param] = $arr['bridged']; else $p['tc.' . $param] = $arr['value']; }; - foreach($this->gSettingsDefaultValues as $param=>$value) { $p['gd.'.$param] = is_array($value) ? join(',',$value) : $value; }; + foreach($this->gSettingsDefaultValues as $param=>$value) { $p['gd.'.$param] = is_array($value) ? implode(',',$value) : $value; }; foreach($this->langArr as $param=>$value) { $p['l.'.$param] = $value; }; return $p; } @@ -864,14 +866,14 @@ public function parseEditableIds($source, $attrContentEditable=false) { if(!isset($_SESSION['mgrValidated'])) return $source; $attrContentEditable = $attrContentEditable == true ? ' contenteditable="true"' : ''; - + $matchPhs = '~\[\*#(.*?)\*\]~'; // match [*#content*] / content preg_match_all($matchPhs, $source, $editableIds); - + $this->setEditableIds($editableIds); - + $source = preg_replace($matchPhs, '
    [*$1*]
    ', $source); - + return $source; } @@ -939,7 +941,7 @@ public function renderDebugMessages($placeholderArr) { if($this->debug) { $output .= "' . "\n"; - } else { - // There aren't any Template Variables - //$templateVariables .= "\t

    " . $_lang['tmplvars_novars'] . "

    \n"; } } @@ -1535,9 +1532,13 @@ function makePublic(b) { } } +/** + * @return string + */ function getDefaultTemplate() { global $modx; + $default_template = ''; switch($modx->config['auto_template_logic']) { case 'sibling': if(!isset($_GET['pid']) || empty($_GET['pid'])) { @@ -1573,9 +1574,6 @@ function getDefaultTemplate() { default: // default_template is already set $default_template = $modx->config['default_template']; } - if(!isset($default_template)) { - $default_template = $modx->config['default_template']; - } // default_template is already set - return $default_template; + return empty($default_template) ? $modx->config['default_template'] : $default_template; } diff --git a/manager/actions/mutate_htmlsnippet.dynamic.php b/manager/actions/mutate_htmlsnippet.dynamic.php index 105743800f..9305315b5c 100644 --- a/manager/actions/mutate_htmlsnippet.dynamic.php +++ b/manager/actions/mutate_htmlsnippet.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR


    Please use the EVO Content Manager instead of accessing this file directly."); } @@ -18,7 +18,7 @@ $modx->webAlertAndQuit($_lang["error_no_privileges"]); } -$id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; +$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; // Get table names (alphabetical) $tbl_site_htmlsnippets = $modx->getFullTableName('site_htmlsnippets'); @@ -47,7 +47,7 @@ $content['name'] = $_REQUEST['itemname']; } else { $_SESSION['itemname'] = $_lang["new_htmlsnippet"]; - $content['category'] = intval($_REQUEST['catid']); + $content['category'] = (int)$_REQUEST['catid']; } if ($modx->manager->hasFormValues()) { diff --git a/manager/actions/mutate_menuindex_sort.dynamic.php b/manager/actions/mutate_menuindex_sort.dynamic.php index c1f324fea5..989eedeada 100644 --- a/manager/actions/mutate_menuindex_sort.dynamic.php +++ b/manager/actions/mutate_menuindex_sort.dynamic.php @@ -1,12 +1,12 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('edit_document') || !$modx->hasPermission('save_document')) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } -$id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : null; +$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : null; $reset = isset($_POST['reset']) && $_POST['reset'] == 'true' ? 1 : 0; $items = isset($_POST['list']) ? $_POST['list'] : ''; $ressourcelist = ''; @@ -70,7 +70,7 @@ } } -$pagetitle = $id == 0 ? $site_name : $pagetitle; +$pagetitle = empty($id) ? $site_name : $pagetitle; ?>
    - \ No newline at end of file + diff --git a/manager/actions/resources/tab2_templatevars.inc.php b/manager/actions/resources/tab2_templatevars.inc.php index 2cfca10b96..72d8f8d4e7 100644 --- a/manager/actions/resources/tab2_templatevars.inc.php +++ b/manager/actions/resources/tab2_templatevars.inc.php @@ -1,6 +1,6 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } @@ -40,4 +40,4 @@ initViews('tv', 'tv', 'site_tmplvars')
    - \ No newline at end of file + diff --git a/manager/actions/resources/tab3_chunks.inc.php b/manager/actions/resources/tab3_chunks.inc.php index c694758965..6183b1afb9 100644 --- a/manager/actions/resources/tab3_chunks.inc.php +++ b/manager/actions/resources/tab3_chunks.inc.php @@ -1,6 +1,6 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } @@ -36,4 +36,4 @@ initViews('ch', 'chunks', 'site_htmlsnippets')
    - \ No newline at end of file + diff --git a/manager/actions/resources/tab4_snippets.inc.php b/manager/actions/resources/tab4_snippets.inc.php index cc075f8bea..921b4e4089 100644 --- a/manager/actions/resources/tab4_snippets.inc.php +++ b/manager/actions/resources/tab4_snippets.inc.php @@ -1,6 +1,6 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } @@ -36,4 +36,4 @@ initViews('sn', 'snippets', 'site_snippets')
    - \ No newline at end of file + diff --git a/manager/actions/resources/tab5_plugins.inc.php b/manager/actions/resources/tab5_plugins.inc.php index 8bed66c930..b07db5ab55 100644 --- a/manager/actions/resources/tab5_plugins.inc.php +++ b/manager/actions/resources/tab5_plugins.inc.php @@ -1,6 +1,6 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } @@ -49,4 +49,4 @@ initViews('pl', 'plugins', 'site_plugins') - \ No newline at end of file + diff --git a/manager/actions/resources/tab6_categoryview.inc.php b/manager/actions/resources/tab6_categoryview.inc.php index ab29a6657f..2f118d79d9 100644 --- a/manager/actions/resources/tab6_categoryview.inc.php +++ b/manager/actions/resources/tab6_categoryview.inc.php @@ -1,4 +1,5 @@ -INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } ?> @@ -33,4 +34,4 @@ initQuicksearch('categories_list_search', 'categories_list') initViews('cat', 'category') - \ No newline at end of file + diff --git a/manager/actions/role_management.static.php b/manager/actions/role_management.static.php index 2562efc431..bd6adb1dce 100644 --- a/manager/actions/role_management.static.php +++ b/manager/actions/role_management.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if(!$modx->hasPermission('edit_user')) { diff --git a/manager/actions/search.static.php b/manager/actions/search.static.php index 5253f48e77..40c94197e9 100644 --- a/manager/actions/search.static.php +++ b/manager/actions/search.static.php @@ -1,5 +1,5 @@ db->select('*', $modx->getFullTableName('site_templates')); $option[] = ''; - $templateid = (isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '') ? intval($_REQUEST['templateid']) : ''; + $templateid = (isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '') ? (int)$_REQUEST['templateid'] : ''; $selected = $templateid === 0 ? ' selected="selected"' : ''; $option[] = ''; while ($row = $modx->db->getRow($rs)) { @@ -49,7 +49,7 @@ $selected = $row['id'] == $templateid ? ' selected="selected"' : ''; $option[] = sprintf('', $row['id'], $selected, $templatename, $row['id']); } - $tpls = sprintf('', join("\n", $option)); + $tpls = sprintf('', implode("\n", $option)); ?> @@ -86,7 +86,7 @@ $searchfields = htmlentities(trim($_POST['searchfields']), ENT_QUOTES, $modx_manager_charset); $searchlongtitle = $modx->db->escape(trim($_REQUEST['searchfields'])); $search_alias = $modx->db->escape(trim($_REQUEST['searchfields'])); - $templateid = isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '' ? intval($_REQUEST['templateid']) : ''; + $templateid = isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '' ? (int)$_REQUEST['templateid'] : ''; $searchcontent = $modx->db->escape($_REQUEST['content']); $fields = 'DISTINCT sc.id, contenttype, pagetitle, longtitle, description, introtext, menutitle, deleted, published, isfolder, type'; @@ -112,7 +112,7 @@ // Handle Input "Search in main fields" if ($searchfields != '') { - + /*start search by TV. Added Rising13*/ $tbl_site_tmplvar_contentvalues = $modx->getFullTableName('site_tmplvar_contentvalues'); $articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'"; @@ -127,13 +127,13 @@ $articul_id.=','; } $i++; - } + } $articul_id_query = " OR sc.id IN ({$articul_id})"; }else{ $articul_id_query = ''; } /*end search by TV*/ - + if (ctype_digit($searchfields)) { $sqladd .= "sc.id='{$searchfields}'"; if (strlen($searchfields) > 3) { @@ -144,7 +144,7 @@ if ($idFromAlias) { $sqladd .= $sqladd != '' ? ' OR ' : ''; $sqladd .= "sc.id='{$idFromAlias}'"; - + } $sqladd = $sqladd ? "({$sqladd})" : $sqladd; @@ -414,6 +414,11 @@ $1', $text); } +/** + * @param string $locked + * @param string $disabled + * @param string $deleted + * @return string + */ function addClassForItemList($locked = '', $disabled = '', $deleted = '') { $class = ''; diff --git a/manager/actions/site_schedule.static.php b/manager/actions/site_schedule.static.php index d783454b1c..ae8d6b8ecb 100644 --- a/manager/actions/site_schedule.static.php +++ b/manager/actions/site_schedule.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if(!$modx->hasPermission('view_eventlog')) { diff --git a/manager/actions/sysinfo.static.php b/manager/actions/sysinfo.static.php index 7162b48ecc..6ac4cab6fd 100644 --- a/manager/actions/sysinfo.static.php +++ b/manager/actions/sysinfo.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('logs')) { diff --git a/manager/actions/user_management.static.php b/manager/actions/user_management.static.php index f93ed36429..8402d14429 100644 --- a/manager/actions/user_management.static.php +++ b/manager/actions/user_management.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if(!$modx->hasPermission('edit_user')) { diff --git a/manager/frames/nodes.functions.inc.php b/manager/frames/nodes.functions.inc.php index f6f43f5ffd..520c5ff0c2 100644 --- a/manager/frames/nodes.functions.inc.php +++ b/manager/frames/nodes.functions.inc.php @@ -1,585 +1,581 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly.'); +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die('INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly.'); } /** - * @param $indent - * @param $parent - * @param $expandAll - * @param $theme + * @param int $indent + * @param int $parent + * @param int $expandAll * @param string $hereid + * @return string */ -function makeHTML($indent, $parent, $expandAll, $theme, $hereid = '') { - global $modx; - global $icons, $iconsPrivate, $_style; - global $_lang, $opened, $opened2, $closed2; //added global vars - global $modx_textdir; - - $output = ''; - - // setup spacer - $level = 0; - $spacer = ''; - for($i = 2; $i <= $indent; $i++) { - $spacer .= ''; - $level++; - } - $spacer .= ''; - - // manage order-by - 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'; - } - - switch($_SESSION['tree_sortby']) { - case 'createdon': - case 'editedon': - case 'publishedon': - case 'pub_date': - case 'unpub_date': - $sortby = sprintf('CASE WHEN %s IS NULL THEN 1 ELSE 0 END, %s', 'sc.' . $_SESSION['tree_sortby'], 'sc.' . $_SESSION['tree_sortby']); - break; - default: - $sortby = 'sc.' . $_SESSION['tree_sortby']; - }; - - $orderby = $modx->db->escape($sortby . ' ' . $_SESSION['tree_sortdir']); - - // Folder sorting gets special setup ;) Add menuindex and pagetitle - if($_SESSION['tree_sortby'] == 'isfolder') { - $orderby .= ', menuindex ASC, pagetitle'; - } - - $tblsc = $modx->getFullTableName('site_content'); - $tbldg = $modx->getFullTableName('document_groups'); - $tblst = $modx->getFullTableName('site_templates'); - // 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']; - } - $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}))"); - } else { - $access = ''; - } - $docgrp_cond = $docgrp ? "OR dg.document_group IN ({$docgrp})" : ''; - $field = "DISTINCT sc.id, pagetitle, longtitle, menutitle, parent, isfolder, published, pub_date, unpub_date, richtext, searchable, cacheable, deleted, type, template, templatename, menuindex, donthit, hidemenu, alias, contentType, privateweb, privatemgr, +function makeHTML($indent, $parent, $expandAll, $hereid = '') +{ + global $modx, $icons, $_style, $_lang, $opened, $opened2, $closed2, $modx_textdir; + + $output = ''; + + // setup spacer + $level = 0; + $spacer = ''; + for ($i = 2; $i <= $indent; $i++) { + $spacer .= ''; + $level++; + } + $spacer .= ''; + + // manage order-by + 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'; + } + + switch ($_SESSION['tree_sortby']) { + case 'createdon': + case 'editedon': + case 'publishedon': + case 'pub_date': + case 'unpub_date': + $sortby = sprintf('CASE WHEN %s IS NULL THEN 1 ELSE 0 END, %s', 'sc.' . $_SESSION['tree_sortby'], 'sc.' . $_SESSION['tree_sortby']); + break; + default: + $sortby = 'sc.' . $_SESSION['tree_sortby']; + }; + + $orderby = $modx->db->escape($sortby . ' ' . $_SESSION['tree_sortdir']); + + // Folder sorting gets special setup ;) Add menuindex and pagetitle + if ($_SESSION['tree_sortby'] == 'isfolder') { + $orderby .= ', menuindex ASC, pagetitle'; + } + + $tblsc = $modx->getFullTableName('site_content'); + $tbldg = $modx->getFullTableName('document_groups'); + $tblst = $modx->getFullTableName('site_templates'); + // 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']; + } + $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}))"); + } else { + $access = ''; + } + $docgrp_cond = $docgrp ? "OR dg.document_group IN ({$docgrp})" : ''; + $field = "DISTINCT sc.id, pagetitle, longtitle, menutitle, parent, isfolder, published, pub_date, unpub_date, richtext, searchable, cacheable, deleted, type, template, templatename, menuindex, donthit, hidemenu, alias, contentType, privateweb, privatemgr, MAX(IF(1={$mgrRole} OR sc.privatemgr=0 {$docgrp_cond}, 1, 0)) AS hasAccess, GROUP_CONCAT(document_group SEPARATOR ',') AS roles"; - $from = "{$tblsc} AS sc LEFT JOIN {$tbldg} dg on dg.document = sc.id LEFT JOIN {$tblst} st on st.id = sc.template"; - $where = "(parent={$parent}) {$access} GROUP BY sc.id"; - $result = $modx->db->select($field, $from, $where, $orderby); - if($modx->db->getRecordCount($result) == 0) { - $output .= sprintf('', $spacer, $_style['tree_deletedpage'], $_lang['empty_folder']); - } - - $nodeNameSource = $_SESSION['tree_nodename'] == 'default' ? $modx->config['resource_tree_node_name'] : $_SESSION['tree_nodename']; - - while($row = $modx->db->getRow($result)) { - $node = ''; - - $nodetitle = getNodeTitle($nodeNameSource, $row); - $nodetitleDisplay = $nodetitle; - - $treeNodeClass = 'node'; - $treeNodeClass .= $row['hasAccess'] == 0 ? ' protected' : ''; - - if($row['deleted'] == 1) { - $treeNodeClass .= ' deleted'; - //$nodetitleDisplay = sprintf('%s', $nodetitle); - } elseif($row['published'] == 0) { - $treeNodeClass .= ' unpublished'; - //$nodetitleDisplay = sprintf('%s', $nodetitle); - } elseif($row['hidemenu'] == 1) { - $treeNodeClass .= ' hidemenu'; - //$nodetitleDisplay = sprintf('%s', $protectedClass, $nodetitle); - } else { - //$nodetitleDisplay = sprintf('%s', $protectedClass, $nodetitle); - } - - if($row['id'] == $hereid) { - $treeNodeClass .= ' current'; - } - - $weblinkDisplay = $row['type'] == 'reference' ? sprintf(' %s', $_style['tree_linkgo']) : ''; - $pageIdDisplay = '(' . ($modx_textdir ? '‏' : '') . $row['id'] . ')'; - - // Prepare displaying user-locks - $lockedByUser = ''; - $rowLock = $modx->elementIsLocked(7, $row['id'], true); - if($rowLock && $modx->hasPermission('display_locks')) { - if($rowLock['sid'] == $modx->sid) { - $title = $modx->parseText($_lang["lock_element_editing"], array( - 'element_type' => $_lang["lock_element_type_7"], - 'lasthit_df' => $rowLock['lasthit_df'] - )); - $lockedByUser = '' . $_style['tree_preview_resource'] . ''; - } else { - $title = $modx->parseText($_lang["lock_element_locked_by"], array( - 'element_type' => $_lang["lock_element_type_7"], - 'username' => $rowLock['username'], - 'lasthit_df' => $rowLock['lasthit_df'] - )); - if($modx->hasPermission('remove_locks')) { - $lockedByUser = '' . $_style['icons_secured'] . ''; - } else { - $lockedByUser = '' . $_style['icons_secured'] . ''; - } - } - } - - $url = $modx->makeUrl($row['id']); - - $title = ''; - if(isDateNode($nodeNameSource)) { - $title = $_lang['pagetitle'] . ': ' . $row['pagetitle'] . '[+lf+]'; - } - $title .= $_lang['id'] . ': ' . $row['id']; - $title .= '[+lf+]' . $_lang['resource_opt_menu_title'] . ': ' . $row['menutitle']; - $title .= '[+lf+]' . $_lang['resource_opt_menu_index'] . ': ' . $row['menuindex']; - $title .= '[+lf+]' . $_lang['alias'] . ': ' . (!empty($row['alias']) ? $row['alias'] : '-'); - $title .= '[+lf+]' . $_lang['template'] . ': ' . $row['templatename']; - $title .= '[+lf+]' . $_lang['publish_date'] . ': ' . $modx->toDateFormat($row['pub_date']); - $title .= '[+lf+]' . $_lang['unpublish_date'] . ': ' . $modx->toDateFormat($row['unpub_date']); - $title .= '[+lf+]' . $_lang['page_data_web_access'] . ': ' . ($row['privateweb'] ? $_lang['private'] : $_lang['public']); - $title .= '[+lf+]' . $_lang['page_data_mgr_access'] . ': ' . ($row['privatemgr'] ? $_lang['private'] : $_lang['public']); - $title .= '[+lf+]' . $_lang['resource_opt_richtext'] . ': ' . ($row['richtext'] == 0 ? $_lang['no'] : $_lang['yes']); - $title .= '[+lf+]' . $_lang['page_data_searchable'] . ': ' . ($row['searchable'] == 0 ? $_lang['no'] : $_lang['yes']); - $title .= '[+lf+]' . $_lang['page_data_cacheable'] . ': ' . ($row['cacheable'] == 0 ? $_lang['no'] : $_lang['yes']); - $title = $modx->htmlspecialchars($title); - $title = str_replace('[+lf+]', ' ', $title); // replace line-breaks with empty space as fall-back - - $data = array( - 'id' => $row['id'], - 'pagetitle' => $row['pagetitle'], - 'longtitle' => $row['longtitle'], - 'menutitle' => $row['menutitle'], - 'parent' => $parent, - 'isfolder' => $row['isfolder'], - 'published' => $row['published'], - 'deleted' => $row['deleted'], - 'type' => $row['type'], - 'menuindex' => $row['menuindex'], - 'donthit' => $row['donthit'], - 'hidemenu' => $row['hidemenu'], - 'alias' => $row['alias'], - 'contenttype' => $row['contentType'], - 'privateweb' => $row['privateweb'], - 'privatemgr' => $row['privatemgr'], - 'hasAccess' => $row['hasAccess'], - 'template' => $row['template'], - 'nodetitle' => $nodetitle, - 'url' => $url, - 'title' => $title, - 'nodetitleDisplay' => $nodetitleDisplay, - 'weblinkDisplay' => $weblinkDisplay, - 'pageIdDisplay' => $pageIdDisplay, - 'lockedByUser' => $lockedByUser, - 'treeNodeClass' => $treeNodeClass, - 'treeNodeSelected' => $row['id'] == $hereid ? ' treeNodeSelected' : '', - 'tree_page_click' => $modx->config['tree_page_click'], - 'showChildren' => 1, - 'openFolder' => 1, - 'contextmenu' => '', - 'tree_minusnode' => $_style['tree_minusnode'], - 'tree_plusnode' => $_style['tree_plusnode'], - 'spacer' => $spacer, - 'subMenuState' => '', - 'level' => $level, - 'isPrivate' => 0, - 'roles' => ($row['roles'] ? $row['roles'] : '') - ); - - $ph = $data; - $ph['nodetitle_esc'] = addslashes($nodetitle); - $ph['indent'] = $indent + 1; - $ph['expandAll'] = $expandAll; - $ph['isPrivate'] = ($row['privateweb'] || $row['privatemgr']) ? 1 : 0; - - if(!$row['isfolder']) { - $tpl = getTplSingleNode(); - switch($row['id']) { - case $modx->config['site_start'] : - $icon = $_style['tree_page_home']; - break; - case $modx->config['error_page'] : - $icon = $_style['tree_page_404']; - break; - case $modx->config['site_unavailable_page'] : - $icon = $_style['tree_page_hourglass']; - break; - case $modx->config['unauthorized_page'] : - $icon = $_style['tree_page_info']; - break; - default: - if(isset($icons[$row['contentType']])) { - $icon = $icons[$row['contentType']]; - } else { - $icon = $_style['tree_page']; - } - } - $ph['icon'] = $icon; - - // invoke OnManagerNodePrerender event - $prenode = $modx->invokeEvent("OnManagerNodePrerender", array('ph' => $ph)); - if(is_array($prenode)) { - $phnew = array(); - foreach($prenode as $pnode) { - $phnew = array_merge($phnew, unserialize($pnode)); - } - $ph = (count($phnew) > 0) ? $phnew : $ph; - } - - if($ph['contextmenu']) { - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; - } - - if($_SESSION['tree_show_only_folders']) { - if($row['parent'] == 0) { - $node .= $modx->parseText($tpl, $ph); - } else { - $node .= ''; - } - } else { - $node .= $modx->parseText($tpl, $ph); - } - - } else { - $ph['icon_folder_open'] = $_style['tree_folderopen_new']; - $ph['icon_folder_close'] = $_style['tree_folder_new']; - - if($_SESSION['tree_show_only_folders']) { - $tpl = getTplFolderNodeNotChildren(); - $checkFolders = checkIsFolder($row['id'], 1) ? 1 : 0; // folders - $checkDocs = checkIsFolder($row['id'], 0) ? 1 : 0; // no folders - $ph['tree_page_click'] = 3; - - // expandAll: two type for partial expansion - if($expandAll == 1 || ($expandAll == 2 && in_array($row['id'], $opened))) { - if($expandAll == 1) { - $opened2[] = $row['id']; - } - $ph['icon'] = $ph['icon_folder_open']; - $ph['icon_node_toggle'] = $ph['tree_minusnode']; - $ph['node_toggle'] = 1; - $ph['subMenuState'] = ' open'; - - if(($checkDocs && !$checkFolders) || (!$checkDocs && !$checkFolders)) { - $ph['showChildren'] = 1; - $ph['icon_node_toggle'] = ''; - $ph['icon'] = $ph['icon_folder_close']; - } elseif(!$checkDocs && $checkFolders) { - $ph['showChildren'] = 0; - $ph['openFolder'] = 2; - } else { - $ph['openFolder'] = 2; - } - - // invoke OnManagerNodePrerender event - $prenode = $modx->invokeEvent("OnManagerNodePrerender", array( - 'ph' => $ph, - 'opened' => '1' - )); - if(is_array($prenode)) { - $phnew = array(); - foreach($prenode as $pnode) { - $phnew = array_merge($phnew, unserialize($pnode)); - } - $ph = (count($phnew) > 0) ? $phnew : $ph; - } - - if($ph['contextmenu']) { - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; - } - - $node .= $modx->parseText($tpl, $ph); - if($checkFolders) { - $node .= makeHTML($indent + 1, $row['id'], $expandAll, $theme, $hereid); - } - $node .= ''; - } else { - $closed2[] = $row['id']; - $ph['icon'] = $ph['icon_folder_close']; - $ph['icon_node_toggle'] = $ph['tree_plusnode']; - $ph['node_toggle'] = 0; - - if(($checkDocs && !$checkFolders) || (!$checkDocs && !$checkFolders)) { - $ph['showChildren'] = 1; - $ph['icon_node_toggle'] = ''; - } elseif(!$checkDocs && $checkFolders) { - $ph['showChildren'] = 0; - $ph['openFolder'] = 2; - } else { - $ph['openFolder'] = 2; - } - - // invoke OnManagerNodePrerender event - $prenode = $modx->invokeEvent("OnManagerNodePrerender", array( - 'ph' => $ph, - 'opened' => '0' - )); - if(is_array($prenode)) { - $phnew = array(); - foreach($prenode as $pnode) { - $phnew = array_merge($phnew, unserialize($pnode)); - } - $ph = (count($phnew) > 0) ? $phnew : $ph; - } - - if($ph['contextmenu']) { - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; - } - - $node .= $modx->parseText($tpl, $ph); - $node .= ''; - } - } else { - $tpl = getTplFolderNode(); - // expandAll: two type for partial expansion - if($expandAll == 1 || ($expandAll == 2 && in_array($row['id'], $opened))) { - if($expandAll == 1) { - $opened2[] = $row['id']; - } - $ph['icon'] = $ph['icon_folder_open']; - $ph['icon_node_toggle'] = $ph['tree_minusnode']; - $ph['node_toggle'] = 1; - $ph['subMenuState'] = ' open'; - - if($ph['donthit'] == 1) { - $ph['tree_page_click'] = 3; - $ph['icon_node_toggle'] = ''; - $ph['icon'] = $ph['icon_folder_close']; - $ph['showChildren'] = 0; - } - - // invoke OnManagerNodePrerender event - $prenode = $modx->invokeEvent("OnManagerNodePrerender", array( - 'ph' => $ph, - 'opened' => '1' - )); - if(is_array($prenode)) { - $phnew = array(); - foreach($prenode as $pnode) { - $phnew = array_merge($phnew, unserialize($pnode)); - } - $ph = (count($phnew) > 0) ? $phnew : $ph; - if($ph['showChildren'] == 0) { - unset($opened2[$row['id']]); - $ph['node_toggle'] = 0; - $ph['subMenuState'] = ''; - } - } - - if($ph['showChildren'] == 0) { - $ph['icon_node_toggle'] = ''; - $ph['donthit'] = 1; - $ph['icon'] = $ph['icon_folder_close']; - $tpl = getTplFolderNodeNotChildren(); - } - - if($ph['contextmenu']) { - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; - } - - $node .= $modx->parseText($tpl, $ph); - if($ph['donthit'] == 0) { - $node .= makeHTML($indent + 1, $row['id'], $expandAll, $theme, $hereid); - } - $node .= ''; - } else { - $closed2[] = $row['id']; - $ph['icon'] = $ph['icon_folder_close']; - $ph['icon_node_toggle'] = $ph['tree_plusnode']; - $ph['node_toggle'] = 0; - - if($ph['donthit'] == 1) { - $ph['tree_page_click'] = 3; - $ph['icon_node_toggle'] = ''; - $ph['icon'] = $ph['icon_folder_close']; - $ph['showChildren'] = 0; - } - - // invoke OnManagerNodePrerender event - $prenode = $modx->invokeEvent("OnManagerNodePrerender", array( - 'ph' => $ph, - 'opened' => '0' - )); - if(is_array($prenode)) { - $phnew = array(); - foreach($prenode as $pnode) { - $phnew = array_merge($phnew, unserialize($pnode)); - } - $ph = (count($phnew) > 0) ? $phnew : $ph; - } - - if($ph['showChildren'] == 0) { - $ph['icon_node_toggle'] = ''; - $ph['donthit'] = 1; - $ph['icon'] = $ph['icon_folder_close']; - $tpl = getTplFolderNodeNotChildren(); - } - - if($ph['contextmenu']) { - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; - } - - $node .= $modx->parseText($tpl, $ph); - $node .= ''; - } - } - } - - // invoke OnManagerNodeRender event - $data['node'] = $node; - $evtOut = $modx->invokeEvent('OnManagerNodeRender', $data); - if(is_array($evtOut)) { - $evtOut = implode("\n", $evtOut); - } - if($evtOut != '') { - $node = trim($evtOut); - } - - $output .= $node; - } - - return $output; + $from = "{$tblsc} AS sc LEFT JOIN {$tbldg} dg on dg.document = sc.id LEFT JOIN {$tblst} st on st.id = sc.template"; + $where = "(parent={$parent}) {$access} GROUP BY sc.id"; + $result = $modx->db->select($field, $from, $where, $orderby); + if ($modx->db->getRecordCount($result) == 0) { + $output .= sprintf('', $spacer, $_style['tree_deletedpage'], $_lang['empty_folder']); + } + + $nodeNameSource = $_SESSION['tree_nodename'] == 'default' ? $modx->config['resource_tree_node_name'] : $_SESSION['tree_nodename']; + + while ($row = $modx->db->getRow($result)) { + $node = ''; + $nodetitle = getNodeTitle($nodeNameSource, $row); + $nodetitleDisplay = $nodetitle; + $treeNodeClass = 'node'; + $treeNodeClass .= $row['hasAccess'] == 0 ? ' protected' : ''; + + if ($row['deleted'] == 1) { + $treeNodeClass .= ' deleted'; + } elseif ($row['published'] == 0) { + $treeNodeClass .= ' unpublished'; + } elseif ($row['hidemenu'] == 1) { + $treeNodeClass .= ' hidemenu'; + } + + if ($row['id'] == $hereid) { + $treeNodeClass .= ' current'; + } + + $weblinkDisplay = $row['type'] == 'reference' ? sprintf(' %s', $_style['tree_linkgo']) : ''; + $pageIdDisplay = '(' . ($modx_textdir ? '‏' : '') . $row['id'] . ')'; + + // Prepare displaying user-locks + $lockedByUser = ''; + $rowLock = $modx->elementIsLocked(7, $row['id'], true); + if ($rowLock && $modx->hasPermission('display_locks')) { + if ($rowLock['sid'] == $modx->sid) { + $title = $modx->parseText($_lang["lock_element_editing"], array( + 'element_type' => $_lang["lock_element_type_7"], + 'lasthit_df' => $rowLock['lasthit_df'] + )); + $lockedByUser = '' . $_style['tree_preview_resource'] . ''; + } else { + $title = $modx->parseText($_lang["lock_element_locked_by"], array( + 'element_type' => $_lang["lock_element_type_7"], + 'username' => $rowLock['username'], + 'lasthit_df' => $rowLock['lasthit_df'] + )); + if ($modx->hasPermission('remove_locks')) { + $lockedByUser = '' . $_style['icons_secured'] . ''; + } else { + $lockedByUser = '' . $_style['icons_secured'] . ''; + } + } + } + + $url = $modx->makeUrl($row['id']); + + $title = ''; + if (isDateNode($nodeNameSource)) { + $title = $_lang['pagetitle'] . ': ' . $row['pagetitle'] . '[+lf+]'; + } + $title .= $_lang['id'] . ': ' . $row['id']; + $title .= '[+lf+]' . $_lang['resource_opt_menu_title'] . ': ' . $row['menutitle']; + $title .= '[+lf+]' . $_lang['resource_opt_menu_index'] . ': ' . $row['menuindex']; + $title .= '[+lf+]' . $_lang['alias'] . ': ' . (!empty($row['alias']) ? $row['alias'] : '-'); + $title .= '[+lf+]' . $_lang['template'] . ': ' . $row['templatename']; + $title .= '[+lf+]' . $_lang['publish_date'] . ': ' . $modx->toDateFormat($row['pub_date']); + $title .= '[+lf+]' . $_lang['unpublish_date'] . ': ' . $modx->toDateFormat($row['unpub_date']); + $title .= '[+lf+]' . $_lang['page_data_web_access'] . ': ' . ($row['privateweb'] ? $_lang['private'] : $_lang['public']); + $title .= '[+lf+]' . $_lang['page_data_mgr_access'] . ': ' . ($row['privatemgr'] ? $_lang['private'] : $_lang['public']); + $title .= '[+lf+]' . $_lang['resource_opt_richtext'] . ': ' . ($row['richtext'] == 0 ? $_lang['no'] : $_lang['yes']); + $title .= '[+lf+]' . $_lang['page_data_searchable'] . ': ' . ($row['searchable'] == 0 ? $_lang['no'] : $_lang['yes']); + $title .= '[+lf+]' . $_lang['page_data_cacheable'] . ': ' . ($row['cacheable'] == 0 ? $_lang['no'] : $_lang['yes']); + $title = $modx->htmlspecialchars($title); + $title = str_replace('[+lf+]', ' ', $title); // replace line-breaks with empty space as fall-back + + $data = array( + 'id' => $row['id'], + 'pagetitle' => $row['pagetitle'], + 'longtitle' => $row['longtitle'], + 'menutitle' => $row['menutitle'], + 'parent' => $parent, + 'isfolder' => $row['isfolder'], + 'published' => $row['published'], + 'deleted' => $row['deleted'], + 'type' => $row['type'], + 'menuindex' => $row['menuindex'], + 'donthit' => $row['donthit'], + 'hidemenu' => $row['hidemenu'], + 'alias' => $row['alias'], + 'contenttype' => $row['contentType'], + 'privateweb' => $row['privateweb'], + 'privatemgr' => $row['privatemgr'], + 'hasAccess' => $row['hasAccess'], + 'template' => $row['template'], + 'nodetitle' => $nodetitle, + 'url' => $url, + 'title' => $title, + 'nodetitleDisplay' => $nodetitleDisplay, + 'weblinkDisplay' => $weblinkDisplay, + 'pageIdDisplay' => $pageIdDisplay, + 'lockedByUser' => $lockedByUser, + 'treeNodeClass' => $treeNodeClass, + 'treeNodeSelected' => $row['id'] == $hereid ? ' treeNodeSelected' : '', + 'tree_page_click' => $modx->config['tree_page_click'], + 'showChildren' => 1, + 'openFolder' => 1, + 'contextmenu' => '', + 'tree_minusnode' => $_style['tree_minusnode'], + 'tree_plusnode' => $_style['tree_plusnode'], + 'spacer' => $spacer, + 'subMenuState' => '', + 'level' => $level, + 'isPrivate' => 0, + 'roles' => ($row['roles'] ? $row['roles'] : '') + ); + + $ph = $data; + $ph['nodetitle_esc'] = addslashes($nodetitle); + $ph['indent'] = $indent + 1; + $ph['expandAll'] = $expandAll; + $ph['isPrivate'] = ($row['privateweb'] || $row['privatemgr']) ? 1 : 0; + + if (!$row['isfolder']) { + $tpl = getTplSingleNode(); + switch ($row['id']) { + case $modx->config['site_start'] : + $icon = $_style['tree_page_home']; + break; + case $modx->config['error_page'] : + $icon = $_style['tree_page_404']; + break; + case $modx->config['site_unavailable_page'] : + $icon = $_style['tree_page_hourglass']; + break; + case $modx->config['unauthorized_page'] : + $icon = $_style['tree_page_info']; + break; + default: + if (isset($icons[$row['contentType']])) { + $icon = $icons[$row['contentType']]; + } else { + $icon = $_style['tree_page']; + } + } + $ph['icon'] = $icon; + + // invoke OnManagerNodePrerender event + $prenode = $modx->invokeEvent("OnManagerNodePrerender", array('ph' => $ph)); + if (is_array($prenode)) { + $phnew = array(); + foreach ($prenode as $pnode) { + $phnew = array_merge($phnew, unserialize($pnode)); + } + $ph = (count($phnew) > 0) ? $phnew : $ph; + } + + if ($ph['contextmenu']) { + $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; + } + + if ($_SESSION['tree_show_only_folders']) { + if ($row['parent'] == 0) { + $node .= $modx->parseText($tpl, $ph); + } else { + $node .= ''; + } + } else { + $node .= $modx->parseText($tpl, $ph); + } + + } else { + $ph['icon_folder_open'] = $_style['tree_folderopen_new']; + $ph['icon_folder_close'] = $_style['tree_folder_new']; + + if ($_SESSION['tree_show_only_folders']) { + $tpl = getTplFolderNodeNotChildren(); + $checkFolders = checkIsFolder($row['id'], 1) ? 1 : 0; // folders + $checkDocs = checkIsFolder($row['id'], 0) ? 1 : 0; // no folders + $ph['tree_page_click'] = 3; + + // expandAll: two type for partial expansion + if ($expandAll == 1 || ($expandAll == 2 && in_array($row['id'], $opened))) { + if ($expandAll == 1) { + $opened2[] = $row['id']; + } + $ph['icon'] = $ph['icon_folder_open']; + $ph['icon_node_toggle'] = $ph['tree_minusnode']; + $ph['node_toggle'] = 1; + $ph['subMenuState'] = ' open'; + + if (($checkDocs && !$checkFolders) || (!$checkDocs && !$checkFolders)) { + $ph['showChildren'] = 1; + $ph['icon_node_toggle'] = ''; + $ph['icon'] = $ph['icon_folder_close']; + } elseif (!$checkDocs && $checkFolders) { + $ph['showChildren'] = 0; + $ph['openFolder'] = 2; + } else { + $ph['openFolder'] = 2; + } + + // invoke OnManagerNodePrerender event + $prenode = $modx->invokeEvent("OnManagerNodePrerender", array( + 'ph' => $ph, + 'opened' => '1' + )); + if (is_array($prenode)) { + $phnew = array(); + foreach ($prenode as $pnode) { + $phnew = array_merge($phnew, unserialize($pnode)); + } + $ph = (count($phnew) > 0) ? $phnew : $ph; + } + + if ($ph['contextmenu']) { + $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; + } + + $node .= $modx->parseText($tpl, $ph); + if ($checkFolders) { + $node .= makeHTML($indent + 1, $row['id'], $expandAll, $hereid); + } + $node .= ''; + } else { + $closed2[] = $row['id']; + $ph['icon'] = $ph['icon_folder_close']; + $ph['icon_node_toggle'] = $ph['tree_plusnode']; + $ph['node_toggle'] = 0; + + if (($checkDocs && !$checkFolders) || (!$checkDocs && !$checkFolders)) { + $ph['showChildren'] = 1; + $ph['icon_node_toggle'] = ''; + } elseif (!$checkDocs && $checkFolders) { + $ph['showChildren'] = 0; + $ph['openFolder'] = 2; + } else { + $ph['openFolder'] = 2; + } + + // invoke OnManagerNodePrerender event + $prenode = $modx->invokeEvent("OnManagerNodePrerender", array( + 'ph' => $ph, + 'opened' => '0' + )); + if (is_array($prenode)) { + $phnew = array(); + foreach ($prenode as $pnode) { + $phnew = array_merge($phnew, unserialize($pnode)); + } + $ph = (count($phnew) > 0) ? $phnew : $ph; + } + + if ($ph['contextmenu']) { + $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; + } + + $node .= $modx->parseText($tpl, $ph); + $node .= ''; + } + } else { + $tpl = getTplFolderNode(); + // expandAll: two type for partial expansion + if ($expandAll == 1 || ($expandAll == 2 && in_array($row['id'], $opened))) { + if ($expandAll == 1) { + $opened2[] = $row['id']; + } + $ph['icon'] = $ph['icon_folder_open']; + $ph['icon_node_toggle'] = $ph['tree_minusnode']; + $ph['node_toggle'] = 1; + $ph['subMenuState'] = ' open'; + + if ($ph['donthit'] == 1) { + $ph['tree_page_click'] = 3; + $ph['icon_node_toggle'] = ''; + $ph['icon'] = $ph['icon_folder_close']; + $ph['showChildren'] = 0; + } + + // invoke OnManagerNodePrerender event + $prenode = $modx->invokeEvent("OnManagerNodePrerender", array( + 'ph' => $ph, + 'opened' => '1' + )); + if (is_array($prenode)) { + $phnew = array(); + foreach ($prenode as $pnode) { + $phnew = array_merge($phnew, unserialize($pnode)); + } + $ph = (count($phnew) > 0) ? $phnew : $ph; + if ($ph['showChildren'] == 0) { + unset($opened2[$row['id']]); + $ph['node_toggle'] = 0; + $ph['subMenuState'] = ''; + } + } + + if ($ph['showChildren'] == 0) { + $ph['icon_node_toggle'] = ''; + $ph['donthit'] = 1; + $ph['icon'] = $ph['icon_folder_close']; + $tpl = getTplFolderNodeNotChildren(); + } + + if ($ph['contextmenu']) { + $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; + } + + $node .= $modx->parseText($tpl, $ph); + if ($ph['donthit'] == 0) { + $node .= makeHTML($indent + 1, $row['id'], $expandAll, $hereid); + } + $node .= ''; + } else { + $closed2[] = $row['id']; + $ph['icon'] = $ph['icon_folder_close']; + $ph['icon_node_toggle'] = $ph['tree_plusnode']; + $ph['node_toggle'] = 0; + + if ($ph['donthit'] == 1) { + $ph['tree_page_click'] = 3; + $ph['icon_node_toggle'] = ''; + $ph['icon'] = $ph['icon_folder_close']; + $ph['showChildren'] = 0; + } + + // invoke OnManagerNodePrerender event + $prenode = $modx->invokeEvent("OnManagerNodePrerender", array( + 'ph' => $ph, + 'opened' => '0' + )); + if (is_array($prenode)) { + $phnew = array(); + foreach ($prenode as $pnode) { + $phnew = array_merge($phnew, unserialize($pnode)); + } + $ph = (count($phnew) > 0) ? $phnew : $ph; + } + + if ($ph['showChildren'] == 0) { + $ph['icon_node_toggle'] = ''; + $ph['donthit'] = 1; + $ph['icon'] = $ph['icon_folder_close']; + $tpl = getTplFolderNodeNotChildren(); + } + + if ($ph['contextmenu']) { + $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; + } + + $node .= $modx->parseText($tpl, $ph); + $node .= ''; + } + } + } + + // invoke OnManagerNodeRender event + $data['node'] = $node; + $evtOut = $modx->invokeEvent('OnManagerNodeRender', $data); + if (is_array($evtOut)) { + $evtOut = implode("\n", $evtOut); + } + if ($evtOut != '') { + $node = trim($evtOut); + } + + $output .= $node; + } + + return $output; } -function getIconInfo($_style) { - if(!isset($_style['tree_page_gif'])) { - $_style['tree_page_gif'] = $_style['tree_page']; - } - if(!isset($_style['tree_page_jpg'])) { - $_style['tree_page_jpg'] = $_style['tree_page']; - } - if(!isset($_style['tree_page_png'])) { - $_style['tree_page_png'] = $_style['tree_page']; - } - $icons = array( - 'text/html' => $_style['tree_page_html'], - 'text/plain' => $_style['tree_page'], - 'text/xml' => $_style['tree_page_xml'], - 'text/css' => $_style['tree_page_css'], - 'text/javascript' => $_style['tree_page_js'], - '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'], - 'image/gif' => $_style['tree_page_gif'], - 'image/jpg' => $_style['tree_page_jpg'], - 'image/png' => $_style['tree_page_png'] - ); - return $icons; -} - -function getPrivateIconInfo($_style) { - if(!isset($_style['tree_page_gif_secure'])) { - $_style['tree_page_gif_secure'] = $_style['tree_page_secure']; - } - if(!isset($_style['tree_page_jpg_secure'])) { - $_style['tree_page_jpg_secure'] = $_style['tree_page_secure']; - } - if(!isset($_style['tree_page_png_secure'])) { - $_style['tree_page_png_secure'] = $_style['tree_page_secure']; - } - $iconsPrivate = array( - 'text/html' => $_style['tree_page_html_secure'], - 'text/plain' => $_style['tree_page_secure'], - 'text/xml' => $_style['tree_page_xml_secure'], - 'text/css' => $_style['tree_page_css_secure'], - 'text/javascript' => $_style['tree_page_js_secure'], - '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'], - 'image/gif' => $_style['tree_page_gif_secure'], - 'image/jpg' => $_style['tree_page_jpg_secure'], - 'image/png' => $_style['tree_page_png_secure'] - ); - return $iconsPrivate; +/** + * @param array $_style + * @return array + */ +function getIconInfo($_style) +{ + if (!isset($_style['tree_page_gif'])) { + $_style['tree_page_gif'] = $_style['tree_page']; + } + if (!isset($_style['tree_page_jpg'])) { + $_style['tree_page_jpg'] = $_style['tree_page']; + } + if (!isset($_style['tree_page_png'])) { + $_style['tree_page_png'] = $_style['tree_page']; + } + + return array( + 'text/html' => $_style['tree_page_html'], + 'text/plain' => $_style['tree_page'], + 'text/xml' => $_style['tree_page_xml'], + 'text/css' => $_style['tree_page_css'], + 'text/javascript' => $_style['tree_page_js'], + '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'], + 'image/gif' => $_style['tree_page_gif'], + 'image/jpg' => $_style['tree_page_jpg'], + 'image/png' => $_style['tree_page_png'] + ); } -function getNodeTitle($nodeNameSource, $row) { - global $modx; - - switch($nodeNameSource) { - case 'menutitle': - $nodetitle = $row['menutitle'] ? $row['menutitle'] : $row['pagetitle']; - break; - case 'alias': - $nodetitle = $row['alias'] ? $row['alias'] : $row['id']; - if(strpos($row['alias'], '.') === false) { - if($row['isfolder'] != 1 || $modx->config['make_folders'] != 1) { - $nodetitle .= $modx->config['friendly_url_suffix']; - } - } - $nodetitle = $modx->config['friendly_url_prefix'] . $nodetitle; - break; - case 'pagetitle': - $nodetitle = $row['pagetitle']; - break; - case 'longtitle': - $nodetitle = $row['longtitle'] ? $row['longtitle'] : $row['pagetitle']; - break; - case 'createdon': - case 'editedon': - case 'publishedon': - case 'pub_date': - case 'unpub_date': - $doc = $modx->getDocumentObject('id', $row['id']); - $date = $doc[$nodeNameSource]; - if(!empty($date)) { - $nodetitle = $modx->toDateFormat($date); - } else { - $nodetitle = '- - -'; - } - break; - default: - $nodetitle = $row['pagetitle']; - } - $nodetitle = $modx->htmlspecialchars(str_replace(array( - "\r\n", - "\n", - "\r" - ), ' ', $nodetitle), ENT_COMPAT); - return $nodetitle; +/** + * @param string $nodeNameSource + * @param array $row + * @return string + */ +function getNodeTitle($nodeNameSource, $row) +{ + global $modx; + + switch ($nodeNameSource) { + case 'menutitle': + $nodetitle = $row['menutitle'] ? $row['menutitle'] : $row['pagetitle']; + break; + case 'alias': + $nodetitle = $row['alias'] ? $row['alias'] : $row['id']; + if (strpos($row['alias'], '.') === false) { + if ($row['isfolder'] != 1 || $modx->config['make_folders'] != 1) { + $nodetitle .= $modx->config['friendly_url_suffix']; + } + } + $nodetitle = $modx->config['friendly_url_prefix'] . $nodetitle; + break; + case 'pagetitle': + $nodetitle = $row['pagetitle']; + break; + case 'longtitle': + $nodetitle = $row['longtitle'] ? $row['longtitle'] : $row['pagetitle']; + break; + case 'createdon': + case 'editedon': + case 'publishedon': + case 'pub_date': + case 'unpub_date': + $doc = $modx->getDocumentObject('id', $row['id']); + $date = $doc[$nodeNameSource]; + if (!empty($date)) { + $nodetitle = $modx->toDateFormat($date); + } else { + $nodetitle = '- - -'; + } + break; + default: + $nodetitle = $row['pagetitle']; + } + $nodetitle = $modx->htmlspecialchars(str_replace(array( + "\r\n", + "\n", + "\r" + ), ' ', $nodetitle), ENT_COMPAT); + + return $nodetitle; } -function isDateNode($nodeNameSource) { - switch($nodeNameSource) { - case 'createdon': - case 'editedon': - case 'publishedon': - case 'pub_date': - case 'unpub_date': - return true; - default: - return false; - } +/** + * @param string $nodeNameSource + * @return bool + */ +function isDateNode($nodeNameSource) +{ + switch ($nodeNameSource) { + case 'createdon': + case 'editedon': + case 'publishedon': + case 'pub_date': + case 'unpub_date': + return true; + default: + return false; + } } -function checkIsFolder($parent = 0, $isfolder = 1) { - global $modx; +/** + * @param int $parent + * @param int $isfolder + * @return int + */ +function checkIsFolder($parent = 0, $isfolder = 1) +{ + global $modx; - return (int) $modx->db->getValue($modx->db->query('SELECT count(*) FROM ' . $modx->getFullTableName('site_content') . ' WHERE parent=' . $parent . ' AND isfolder=' . $isfolder . ' ')); + return (int)$modx->db->getValue($modx->db->query('SELECT count(*) FROM ' . $modx->getFullTableName('site_content') . ' WHERE parent=' . $parent . ' AND isfolder=' . $isfolder . ' ')); } -function _htmlentities($array) { - global $modx; +/** + * @param mixed $array + * @return string + */ +function _htmlentities($array) +{ + global $modx; - $array = json_encode($array, JSON_UNESCAPED_UNICODE); - $array = htmlentities($array, ENT_COMPAT, $modx->config['modx_charset']); + $array = json_encode($array, JSON_UNESCAPED_UNICODE); + $array = htmlentities($array, ENT_COMPAT, $modx->config['modx_charset']); - return $array; + return $array; } -function getTplSingleNode() { - return ''; } -function getTplFolderNode() { - return '
    [+nodetitleDisplay+][+weblinkDisplay+][+pageIdDisplay+]
    '; } -function getTplFolderNodeNotChildren() { - return '
    [+nodetitleDisplay+][+weblinkDisplay+][+pageIdDisplay+]
    '; } - -function dbug($str, $flag = false) { - print('
    ');
    -	print_r($str);
    -	print('
    '); - if($flag) { - exit; - } -} diff --git a/manager/frames/nodes.php b/manager/frames/nodes.php index 2caa04b740..c66fc3fb95 100644 --- a/manager/frames/nodes.php +++ b/manager/frames/nodes.php @@ -4,7 +4,7 @@ * Build and return document tree view nodes * */ -if (IN_MANAGER_MODE != 'true') { +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { die('INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly.'); } @@ -18,11 +18,10 @@ exit('send some data'); } //?? -$indent = intval($_REQUEST['indent']); -$parent = intval($_REQUEST['parent']); -$expandAll = intval($_REQUEST['expandAll']); +$indent = (int)$_REQUEST['indent']; +$parent = (int)$_REQUEST['parent']; +$expandAll = (int)$_REQUEST['expandAll']; $output = ''; -$theme = $manager_theme . "/"; $hereid = isset($_REQUEST['id']) && is_numeric($_REQUEST['id']) ? $_REQUEST['id'] : ''; if (isset($_REQUEST['showonlyfolders'])) { @@ -44,7 +43,6 @@ // icons by content type $icons = getIconInfo($_style); -$iconsPrivate = getPrivateIconInfo($_style); if (isset($_SESSION['openedArray'])) { $opened = array_filter(array_map('intval', explode('|', $_SESSION['openedArray']))); @@ -55,8 +53,8 @@ $opened2 = array(); $closed2 = array(); -//makeHTML($indent, $parent, $expandAll, $theme, $hereid); -echo makeHTML($indent, $parent, $expandAll, $theme, $hereid); +//makeHTML($indent, $parent, $expandAll, $hereid); +echo makeHTML($indent, $parent, $expandAll, $hereid); // check for deleted documents on reload if ($expandAll == 2) { diff --git a/manager/frames/tree.php b/manager/frames/tree.php index 05fb3dbb5c..7520ba7796 100644 --- a/manager/frames/tree.php +++ b/manager/frames/tree.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } diff --git a/manager/includes/actionlist.inc.php b/manager/includes/actionlist.inc.php old mode 100755 new mode 100644 index 798d044581..7bcc98a5c5 --- a/manager/includes/actionlist.inc.php +++ b/manager/includes/actionlist.inc.php @@ -1,5 +1,7 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +} // action list $GLOBALS['action_list'] = array( @@ -118,7 +120,7 @@ '116' => 'Delete event log', '117' => 'Editing tv rank', '118' => 'Call settings ajax include', - '119' => 'Login Fail (Temporary Block)', + '119' => 'Login Fail (Temporary Block)', '300' => 'Create Template Variable', '301' => 'Edit Template Variable', @@ -132,6 +134,11 @@ '999' => 'Viewing test page', ); +/** + * @param string $actionId + * @param string $itemid + * @return string + */ function getAction($actionId, $itemid='') { global $action_list; diff --git a/manager/includes/active_user_locks.inc.php b/manager/includes/active_user_locks.inc.php index dbd3c556dc..3ff7f1861e 100644 --- a/manager/includes/active_user_locks.inc.php +++ b/manager/includes/active_user_locks.inc.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -$lockElementId = intval($lockElementId); +$lockElementId = (int)$lockElementId; if ($lockElementId > 0) { ?> @@ -32,4 +32,4 @@ function unlockThisElement() \ No newline at end of file +?> diff --git a/manager/includes/active_user_locks.php b/manager/includes/active_user_locks.php index 9f8fd7e50c..64b82e1af6 100644 --- a/manager/includes/active_user_locks.php +++ b/manager/includes/active_user_locks.php @@ -12,14 +12,10 @@ $modx->invokeEvent('OnManagerPageInit'); $ok = false; -if($modx->elementIsLocked($_GET['type'], $_GET['id'], true)) { - $modx->lockElement($_GET['type'], $_GET['id'], true); +if ($modx->elementIsLocked($_GET['type'], $_GET['id'], true)) { + $modx->lockElement($_GET['type'], $_GET['id']); $ok = true; } header('Content-type: application/json'); -if($ok) { - echo '{status:"ok"}'; -} else { - echo '{status:"null"}'; -} +echo $ok ? '{status:"ok"}' : '{status:"null"}'; diff --git a/manager/includes/categories.inc.php b/manager/includes/categories.inc.php index 6376fee018..7db7d3f015 100644 --- a/manager/includes/categories.inc.php +++ b/manager/includes/categories.inc.php @@ -2,58 +2,101 @@ //Helper functions for categories //Kyle Jaebker - 08/07/06 -//Create a new category -function newCategory($newCat) { +/** + * Create a new category + * @param string $newCat + * @return int + */ +function newCategory($newCat) +{ global $modx; $useTable = $modx->getFullTableName('categories'); $categoryId = $modx->db->insert( array( 'category' => $modx->db->escape($newCat), ), $useTable); - if (!$categoryId) $categoryId = 0; + if (!$categoryId) { + $categoryId = 0; + } + return $categoryId; } -//check if new category already exists -function checkCategory($newCat = '') { + +/** + * check if new category already exists + * + * @param string $newCat + * @return int + */ +function checkCategory($newCat = '') +{ global $modx; - $useTable = $modx->getFullTableName('categories'); $newCat = $modx->db->escape($newCat); $cats = $modx->db->select('id', $modx->getFullTableName('categories'), "category='{$newCat}'"); - if($cat = $modx->db->getValue($cats)) { - return $cat; - } + if ($cat = $modx->db->getValue($cats)) { + return (int)$cat; + } + return 0; } -//Check for category, create new if not exists -function getCategory($category='') { + +/** + * Check for category, create new if not exists + * + * @param string $category + * @return int + */ +function getCategory($category = '') +{ $categoryId = checkCategory($category); - if(!$categoryId) $categoryId = newCategory($category); + if (!$categoryId) { + $categoryId = newCategory($category); + } + return $categoryId; } -//Get all categories -function getCategories() { + +/** + * Get all categories + * + * @return array + */ +function getCategories() +{ global $modx; $useTable = $modx->getFullTableName('categories'); $cats = $modx->db->select('id, category', $modx->getFullTableName('categories'), '', 'category'); - $resourceArray = array(); - while($row = $modx->db->getRow($cats)) { + $resourceArray = array(); + while ($row = $modx->db->getRow($cats)) { $row['category'] = stripslashes($row['category']); $resourceArray[] = $row; } + return $resourceArray; } -//Delete category & associations -function deleteCategory($catId=0) { + +/** + * Delete category & associations + * + * @param int $catId + */ +function deleteCategory($catId = 0) +{ global $modx; if ($catId) { - $resetTables = array('site_plugins', 'site_snippets', 'site_htmlsnippets', 'site_templates', 'site_tmplvars', 'site_modules'); - foreach ($resetTables as $n=>$v) { + $resetTables = array( + 'site_plugins', + 'site_snippets', + 'site_htmlsnippets', + 'site_templates', + 'site_tmplvars', + 'site_modules' + ); + foreach ($resetTables as $n => $v) { $useTable = $modx->getFullTableName($v); - $modx->db->update(array('category'=>0), $useTable, "category='{$catId}'"); + $modx->db->update(array('category' => 0), $useTable, "category='{$catId}'"); } $catTable = $modx->getFullTableName('categories'); $modx->db->delete($catTable, "id='{$catId}'"); } } - -?> \ No newline at end of file diff --git a/manager/includes/charsets.php b/manager/includes/charsets.php old mode 100755 new mode 100644 index 9dd77bc935..6596c5d90f --- a/manager/includes/charsets.php +++ b/manager/includes/charsets.php @@ -87,4 +87,4 @@ $selected = $value===$modx_charset ? 'selected' : ''; $options[] = sprintf($tpl, $value, $selected, $label); } -echo join("\n", $options); +echo implode("\n", $options); diff --git a/manager/includes/config_check.inc.php b/manager/includes/config_check.inc.php old mode 100755 new mode 100644 index 11867abe5a..9d8fdd5bd5 --- a/manager/includes/config_check.inc.php +++ b/manager/includes/config_check.inc.php @@ -1,5 +1,7 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +} // PROCESSOR FIRST if($_SESSION['mgrRole'] == 1) { @@ -115,6 +117,9 @@ function disableTemplateSwitcher(){ } if (!function_exists('checkSiteCache')) { + /** + * @return bool + */ function checkSiteCache() { global $modx; $checked= true; @@ -177,11 +182,11 @@ function checkSiteCache() { break; case $_lang['configcheck_sysfiles_mod']: $warnings[$i][1] = $_lang["configcheck_sysfiles_mod_msg"]; - $warnings[$i][2] = '
    • '. join('
    • ', $sysfiles_check) .'
    '; + $warnings[$i][2] = '
    • '. implode('
    • ', $sysfiles_check) .'
    '; if($modx->hasPermission('settings')) { $warnings[$i][2] .= ''; } - if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1]." ".join(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']); + if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1]." ".implode(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']); break; case $_lang['configcheck_lang_difference'] : $warnings[$i][1] = $_lang['configcheck_lang_difference_msg']; diff --git a/manager/includes/controls/contextmenu.php b/manager/includes/controls/contextmenu.php index 2d8db57131..6474991306 100644 --- a/manager/includes/controls/contextmenu.php +++ b/manager/includes/controls/contextmenu.php @@ -4,18 +4,30 @@ $ContextMenuCnt = 0; class ContextMenu { - var $id; + public $id; + /** + * @var string + */ + public $html = ''; + /** + * @var bool + */ + public $visible = false; + /** + * @var int + */ + public $width = 120; - function __construct($id = '', $width = 120, $visible = false) { + public function __construct($id = '', $width = 120, $visible = false) { global $ContextMenuCnt; $ContextMenuCnt++; $this->html = ""; $this->visible = $visible ? $visible : false; - $this->width = is_numeric($width) ? intval($width) : 120; + $this->width = is_numeric($width) ? (int)$width : 120; $this->id = $id ? $id : "cntxMnu" . $ContextMenuCnt; // set id } - function addItem($text, $action = "", $img = "", $disabled = 0) { + public function addItem($text, $action = "", $img = "", $disabled = 0) { global $base_url, $_style; if($disabled) { return; @@ -40,13 +52,13 @@ function addItem($text, $action = "", $img = "", $disabled = 0) { $this->html .= $img . ' ' . $text . '
    '; } - function addSeparator() { + public function addSeparator() { $this->html .= "
    "; } - function render() { + public function render() { global $ContextMenuScript; $html = $ContextMenuScript . "
    " . $this->html . "
    "; @@ -54,7 +66,7 @@ function render() { return $html; } - function getClientScriptObject() { + public function getClientScriptObject() { return "getCntxMenu('" . $this->id . "')"; } } diff --git a/manager/includes/controls/datagrid.class.php b/manager/includes/controls/datagrid.class.php old mode 100755 new mode 100644 index 870c2e5b02..781c64be61 --- a/manager/includes/controls/datagrid.class.php +++ b/manager/includes/controls/datagrid.class.php @@ -1,7 +1,7 @@ id = $this->id ? $id : "dg" . $__DataGridCnt; + $this->id = $this->id ? empty($id) : "dg" . $__DataGridCnt; // set datasource $this->ds = $ds; // set pager $this->pageSize = $pageSize; - $this->pageNumber = $pageNumber; // by setting pager to -1 will cause pager to load it's last page number + $this->pageNumber = $pageNumber; // by setting pager to -1 will cause pager to load it's last page number $this->pagerLocation = 'top-right'; } - function setDataSource($ds) { + public function setDataSource($ds) { $this->ds = $ds; } - function render() { + public function render() { global $modx; $columnHeaderStyle = ($this->columnHeaderStyle) ? "style='" . $this->columnHeaderStyle . "'" : ''; $columnHeaderClass = ($this->columnHeaderClass) ? "class='" . $this->columnHeaderClass . "'" : ""; @@ -187,7 +207,7 @@ function render() { // format column values - function RenderRowFnc($n, $row) { + public function RenderRowFnc($n, $row) { if($this->_alt == 0) { $Style = $this->_itemStyle; $Class = $this->_itemClass; @@ -217,7 +237,7 @@ function RenderRowFnc($n, $row) { return $o; } - function formatColumnValue($row, $value, $type, &$align) { + public function formatColumnValue($row, $value, $type, &$align) { if(strpos($type, ":") !== false) { list($type, $type_format) = explode(":", $type, 2); } diff --git a/manager/includes/controls/datasetpager.class.php b/manager/includes/controls/datasetpager.class.php old mode 100755 new mode 100644 index 629764dd2d..45628aef4b --- a/manager/includes/controls/datasetpager.class.php +++ b/manager/includes/controls/datasetpager.class.php @@ -12,22 +12,26 @@ class DataSetPager { - var $ds; // datasource - var $pageSize; - var $pageNumber; - var $rows; - var $pager; - var $id; + public $ds; // datasource + public $pageSize; + public $pageNumber; + public $rows; + public $pager; + public $id; - // normal page - var $pageStyle; - var $pageClass; + // normal page + public $pageStyle; + public $pageClass; // selected page - var $selPageStyle; - var $selPageClass; - - function __construct($id, $ds, $pageSize = 10, $pageNumber = -1) { + public $selPageStyle; + public $selPageClass; + public $renderRowFnc; + public $renderRowFncArgs; + public $renderPagerFnc; + public $renderPagerFncArgs; + + public function __construct($id, $ds, $pageSize = 10, $pageNumber = -1) { global $_PAGE; // use view state object global $__DataSetPagerCnt; @@ -57,35 +61,35 @@ function __construct($id, $ds, $pageSize = 10, $pageNumber = -1) { $this->pager = ''; } - function getRenderedPager() { + public function getRenderedPager() { return $this->pager; } - function getRenderedRows() { + public function getRenderedRows() { return $this->rows; } - function setDataSource($ds) { + public function setDataSource($ds) { $this->ds = $ds; } - function setPageSize($ps) { + public function setPageSize($ps) { $this->pageSize = $ps; } - function setRenderRowFnc($fncName, $args = "") { + public function setRenderRowFnc($fncName, $args = "") { $this->renderRowFnc = &$fncName; $this->renderRowFncArgs = $args; // extra agruments } - function setRenderPagerFnc($fncName, $args = "") { + public function setRenderPagerFnc($fncName, $args = "") { $this->renderPagerFnc = $fncName; $this->renderPagerFncArgs = $args; // extra agruments } - function render() { + public function render() { global $modx, $_PAGE; $isDataset = $modx->db->isResult($this->ds); @@ -94,7 +98,7 @@ function render() { $this->selPageStyle = "font-weight:bold"; } - // get total number of rows + // get total number of rows $tnr = ($isDataset) ? $modx->db->getRecordCount($this->ds) : count($this->ds); // render: no records found @@ -128,6 +132,7 @@ function render() { // render pager : renderPagerFnc($cuurentPage,$pagerNumber,$arguments=""); if($tp > 1) { + $url = ''; $fnc = $this->renderPagerFnc; $args = $this->renderPagerFncArgs; if(!isset($fnc)) { diff --git a/manager/includes/debug.inc.php b/manager/includes/debug.inc.php old mode 100755 new mode 100644 index 676db4295d..9a0192995d --- a/manager/includes/debug.inc.php +++ b/manager/includes/debug.inc.php @@ -1,16 +1,18 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +} // show debug information if(isset($enable_debug) && $enable_debug==true) { ?> - - - - -include_lang('errormsg'); + + $this->errors = array( + 0 => $_lang["No errors occured."], + 1 => $_lang["An error occured!"], + 2 => $_lang["Document's ID not passed in request!"], + 3 => $_lang["You don't have enough privileges for this action!"], + 4 => $_lang["ID passed in request is NaN!"], + 5 => $_lang["The document is locked!"], + 6 => $_lang["Too many results returned from database!"], + 7 => $_lang["Not enough/ no results returned from database!"], + 8 => $_lang["Couldn't find parent document's name!"], + 9 => $_lang["Logging error!"], + 10 => $_lang["Table to optimise not found in request!"], + 11 => $_lang["No settings found in request!"], + 12 => $_lang["The document must have a title!"], + 13 => $_lang["No user selected as recipient of this message!"], + 14 => $_lang["No group selected as recipient of this message!"], + 15 => $_lang["The document was not found!"], + + 100 => $_lang["Double action (GET & POST) posted!"], + 600 => $_lang["Document cannot be it's own parent!"], + 601 => $_lang["Document's ID not passed in request!"], + 602 => $_lang["New parent not set in request!"], + 900 => $_lang["don't know the user!"], // don't know the user! + 901 => $_lang["wrong password!"], // wrong password! + 902 => $_lang["Due to too many failed logins, you have been blocked!"], + 903 => $_lang["You are blocked and cannot log in!"], + 904 => $_lang["You are blocked and cannot log in! Please try again later."], + 905 => $_lang["The security code you entered didn't validate! Please try to login again!"] + ); + } + + /** + * @param string $context + * @return array + */ + public function include_lang($context = 'common') + { + global $modx; + $_lang = array(); + + $context = trim($context, '/'); + if (strpos($context, '..') !== false) { + return $_lang; + } + + if ($context === 'common') { + $lang_path = MODX_MANAGER_PATH . 'includes/lang/'; + } else { + $lang_path = MODX_MANAGER_PATH . "includes/lang/{$context}/"; + } + include_once($lang_path . 'english.inc.php'); + $manager_language = $modx->config['manager_language']; + if (is_file("{$lang_path}{$manager_language}.inc.php")) { + include_once("{$lang_path}{$manager_language}.inc.php"); + } + + return is_array($_lang) ? $_lang : array(); + } + + /** + * @param int $errorcode + * @param string $custommessage + */ + public function setError($errorcode, $custommessage = "") + { + $this->errorcode = $errorcode; + $this->errormessage = $this->errors[$errorcode]; + if ($custommessage != "") { + $this->errormessage = $custommessage; + } + } + + /** + * @return int + */ + public function getError() + { + return $this->errorcode; + } + + /** + * @return void + */ + public function dumpError() + { + ?> + + + MODX :: Error + + + + + + + \ No newline at end of file diff --git a/manager/includes/extenders/dbapi.mysql.class.inc.php b/manager/includes/extenders/dbapi.mysql.class.inc.php index fe1c4ded29..c69339cffd 100644 --- a/manager/includes/extenders/dbapi.mysql.class.inc.php +++ b/manager/includes/extenders/dbapi.mysql.class.inc.php @@ -5,190 +5,219 @@ * */ -class DBAPI { - - var $conn; - var $config; - var $lastQuery; - var $isConnected; - - /** - * @name: DBAPI - * - */ - function __construct($host='',$dbase='', $uid='',$pwd='',$pre=NULL,$charset='',$connection_method='SET CHARACTER SET') { - $this->config['host'] = $host ? $host : $GLOBALS['database_server']; - $this->config['dbase'] = $dbase ? $dbase : $GLOBALS['dbase']; - $this->config['user'] = $uid ? $uid : $GLOBALS['database_user']; - $this->config['pass'] = $pwd ? $pwd : $GLOBALS['database_password']; - $this->config['charset'] = $charset ? $charset : $GLOBALS['database_connection_charset']; - $this->config['connection_method'] = $this->_dbconnectionmethod = (isset($GLOBALS['database_connection_method']) ? $GLOBALS['database_connection_method'] : $connection_method); - $this->config['table_prefix'] = ($pre !== NULL) ? $pre : $GLOBALS['table_prefix']; - $this->initDataTypes(); - } - - /** - * @name: initDataTypes - * @desc: called in the constructor to set up arrays containing the types - * of database fields that can be used with specific PHP types - */ - function initDataTypes() { - $this->dataTypes['numeric'] = array ( - 'INT', - 'INTEGER', - 'TINYINT', - 'BOOLEAN', - 'DECIMAL', - 'DEC', - 'NUMERIC', - 'FLOAT', - 'DOUBLE PRECISION', - 'REAL', - 'SMALLINT', - 'MEDIUMINT', - 'BIGINT', - 'BIT' - ); - $this->dataTypes['string'] = array ( - 'CHAR', - 'VARCHAR', - 'BINARY', - 'VARBINARY', - 'TINYBLOB', - 'BLOB', - 'MEDIUMBLOB', - 'LONGBLOB', - 'TINYTEXT', - 'TEXT', - 'MEDIUMTEXT', - 'LONGTEXT', - 'ENUM', - 'SET' - ); - $this->dataTypes['date'] = array ( - 'DATE', - 'DATETIME', - 'TIMESTAMP', - 'TIME', - 'YEAR' - ); - } - - /** - * @name: connect - * - */ - function connect($host = '', $dbase = '', $uid = '', $pwd = '', $persist = 0) { - global $modx; - $uid = $uid ? $uid : $this->config['user']; - $pwd = $pwd ? $pwd : $this->config['pass']; - $host = $host ? $host : $this->config['host']; - $dbase = $dbase ? $dbase : $this->config['dbase']; - $charset = $this->config['charset']; - $connection_method = $this->config['connection_method']; - $tstart = $modx->getMicroTime(); - $safe_count = 0; - while(!$this->conn && $safe_count<3) - { - if($persist!=0) $this->conn = mysql_pconnect($host, $uid, $pwd); - else $this->conn = mysql_connect($host, $uid, $pwd, true); - - if(!$this->conn) - { - if(isset($modx->config['send_errormail']) && $modx->config['send_errormail'] !== '0') - { - if($modx->config['send_errormail'] <= 2) - { - $logtitle = 'Failed to create the database connection!'; - $request_uri = $modx->htmlspecialchars($_SERVER['REQUEST_URI']); - $ua = $modx->htmlspecialchars($_SERVER['HTTP_USER_AGENT']); - $referer = $modx->htmlspecialchars($_SERVER['HTTP_REFERER']); - - $modx->sendmail(array( - 'subject' => 'Missing to create the database connection! from ' . $modx->config['site_name'], - 'body' => "{$logtitle}\n{$request_uri}\n{$ua}\n{$referer}", - 'type' => 'text') - ); - } +class DBAPI +{ + + public $conn; + public $config; + public $lastQuery; + public $isConnected; + public $_dbconnectionmethod; + /** + * @var array + */ + public $dataTypes = array(); + + /** + * @name: DBAPI + * + */ + public function __construct( + $host = '', + $dbase = '', + $uid = '', + $pwd = '', + $pre = null, + $charset = '', + $connection_method = 'SET CHARACTER SET' + ) { + $this->config['host'] = $host ? $host : $GLOBALS['database_server']; + $this->config['dbase'] = $dbase ? $dbase : $GLOBALS['dbase']; + $this->config['user'] = $uid ? $uid : $GLOBALS['database_user']; + $this->config['pass'] = $pwd ? $pwd : $GLOBALS['database_password']; + $this->config['charset'] = $charset ? $charset : $GLOBALS['database_connection_charset']; + $this->config['connection_method'] = $this->_dbconnectionmethod = (isset($GLOBALS['database_connection_method']) ? $GLOBALS['database_connection_method'] : $connection_method); + $this->config['table_prefix'] = ($pre !== null) ? $pre : $GLOBALS['table_prefix']; + $this->initDataTypes(); + } + + /** + * @name: initDataTypes + * @desc: called in the constructor to set up arrays containing the types + * of database fields that can be used with specific PHP types + */ + public function initDataTypes() + { + $this->dataTypes['numeric'] = array( + 'INT', + 'INTEGER', + 'TINYINT', + 'BOOLEAN', + 'DECIMAL', + 'DEC', + 'NUMERIC', + 'FLOAT', + 'DOUBLE PRECISION', + 'REAL', + 'SMALLINT', + 'MEDIUMINT', + 'BIGINT', + 'BIT' + ); + $this->dataTypes['string'] = array( + 'CHAR', + 'VARCHAR', + 'BINARY', + 'VARBINARY', + 'TINYBLOB', + 'BLOB', + 'MEDIUMBLOB', + 'LONGBLOB', + 'TINYTEXT', + 'TEXT', + 'MEDIUMTEXT', + 'LONGTEXT', + 'ENUM', + 'SET' + ); + $this->dataTypes['date'] = array( + 'DATE', + 'DATETIME', + 'TIMESTAMP', + 'TIME', + 'YEAR' + ); + } + + /** + * @name: connect + * + */ + public function connect($host = '', $dbase = '', $uid = '', $pwd = '', $persist = 0) + { + global $modx; + $uid = $uid ? $uid : $this->config['user']; + $pwd = $pwd ? $pwd : $this->config['pass']; + $host = $host ? $host : $this->config['host']; + $dbase = $dbase ? $dbase : $this->config['dbase']; + $charset = $this->config['charset']; + $connection_method = $this->config['connection_method']; + $tstart = $modx->getMicroTime(); + $safe_count = 0; + while (!$this->conn && $safe_count < 3) { + if ($persist != 0) { + $this->conn = mysql_pconnect($host, $uid, $pwd); + } else { + $this->conn = mysql_connect($host, $uid, $pwd, true); + } + + if (!$this->conn) { + if (isset($modx->config['send_errormail']) && $modx->config['send_errormail'] !== '0') { + if ($modx->config['send_errormail'] <= 2) { + $logtitle = 'Failed to create the database connection!'; + $request_uri = $modx->htmlspecialchars($_SERVER['REQUEST_URI']); + $ua = $modx->htmlspecialchars($_SERVER['HTTP_USER_AGENT']); + $referer = $modx->htmlspecialchars($_SERVER['HTTP_REFERER']); + + $modx->sendmail(array( + 'subject' => 'Missing to create the database connection! from ' . $modx->config['site_name'], + 'body' => "{$logtitle}\n{$request_uri}\n{$ua}\n{$referer}", + 'type' => 'text' + ) + ); + } + } + sleep(1); + $safe_count++; } - sleep(1); - $safe_count++; - } - } - if (!$this->conn) { - $modx->messageQuit("Failed to create the database connection!"); - exit; - } else { - $dbase = trim($dbase,'`'); // remove the `` chars - if (!@ mysql_select_db($dbase, $this->conn)) { - $modx->messageQuit("Failed to select the database '" . $dbase . "'!"); + } + if (!$this->conn) { + $modx->messageQuit("Failed to create the database connection!"); exit; - } - @mysql_query("{$connection_method} {$charset}", $this->conn); - $tend = $modx->getMicroTime(); - $totaltime = $tend - $tstart; - if ($modx->dumpSQL) { - $modx->queryCode .= "
    Database connection" . sprintf("Database connection was created in %2.4f s", $totaltime) . "

    "; - } + } else { + $dbase = trim($dbase, '`'); // remove the `` chars + if (!@ mysql_select_db($dbase, $this->conn)) { + $modx->messageQuit("Failed to select the database '" . $dbase . "'!"); + exit; + } + @mysql_query("{$connection_method} {$charset}", $this->conn); + $tend = $modx->getMicroTime(); + $totaltime = $tend - $tstart; + if ($modx->dumpSQL) { + $modx->queryCode .= "
    Database connection" . sprintf("Database connection was created in %2.4f s", + $totaltime) . "

    "; + } if (function_exists('mysql_set_charset')) { mysql_set_charset($this->config['charset']); } else { @mysql_query("SET NAMES {$this->config['charset']}", $this->conn); } - $this->isConnected = true; - // FIXME (Fixed by line below): - // this->queryTime = this->queryTime + $totaltime; - $modx->queryTime += $totaltime; - } - } - - /** - * @name: disconnect - * - */ - function disconnect() { - @ mysql_close($this->conn); - $this->conn = null; - $this->isConnected = false; - } - - function escape($s, $safecount=0) { - - $safecount++; - if(1000<$safecount) exit("Too many loops '{$safecount}'"); - - if (empty ($this->conn) || !is_resource($this->conn)) { - $this->connect(); - } - - if(is_array($s)) { - if(count($s) === 0) $s = ''; - else { - foreach($s as $i=>$v) { - $s[$i] = $this->escape($v,$safecount); - } - } - } - else $s = mysql_real_escape_string($s, $this->conn); - return $s; - } - - /** - * @name: query - * @desc: Mainly for internal use. - * Developers should use select, update, insert, delete where possible - */ - function query($sql,$watchError=true) { - global $modx; - if (empty ($this->conn) || !is_resource($this->conn)) { - $this->connect(); - } - $tstart = $modx->getMicroTime(); - if(is_array($sql)) $sql = join("\n", $sql); - $this->lastQuery = $sql; - if (!$result = @ mysql_query($sql, $this->conn)) { - if(!$watchError) return; - switch(mysql_errno()) { + $this->isConnected = true; + // FIXME (Fixed by line below): + // this->queryTime = this->queryTime + $totaltime; + $modx->queryTime += $totaltime; + } + } + + /** + * @name: disconnect + * + */ + public function disconnect() + { + @ mysql_close($this->conn); + $this->conn = null; + $this->isConnected = false; + } + + public function escape($s, $safecount = 0) + { + + $safecount++; + if (1000 < $safecount) { + exit("Too many loops '{$safecount}'"); + } + + if (empty ($this->conn) || !is_resource($this->conn)) { + $this->connect(); + } + + if (is_array($s)) { + if (count($s) === 0) { + $s = ''; + } else { + foreach ($s as $i => $v) { + $s[$i] = $this->escape($v, $safecount); + } + } + } else { + $s = mysql_real_escape_string($s, $this->conn); + } + + return $s; + } + + /** + * @name: query + * @desc: Mainly for internal use. + * Developers should use select, update, insert, delete where possible + */ + public function query($sql, $watchError = true) + { + global $modx; + if (empty ($this->conn) || !is_resource($this->conn)) { + $this->connect(); + } + $tstart = $modx->getMicroTime(); + if (is_array($sql)) { + $sql = implode("\n", $sql); + } + $this->lastQuery = $sql; + if (!$result = @ mysql_query($sql, $this->conn)) { + if (!$watchError) { + return; + } + switch (mysql_errno()) { case 1054: case 1060: case 1061: @@ -198,444 +227,548 @@ function query($sql,$watchError=true) { default: $modx->messageQuit('Execution of a query to the database failed - ' . $this->getLastError(), $sql); } - } else { - $tend = $modx->getMicroTime(); - $totaltime = $tend - $tstart; - $modx->queryTime = $modx->queryTime + $totaltime; - if ($modx->dumpSQL) { - $debug = debug_backtrace(); - array_shift($debug); - $debug_path = array(); - foreach ($debug as $line) $debug_path[] = $line['function']; - $debug_path = implode(' > ',array_reverse($debug_path)); - $modx->queryCode .= "
    Query " . ($modx->executedQueries + 1) . " - " . sprintf("%2.2f ms", $totaltime*1000) . ""; - $modx->queryCode .= $sql . '

    '; - if ($modx->event->name) $modx->queryCode .= 'Current Event => ' . $modx->event->name . '
    '; - if ($modx->event->activePlugin) $modx->queryCode .= 'Current Plugin => ' . $modx->event->activePlugin . '
    '; - if ($modx->currentSnippet) $modx->queryCode .= 'Current Snippet => ' . $modx->currentSnippet . '
    '; - if (stripos($sql, 'select')===0) $modx->queryCode .= 'Record Count => ' . $this->getRecordCount($result) . '
    '; - else $modx->queryCode .= 'Affected Rows => ' . $this->getAffectedRows() . '
    '; - $modx->queryCode .= 'Functions Path => ' . $debug_path . '
    '; - $modx->queryCode .= "

    "; - } - $modx->executedQueries = $modx->executedQueries + 1; - return $result; - } - } - - /** - * @name: delete - * - */ - function delete($from, $where='', $orderby='', $limit = '') { - global $modx; - if (!$from) - $modx->messageQuit("Empty \$from parameters in DBAPI::delete()."); - else { - $from = $this->replaceFullTableName($from); - $where = trim($where); - $orderby = trim($orderby); - $limit = trim($limit); - if($where!=='' && stripos($where, 'WHERE')!==0) $where = "WHERE {$where}"; - if($orderby!=='' && stripos($orderby, 'ORDER BY')!==0) $orderby = "ORDER BY {$orderby}"; - if($limit!=='' && stripos($limit, 'LIMIT')!==0) $limit = "LIMIT {$limit}"; - return $this->query("DELETE FROM {$from} {$where} {$orderby} {$limit}"); - } - } - - /** - * @name: select - * - */ - function select($fields = "*", $from = "", $where = "", $orderby = "", $limit = "") { - global $modx; - - if(is_array($fields)) $fields = $this->_getFieldsStringFromArray($fields); - if(is_array($from)) $from = $this->_getFromStringFromArray($from); - if(is_array($where)) $where = join(' ', $where); - - if (!$from) { - $modx->messageQuit("Empty \$from parameters in DBAPI::select()."); - exit; - } - - $fields = $this->replaceFullTableName($fields); - $from = $this->replaceFullTableName($from); - $where = trim($where); - $orderby = trim($orderby); - $limit = trim($limit); - if($where!=='' && stripos($where,'WHERE')!==0) $where = "WHERE {$where}"; - if($orderby!=='' && stripos($orderby,'ORDER')!==0) $orderby = "ORDER BY {$orderby}"; - if($limit!=='' && stripos($limit,'LIMIT')!==0) $limit = "LIMIT {$limit}"; - return $this->query("SELECT {$fields} FROM {$from} {$where} {$orderby} {$limit}"); - } - - /** - * @name: update - * - */ - function update($fields, $table, $where = "") { - global $modx; - if (!$table) - $modx->messageQuit("Empty \$table parameter in DBAPI::update()."); - else { - $table = $this->replaceFullTableName($table); - if (is_array($fields)) { - foreach ($fields as $key => $value) { - if(is_null($value) || strtolower($value) === 'null'){ - $flds = 'NULL'; - }else{ - $flds = "'" . $value . "'"; - } - $fields[$key] = "`{$key}` = ".$flds; - } - $fields = implode(",", $fields); - } - $where = trim($where); - if($where!=='' && stripos($where, 'WHERE')!==0) $where = "WHERE {$where}"; - return $this->query("UPDATE {$table} SET {$fields} {$where}"); - } - } - - /** - * @name: insert - * @desc: returns either last id inserted or the result from the query - */ - function insert($fields, $intotable, $fromfields = "*", $fromtable = "", $where = "", $limit = "") { - global $modx; - if (!$intotable) - $modx->messageQuit("Empty \$intotable parameters in DBAPI::insert()."); - else { - $intotable = $this->replaceFullTableName($intotable); - if (!is_array($fields)) { - $this->query("INSERT INTO {$intotable} {$fields}"); - } else { - if (empty($fromtable)) { - $fields = "(`".implode("`, `", array_keys($fields))."`) VALUES('".implode("', '", array_values($fields))."')"; - $rt = $this->query("INSERT INTO {$intotable} {$fields}"); + } else { + $tend = $modx->getMicroTime(); + $totaltime = $tend - $tstart; + $modx->queryTime = $modx->queryTime + $totaltime; + if ($modx->dumpSQL) { + $debug = debug_backtrace(); + array_shift($debug); + $debug_path = array(); + foreach ($debug as $line) { + $debug_path[] = $line['function']; + } + $debug_path = implode(' > ', array_reverse($debug_path)); + $modx->queryCode .= "
    Query " . ($modx->executedQueries + 1) . " - " . sprintf("%2.2f ms", + $totaltime * 1000) . ""; + $modx->queryCode .= $sql . '

    '; + if ($modx->event->name) { + $modx->queryCode .= 'Current Event => ' . $modx->event->name . '
    '; + } + if ($modx->event->activePlugin) { + $modx->queryCode .= 'Current Plugin => ' . $modx->event->activePlugin . '
    '; + } + if ($modx->currentSnippet) { + $modx->queryCode .= 'Current Snippet => ' . $modx->currentSnippet . '
    '; + } + if (stripos($sql, 'select') === 0) { + $modx->queryCode .= 'Record Count => ' . $this->getRecordCount($result) . '
    '; + } else { + $modx->queryCode .= 'Affected Rows => ' . $this->getAffectedRows() . '
    '; + } + $modx->queryCode .= 'Functions Path => ' . $debug_path . '
    '; + $modx->queryCode .= "

    "; + } + $modx->executedQueries = $modx->executedQueries + 1; + + return $result; + } + } + + /** + * @name: delete + * + */ + public function delete($from, $where = '', $orderby = '', $limit = '') + { + global $modx; + if (!$from) { + $modx->messageQuit("Empty \$from parameters in DBAPI::delete()."); + } else { + $from = $this->replaceFullTableName($from); + $where = trim($where); + $orderby = trim($orderby); + $limit = trim($limit); + if ($where !== '' && stripos($where, 'WHERE') !== 0) { + $where = "WHERE {$where}"; + } + if ($orderby !== '' && stripos($orderby, 'ORDER BY') !== 0) { + $orderby = "ORDER BY {$orderby}"; + } + if ($limit !== '' && stripos($limit, 'LIMIT') !== 0) { + $limit = "LIMIT {$limit}"; + } + + return $this->query("DELETE FROM {$from} {$where} {$orderby} {$limit}"); + } + } + + /** + * @name: select + * + */ + public function select($fields = "*", $from = "", $where = "", $orderby = "", $limit = "") + { + global $modx; + + if (is_array($fields)) { + $fields = $this->_getFieldsStringFromArray($fields); + } + if (is_array($from)) { + $from = $this->_getFromStringFromArray($from); + } + if (is_array($where)) { + $where = implode(' ', $where); + } + + if (!$from) { + $modx->messageQuit("Empty \$from parameters in DBAPI::select()."); + exit; + } + + $fields = $this->replaceFullTableName($fields); + $from = $this->replaceFullTableName($from); + $where = trim($where); + $orderby = trim($orderby); + $limit = trim($limit); + if ($where !== '' && stripos($where, 'WHERE') !== 0) { + $where = "WHERE {$where}"; + } + if ($orderby !== '' && stripos($orderby, 'ORDER') !== 0) { + $orderby = "ORDER BY {$orderby}"; + } + if ($limit !== '' && stripos($limit, 'LIMIT') !== 0) { + $limit = "LIMIT {$limit}"; + } + + return $this->query("SELECT {$fields} FROM {$from} {$where} {$orderby} {$limit}"); + } + + /** + * @name: update + * + */ + public function update($fields, $table, $where = "") + { + global $modx; + if (!$table) { + $modx->messageQuit("Empty \$table parameter in DBAPI::update()."); + } else { + $table = $this->replaceFullTableName($table); + if (is_array($fields)) { + foreach ($fields as $key => $value) { + if (is_null($value) || strtolower($value) === 'null') { + $flds = 'NULL'; + } else { + $flds = "'" . $value . "'"; + } + $fields[$key] = "`{$key}` = " . $flds; + } + $fields = implode(",", $fields); + } + $where = trim($where); + if ($where !== '' && stripos($where, 'WHERE') !== 0) { + $where = "WHERE {$where}"; + } + + return $this->query("UPDATE {$table} SET {$fields} {$where}"); + } + } + + /** + * @name: insert + * @desc: returns either last id inserted or the result from the query + */ + public function insert($fields, $intotable, $fromfields = "*", $fromtable = "", $where = "", $limit = "") + { + global $modx; + if (!$intotable) { + $modx->messageQuit("Empty \$intotable parameters in DBAPI::insert()."); + } else { + $intotable = $this->replaceFullTableName($intotable); + if (!is_array($fields)) { + $this->query("INSERT INTO {$intotable} {$fields}"); } else { - if (version_compare($this->getVersion(),"4.0.14")>=0) { - $fromtable = $this->replaceFullTableName($fromtable); - $fields = "(".implode(",", array_keys($fields)).")"; - $where = trim($where); - $limit = trim($limit); - if($where!=='' && stripos($where, 'WHERE')!==0) $where = "WHERE {$where}"; - if($limit!=='' && stripos($limit, 'LIMIT')!==0) $limit = "LIMIT {$limit}"; - $rt = $this->query("INSERT INTO {$intotable} {$fields} SELECT {$fromfields} FROM {$fromtable} {$where} {$limit}"); - } else { - $ds = $this->select($fromfields, $fromtable, $where, '', $limit); - while ($row = $this->getRow($ds)) { - $fields = "(".implode(",", array_keys($fields)).") VALUES('".implode("', '", $row)."')"; - $rt = $this->query("INSERT INTO {$intotable} {$fields}"); - } - } + if (empty($fromtable)) { + $fields = "(`" . implode("`, `", array_keys($fields)) . "`) VALUES('" . implode("', '", + array_values($fields)) . "')"; + $rt = $this->query("INSERT INTO {$intotable} {$fields}"); + } else { + if (version_compare($this->getVersion(), "4.0.14") >= 0) { + $fromtable = $this->replaceFullTableName($fromtable); + $fields = "(" . implode(",", array_keys($fields)) . ")"; + $where = trim($where); + $limit = trim($limit); + if ($where !== '' && stripos($where, 'WHERE') !== 0) { + $where = "WHERE {$where}"; + } + if ($limit !== '' && stripos($limit, 'LIMIT') !== 0) { + $limit = "LIMIT {$limit}"; + } + $rt = $this->query("INSERT INTO {$intotable} {$fields} SELECT {$fromfields} FROM {$fromtable} {$where} {$limit}"); + } else { + $ds = $this->select($fromfields, $fromtable, $where, '', $limit); + while ($row = $this->getRow($ds)) { + $fields = "(" . implode(",", array_keys($fields)) . ") VALUES('" . implode("', '", + $row) . "')"; + $rt = $this->query("INSERT INTO {$intotable} {$fields}"); + } + } + } + } + if (($lid = $this->getInsertId()) === false) { + $modx->messageQuit("Couldn't get last insert key!"); } - } - if (($lid = $this->getInsertId())===false) $modx->messageQuit("Couldn't get last insert key!"); - return $lid; - } - } - - function save($fields, $table, $where='') { - - if($where === '') $mode = 'insert'; - elseif($this->getRecordCount($this->select('*',$table,$where))==0) $mode = 'insert'; - else $mode = 'update'; - - if($mode==='insert') return $this->insert($fields, $table); - else return $this->update($fields, $table, $where); - } - - /** - * @name: isResult - * - */ - function isResult($rs) { - return is_resource($rs); - } - - /** - * @name: freeResult - * - */ - function freeResult($rs) { - mysql_free_result($rs); - } - - /** - * @name: numFields - * - */ - function numFields($rs) { - return mysql_num_fields($rs); - } - - /** - * @name: fieldName - * - */ - function fieldName($rs,$col=0) { - return mysql_field_name($rs,$col); - } - + + return $lid; + } + } + + public function save($fields, $table, $where = '') + { + + if ($where === '') { + $mode = 'insert'; + } elseif ($this->getRecordCount($this->select('*', $table, $where)) == 0) { + $mode = 'insert'; + } else { + $mode = 'update'; + } + + if ($mode === 'insert') { + return $this->insert($fields, $table); + } else { + return $this->update($fields, $table, $where); + } + } + + /** + * @name: isResult + * + */ + public function isResult($rs) + { + return is_resource($rs); + } + + /** + * @name: freeResult + * + */ + public function freeResult($rs) + { + mysql_free_result($rs); + } + + /** + * @name: numFields + * + */ + public function numFields($rs) + { + return mysql_num_fields($rs); + } + /** - * @name: selectDb - * - */ - function selectDb($name) { - mysql_select_db($name); - } - - - /** - * @name: getInsertId - * - */ - function getInsertId($conn=NULL) { - if( !is_resource($conn)) $conn =& $this->conn; - return mysql_insert_id($conn); - } - - /** - * @name: getAffectedRows - * - */ - function getAffectedRows($conn=NULL) { - if (!is_resource($conn)) $conn =& $this->conn; - return mysql_affected_rows($conn); - } - - /** - * @name: getLastError - * - */ - function getLastError($conn=NULL) { - if (!is_resource($conn)) $conn =& $this->conn; - return mysql_error($conn); - } - - /** - * @name: getRecordCount - * - */ - function getRecordCount($ds) { - return (is_resource($ds)) ? mysql_num_rows($ds) : 0; - } - - /** - * @name: getRow - * @desc: returns an array of column values - * @param: $dsq - dataset - * - */ - function getRow($ds, $mode = 'assoc') { - if (is_resource($ds)) { - if ($mode == 'assoc') { - return mysql_fetch_assoc($ds); - } - elseif ($mode == 'num') { - return mysql_fetch_row($ds); - } - elseif ($mode == 'object') { - return mysql_fetch_object($ds); - } - elseif ($mode == 'both') { - return mysql_fetch_array($ds, MYSQL_BOTH); - } else { - global $modx; - $modx->messageQuit("Unknown get type ($mode) specified for fetchRow - must be empty, 'assoc', 'num' or 'both'."); - } - } - } - - /** - * @name: getColumn - * @desc: returns an array of the values found on colun $name - * @param: $dsq - dataset or query string - */ - function getColumn($name, $dsq) { - if (!is_resource($dsq)) - $dsq = $this->query($dsq); - if ($dsq) { - $col = array (); - while ($row = $this->getRow($dsq)) { - $col[] = $row[$name]; - } - return $col; - } - } - - /** - * @name: getColumnNames - * @desc: returns an array containing the column $name - * @param: $dsq - dataset or query string - */ - function getColumnNames($dsq) { - if (!is_resource($dsq)) - $dsq = $this->query($dsq); - if ($dsq) { - $names = array (); - $limit = mysql_num_fields($dsq); - for ($i = 0; $i < $limit; $i++) { - $names[] = mysql_field_name($dsq, $i); - } - return $names; - } - } - - /** - * @name: getValue - * @desc: returns the value from the first column in the set - * @param: $dsq - dataset or query string - */ - function getValue($dsq) { - if (!is_resource($dsq)) - $dsq = $this->query($dsq); - if ($dsq) { - $r = $this->getRow($dsq, "num"); - return $r[0]; - } - } - - /** - * @name: getTableMetaData - * @desc: returns an array of MySQL structure detail for each column of a - * table - * @param: $table: the full name of the database table - */ - function getTableMetaData($table) { - $metadata = false; - if (!empty ($table)) { - $sql = "SHOW FIELDS FROM $table"; - if ($ds = $this->query($sql)) { - while ($row = $this->getRow($ds)) { - $fieldName = $row['Field']; - $metadata[$fieldName] = $row; + * @name: fieldName + * + */ + public function fieldName($rs, $col = 0) + { + return mysql_field_name($rs, $col); + } + + /** + * @name: selectDb + * + */ + public function selectDb($name) + { + mysql_select_db($name); + } + + + /** + * @name: getInsertId + * + */ + public function getInsertId($conn = null) + { + if (!is_resource($conn)) { + $conn =& $this->conn; + } + + return mysql_insert_id($conn); + } + + /** + * @name: getAffectedRows + * + */ + public function getAffectedRows($conn = null) + { + if (!is_resource($conn)) { + $conn =& $this->conn; + } + + return mysql_affected_rows($conn); + } + + /** + * @name: getLastError + * + */ + public function getLastError($conn = null) + { + if (!is_resource($conn)) { + $conn =& $this->conn; + } + + return mysql_error($conn); + } + + /** + * @name: getRecordCount + * + */ + public function getRecordCount($ds) + { + return (is_resource($ds)) ? mysql_num_rows($ds) : 0; + } + + /** + * @name: getRow + * @desc: returns an array of column values + * @param: $dsq - dataset + * + */ + public function getRow($ds, $mode = 'assoc') + { + if (is_resource($ds)) { + if ($mode == 'assoc') { + return mysql_fetch_assoc($ds); + } elseif ($mode == 'num') { + return mysql_fetch_row($ds); + } elseif ($mode == 'object') { + return mysql_fetch_object($ds); + } elseif ($mode == 'both') { + return mysql_fetch_array($ds, MYSQL_BOTH); + } else { + global $modx; + $modx->messageQuit("Unknown get type ($mode) specified for fetchRow - must be empty, 'assoc', 'num' or 'both'."); } - } - } - return $metadata; - } - - /** - * @name: prepareDate - * @desc: prepares a date in the proper format for specific database types - * given a UNIX timestamp - * @param: $timestamp: a UNIX timestamp - * @param: $fieldType: the type of field to format the date for - * (in MySQL, you have DATE, TIME, YEAR, and DATETIME) - */ - function prepareDate($timestamp, $fieldType = 'DATETIME') { - $date = ''; - if (!$timestamp === false && $timestamp > 0) { - switch ($fieldType) { - case 'DATE' : - $date = date('Y-m-d', $timestamp); - break; - case 'TIME' : - $date = date('H:i:s', $timestamp); - break; - case 'YEAR' : - $date = date('Y', $timestamp); - break; - default : - $date = date('Y-m-d H:i:s', $timestamp); - break; - } - } - return $date; - } - - /** - * @name: makeArray - * @desc: turns a recordset into a multidimensional array - * @return: an array of row arrays from recordset, or empty array - * if the recordset was empty, returns false if no recordset - * was passed - * @param: $rs Recordset to be packaged into an array - */ - function makeArray($rs='',$index=false){ - if (!$rs) return false; - $rsArray = array(); - $iterator = 0; - while ($row = $this->getRow($rs)) { - $returnIndex = $index !== false && isset($row[$index]) ? $row[$index] : $iterator; - $rsArray[$returnIndex] = $row; - $iterator++; - } - return $rsArray; - } - - /** - * @name getVersion - * @desc returns a string containing the database server version - * - * @return string - */ - function getVersion() { - return mysql_get_server_info(); - } - - /** - * @name replaceFullTableName - * @desc Get full table name. Append table name and table prefix. - * - * @param string $str - * @return string - */ - function replaceFullTableName($str,$force=null) { - - $str = trim($str); - $dbase = trim($this->config['dbase'],'`'); - $prefix = $this->config['table_prefix']; - if(!empty($force)) - { - $result = "`{$dbase}`.`{$prefix}{$str}`"; - } - elseif(strpos($str,'[+prefix+]')!==false) - { - $result = preg_replace('@\[\+prefix\+\]([0-9a-zA-Z_]+)@', "`{$dbase}`.`{$prefix}$1`", $str); - } - else $result = $str; - - return $result; - } - - function optimize($table_name) - { - $rs = $this->query("OPTIMIZE TABLE {$table_name}"); - if($rs) $rs = $this->query("ALTER TABLE {$table_name}"); - return $rs; - } - - function truncate($table_name) - { - $rs = $this->query("TRUNCATE {$table_name}"); - return $rs; - } - - function dataSeek($result, $row_number) { - return mysql_data_seek($result, $row_number); - } - - function _getFieldsStringFromArray($fields=array()) { - - if(empty($fields)) return '*'; - + } + } + + /** + * @name: getColumn + * @desc: returns an array of the values found on colun $name + * @param: $dsq - dataset or query string + */ + public function getColumn($name, $dsq) + { + if (!is_resource($dsq)) { + $dsq = $this->query($dsq); + } + if ($dsq) { + $col = array(); + while ($row = $this->getRow($dsq)) { + $col[] = $row[$name]; + } + + return $col; + } + } + + /** + * @name: getColumnNames + * @desc: returns an array containing the column $name + * @param: $dsq - dataset or query string + */ + public function getColumnNames($dsq) + { + if (!is_resource($dsq)) { + $dsq = $this->query($dsq); + } + if ($dsq) { + $names = array(); + $limit = mysql_num_fields($dsq); + for ($i = 0; $i < $limit; $i++) { + $names[] = mysql_field_name($dsq, $i); + } + + return $names; + } + } + + /** + * @name: getValue + * @desc: returns the value from the first column in the set + * @param: $dsq - dataset or query string + */ + public function getValue($dsq) + { + if (!is_resource($dsq)) { + $dsq = $this->query($dsq); + } + if ($dsq) { + $r = $this->getRow($dsq, "num"); + + return $r[0]; + } + } + + /** + * @name: getTableMetaData + * @desc: returns an array of MySQL structure detail for each column of a + * table + * @param: $table: the full name of the database table + */ + public function getTableMetaData($table) + { + $metadata = false; + if (!empty ($table)) { + $sql = "SHOW FIELDS FROM $table"; + if ($ds = $this->query($sql)) { + while ($row = $this->getRow($ds)) { + $fieldName = $row['Field']; + $metadata[$fieldName] = $row; + } + } + } + + return $metadata; + } + + /** + * @name: prepareDate + * @desc: prepares a date in the proper format for specific database types + * given a UNIX timestamp + * @param: $timestamp: a UNIX timestamp + * @param: $fieldType: the type of field to format the date for + * (in MySQL, you have DATE, TIME, YEAR, and DATETIME) + */ + public function prepareDate($timestamp, $fieldType = 'DATETIME') + { + $date = ''; + if (!$timestamp === false && $timestamp > 0) { + switch ($fieldType) { + case 'DATE' : + $date = date('Y-m-d', $timestamp); + break; + case 'TIME' : + $date = date('H:i:s', $timestamp); + break; + case 'YEAR' : + $date = date('Y', $timestamp); + break; + default : + $date = date('Y-m-d H:i:s', $timestamp); + break; + } + } + + return $date; + } + + /** + * @name: makeArray + * @desc: turns a recordset into a multidimensional array + * @return: an array of row arrays from recordset, or empty array + * if the recordset was empty, returns false if no recordset + * was passed + * @param: $rs Recordset to be packaged into an array + */ + public function makeArray($rs = '', $index = false) + { + if (!$rs) { + return false; + } + $rsArray = array(); + $iterator = 0; + while ($row = $this->getRow($rs)) { + $returnIndex = $index !== false && isset($row[$index]) ? $row[$index] : $iterator; + $rsArray[$returnIndex] = $row; + $iterator++; + } + + return $rsArray; + } + + /** + * @name getVersion + * @desc returns a string containing the database server version + * + * @return string + */ + public function getVersion() + { + return mysql_get_server_info(); + } + + /** + * @name replaceFullTableName + * @desc Get full table name. Append table name and table prefix. + * + * @param string $str + * @return string + */ + public function replaceFullTableName($str, $force = null) + { + + $str = trim($str); + $dbase = trim($this->config['dbase'], '`'); + $prefix = $this->config['table_prefix']; + if (!empty($force)) { + $result = "`{$dbase}`.`{$prefix}{$str}`"; + } elseif (strpos($str, '[+prefix+]') !== false) { + $result = preg_replace('@\[\+prefix\+\]([0-9a-zA-Z_]+)@', "`{$dbase}`.`{$prefix}$1`", $str); + } else { + $result = $str; + } + + return $result; + } + + public function optimize($table_name) + { + $rs = $this->query("OPTIMIZE TABLE {$table_name}"); + if ($rs) { + $rs = $this->query("ALTER TABLE {$table_name}"); + } + + return $rs; + } + + public function truncate($table_name) + { + $rs = $this->query("TRUNCATE {$table_name}"); + + return $rs; + } + + public function dataSeek($result, $row_number) + { + return mysql_data_seek($result, $row_number); + } + + public function _getFieldsStringFromArray($fields = array()) + { + + if (empty($fields)) { + return '*'; + } + $_ = array(); - foreach($fields as $k=>$v) { - if($k!==$v) $_[] = "{$v} as {$k}"; - else $_[] = $v; + foreach ($fields as $k => $v) { + if ($k !== $v) { + $_[] = "{$v} as {$k}"; + } else { + $_[] = $v; + } } - return join(',', $_); + + return implode(',', $_); } - - function _getFromStringFromArray($tables=array()) { + + public function _getFromStringFromArray($tables = array()) + { $_ = array(); - foreach($tables as $k=>$v) { + foreach ($tables as $k => $v) { $_[] = $v; } - return join(' ', $_); + + return implode(' ', $_); } } diff --git a/manager/includes/extenders/dbapi.mysqli.class.inc.php b/manager/includes/extenders/dbapi.mysqli.class.inc.php index f1101227a5..9fb4af3501 100644 --- a/manager/includes/extenders/dbapi.mysqli.class.inc.php +++ b/manager/includes/extenders/dbapi.mysqli.class.inc.php @@ -1,105 +1,163 @@ config['host'] = $host ? $host : $GLOBALS['database_server']; - $this->config['dbase'] = $dbase ? $dbase : $GLOBALS['dbase']; - $this->config['user'] = $uid ? $uid : $GLOBALS['database_user']; - $this->config['pass'] = $pwd ? $pwd : $GLOBALS['database_password']; - $this->config['charset'] = $charset ? $charset : $GLOBALS['database_connection_charset']; - $this->config['connection_method'] = $this->_dbconnectionmethod = (isset($GLOBALS['database_connection_method']) ? $GLOBALS['database_connection_method'] : $connection_method); - $this->config['table_prefix'] = ($pre !== NULL) ? $pre : $GLOBALS['table_prefix']; - } - - function connect($host = '', $dbase = '', $uid = '', $pwd = '', $tmp = 0) { - global $modx; - $uid = $uid ? $uid : $this->config['user']; - $pwd = $pwd ? $pwd : $this->config['pass']; - $host = $host ? $host : $this->config['host']; - $dbase = $dbase ? $dbase : $this->config['dbase']; - $dbase = trim($dbase, '`'); // remove the `` chars - $charset = $this->config['charset']; - $connection_method = $this->config['connection_method']; - $tstart = $modx->getMicroTime(); - $safe_count = 0; - do { - $this->conn = new mysqli($host, $uid, $pwd, $dbase); - if ($this->conn->connect_error) { - $this->conn = null; - if (isset($modx->config['send_errormail']) && $modx->config['send_errormail'] !== '0') { - if ($modx->config['send_errormail'] <= 2) { - $logtitle = 'Failed to create the database connection!'; - $request_uri = $modx->htmlspecialchars($_SERVER['REQUEST_URI']); - $ua = $modx->htmlspecialchars($_SERVER['HTTP_USER_AGENT']); - $referer = $modx->htmlspecialchars($_SERVER['HTTP_REFERER']); - $modx->sendmail(array( - 'subject' => 'Missing to create the database connection! from ' . $modx->config['site_name'], - 'body' => "{$logtitle}\n{$request_uri}\n{$ua}\n{$referer}", - 'type' => 'text' - )); - } - } - sleep(1); - $safe_count++; - } - } while (!$this->conn && $safe_count<3); - if (!$this->conn) { - $modx->messageQuit("Failed to create the database connection!"); - exit; - } else { - $this->conn->query("{$connection_method} {$charset}"); - $tend = $modx->getMicroTime(); - $totaltime = $tend - $tstart; - if ($modx->dumpSQL) { - $modx->queryCode .= "
    Database connection" . sprintf("Database connection was created in %2.4f s", $totaltime) . "

    "; - } - $this->conn->set_charset($this->config['charset']); - $this->isConnected = true; - $modx->queryTime += $totaltime; - } - } - - function disconnect() { - $this->conn->close(); - $this->conn = null; - $this->isConnected = false; - } - - function escape($s, $safecount=0) { - $safecount++; - if (1000<$safecount) exit("Too many loops '{$safecount}'"); - if (empty ($this->conn) || !is_object($this->conn)) { - $this->connect(); - } - if (is_array($s)) { - if (count($s) === 0) { - $s = ''; - } else { - foreach ($s as $i=>$v) { - $s[$i] = $this->escape($v, $safecount); - } - } - } else { - $s = $this->conn->escape_string($s); - } - return $s; - } - - function query($sql,$watchError=true) { - global $modx; - if (empty ($this->conn) || !is_object($this->conn)) { - $this->connect(); - } - $tstart = $modx->getMicroTime(); - if(is_array($sql)) $sql = join("\n", $sql); - $this->lastQuery = $sql; - if (!($result = $this->conn->query($sql))) { - if(!$watchError) return; - switch(mysqli_errno($this->conn)) { + +class DBAPI +{ + /** + * @var mysqli + */ + public $conn; + public $config; + public $lastQuery; + public $isConnected; + public $_dbconnectionmethod; + + /** + * DBAPI constructor. + * + * @param string $host + * @param string $dbase + * @param string $uid + * @param string $pwd + * @param null|string $pre + * @param string $charset + * @param string $connection_method + */ + public function __construct( + $host = '', + $dbase = '', + $uid = '', + $pwd = '', + $pre = null, + $charset = '', + $connection_method = 'SET CHARACTER SET' + ) { + $this->config['host'] = $host ? $host : $GLOBALS['database_server']; + $this->config['dbase'] = $dbase ? $dbase : $GLOBALS['dbase']; + $this->config['user'] = $uid ? $uid : $GLOBALS['database_user']; + $this->config['pass'] = $pwd ? $pwd : $GLOBALS['database_password']; + $this->config['charset'] = $charset ? $charset : $GLOBALS['database_connection_charset']; + $this->config['connection_method'] = $this->_dbconnectionmethod = (isset($GLOBALS['database_connection_method']) ? $GLOBALS['database_connection_method'] : $connection_method); + $this->config['table_prefix'] = ($pre !== null) ? $pre : $GLOBALS['table_prefix']; + } + + /** + * @param string $host + * @param string $dbase + * @param string $uid + * @param string $pwd + * @return mysqli + */ + public function connect($host = '', $dbase = '', $uid = '', $pwd = '') + { + global $modx; + $uid = $uid ? $uid : $this->config['user']; + $pwd = $pwd ? $pwd : $this->config['pass']; + $host = $host ? $host : $this->config['host']; + $dbase = $dbase ? $dbase : $this->config['dbase']; + $dbase = trim($dbase, '`'); // remove the `` chars + $charset = $this->config['charset']; + $connection_method = $this->config['connection_method']; + $tstart = $modx->getMicroTime(); + $safe_count = 0; + do { + $this->conn = new mysqli($host, $uid, $pwd, $dbase); + if ($this->conn->connect_error) { + $this->conn = null; + if (isset($modx->config['send_errormail']) && $modx->config['send_errormail'] !== '0') { + if ($modx->config['send_errormail'] <= 2) { + $logtitle = 'Failed to create the database connection!'; + $request_uri = $modx->htmlspecialchars($_SERVER['REQUEST_URI']); + $ua = $modx->htmlspecialchars($_SERVER['HTTP_USER_AGENT']); + $referer = $modx->htmlspecialchars($_SERVER['HTTP_REFERER']); + $modx->sendmail(array( + 'subject' => 'Missing to create the database connection! from ' . $modx->config['site_name'], + 'body' => "{$logtitle}\n{$request_uri}\n{$ua}\n{$referer}", + 'type' => 'text' + )); + } + } + sleep(1); + $safe_count++; + } + } while (!$this->conn && $safe_count < 3); + if ($this->conn instanceof mysqli) { + $this->conn->query("{$connection_method} {$charset}"); + $tend = $modx->getMicroTime(); + $totaltime = $tend - $tstart; + if ($modx->dumpSQL) { + $modx->queryCode .= "
    Database connection" . sprintf("Database connection was created in %2.4f s", + $totaltime) . "

    "; + } + $this->conn->set_charset($this->config['charset']); + $this->isConnected = true; + $modx->queryTime += $totaltime; + } else { + $modx->messageQuit("Failed to create the database connection!"); + exit; + } + return $this->conn; + } + + /** + * @return void + */ + public function disconnect() + { + $this->conn->close(); + $this->conn = null; + $this->isConnected = false; + } + + /** + * @param array|string $s + * @param int $safeCount + * @return array|string + */ + public function escape($s, $safeCount = 0) + { + $safeCount++; + if (1000 < $safeCount) { + exit("Too many loops '{$safeCount}'"); + } + if ( ! ($this->conn instanceof mysqli)) { + $this->connect(); + } + if (is_array($s)) { + if (count($s) === 0) { + $s = ''; + } else { + foreach ($s as $i => $v) { + $s[$i] = $this->escape($v, $safeCount); + } + } + } else { + $s = $this->conn->escape_string($s); + } + + return $s; + } + + /** + * @param string|array|mysqli_result $sql + * @param bool $watchError + * @return bool|mysqli_result + */ + public function query($sql, $watchError = true) + { + global $modx; + if ( ! ($this->conn instanceof mysqli)) { + $this->connect(); + } + $tStart = $modx->getMicroTime(); + if (is_array($sql)) { + $sql = implode("\n", $sql); + } + $this->lastQuery = $sql; + if (!($result = $this->conn->query($sql))) { + if (!$watchError) { + return false; + } + switch (mysqli_errno($this->conn)) { case 1054: case 1060: case 1061: @@ -109,324 +167,574 @@ function query($sql,$watchError=true) { default: $modx->messageQuit('Execution of a query to the database failed - ' . $this->getLastError(), $sql); } - } else { - $tend = $modx->getMicroTime(); - $totaltime = $tend - $tstart; - $modx->queryTime = $modx->queryTime + $totaltime; - if ($modx->dumpSQL) { - $debug = debug_backtrace(); - array_shift($debug); - $debug_path = array(); - foreach ($debug as $line) $debug_path[] = $line['function']; - $debug_path = implode(' > ', array_reverse($debug_path)); - $modx->queryCode .= "
    Query " . ($modx->executedQueries + 1) . " - " . sprintf("%2.2f ms", $totaltime*1000) . ""; - $modx->queryCode .= $sql . '

    '; - if ($modx->event->name) $modx->queryCode .= 'Current Event => ' . $modx->event->name . '
    '; - if ($modx->event->activePlugin) $modx->queryCode .= 'Current Plugin => ' . $modx->event->activePlugin . '
    '; - if ($modx->currentSnippet) $modx->queryCode .= 'Current Snippet => ' . $modx->currentSnippet . '
    '; - if (stripos($sql, 'select')===0) $modx->queryCode .= 'Record Count => ' . $this->getRecordCount($result) . '
    '; - else $modx->queryCode .= 'Affected Rows => ' . $this->getAffectedRows() . '
    '; - $modx->queryCode .= 'Functions Path => ' . $debug_path . '
    '; - $modx->queryCode .= "

    "; - } - $modx->executedQueries = $modx->executedQueries + 1; - return $result; - } - } - - function delete($from, $where='', $orderby='', $limit = '') { - global $modx; - if (!$from) { - $modx->messageQuit("Empty \$from parameters in DBAPI::delete()."); - } else { - $from = $this->replaceFullTableName($from); - $where = trim($where); - $orderby = trim($orderby); - $limit = trim($limit); - if($where!=='' && stripos($where, 'WHERE')!==0) $where = "WHERE {$where}"; - if($orderby!== '' && stripos($orderby,'ORDER BY')!==0) $orderby = "ORDER BY {$orderby}"; - if($limit!== '' && stripos($limit, 'LIMIT')!==0) $limit = "LIMIT {$limit}"; - return $this->query("DELETE FROM {$from} {$where} {$orderby} {$limit}"); - } - } - - function select($fields = "*", $from = "", $where = "", $orderby = "", $limit = "") { - global $modx; - - if(is_array($fields)) $fields = $this->_getFieldsStringFromArray($fields); - if(is_array($from)) $from = $this->_getFromStringFromArray($from); - if(is_array($where)) $where = join(' ', $where); - - if (!$from) { - $modx->messageQuit("Empty \$from parameters in DBAPI::select()."); - exit; - } - - $fields = $this->replaceFullTableName($fields); - $from = $this->replaceFullTableName($from); - $where = trim($where); - $orderby = trim($orderby); - $limit = trim($limit); - if($where!=='' && stripos($where,'WHERE')!==0) $where = "WHERE {$where}"; - if($orderby!=='' && stripos($orderby,'ORDER')!==0) $orderby = "ORDER BY {$orderby}"; - if($limit!=='' && stripos($limit,'LIMIT')!==0) $limit = "LIMIT {$limit}"; - return $this->query("SELECT {$fields} FROM {$from} {$where} {$orderby} {$limit}"); - } - - function update($fields, $table, $where = "") { - global $modx; - if (!$table) { - $modx->messageQuit("Empty \$table parameter in DBAPI::update()."); - } else { - $table = $this->replaceFullTableName($table); - if (is_array($fields)) { - foreach ($fields as $key => $value) { - if(is_null($value) || strtolower($value) === 'null'){ - $flds = 'NULL'; - }else{ - $flds = "'" . $value . "'"; - } - $fields[$key] = "`{$key}` = ".$flds; - } - $fields = implode(",", $fields); - } - $where = trim($where); - if($where!=='' && stripos($where, 'WHERE')!==0) $where = "WHERE {$where}"; - return $this->query("UPDATE {$table} SET {$fields} {$where}"); - } - } - - function insert($fields, $intotable, $fromfields = "*", $fromtable = "", $where = "", $limit = "") { - global $modx; - if (!$intotable) { - $modx->messageQuit("Empty \$intotable parameters in DBAPI::insert()."); - } else { - $intotable = $this->replaceFullTableName($intotable); - if (!is_array($fields)) { - $this->query("INSERT INTO {$intotable} {$fields}"); - } else { - if (empty($fromtable)) { - $fields = "(`".implode("`, `", array_keys($fields))."`) VALUES('".implode("', '", array_values($fields))."')"; - $rt = $this->query("INSERT INTO {$intotable} {$fields}"); - } else { - $fromtable = $this->replaceFullTableName($fromtable); - $fields = "(".implode(",", array_keys($fields)).")"; - $where = trim($where); - $limit = trim($limit); - if($where!=='' && stripos($where, 'WHERE')!==0) $where = "WHERE {$where}"; - if($limit!=='' && stripos($limit, 'LIMIT')!==0) $limit = "LIMIT {$limit}"; - $rt = $this->query("INSERT INTO {$intotable} {$fields} SELECT {$fromfields} FROM {$fromtable} {$where} {$limit}"); - } - } - if (($lid = $this->getInsertId())===false) $modx->messageQuit("Couldn't get last insert key!"); - return $lid; - } - } - - function save($fields, $table, $where='') { // This is similar to "replace into table". - - if($where === '') $mode = 'insert'; - elseif($this->getRecordCount($this->select('*',$table,$where))==0) $mode = 'insert'; - else $mode = 'update'; - - if($mode==='insert') return $this->insert($fields, $table); - else return $this->update($fields, $table, $where); - } - - function isResult($rs) { - return is_object($rs); - } - - function freeResult($rs) { - $rs->free_result(); - } - - function numFields($rs) { - return $rs->field_count; - } - - function fieldName($rs,$col=0) { - $field = $rs->fetch_field_direct($col); - return $field->name; - } - - function selectDb($name) { - $this->conn->select_db($name); - } - - - function getInsertId($conn=NULL) { - if (!is_object($conn)) $conn =& $this->conn; - return $conn->insert_id; - } - - function getAffectedRows($conn=NULL) { - if (!is_object($conn)) $conn =& $this->conn; - return $conn->affected_rows; - } - - function getLastError($conn=NULL) { - if (!is_object($conn)) $conn =& $this->conn; - return $conn->error; - } - - function getRecordCount($ds) { - return (is_object($ds)) ? $ds->num_rows : 0; - } - - function getRow($ds, $mode = 'assoc') { - if (is_object($ds)) { - if ($mode == 'assoc') { - return $ds->fetch_assoc(); - } elseif ($mode == 'num') { - return $ds->fetch_row(); - } elseif ($mode == 'object') { - return $ds->fetch_object(); - } elseif ($mode == 'both') { - return $ds->fetch_array(MYSQLI_BOTH); - } else { - global $modx; - $modx->messageQuit("Unknown get type ($mode) specified for fetchRow - must be empty, 'assoc', 'num' or 'both'."); - } - } - } - - function getColumn($name, $dsq) { - if (!is_object($dsq)) { - $dsq = $this->query($dsq); - } - if ($dsq) { - $col = array (); - while ($row = $this->getRow($dsq)) { - $col[] = $row[$name]; - } - return $col; - } - } - - function getColumnNames($dsq) { - if (!is_object($dsq)) { - $dsq = $this->query($dsq); - } - if ($dsq) { - $names = array (); - $limit = $this->numFields($dsq); - for ($i = 0; $i < $limit; $i++) { - $names[] = $this->fieldName($dsq, $i); - } - return $names; - } - } - - function getValue($dsq) { - if (!is_object($dsq)) { - $dsq = $this->query($dsq); - } - if ($dsq) { - $r = $this->getRow($dsq, "num"); - return $r[0]; - } - } - - function getTableMetaData($table) { - $metadata = false; - if (!empty ($table)) { - $sql = "SHOW FIELDS FROM $table"; - if ($ds = $this->query($sql)) { - while ($row = $this->getRow($ds)) { - $fieldName = $row['Field']; - $metadata[$fieldName] = $row; - } - } - } - return $metadata; - } - - function prepareDate($timestamp, $fieldType = 'DATETIME') { - $date = ''; - if (!$timestamp === false && $timestamp > 0) { - switch ($fieldType) { - case 'DATE' : - $date = date('Y-m-d', $timestamp); - break; - case 'TIME' : - $date = date('H:i:s', $timestamp); - break; - case 'YEAR' : - $date = date('Y', $timestamp); - break; - default : - $date = date('Y-m-d H:i:s', $timestamp); - break; - } - } - return $date; - } - - function makeArray($rs='',$index=false){ - if (!$rs) return false; - $rsArray = array(); - $iterator = 0; - while ($row = $this->getRow($rs)) { - $returnIndex = $index !== false && isset($row[$index]) ? $row[$index] : $iterator; - $rsArray[$returnIndex] = $row; - $iterator++; - } - return $rsArray; - } - - function getVersion() { - return $this->conn->server_info; - } - - function replaceFullTableName($str,$force=null) { - $str = trim($str); - $dbase = trim($this->config['dbase'],'`'); - $prefix = $this->config['table_prefix']; - if (!empty($force)) { - $result = "`{$dbase}`.`{$prefix}{$str}`"; - } elseif (strpos($str,'[+prefix+]')!==false) { - $result = preg_replace('@\[\+prefix\+\]([0-9a-zA-Z_]+)@', "`{$dbase}`.`{$prefix}$1`", $str); - } else { - $result = $str; - } - return $result; - } - - function optimize($table_name) { - $rs = $this->query("OPTIMIZE TABLE {$table_name}"); - if ($rs) { - $rs = $this->query("ALTER TABLE {$table_name}"); - } - return $rs; - } - - function truncate($table_name) { - $rs = $this->query("TRUNCATE {$table_name}"); - return $rs; - } - - function dataSeek($result, $row_number) { - return $result->data_seek($row_number); - } - - function _getFieldsStringFromArray($fields=array()) { - - if(empty($fields)) return '*'; - + } else { + $tend = $modx->getMicroTime(); + $totalTime = $tend - $tStart; + $modx->queryTime += $totalTime; + if ($modx->dumpSQL) { + $debug = debug_backtrace(); + array_shift($debug); + $debug_path = array(); + foreach ($debug as $line) { + $debug_path[] = $line['function']; + } + $debug_path = implode(' > ', array_reverse($debug_path)); + $modx->queryCode .= "
    Query " . ($modx->executedQueries + 1) . " - " . sprintf("%2.2f ms", + $totalTime * 1000) . ""; + $modx->queryCode .= $sql . '

    '; + if ($modx->event->name) { + $modx->queryCode .= 'Current Event => ' . $modx->event->name . '
    '; + } + if ($modx->event->activePlugin) { + $modx->queryCode .= 'Current Plugin => ' . $modx->event->activePlugin . '
    '; + } + if ($modx->currentSnippet) { + $modx->queryCode .= 'Current Snippet => ' . $modx->currentSnippet . '
    '; + } + if (stripos($sql, 'select') === 0) { + $modx->queryCode .= 'Record Count => ' . $this->getRecordCount($result) . '
    '; + } else { + $modx->queryCode .= 'Affected Rows => ' . $this->getAffectedRows() . '
    '; + } + $modx->queryCode .= 'Functions Path => ' . $debug_path . '
    '; + $modx->queryCode .= "

    "; + } + $modx->executedQueries++; + + return $result; + } + return false; + } + + /** + * @param string $from + * @param string $where + * @param string $orderBy + * @param string $limit + * @return bool|mysqli_result + */ + public function delete($from, $where = '', $orderBy = '', $limit = '') + { + global $modx; + $out = false; + if (!$from) { + $modx->messageQuit("Empty \$from parameters in DBAPI::delete()."); + } else { + $from = $this->replaceFullTableName($from); + $where = trim($where); + $orderBy = trim($orderBy); + $limit = trim($limit); + if ($where !== '' && stripos($where, 'WHERE') !== 0) { + $where = "WHERE {$where}"; + } + if ($orderBy !== '' && stripos($orderBy, 'ORDER BY') !== 0) { + $orderBy = "ORDER BY {$orderBy}"; + } + if ($limit !== '' && stripos($limit, 'LIMIT') !== 0) { + $limit = "LIMIT {$limit}"; + } + + $out = $this->query("DELETE FROM {$from} {$where} {$orderBy} {$limit}"); + } + return $out; + } + + /** + * @param string|array $fields + * @param string|array $from + * @param string|array $where + * @param string $orderBy + * @param string $limit + * @return bool|mysqli_result + */ + public function select($fields = "*", $from = "", $where = "", $orderBy = "", $limit = "") + { + global $modx; + + if (is_array($fields)) { + $fields = $this->_getFieldsStringFromArray($fields); + } + if (is_array($from)) { + $from = $this->_getFromStringFromArray($from); + } + if (is_array($where)) { + $where = implode(' ', $where); + } + + if (!$from) { + $modx->messageQuit("Empty \$from parameters in DBAPI::select()."); + exit; + } + + $fields = $this->replaceFullTableName($fields); + $from = $this->replaceFullTableName($from); + $where = trim($where); + $orderBy = trim($orderBy); + $limit = trim($limit); + if ($where !== '' && stripos($where, 'WHERE') !== 0) { + $where = "WHERE {$where}"; + } + if ($orderBy !== '' && stripos($orderBy, 'ORDER') !== 0) { + $orderBy = "ORDER BY {$orderBy}"; + } + if ($limit !== '' && stripos($limit, 'LIMIT') !== 0) { + $limit = "LIMIT {$limit}"; + } + + return $this->query("SELECT {$fields} FROM {$from} {$where} {$orderBy} {$limit}"); + } + + /** + * @param array|string $fields + * @param $table + * @param string $where + * @return bool|mysqli_result + */ + public function update($fields, $table, $where = "") + { + global $modx; + $out = false; + if (!$table) { + $modx->messageQuit('Empty '.$table.' parameter in DBAPI::update().'); + } else { + $table = $this->replaceFullTableName($table); + if (is_array($fields)) { + foreach ($fields as $key => $value) { + if ($value === null || strtolower($value) === 'null') { + $f = 'NULL'; + } else { + $f = "'" . $value . "'"; + } + $fields[$key] = "`{$key}` = " . $f; + } + $fields = implode(',', $fields); + } + $where = trim($where); + if ($where !== '' && stripos($where, 'WHERE') !== 0) { + $where = 'WHERE '.$where; + } + + return $this->query('UPDATE '.$table.' SET '.$fields.' '.$where); + } + return $out; + } + + /** + * @param string|array $fields + * @param string $intotable + * @param string $fromfields + * @param string $fromtable + * @param string $where + * @param string $limit + * @return mixed + */ + public function insert($fields, $intotable, $fromfields = "*", $fromtable = "", $where = "", $limit = "") + { + global $modx; + $out = false; + if (!$intotable) { + $modx->messageQuit("Empty \$intotable parameters in DBAPI::insert()."); + } else { + $intotable = $this->replaceFullTableName($intotable); + if (!is_array($fields)) { + $this->query("INSERT INTO {$intotable} {$fields}"); + } else { + if (empty($fromtable)) { + $fields = "(`" . implode("`, `", array_keys($fields)) . "`) VALUES('" . implode("', '", + array_values($fields)) . "')"; + $this->query("INSERT INTO {$intotable} {$fields}"); + } else { + $fromtable = $this->replaceFullTableName($fromtable); + $fields = "(" . implode(",", array_keys($fields)) . ")"; + $where = trim($where); + $limit = trim($limit); + if ($where !== '' && stripos($where, 'WHERE') !== 0) { + $where = "WHERE {$where}"; + } + if ($limit !== '' && stripos($limit, 'LIMIT') !== 0) { + $limit = "LIMIT {$limit}"; + } + $this->query("INSERT INTO {$intotable} {$fields} SELECT {$fromfields} FROM {$fromtable} {$where} {$limit}"); + } + } + if (($lid = $this->getInsertId()) === false) { + $modx->messageQuit("Couldn't get last insert key!"); + } + + $out = $lid; + } + return $out; + } + + /** + * @param $fields + * @param $table + * @param string $where + * @return bool|mixed|mysqli_result + */ + public function save($fields, $table, $where = '') + { // This is similar to "replace into table". + + if ($where === '') { + $mode = 'insert'; + } elseif ($this->getRecordCount($this->select('*', $table, $where)) === 0) { + $mode = 'insert'; + } else { + $mode = 'update'; + } + + return ($mode === 'insert') ? $this->insert($fields, $table) : $this->update($fields, $table, $where); + } + + /** + * @param mixed $rs + * @return bool + */ + public function isResult($rs) + { + return $rs instanceof mysqli_result; + } + + /** + * @param mysqli_result $rs + */ + public function freeResult($rs) + { + $rs->free_result(); + } + + /** + * @param mysqli_result $rs + * @return mixed + */ + public function numFields($rs) + { + return $rs->field_count; + } + + /** + * @param mysqli_result $rs + * @param int $col + * @return string|null + */ + public function fieldName($rs, $col = 0) + { + $field = $rs->fetch_field_direct($col); + + return isset($field->name) ? $field->name : null; + } + + /** + * @param $name + */ + public function selectDb($name) + { + $this->conn->select_db($name); + } + + + /** + * @param null|mysqli $conn + * @return mixed + */ + public function getInsertId($conn = null) + { + if (! ($conn instanceof mysqli)) { + $conn =& $this->conn; + } + + return $conn->insert_id; + } + + /** + * @param null|mysqli $conn + * @return int + */ + public function getAffectedRows($conn = null) + { + if (! ($conn instanceof mysqli)) { + $conn =& $this->conn; + } + + return $conn->affected_rows; + } + + /** + * @param null|mysqli $conn + * @return string + */ + public function getLastError($conn = null) + { + if (! ($conn instanceof mysqli)) { + $conn =& $this->conn; + } + + return $conn->error; + } + + /** + * @param mysqli_result $ds + * @return int + */ + public function getRecordCount($ds) + { + return ($ds instanceof mysqli_result) ? $ds->num_rows : 0; + } + + /** + * @param mysqli_result $ds + * @param string $mode + * @return array|bool|mixed|object|stdClass + */ + public function getRow($ds, $mode = 'assoc') + { + $out = false; + if ($ds instanceof mysqli_result) { + switch($mode){ + case 'assoc': + $out = $ds->fetch_assoc(); + break; + case 'num': + $out = $ds->fetch_row(); + break; + case 'object': + $out = $ds->fetch_object(); + break; + case 'both': + $out = $ds->fetch_array(MYSQLI_BOTH); + break; + default: + global $modx; + $modx->messageQuit("Unknown get type ($mode) specified for fetchRow - must be empty, 'assoc', 'num' or 'both'."); + + } + } + return $out; + } + + /** + * @param $name + * @param mysqli_result|string $dsq + * @return array + */ + public function getColumn($name, $dsq) + { + $col = array(); + if ( ! ($dsq instanceof mysqli_result)) { + $dsq = $this->query($dsq); + } + if ($dsq) { + while ($row = $this->getRow($dsq)) { + $col[] = $row[$name]; + } + } + + return $col; + } + + /** + * @param mysqli_result|string $dsq + * @return array + */ + public function getColumnNames($dsq) + { + $names = array(); + if ( ! ($dsq instanceof mysqli_result)) { + $dsq = $this->query($dsq); + } + if ($dsq) { + $limit = $this->numFields($dsq); + for ($i = 0; $i < $limit; $i++) { + $names[] = $this->fieldName($dsq, $i); + } + } + + return $names; + } + + /** + * @param mysqli_result|string $dsq + * @return bool|string|int + */ + public function getValue($dsq) + { + $out = false; + if ( ! ($dsq instanceof mysqli_result)) { + $dsq = $this->query($dsq); + } + if ($dsq) { + $r = $this->getRow($dsq, 'num'); + $out = isset($r[0]) ? $r[0] : false; + } + + return $out; + } + + /** + * @param string $table + * @return array + */ + public function getTableMetaData($table) + { + $metadata = array(); + if (!empty($table) && is_scalar($table)) { + $sql = 'SHOW FIELDS FROM '.$table; + if ($ds = $this->query($sql)) { + while ($row = $this->getRow($ds)) { + $fieldName = $row['Field']; + $metadata[$fieldName] = $row; + } + } + } + + return $metadata; + } + + /** + * @param int $timestamp + * @param string $fieldType + * @return false|string + */ + public function prepareDate($timestamp, $fieldType = 'DATETIME') + { + $date = false; + if (!$timestamp === false && $timestamp > 0) { + switch ($fieldType) { + case 'DATE' : + $date = date('Y-m-d', $timestamp); + break; + case 'TIME' : + $date = date('H:i:s', $timestamp); + break; + case 'YEAR' : + $date = date('Y', $timestamp); + break; + default : + $date = date('Y-m-d H:i:s', $timestamp); + break; + } + } + + return $date; + } + + /** + * @param string|mysqli_result $rs + * @param bool $index + * @return array + */ + public function makeArray($rs = '', $index = false) + { + $rsArray = array(); + if (!$rs) { + return $rsArray; + } + $iterator = 0; + while ($row = $this->getRow($rs)) { + $returnIndex = $index !== false && isset($row[$index]) ? $row[$index] : $iterator; + $rsArray[$returnIndex] = $row; + $iterator++; + } + + return $rsArray; + } + + /** + * @return string + */ + public function getVersion() + { + return $this->conn->server_info; + } + + /** + * @param string $tableName + * @param bool $force + * @return string + */ + public function replaceFullTableName($tableName, $force = false) + { + $tableName = trim($tableName); + $dbase = trim($this->config['dbase'], '`'); + $prefix = $this->config['table_prefix']; + if ((bool)$force === true) { + $result = "`{$dbase}`.`{$prefix}{$tableName}`"; + } elseif (strpos($tableName, '[+prefix+]') !== false) { + $result = preg_replace('@\[\+prefix\+\]([0-9a-zA-Z_]+)@', "`{$dbase}`.`{$prefix}$1`", $tableName); + } else { + $result = $tableName; + } + + return $result; + } + + /** + * @param string $table_name + * @return bool|mysqli_result + */ + public function optimize($table_name) + { + $rs = $this->query('OPTIMIZE TABLE '.$table_name); + if ($rs) { + $rs = $this->query('ALTER TABLE '.$table_name); + } + + return $rs; + } + + /** + * @param string $table_name + * @return bool|mysqli_result + */ + public function truncate($table_name) + { + return $this->query('TRUNCATE '.$table_name); + } + + /** + * @param mysqli_result $result + * @param int $row_number + * @return bool + */ + public function dataSeek($result, $row_number) + { + return $result->data_seek($row_number); + } + + /** + * @param array $fields + * @return string + */ + public function _getFieldsStringFromArray($fields = array()) + { + + if (empty($fields)) { + return '*'; + } + $_ = array(); - foreach($fields as $k=>$v) { - if($k!==$v) $_[] = "{$v} as {$k}"; - else $_[] = $v; + foreach ($fields as $k => $v) { + if ($k !== $v) { + $_[] = $v.' as '.$k; + } else { + $_[] = $v; + } } - return join(',', $_); + + return implode(',', $_); } - - function _getFromStringFromArray($tables=array()) { + + /** + * @param array $tables + * @return string + */ + public function _getFromStringFromArray($tables = array()) + { $_ = array(); - foreach($tables as $k=>$v) { + foreach ($tables as $k => $v) { $_[] = $v; } - return join(' ', $_); + + return implode(' ', $_); } } diff --git a/manager/includes/extenders/deprecated.functions.inc.php b/manager/includes/extenders/deprecated.functions.inc.php index 74a6094ee3..fddcdef1f8 100644 --- a/manager/includes/extenders/deprecated.functions.inc.php +++ b/manager/includes/extenders/deprecated.functions.inc.php @@ -1,147 +1,311 @@ old = new OldFunctions(); -class OldFunctions { - - function dbConnect() {global $modx; $modx->db->connect();$modx->rs = $modx->db->conn;} - function dbQuery($sql) {global $modx;return $modx->db->query($sql);} - function recordCount($rs) {global $modx;return $modx->db->getRecordCount($rs);} - function fetchRow($rs,$mode='assoc') {global $modx;return $modx->db->getRow($rs, $mode);} - function affectedRows($rs) {global $modx;return $modx->db->getAffectedRows($rs);} - function insertId($rs) {global $modx;return $modx->db->getInsertId($rs);} - function dbClose() {global $modx; $modx->db->disconnect();} - - function makeList($array, $ulroot= 'root', $ulprefix= 'sub_', $type= '', $ordered= false, $tablevel= 0) { + +class OldFunctions +{ + /** + * @deprecated + * + * return @void + */ + public function dbConnect() + { + global $modx; + $modx->db->connect(); + $modx->rs = $modx->db->conn; + } + + /** + * @deprecated + * + * @param $sql + * @return bool|mysqli_result|resource + */ + public function dbQuery($sql) + { + global $modx; + + return $modx->db->query($sql); + } + + /** + * @deprecated + * + * @param $rs + * @return int + */ + public function recordCount($rs) + { + global $modx; + + return $modx->db->getRecordCount($rs); + } + + /** + * @deprecated + * + * @param $rs + * @param string $mode + * @return array|bool|mixed|object|stdClass + */ + public function fetchRow($rs, $mode = 'assoc') + { + global $modx; + + return $modx->db->getRow($rs, $mode); + } + + /** + * @deprecated + * + * @param $rs + * @return int + */ + public function affectedRows($rs) + { + global $modx; + + return $modx->db->getAffectedRows($rs); + } + + /** + * @deprecated + * + * @param $rs + * @return int|mixed + */ + public function insertId($rs) + { + global $modx; + + return $modx->db->getInsertId($rs); + } + + /** + * @deprecated + * + * @return void + */ + public function dbClose() + { + global $modx; + $modx->db->disconnect(); + } + + /** + * @deprecated + * + * @param array $array + * @param string $ulroot + * @param string $ulprefix + * @param string $type + * @param bool $ordered + * @param int $tablevel + * @return string + */ + public function makeList($array, $ulroot = 'root', $ulprefix = 'sub_', $type = '', $ordered = false, $tablevel = 0) + { // first find out whether the value passed is an array if (!is_array($array)) { return "
    • Bad list
    "; } if (!empty ($type)) { - $typestr= " style='list-style-type: $type'"; + $typestr = " style='list-style-type: $type'"; } else { - $typestr= ""; + $typestr = ""; } - $tabs= ""; - for ($i= 0; $i < $tablevel; $i++) { + $tabs = ""; + for ($i = 0; $i < $tablevel; $i++) { $tabs .= "\t"; } - $listhtml= $ordered == true ? $tabs . "
      \n" : $tabs . "
        \n"; + $listhtml = $ordered == true ? $tabs . "
          \n" : $tabs . "
            \n"; foreach ($array as $key => $value) { if (is_array($value)) { - $listhtml .= $tabs . "\t
          • " . $key . "\n" . $this->makeList($value, $ulprefix . $ulroot, $ulprefix, $type, $ordered, $tablevel +2) . $tabs . "\t
          • \n"; + $listhtml .= $tabs . "\t
          • " . $key . "\n" . $this->makeList($value, $ulprefix . $ulroot, $ulprefix, + $type, $ordered, $tablevel + 2) . $tabs . "\t
          • \n"; } else { $listhtml .= $tabs . "\t
          • " . $value . "
          • \n"; } } $listhtml .= $ordered == true ? $tabs . "
        \n" : $tabs . "
      \n"; + return $listhtml; } - - function getUserData() { + /** + * @deprecated + * + * @return array + */ + public function getUserData() + { + $client = array(); $client['ip'] = $_SERVER['REMOTE_ADDR']; $client['ua'] = $_SERVER['HTTP_USER_AGENT']; - return $client; - } - - # Returns true, install or interact when inside manager - // deprecated - function insideManager() { - $m= false; - if (defined('IN_MANAGER_MODE') && IN_MANAGER_MODE == 'true') { - $m= true; - if (defined('SNIPPET_INTERACTIVE_MODE') && SNIPPET_INTERACTIVE_MODE == 'true') - $m= "interact"; - else - if (defined('SNIPPET_INSTALL_MODE') && SNIPPET_INSTALL_MODE == 'true') - $m= "install"; + + return $client; + } + + /** + * Returns true, install or interact when inside manager + * + * @deprecated + * + * @return bool|string + */ + public function insideManager() + { + $m = false; + if (defined('IN_MANAGER_MODE') && IN_MANAGER_MODE === true) { + $m = true; + if (defined('SNIPPET_INTERACTIVE_MODE') && SNIPPET_INTERACTIVE_MODE == 'true') { + $m = "interact"; + } else { + if (defined('SNIPPET_INSTALL_MODE') && SNIPPET_INSTALL_MODE == 'true') { + $m = "install"; + } + } } + return $m; } - // deprecated - function putChunk($chunkName) { // alias name >.< - global $modx; + /** + * @deprecated + * + * @param $chunkName + * @return bool|string + */ + public function putChunk($chunkName) + { // alias name >.< + global $modx; + return $modx->getChunk($chunkName); } - function getDocGroups() { - global $modx; + /** + * @deprecated + * + * @return array|string + */ + public function getDocGroups() + { + global $modx; + return $modx->getUserDocGroups(); - } // deprecated - - function changePassword($o, $n) { - return changeWebUserPassword($o, $n); - } // deprecated - - function userLoggedIn() { - global $modx; - $userdetails= array (); + } + + /** + * @deprecated + * + * @param string $o + * @param string $n + * @return bool|string + */ + public function changePassword($o, $n) + { + global $modx; + + return $modx->changeWebUserPassword($o, $n); + } + + /** + * @deprecated + * + * @return array|bool + */ + public function userLoggedIn() + { + global $modx; + $userdetails = array(); if ($modx->isFrontend() && isset ($_SESSION['webValidated'])) { // web user - $userdetails['loggedIn']= true; - $userdetails['id']= $_SESSION['webInternalKey']; - $userdetails['username']= $_SESSION['webShortname']; - $userdetails['usertype']= 'web'; // added by Raymond + $userdetails['loggedIn'] = true; + $userdetails['id'] = $_SESSION['webInternalKey']; + $userdetails['username'] = $_SESSION['webShortname']; + $userdetails['usertype'] = 'web'; // added by Raymond + return $userdetails; - } else + } else { if ($modx->isBackend() && isset ($_SESSION['mgrValidated'])) { // manager user - $userdetails['loggedIn']= true; - $userdetails['id']= $_SESSION['mgrInternalKey']; - $userdetails['username']= $_SESSION['mgrShortname']; - $userdetails['usertype']= 'manager'; // added by Raymond + $userdetails['loggedIn'] = true; + $userdetails['id'] = $_SESSION['mgrInternalKey']; + $userdetails['username'] = $_SESSION['mgrShortname']; + $userdetails['usertype'] = 'manager'; // added by Raymond + return $userdetails; } else { return false; } + } } - - function getFormVars($method= "", $prefix= "", $trim= "", $REQUEST_METHOD) { + + /** + * @deprecated + * + * @param string $method + * @param string $prefix + * @param string $trim + * @param $REQUEST_METHOD + * @return array|bool + */ + public function getFormVars($method = "", $prefix = "", $trim = "", $REQUEST_METHOD) + { // function to retrieve form results into an associative array - global $modx; - $results= array (); - $method= strtoupper($method); - if ($method == "") - $method= $REQUEST_METHOD; - if ($method == "POST") - $method= & $_POST; - elseif ($method == "GET") $method= & $_GET; - else + global $modx; + $results = array(); + $method = strtoupper($method); + if ($method == "") { + $method = $REQUEST_METHOD; + } + if ($method == "POST") { + $method = &$_POST; + } elseif ($method == "GET") { + $method = &$_GET; + } else { return false; + } reset($method); foreach ($method as $key => $value) { if (($prefix != "") && (substr($key, 0, strlen($prefix)) == $prefix)) { if ($trim) { - $pieces= explode($prefix, $key, 2); - $key= $pieces[1]; - $results[$key]= $value; - } else - $results[$key]= $value; + $pieces = explode($prefix, $key, 2); + $key = $pieces[1]; + $results[$key] = $value; + } else { + $results[$key] = $value; + } + } elseif ($prefix == "") { + $results[$key] = $value; } - elseif ($prefix == "") $results[$key]= $value; } + return $results; } /** * Displays a javascript alert message in the web browser * + * @deprecated + * * @param string $msg Message to show * @param string $url URL to redirect to */ - function webAlert($msg, $url= "") { - global $modx; - $msg= addslashes($modx->db->escape($msg)); + public function webAlert($msg, $url = "") + { + global $modx; + $msg = addslashes($modx->db->escape($msg)); if (substr(strtolower($url), 0, 11) == "javascript:") { - $act= "__WebAlert();"; - $fnc= "function __WebAlert(){" . substr($url, 11) . "};"; + $act = "__WebAlert();"; + $fnc = "function __WebAlert(){" . substr($url, 11) . "};"; } else { - $act= ($url ? "window.location.href='" . addslashes($url) . "';" : ""); + $act = ($url ? "window.location.href='" . addslashes($url) . "';" : ""); } - $html= ""; - if ($modx->isFrontend()) + $html = ""; + if ($modx->isFrontend()) { $modx->regClientScript($html); - else { + } else { echo $html; } } diff --git a/manager/includes/extenders/ex_dbapi.inc.php b/manager/includes/extenders/ex_dbapi.inc.php index 8d7fb5c01f..949109de89 100644 --- a/manager/includes/extenders/ex_dbapi.inc.php +++ b/manager/includes/extenders/ex_dbapi.inc.php @@ -9,9 +9,15 @@ if (empty($database_type)) $database_type = 'mysql'; -if (!include_once MODX_MANAGER_PATH . 'includes/extenders/dbapi.' . $database_type . '.class.inc.php'){ - return false; -}else{ - $this->db= new DBAPI; - return true; +$out = false; +$class = 'DBAPI'; +if( ! class_exists($class)){ + include_once MODX_MANAGER_PATH . 'includes/extenders/dbapi.' . $database_type . '.class.inc.php'; } + +if(class_exists($class)){ + $this->db= new $class; + $out = true; +} + +return $out; diff --git a/manager/includes/extenders/ex_export_site.inc.php b/manager/includes/extenders/ex_export_site.inc.php index ae0285d78f..48dc158d5c 100644 --- a/manager/includes/extenders/ex_export_site.inc.php +++ b/manager/includes/extenders/ex_export_site.inc.php @@ -5,10 +5,10 @@ * Time: 14:24 */ -if(include_once(MODX_MANAGER_PATH . 'includes/extenders/export.class.inc.php')) -{ +if (include_once(MODX_MANAGER_PATH . 'includes/extenders/export.class.inc.php')) { $this->export = new EXPORT_SITE; + return true; } else { return false; -} \ No newline at end of file +} diff --git a/manager/includes/extenders/ex_getUserData.php b/manager/includes/extenders/ex_getUserData.php index 813d1be7c7..3185bc4067 100644 --- a/manager/includes/extenders/ex_getUserData.php +++ b/manager/includes/extenders/ex_getUserData.php @@ -1,5 +1,7 @@ INCLUDE ACCESS ERROR

      Direct access to this file prohibited."); +if ((!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) && IN_PARSER_MODE != "true") { + die("INCLUDE ACCESS ERROR

      Direct access to this file prohibited."); +} $tmpArray = array(); $tmpArray['ip'] = $_SERVER['REMOTE_ADDR']; $tmpArray['ua'] = $_SERVER['HTTP_USER_AGENT']; diff --git a/manager/includes/extenders/ex_maketable.inc.php b/manager/includes/extenders/ex_maketable.inc.php index 8960d22ddc..f05a0078ae 100644 --- a/manager/includes/extenders/ex_maketable.inc.php +++ b/manager/includes/extenders/ex_maketable.inc.php @@ -5,9 +5,10 @@ * Time: 14:38 */ -if (!include_once MODX_MANAGER_PATH . 'includes/extenders/maketable.class.php'){ +if (!include_once MODX_MANAGER_PATH . 'includes/extenders/maketable.class.php') { return false; -}else{ - $this->table= new MakeTable; +} else { + $this->table = new MakeTable; + return true; -} \ No newline at end of file +} diff --git a/manager/includes/extenders/ex_managerapi.inc.php b/manager/includes/extenders/ex_managerapi.inc.php index 6a5a0f0f9f..ecbb7d8ed7 100644 --- a/manager/includes/extenders/ex_managerapi.inc.php +++ b/manager/includes/extenders/ex_managerapi.inc.php @@ -5,9 +5,10 @@ * Time: 14:16 */ -if (!include_once MODX_MANAGER_PATH . 'includes/extenders/manager.api.class.inc.php'){ +if (!include_once MODX_MANAGER_PATH . 'includes/extenders/manager.api.class.inc.php') { return false; -}else{ - $this->manager= new ManagerAPI; +} else { + $this->manager = new ManagerAPI; + return true; -} \ No newline at end of file +} diff --git a/manager/includes/extenders/ex_modifiers.inc.php b/manager/includes/extenders/ex_modifiers.inc.php index a208b4ebdd..2e87d7af51 100644 --- a/manager/includes/extenders/ex_modifiers.inc.php +++ b/manager/includes/extenders/ex_modifiers.inc.php @@ -5,8 +5,10 @@ * Time: 10:00 */ -if (isset($this->filter) && is_object($this->filter)) return true; +if (isset($this->filter) && is_object($this->filter)) { + return true; +} -include_once(MODX_MANAGER_PATH.'includes/extenders/modifiers.class.inc.php'); -$this->filter= new MODIFIERS; +include_once(MODX_MANAGER_PATH . 'includes/extenders/modifiers.class.inc.php'); +$this->filter = new MODIFIERS; return true; diff --git a/manager/includes/extenders/ex_modxmailer.inc.php b/manager/includes/extenders/ex_modxmailer.inc.php index e9298ac59d..c9a0600f9e 100644 --- a/manager/includes/extenders/ex_modxmailer.inc.php +++ b/manager/includes/extenders/ex_modxmailer.inc.php @@ -6,10 +6,11 @@ * Time: 14:17 */ -if (!include_once(MODX_MANAGER_PATH . 'includes/extenders/modxmailer.class.inc.php')){ +if (!include_once(MODX_MANAGER_PATH . 'includes/extenders/modxmailer.class.inc.php')) { return false; -}else{ +} else { $this->mail = new MODxMailer; $this->mail->init($this); + return true; } diff --git a/manager/includes/extenders/ex_phpass.inc.php b/manager/includes/extenders/ex_phpass.inc.php index a1d5d82bd0..295d40e8d8 100644 --- a/manager/includes/extenders/ex_phpass.inc.php +++ b/manager/includes/extenders/ex_phpass.inc.php @@ -5,13 +5,14 @@ * Time: 19:14 */ -if (isset($this->phpass) && is_object($this->phpass)){ +if (isset($this->phpass) && is_object($this->phpass)) { return true; } -if (!include_once(MODX_MANAGER_PATH . 'includes/extenders/phpass.class.inc.php')){ +if (!include_once(MODX_MANAGER_PATH . 'includes/extenders/phpass.class.inc.php')) { return false; -}else{ +} else { $this->phpass = new PasswordHash; + return true; -} \ No newline at end of file +} diff --git a/manager/includes/extenders/ex_phpcompat.inc.php b/manager/includes/extenders/ex_phpcompat.inc.php index bcacb72a0f..ebb241c8b9 100644 --- a/manager/includes/extenders/ex_phpcompat.inc.php +++ b/manager/includes/extenders/ex_phpcompat.inc.php @@ -5,13 +5,14 @@ * Time: 12:25 */ -if (isset($this->phpcompat) && is_object($this->phpcompat)){ +if (isset($this->phpcompat) && is_object($this->phpcompat)) { return true; } -if (!include_once(MODX_MANAGER_PATH . 'includes/extenders/phpcompat.class.inc.php')){ +if (!include_once(MODX_MANAGER_PATH . 'includes/extenders/phpcompat.class.inc.php')) { return false; -}else{ +} else { $this->phpcompat = new PHPCOMPAT; + return true; } diff --git a/manager/includes/extenders/export.class.inc.php b/manager/includes/extenders/export.class.inc.php index 6ad8ae7ee5..964586130f 100644 --- a/manager/includes/extenders/export.class.inc.php +++ b/manager/includes/extenders/export.class.inc.php @@ -1,280 +1,374 @@ exportstart = $this->get_mtime(); - $this->count = 0; - $this->setUrlMode(); - $this->dirCheckCount = 0; - $this->generate_mode = 'crawl'; - $this->targetDir = $modx->config['base_path'] . 'temp/export'; - if(!isset($this->total)) $this->getTotal(); - } - - function setExportDir($dir) - { - $dir = str_replace('\\','/',$dir); - $dir = rtrim($dir, '/'); - $this->targetDir = $dir; - } - - function get_mtime() - { - $mtime = microtime(); - $mtime = explode(' ', $mtime); - $mtime = $mtime[1] + $mtime[0]; - return $mtime; - } - - function setUrlMode() - { - global $modx; - - if($modx->config['friendly_urls']==0) - { - $modx->config['friendly_urls'] = 1; - $modx->config['use_alias_path'] = 1; - $modx->clearCache('full'); - } - $modx->config['make_folders'] = '1'; - } - - function getTotal($ignore_ids='', $noncache='0') - { - global $modx; - $tbl_site_content = $modx->getFullTableName('site_content'); - - $ignore_ids = array_filter(array_map('intval', explode(',', $ignore_ids))); - if(count($ignore_ids)>0) - { - $ignore_ids = "AND NOT id IN ('".implode("','", $ignore_ids)."')"; - } else { - $ignore_ids = ''; - } - - $this->ignore_ids = $ignore_ids; - - $noncache = ($noncache == 1) ? '' : 'AND cacheable=1'; - $where = "deleted=0 AND ((published=1 AND type='document') OR (isfolder=1)) {$noncache} {$ignore_ids}"; - $rs = $modx->db->select('count(id)',$tbl_site_content,$where); - $this->total = $modx->db->getValue($rs); - return $this->total; - } - - function removeDirectoryAll($directory='') - { - if(empty($directory)) $directory = $this->targetDir; - $directory = rtrim($directory,'/'); - // if the path is not valid or is not a directory ... - if(empty($directory)) return false; - if(strpos($directory,MODX_BASE_PATH)===false) return FALSE; - - if(!is_dir($directory)) return FALSE; - elseif(!is_readable($directory)) return FALSE; - else - { - $files = glob($directory . '/*'); - if(!empty($files)) - { - foreach($files as $path) - { - if(is_dir($path)) $this->removeDirectoryAll($path); - else $rs = unlink($path); - } - } - } - if($directory !== $this->targetDir) $rs = rmdir($directory); - - return $rs; - } - - function makeFile($docid, $filepath) - { - global $modx,$_lang; - $file_permission = octdec($modx->config['new_file_permissions']); - if($this->generate_mode==='direct') - { - $back_lang = $_lang; - $src = $modx->executeParser($docid); - - $_lang = $back_lang; - } - else $src = $this->curl_get_contents(MODX_SITE_URL . "index.php?id={$docid}"); - - - if($src !== false) - { - if($this->repl_before!==$this->repl_after) $src = str_replace($this->repl_before,$this->repl_after,$src); - $result = file_put_contents($filepath,$src); - if($result!==false) @chmod($filepath, $file_permission); - - if($result !== false) return 'success'; - else return 'failed_no_write'; - } - else return 'failed_no_retrieve'; - } - - function getFileName($docid, $alias='', $prefix, $suffix) - { - global $modx; - - if($alias==='') $filename = $prefix.$docid.$suffix; - else - { - if($modx->config['suffix_mode']==='1' && strpos($alias, '.')!==false) - { - $suffix = ''; - } - $filename = $prefix.$alias.$suffix; - } - return $filename; - } - - function run($parent=0) - { - global $_lang; - global $modx; - - $tbl_site_content = $modx->getFullTableName('site_content'); - - $ignore_ids = $this->ignore_ids; - $dirpath = $this->targetDir . '/'; - - $prefix = $modx->config['friendly_url_prefix']; - $suffix = $modx->config['friendly_url_suffix']; - - $tpl = ' [+msg1+] [+msg2+]'; - $ph = array(); - - $ph['status'] = 'fail'; - $ph['msg1'] = $_lang['export_site_failed']; - $ph['msg2'] = $_lang["export_site_failed_no_write"] . ' - ' . $dirpath; - $msg_failed_no_write = $this->parsePlaceholder($tpl,$ph); - - $ph['msg2'] = $_lang["export_site_failed_no_retrieve"]; - $msg_failed_no_retrieve = $this->parsePlaceholder($tpl,$ph); - - $ph['status'] = 'success'; - $ph['msg1'] = $_lang['export_site_success']; - $ph['msg2'] = ''; - $msg_success = $this->parsePlaceholder($tpl,$ph); - - $ph['msg2'] = $_lang['export_site_success_skip_doc']; - $msg_success_skip_doc = $this->parsePlaceholder($tpl,$ph); - - $ph['msg2'] = $_lang['export_site_success_skip_dir']; - $msg_success_skip_dir = $this->parsePlaceholder($tpl,$ph); - - $fields = "id, alias, pagetitle, isfolder, (content = '' AND template = 0) AS wasNull, published"; - $noncache = $_POST['includenoncache']==1 ? '' : 'AND cacheable=1'; - $where = "parent = '{$parent}' AND deleted=0 AND ((published=1 AND type='document') OR (isfolder=1)) {$noncache} {$ignore_ids}"; - $rs = $modx->db->select($fields,$tbl_site_content,$where); - - $ph = array(); - $ph['total'] = $this->total; - $folder_permission = octdec($modx->config['new_folder_permissions']); - while($row = $modx->db->getRow($rs)) - { - $this->count++; - - $row['count'] = $this->count; - $row['url'] = $modx->makeUrl($row['id']); - - if (!$row['wasNull']) - { // needs writing a document - $docname = $this->getFileName($row['id'], $row['alias'], $prefix, $suffix); - $filename = $dirpath.$docname; - if (!is_file($filename)) - { - if($row['published']==='1') - { - $status = $this->makeFile($row['id'], $filename); - switch($status) - { - case 'failed_no_write' : - $row['status'] = $msg_failed_no_write; - break; - case 'failed_no_retrieve': - $row['status'] = $msg_failed_no_retrieve; - break; - default: - $row['status'] = $msg_success; - } - } - else $row['status'] = $msg_failed_no_retrieve; - } - else $row['status'] = $msg_success_skip_doc; - $this->output[] = $this->parsePlaceholder($_lang['export_site_exporting_document'], $row); - } - else - { - $row['status'] = $msg_success_skip_dir; - $this->output[] = $this->parsePlaceholder($_lang['export_site_exporting_document'], $row); - } - if ($row['isfolder']==='1' && ($modx->config['suffix_mode']!=='1' || strpos($row['alias'],'.')===false)) - { // needs making a folder - $end_dir = ($row['alias']!=='') ? $row['alias'] : $row['id']; - $dir_path = $dirpath . $end_dir; - if(strpos($dir_path,MODX_BASE_PATH)===false) return FALSE; - if (!is_dir($dir_path)) - { - if (is_file($dir_path)) @unlink($dir_path); - mkdir($dir_path); - @chmod($dir_path, $folder_permission); - - } - - - if($modx->config['make_folders']==='1' && $row['published']==='1') - { - if(is_file($filename)) rename($filename,$dir_path . '/index.html'); - } - $this->targetDir = $dir_path; - $this->run($row['id']); - } - } - return implode("\n", $this->output); - } - - function curl_get_contents($url, $timeout = 30 ) + /** + * @var string + */ + public $targetDir; + /** + * @var string + */ + public $generate_mode; + /** + * @var + */ + public $total; + /** + * @var int + */ + public $count; + /** + * @var + */ + public $ignore_ids; + /** + * @var array|mixed + */ + public $exportstart; + /** + * @var + */ + public $repl_before; + /** + * @var + */ + public $repl_after; + /** + * @var array + */ + public $output = array(); + /** + * @var int + */ + public $dirCheckCount = 0; + + /** + * EXPORT_SITE constructor. + */ + public function __construct() + { + global $modx; + + if (!defined('MODX_BASE_PATH')) { + return false; + } + $this->exportstart = $this->get_mtime(); + $this->count = 0; + $this->setUrlMode(); + $this->generate_mode = 'crawl'; + $this->targetDir = $modx->config['base_path'] . 'temp/export'; + if (!isset($this->total)) { + $this->getTotal(); + } + } + + /** + * @param string $dir + */ + public function setExportDir($dir) + { + $dir = str_replace('\\', '/', $dir); + $dir = rtrim($dir, '/'); + $this->targetDir = $dir; + } + + /** + * @return int + */ + public function get_mtime() + { + $mtime = microtime(); + $mtime = explode(' ', $mtime); + $mtime = $mtime[1] + $mtime[0]; + + return $mtime; + } + + /** + * @return void + */ + public function setUrlMode() + { + global $modx; + + if ($modx->config['friendly_urls'] == 0) { + $modx->config['friendly_urls'] = 1; + $modx->config['use_alias_path'] = 1; + $modx->clearCache('full'); + } + $modx->config['make_folders'] = '1'; + } + + /** + * @param string|array $ignore_ids + * @param string|int|bool $noncache + * @return int + */ + public function getTotal($ignore_ids = '', $noncache = '0') + { + global $modx; + $tbl_site_content = $modx->getFullTableName('site_content'); + + $ignore_ids = array_filter(array_map('intval', explode(',', $ignore_ids))); + if (count($ignore_ids) > 0) { + $ignore_ids = "AND NOT id IN ('" . implode("','", $ignore_ids) . "')"; + } else { + $ignore_ids = ''; + } + + $this->ignore_ids = $ignore_ids; + + $noncache = ($noncache == 1) ? '' : 'AND cacheable=1'; + $where = "deleted=0 AND ((published=1 AND type='document') OR (isfolder=1)) {$noncache} {$ignore_ids}"; + $rs = $modx->db->select('count(id)', $tbl_site_content, $where); + $this->total = (int)$modx->db->getValue($rs); + + return $this->total; + } + + /** + * @param string $directory + * @return bool + */ + public function removeDirectoryAll($directory = '') + { + $rs = false; + if (empty($directory)) { + $directory = $this->targetDir; + } + $directory = rtrim($directory, '/'); + // if the path is not valid or is not a directory ... + if (empty($directory)) { + return false; + } + if (strpos($directory, MODX_BASE_PATH) === false) { + return $rs; + } + + if (!is_dir($directory)) { + return $rs; + } elseif (!is_readable($directory)) { + return $rs; + } else { + $files = glob($directory . '/*'); + if (!empty($files)) { + foreach ($files as $path) { + $rs = is_dir($path) ? $this->removeDirectoryAll($path) : unlink($path); + } + } + } + if ($directory !== $this->targetDir) { + $rs = rmdir($directory); + } + + return $rs; + } + + /** + * @param int $docid + * @param string $filepath + * @return string + */ + public function makeFile($docid, $filepath) + { + global $modx, $_lang; + $file_permission = octdec($modx->config['new_file_permissions']); + if ($this->generate_mode === 'direct') { + $back_lang = $_lang; + $src = $modx->executeParser($docid); + + $_lang = $back_lang; + } else { + $src = $this->curl_get_contents(MODX_SITE_URL . "index.php?id={$docid}"); + } + + + if ($src !== false) { + if ($this->repl_before !== $this->repl_after) { + $src = str_replace($this->repl_before, $this->repl_after, $src); + } + $result = file_put_contents($filepath, $src); + if ($result !== false) { + @chmod($filepath, $file_permission); + } + + if ($result !== false) { + return 'success'; + } else { + return 'failed_no_write'; + } + } else { + return 'failed_no_retrieve'; + } + } + + /** + * @param int $docid + * @param string $alias + * @param string $prefix + * @param string $suffix + * @return string + */ + public function getFileName($docid, $alias = '', $prefix, $suffix) + { + global $modx; + + if ($alias === '') { + $filename = $prefix . $docid . $suffix; + } else { + if ($modx->config['suffix_mode'] === '1' && strpos($alias, '.') !== false) { + $suffix = ''; + } + $filename = $prefix . $alias . $suffix; + } + + return $filename; + } + + /** + * @param int $parent + * @return string + */ + public function run($parent = 0) { - if(!function_exists('curl_init')) return @file_get_contents($url); + global $_lang; + global $modx; + + $tbl_site_content = $modx->getFullTableName('site_content'); + + $ignore_ids = $this->ignore_ids; + $dirpath = $this->targetDir . '/'; + + $prefix = $modx->config['friendly_url_prefix']; + $suffix = $modx->config['friendly_url_suffix']; + + $tpl = ' [+msg1+] [+msg2+]'; + $ph = array(); + + $ph['status'] = 'fail'; + $ph['msg1'] = $_lang['export_site_failed']; + $ph['msg2'] = $_lang["export_site_failed_no_write"] . ' - ' . $dirpath; + $msg_failed_no_write = $this->parsePlaceholder($tpl, $ph); + + $ph['msg2'] = $_lang["export_site_failed_no_retrieve"]; + $msg_failed_no_retrieve = $this->parsePlaceholder($tpl, $ph); + + $ph['status'] = 'success'; + $ph['msg1'] = $_lang['export_site_success']; + $ph['msg2'] = ''; + $msg_success = $this->parsePlaceholder($tpl, $ph); + + $ph['msg2'] = $_lang['export_site_success_skip_doc']; + $msg_success_skip_doc = $this->parsePlaceholder($tpl, $ph); + + $ph['msg2'] = $_lang['export_site_success_skip_dir']; + $msg_success_skip_dir = $this->parsePlaceholder($tpl, $ph); + + $fields = "id, alias, pagetitle, isfolder, (content = '' AND template = 0) AS wasNull, published"; + $noncache = $_POST['includenoncache'] == 1 ? '' : 'AND cacheable=1'; + $where = "parent = '{$parent}' AND deleted=0 AND ((published=1 AND type='document') OR (isfolder=1)) {$noncache} {$ignore_ids}"; + $rs = $modx->db->select($fields, $tbl_site_content, $where); + + $ph = array(); + $ph['total'] = $this->total; + $folder_permission = octdec($modx->config['new_folder_permissions']); + while ($row = $modx->db->getRow($rs)) { + $this->count++; + $filename = ''; + $row['count'] = $this->count; + $row['url'] = $modx->makeUrl($row['id']); + + if (!$row['wasNull']) { // needs writing a document + $docname = $this->getFileName($row['id'], $row['alias'], $prefix, $suffix); + $filename = $dirpath . $docname; + if (!is_file($filename)) { + if ($row['published'] === '1') { + $status = $this->makeFile($row['id'], $filename); + switch ($status) { + case 'failed_no_write' : + $row['status'] = $msg_failed_no_write; + break; + case 'failed_no_retrieve': + $row['status'] = $msg_failed_no_retrieve; + break; + default: + $row['status'] = $msg_success; + } + } else { + $row['status'] = $msg_failed_no_retrieve; + } + } else { + $row['status'] = $msg_success_skip_doc; + } + $this->output[] = $this->parsePlaceholder($_lang['export_site_exporting_document'], $row); + } else { + $row['status'] = $msg_success_skip_dir; + $this->output[] = $this->parsePlaceholder($_lang['export_site_exporting_document'], $row); + } + if ($row['isfolder'] === '1' && ($modx->config['suffix_mode'] !== '1' || strpos($row['alias'], + '.') === false)) { // needs making a folder + $end_dir = ($row['alias'] !== '') ? $row['alias'] : $row['id']; + $dir_path = $dirpath . $end_dir; + if (strpos($dir_path, MODX_BASE_PATH) === false) { + return false; + } + if (!is_dir($dir_path)) { + if (is_file($dir_path)) { + @unlink($dir_path); + } + mkdir($dir_path); + @chmod($dir_path, $folder_permission); + + } + + + if ($modx->config['make_folders'] === '1' && $row['published'] === '1') { + if (!empty($filename) && is_file($filename)) { + rename($filename, $dir_path . '/index.html'); + } + } + $this->targetDir = $dir_path; + $this->run($row['id']); + } + } + + return implode("\n", $this->output); + } + + /** + * @param string $url + * @param int $timeout + * @return string + */ + public function curl_get_contents($url, $timeout = 30) + { + if (!function_exists('curl_init')) { + return @file_get_contents($url); + } $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // 0 = DO NOT VERIFY AUTHENTICITY OF SSL-CERT curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); // 2 = CERT MUST INDICATE BEING CONNECTED TO RIGHT SERVER curl_setopt($ch, CURLOPT_HEADER, false); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true ); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $result = curl_exec($ch); curl_close($ch); + return $result; } - function parsePlaceholder($tpl,$ph=array()) + public function parsePlaceholder($tpl, $ph = array()) { - foreach($ph as $k=>$v) - { - $k = "[+{$k}+]"; - $tpl = str_replace($k,$v,$tpl); - } - return $tpl; + foreach ($ph as $k => $v) { + $k = "[+{$k}+]"; + $tpl = str_replace($k, $v, $tpl); + } + + return $tpl; } } diff --git a/manager/includes/extenders/maketable.class.php b/manager/includes/extenders/maketable.class.php old mode 100755 new mode 100644 index 470ef7ed84..da273c02d0 --- a/manager/includes/extenders/maketable.class.php +++ b/manager/includes/extenders/maketable.class.php @@ -5,390 +5,480 @@ * support for pagination, sorting by any column, providing optional header arrays, * providing classes for styling the table, rows, and cells (including alternate * row styling), as well as adding form controls to each row. - * + * * @author Jason Coward (MODX) */ -class MakeTable { - var $actionField; - var $cellAction; - var $linkAction; - var $tableWidth; - var $tableClass; - var $tableID; - var $thClass; - var $rowHeaderClass; - var $columnHeaderClass; - var $rowRegularClass; - var $rowAlternateClass; - var $formName; - var $formAction; - var $formElementType; - var $formElementName; - var $rowAlternatingScheme; - var $excludeFields; - var $allOption; - var $pageNav; - var $columnWidths; - var $selectedValues; - - function __construct() { - $this->fieldHeaders= array(); - $this->excludeFields= array(); - $this->actionField= ''; - $this->cellAction= ''; - $this->linkAction= ''; - $this->tableWidth= ''; - $this->tableClass= ''; - $this->rowHeaderClass= ''; - $this->columnHeaderClass= ''; - $this->rowRegularClass= ''; - $this->rowAlternateClass= 'alt'; - $this->formName= 'tableForm'; - $this->formAction= '[~[*id*]~]'; - $this->formElementName= ''; - $this->formElementType= ''; - $this->rowAlternatingScheme= 'EVEN'; - $this->allOption= 0; - $this->selectedValues= array(); - $this->extra= ''; - } - - /** - * Sets the default link href for all cells in the table. - * - * @param $value A URL to execute when table cells are clicked. - */ - function setCellAction($value) { - $this->cellAction= $this->prepareLink($value); - } - - /** - * Sets the default link href for the text presented in a cell. - * - * @param $value A URL to execute when text within table cells are clicked. - */ - function setLinkAction($value) { - $this->linkAction= $this->prepareLink($value); - } - - /** - * Sets the width attribute of the main HTML TABLE. - * - * @param $value A valid width attribute for the HTML TABLE tag - */ - function setTableWidth($value) { - $this->tableWidth= $value; - } - - /** - * Sets the class attribute of the main HTML TABLE. - * - * @param $value A class for the main HTML TABLE. - */ - function setTableClass($value) { - $this->tableClass= $value; - } - - /** - * Sets the id attribute of the main HTML TABLE. - * - * @param $value A class for the main HTML TABLE. - */ - function setTableID($value) { - $this->tableID= $value; - } - - /** - * Sets the class attribute of the table header row. - * - * @param $value A class for the table header row. - */ - function setRowHeaderClass($value) { - $this->rowHeaderClass= $value; - } - - /** - * Sets the class attribute of the table header row. - * - * @param $value A class for the table header row. - */ - function setThHeaderClass($value) { - $this->thClass= $value; - } - - /** - * Sets the class attribute of the column header row. - * - * @param $value A class for the column header row. - */ - function setColumnHeaderClass($value) { - $this->columnHeaderClass= $value; - } - - /** - * Sets the class attribute of regular table rows. - * - * @param $value A class for regular table rows. - */ - function setRowRegularClass($value) { - $this->rowRegularClass= $value; - } - - /** - * Sets the class attribute of alternate table rows. - * - * @param $value A class for alternate table rows. - */ - function setRowAlternateClass($value) { - $this->rowAlternateClass= $value; - } - - /** - * Sets the type of INPUT form element to be presented as the first column. - * - * @param $value Indicates the INPUT form element type attribute. - */ - function setFormElementType($value) { - $this->formElementType= $value; - } - - /** - * Sets the name of the INPUT form element to be presented as the first column. - * - * @param $value Indicates the INPUT form element name attribute. - */ - function setFormElementName($value) { - $this->formElementName= $value; - } - - /** - * Sets the name of the FORM to wrap the table in when a form element has - * been indicated. - * - * @param $value Indicates the FORM name attribute. - */ - function setFormName($value) { - $this->formName= $value; - } - - /** - * Sets the action of the FORM element. - * - * @param $value Indicates the FORM action attribute. - */ - function setFormAction($value) { - $this->formAction= $value; - } - - /** - * Excludes fields from the table by array key. - * - * @param $value An Array of field keys to exclude from the table. - */ - function setExcludeFields($value) { - $this->excludeFields= $value; - } +class MakeTable +{ + /** + * @var string + */ + public $actionField = ''; + /** + * @var string + */ + public $cellAction = ''; + /** + * @var string + */ + public $linkAction = ''; + /** + * @var int + */ + public $tableWidth = 0; + /** + * @var string + */ + public $tableClass = ''; + /** + * @var + */ + public $tableID; + /** + * @var + */ + public $thClass; + /** + * @var string + */ + public $rowHeaderClass = ''; + /** + * @var string + */ + public $columnHeaderClass = ''; + /** + * @var string + */ + public $rowRegularClass = ''; + /** + * @var string + */ + public $rowAlternateClass = 'alt'; + /** + * @var string + */ + public $formName = 'tableForm'; + /** + * @var string + */ + public $formAction = '[~[*id*]~]'; + /** + * @var string + */ + public $formElementType = ''; + /** + * @var string + */ + public $formElementName = ''; + /** + * @var string + */ + public $rowAlternatingScheme = 'EVEN'; + /** + * @var array + */ + public $excludeFields = array(); + /** + * @var int + */ + public $allOption = 0; + /** + * @var + */ + public $pageNav; + /** + * @var array + */ + public $columnWidths = array(); + /** + * @var array + */ + public $selectedValues = array(); + /** + * @var array + */ + public $fieldHeaders = array(); + /** + * @var string + */ + public $extra = ''; - /** - * Sets the table to provide alternate row colors using ODD or EVEN rows - * - * @param $value 'ODD' or 'EVEN' to indicate the alternate row scheme. - */ - function setRowAlternatingScheme($value) { - $this->rowAlternatingScheme= $value; - } - - /** - * Sets the default field value to be used when appending query parameters - * to link actions. - * - * @param $value The key of the field to add as a query string parameter. - */ - function setActionFieldName($value) { - $this->actionField= $value; - } - - /** - * Sets the width attribute of each column in the array. - * - * @param $value An Array of column widths in the order of the keys in the - * source table array. - */ - function setColumnWidths($widthArray) { - $this->columnWidths= $widthArray; - } - - /** - * An optional array of values that can be preselected when using - * - * @param $value Indicates the INPUT form element type attribute. - */ - function setSelectedValues($valueArray) { - $this->selectedValues= $valueArray; - } - - /** - * Sets extra content to be presented following the table (but within - * the form, if a form is being rendered with the table). - * - * @param $value A string of additional content. - */ - function setExtra($value) { - $this->extra= $value; - } - - /** - * Retrieves the width of a specific table column by index position. - * - * @param $columnPosition The index of the column to get the width for. - */ - function getColumnWidth($columnPosition) { - $currentWidth= ''; - if (is_array($this->columnWidths)) { - $currentWidth= $this->columnWidths[$columnPosition] ? ' width="'.$this->columnWidths[$columnPosition].'" ' : ''; - } - return $currentWidth; - } - - /** - * Determines what class the current row should have applied. - * - * @param $value The position of the current row being rendered. - */ - function determineRowClass($position) { - switch ($this->rowAlternatingScheme) { - case 'ODD' : - $modRemainder= 1; - break; - case 'EVEN' : - $modRemainder= 0; - break; - } - if ($position % 2 == $modRemainder) { - $currentClass= $this->rowRegularClass; - } else { - $currentClass= $this->rowAlternateClass; - } - return ' class="'.$currentClass.'"'; - } - - /** - * Generates an onclick action applied to the current cell, to execute - * any specified cell actions. - * - * @param $value Indicates the INPUT form element type attribute. - */ - function getCellAction($currentActionFieldValue) { - if ($this->cellAction) { - $cellAction= ' onClick="javascript:window.location=\''.$this->cellAction.$this->actionField.'='.urlencode($currentActionFieldValue).'\'" '; - } - return $cellAction; - } - - /** - * Generates the cell content, including any specified action fields values. - * - * @param $currentActionFieldValue The value to be applied to the link action. - * @param $value The value of the cell. - */ - function createCellText($currentActionFieldValue, $value) { - $cell .= $value; - if ($this->linkAction) { - $cell= ''.$cell.''; - } - return $cell; - } - - /** - * Sets an option to generate a check all link when checkbox is indicated - * as the table formElementType. - */ - function setAllOption() { - $this->allOption= 1; - } - - /** - * Function to prepare a link generated in the table cell/link actions. - * - * @param $value Indicates the INPUT form element type attribute. - */ - function prepareLink($link) { - if (strstr($link, '?')) { - $end= '&'; - } else { - $end= '?'; - } - return $link.$end; - } - - /** - * Generates the table content. - * - * @param $fieldsArray The associative array representing the table rows - * and columns. - * @param $fieldHeadersArray An optional array of values for providing - * alternative field headers; this is an associative arrays of keys from - * the $fieldsArray where the values represent the alt heading content - * for each column. - */ - function create($fieldsArray, $fieldHeadersArray=array(),$linkpage="") { - global $_lang; - if (is_array($fieldsArray)) { - $i= 0; - foreach ($fieldsArray as $fieldName => $fieldValue) { - $table .= "\tdetermineRowClass($i).">\n"; - $currentActionFieldValue= $fieldValue[$this->actionField]; - if (is_array($this->selectedValues)) { - $isChecked= array_search($currentActionFieldValue, $this->selectedValues)===false? 0 : 1; - } else { - $isChecked= false; - } - $table .= $this->addFormField($currentActionFieldValue, $isChecked); - $colPosition= 0; - foreach ($fieldValue as $key => $value) { - if (!in_array($key, $this->excludeFields)) { - $table .= "\t\tgetCellAction($currentActionFieldValue).">"; - $table .= $this->createCellText($currentActionFieldValue, $value); - $table .= "\n"; - if ($i == 0) { - if (empty ($header) && $this->formElementType) { - $header .= "\t\tthClass ? 'class="'.$this->thClass.'"' : '').">". ($this->allOption ? 'all' : '')."\n"; - } - $headerText= array_key_exists($key, $fieldHeadersArray)? $fieldHeadersArray[$key]: $key; - $header .= "\t\tgetColumnWidth($colPosition).($this->thClass ? ' class="'.$this->thClass.'" ' : '').">".$headerText."\n"; - } - $colPosition ++; - } - } - $i ++; - $table .= "\t\n"; - } - $table= "\n".'tableWidth ? ' width="'.$this->tableWidth.'"' : ''). ($this->tableClass ? ' class="'.$this->tableClass.'"' : ''). ($this->tableID ? ' id="'.$this->tableID.'"' : '').">\n". ($header ? "\t\n\trowHeaderClass."\">\n".$header."\t\n\t\n" : '').$table."\n"; - if ($this->formElementType) { - $table= "\n".'
      '.$table; - } - if (strlen($this->pageNav) > 1) {//changed to display the pagination if exists. - /* commented this part because of cookie - $table .= '
      '.$_lang["pagination_table_perpage"].'
      '; - */ - $table .= ''; - //$table .= ''; + /** + * Sets the default link href for all cells in the table. + * + * @param string $value A URL to execute when table cells are clicked. + */ + public function setCellAction($value) + { + $this->cellAction = $this->prepareLink($value); + } - } - if ($this->allOption) { - $table .= ' + /** + * Sets the default link href for the text presented in a cell. + * + * @param string $value A URL to execute when text within table cells are clicked. + */ + public function setLinkAction($value) + { + $this->linkAction = $this->prepareLink($value); + } + + /** + * Sets the width attribute of the main HTML TABLE. + * + * @param int $value A valid width attribute for the HTML TABLE tag + */ + public function setTableWidth($value) + { + $this->tableWidth = (int)$value; + } + + /** + * Sets the class attribute of the main HTML TABLE. + * + * @param string $value A class for the main HTML TABLE. + */ + public function setTableClass($value) + { + $this->tableClass = $value; + } + + /** + * Sets the id attribute of the main HTML TABLE. + * + * @param string $value A class for the main HTML TABLE. + */ + public function setTableID($value) + { + $this->tableID = $value; + } + + /** + * Sets the class attribute of the table header row. + * + * @param string $value A class for the table header row. + */ + public function setRowHeaderClass($value) + { + $this->rowHeaderClass = $value; + } + + /** + * Sets the class attribute of the table header row. + * + * @param string $value A class for the table header row. + */ + public function setThHeaderClass($value) + { + $this->thClass = $value; + } + + /** + * Sets the class attribute of the column header row. + * + * @param string $value A class for the column header row. + */ + public function setColumnHeaderClass($value) + { + $this->columnHeaderClass = $value; + } + + /** + * Sets the class attribute of regular table rows. + * + * @param string $value A class for regular table rows. + */ + public function setRowRegularClass($value) + { + $this->rowRegularClass = $value; + } + + /** + * Sets the class attribute of alternate table rows. + * + * @param string $value A class for alternate table rows. + */ + public function setRowAlternateClass($value) + { + $this->rowAlternateClass = $value; + } + + /** + * Sets the type of INPUT form element to be presented as the first column. + * + * @param string $value Indicates the INPUT form element type attribute. + */ + public function setFormElementType($value) + { + $this->formElementType = $value; + } + + /** + * Sets the name of the INPUT form element to be presented as the first column. + * + * @param string $value Indicates the INPUT form element name attribute. + */ + public function setFormElementName($value) + { + $this->formElementName = $value; + } + + /** + * Sets the name of the FORM to wrap the table in when a form element has + * been indicated. + * + * @param string $value Indicates the FORM name attribute. + */ + public function setFormName($value) + { + $this->formName = $value; + } + + /** + * Sets the action of the FORM element. + * + * @param string $value Indicates the FORM action attribute. + */ + public function setFormAction($value) + { + $this->formAction = $value; + } + + /** + * Excludes fields from the table by array key. + * + * @param array $value An Array of field keys to exclude from the table. + */ + public function setExcludeFields($value) + { + $this->excludeFields = $value; + } + + /** + * Sets the table to provide alternate row colors using ODD or EVEN rows + * + * @param string $value 'ODD' or 'EVEN' to indicate the alternate row scheme. + */ + public function setRowAlternatingScheme($value) + { + $this->rowAlternatingScheme = $value; + } + + /** + * Sets the default field value to be used when appending query parameters + * to link actions. + * + * @param string $value The key of the field to add as a query string parameter. + */ + public function setActionFieldName($value) + { + $this->actionField = $value; + } + + /** + * Sets the width attribute of each column in the array. + * + * @param array $value An Array of column widths in the order of the keys in the + * source table array. + */ + public function setColumnWidths($widthArray) + { + $this->columnWidths = $widthArray; + } + + /** + * An optional array of values that can be preselected when using + * + * @param array $value Indicates the INPUT form element type attribute. + */ + public function setSelectedValues($valueArray) + { + $this->selectedValues = $valueArray; + } + + /** + * Sets extra content to be presented following the table (but within + * the form, if a form is being rendered with the table). + * + * @param string $value A string of additional content. + */ + public function setExtra($value) + { + $this->extra = $value; + } + + /** + * Retrieves the width of a specific table column by index position. + * + * @param int $columnPosition The index of the column to get the width for. + * @return string + */ + public function getColumnWidth($columnPosition) + { + $currentWidth = ''; + if (is_array($this->columnWidths)) { + $currentWidth = $this->columnWidths[$columnPosition] ? ' width="' . $this->columnWidths[$columnPosition] . '" ' : ''; + } + + return $currentWidth; + } + + /** + * Determines what class the current row should have applied. + * + * @param int $value The position of the current row being rendered. + * @return string + */ + public function determineRowClass($position) + { + switch ($this->rowAlternatingScheme) { + case 'ODD' : + $modRemainder = 1; + break; + case 'EVEN' : + default: + $modRemainder = 0; + break; + } + if ($position % 2 == $modRemainder) { + $currentClass = $this->rowRegularClass; + } else { + $currentClass = $this->rowAlternateClass; + } + + return ' class="' . $currentClass . '"'; + } + + /** + * Generates an onclick action applied to the current cell, to execute + * any specified cell actions. + * + * @param string $value Indicates the INPUT form element type attribute. + * @return string + */ + public function getCellAction($currentActionFieldValue) + { + $cellAction = ''; + if ($this->cellAction) { + $cellAction = ' onClick="javascript:window.location=\'' . $this->cellAction . $this->actionField . '=' . urlencode($currentActionFieldValue) . '\'" '; + } + + return $cellAction; + } + + /** + * Generates the cell content, including any specified action fields values. + * + * @param string $currentActionFieldValue The value to be applied to the link action. + * @param string $value The value of the cell. + * @return string + */ + public function createCellText($currentActionFieldValue, $value) + { + $cell = $value; + if ($this->linkAction) { + $cell = '' . $cell . ''; + } + + return $cell; + } + + /** + * Sets an option to generate a check all link when checkbox is indicated + * as the table formElementType. + */ + public function setAllOption() + { + $this->allOption = 1; + } + + /** + * Function to prepare a link generated in the table cell/link actions. + * + * @param string $value Indicates the INPUT form element type attribute. + * @return string + */ + public function prepareLink($link) + { + if (strstr($link, '?')) { + $end = '&'; + } else { + $end = '?'; + } + + return $link . $end; + } + + /** + * Generates the table content. + * + * @param array $fieldsArray The associative array representing the table rows + * and columns. + * @param array $fieldHeadersArray An optional array of values for providing + * alternative field headers; this is an associative arrays of keys from + * the $fieldsArray where the values represent the alt heading content + * for each column. + * @return string + */ + public function create($fieldsArray, $fieldHeadersArray = array(), $linkpage = "") + { + global $_lang; + if (is_array($fieldsArray)) { + $i = 0; + foreach ($fieldsArray as $fieldName => $fieldValue) { + $table .= "\tdetermineRowClass($i) . ">\n"; + $currentActionFieldValue = $fieldValue[$this->actionField]; + if (is_array($this->selectedValues)) { + $isChecked = array_search($currentActionFieldValue, $this->selectedValues) === false ? 0 : 1; + } else { + $isChecked = false; + } + $table .= $this->addFormField($currentActionFieldValue, $isChecked); + $colPosition = 0; + foreach ($fieldValue as $key => $value) { + if (!in_array($key, $this->excludeFields)) { + $table .= "\t\tgetCellAction($currentActionFieldValue) . ">"; + $table .= $this->createCellText($currentActionFieldValue, $value); + $table .= "\n"; + if ($i == 0) { + if (empty ($header) && $this->formElementType) { + $header .= "\t\tthClass ? 'class="' . $this->thClass . '"' : '') . ">" . ($this->allOption ? 'all' : '') . "\n"; + } + $headerText = array_key_exists($key, $fieldHeadersArray) ? $fieldHeadersArray[$key] : $key; + $header .= "\t\tgetColumnWidth($colPosition) . ($this->thClass ? ' class="' . $this->thClass . '" ' : '') . ">" . $headerText . "\n"; + } + $colPosition++; + } + } + $i++; + $table .= "\t\n"; + } + $table = "\n" . 'tableWidth > 0 ? ' width="' . $this->tableWidth . '"' : '') . ($this->tableClass ? ' class="' . $this->tableClass . '"' : '') . ($this->tableID ? ' id="' . $this->tableID . '"' : '') . ">\n" . ($header ? "\t\n\trowHeaderClass . "\">\n" . $header . "\t\n\t\n" : '') . $table . "\n"; + if ($this->formElementType) { + $table = "\n" . '' . $table; + } + if (strlen($this->pageNav) > 1) {//changed to display the pagination if exists. + /* commented this part because of cookie + $table .= '
      '.$_lang["pagination_table_perpage"].'
      '; + */ + $table .= ''; + //$table .= ''; + + } + if ($this->allOption) { + $table .= ' '; - } - if ($this->formElementType) { - if ($this->extra) { - $table.= "\n".$this->extra."\n"; - } - $table.= "\n".''."\n"; - } - return $table; - } - } - - /** - * Generates optional paging navigation controls for the table. - * - * @param $numRecords The number of records to show per page. - * @param $qs An optional query string to be appended to the paging links - */ - function createPagingNavigation($numRecords, $qs='') { - global $_lang; - $currentPage= (is_numeric($_GET['page']) ? $_GET['page'] : 1); - $numPages= ceil($numRecords / MAX_DISPLAY_RECORDS_NUM); - if ($numPages > 1) { - $currentURL= empty($qs)? '': '?'.$qs; - if ($currentPage > 6) { - $nav .= $this->createPageLink($currentURL, 1, $_lang["pagination_table_first"]); - } - if ($currentPage != 1) { - $nav .= $this->createPageLink($currentURL, $currentPage -1, '<<'); - } - $offset= -4 + ($currentPage < 5 ? (5 - $currentPage) : 0); - $i= 1; - while ($i < 10 && ($currentPage + $offset <= $numPages)) { - if ($currentPage == $currentPage + $offset) - $nav .= $this->createPageLink($currentURL, $currentPage + $offset, $currentPage + $offset, true); - else - $nav .= $this->createPageLink($currentURL, $currentPage + $offset, $currentPage + $offset); - $i ++; - $offset ++; - } - if ($currentPage < $numPages) { - $nav .= $this->createPageLink($currentURL, $currentPage +1, '>>'); - } - if ($currentPage != $numPages) { - $nav .= $this->createPageLink($currentURL, $numPages, $_lang["pagination_table_last"]); - } - } - $this->pageNav= ' '.$nav; - } - - /** - * Creates an individual page link for the paging navigation. - * - * @param $link The link for the page, defaulted to the current document. - * @param $pageNum The page number of the link. - * @param $displayText The text of the link. - * @param $currentPage Indicates if the link is to the current page. - * @param $qs And optional query string to be appended to the link. - */ - function createPageLink($link='', $pageNum, $displayText, $currentPage=false, $qs='') { - global $modx; - $orderBy= !empty($_GET['orderby'])? '&orderby=' . $_GET['orderby']: ''; - $orderDir= !empty($_GET['orderdir'])? '&orderdir=' . $_GET['orderdir']: ''; - if (!empty($qs)) $qs= "?$qs"; - $link= empty($link)? $modx->makeUrl($modx->documentIdentifier, $modx->documentObject['alias'], $qs . "page=$pageNum$orderBy$orderDir"): $this->prepareLink($link) . "page=$pageNum"; - $nav .= ''.$displayText.''."\n"; - return $nav; - } - - /** - * Adds an INPUT form element column to the table. - * - * @param $value The value attribute of the element. - * @param $isChecked Indicates if the checked attribute should apply to the - * element. - */ - function addFormField($value, $isChecked) { - if ($this->formElementType) { - $checked= $isChecked? "checked ": ""; - $field= "\t\t".''."\n"; - } - return $field; - } - - /** - * Generates the proper LIMIT clause for queries to retrieve paged results in - * a MakeTable $fieldsArray. - */ - function handlePaging() { - $offset= (is_numeric($_GET['page']) && $_GET['page'] > 0) ? $_GET['page'] - 1 : 0; - $limitClause= ' LIMIT '. ($offset * MAX_DISPLAY_RECORDS_NUM).', '.MAX_DISPLAY_RECORDS_NUM; - return $limitClause; - } - - /** - * Generates the SORT BY clause for queries used to retrieve a MakeTable - * $fieldsArray - * - * @param $natural_order If true, the results are returned in natural order. - */ - function handleSorting($natural_order=false) { - $orderByClause= ''; - if (!$natural_order) { - $orderby= !empty($_GET['orderby'])? $_GET['orderby']: "id"; - $orderdir= !empty($_GET['orderdir'])? $_GET['orderdir']: "DESC"; - $orderbyClause= !empty($orderby)? ' ORDER BY ' . $orderby . ' ' . $orderdir . ' ': ""; - } - return $orderbyClause; - } - - /** - * Generates a link to order by a specific $fieldsArray key; use to generate - * sort by links in the MakeTable $fieldHeadingsArray values. - * - * @param $key The $fieldsArray key for the column to sort by. - * @param $text The text for the link (e.g. table column header). - * @param $qs An optional query string to append to the order by link. - */ - function prepareOrderByLink($key, $text, $qs='') { - global $modx; - if (!empty($_GET['orderdir'])) { - $orderDir= strtolower($_GET['orderdir'])=='desc'? '&orderdir=asc': '&orderdir=desc'; - } else { - $orderDir= '&orderdir=asc'; - } - if (!empty($qs)) { - if (!strrpos($qs, '&')==strlen($qs)-1) $qs.= '&'; - } - return ''.$text.''; - } - + } + if ($this->formElementType) { + if ($this->extra) { + $table .= "\n" . $this->extra . "\n"; + } + $table .= "\n" . '' . "\n"; + } + + return $table; + } + + return ''; + } + + /** + * Generates optional paging navigation controls for the table. + * + * @param int $numRecords The number of records to show per page. + * @param string $qs An optional query string to be appended to the paging links + * @return void + */ + public function createPagingNavigation($numRecords, $qs = '') + { + global $_lang; + $currentPage = (is_numeric($_GET['page']) ? $_GET['page'] : 1); + $numPages = ceil($numRecords / MAX_DISPLAY_RECORDS_NUM); + $nav = ''; + if ($numPages > 1) { + $currentURL = empty($qs) ? '' : '?' . $qs; + if ($currentPage > 6) { + $nav .= $this->createPageLink($currentURL, 1, $_lang["pagination_table_first"]); + } + if ($currentPage != 1) { + $nav .= $this->createPageLink($currentURL, $currentPage - 1, '<<'); + } + $offset = -4 + ($currentPage < 5 ? (5 - $currentPage) : 0); + $i = 1; + while ($i < 10 && ($currentPage + $offset <= $numPages)) { + if ($currentPage == $currentPage + $offset) { + $nav .= $this->createPageLink($currentURL, $currentPage + $offset, $currentPage + $offset, true); + } else { + $nav .= $this->createPageLink($currentURL, $currentPage + $offset, $currentPage + $offset); + } + $i++; + $offset++; + } + if ($currentPage < $numPages) { + $nav .= $this->createPageLink($currentURL, $currentPage + 1, '>>'); + } + if ($currentPage != $numPages) { + $nav .= $this->createPageLink($currentURL, $numPages, $_lang["pagination_table_last"]); + } + } + $this->pageNav = ' ' . $nav; + } + + /** + * Creates an individual page link for the paging navigation. + * + * @param string $link The link for the page, defaulted to the current document. + * @param int $pageNum The page number of the link. + * @param string $displayText The text of the link. + * @param bool $currentPage Indicates if the link is to the current page. + * @param string $qs And optional query string to be appended to the link. + * @return string + */ + public function createPageLink($link = '', $pageNum, $displayText, $currentPage = false, $qs = '') + { + global $modx; + $orderBy = !empty($_GET['orderby']) ? '&orderby=' . $_GET['orderby'] : ''; + $orderDir = !empty($_GET['orderdir']) ? '&orderdir=' . $_GET['orderdir'] : ''; + if (!empty($qs)) { + $qs = "?$qs"; + } + $link = empty($link) ? $modx->makeUrl($modx->documentIdentifier, $modx->documentObject['alias'], + $qs . "page=$pageNum$orderBy$orderDir") : $this->prepareLink($link) . "page=$pageNum"; + $nav = '' . $displayText . '' . "\n"; + + return $nav; + } + + /** + * Adds an INPUT form element column to the table. + * + * @param string $value The value attribute of the element. + * @param bool $isChecked Indicates if the checked attribute should apply to the + * element. + * @return string + */ + public function addFormField($value, $isChecked) + { + $field = ''; + if ($this->formElementType) { + $checked = $isChecked ? "checked " : ""; + $field = "\t\t" . '' . "\n"; + } + + return $field; + } + + /** + * Generates the proper LIMIT clause for queries to retrieve paged results in + * a MakeTable $fieldsArray. + * @return string + */ + public function handlePaging() + { + $offset = (is_numeric($_GET['page']) && $_GET['page'] > 0) ? $_GET['page'] - 1 : 0; + $limitClause = ' LIMIT ' . ($offset * MAX_DISPLAY_RECORDS_NUM) . ', ' . MAX_DISPLAY_RECORDS_NUM; + + return $limitClause; + } + + /** + * Generates the SORT BY clause for queries used to retrieve a MakeTable + * $fieldsArray + * + * @param bool $natural_order If true, the results are returned in natural order. + * @return string + */ + public function handleSorting($natural_order = false) + { + $orderByClause = ''; + if ((bool)$natural_order === false) { + $orderby = !empty($_GET['orderby']) ? $_GET['orderby'] : "id"; + $orderdir = !empty($_GET['orderdir']) ? $_GET['orderdir'] : "DESC"; + $orderByClause = !empty($orderby) ? ' ORDER BY ' . $orderby . ' ' . $orderdir . ' ' : ""; + } + + return $orderByClause; + } + + /** + * Generates a link to order by a specific $fieldsArray key; use to generate + * sort by links in the MakeTable $fieldHeadingsArray values. + * + * @param string $key The $fieldsArray key for the column to sort by. + * @param string $text The text for the link (e.g. table column header). + * @param string $qs An optional query string to append to the order by link. + * @return string + */ + public function prepareOrderByLink($key, $text, $qs = '') + { + global $modx; + if (!empty($_GET['orderdir'])) { + $orderDir = strtolower($_GET['orderdir']) == 'desc' ? '&orderdir=asc' : '&orderdir=desc'; + } else { + $orderDir = '&orderdir=asc'; + } + if (!empty($qs)) { + if (!strrpos($qs, '&') == strlen($qs) - 1) { + $qs .= '&'; + } + } + + return '' . $text . ''; + } + } -?> \ No newline at end of file diff --git a/manager/includes/extenders/manager.api.class.inc.php b/manager/includes/extenders/manager.api.class.inc.php index bf7498e527..4d2efe2e6f 100644 --- a/manager/includes/extenders/manager.api.class.inc.php +++ b/manager/includes/extenders/manager.api.class.inc.php @@ -8,258 +8,389 @@ global $_PAGE; // page view state object. Usage $_PAGE['vs']['propertyname'] = $value; // Content manager wrapper class -class ManagerAPI { - - var $action; // action directive - - function __construct(){ - global $action; - $this->action = $action; // set action directive - } - - function initPageViewState($id=0){ - global $_PAGE; - $vsid = isset($_SESSION["mgrPageViewSID"]) ? $_SESSION["mgrPageViewSID"] : ''; - if($vsid!=$this->action) { - $_SESSION["mgrPageViewSDATA"] = array(); // new view state - $_SESSION["mgrPageViewSID"] = $id>0 ? $id:$this->action; // set id - } - $_PAGE['vs'] = &$_SESSION["mgrPageViewSDATA"]; // restore viewstate - } - - // save page view state - not really necessary, - function savePageViewState($id=0){ - global $_PAGE; - $_SESSION["mgrPageViewSDATA"] = $_PAGE['vs']; - $_SESSION["mgrPageViewSID"] = $id>0 ? $id:$this->action; - } - - // check for saved form - function hasFormValues() { - if(isset($_SESSION["mgrFormValueId"])) { - if($this->action==$_SESSION["mgrFormValueId"]) { - return true; - } - else { - $this->clearSavedFormValues(); - } - } - return false; - } - // saved form post from $_POST - function saveFormValues($id=0){ - $_SESSION["mgrFormValues"] = $_POST; - $_SESSION["mgrFormValueId"] = $id>0 ? $id:$this->action; - } - // load saved form values into $_POST - function loadFormValues(){ - - if(!$this->hasFormValues()) return false; - - $p = $_SESSION["mgrFormValues"]; - $this->clearSavedFormValues(); - foreach($p as $k=>$v) { - $_POST[$k]=$v; - } - return true; - } - // clear form post - function clearSavedFormValues(){ - unset($_SESSION["mgrFormValues"]); - unset($_SESSION["mgrFormValueId"]); - } - - function getHashType($db_value='') { // md5 | v1 | phpass - $c = substr($db_value,0,1); - if($c==='$') return 'phpass'; - elseif(strlen($db_value)===32) return 'md5'; - elseif($c!=='$' && strpos($db_value,'>')!==false) return 'v1'; - else return 'unknown'; - } - - function genV1Hash($password, $seed='1') - { // $seed is user_id basically - global $modx; - - if(isset($modx->config['pwd_hash_algo']) && !empty($modx->config['pwd_hash_algo'])) - $algorithm = $modx->config['pwd_hash_algo']; - else $algorithm = 'UNCRYPT'; - - $salt = md5($password . $seed); - - switch($algorithm) - { - case 'BLOWFISH_Y': - $salt = '$2y$07$' . substr($salt,0,22); - break; - case 'BLOWFISH_A': - $salt = '$2a$07$' . substr($salt,0,22); - break; - case 'SHA512': - $salt = '$6$' . substr($salt,0,16); - break; - case 'SHA256': - $salt = '$5$' . substr($salt,0,16); - break; - case 'MD5': - $salt = '$1$' . substr($salt,0,8); - break; - } - - if($algorithm!=='UNCRYPT') - { - $password = sha1($password) . crypt($password,$salt); - } - else $password = sha1($salt.$password); - - $result = strtolower($algorithm) . '>' . md5($salt.$password) . substr(md5($salt),0,8); - - return $result; - } - - function getV1UserHashAlgorithm($uid) - { - global $modx; - $tbl_manager_users = $modx->getFullTableName('manager_users'); - $rs = $modx->db->select('password',$tbl_manager_users,"id='{$uid}'"); - $password = $modx->db->getValue($rs); - - if(strpos($password,'>')===false) $algo = 'NOSALT'; - else - { - $algo = substr($password,0,strpos($password,'>')); - } - return strtoupper($algo); - } - - function checkHashAlgorithm($algorithm='') - { - $result = false; - if (!empty($algorithm)) - { - switch ($algorithm) - { - case 'BLOWFISH_Y': - if (defined('CRYPT_BLOWFISH') && CRYPT_BLOWFISH == 1) - { - if (version_compare('5.3.7', PHP_VERSION) <= 0) $result = true; - } - break; - case 'BLOWFISH_A': - if (defined('CRYPT_BLOWFISH') && CRYPT_BLOWFISH == 1) $result = true; - break; - case 'SHA512': - if (defined('CRYPT_SHA512') && CRYPT_SHA512 == 1) $result = true; - break; - case 'SHA256': - if (defined('CRYPT_SHA256') && CRYPT_SHA256 == 1) $result = true; - break; - case 'MD5': - if (defined('CRYPT_MD5') && CRYPT_MD5 == 1 && PHP_VERSION != '5.3.7') $result = true; - break; - case 'UNCRYPT': - $result = true; - break; - } - } - return $result; - } - - function getSystemChecksum($check_files) { - $_ = array(); - $check_files = trim($check_files); - $check_files = explode("\n", $check_files); - foreach($check_files as $file) { - $file = trim($file); - $file = MODX_BASE_PATH . $file; - if(!is_file($file)) continue; - $_[$file]= md5_file($file); - } - return serialize($_); - } - - function getModifiedSystemFilesList($check_files, $checksum) { - $_ = array(); - $check_files = trim($check_files); - $check_files = explode("\n", $check_files); - $checksum = unserialize($checksum); - foreach($check_files as $file) { - $file = trim($file); - $filePath = MODX_BASE_PATH . $file; - if(!is_file($filePath)) continue; - if(md5_file($filePath) != $checksum[$filePath]) $_[] = $file; - } - return $_; - } - - function setSystemChecksum($checksum) { - global $modx; - $tbl_system_settings = $modx->getFullTableName('system_settings'); - $sql = "REPLACE INTO {$tbl_system_settings} (setting_name, setting_value) VALUES ('sys_files_checksum','" . $modx->db->escape($checksum) . "')"; +class ManagerAPI +{ + /** + * @var string + */ + public $action; // action directive + + /** + * ManagerAPI constructor. + */ + public function __construct() + { + global $action; + $this->action = $action; // set action directive + } + + /** + * @param int $id + */ + public function initPageViewState($id = 0) + { + global $_PAGE; + $vsid = isset($_SESSION["mgrPageViewSID"]) ? $_SESSION["mgrPageViewSID"] : ''; + if ($vsid != $this->action) { + $_SESSION["mgrPageViewSDATA"] = array(); // new view state + $_SESSION["mgrPageViewSID"] = $id > 0 ? $id : $this->action; // set id + } + $_PAGE['vs'] = &$_SESSION["mgrPageViewSDATA"]; // restore viewstate + } + + /** + * save page view state - not really necessary, + * + * @param int $id + */ + public function savePageViewState($id = 0) + { + global $_PAGE; + $_SESSION["mgrPageViewSDATA"] = $_PAGE['vs']; + $_SESSION["mgrPageViewSID"] = $id > 0 ? $id : $this->action; + } + + /** + * check for saved form + * + * @return bool + */ + public function hasFormValues() + { + if (isset($_SESSION["mgrFormValueId"])) { + if ($this->action == $_SESSION["mgrFormValueId"]) { + return true; + } else { + $this->clearSavedFormValues(); + } + } + + return false; + } + + /** + * saved form post from $_POST + * + * @param int $id + */ + public function saveFormValues($id = 0) + { + $_SESSION["mgrFormValues"] = $_POST; + $_SESSION["mgrFormValueId"] = $id > 0 ? $id : $this->action; + } + + /** + * load saved form values into $_POST + * + * @return bool + */ + public function loadFormValues() + { + + if (!$this->hasFormValues()) { + return false; + } + + $p = $_SESSION["mgrFormValues"]; + $this->clearSavedFormValues(); + foreach ($p as $k => $v) { + $_POST[$k] = $v; + } + + return true; + } + + /** + * clear form post + * + * @return void + */ + public function clearSavedFormValues() + { + unset($_SESSION["mgrFormValues"]); + unset($_SESSION["mgrFormValueId"]); + } + + /** + * @param string $db_value + * @return string + */ + public function getHashType($db_value = '') + { // md5 | v1 | phpass + $c = substr($db_value, 0, 1); + if ($c === '$') { + return 'phpass'; + } elseif (strlen($db_value) === 32) { + return 'md5'; + } elseif ($c !== '$' && strpos($db_value, '>') !== false) { + return 'v1'; + } else { + return 'unknown'; + } + } + + /** + * @param string $password + * @param string $seed + * @return string + */ + public function genV1Hash($password, $seed = '1') + { // $seed is user_id basically + global $modx; + + if (isset($modx->config['pwd_hash_algo']) && !empty($modx->config['pwd_hash_algo'])) { + $algorithm = $modx->config['pwd_hash_algo']; + } else { + $algorithm = 'UNCRYPT'; + } + + $salt = md5($password . $seed); + + switch ($algorithm) { + case 'BLOWFISH_Y': + $salt = '$2y$07$' . substr($salt, 0, 22); + break; + case 'BLOWFISH_A': + $salt = '$2a$07$' . substr($salt, 0, 22); + break; + case 'SHA512': + $salt = '$6$' . substr($salt, 0, 16); + break; + case 'SHA256': + $salt = '$5$' . substr($salt, 0, 16); + break; + case 'MD5': + $salt = '$1$' . substr($salt, 0, 8); + break; + } + + if ($algorithm !== 'UNCRYPT') { + $password = sha1($password) . crypt($password, $salt); + } else { + $password = sha1($salt . $password); + } + + $result = strtolower($algorithm) . '>' . md5($salt . $password) . substr(md5($salt), 0, 8); + + return $result; + } + + /** + * @param string $uid + * @return string + */ + public function getV1UserHashAlgorithm($uid) + { + global $modx; + $tbl_manager_users = $modx->getFullTableName('manager_users'); + $uid = $modx->db->escape($uid); + $rs = $modx->db->select('password', $tbl_manager_users, "id='{$uid}'"); + $password = $modx->db->getValue($rs); + + if (strpos($password, '>') === false) { + $algo = 'NOSALT'; + } else { + $algo = substr($password, 0, strpos($password, '>')); + } + + return strtoupper($algo); + } + + /** + * @param string $algorithm + * @return bool + */ + public function checkHashAlgorithm($algorithm = '') + { + $result = false; + if (!empty($algorithm)) { + switch ($algorithm) { + case 'BLOWFISH_Y': + if (defined('CRYPT_BLOWFISH') && CRYPT_BLOWFISH == 1) { + if (version_compare('5.3.7', PHP_VERSION) <= 0) { + $result = true; + } + } + break; + case 'BLOWFISH_A': + if (defined('CRYPT_BLOWFISH') && CRYPT_BLOWFISH == 1) { + $result = true; + } + break; + case 'SHA512': + if (defined('CRYPT_SHA512') && CRYPT_SHA512 == 1) { + $result = true; + } + break; + case 'SHA256': + if (defined('CRYPT_SHA256') && CRYPT_SHA256 == 1) { + $result = true; + } + break; + case 'MD5': + if (defined('CRYPT_MD5') && CRYPT_MD5 == 1 && PHP_VERSION != '5.3.7') { + $result = true; + } + break; + case 'UNCRYPT': + $result = true; + break; + } + } + + return $result; + } + + /** + * @param string $check_files + * @return string + */ + public function getSystemChecksum($check_files) + { + $_ = array(); + $check_files = trim($check_files); + $check_files = explode("\n", $check_files); + foreach ($check_files as $file) { + $file = trim($file); + $file = MODX_BASE_PATH . $file; + if (!is_file($file)) { + continue; + } + $_[$file] = md5_file($file); + } + + return serialize($_); + } + + /** + * @param string $check_files + * @param string $checksum + * @return array + */ + public function getModifiedSystemFilesList($check_files, $checksum) + { + $_ = array(); + $check_files = trim($check_files); + $check_files = explode("\n", $check_files); + $checksum = unserialize($checksum); + foreach ($check_files as $file) { + $file = trim($file); + $filePath = MODX_BASE_PATH . $file; + if (!is_file($filePath)) { + continue; + } + if (md5_file($filePath) != $checksum[$filePath]) { + $_[] = $file; + } + } + + return $_; + } + + /** + * @param string $checksum + */ + public function setSystemChecksum($checksum) + { + global $modx; + $tbl_system_settings = $modx->getFullTableName('system_settings'); + $sql = "REPLACE INTO {$tbl_system_settings} (setting_name, setting_value) VALUES ('sys_files_checksum','" . $modx->db->escape($checksum) . "')"; $modx->db->query($sql); - } - - function checkSystemChecksum() { - global $modx; - - if(!isset($modx->config['check_files_onlogin']) || empty($modx->config['check_files_onlogin'])) return '0'; - - $current = $this->getSystemChecksum($modx->config['check_files_onlogin']); - if(empty($current)) return '0'; - - if(!isset($modx->config['sys_files_checksum']) || empty($modx->config['sys_files_checksum'])) - { - $this->setSystemChecksum($current); - return '0'; - } - if($current===$modx->config['sys_files_checksum']) $result = '0'; - else { - $result = $this->getModifiedSystemFilesList($modx->config['check_files_onlogin'], $modx->config['sys_files_checksum']); - } - - return $result; - } - - function getLastUserSetting($key=false) { + } + + /** + * @return array|string + */ + public function checkSystemChecksum() + { global $modx; - - $rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$_SESSION['mgrInternalKey']}'"); - - $usersettings = array (); + + if (!isset($modx->config['check_files_onlogin']) || empty($modx->config['check_files_onlogin'])) { + return '0'; + } + + $current = $this->getSystemChecksum($modx->config['check_files_onlogin']); + if (empty($current)) { + return '0'; + } + + if (!isset($modx->config['sys_files_checksum']) || empty($modx->config['sys_files_checksum'])) { + $this->setSystemChecksum($current); + + return '0'; + } + if ($current === $modx->config['sys_files_checksum']) { + $result = '0'; + } else { + $result = $this->getModifiedSystemFilesList($modx->config['check_files_onlogin'], + $modx->config['sys_files_checksum']); + } + + return $result; + } + + /** + * @param bool|string $key + * @return null|string|array + */ + public function getLastUserSetting($key = false) + { + global $modx; + + $rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), + "user = '{$_SESSION['mgrInternalKey']}'"); + + $usersettings = array(); while ($row = $modx->db->getRow($rs)) { - if(substr($row['setting_name'], 0, 6) == '_LAST_') { + if (substr($row['setting_name'], 0, 6) == '_LAST_') { $name = substr($row['setting_name'], 6); $usersettings[$name] = $row['setting_value']; } } - - if(!$key) return $usersettings; - else return isset($usersettings[$key]) ? $usersettings[$key] : NULL; + + if ($key === false) { + return $usersettings; + } else { + return isset($usersettings[$key]) ? $usersettings[$key] : null; + } } - - function saveLastUserSetting($settings, $val='') { + + /** + * @param array $settings + * @param string $val + */ + public function saveLastUserSetting($settings, $val = '') + { global $modx; - - if(!empty($settings)) { - if(!is_array($settings)) $settings = array($settings=>$val); - + + if (!empty($settings)) { + if (!is_array($settings)) { + $settings = array($settings => $val); + } + foreach ($settings as $key => $val) { $f = array(); - $f['user'] = $_SESSION['mgrInternalKey']; - $f['setting_name'] = '_LAST_'.$key; + $f['user'] = $_SESSION['mgrInternalKey']; + $f['setting_name'] = '_LAST_' . $key; $f['setting_value'] = $val; $f = $modx->db->escape($f); - $f = "(`".implode("`, `", array_keys($f))."`) VALUES('".implode("', '", array_values($f))."')"; + $f = "(`" . implode("`, `", array_keys($f)) . "`) VALUES('" . implode("', '", array_values($f)) . "')"; $f .= " ON DUPLICATE KEY UPDATE setting_value = VALUES(setting_value)"; $modx->db->insert($f, $modx->getFullTableName('user_settings')); } } } - - function loadDatePicker($path) { + + /** + * @param $path + * @return string + */ + public function loadDatePicker($path) + { global $modx; include_once($path); $dp = new DATEPICKER(); + return $modx->mergeSettingsContent($dp->getDP()); } -} \ No newline at end of file +} diff --git a/manager/includes/extenders/message.quit.inc.php b/manager/includes/extenders/message.quit.inc.php index e03bf988af..e076ce04c2 100644 --- a/manager/includes/extenders/message.quit.inc.php +++ b/manager/includes/extenders/message.quit.inc.php @@ -1,9 +1,11 @@ INCLUDE ACCESS ERROR

      Direct access to this file prohibited."); +if(( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) && IN_PARSER_MODE!="true") { + die("INCLUDE ACCESS ERROR

      Direct access to this file prohibited."); +} $parsedMessageString = " EVO Content Manager $version » $release_date @@ -91,5 +93,3 @@ function copyToClip() $parsedMessageString .= ""; $parsedMessageString .= ""; - -?> \ No newline at end of file diff --git a/manager/includes/extenders/modifiers.class.inc.php b/manager/includes/extenders/modifiers.class.inc.php index fa701df2b0..e15250e640 100644 --- a/manager/includes/extenders/modifiers.class.inc.php +++ b/manager/includes/extenders/modifiers.class.inc.php @@ -3,28 +3,75 @@ if(!defined('MODX_CORE_PATH')) define('MODX_CORE_PATH', MODX_MANAGER_PATH.'includes/'); class MODIFIERS { - - var $placeholders = array(); - var $vars = array(); - var $tmpCache = array(); - var $bt; - var $srcValue; - var $condition = array(); - var $condModifiers; - - var $key; - var $value; - var $opt; - - function __construct() + /** + * @var array + */ + public $placeholders = array(); + /** + * @var array + */ + public $vars = array(); + /** + * @var array + */ + public $tmpCache = array(); + /** + * @var + */ + public $bt; + /** + * @var + */ + public $srcValue; + /** + * @var array + */ + public $condition = array(); + /** + * @var string + */ + public $condModifiers; + + /** + * @var + */ + public $key; + /** + * @var + */ + public $value; + /** + * @var + */ + public $opt; + /** + * @var + */ + public $elmName; + + /** + * @var array + */ + public $documentObject = array(); + + /** + * MODIFIERS constructor. + */ + public function __construct() { global $modx; - + if (function_exists('mb_internal_encoding')) mb_internal_encoding($modx->config['modx_charset']); $this->condModifiers = '=,is,eq,equals,ne,neq,notequals,isnot,isnt,not,%,isempty,isnotempty,isntempty,>=,gte,eg,gte,greaterthan,>,gt,isgreaterthan,isgt,lowerthan,<,lt,<=,lte,islte,islowerthan,islt,el,find,in,inarray,in_array,fnmatch,wcard,wcard_match,wildcard,wildcard_match,is_file,is_dir,file_exists,is_readable,is_writable,is_image,regex,preg,preg_match,memberof,mo,isinrole,ir'; } - - function phxFilter($key,$value,$modifiers) + + /** + * @param string $key + * @param string $value + * @param string $modifiers + * @return bool|mixed|string + */ + public function phxFilter($key,$value,$modifiers) { global $modx; if(substr($modifiers,0,3)!=='id(') $value = $this->parseDocumentSource($value); @@ -33,7 +80,7 @@ function phxFilter($key,$value,$modifiers) $modifiers = ':'.trim($modifiers,':'); $modifiers = str_replace(array("\r\n","\r"), "\n", $modifiers); $modifiers = $this->splitEachModifiers($modifiers); - + $this->placeholders = array(); $this->placeholders['phx'] = ''; $this->placeholders['dummy'] = ''; @@ -44,27 +91,38 @@ function phxFilter($key,$value,$modifiers) $this->vars = array(); return $value; } - - function _getDelim($mode,$modifiers) { + + /** + * @param string $mode + * @param string $modifiers + * @return bool|string + */ + public function _getDelim($mode,$modifiers) { $c = substr($modifiers,0,1); if(!in_array($c, array('"', "'", '`')) ) return false; - + $modifiers = substr($modifiers,1); $closure = $mode=='(' ? "{$c})" : $c; if(strpos($modifiers, $closure)===false) return false; - + return $c; } - - function _getOpt($mode,$delim,$modifiers) { + + /** + * @param string $mode + * @param string $delim + * @param string $modifiers + * @return bool|string + */ + public function _getOpt($mode,$delim,$modifiers) { if($delim) { if($mode=='(') return substr($modifiers,1,strpos($modifiers, $delim . ')' )-1); - + return substr($modifiers,1,strpos($modifiers,$delim,1)-1); } else { if($mode=='(') return substr($modifiers,0,strpos($modifiers, ')') ); - + $chars = str_split($modifiers); $opt=''; foreach($chars as $c) { @@ -74,7 +132,7 @@ function _getOpt($mode,$delim,$modifiers) { return $opt; } } - function _getRemainModifiers($mode,$delim,$modifiers) { + public function _getRemainModifiers($mode,$delim,$modifiers) { if($delim) { if($mode=='(') return $this->_fetchContent($modifiers, $delim . ')'); @@ -94,33 +152,34 @@ function _getRemainModifiers($mode,$delim,$modifiers) { return $modifiers; } } - - function _fetchContent($string,$delim) { + + public function _fetchContent($string,$delim) { $len = strlen($delim); $string = $this->parseDocumentSource($string); return substr($string,strpos($string, $delim)+$len); } - - function splitEachModifiers($modifiers) { + + public function splitEachModifiers($modifiers) { global $modx; - + $cmd = ''; $bt = ''; + $result = array(); while($bt!==$modifiers) { $bt = $modifiers; $c = substr($modifiers,0,1); $modifiers = substr($modifiers,1); - + if($c===':' && preg_match('@^(!?[<>=]{1,2})@', $modifiers, $match)) { // :=, :!=, :<=, :>=, :!<=, :!>= $c = substr($modifiers,strlen($match[1]),1); $debuginfo = "#i=0 #c=[{$c}] #m=[{$modifiers}]"; if($c==='(') $modifiers = substr($modifiers,strlen($match[1])+1); else $modifiers = substr($modifiers,strlen($match[1])); - + $delim = $this->_getDelim($c,$modifiers); $opt = $this->_getOpt($c,$delim,$modifiers); $modifiers = trim($this->_getRemainModifiers($c,$delim,$modifiers)); - + $result[]=array('cmd'=>trim($match[1]),'opt'=>$opt,'debuginfo'=>$debuginfo); $cmd = ''; } @@ -135,47 +194,48 @@ function splitEachModifiers($modifiers) { $opt = $this->_getOpt($c,$delim,$modifiers); $modifiers = trim($this->_getRemainModifiers($c,$delim,$modifiers)); $debuginfo = "#i=1 #c=[{$c}] #delim=[{$delim}] #m1=[{$m1}] remainMdf=[{$modifiers}]"; - + $result[]=array('cmd'=>trim($cmd),'opt'=>$opt,'debuginfo'=>$debuginfo); - + $cmd = ''; } elseif($c==':') { $debuginfo = "#i=2 #c=[{$c}] #m=[{$modifiers}]"; if($cmd!=='') $result[]=array('cmd'=>trim($cmd),'opt'=>'','debuginfo'=>$debuginfo); - + $cmd = ''; } elseif(trim($modifiers)=='' && trim($cmd)!=='') { $debuginfo = "#i=3 #c=[{$c}] #m=[{$modifiers}]"; $cmd .= $c; $result[]=array('cmd'=>trim($cmd),'opt'=>'','debuginfo'=>$debuginfo); - + break; } else { $cmd .= $c; } } - + if(empty($result)) return array(); - + foreach($result as $i=>$a) { $a['opt'] = $this->parseDocumentSource($a['opt']); $result[$i]['opt'] = $modx->mergePlaceholderContent($a['opt'],$this->placeholders); } - + return $result; } - - function parsePhx($key,$value,$modifiers) + + public function parsePhx($key,$value,$modifiers) { global $modx; + $lastKey = ''; $cacheKey = md5(sprintf('parsePhx#%s#%s#%s',$key,$value,print_r($modifiers,true))); if(isset($this->tmpCache[$cacheKey])) return $this->tmpCache[$cacheKey]; if(empty($modifiers)) return ''; - + foreach($modifiers as $m) { $lastKey = strtolower($m['cmd']); @@ -186,7 +246,7 @@ function parsePhx($key,$value,$modifiers) $modifiers[] = array('cmd'=>'then','opt'=>'1'); $modifiers[] = array('cmd'=>'else','opt'=>'0'); } - + foreach($modifiers as $i=>$a) { $value = $this->Filter($key,$value, $a['cmd'], $a['opt']); @@ -194,12 +254,12 @@ function parsePhx($key,$value,$modifiers) $this->tmpCache[$cacheKey] = $value; return $value; } - + // Parser: modifier detection and eXtended processing if needed - function Filter($key, $value, $cmd, $opt='') + public function Filter($key, $value, $cmd, $opt='') { global $modx; - + if($key==='documentObject') $value = $modx->documentIdentifier; $cmd = $this->parseDocumentSource($cmd); if(preg_match('@^[1-9][/0-9]*$@',$cmd)) @@ -209,44 +269,44 @@ function Filter($key, $value, $cmd, $opt='') $opt = $cmd; $cmd = 'id'; } - + if(isset($modx->snippetCache["phx:{$cmd}"])) $this->elmName = "phx:{$cmd}"; elseif(isset($modx->chunkCache["phx:{$cmd}"])) $this->elmName = "phx:{$cmd}"; else $this->elmName = ''; - + $cmd = strtolower($cmd); if($this->elmName!=='') $value = $this->getValueFromElement($key, $value, $cmd, $opt); else $value = $this->getValueFromPreset($key, $value, $cmd, $opt); - + $value = str_replace('[+key+]', $key, $value); - + return $value; } - - function isEmpty($cmd,$value) + + public function isEmpty($cmd,$value) { if($value!=='') return false; - + $_ = explode(',', $this->condModifiers . ',_default,default,if,input,or,and,show,this,select,switch,then,else,id,ifempty,smart_desc,smart_description,summary'); if(in_array($cmd,$_)) return false; else return true; } - - function getValueFromPreset($key, $value, $cmd, $opt) + + public function getValueFromPreset($key, $value, $cmd, $opt) { global $modx; - + if($this->isEmpty($cmd,$value)) return ''; - + $this->key = $key; $this->value = $value; $this->opt = $opt; - + switch ($cmd) { - ##### Conditional Modifiers + ##### Conditional Modifiers case 'input': case 'if': if(!$opt) return $value; @@ -255,56 +315,56 @@ function getValueFromPreset($key, $value, $cmd, $opt) case 'eq': case 'is': case 'equals': - $this->condition[] = intval($value == $opt); break; + $this->condition[] = (int)($value == $opt); break; case 'neq': case 'ne': case 'notequals': case 'isnot': case 'isnt': case 'not': - $this->condition[] = intval($value != $opt);break; + $this->condition[] = (int)($value != $opt);break; case '%': - $this->condition[] = intval($value%$opt==0);break; + $this->condition[] = (int)($value%$opt==0);break; case 'isempty': - $this->condition[] = intval(empty($value)); break; + $this->condition[] = (int)(empty($value)); break; case 'isntempty': case 'isnotempty': - $this->condition[] = intval(!empty($value)); break; + $this->condition[] = (int)(!empty($value)); break; case '>=': case 'gte': case 'eg': case 'isgte': - $this->condition[] = intval($value >= $opt);break; + $this->condition[] = (int)($value >= $opt);break; case '<=': case 'lte': case 'el': case 'islte': - $this->condition[] = intval($value <= $opt);break; + $this->condition[] = (int)($value <= $opt);break; case '>': case 'gt': case 'greaterthan': case 'isgreaterthan': case 'isgt': - $this->condition[] = intval($value > $opt);break; + $this->condition[] = (int)($value > $opt);break; case '<': case 'lt': case 'lowerthan': case 'islowerthan': case 'islt': - $this->condition[] = intval($value < $opt);break; + $this->condition[] = (int)($value < $opt);break; case 'find': - $this->condition[] = intval(strpos($value, $opt)!==false);break; + $this->condition[] = (int)(strpos($value, $opt)!==false);break; case 'inarray': case 'in_array': case 'in': $opt = explode(',', $opt); - $this->condition[] = intval(in_array($value, $opt)!==false);break; + $this->condition[] = (int)(in_array($value, $opt)!==false);break; case 'wildcard_match': case 'wcard_match': case 'wildcard': case 'wcard': case 'fnmatch': - $this->condition[] = intval(fnmatch($opt, $value)!==false);break; + $this->condition[] = (int)(fnmatch($opt, $value)!==false);break; case 'is_file': case 'is_dir': case 'file_exists': @@ -314,18 +374,18 @@ function getValueFromPreset($key, $value, $cmd, $opt) else $path = $opt; if(strpos($path,MODX_MANAGER_PATH)!==false) exit('Can not read core path'); if(strpos($path,$modx->config['base_path'])===false) $path = ltrim($path,'/'); - $this->condition[] = intval($cmd($path)!==false);break; + $this->condition[] = (int)($cmd($path)!==false);break; case 'is_image': if(!$opt) $path = $value; else $path = $opt; if(!is_file($path)) {$this->condition[]='0';break;} $_ = getimagesize($path); - $this->condition[] = intval($_[0]);break; + $this->condition[] = (int)($_[0]);break; case 'regex': case 'preg': case 'preg_match': - $this->condition[] = intval(preg_match($opt,$value));break; case 'isinrole': + $this->condition[] = (int)(preg_match($opt,$value));break; case 'ir': case 'memberof': case 'mo': @@ -338,18 +398,18 @@ function getValueFromPreset($key, $value, $cmd, $opt) $this->condition[] = '&&';break; case 'show': case 'this': - $conditional = join(' ',$this->condition); - $isvalid = intval(eval("return ({$conditional});")); + $conditional = implode(' ',$this->condition); + $isvalid = (int)(eval("return ({$conditional});")); if ($isvalid) return $this->srcValue; return NULL; case 'then': - $conditional = join(' ',$this->condition); - $isvalid = intval(eval("return ({$conditional});")); + $conditional = implode(' ',$this->condition); + $isvalid = (int)eval("return ({$conditional});"); if ($isvalid) return $opt; return null; case 'else': - $conditional = join(' ',$this->condition); - $isvalid = intval(eval("return ({$conditional});")); + $conditional = implode(' ',$this->condition); + $isvalid = (int)eval("return ({$conditional});"); if (!$isvalid) return $opt; break; case 'select': @@ -364,7 +424,7 @@ function getValueFromPreset($key, $value, $cmd, $opt) if(isset($map[$value])) return $map[$value]; else return ''; ##### End of Conditional Modifiers - + ##### Encode / Decode / Hash / Escape case 'htmlent': case 'htmlentities': @@ -403,7 +463,7 @@ function getValueFromPreset($key, $value, $cmd, $opt) $v = trim($v,' '); $param[] = "<{$v}>"; } - $params = join(',',$param); + $params = implode(',',$param); } else $params = ''; if(!strpos($params,'
      ')===false) { @@ -431,7 +491,7 @@ function getValueFromPreset($key, $value, $cmd, $opt) case 'json_encode': case 'json_decode': return $cmd($value); - + ##### String Modifiers case 'lcase': case 'strtolower': @@ -447,7 +507,7 @@ function getValueFromPreset($key, $value, $cmd, $opt) { $_[$i] = ucfirst($v); } - return join(' ',$_); + return implode(' ',$_); case 'zenhan': if(empty($opt)) $opt='VKas'; return mb_convert_kana($value,$opt,$modx->config['modx_charset']); @@ -481,7 +541,7 @@ function getValueFromPreset($key, $value, $cmd, $opt) return $this->strpos($value,$opt); case 'wordwrap': // default: 70 - $wrapat = intval($opt) ? intval($opt) : 70; + $wrapat = (int)$opt > 0 ? (int)$opt : 70; if (version_compare(PHP_VERSION, '5.3.0') >= 0) return $this->includeMdfFile('wordwrap'); else return preg_replace("@(\b\w+\b)@e","wordwrap('\\1',\$wrapat,' ',1)",$value); case 'wrap_text': @@ -498,7 +558,7 @@ function getValueFromPreset($key, $value, $cmd, $opt) $chunk[] = $this->substr($value,0,$width); $value = $this->substr($value,$width); } - return join("\n",$chunk); + return implode("\n",$chunk); } else return wordwrap($value,$width,"\n",true); @@ -551,7 +611,7 @@ function getValueFromPreset($key, $value, $cmd, $opt) foreach($value as $v) { $_[] = str_replace(array('[+value+]','[+output+]','{value}','%s'),$v,$opt); } - return join("\n", $_); + return implode("\n", $_); case 'array_pop': case 'array_shift': if(strpos($value,'||')!==false) $delim = '||'; @@ -612,7 +672,7 @@ function getValueFromPreset($key, $value, $cmd, $opt) case 'lcfirst': case 'ucwords': return $cmd($value); - + ##### Date time format case 'strftime': case 'date': @@ -631,7 +691,7 @@ function getValueFromPreset($key, $value, $cmd, $opt) return strtotime($value); ##### mathematical function case 'toint': - return intval($value); + return (int)$value; case 'tofloat': return floatval($value); case 'round': @@ -665,7 +725,7 @@ function getValueFromPreset($key, $value, $cmd, $opt) if(!$opt) $opt = SORT_REGULAR; else $opt = constant($opt); $cmd($swap,$opt); - return join($delim,$swap); + return implode($delim,$swap); ##### Resource fields case 'id': if($opt) return $this->getDocumentObject($opt,$key); @@ -739,13 +799,13 @@ function getValueFromPreset($key, $value, $cmd, $opt) case '!published': $published = 0; break; } } - $where = join(' AND ', $where); + $where = implode(' AND ', $where); $children = $modx->getDocumentChildren($value, $published, '0', 'id', $where); $result = array(); foreach((array)$children as $child){ $result[] = $child['id']; } - return join(',', $result); + return implode(',', $result); case 'fullurl': if(!is_numeric($value)) return $value; return $modx->makeUrl($value); @@ -753,7 +813,7 @@ function getValueFromPreset($key, $value, $cmd, $opt) if(!is_numeric($value)) return $value; if(!$opt) $opt = 'full'; return $modx->makeUrl($value,'','',$opt); - + ##### File system case 'getimageinfo': case 'imageinfo': @@ -780,7 +840,7 @@ function getValueFromPreset($key, $value, $cmd, $opt) case 'attrib': return $info['attrib']; default : return print_r($info,true); } - + case 'file_get_contents': case 'readfile': if(!is_file($value)) return $value; @@ -793,17 +853,17 @@ function getValueFromPreset($key, $value, $cmd, $opt) case 'filesize': if($value == '') return ''; $filename = $value; - + $site_url = $modx->config['site_url']; if(strpos($filename,$site_url) === 0) $filename = substr($filename,0,strlen($site_url)); $filename = trim($filename,'/'); - + $opt = trim($opt,'/'); if($opt!=='') $opt .= '/'; - + $filename = MODX_BASE_PATH.$opt.$filename; - + if(is_file($filename)){ clearstatcache(); $size = filesize($filename); @@ -815,8 +875,8 @@ function getValueFromPreset($key, $value, $cmd, $opt) case 'fullname': case 'role': case 'email': - case 'phone': - case 'mobilephone': + case 'phone': + case 'mobilephone': case 'blocked': case 'blockeduntil': case 'blockedafter': @@ -843,7 +903,7 @@ function getValueFromPreset($key, $value, $cmd, $opt) if(empty($opt)) $this->opt = 'username'; $this->value = -$value; return $this->includeMdfFile('moduser'); - ##### Special functions + ##### Special functions case 'ifempty': case '_default': case 'default': @@ -852,8 +912,7 @@ function getValueFromPreset($key, $value, $cmd, $opt) if (!empty($value)) return $opt; break; case 'datagrid': include_once(MODX_CORE_PATH . 'controls/datagrid.class.php'); - $grd = new DataGrid(); - $grd->ds = trim($value); + $grd = new DataGrid(null, trim($value)); $grd->itemStyle = ''; $grd->altItemStyle = ''; $pos = strpos($value,"\n"); @@ -912,7 +971,7 @@ function getValueFromPreset($key, $value, $cmd, $opt) return ''; case 'dummy': return $value; - + // If we haven't yet found the modifier, let's look elsewhere default: $value = $this->getValueFromElement($key, $value, $cmd, $opt); @@ -920,15 +979,15 @@ function getValueFromPreset($key, $value, $cmd, $opt) return $value; } - function includeMdfFile($cmd) { + public function includeMdfFile($cmd) { global $modx; $key = $this->key; $value = $this->value; $opt = $this->opt; return include(MODX_CORE_PATH."extenders/modifiers/mdf_{$cmd}.inc.php"); } - - function getValueFromElement($key, $value, $cmd, $opt) + + public function getValueFromElement($key, $value, $cmd, $opt) { global $modx; if( isset($modx->snippetCache[$this->elmName]) ) @@ -955,8 +1014,8 @@ function getValueFromElement($key, $value, $cmd, $opt) elseif(is_file(MODX_CORE_PATH."extenders/modifiers/mdf_{$cmd}.inc.php")) $modifiers_path = MODX_CORE_PATH."extenders/modifiers/mdf_{$cmd}.inc.php"; else $modifiers_path = false; - - if($modifiers_path) { + + if($modifiers_path !== false) { $php = @file_get_contents($modifiers_path); $php = trim($php); if(substr($php,0,5)==='elmName!=='') $modx->snippetCache[$this->elmName]= $php; } if($php==='') $php=false; - + if($php===false) $html = $modx->getChunk($this->elmName); else $html = false; $self = '[+output+]'; - + if($php !== false) { ob_start(); @@ -1000,7 +1059,7 @@ function getValueFromElement($key, $value, $cmd, $opt) $value = str_replace(array('[+options+]','[+param+]'), $opt, $html); } else return false; - + if($php===false && $html===false && $value!=='' && (strpos($cmd,'[+value+]')!==false || strpos($cmd,$self)!==false)) { @@ -1008,13 +1067,13 @@ function getValueFromElement($key, $value, $cmd, $opt) } return $value; } - - function parseDocumentSource($content='') + + public function parseDocumentSource($content='') { global $modx; - + if(strpos($content,'[')===false && strpos($content,'{')===false) return $content; - + if(!$modx->maxParserPasses) $modx->maxParserPasses = 10; $bt=''; $i=0; @@ -1027,18 +1086,18 @@ function parseDocumentSource($content='') if(strpos($content,'{{')!==false) $content = $modx->mergeChunkContent($content); if(strpos($content,'[!')!==false) $content = str_replace(array('[!','!]'),array('[[',']]'),$content); if(strpos($content,'[[')!==false) $content = $modx->evalSnippets($content); - + if($content===$bt) break; if($modx->maxParserPasses < $i) break; $i++; } return $content; } - - function getDocumentObject($target='',$field='pagetitle') + + public function getDocumentObject($target='',$field='pagetitle') { global $modx; - + $target = trim($target); if(empty($target)) $target = $modx->config['site_start']; if(preg_match('@^[1-9][0-9]*$@',$target)) $method='id'; @@ -1048,7 +1107,7 @@ function getDocumentObject($target='',$field='pagetitle') { $this->documentObject[$target] = $modx->getDocumentObject($method,$target,'direct'); } - + if($this->documentObject[$target]['publishedon']==='0') return ''; elseif(isset($this->documentObject[$target][$field])) @@ -1060,11 +1119,11 @@ function getDocumentObject($target='',$field='pagetitle') } } else $this->documentObject[$target][$field] = false; - + return $this->documentObject[$target][$field]; } - - function setPlaceholders($value = '', $key = '', $path = '') { + + public function setPlaceholders($value = '', $key = '', $path = '') { if($path!=='') $key = "{$path}.{$key}"; if (is_array($value)) { foreach ($value as $subkey => $subval) { @@ -1073,14 +1132,14 @@ function setPlaceholders($value = '', $key = '', $path = '') { } else $this->setModifiersVariable($key, $value); } - + // Sets a placeholder variable which can only be access by Modifiers - function setModifiersVariable($key, $value) { + public function setModifiersVariable($key, $value) { if ($key != 'phx' && $key != 'dummy') $this->placeholders[$key] = $value; } - + //mbstring - function substr($str, $s, $l = null) { + public function substr($str, $s, $l = null) { global $modx; if(is_null($l)) $l = $this->strlen($str); if (function_exists('mb_substr')) @@ -1091,61 +1150,61 @@ function substr($str, $s, $l = null) { } return substr($str, $s, $l); } - function strpos($haystack,$needle,$offset=0) { + public function strpos($haystack,$needle,$offset=0) { global $modx; if (function_exists('mb_strpos')) return mb_strpos($haystack,$needle,$offset,$modx->config['modx_charset']); return strpos($haystack,$needle,$offset); } - function strlen($str) { + public function strlen($str) { global $modx; if (function_exists('mb_strlen')) return mb_strlen(str_replace("\r\n", "\n", $str),$modx->config['modx_charset']); return strlen($str); } - function strtolower($str) { + public function strtolower($str) { if (function_exists('mb_strtolower')) return mb_strtolower($str); return strtolower($str); } - function strtoupper($str) { + public function strtoupper($str) { if (function_exists('mb_strtoupper')) return mb_strtoupper($str); return strtoupper($str); } - function ucfirst($str) { - if (function_exists('mb_strtoupper')) + public function ucfirst($str) { + if (function_exists('mb_strtoupper')) return mb_strtoupper($this->substr($str, 0, 1)).$this->substr($str, 1, $this->strlen($str)); return ucfirst($str); } - function lcfirst($str) { - if (function_exists('mb_strtolower')) + public function lcfirst($str) { + if (function_exists('mb_strtolower')) return mb_strtolower($this->substr($str, 0, 1)).$this->substr($str, 1, $this->strlen($str)); return lcfirst($str); } - function ucwords($str) { + public function ucwords($str) { if (function_exists('mb_convert_case')) return mb_convert_case($str, MB_CASE_TITLE); return ucwords($str); } - function strrev($str) { + public function strrev($str) { preg_match_all('/./us', $str, $ar); - return join(array_reverse($ar[0])); + return implode(array_reverse($ar[0])); } - function str_shuffle($str) { + public function str_shuffle($str) { preg_match_all('/./us', $str, $ar); shuffle($ar[0]); - return join($ar[0]); + return implode($ar[0]); } - function str_word_count($str) { + public function str_word_count($str) { return count(preg_split('~[^\p{L}\p{N}\']+~u',$str)); } - function strip_tags($value,$params='') { + public function strip_tags($value,$params='') { global $modx; if(stripos($params,'style')===false && stripos($value,'')!==false) { $value = preg_replace('@.*?@is', '', $value); } if(stripos($params,'script')===false && stripos($value,'')!==false) { - $value = preg_replace('@.*?@is', '', $value); + $value = preg_replace('@.*?@is', '', $value); } - + return trim(strip_tags($value,$params)); } } diff --git a/manager/includes/extenders/modifiers/mdf_addbreak.inc.php b/manager/includes/extenders/modifiers/mdf_addbreak.inc.php index 6d58db9c52..03c3a1abff 100644 --- a/manager/includes/extenders/modifiers/mdf_addbreak.inc.php +++ b/manager/includes/extenders/modifiers/mdf_addbreak.inc.php @@ -20,4 +20,4 @@ } $lines[$i] = "{$line}
      "; } -return join("\n", $lines); +return implode("\n", $lines); diff --git a/manager/includes/extenders/modifiers/mdf_moduser.inc.php b/manager/includes/extenders/modifiers/mdf_moduser.inc.php index 6bf0514b50..1349964cef 100644 --- a/manager/includes/extenders/modifiers/mdf_moduser.inc.php +++ b/manager/includes/extenders/modifiers/mdf_moduser.inc.php @@ -1,5 +1,5 @@ filter->cache['ui'][$userid])) { if ($userid < 0) $user = $modx->getWebUserInfo(abs($userid)); else $user = $modx->getUserInfo($userid); diff --git a/manager/includes/extenders/modifiers/mdf_summary.inc.php b/manager/includes/extenders/modifiers/mdf_summary.inc.php index 9faff6c64f..4cb0dd703b 100644 --- a/manager/includes/extenders/modifiers/mdf_summary.inc.php +++ b/manager/includes/extenders/modifiers/mdf_summary.inc.php @@ -4,7 +4,7 @@ else {$limit=124;$delim='';} if($delim==='') $delim = $modx->config['manager_language']==='japanese-utf8' ? '。' : '.'; -$limit = intval($limit); +$limit = (int)$limit; $content = $modx->filter->parseDocumentSource($value); diff --git a/manager/includes/extenders/modxmailer.class.inc.php b/manager/includes/extenders/modxmailer.class.inc.php index 43deff665d..eb99152481 100644 --- a/manager/includes/extenders/modxmailer.class.inc.php +++ b/manager/includes/extenders/modxmailer.class.inc.php @@ -9,7 +9,7 @@ */ use PHPMailer\PHPMailer\PHPMailer; -use PHPMailer\PHPMailer\Exception; +use PHPMailer\PHPMailer\Exception as PHPMailerException; require MODX_MANAGER_PATH . 'includes/controls/phpmailer/Exception.php'; require MODX_MANAGER_PATH . 'includes/controls/phpmailer/PHPMailer.php'; @@ -20,15 +20,30 @@ */ class MODxMailer extends PHPMailer { + /** + * @var string + */ protected $mb_language = 'UNI'; + + /** + * @var string + */ protected $encode_header_method = ''; - /* var \DocumentParser $modx */ - protected $modx = null; /** - * @param \DocumentParser $modx + * @var + */ + public $PluginDir; + + /** + * @var DocumentParser $modx + */ + protected $modx; + + /** + * @param DocumentParser $modx */ - public function init(\DocumentParser $modx) + public function init(DocumentParser $modx) { $this->modx = $modx; $this->PluginDir = MODX_MANAGER_PATH . 'includes/controls/phpmailer/'; @@ -106,7 +121,7 @@ public function init(\DocumentParser $modx) * Picks shortest of Q, B, or none. Result includes folding if needed. * See RFC822 definitions for phrase, comment and text positions. * - * @param string $str The header value to encode + * @param string $str The header value to encode * @param string $position What context the string will be used in * * @return string @@ -126,7 +141,7 @@ public function EncodeHeader($str, $position = 'text') * Create a message and send it. * Uses the sending method specified by $Mailer. * - * @throws Exception + * @throws PHPMailerException * * @return bool false on error - See the ErrorInfo property for details of the error */ @@ -140,8 +155,8 @@ public function Send() /** * @param string $header The message headers - * @param string $body The message body - * + * @param string $body The message body + * * @return bool */ public function MailSend($header, $body) @@ -174,27 +189,33 @@ public function MailSend($header, $body) return true; } + switch ($mode) { case 'normal': - return parent::mailSend($header, $body); + $out = parent::mailSend($header, $body); break; case 'mb': - return $this->mbMailSend($header, $body); + $out = $this->mbMailSend($header, $body); break; + default: + $out = false; } + + return $out; } /** * @param string $header The message headers - * @param string $body The message body - * + * @param string $body The message body + * * @return bool */ public function mbMailSend($header, $body) { $rt = false; $to = ''; - for ($i = 0; $i < count($this->to); $i++) { + $countTo = count($this->to); + for ($i = 0; $i < $countTo; $i++) { if ($i != 0) { $to .= ', '; } @@ -256,7 +277,7 @@ public function SetError($msg) /** * @param $address - * + * * @return array */ public function address_split($address) @@ -268,31 +289,32 @@ public function address_split($address) } else { $name = ''; } - $result = array($name, $address); - - return $result; + return array($name, $address); } /** * @return string */ - public function getMIMEHeader() { + public function getMIMEHeader() + { return $this->MIMEHeader; } /** * @return string */ - public function getMIMEBody() { + public function getMIMEBody() + { return $this->MIMEBody; } /** * @param string $header - * + * * @return $this */ - public function setMIMEHeader($header = '') { + public function setMIMEHeader($header = '') + { $this->MIMEHeader = $header; return $this; @@ -300,10 +322,11 @@ public function setMIMEHeader($header = '') { /** * @param string $body - * + * * @return $this */ - public function setMIMEBody($body = '') { + public function setMIMEBody($body = '') + { $this->MIMEBody = $body; return $this; @@ -311,10 +334,11 @@ public function setMIMEBody($body = '') { /** * @param string $header - * + * * @return $this */ - public function setMailHeader($header = '') { + public function setMailHeader($header = '') + { $this->mailHeader = $header; return $this; @@ -323,7 +347,8 @@ public function setMailHeader($header = '') { /** * @return string */ - public function getMessageID() { - return trim($this->lastMessageID,'<>'); + public function getMessageID() + { + return trim($this->lastMessageID, '<>'); } } diff --git a/manager/includes/extenders/phpass.class.inc.php b/manager/includes/extenders/phpass.class.inc.php index 8f4dc410c0..6f43a17638 100644 --- a/manager/includes/extenders/phpass.class.inc.php +++ b/manager/includes/extenders/phpass.class.inc.php @@ -24,26 +24,38 @@ // Obviously, since this code is in the public domain, the above are not // requirements (there can be none), but merely suggestions. // -class PasswordHash { - var $itoa64; - var $iteration_count_log2; - var $portable_hashes; - var $random_state; - - function __construct($iteration_count_log2=8, $portable_hashes=true) +class PasswordHash +{ + public $itoa64; + public $iteration_count_log2; + public $portable_hashes; + public $random_state; + + /** + * PasswordHash constructor. + * + * @param int $iteration_count_log2 + * @param bool $portable_hashes + */ + public function __construct($iteration_count_log2 = 8, $portable_hashes = true) { $this->itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; - if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31) + if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31) { $iteration_count_log2 = 8; + } $this->iteration_count_log2 = $iteration_count_log2; $this->portable_hashes = $portable_hashes; - $this->random_state = microtime() . uniqid(mt_rand(), TRUE); + $this->random_state = microtime() . uniqid(mt_rand(), true); } - function get_random_bytes($count) + /** + * @param string $count + * @return bool|string + */ + public function get_random_bytes($count) { $output = ''; if (@is_readable('/dev/urandom') && @@ -66,30 +78,43 @@ function get_random_bytes($count) return $output; } - function encode64($input, $count) + /** + * @param string $input + * @param int $count + * @return string + */ + public function encode64($input, $count) { $output = ''; $i = 0; do { $value = ord($input[$i++]); $output .= $this->itoa64[$value & 0x3f]; - if ($i < $count) + if ($i < $count) { $value |= ord($input[$i]) << 8; + } $output .= $this->itoa64[($value >> 6) & 0x3f]; - if ($i++ >= $count) + if ($i++ >= $count) { break; - if ($i < $count) + } + if ($i < $count) { $value |= ord($input[$i]) << 16; + } $output .= $this->itoa64[($value >> 12) & 0x3f]; - if ($i++ >= $count) + if ($i++ >= $count) { break; + } $output .= $this->itoa64[($value >> 18) & 0x3f]; } while ($i < $count); return $output; } - function gensalt_private($input) + /** + * @param string $input + * @return string + */ + public function gensalt_private($input) { $output = '$P$'; $output .= $this->itoa64[min($this->iteration_count_log2 + 5, 30)]; @@ -98,26 +123,35 @@ function gensalt_private($input) return $output; } - function crypt_private($password, $setting) + /** + * @param string $password + * @param string $setting + * @return string + */ + public function crypt_private($password, $setting) { $output = '*0'; - if (substr($setting, 0, 2) == $output) + if (substr($setting, 0, 2) == $output) { $output = '*1'; + } $id = substr($setting, 0, 3); // We use "$P$", phpBB3 uses "$H$" for the same thing - if ($id != '$P$' && $id != '$H$') + if ($id != '$P$' && $id != '$H$') { return $output; + } $count_log2 = strpos($this->itoa64, $setting[3]); - if ($count_log2 < 7 || $count_log2 > 30) + if ($count_log2 < 7 || $count_log2 > 30) { return $output; + } $count = 1 << $count_log2; $salt = substr($setting, 4, 8); - if (strlen($salt) != 8) + if (strlen($salt) != 8) { return $output; + } // We're kind of forced to use MD5 here since it's the only // cryptographic primitive available in all versions of PHP @@ -125,10 +159,10 @@ function crypt_private($password, $setting) // in PHP would result in much worse performance and // consequently in lower iteration counts and hashes that are // quicker to crack (by non-PHP code). - - $hash = md5($salt . $password, TRUE); + + $hash = md5($salt . $password, true); do { - $hash = md5($hash . $password, TRUE); + $hash = md5($hash . $password, true); } while (--$count); $output = substr($setting, 0, 12); @@ -137,7 +171,11 @@ function crypt_private($password, $setting) return $output; } - function gensalt_extended($input) + /** + * @param string $input + * @return string + */ + public function gensalt_extended($input) { $count_log2 = min($this->iteration_count_log2 + 8, 24); // This should be odd to not reveal weak DES keys, and the @@ -155,7 +193,11 @@ function gensalt_extended($input) return $output; } - function gensalt_blowfish($input) + /** + * @param string $input + * @return string + */ + public function gensalt_blowfish($input) { // This one needs to use a different order of characters and a // different encoding scheme from the one in encode64() above. @@ -196,9 +238,13 @@ function gensalt_blowfish($input) return $output; } - function HashPassword($password) + /** + * @param string $password + * @return string + */ + public function HashPassword($password) { - if ( strlen( $password ) > 4096 ) { + if (strlen($password) > 4096) { return '*'; } @@ -208,26 +254,31 @@ function HashPassword($password) $random = $this->get_random_bytes(16); $hash = crypt($password, $this->gensalt_blowfish($random)); - if (strlen($hash) == 60) + if (strlen($hash) == 60) { return $hash; + } } if (CRYPT_EXT_DES == 1 && !$this->portable_hashes) { - if (strlen($random) < 3) + if (strlen($random) < 3) { $random = $this->get_random_bytes(3); + } $hash = crypt($password, $this->gensalt_extended($random)); - if (strlen($hash) == 20) + if (strlen($hash) == 20) { return $hash; + } } - if (strlen($random) < 6) + if (strlen($random) < 6) { $random = $this->get_random_bytes(6); + } $hash = $this->crypt_private($password, - $this->gensalt_private($random)); - if (strlen($hash) == 34) + $this->gensalt_private($random)); + if (strlen($hash) == 34) { return $hash; + } // Returning '*' on error is safe here, but would _not_ be safe // in a crypt(3)-like function used _both_ for generating new @@ -235,16 +286,22 @@ function HashPassword($password) return '*'; } - function CheckPassword($password, $stored_hash) + /** + * @param string $password + * @param string $stored_hash + * @return bool + */ + public function CheckPassword($password, $stored_hash) { - if ( strlen( $password ) > 4096 ) { + if (strlen($password) > 4096) { return false; } $hash = $this->crypt_private($password, $stored_hash); - if (substr($hash,0,1) === '*') + if (substr($hash, 0, 1) === '*') { $hash = crypt($password, $stored_hash); + } - return ($hash===$stored_hash) ? true : false; + return ($hash === $stored_hash) ? true : false; } } diff --git a/manager/includes/extenders/phpcompat.class.inc.php b/manager/includes/extenders/phpcompat.class.inc.php index e3b8539f8c..55bbc8a2f6 100644 --- a/manager/includes/extenders/phpcompat.class.inc.php +++ b/manager/includes/extenders/phpcompat.class.inc.php @@ -1,27 +1,35 @@ config['modx_charset']; - - $ent_str = htmlspecialchars($str, $flags, $encode); - - if(!empty($str) && empty($ent_str)) - { - $detect_order = implode(',', mb_detect_order()); - $ent_str = mb_convert_encoding($str, $encode, $detect_order); - } - - return $ent_str; - } + /** + * @param string $str + * @param int $flags + * @param string $encode + * @return string + */ + public function htmlspecialchars($str = '', $flags = ENT_COMPAT, $encode = '') + { + global $modx; + + if ($str == '') { + return ''; + } + + if ($encode == '') { + $encode = $modx->config['modx_charset']; + } + + $ent_str = htmlspecialchars($str, $flags, $encode); + + if (!empty($str) && empty($ent_str)) { + $detect_order = implode(',', mb_detect_order()); + $ent_str = mb_convert_encoding($str, $encode, $detect_order); + } + + return $ent_str; + } } diff --git a/manager/includes/footer.inc.php b/manager/includes/footer.inc.php index ea173bef6c..401c07609f 100644 --- a/manager/includes/footer.inc.php +++ b/manager/includes/footer.inc.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); } global $SystemAlertMsgQueque; diff --git a/manager/includes/header.inc.php b/manager/includes/header.inc.php index d04849d92e..ab64787592 100644 --- a/manager/includes/header.inc.php +++ b/manager/includes/header.inc.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); } $mxla = $modx_lang_attribute ? $modx_lang_attribute : 'en'; diff --git a/manager/includes/log.class.inc.php b/manager/includes/log.class.inc.php old mode 100755 new mode 100644 index 3121cb56f8..3032924741 --- a/manager/includes/log.class.inc.php +++ b/manager/includes/log.class.inc.php @@ -1,76 +1,104 @@ initAndWriteLog($msg); // write $msg to log, and populate all other fields as best as possible + * $log->initAndWriteLog($msg, $internalKey, $username, $action, $id, $itemname); // write $msg and other data to log + */ +class logHandler +{ + /** + * Single variable for a log entry + * + * @var array + */ + public $entry = array(); -Usage: - -include_once "log.class.inc.php"; // include_once the class -$log = new logHandler; // create the object -$log->initAndWriteLog($msg); // write $msg to log, and populate all other fields as best as possible -$log->initAndWriteLog($msg, $internalKey, $username, $action, $id, $itemname); // write $msg and other data to log - -*/ - -class logHandler { - // Single variable for a log entry - var $entry = array(); - - function initAndWriteLog($msg="", $internalKey="", $username="", $action="", $itemid="", $itemname="") { + /** + * @param string $msg + * @param string $internalKey + * @param string $username + * @param string $action + * @param string $itemid + * @param string $itemname + * + * @return void + */ + public function initAndWriteLog( + $msg = "", + $internalKey = "", + $username = "", + $action = "", + $itemid = "", + $itemname = "" + ) { global $modx; $this->entry['msg'] = $msg; // writes testmessage to the object - $this->entry['action'] = empty($action)? $modx->manager->action : $action; // writes the action to the object + $this->entry['action'] = empty($action) ? $modx->manager->action : $action; // writes the action to the object // User Credentials $this->entry['internalKey'] = $internalKey == "" ? $modx->getLoginUserID() : $internalKey; $this->entry['username'] = $username == "" ? $modx->getLoginUserName() : $username; $this->entry['itemId'] = (empty($itemid) && isset($_REQUEST['id'])) ? (int)$_REQUEST['id'] : $itemid; // writes the id to the object - if($this->entry['itemId'] == 0) $this->entry['itemId'] = "-"; // to stop items having id 0 + if ($this->entry['itemId'] == 0) { + $this->entry['itemId'] = "-"; + } // to stop items having id 0 - $this->entry['itemName'] = ($itemname == "" && isset($_SESSION['itemname']))? $_SESSION['itemname'] : $itemname; // writes the id to the object - if($this->entry['itemName'] == "") $this->entry['itemName'] = "-"; // to stop item name being empty + $this->entry['itemName'] = ($itemname == "" && isset($_SESSION['itemname'])) ? $_SESSION['itemname'] : $itemname; // writes the id to the object + if ($this->entry['itemName'] == "") { + $this->entry['itemName'] = "-"; + } // to stop item name being empty $this->writeToLog(); + return; } - // function to write to the log - // collects all required info, and - // writes it to the logging table - function writeToLog() { + /** + * function to write to the log collects all required info, and writes it to the logging table + * + * @return void + */ + public function writeToLog() + { global $modx; $tbl_manager_log = $modx->getFullTableName('manager_log'); - - if($this->entry['internalKey'] == "") { + + if ($this->entry['internalKey'] == "") { $modx->webAlertAndQuit("Logging error: internalKey not set."); } - if(empty($this->entry['action'])) { + if (empty($this->entry['action'])) { $modx->webAlertAndQuit("Logging error: action not set."); } - if($this->entry['msg'] == "") { + if ($this->entry['msg'] == "") { include_once "actionlist.inc.php"; $this->entry['msg'] = getAction($this->entry['action'], $this->entry['itemId']); - if($this->entry['msg'] == "") { + if ($this->entry['msg'] == "") { $modx->webAlertAndQuit("Logging error: couldn't find message to write to log."); } } - $fields['timestamp'] = time(); + $fields['timestamp'] = time(); $fields['internalKey'] = $modx->db->escape($this->entry['internalKey']); - $fields['username'] = $modx->db->escape($this->entry['username']); - $fields['action'] = $this->entry['action']; - $fields['itemid'] = $this->entry['itemId']; - $fields['itemname'] = $modx->db->escape($this->entry['itemName']); - $fields['message'] = $modx->db->escape($this->entry['msg']); - $insert_id = $modx->db->insert($fields,$tbl_manager_log); - if(!$insert_id) { - $modx->messageQuit("Logging error: couldn't save log to table! Error code: ".$modx->db->getLastError()); + $fields['username'] = $modx->db->escape($this->entry['username']); + $fields['action'] = $this->entry['action']; + $fields['itemid'] = $this->entry['itemId']; + $fields['itemname'] = $modx->db->escape($this->entry['itemName']); + $fields['message'] = $modx->db->escape($this->entry['msg']); + $insert_id = $modx->db->insert($fields, $tbl_manager_log); + if (!$insert_id) { + $modx->messageQuit("Logging error: couldn't save log to table! Error code: " . $modx->db->getLastError()); } else { - $limit = (isset($modx->config['manager_log_limit'])) ? intval($modx->config['manager_log_limit']) : 3000; - $trim = (isset($modx->config['manager_log_trim'])) ? intval($modx->config['manager_log_trim']) : 100; - if(($insert_id % $trim) === 0) { - $modx->rotate_log('manager_log',$limit,$trim); + $limit = (isset($modx->config['manager_log_limit'])) ? (int)$modx->config['manager_log_limit'] : 3000; + $trim = (isset($modx->config['manager_log_trim'])) ? (int)$modx->config['manager_log_trim'] : 100; + if (($insert_id % $trim) === 0) { + $modx->rotate_log('manager_log', $limit, $trim); } } } diff --git a/manager/includes/manager.lockout.inc.php b/manager/includes/manager.lockout.inc.php index ab4090f777..400371a225 100644 --- a/manager/includes/manager.lockout.inc.php +++ b/manager/includes/manager.lockout.inc.php @@ -1,8 +1,10 @@ INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); +} if($modx->manager->action!='8' && isset($_SESSION['mgrValidated'])){ - + $homeurl = $modx->makeUrl($manager_login_startup>0 ? $manager_login_startup:$site_start); $logouturl = MODX_MANAGER_URL.'index.php?a=8'; @@ -22,13 +24,13 @@ // load template if(!isset($modx->config['manager_lockout_tpl']) || empty($modx->config['manager_lockout_tpl'])) { - $modx->config['manager_lockout_tpl'] = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; + $modx->config['manager_lockout_tpl'] = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; } - + $target = $modx->config['manager_lockout_tpl']; $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target); $target = $modx->mergeSettingsContent($target); - + if(substr($target,0,1)==='@') { if(substr($target,0,6)==='@CHUNK') { $target = trim(substr($target,7)); @@ -70,9 +72,7 @@ $regx = strpos($lockout_tpl,'[[+')!==false ? '~\[\[\+(.*?)\]\]~' : '~\[\+(.*?)\+\]~'; // little tweak for newer parsers $lockout_tpl = preg_replace($regx, '', $lockout_tpl); //cleanup - echo $lockout_tpl; - + echo $lockout_tpl; + exit; } - -?> \ No newline at end of file diff --git a/manager/includes/menu.class.inc.php b/manager/includes/menu.class.inc.php index fedaf9fced..67024896ee 100644 --- a/manager/includes/menu.class.inc.php +++ b/manager/includes/menu.class.inc.php @@ -1,16 +1,28 @@ Build('id','parent','name','link','alt','onclick','permission','target','divider 1/0','menuindex') -*/ - +/** + * menu->Build('id','parent','name','link','alt','onclick','permission','target','divider 1/0','menuindex') + */ class EVOmenu { - var $defaults = array(); - var $menu; - var $output; - - function Build($menu, $setting = array()) + /** + * @var array + */ + public $defaults = array(); + /** + * @var + */ + public $menu; + /** + * @var + */ + public $output; + + /** + * @param $menu + * @param array $setting + */ + public function Build($menu, $setting = array()) { $this->defaults['outerClass'] = 'nav'; $this->defaults['parentClass'] = 'dropdown'; @@ -25,8 +37,12 @@ function Build($menu, $setting = array()) echo $this->output; } - function Structurise($menu) + /** + * @param array $menu + */ + public function Structurise($menu) { + $new = array(); foreach ($menu as $key => $row) { $data[$key] = $row[9]; } @@ -40,7 +56,12 @@ function Structurise($menu) $this->menu = $new; } - function DrawSub($parentid, $level) + /** + * @param int $parentid + * @param int $level + * @return string + */ + public function DrawSub($parentid, $level) { global $modx; @@ -48,6 +69,7 @@ function DrawSub($parentid, $level) if (isset($this->menu[$parentid])) { + $ph = array(); $countChild = 0; $itemTpl = '
    1. [+itemName+][+DrawSub+]
    2. '; @@ -81,17 +103,21 @@ function DrawSub($parentid, $level) $ph['DrawSub'] = $this->DrawSub($id, $level); $level--; // Optional buttons - } else if (isset($value[11]) && !empty($value[11])) { - $optionalButton = ''; - if (is_array($value[11])) { - foreach ($value[11] as $opt) { - $optionalButton .= sprintf('<%s href="%s" class="%s" onclick="%s" title="%s">%s', $opt[0], $opt[1], $opt[2], $opt[3], $opt[4], $opt[5], $opt[0]); + } else { + if (isset($value[11]) && !empty($value[11])) { + $optionalButton = ''; + if (is_array($value[11])) { + foreach ($value[11] as $opt) { + $optionalButton .= sprintf('<%s href="%s" class="%s" onclick="%s" title="%s">%s', + $opt[0], $opt[1], $opt[2], $opt[3], $opt[4], $opt[5], $opt[0]); + } + } else { + $opt = $value[11]; + $optionalButton = sprintf('<%s href="%s" class="%s" onclick="%s" title="%s">%s', + $opt[0], $opt[1], $opt[2], $opt[3], $opt[4], $opt[5], $opt[0]); } - } else { - $opt = $value[11]; - $optionalButton = sprintf('<%s href="%s" class="%s" onclick="%s" title="%s">%s', $opt[0], $opt[1], $opt[2], $opt[3], $opt[4], $opt[5], $opt[0]); + $ph['DrawSub'] = $optionalButton; } - $ph['DrawSub'] = $optionalButton; } $output .= $modx->parseText($itemTpl, $ph); @@ -105,10 +131,15 @@ function DrawSub($parentid, $level) $output = $modx->parseText($outerTpl, $ph); } } + return $output; } - function get_li_class($id) + /** + * @param int $id + * @return string + */ + public function get_li_class($id) { if (isset($this->menu[$id])) { return $this->defaults['parentClass'] . ' '; @@ -117,7 +148,11 @@ function get_li_class($id) } } - function get_a_class($id) + /** + * @param int $id + * @return string + */ + public function get_a_class($id) { if (isset($this->menu[$id])) { return ' class="' . $this->defaults['parentLinkClass'] . '"'; @@ -126,7 +161,11 @@ function get_a_class($id) } } - function getLinkAttr($id) + /** + * @param int $id + * @return string + */ + public function getLinkAttr($id) { if (isset($this->menu[$id])) { return $this->defaults['parentLinkAttr']; @@ -135,7 +174,11 @@ function getLinkAttr($id) } } - function getItemName($id) + /** + * @param int $id + * @return string + */ + public function getItemName($id) { if (isset($this->menu[$id])) { return $this->defaults['parentLinkIn']; diff --git a/manager/includes/messageCount.inc.php b/manager/includes/messageCount.inc.php index 8bd49f22ac..8ceec93e0c 100644 --- a/manager/includes/messageCount.inc.php +++ b/manager/includes/messageCount.inc.php @@ -1,16 +1,18 @@ INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); +} -$rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID()." AND messageread=0"); +$rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_messages'), + "recipient=" . $modx->getLoginUserID() . " AND messageread=0"); $nrnewmessages = $modx->db->getValue($rs); -$rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID()); +$rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID()); $nrtotalmessages = $modx->db->getValue($rs); $messagesallowed = $modx->hasPermission('messages'); // ajax response if (isset($_POST['updateMsgCount'])) { - header("Content-Type: application/json; charset=utf-8"); - print $nrnewmessages.','.$nrtotalmessages; - exit; + header("Content-Type: application/json; charset=utf-8"); + print $nrnewmessages . ',' . $nrtotalmessages; + exit; } -?> \ No newline at end of file diff --git a/manager/includes/mutate_settings.ajax.php b/manager/includes/mutate_settings.ajax.php index 0550a2947f..caee7e9249 100644 --- a/manager/includes/mutate_settings.ajax.php +++ b/manager/includes/mutate_settings.ajax.php @@ -1,10 +1,11 @@ INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); - +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); +} + require_once(dirname(__FILE__) . '/protect.inc.php'); $action = preg_replace('/[^A-Za-z0-9_\-\.\/]/', '', $_POST['action']); @@ -20,38 +21,39 @@ $str = ''; $emptyCache = false; -switch(true){ - case ($action == 'get' && preg_match('/^[A-z0-9_-]+$/',$lang) && file_exists(dirname(__FILE__) . '/lang/'.$lang.'.inc.php')):{ - include(dirname(__FILE__) . '/lang/'.$lang.'.inc.php'); - $str = isset($key,$_lang,$_lang[$key]) ? $_lang[$key] : "" ; +switch (true) { + case ($action == 'get' && preg_match('/^[A-z0-9_-]+$/', + $lang) && file_exists(dirname(__FILE__) . '/lang/' . $lang . '.inc.php')): { + include(dirname(__FILE__) . '/lang/' . $lang . '.inc.php'); + $str = isset($key, $_lang, $_lang[$key]) ? $_lang[$key] : ""; break; } - case ($action == 'setsetting' && !empty($key) && !empty($value)):{ - $sql = "REPLACE INTO ".$modx->getFullTableName("system_settings")." (setting_name, setting_value) VALUES('{$key}', '{$value}');"; + case ($action == 'setsetting' && !empty($key) && !empty($value)): { + $sql = "REPLACE INTO " . $modx->getFullTableName("system_settings") . " (setting_name, setting_value) VALUES('{$key}', '{$value}');"; $str = "true"; $modx->db->query($sql); $emptyCache = true; break; } - case ($action == 'updateplugin' && ($key == '_delete_' && !empty($lang))):{ + case ($action == 'updateplugin' && ($key == '_delete_' && !empty($lang))): { $modx->db->delete($modx->getFullTableName("site_plugins"), "name='{$lang}'"); $str = "true"; $emptyCache = true; break; } - case ($action == 'updateplugin' && (!empty($key) && !empty($lang) && !empty($value))):{ - $modx->db->update(array($key=>$value), $modx->getFullTableName("site_plugins"), "name = '{$lang}'"); + case ($action == 'updateplugin' && (!empty($key) && !empty($lang) && !empty($value))): { + $modx->db->update(array($key => $value), $modx->getFullTableName("site_plugins"), "name = '{$lang}'"); $str = "true"; $emptyCache = true; break; } default: { - break; + break; } } -if($emptyCache) { - $modx->clearCache('full'); +if ($emptyCache) { + $modx->clearCache('full'); } -echo $str; \ No newline at end of file +echo $str; diff --git a/manager/includes/paginate.inc.php b/manager/includes/paginate.inc.php old mode 100755 new mode 100644 index a580c86740..9b24e31387 --- a/manager/includes/paginate.inc.php +++ b/manager/includes/paginate.inc.php @@ -3,7 +3,7 @@ // FILE: Paging.php // // ===================================================== -// Description: This class handles the paging from a query to be print +// Description: This class handles the paging from a query to be print // to the browser. You can customize it to your needs. // // This is distribute as is. Free of use and free to do anything you want. @@ -17,7 +17,7 @@ // Date: 2001-03-25 // Version: 2.0 // -// Modif: +// Modif: // Version 1.1 (2001-04-09) Remove 3 lines in getNumberOfPage() that were forgot after debugging // Version 1.1 (2001-04-09) Modification to the exemple // Version 1.1 (2001-04-10) Added more argv to the previous and next link. ( by: peliter@mail.peliter.com ) @@ -28,28 +28,65 @@ // * Function printPaging() broken in two: getPagingArray() and getPagingRowArray() // * Function openTable() and closeTable() removed. // ===================================================== + class Paging { - var $int_num_result; // Number of result to show per page (decided by user) - var $int_nbr_row; // Total number of items (SQL count from db) - var $int_cur_position;// Current position in recordset - var $str_ext_argv; // Extra argv of query string - - // ------------------------------------------------------------------------ Constructor - // - function __construct($int_nbr_row, $int_cur_position, $int_num_result, $str_ext_argv = "") + /** + * Number of result to show per page (decided by user) + * + * @var int + */ + public $int_num_result; + + /** + * Total number of items (SQL count from db) + * + * @var int + */ + public $int_nbr_row; + + /** + * Current position in recordset + * + * @var int + */ + public $int_cur_position; + + /** + * Extra argv of query string + * + * @var string + */ + public $str_ext_argv; + + /** + * Paging constructor. + * @param int $int_nbr_row + * @param int $int_cur_position + * @param int $int_num_result + * @param string $str_ext_argv + */ + public function __construct($int_nbr_row, $int_cur_position, $int_num_result, $str_ext_argv = "") { $this->int_nbr_row = $int_nbr_row; $this->int_num_result = $int_num_result; $this->int_cur_position = $int_cur_position; $this->str_ext_argv = urldecode($str_ext_argv); - } // End constructor - - // ------------------------------------------------------------------- getNumberOfPage() - // This function returns the total number of page to display. - - function getPagingArray() + } + + /** + * This function print the paging to the screen. + * This function returns an array: + * $array_paging['lower'] lower limit of where we are in result set + * $array_paging['upper'] upper limit of where we are in result set + * $array_paging['total'] total number of result + * $array_paging['previous_link'] href tag for previous link + * $array_paging['next_link'] href tag for next link + * + * @return array + */ + public function getPagingArray() { global $PHP_SELF; @@ -73,13 +110,16 @@ function getPagingArray() $array_paging['last_link'] = "int_nbr_row . $this->str_ext_argv . "\">"; $array_paging['next_link'] = "str_ext_argv . "\">"; } - return $array_paging; - } // end function - - // -------------------------------------------------------------------- getCurrentPage() - // This function returns the current page number. - function getPagingRowArray() + return $array_paging; + } + + /** + * This function returns an array of string (href link with the page number) + * + * @return array + */ + public function getPagingRowArray() { global $PHP_SELF; $array_all_page = array(); @@ -92,31 +132,29 @@ function getPagingRowArray() $array_all_page[$i] = "str_ext_argv\">" . ($i + 1) . " "; } } + return $array_all_page; - } // end function - - // ----------------------------------------------------------------------- getPagingArray() - // This function print the paging to the screen. - // This function returns an array: - // $array_paging['lower'] lower limit of where we are in result set - // $array_paging['upper'] upper limit of where we are in result set - // $array_paging['total'] total number of result - // $array_paging['previous_link'] href tag for previous link - // $array_paging['next_link'] href tag for next link - - function getNumberOfPage() + } + + /** + * This function returns the total number of page to display. + * + * @return float|int + */ + public function getNumberOfPage() { - $int_nbr_page = $this->int_nbr_row / $this->int_num_result; - return $int_nbr_page; - } // end function - - // ----------------------------------------------------------------------- getPagingRowArray() - // This function returns an array of string (href link with the page number) - - function getCurrentPage() + return $this->int_nbr_row / $this->int_num_result; + } + + /** + * This function returns the current page number. + * + * @return int + */ + public function getCurrentPage() { $int_cur_page = ($this->int_cur_position * $this->getNumberOfPage()) / $this->int_nbr_row; + return number_format($int_cur_page, 0); - } // end function + } } -// End Class diff --git a/manager/includes/preload.functions.inc.php b/manager/includes/preload.functions.inc.php index 490aa08bfd..a04537c7e3 100644 --- a/manager/includes/preload.functions.inc.php +++ b/manager/includes/preload.functions.inc.php @@ -30,7 +30,7 @@ function startCMSSession() $cookieDomain = !empty($session_cookie_domain) ? $session_cookie_domain : ''; session_set_cookie_params($cookieExpiration, $cookiePath, $cookieDomain, $secure, true); session_start(); - $key = "modx.session.cookie.lifetime"; + $key = "modx.mgr.session.cookie.lifetime"; if (isset($_SESSION[$key]) && is_numeric($_SESSION[$key])) { $cookieLifetime = (int)$_SESSION[$key]; if ($cookieLifetime) { diff --git a/manager/includes/protect.inc.php b/manager/includes/protect.inc.php index afc92ba7de..f868ed98b8 100644 --- a/manager/includes/protect.inc.php +++ b/manager/includes/protect.inc.php @@ -6,53 +6,77 @@ error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED); // Null is evil -if (isset($_SERVER['QUERY_STRING']) && strpos(urldecode($_SERVER['QUERY_STRING']), chr(0)) !== false) +if (isset($_SERVER['QUERY_STRING']) && strpos(urldecode($_SERVER['QUERY_STRING']), chr(0)) !== false) { die(); +} global $sanitize_seed; -$sanitize_seed = 'sanitize_seed_' . base_convert(md5(__FILE__),16,36); +$sanitize_seed = 'sanitize_seed_' . base_convert(md5(__FILE__), 16, 36); // sanitize array if (!function_exists('modx_sanitize_gpc')) { - function modx_sanitize_gpc(& $values, $depth=0) { - if(200 < $depth) exit('GPC Array nested too deep!'); - if(is_array($values)) { + /** + * @param array|string $values + * @param int $depth + * @return array|string + */ + function modx_sanitize_gpc(& $values, $depth = 0) + { + if (200 < $depth) { + exit('GPC Array nested too deep!'); + } + if (is_array($values)) { $depth++; foreach ($values as $key => $value) { - if (is_array($value)) modx_sanitize_gpc($value, $depth); - else $values[$key] = getSanitizedValue($value); + if (is_array($value)) { + modx_sanitize_gpc($value, $depth); + } else { + $values[$key] = getSanitizedValue($value); + } } + } else { + $values = getSanitizedValue($values); } - else $values = getSanitizedValue($values); - + return $values; } } -function getSanitizedValue($value='') { +/** + * @param string $value + * @return string + */ +function getSanitizedValue($value = '') +{ global $sanitize_seed; - - if(!$value) return $value; - + + if (empty($value)) { + return $value; + } + $brackets = explode(' ', '[[ ]] [! !] [* *] [( )] {{ }} [+ +] [~ ~] [^ ^]'); - foreach($brackets as $bracket) { - if(strpos($value,$bracket)===false) continue; - $sanitizedBracket = str_replace('#', $sanitize_seed, sprintf('#%s#%s#', substr($bracket,0,1), substr($bracket,1,1))); - $value = str_replace($bracket,$sanitizedBracket,$value); + foreach ($brackets as $bracket) { + if (strpos($value, $bracket) === false) { + continue; + } + $sanitizedBracket = str_replace('#', $sanitize_seed, + sprintf('#%s#%s#', substr($bracket, 0, 1), substr($bracket, 1, 1))); + $value = str_replace($bracket, $sanitizedBracket, $value); } $value = str_ireplace('$url) { - $output = ''; +foreach ($urls as $section => $url) { + $output = ''; $rss = @fetch_rss($url); - if( !$rss ){ - $feedData[$section] = 'Failed to retrieve ' . $url; - continue; - } + if (!$rss) { + $feedData[$section] = 'Failed to retrieve ' . $url; + continue; + } $output .= '
        '; $items = array_slice($rss->items, 0, $itemsNumber); foreach ($items as $item) { - $href = rel2abs($item['link'],'https://github.com'); + $href = rel2abs($item['link'], 'https://github.com'); $title = $item['title']; $pubdate = $item['pubdate']; $pubdate = $modx->toDateFormat(strtotime($pubdate)); $description = strip_tags($item['description']); if (strlen($description) > 199) { $description = substr($description, 0, 200); - $description .= '...
        Read more.'; + $description .= '...
        Read more.'; } - $output .= '
      • '.$title.' - '.$pubdate.'
        '.$description.'
      • '; + $output .= '
      • ' . $title . ' - ' . $pubdate . '
        ' . $description . '
      • '; } $output .= '
      '; - $feedData[$section] = $output; + $feedData[$section] = $output; } -?> diff --git a/manager/includes/secure_mgr_documents.inc.php b/manager/includes/secure_mgr_documents.inc.php index 2131607f34..d99f251c43 100644 --- a/manager/includes/secure_mgr_documents.inc.php +++ b/manager/includes/secure_mgr_documents.inc.php @@ -1,29 +1,33 @@ INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); +} /** - * Secure Manager Documents - * This script will mark manager documents as private + * Secure Manager Documents + * This script will mark manager documents as private * - * A document will be marked as private only if a manager user group - * is assigned to the document group that the document belongs to. + * A document will be marked as private only if a manager user group + * is assigned to the document group that the document belongs to. * + * @param string $docid */ +function secureMgrDocument($docid = '') +{ + global $modx; -function secureMgrDocument($docid='') { - global $modx; - - $modx->db->update('privatemgr = 0', $modx->getFullTableName("site_content"), ($docid>0 ? "id='$docid'":"privatemgr = 1")); - $rs = $modx->db->select( - 'DISTINCT sc.id', - $modx->getFullTableName("site_content")." sc - LEFT JOIN ".$modx->getFullTableName("document_groups")." dg ON dg.document = sc.id - LEFT JOIN ".$modx->getFullTableName("membergroup_access")." mga ON mga.documentgroup = dg.document_group", - ($docid>0 ? " sc.id='{$docid}' AND ":"")."mga.id>0" - ); - $ids = $modx->db->getColumn("id",$rs); - if(count($ids)>0) { - $modx->db->update('privatemgr = 1', $modx->getFullTableName("site_content"), "id IN (".implode(", ",$ids).")"); - } + $modx->db->update('privatemgr = 0', $modx->getFullTableName("site_content"), + ($docid > 0 ? "id='$docid'" : "privatemgr = 1")); + $rs = $modx->db->select( + 'DISTINCT sc.id', + $modx->getFullTableName("site_content") . " sc + LEFT JOIN " . $modx->getFullTableName("document_groups") . " dg ON dg.document = sc.id + LEFT JOIN " . $modx->getFullTableName("membergroup_access") . " mga ON mga.documentgroup = dg.document_group", + ($docid > 0 ? " sc.id='{$docid}' AND " : "") . "mga.id>0" + ); + $ids = $modx->db->getColumn("id", $rs); + if (count($ids) > 0) { + $modx->db->update('privatemgr = 1', $modx->getFullTableName("site_content"), + "id IN (" . implode(", ", $ids) . ")"); + } } -?> \ No newline at end of file diff --git a/manager/includes/secure_web_documents.inc.php b/manager/includes/secure_web_documents.inc.php index b91fbd6471..0ec5e3307b 100644 --- a/manager/includes/secure_web_documents.inc.php +++ b/manager/includes/secure_web_documents.inc.php @@ -1,29 +1,33 @@ INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); +} /** - * Secure Web Documents - * This script will mark web documents as private + * Secure Web Documents + * This script will mark web documents as private * - * A document will be marked as private only if a web user group - * is assigned to the document group that the document belongs to. + * A document will be marked as private only if a web user group + * is assigned to the document group that the document belongs to. * + * @param string $docid */ +function secureWebDocument($docid = '') +{ + global $modx; -function secureWebDocument($docid='') { - global $modx; - - $modx->db->update('privateweb = 0', $modx->getFullTableName("site_content"), ($docid>0 ? "id='$docid'":"privateweb = 1")); - $rs = $modx->db->select( - 'DISTINCT sc.id', - $modx->getFullTableName("site_content")." sc - LEFT JOIN ".$modx->getFullTableName("document_groups")." dg ON dg.document = sc.id - LEFT JOIN ".$modx->getFullTableName("webgroup_access")." wga ON wga.documentgroup = dg.document_group", - ($docid>0 ? " sc.id='{$docid}' AND ":"")."wga.id>0" - ); - $ids = $modx->db->getColumn("id",$rs); - if(count($ids)>0) { - $modx->db->update('privateweb = 1', $modx->getFullTableName("site_content"), "id IN (".implode(", ",$ids).")"); - } + $modx->db->update('privateweb = 0', $modx->getFullTableName("site_content"), + ($docid > 0 ? "id='$docid'" : "privateweb = 1")); + $rs = $modx->db->select( + 'DISTINCT sc.id', + $modx->getFullTableName("site_content") . " sc + LEFT JOIN " . $modx->getFullTableName("document_groups") . " dg ON dg.document = sc.id + LEFT JOIN " . $modx->getFullTableName("webgroup_access") . " wga ON wga.documentgroup = dg.document_group", + ($docid > 0 ? " sc.id='{$docid}' AND " : "") . "wga.id>0" + ); + $ids = $modx->db->getColumn("id", $rs); + if (count($ids) > 0) { + $modx->db->update('privateweb = 1', $modx->getFullTableName("site_content"), + "id IN (" . implode(", ", $ids) . ")"); + } } -?> \ No newline at end of file diff --git a/manager/includes/session_keepalive.php b/manager/includes/session_keepalive.php index 900ed47a4b..271385d61e 100644 --- a/manager/includes/session_keepalive.php +++ b/manager/includes/session_keepalive.php @@ -11,14 +11,12 @@ $modx->getSettings(); $modx->invokeEvent('OnManagerPageInit'); $ok = false; -if(isset($_SESSION['mgrToken']) && $_GET['tok'] == $_SESSION['mgrToken']) { - $ok = true; - $modx->updateValidatedUserSession(); + +if (isset($_SESSION['mgrToken']) && $_GET['tok'] == $_SESSION['mgrToken']) { + $ok = true; + $modx->updateValidatedUserSession(); } header('Content-type: application/json'); -if($ok) { - echo '{"status":"ok"}'; -} else { - echo '{"status":"null"}'; -} + +echo $ok ? '{"status":"ok"}' : '{"status":"null"}'; diff --git a/manager/includes/settings.inc.php b/manager/includes/settings.inc.php old mode 100755 new mode 100644 index 3a3d322f9b..480aac2b2b --- a/manager/includes/settings.inc.php +++ b/manager/includes/settings.inc.php @@ -1,20 +1,22 @@ INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); +} // get the settings from the database. $settings = array(); -if ($modx && count($modx->config)>0) $settings = $modx->config; -else{ - $rs = $modx->db->select('setting_name, setting_value', $modx->getFullTableName('system_settings')); - while ($row = $modx->db->getRow($rs)) { - $settings[$row['setting_name']] = $row['setting_value']; - } +if ($modx && count($modx->config) > 0) { + $settings = $modx->config; +} else { + $rs = $modx->db->select('setting_name, setting_value', $modx->getFullTableName('system_settings')); + while ($row = $modx->db->getRow($rs)) { + $settings[$row['setting_name']] = $row['setting_value']; + } } extract($settings, EXTR_OVERWRITE); // setup default site id - new installation should generate a unique id for the site. -if(!isset($site_id)) $site_id = "MzGeQ2faT4Dw06+U49x3"; - - -?> \ No newline at end of file +if (!isset($site_id)) { + $site_id = "MzGeQ2faT4Dw06+U49x3"; +} diff --git a/manager/includes/template.parser.class.inc.php b/manager/includes/template.parser.class.inc.php index 40b1f4c09a..1c7ac5dcd3 100644 --- a/manager/includes/template.parser.class.inc.php +++ b/manager/includes/template.parser.class.inc.php @@ -9,10 +9,7 @@ Class TemplateParser { - function __construct() { - } - - /** + /** * @param array $config [action, tabs, toArray] * @param array $data * @return string @@ -69,6 +66,10 @@ public function output($config = array(), $data = array()) { return $output; } + /** + * @param array $data + * @return string + */ private function render($data) { global $modx, $_lang, $_country_lang; diff --git a/manager/includes/tmplvars.commands.inc.php b/manager/includes/tmplvars.commands.inc.php old mode 100755 new mode 100644 index 52e9c1d4a1..79d888dbbb --- a/manager/includes/tmplvars.commands.inc.php +++ b/manager/includes/tmplvars.commands.inc.php @@ -14,9 +14,17 @@ 'DIRECTORY' ); +/** + * @param string $value + * @param string $name + * @param string $docid + * @param string $src + * @param array $tvsArray + * @return string + */ function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsArray = array()) { global $modx; - $docid = intval($docid) ? intval($docid) : $modx->documentIdentifier; + $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier; $nvalue = trim($value); if (substr($nvalue, 0, 1) != '@') return $value; @@ -78,8 +86,8 @@ function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsA $tv = $modx->getTemplateVar($name, '*', $doc['id'], $doc['published']); // if an inherited value is found and if there is content following the @INHERIT binding - // remove @INHERIT and output that following content. This content could contain other - // @ bindings, that are processed in the next step + // remove @INHERIT and output that following content. This content could contain other + // @ bindings, that are processed in the next step if ((string) $tv['value'] !== '' && !preg_match('%^@INHERIT[\s\n\r]*$%im', $tv['value'])) { $output = trim(str_replace('@INHERIT', '', (string) $tv['value'])); break 2; @@ -117,14 +125,23 @@ function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsA } } +/** + * @param $file + * @return string + */ function ProcessFile($file) { // get the file $buffer = @file_get_contents($file); - if ($buffer===false) $buffer = " Could not retrieve document '$file'."; + if ($buffer === false) $buffer = " Could not retrieve document '$file'."; return $buffer; } -// ParseCommand - separate @ cmd from params +/** + * ParseCommand - separate @ cmd from params + * + * @param string $binding_string + * @return array + */ function ParseCommand($binding_string) { global $BINDINGS; @@ -141,7 +158,13 @@ function ParseCommand($binding_string) return $binding_array; } -// Parse MODX Template-Variables +/** + * Parse MODX Template-Variables + * + * @param string $param + * @param array $tvsArray + * @return mixed + */ function parseTvValues($param, $tvsArray) { global $modx; @@ -161,4 +184,4 @@ function parseTvValues($param, $tvsArray) } } return $param; -} \ No newline at end of file +} diff --git a/manager/includes/tmplvars.format.inc.php b/manager/includes/tmplvars.format.inc.php old mode 100755 new mode 100644 index a17c563da4..1098fc5c8b --- a/manager/includes/tmplvars.format.inc.php +++ b/manager/includes/tmplvars.format.inc.php @@ -5,12 +5,23 @@ */ // Added by Raymond 20-Jan-2005 +/** + * @param string $name + * @param string $value + * @param string $format + * @param string $paramstring + * @param string $tvtype + * @param string $docid + * @param string $sep + * @return mixed|string + */ function getTVDisplayFormat($name, $value, $format, $paramstring = "", $tvtype = "", $docid = "", $sep = '') { global $modx; + $o = ''; - // process any TV commands in value - $docid = intval($docid) ? intval($docid) : $modx->documentIdentifier; + // process any TV commands in value + $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier; $value = ProcessTVCommand($value, $name, $docid); $params = array(); @@ -29,7 +40,6 @@ function getTVDisplayFormat($name, $value, $format, $paramstring = "", $tvtype = switch($format) { case 'image': $images = parseInput($value, '||', 'array'); - $o = ''; foreach($images as $image) { if(!is_array($image)) { $image = explode('==', $image); @@ -99,7 +109,8 @@ function getTVDisplayFormat($name, $value, $format, $paramstring = "", $tvtype = case "hyperlink": $value = parseInput($value, "||", "array"); $o = ''; - for($i = 0; $i < count($value); $i++) { + $countValue = count($value); + for($i = 0; $i < $countValue; $i++) { list($name, $url) = is_array($value[$i]) ? $value[$i] : explode("==", $value[$i]); if(!$url) { $url = $name; @@ -132,7 +143,8 @@ function getTVDisplayFormat($name, $value, $format, $paramstring = "", $tvtype = $tagname = ($params['tagname']) ? $params['tagname'] : 'div'; $o = ''; // Loop through a list of tags - for($i = 0; $i < count($value); $i++) { + $countValue = count($value); + for($i = 0; $i < $countValue; $i++) { $tagvalue = is_array($value[$i]) ? implode(' ', $value[$i]) : $value[$i]; if(!$tagvalue) { continue; @@ -325,13 +337,24 @@ function getTVDisplayFormat($name, $value, $format, $paramstring = "", $tvtype = return $o; } +/** + * @param string $s + * @return string + */ function decodeParamValue($s) { $s = str_replace("%3D", '=', $s); // = - $s = str_replace("%26", '&', $s); // & - return $s; + return str_replace("%26", '&', $s); // & } -// returns an array if a delimiter is present. returns array is a recordset is present +/** + * returns an array if a delimiter is present. returns array is a recordset is present + * + * @param $src + * @param string $delim + * @param string $type + * @param bool $columns + * @return array|string + */ function parseInput($src, $delim = "||", $type = "string", $columns = true) { // type can be: string, array global $modx; if($modx->db->isResult($src)) { @@ -349,6 +372,10 @@ function parseInput($src, $delim = "||", $type = "string", $columns = true) { // } } +/** + * @param string $value + * @return bool|false|int + */ function getUnixtimeFromDateString($value) { $timestamp = false; // Check for MySQL or legacy style date diff --git a/manager/includes/tmplvars.inc.php b/manager/includes/tmplvars.inc.php index 11e97d8364..ee3a6f3527 100644 --- a/manager/includes/tmplvars.inc.php +++ b/manager/includes/tmplvars.inc.php @@ -1,5 +1,17 @@ INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); +} // START HACK if (isset ($modx)) { - $user_id = $modx->getLoginUserID(); + $user_id = $modx->getLoginUserID(); } else { - $user_id = $_SESSION['mgrInternalKey']; + $user_id = $_SESSION['mgrInternalKey']; } // END HACK if (!empty($user_id)) { - // Raymond: grab the user settings from the database. - $rs = $modx->db->select('setting_name, setting_value', $modx->getFullTableName('user_settings'), "user=".$modx->getLoginUserID()); + // Raymond: grab the user settings from the database. + $rs = $modx->db->select('setting_name, setting_value', $modx->getFullTableName('user_settings'), + "user=" . $modx->getLoginUserID()); - $which_browser_default = $which_browser; - while ($row = $modx->db->getRow($rs)) { - if($row['setting_name'] == 'which_browser' && $row['setting_value'] == 'default') $row['setting_value'] = $which_browser_default; - $settings[$row['setting_name']] = $row['setting_value']; - if (isset($modx->config)) { - $modx->config[$row['setting_name']] = $row['setting_value']; - } - } - extract($settings, EXTR_OVERWRITE); + $which_browser_default = $which_browser; + while ($row = $modx->db->getRow($rs)) { + if ($row['setting_name'] == 'which_browser' && $row['setting_value'] == 'default') { + $row['setting_value'] = $which_browser_default; + } + $settings[$row['setting_name']] = $row['setting_value']; + if (isset($modx->config)) { + $modx->config[$row['setting_name']] = $row['setting_value']; + } + } + extract($settings, EXTR_OVERWRITE); } -?> \ No newline at end of file diff --git a/manager/includes/veriword.php b/manager/includes/veriword.php old mode 100755 new mode 100644 index bbfb511ec7..f1bb46475f --- a/manager/includes/veriword.php +++ b/manager/includes/veriword.php @@ -50,6 +50,7 @@ class VeriWord { public $word = ""; public $im_width = 0; public $im_height = 0; + public $im; public function __construct($w=200, $h=80) { /* create session to set word for verification */ @@ -125,13 +126,13 @@ public function draw_text() { /* draw text into canvas */ imagettftext ( $im_text, - $text_size, - $text_angle, - $text_x, - $text_y, - $text_color, - $text_font, - $this->word); + $text_size, + $text_angle, + $text_x, + $text_y, + $text_color, + $text_font, + $this->word); /* remove background color */ imagecolortransparent($im_text, $bg_color); @@ -152,20 +153,20 @@ public function draw_image() { /* resize the background image to fit the size of image output */ $this->im = imagecreatetruecolor($this->im_width,$this->im_height); imagecopyresampled ($this->im, - $noise_img, - 0, 0, 0, 0, - $this->im_width, - $this->im_height, - $noise_width, - $noise_height); + $noise_img, + 0, 0, 0, 0, + $this->im_width, + $this->im_height, + $noise_width, + $noise_height); /* put text image into background image */ imagecopymerge ( $this->im, - $this->draw_text(), - 0, 0, 0, 0, - $this->im_width, - $this->im_height, - 70 ); + $this->draw_text(), + 0, 0, 0, 0, + $this->im_width, + $this->im_height, + 70 ); return $this->im; } @@ -176,4 +177,4 @@ public function destroy_image() { } -} \ No newline at end of file +} diff --git a/manager/index.php b/manager/index.php index fde431615b..878a94355d 100644 --- a/manager/index.php +++ b/manager/index.php @@ -79,8 +79,8 @@ // we use this to make sure files are accessed through // the manager instead of seperately. -if (!defined('IN_MANAGER_MODE')) { - define("IN_MANAGER_MODE", true); +if ( ! defined('IN_MANAGER_MODE')) { + define('IN_MANAGER_MODE', true); } // harden it @@ -117,13 +117,13 @@ $incPath = str_replace("\\","/",dirname(__FILE__)."/includes/"); // Mod by Raymond set_include_path(get_include_path() . PATH_SEPARATOR . $incPath); -if (!defined("ENT_COMPAT")) define("ENT_COMPAT", 2); -if (!defined("ENT_NOQUOTES")) define("ENT_NOQUOTES", 0); -if (!defined("ENT_QUOTES")) define("ENT_QUOTES", 3); +if (!defined('ENT_COMPAT')) define('ENT_COMPAT', 2); +if (!defined('ENT_NOQUOTES')) define('ENT_NOQUOTES', 0); +if (!defined('ENT_QUOTES')) define('ENT_QUOTES', 3); // set the document_root :| -if(!isset($_SERVER["DOCUMENT_ROOT"]) || empty($_SERVER["DOCUMENT_ROOT"])) { - $_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PATH_INFO"], "", preg_replace("/\\\\/", "/", $_SERVER["PATH_TRANSLATED"]))."/"; +if(!isset($_SERVER['DOCUMENT_ROOT']) || empty($_SERVER['DOCUMENT_ROOT'])) { + $_SERVER['DOCUMENT_ROOT'] = str_replace($_SERVER['PATH_INFO'], "", preg_replace("/\\\\/", "/", $_SERVER['PATH_TRANSLATED']))."/"; } // include_once config file @@ -138,8 +138,14 @@ include_once "config.inc.php"; // initiate the content manager class -include_once "document.parser.class.inc.php"; -$modx = new DocumentParser; +if (isset($coreClass) && class_exists($coreClass)) { + $modx = new $coreClass; +} +if (!isset($modx) || !($modx instanceof \DocumentParser)) { + include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php'); + $modx = new \DocumentParser; +} + $modx->loadExtension("ManagerAPI"); $modx->getSettings(); $modx->tstart = $tstart; @@ -163,7 +169,7 @@ $manager_language = "english"; // if not set, get the english language file. } -// $length_eng_lang = count($_lang); // Not used for now, required for difference-check with other languages than english (i.e. inside installer) +// $length_eng_lang = count($_lang); // Not used for now, required for difference-check with other languages than english (i.e. inside installer) if($manager_language!="english" && file_exists(MODX_MANAGER_PATH."includes/lang/".$manager_language.".inc.php")) { include_once "lang/".$manager_language.".inc.php"; @@ -238,7 +244,7 @@ $modx->manager->action = $action; // attempt to foil some simple types of CSRF attacks -if (isset($modx->config['validate_referer']) && intval($modx->config['validate_referer'])) { +if (isset($modx->config['validate_referer']) && (int)$modx->config['validate_referer']) { if (isset($_SERVER['HTTP_REFERER'])) { $referer = $_SERVER['HTTP_REFERER']; diff --git a/manager/media/browser/mcpuk/browse.php b/manager/media/browser/mcpuk/browse.php index 81b98aec99..0f0e308919 100644 --- a/manager/media/browser/mcpuk/browse.php +++ b/manager/media/browser/mcpuk/browse.php @@ -25,5 +25,3 @@ function returnNoPermissionsMessage($role) { $browser = new browser($modx); $browser->action(); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/config.php b/manager/media/browser/mcpuk/config.php index 8cd6149022..ef4dfe4f24 100644 --- a/manager/media/browser/mcpuk/config.php +++ b/manager/media/browser/mcpuk/config.php @@ -23,7 +23,7 @@ 'denyZipDownload' => $modx->config['denyZipDownload'], 'denyExtensionRename' => $modx->config['denyExtensionRename'], 'showHiddenFiles' => $modx->config['showHiddenFiles'], - + 'theme' => "evo", 'uploadURL' => rtrim($modx->config['rb_base_url'],'/'), @@ -70,7 +70,7 @@ 'dirnameChangeChars' => array( ' ' => "_", ':' => "." - ), + ), 'mime_magic' => "", 'maxImageWidth' => $modx->config['maxImageWidth'], @@ -98,5 +98,3 @@ //'_sessionDomain' => ".mysite.com", //'_sessionPath' => "/my/path", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/core/autoload.php b/manager/media/browser/mcpuk/core/autoload.php index 47e94418e9..ff4e39fb96 100644 --- a/manager/media/browser/mcpuk/core/autoload.php +++ b/manager/media/browser/mcpuk/core/autoload.php @@ -25,11 +25,11 @@ include_once('../../../includes/document.parser.class.inc.php'); $modx = new DocumentParser; $modx->db->connect(); -startCMSSession(); +startCMSSession(); if(!isset($_SESSION['mgrValidated'])) { die("INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); } -define('IN_MANAGER_MODE', "true"); +define('IN_MANAGER_MODE', true); $modx->getSettings(); $manager_language = $modx->config['manager_language']; @@ -71,7 +71,7 @@ function autoloadda9d06472ccb71b84928677ce2a6ca89($class) { 'image_imagick' => '/../lib/class_image_imagick.php', 'image_gmagick' => '/../lib/class_image_gmagick.php', 'image_gd' => '/../lib/class_image_gd.php', - 'fastImage' => '/../lib/class_fastImage.php' + 'fastImage' => '/../lib/class_fastImage.php' ); } if (isset($classes[$class])) { @@ -219,5 +219,3 @@ public function gc($maxlifetime) { // PUT YOUR ADDITIONAL CODE HERE - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/core/browser.php b/manager/media/browser/mcpuk/core/browser.php index ac49343d31..a978b321b1 100644 --- a/manager/media/browser/mcpuk/core/browser.php +++ b/manager/media/browser/mcpuk/core/browser.php @@ -686,14 +686,14 @@ protected function moveUploadFile($file, $dir) { return "{$file['name']}: " . $this->label("Cannot move uploaded file to target folder."); } elseif (function_exists('chmod')) chmod($target, $this->config['filePerms']); - + $this->modx->invokeEvent('OnFileBrowserUpload',array( 'filepath'=>realpath($dir), 'filename'=>str_replace("/","",str_replace($dir,"",realpath($target))) )); - + $this->makeThumb($target); - + return "/" . basename($target); } @@ -884,5 +884,3 @@ protected function errorMsg($message, array $data=null) { } } } - -?> diff --git a/manager/media/browser/mcpuk/core/types/type_img.php b/manager/media/browser/mcpuk/core/types/type_img.php index c788cfdb3d..158e81b21a 100644 --- a/manager/media/browser/mcpuk/core/types/type_img.php +++ b/manager/media/browser/mcpuk/core/types/type_img.php @@ -27,5 +27,3 @@ public function checkFile($file, array $config) { return true; } } - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/core/types/type_mime.php b/manager/media/browser/mcpuk/core/types/type_mime.php index bf22d4f1a0..ec4a2eaa5c 100644 --- a/manager/media/browser/mcpuk/core/types/type_mime.php +++ b/manager/media/browser/mcpuk/core/types/type_mime.php @@ -43,5 +43,3 @@ public function checkFile($file, array $config) { : true; } } - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/js/browser/joiner.php b/manager/media/browser/mcpuk/js/browser/joiner.php index 805fff1ae5..6562d0d7c1 100644 --- a/manager/media/browser/mcpuk/js/browser/joiner.php +++ b/manager/media/browser/mcpuk/js/browser/joiner.php @@ -31,5 +31,3 @@ header("Content-Type: text/javascript"); foreach ($files as $file) require $file; - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/js_localize.php b/manager/media/browser/mcpuk/js_localize.php index 46413f2b28..1fb386cd96 100644 --- a/manager/media/browser/mcpuk/js_localize.php +++ b/manager/media/browser/mcpuk/js_localize.php @@ -34,5 +34,3 @@ foreach ($lang as $english => $native) if (substr($english, 0, 1) != "_") echo "browser.labels['" . text::jsValue($english) . "']=\"" . text::jsValue($native) . "\";"; - -?> diff --git a/manager/media/browser/mcpuk/lib/class_fastImage.php b/manager/media/browser/mcpuk/lib/class_fastImage.php old mode 100755 new mode 100644 index a42093af37..ec12ef40cc --- a/manager/media/browser/mcpuk/lib/class_fastImage.php +++ b/manager/media/browser/mcpuk/lib/class_fastImage.php @@ -126,7 +126,6 @@ private function parseSizeForBMP() private function parseSizeForJPEG() { $state = null; - $i = 0; while (true) { @@ -237,4 +236,4 @@ public function __destruct() { $this->close(); } -} \ No newline at end of file +} diff --git a/manager/media/browser/mcpuk/lib/class_gd.php b/manager/media/browser/mcpuk/lib/class_gd.php index dbf94b9280..c9ed6f04af 100644 --- a/manager/media/browser/mcpuk/lib/class_gd.php +++ b/manager/media/browser/mcpuk/lib/class_gd.php @@ -364,26 +364,26 @@ public function imagecopyresampled( if (is_null($src_h)) $src_h = $src_height - $src_y; imagealphablending($this->image, false); imagesavealpha($this->image,true); - - - - + + + + /*** gif transparent fix - 1.10.2013 ***/ - + $transindex = imagecolortransparent($src); $palletsize = imagecolorstotal($src); if($transindex >= 0 && $transindex < $palletsize) { $transcol = imagecolorsforindex($src, $transindex); - + /*** end gif transparent fix ***/ - + $transindex = imagecolorallocatealpha($this->image, $transcol['red'], $transcol['green'], $transcol['blue'], 127); imagefilledrectangle($this->image, 0, 0, $dst_w, $dst_h, $transindex); imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); imagecolortransparent($this->image, $transindex); for($y=0; $y<$dst_h; ++$y) for($x=0; $x<$dst_w; ++$x) - if(((imagecolorat($this->image, $x, $y)>>24) & 0x7F) >= 100) imagesetpixel($this->image, $x, $y, $transindex); + if(((imagecolorat($this->image, $x, $y)>>24) & 0x7F) >= 100) imagesetpixel($this->image, $x, $y, $transindex); imagetruecolortopalette($this->image, true, 255); } else { @@ -423,5 +423,3 @@ public function imagegif($filename=null) { return imagegif($this->image, $filename); } } - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lib/class_image.php b/manager/media/browser/mcpuk/lib/class_image.php old mode 100755 new mode 100644 index b270eabb73..79918a49b2 --- a/manager/media/browser/mcpuk/lib/class_image.php +++ b/manager/media/browser/mcpuk/lib/class_image.php @@ -237,5 +237,3 @@ abstract protected function getBlankImage($width, $height); abstract protected function getImage($image, &$width, &$height); } - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lib/class_image_gd.php b/manager/media/browser/mcpuk/lib/class_image_gd.php old mode 100755 new mode 100644 index 76116e0473..c564ce8e43 --- a/manager/media/browser/mcpuk/lib/class_image_gd.php +++ b/manager/media/browser/mcpuk/lib/class_image_gd.php @@ -350,5 +350,3 @@ protected function imageCopyResampled( return imageCopyResampled($this->image, $src, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH); } } - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lib/class_image_gmagick.php b/manager/media/browser/mcpuk/lib/class_image_gmagick.php old mode 100755 new mode 100644 index a53b528b07..f67691f99b --- a/manager/media/browser/mcpuk/lib/class_image_gmagick.php +++ b/manager/media/browser/mcpuk/lib/class_image_gmagick.php @@ -238,7 +238,7 @@ static function available() { static function checkImage($file) { try { - $img = new Gmagic($file); + new Gmagick($file); } catch (Exception $e) { return false; } @@ -298,5 +298,3 @@ protected function optimize_jpeg(array $options=array()) { } } - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lib/class_image_imagick.php b/manager/media/browser/mcpuk/lib/class_image_imagick.php old mode 100755 new mode 100644 index 4f4d7b8cfc..0d576fa345 --- a/manager/media/browser/mcpuk/lib/class_image_imagick.php +++ b/manager/media/browser/mcpuk/lib/class_image_imagick.php @@ -240,7 +240,7 @@ static function available() { static function checkImage($file) { try { - $img = new Imagic($file); + new Imagick($file); } catch (Exception $e) { return false; } @@ -301,5 +301,3 @@ protected function optimize_jpeg(array $options=array()) { } } - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lib/class_input.php b/manager/media/browser/mcpuk/lib/class_input.php old mode 100755 new mode 100644 index d9073311b7..36917217ad --- a/manager/media/browser/mcpuk/lib/class_input.php +++ b/manager/media/browser/mcpuk/lib/class_input.php @@ -40,5 +40,3 @@ public function __get($property) { return property_exists($this, $property) ? $this->$property : null; } } - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lib/class_zipFolder.php b/manager/media/browser/mcpuk/lib/class_zipFolder.php old mode 100755 new mode 100644 index 3885a9e45a..a5d469f7ab --- a/manager/media/browser/mcpuk/lib/class_zipFolder.php +++ b/manager/media/browser/mcpuk/lib/class_zipFolder.php @@ -56,5 +56,3 @@ function zip($folder, $parent=null) { } } } - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lib/helper_dir.php b/manager/media/browser/mcpuk/lib/helper_dir.php old mode 100755 new mode 100644 index 2ddfc54113..2f61f2ebe8 --- a/manager/media/browser/mcpuk/lib/helper_dir.php +++ b/manager/media/browser/mcpuk/lib/helper_dir.php @@ -157,5 +157,3 @@ static function fileSort($a, $b) { return ($a < $b) ? -1 : 1; } } - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lib/helper_file.php b/manager/media/browser/mcpuk/lib/helper_file.php old mode 100755 new mode 100644 index 4221268c7c..1f0200bcd7 --- a/manager/media/browser/mcpuk/lib/helper_file.php +++ b/manager/media/browser/mcpuk/lib/helper_file.php @@ -198,5 +198,3 @@ static function getInexistantFilename($filename, $dir=null, $tpl=null) { } } - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lib/helper_httpCache.php b/manager/media/browser/mcpuk/lib/helper_httpCache.php old mode 100755 new mode 100644 index e2c2c2c417..2dd660c6d0 --- a/manager/media/browser/mcpuk/lib/helper_httpCache.php +++ b/manager/media/browser/mcpuk/lib/helper_httpCache.php @@ -94,5 +94,3 @@ static function checkMTime($mtime, $sendHeaders=null) { } } } - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lib/helper_path.php b/manager/media/browser/mcpuk/lib/helper_path.php old mode 100755 new mode 100644 index 20886eeb60..04e9de087b --- a/manager/media/browser/mcpuk/lib/helper_path.php +++ b/manager/media/browser/mcpuk/lib/helper_path.php @@ -140,5 +140,3 @@ static function urlPathDecode($path) { return $decoded; } } - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lib/helper_text.php b/manager/media/browser/mcpuk/lib/helper_text.php old mode 100755 new mode 100644 index abd92d3eeb..8cecc353d1 --- a/manager/media/browser/mcpuk/lib/helper_text.php +++ b/manager/media/browser/mcpuk/lib/helper_text.php @@ -75,5 +75,3 @@ static function compressCSS($code) { return $code; } } - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/upload.php b/manager/media/browser/mcpuk/upload.php index d57696c30d..801fe34548 100644 --- a/manager/media/browser/mcpuk/upload.php +++ b/manager/media/browser/mcpuk/upload.php @@ -15,5 +15,3 @@ require "core/autoload.php"; $uploader = new uploader($modx); $uploader->upload(); - -?> \ No newline at end of file diff --git a/manager/media/rss/extlib/Snoopy.class.inc b/manager/media/rss/extlib/Snoopy.class.inc index bb91e6d3ec..2ac3487757 100644 --- a/manager/media/rss/extlib/Snoopy.class.inc +++ b/manager/media/rss/extlib/Snoopy.class.inc @@ -857,7 +857,7 @@ class Snoopy if (isset($this->capath)) $context_opts['ssl']['capath'] = $this->capath; } - + $host = 'ssl://' . $host; } @@ -997,5 +997,3 @@ class Snoopy return $this->results; } } - -?> diff --git a/manager/media/rss/rss_cache.inc b/manager/media/rss/rss_cache.inc index 9984dc7a67..e8d96c87ad 100644 --- a/manager/media/rss/rss_cache.inc +++ b/manager/media/rss/rss_cache.inc @@ -1,7 +1,7 @@ * Version: 0.51 @@ -20,7 +20,7 @@ class RSSCache { var $BASE_CACHE = './cache'; // where the cache files are stored var $MAX_AGE = 3600; // when are files stale, default one hour var $ERROR = ""; // accumulate error messages - + function __construct($base='', $age='') { if ( $base ) { $this->BASE_CACHE = $base; @@ -28,12 +28,12 @@ class RSSCache { if ( $age ) { $this->MAX_AGE = $age; } - + // attempt to make the cache directory if ( ! file_exists( $this->BASE_CACHE ) ) { $status = @mkdir( $this->BASE_CACHE, 0755 ); - - // if make failed + + // if make failed if ( ! $status ) { $this->error( "Cache couldn't make dir '" . $this->BASE_CACHE . "'." @@ -41,50 +41,50 @@ class RSSCache { } } } - + /*=======================================================================*\ Function: set Purpose: add an item to the cache, keyed on url Input: url from wich the rss file was fetched - Output: true on sucess + Output: true on sucess \*=======================================================================*/ function set ($url, $rss) { $this->ERROR = ""; $cache_file = $this->file_name( $url ); $fp = @fopen( $cache_file, 'w' ); - + if ( ! $fp ) { $this->error( "Cache unable to open file for writing: $cache_file" ); return 0; } - - + + $data = $this->serialize( $rss ); fwrite( $fp, $data ); fclose( $fp ); - + return $cache_file; } - + /*=======================================================================*\ Function: get Purpose: fetch an item from the cache Input: url from wich the rss file was fetched - Output: cached object on HIT, false on MISS -\*=======================================================================*/ + Output: cached object on HIT, false on MISS +\*=======================================================================*/ function get ($url) { $this->ERROR = ""; $cache_file = $this->file_name( $url ); - + if ( ! file_exists( $cache_file ) ) { - $this->debug( + $this->debug( "Cache doesn't contain: $url (cache file: $cache_file)" ); return 0; } - + $fp = @fopen($cache_file, 'r'); if ( ! $fp ) { $this->error( @@ -92,14 +92,14 @@ class RSSCache { ); return 0; } - + if ($filesize = filesize($cache_file) ) { $data = fread( $fp, filesize($cache_file) ); $rss = $this->unserialize( $data ); - + return $rss; } - + return 0; } @@ -108,12 +108,12 @@ class RSSCache { Purpose: check a url for membership in the cache and whether the object is older then MAX_AGE (ie. STALE) Input: url from wich the rss file was fetched - Output: cached object on HIT, false on MISS -\*=======================================================================*/ + Output: cached object on HIT, false on MISS +\*=======================================================================*/ function check_cache ( $url ) { $this->ERROR = ""; $filename = $this->file_name( $url ); - + if ( file_exists( $filename ) ) { // find how long ago the file was added to the cache // and whether that is longer then MAX_AGE @@ -142,42 +142,42 @@ class RSSCache { return $age; } else { - return -1; + return -1; } } - + /*=======================================================================*\ Function: serialize -\*=======================================================================*/ +\*=======================================================================*/ function serialize ( $rss ) { return serialize( $rss ); } /*=======================================================================*\ Function: unserialize -\*=======================================================================*/ +\*=======================================================================*/ function unserialize ( $data ) { return unserialize( $data ); } - + /*=======================================================================*\ Function: file_name Purpose: map url to location in cache Input: url from wich the rss file was fetched Output: a file name -\*=======================================================================*/ +\*=======================================================================*/ function file_name ($url) { $filename = md5( $url ); - return join( DIRECTORY_SEPARATOR, array( $this->BASE_CACHE, $filename ) ); + return implode( DIRECTORY_SEPARATOR, array( $this->BASE_CACHE, $filename ) ); } /*=======================================================================*\ Function: error Purpose: register error -\*=======================================================================*/ +\*=======================================================================*/ function error ($errormsg, $lvl=E_USER_WARNING) { // append PHP's error message if track_errors enabled - if ( isset($php_errormsg) ) { + if ( isset($php_errormsg) ) { $errormsg .= " ($php_errormsg)"; } $this->ERROR = $errormsg; @@ -188,7 +188,7 @@ class RSSCache { error_log( $errormsg, 0); } } - + function debug ($debugmsg, $lvl=E_USER_NOTICE) { if ( MAGPIE_DEBUG ) { $this->error("MagpieRSS [debug] $debugmsg", $lvl); @@ -196,4 +196,3 @@ class RSSCache { } } -?> \ No newline at end of file diff --git a/manager/media/rss/rss_fetch.inc b/manager/media/rss/rss_fetch.inc index ba73a72ca2..3ddba6733f 100644 --- a/manager/media/rss/rss_fetch.inc +++ b/manager/media/rss/rss_fetch.inc @@ -15,7 +15,7 @@ * magpierss-general@lists.sourceforge.net * */ - + // Setup MAGPIE_DIR for use on hosts that don't include // the current path in include_path. // with thanks to rajiv and smarty @@ -39,18 +39,18 @@ define('MAGPIE_EXTLIB', MAGPIE_DIR . 'extlib' . DIR_SEP); require_once( MAGPIE_EXTLIB . 'Snoopy.class.inc'); -/* +/* * CONSTANTS - redefine these in your script to change the * behaviour of fetch_rss() currently, most options effect the cache * - * MAGPIE_CACHE_ON - Should Magpie cache parsed RSS objects? - * For me a built in cache was essential to creating a "PHP-like" + * MAGPIE_CACHE_ON - Should Magpie cache parsed RSS objects? + * For me a built in cache was essential to creating a "PHP-like" * feel to Magpie, see rss_cache.inc for rationale * * * MAGPIE_CACHE_DIR - Where should Magpie cache parsed RSS objects? - * This should be a location that the webserver can write to. If this - * directory does not already exist Mapie will try to be smart and create + * This should be a location that the webserver can write to. If this + * directory does not already exist Mapie will try to be smart and create * it. This will often fail for permissions reasons. * * @@ -66,20 +66,20 @@ require_once( MAGPIE_EXTLIB . 'Snoopy.class.inc'); /*=======================================================================*\ - Function: fetch_rss: + Function: fetch_rss: Purpose: return RSS object for the give url maintain the cache Input: url of RSS file Output: parsed RSS object (see rss_parse.inc) - NOTES ON CACHEING: + NOTES ON CACHEING: If caching is on (MAGPIE_CACHE_ON) fetch_rss will first check the cache. - + NOTES ON RETRIEVING REMOTE FILES: If conditional gets are on (MAGPIE_CONDITIONAL_GET_ON) fetch_rss will return a cached object, and touch the cache object upon recieving a 304. - + NOTES ON FAILED REQUESTS: If there is an HTTP error while fetching an RSS object, the cached version will be return, if it exists (and if MAGPIE_CACHE_FRESH_ONLY is off) @@ -92,12 +92,12 @@ $MAGPIE_ERROR = ""; function fetch_rss ($url) { // initialize constants init(); - + if ( !isset($url) ) { error("fetch_rss called without a url"); return false; } - + // if cache is disabled if ( !MAGPIE_CACHE_ON ) { // fetch file, and parse it @@ -109,7 +109,7 @@ function fetch_rss ($url) { error("Failed to fetch $url and cache is off"); return false; } - } + } // else cache is ON else { // Flow @@ -117,28 +117,28 @@ function fetch_rss ($url) { // 2. if there is a hit, make sure its fresh // 3. if cached obj fails freshness check, fetch remote // 4. if remote fails, return stale object, or error - + $cache = new RSSCache( MAGPIE_CACHE_DIR, MAGPIE_CACHE_AGE ); - + if (MAGPIE_DEBUG and $cache->ERROR) { debug($cache->ERROR, E_USER_WARNING); } - - + + $cache_status = 0; // response of check_cache $request_headers = array(); // HTTP headers to send with fetch $rss = 0; // parsed RSS object $errormsg = 0; // errors, if any - + // store parsed XML by desired output encoding // as character munging happens at parse time $cache_key = $url . MAGPIE_OUTPUT_ENCODING; - + if (!$cache->ERROR) { // return cache HIT, MISS, or STALE $cache_status = $cache->check_cache( $cache_key); } - + // if object cached, and cache is fresh, return cached obj if ( $cache_status == 'HIT' ) { $rss = $cache->get( $cache_key ); @@ -151,9 +151,9 @@ function fetch_rss ($url) { return $rss; } } - + // else attempt a conditional get - + // setup headers if ( $cache_status == 'STALE' ) { $rss = $cache->get( $cache_key ); @@ -162,9 +162,9 @@ function fetch_rss ($url) { $request_headers['If-Last-Modified'] = $rss->last_modified; } } - + $resp = _fetch_remote_file( $url, $request_headers ); - + if (isset($resp) and $resp) { if ($resp->status == '304' ) { // we have the most current copy @@ -194,7 +194,7 @@ function fetch_rss ($url) { elseif ( $resp->error ) { # compensate for Snoopy's annoying habbit to tacking # on '\n' - $http_error = substr($resp->error, 0, -2); + $http_error = substr($resp->error, 0, -2); $errormsg .= "(HTTP Error: $http_error)"; } else { @@ -205,9 +205,9 @@ function fetch_rss ($url) { else { $errormsg = "Unable to retrieve RSS file for unknown reasons."; } - + // else fetch failed - + // attempt to return cached object if ($rss) { if ( MAGPIE_DEBUG ) { @@ -215,12 +215,12 @@ function fetch_rss ($url) { } return $rss; } - + // else we totally failed - error( $errormsg ); - + error( $errormsg ); + return false; - + } // end if ( !MAGPIE_CACHE_ON ) { } // end fetch_rss() @@ -231,34 +231,34 @@ function fetch_rss ($url) { function error ($errormsg, $lvl=E_USER_WARNING) { global $MAGPIE_ERROR; - + // append PHP's error message if track_errors enabled - if ( isset($php_errormsg) ) { + if ( isset($php_errormsg) ) { $errormsg .= " ($php_errormsg)"; } if ( $errormsg ) { $errormsg = "MagpieRSS: $errormsg"; $MAGPIE_ERROR = $errormsg; - trigger_error( $errormsg, $lvl); + trigger_error( $errormsg, $lvl); } } function debug ($debugmsg, $lvl=E_USER_NOTICE) { trigger_error("MagpieRSS [debug] $debugmsg", $lvl); } - + /*=======================================================================*\ Function: magpie_error Purpose: accessor for the magpie error variable \*=======================================================================*/ function magpie_error ($errormsg="") { global $MAGPIE_ERROR; - - if ( isset($errormsg) and $errormsg ) { + + if ( isset($errormsg) and $errormsg ) { $MAGPIE_ERROR = $errormsg; } - - return $MAGPIE_ERROR; + + return $MAGPIE_ERROR; } /*=======================================================================*\ @@ -266,7 +266,7 @@ function magpie_error ($errormsg="") { Purpose: retrieve an arbitrary remote file Input: url of the remote file headers to send along with the request (optional) - Output: an HTTP response object (see Snoopy.class.inc) + Output: an HTTP response object (see Snoopy.class.inc) \*=======================================================================*/ function _fetch_remote_file ($url, $headers = "" ) { // Snoopy is an HTTP client in PHP @@ -277,7 +277,7 @@ function _fetch_remote_file ($url, $headers = "" ) { if (is_array($headers) ) { $client->rawheaders = $headers; } - + @$client->fetch($url); return $client; @@ -291,10 +291,10 @@ function _fetch_remote_file ($url, $headers = "" ) { \*=======================================================================*/ function _response_to_rss ($resp) { $rss = new MagpieRSS( $resp->results, MAGPIE_OUTPUT_ENCODING, MAGPIE_INPUT_ENCODING, MAGPIE_DETECT_ENCODING ); - - // if RSS parsed successfully + + // if RSS parsed successfully if ( $rss and !$rss->ERROR) { - + // find Etag, and Last-Modified foreach($resp->headers as $h) { // 2003-03-02 - Nicola Asuni (www.tecnick.com) - fixed bug "Undefined offset: 1" @@ -305,26 +305,26 @@ function _response_to_rss ($resp) { $field = $h; $val = ""; } - + if ( $field == 'ETag' ) { $rss->etag = $val; } - + if ( $field == 'Last-Modified' ) { $rss->last_modified = $val; } } - - return $rss; + + return $rss; } // else construct error message else { $errormsg = "Failed to parse RSS file."; - + if ($rss) { $errormsg .= " (" . $rss->ERROR . ")"; } error($errormsg); - + return false; } // end if ($rss and !$rss->error) } @@ -341,7 +341,7 @@ function init () { else { define('MAGPIE_INITALIZED', true); } - + if ( !defined('MAGPIE_CACHE_ON') ) { define('MAGPIE_CACHE_ON', true); } @@ -363,39 +363,39 @@ function init () { if(empty($modx_manager_charset)) $modx_manager_charset = 'ISO-8859-1'; define('MAGPIE_OUTPUT_ENCODING', $modx_manager_charset); } - + if ( !defined('MAGPIE_INPUT_ENCODING') ) { define('MAGPIE_INPUT_ENCODING', null); } - + if ( !defined('MAGPIE_DETECT_ENCODING') ) { define('MAGPIE_DETECT_ENCODING', true); } - + if ( !defined('MAGPIE_DEBUG') ) { define('MAGPIE_DEBUG', 0); } - + if ( !defined('MAGPIE_USER_AGENT') ) { $ua = 'MagpieRSS/'. MAGPIE_VERSION . ' (+http://magpierss.sf.net'; - + if ( MAGPIE_CACHE_ON ) { $ua = $ua . ')'; } else { $ua = $ua . '; No cache)'; } - + define('MAGPIE_USER_AGENT', $ua); } - + if ( !defined('MAGPIE_FETCH_TIME_OUT') ) { define('MAGPIE_FETCH_TIME_OUT', 5); // 5 second timeout } - + // use gzip encoding to fetch rss files if supported? if ( !defined('MAGPIE_USE_GZIP') ) { - define('MAGPIE_USE_GZIP', true); + define('MAGPIE_USE_GZIP', true); } } @@ -406,7 +406,7 @@ function init () { HTTP STATUS CODE PREDICATES These functions attempt to classify an HTTP status code based on RFC 2616 and RFC 2518. - + All of them take an HTTP status code as input, and return true or false All this code is adapted from LWP's HTTP::Status. @@ -417,47 +417,46 @@ function init () { Function: is_info Purpose: return true if Informational status code \*=======================================================================*/ -function is_info ($sc) { - return $sc >= 100 && $sc < 200; +function is_info ($sc) { + return $sc >= 100 && $sc < 200; } /*=======================================================================*\ Function: is_success Purpose: return true if Successful status code \*=======================================================================*/ -function is_success ($sc) { - return $sc >= 200 && $sc < 300; +function is_success ($sc) { + return $sc >= 200 && $sc < 300; } /*=======================================================================*\ Function: is_redirect Purpose: return true if Redirection status code \*=======================================================================*/ -function is_redirect ($sc) { - return $sc >= 300 && $sc < 400; +function is_redirect ($sc) { + return $sc >= 300 && $sc < 400; } /*=======================================================================*\ Function: is_error Purpose: return true if Error status code \*=======================================================================*/ -function is_error ($sc) { - return $sc >= 400 && $sc < 600; +function is_error ($sc) { + return $sc >= 400 && $sc < 600; } /*=======================================================================*\ Function: is_client_error Purpose: return true if Error status code, and its a client error \*=======================================================================*/ -function is_client_error ($sc) { - return $sc >= 400 && $sc < 500; +function is_client_error ($sc) { + return $sc >= 400 && $sc < 500; } /*=======================================================================*\ Function: is_client_error Purpose: return true if Error status code, and its a server error \*=======================================================================*/ -function is_server_error ($sc) { - return $sc >= 500 && $sc < 600; +function is_server_error ($sc) { + return $sc >= 500 && $sc < 600; } -?> diff --git a/manager/media/rss/rss_parse.inc b/manager/media/rss/rss_parse.inc index 3d8feeb17a..ebf24fc944 100644 --- a/manager/media/rss/rss_parse.inc +++ b/manager/media/rss/rss_parse.inc @@ -33,7 +33,7 @@ require_once (MAGPIE_DIR . 'rss_utils.inc'); */ class MagpieRSS { var $parser; - + var $current_item = array(); // item currently being parsed var $items = array(); // collection of parsed items var $channel = array(); // hash of channel fields @@ -42,14 +42,14 @@ class MagpieRSS { var $feed_type; var $feed_version; var $encoding = ''; // output encoding of parsed rss - + var $_source_encoding = ''; // only set if we have to parse xml prolog - + var $ERROR = ""; var $WARNING = ""; - + // define some constants - + var $_CONTENT_CONSTRUCTS = array('content', 'summary', 'info', 'title', 'tagline', 'copyright'); var $_KNOWN_ENCODINGS = array('UTF-8', 'US-ASCII', 'ISO-8859-1'); @@ -57,75 +57,75 @@ class MagpieRSS { var $stack = array(); // parser stack var $inchannel = false; var $initem = false; - var $incontent = false; // if in Atom field + var $incontent = false; // if in Atom field var $intextinput = false; var $inimage = false; var $current_namespace = false; - + /** * Set up XML parser, parse source, and return populated RSS object.. - * + * * @param string $source string containing the RSS to be parsed * * NOTE: Probably a good idea to leave the encoding options alone unless * you know what you're doing as PHP's character set support is * a little weird. * - * NOTE: A lot of this is unnecessary but harmless with PHP5 + * NOTE: A lot of this is unnecessary but harmless with PHP5 * * - * @param string $output_encoding output the parsed RSS in this character + * @param string $output_encoding output the parsed RSS in this character * set defaults to ISO-8859-1 as this is PHP's * default. * * NOTE: might be changed to UTF-8 in future * versions. - * - * @param string $input_encoding the character set of the incoming RSS source. + * + * @param string $input_encoding the character set of the incoming RSS source. * Leave blank and Magpie will try to figure it * out. - * - * + * + * * @param bool $detect_encoding if false Magpie won't attempt to detect * source encoding. (caveat emptor) * */ function __construct($source, $output_encoding='ISO-8859-1', - $input_encoding=null, $detect_encoding=true) - { + $input_encoding=null, $detect_encoding=true) + { # if PHP xml isn't compiled in, die # if (!function_exists('xml_parser_create')) { - $this->error( "Failed to load PHP's XML Extension. " . + $this->error( "Failed to load PHP's XML Extension. " . "http://www.php.net/manual/en/ref.xml.php", E_USER_ERROR ); } - - list($parser, $source) = $this->create_parser($source, + + list($parser, $source) = $this->create_parser($source, $output_encoding, $input_encoding, $detect_encoding); - - + + if (!is_resource($parser)) { $this->error( "Failed to create an instance of PHP's XML parser. " . "http://www.php.net/manual/en/ref.xml.php", E_USER_ERROR ); } - + $this->parser = $parser; - + # pass in parser, and a reference to this object # setup handlers # xml_set_object( $this->parser, $this ); - xml_set_element_handler($this->parser, + xml_set_element_handler($this->parser, 'feed_start_element', 'feed_end_element' ); - - xml_set_character_data_handler( $this->parser, 'feed_cdata' ); - + + xml_set_character_data_handler( $this->parser, 'feed_cdata' ); + $status = xml_parse( $this->parser, $source ); - + if (! $status ) { $errorcode = xml_get_error_code( $this->parser ); if ( $errorcode != XML_ERROR_NONE ) { @@ -137,25 +137,25 @@ class MagpieRSS { $this->error( $errormsg ); } } - + xml_parser_free( $this->parser ); $this->normalize(); } - + function feed_start_element($p, $element, &$attrs) { $el = $element = strtolower($element); $attrs = array_change_key_case($attrs, CASE_LOWER); - + // check for a namespace, and split if found $ns = false; if ( strpos( $element, ':' ) ) { - list($ns, $el) = explode( ':', $element, 2); + list($ns, $el) = explode( ':', $element, 2); } if ( $ns and $ns != 'rdf' ) { $this->current_namespace = $ns; } - + # if feed type isn't set, then this is first element of feed # identify feed from root element # @@ -175,37 +175,37 @@ class MagpieRSS { } return; } - - if ( $el == 'channel' ) + + if ( $el == 'channel' ) { $this->inchannel = true; } - elseif ($el == 'item' or $el == 'entry' ) + elseif ($el == 'item' or $el == 'entry' ) { $this->initem = true; if ( isset($attrs['rdf:about']) ) { - $this->current_item['about'] = $attrs['rdf:about']; + $this->current_item['about'] = $attrs['rdf:about']; } } - + // if we're in the default namespace of an RSS feed, // record textinput or image fields - elseif ( - $this->feed_type == RSS and - $this->current_namespace == '' and - $el == 'textinput' ) + elseif ( + $this->feed_type == RSS and + $this->current_namespace == '' and + $el == 'textinput' ) { $this->intextinput = true; } - + elseif ( - $this->feed_type == RSS and - $this->current_namespace == '' and - $el == 'image' ) + $this->feed_type == RSS and + $this->current_namespace == '' and + $el == 'image' ) { $this->inimage = true; } - + # handle atom content constructs elseif ( $this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS) ) { @@ -213,40 +213,40 @@ class MagpieRSS { if ($el == 'content' ) { $el = 'atom_content'; } - + $this->incontent = $el; - - + + } - + // if inside an Atom content construct (e.g. content or summary) field treat tags as text - elseif ($this->feed_type == ATOM and $this->incontent ) + elseif ($this->feed_type == ATOM and $this->incontent ) { // if tags are inlined, then flatten - $attrs_str = join(' ', - array_map('map_attrs', - array_keys($attrs), + $attrs_str = implode(' ', + array_map('map_attrs', + array_keys($attrs), array_values($attrs) ) ); - + $this->append_content( "<$element $attrs_str>" ); - + array_unshift( $this->stack, $el ); } - + // Atom support many links per containging element. // Magpie treats link elements of type rel='alternate' // as being equivalent to RSS's simple link element. // - elseif ($this->feed_type == ATOM and $el == 'link' ) + elseif ($this->feed_type == ATOM and $el == 'link' ) { - if ( isset($attrs['rel']) and $attrs['rel'] == 'alternate' ) + if ( isset($attrs['rel']) and $attrs['rel'] == 'alternate' ) { $link_el = 'link'; } else { $link_el = 'link_' . $attrs['rel']; } - + $this->append($link_el, $attrs['href']); } // set stack[0] to current element @@ -254,49 +254,49 @@ class MagpieRSS { array_unshift($this->stack, $el); } } - - + + function feed_cdata ($p, $text) { - if ($this->feed_type == ATOM and $this->incontent) + if ($this->feed_type == ATOM and $this->incontent) { $this->append_content( $text ); } else { - $current_el = join('_', array_reverse($this->stack)); + $current_el = implode('_', array_reverse($this->stack)); $this->append($current_el, $text); } } - + function feed_end_element ($p, $el) { $el = strtolower($el); - - if ( $el == 'item' or $el == 'entry' ) + + if ( $el == 'item' or $el == 'entry' ) { $this->items[] = $this->current_item; $this->current_item = array(); $this->initem = false; } - elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'textinput' ) + elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'textinput' ) { $this->intextinput = false; } - elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'image' ) + elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'image' ) { $this->inimage = false; } elseif ($this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS) ) - { + { $this->incontent = false; } - elseif ($el == 'channel' or $el == 'feed' ) + elseif ($el == 'channel' or $el == 'feed' ) { $this->inchannel = false; } elseif ($this->feed_type == ATOM and $this->incontent ) { // balance tags properly // note: i don't think this is actually neccessary - if ( $this->stack[0] == $el ) + if ( $this->stack[0] == $el ) { $this->append_content(""); } @@ -309,19 +309,19 @@ class MagpieRSS { else { array_shift( $this->stack ); } - + $this->current_namespace = false; } - + function concat (&$str1, $str2="") { if (!isset($str1) ) { $str1=""; } $str1 .= $str2; } - - - + + + function append_content($text) { if ( $this->initem ) { $this->concat( $this->current_item[ $this->incontent ], $text ); @@ -330,13 +330,13 @@ class MagpieRSS { $this->concat( $this->channel[ $this->incontent ], $text ); } } - + // smart append - field and namespace aware function append($el, $text) { if (!$el) { return; } - if ( $this->current_namespace ) + if ( $this->current_namespace ) { if ( $this->initem ) { $this->concat( @@ -372,10 +372,10 @@ class MagpieRSS { $this->concat( $this->channel[ $el ], $text ); } - + } } - + function normalize () { // if atom populate rss fields if ( $this->is_atom() ) { @@ -386,7 +386,7 @@ class MagpieRSS { $item['description'] = $item['summary']; if ( isset($item['atom_content'])) $item['content']['encoded'] = $item['atom_content']; - + $atom_date = (isset($item['issued']) ) ? $item['issued'] : $item['modified']; if ( $atom_date ) { $epoch = @parse_w3cdtf($atom_date); @@ -394,9 +394,9 @@ class MagpieRSS { $item['date_timestamp'] = $epoch; } } - + $this->items[$i] = $item; - } + } } elseif ( $this->is_rss() ) { $this->channel['tagline'] = $this->channel['description']; @@ -406,7 +406,7 @@ class MagpieRSS { $item['summary'] = $item['description']; if ( isset($item['content']['encoded'] ) ) $item['atom_content'] = $item['content']['encoded']; - + if ( $this->is_rss() == '1.0' and isset($item['dc']['date']) ) { $epoch = @parse_w3cdtf($item['dc']['date']); if ($epoch and $epoch > 0) { @@ -419,22 +419,22 @@ class MagpieRSS { $item['date_timestamp'] = $epoch; } } - + $this->items[$i] = $item; } } } - - + + function is_rss () { if ( $this->feed_type == RSS ) { - return $this->feed_version; + return $this->feed_version; } else { return false; } } - + function is_atom() { if ( $this->feed_type == ATOM ) { return $this->feed_version; @@ -459,15 +459,15 @@ class MagpieRSS { $this->encoding = $out_enc; xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, $out_enc); } - + return array($parser, $source); } - + /** * Instantiate an XML parser under PHP5 * * PHP5 will do a fine job of detecting input encoding - * if passed an empty string as the encoding. + * if passed an empty string as the encoding. * * All hail libxml2! * @@ -481,7 +481,7 @@ class MagpieRSS { return xml_parser_create(''); } } - + /** * Instaniate an XML parser under PHP4 * @@ -501,7 +501,7 @@ class MagpieRSS { if ( !$detect ) { return array(xml_parser_create($in_enc), $source); } - + if (!$in_enc) { if (preg_match('//m', $source, $m)) { $in_enc = strtoupper($m[1]); @@ -511,24 +511,24 @@ class MagpieRSS { $in_enc = 'UTF-8'; } } - + if ($this->known_encoding($in_enc)) { return array(xml_parser_create($in_enc), $source); } - + // the dectected encoding is not one of the simple encodings PHP knows - + // attempt to use the iconv extension to // cast the XML to a known encoding // @see http://php.net/iconv - + if (function_exists('iconv')) { $encoded_source = iconv($in_enc,'UTF-8', $source); if ($encoded_source) { return array(xml_parser_create('UTF-8'), $encoded_source); } } - + // iconv didn't work, try mb_convert_encoding // @see http://php.net/mbstring if(function_exists('mb_convert_encoding')) { @@ -537,15 +537,15 @@ class MagpieRSS { return array(xml_parser_create('UTF-8'), $encoded_source); } } - - // else + + // else $this->error("Feed is in an unsupported character encoding. ($in_enc) " . "You may see strange artifacts, and mangled characters.", E_USER_NOTICE); - + return array(xml_parser_create(), $source); } - + function known_encoding($enc) { $enc = strtoupper($enc); if ( in_array($enc, $this->_KNOWN_ENCODINGS) ) { @@ -558,16 +558,16 @@ class MagpieRSS { function error ($errormsg, $lvl=E_USER_WARNING) { // append PHP's error message if track_errors enabled - if ( isset($php_errormsg) ) { + if ( isset($php_errormsg) ) { $errormsg .= " ($php_errormsg)"; } if ( MAGPIE_DEBUG ) { - trigger_error( $errormsg, $lvl); + trigger_error( $errormsg, $lvl); } else { error_log( $errormsg, 0); } - + $notices = E_USER_NOTICE|E_NOTICE; if ( $lvl&$notices ) { $this->WARNING = $errormsg; @@ -575,30 +575,38 @@ class MagpieRSS { $this->ERROR = $errormsg; } } - - + + } // end class RSS function map_attrs($k, $v) { return "$k=\"$v\""; } -// patch to support medieval versions of PHP4.1.x, +// patch to support medieval versions of PHP4.1.x, // courtesy, Ryan Currie, ryan@digibliss.com if (!function_exists('array_change_key_case')) { - define("CASE_UPPER",1); - define("CASE_LOWER",0); + define('CASE_UPPER', 1); + define('CASE_LOWER', 0); - function array_change_key_case($array,$case=CASE_LOWER) { - if ($case=CASE_LOWER) $cmd=strtolower; - elseif ($case=CASE_UPPER) $cmd=strtoupper; - foreach($array as $key=>$value) { - $output[$cmd($key)]=$value; - } - return $output; + function array_change_key_case($array, $case=CASE_LOWER) { + $output = array(); + switch($case){ + case CASE_LOWER: + $cmd='strtolower'; + break; + case CASE_UPPER: + $cmd='strtoupper'; + break; + default: + $cmd = ''; + } + foreach($array as $key=>$value) { + $output[empty($cmd) ? $key : $cmd($key)] = $value; + } + return $output; } } -?> \ No newline at end of file diff --git a/manager/media/rss/rss_utils.inc b/manager/media/rss/rss_utils.inc index 002cc82709..9dc9702cb5 100644 --- a/manager/media/rss/rss_utils.inc +++ b/manager/media/rss/rss_utils.inc @@ -23,17 +23,17 @@ \*======================================================================*/ function parse_w3cdtf ( $date_str ) { - + # regex to match wc3dtf $pat = "/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(:(\d{2}))?(?:([-+])(\d{2}):?(\d{2})|(Z))?/"; - + if ( preg_match( $pat, $date_str, $match ) ) { - list( $year, $month, $day, $hours, $minutes, $seconds) = + list( $year, $month, $day, $hours, $minutes, $seconds) = array( $match[1], $match[2], $match[3], $match[4], $match[5], $match[6]); - + # calc epoch for current date assuming GMT $epoch = gmmktime( $hours, $minutes, $seconds, $month, $day, $year); - + $offset = 0; if ( $match[10] == 'Z' ) { # zulu time, aka GMT @@ -41,20 +41,20 @@ function parse_w3cdtf ( $date_str ) { else { list( $tz_mod, $tz_hour, $tz_min ) = array( $match[8], $match[9], $match[10]); - + # zero out the variables if ( ! $tz_hour ) { $tz_hour = 0; } if ( ! $tz_min ) { $tz_min = 0; } - + $offset_secs = (($tz_hour*60)+$tz_min)*60; - + # is timezone ahead of GMT? then subtract offset # if ( $tz_mod == '+' ) { $offset_secs = $offset_secs * -1; } - - $offset = $offset_secs; + + $offset = $offset_secs; } $epoch = $epoch + $offset; return $epoch; @@ -63,4 +63,3 @@ function parse_w3cdtf ( $date_str ) { return -1; } } -?> \ No newline at end of file diff --git a/manager/media/script/air-datepicker/datepicker.inc.php b/manager/media/script/air-datepicker/datepicker.inc.php index 7b26850998..a3c5e39f62 100644 --- a/manager/media/script/air-datepicker/datepicker.inc.php +++ b/manager/media/script/air-datepicker/datepicker.inc.php @@ -1,24 +1,29 @@ config['lang_code'])) $modx->config['lang_code'] = $this->getLangCode(); $modx->config['datetime_format_lc'] = isset($modx->config['datetime_format']) ? strtolower($modx->config['datetime_format']) : 'dd-mm-yyyy'; return $modx->mergeSettingsContent($load_script); } - function getLangCode() { + + /** + * @return string + */ + public function getLangCode() { global $modx, $modx_lang_attribute; - + if(!$modx_lang_attribute) return 'en'; - + $lc = $modx_lang_attribute; - if($lc=='uk') return 'ru'; + if($lc === 'uk') return 'ru'; $dp_path = str_replace('\\','/',dirname(__FILE__)); - if(is_file("{$dp_path}/i18n/datepicker.{$lc}.js")) return $modx_lang_attribute; - else return 'en'; + + return (is_file("{$dp_path}/i18n/datepicker.{$lc}.js")) ? $modx_lang_attribute : 'en'; } } diff --git a/manager/processors/cache_sync.class.processor.php b/manager/processors/cache_sync.class.processor.php index 60875362fd..878445eeaa 100644 --- a/manager/processors/cache_sync.class.processor.php +++ b/manager/processors/cache_sync.class.processor.php @@ -2,50 +2,83 @@ class synccache { - var $cachePath; - var $showReport; - var $deletedfiles = array(); - var $aliases = array(); - var $parents = array(); - var $aliasVisible = array(); - var $request_time; - + public $cachePath; + public $showReport; + public $deletedfiles = array(); + /** + * @var array + */ + public $aliases = array(); + /** + * @var array + */ + public $parents = array(); + /** + * @var array + */ + public $aliasVisible = array(); + public $request_time; + public $cacheRefreshTime; - function __construct() + /** + * synccache constructor. + */ + public function __construct() { global $modx; $this->request_time = $_SERVER['REQUEST_TIME'] + $modx->config['server_offset_time']; } - function setCachepath($path) + /** + * @param string $path + */ + public function setCachepath($path) { $this->cachePath = $path; } - function setReport($bool) + /** + * @param bool $bool + */ + public function setReport($bool) { $this->showReport = $bool; } - function escapeSingleQuotes($s) + /** + * @param string $s + * @return string + */ + public function escapeSingleQuotes($s) { - if ($s == '') { + if ($s === '') { return $s; } $q1 = array("\\", "'"); $q2 = array("\\\\", "\\'"); + return str_replace($q1, $q2, $s); } - function escapeDoubleQuotes($s) + /** + * @param string $s + * @return string + */ + public function escapeDoubleQuotes($s) { $q1 = array("\\", "\"", "\r", "\n", "\$"); $q2 = array("\\\\", "\\\"", "\\r", "\\n", "\\$"); + return str_replace($q1, $q2, $s); } - function getParents($id, $path = '') + /** + * @param int|string $id + * @param string $path + * @return string + */ + public function getParents($id, $path = '') { // modx:returns child's parent global $modx; if (empty($this->aliases)) { @@ -66,14 +99,19 @@ function getParents($id, $path = '') $path = $this->aliases[$id]; } } + return $this->getParents($this->parents[$id], $path); } + return $path; } - function emptyCache($modx = null) + /** + * @param null|DocumentParser $modx + */ + public function emptyCache($modx = null) { - if (is_a($modx, 'DocumentParser') === false || get_class($modx) !== 'DocumentParser') { + if (!($modx instanceof DocumentParser)) { $modx = $GLOBALS['modx']; } if (!isset($this->cachePath)) { @@ -93,7 +131,7 @@ function emptyCache($modx = null) } } - if(function_exists('opcache_get_status')) { + if (function_exists('opcache_get_status')) { $opcache = opcache_get_status(); if (!empty($opcache['opcache_enabled'])) { opcache_reset(); @@ -122,6 +160,9 @@ function emptyCache($modx = null) } } + /** + * @param string|int $cacheRefreshTime + */ public function publishTimeConfig($cacheRefreshTime = '') { $cacheRefreshTimeFromDB = $this->getCacheRefreshTime(); @@ -148,6 +189,9 @@ public function publishTimeConfig($cacheRefreshTime = '') } } + /** + * @return int + */ public function getCacheRefreshTime() { global $modx; @@ -155,7 +199,8 @@ public function getCacheRefreshTime() // update publish time file $timesArr = array(); - $result = $modx->db->select('MIN(pub_date) AS minpub', '[+prefix+]site_content', 'pub_date>' . $this->request_time); + $result = $modx->db->select('MIN(pub_date) AS minpub', '[+prefix+]site_content', + 'pub_date>' . $this->request_time); if (!$result) { echo "Couldn't determine next publish event!"; } @@ -165,7 +210,8 @@ public function getCacheRefreshTime() $timesArr[] = $minpub; } - $result = $modx->db->select('MIN(unpub_date) AS minunpub', '[+prefix+]site_content', 'unpub_date>' . $this->request_time); + $result = $modx->db->select('MIN(unpub_date) AS minunpub', '[+prefix+]site_content', + 'unpub_date>' . $this->request_time); if (!$result) { echo "Couldn't determine next unpublish event!"; } @@ -184,12 +230,13 @@ public function getCacheRefreshTime() } else { $cacheRefreshTime = 0; } + return $cacheRefreshTime; } /** * build siteCache file - * @param DocumentParser $modx + * @param DocumentParser $modx * @return boolean success */ public function buildCache($modx) @@ -336,7 +383,8 @@ public function buildCache($modx) } foreach ($events as $evtname => $pluginnames) { $events[$evtname] = $pluginnames; - $content .= '$e[\'' . $evtname . '\']=array(\'' . implode('\',\'', $this->escapeSingleQuotes($pluginnames)) . '\');'; + $content .= '$e[\'' . $evtname . '\']=array(\'' . implode('\',\'', + $this->escapeSingleQuotes($pluginnames)) . '\');'; } $content .= "\n"; @@ -365,8 +413,13 @@ public function buildCache($modx) return true; } - // ref : http://php.net/manual/en/tokenizer.examples.php - function php_strip_whitespace($source) + /** + * @param string $source + * @return string + * + * @see http://php.net/manual/en/tokenizer.examples.php + */ + public function php_strip_whitespace($source) { $source = trim($source); @@ -404,7 +457,8 @@ function php_strip_whitespace($source) } $lastChar = substr($_, -1); if (!in_array($lastChar, $chars)) {// ,320,327,288,284,289 - if (!in_array($prev_token, array(T_FOREACH, T_WHILE, T_FOR, T_BOOLEAN_AND, T_BOOLEAN_OR, T_DOUBLE_ARROW))) { + if (!in_array($prev_token, + array(T_FOREACH, T_WHILE, T_FOR, T_BOOLEAN_AND, T_BOOLEAN_OR, T_DOUBLE_ARROW))) { $_ .= ' '; } } @@ -427,8 +481,10 @@ function php_strip_whitespace($source) $_ .= $text; } } - $source = preg_replace(array('@^<\?php@i', '|\s+|', '||', '|-->\s+' . "\n", '-->' . "\n" . '|', '|-->\s+' . "\n", '-->' . "\n" . '
    diff --git a/manager/includes/accesscontrol.inc.php b/manager/includes/accesscontrol.inc.php index 4cc3d27b17..25191e4268 100755 --- a/manager/includes/accesscontrol.inc.php +++ b/manager/includes/accesscontrol.inc.php @@ -84,8 +84,21 @@ $modx->setPlaceholder('manager_theme_url', MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/'); $modx->setPlaceholder('year', date('Y')); - $modx->setPlaceholder('manager_theme_style', - (isset($_COOKIE['MODX_themeColor']) ? $_COOKIE['MODX_themeColor'] : 'dark')); + + switch ($modx->config['manager_theme_mode']) { + case '1': + $modx->setPlaceholder('manager_theme_style', 'lightness'); + break; + case '2': + $modx->setPlaceholder('manager_theme_style', 'light'); + break; + case '3': + $modx->setPlaceholder('manager_theme_style', 'dark'); + break; + case '4': + $modx->setPlaceholder('manager_theme_style', 'darkness'); + break; } + // andrazk 20070416 - notify user of install/update if (isset($_GET['installGoingOn'])) { diff --git a/manager/includes/header.inc.php b/manager/includes/header.inc.php index 91ea271f70..dc0008c1f8 100755 --- a/manager/includes/header.inc.php +++ b/manager/includes/header.inc.php @@ -16,10 +16,19 @@ $modx->config['mgr_date_picker_path'] = 'media/script/air-datepicker/datepicker.inc.php'; } -if (isset($_COOKIE['MODX_themeColor'])) { - $body_class .= ' ' . $_COOKIE['MODX_themeColor']; -} else { +switch ($modx->config['manager_theme_mode']) { + case '1': + $body_class .= ' lightness'; + break; + case '2': + $body_class .= ' light'; + break; + case '3': $body_class .= ' dark'; + break; + case '4': + $body_class .= ' darkness'; + break; } $css = 'media/style/' . $modx->config['manager_theme'] . '/style.css?v=' . $lastInstallTime; From 85bfee4d10cdcc06085c4f196ee3ed6e2120dd5d Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Mon, 26 Mar 2018 00:32:24 +0300 Subject: [PATCH 074/274] fix manager_theme_mode for CodeMirror --- assets/plugins/codemirror/codemirror.plugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/plugins/codemirror/codemirror.plugin.php b/assets/plugins/codemirror/codemirror.plugin.php index 86e3305da0..363325a043 100755 --- a/assets/plugins/codemirror/codemirror.plugin.php +++ b/assets/plugins/codemirror/codemirror.plugin.php @@ -38,7 +38,7 @@ $fontSize = (isset($fontSize) ? 'font-size:' . $fontSize . 'px !important;' : ''); $lineHeight = (isset($lineHeight) ? 'line-height:' . $lineHeight . ' !important;' : ''); -if ($modx->config['which_editor'] == 3 || $modx->config['which_editor'] == 4) { +if ($modx->config['manager_theme_mode'] == 3 || $modx->config['manager_theme_mode'] == 4) { $theme = $darktheme; } /* From 36dfe9c6d54be88728088be3d4d8c9cac198a931 Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Mon, 26 Mar 2018 00:39:41 +0300 Subject: [PATCH 075/274] write manager IP address to manager_log --- install/setup.sql | 4 ++++ manager/actions/logging.static.php | 2 ++ manager/includes/log.class.inc.php | 16 ++++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/install/setup.sql b/install/setup.sql index b685fc382b..61a2fd3f82 100755 --- a/install/setup.sql +++ b/install/setup.sql @@ -87,6 +87,7 @@ CREATE TABLE IF NOT EXISTS `{PREFIX}manager_log` ( `itemid` varchar(10) default '0', `itemname` varchar(255) default NULL, `message` varchar(255) NOT NULL default '', + `ip` varchar(15), PRIMARY KEY (`id`) ) ENGINE=MyISAM COMMENT='Contains a record of user interaction.'; @@ -860,6 +861,9 @@ ALTER TABLE `{PREFIX}web_groups` ADD UNIQUE INDEX `ix_group_user` (`webgroup`,`w ALTER TABLE `{PREFIX}document_groups` ADD UNIQUE INDEX `ix_dg_id` (`document_group`,`document`); +ALTER TABLE `{PREFIX}manager_log` + ADD COLUMN `ip` varchar(15); + # ]]upgrade-able diff --git a/manager/actions/logging.static.php b/manager/actions/logging.static.php index 0ce5a82f39..293a82af66 100755 --- a/manager/actions/logging.static.php +++ b/manager/actions/logging.static.php @@ -281,6 +281,7 @@ function record_sort($array, $key) + IP @@ -305,6 +306,7 @@ function record_sort($array, $key) toDateFormat($logentry['timestamp'] + $server_offset_time) ?> + entry['itemId']; $fields['itemname'] = $modx->db->escape($this->entry['itemName']); $fields['message'] = $modx->db->escape($this->entry['msg']); + $fields['ip'] = $this->getUserIP(); + $insert_id = $modx->db->insert($fields, $tbl_manager_log); if (!$insert_id) { $modx->messageQuit("Logging error: couldn't save log to table! Error code: " . $modx->db->getLastError()); @@ -102,4 +104,18 @@ public function writeToLog() } } } + + private function getUserIP() { + if( array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER) && !empty($_SERVER['HTTP_X_FORWARDED_FOR']) ) { + if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',')>0) { + $addr = explode(",",$_SERVER['HTTP_X_FORWARDED_FOR']); + return trim($addr[0]); + } else { + return $_SERVER['HTTP_X_FORWARDED_FOR']; + } + } + else { + return $_SERVER['REMOTE_ADDR']; + } + } } From 263737fbe6518b8d4d61777b71ff251794affddc Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Mon, 26 Mar 2018 00:51:23 +0300 Subject: [PATCH 076/274] add user_agent info to manager_log --- install/setup.sql | 4 ++++ manager/actions/logging.static.php | 2 ++ manager/includes/log.class.inc.php | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/install/setup.sql b/install/setup.sql index 61a2fd3f82..0a390d36ac 100755 --- a/install/setup.sql +++ b/install/setup.sql @@ -88,6 +88,7 @@ CREATE TABLE IF NOT EXISTS `{PREFIX}manager_log` ( `itemname` varchar(255) default NULL, `message` varchar(255) NOT NULL default '', `ip` varchar(15), + `useragent` varchar(255), PRIMARY KEY (`id`) ) ENGINE=MyISAM COMMENT='Contains a record of user interaction.'; @@ -864,6 +865,9 @@ ALTER TABLE `{PREFIX}document_groups` ADD UNIQUE INDEX `ix_dg_id` (`document_gro ALTER TABLE `{PREFIX}manager_log` ADD COLUMN `ip` varchar(15); +ALTER TABLE `{PREFIX}manager_log` + ADD COLUMN `useragent` varchar(255); + # ]]upgrade-able diff --git a/manager/actions/logging.static.php b/manager/actions/logging.static.php index 293a82af66..26f678b7ad 100755 --- a/manager/actions/logging.static.php +++ b/manager/actions/logging.static.php @@ -282,6 +282,7 @@ function record_sort($array, $key) IP + USER_AGENT @@ -307,6 +308,7 @@ function record_sort($array, $key) toDateFormat($logentry['timestamp'] + $server_offset_time) ?> + db->escape($this->entry['itemName']); $fields['message'] = $modx->db->escape($this->entry['msg']); $fields['ip'] = $this->getUserIP(); - + $fields['useragent'] = $_SERVER['HTTP_USER_AGENT']; + $insert_id = $modx->db->insert($fields, $tbl_manager_log); if (!$insert_id) { $modx->messageQuit("Logging error: couldn't save log to table! Error code: " . $modx->db->getLastError()); From 1a5a68027f7b12f06d99d49562928ba84d2cb614 Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Mon, 26 Mar 2018 01:08:23 +0300 Subject: [PATCH 077/274] Fix Extras buttons on 1.4.1 #571 --- assets/modules/store/lang/italian.php | 6 ++++++ assets/modules/store/lang/nederlands-utf8.php | 6 ++++++ assets/modules/store/lang/nederlands.php | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/assets/modules/store/lang/italian.php b/assets/modules/store/lang/italian.php index 8dbffdb1e7..ea20d98c54 100755 --- a/assets/modules/store/lang/italian.php +++ b/assets/modules/store/lang/italian.php @@ -35,6 +35,12 @@ $_Lang['s2_2_down'] = "Ascendente"; $_Lang['search'] = "Cerca nella Categoria: "; +/* Installazione tramite caricamento file */ +$_Lang ['install_file'] = "Installa per file"; +$_Lang ['choose_file_msg'] = "Scegli un file da caricare e installare"; +$_Lang ['install_file_btn'] = "Installa"; +$_Lang ['install_file_success'] = "Installazione riuscita"; + /* faq */ $_Lang['faq'] = '
  • A cosa serve la repository
  • ⏎ diff --git a/assets/modules/store/lang/nederlands-utf8.php b/assets/modules/store/lang/nederlands-utf8.php index 4536c50213..4cb80f41b4 100755 --- a/assets/modules/store/lang/nederlands-utf8.php +++ b/assets/modules/store/lang/nederlands-utf8.php @@ -35,6 +35,12 @@ $_Lang['s2_2_down'] = "Oplopend"; $_Lang['search'] = "Zoeken binnen categorie:"; +/* Installation by file-upload */ +$_Lang['install_file'] = "Installeren op bestand"; +$_Lang['choose_file_msg'] = "Kies een bestand om te uploaden en te installeren"; +$_Lang['install_file_btn'] = "Installeren"; +$_Lang['install_file_success'] = "Installatie succesvol"; + /* faq */ $_Lang['faq'] = '
  • Waarom heb je een opslagplaats nodig?
  • diff --git a/assets/modules/store/lang/nederlands.php b/assets/modules/store/lang/nederlands.php index 4536c50213..4cb80f41b4 100755 --- a/assets/modules/store/lang/nederlands.php +++ b/assets/modules/store/lang/nederlands.php @@ -35,6 +35,12 @@ $_Lang['s2_2_down'] = "Oplopend"; $_Lang['search'] = "Zoeken binnen categorie:"; +/* Installation by file-upload */ +$_Lang['install_file'] = "Installeren op bestand"; +$_Lang['choose_file_msg'] = "Kies een bestand om te uploaden en te installeren"; +$_Lang['install_file_btn'] = "Installeren"; +$_Lang['install_file_success'] = "Installatie succesvol"; + /* faq */ $_Lang['faq'] = '
  • Waarom heb je een opslagplaats nodig?
  • From e804059d5e21e615ba49d5a76f44a03dbbff7c3d Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Mon, 26 Mar 2018 01:09:19 +0300 Subject: [PATCH 078/274] fix #571 --- assets/modules/store/lang/nederlands-utf8.php | 8 ++++---- assets/modules/store/lang/nederlands.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/assets/modules/store/lang/nederlands-utf8.php b/assets/modules/store/lang/nederlands-utf8.php index 4cb80f41b4..c019c1c6ce 100755 --- a/assets/modules/store/lang/nederlands-utf8.php +++ b/assets/modules/store/lang/nederlands-utf8.php @@ -36,10 +36,10 @@ $_Lang['search'] = "Zoeken binnen categorie:"; /* Installation by file-upload */ -$_Lang['install_file'] = "Installeren op bestand"; -$_Lang['choose_file_msg'] = "Kies een bestand om te uploaden en te installeren"; -$_Lang['install_file_btn'] = "Installeren"; -$_Lang['install_file_success'] = "Installatie succesvol"; ++$_Lang['install_file'] = "Installatie vanuit archief"; ++$_Lang['choose_file_msg'] = "Selecteer bestand"; ++$_Lang['install_file_btn'] = "Installeer"; ++$_Lang['install_file_success'] = "Installatie voltooid"; /* faq */ $_Lang['faq'] = ' diff --git a/assets/modules/store/lang/nederlands.php b/assets/modules/store/lang/nederlands.php index 4cb80f41b4..1f859d2d6e 100755 --- a/assets/modules/store/lang/nederlands.php +++ b/assets/modules/store/lang/nederlands.php @@ -36,10 +36,10 @@ $_Lang['search'] = "Zoeken binnen categorie:"; /* Installation by file-upload */ -$_Lang['install_file'] = "Installeren op bestand"; -$_Lang['choose_file_msg'] = "Kies een bestand om te uploaden en te installeren"; -$_Lang['install_file_btn'] = "Installeren"; -$_Lang['install_file_success'] = "Installatie succesvol"; +$_Lang['install_file'] = "Installatie vanuit archief"; +$_Lang['choose_file_msg'] = "Selecteer bestand"; +$_Lang['install_file_btn'] = "Installeer"; +$_Lang['install_file_success'] = "Installatie voltooid"; /* faq */ $_Lang['faq'] = ' From 868fda5e5ff5cc8ee24122e7b3c69293efb58fa4 Mon Sep 17 00:00:00 2001 From: Serg <64j@mail.ru> Date: Mon, 26 Mar 2018 01:37:49 +0300 Subject: [PATCH 079/274] remove toggle theme --- manager/frames/tree.php | 2 -- manager/media/style/default/js/modx.js | 28 ---------------------- manager/media/style/default/js/modx.min.js | 2 +- 3 files changed, 1 insertion(+), 31 deletions(-) diff --git a/manager/frames/tree.php b/manager/frames/tree.php index 506643c448..394415f7e9 100755 --- a/manager/frames/tree.php +++ b/manager/frames/tree.php @@ -46,8 +46,6 @@ - -
    diff --git a/manager/media/style/default/js/modx.js b/manager/media/style/default/js/modx.js index 89741f056d..e62b4e5761 100755 --- a/manager/media/style/default/js/modx.js +++ b/manager/media/style/default/js/modx.js @@ -889,34 +889,6 @@ } } }, - toggleTheme: function() { - var myCodeMirrors = w.main.myCodeMirrors, key; - if (d.body.classList.contains('dark')) { - d.body.classList.remove('dark'); - w.main.document.body.classList.remove('dark'); - d.cookie = 'MODX_themeColor='; - if (myCodeMirrors) { - for (key in myCodeMirrors) { - if (myCodeMirrors.hasOwnProperty(key)) { - w.main.document.getElementsByName(key)[0].nextElementSibling.classList.remove('cm-s-' + myCodeMirrors[key].options.darktheme); - w.main.document.getElementsByName(key)[0].nextElementSibling.classList.add('cm-s-' + myCodeMirrors[key].options.defaulttheme); - } - } - } - } else { - d.body.classList.add('dark'); - w.main.document.body.classList.add('dark'); - d.cookie = 'MODX_themeColor=dark'; - if (myCodeMirrors) { - for (key in myCodeMirrors) { - if (myCodeMirrors.hasOwnProperty(key)) { - w.main.document.getElementsByName(key)[0].nextElementSibling.classList.add('cm-s-' + myCodeMirrors[key].options.darktheme); - w.main.document.getElementsByName(key)[0].nextElementSibling.classList.remove('cm-s-' + myCodeMirrors[key].options.defaulttheme); - } - } - } - } - }, toggleNode: function(e, id) { e = e || w.event; if (e.ctrlKey) return; diff --git a/manager/media/style/default/js/modx.min.js b/manager/media/style/default/js/modx.min.js index 960096ca1e..f66aecc735 100755 --- a/manager/media/style/default/js/modx.min.js +++ b/manager/media/style/default/js/modx.min.js @@ -1 +1 @@ -(function($,w,d,u){'use strict';modx.extended({frameset:'frameset',minWidth:840,isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),typesactions:{'16':1,'301':2,'78':3,'22':4,'102':5,'108':6,'3':7,'4':7,'6':7,'27':7,'61':7,'62':7,'63':7,'72':7},tabsTimer:0,popupTimer:0,init:function(){if(!localStorage.getItem('MODX_widthSideBar')){localStorage.setItem('MODX_widthSideBar',this.config.tree_width)}this.mainmenu.init();if(w.location.hash){if(modx.getActionFromUrl(w.location.hash,2)){w.history.replaceState(null,d.title,modx.MODX_MANAGER_URL)}else if(modx.getActionFromUrl(w.location.hash)||modx.main.getQueryVariable('filemanager',w.location.hash)){var url=modx.main.getQueryVariable('filemanager',w.location.hash)?modx.MODX_MANAGER_URL+modx.main.getQueryVariable('filemanager',w.location.hash)+w.location.hash.replace('#?','?'):w.location.href.replace('#?','?');if(modx.config.global_tabs){modx.tabs({url:url,title:'blank'})}else if(w.main){w.main.frameElement.src=url}else{modx.openWindow(url)}}}this.resizer.init();this.search.init();if(this.config.session_timeout>0){w.setInterval(this.keepMeAlive,1000*60*this.config.session_timeout)}if(modx.config.mail_check_timeperiod>0&&modx.permission.messages){setTimeout('modx.updateMail(true)',1000)}d.addEventListener('click',this.hideDropDown,false);if(modx.config.global_tabs){d.addEventListener('click',this.tabs,false);this.tabs({url:'?a=2',reload:0})}},mainmenu:{id:'mainMenu',init:function(){var $mm=$('#mainMenu'),mm=d.getElementById('mainMenu'),timer;$mm.on('click','a',function(e){if($(this).hasClass('dropdown-toggle')){if($mm.hasClass('show')&&($(this).hasClass('selected')||!modx.isMobile&&$(this).parent().hasClass('hover'))){$(this).removeClass('selected');$mm.removeClass('show')}else{$('.nav > li > a:not(:hover)').removeClass('selected');$(this).addClass('selected');$mm.addClass('show')}e.stopPropagation();e.target.dataset.toggle='#mainMenu';modx.hideDropDown(e)}if($(this).closest('ul').hasClass('dropdown-menu')&&!$(this).parent('li').hasClass('dropdown-back')){$('.nav > .active').removeClass('active');$('.nav li.selected').removeClass('selected');$(this).closest('.nav > li').addClass('active');if(this.offsetParent.id){d.getElementById(this.offsetParent.id.substr(7)).classList.add('selected')}if((modx.isMobile||w.innerWidth li',function(){var els=mm.querySelectorAll('.nav > li.hover:not(:hover)');for(var i=0;i li li',function(e){var self=this,ul;var els=mm.querySelectorAll('.nav > li li.hover:not(:hover)');for(var i=0;i'+modx.lang.paging_prev+''+data}ul.id='parent_'+self.id;ul.innerHTML=data;var id=w.location.hash.substr(2).replace(/=/g,'_').replace(/&/g,'__');var el=d.getElementById(id);if(el){el.parentNode.classList.add('selected');d.getElementById(el.parentNode.parentNode.id.substr(7)).classList.add('selected')}for(var i=0;iitems.length-1){index=items.length-1}if(index>=0&&index2){s.timer=setTimeout(function(){s.loader.style.display='block';modx.get(modx.MODX_MANAGER_URL+'?a=71&ajax=1&submitok=Search&searchid='+s.input.value,function(data){s.loader.style.display='none';s.results=data.querySelector('.ajaxSearchResults');if(s.results&&s.results.innerHTML!==''){s.result.innerHTML=s.results.outerHTML;s.open();s.result.onclick=function(e){var t=e.target,p=t.parentNode;if(t.tagName==='I'){modx.openWindow({title:p.innerText,id:p.id,url:p.href});e.preventDefault();e.stopPropagation()}else{var a=t.tagName==='A'&&t||p.tagName==='A'&&p;if(a){var el=s.result.querySelector('.selected');if(el)el.className='';a.className='selected';if(modx.isMobile)s.close()}}}}else{s.empty()}},'document')},300)}else{s.empty()}};if(modx.isMobile){this.input.onblur=this.close}this.input.onfocus=this.open;this.input.onclick=this.open;this.input.onmouseenter=this.open;this.result.onmouseenter=this.open;this.result.onmouseleave=this.close;this.mask.onmouseenter=this.open;this.mask.onmouseleave=this.close},open:function(){if(modx.search.results){modx.search.result.classList.add('open')}},close:function(){modx.search.result.classList.remove('open')},empty:function(){modx.search.result.classList.remove('open');modx.search.result.innerHTML=''}},main:{id:'main',idFrame:'mainframe',as:null,onload:function(e){w.main=e.target.contentWindow||e.target.defaultView;modx.main.tabRow.init();modx.main.stopWork();modx.main.scrollWork();w.main.document.addEventListener('click',modx.hideDropDown,false);w.main.document.addEventListener('contextmenu',modx.main.oncontextmenu,false);if(modx.config.global_tabs){w.main.document.addEventListener('click',modx.tabs,false)}w.history.replaceState(null,d.title,modx.getActionFromUrl(w.main.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.main.location.search);setTimeout('modx.tree.restoreTree()',100)},oncontextmenu:function(e){if(e.ctrlKey)return;var el=e.target;if(modx.user.role===1&&/modxtv|modxplaceholder|modxattributevalue|modxchunk|modxsnippet|modxsnippetnocache/i.test(el.className)){var id=Date.now(),name=el.innerText.replace(/[\[|\]|{|}|\*||\#|\+|?|\!|&|=|`|:]/g,''),type=el.className.replace(/cm-modx/,''),n=!!name.replace(/^\d+$/,'');if(name&&n){e.preventDefault();modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',{a:'modxTagHelper',name:name,type:type},function(r){if(r){r=JSON.parse(r);for(var k in r){if(r.hasOwnProperty(k)&&r[k].url){r[k]['onclick']='if(event.shiftKey){modx.openWindow({url:\''+r[k].url+'\'})}else{modx.popup({url:\''+r[k].url+'\',title:\''+r.header.innerHTML+'\',width:\'95%\',height:\'95%\',margin:0,hide:0,hover:0,overlay:1,overlayclose:0,position:\'center elements\',animation:0,icon:\'none\'})}'}}r=JSON.stringify(r);el.id='node'+id;el.dataset.contextmenu=r;modx.tree.showPopup(e,id,name)}})}e.preventDefault()}},tabRow:{init:function(){var row=w.main.document.querySelector('.tab-pane > .tab-row');if(row)this.build(row)},build:function(row){var rowContainer=d.createElement('div'),sel=row.querySelector('.selected');rowContainer.className='tab-row-container';row.parentNode.insertBefore(rowContainer,row);rowContainer.appendChild(row);var p=d.createElement('i');p.className='fa fa-angle-left prev disable';p.onclick=function(e){e.stopPropagation();e.preventDefault();var sel=row.querySelector('.selected');if(sel.previousSibling){sel.previousSibling.click();modx.main.tabRow.scroll(row)}};rowContainer.appendChild(p);var n=d.createElement('i');n.className='fa fa-angle-right next disable';n.onclick=function(e){e.stopPropagation();e.preventDefault();var sel=row.querySelector('.selected');if(sel.nextSibling){sel.nextSibling.click();modx.main.tabRow.scroll(row)}};rowContainer.appendChild(n);setTimeout(function(){sel=row.querySelector('.selected');modx.main.tabRow.scroll(row,sel);w.main.addEventListener('resize',function(){modx.main.tabRow.scroll(row)},false);if(sel){if(sel.previousSibling)p.classList.remove('disable');if(sel.nextSibling)n.classList.remove('disable')}},100);row.onclick=function(e){var sel=e.target.tagName==='H2'?e.target:e.target.tagName==='SPAN'?e.target.parentNode:null;if(sel){if(sel.previousSibling){this.parentNode.querySelector('i.prev').classList.remove('disable')}else{this.parentNode.querySelector('i.prev').classList.add('disable')}if(sel.nextSibling){this.parentNode.querySelector('i.next').classList.remove('disable')}else{this.parentNode.querySelector('i.next').classList.add('disable')}modx.main.tabRow.scroll(this,sel)}}},scroll:function(row,sel,a){sel=sel||row.querySelector('.selected')||row.firstChild;a=a||100;var c=0,elms=row.childNodes;for(var i=0;isel.offsetLeft){$(row).animate({scrollLeft:sel.offsetLeft-(sel.previousSibling?30:1)},a)}if(sel.offsetLeft+sel.offsetWidth>row.offsetWidth+row.scrollLeft){$(row).animate({scrollLeft:sel.offsetLeft-row.offsetWidth+sel.offsetWidth+(sel.nextSibling?30:0)},a)}if(c>row.offsetWidth){this.drag(row)}},drag:function(row){row.onmousedown=function(e){if(e.button===0){e.preventDefault();var x=e.clientX,f=row.scrollLeft;row.ownerDocument.body.focus();row.onmousemove=row.ownerDocument.onmousemove=function(e){if(Math.abs(e.clientX-x)>5){e.stopPropagation();row.scrollLeft=f-(e.clientX-x);row.ownerDocument.body.classList.add('drag')}};row.onmouseup=row.ownerDocument.onmouseup=function(e){e.stopPropagation();row.onmousemove=null;row.ownerDocument.onmousemove=null;row.ownerDocument.body.classList.remove('drag')}}}}},work:function(){d.getElementById('mainloader').classList.add('show')},stopWork:function(){d.getElementById('mainloader').classList.remove('show')},scrollWork:function(){var a=w.main.frameElement.contentWindow,b=a.location.search.substring(1)||a.location.hash.substring(2),c=localStorage.getItem('page_y')||0,f=localStorage.getItem('page_url')||b;if(((modx.getActionFromUrl(f)===modx.getActionFromUrl(b))&&(modx.main.getQueryVariable('id',f)&&modx.main.getQueryVariable('id',f)===modx.main.getQueryVariable('id',b)))||(f===b)){a.scrollTo(0,c)}a.addEventListener('scroll',function(){if(this.pageYOffset>=0){localStorage.setItem('page_y',this.pageYOffset.toString());localStorage.setItem('page_url',b)}},false)},getQueryVariable:function(a,b){var f='';if(b||typeof b==='string'){b=b.split('?');b=b[1]||b[0];b=b.split('&');for(var i=0;iMath.abs(ay)&&this.swipe){if(ax<0&&this.sidebar){if(Math.abs(ax)>h)ax=-h;tree.style.transform='translate3d('+ax+'px, 0, 0)';tree.style.WebkitTransform='translate3d('+ax+'px, 0, 0)';modx.resizer.mask.style.opacity=(0.5-0.5/-h*ax).toFixed(2);if(Math.abs(ax)>h/3){this.swipe='left'}else{this.swipe='right'}}else if(ax>0&&!this.sidebar){if(Math.abs(ax)>h)ax=h;tree.style.transform='translate3d('+ -(h-ax)+'px, 0, 0)';tree.style.WebkitTransform='translate3d('+ -(h-ax)+'px, 0, 0)';modx.resizer.mask.style.opacity=(0.5/h*ax).toFixed(2);if(Math.abs(ax)>h/3){this.swipe='right'}else{this.swipe='left'}}}},false);w.addEventListener('touchend',function(){if(this.swipe==='left'){d.body.classList.add('sidebar-closed');modx.resizer.setWidth(0)}if(this.swipe==='right'){d.body.classList.remove('sidebar-closed');modx.resizer.setWidth(h)}tree.style.cssText='';modx.resizer.mask.style.cssText=''},false)}},onMouseDown:function(e){e=e||w.event;modx.resizer.dragElement=e.target!==null?e.target:e.srcElement;if((e.buttons===1||e.button===0)&&modx.resizer.dragElement.id===modx.resizer.id){modx.resizer.oldZIndex=modx.resizer.dragElement.style.zIndex;modx.resizer.dragElement.style.zIndex=modx.resizer.newZIndex;modx.resizer.dragElement.style.background=modx.resizer.background;localStorage.setItem('MODX_widthSideBar',modx.resizer.dragElement.offsetLeft>0?modx.resizer.dragElement.offsetLeft:0);d.body.appendChild(modx.resizer.mask);d.onmousemove=modx.resizer.onMouseMove;d.body.focus();d.body.classList.add('resizer_move');d.onselectstart=function(){return false};modx.resizer.dragElement.ondragstart=function(){return false};return false}},onMouseMove:function(e){e=e||w.event;if(e.clientX>0){modx.resizer.left=e.clientX}else{modx.resizer.left=0}modx.resizer.dragElement.style.left=modx.pxToRem(modx.resizer.left)+'rem';d.getElementById('tree').style.width=modx.pxToRem(modx.resizer.left)+'rem';d.getElementById('main').style.left=modx.pxToRem(modx.resizer.left)+'rem';if(e.clientX<-2||e.clientY<-2){modx.resizer.onMouseUp(e)}},onMouseUp:function(e){if(modx.resizer.dragElement!==null&&e.button===0&&modx.resizer.dragElement.id===modx.resizer.id){if(e.clientX>0){d.body.classList.remove('sidebar-closed');modx.resizer.left=e.clientX}else{d.body.classList.add('sidebar-closed');modx.resizer.left=0}d.cookie='MODX_widthSideBar='+modx.pxToRem(modx.resizer.left);modx.resizer.dragElement.style.zIndex=modx.resizer.oldZIndex;modx.resizer.dragElement.style.background='';modx.resizer.dragElement.ondragstart=null;modx.resizer.dragElement=null;d.body.classList.remove('resizer_move');d.body.removeChild(modx.resizer.mask);d.onmousemove=null;d.onselectstart=null}},toggle:function(){if(modx.isMobile||w.innerWidth<=modx.minWidth){if(d.body.classList.contains('sidebar-closed')){d.body.classList.remove('sidebar-closed');localStorage.setItem('MODX_widthSideBar',0);d.cookie='MODX_widthSideBar='+modx.pxToRem(parseInt(d.getElementById('tree').offsetWidth))}else{localStorage.setItem('MODX_widthSideBar',parseInt(d.getElementById('tree').offsetWidth));d.body.classList.add('sidebar-closed');d.cookie='MODX_widthSideBar=0'}}else{var p=d.getElementById('tree').offsetWidth!==0?0:parseInt(localStorage.getItem('MODX_widthSideBar'))?parseInt(localStorage.getItem('MODX_widthSideBar')):modx.config.tree_width;modx.resizer.setWidth(p)}},setWidth:function(a){if(a>0){localStorage.setItem('MODX_widthSideBar',0);d.body.classList.remove('sidebar-closed')}else{localStorage.setItem('MODX_widthSideBar',parseInt(d.getElementById('tree').offsetWidth));d.body.classList.add('sidebar-closed')}d.cookie='MODX_widthSideBar='+modx.pxToRem(a);d.getElementById('tree').style.width=modx.pxToRem(a)+'rem';d.getElementById('resizer').style.left=modx.pxToRem(a)+'rem';d.getElementById('main').style.left=modx.pxToRem(a)+'rem'},setDefaultWidth:function(){modx.resizer.setWidth(modx.remToPx(modx.config.tree_width))}},tree:{ctx:null,rpcNode:null,itemToChange:'',selectedObjectName:null,selectedObject:0,selectedObjectDeleted:0,selectedObjectUrl:'',drag:false,deleted:[],init:function(){this.restoreTree()},draggable:function(){if(modx.permission.dragndropdocintree){var els=d.querySelectorAll('#treeRoot a:not(.empty)');for(var i=0;i-1:true;modx.tree.itemToChange=this.dataset.id||this.parentNode.id.replace('node','');modx.tree.selectedObjectName=this.dataset.titleEsc;if(draggable){this.parentNode.draggable=true;this.parentNode.ondragstart=modx.tree.ondragstart}else{this.parentNode.draggable=false;this.parentNode.ondragstart=function(){return false}}}},ondragstart:function(e){e.dataTransfer.effectAllowed='all';e.dataTransfer.dropEffect='all';e.dataTransfer.setData('text',this.id.substr(4))},ondragenter:function(e){if(d.getElementById('node'+modx.tree.itemToChange)===(this.parentNode.closest('#node'+modx.tree.itemToChange)||this.parentNode)){this.parentNode.className='';e.dataTransfer.effectAllowed='none';e.dataTransfer.dropEffect='none';modx.tree.drag=false}else{this.parentNode.className='dragenter';e.dataTransfer.effectAllowed='copy';e.dataTransfer.dropEffect='copy';modx.tree.drag=true}e.preventDefault()},ondragover:function(e){if(modx.tree.drag){var a=e.clientY;var b=parseInt(this.getBoundingClientRect().top);var c=a-b;if(c>this.offsetHeight/1.51){this.parentNode.classList.add('dragafter');this.parentNode.classList.remove('dragbefore');this.parentNode.classList.remove('dragenter');e.dataTransfer.effectAllowed='link';e.dataTransfer.dropEffect='link'}else if(c'}if(this.nextSibling){if(this.nextSibling.innerHTML){this.nextSibling.appendChild(el)}else{el.parentNode.removeChild(el)}els=this.parentNode.lastChild.children;for(i=0;i'}this.parentNode.parentNode.insertBefore(el,this.parentNode.nextSibling);els=this.parentNode.parentNode.children;for(i=0;i'}this.parentNode.parentNode.insertBefore(el,this.parentNode);els=this.parentNode.parentNode.children;for(i=0;i-1:true)){alert(modx.lang.error_no_privileges);modx.tree.restoreTree();return}modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',{a:'movedocument',id:id,parent:parent,menuindex:menuindex},function(r){if(r.errors)alert(r.errors);modx.tree.restoreTree()},'json');var b=w.main.frameElement.contentWindow.location.search.substr(1);if(modx.getActionFromUrl(b,27)&&parseInt(modx.main.getQueryVariable('id',b))===parseInt(id)){var index=menuindex.indexOf(id),elMenuIndex=w.main.document.querySelector('#documentPane input[name=menuindex]'),elParent=w.main.document.querySelector('#documentPane input[name=parent]'),elParentName=w.main.document.querySelector('#documentPane #parentName');if(elMenuIndex&&index>=0)elMenuIndex.value=index;if(elParent&&elParentName){elParent.value=parent;elParentName.innerHTML=parent+' ('+d.querySelector('#node'+parent+' > a').dataset.titleEsc+')'}}},toggleTheme:function(){var myCodeMirrors=w.main.myCodeMirrors,key;if(d.body.classList.contains('dark')){d.body.classList.remove('dark');w.main.document.body.classList.remove('dark');d.cookie='MODX_themeColor=';if(myCodeMirrors){for(key in myCodeMirrors){if(myCodeMirrors.hasOwnProperty(key)){w.main.document.getElementsByName(key)[0].nextElementSibling.classList.remove('cm-s-'+myCodeMirrors[key].options.darktheme);w.main.document.getElementsByName(key)[0].nextElementSibling.classList.add('cm-s-'+myCodeMirrors[key].options.defaulttheme)}}}}else{d.body.classList.add('dark');w.main.document.body.classList.add('dark');d.cookie='MODX_themeColor=dark';if(myCodeMirrors){for(key in myCodeMirrors){if(myCodeMirrors.hasOwnProperty(key)){w.main.document.getElementsByName(key)[0].nextElementSibling.classList.add('cm-s-'+myCodeMirrors[key].options.darktheme);w.main.document.getElementsByName(key)[0].nextElementSibling.classList.remove('cm-s-'+myCodeMirrors[key].options.defaulttheme)}}}}},toggleNode:function(e,id){e=e||w.event;if(e.ctrlKey)return;e.stopPropagation();var el=d.getElementById('node'+id).firstChild;this.rpcNode=el.nextSibling;var toggle=el.querySelector('.toggle'),icon=el.querySelector('.icon');if(this.rpcNode.innerHTML===''){if(toggle)toggle.innerHTML=el.dataset.iconCollapsed;icon.innerHTML=el.dataset.iconFolderOpen;var rpcNodeText=this.rpcNode.innerHTML,loadText=modx.lang.loading_doc_tree;modx.openedArray[id]=1;if(rpcNodeText===''||rpcNodeText.indexOf(loadText)>0){var folderState=this.getFolderState();d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent='+el.dataset.indent+'&parent='+id+'&expandAll='+el.dataset.expandall+folderState,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})}this.saveFolderState()}else{if(toggle)toggle.innerHTML=el.dataset.iconExpanded;icon.innerHTML=el.dataset.iconFolderClose;delete modx.openedArray[id];this.rpcNode.style.overflow='hidden';$(this.rpcNode.firstChild).animate({marginTop:-this.rpcNode.offsetHeight+'px'},100,function(){this.parentNode.innerHTML=''});this.saveFolderState()}e.preventDefault()},rpcLoadData:function(a){if(this.rpcNode!==null){var el;this.rpcNode.innerHTML=typeof a==='object'?a.responseText:a;this.rpcNode.loaded=true;if(this.rpcNode.firstChild.tagName==='DIV'){if(this.rpcNode.id==='treeRoot'){el=d.getElementById('binFull');if(el){this.showBin(true)}else{this.showBin(false)}}else{this.rpcNode.style.overflow='hidden';this.rpcNode.firstElementChild.style.marginTop=-this.rpcNode.offsetHeight+'px';$(this.rpcNode.firstChild).animate({marginTop:0},100)}d.getElementById('treeloader').classList.remove('visible')}else{el=d.getElementById('loginfrm');if(el){this.rpcNode.parentNode.removeChild(this.rpcNode);w.location.href=modx.MODX_MANAGER_URL}}}},treeAction:function(e,id,title){if(e.ctrlKey)return;var el=d.getElementById('node'+id).firstChild,treepageclick=el.dataset.treepageclick,showchildren=parseInt(el.dataset.showchildren),openfolder=parseInt(el.dataset.openfolder);title=title||el.dataset&&el.dataset.titleEsc;if(tree.ca==='move'){try{this.setSelectedByContext(id);w.main.setMoveValue(id,title)}catch(oException){alert(modx.lang.unable_set_parent)}}if(tree.ca==='open'||tree.ca===''){if(id===0){href='?a=2'}else{var href='';if(!isNaN(treepageclick)&&isFinite(treepageclick)){href='?a='+treepageclick+'&r=1&id='+id+(openfolder===0?this.getFolderState():'')}else{href=treepageclick}if(openfolder===2){if(showchildren!==1){href=''}this.toggleNode(e,id)}}if(href){if(e.shiftKey){w.getSelection().removeAllRanges();modx.openWindow(href);this.restoreTree()}else{modx.tabs({url:modx.MODX_MANAGER_URL+href,title:title+'('+id+')'});if(modx.isMobile)modx.resizer.toggle()}}this.itemToChange=id;this.setSelected(id)}if(tree.ca==='parent'){try{this.setSelectedByContext(id);w.main.setParent(id,title)}catch(oException){alert(modx.lang.unable_set_parent)}}if(tree.ca==='link'){try{this.setSelectedByContext(id);w.main.setLink(id)}catch(oException){alert(modx.lang.unable_set_link)}}e.preventDefault()},showPopup:function(e,id,title){if(e.ctrlKey)return;e.preventDefault();var tree=d.getElementById('tree'),el=d.getElementById('node'+id)||e.target,x=0,y=0;if(el.firstChild&&el.firstChild.dataset&&el.firstChild.dataset.contextmenu){el=el.firstChild}if(el){if(el.dataset.contextmenu){e.target.dataset.toggle='#contextmenu';modx.hideDropDown(e);this.ctx=d.createElement('div');this.ctx.id='contextmenu';this.ctx.className='dropdown-menu';d.getElementById(modx.frameset).appendChild(this.ctx);this.setSelectedByContext(id);var dataJson=JSON.parse(el.dataset.contextmenu);for(var key in dataJson){if(dataJson.hasOwnProperty(key)){var item=d.createElement('div');for(var k in dataJson[key]){if(dataJson[key].hasOwnProperty(k)){if(k.substring(0,2)==='on'){var onEvent=dataJson[key][k];item[k]=function(onEvent){return function(event){eval(onEvent)}}(onEvent)}else{item[k]=dataJson[key][k]}}}if(key.indexOf('header')===0)item.className+=' menuHeader';if(key.indexOf('item')===0)item.className+=' menuLink';if(key.indexOf('seperator')===0||key.indexOf('separator')===0)item.className+=' seperator separator';this.ctx.appendChild(item)}}x=e.clientX>0?e.clientX:e.pageX;y=e.clientY>0?e.clientY:e.pageY;e.view.position=e.view.frameElement?e.view.frameElement.getBoundingClientRect():e.target.offsetParent.getBoundingClientRect();if(e.view.frameElement){x+=e.view.position.left;y+=e.view.frameElement.offsetParent.offsetTop}else{if(e.target.parentNode.parentNode.classList.contains('node')){x+=50}}if(x>e.view.position.width){x=e.view.position.width-this.ctx.offsetWidth}if(y+this.ctx.offsetHeight/2>e.view.position.height){y=e.view.position.height-this.ctx.offsetHeight-5}else if(y-this.ctx.offsetHeight/20?e.clientX:e.pageX;y=e.clientY>0?e.clientY:e.pageY;if(y+ctx.offsetHeight/2>bodyHeight){y=bodyHeight-ctx.offsetHeight-5}else if(y-ctx.offsetHeight/230){this.selectedObjectName=this.selectedObjectName.substr(0,30)+'...'}var f=d.getElementById('nameHolder');f.innerHTML=this.selectedObjectName;el.style.left=a+(modx.config.textdir?'-190':'')+'px';el.style.top=b+'px';el.classList.add('show')},menuHandler:function(a){switch(a){case 1:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=3&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 2:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=27&r=1&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 3:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=4&pid='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 4:if(this.selectedObjectDeleted){alert('"'+this.selectedObjectName+'" '+modx.lang.already_deleted)}else if(confirm('"'+this.selectedObjectName+'"\n\n'+modx.lang.confirm_delete_resource)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=6&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 5:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=51&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 6:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=72&pid='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 7:if(confirm(modx.lang.confirm_resource_duplicate)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=94&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 8:if(d.getElementById('node'+this.itemToChange).firstChild.dataset.deleted){if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_undelete)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=63&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}}else{alert('"'+this.selectedObjectName+'"'+modx.lang.not_deleted)}break;case 9:if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_publish)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=61&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 10:if(this.itemToChange!==modx.config.site_start){if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_unpublish)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=62&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}}else{alert('Document is linked to site_start variable and cannot be unpublished!')}break;case 11:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=56&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 12:w.open(d.getElementById('node'+this.itemToChange).firstChild.dataset.href,'previeWin');break;default:alert('Unknown operation command.')}},setSelected:function(a){var el=d.querySelector('#tree .current');if(el)el.classList.remove('current');if(a){if(typeof a==='object'){a.classList.add('current')}else{el=d.querySelector('#node'+a+'>.node')||d.getElementById('node'+a);if(el)el.classList.add('current')}}},setActiveFromContextMenu:function(a){var el=d.querySelector('#node'+a+'>.node');if(el)this.setSelected(el)},setSelectedByContext:function(a){var el=d.querySelector('#treeRoot .selected');if(el)el.classList.remove('selected');el=d.querySelector('#node'+a+'>.node');if(el)el.classList.add('selected')},setItemToChange:function(){var a=w.main.document&&(w.main.document.URL||w.main.document.location.search),b=modx.getActionFromUrl(a);if(a&&modx.typesactions[b]){this.itemToChange=(modx.typesactions[b]===7?'':modx.typesactions[b]+'_')+parseInt(modx.main.getQueryVariable('id',a))}else{this.itemToChange=''}this.setSelected(this.itemToChange)},restoreTree:function(){if(d.getElementById('treeRoot')){d.getElementById('treeloader').classList.add('visible');this.setItemToChange();this.rpcNode=d.getElementById('treeRoot');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=2&id='+this.itemToChange,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})}},expandTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=1&id='+this.itemToChange,function(r){modx.tree.rpcLoadData(r);modx.tree.saveFolderState();modx.tree.draggable()})},collapseTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=0&id='+this.itemToChange,function(r){modx.openedArray=[];modx.tree.saveFolderState();modx.tree.rpcLoadData(r);modx.tree.draggable()})},updateTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');var a=d.sortFrm;var b='a=1&f=nodes&indent=1&parent=0&expandAll=2&dt='+a.dt.value+'&tree_sortby='+a.sortby.value+'&tree_sortdir='+a.sortdir.value+'&tree_nodename='+a.nodename.value+'&id='+this.itemToChange+'&showonlyfolders='+a.showonlyfolders.value;modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',b,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})},getFolderState:function(){var a;if(modx.openedArray!==[0]){a='&opened=';for(var key in modx.openedArray){if(modx.openedArray[key]){a+=key+'|'}}}else{a='&opened='}return a},saveFolderState:function(){modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&savestateonly=1'+this.getFolderState())},showSorter:function(e){e=e||w.event;var el=d.getElementById('floater');e.target.dataset.toggle='#floater';el.classList.toggle('show');el.onclick=function(e){e.stopPropagation()}},emptyTrash:function(){if(confirm(modx.lang.confirm_empty_trash)===true){modx.get(modx.MODX_MANAGER_URL+'?a=64',function(){modx.tabsClose(modx.tree.deleted);modx.tree.deleted=[];modx.tree.restoreTree()})}},showBin:function(a){var el=d.getElementById('treeMenu_emptytrash');if(el){if(a){el.title=modx.lang.empty_recycle_bin;el.classList.remove('disabled');el.innerHTML=modx.style.empty_recycle_bin;el.onclick=function(){modx.tree.emptyTrash()};var els=d.getElementById('tree').querySelectorAll('.deleted');for(var i=0;i0){if(el){el.innerHTML=c[0];el.style.display='block'}}else{if(el)el.style.display='none'}if(c[1]>0){el=d.getElementById('newMail');if(el){el.innerHTML=''+modx.style.email+modx.lang.inbox+' ('+c[0]+' / '+c[1]+')';el.style.display='block'}}if(modx.config.mail_check_timeperiod>0)setTimeout('modx.updateMail(true)',1000*modx.config.mail_check_timeperiod)})}}catch(oException){setTimeout('modx.updateMail(true)',1000*modx.config.mail_check_timeperiod)}},openWindow:function(a){if(typeof a!=='object'){a={'url':a}}if(!a.width)a.width=parseInt(w.innerWidth*0.9)+'px';if(!a.height)a.height=parseInt(w.innerHeight*0.8)+'px';if(!a.left)a.left=parseInt(w.innerWidth*0.05)+'px';if(!a.top)a.top=parseInt(w.innerHeight*0.1)+'px';if(!a.title)a.title=Math.floor((Math.random()*999999)+1);if(a.url){if(this.plugins.EVOmodal===1){top.EVO.modal.show(a)}else{w.open(a.url,a.title,'width='+a.width+',height='+a.height+',top='+a.top+',left='+a.left+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no')}}},tabsClose:function(a){if(modx.config.global_tabs&&a){for(var k in a){if(a.hasOwnProperty(k)){var el=d.getElementById(a[k]);if(el){el.firstElementChild.contentWindow.documentDirty=false;el.close()}}}}},tabs:function(a){function Tabs(a){var s=this;this.url=a.url;this.title=a.title||'';this.name=a.name||'';this.timer=null;this.olduid='';this.closeactions=[6,61,62,63,94];this.reload=typeof a.reload!=='undefined'?a.reload:1;this.action=modx.getActionFromUrl(a.url);this.uid=modx.getActionFromUrl(a.url,2)?'home':modx.urlToUid(a.url);this.page=d.getElementById('evo-tab-page-'+this.uid);this.row=d.getElementsByClassName('evo-tab-row')[0].firstElementChild;this.tab=d.getElementById('evo-tab-'+this.uid);if(this.page){if(this.uid==='home'){if(this.reload){this.page.firstElementChild.src=this.url;this.show()}else{this.reload=1;if(this.tab.onclick===null){this.tab.onclick=function(e){s.select.call(s,e,this)}}this.tab.show=function(e){s.show.call(s,e)};modx.tabs.selected=this.tab}}else{this.show();if(~this.closeactions.indexOf(this.action)){this.setDocPublished();modx.get(this.url,function(){modx.tree.restoreTree()})}}}else if(~this.closeactions.indexOf(this.action)){modx.get(this.url,function(){modx.tree.restoreTree()})}else{this.create()}}Tabs.prototype={create:function(){var s=this;modx.main.work();modx.tabs.selected=this.row.querySelector('.selected');if(modx.tabs.selected){d.getElementById(modx.tabs.selected.id.replace('tab','tab-page')).classList.remove('show');modx.tabs.selected.classList.remove('selected')}this.page=d.createElement('div');this.page.id='evo-tab-page-'+this.uid;this.page.className='evo-tab-page show';this.page.innerHTML='';d.getElementById('main').appendChild(this.page);console.time('load-tab');this.page.firstElementChild.onload=function(e){s.onload.call(s,e);console.timeEnd('load-tab')};this.tab=d.createElement('h2');this.tab.id='evo-tab-'+this.uid;this.tab.className='tab selected';this.icon='';if(!/'}this.tab.innerHTML=''+this.icon+this.title+'×';this.row.appendChild(this.tab);this.tab.onclick=function(e){s.select.call(s,e,this)};this.tab.close=function(e){s.close.call(s,e)};this.tab.show=function(e){s.show.call(s,e)};this.page.close=function(e){s.close.call(s,e)}},onload:function(e){var s=this;w.main=e.target.contentWindow||e.target.defaultView;this.url=w.main.location.search||w.location.hash.substring(1);this.olduid=this.uid;this.uid=modx.urlToUid(this.url);if(!!w.main.__alertQuit){w.main.alert=function(a){};var message=w.main.document.body.innerHTML;w.main.document.body.innerHTML='';history.pushState(null,d.title,modx.getActionFromUrl(w.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.location.search);w.onpopstate=function(){history.go(1)};modx.popup({type:'warning',title:'MODX :: Alert',position:'top center alertQuit',content:message,wrap:'body'});modx.getLockedElements(modx.getActionFromUrl(this.url),modx.main.getQueryVariable('id',this.url),function(data){if(!!data){s.page.close();modx.tree.restoreTree()}else{w.main.location.href=modx.MODX_MANAGER_URL+s.url;w.history.replaceState(null,d.title,modx.getActionFromUrl(s.url,2)?modx.MODX_MANAGER_URL:'#'+s.url)}})}else{if(modx.getActionFromUrl(this.url,2)){this.close(e)}else if(this.olduid!==this.uid&&d.getElementById('evo-tab-'+this.uid)){this.close(e);d.getElementById('evo-tab-'+this.uid).show()}else{this.title=w.main.document.body.querySelectorAll('h1')[0]&&w.main.document.body.querySelectorAll('h1')[0].innerHTML||this.title;if(this.title&&this.uid!=='home'){this.tab.innerHTML=''+this.title+'×'}this.page.id='evo-tab-page-'+this.uid;this.tab.id='evo-tab-'+this.uid;this.tab.classList.remove('changed');this.show();modx.main.onload(e);w.main.document.addEventListener('click',function a(e){if(typeof e.view.documentDirty!=='undefined'&&e.view.documentDirty&&!s.tab.classList.contains('changed')){s.tab.classList.add('changed');this.removeEventListener(e.type,a,false)}},false);w.main.document.addEventListener('keyup',function a(e){if(typeof e.view.documentDirty!=='undefined'&&e.view.documentDirty&&!s.tab.classList.contains('changed')){s.tab.classList.add('changed');this.removeEventListener(e.type,a,false)}},false)}}},show:function(){var s=this;modx.tabs.selected=this.row.querySelector('.selected');if(modx.tabs.selected&&modx.tabs.selected!==this.tab){d.getElementById(modx.tabs.selected.id.replace('tab','tab-page')).classList.remove('show');modx.tabs.selected.classList.remove('selected')}this.page.classList.add('show');this.tab.classList.add('selected');modx.tabs.selected=this.tab;w.main=this.page.firstElementChild.contentWindow;w.history.replaceState(null,w.main.document.title,modx.getActionFromUrl(w.main.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.main.location.search);modx.tree.setItemToChange();modx.main.tabRow.scroll(this.row,this.tab,350)},close:function(e){var documentDirty=this.page.firstElementChild.contentWindow.documentDirty;var checkDirt=!!this.page.firstElementChild.contentWindow.checkDirt;if(documentDirty&&checkDirt&&confirm(this.page.firstElementChild.contentWindow.checkDirt(e))||!documentDirty){modx.tabs.selected=this.tab.classList.contains('selected')?this.tab.previousElementSibling:this.row.querySelector('.selected');this.page.parentNode.removeChild(this.page);this.row.removeChild(this.tab);modx.tabs.selected.show()}},select:function(e){if(e.target.className==='tab-close'){this.close(e)}else if(modx.tabs.selected===this.tab){var s=this;if(this.timer){clearTimeout(this.timer);this.timer=null;w.main.location.reload()}else{this.timer=setTimeout(function(){s.timer=null},250)}}else{this.show()}},setDocPublished:function(){var el=w.main.document.getElementsByName('publishedcheck')[0];if(el){el.checked=this.action===61;w.main.document.getElementsByName('published')[0].value=+el.checked}if(modx.getActionFromUrl(w.main.location.search,3)){w.main.location.reload()}}};if(modx.config.global_tabs){if(typeof a.currentTarget!=='undefined'){var e=a;if(e.button===0&&e.target&&(e.target.tagName==='A'&&e.target.target==='main'||(e.target.parentNode&&e.target.parentNode.tagName==='A'&&e.target.parentNode.target==='main'))){a=e.target.tagName==='A'&&e.target||e.target.parentNode.tagName==='A'&&e.target.parentNode;if(e.shiftKey){modx.openWindow({url:a.href})}else{modx.tabs({url:a.href,title:a.innerHTML})}e.preventDefault()}}else{return new Tabs(a)}}else if(a.url){if(w.main){w.main.frameElement.src=a.url}else{modx.openWindow(a.url)}}},popup:function(a){if(typeof a==='object'&&(a.url||a.content||a.text)){var o={addclass:'',animation:'fade',content:a.content||a.text||'',clickclose:0,closeall:0,data:'',dataType:'document',delay:5000,draggable:!1,event:null,height:'auto',hide:1,hover:1,icon:'',iframe:'iframe',margin:'.5rem',maxheight:'',method:'GET',overlay:0,overlayclose:0,position:'center',resize:!1,selector:'',showclose:1,target:'main',uid:'',type:'default',title:'',url:'',width:'20rem',wrap:w.main.document.body,zIndex:10500,w:null,show:function(){if(~o.position.indexOf('center')){if(o.event){o.el.style.left=o.event.clientX+o.mt+'px';o.el.style.bottom=o.w.innerHeight-o.el.offsetHeight-o.event.clientY+o.mt+'px'}else{o.el.style.left=/(%)/.test(o.width)?(100-parseInt(o.width))/2-o.mt/(o.w.innerWidth/100)+'%':(o.w.innerWidth-o.el.offsetWidth)/2-o.mt+'px';o.el.style.bottom=/(%)/.test(o.height)?(100-parseInt(o.height))/2-o.mt/(o.w.innerHeight/100)+'%':(o.w.innerHeight-o.el.offsetHeight-o.wrap.offsetTop)/2-o.mt+'px'}}if(~o.position.indexOf('left')){o.el.style.left=0}if(~o.position.indexOf('right')){o.el.style.right=0}else{o.el.style.right='auto'}if(~o.position.indexOf('top')){o.el.style.top=0;o.el.style.bottom=''}else{o.el.style.top='auto'}if(~o.position.indexOf('bottom')){o.el.style.bottom=0}o.calc();o.el.className+=' in';if(o.showclose){o.el.querySelector('.close').onclick=o.close}if(o.hide){o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);o.close()},o.delay)}if(o.hover){o.el.onmouseenter=function(){clearTimeout(o.el.timer)};o.el.onmouseleave=o.close}if(o.overlayclose&&o.o){o.o.onclick=o.close}if(o.clickclose){o.el.onclick=o.close}if(o.draggable){modx.dragging(o.el,{wrap:o.wrap,resize:o.resize})}},close:function(e){o.event=e||o.event||w.event;if(o.url&&o.iframe==='iframe'){var els=o.wrap.ownerDocument.querySelectorAll('.'+o.className+'.in');if(els){var documentDirty=o.el.lastElementChild.firstElementChild.contentWindow.documentDirty;if(documentDirty&&confirm(o.el.lastElementChild.firstElementChild.contentWindow.checkDirt(o.event))||!documentDirty){o.el.classList.remove('in');if(!o.animation){o.el.classList.remove('show')}o.calc(1);if(o.o&&o.o.parentNode){o.o.parentNode.removeChild(o.o);o.wrap.style.overflow=''}o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);if(o.el.parentNode){o.el.parentNode.removeChild(o.el)}},200)}}}else{o.el.classList.remove('in');if(!o.animation){o.el.classList.remove('show')}o.calc(1);if(o.o&&o.o.parentNode){o.o.parentNode.removeChild(o.o);o.wrap.style.overflow=''}o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);if(o.el.parentNode){o.el.parentNode.removeChild(o.el)}},200)}if(typeof o.onclose==='function'){o.onclose(e,o.el)}},calc:function(f){var els=o.wrap.ownerDocument.querySelectorAll('.'+o.className+'.in[data-position="'+o.el.dataset.position+'"]');if(els&&els.length){o.els=[];for(var i=0;i×
    '}if(o.title){o.header=document.createElement('div');if(o.icon!=='none'){o.header.innerHTML+=''}o.header.innerHTML+=o.title;o.header.className='evo-popup-header';o.el.appendChild(o.header)}o.el.innerHTML+='
    ';o.wrap.appendChild(o.el);o.mt=parseFloat(getComputedStyle(o.el).marginTop);if(o.maxheight){o.maxheight=/(%)/.test(o.maxheight)?(o.w.innerHeight-o.el.offsetHeight-o.mt)/100*parseInt(o.maxheight):o.maxheight;o.el.lastChild.style.overflowY='auto';o.el.lastChild.style.maxHeight=o.maxheight+'px'}if(o.url){o.draggable=1;if(o.iframe==='iframe'){o.resize=1;o.uid=modx.urlToUid(a.url);o.el.className+=' '+o.addclass+' '+o.className+'-iframe';o.el.id='evo-popup-'+o.uid;d.getElementById('mainloader').className='show';o.frame=d.createElement('iframe');o.frame.width='100%';o.frame.height='100%';o.frame.frameBorder='0';o.frame.src=o.url;o.frame.onload=function(e){e.target.contentWindow.opener=o.w;a.url=e.target.contentWindow.location.href;o.uid=modx.urlToUid(a.url);o.event=e;if(!!e.target.contentWindow.__alertQuit){modx.popup({type:'warning',title:'MODX :: Alert',position:'top center alertQuit',content:e.target.contentWindow.document.body.querySelector('p').innerHTML});e.target.contentWindow.document.body.innerHTML='';e.target.contentWindow.alert=function(){}}else{if(modx.getActionFromUrl(a.url,2)||o.wrap.querySelectorAll('#evo-popup-'+o.uid).length>1){o.el.close()}else{if(e.target.contentDocument.querySelectorAll('h1')[0]){a.title=e.target.contentDocument.querySelectorAll('h1')[0].innerHTML}else if(e.target.contentDocument.title){a.title=e.target.contentDocument.title}if(o.header){e.target.offsetParent.offsetParent.getElementsByClassName(o.header.className)[0].innerHTML=a.title}e.target.offsetParent.offsetParent.id='evo-popup-'+o.uid;e.target.offsetParent.offsetParent.classList.remove('changed')}}e.target.contentWindow.close=o.close;modx.main.stopWork()};o.el.lastChild.appendChild(o.frame);o.show()}else{var xhr=new XMLHttpRequest();xhr.open(o.method,o.url,true);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');xhr.setRequestHeader('X-REQUESTED-WITH','XMLHttpRequest');if(o.dataType){xhr.responseType=o.dataType}xhr.onload=function(){if(this.readyState===4){o.el.className+=' '+o.className+'-ajax';if(o.dataType==='document'){if(o.selector){var r=this.response.documentElement.querySelector(o.selector);if(r){o.el.lastChild.innerHTML+=r.innerHTML}}else{o.el.lastChild.innerHTML+=this.response.body.innerHTML}}else{o.el.lastChild.innerHTML+=this.response}o.show()}};xhr.send(o.data)}}else{o.el.lastChild.innerHTML+=o.content;o.show()}}return o}},getWindowDimension:function(){var a=0,b=0,c=d.documentElement,e=d.body;if(typeof(w.innerWidth)==='number'){a=w.innerWidth;b=w.innerHeight}else if(c&&(c.clientWidth||c.clientHeight)){a=c.clientWidth;b=c.clientHeight}else if(e&&(e.clientWidth||e.clientHeight)){a=e.clientWidth;b=e.clientHeight}return{'width':a,'height':b}},hideDropDown:function(e){e=e||w.event||w.main.event;if(tree.ca==='open'||tree.ca===''){modx.tree.setSelectedByContext()}if(modx.tree.ctx!==null){d.getElementById(modx.frameset).removeChild(modx.tree.ctx);modx.tree.ctx=null}if(!/dropdown\-item/.test(e.target.className)){var els=d.querySelectorAll('.dropdown.show'),n=null,t=e.target||e.target.parentNode,i;if(typeof t.dataset.toggle!=='undefined'){n=d.querySelector(t.dataset.toggle)}else if(t.classList.contains('dropdown-toggle')){n=t.offsetParent}for(i=0;i';if(this.classDrag)this.el.classList.add(this.classDrag);if(this.classResize)this.el.classList.add(this.classResize);this.el.insertBefore(this.borders,this.el.firstChild);if(this.handler&&this.el.getElementsByClassName(this.handler)[0]){this.handler=this.el.getElementsByClassName(this.handler)[0];this.handlerHeight=this.handler.offsetHeight}this.el.onmousedown=function(e){s.mousedown(e)};this.el.ontouchstart=function(e){s.mousedown(e.changedTouches[0])};this.wrap.addEventListener('mousemove',function(e){s.calc(e)},false);this.wrap.addEventListener('touchmove',function(e){s.calc(e.changedTouches[0])},false)};this.dragging.init.prototype={mousedown:function(e){if(e.target.classList.contains('close')){return}e=document.all?window.event:e;var s=this,x=document.all?window.event.clientX:e.clientX,y=document.all?window.event.clientY:e.clientY,style=w.getComputedStyle(this.el);this.elmX=(x-this.el.offsetLeft+parseInt(style.marginLeft));this.elmY=(y-this.el.offsetTop+parseInt(style.marginTop));this.el.position=this.el.getBoundingClientRect();this.el.style.position='fixed';this.el.style.transitionDuration='0s';this.el.style.webkitTransitionDuration='0s';this.el.style.left=this.el.offsetLeft-parseInt(style.marginLeft)+'px';this.el.style.top=this.el.offsetTop-parseInt(style.marginTop)+'px';this.el.style.right='auto';this.el.style.bottom='auto';this.el.style.width=this.el.position.width+'px';this.el.style.height=this.el.position.height+'px';if(e.target.parentNode===this.borders){this.isresize=this.resize;this.el.classList.add('is-resize')}else{if(!this.handler||(this.handler&&e.target===this.handler)){this.isdrag=true;this.el.classList.add('is-drag')}}if(typeof this.start==='function'){this.onstart(e,this.el)}if(e.preventDefault){e.preventDefault()}else{document.onselectstart=function(){return false}}this.wrap.onmousemove=function(e){s.mousemove(e)};this.wrap.ontouchmove=function(e){s.mousemove(e.changedTouches[0]);e.stopPropagation()};this.wrap.onmouseup=function(e){s.mouseup(e)};this.wrap.ontouchend=function(e){s.mouseup(e.changedTouches[0]);e.stopPropagation()}},mousemove:function(e){var x=document.all?window.event.clientX:e.clientX,y=document.all?window.event.clientY:e.clientY;if(this.isresize){if(this.onRight)this.el.style.width=Math.max(x-this.el.position.left+(this.el.position.width-this.x),this.minWidth)+'px';if(this.onBottom)this.el.style.height=Math.max(y-this.el.position.top+(this.el.position.height-this.y),this.minHeight)+'px';if(this.onLeft){this.width=Math.max(this.el.position.left-x+this.el.position.width+this.x,this.minWidth);if(this.width>this.minWidth){this.el.style.width=this.width+'px';this.el.style.left=x-this.elmX+'px'}}if(this.onTop){var currentHeight=Math.max(this.el.position.top-y+this.el.position.height+this.y,this.minHeight);if(currentHeight>this.minHeight){this.el.style.height=currentHeight+'px';this.el.style.top=y-this.elmY+'px'}}if(typeof this.onresize==='function'){this.onresize(e,this.el)}}else if(this.isdrag){this.el.style.opacity=this.opacity;this.el.style.left=x-this.elmX+'px';this.el.style.top=y-this.elmY+'px';if(typeof this.drag==='function'){this.ondrag(e,this.el)}}},mouseup:function(e){if(this.isdrag||this.isresize){this.el.classList.remove('is-resize');this.el.classList.remove('is-drag');this.el.style.opacity='';this.el.style.transitionDuration='';this.el.style.webkitTransitionDuration='';this.el.position=this.el.getBoundingClientRect();this.isdrag=false;this.isresize=false;this.wrap.onmousemove=null;this.wrap.onselectstart=null;if(typeof this.stop==='function'){this.onstop(e,this.el)}}},calc:function(e){if(this.isresize||this.isdrag){return}this.x=e.clientX-this.el.offsetLeft;this.y=e.clientY-this.el.offsetTop;if(this.resize){this.onTop=this.y=this.el.offsetWidth-this.border;this.onBottom=this.y>=this.el.offsetHeight-this.border;if(this.onRight&&this.onBottom||this.onLeft&&this.onTop){this.el.style.cursor='nwse-resize'}else if(this.onRight&&this.onTop||this.onBottom&&this.onLeft){this.el.style.cursor='nesw-resize'}else if(this.onRight||this.onLeft){this.el.style.cursor='ew-resize'}else if(this.onBottom||this.onTop){this.el.style.cursor='ns-resize'}else if(this.x>0&&this.y>0&&(this.x=this.border)){this.el.style.cursor='move'}else{this.el.style.cursor='default'}}else{if(this.x>0&&this.y>0&&(this.x=this.border)){this.el.style.cursor='move'}}}};return new this.dragging.init(a,b)},setTypeIcon:function(a){var b='';switch(this.typesactions[a]){case 1:b='fa fa-newspaper-o';break;case 2:b='fa fa-list-alt';break;case 3:b='fa fa-th-large';break;case 4:b='fa fa-code';break;case 5:b='fa fa-plug';break;case 6:b='fa fa-cube';break;case 7:b='fa fa-pencil-square-o';break;default:b='fa fa-circle'}return b}});w.mainMenu={};w.mainMenu.stopWork=function(){modx.main.stopWork()};w.mainMenu.work=function(){modx.main.work()};w.mainMenu.reloadtree=function(){if(modx.plugins.ElementsInTree){setTimeout('reloadElementsInTree()',50)}if(modx.config.global_tabs){setTimeout('modx.tree.restoreTree()',100)}};w.mainMenu.startrefresh=function(a){if(a===1){}if(a===2){}if(a===9){modx.tree.restoreTree()}if(a===10){w.location.href=modx.MODX_MANAGER_URL}};w.mainMenu.startmsgcount=function(a,b,c){modx.updateMail(c)};w.mainMenu.hideTreeFrame=function(){modx.resizer.setWidth(0)};w.mainMenu.defaultTreeFrame=function(){modx.resizer.setDefaultWidth()};w.tree={};w.tree.ca='open';w.tree.document=document;w.tree.saveFolderState=function(){};w.tree.updateTree=function(){modx.tree.updateTree()};w.tree.restoreTree=function(){modx.tree.restoreTree()};w.tree.resizeTree=function(){};w.onbeforeunload=function(){var a=w.main.frameElement.contentWindow;if(modx.getActionFromUrl(a.location.search,27)){modx.get(modx.MODX_MANAGER_URL+'?a=67&type=7&id='+modx.main.getQueryVariable('id',a.location.search.substring(1)))}};d.addEventListener('DOMContentLoaded',function(){modx.init()})})(typeof jQuery!=='undefined'?jQuery:'',window,document,undefined);(function(){if(!Element.prototype.closest){Element.prototype.closest=function(a){var b=this,c,d;['matches','webkitMatchesSelector','mozMatchesSelector','msMatchesSelector','oMatchesSelector'].some(function(fn){if(typeof document.body[fn]==='function'){c=fn;return true}return false});if(b&&c&&b[c](a))return b;while(b){d=b.parentElement;if(d&&c&&d[c](a))return d;b=d}return null}}})(); \ No newline at end of file +(function($,w,d,u){'use strict';modx.extended({frameset:'frameset',minWidth:840,isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),typesactions:{'16':1,'301':2,'78':3,'22':4,'102':5,'108':6,'3':7,'4':7,'6':7,'27':7,'61':7,'62':7,'63':7,'72':7},tabsTimer:0,popupTimer:0,init:function(){if(!localStorage.getItem('MODX_widthSideBar')){localStorage.setItem('MODX_widthSideBar',this.config.tree_width)}this.mainmenu.init();if(w.location.hash){if(modx.getActionFromUrl(w.location.hash,2)){w.history.replaceState(null,d.title,modx.MODX_MANAGER_URL)}else if(modx.getActionFromUrl(w.location.hash)||modx.main.getQueryVariable('filemanager',w.location.hash)){var url=modx.main.getQueryVariable('filemanager',w.location.hash)?modx.MODX_MANAGER_URL+modx.main.getQueryVariable('filemanager',w.location.hash)+w.location.hash.replace('#?','?'):w.location.href.replace('#?','?');if(modx.config.global_tabs){modx.tabs({url:url,title:'blank'})}else if(w.main){w.main.frameElement.src=url}else{modx.openWindow(url)}}}this.resizer.init();this.search.init();if(this.config.session_timeout>0){w.setInterval(this.keepMeAlive,1000*60*this.config.session_timeout)}if(modx.config.mail_check_timeperiod>0&&modx.permission.messages){setTimeout('modx.updateMail(true)',1000)}d.addEventListener('click',this.hideDropDown,false);if(modx.config.global_tabs){d.addEventListener('click',this.tabs,false);this.tabs({url:'?a=2',reload:0})}},mainmenu:{id:'mainMenu',init:function(){var $mm=$('#mainMenu'),mm=d.getElementById('mainMenu'),timer;$mm.on('click','a',function(e){if($(this).hasClass('dropdown-toggle')){if($mm.hasClass('show')&&($(this).hasClass('selected')||!modx.isMobile&&$(this).parent().hasClass('hover'))){$(this).removeClass('selected');$mm.removeClass('show')}else{$('.nav > li > a:not(:hover)').removeClass('selected');$(this).addClass('selected');$mm.addClass('show')}e.stopPropagation();e.target.dataset.toggle='#mainMenu';modx.hideDropDown(e)}if($(this).closest('ul').hasClass('dropdown-menu')&&!$(this).parent('li').hasClass('dropdown-back')){$('.nav > .active').removeClass('active');$('.nav li.selected').removeClass('selected');$(this).closest('.nav > li').addClass('active');if(this.offsetParent.id){d.getElementById(this.offsetParent.id.substr(7)).classList.add('selected')}if((modx.isMobile||w.innerWidth li',function(){var els=mm.querySelectorAll('.nav > li.hover:not(:hover)');for(var i=0;i li li',function(e){var self=this,ul;var els=mm.querySelectorAll('.nav > li li.hover:not(:hover)');for(var i=0;i'+modx.lang.paging_prev+''+data}ul.id='parent_'+self.id;ul.innerHTML=data;var id=w.location.hash.substr(2).replace(/=/g,'_').replace(/&/g,'__');var el=d.getElementById(id);if(el){el.parentNode.classList.add('selected');d.getElementById(el.parentNode.parentNode.id.substr(7)).classList.add('selected')}for(var i=0;iitems.length-1){index=items.length-1}if(index>=0&&index2){s.timer=setTimeout(function(){s.loader.style.display='block';modx.get(modx.MODX_MANAGER_URL+'?a=71&ajax=1&submitok=Search&searchid='+s.input.value,function(data){s.loader.style.display='none';s.results=data.querySelector('.ajaxSearchResults');if(s.results&&s.results.innerHTML!==''){s.result.innerHTML=s.results.outerHTML;s.open();s.result.onclick=function(e){var t=e.target,p=t.parentNode;if(t.tagName==='I'){modx.openWindow({title:p.innerText,id:p.id,url:p.href});e.preventDefault();e.stopPropagation()}else{var a=t.tagName==='A'&&t||p.tagName==='A'&&p;if(a){var el=s.result.querySelector('.selected');if(el)el.className='';a.className='selected';if(modx.isMobile)s.close()}}}}else{s.empty()}},'document')},300)}else{s.empty()}};if(modx.isMobile){this.input.onblur=this.close}this.input.onfocus=this.open;this.input.onclick=this.open;this.input.onmouseenter=this.open;this.result.onmouseenter=this.open;this.result.onmouseleave=this.close;this.mask.onmouseenter=this.open;this.mask.onmouseleave=this.close},open:function(){if(modx.search.results){modx.search.result.classList.add('open')}},close:function(){modx.search.result.classList.remove('open')},empty:function(){modx.search.result.classList.remove('open');modx.search.result.innerHTML=''}},main:{id:'main',idFrame:'mainframe',as:null,onload:function(e){w.main=e.target.contentWindow||e.target.defaultView;modx.main.tabRow.init();modx.main.stopWork();modx.main.scrollWork();w.main.document.addEventListener('click',modx.hideDropDown,false);w.main.document.addEventListener('contextmenu',modx.main.oncontextmenu,false);if(modx.config.global_tabs){w.main.document.addEventListener('click',modx.tabs,false)}w.history.replaceState(null,d.title,modx.getActionFromUrl(w.main.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.main.location.search);setTimeout('modx.tree.restoreTree()',100)},oncontextmenu:function(e){if(e.ctrlKey)return;var el=e.target;if(modx.user.role===1&&/modxtv|modxplaceholder|modxattributevalue|modxchunk|modxsnippet|modxsnippetnocache/i.test(el.className)){var id=Date.now(),name=el.innerText.replace(/[\[|\]|{|}|\*||\#|\+|?|\!|&|=|`|:]/g,''),type=el.className.replace(/cm-modx/,''),n=!!name.replace(/^\d+$/,'');if(name&&n){e.preventDefault();modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',{a:'modxTagHelper',name:name,type:type},function(r){if(r){r=JSON.parse(r);for(var k in r){if(r.hasOwnProperty(k)&&r[k].url){r[k]['onclick']='if(event.shiftKey){modx.openWindow({url:\''+r[k].url+'\'})}else{modx.popup({url:\''+r[k].url+'\',title:\''+r.header.innerHTML+'\',width:\'95%\',height:\'95%\',margin:0,hide:0,hover:0,overlay:1,overlayclose:0,position:\'center elements\',animation:0,icon:\'none\'})}'}}r=JSON.stringify(r);el.id='node'+id;el.dataset.contextmenu=r;modx.tree.showPopup(e,id,name)}})}e.preventDefault()}},tabRow:{init:function(){var row=w.main.document.querySelector('.tab-pane > .tab-row');if(row)this.build(row)},build:function(row){var rowContainer=d.createElement('div'),sel=row.querySelector('.selected');rowContainer.className='tab-row-container';row.parentNode.insertBefore(rowContainer,row);rowContainer.appendChild(row);var p=d.createElement('i');p.className='fa fa-angle-left prev disable';p.onclick=function(e){e.stopPropagation();e.preventDefault();var sel=row.querySelector('.selected');if(sel.previousSibling){sel.previousSibling.click();modx.main.tabRow.scroll(row)}};rowContainer.appendChild(p);var n=d.createElement('i');n.className='fa fa-angle-right next disable';n.onclick=function(e){e.stopPropagation();e.preventDefault();var sel=row.querySelector('.selected');if(sel.nextSibling){sel.nextSibling.click();modx.main.tabRow.scroll(row)}};rowContainer.appendChild(n);setTimeout(function(){sel=row.querySelector('.selected');modx.main.tabRow.scroll(row,sel);w.main.addEventListener('resize',function(){modx.main.tabRow.scroll(row)},false);if(sel){if(sel.previousSibling)p.classList.remove('disable');if(sel.nextSibling)n.classList.remove('disable')}},100);row.onclick=function(e){var sel=e.target.tagName==='H2'?e.target:e.target.tagName==='SPAN'?e.target.parentNode:null;if(sel){if(sel.previousSibling){this.parentNode.querySelector('i.prev').classList.remove('disable')}else{this.parentNode.querySelector('i.prev').classList.add('disable')}if(sel.nextSibling){this.parentNode.querySelector('i.next').classList.remove('disable')}else{this.parentNode.querySelector('i.next').classList.add('disable')}modx.main.tabRow.scroll(this,sel)}}},scroll:function(row,sel,a){sel=sel||row.querySelector('.selected')||row.firstChild;a=a||100;var c=0,elms=row.childNodes;for(var i=0;isel.offsetLeft){$(row).animate({scrollLeft:sel.offsetLeft-(sel.previousSibling?30:1)},a)}if(sel.offsetLeft+sel.offsetWidth>row.offsetWidth+row.scrollLeft){$(row).animate({scrollLeft:sel.offsetLeft-row.offsetWidth+sel.offsetWidth+(sel.nextSibling?30:0)},a)}if(c>row.offsetWidth){this.drag(row)}},drag:function(row){row.onmousedown=function(e){if(e.button===0){e.preventDefault();var x=e.clientX,f=row.scrollLeft;row.ownerDocument.body.focus();row.onmousemove=row.ownerDocument.onmousemove=function(e){if(Math.abs(e.clientX-x)>5){e.stopPropagation();row.scrollLeft=f-(e.clientX-x);row.ownerDocument.body.classList.add('drag')}};row.onmouseup=row.ownerDocument.onmouseup=function(e){e.stopPropagation();row.onmousemove=null;row.ownerDocument.onmousemove=null;row.ownerDocument.body.classList.remove('drag')}}}}},work:function(){d.getElementById('mainloader').classList.add('show')},stopWork:function(){d.getElementById('mainloader').classList.remove('show')},scrollWork:function(){var a=w.main.frameElement.contentWindow,b=a.location.search.substring(1)||a.location.hash.substring(2),c=localStorage.getItem('page_y')||0,f=localStorage.getItem('page_url')||b;if(((modx.getActionFromUrl(f)===modx.getActionFromUrl(b))&&(modx.main.getQueryVariable('id',f)&&modx.main.getQueryVariable('id',f)===modx.main.getQueryVariable('id',b)))||(f===b)){a.scrollTo(0,c)}a.addEventListener('scroll',function(){if(this.pageYOffset>=0){localStorage.setItem('page_y',this.pageYOffset.toString());localStorage.setItem('page_url',b)}},false)},getQueryVariable:function(a,b){var f='';if(b||typeof b==='string'){b=b.split('?');b=b[1]||b[0];b=b.split('&');for(var i=0;iMath.abs(ay)&&this.swipe){if(ax<0&&this.sidebar){if(Math.abs(ax)>h)ax=-h;tree.style.transform='translate3d('+ax+'px, 0, 0)';tree.style.WebkitTransform='translate3d('+ax+'px, 0, 0)';modx.resizer.mask.style.opacity=(0.5-0.5/-h*ax).toFixed(2);if(Math.abs(ax)>h/3){this.swipe='left'}else{this.swipe='right'}}else if(ax>0&&!this.sidebar){if(Math.abs(ax)>h)ax=h;tree.style.transform='translate3d('+ -(h-ax)+'px, 0, 0)';tree.style.WebkitTransform='translate3d('+ -(h-ax)+'px, 0, 0)';modx.resizer.mask.style.opacity=(0.5/h*ax).toFixed(2);if(Math.abs(ax)>h/3){this.swipe='right'}else{this.swipe='left'}}}},false);w.addEventListener('touchend',function(){if(this.swipe==='left'){d.body.classList.add('sidebar-closed');modx.resizer.setWidth(0)}if(this.swipe==='right'){d.body.classList.remove('sidebar-closed');modx.resizer.setWidth(h)}tree.style.cssText='';modx.resizer.mask.style.cssText=''},false)}},onMouseDown:function(e){e=e||w.event;modx.resizer.dragElement=e.target!==null?e.target:e.srcElement;if((e.buttons===1||e.button===0)&&modx.resizer.dragElement.id===modx.resizer.id){modx.resizer.oldZIndex=modx.resizer.dragElement.style.zIndex;modx.resizer.dragElement.style.zIndex=modx.resizer.newZIndex;modx.resizer.dragElement.style.background=modx.resizer.background;localStorage.setItem('MODX_widthSideBar',modx.resizer.dragElement.offsetLeft>0?modx.resizer.dragElement.offsetLeft:0);d.body.appendChild(modx.resizer.mask);d.onmousemove=modx.resizer.onMouseMove;d.body.focus();d.body.classList.add('resizer_move');d.onselectstart=function(){return false};modx.resizer.dragElement.ondragstart=function(){return false};return false}},onMouseMove:function(e){e=e||w.event;if(e.clientX>0){modx.resizer.left=e.clientX}else{modx.resizer.left=0}modx.resizer.dragElement.style.left=modx.pxToRem(modx.resizer.left)+'rem';d.getElementById('tree').style.width=modx.pxToRem(modx.resizer.left)+'rem';d.getElementById('main').style.left=modx.pxToRem(modx.resizer.left)+'rem';if(e.clientX<-2||e.clientY<-2){modx.resizer.onMouseUp(e)}},onMouseUp:function(e){if(modx.resizer.dragElement!==null&&e.button===0&&modx.resizer.dragElement.id===modx.resizer.id){if(e.clientX>0){d.body.classList.remove('sidebar-closed');modx.resizer.left=e.clientX}else{d.body.classList.add('sidebar-closed');modx.resizer.left=0}d.cookie='MODX_widthSideBar='+modx.pxToRem(modx.resizer.left);modx.resizer.dragElement.style.zIndex=modx.resizer.oldZIndex;modx.resizer.dragElement.style.background='';modx.resizer.dragElement.ondragstart=null;modx.resizer.dragElement=null;d.body.classList.remove('resizer_move');d.body.removeChild(modx.resizer.mask);d.onmousemove=null;d.onselectstart=null}},toggle:function(){if(modx.isMobile||w.innerWidth<=modx.minWidth){if(d.body.classList.contains('sidebar-closed')){d.body.classList.remove('sidebar-closed');localStorage.setItem('MODX_widthSideBar',0);d.cookie='MODX_widthSideBar='+modx.pxToRem(parseInt(d.getElementById('tree').offsetWidth))}else{localStorage.setItem('MODX_widthSideBar',parseInt(d.getElementById('tree').offsetWidth));d.body.classList.add('sidebar-closed');d.cookie='MODX_widthSideBar=0'}}else{var p=d.getElementById('tree').offsetWidth!==0?0:parseInt(localStorage.getItem('MODX_widthSideBar'))?parseInt(localStorage.getItem('MODX_widthSideBar')):modx.config.tree_width;modx.resizer.setWidth(p)}},setWidth:function(a){if(a>0){localStorage.setItem('MODX_widthSideBar',0);d.body.classList.remove('sidebar-closed')}else{localStorage.setItem('MODX_widthSideBar',parseInt(d.getElementById('tree').offsetWidth));d.body.classList.add('sidebar-closed')}d.cookie='MODX_widthSideBar='+modx.pxToRem(a);d.getElementById('tree').style.width=modx.pxToRem(a)+'rem';d.getElementById('resizer').style.left=modx.pxToRem(a)+'rem';d.getElementById('main').style.left=modx.pxToRem(a)+'rem'},setDefaultWidth:function(){modx.resizer.setWidth(modx.remToPx(modx.config.tree_width))}},tree:{ctx:null,rpcNode:null,itemToChange:'',selectedObjectName:null,selectedObject:0,selectedObjectDeleted:0,selectedObjectUrl:'',drag:false,deleted:[],init:function(){this.restoreTree()},draggable:function(){if(modx.permission.dragndropdocintree){var els=d.querySelectorAll('#treeRoot a:not(.empty)');for(var i=0;i-1:true;modx.tree.itemToChange=this.dataset.id||this.parentNode.id.replace('node','');modx.tree.selectedObjectName=this.dataset.titleEsc;if(draggable){this.parentNode.draggable=true;this.parentNode.ondragstart=modx.tree.ondragstart}else{this.parentNode.draggable=false;this.parentNode.ondragstart=function(){return false}}}},ondragstart:function(e){e.dataTransfer.effectAllowed='all';e.dataTransfer.dropEffect='all';e.dataTransfer.setData('text',this.id.substr(4))},ondragenter:function(e){if(d.getElementById('node'+modx.tree.itemToChange)===(this.parentNode.closest('#node'+modx.tree.itemToChange)||this.parentNode)){this.parentNode.className='';e.dataTransfer.effectAllowed='none';e.dataTransfer.dropEffect='none';modx.tree.drag=false}else{this.parentNode.className='dragenter';e.dataTransfer.effectAllowed='copy';e.dataTransfer.dropEffect='copy';modx.tree.drag=true}e.preventDefault()},ondragover:function(e){if(modx.tree.drag){var a=e.clientY;var b=parseInt(this.getBoundingClientRect().top);var c=a-b;if(c>this.offsetHeight/1.51){this.parentNode.classList.add('dragafter');this.parentNode.classList.remove('dragbefore');this.parentNode.classList.remove('dragenter');e.dataTransfer.effectAllowed='link';e.dataTransfer.dropEffect='link'}else if(c'}if(this.nextSibling){if(this.nextSibling.innerHTML){this.nextSibling.appendChild(el)}else{el.parentNode.removeChild(el)}els=this.parentNode.lastChild.children;for(i=0;i'}this.parentNode.parentNode.insertBefore(el,this.parentNode.nextSibling);els=this.parentNode.parentNode.children;for(i=0;i'}this.parentNode.parentNode.insertBefore(el,this.parentNode);els=this.parentNode.parentNode.children;for(i=0;i-1:true)){alert(modx.lang.error_no_privileges);modx.tree.restoreTree();return}modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',{a:'movedocument',id:id,parent:parent,menuindex:menuindex},function(r){if(r.errors)alert(r.errors);modx.tree.restoreTree()},'json');var b=w.main.frameElement.contentWindow.location.search.substr(1);if(modx.getActionFromUrl(b,27)&&parseInt(modx.main.getQueryVariable('id',b))===parseInt(id)){var index=menuindex.indexOf(id),elMenuIndex=w.main.document.querySelector('#documentPane input[name=menuindex]'),elParent=w.main.document.querySelector('#documentPane input[name=parent]'),elParentName=w.main.document.querySelector('#documentPane #parentName');if(elMenuIndex&&index>=0)elMenuIndex.value=index;if(elParent&&elParentName){elParent.value=parent;elParentName.innerHTML=parent+' ('+d.querySelector('#node'+parent+' > a').dataset.titleEsc+')'}}},toggleNode:function(e,id){e=e||w.event;if(e.ctrlKey)return;e.stopPropagation();var el=d.getElementById('node'+id).firstChild;this.rpcNode=el.nextSibling;var toggle=el.querySelector('.toggle'),icon=el.querySelector('.icon');if(this.rpcNode.innerHTML===''){if(toggle)toggle.innerHTML=el.dataset.iconCollapsed;icon.innerHTML=el.dataset.iconFolderOpen;var rpcNodeText=this.rpcNode.innerHTML,loadText=modx.lang.loading_doc_tree;modx.openedArray[id]=1;if(rpcNodeText===''||rpcNodeText.indexOf(loadText)>0){var folderState=this.getFolderState();d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent='+el.dataset.indent+'&parent='+id+'&expandAll='+el.dataset.expandall+folderState,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})}this.saveFolderState()}else{if(toggle)toggle.innerHTML=el.dataset.iconExpanded;icon.innerHTML=el.dataset.iconFolderClose;delete modx.openedArray[id];this.rpcNode.style.overflow='hidden';$(this.rpcNode.firstChild).animate({marginTop:-this.rpcNode.offsetHeight+'px'},100,function(){this.parentNode.innerHTML=''});this.saveFolderState()}e.preventDefault()},rpcLoadData:function(a){if(this.rpcNode!==null){var el;this.rpcNode.innerHTML=typeof a==='object'?a.responseText:a;this.rpcNode.loaded=true;if(this.rpcNode.firstChild.tagName==='DIV'){if(this.rpcNode.id==='treeRoot'){el=d.getElementById('binFull');if(el){this.showBin(true)}else{this.showBin(false)}}else{this.rpcNode.style.overflow='hidden';this.rpcNode.firstElementChild.style.marginTop=-this.rpcNode.offsetHeight+'px';$(this.rpcNode.firstChild).animate({marginTop:0},100)}d.getElementById('treeloader').classList.remove('visible')}else{el=d.getElementById('loginfrm');if(el){this.rpcNode.parentNode.removeChild(this.rpcNode);w.location.href=modx.MODX_MANAGER_URL}}}},treeAction:function(e,id,title){if(e.ctrlKey)return;var el=d.getElementById('node'+id).firstChild,treepageclick=el.dataset.treepageclick,showchildren=parseInt(el.dataset.showchildren),openfolder=parseInt(el.dataset.openfolder);title=title||el.dataset&&el.dataset.titleEsc;if(tree.ca==='move'){try{this.setSelectedByContext(id);w.main.setMoveValue(id,title)}catch(oException){alert(modx.lang.unable_set_parent)}}if(tree.ca==='open'||tree.ca===''){if(id===0){href='?a=2'}else{var href='';if(!isNaN(treepageclick)&&isFinite(treepageclick)){href='?a='+treepageclick+'&r=1&id='+id+(openfolder===0?this.getFolderState():'')}else{href=treepageclick}if(openfolder===2){if(showchildren!==1){href=''}this.toggleNode(e,id)}}if(href){if(e.shiftKey){w.getSelection().removeAllRanges();modx.openWindow(href);this.restoreTree()}else{modx.tabs({url:modx.MODX_MANAGER_URL+href,title:title+'('+id+')'});if(modx.isMobile)modx.resizer.toggle()}}this.itemToChange=id;this.setSelected(id)}if(tree.ca==='parent'){try{this.setSelectedByContext(id);w.main.setParent(id,title)}catch(oException){alert(modx.lang.unable_set_parent)}}if(tree.ca==='link'){try{this.setSelectedByContext(id);w.main.setLink(id)}catch(oException){alert(modx.lang.unable_set_link)}}e.preventDefault()},showPopup:function(e,id,title){if(e.ctrlKey)return;e.preventDefault();var tree=d.getElementById('tree'),el=d.getElementById('node'+id)||e.target,x=0,y=0;if(el.firstChild&&el.firstChild.dataset&&el.firstChild.dataset.contextmenu){el=el.firstChild}if(el){if(el.dataset.contextmenu){e.target.dataset.toggle='#contextmenu';modx.hideDropDown(e);this.ctx=d.createElement('div');this.ctx.id='contextmenu';this.ctx.className='dropdown-menu';d.getElementById(modx.frameset).appendChild(this.ctx);this.setSelectedByContext(id);var dataJson=JSON.parse(el.dataset.contextmenu);for(var key in dataJson){if(dataJson.hasOwnProperty(key)){var item=d.createElement('div');for(var k in dataJson[key]){if(dataJson[key].hasOwnProperty(k)){if(k.substring(0,2)==='on'){var onEvent=dataJson[key][k];item[k]=function(onEvent){return function(event){eval(onEvent)}}(onEvent)}else{item[k]=dataJson[key][k]}}}if(key.indexOf('header')===0)item.className+=' menuHeader';if(key.indexOf('item')===0)item.className+=' menuLink';if(key.indexOf('seperator')===0||key.indexOf('separator')===0)item.className+=' seperator separator';this.ctx.appendChild(item)}}x=e.clientX>0?e.clientX:e.pageX;y=e.clientY>0?e.clientY:e.pageY;e.view.position=e.view.frameElement?e.view.frameElement.getBoundingClientRect():e.target.offsetParent.getBoundingClientRect();if(e.view.frameElement){x+=e.view.position.left;y+=e.view.frameElement.offsetParent.offsetTop}else{if(e.target.parentNode.parentNode.classList.contains('node')){x+=50}}if(x>e.view.position.width){x=e.view.position.width-this.ctx.offsetWidth}if(y+this.ctx.offsetHeight/2>e.view.position.height){y=e.view.position.height-this.ctx.offsetHeight-5}else if(y-this.ctx.offsetHeight/20?e.clientX:e.pageX;y=e.clientY>0?e.clientY:e.pageY;if(y+ctx.offsetHeight/2>bodyHeight){y=bodyHeight-ctx.offsetHeight-5}else if(y-ctx.offsetHeight/230){this.selectedObjectName=this.selectedObjectName.substr(0,30)+'...'}var f=d.getElementById('nameHolder');f.innerHTML=this.selectedObjectName;el.style.left=a+(modx.config.textdir?'-190':'')+'px';el.style.top=b+'px';el.classList.add('show')},menuHandler:function(a){switch(a){case 1:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=3&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 2:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=27&r=1&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 3:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=4&pid='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 4:if(this.selectedObjectDeleted){alert('"'+this.selectedObjectName+'" '+modx.lang.already_deleted)}else if(confirm('"'+this.selectedObjectName+'"\n\n'+modx.lang.confirm_delete_resource)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=6&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 5:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=51&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 6:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=72&pid='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 7:if(confirm(modx.lang.confirm_resource_duplicate)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=94&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 8:if(d.getElementById('node'+this.itemToChange).firstChild.dataset.deleted){if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_undelete)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=63&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}}else{alert('"'+this.selectedObjectName+'"'+modx.lang.not_deleted)}break;case 9:if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_publish)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=61&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 10:if(this.itemToChange!==modx.config.site_start){if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_unpublish)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=62&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}}else{alert('Document is linked to site_start variable and cannot be unpublished!')}break;case 11:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=56&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 12:w.open(d.getElementById('node'+this.itemToChange).firstChild.dataset.href,'previeWin');break;default:alert('Unknown operation command.')}},setSelected:function(a){var el=d.querySelector('#tree .current');if(el)el.classList.remove('current');if(a){if(typeof a==='object'){a.classList.add('current')}else{el=d.querySelector('#node'+a+'>.node')||d.getElementById('node'+a);if(el)el.classList.add('current')}}},setActiveFromContextMenu:function(a){var el=d.querySelector('#node'+a+'>.node');if(el)this.setSelected(el)},setSelectedByContext:function(a){var el=d.querySelector('#treeRoot .selected');if(el)el.classList.remove('selected');el=d.querySelector('#node'+a+'>.node');if(el)el.classList.add('selected')},setItemToChange:function(){var a=w.main.document&&(w.main.document.URL||w.main.document.location.search),b=modx.getActionFromUrl(a);if(a&&modx.typesactions[b]){this.itemToChange=(modx.typesactions[b]===7?'':modx.typesactions[b]+'_')+parseInt(modx.main.getQueryVariable('id',a))}else{this.itemToChange=''}this.setSelected(this.itemToChange)},restoreTree:function(){if(d.getElementById('treeRoot')){d.getElementById('treeloader').classList.add('visible');this.setItemToChange();this.rpcNode=d.getElementById('treeRoot');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=2&id='+this.itemToChange,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})}},expandTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=1&id='+this.itemToChange,function(r){modx.tree.rpcLoadData(r);modx.tree.saveFolderState();modx.tree.draggable()})},collapseTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=0&id='+this.itemToChange,function(r){modx.openedArray=[];modx.tree.saveFolderState();modx.tree.rpcLoadData(r);modx.tree.draggable()})},updateTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');var a=d.sortFrm;var b='a=1&f=nodes&indent=1&parent=0&expandAll=2&dt='+a.dt.value+'&tree_sortby='+a.sortby.value+'&tree_sortdir='+a.sortdir.value+'&tree_nodename='+a.nodename.value+'&id='+this.itemToChange+'&showonlyfolders='+a.showonlyfolders.value;modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',b,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})},getFolderState:function(){var a;if(modx.openedArray!==[0]){a='&opened=';for(var key in modx.openedArray){if(modx.openedArray[key]){a+=key+'|'}}}else{a='&opened='}return a},saveFolderState:function(){modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&savestateonly=1'+this.getFolderState())},showSorter:function(e){e=e||w.event;var el=d.getElementById('floater');e.target.dataset.toggle='#floater';el.classList.toggle('show');el.onclick=function(e){e.stopPropagation()}},emptyTrash:function(){if(confirm(modx.lang.confirm_empty_trash)===true){modx.get(modx.MODX_MANAGER_URL+'?a=64',function(){modx.tabsClose(modx.tree.deleted);modx.tree.deleted=[];modx.tree.restoreTree()})}},showBin:function(a){var el=d.getElementById('treeMenu_emptytrash');if(el){if(a){el.title=modx.lang.empty_recycle_bin;el.classList.remove('disabled');el.innerHTML=modx.style.empty_recycle_bin;el.onclick=function(){modx.tree.emptyTrash()};var els=d.getElementById('tree').querySelectorAll('.deleted');for(var i=0;i0){if(el){el.innerHTML=c[0];el.style.display='block'}}else{if(el)el.style.display='none'}if(c[1]>0){el=d.getElementById('newMail');if(el){el.innerHTML=''+modx.style.email+modx.lang.inbox+' ('+c[0]+' / '+c[1]+')';el.style.display='block'}}if(modx.config.mail_check_timeperiod>0)setTimeout('modx.updateMail(true)',1000*modx.config.mail_check_timeperiod)})}}catch(oException){setTimeout('modx.updateMail(true)',1000*modx.config.mail_check_timeperiod)}},openWindow:function(a){if(typeof a!=='object'){a={'url':a}}if(!a.width)a.width=parseInt(w.innerWidth*0.9)+'px';if(!a.height)a.height=parseInt(w.innerHeight*0.8)+'px';if(!a.left)a.left=parseInt(w.innerWidth*0.05)+'px';if(!a.top)a.top=parseInt(w.innerHeight*0.1)+'px';if(!a.title)a.title=Math.floor((Math.random()*999999)+1);if(a.url){if(this.plugins.EVOmodal===1){top.EVO.modal.show(a)}else{w.open(a.url,a.title,'width='+a.width+',height='+a.height+',top='+a.top+',left='+a.left+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no')}}},tabsClose:function(a){if(modx.config.global_tabs&&a){for(var k in a){if(a.hasOwnProperty(k)){var el=d.getElementById(a[k]);if(el){el.firstElementChild.contentWindow.documentDirty=false;el.close()}}}}},tabs:function(a){function Tabs(a){var s=this;this.url=a.url;this.title=a.title||'';this.name=a.name||'';this.timer=null;this.olduid='';this.closeactions=[6,61,62,63,94];this.reload=typeof a.reload!=='undefined'?a.reload:1;this.action=modx.getActionFromUrl(a.url);this.uid=modx.getActionFromUrl(a.url,2)?'home':modx.urlToUid(a.url);this.page=d.getElementById('evo-tab-page-'+this.uid);this.row=d.getElementsByClassName('evo-tab-row')[0].firstElementChild;this.tab=d.getElementById('evo-tab-'+this.uid);if(this.page){if(this.uid==='home'){if(this.reload){this.page.firstElementChild.src=this.url;this.show()}else{this.reload=1;if(this.tab.onclick===null){this.tab.onclick=function(e){s.select.call(s,e,this)}}this.tab.show=function(e){s.show.call(s,e)};modx.tabs.selected=this.tab}}else{this.show();if(~this.closeactions.indexOf(this.action)){this.setDocPublished();modx.get(this.url,function(){modx.tree.restoreTree()})}}}else if(~this.closeactions.indexOf(this.action)){modx.get(this.url,function(){modx.tree.restoreTree()})}else{this.create()}}Tabs.prototype={create:function(){var s=this;modx.main.work();modx.tabs.selected=this.row.querySelector('.selected');if(modx.tabs.selected){d.getElementById(modx.tabs.selected.id.replace('tab','tab-page')).classList.remove('show');modx.tabs.selected.classList.remove('selected')}this.page=d.createElement('div');this.page.id='evo-tab-page-'+this.uid;this.page.className='evo-tab-page show';this.page.innerHTML='';d.getElementById('main').appendChild(this.page);console.time('load-tab');this.page.firstElementChild.onload=function(e){s.onload.call(s,e);console.timeEnd('load-tab')};this.tab=d.createElement('h2');this.tab.id='evo-tab-'+this.uid;this.tab.className='tab selected';this.icon='';if(!/'}this.tab.innerHTML=''+this.icon+this.title+'×';this.row.appendChild(this.tab);this.tab.onclick=function(e){s.select.call(s,e,this)};this.tab.close=function(e){s.close.call(s,e)};this.tab.show=function(e){s.show.call(s,e)};this.page.close=function(e){s.close.call(s,e)}},onload:function(e){var s=this;w.main=e.target.contentWindow||e.target.defaultView;this.url=w.main.location.search||w.location.hash.substring(1);this.olduid=this.uid;this.uid=modx.urlToUid(this.url);if(!!w.main.__alertQuit){w.main.alert=function(a){};var message=w.main.document.body.innerHTML;w.main.document.body.innerHTML='';history.pushState(null,d.title,modx.getActionFromUrl(w.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.location.search);w.onpopstate=function(){history.go(1)};modx.popup({type:'warning',title:'MODX :: Alert',position:'top center alertQuit',content:message,wrap:'body'});modx.getLockedElements(modx.getActionFromUrl(this.url),modx.main.getQueryVariable('id',this.url),function(data){if(!!data){s.page.close();modx.tree.restoreTree()}else{w.main.location.href=modx.MODX_MANAGER_URL+s.url;w.history.replaceState(null,d.title,modx.getActionFromUrl(s.url,2)?modx.MODX_MANAGER_URL:'#'+s.url)}})}else{if(modx.getActionFromUrl(this.url,2)){this.close(e)}else if(this.olduid!==this.uid&&d.getElementById('evo-tab-'+this.uid)){this.close(e);d.getElementById('evo-tab-'+this.uid).show()}else{this.title=w.main.document.body.querySelectorAll('h1')[0]&&w.main.document.body.querySelectorAll('h1')[0].innerHTML||this.title;if(this.title&&this.uid!=='home'){this.tab.innerHTML=''+this.title+'×'}this.page.id='evo-tab-page-'+this.uid;this.tab.id='evo-tab-'+this.uid;this.tab.classList.remove('changed');this.show();modx.main.onload(e);w.main.document.addEventListener('click',function a(e){if(typeof e.view.documentDirty!=='undefined'&&e.view.documentDirty&&!s.tab.classList.contains('changed')){s.tab.classList.add('changed');this.removeEventListener(e.type,a,false)}},false);w.main.document.addEventListener('keyup',function a(e){if(typeof e.view.documentDirty!=='undefined'&&e.view.documentDirty&&!s.tab.classList.contains('changed')){s.tab.classList.add('changed');this.removeEventListener(e.type,a,false)}},false)}}},show:function(){var s=this;modx.tabs.selected=this.row.querySelector('.selected');if(modx.tabs.selected&&modx.tabs.selected!==this.tab){d.getElementById(modx.tabs.selected.id.replace('tab','tab-page')).classList.remove('show');modx.tabs.selected.classList.remove('selected')}this.page.classList.add('show');this.tab.classList.add('selected');modx.tabs.selected=this.tab;w.main=this.page.firstElementChild.contentWindow;w.history.replaceState(null,w.main.document.title,modx.getActionFromUrl(w.main.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.main.location.search);modx.tree.setItemToChange();modx.main.tabRow.scroll(this.row,this.tab,350)},close:function(e){var documentDirty=this.page.firstElementChild.contentWindow.documentDirty;var checkDirt=!!this.page.firstElementChild.contentWindow.checkDirt;if(documentDirty&&checkDirt&&confirm(this.page.firstElementChild.contentWindow.checkDirt(e))||!documentDirty){modx.tabs.selected=this.tab.classList.contains('selected')?this.tab.previousElementSibling:this.row.querySelector('.selected');this.page.parentNode.removeChild(this.page);this.row.removeChild(this.tab);modx.tabs.selected.show()}},select:function(e){if(e.target.className==='tab-close'){this.close(e)}else if(modx.tabs.selected===this.tab){var s=this;if(this.timer){clearTimeout(this.timer);this.timer=null;w.main.location.reload()}else{this.timer=setTimeout(function(){s.timer=null},250)}}else{this.show()}},setDocPublished:function(){var el=w.main.document.getElementsByName('publishedcheck')[0];if(el){el.checked=this.action===61;w.main.document.getElementsByName('published')[0].value=+el.checked}if(modx.getActionFromUrl(w.main.location.search,3)){w.main.location.reload()}}};if(modx.config.global_tabs){if(typeof a.currentTarget!=='undefined'){var e=a;if(e.button===0&&e.target&&(e.target.tagName==='A'&&e.target.target==='main'||(e.target.parentNode&&e.target.parentNode.tagName==='A'&&e.target.parentNode.target==='main'))){a=e.target.tagName==='A'&&e.target||e.target.parentNode.tagName==='A'&&e.target.parentNode;if(e.shiftKey){modx.openWindow({url:a.href})}else{modx.tabs({url:a.href,title:a.innerHTML})}e.preventDefault()}}else{return new Tabs(a)}}else if(a.url){if(w.main){w.main.frameElement.src=a.url}else{modx.openWindow(a.url)}}},popup:function(a){if(typeof a==='object'&&(a.url||a.content||a.text)){var o={addclass:'',animation:'fade',content:a.content||a.text||'',clickclose:0,closeall:0,data:'',dataType:'document',delay:5000,draggable:!1,event:null,height:'auto',hide:1,hover:1,icon:'',iframe:'iframe',margin:'.5rem',maxheight:'',method:'GET',overlay:0,overlayclose:0,position:'center',resize:!1,selector:'',showclose:1,target:'main',uid:'',type:'default',title:'',url:'',width:'20rem',wrap:w.main.document.body,zIndex:10500,w:null,show:function(){if(~o.position.indexOf('center')){if(o.event){o.el.style.left=o.event.clientX+o.mt+'px';o.el.style.bottom=o.w.innerHeight-o.el.offsetHeight-o.event.clientY+o.mt+'px'}else{o.el.style.left=/(%)/.test(o.width)?(100-parseInt(o.width))/2-o.mt/(o.w.innerWidth/100)+'%':(o.w.innerWidth-o.el.offsetWidth)/2-o.mt+'px';o.el.style.bottom=/(%)/.test(o.height)?(100-parseInt(o.height))/2-o.mt/(o.w.innerHeight/100)+'%':(o.w.innerHeight-o.el.offsetHeight-o.wrap.offsetTop)/2-o.mt+'px'}}if(~o.position.indexOf('left')){o.el.style.left=0}if(~o.position.indexOf('right')){o.el.style.right=0}else{o.el.style.right='auto'}if(~o.position.indexOf('top')){o.el.style.top=0;o.el.style.bottom=''}else{o.el.style.top='auto'}if(~o.position.indexOf('bottom')){o.el.style.bottom=0}o.calc();o.el.className+=' in';if(o.showclose){o.el.querySelector('.close').onclick=o.close}if(o.hide){o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);o.close()},o.delay)}if(o.hover){o.el.onmouseenter=function(){clearTimeout(o.el.timer)};o.el.onmouseleave=o.close}if(o.overlayclose&&o.o){o.o.onclick=o.close}if(o.clickclose){o.el.onclick=o.close}if(o.draggable){modx.dragging(o.el,{wrap:o.wrap,resize:o.resize})}},close:function(e){o.event=e||o.event||w.event;if(o.url&&o.iframe==='iframe'){var els=o.wrap.ownerDocument.querySelectorAll('.'+o.className+'.in');if(els){var documentDirty=o.el.lastElementChild.firstElementChild.contentWindow.documentDirty;if(documentDirty&&confirm(o.el.lastElementChild.firstElementChild.contentWindow.checkDirt(o.event))||!documentDirty){o.el.classList.remove('in');if(!o.animation){o.el.classList.remove('show')}o.calc(1);if(o.o&&o.o.parentNode){o.o.parentNode.removeChild(o.o);o.wrap.style.overflow=''}o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);if(o.el.parentNode){o.el.parentNode.removeChild(o.el)}},200)}}}else{o.el.classList.remove('in');if(!o.animation){o.el.classList.remove('show')}o.calc(1);if(o.o&&o.o.parentNode){o.o.parentNode.removeChild(o.o);o.wrap.style.overflow=''}o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);if(o.el.parentNode){o.el.parentNode.removeChild(o.el)}},200)}if(typeof o.onclose==='function'){o.onclose(e,o.el)}},calc:function(f){var els=o.wrap.ownerDocument.querySelectorAll('.'+o.className+'.in[data-position="'+o.el.dataset.position+'"]');if(els&&els.length){o.els=[];for(var i=0;i×
    '}if(o.title){o.header=document.createElement('div');if(o.icon!=='none'){o.header.innerHTML+=''}o.header.innerHTML+=o.title;o.header.className='evo-popup-header';o.el.appendChild(o.header)}o.el.innerHTML+='
    ';o.wrap.appendChild(o.el);o.mt=parseFloat(getComputedStyle(o.el).marginTop);if(o.maxheight){o.maxheight=/(%)/.test(o.maxheight)?(o.w.innerHeight-o.el.offsetHeight-o.mt)/100*parseInt(o.maxheight):o.maxheight;o.el.lastChild.style.overflowY='auto';o.el.lastChild.style.maxHeight=o.maxheight+'px'}if(o.url){o.draggable=1;if(o.iframe==='iframe'){o.resize=1;o.uid=modx.urlToUid(a.url);o.el.className+=' '+o.addclass+' '+o.className+'-iframe';o.el.id='evo-popup-'+o.uid;d.getElementById('mainloader').className='show';o.frame=d.createElement('iframe');o.frame.width='100%';o.frame.height='100%';o.frame.frameBorder='0';o.frame.src=o.url;o.frame.onload=function(e){e.target.contentWindow.opener=o.w;a.url=e.target.contentWindow.location.href;o.uid=modx.urlToUid(a.url);o.event=e;if(!!e.target.contentWindow.__alertQuit){modx.popup({type:'warning',title:'MODX :: Alert',position:'top center alertQuit',content:e.target.contentWindow.document.body.querySelector('p').innerHTML});e.target.contentWindow.document.body.innerHTML='';e.target.contentWindow.alert=function(){}}else{if(modx.getActionFromUrl(a.url,2)||o.wrap.querySelectorAll('#evo-popup-'+o.uid).length>1){o.el.close()}else{if(e.target.contentDocument.querySelectorAll('h1')[0]){a.title=e.target.contentDocument.querySelectorAll('h1')[0].innerHTML}else if(e.target.contentDocument.title){a.title=e.target.contentDocument.title}if(o.header){e.target.offsetParent.offsetParent.getElementsByClassName(o.header.className)[0].innerHTML=a.title}e.target.offsetParent.offsetParent.id='evo-popup-'+o.uid;e.target.offsetParent.offsetParent.classList.remove('changed')}}e.target.contentWindow.close=o.close;modx.main.stopWork()};o.el.lastChild.appendChild(o.frame);o.show()}else{var xhr=new XMLHttpRequest();xhr.open(o.method,o.url,true);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');xhr.setRequestHeader('X-REQUESTED-WITH','XMLHttpRequest');if(o.dataType){xhr.responseType=o.dataType}xhr.onload=function(){if(this.readyState===4){o.el.className+=' '+o.className+'-ajax';if(o.dataType==='document'){if(o.selector){var r=this.response.documentElement.querySelector(o.selector);if(r){o.el.lastChild.innerHTML+=r.innerHTML}}else{o.el.lastChild.innerHTML+=this.response.body.innerHTML}}else{o.el.lastChild.innerHTML+=this.response}o.show()}};xhr.send(o.data)}}else{o.el.lastChild.innerHTML+=o.content;o.show()}}return o}},getWindowDimension:function(){var a=0,b=0,c=d.documentElement,e=d.body;if(typeof(w.innerWidth)==='number'){a=w.innerWidth;b=w.innerHeight}else if(c&&(c.clientWidth||c.clientHeight)){a=c.clientWidth;b=c.clientHeight}else if(e&&(e.clientWidth||e.clientHeight)){a=e.clientWidth;b=e.clientHeight}return{'width':a,'height':b}},hideDropDown:function(e){e=e||w.event||w.main.event;if(tree.ca==='open'||tree.ca===''){modx.tree.setSelectedByContext()}if(modx.tree.ctx!==null){d.getElementById(modx.frameset).removeChild(modx.tree.ctx);modx.tree.ctx=null}if(!/dropdown\-item/.test(e.target.className)){var els=d.querySelectorAll('.dropdown.show'),n=null,t=e.target||e.target.parentNode,i;if(typeof t.dataset.toggle!=='undefined'){n=d.querySelector(t.dataset.toggle)}else if(t.classList.contains('dropdown-toggle')){n=t.offsetParent}for(i=0;i';if(this.classDrag)this.el.classList.add(this.classDrag);if(this.classResize)this.el.classList.add(this.classResize);this.el.insertBefore(this.borders,this.el.firstChild);if(this.handler&&this.el.getElementsByClassName(this.handler)[0]){this.handler=this.el.getElementsByClassName(this.handler)[0];this.handlerHeight=this.handler.offsetHeight}this.el.onmousedown=function(e){s.mousedown(e)};this.el.ontouchstart=function(e){s.mousedown(e.changedTouches[0])};this.wrap.addEventListener('mousemove',function(e){s.calc(e)},false);this.wrap.addEventListener('touchmove',function(e){s.calc(e.changedTouches[0])},false)};this.dragging.init.prototype={mousedown:function(e){if(e.target.classList.contains('close')){return}e=document.all?window.event:e;var s=this,x=document.all?window.event.clientX:e.clientX,y=document.all?window.event.clientY:e.clientY,style=w.getComputedStyle(this.el);this.elmX=(x-this.el.offsetLeft+parseInt(style.marginLeft));this.elmY=(y-this.el.offsetTop+parseInt(style.marginTop));this.el.position=this.el.getBoundingClientRect();this.el.style.position='fixed';this.el.style.transitionDuration='0s';this.el.style.webkitTransitionDuration='0s';this.el.style.left=this.el.offsetLeft-parseInt(style.marginLeft)+'px';this.el.style.top=this.el.offsetTop-parseInt(style.marginTop)+'px';this.el.style.right='auto';this.el.style.bottom='auto';this.el.style.width=this.el.position.width+'px';this.el.style.height=this.el.position.height+'px';if(e.target.parentNode===this.borders){this.isresize=this.resize;this.el.classList.add('is-resize')}else{if(!this.handler||(this.handler&&e.target===this.handler)){this.isdrag=true;this.el.classList.add('is-drag')}}if(typeof this.start==='function'){this.onstart(e,this.el)}if(e.preventDefault){e.preventDefault()}else{document.onselectstart=function(){return false}}this.wrap.onmousemove=function(e){s.mousemove(e)};this.wrap.ontouchmove=function(e){s.mousemove(e.changedTouches[0]);e.stopPropagation()};this.wrap.onmouseup=function(e){s.mouseup(e)};this.wrap.ontouchend=function(e){s.mouseup(e.changedTouches[0]);e.stopPropagation()}},mousemove:function(e){var x=document.all?window.event.clientX:e.clientX,y=document.all?window.event.clientY:e.clientY;if(this.isresize){if(this.onRight)this.el.style.width=Math.max(x-this.el.position.left+(this.el.position.width-this.x),this.minWidth)+'px';if(this.onBottom)this.el.style.height=Math.max(y-this.el.position.top+(this.el.position.height-this.y),this.minHeight)+'px';if(this.onLeft){this.width=Math.max(this.el.position.left-x+this.el.position.width+this.x,this.minWidth);if(this.width>this.minWidth){this.el.style.width=this.width+'px';this.el.style.left=x-this.elmX+'px'}}if(this.onTop){var currentHeight=Math.max(this.el.position.top-y+this.el.position.height+this.y,this.minHeight);if(currentHeight>this.minHeight){this.el.style.height=currentHeight+'px';this.el.style.top=y-this.elmY+'px'}}if(typeof this.onresize==='function'){this.onresize(e,this.el)}}else if(this.isdrag){this.el.style.opacity=this.opacity;this.el.style.left=x-this.elmX+'px';this.el.style.top=y-this.elmY+'px';if(typeof this.drag==='function'){this.ondrag(e,this.el)}}},mouseup:function(e){if(this.isdrag||this.isresize){this.el.classList.remove('is-resize');this.el.classList.remove('is-drag');this.el.style.opacity='';this.el.style.transitionDuration='';this.el.style.webkitTransitionDuration='';this.el.position=this.el.getBoundingClientRect();this.isdrag=false;this.isresize=false;this.wrap.onmousemove=null;this.wrap.onselectstart=null;if(typeof this.stop==='function'){this.onstop(e,this.el)}}},calc:function(e){if(this.isresize||this.isdrag){return}this.x=e.clientX-this.el.offsetLeft;this.y=e.clientY-this.el.offsetTop;if(this.resize){this.onTop=this.y=this.el.offsetWidth-this.border;this.onBottom=this.y>=this.el.offsetHeight-this.border;if(this.onRight&&this.onBottom||this.onLeft&&this.onTop){this.el.style.cursor='nwse-resize'}else if(this.onRight&&this.onTop||this.onBottom&&this.onLeft){this.el.style.cursor='nesw-resize'}else if(this.onRight||this.onLeft){this.el.style.cursor='ew-resize'}else if(this.onBottom||this.onTop){this.el.style.cursor='ns-resize'}else if(this.x>0&&this.y>0&&(this.x=this.border)){this.el.style.cursor='move'}else{this.el.style.cursor='default'}}else{if(this.x>0&&this.y>0&&(this.x=this.border)){this.el.style.cursor='move'}}}};return new this.dragging.init(a,b)},setTypeIcon:function(a){var b='';switch(this.typesactions[a]){case 1:b='fa fa-newspaper-o';break;case 2:b='fa fa-list-alt';break;case 3:b='fa fa-th-large';break;case 4:b='fa fa-code';break;case 5:b='fa fa-plug';break;case 6:b='fa fa-cube';break;case 7:b='fa fa-pencil-square-o';break;default:b='fa fa-circle'}return b}});w.mainMenu={};w.mainMenu.stopWork=function(){modx.main.stopWork()};w.mainMenu.work=function(){modx.main.work()};w.mainMenu.reloadtree=function(){if(modx.plugins.ElementsInTree){setTimeout('reloadElementsInTree()',50)}if(modx.config.global_tabs){setTimeout('modx.tree.restoreTree()',100)}};w.mainMenu.startrefresh=function(a){if(a===1){}if(a===2){}if(a===9){modx.tree.restoreTree()}if(a===10){w.location.href=modx.MODX_MANAGER_URL}};w.mainMenu.startmsgcount=function(a,b,c){modx.updateMail(c)};w.mainMenu.hideTreeFrame=function(){modx.resizer.setWidth(0)};w.mainMenu.defaultTreeFrame=function(){modx.resizer.setDefaultWidth()};w.tree={};w.tree.ca='open';w.tree.document=document;w.tree.saveFolderState=function(){};w.tree.updateTree=function(){modx.tree.updateTree()};w.tree.restoreTree=function(){modx.tree.restoreTree()};w.tree.resizeTree=function(){};w.onbeforeunload=function(){var a=w.main.frameElement.contentWindow;if(modx.getActionFromUrl(a.location.search,27)){modx.get(modx.MODX_MANAGER_URL+'?a=67&type=7&id='+modx.main.getQueryVariable('id',a.location.search.substring(1)))}};d.addEventListener('DOMContentLoaded',function(){modx.init()})})(typeof jQuery!=='undefined'?jQuery:'',window,document,undefined);(function(){if(!Element.prototype.closest){Element.prototype.closest=function(a){var b=this,c,d;['matches','webkitMatchesSelector','mozMatchesSelector','msMatchesSelector','oMatchesSelector'].some(function(fn){if(typeof document.body[fn]==='function'){c=fn;return true}return false});if(b&&c&&b[c](a))return b;while(b){d=b.parentElement;if(d&&c&&d[c](a))return d;b=d}return null}}})(); \ No newline at end of file From ec72224a250e8057a35e794488b24c265517266b Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Mon, 26 Mar 2018 18:44:21 +0300 Subject: [PATCH 080/274] [F] MySQL strict mode and Parse Error #580 --- manager/media/style/default/ajax.php | 1 - 1 file changed, 1 deletion(-) diff --git a/manager/media/style/default/ajax.php b/manager/media/style/default/ajax.php index ff354f56a8..5edf15d0be 100755 --- a/manager/media/style/default/ajax.php +++ b/manager/media/style/default/ajax.php @@ -83,7 +83,6 @@ FROM ' . $modx->getFullTableName('site_tmplvars') . ' AS t1 LEFT JOIN ' . $modx->getFullTableName('site_tmplvar_templates') . ' AS t2 ON t1.id=t2.tmplvarid ' . $sqlLike . ' - GROUP BY t1.id ORDER BY t1.name ASC ' . $sqlLimit); From 578992f9716ae90ddebab45d4816012de0a76e68 Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Mon, 26 Mar 2018 19:41:55 +0300 Subject: [PATCH 081/274] Revert "[F] MySQL strict mode and Parse Error #580" This reverts commit ec72224a250e8057a35e794488b24c265517266b. --- manager/media/style/default/ajax.php | 1 + 1 file changed, 1 insertion(+) diff --git a/manager/media/style/default/ajax.php b/manager/media/style/default/ajax.php index 5edf15d0be..ff354f56a8 100755 --- a/manager/media/style/default/ajax.php +++ b/manager/media/style/default/ajax.php @@ -83,6 +83,7 @@ FROM ' . $modx->getFullTableName('site_tmplvars') . ' AS t1 LEFT JOIN ' . $modx->getFullTableName('site_tmplvar_templates') . ' AS t2 ON t1.id=t2.tmplvarid ' . $sqlLike . ' + GROUP BY t1.id ORDER BY t1.name ASC ' . $sqlLimit); From 3c58b46597c0b3299cf331e684c7a2af289ffc9d Mon Sep 17 00:00:00 2001 From: Mr B Date: Mon, 26 Mar 2018 17:44:52 +0100 Subject: [PATCH 082/274] [I] Multiple web user email option To mirror the option available on MODX Revolution: https://forums.modx.com/thread/103109/need-to-add-users-who-have-no-or-duplicate-email-addresses There can be cases when a web user account needs the same email address as another web user --- .../mutate_settings/tab3_user_settings.inc.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/manager/actions/mutate_settings/tab3_user_settings.inc.php b/manager/actions/mutate_settings/tab3_user_settings.inc.php index 95625d00fc..449b38a8da 100755 --- a/manager/actions/mutate_settings/tab3_user_settings.inc.php +++ b/manager/actions/mutate_settings/tab3_user_settings.inc.php @@ -147,5 +147,19 @@ ?> + +
    + + +
    [(allow_multiple_emails)] + +
    + + + + +   + + From 346cc99db8a25e44d05d9e895ba13d282d863fb6 Mon Sep 17 00:00:00 2001 From: Mr B Date: Mon, 26 Mar 2018 17:47:25 +0100 Subject: [PATCH 083/274] Update save_web_user.processor.php --- .../processors/save_web_user.processor.php | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/manager/processors/save_web_user.processor.php b/manager/processors/save_web_user.processor.php index 05c6c0162d..e72bbe3eef 100755 --- a/manager/processors/save_web_user.processor.php +++ b/manager/processors/save_web_user.processor.php @@ -69,10 +69,12 @@ } // check if the email address already exist - $rs = $modx->db->select('count(id)', $tbl_web_user_attributes, "email='{$esc_email}' AND id!='{$id}'"); - $limit = $modx->db->getValue($rs); - if($limit > 0) { - webAlertAndQuit("Email is already in use!"); + if ($modx->config['allow_multiple_emails'] != 1) { + $rs = $modx->db->select('count(id)', $tbl_web_user_attributes, "email='{$esc_email}' AND id!='{$id}'"); + $limit = $modx->db->getValue($rs); + if($limit > 0) { + webAlertAndQuit("Email is already in use!"); + } } // generate a new password for this user @@ -215,10 +217,12 @@ } // check if the email address already exists - $rs = $modx->db->select('count(internalKey)', $tbl_web_user_attributes, "email='{$esc_email}' AND internalKey!='{$id}'"); - $limit = $modx->db->getValue($rs); - if($limit > 0) { - webAlertAndQuit("Email is already in use!"); + if ($modx->config['allow_multiple_emails'] != 1) { + $rs = $modx->db->select('count(internalKey)', $tbl_web_user_attributes, "email='{$esc_email}' AND internalKey!='{$id}'"); + $limit = $modx->db->getValue($rs); + if($limit > 0) { + webAlertAndQuit("Email is already in use!"); + } } // invoke OnBeforeWUsrFormSave event From ff8de422c9cfa1bbc3374a472060aa1deebd56a9 Mon Sep 17 00:00:00 2001 From: Mr B Date: Mon, 26 Mar 2018 17:48:54 +0100 Subject: [PATCH 084/274] Update english.inc.php --- manager/includes/lang/english.inc.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manager/includes/lang/english.inc.php b/manager/includes/lang/english.inc.php index 66211177de..5a149a885d 100755 --- a/manager/includes/lang/english.inc.php +++ b/manager/includes/lang/english.inc.php @@ -1205,6 +1205,8 @@ $_lang["webpwdreminder_title"] = 'Web Reminder Email'; $_lang["websignupemail_message"] = 'Set the email message sent to Users when creating accounts including their username and password
    Note: The following Placeholders are replaced by the Content Manager when the message is sent:

    [+sname+] - Name of your web site,
    [+saddr+] - Your web site email address,
    [+surl+] - Your site url,
    [+uid+] - User\'s Login name or id,
    [+pwd+] - User\'s password,
    [+ufn+] - User\'s full name.

    Leave the [+uid+] and [+pwd+] in the e-mail, or else the username and password won\'t be sent in the mail and your Users won\'t know their username or password!'; $_lang["websignupemail_title"] = 'Web Signup e-mail'; +$_lang["allow_multiple_emails_title"] = 'Duplicate Web User email address'; +$_lang["allow_multiple_emails_message"] = 'Allows Web Users to share the same email address for situations when a member may not have their own email address or there is just one family email address.
    Note: Any password reminder and registration logic will need to account for this option if set to yes.'; $_lang["wednesday"] = 'Wednesday'; $_lang["welcome_messages"] = 'Your Inbox contains %d message(s), of which %s are unread.'; $_lang["welcome_title"] = 'Welcome to your EVO Content Manager'; From 26df2a87a9418689635c54f0b174627590413914 Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Tue, 27 Mar 2018 16:30:22 +0300 Subject: [PATCH 085/274] fix --- manager/includes/default_config.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manager/includes/default_config.php b/manager/includes/default_config.php index 69968ba7dc..bcc59b8451 100755 --- a/manager/includes/default_config.php +++ b/manager/includes/default_config.php @@ -106,5 +106,6 @@ $c['cache_default'] = '1'; $c['search_default'] = '1'; $c['group_tvs'] = 0; -$c['global_tabs'] = 0; +$c['global_tabs'] = 1; $c['manager_theme_mode'] = '3'; + From 5a208b2fe0429c8c9cc471c1e89e2d8bc9ad90ab Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Wed, 28 Mar 2018 15:37:30 +0300 Subject: [PATCH 086/274] update DocLister --- assets/lib/MODxAPI/modResource.php | 14 ++++++++------ .../DocLister/core/extender/tv.extender.inc | 14 ++++++++------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/assets/lib/MODxAPI/modResource.php b/assets/lib/MODxAPI/modResource.php index 7966ddddf1..9142f36fa6 100644 --- a/assets/lib/MODxAPI/modResource.php +++ b/assets/lib/MODxAPI/modResource.php @@ -444,7 +444,7 @@ public function create($data = array()) $this->close(); $fld = array(); foreach ($this->tvd as $name => $tv) { - $fld[$name] = $tv; + $fld[$name] = $tv['default']; }; $this->store($fld); @@ -806,12 +806,14 @@ protected function get_TV($reload = false) $this->modx->_TVnames = $this->loadFromCache('_TVnames'); if ($this->modx->_TVnames === false || empty($this->modx->_TVnames) || $reload) { $this->modx->_TVnames = array(); - $result = $this->query('SELECT `id`,`name`,`default_text`,`type` FROM ' . $this->makeTable('site_tmplvars')); + $result = $this->query('SELECT `id`,`name`,`default_text`,`type`,`display`,`display_params` FROM ' . $this->makeTable('site_tmplvars')); while ($row = $this->modx->db->GetRow($result)) { $this->modx->_TVnames[$row['name']] = array( - "id" => $row['id'], - "type" => $row['type'], - "default" => $row['default_text'] + 'id' => $row['id'], + 'type' => $row['type'], + 'default' => $row['default_text'], + 'display' => $row['display'], + 'display_params' => $row['display_params'] ); } $this->saveToCache($this->modx->_TVnames, '_TVnames'); @@ -861,7 +863,7 @@ protected function loadTVDefault(array $tvId = array()) $this->tvd = array(); foreach ($tvId as $id) { $name = $this->tvid[$id]; - $this->tvd[$name] = $this->modx->_TVnames[$name]['default']; + $this->tvd[$name] = $this->modx->_TVnames[$name]; } } diff --git a/assets/snippets/DocLister/core/extender/tv.extender.inc b/assets/snippets/DocLister/core/extender/tv.extender.inc index 5390a44732..b3749c1c0f 100644 --- a/assets/snippets/DocLister/core/extender/tv.extender.inc +++ b/assets/snippets/DocLister/core/extender/tv.extender.inc @@ -88,13 +88,15 @@ class tv_DL_Extender extends extDocLister if ($this->modx->_TVnames === false) { $this->modx->_TVnames = array(); $from = $this->DocLister->getTable('site_tmplvars'); - $rs = $this->DocLister->dbQuery("SELECT `id`, `name`, `default_text`, `type` FROM {$from}"); + $rs = $this->DocLister->dbQuery("SELECT `id`, `name`, `default_text`, `type`, `display`, `display_params` FROM {$from}"); while ($item = $this->modx->db->getRow($rs)) { $this->modx->_TVnames[$item['name']] = array( - "id" => $item['id'], - "type" => $item['type'], - "default" => $item['default_text'] + 'id' => $item['id'], + 'type' => $item['type'], + 'default' => $item['default_text'], + 'display' => $item['display'], + 'display_params' => $item['display_params'] ); } $this->saveToCache($this->modx->_TVnames, '_TVnames'); @@ -139,7 +141,7 @@ class tv_DL_Extender extends extDocLister foreach ($out as $itemid => $item) { foreach ($TVkeys as $name) { if (!isset($out[$itemid][$name])) { - $out[$itemid][$name] = $tvDef[$name]; + $out[$itemid][$name] = $tvDef[$name]['default']; } if (in_array($name, $renderTV) || $renderTV == array("*")) { $out[$itemid][$name] = $this->renderTV($itemid, $name, $out[$itemid][$name], $tvDef[$name]); @@ -240,7 +242,7 @@ class tv_DL_Extender extends extDocLister $out = array(); foreach ($tvId as $id) { $name = $tvs[$id]; - $out[$this->_TVprefix . $name] = $this->modx->_TVnames[$name]['default']; + $out[$this->_TVprefix . $name] = $this->modx->_TVnames[$name]; } return $out; From 85502a94fd9a68d1ded5710a8510affeab27e5d1 Mon Sep 17 00:00:00 2001 From: Mr B Date: Thu, 29 Mar 2018 10:22:09 +0100 Subject: [PATCH 087/274] [F] --- manager/actions/search.static.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/manager/actions/search.static.php b/manager/actions/search.static.php index 40c94197e9..86f76bafcd 100755 --- a/manager/actions/search.static.php +++ b/manager/actions/search.static.php @@ -151,13 +151,14 @@ if (!ctype_digit($searchfields)) { $sqladd .= $sqladd != '' ? ' AND' : ''; - $sqladd .= " sc.pagetitle LIKE '%{$searchfields}%'"; + $sqladd .= " (sc.pagetitle LIKE '%{$searchfields}%'"; $sqladd .= " OR sc.longtitle LIKE '%{$searchlongtitle}%'"; $sqladd .= " OR sc.description LIKE '%{$searchlongtitle}%'"; $sqladd .= " OR sc.introtext LIKE '%{$searchlongtitle}%'"; $sqladd .= " OR sc.menutitle LIKE '%{$searchlongtitle}%'"; $sqladd .= " OR sc.alias LIKE '%{$search_alias}%'"; - $sqladd .= $articul_id_query;//search by TV + $sqladd .= $articul_id_query;//search by TV + $sqladd .= ")"; } } else if ($idFromAlias) { $sqladd .= " sc.id='{$idFromAlias}'"; From 3fb2275403a50e92672e56da2cedb06a173d1c5f Mon Sep 17 00:00:00 2001 From: Deesen Date: Thu, 29 Mar 2018 20:11:59 +0200 Subject: [PATCH 088/274] [F] #577 Fix TinyMCE for [*introtext*] --- assets/lib/class.modxRTEbridge.php | 2 +- assets/plugins/tinymce4/theme/theme.tinymce4.base.inc.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/lib/class.modxRTEbridge.php b/assets/lib/class.modxRTEbridge.php index f32d9b65c1..5b1abdcd68 100755 --- a/assets/lib/class.modxRTEbridge.php +++ b/assets/lib/class.modxRTEbridge.php @@ -368,7 +368,7 @@ public function renderBridgeParams($selector) // Load Tv-Options as bridged-params if($selector !== 'initBridge') { foreach ($this->themeConfig as $key => $conf) { - if (isset($this->tvOptions[$selector][$key])) { + if (isset($this->tvOptions[$selector][$key]) && $key != 'theme') { // Issue #577 $this->themeConfig[$key]['bridged'] = $this->tvOptions[$selector][$key]; } } diff --git a/assets/plugins/tinymce4/theme/theme.tinymce4.base.inc.php b/assets/plugins/tinymce4/theme/theme.tinymce4.base.inc.php index 6b888a5b20..033eb95479 100755 --- a/assets/plugins/tinymce4/theme/theme.tinymce4.base.inc.php +++ b/assets/plugins/tinymce4/theme/theme.tinymce4.base.inc.php @@ -32,8 +32,8 @@ $this->set('skin', 'lightgray', 'string' ); // Set default skin (setting param first time sets its value also as default val) $this->set('skin', $this->modxParams['skin'] ); // Overwrite with Modx-setting (if empty, default is used)) -$this->set('skintheme', 'modern', 'string' ); // Set default skin (setting param first time sets its value also as default val) -$this->set('skintheme', $this->modxParams['skintheme'] ); // Overwrite with Modx-setting (if empty, default is used)) +$this->set('theme', 'modern', 'string' ); // Set default skin (setting param first time sets its value also as default val) +$this->set('theme', $this->modxParams['skintheme'] ); // Overwrite with Modx-setting (if empty, default is used)) $this->set('width', $this->pluginParams['width'], 'string' ); // https://www.tinymce.com/docs/configure/editor-appearance/#width $this->set('height', $this->pluginParams['height'], 'string' ); // https://www.tinymce.com/docs/configure/editor-appearance/#height From 060e49f1d13209fe949c0a8d726e2474e25e18bf Mon Sep 17 00:00:00 2001 From: Serg <64j@mail.ru> Date: Thu, 29 Mar 2018 22:20:30 +0300 Subject: [PATCH 089/274] fix empty template on save tv --- manager/processors/save_tmplvars.processor.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/manager/processors/save_tmplvars.processor.php b/manager/processors/save_tmplvars.processor.php index 6180168ec2..d88343b9c1 100755 --- a/manager/processors/save_tmplvars.processor.php +++ b/manager/processors/save_tmplvars.processor.php @@ -197,15 +197,16 @@ function saveTemplateVarAccess() $getRankArray[$row['templateid']] = $row['rank']; } - $modx->db->delete($tbl_site_tmplvar_templates, "tmplvarid = '{$id}'"); - for ($i = 0; $i < count($templates); $i++) { - $setRank = ($getRankArray[$templates[$i]]) ? $getRankArray[$templates[$i]] : 0; - $modx->db->insert(array( - 'tmplvarid' => $id, - 'templateid' => $templates[$i], - 'rank' => $setRank, - ), $tbl_site_tmplvar_templates); + if (!empty($templates)) { + for ($i = 0; $i < count($templates); $i++) { + $setRank = ($getRankArray[$templates[$i]]) ? $getRankArray[$templates[$i]] : 0; + $modx->db->insert(array( + 'tmplvarid' => $id, + 'templateid' => $templates[$i], + 'rank' => $setRank, + ), $tbl_site_tmplvar_templates); + } } } From f8c17c495759aadecb5c8bd82e3af876a550cf10 Mon Sep 17 00:00:00 2001 From: Serg <64j@mail.ru> Date: Thu, 29 Mar 2018 22:34:40 +0300 Subject: [PATCH 090/274] moved JS code to a file manager/media/script/main.js --- manager/includes/header.inc.php | 556 +++----------------------------- manager/media/script/main.js | 456 ++++++++++++++++++++++++++ 2 files changed, 504 insertions(+), 508 deletions(-) create mode 100644 manager/media/script/main.js diff --git a/manager/includes/header.inc.php b/manager/includes/header.inc.php index dc0008c1f8..9c397558a6 100755 --- a/manager/includes/header.inc.php +++ b/manager/includes/header.inc.php @@ -1,6 +1,7 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    + Please use the EVO Content Manager instead of accessing this file directly."); } $mxla = $modx_lang_attribute ? $modx_lang_attribute : 'en'; @@ -17,24 +18,25 @@ } switch ($modx->config['manager_theme_mode']) { - case '1': - $body_class .= ' lightness'; - break; - case '2': - $body_class .= ' light'; - break; - case '3': - $body_class .= ' dark'; - break; - case '4': - $body_class .= ' darkness'; - break; + case '1': + $body_class .= ' lightness'; + break; + case '2': + $body_class .= ' light'; + break; + case '3': + $body_class .= ' dark'; + break; + case '4': + $body_class .= ' darkness'; + break; } $css = 'media/style/' . $modx->config['manager_theme'] . '/style.css?v=' . $lastInstallTime; if ($modx->config['manager_theme'] == 'default') { - if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) { + if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') + && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) { require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php'; $minifier = new Formatter\CSSMinify(); $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css'); @@ -49,7 +51,10 @@ $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/index.css'); $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/main.css'); $css = $minifier->minify(); - file_put_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', $css); + file_put_contents( + MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', + $css + ); } if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime; @@ -61,15 +66,16 @@ Evolution CMS - - - - - + + + + + ' . "\n", $modx->config['mgr_jquery_path']) ?> config['show_picker'] != "0") { ?> - + + + class="" data-evocp="color"> diff --git a/manager/media/script/main.js b/manager/media/script/main.js new file mode 100644 index 0000000000..6a1f7b78aa --- /dev/null +++ b/manager/media/script/main.js @@ -0,0 +1,456 @@ +// evoTooltips +evo.tooltips = function(a) { + 'use strict'; + if (!a) { + return; + } else { + a = 'string' === typeof a ? document.querySelectorAll(a) : a; + } + var b = document.querySelector('.evo-tooltip'); + if (!b) { + b = document.createElement('div'); + b.className = 'evo-tooltip'; + document.body.appendChild(b); + } + b.style.pointerEvents = 'none'; + var c = parseFloat(getComputedStyle(b).marginTop); + for (var i = 0; i < a.length; i++) { + a[i].addEventListener('mouseenter', function(e) { + if (e.buttons) { + return; + } + var x = e.clientX, y = e.clientY; + b.innerHTML = (this.dataset && this.dataset.tooltip ? (this.dataset.tooltip[0] === '#' ? document.querySelector(this.dataset.tooltip).innerHTML : this.dataset.tooltip) : this.innerHTML); + if (x + b.offsetWidth + (c * 2) > window.innerWidth) { + b.style.left = Math.round(x - b.offsetWidth - (c * 2)) + 'px'; + b.classList.add('evo-tooltip-right'); + } else { + b.style.left = Math.round(x) + 'px'; + b.classList.add('evo-tooltip-left'); + } + if (y - (b.offsetHeight / 2) - c < 0) { + b.style.top = 0; + } else if (y + (b.offsetHeight / 2) > window.innerHeight) { + b.style.top = Math.round(window.innerHeight - b.offsetHeight) - (c * 2) + 'px'; + } else { + b.style.top = Math.round(y - (b.offsetHeight / 2)) - c + 'px'; + } + b.classList.add('show'); + }); + a[i].addEventListener('mouseleave', function() { + b.className = 'evo-tooltip'; + }); + a[i].addEventListener('mousedown', function() { + b.className = 'evo-tooltip'; + }); + } +}; + +// evoSortable +evo.sortable = function(a, b) { + 'use strict'; + if (!a) { + return; + } else { + a = 'string' === typeof a ? document.querySelectorAll(a) : a; + b = b || {}; + } + var o = { + el: null, + handleClass: b.handleClass || 'ghost', + position: b.position || 'vertical', + complete: function(c) { + if ('function' === typeof b.complete) { + b.complete(c); + } + }, + change: function(c) { + if ('function' === typeof b.change) { + b.change(c); + } + } + }; + + function onmousedown(e) { + o.el = this; + o.x = e.pageX; + o.y = e.pageY; + o.marginX = parseFloat(getComputedStyle(o.el).marginLeft) + parseFloat(getComputedStyle(o.el).marginRight); + o.marginY = parseFloat(getComputedStyle(o.el).marginTop) + parseFloat(getComputedStyle(o.el).marginBottom); + o.el.classList.add(o.handleClass); + o.el.ownerDocument.addEventListener('mousemove', onmousemove); + o.el.ownerDocument.addEventListener('mouseup', onmouseup); + o.el.ownerDocument.onselectstart = function(e) { + e.preventDefault(); + }; + } + + function onmousemove(e) { + if (o.position === 'vertical') { + var y = (e.pageY - o.y); + if (y >= o.el.offsetHeight && o.el.nextElementSibling) { + o.y += o.el.offsetHeight + o.marginY; + o.el.parentNode.insertBefore(o.el, o.el.nextElementSibling.nextElementSibling); + o.change(); + y = 0; + } else if (y <= -o.el.offsetHeight && o.el.previousElementSibling) { + o.y -= o.el.offsetHeight + o.marginY; + o.el.parentNode.insertBefore(o.el, o.el.previousElementSibling); + o.change(); + y = 0; + } else if (!o.el.previousElementSibling && y < 0 || !o.el.nextElementSibling && y > 0) { + y = 0; + } + o.el.style.webkitTransform = 'translateY(' + y + 'px)'; + o.el.style.transform = 'translateY(' + y + 'px)'; + } else { + var x = (e.pageX - o.x); + if (x >= o.el.offsetWidth && o.el.nextElementSibling) { + o.x += o.el.offsetWidth + o.marginX; + o.el.parentNode.insertBefore(o.el, o.el.nextElementSibling.nextElementSibling); + o.change(); + x = 0; + } else if (x <= -o.el.offsetWidth && o.el.previousElementSibling) { + o.x -= o.el.offsetHeight + o.marginX; + o.el.parentNode.insertBefore(o.el, o.el.previousElementSibling); + o.change(); + x = 0; + } else if (!o.el.previousElementSibling && x < 0 || !o.el.nextElementSibling && x > 0) { + x = 0; + } + o.el.style.webkitTransform = 'translateX(' + x + 'px)'; + o.el.style.transform = 'translateX(' + x + 'px)'; + } + } + + function onmouseup() { + o.el.style.webkitTransform = ''; + o.el.style.transform = ''; + o.el.classList.remove(o.handleClass); + o.el.ownerDocument.removeEventListener('mousemove', onmousemove); + o.el.ownerDocument.removeEventListener('mouseup', onmouseup); + o.el.ownerDocument.onselectstart = null; + o.complete(o.el); + } + + for (var i = 0; i < a.length; i++) { + a[i].addEventListener('mousedown', onmousedown); + } +}; + +// evo draggable +evo.draggable = function(a, b) { + 'use strict'; + if (!a) { + return; + } else { + a = 'string' === typeof a ? document.querySelectorAll(a) : a; + b = b || {}; + } + var o = { + handle: { + start: function(c) { + 'function' === typeof b.handle.start ? b.handle.start.call(c) : ''; + }, + end: function(c) { + 'function' === typeof b.handle.end ? b.handle.end.call(c) : ''; + } + }, + container: { + className: b.container.className || 'drop', + classOver: b.container.classOver || 'over', + over: function(c) { + 'function' === typeof b.container.over ? b.container.over.call(c) : ''; + }, + leave: function(c) { + 'function' === typeof b.container.leave ? b.container.leave.call(c) : ''; + }, + drop: function(c, i) { + 'function' === typeof b.container.drop ? b.container.drop.call(c, i) : ''; + } + } + }; + + o.container.els = document.getElementsByClassName(o.container.className); + + function onmousedown(e) { + o.el = this; + o.parent = o.el.offsetParent; + o.x = e.pageX; + o.y = e.pageY; + o.draggable = false; + document.onselectstart = function(e) { + e.preventDefault(); + }; + document.addEventListener('mousemove', onmousemove); + document.addEventListener('mouseup', onmouseup); + o.el.addEventListener('mouseup', onmouseup); + } + + function onmousemove(e) { + var x = e.pageX - o.x, y = e.pageY - o.y; + if (Math.abs(x) + Math.abs(y) > 10) { + o.draggable = true; + o.el.style.pointerEvents = 'none'; + o.el.style.left = x + 'px'; + o.el.style.top = y + 'px'; + o.handle.start(o.el); + } + } + + function onmouseup() { + document.removeEventListener('mousemove', onmousemove); + document.removeEventListener('mouseup', onmouseup); + o.el.removeEventListener('mouseup', onmouseup); + if (o.draggable) { + o.draggable = false; + o.el.style.pointerEvents = ''; + o.el.style.left = ''; + o.el.style.top = ''; + o.el.draggable = false; + var h = document.getElementsByClassName(o.container.classOver); + if (h && h !== o.parent) { + h.appendChild(o.el); + o.container.drop(h, o.el); + } + o.handle.end(o.el); + } + } + + for (var i = 0; i < a.length; i++) { + a[i].addEventListener('mousedown', onmousedown); + } + + for (var i = 0; i < o.container.els.length; i++) { + o.container.els[i].onmouseenter = function() { + this.classList.add(b.container.classOver); + }; + o.container.els[i].onmouseleave = function() { + this.classList.remove(b.container.classOver); + }; + } + +}; + +// evo collapse +evo.collapse = function(a, b) { + if (!a) { + return; + } else { + a = 'string' === typeof a ? document.querySelectorAll(a) : a; + } + var h = { + containerClass: b && b.containerClass || 'tab-body' + }; + + for (var i = 0; i < a.length; i++) { + if (a[i].nextElementSibling && a[i].nextElementSibling.classList.contains(h.containerClass)) { + a[i].nextElementSibling.classList.add('collapse', 'in'); + a[i].onclick = function() { + if (a[i].nextElementSibling.classList.contains('in')) { + a[i].nextElementSibling.classList.remove('in'); + a[i].classList.add('collapsed'); + } else { + a[i].nextElementSibling.classList.add('in'); + a[i].classList.remove('collapsed'); + } + }; + } + } +}; + +// check connection to server +evo.checkConnectionToServer = function() { + var xhr = new (window.ActiveXObject || XMLHttpRequest)('Microsoft.XMLHTTP'); + xhr.open('HEAD', evo.urlCheckConnectionToServer + '?time=' + new Date().getTime(), false); + try { + xhr.send(); + return (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304); + } catch (error) { + return false; + } +}; + +function document_onload() { + stopWorker(); + + var actionButtons = document.getElementById('actions'), actionSelect = document.getElementById('stay'); + if (actionButtons !== null && actionSelect !== null) { + var actionPlus = actionButtons.querySelector('.plus'), actionSaveButton = actionButtons.querySelector('a#Button1') || actionButtons.querySelector('#Button1 > a'), actionStay = []; + actionPlus.classList.add('dropdown-toggle'); + actionStay['stay1'] = ''; + actionStay['stay2'] = ''; + actionStay['stay3'] = ''; + if (actionSelect.value) { + actionSaveButton.innerHTML += ' + ' + actionStay['stay' + actionSelect.value] + '' + actionSelect.children['stay' + actionSelect.value].innerHTML + ''; + } + var actionSelectNewOption = null, actionSelectOptions = actionSelect.children, div = document.createElement('div'); + div.className = 'dropdown-menu'; + actionSaveButton.parentNode.classList.add('dropdown'); + for (var i = 0; i < actionSelectOptions.length; i++) { + if (!actionSelectOptions[i].selected) { + actionSelectNewOption = document.createElement('SPAN'); + actionSelectNewOption.className = 'btn btn-block'; + actionSelectNewOption.dataset.id = i; + actionSelectNewOption.innerHTML = actionStay[actionSelect.children[i].id] + ' ' + actionSelect.children[i].innerHTML + ''; + actionSelectNewOption.onclick = function() { + var s = actionSelect.querySelector('option[selected=selected]'); + if (s) { + s.selected = false; + } + actionSelect.children[this.dataset.id].selected = true; + actionSaveButton.click(); + }; + div.appendChild(actionSelectNewOption); + } + } + actionSaveButton.parentNode.appendChild(div); + actionPlus.onclick = function() { + this.parentNode.classList.toggle('show'); + }; + } + evo.tooltips('[data-tooltip]'); + + if (document.forms.length && document.forms.mutate && window.frameElement.parentNode.parentNode.classList.contains('evo-popup')) { + window.focus(); + document.forms.mutate.addEventListener('submit', function(e) { + if ((actionSelect && actionSelect.value === '') || (!actionSelect && actionSaveButton)) { + if (actionSelect) { + actionSelect.parentNode.removeChild(actionSelect); + } + if (top.mainMenu) { + top.mainMenu.work(); + } + var xhr = new XMLHttpRequest(); + xhr.onload = function() { + if (this.status === 200 && this.readyState === 4) { + if (top.mainMenu) { + top.mainMenu.stopWork(); + } + if (top.tree) { + top.tree.restoreTree(); + } + window.frameElement.parentNode.parentNode.close(e); + } + }; + xhr.open(document.forms.mutate.method, document.forms.mutate.action, true); + xhr.send(new FormData(document.forms.mutate)); + e.preventDefault(); + } + }, false); + + actions.cancel = function() { + window.frameElement.parentNode.parentNode.close(); + }; + + window.addEventListener('keydown', function(e) { + if (e.keyCode === 27) { + window.frameElement.parentNode.parentNode.close(); + } + }); + } +} + +function reset_path(elementName) { + document.getElementById(elementName).value = document.getElementById('default_' + elementName).innerHTML; +} + +function document_onunload(e) { + if (!dontShowWorker) { + top.mainMenu.work(); + } +} + +// set tree to default action. +if (parent.tree) { + parent.tree.ca = 'open'; +} + +// call the updateMail function, updates mail notification in top navigation +if (top.mainMenu && top.mainMenu.updateMail) { + top.mainMenu.updateMail(true); +} + +function stopWorker() { + try { + parent.mainMenu.stopWork(); + } catch (oException) { + ww = window.setTimeout('stopWorker()', 500); + } +} + +function doRefresh(r) { + try { + rr = r; + top.mainMenu.startrefresh(rr); + } catch (oException) { + vv = window.setTimeout('doRefresh()', 1000); + } +} + +function checkDirt(evt) { + evt = evt || window.event; + var message = ''; + if (!evo.checkConnectionToServer()) { + message = evo.lang.error_internet_connection; + setTimeout(function() { + alert(message); + }, 10); + evt.returnValue = message; + timerForUnload = setTimeout('stopWorker()', 100); + return message; + } + if (documentDirty === true) { + message = evo.lang.warning_not_saved; + evt.returnValue = message; + timerForUnload = setTimeout('stopWorker()', 100); + return message; + } +} + +function saveWait(fName) { + document.getElementById('savingMessage').innerHTML = evo.lang.saving; + for (var i = 0; i < document.forms[fName].elements.length; i++) { + document.forms[fName].elements[i].disabled = 'disabled'; + } +} + +function hideLoader() { + document.getElementById('preLoader').style.display = 'none'; +} + +// add the 'unsaved changes' warning event handler +if (typeof window.addEventListener !== 'undefined') { + window.addEventListener('beforeunload', function(e) { + checkDirt(e); + document_onunload(); + }, false); +} else if (typeof window.attachEvent !== 'undefined') { + window.attachEvent('onbeforeunload', function(e) { + checkDirt(e); + document_onunload(); + }); +} else { + window.onbeforeunload = function(e) { + checkDirt(e); + document_onunload(); + }; +} + +if (typeof window.addEventListener !== 'undefined') { + window.addEventListener('load', function() { + document_onload(); + }, false); +} else if (typeof window.attachEvent !== 'undefined') { + window.attachEvent('onload', function() { + document_onload(); + }); +} else { + window.onload = function() { + document_onload(); + }; +} + +window.addEventListener('unload', function() { + clearTimeout(timerForUnload); +}); \ No newline at end of file From 857140587c927bf84281b3ee2772fc5db0bae181 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Fri, 30 Mar 2018 21:12:09 +0200 Subject: [PATCH 091/274] Better navbar icon rendering Better small icons rendering in eg. Firefox. 0.875rem = 14px = native FA size. --- manager/media/style/default/css/mainmenu.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/manager/media/style/default/css/mainmenu.css b/manager/media/style/default/css/mainmenu.css index 48998cb795..82f490b956 100755 --- a/manager/media/style/default/css/mainmenu.css +++ b/manager/media/style/default/css/mainmenu.css @@ -18,7 +18,7 @@ #mainMenu .nav > li > a .icon { display: inline-block; overflow: hidden; width: auto; height: 2rem; line-height: 2rem; font-size: 1.5em; text-align: center; margin: 0.05rem 0 0 0.5rem; vertical-align: top; border-radius: 50%; background: no-repeat 50% 50%; background-size: cover; } #mainMenu .nav > li > a .icon.photo { width: 2rem } #mainMenu .nav > li > a .icon .fa { font-size: 1.2rem; line-height: 2.1rem } -#mainMenu .nav > li .fa { min-width: 1em; line-height: 2.2rem; font-size: .9rem; vertical-align: top } +#mainMenu .nav > li .fa { min-width: 1em; line-height: 2.2rem; font-size: 0.875rem; vertical-align: top } #mainMenu #nav > li > a > .fa { display: none } #mainMenu #nav #bars { width: 3.5rem; text-align: center } #mainMenu #nav #bars a { padding: 0 1rem; } @@ -92,7 +92,6 @@ #mainMenu, #mainMenu .nav > li > a, #mainMenu .nav .label_searchid, #mainMenu .nav > li > a .icon, #mainMenu #searchform .mask, #mainMenu #nav #site::before { height: 3rem; } #mainMenu .nav > li > a, #mainMenu .nav .label_searchid, #mainMenu .nav > li .fa, #mainMenu .nav > li > a .icon { line-height: 3.1rem; } #mainMenu .nav > li > a .icon.photo { width: 2.5rem; height: 2.5rem; margin-top: .3rem; } -#mainMenu .nav > li .fa { font-size: 1rem; } #mainMenu #nav > li > a { padding: 0 1.3rem; font-size: .875rem; } #mainMenu #nav > li > a > .fa { display: none } #mainMenu .nav > li > a .icon .fa { line-height: 3rem; font-size: 1.5rem; } From b61aa6c47012d51ad812fed4500a98a9d60a9834 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Fri, 30 Mar 2018 21:18:09 +0200 Subject: [PATCH 092/274] Navbar bg color --- manager/media/style/default/css/mainmenu.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/media/style/default/css/mainmenu.css b/manager/media/style/default/css/mainmenu.css index 82f490b956..b19d32d5a0 100755 --- a/manager/media/style/default/css/mainmenu.css +++ b/manager/media/style/default/css/mainmenu.css @@ -1,5 +1,5 @@ /* #mainMenu */ -#mainMenu { background-color: #2b323a; color: #8b9298; -webkit-box-shadow: 0 0.15rem 0.15rem rgba(0, 0, 0, 0.25); box-shadow: 0 0.15rem 0.15rem rgba(0, 0, 0, 0.25); } +#mainMenu { background-color: #343944; color: #8b9298; -webkit-box-shadow: 0 0.15rem 0.15rem rgba(0, 0, 0, 0.25); box-shadow: 0 0.15rem 0.15rem rgba(0, 0, 0, 0.25); } #mainMenu.show { overflow: visible } #mainMenu + #tree::before, #mainMenu + #tree + #main::before { content: ""; position: fixed; z-index: 9999; left: 0; top: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, .1); opacity: 0; visibility: hidden; -webkit-transition: opacity .15s, visibility .15s; transition: opacity .15s, visibility .15s; } #mainMenu.show + #tree::before, #mainMenu.show + #tree + #main::before { opacity: 1; visibility: visible } From 109d3819511893c75c6e67370ee645f43e3a28de Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Fri, 30 Mar 2018 21:27:40 +0200 Subject: [PATCH 093/274] Navbar height 3.125rem = 50px --- manager/media/style/default/css/index.css | 4 ++-- manager/media/style/default/css/mainmenu.css | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/manager/media/style/default/css/index.css b/manager/media/style/default/css/index.css index 3ce62c2f9a..d41deb372a 100755 --- a/manager/media/style/default/css/index.css +++ b/manager/media/style/default/css/index.css @@ -18,8 +18,8 @@ .sidebar-closed #tree { width: 0 !important; } .sidebar-closed #main, .sidebar-closed #resizer { left: 0 !important; } @media (min-width: 1200px) { -#mainMenu { height: 3rem; } -#tree, #main { top: 3rem; } +#mainMenu { height: 3.125rem; } +#tree, #main { top: 3.125rem; } #tree { font-size: .875rem } } @media (max-width: 840px) { diff --git a/manager/media/style/default/css/mainmenu.css b/manager/media/style/default/css/mainmenu.css index b19d32d5a0..fdd26123b0 100755 --- a/manager/media/style/default/css/mainmenu.css +++ b/manager/media/style/default/css/mainmenu.css @@ -86,10 +86,10 @@ #searchresult .ajaxSearchResults .disabled a { opacity: .5; color: #7d2a24; } #searchresult .ajaxSearchResults .deleted a { color: #a52a2a; text-decoration: line-through } @media (min-width: 1200px) { -#searchresult { top: 3rem; } +#searchresult { top: 3.125rem; } #mainMenu #nav #site::before { content: ""; display: block; overflow: hidden; width: 10rem; background: url("../images/misc/logo-navbar.png") 0 50% no-repeat; background-size: 88%; } #mainMenu #nav #site::before , #mainMenu #nav #site a { float: left } -#mainMenu, #mainMenu .nav > li > a, #mainMenu .nav .label_searchid, #mainMenu .nav > li > a .icon, #mainMenu #searchform .mask, #mainMenu #nav #site::before { height: 3rem; } +#mainMenu, #mainMenu .nav > li > a, #mainMenu .nav .label_searchid, #mainMenu .nav > li > a .icon, #mainMenu #searchform .mask, #mainMenu #nav #site::before { height: 3.125rem; } #mainMenu .nav > li > a, #mainMenu .nav .label_searchid, #mainMenu .nav > li .fa, #mainMenu .nav > li > a .icon { line-height: 3.1rem; } #mainMenu .nav > li > a .icon.photo { width: 2.5rem; height: 2.5rem; margin-top: .3rem; } #mainMenu #nav > li > a { padding: 0 1.3rem; font-size: .875rem; } From 72ceb3130a13eb4f82b755020817c8a01a74de02 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Fri, 30 Mar 2018 21:30:08 +0200 Subject: [PATCH 094/274] Navbar links color --- manager/media/style/default/css/mainmenu.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/media/style/default/css/mainmenu.css b/manager/media/style/default/css/mainmenu.css index fdd26123b0..52d31fc8de 100755 --- a/manager/media/style/default/css/mainmenu.css +++ b/manager/media/style/default/css/mainmenu.css @@ -11,7 +11,7 @@ #mainMenu .nav { margin: 0; white-space: nowrap; font-size: 0 } #mainMenu .nav > li { position: relative; display: inline-block; font-size: 0.8rem; vertical-align: top } #mainMenu .nav > li.active > a { color: #fff; background-color: rgba(255, 255, 255, 0.07) } -#mainMenu .nav > li > a, #mainMenu .nav .label_searchid { display: block; position: relative; z-index: 1; padding: 0 1rem; height: 2.2rem; line-height: 2.3rem; text-decoration: none; color: #bbb; transition-duration: 0.15s } +#mainMenu .nav > li > a, #mainMenu .nav .label_searchid { display: block; position: relative; z-index: 1; padding: 0 1rem; height: 2.2rem; line-height: 2.3rem; text-decoration: none; color: #DCD9E3; transition-duration: 0.15s } #mainMenu .nav > li > a:hover, #mainMenu .nav .label_searchid:hover { color: #f3f3f3; } /*#mainMenu.show .nav > li.dropdown:hover > a, */ #mainMenu.show .nav > li.dropdown.hover > a { background-color: #fff; color: #444; } From a1ade4a8ee23cef70d26efa7e7cc5e367c7a0274 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Fri, 30 Mar 2018 21:48:38 +0200 Subject: [PATCH 095/274] Table style --- manager/media/style/default/css/custom.css | 23 +++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/manager/media/style/default/css/custom.css b/manager/media/style/default/css/custom.css index 6b110203b2..221959346c 100755 --- a/manager/media/style/default/css/custom.css +++ b/manager/media/style/default/css/custom.css @@ -197,7 +197,6 @@ ul.breadcrumbs span::after { margin-left: 2em; font-family: FontAwesome; content .widgets .card-block .card-body { padding: 1rem; } .widgets .card-block .card-body + .card-body { padding-top: 0 } .widgets .table { margin-bottom: 0rem } -.widgets .table.data td, .widgets .table.data th, .widgets .table.data thead td{border-top:0px;} .widgets .table:not(.data) tr th, .widgets .table:not(.data) tr td { padding: .15rem; } .widgets .table tr th:first-child, .widgets .table tr td:first-child { padding-left: 1rem !important } .widgets .table tr th:last-child, .widgets .table tr td:last-child { padding-right: 1rem !important } @@ -344,14 +343,32 @@ to { opacity: 1; transform: translateY(0); } /* pmfx theme */ #actions .dropdown-toggle:after { display: none !important; } +.card .table.data { + margin-bottom: 0; + border-bottom-width: 0; +} + +.table.data th, +.table.data thead td { + border-bottom-width: 1px; +} + +.card .table.data > thead > tr:first-child td, +.card .table.data > thead > tr:first-child th, +.card .table.data > tbody > tr:first-child td, +.card .table.data > tbody > tr:first-child th { + border-top-width: 0; +} -/* .table.data > tbody > tr, .table.data > tbody > tr:nth-child(2n), .widgets #modxrecent_widget .table.data tbody tr:nth-child(4n+1):not(:hover) { background-color: #fff; -}*/ +} +.table.data > tbody > tr:hover { + background-color: rgba(0, 0, 0, 0.03) !important; +} ul.breadcrumbs { margin: 0 0 1rem 0; From 6608559061d8acf7997a59fffdf3d494f1a61eb5 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Fri, 30 Mar 2018 22:06:49 +0200 Subject: [PATCH 096/274] Tree styles --- manager/media/style/default/css/custom.css | 1 + manager/media/style/default/css/tree.css | 32 ++++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/manager/media/style/default/css/custom.css b/manager/media/style/default/css/custom.css index 221959346c..5fa1d3c571 100755 --- a/manager/media/style/default/css/custom.css +++ b/manager/media/style/default/css/custom.css @@ -425,6 +425,7 @@ textarea.mce, ul.mmTagList li { padding: 2px 8px !important; + margin-bottom: 5px !important; border-radius: 3px !important; -webkit-border-radius: 3px !important; background-color: #eaeaea !important; diff --git a/manager/media/style/default/css/tree.css b/manager/media/style/default/css/tree.css index 55ce9cb647..60c0fb8504 100755 --- a/manager/media/style/default/css/tree.css +++ b/manager/media/style/default/css/tree.css @@ -11,11 +11,11 @@ #treeMenu .treeButton.disabled { color: #777; opacity: 0.5 } #treeHolder { position: relative; z-index: 1; cursor: default; overflow: auto; height: 100%; max-height: calc(100% - 30px); white-space: nowrap } #treeHolder .rootNode { position: relative; } -#treeHolder .rootNode a { display: block; overflow: hidden; padding: 1em 1em 0.5em 1em; text-overflow: ellipsis; color: #333; cursor: pointer; -webkit-transition-duration: 0.15s; transition-duration: 0.15s; font-weight: bold } +#treeHolder .rootNode a { display: block; overflow: hidden; padding: 1em 1em 0.5em 1rem; text-overflow: ellipsis; color: #333; cursor: pointer; -webkit-transition-duration: 0.15s; transition-duration: 0.15s; font-weight: bold } #treeHolder .rootNode a .fa { margin-right: 0.5em } #treeHolder .rootNode .icon { display: none; } #treeRoot { float: left; width: 100%; color: #333; } -#treeRoot a { display: block; clear: both; overflow: hidden; text-decoration: none; padding: 0.1em 0 0.1em 2.2em; font-size: 1em; text-overflow: ellipsis; color: #333; cursor: default; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } +#treeRoot a { display: block; clear: both; overflow: hidden; text-decoration: none; padding: 0.2em 0 0.2em 2rem !important; font-size: 0.875rem; text-overflow: ellipsis; color: #333; cursor: default; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } #treeRoot a:hover:not(.empty), #treeRoot a.current { background-color: rgba(33, 150, 243, 0.1) } #treeRoot a small { margin: 0 0.8em 0 0.2em } #treeRoot a.selected, #treeRoot .dragenter > a { background-color: rgba(0, 0, 0, 0.1); } @@ -66,3 +66,31 @@ .dark #treeRoot a.deleted .title:hover { color: #e23d3d } .dark #treeRoot .toggle:hover { background-color: rgba(255, 255, 255, 0.19); } .dark #treeRoot .fa, .dark #treeHolder .rootNode .fa { color: #bcbec0; } + +/* ElementsInTree plugin */ + +#treePane .panel-title { + font-size: 0.8125rem; +} + +#treePane .panel-title a { + padding: 4px 0 6px 0.6rem !important; +} + +#treePane .panel-title > a:before { + display: none !important; +} + +#treePane .tab-page ul { + margin: 7px 0 !important; +} + +.ElementsInTree #tree .eltree { + padding-left: 1rem !important; + font-size: 13px; +} + +.dark #treePane .panel-heading { + border-top-color: #3e4144 !important; + border-bottom-color: transparent !important; +} \ No newline at end of file From c0efeb457685a211c71c581f94e04ab7eec7eb7d Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Fri, 30 Mar 2018 22:13:05 +0200 Subject: [PATCH 097/274] Navbar styles --- manager/media/style/default/css/mainmenu.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/media/style/default/css/mainmenu.css b/manager/media/style/default/css/mainmenu.css index 52d31fc8de..fc0622c5d5 100755 --- a/manager/media/style/default/css/mainmenu.css +++ b/manager/media/style/default/css/mainmenu.css @@ -1,5 +1,5 @@ /* #mainMenu */ -#mainMenu { background-color: #343944; color: #8b9298; -webkit-box-shadow: 0 0.15rem 0.15rem rgba(0, 0, 0, 0.25); box-shadow: 0 0.15rem 0.15rem rgba(0, 0, 0, 0.25); } +#mainMenu { background-color: #343944; color: #8b9298; -webkit-box-shadow: 0 2px 4px rgba(0,0,0,.3); box-shadow: 0 2px 4px rgba(0,0,0,.3); } #mainMenu.show { overflow: visible } #mainMenu + #tree::before, #mainMenu + #tree + #main::before { content: ""; position: fixed; z-index: 9999; left: 0; top: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, .1); opacity: 0; visibility: hidden; -webkit-transition: opacity .15s, visibility .15s; transition: opacity .15s, visibility .15s; } #mainMenu.show + #tree::before, #mainMenu.show + #tree + #main::before { opacity: 1; visibility: visible } @@ -37,7 +37,7 @@ #mainMenu .nav > li > ul > li:last-child { border: none; margin-bottom: 0 } #mainMenu .nav > li > ul > li.item-input { padding: 0.375em 0.5em; } #mainMenu .nav > li > ul > li > a:first-child, #mainMenu .nav > li > ul > li > span { display: block; position: relative; padding: 0 2rem 0 1rem; line-height: 2.2rem; color: #444; text-decoration: none } -#mainMenu .nav > li > ul > li.hover > a:first-child { color: #fff; background-color: #1976d2; } +#mainMenu .nav > li > ul > li.hover > a:first-child { color: #444; background-color: #eee; } #mainMenu .nav > li > ul > li > span:first-child { padding: 0 1rem; text-align: center; font-size: 0.875em; color: #aaa; } #mainMenu .nav > li > ul > li.dropdown-back > span { text-align: left; font-size: inherit; color: inherit } #mainMenu .nav > li > ul > li.dropdown-back > span * { pointer-events: none } From 002353afddd467e8419fa609fd5f386c30ffd19d Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Fri, 30 Mar 2018 22:17:17 +0200 Subject: [PATCH 098/274] Input border --- manager/media/style/default/css/forms.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/media/style/default/css/forms.css b/manager/media/style/default/css/forms.css index b23c0cd9c3..0f8a6f4c66 100755 --- a/manager/media/style/default/css/forms.css +++ b/manager/media/style/default/css/forms.css @@ -12,7 +12,7 @@ input[type=checkbox]:focus, input[type=radio]:focus { border-color: #4d8ef9 !imp input[type=checkbox]:checked, input[type=radio]:checked { background-position: 50% 50% } input[type=checkbox]:disabled { background-image: url("data:image/svg+xml;utf8,%3Csvg%20viewBox%3D%270%200%201792%201792%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M1671%20566q0%2040-28%2068l-724%20724-136%20136q-28%2028-68%2028t-68-28l-136-136-362-362q-28-28-28-68t28-68l136-136q28-28%2068-28t68%2028l294%20295%20656-657q28-28%2068-28t68%2028l136%20136q28%2028%2028%2068z%27%20fill%3D%27%23bbb%27/%3E%3C/svg%3E"); background-size: .875em; } button, input, optgroup, select, textarea { position: relative; font-family: sans-serif; font-size: 0.8125rem; line-height: 1.23076923; margin: 0; -webkit-appearance: none; -moz-appearance: none; } -.form-control, input[type=text]:not(.form-control), input[type=password], input[type=number], input[type=email], input[type=date], input[type=url], input[type=search], select, textarea { display: inline-block; width: 100%; max-width: 100%; padding: 0.46153846em .5em; line-height: 1.23076923; vertical-align: inherit; font-size: 0.8125rem; color: #464a4c; background-color: #fff; -webkit-background-clip: padding-box; background-clip: padding-box; border: 1px solid #d4d4d4; border-radius: .1em; -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; } +.form-control, input[type=text]:not(.form-control), input[type=password], input[type=number], input[type=email], input[type=date], input[type=url], input[type=search], select, textarea { display: inline-block; width: 100%; max-width: 100%; padding: 0.46153846em .5em; line-height: 1.23076923; vertical-align: inherit; font-size: 0.8125rem; color: #464a4c; background-color: #fff; -webkit-background-clip: padding-box; background-clip: padding-box; border: 1px solid #d4d4d4; border-color: rgba(0,0,0,0.08); border-radius: .1em; -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; } .form-control:focus, input:not([type=radio]):not([type=checkbox]):focus, select:focus, textarea:focus, .btn.focus, .btn:focus { z-index: 3; outline-offset: -1px; outline: rgba(77, 142, 249, 0.5) solid 2px; border-color: #66afe9; } input:not([type=button]):not([type=submit]):hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: #bbb; transition: border-color 0s, background-position .1s; } .btn, button:not(.btn), input[type=button]:not(.btn), input[type=submit]:not(.btn) { display: inline-block; padding: 0.46153846em 1em; line-height: 1.23076923; vertical-align: inherit; text-align: center; text-decoration: none !important; font-size: 0.8125rem; font-weight: 400; white-space: nowrap; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: pointer; background-color: #fff; border: 1px solid #d4d4d4; border-radius: .1em; -webkit-transition: all .2s ease-in-out; -o-transition: all .2s ease-in-out; transition: all .2s ease-in-out } From c4c8db2fca0ee1833884f23cc08dfe2c39d14ab1 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Fri, 30 Mar 2018 22:20:49 +0200 Subject: [PATCH 099/274] Wider Global Tabs --- manager/media/style/default/css/tabpane.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/media/style/default/css/tabpane.css b/manager/media/style/default/css/tabpane.css index eb31a88a3b..bc0acad538 100755 --- a/manager/media/style/default/css/tabpane.css +++ b/manager/media/style/default/css/tabpane.css @@ -115,7 +115,7 @@ .evo-tab-row .tab-row .tab:not(#evo-tab-home) i.help, .evo-popup.evo-popup-iframe .evo-popup-header i.help { display: none } .evo-tab-row .tab-row .tab:not(#evo-tab-home) i, .evo-popup.evo-popup-iframe .evo-popup-header i { margin-right: .25em } .evo-tab-row .tab-row .tab span { background: none !important } -.evo-tab-row .tab-row .tab .tab-title { float: left; width: 5rem; line-height: 2rem; text-overflow: ellipsis; overflow: hidden; } +.evo-tab-row .tab-row .tab .tab-title { float: left; width: 8rem; line-height: 2rem; text-overflow: ellipsis; overflow: hidden; } .evo-tab-row .tab-row .tab .tab-close { float: right; margin: 0 -.75rem 0 .5rem; padding: .25em; line-height: 1.3em; font-size: 1.3em; font-weight: 700; color: #9e9e9e } .evo-tab-row .tab-row .tab .tab-close:hover { color: #d9534f } .evo-tab-page { position: absolute; overflow: hidden; z-index: -1; display: block; left: 0; top: 2.3em; right: 0; bottom: 0; height: auto; box-shadow: none; background-color: #fafafa; } From dde4173e8e2139233a3027dc814b2710e6ebcce0 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Fri, 30 Mar 2018 22:35:48 +0200 Subject: [PATCH 100/274] tab-header styles --- manager/media/style/default/css/tabpane.css | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/manager/media/style/default/css/tabpane.css b/manager/media/style/default/css/tabpane.css index bc0acad538..9acc2f6a46 100755 --- a/manager/media/style/default/css/tabpane.css +++ b/manager/media/style/default/css/tabpane.css @@ -22,7 +22,8 @@ .tab-pane > .tab-page > div:first-of-type, .tab-pane > .tab-page > table { margin-top: -2.5rem } .dynamic-tab-pane-control.tab-pane > .tab-page > div:first-of-type, .dynamic-tab-pane-control.tab-pane > .tab-page > table { margin-top: 0 } .tab-page { clear: both; width: 100%; background-color: #fff; padding: 0; border: 0; border-radius: 0; box-shadow: 0 0 0.3rem 0 rgba(0, 0, 0, .1) } -.tab-page .tab-header, .sectionHeader { margin-top: 1em; padding: .5rem 1.25rem; letter-spacing: .03rem } +.tab-page .tab-header, .sectionHeader { margin-top: 1em; padding: .5rem 1.25rem; letter-spacing: 0; font-size: 0.875rem; font-weight: bold; } +.tab-page .tab-header, .tab-page .tab-section .tab-header, .tab-page .sectionHeader { background-color: #f3f3f3; border-bottom-width: 1px; } .tab-page .tab-header + .tab-header, .tab-page .sectionHeader + .sectionHeader { margin-top: 0; border-top: 1px solid #ccc; } .tab-page > .tab-body .tab-header { padding-left: 0; padding-right: 0 } .tab-page > .tab-header:first-child, .tab-page > .tab-body > .tab-header:first-child, .tab-page .sectionHeader:first-child, .tab-page > script + .sectionHeader, .sectionBody .tab-page > script + .tab-section { margin-top: 0 } @@ -34,6 +35,7 @@ .tab-page .tab-section, .tab-page .sectionHeader + .sectionBody { margin-top: 1.25rem; background-color: #fafafa; border: 1px solid #e0e0e0; border-radius: .1rem; } .tab-page .tab-section:first-child, .tab-page .sectionHeader + .sectionBody, .tab-page .sectionBody ~ .sectionHeader { margin-top: 0 } .tab-page .tab-section .tab-header, .tab-page .sectionHeader { margin-left: -1px; margin-right: -1px; padding-left: .5rem; padding-right: .5rem; background-color: #efeff6; border: 1px solid #e0e0e0; border-bottom: 2px solid #e0e0ec; } +.tab-page .tab-header, .tab-page .tab-section .tab-header, .tab-page .sectionHeader { background-color: #f3f3f3; border-bottom-width: 1px; } .tab-page .tab-section .tab-header:first-child, .tab-page .sectionHeader { margin-top: 0; border-top: none } .tab-page .tab-section .tab-header + .tab-header, .tab-page .tab-section .tab-body + .tab-header, .tab-page .sectionHeader { border-top: 1px solid #e0e0e0; } .tab-page .tab-section .tab-body, .tab-page .sectionBody { padding: 1rem; } @@ -121,6 +123,7 @@ .evo-tab-page { position: absolute; overflow: hidden; z-index: -1; display: block; left: 0; top: 2.3em; right: 0; bottom: 0; height: auto; box-shadow: none; background-color: #fafafa; } .evo-tab-page.show { z-index: 1; } .evo-tab-page iframe { position: absolute; left: 0; top: 0; width: 100%; height: 100%; background-color: #fafafa; overflow: hidden; } +#tabGeneral > table { margin-bottom: 1rem; } /* dark */ .dark .evo-popup-overlay { background-color: rgba(0, 0, 0, 0.3); } .dark .evo-tab-row { background-color: #1a1c21; border-bottom: none; } From f0f0e2aaaa1098bb5a5fafffe9c089f8cbd8ba07 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Fri, 30 Mar 2018 22:39:33 +0200 Subject: [PATCH 101/274] Refactor CSS source files Refactor CSS source files for easier editing --- .../style/default/css/color.switcher.css | 467 ++-- .../media/style/default/css/contextmenu.css | 102 +- manager/media/style/default/css/custom.css | 2078 ++++++++++++++--- manager/media/style/default/css/fonts.css | 558 ++++- manager/media/style/default/css/forms.css | 417 +++- manager/media/style/default/css/index.css | 268 ++- manager/media/style/default/css/layout.css | 180 +- manager/media/style/default/css/main.css | 995 ++++++-- manager/media/style/default/css/mainmenu.css | 839 ++++++- manager/media/style/default/css/tabpane.css | 926 +++++++- manager/media/style/default/css/tree.css | 461 +++- 11 files changed, 6126 insertions(+), 1165 deletions(-) diff --git a/manager/media/style/default/css/color.switcher.css b/manager/media/style/default/css/color.switcher.css index 14cd460b96..765bf0dff3 100755 --- a/manager/media/style/default/css/color.switcher.css +++ b/manager/media/style/default/css/color.switcher.css @@ -1,299 +1,358 @@ * { - margin: 0; - padding: 0; - box-sizing: border-box; + margin: 0; + padding: 0; + box-sizing: border-box; } + .evocp-box { - position: fixed; - width: 300px; - min-height: 100%; - top: 35px; - right: -300px; - color: #444; - z-index: 10; - transition: 0.5s cubic-bezier(1, 1.48, 0.76, 0.95) right, box-shadow .5s; + position: fixed; + width: 300px; + min-height: 100%; + top: 35px; + right: -300px; + color: #444; + z-index: 10; + transition: 0.5s cubic-bezier(1, 1.48, 0.76, 0.95) right, box-shadow .5s; } + .evocp-icon { - position: absolute; - width: 34px; - height: 29px; - vertical-align: middle; - line-height: 28px; - left: -34px; - background: #fafafa; - box-shadow: -3px 0 2px 1px rgba(0, 0, 0, 0.1); - border-radius: 50% 0 0 50%; - text-align: center; - font-size: 17px; - cursor: pointer; - z-index: 10; - -webkit-animation: colorchange 15s infinite alternate; + position: absolute; + width: 34px; + height: 29px; + vertical-align: middle; + line-height: 28px; + left: -34px; + background: #fafafa; + box-shadow: -3px 0 2px 1px rgba(0, 0, 0, 0.1); + border-radius: 50% 0 0 50%; + text-align: center; + font-size: 17px; + cursor: pointer; + z-index: 10; + -webkit-animation: colorchange 15s infinite alternate; } + .dark .evocp-icon { - background: #2f323a; - border: 1px solid #2f323a; - border-right: 0; - -webkit-animation: colorchange 15s infinite alternate; + background: #2f323a; + border: 1px solid #2f323a; + border-right: 0; + -webkit-animation: colorchange 15s infinite alternate; } + i.evocpicon:hover { - -webkit-transform: rotate(30deg); - -moz-transform: rotate(30deg); - -ms-transform: rotate(30deg); - -o-transform: rotate(30deg); - transform: rotate(30deg); + -webkit-transform: rotate(30deg); + -moz-transform: rotate(30deg); + -ms-transform: rotate(30deg); + -o-transform: rotate(30deg); + transform: rotate(30deg); } + @keyframes colorchange { - 0% { - color: #b45f06; - } - 10% { - color: #38761d; - } - 20% { - color: #134f5c; - } - 30% { - color: #0b5394; - } - 40% { - color: #351c75; - } - 50% { - color: #741b47; - } - 60% { - color: blue; - } - 70% { - color: #2980b9; - } - 80% { - color: #f1c40f; - } - 90% { - color: #2980b9; - } - 100% { - color: #900; - } + 0% { + color: #b45f06; + } + 10% { + color: #38761d; + } + 20% { + color: #134f5c; + } + 30% { + color: #0b5394; + } + 40% { + color: #351c75; + } + 50% { + color: #741b47; + } + 60% { + color: blue; + } + 70% { + color: #2980b9; + } + 80% { + color: #f1c40f; + } + 90% { + color: #2980b9; + } + 100% { + color: #900; + } } + @-webkit-keyframes colorchange /* Safari and Chrome - necessary duplicate */ -{ - 0% { - color: #b45f06; - } - 10% { - color: #38761d; - } - 20% { - color: #134f5c; - } - 30% { - color: #0b5394; - } - 40% { - color: #351c75; - } - 50% { - color: #741b47; - } - 60% { - color: blue; - } - 70% { - color: #2980b9; - } - 80% { - color: #f1c40f; - } - 90% { - color: #2980b9; - } - 100% { - color: #900; - } + { + 0% { + color: #b45f06; + } + 10% { + color: #38761d; + } + 20% { + color: #134f5c; + } + 30% { + color: #0b5394; + } + 40% { + color: #351c75; + } + 50% { + color: #741b47; + } + 60% { + color: blue; + } + 70% { + color: #2980b9; + } + 80% { + color: #f1c40f; + } + 90% { + color: #2980b9; + } + 100% { + color: #900; + } } + .evocp-box .evocp-frame { - position: absolute; - width: 100%; - height: 100%; - top: 0; - right: 0; - background: #fafafa; - text-align: center; - font-weight: 700; - color: #444; - padding: 0 0 20px 0; + position: absolute; + width: 100%; + height: 100%; + top: 0; + right: 0; + background: #fafafa; + text-align: center; + font-weight: 700; + color: #444; + padding: 0 0 20px 0; } + .dark .evocp-box .evocp-frame { - color: #dedede; - background: #202329; - border-top: 1px solid #2f323a; + color: #dedede; + background: #202329; + border-top: 1px solid #2f323a; } + .evocp-box .evocp-menuHColors, .evocp-box .evocp-menuColors, .evocp-box .evocp-bgmcolors, .evocp-box .evocp-colors, .evocp-box .evocp-alinkcolors { - margin: 10px; - overflow: hidden; + margin: 10px; + overflow: hidden; } + .evocp-box .evocp-menuHColor, .evocp-box .evocp-menuColor, .evocp-box .evocp-bgmcolor, .evocp-box .evocp-color, .evocp-box .evocp-alinkcolor { - position: relative; - float: left; - margin: 2px; - height: 31px; - width: 31px; - max-height: 31px; - max-width: 31px; - background: #2f323a; - color: transparent; - overflow: hidden; - cursor: pointer; - border: 1px solid #646b7b; - border-radius: 50%; + position: relative; + float: left; + margin: 2px; + height: 31px; + width: 31px; + max-height: 31px; + max-width: 31px; + background: #2f323a; + color: transparent; + overflow: hidden; + cursor: pointer; + border: 1px solid #646b7b; + border-radius: 50%; } + .evocp-box .evocp-custom-colors, .evocp-box .evocp-custom-colors { - clear: both; - padding-top: 20px; + clear: both; + padding-top: 20px; } + .evocp-box input[name="evocpCustomalinkcolor"], .evocp-box input[name="evocpCustommenuColor"], .evocp-box input[name="evocpCustommenuHColor"], .evocp-box input[name="evocpCustombgmColor"], .evocp-box input[name="evocpCustomTXColor"] { - margin: 10px 0 0 -4px; - cursor: pointer; - height: 30px; - width: 30px; - border-radius: 50%; - border: none; - outline: none; - background: transparent; - padding: 0; + margin: 10px 0 0 -4px; + cursor: pointer; + height: 30px; + width: 30px; + border-radius: 50%; + border: none; + outline: none; + background: transparent; + padding: 0; } + .appear-it { - right: 0; - box-shadow: -3px 0 4px 1px rgba(0, 0, 0, 0.1); + right: 0; + box-shadow: -3px 0 4px 1px rgba(0, 0, 0, 0.1); } .evocp-frame h2 { - font-size: 1.0rem; - line-height: 1.6rem; - border-bottom: 1px solid #dedede; - padding-top: 4px; - /* -webkit-animation: colorchange 20s infinite alternate;*/ + font-size: 1.0rem; + line-height: 1.6rem; + border-bottom: 1px solid #dedede; + padding-top: 4px; + /* -webkit-animation: colorchange 20s infinite alternate;*/ } + .dark .evocp-frame h2 { - background-color: #2f323a; - border-bottom: 1px solid #dedede; + background-color: #2f323a; + border-bottom: 1px solid #dedede; } + .evocp-frame .panel-heading h3 { - cursor: pointer; - display: inline-block; - font-size: 0.8rem; - line-height: 1.1rem; - margin-top: 9px; + cursor: pointer; + display: inline-block; + font-size: 0.8rem; + line-height: 1.1rem; + margin-top: 9px; } + .evocp-frame .panel-heading h3:hover { - color: #000; + color: #000; } + .dark .evocp-frame h3:hover { - color: #fff; + color: #fff; } + .evocp-frame .panel { - margin-bottom: 2px; + margin-bottom: 2px; } + .evocp-frame .panel-heading { - text-align: left; - border-top: 1px solid #dedede; - border-bottom: 1px solid #dedede; - background-color: #f2f2f2; - padding: 0 0 0 8px; - text-transform: uppercase; + text-align: left; + border-top: 1px solid #dedede; + border-bottom: 1px solid #dedede; + background-color: #f2f2f2; + padding: 0 0 0 8px; + text-transform: uppercase; } + .dark .evocp-frame .panel-heading { - background-color: #2f323a; - border-color: #3e4144; + background-color: #2f323a; + border-color: #3e4144; } + .evocp-frame .panel-heading .btn { - margin-top: 2px + margin-top: 2px } + .dark .evocp-frame .panel-heading .btn { - background-color: #2f323a; - border-color: #3e4144; - color: #fafafa; + background-color: #2f323a; + border-color: #3e4144; + color: #fafafa; } + .dark .evocp-frame .panel-heading .btn:hover { - background-color: #1a1c21; + background-color: #1a1c21; } + .dark .evocp-frame h2 { - border-color: #3e4144; + border-color: #3e4144; } + .evocp-frame .panel-heading .togglearrow { - width: 10px; - font-size: 10px; - color: #bbb; - margin-right: 2px; - margin-top:-5px; + width: 10px; + font-size: 10px; + color: #bbb; + margin-right: 2px; + margin-top: -5px; } + .evocp-box .evocp-menuHColor.colorSelected:before, .evocp-box .evocp-menuColor.colorSelected:before, .evocp-box .evocp-bgmcolor.colorSelected:before, .evocp-box .evocp-color.colorSelected:before, .evocp-box .evocp-alinkcolor.colorSelected:before { - font-family: FontAwesome; - content: "\f1fc"; - display: inline-block; - padding-top: 3px; - vertical-align: middle; - color: #FFF; + font-family: FontAwesome; + content: "\f1fc"; + display: inline-block; + padding-top: 3px; + vertical-align: middle; + color: #FFF; } + .evocp-box .evocp-menuHColor.evocp_light.colorSelected:before, .evocp-box .evocp-menuColor.evocp_light.colorSelected:before, .evocp-box .evocp-bgmcolor.evocp_light.colorSelected:before, .evocp-box .evocp-color.evocp_light.colorSelected:before, .evocp-box .evocp-alinkcolor.evocp_light.colorSelected:before { - color: #444!important; + color: #444!important; } -.dark .evocp-box .btn-secondary{ - background-color: #2f323a; - border-color: #3e4144; - color: #fafafa; +.dark .evocp-box .btn-secondary { + background-color: #2f323a; + border-color: #3e4144; + color: #fafafa; } + /*fix for mainmenu*/ + /* #mainMenu.show .nav > li.dropdown.hover > a { background-color: #fff; color: #666!important; } /* color picker*/ + .sp-picker-container { - width:200px; - border-left:0!important; -} -.sp-container {width:300px; background: #f2f2f2; border: 1px solid #dedede;} -.dark .sp-container {background: #2f323a; border: 1px solid #3e4144;} -.evo-cp-replacer, .sp-replacer.sp-light {padding:2px; background: #f2f2f2; border-color: #dedede; margin:3px auto;} -.dark .evo-cp-replacer, .dark .sp-replacer.sp-light {background: #2f323a; border-color: #3e4144;} -.sp-dd {margin-top:4px;color:#666;} -.dark .sp-dd {color:#bcbec0;} + width: 200px; + border-left: 0!important; +} + +.sp-container { + width: 300px; + background: #f2f2f2; + border: 1px solid #dedede; +} + +.dark .sp-container { + background: #2f323a; + border: 1px solid #3e4144; +} + +.evo-cp-replacer, +.sp-replacer.sp-light { + padding: 2px; + background: #f2f2f2; + border-color: #dedede; + margin: 3px auto; +} + +.dark .evo-cp-replacer, +.dark .sp-replacer.sp-light { + background: #2f323a; + border-color: #3e4144; +} + +.sp-dd { + margin-top: 4px; + color: #666; +} + +.dark .sp-dd { + color: #bcbec0; +} + .sp-preview { - height: 25px; - width: 25px; - max-height: 25px; - max-width: 25px; - overflow: hidden; - cursor: pointer; - border-radius: 50%; - border: 0px solid #2f323a; + height: 25px; + width: 25px; + max-height: 25px; + max-width: 25px; + overflow: hidden; + cursor: pointer; + border-radius: 50%; + border: 0px solid #2f323a; } diff --git a/manager/media/style/default/css/contextmenu.css b/manager/media/style/default/css/contextmenu.css index 2447ea6a23..6d14313886 100755 --- a/manager/media/style/default/css/contextmenu.css +++ b/manager/media/style/default/css/contextmenu.css @@ -1,11 +1,93 @@ /* contextmenu */ -#mx_contextmenu, #contextmenu, .nu-context-menu, .contextMenu { display: block !important; position: absolute; overflow: hidden; top: 0; max-width: 25rem; width: auto !important; height: auto; padding: 0.25rem 0; visibility: hidden; opacity: 0; z-index: 10000; background: #fff; font-size: 0.9em; border: none; border-radius: 0.25rem; -webkit-box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); transition: opacity 0s, visibility 0s; transform: translateZ(0) } -#mx_contextmenu .fa, #contextmenu .fa, .nu-context-menu .fa, .contextMenu .fa { width: 1.3em; font-size: 0.9rem; text-align: center; } -#mx_contextmenu.show, #contextmenu.show, .nu-context-menu.active, .contextMenu { visibility: visible; opacity: 1; transition: opacity 0.1s, visibility 0.1s; } -#mx_contextmenu > div, #contextmenu > div, .nu-context-menu ul li, .contextMenu > div { padding: 0.5em 2em 0.5em 1em; } -#mx_contextmenu #nameHolder, #contextmenu .menuHeader, .nu-context-menu-title { color: #1377c5; padding: 0.75em 1em; } -#mx_contextmenu .menuLink, #contextmenu .menuLink, .nu-context-menu ul li, .contextMenu > div { cursor: pointer; } -#mx_contextmenu .menuLink:hover, #contextmenu .menuLink:hover, .nu-context-menu ul li:hover, .contextMenu > div:hover { background-color: #1976d2; color: #fff; } -#mx_contextmenu .seperator, #contextmenu .seperator, .nu-context-menu ul hr, .contextMenu .cntxMnuSeparator { height: 1px; background-color: rgba(0, 0, 0, 0.07) !important; margin: 0.25em 0; padding: 0; cursor: default; } -.nu-context-menu ul { margin: 0; padding: 0; } -.contextMenu .cntxMnuItem { white-space: nowrap } + +#mx_contextmenu, +#contextmenu, +.nu-context-menu, +.contextMenu { + display: block !important; + position: absolute; + overflow: hidden; + top: 0; + max-width: 25rem; + width: auto !important; + height: auto; + padding: 0.25rem 0; + visibility: hidden; + opacity: 0; + z-index: 10000; + background: #fff; + font-size: 0.9em; + border: none; + border-radius: 0.25rem; + -webkit-box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); + box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); + transition: opacity 0s, visibility 0s; + transform: translateZ(0) +} + +#mx_contextmenu .fa, +#contextmenu .fa, +.nu-context-menu .fa, +.contextMenu .fa { + width: 1.3em; + font-size: 0.9rem; + text-align: center; +} + +#mx_contextmenu.show, +#contextmenu.show, +.nu-context-menu.active, +.contextMenu { + visibility: visible; + opacity: 1; + transition: opacity 0.1s, visibility 0.1s; +} + +#mx_contextmenu > div, +#contextmenu > div, +.nu-context-menu ul li, +.contextMenu > div { + padding: 0.5em 2em 0.5em 1em; +} + +#mx_contextmenu #nameHolder, +#contextmenu .menuHeader, +.nu-context-menu-title { + color: #1377c5; + padding: 0.75em 1em; +} + +#mx_contextmenu .menuLink, +#contextmenu .menuLink, +.nu-context-menu ul li, +.contextMenu > div { + cursor: pointer; +} + +#mx_contextmenu .menuLink:hover, +#contextmenu .menuLink:hover, +.nu-context-menu ul li:hover, +.contextMenu > div:hover { + background-color: #1976d2; + color: #fff; +} + +#mx_contextmenu .seperator, +#contextmenu .seperator, +.nu-context-menu ul hr, +.contextMenu .cntxMnuSeparator { + height: 1px; + background-color: rgba(0, 0, 0, 0.07) !important; + margin: 0.25em 0; + padding: 0; + cursor: default; +} + +.nu-context-menu ul { + margin: 0; + padding: 0; +} + +.contextMenu .cntxMnuItem { + white-space: nowrap +} diff --git a/manager/media/style/default/css/custom.css b/manager/media/style/default/css/custom.css index 5fa1d3c571..1072c01362 100755 --- a/manager/media/style/default/css/custom.css +++ b/manager/media/style/default/css/custom.css @@ -1,354 +1,1833 @@ /* [ COLS ] */ -.row { margin-left: -1.25rem; margin-right: -1.25rem } -.container { padding-left: 1.25rem; padding-right: 1.25rem; width: 100% } + +.row { + margin-left: -1.25rem; + margin-right: -1.25rem +} + +.container { + padding-left: 1.25rem; + padding-right: 1.25rem; + width: 100% +} + /* :TODO .container-body need remove and replace .tab-content */ -.container-body { padding: 1.25rem } + +.container-body { + padding: 1.25rem +} + /* [ FORMS ] */ -.form-row { margin-bottom: 0.25rem; } -.form-row.row { margin-left: 0; margin-right: -1rem } -.form-row label { margin-bottom: 0.15rem } -.form-row .col, .form-row .col-1, .form-row .col-10, .form-row .col-11, .form-row .col-12, .form-row .col-2, .form-row .col-3, .form-row .col-4, .form-row .col-5, .form-row .col-6, .form-row .col-7, .form-row .col-8, .form-row .col-9, .form-row .col-lg, .form-row .col-lg-1, .form-row .col-lg-10, .form-row .col-lg-11, .form-row .col-lg-12, .form-row .col-lg-2, .form-row .col-lg-3, .form-row .col-lg-4, .form-row .col-lg-5, .form-row .col-lg-6, .form-row .col-lg-7, .form-row .col-lg-8, .form-row .col-lg-9, .form-row .col-md, .form-row .col-md-1, .form-row .col-md-10, .form-row .col-md-11, .form-row .col-md-12, .form-row .col-md-2, .form-row .col-md-3, .form-row .col-md-4, .form-row .col-md-5, .form-row .col-md-6, .form-row .col-md-7, .form-row .col-md-8, .form-row .col-md-9, .form-row .col-sm, .form-row .col-sm-1, .form-row .col-sm-10, .form-row .col-sm-11, .form-row .col-sm-12, .form-row .col-sm-2, .form-row .col-sm-3, .form-row .col-sm-4, .form-row .col-sm-5, .form-row .col-sm-6, .form-row .col-sm-7, .form-row .col-sm-8, .form-row .col-sm-9, .form-row .col-xl, .form-row .col-xl-1, .form-row .col-xl-10, .form-row .col-xl-11, .form-row .col-xl-12, .form-row .col-xl-2, .form-row .col-xl-3, .form-row .col-xl-4, .form-row .col-xl-5, .form-row .col-xl-6, .form-row .col-xl-7, .form-row .col-xl-8, .form-row .col-xl-9, .form-row .col-xs, .form-row .col-xs-1, .form-row .col-xs-10, .form-row .col-xs-11, .form-row .col-xs-12, .form-row .col-xs-2, .form-row .col-xs-3, .form-row .col-xs-4, .form-row .col-xs-5, .form-row .col-xs-6, .form-row .col-xs-7, .form-row .col-xs-8, .form-row .col-xs-9 { padding-left: 0 } -.form-row .form-control { float: left; } -.form-inline .form-row .form-control { float: none; } -.container-body > .form-group:last-child, .container-body > .form-row:last-child, .container-body > p:last-child, .container-body > .form-group:last-child > p:last-child { margin-bottom: 0 } -.form-control-name { position: relative; } -.form-control-name .form-control { padding-right: 2em } -.form-control-name .custom-control { display: block; overflow: hidden; position: absolute; z-index: 3; top: 0; right: 0; width: 2em; height: 100%; margin: 0; padding: 0; cursor: pointer } -.form-control-name .custom-control input { position: absolute; left: -100% } -.form-control-name .custom-control .fa-lock { margin-top: 0.6em; font-size: 1.5em } -.form-control-name .custom-control .fa-lock::before { content: "\f09c"; color: #ddd } -.form-control-name .custom-control input:checked ~ .fa-lock::before { content: "\f023"; color: #d9534f } -input[type=date]:not(.unstyled), input[name*=date]:not(.unstyled):not([type=checkbox]):not([type=radio]), input[name=createdon], input[name=editedon], input[size="1"], select[name=usergroup]:not(.unstyled), select[name=docgroup]:not(.unstyled) { width: auto !important; vertical-align: middle } -select[size="1"]:not(.unstyled) { vertical-align: middle } -input[name*=date]:not(.unstyled) + .input-group-addon { float: left; width: auto; } -input[size="50"], select[size="50"] { width: 10rem !important } -select[name=usergroup], select[name=docgroup] { margin: 0 0.5em; } -select[name=docgroup] + input[type=submit] { float: none; margin: 0; } -#settingsPane #filemanager_path, #settingsPane #rb_base_dir, #settingsPane input[name=txt_custom_contenttype] { border-top-right-radius: 0; border-bottom-right-radius: 0 } -#settingsPane #filemanager_path + input[name=reset_filemanager_path], #settingsPane #rb_base_dir + input[name=reset_rb_base_dir], #settingsPane input[name=txt_custom_contenttype] + input[type=button], input[name=photo] + input[type=button], #range input#pids + input[name=fsubmit], input[name="ta"].inputBox + input[type=button], input[name="ta"].inputBox + .CodeMirror + input[type=button], #documentPane input[name^=tv]:not([class*=mtv]) + input[type=button] { z-index: 5; float: right; margin-top: -2.30769em; width: auto !important; border-top-left-radius: 0; border-bottom-left-radius: 0 } -#settingsPane [name=site_name], #settingsPane [name=txt_custom_contenttype], #settingsPane [name=filemanager_path], #settingsPane [name=rb_base_dir], input[name=photo], #range input#pids, input[maxlength="350"], textarea.mce, #editorRow_TinyMCE { width: 100% !important } -#range::after { content: ""; display: table; width: 100% } + +.form-row { + margin-bottom: 0.25rem; +} + +.form-row.row { + margin-left: 0; + margin-right: -1rem +} + +.form-row label { + margin-bottom: 0.15rem +} + +.form-row .col, +.form-row .col-1, +.form-row .col-10, +.form-row .col-11, +.form-row .col-12, +.form-row .col-2, +.form-row .col-3, +.form-row .col-4, +.form-row .col-5, +.form-row .col-6, +.form-row .col-7, +.form-row .col-8, +.form-row .col-9, +.form-row .col-lg, +.form-row .col-lg-1, +.form-row .col-lg-10, +.form-row .col-lg-11, +.form-row .col-lg-12, +.form-row .col-lg-2, +.form-row .col-lg-3, +.form-row .col-lg-4, +.form-row .col-lg-5, +.form-row .col-lg-6, +.form-row .col-lg-7, +.form-row .col-lg-8, +.form-row .col-lg-9, +.form-row .col-md, +.form-row .col-md-1, +.form-row .col-md-10, +.form-row .col-md-11, +.form-row .col-md-12, +.form-row .col-md-2, +.form-row .col-md-3, +.form-row .col-md-4, +.form-row .col-md-5, +.form-row .col-md-6, +.form-row .col-md-7, +.form-row .col-md-8, +.form-row .col-md-9, +.form-row .col-sm, +.form-row .col-sm-1, +.form-row .col-sm-10, +.form-row .col-sm-11, +.form-row .col-sm-12, +.form-row .col-sm-2, +.form-row .col-sm-3, +.form-row .col-sm-4, +.form-row .col-sm-5, +.form-row .col-sm-6, +.form-row .col-sm-7, +.form-row .col-sm-8, +.form-row .col-sm-9, +.form-row .col-xl, +.form-row .col-xl-1, +.form-row .col-xl-10, +.form-row .col-xl-11, +.form-row .col-xl-12, +.form-row .col-xl-2, +.form-row .col-xl-3, +.form-row .col-xl-4, +.form-row .col-xl-5, +.form-row .col-xl-6, +.form-row .col-xl-7, +.form-row .col-xl-8, +.form-row .col-xl-9, +.form-row .col-xs, +.form-row .col-xs-1, +.form-row .col-xs-10, +.form-row .col-xs-11, +.form-row .col-xs-12, +.form-row .col-xs-2, +.form-row .col-xs-3, +.form-row .col-xs-4, +.form-row .col-xs-5, +.form-row .col-xs-6, +.form-row .col-xs-7, +.form-row .col-xs-8, +.form-row .col-xs-9 { + padding-left: 0 +} + +.form-row .form-control { + float: left; +} + +.form-inline .form-row .form-control { + float: none; +} + +.container-body > .form-group:last-child, +.container-body > .form-row:last-child, +.container-body > p:last-child, +.container-body > .form-group:last-child > p:last-child { + margin-bottom: 0 +} + +.form-control-name { + position: relative; +} + +.form-control-name .form-control { + padding-right: 2em +} + +.form-control-name .custom-control { + display: block; + overflow: hidden; + position: absolute; + z-index: 3; + top: 0; + right: 0; + width: 2em; + height: 100%; + margin: 0; + padding: 0; + cursor: pointer +} + +.form-control-name .custom-control input { + position: absolute; + left: -100% +} + +.form-control-name .custom-control .fa-lock { + margin-top: 0.6em; + font-size: 1.5em +} + +.form-control-name .custom-control .fa-lock::before { + content: "\f09c"; + color: #ddd +} + +.form-control-name .custom-control input:checked ~ .fa-lock::before { + content: "\f023"; + color: #d9534f +} + +input[type=date]:not(.unstyled), +input[name*=date]:not(.unstyled):not([type=checkbox]):not([type=radio]), +input[name=createdon], +input[name=editedon], +input[size="1"], +select[name=usergroup]:not(.unstyled), +select[name=docgroup]:not(.unstyled) { + width: auto !important; + vertical-align: middle +} + +select[size="1"]:not(.unstyled) { + vertical-align: middle +} + +input[name*=date]:not(.unstyled) + .input-group-addon { + float: left; + width: auto; +} + +input[size="50"], +select[size="50"] { + width: 10rem !important +} + +select[name=usergroup], +select[name=docgroup] { + margin: 0 0.5em; +} + +select[name=docgroup] + input[type=submit] { + float: none; + margin: 0; +} + +#settingsPane #filemanager_path, +#settingsPane #rb_base_dir, +#settingsPane input[name=txt_custom_contenttype] { + border-top-right-radius: 0; + border-bottom-right-radius: 0 +} + +#settingsPane #filemanager_path + input[name=reset_filemanager_path], +#settingsPane #rb_base_dir + input[name=reset_rb_base_dir], +#settingsPane input[name=txt_custom_contenttype] + input[type=button], +input[name=photo] + input[type=button], +#range input#pids + input[name=fsubmit], +input[name="ta"].inputBox + input[type=button], +input[name="ta"].inputBox + .CodeMirror + input[type=button], +#documentPane input[name^=tv]:not([class*=mtv]) + input[type=button] { + z-index: 5; + float: right; + margin-top: -2.30769em; + width: auto !important; + border-top-left-radius: 0; + border-bottom-left-radius: 0 +} + +#settingsPane [name=site_name], +#settingsPane [name=txt_custom_contenttype], +#settingsPane [name=filemanager_path], +#settingsPane [name=rb_base_dir], +input[name=photo], +#range input#pids, +input[maxlength="350"], +textarea.mce, +#editorRow_TinyMCE { + width: 100% !important +} + +#range::after { + content: ""; + display: table; + width: 100% +} + /* [ Editor ] */ -.navbar.navbar-editor { padding: .5rem 1.25rem; border-radius: 0 } -.navbar-editor > label { margin-bottom: 0 } -.section-editor textarea { float: left; border-left: none; border-right: none; font-family: 'Inconsolata', 'Monaco', 'Consolas', 'Courier New', 'Courier', monospace; font-weight: 300; font-size: 0.875rem; } + +.navbar.navbar-editor { + padding: .5rem 1.25rem; + border-radius: 0 +} + +.navbar-editor > label { + margin-bottom: 0 +} + +.section-editor textarea { + float: left; + border-left: none; + border-right: none; + font-family: 'Inconsolata', 'Monaco', 'Consolas', 'Courier New', 'Courier', monospace; + font-weight: 300; + font-size: 0.875rem; +} + /* [ Action Buttons ] */ + /* new style */ -#actions { background: rgba(199, 199, 199, 0.25); padding: 0.5rem; position: fixed; top: 0; right: 1rem; text-align: right; z-index: 1001; border-radius: 0 0 0.3rem 0.3rem; } -#actions .btn-group { margin: 0 } -#actions .btn-group > .btn-group { display: block } -#actions .btn-group .btn, #actions .btn-group .form-control { font-size: .6772rem; height: 2.4em; line-height: 1.4 } -#actions .btn-group .btn .fa, #_actions .btn-group .btn .fa { display: none; width: 1em; font-size: 1em; text-align: center } -#actions .btn-group .btn-group #Button1 { min-width: 100%; text-align: left; float: right; } -#actions .btn-group .btn-success { box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .07); } -#actions .btn-group .btn-success:hover { box-shadow: none } -#actions .btn-group .plus { z-index: 2; float: right; margin: -2.4em 0 0 0; width: 2rem; padding-left: 0; padding-right: 0; text-align: center; cursor: default; } -#actions .btn-group .plus::before { content: "\f107"; font-family: FontAwesome } -#actions .btn-group .show .plus::before { content: "\f106"; } -#actions .btn-group select#stay { display: block; position: relative; z-index: -1; clear: both; width: auto; height: 0; margin: -100% 0 -2rem 0; font-size: 0.675rem; opacity: 0; visibility: hidden; } -#actions .btn-group .dropdown-menu { display: none; position: absolute; z-index: -1; left: auto; right: 0; top: 100%; width: 100%; min-width: 2rem; margin: 0; padding: 0; text-align: left; font-size: .6772rem; border-top: none; border-radius: 0 0 0.1em 0.1em; overflow: hidden; } -#actions .btn-group .show > .dropdown-menu { display: block } -#actions .btn-group .dropdown-menu > span { display: block; margin: 0; text-align: left; border: none; border-top: 1px solid rgba(0, 0, 0, 0.1) } -#actions .btn-group .dropdown-menu > span:first-child { border-color: transparent } -#actions .btn-group .dropdown-menu > span:hover { background-color: #e6e6e6; } -#actions .btn-group .dropdown-toggle::after { margin: 0; border-width: 0.4em; transition-duration: 0.25s } -#actions .btn-group .show .dropdown-toggle::after { transform: rotate(180deg) } -#_actions .btn-group .input-group-btn .btn { margin-left: .1875rem } -#_actions .btn-group .form-control, #_actions .btn-group .btn { border-radius: .1em } + +#actions { + background: rgba(199, 199, 199, 0.25); + padding: 0.5rem; + position: fixed; + top: 0; + right: 1rem; + text-align: right; + z-index: 1001; + border-radius: 0 0 0.3rem 0.3rem; +} + +#actions .btn-group { + margin: 0 +} + +#actions .btn-group > .btn-group { + display: block +} + +#actions .btn-group .btn, +#actions .btn-group .form-control { + font-size: .6772rem; + height: 2.4em; + line-height: 1.4 +} + +#actions .btn-group .btn .fa, +#_actions .btn-group .btn .fa { + display: none; + width: 1em; + font-size: 1em; + text-align: center +} + +#actions .btn-group .btn-group #Button1 { + min-width: 100%; + text-align: left; + float: right; +} + +#actions .btn-group .btn-success { + box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .07); +} + +#actions .btn-group .btn-success:hover { + box-shadow: none +} + +#actions .btn-group .plus { + z-index: 2; + float: right; + margin: -2.4em 0 0 0; + width: 2rem; + padding-left: 0; + padding-right: 0; + text-align: center; + cursor: default; +} + +#actions .btn-group .plus::before { + content: "\f107"; + font-family: FontAwesome +} + +#actions .btn-group .show .plus::before { + content: "\f106"; +} + +#actions .btn-group select#stay { + display: block; + position: relative; + z-index: -1; + clear: both; + width: auto; + height: 0; + margin: -100% 0 -2rem 0; + font-size: 0.675rem; + opacity: 0; + visibility: hidden; +} + +#actions .btn-group .dropdown-menu { + display: none; + position: absolute; + z-index: -1; + left: auto; + right: 0; + top: 100%; + width: 100%; + min-width: 2rem; + margin: 0; + padding: 0; + text-align: left; + font-size: .6772rem; + border-top: none; + border-radius: 0 0 0.1em 0.1em; + overflow: hidden; +} + +#actions .btn-group .show > .dropdown-menu { + display: block +} + +#actions .btn-group .dropdown-menu > span { + display: block; + margin: 0; + text-align: left; + border: none; + border-top: 1px solid rgba(0, 0, 0, 0.1) +} + +#actions .btn-group .dropdown-menu > span:first-child { + border-color: transparent +} + +#actions .btn-group .dropdown-menu > span:hover { + background-color: #e6e6e6; +} + +#actions .btn-group .dropdown-toggle::after { + margin: 0; + border-width: 0.4em; + transition-duration: 0.25s +} + +#actions .btn-group .show .dropdown-toggle::after { + transform: rotate(180deg) +} + +#_actions .btn-group .input-group-btn .btn { + margin-left: .1875rem +} + +#_actions .btn-group .form-control, +#_actions .btn-group .btn { + border-radius: .1em +} + @media (max-width: 840px) { -#actions { right: 0 } -#actions .btn-group .btn span, #actions .btn-group select#stay, #_actions .btn-group .btn span { display: none } -#actions .btn-group .btn .fa, #_actions .btn-group .btn .fa { display: inline-block } -#actions .btn-group .dropdown-menu { width: 2rem } -#actions .btn-group .dropdown-menu span { padding-left: 0; padding-right: 0; text-align: center } -#_actions .btn-group .input-group-btn .btn { margin-left: -1px } -#_actions .btn-group .form-control, #_actions .btn-group .btn { border-radius: 0 } -#_actions .btn-group .form-control:first-child { border-top-left-radius: .1em; border-bottom-left-radius: .1em; } -#_actions .btn-group .btn:last-child { border-top-right-radius: .1em; border-bottom-right-radius: .1em; } + #actions { + right: 0 + } + #actions .btn-group .btn span, + #actions .btn-group select#stay, + #_actions .btn-group .btn span { + display: none + } + #actions .btn-group .btn .fa, + #_actions .btn-group .btn .fa { + display: inline-block + } + #actions .btn-group .dropdown-menu { + width: 2rem + } + #actions .btn-group .dropdown-menu span { + padding-left: 0; + padding-right: 0; + text-align: center + } + #_actions .btn-group .input-group-btn .btn { + margin-left: -1px + } + #_actions .btn-group .form-control, + #_actions .btn-group .btn { + border-radius: 0 + } + #_actions .btn-group .form-control:first-child { + border-top-left-radius: .1em; + border-bottom-left-radius: .1em; + } + #_actions .btn-group .btn:last-child { + border-top-right-radius: .1em; + border-bottom-right-radius: .1em; + } +} + +/* old style */ + +#actions .actionButtons { + float: left; + min-height: 32px +} + +#actions .actionButtons li { + position: relative; + float: left; + margin-right: 3px; + border: none +} + +#actions .actionButtons li a, +#actions .actionButtons .plus { + float: left; + padding: 0 10px !important; + height: 32px; + line-height: 30px; + -webkit-user-select: none; + user-select: none; +} + +#actions .actionButtons li:last-child { + margin: 0 +} + +#actions .actionButtons #Button1 a { + width: 100%; + text-align: left; +} + +#actions .actionButtons .plus { + overflow: hidden; + float: right; + margin: -32px 0 0 0; + width: 35px; + border-radius: 0 3px 3px 0 !important; + text-align: center; + cursor: default; + font: normal normal normal 0/30px FontAwesome +} + +#actions .actionButtons .plus::before { + content: "\f107"; + font-size: 14px +} + +#actions .actionButtons .show .plus::before { + content: "\f106"; +} + +#actions .actionButtons .dropdown-menu { + display: none; + position: absolute; + z-index: -1; + left: auto; + right: 0; + top: 100%; + width: 100%; + min-width: 35px; + margin: -2px 0 0; + padding: 2px 0 0; + text-align: left; + font-size: 1em; + background-color: #fff; + border: 1px solid #32ab9a; + border-top: none; + border-radius: 0 0 3px 3px; + overflow: hidden; +} + +#actions .actionButtons .show > .dropdown-menu { + display: block +} + +#actions .actionButtons .dropdown-menu > span { + display: block; + padding: 0 10px; + height: 32px; + line-height: 30px; + border: none; + border-top: 1px solid #f2f2f2; + cursor: pointer; +} + +#actions .actionButtons .dropdown-menu > span:hover { + background-color: #fbfbfb; +} + +#actions .actionButtons select#stay { + display: block; + position: relative; + z-index: -1; + clear: both; + width: auto; + height: 0; + padding: 0 10px; + margin: -100% 0 -32px 0; + font-size: 1em; + opacity: 0; + visibility: hidden; +} + +#actions .actionButtons #Button1 a, +#actions .actionButtons .plus { + color: #fff; + border-color: #32ab9a; + background: #32ab9a linear-gradient(#32ab9a, #00948e); +} + +#actions .actionButtons #Button1 a:hover, +#actions .actionButtons .plus:hover { + background: #2b9385 linear-gradient(#2b9385, #007571); + border-color: #2b9385; +} + +#actions .actionButtons #Button1 a:active, +#actions .actionButtons .plus:active { + background: #32ab9a; + border-color: #32ab9a; +} + +@media (max-width: 900px) { + #actions .actionButtons li a, + #actions .actionButtons .dropdown-menu span { + font-size: 0 + } + #actions .actionButtons li a .fa, + #actions .actionButtons .dropdown-menu span .fa { + display: inline-block; + font-size: 14px; + line-height: 30px + } + #actions .actionButtons .dropdown-menu { + width: 35px + } + #actions .actionButtons #Button1 a { + margin: 0; + width: auto + } + #actions .actionButtons .plus { + margin: 0 0 0 -2px + } + #actions .actionButtons select#stay { + display: none + } +} + +/* actionButtons in content ( old style ) */ + +.actionButtons { + margin: 0; + padding: 0; + background: none; + width: auto; + white-space: nowrap; +} + +.actionButtons li { + float: left; + margin: 0; + padding: 0; + list-style: none; +} + +.actionButtons li:before, +.mmTagList li:before, +.rTable li:before, +.tab-pane ul li ul li:before, +.dashboard li:before, +div#idShowHideSocialBox.sectionBody > div.btn-group.ope > ul.dropdown-menu > li:before, +.sectionBody .multitv .list li:before { + display: none; + content: ''; +} + +.actionButtons img { + vertical-align: top; + margin-top: 1px; + opacity: 0.3; +} + +.actionButtons:hover img { + opacity: 1; +} + +.actionButtons a:hover { + border-color: #999; + -webkit-box-shadow: 1px 1px 2px #aaa; + box-shadow: 1px 1px 2px #aaa; + -webkit-transition: .3s ease; + transition: .3s ease; + background: -moz-linear-gradient(#fff, #f5f5f5); + background: -webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#f5f5f5)); + background: -o-linear-gradient(#fff, #f5f5f5); + text-decoration: none !important; +} + +.actionButtons a:active { + background: #92aac4 bottom left; + -webkit-box-shadow: 0 0 10px #b8c7d6; + box-shadow: 0 0 10px #b8c7d6; +} + +.actionButtons a { + float: left; + padding: 5px 10px; + height: 32px; + font-size: 13px; + font-weight: 500; +} + +.actionButtons a, +.actionButtons li.primary a, +.actionButtons a.primary, +.actionButtons a.default { + text-shadow: none; + background: #fff; + color: #555; + border: 1px solid #e4e4e4; + border-radius: 3px; + /*box-shadow: 0 0 0 1px #E4E4E4;*/ + box-shadow: none; + transition: none; +} + +.actionButtons a:hover { + background: #1377c5; + box-shadow: none; + border-color: #1377c5; + color: #fff !important; + transition: none; +} + +.actionButtons a:active { + background-color: #3189ba; + border-color: #3189ba; +} + +.actionButtons li.primary a, +.actionButtons a.primary { + color: #fff; + border-color: #32ab9a; + background: #32ab9a linear-gradient(#32ab9a, #00948e); +} + +.actionButtons li.primary a:hover, +.actionButtons a.primary:hover { + background: #2b9385 linear-gradient(#2b9385, #007571); + border-color: #2b9385; +} + +.actionButtons li.primary a:active, +.actionButtons a.primary:active { + background: #32ab9a; + border-color: #32ab9a; +} + +.actionButtons img { + display: none; +} + +#treePane .actionButtons img { + display: inline; +} + +.actionButtons--tableheader .fa { + font-size: 14px; +} + +.sectionBody .actionButtons { + padding-top: 0; + min-height: 40px; +} + +.sectionBody .actionButtons li { + margin-right: 10px; +} + +.sectionBody .actionButtons a { + display: inline-block; + padding: 9px 10px; + line-height: 1; +} + +table.actionButtons { + margin-top: 1rem; + margin-bottom: 10px; +} + +table.actionButtons img { + display: inline-block; +} + +table.actionButtons .searchtext { + padding: 5px; + height: 24px; + width: 150px; +} + +.actionButtons .fa { + display: none; + text-align: center; + font-size: 1em; + line-height: 1em; + width: 1.1em; + vertical-align: initial +} + +.actionButtons .fa, +.actionButtons--eit .fa { + display: inline-block; +} + +.optionsTitle .fa { + display: inline-block; +} + +@media (max-width: 900px) { + .actionButtons a { + display: inline-block; + padding: 6px 10px + } + .tab-page .actionButtons a { + margin-top: 0 !important + } + .actionButtons a span { + display: none; + } + .actionButtons a .fa { + display: inline-block; + } +} + +/* [ TABLES ] */ + +/* table */ + +.table th, +.table td { + padding: 0.15rem 0.25rem; +} + +/* table-data */ + +.table.data { + width: 100%; + max-width: 100%; + margin-bottom: 0; + border-bottom: 1px solid #eceeef +} + +.table.data th, +.table.data thead td { + padding: 0.75rem; + text-transform: uppercase; + white-space: nowrap; + font-size: 0.675rem; + color: #777; + border-bottom: 1px solid #eceeef +} + +.table.data td { + padding: 0.55rem 0.75rem; +} + +.table.data td, +.table.data th, +.table.data thead td { + vertical-align: top; + border-top: 1px solid #eceeef +} + +.table.data td:first-child, +.table.data th:first-child, +.table.data.table-sm td:first-child, +.table.data.table-sm th:first-child { + padding-left: 1.25rem +} + +.table.data td:last-child, +.table.data th:last-child, +.table.data.table-sm td:last-child, +.table.data.table-sm th:last-child { + padding-right: 1.25rem +} + +.table.data thead { + background-color: #fff; +} + +.table.data > tbody > tr { + background-color: #f9f9f9; + transition-duration: .5s +} + +.table.data > tbody > tr:nth-child(2n) { + background-color: #fff +} + +.table.data > tbody > tr:hover { + cursor: default; + background-color: rgba(93, 109, 202, 0.16); + transition-duration: .05s +} + +.table.data tr.unstyled:hover { + background-color: inherit +} + +.table.data .actions { + white-space: nowrap +} + +.table.data .actions a { + color: #555 +} + +.table.data .actions a .fa, +.table.data .actions span .fa { + position: relative; + margin: 0 0.375rem; + font-size: 0.9rem; + color: #555 +} + +.table.data .actions a:hover .fa { + color: #000; +} + +.table.data .actions a:hover .fa.fa-trash { + color: #d80030 +} + +.table.data .actions a .fa::before { + position: relative; + z-index: 2; +} + +.table.data .actions a .fa::after { + content: ""; + position: absolute; + z-index: 1; + left: 50%; + top: 50%; + width: 1.5rem; + height: 1.5rem; + margin: -0.75rem 0 0 -0.75rem; + border-radius: 50%; + -webkit-transition: 0.15s; + transition: 0.15s; +} + +.table.data .actions a:hover .fa::after { + background-color: #fff +} + +.table.data .actions .disabled { + visibility: hidden +} + +/* table-data-nowrap */ + +.table.data.nowrap th, +.table.data.nowrap td { + white-space: nowrap +} + +/* table-data-sortable */ + +.table.data thead .sortable a, +.table.data thead .sortable-text a { + color: #777; + text-decoration: none !important; +} + +.table.data thead .sortable a:hover, +.table.data thead .sortable-text a:hover { + color: #222 +} + +.table.data thead .sortable a::after, +.table.data thead .sortable-text a::after { + content: "\f107"; + font-family: FontAwesome; + opacity: .3; + margin-left: .5em; +} + +.table.data thead .sortable.forwardSort a::after, +.table.data thead .sortable-text.forwardSort a::after { + opacity: 1; + content: "\f106"; + color: #d9534f +} + +.table.data thead .sortable.reverseSort a::after, +.table.data thead .sortable-text.reverseSort a::after { + opacity: 1; + content: "\f107"; + color: #d9534f +} + +.table.data thead .sortable:hover a::after, +.table.data thead .sortable-text:hover a::after, +.table.data thead .sortable-numeric:hover a::after, +.table.data thead .sortable-date:hover a::after { + opacity: 1 +} + +.table.data thead .sortable, +.table.data thead .sortable-text, +.table.data thead .sortable-numeric, +.table.data thead .sortable-date { + cursor: pointer +} + +.table.data thead .sortable-text span, +.table.data thead .sortable-numeric span, +.table.data thead .sortable-date span { + display: none +} + +.table.data.table-sortable > tbody > tr { + cursor: move; + transition-duration: .5s +} + +.table.data.table-sortable > tbody > tr.ghost { + background-color: rgba(93, 109, 202, 0.16); + color: #d9534f !important; + transition: background-color .5s, color .5s, transform 0s +} + +/* table-data-sm */ + +.table.data.table-sm td, +.table.data.table-sm th { + padding: .25rem .5rem; +} + +.table.data.table-sm th, +.table.data.table-sm thead td { + font-size: 0.75rem; + text-transform: none; +} + +/* table-data-even */ + +.table.data.table-even > tbody > tr:not(:hover) { + background-color: #fff +} + +.table.data.table-even > tbody > tr:nth-child(4n+1):not(:hover) { + background-color: #f6f8f8 +} + +.table.data.table-even > tbody > tr:nth-child(2n) { + background-color: #fff +} + +/* table-data-docs */ + +.table.data .doc-item .fa { + width: 1.2em; + font-size: 0.9rem; + text-align: center; + margin-right: 0.25rem +} + +.table.data .doc-item { + text-decoration: none +} + +.table.data .doc-item:hover span { + text-decoration: underline +} + +.table.data .doc-item.private .fa::after { + position: relative; + float: left; + margin: .5em -1em 0 0; + content: "\f023"; + font-size: 0.75em; + color: #d9534f; +} + +/* [ BREADCRUMBS ] */ + +ul.breadcrumbs { + margin: 0 1rem .5rem; + padding: 0 0 .5rem; + line-height: normal; + font-size: .675rem; + color: #888; + border-bottom: 1px dotted #cecaca; +} + +ul.breadcrumbs li { + list-style: none; + display: inline-block; + padding: 0; + margin: 0; +} + +ul.breadcrumbs a { + text-decoration: none; +} + +ul.breadcrumbs span { + display: inline-block; + width: 1.25em; + vertical-align: top; + text-indent: -2.25em; + overflow: hidden; +} + +ul.breadcrumbs span::after { + margin-left: 2em; + font-family: FontAwesome; + content: "\f105" +} + +/* [ PAGINATION ] */ + +#pagination { + padding: 0 1.25rem; + margin: .5rem 0 0; +} + +#pagination ul { + margin: 0 0 0 .5rem; + display: inline-block; +} + +#pagination li { + list-style: none; + display: inline-block; + margin: 0 0 0 1px; +} + +#pagination li a { + display: inline-block; + padding: 0 .5rem; + line-height: 1.7; + border: 1px solid #ddd; + text-decoration: none; + color: #333; +} + +#pagination li.currentPage a, +#pagination li a:hover { + color: #555; + border: 1px solid #555; +} + +/* [ SEARCHBAR ] */ + +.searchbar input[type=text] { + max-width: 10rem +} + +/* [ WIDGETS ] */ + +.widgets .card { + margin-bottom: 1rem; + border-width: 0; + border-radius: 0; + background-color: #fff; + -webkit-transition: box-shadow .35s; + transition: box-shadow .35s; + box-shadow: 0 0.1rem 0.3rem 0 rgba(0, 0, 0, 0.075); +} + +.widgets .card:hover { + box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.07); +} + +.widgets .card-header { + padding: .5rem 1rem; + font-size: .9rem; + color: #616a73; + font-weight: 700; + border-radius: 0; + border: none; + border-bottom: 1px solid rgba(0, 0, 0, .05); + text-transform: none; + background-color: transparent; + border-bottom: 1px solid rgba(0, 0, 0, 0.05); +} + +.widgets .card-header .fa { + font-size: .9rem +} + +.widgets .card-block { + padding: 0; +} + +.widgets .card-block .card-block p { + padding: 0 1rem +} + +.widgets .card-block .card-body { + padding: 1rem; +} + +.widgets .card-block .card-body + .card-body { + padding-top: 0 } -/* old style */ -#actions .actionButtons { float: left; min-height: 32px } -#actions .actionButtons li { position: relative; float: left; margin-right: 3px; border: none } -#actions .actionButtons li a, #actions .actionButtons .plus { float: left; padding: 0 10px !important; height: 32px; line-height: 30px; -webkit-user-select: none; user-select: none; } -#actions .actionButtons li:last-child { margin: 0 } -#actions .actionButtons #Button1 a { width: 100%; text-align: left; } -#actions .actionButtons .plus { overflow: hidden; float: right; margin: -32px 0 0 0; width: 35px; border-radius: 0 3px 3px 0 !important; text-align: center; cursor: default; font: normal normal normal 0/30px FontAwesome } -#actions .actionButtons .plus::before { content: "\f107"; font-size: 14px } -#actions .actionButtons .show .plus::before { content: "\f106"; } -#actions .actionButtons .dropdown-menu { display: none; position: absolute; z-index: -1; left: auto; right: 0; top: 100%; width: 100%; min-width: 35px; margin: -2px 0 0; padding: 2px 0 0; text-align: left; font-size: 1em; background-color: #fff; border: 1px solid #32ab9a; border-top: none; border-radius: 0 0 3px 3px; overflow: hidden; } -#actions .actionButtons .show > .dropdown-menu { display: block } -#actions .actionButtons .dropdown-menu > span { display: block; padding: 0 10px; height: 32px; line-height: 30px; border: none; border-top: 1px solid #f2f2f2; cursor: pointer; } -#actions .actionButtons .dropdown-menu > span:hover { background-color: #fbfbfb; } -#actions .actionButtons select#stay { display: block; position: relative; z-index: -1; clear: both; width: auto; height: 0; padding: 0 10px; margin: -100% 0 -32px 0; font-size: 1em; opacity: 0; visibility: hidden; } -#actions .actionButtons #Button1 a, #actions .actionButtons .plus { color: #fff; border-color: #32ab9a; background: #32ab9a linear-gradient(#32ab9a, #00948e); } -#actions .actionButtons #Button1 a:hover, #actions .actionButtons .plus:hover { background: #2b9385 linear-gradient(#2b9385, #007571); border-color: #2b9385; } -#actions .actionButtons #Button1 a:active, #actions .actionButtons .plus:active { background: #32ab9a; border-color: #32ab9a; } -@media (max-width: 900px) { -#actions .actionButtons li a, #actions .actionButtons .dropdown-menu span { font-size: 0 } -#actions .actionButtons li a .fa, #actions .actionButtons .dropdown-menu span .fa { display: inline-block; font-size: 14px; line-height: 30px } -#actions .actionButtons .dropdown-menu { width: 35px } -#actions .actionButtons #Button1 a { margin: 0; width: auto } -#actions .actionButtons .plus { margin: 0 0 0 -2px } -#actions .actionButtons select#stay { display: none } + +.widgets .table { + margin-bottom: 0rem } -/* actionButtons in content ( old style ) */ -.actionButtons { margin: 0; padding: 0; background: none; width: auto; white-space: nowrap; } -.actionButtons li { float: left; margin: 0; padding: 0; list-style: none; } -.actionButtons li:before, .mmTagList li:before, .rTable li:before, .tab-pane ul li ul li:before, .dashboard li:before, div#idShowHideSocialBox.sectionBody > div.btn-group.ope > ul.dropdown-menu > li:before, .sectionBody .multitv .list li:before { display: none; content: ''; } -.actionButtons img { vertical-align: top; margin-top: 1px; opacity: 0.3; } -.actionButtons:hover img { opacity: 1; } -.actionButtons a:hover { border-color: #999; -webkit-box-shadow: 1px 1px 2px #aaa; box-shadow: 1px 1px 2px #aaa; -webkit-transition: .3s ease; transition: .3s ease; background: -moz-linear-gradient(#fff, #f5f5f5); background: -webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#f5f5f5)); background: -o-linear-gradient(#fff, #f5f5f5); text-decoration: none !important; } -.actionButtons a:active { background: #92aac4 bottom left; -webkit-box-shadow: 0 0 10px #b8c7d6; box-shadow: 0 0 10px #b8c7d6; } -.actionButtons a { float: left; padding: 5px 10px; height: 32px; font-size: 13px; font-weight: 500; } -.actionButtons a, .actionButtons li.primary a, .actionButtons a.primary, .actionButtons a.default { text-shadow: none; background: #fff; color: #555; border: 1px solid #e4e4e4; border-radius: 3px; /*box-shadow: 0 0 0 1px #E4E4E4;*/ box-shadow: none; transition: none; } -.actionButtons a:hover { background: #1377c5; box-shadow: none; border-color: #1377c5; color: #fff !important; transition: none; } -.actionButtons a:active { background-color: #3189ba; border-color: #3189ba; } -.actionButtons li.primary a, .actionButtons a.primary { color: #fff; border-color: #32ab9a; background: #32ab9a linear-gradient(#32ab9a, #00948e); } -.actionButtons li.primary a:hover, .actionButtons a.primary:hover { background: #2b9385 linear-gradient(#2b9385, #007571); border-color: #2b9385; } -.actionButtons li.primary a:active, .actionButtons a.primary:active { background: #32ab9a; border-color: #32ab9a; } -.actionButtons img { display: none; } -#treePane .actionButtons img { display: inline; } -.actionButtons--tableheader .fa { font-size: 14px; } -.sectionBody .actionButtons { padding-top: 0; min-height: 40px; } -.sectionBody .actionButtons li { margin-right: 10px; } -.sectionBody .actionButtons a { display: inline-block; padding: 9px 10px; line-height: 1; } -table.actionButtons { margin-top: 1rem; margin-bottom: 10px; } -table.actionButtons img { display: inline-block; } -table.actionButtons .searchtext { padding: 5px; height: 24px; width: 150px; } -.actionButtons .fa { display: none; text-align: center; font-size: 1em; line-height: 1em; width: 1.1em; vertical-align: initial } -.actionButtons .fa, .actionButtons--eit .fa { display: inline-block; } -.optionsTitle .fa { display: inline-block; } -@media (max-width: 900px) { -.actionButtons a { display: inline-block; padding: 6px 10px } -.tab-page .actionButtons a { margin-top: 0 !important } -.actionButtons a span { display: none; } -.actionButtons a .fa { display: inline-block; } + +.widgets .table:not(.data) tr th, +.widgets .table:not(.data) tr td { + padding: .15rem; } -/* [ TABLES ] */ -/* table */ -.table th, .table td { padding: 0.15rem 0.25rem; } -/* table-data */ -.table.data { width: 100%; max-width: 100%; margin-bottom: 0; border-bottom: 1px solid #eceeef } -.table.data th, .table.data thead td { padding: 0.75rem; text-transform: uppercase; white-space: nowrap; font-size: 0.675rem; color: #777; border-bottom: 1px solid #eceeef } -.table.data td { padding: 0.55rem 0.75rem; } -.table.data td, .table.data th, .table.data thead td { vertical-align: top; border-top: 1px solid #eceeef } -.table.data td:first-child, .table.data th:first-child, .table.data.table-sm td:first-child, .table.data.table-sm th:first-child { padding-left: 1.25rem } -.table.data td:last-child, .table.data th:last-child, .table.data.table-sm td:last-child, .table.data.table-sm th:last-child { padding-right: 1.25rem } -.table.data thead { background-color: #fff; } -.table.data > tbody > tr { background-color: #f9f9f9; transition-duration: .5s } -.table.data > tbody > tr:nth-child(2n) { background-color: #fff } -.table.data > tbody > tr:hover { cursor: default; background-color: rgba(93, 109, 202, 0.16); transition-duration: .05s } -.table.data tr.unstyled:hover { background-color: inherit } -.table.data .actions { white-space: nowrap } -.table.data .actions a { color: #555 } -.table.data .actions a .fa, .table.data .actions span .fa { position: relative; margin: 0 0.375rem; font-size: 0.9rem; color: #555 } -.table.data .actions a:hover .fa { color: #000; } -.table.data .actions a:hover .fa.fa-trash { color: #d80030 } -.table.data .actions a .fa::before { position: relative; z-index: 2; } -.table.data .actions a .fa::after { content: ""; position: absolute; z-index: 1; left: 50%; top: 50%; width: 1.5rem; height: 1.5rem; margin: -0.75rem 0 0 -0.75rem; border-radius: 50%; -webkit-transition: 0.15s; transition: 0.15s; } -.table.data .actions a:hover .fa::after { background-color: #fff } -.table.data .actions .disabled { visibility: hidden } -/* table-data-nowrap */ -.table.data.nowrap th, .table.data.nowrap td { white-space: nowrap } -/* table-data-sortable */ -.table.data thead .sortable a, .table.data thead .sortable-text a { color: #777; text-decoration: none !important; } -.table.data thead .sortable a:hover, .table.data thead .sortable-text a:hover { color: #222 } -.table.data thead .sortable a::after, .table.data thead .sortable-text a::after { content: "\f107"; font-family: FontAwesome; opacity: .3; margin-left: .5em; } -.table.data thead .sortable.forwardSort a::after, .table.data thead .sortable-text.forwardSort a::after { opacity: 1; content: "\f106"; color: #d9534f } -.table.data thead .sortable.reverseSort a::after, .table.data thead .sortable-text.reverseSort a::after { opacity: 1; content: "\f107"; color: #d9534f } -.table.data thead .sortable:hover a::after, .table.data thead .sortable-text:hover a::after, .table.data thead .sortable-numeric:hover a::after, .table.data thead .sortable-date:hover a::after { opacity: 1 } -.table.data thead .sortable, .table.data thead .sortable-text, .table.data thead .sortable-numeric, .table.data thead .sortable-date { cursor: pointer } -.table.data thead .sortable-text span, .table.data thead .sortable-numeric span, .table.data thead .sortable-date span { display: none } -.table.data.table-sortable > tbody > tr { cursor: move; transition-duration: .5s } -.table.data.table-sortable > tbody > tr.ghost { background-color: rgba(93, 109, 202, 0.16); color: #d9534f !important; transition: background-color .5s, color .5s, transform 0s } -/* table-data-sm */ -.table.data.table-sm td, .table.data.table-sm th { padding: .25rem .5rem; } -.table.data.table-sm th, .table.data.table-sm thead td { font-size: 0.75rem; text-transform: none; } -/* table-data-even */ -.table.data.table-even > tbody > tr:not(:hover) { background-color: #fff } -.table.data.table-even > tbody > tr:nth-child(4n+1):not(:hover) { background-color: #f6f8f8 } -.table.data.table-even > tbody > tr:nth-child(2n) { background-color: #fff } -/* table-data-docs */ -.table.data .doc-item .fa { width: 1.2em; font-size: 0.9rem; text-align: center; margin-right: 0.25rem } -.table.data .doc-item { text-decoration: none } -.table.data .doc-item:hover span { text-decoration: underline } -.table.data .doc-item.private .fa::after { position: relative; float: left; margin: .5em -1em 0 0; content: "\f023"; font-size: 0.75em; color: #d9534f; } -/* [ BREADCRUMBS ] */ -ul.breadcrumbs { margin: 0 1rem .5rem; padding: 0 0 .5rem; line-height: normal; font-size: .675rem; color: #888; border-bottom: 1px dotted #cecaca; } -ul.breadcrumbs li { list-style: none; display: inline-block; padding: 0; margin: 0; } -ul.breadcrumbs a { text-decoration: none; } -ul.breadcrumbs span { display: inline-block; width: 1.25em; vertical-align: top; text-indent: -2.25em; overflow: hidden; } -ul.breadcrumbs span::after { margin-left: 2em; font-family: FontAwesome; content: "\f105" } -/* [ PAGINATION ] */ -#pagination { padding: 0 1.25rem; margin: .5rem 0 0; } -#pagination ul { margin: 0 0 0 .5rem; display: inline-block; } -#pagination li { list-style: none; display: inline-block; margin: 0 0 0 1px; } -#pagination li a { display: inline-block; padding: 0 .5rem; line-height: 1.7; border: 1px solid #ddd; text-decoration: none; color: #333; } -#pagination li.currentPage a, #pagination li a:hover { color: #555; border: 1px solid #555; } -/* [ SEARCHBAR ] */ -.searchbar input[type=text] { max-width: 10rem } -/* [ WIDGETS ] */ -.widgets .card { margin-bottom: 1rem; border-width: 0; border-radius: 0; background-color: #fff; -webkit-transition: box-shadow .35s; transition: box-shadow .35s; box-shadow: 0 0.1rem 0.3rem 0 rgba(0, 0, 0, 0.075);} -.widgets .card:hover { box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.07); } -.widgets .card-header { padding: .5rem 1rem; font-size: .9rem; color: #616a73; font-weight: 700; border-radius: 0; border: none; border-bottom: 1px solid rgba(0, 0, 0, .05); text-transform: none;background-color: transparent;border-bottom: 1px solid rgba(0,0,0,0.05); } -.widgets .card-header .fa { font-size: .9rem } -.widgets .card-block { padding: 0; } -.widgets .card-block .card-block p { padding: 0 1rem } -.widgets .card-block .card-body { padding: 1rem; } -.widgets .card-block .card-body + .card-body { padding-top: 0 } -.widgets .table { margin-bottom: 0rem } -.widgets .table:not(.data) tr th, .widgets .table:not(.data) tr td { padding: .15rem; } -.widgets .table tr th:first-child, .widgets .table tr td:first-child { padding-left: 1rem !important } -.widgets .table tr th:last-child, .widgets .table tr td:last-child { padding-right: 1rem !important } -.widgets .table .actions a .fa { margin: 0 .05rem; } + +.widgets .table tr th:first-child, +.widgets .table tr td:first-child { + padding-left: 1rem !important +} + +.widgets .table tr th:last-child, +.widgets .table tr td:last-child { + padding-right: 1rem !important +} + +.widgets .table .actions a .fa { + margin: 0 .05rem; +} + /* widgets custom */ -.widgets #welcome .wm_buttons { display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; margin-bottom: 1rem; padding: 0; text-align: center; border-bottom: 1px solid rgba(0, 0, 0, .05); } -.widgets #welcome .wm_button { max-width: 16.666667%; flex: 0 0 16.666667%; } -.widgets #welcome .wm_button a { display: block; height: 100%; padding: 1rem 1rem .5rem; text-decoration: none; color: #646b7b; box-shadow: none; transition-duration: .5s } -.widgets #welcome .wm_button a:hover { color: #373b46; background-color: rgba(93, 109, 202, 0.16) } -.widgets #welcome .wm_button a .fa { display: inline-block; } -.widgets #welcome .wm_button a .fa + span { display: block; padding: .5em 0; line-height: 1em; font-size: .7rem; } -.widgets #modxrecent_widget .table.data tbody tr:not(:hover) { background-color: #fff } -.widgets #modxrecent_widget .table.data tbody tr:nth-child(4n+1):not(:hover) { background-color: #f6f8f8 } -.widgets #modxrecent_widget .table.data tbody tr:nth-child(2n) { background-color: #fff } + +.widgets #welcome .wm_buttons { + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + margin-bottom: 1rem; + padding: 0; + text-align: center; + border-bottom: 1px solid rgba(0, 0, 0, .05); +} + +.widgets #welcome .wm_button { + max-width: 16.666667%; + flex: 0 0 16.666667%; +} + +.widgets #welcome .wm_button a { + display: block; + height: 100%; + padding: 1rem 1rem .5rem; + text-decoration: none; + color: #646b7b; + box-shadow: none; + transition-duration: .5s +} + +.widgets #welcome .wm_button a:hover { + color: #373b46; + background-color: rgba(93, 109, 202, 0.16) +} + +.widgets #welcome .wm_button a .fa { + display: inline-block; +} + +.widgets #welcome .wm_button a .fa + span { + display: block; + padding: .5em 0; + line-height: 1em; + font-size: .7rem; +} + +.widgets #modxrecent_widget .table.data tbody tr:not(:hover) { + background-color: #fff +} + +.widgets #modxrecent_widget .table.data tbody tr:nth-child(4n+1):not(:hover) { + background-color: #f6f8f8 +} + +.widgets #modxrecent_widget .table.data tbody tr:nth-child(2n) { + background-color: #fff +} + @media (max-width: 1399px) { -.widgets #welcome .wm_button { max-width: 20%; flex: 0 0 20%; } + .widgets #welcome .wm_button { + max-width: 20%; + flex: 0 0 20%; + } } + @media (max-width: 1199px) { -.widgets #welcome .wm_button { max-width: 25%; flex: 0 0 25%; } + .widgets #welcome .wm_button { + max-width: 25%; + flex: 0 0 25%; + } } + @media (max-width: 991px) { -.widgets #welcome .wm_button { max-width: 33.3333%; flex: 0 0 33.3333%; } + .widgets #welcome .wm_button { + max-width: 33.3333%; + flex: 0 0 33.3333%; + } } + @media (max-width: 767px) { -.widgets #welcome .wm_button { max-width: 50%; flex: 0 0 50%; } + .widgets #welcome .wm_button { + max-width: 50%; + flex: 0 0 50%; + } } + /* [ DATEPICKER ] */ -.dp_container { position: absolute; z-index: 500; } -.dp_cal { overflow: hidden; width: 220px; margin: 0.25rem 0; background-color: #fff; -webkit-box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.3); box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.3); } -.dp_cal p { position: relative; margin: 10px; } -.dp_cal select { font-size: 1em; margin: 2px 3px; width: auto !important } -.dp_cal select option { padding: 1px 3px } -.dp_cal table { border-collapse: collapse; border-spacing: 0; width: 100% } -.dp_cal td.dp_roll { background-color: rgba(0, 0, 0, 0.1); color: #333 !important } -.dp_cal th, .dp_cal td { font-size: 1em; padding: 0.5em 0 !important; text-align: center !important; width: 14.2857%; cursor: default } -.dp_cal tbody th { background-color: #656d79; color: #fff; } -.dp_cal tbody td:nth-child(6), .dp_cal tbody td:nth-child(7) { color: indianred } -.dp_cal .dp_empty { background-color: #f9f9f9 } -.dp_cal .dp_hide { visibility: hidden } -.dp_cal .dp_today { background-color: #4caf50; color: #fff !important } -.dp_cal .dp_selected { background-color: #3189ba; color: #fff !important } -.dp_cal input { width: 68% !important } -.dp_cal button { position: absolute; top: 0; right: 0; margin: 0 !important; width: 30% !important } + +.dp_container { + position: absolute; + z-index: 500; +} + +.dp_cal { + overflow: hidden; + width: 220px; + margin: 0.25rem 0; + background-color: #fff; + -webkit-box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.3); + box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.3); +} + +.dp_cal p { + position: relative; + margin: 10px; +} + +.dp_cal select { + font-size: 1em; + margin: 2px 3px; + width: auto !important +} + +.dp_cal select option { + padding: 1px 3px +} + +.dp_cal table { + border-collapse: collapse; + border-spacing: 0; + width: 100% +} + +.dp_cal td.dp_roll { + background-color: rgba(0, 0, 0, 0.1); + color: #333 !important +} + +.dp_cal th, +.dp_cal td { + font-size: 1em; + padding: 0.5em 0 !important; + text-align: center !important; + width: 14.2857%; + cursor: default +} + +.dp_cal tbody th { + background-color: #656d79; + color: #fff; +} + +.dp_cal tbody td:nth-child(6), +.dp_cal tbody td:nth-child(7) { + color: indianred +} + +.dp_cal .dp_empty { + background-color: #f9f9f9 +} + +.dp_cal .dp_hide { + visibility: hidden +} + +.dp_cal .dp_today { + background-color: #4caf50; + color: #fff !important +} + +.dp_cal .dp_selected { + background-color: #3189ba; + color: #fff !important +} + +.dp_cal input { + width: 68% !important +} + +.dp_cal button { + position: absolute; + top: 0; + right: 0; + margin: 0 !important; + width: 30% !important +} + /* datepicker icon clear */ -.clearDate { position: relative; margin: 0.5rem 0 0 -1.5rem; z-index: 10; } + +.clearDate { + position: relative; + margin: 0.5rem 0 0 -1.5rem; + z-index: 10; +} + /* [ GRID STYLE ] */ -.grid { width: 100%; background-color: #fff !important; border: 1px solid rgba(0, 0, 0, 0.1); border-collapse: collapse; } -.grid thead, .grid tfoot { background-color: #e9e9e9 } -.grid th, .grid td { padding: 0.375rem !important; border: 1px solid #ddd } -.gridHeader, .grid th { color: #333; font-weight: 500; white-space: nowrap; background-color: #e9e9e9; text-align: left; } -.grid > tbody > tr:nth-child(2n) > td { background-color: rgba(0, 0, 0, 0.03) } -.gridItem { background-color: #fff; padding: 3px; } -.gridAltItem { background-color: #f7f7f7; padding: 3px; } -.grid tbody tr:hover td { background: #e9edf3; } -.grid a { text-decoration: none; } -.grid img { vertical-align: middle; padding-right: 4px; } + +.grid { + width: 100%; + background-color: #fff !important; + border: 1px solid rgba(0, 0, 0, 0.1); + border-collapse: collapse; +} + +.grid thead, +.grid tfoot { + background-color: #e9e9e9 +} + +.grid th, +.grid td { + padding: 0.375rem !important; + border: 1px solid #ddd +} + +.gridHeader, +.grid th { + color: #333; + font-weight: 500; + white-space: nowrap; + background-color: #e9e9e9; + text-align: left; +} + +.grid > tbody > tr:nth-child(2n) > td { + background-color: rgba(0, 0, 0, 0.03) +} + +.gridItem { + background-color: #fff; + padding: 3px; +} + +.gridAltItem { + background-color: #f7f7f7; + padding: 3px; +} + +.grid tbody tr:hover td { + background: #e9edf3; +} + +.grid a { + text-decoration: none; +} + +.grid img { + vertical-align: middle; + padding-right: 4px; +} + /* SORTABLELIST */ -ul.sortableList { margin: 0; } -ul.sortableList li { position: relative; z-index: 1; float: left; clear: both; max-width: 100%; width: 30rem; list-style: none; font-weight: bold; cursor: move; padding: 0.46153846em 1em; margin: .0625rem 0; border: 1px solid #ccc; line-height: 1.23076923; background-color: #fff; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); box-shadow: none; transition: color .3s, box-shadow .3s, transform .3s, z-index .3s step-end; } -ul.sortableList li.ghost { z-index: 2; box-shadow: 0 0.25rem 1.5rem rgba(0, 0, 0, 0.15); transition: color .3s, box-shadow .3s, transform 0s, z-index 0s; } + +ul.sortableList { + margin: 0; +} + +ul.sortableList li { + position: relative; + z-index: 1; + float: left; + clear: both; + max-width: 100%; + width: 30rem; + list-style: none; + font-weight: bold; + cursor: move; + padding: 0.46153846em 1em; + margin: .0625rem 0; + border: 1px solid #ccc; + line-height: 1.23076923; + background-color: #fff; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + box-shadow: none; + transition: color .3s, box-shadow .3s, transform .3s, z-index .3s step-end; +} + +ul.sortableList li.ghost { + z-index: 2; + box-shadow: 0 0.25rem 1.5rem rgba(0, 0, 0, 0.15); + transition: color .3s, box-shadow .3s, transform 0s, z-index 0s; +} + /* [ TOOLTIPS ] */ -.evo-tooltip, .custom-tip { position: fixed; z-index: 13000; width: 13rem; margin: 1rem; padding: 0.9rem 1rem; font-size: 0.75rem; line-height: 1.5; font-family: sans-serif; text-align: left; color: #333; background-color: #fff; visibility: hidden; transition-duration: .3s; transform: translate3d(1rem, 0, 0); -webkit-box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.15); box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.15); } -.evo-tooltip { opacity: 0; content: attr(data-tooltip); } -.evo-tooltip.show { opacity: 1; visibility: visible; transform: translate3d(0, 0, 0); } -[data-tooltip] { cursor: help } -[data-tooltip].fa-question-circle { opacity: 0.15; } -[data-tooltip].fa-question-circle:hover { opacity: 1; } + +.evo-tooltip, +.custom-tip { + position: fixed; + z-index: 13000; + width: 13rem; + margin: 1rem; + padding: 0.9rem 1rem; + font-size: 0.75rem; + line-height: 1.5; + font-family: sans-serif; + text-align: left; + color: #333; + background-color: #fff; + visibility: hidden; + transition-duration: .3s; + transform: translate3d(1rem, 0, 0); + -webkit-box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.15); + box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.15); +} + +.evo-tooltip { + opacity: 0; + content: attr(data-tooltip); +} + +.evo-tooltip.show { + opacity: 1; + visibility: visible; + transform: translate3d(0, 0, 0); +} + +[data-tooltip] { + cursor: help +} + +[data-tooltip].fa-question-circle { + opacity: 0.15; +} + +[data-tooltip].fa-question-circle:hover { + opacity: 1; +} + /* [ FILES MANAGER ] */ -#ManageFiles { padding-bottom: 1rem; } -#ManageFiles .breadcrumbs { } -#ManageFiles .breadcrumbs a, #ManageFiles .breadcrumbs span { display: inline-block; padding: 0 0.25em; } -#ManageFiles #imageviewer { text-align: center; } -#ManageFiles #imageviewer img { display: inline-block; max-width: 100%; margin-top: 1rem } -#FilesTable { margin-bottom: 1rem; border-bottom: 1px solid #ddd; } -#file_editfile.section .sectionHeader { margin: 0; padding: 0.5rem 1rem; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; background-color: #f9f9f9 } -#file_editfile.section .sectionBody { margin: 0 !important; padding: 0 0 1rem; border: none; border-bottom: 1px solid #ddd; background-color: #f9f9f9 } -#file_editfile td { padding: 0 !important; } -#file_editfile #content { float: left; width: 100%; min-height: 25rem; border: none; border-bottom: 1px solid rgba(0, 0, 0, .15) } + +#ManageFiles { + padding-bottom: 1rem; +} + +#ManageFiles .breadcrumbs {} + +#ManageFiles .breadcrumbs a, +#ManageFiles .breadcrumbs span { + display: inline-block; + padding: 0 0.25em; +} + +#ManageFiles #imageviewer { + text-align: center; +} + +#ManageFiles #imageviewer img { + display: inline-block; + max-width: 100%; + margin-top: 1rem +} + +#FilesTable { + margin-bottom: 1rem; + border-bottom: 1px solid #ddd; +} + +#file_editfile.section .sectionHeader { + margin: 0; + padding: 0.5rem 1rem; + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + background-color: #f9f9f9 +} + +#file_editfile.section .sectionBody { + margin: 0 !important; + padding: 0 0 1rem; + border: none; + border-bottom: 1px solid #ddd; + background-color: #f9f9f9 +} + +#file_editfile td { + padding: 0 !important; +} + +#file_editfile #content { + float: left; + width: 100%; + min-height: 25rem; + border: none; + border-bottom: 1px solid rgba(0, 0, 0, .15) +} + /* STYLES FOR PAGE HELP */ -#helpPane h1 { margin-bottom: 1em; padding: .5rem; font-size: .8rem; border-bottom: 1px solid #e0e0e0; } -#helpPane li:not(:first-child) > strong { margin-top: 1.4em; } -#helpPane li > strong { display: block; font-size: 14px; } -#helpPane pre { border: 1px solid rgba(0, 0, 0, 0.1); padding: 1em; } + +#helpPane h1 { + margin-bottom: 1em; + padding: .5rem; + font-size: .8rem; + border-bottom: 1px solid #e0e0e0; +} + +#helpPane li:not(:first-child) > strong { + margin-top: 1.4em; +} + +#helpPane li > strong { + display: block; + font-size: 14px; +} + +#helpPane pre { + border: 1px solid rgba(0, 0, 0, 0.1); + padding: 1em; +} + /* [ DARK THEME ] */ -.dark .section-editor textarea { background-color: #282c34; color: #abb2bf } -.dark .tab-page, .dark .sectionBody .tab-page, .dark .tab-row .tab.selected, .dark .tab-row .tab.selected.hover, .dark .tab-row .tab.selected:before, .dark .tab-row .tab.selected span { background-color: #f9f9f9; } -.dark, .dark .resourceTable .panel-heading { background: #ecf0f1 !important; } -.dark .resourceTable .panel-heading:hover { background: #ecf0f1 !important; } -.dark .multitv .list li.element a.copy, .multitv .list li.element a.remove { background: transparent !important; } -.dark .multitv .list li.element { background: #fefefe !important; } -.dark .split { border-color: rgba(0, 0, 0, .05) } -.dark hr { background: transparent; } + +.dark .section-editor textarea { + background-color: #282c34; + color: #abb2bf +} + +.dark .tab-page, +.dark .sectionBody .tab-page, +.dark .tab-row .tab.selected, +.dark .tab-row .tab.selected.hover, +.dark .tab-row .tab.selected:before, +.dark .tab-row .tab.selected span { + background-color: #f9f9f9; +} + +.dark, +.dark .resourceTable .panel-heading { + background: #ecf0f1 !important; +} + +.dark .resourceTable .panel-heading:hover { + background: #ecf0f1 !important; +} + +.dark .multitv .list li.element a.copy, +.multitv .list li.element a.remove { + background: transparent !important; +} + +.dark .multitv .list li.element { + background: #fefefe !important; +} + +.dark .split { + border-color: rgba(0, 0, 0, .05) +} + +.dark hr { + background: transparent; +} + /*.dark .content-blocks .block { background: #fefefe; border: 1px solid #e3e3e3; } .dark .content-blocks .block .fields-group { border: 1px dashed #e2e2e2; }*/ -.dark .content-blocks input[type="text"], .dark .content-blocks input[type="password"], .dark .content-blocks input[type="number"], .dark .content-blocks textarea { background-color: #fbfbfb !important; border-color: #dbdbdb !important; } -.dark .content-blocks .controls { background: #f9f9f9 !important; } -.dark .widgets .card-header { color: #616a73; background-color: #fafafa; } + +.dark .content-blocks input[type="text"], +.dark .content-blocks input[type="password"], +.dark .content-blocks input[type="number"], +.dark .content-blocks textarea { + background-color: #fbfbfb !important; + border-color: #dbdbdb !important; +} + +.dark .content-blocks .controls { + background: #f9f9f9 !important; +} + +.dark .widgets .card-header { + color: #616a73; + background-color: #fafafa; +} + /* [ OTHERS COMPONENTS ] - this components need fix css */ + /* extras */ -.catalog_item select[name=link] { width: auto !important; margin-left: 0.5rem } + +.catalog_item select[name=link] { + width: auto !important; + margin-left: 0.5rem +} + /* ManagerManager */ -.sectionHeader.minimizable { position: relative; z-index: 1; background-color: #fafafa; padding: 0.5rem; border: 1px solid rgba(0, 0, 0, 0.15); } -.dark .sectionHeader.minimizable { background-color: #f2f2f2 } -.imageField { min-width: 100% !important; width: 100% !important } -ul.mmTagList { float: left; margin-top: .25rem !important } + +.sectionHeader.minimizable { + position: relative; + z-index: 1; + background-color: #fafafa; + padding: 0.5rem; + border: 1px solid rgba(0, 0, 0, 0.15); +} + +.dark .sectionHeader.minimizable { + background-color: #f2f2f2 +} + +.imageField { + min-width: 100% !important; + width: 100% !important +} + +ul.mmTagList { + float: left; + margin-top: .25rem !important +} + /* MCE */ -.mce-container, .mce-container-body { box-sizing: border-box !important } -.mce-container button { border: none; border-radius: 0; background-color: transparent; } -.mce-window-head .mce-close { padding: 0; } -#editorRow_TinyMCE { background-color: #fff; } -#editorRow_TinyMCE tr { border: 1px dotted rgba(0, 0, 0, .05); } -#editorRow_TinyMCE th { white-space: nowrap } -#editorRow_TinyMCE th, #editorRow_TinyMCE td { padding: 0.5em; border: none !important } + +.mce-container, +.mce-container-body { + box-sizing: border-box !important +} + +.mce-container button { + border: none; + border-radius: 0; + background-color: transparent; +} + +.mce-window-head .mce-close { + padding: 0; +} + +#editorRow_TinyMCE { + background-color: #fff; +} + +#editorRow_TinyMCE tr { + border: 1px dotted rgba(0, 0, 0, .05); +} + +#editorRow_TinyMCE th { + white-space: nowrap +} + +#editorRow_TinyMCE th, +#editorRow_TinyMCE td { + padding: 0.5em; + border: none !important +} + /* wrap TinyMCE3 toolbar */ -.mceEditor .mceToolbar td { height: 24px; float: left } + +.mceEditor .mceToolbar td { + height: 24px; + float: left +} + /* codeMirror */ -.CodeMirror { width: 100%; margin: 0 !important; } -.CodeMirror pre { word-break: break-all !important; } -.CodeMirror > div:first-child > textarea { /*opacity: 0;*/ z-index: -1; left: -9999rem; } -div.CodeMirror-cursors { pointer-events: none; } + +.CodeMirror { + width: 100%; + margin: 0 !important; +} + +.CodeMirror pre { + word-break: break-all !important; +} + +.CodeMirror > div:first-child > textarea { + /*opacity: 0;*/ + z-index: -1; + left: -9999rem; +} + +div.CodeMirror-cursors { + pointer-events: none; +} + /* docFinder */ -form#docfinder div.tab-page { height: auto !important } + +form#docfinder div.tab-page { + height: auto !important +} + /* SimpleGallery */ -#SimpleGallery .pagination { display: block } -#SimpleGallery .sg_image { width: auto } + +#SimpleGallery .pagination { + display: block +} + +#SimpleGallery .sg_image { + width: auto +} + /* multiTV */ -.multitv .list li.element a.copy, .multitv .list li.element a.remove { width: 25px !important; text-align: center; background: transparent !important; top: -10px !important; } -.multitv .list li.element { border-radius: .25rem; border: 1px solid rgba(0, 0, 0, .125); background: #fefefe !important; margin-bottom: 10px !important; } + +.multitv .list li.element a.copy, +.multitv .list li.element a.remove { + width: 25px !important; + text-align: center; + background: transparent !important; + top: -10px !important; +} + +.multitv .list li.element { + border-radius: .25rem; + border: 1px solid rgba(0, 0, 0, .125); + background: #fefefe !important; + margin-bottom: 10px !important; +} + /* loginbox animation */ + @keyframes anim-loginbox { -from { opacity: 0; transform: translateY(30px); } -to { opacity: 1; transform: translateY(0); } + from { + opacity: 0; + transform: translateY(30px); + } + to { + opacity: 1; + transform: translateY(0); + } } + @-webkit-keyframes anim-loginbox { -from { opacity: 0; transform: translateY(30px); } -to { opacity: 1; transform: translateY(0); } + from { + opacity: 0; + transform: translateY(30px); + } + to { + opacity: 1; + transform: translateY(0); + } } -.loginbox { -webkit-animation-name: anim-loginbox; -webkit-animation-duration: .5s; -webkit-animation-iteration-count: 1; -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: forwards; -moz-animation-name: anim-loginbox; -moz-animation-duration: .5s; -moz-animation-iteration-count: 1; -moz-animation-timing-function: ease; -moz-animation-fill-mode: forwards; animation-name: anim-loginbox; animation-duration: .5s; animation-iteration-count: 1; animation-timing-function: ease; animation-fill-mode: forwards; } -/* end loginbox animation */ +.loginbox { + -webkit-animation-name: anim-loginbox; + -webkit-animation-duration: .5s; + -webkit-animation-iteration-count: 1; + -webkit-animation-timing-function: ease; + -webkit-animation-fill-mode: forwards; + -moz-animation-name: anim-loginbox; + -moz-animation-duration: .5s; + -moz-animation-iteration-count: 1; + -moz-animation-timing-function: ease; + -moz-animation-fill-mode: forwards; + animation-name: anim-loginbox; + animation-duration: .5s; + animation-iteration-count: 1; + animation-timing-function: ease; + animation-fill-mode: forwards; +} + +/* end loginbox animation */ /* pmfx theme */ -#actions .dropdown-toggle:after { display: none !important; } + +#actions .dropdown-toggle:after { + display: none !important; +} .card .table.data { margin-bottom: 0; border-bottom-width: 0; } -.table.data th, +.table.data th, .table.data thead td { border-bottom-width: 1px; } @@ -377,7 +1856,7 @@ ul.breadcrumbs { font-size: .675rem; color: #888; border-width: 0; - background-image: linear-gradient(to right, rgba(0,0,0,0.04), transparent 60%); + background-image: linear-gradient(to right, rgba(0, 0, 0, 0.04), transparent 60%); } ul.breadcrumbs a { @@ -412,11 +1891,13 @@ textarea.mce, #security .card-block > div { padding: 0 !important; } + #news .card-block ul, #security .card-block ul { padding: 0; margin: 0; } + #news .card-block ul li, #security .card-block ul li { padding: 0.75rem 1rem; @@ -431,6 +1912,7 @@ ul.mmTagList li { background-color: #eaeaea !important; text-decoration: none !important; } + ul.mmTagList li.tagSelected { border-radius: 3px !important; -webkit-border-radius: 3px !important; diff --git a/manager/media/style/default/css/fonts.css b/manager/media/style/default/css/fonts.css index 69bd4b5aaf..c065e96b0f 100755 --- a/manager/media/style/default/css/fonts.css +++ b/manager/media/style/default/css/fonts.css @@ -1,104 +1,484 @@ -html { font-size: 16px } +html { + font-size: 16px +} + @media (max-width: 900px) { -html { font-size: 16px; } + html { + font-size: 16px; + } } + @media (max-width: 400px) { -html { font-size: 16px; } + html { + font-size: 16px; + } +} + +body { + font-weight: normal; + font-style: normal; + font-size: 0.8125rem; + line-height: 1.5; + font-family: sans-serif; + -webkit-font-smoothing: subpixel-antialiased } -body { font-weight: normal; font-style: normal; font-size: 0.8125rem; line-height: 1.5; font-family: sans-serif; -webkit-font-smoothing: subpixel-antialiased } + /* For Arabic Font */ -html[lang="ar"] body, html[lang="ary"] body, html[lang="azb"] body, html[lang="fa-IR"] body, html[lang="haz"] body, html[lang="ps"] body, html[lang="ur"] body { font-family: Tahoma, Arial, sans-serif; } + +html[lang="ar"] body, +html[lang="ary"] body, +html[lang="azb"] body, +html[lang="fa-IR"] body, +html[lang="haz"] body, +html[lang="ps"] body, +html[lang="ur"] body { + font-family: Tahoma, Arial, sans-serif; +} + /* For Chinese Font */ -html[lang="zh"] body { font-family: "PingFang SC", "Microsoft JhengHei", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", Helvetica, sans-serif; } + +html[lang="zh"] body { + font-family: "PingFang SC", "Microsoft JhengHei", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", Helvetica, sans-serif; +} + /* For Devanagari Font */ -html[lang="bn-BD"] body, html[lang="hi-IN"] body, html[lang="mr-IN"] body { font-family: Arial, sans-serif; } + +html[lang="bn-BD"] body, +html[lang="hi-IN"] body, +html[lang="mr-IN"] body { + font-family: Arial, sans-serif; +} + /* For Greek Font */ -html[lang="el"] body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } + +html[lang="el"] body { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; +} + /* For Gujarati Font */ -html[lang="gu-IN"] body { font-family: Arial, sans-serif; } + +html[lang="gu-IN"] body { + font-family: Arial, sans-serif; +} + /* For Hebrew Font */ -html[lang="he"] body { font-family: "Arial Hebrew", Arial, sans-serif; } + +html[lang="he"] body { + font-family: "Arial Hebrew", Arial, sans-serif; +} + /* For Japanese Font */ -html[lang="ja"] body { font-family: Meiryo, "Hiragino Kaku Gothic Pro", sans-serif; } + +html[lang="ja"] body { + font-family: Meiryo, "Hiragino Kaku Gothic Pro", sans-serif; +} + /* For Korean font */ -html[lang="ko-KR"] body { font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Nanum Gothic", Dotum, sans-serif; } + +html[lang="ko-KR"] body { + font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Nanum Gothic", Dotum, sans-serif; +} + /* For Thai Font */ -html[lang="th"] body { font-family: "Sukhumvit Set", "Helvetica Neue", Helvetica, Arial, sans-serif; } + +html[lang="th"] body { + font-family: "Sukhumvit Set", "Helvetica Neue", Helvetica, Arial, sans-serif; +} + /* For Arabic Font */ -html[lang="fa"] body { font-family: Tahoma, Arial, sans-serif; } -body { background-color: #fafafa; color: #444; } -body.drag *, body.drag::after { cursor: grabbing !important; cursor: -moz-grabbing !important; cursor: -webkit-grabbing !important; cursor: -moz-grab !important; -moz-user-select: none !important; -webkit-user-select: none !important; user-select: none !important } -body.drag::after { bottom: 0; content: ""; left: 0; position: fixed; right: 0; top: 0; z-index: 999 } -body, ul, li { padding: 0; margin: 0; } -ul { margin-left: 1rem; margin-right: 1rem; } -li { list-style: none } -img { max-width: 100%; height: auto } -.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 { margin-bottom: .5rem; font-family: inherit; font-weight: 500; line-height: 1.1; color: inherit } -.h1, h1 { font-size: 1.75rem } -.h2, h2 { font-size: 1.5rem } -.h3, h3 { font-size: 1.25rem } -.h4, h4 { font-size: 1rem } -.h5, h5 { font-size: 0.8125rem } -.h6, h6 { font-size: 0.7rem } -h1 .fa {display: none;} -a { color: #3481bc; text-decoration: none } -.text-primary {color: #3481bc !important;} -a:focus, a:hover { color: #014c8c; text-decoration: underline } -a[href=""], a:not([href]) { cursor: default } -a:not([href]):not([tabindex]) { color: inherit; text-decoration: none } -a:not([href]):not([tabindex]):focus, a:not([href]):not([tabindex]):hover { color: inherit; text-decoration: none } -a:not([href]):not([tabindex]):focus { outline: 0 } -* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box } -*::-ms-clear { display: none; } -.text-justify { text-align: justify !important } -.text-nowrap { white-space: nowrap !important } -.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap } -.text-left { text-align: left !important } -.text-right { text-align: right !important } -.text-center { text-align: center !important } -.text-lowercase { text-transform: lowercase !important } -.text-uppercase { text-transform: uppercase !important } -.text-capitalize { text-transform: capitalize !important } -.font-weight-normal { font-weight: 400 } -.font-weight-bold { font-weight: 700 } -.font-italic { font-style: italic } -.text-white { color: #fff !important } -.text-muted { color: #818a91 !important } -.text-decoration-through { text-decoration: line-through !important } -.text-underline { text-decoration: underline !important } -a.text-underline:hover { text-decoration: none !important } -a.text-muted:focus, a.text-muted:hover { color: #4b5257 !important } -.text-primary { color: #0275d8 !important } -a.text-primary:focus, a.text-primary:hover { color: #025aa5 !important } -.text-success { color: #5cb85c !important } -a.text-success:focus, a.text-success:hover { color: #449d44 !important } -.text-info { color: #5bc0de !important } -a.text-info:focus, a.text-info:hover { color: #31b0d5 !important } -.text-warning { color: #f0ad4e !important } -a.text-warning:focus, a.text-warning:hover { color: #ec971f !important } -.text-danger { color: #d9534f !important } -a.text-danger:focus, a.text-danger:hover { color: #c9302c !important } -.text-gray-dark { color: #292b2c !important } -a.text-gray-dark:focus, a.text-gray-dark:hover { color: #101112 !important } -.text-hide { font: 0/0 a; color: transparent; text-shadow: none; background-color: transparent; border: 0 } -.hide { display: none !important } -.show { display: block !important } -.visible { visibility: visible !important; } -.invisible { visibility: hidden !important; } -.clear { clear: both; } + +html[lang="fa"] body { + font-family: Tahoma, Arial, sans-serif; +} + +body { + background-color: #fafafa; + color: #444; +} + +body.drag *, +body.drag::after { + cursor: grabbing !important; + cursor: -moz-grabbing !important; + cursor: -webkit-grabbing !important; + cursor: -moz-grab !important; + -moz-user-select: none !important; + -webkit-user-select: none !important; + user-select: none !important +} + +body.drag::after { + bottom: 0; + content: ""; + left: 0; + position: fixed; + right: 0; + top: 0; + z-index: 999 +} + +body, +ul, +li { + padding: 0; + margin: 0; +} + +ul { + margin-left: 1rem; + margin-right: 1rem; +} + +li { + list-style: none +} + +img { + max-width: 100%; + height: auto +} + +.h1, +.h2, +.h3, +.h4, +.h5, +.h6, +h1, +h2, +h3, +h4, +h5, +h6 { + margin-bottom: .5rem; + font-family: inherit; + font-weight: 500; + line-height: 1.1; + color: inherit +} + +.h1, +h1 { + font-size: 1.75rem +} + +.h2, +h2 { + font-size: 1.5rem +} + +.h3, +h3 { + font-size: 1.25rem +} + +.h4, +h4 { + font-size: 1rem +} + +.h5, +h5 { + font-size: 0.8125rem +} + +.h6, +h6 { + font-size: 0.7rem +} + +h1 .fa { + display: none; +} + +a { + color: #3481bc; + text-decoration: none +} + +.text-primary { + color: #3481bc !important; +} + +a:focus, +a:hover { + color: #014c8c; + text-decoration: underline +} + +a[href=""], +a:not([href]) { + cursor: default +} + +a:not([href]):not([tabindex]) { + color: inherit; + text-decoration: none +} + +a:not([href]):not([tabindex]):focus, +a:not([href]):not([tabindex]):hover { + color: inherit; + text-decoration: none +} + +a:not([href]):not([tabindex]):focus { + outline: 0 +} + +* { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box +} + +*::-ms-clear { + display: none; +} + +.text-justify { + text-align: justify !important +} + +.text-nowrap { + white-space: nowrap !important +} + +.text-truncate { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap +} + +.text-left { + text-align: left !important +} + +.text-right { + text-align: right !important +} + +.text-center { + text-align: center !important +} + +.text-lowercase { + text-transform: lowercase !important +} + +.text-uppercase { + text-transform: uppercase !important +} + +.text-capitalize { + text-transform: capitalize !important +} + +.font-weight-normal { + font-weight: 400 +} + +.font-weight-bold { + font-weight: 700 +} + +.font-italic { + font-style: italic +} + +.text-white { + color: #fff !important +} + +.text-muted { + color: #818a91 !important +} + +.text-decoration-through { + text-decoration: line-through !important +} + +.text-underline { + text-decoration: underline !important +} + +a.text-underline:hover { + text-decoration: none !important +} + +a.text-muted:focus, +a.text-muted:hover { + color: #4b5257 !important +} + +.text-primary { + color: #0275d8 !important +} + +a.text-primary:focus, +a.text-primary:hover { + color: #025aa5 !important +} + +.text-success { + color: #5cb85c !important +} + +a.text-success:focus, +a.text-success:hover { + color: #449d44 !important +} + +.text-info { + color: #5bc0de !important +} + +a.text-info:focus, +a.text-info:hover { + color: #31b0d5 !important +} + +.text-warning { + color: #f0ad4e !important +} + +a.text-warning:focus, +a.text-warning:hover { + color: #ec971f !important +} + +.text-danger { + color: #d9534f !important +} + +a.text-danger:focus, +a.text-danger:hover { + color: #c9302c !important +} + +.text-gray-dark { + color: #292b2c !important +} + +a.text-gray-dark:focus, +a.text-gray-dark:hover { + color: #101112 !important +} + +.text-hide { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0 +} + +.hide { + display: none !important +} + +.show { + display: block !important +} + +.visible { + visibility: visible !important; +} + +.invisible { + visibility: hidden !important; +} + +.clear { + clear: both; +} + /* custom */ -#loadingmask { display: none !important; } -.fa > .fa-lock { position: relative; float: left; width: auto !important; margin-top: -1em; font-size: 0.7em !important; color: #FFC107 !important; -webkit-text-stroke: 1px rgba(0, 0, 0, 0.39); text-stroke: 1px rgba(0, 0, 0, 0.39); } -.rotate180 { -webkit-transform: rotate(180deg); -moz-transform: rotate(180deg); -ms-transform: rotate(180deg); -o-transform: rotate(180deg); transform: rotate(180deg); } -.disabledPlugin, .disabledPlugin a { color: #B68282; font-style: italic; } -h1 { font-size: 1.5em; line-height: 1.5rem; padding: 0.8rem; margin: 0; } -h1 .fa { margin-right: 0.25em; color: #1377c5; } -h1 .help { margin: 0 0 0 0.25em; color: rgba(0, 0, 0, 0.15); font-size: 0.8em; cursor: pointer } -h1 .help:hover { color: rgba(0, 0, 0, 0.3); } -h1 small { margin-left: 0.5em; line-height: 1em } -.split { height: 0; font-size: 0; clear: both; padding: 0; border-top: 1px dotted rgba(0, 0, 0, .1) } -#previewIframe { width: 100%; height: 400px; } -.messageRead { color: #333; } -.messageUnread { color: #3CB371; font-weight: 500; } -.element-edit-message { display: none } -.element-edit-message p:last-child, .element-edit-message-tab p:last-child { margin-bottom: 0 } + +#loadingmask { + display: none !important; +} + +.fa > .fa-lock { + position: relative; + float: left; + width: auto !important; + margin-top: -1em; + font-size: 0.7em !important; + color: #FFC107 !important; + -webkit-text-stroke: 1px rgba(0, 0, 0, 0.39); + text-stroke: 1px rgba(0, 0, 0, 0.39); +} + +.rotate180 { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + -ms-transform: rotate(180deg); + -o-transform: rotate(180deg); + transform: rotate(180deg); +} + +.disabledPlugin, +.disabledPlugin a { + color: #B68282; + font-style: italic; +} + +h1 { + font-size: 1.5em; + line-height: 1.5rem; + padding: 0.8rem; + margin: 0; +} + +h1 .fa { + margin-right: 0.25em; + color: #1377c5; +} + +h1 .help { + margin: 0 0 0 0.25em; + color: rgba(0, 0, 0, 0.15); + font-size: 0.8em; + cursor: pointer +} + +h1 .help:hover { + color: rgba(0, 0, 0, 0.3); +} + +h1 small { + margin-left: 0.5em; + line-height: 1em +} + +.split { + height: 0; + font-size: 0; + clear: both; + padding: 0; + border-top: 1px dotted rgba(0, 0, 0, .1) +} + +#previewIframe { + width: 100%; + height: 400px; +} + +.messageRead { + color: #333; +} + +.messageUnread { + color: #3CB371; + font-weight: 500; +} + +.element-edit-message { + display: none +} + +.element-edit-message p:last-child, +.element-edit-message-tab p:last-child { + margin-bottom: 0 +} diff --git a/manager/media/style/default/css/forms.css b/manager/media/style/default/css/forms.css index 0f8a6f4c66..4b8adb280c 100755 --- a/manager/media/style/default/css/forms.css +++ b/manager/media/style/default/css/forms.css @@ -1,51 +1,372 @@ /* [ FORMS ] */ -legend { font-size: 1em; } -label { cursor: pointer; display: inline-block; margin-bottom: .5em } -label:not([for]) { cursor: default } -button, input { margin: 0; padding: 0; border: none; font: inherit; line-height: normal; } -input[type=checkbox], input[type=radio] { width: 0.8125rem !important; height: 0.8125rem !important; margin-right: 0.25em; vertical-align: -0.15em; border-radius: .1rem; border: 1px solid #d4d4d4; background: #fff no-repeat 50% -1em; outline: none; transition: border-color .2s, background-position .1s; } -input[type=checkbox] { background-image: url("data:image/svg+xml;utf8,%3Csvg%20viewBox%3D%270%200%201792%201792%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M1671%20566q0%2040-28%2068l-724%20724-136%20136q-28%2028-68%2028t-68-28l-136-136-362-362q-28-28-28-68t28-68l136-136q28-28%2068-28t68%2028l294%20295%20656-657q28-28%2068-28t68%2028l136%20136q28%2028%2028%2068z%27%20fill%3D%27%23444%27/%3E%3C/svg%3E"); background-size: .875em; } -input[type=radio] { background-image: url("data:image/svg+xml;utf-8,%3Csvg%20viewBox%3D%270%200%201792%201792%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M1664%20896q0%20209-103%20385.5t-279.5%20279.5-385.5%20103-385.5-103-279.5-279.5-103-385.5%20103-385.5%20279.5-279.5%20385.5-103%20385.5%20103%20279.5%20279.5%20103%20385.5z%27%20fill%3D%27%23444%27/%3E%3C/svg%3E"); background-size: .6em; border-radius: 50% } -input[type=checkbox]:hover, input[type=radio]:hover { border-color: #bcbcbc } -input[type=checkbox]:active, input[type=radio]:active { background-color: #fafafa; } -input[type=checkbox]:focus, input[type=radio]:focus { border-color: #4d8ef9 !important; box-shadow: 0 0 0 1px rgba(77, 142, 249, 0.5) } -input[type=checkbox]:checked, input[type=radio]:checked { background-position: 50% 50% } -input[type=checkbox]:disabled { background-image: url("data:image/svg+xml;utf8,%3Csvg%20viewBox%3D%270%200%201792%201792%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M1671%20566q0%2040-28%2068l-724%20724-136%20136q-28%2028-68%2028t-68-28l-136-136-362-362q-28-28-28-68t28-68l136-136q28-28%2068-28t68%2028l294%20295%20656-657q28-28%2068-28t68%2028l136%20136q28%2028%2028%2068z%27%20fill%3D%27%23bbb%27/%3E%3C/svg%3E"); background-size: .875em; } -button, input, optgroup, select, textarea { position: relative; font-family: sans-serif; font-size: 0.8125rem; line-height: 1.23076923; margin: 0; -webkit-appearance: none; -moz-appearance: none; } -.form-control, input[type=text]:not(.form-control), input[type=password], input[type=number], input[type=email], input[type=date], input[type=url], input[type=search], select, textarea { display: inline-block; width: 100%; max-width: 100%; padding: 0.46153846em .5em; line-height: 1.23076923; vertical-align: inherit; font-size: 0.8125rem; color: #464a4c; background-color: #fff; -webkit-background-clip: padding-box; background-clip: padding-box; border: 1px solid #d4d4d4; border-color: rgba(0,0,0,0.08); border-radius: .1em; -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; } -.form-control:focus, input:not([type=radio]):not([type=checkbox]):focus, select:focus, textarea:focus, .btn.focus, .btn:focus { z-index: 3; outline-offset: -1px; outline: rgba(77, 142, 249, 0.5) solid 2px; border-color: #66afe9; } -input:not([type=button]):not([type=submit]):hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: #bbb; transition: border-color 0s, background-position .1s; } -.btn, button:not(.btn), input[type=button]:not(.btn), input[type=submit]:not(.btn) { display: inline-block; padding: 0.46153846em 1em; line-height: 1.23076923; vertical-align: inherit; text-align: center; text-decoration: none !important; font-size: 0.8125rem; font-weight: 400; white-space: nowrap; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: pointer; background-color: #fff; border: 1px solid #d4d4d4; border-radius: .1em; -webkit-transition: all .2s ease-in-out; -o-transition: all .2s ease-in-out; transition: all .2s ease-in-out } -select:not([size]):not([multiple]), select.form-control:not([size]):not([multiple]), select[size="1"]:not([multiple]) { height: 2.3076923em; line-height: 1.38461538 } -.form-control-sm, .input-group-sm > .form-control, .input-group-sm > .input-group-addon, .input-group-sm > .input-group-btn > .btn, input.form-control-sm, .btn-group-sm > .btn, .btn-sm, .input-group-addon.form-control-sm, .input-group-sm > .input-group-addon, .input-group-sm > .input-group-btn > .input-group-addon.btn { padding: 0.46153846em .5rem; font-size: .6772rem; border-radius: .1rem; } -.form-control-lg, .input-group-lg > .form-control, .input-group-lg > .input-group-addon, .input-group-lg > .input-group-btn > .btn, input.form-control-lg, .btn-group-lg > .btn, .btn-lg, .input-group-addon.form-control-lg, .input-group-lg > .input-group-addon, .input-group-lg > .input-group-btn > .input-group-addon.btn { padding: 0.46153846em .5rem; font-size: 1.15rem; border-radius: .1rem; } -.btn:hover, input[type=button]:not(.btn):hover, input[type=submit]:not(.btn):hover { color: #292b2c; background-color: #efefef; border-color: #c3c3c3 } -.btn:focus, input[type=button]:not(.btn):focus, input[type=submit]:not(.btn):focus { background-color: #e6e6e6; border-color: #adadad } -.btn-primary { color: #fff; background-color: #0275d8; border-color: #0275d8 } -.btn-primary:hover { color: #fff; background-color: #025aa5; border-color: #01549b } -.btn-secondary { color: #292b2c; background-color: #fff; border-color: #d4d4d4 } -.btn-secondary:hover { color: #292b2c; background-color: #e6e6e6; border-color: #adadad } -.btn-success { color: #fff; background-color: #5cb85c; border-color: #56ac56 } -.btn-success:hover { color: #fff; background-color: #449d44; border-color: #419641 } -.btn-danger { color: #fff; background-color: #d9534f; border-color: #d9534f } -.btn-danger:hover { color: #fff; background-color: #c9302c; border-color: #c12e2a } -.btn-warning { color: #fff; background-color: #f0ad4e; border-color: #f0ad4e; } -.btn-warning:hover { color: #fff; background-color: #ec971f; border-color: #eb9316; } -.btn-info { color: #fff; background-color: #5bc0de; border-color: #5bc0de; } -.btn-info:hover { color: #fff; background-color: #31b0d5; border-color: #2aabd2; } -.btn-default { color: #bbb; background-color: #202329; border-color: #202329 } -.btn-default:hover { color: #fff; background-color: #1a1c21; border-color: #1a1c21 } -textarea, textarea.form-control { width: 100%; line-height: 1.5; overflow: auto; resize: vertical } -select:not([size]):not([multiple]), select[size="1"] { padding-right: 2em !important; background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTc5MiAxNzkyJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnPjxwYXRoIGQ9J00xMzk1IDczNnEwIDEzLTEwIDIzbC00NjYgNDY2cS0xMCAxMC0yMyAxMHQtMjMtMTBsLTQ2Ni00NjZxLTEwLTEwLTEwLTIzdDEwLTIzbDUwLTUwcTEwLTEwIDIzLTEwdDIzIDEwbDM5MyAzOTMgMzkzLTM5M3ExMC0xMCAyMy0xMHQyMyAxMGw1MCA1MHExMCAxMCAxMCAyM3onIGZpbGw9JyUyMzQ0NCcvPjwvc3ZnPg==") !important; background-repeat: no-repeat; background-position: right center; background-size: 2em 1.3em } -optgroup { font-style: normal; font-weight: 500; background-color: #ddd; } -optgroup option { font-weight: normal; background-color: #fff; } -input[type=color] { width: 2.308em; height: 2.308em; -webkit-appearance: menulist; -moz-appearance: menupopup } -input[type=range] { -webkit-appearance: slider-horizontal; -moz-appearance: initial; } -.input-group-addon { padding: 0.46153846em .75em; font-size: 0.8125rem; border: 1px solid rgba(0, 0, 0, .15); border-radius: .1em; } -.form-control.dropdown-item:focus, .form-control.dropdown-item:hover { background-color: inherit } -::-ms-value { border: none; margin: 0; padding: 0 0 1px; line-height: 1 } -select::-ms-expand { display: none; } -::-moz-focus-inner { border: 0; padding: 0; } + +legend { + font-size: 1em; +} + +label { + cursor: pointer; + display: inline-block; + margin-bottom: .5em +} + +label:not([for]) { + cursor: default +} + +button, +input { + margin: 0; + padding: 0; + border: none; + font: inherit; + line-height: normal; +} + +input[type=checkbox], +input[type=radio] { + width: 0.8125rem !important; + height: 0.8125rem !important; + margin-right: 0.25em; + vertical-align: -0.15em; + border-radius: .1rem; + border: 1px solid #d4d4d4; + background: #fff no-repeat 50% -1em; + outline: none; + transition: border-color .2s, background-position .1s; +} + +input[type=checkbox] { + background-image: url("data:image/svg+xml;utf8,%3Csvg%20viewBox%3D%270%200%201792%201792%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M1671%20566q0%2040-28%2068l-724%20724-136%20136q-28%2028-68%2028t-68-28l-136-136-362-362q-28-28-28-68t28-68l136-136q28-28%2068-28t68%2028l294%20295%20656-657q28-28%2068-28t68%2028l136%20136q28%2028%2028%2068z%27%20fill%3D%27%23444%27/%3E%3C/svg%3E"); + background-size: .875em; +} + +input[type=radio] { + background-image: url("data:image/svg+xml;utf-8,%3Csvg%20viewBox%3D%270%200%201792%201792%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M1664%20896q0%20209-103%20385.5t-279.5%20279.5-385.5%20103-385.5-103-279.5-279.5-103-385.5%20103-385.5%20279.5-279.5%20385.5-103%20385.5%20103%20279.5%20279.5%20103%20385.5z%27%20fill%3D%27%23444%27/%3E%3C/svg%3E"); + background-size: .6em; + border-radius: 50% +} + +input[type=checkbox]:hover, +input[type=radio]:hover { + border-color: #bcbcbc +} + +input[type=checkbox]:active, +input[type=radio]:active { + background-color: #fafafa; +} + +input[type=checkbox]:focus, +input[type=radio]:focus { + border-color: #4d8ef9 !important; + box-shadow: 0 0 0 1px rgba(77, 142, 249, 0.5) +} + +input[type=checkbox]:checked, +input[type=radio]:checked { + background-position: 50% 50% +} + +input[type=checkbox]:disabled { + background-image: url("data:image/svg+xml;utf8,%3Csvg%20viewBox%3D%270%200%201792%201792%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M1671%20566q0%2040-28%2068l-724%20724-136%20136q-28%2028-68%2028t-68-28l-136-136-362-362q-28-28-28-68t28-68l136-136q28-28%2068-28t68%2028l294%20295%20656-657q28-28%2068-28t68%2028l136%20136q28%2028%2028%2068z%27%20fill%3D%27%23bbb%27/%3E%3C/svg%3E"); + background-size: .875em; +} + +button, +input, +optgroup, +select, +textarea { + position: relative; + font-family: sans-serif; + font-size: 0.8125rem; + line-height: 1.23076923; + margin: 0; + -webkit-appearance: none; + -moz-appearance: none; +} + +.form-control, +input[type=text]:not(.form-control), +input[type=password], +input[type=number], +input[type=email], +input[type=date], +input[type=url], +input[type=search], +select, +textarea { + display: inline-block; + width: 100%; + max-width: 100%; + padding: 0.46153846em .5em; + line-height: 1.23076923; + vertical-align: inherit; + font-size: 0.8125rem; + color: #464a4c; + background-color: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #d4d4d4; + border-color: rgba(0, 0, 0, 0.08); + border-radius: .1em; + -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; + -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; +} + +.form-control:focus, +input:not([type=radio]):not([type=checkbox]):focus, +select:focus, +textarea:focus, +.btn.focus, +.btn:focus { + z-index: 3; + outline-offset: -1px; + outline: rgba(77, 142, 249, 0.5) solid 2px; + border-color: #66afe9; +} + +input:not([type=button]):not([type=submit]):hover:not(:focus), +select:hover:not(:focus), +textarea:hover:not(:focus) { + border-color: #bbb; + transition: border-color 0s, background-position .1s; +} + +.btn, +button:not(.btn), +input[type=button]:not(.btn), +input[type=submit]:not(.btn) { + display: inline-block; + padding: 0.46153846em 1em; + line-height: 1.23076923; + vertical-align: inherit; + text-align: center; + text-decoration: none !important; + font-size: 0.8125rem; + font-weight: 400; + white-space: nowrap; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; + background-color: #fff; + border: 1px solid #d4d4d4; + border-radius: .1em; + -webkit-transition: all .2s ease-in-out; + -o-transition: all .2s ease-in-out; + transition: all .2s ease-in-out +} + +select:not([size]):not([multiple]), +select.form-control:not([size]):not([multiple]), +select[size="1"]:not([multiple]) { + height: 2.3076923em; + line-height: 1.38461538 +} + +.form-control-sm, +.input-group-sm > .form-control, +.input-group-sm > .input-group-addon, +.input-group-sm > .input-group-btn > .btn, +input.form-control-sm, +.btn-group-sm > .btn, +.btn-sm, +.input-group-addon.form-control-sm, +.input-group-sm > .input-group-addon, +.input-group-sm > .input-group-btn > .input-group-addon.btn { + padding: 0.46153846em .5rem; + font-size: .6772rem; + border-radius: .1rem; +} + +.form-control-lg, +.input-group-lg > .form-control, +.input-group-lg > .input-group-addon, +.input-group-lg > .input-group-btn > .btn, +input.form-control-lg, +.btn-group-lg > .btn, +.btn-lg, +.input-group-addon.form-control-lg, +.input-group-lg > .input-group-addon, +.input-group-lg > .input-group-btn > .input-group-addon.btn { + padding: 0.46153846em .5rem; + font-size: 1.15rem; + border-radius: .1rem; +} + +.btn:hover, +input[type=button]:not(.btn):hover, +input[type=submit]:not(.btn):hover { + color: #292b2c; + background-color: #efefef; + border-color: #c3c3c3 +} + +.btn:focus, +input[type=button]:not(.btn):focus, +input[type=submit]:not(.btn):focus { + background-color: #e6e6e6; + border-color: #adadad +} + +.btn-primary { + color: #fff; + background-color: #0275d8; + border-color: #0275d8 +} + +.btn-primary:hover { + color: #fff; + background-color: #025aa5; + border-color: #01549b +} + +.btn-secondary { + color: #292b2c; + background-color: #fff; + border-color: #d4d4d4 +} + +.btn-secondary:hover { + color: #292b2c; + background-color: #e6e6e6; + border-color: #adadad +} + +.btn-success { + color: #fff; + background-color: #5cb85c; + border-color: #56ac56 +} + +.btn-success:hover { + color: #fff; + background-color: #449d44; + border-color: #419641 +} + +.btn-danger { + color: #fff; + background-color: #d9534f; + border-color: #d9534f +} + +.btn-danger:hover { + color: #fff; + background-color: #c9302c; + border-color: #c12e2a +} + +.btn-warning { + color: #fff; + background-color: #f0ad4e; + border-color: #f0ad4e; +} + +.btn-warning:hover { + color: #fff; + background-color: #ec971f; + border-color: #eb9316; +} + +.btn-info { + color: #fff; + background-color: #5bc0de; + border-color: #5bc0de; +} + +.btn-info:hover { + color: #fff; + background-color: #31b0d5; + border-color: #2aabd2; +} + +.btn-default { + color: #bbb; + background-color: #202329; + border-color: #202329 +} + +.btn-default:hover { + color: #fff; + background-color: #1a1c21; + border-color: #1a1c21 +} + +textarea, +textarea.form-control { + width: 100%; + line-height: 1.5; + overflow: auto; + resize: vertical +} + +select:not([size]):not([multiple]), +select[size="1"] { + padding-right: 2em !important; + background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTc5MiAxNzkyJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnPjxwYXRoIGQ9J00xMzk1IDczNnEwIDEzLTEwIDIzbC00NjYgNDY2cS0xMCAxMC0yMyAxMHQtMjMtMTBsLTQ2Ni00NjZxLTEwLTEwLTEwLTIzdDEwLTIzbDUwLTUwcTEwLTEwIDIzLTEwdDIzIDEwbDM5MyAzOTMgMzkzLTM5M3ExMC0xMCAyMy0xMHQyMyAxMGw1MCA1MHExMCAxMCAxMCAyM3onIGZpbGw9JyUyMzQ0NCcvPjwvc3ZnPg==") !important; + background-repeat: no-repeat; + background-position: right center; + background-size: 2em 1.3em +} + +optgroup { + font-style: normal; + font-weight: 500; + background-color: #ddd; +} + +optgroup option { + font-weight: normal; + background-color: #fff; +} + +input[type=color] { + width: 2.308em; + height: 2.308em; + -webkit-appearance: menulist; + -moz-appearance: menupopup +} + +input[type=range] { + -webkit-appearance: slider-horizontal; + -moz-appearance: initial; +} + +.input-group-addon { + padding: 0.46153846em .75em; + font-size: 0.8125rem; + border: 1px solid rgba(0, 0, 0, .15); + border-radius: .1em; +} + +.form-control.dropdown-item:focus, +.form-control.dropdown-item:hover { + background-color: inherit +} + +::-ms-value { + border: none; + margin: 0; + padding: 0 0 1px; + line-height: 1 +} + +select::-ms-expand { + display: none; +} + +::-moz-focus-inner { + border: 0; + padding: 0; +} + @-moz-document url-prefix() { -select:not([size]):not([multiple]) { text-indent: -2px } + select:not([size]):not([multiple]) { + text-indent: -2px + } } diff --git a/manager/media/style/default/css/index.css b/manager/media/style/default/css/index.css index d41deb372a..3df15941e1 100755 --- a/manager/media/style/default/css/index.css +++ b/manager/media/style/default/css/index.css @@ -1,44 +1,244 @@ -#frameset { position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; } -#mainMenu, #tree, #main { position: absolute; } -#mainMenu { top: 0; left: 0; width: 100%; height: 2.2rem; z-index: 100; } -#tree { left: 0; top: 2.2rem; bottom: 0; width: 25rem; max-width: 100%; overflow: hidden; z-index: 2; } -#main { left: 25rem; top: 2.2rem; right: 0; bottom: 0; z-index: 1; } -#main #mainframe { display: block; position: absolute; width: 100%; height: 100%; overflow: auto; } +#frameset { + position: absolute; + left: 0; + top: 0; + right: 0; + bottom: 0; + overflow: hidden; +} + +#mainMenu, +#tree, +#main { + position: absolute; +} + +#mainMenu { + top: 0; + left: 0; + width: 100%; + height: 2.2rem; + z-index: 100; +} + +#tree { + left: 0; + top: 2.2rem; + bottom: 0; + width: 25rem; + max-width: 100%; + overflow: hidden; + z-index: 2; +} + +#main { + left: 25rem; + top: 2.2rem; + right: 0; + bottom: 0; + z-index: 1; +} + +#main #mainframe { + display: block; + position: absolute; + width: 100%; + height: 100%; + overflow: auto; +} + /* floater */ -#floater { position: fixed; z-index: 1000; opacity: 0; visibility: hidden; max-width: 20rem; padding: 1.5rem; top: 4rem; left: 2rem; border-radius: 0.25rem; background-color: #fff; -webkit-box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); transition-duration: 0.15s } -#floater.show { opacity: 1; visibility: visible; } + +#floater { + position: fixed; + z-index: 1000; + opacity: 0; + visibility: hidden; + max-width: 20rem; + padding: 1.5rem; + top: 4rem; + left: 2rem; + border-radius: 0.25rem; + background-color: #fff; + -webkit-box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); + box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); + transition-duration: 0.15s +} + +#floater.show { + opacity: 1; + visibility: visible; +} + /*resizer*/ -#resizer { position: absolute; z-index: 99; top: 2.2rem; bottom: 0; left: 25rem; width: 5px; margin-left: -1px; cursor: col-resize; background-color: transparent; transition: background-color .3s } -#resizer:hover { background-color: rgba(0, 0, 0, 0.1); } -#mask_resizer { position: absolute; width: 100%; height: 100%; } + +#resizer { + position: absolute; + z-index: 99; + top: 2.2rem; + bottom: 0; + left: 25rem; + width: 5px; + margin-left: -1px; + cursor: col-resize; + background-color: transparent; + transition: background-color .3s +} + +#resizer:hover { + background-color: rgba(0, 0, 0, 0.1); +} + +#mask_resizer { + position: absolute; + width: 100%; + height: 100%; +} + /* mainloader */ -#mainloader { position: absolute; z-index: 50000; top: 0; left: 0; width: 100%; height: 100%; text-align: center; vertical-align: middle; padding: 15% 0 0 0; background-color: rgba(255, 255, 255, 0.64); opacity: 0; visibility: hidden; -webkit-transition-duration: 0.3s; transition-duration: 0.3s } -#mainloader.show { opacity: 0.75; visibility: visible; -webkit-transition-duration: 0.1s; transition-duration: 0.1s } -#mainloader::before { content: ""; display: block; position: absolute; z-index: 1; left: 50%; top: 30%; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; animation: rotate 2s linear infinite; box-shadow: 5px 5px 0 0 rgb(234, 132, 82), 14px -7px 0 0 rgba(111, 163, 219, 0.7), -7px 11px 0 0 rgba(112, 193, 92, 0.74), -11px -7px 0 0 rgba(147, 205, 99, 0.78); } -.sidebar-closed #tree { width: 0 !important; } -.sidebar-closed #main, .sidebar-closed #resizer { left: 0 !important; } + +#mainloader { + position: absolute; + z-index: 50000; + top: 0; + left: 0; + width: 100%; + height: 100%; + text-align: center; + vertical-align: middle; + padding: 15% 0 0 0; + background-color: rgba(255, 255, 255, 0.64); + opacity: 0; + visibility: hidden; + -webkit-transition-duration: 0.3s; + transition-duration: 0.3s +} + +#mainloader.show { + opacity: 0.75; + visibility: visible; + -webkit-transition-duration: 0.1s; + transition-duration: 0.1s +} + +#mainloader::before { + content: ""; + display: block; + position: absolute; + z-index: 1; + left: 50%; + top: 30%; + width: 120px; + height: 120px; + margin: -60px 0 0 -60px; + border-radius: 50%; + animation: rotate 2s linear infinite; + box-shadow: 5px 5px 0 0 rgb(234, 132, 82), 14px -7px 0 0 rgba(111, 163, 219, 0.7), -7px 11px 0 0 rgba(112, 193, 92, 0.74), -11px -7px 0 0 rgba(147, 205, 99, 0.78); +} + +.sidebar-closed #tree { + width: 0 !important; +} + +.sidebar-closed #main, +.sidebar-closed #resizer { + left: 0 !important; +} + @media (min-width: 1200px) { -#mainMenu { height: 3.125rem; } -#tree, #main { top: 3.125rem; } -#tree { font-size: .875rem } + #mainMenu { + height: 3.125rem; + } + #tree, + #main { + top: 3.125rem; + } + #tree { + font-size: .875rem + } } + @media (max-width: 840px) { -#floater { left: 0; right: 0; margin: 0 auto; } -#resizer { display: none } -#frameset #mask_resizer { z-index: 3 !important; opacity: 0.5; visibility: visible; background-color: #000; -webkit-transition: 0.2s; transition: 0.2s } -.sidebar-closed #frameset #mask_resizer { opacity: 0; visibility: hidden; } -#tree { z-index: 5; width: 100% !important; max-width: 20rem; box-shadow: 0 0 1rem rgba(0, 0, 0, 0.25); -webkit-transition: 0.25s; transition: 0.25s } -.sidebar-closed #tree { width: auto !important; box-shadow: none; -webkit-transform: translate3d(-100%, 0, 0); transform: translate3d(-100%, 0, 0); } -#tree .treeframebody { box-shadow: none } -.sidebar-closed #main::after { content: ""; position: absolute; z-index: 1; left: 0; top: 6rem; bottom: 0; width: 1rem; } -#main { left: 0 !important; } -#main::before { content: ""; position: absolute; z-index: 9999; left: 0; top: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0); } -.sidebar-closed #mainMenu:not(.show) + #tree + #main::before { display: none } + #floater { + left: 0; + right: 0; + margin: 0 auto; + } + #resizer { + display: none + } + #frameset #mask_resizer { + z-index: 3 !important; + opacity: 0.5; + visibility: visible; + background-color: #000; + -webkit-transition: 0.2s; + transition: 0.2s + } + .sidebar-closed #frameset #mask_resizer { + opacity: 0; + visibility: hidden; + } + #tree { + z-index: 5; + width: 100% !important; + max-width: 20rem; + box-shadow: 0 0 1rem rgba(0, 0, 0, 0.25); + -webkit-transition: 0.25s; + transition: 0.25s + } + .sidebar-closed #tree { + width: auto !important; + box-shadow: none; + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + } + #tree .treeframebody { + box-shadow: none + } + .sidebar-closed #main::after { + content: ""; + position: absolute; + z-index: 1; + left: 0; + top: 6rem; + bottom: 0; + width: 1rem; + } + #main { + left: 0 !important; + } + #main::before { + content: ""; + position: absolute; + z-index: 9999; + left: 0; + top: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0); + } + .sidebar-closed #mainMenu:not(.show) + #tree + #main::before { + display: none + } } + @keyframes rotate { -to { transform: rotate(360deg) } + to { + transform: rotate(360deg) + } } + /* dark */ -.dark #frameset { background-color: #202329 } -.dark #main { background-color: #ecf0f1 } -.dark #mainloader { background-color: rgba(0, 0, 0, 0.1); } + +.dark #frameset { + background-color: #202329 +} + +.dark #main { + background-color: #ecf0f1 +} + +.dark #mainloader { + background-color: rgba(0, 0, 0, 0.1); +} diff --git a/manager/media/style/default/css/layout.css b/manager/media/style/default/css/layout.css index 173a9bcd6c..05bf9d5463 100755 --- a/manager/media/style/default/css/layout.css +++ b/manager/media/style/default/css/layout.css @@ -1,29 +1,151 @@ -.layout { display: table; table-layout: fixed; height: 100%; width: 100% } -.layout > .layout-row { display: table-row; vertical-align: top; height: 100% } -.layout > .layout-row > .layout-cell { display: table-cell; vertical-align: top; height: 100% } -.layout > .layout-row > .layout-cell.layout-container, .layout > .layout-row > .layout-cell .layout-container, .layout > .layout-row > .layout-cell.padded-container, .layout > .layout-row > .layout-cell .padded-container { padding: 1rem 1rem 0 1rem } -.layout > .layout-row > .layout-cell.layout-container .container-flush, .layout > .layout-row > .layout-cell .layout-container .container-flush, .layout > .layout-row > .layout-cell.padded-container .container-flush, .layout > .layout-row > .layout-cell .padded-container .container-flush { padding-top: 0 } -.layout > .layout-row > .layout-cell .layout-relative { position: relative; height: 100% } -.layout > .layout-row > .layout-cell .layout-absolute { position: absolute; height: 100%; width: 100% } -.layout > .layout-row > .layout-cell.min-size { width: 0 } -.layout > .layout-row > .layout-cell.min-height { height: 0 } -.layout > .layout-row > .layout-cell.center { text-align: center } -.layout > .layout-row > .layout-cell.middle { vertical-align: middle } -.layout > .layout-row > .layout-cell.layout-container, .layout > .layout-row > .layout-cell .layout-container, .layout > .layout-row > .layout-cell.padded-container, .layout > .layout-row > .layout-cell .padded-container { padding: 1rem 1rem 0 1rem } -.layout > .layout-row > .layout-cell.layout-container .container-flush, .layout > .layout-row > .layout-cell .layout-container .container-flush, .layout > .layout-row > .layout-cell.padded-container .container-flush, .layout > .layout-row > .layout-cell .padded-container .container-flush { padding-top: 0 } -.layout > .layout-row > .layout-cell .layout-relative { position: relative; height: 100% } -.layout > .layout-row > .layout-cell .layout-absolute { position: absolute; height: 100%; width: 100% } -.layout > .layout-row > .layout-cell.min-size { width: 0 } -.layout > .layout-row > .layout-cell.min-height { height: 0 } -.layout > .layout-row > .layout-cell.center { text-align: center } -.layout > .layout-row > .layout-cell.middle { vertical-align: middle } -.layout > .layout-row.min-size { height: 0 } -.layout > .layout-cell { display: table-cell; vertical-align: top; height: 100% } -.layout > .layout-cell.layout-container, .layout > .layout-cell .layout-container, .layout > .layout-cell.padded-container, .layout > .layout-cell .padded-container { padding: 1rem 1rem 0 1rem } -.layout > .layout-cell.layout-container .container-flush, .layout > .layout-cell .layout-container .container-flush, .layout > .layout-cell.padded-container .container-flush, .layout > .layout-cell .padded-container .container-flush { padding-top: 0 } -.layout > .layout-cell .layout-relative { position: relative; height: 100% } -.layout > .layout-cell .layout-absolute { position: absolute; height: 100%; width: 100% } -.layout > .layout-cell.min-size { width: 0 } -.layout > .layout-cell.min-height { height: 0 } -.layout > .layout-cell.center { text-align: center } -.layout > .layout-cell.middle { vertical-align: middle } +.layout { + display: table; + table-layout: fixed; + height: 100%; + width: 100% +} + +.layout > .layout-row { + display: table-row; + vertical-align: top; + height: 100% +} + +.layout > .layout-row > .layout-cell { + display: table-cell; + vertical-align: top; + height: 100% +} + +.layout > .layout-row > .layout-cell.layout-container, +.layout > .layout-row > .layout-cell .layout-container, +.layout > .layout-row > .layout-cell.padded-container, +.layout > .layout-row > .layout-cell .padded-container { + padding: 1rem 1rem 0 1rem +} + +.layout > .layout-row > .layout-cell.layout-container .container-flush, +.layout > .layout-row > .layout-cell .layout-container .container-flush, +.layout > .layout-row > .layout-cell.padded-container .container-flush, +.layout > .layout-row > .layout-cell .padded-container .container-flush { + padding-top: 0 +} + +.layout > .layout-row > .layout-cell .layout-relative { + position: relative; + height: 100% +} + +.layout > .layout-row > .layout-cell .layout-absolute { + position: absolute; + height: 100%; + width: 100% +} + +.layout > .layout-row > .layout-cell.min-size { + width: 0 +} + +.layout > .layout-row > .layout-cell.min-height { + height: 0 +} + +.layout > .layout-row > .layout-cell.center { + text-align: center +} + +.layout > .layout-row > .layout-cell.middle { + vertical-align: middle +} + +.layout > .layout-row > .layout-cell.layout-container, +.layout > .layout-row > .layout-cell .layout-container, +.layout > .layout-row > .layout-cell.padded-container, +.layout > .layout-row > .layout-cell .padded-container { + padding: 1rem 1rem 0 1rem +} + +.layout > .layout-row > .layout-cell.layout-container .container-flush, +.layout > .layout-row > .layout-cell .layout-container .container-flush, +.layout > .layout-row > .layout-cell.padded-container .container-flush, +.layout > .layout-row > .layout-cell .padded-container .container-flush { + padding-top: 0 +} + +.layout > .layout-row > .layout-cell .layout-relative { + position: relative; + height: 100% +} + +.layout > .layout-row > .layout-cell .layout-absolute { + position: absolute; + height: 100%; + width: 100% +} + +.layout > .layout-row > .layout-cell.min-size { + width: 0 +} + +.layout > .layout-row > .layout-cell.min-height { + height: 0 +} + +.layout > .layout-row > .layout-cell.center { + text-align: center +} + +.layout > .layout-row > .layout-cell.middle { + vertical-align: middle +} + +.layout > .layout-row.min-size { + height: 0 +} + +.layout > .layout-cell { + display: table-cell; + vertical-align: top; + height: 100% +} + +.layout > .layout-cell.layout-container, +.layout > .layout-cell .layout-container, +.layout > .layout-cell.padded-container, +.layout > .layout-cell .padded-container { + padding: 1rem 1rem 0 1rem +} + +.layout > .layout-cell.layout-container .container-flush, +.layout > .layout-cell .layout-container .container-flush, +.layout > .layout-cell.padded-container .container-flush, +.layout > .layout-cell .padded-container .container-flush { + padding-top: 0 +} + +.layout > .layout-cell .layout-relative { + position: relative; + height: 100% +} + +.layout > .layout-cell .layout-absolute { + position: absolute; + height: 100%; + width: 100% +} + +.layout > .layout-cell.min-size { + width: 0 +} + +.layout > .layout-cell.min-height { + height: 0 +} + +.layout > .layout-cell.center { + text-align: center +} + +.layout > .layout-cell.middle { + vertical-align: middle +} diff --git a/manager/media/style/default/css/main.css b/manager/media/style/default/css/main.css index a3807f7e73..65a04dc862 100755 --- a/manager/media/style/default/css/main.css +++ b/manager/media/style/default/css/main.css @@ -1,193 +1,898 @@ /* -------------------------[ Misc stuff ]--- */ -.comment { font-size: 11px; color: #999; padding: 4px 0; } -.screen { border: 1px solid #ddd; text-align: center; } -.even { background: #d9e7c2; } -.odd { background: #fff; } + +.comment { + font-size: 11px; + color: #999; + padding: 4px 0; +} + +.screen { + border: 1px solid #ddd; + text-align: center; +} + +.even { + background: #d9e7c2; +} + +.odd { + background: #fff; +} + /* -------------------------[ end sortable table ]--- */ -.disabledImage { width: 20px; opacity: 0.3; filter: alpha(opacity=30); } -.disabledImage img { border: 0; } -.editorCell { border-top: 1px solid #808080; text-align: left; vertical-align: baseline; } + +.disabledImage { + width: 20px; + opacity: 0.3; + filter: alpha(opacity=30); +} + +.disabledImage img { + border: 0; +} + +.editorCell { + border-top: 1px solid #808080; + text-align: left; + vertical-align: baseline; +} + /* */ -.unpublished a, .unpublish { color: #b68282; font-style: italic; } -.notInMenuNode { color: #39515d; text-decoration: none; } -#treeSplitter { width: 10px; height: 100%; position: absolute; right: -10px; } -.deleted { color: #a52a2a; text-decoration: line-through; } -label.disabled { color: #aaa; } + +.unpublished a, +.unpublish { + color: #b68282; + font-style: italic; +} + +.notInMenuNode { + color: #39515d; + text-decoration: none; +} + +#treeSplitter { + width: 10px; + height: 100%; + position: absolute; + right: -10px; +} + +.deleted { + color: #a52a2a; + text-decoration: line-through; +} + +label.disabled { + color: #aaa; +} + /* -------------------------[ home page main links ]--- */ + /*a.hometblink, a.hometblink:active, .hometblink { text-decoration: underline; color: #333; font-weight: 500; font-size: 12px; } a.hometblink:hover { text-decoration: underline; color: Gray; }*/ -.notice { width: 100%; padding: 5px; border: 1px solid #eee; background-color: #f5f5f5; color: #707070; } + +.notice { + width: 100%; + padding: 5px; + border: 1px solid #eee; + background-color: #f5f5f5; + color: #707070; +} + /* -------------------------[ Settings Table ]--- */ -.filelist td { border-bottom: 1px solid #c2c3cf; } + +.filelist td { + border-bottom: 1px solid #c2c3cf; +} + /* -------------------------[ Welcome Page ]--- */ + /*#mainActionPages { background: #f5f5f5; }*/ + /* -------------------------[ New sortable table class ]--- */ -.sortabletable { width: 100%; border-collapse: collapse; } -.sortabletable thead tr { color: #333; font-weight: 500; white-space: nowrap; background-color: #d2d2d2; text-align: left; } -.sortabletable tr { background: #fff; } -.sortabletable tr.even { background: #f7f7f7; } -.sortabletable tbody tr:hover { background: #e9f0f3; } -.sortabletable td, .sortabletable th { padding: 5px !important; border: 1px solid #ccc; } -.sortabletable th { text-align: left; cursor: pointer; color: #333; } -.sortabletable th a { text-decoration: none; color: #333; } -.sortabletable th:active { background: #ccc; padding: 3px 4px 1px 6px; } + +.sortabletable { + width: 100%; + border-collapse: collapse; +} + +.sortabletable thead tr { + color: #333; + font-weight: 500; + white-space: nowrap; + background-color: #d2d2d2; + text-align: left; +} + +.sortabletable tr { + background: #fff; +} + +.sortabletable tr.even { + background: #f7f7f7; +} + +.sortabletable tbody tr:hover { + background: #e9f0f3; +} + +.sortabletable td, +.sortabletable th { + padding: 5px !important; + border: 1px solid #ccc; +} + +.sortabletable th { + text-align: left; + cursor: pointer; + color: #333; +} + +.sortabletable th a { + text-decoration: none; + color: #333; +} + +.sortabletable th:active { + background: #ccc; + padding: 3px 4px 1px 6px; +} + /* -------------------------[ Pagination table ]--- */ -#max-display-records { margin: 10px 0; } -fieldset.tab-page { border: 1px solid #e4e4e4 !important; } -h2#edit_document_title { font-size: 0.9rem; color: #f5f5f5; width: 100%; border-bottom: none; padding: 5px 10px; } -fieldset#preview h2.tab { float: right; } + +#max-display-records { + margin: 10px 0; +} + +fieldset.tab-page { + border: 1px solid #e4e4e4 !important; +} + +h2#edit_document_title { + font-size: 0.9rem; + color: #f5f5f5; + width: 100%; + border-bottom: none; + padding: 5px 10px; +} + +fieldset#preview h2.tab { + float: right; +} + /* * Generic styles for all form elements */ -form#mutate dt, form#mutate dd { margin-bottom: 10px; } -form#mutate dt label, form#mutate dt h3.label { font-size: 1em; display: inline; float: left; width: 200px; color: #821517 !important; font-weight: 500; } -form#mutate dd { margin-left: 210px; } -form#mutate input.disabled { background-color: #f5f5f5 !important; } + +form#mutate dt, +form#mutate dd { + margin-bottom: 10px; +} + +form#mutate dt label, +form#mutate dt h3.label { + font-size: 1em; + display: inline; + float: left; + width: 200px; + color: #821517 !important; + font-weight: 500; +} + +form#mutate dd { + margin-left: 210px; +} + +form#mutate input.disabled { + background-color: #f5f5f5 !important; +} + /*form#mutate select.inputBox { margin-right: 5px; }*/ -form#mutate .multitv input[type="text"] { width: 300px; } -form#mutate .imageField { width: 50%; min-width: 300px; } -form#mutate input[name="menuindex"] { text-align: center; width: 80px; padding-left: 0; padding-right: 0; } -form#mutate input[name="ta"].inputBox { padding-left: 30px } -form#mutate input[name="ta"].inputBox:focus + input[type=button], form#mutate input[name="ta"].inputBox:focus + .CodeMirror + input[type=button] { border-color: #1377c5 #1377c5 #1377c5 #bbb; } -input[name^=tv].DatePicker, input[name*=date].DatePicker, input[name=createdon].DatePicker, input[name=editedon].DatePicker { float: left; width: auto; padding-right: 2em } -input[name^=tv].DatePicker + a, input[name*=date].DatePicker + a { position: relative; z-index: 5; margin-top: 0.5em; margin-left: -1.5em; float: left; } -form#mutate textarea.tv_textareamini { height: 100px; width: 300px; overflow-y: scroll; } -form#mutate textarea.tv_textarea { height: 100px; width: 100%; overflow-y: scroll; } -form#mutate #llock { position: relative; z-index: 5; float: left; width: 1.9rem; height: 1.9rem; margin: 0 -2rem 0 0; line-height: 2rem; cursor: pointer; text-align: center; } -form#mutate #llock + #ta { display: block !important; padding-left: 2rem } -form#mutate #llock + #ta + .CodeMirror { display: none !important; } -form#mutate #plock { width: 1.4em; cursor: pointer; font-size: 14px } + +form#mutate .multitv input[type="text"] { + width: 300px; +} + +form#mutate .imageField { + width: 50%; + min-width: 300px; +} + +form#mutate input[name="menuindex"] { + text-align: center; + width: 80px; + padding-left: 0; + padding-right: 0; +} + +form#mutate input[name="ta"].inputBox { + padding-left: 30px +} + +form#mutate input[name="ta"].inputBox:focus + input[type=button], +form#mutate input[name="ta"].inputBox:focus + .CodeMirror + input[type=button] { + border-color: #1377c5 #1377c5 #1377c5 #bbb; +} + +input[name^=tv].DatePicker, +input[name*=date].DatePicker, +input[name=createdon].DatePicker, +input[name=editedon].DatePicker { + float: left; + width: auto; + padding-right: 2em +} + +input[name^=tv].DatePicker + a, +input[name*=date].DatePicker + a { + position: relative; + z-index: 5; + margin-top: 0.5em; + margin-left: -1.5em; + float: left; +} + +form#mutate textarea.tv_textareamini { + height: 100px; + width: 300px; + overflow-y: scroll; +} + +form#mutate textarea.tv_textarea { + height: 100px; + width: 100%; + overflow-y: scroll; +} + +form#mutate #llock { + position: relative; + z-index: 5; + float: left; + width: 1.9rem; + height: 1.9rem; + margin: 0 -2rem 0 0; + line-height: 2rem; + cursor: pointer; + text-align: center; +} + +form#mutate #llock + #ta { + display: block !important; + padding-left: 2rem +} + +form#mutate #llock + #ta + .CodeMirror { + display: none !important; +} + +form#mutate #plock { + width: 1.4em; + cursor: pointer; + font-size: 14px +} + /* * Individual Styles for fieldset#preview */ -fieldset#preview iframe { width: 100%; margin: 0 auto; border: 1px solid #f5f5f5; } + +fieldset#preview iframe { + width: 100%; + margin: 0 auto; + border: 1px solid #f5f5f5; +} + /* * Individual Styles for fieldset#access_permissions */ -fieldset#access_permissions dt label { width: 200px; } -fieldset#access_permissions dd { margin-left: 210px; } -fieldset#access_permissions dl dd ul li { list-style-type: none; } + +fieldset#access_permissions dt label { + width: 200px; +} + +fieldset#access_permissions dd { + margin-left: 210px; +} + +fieldset#access_permissions dl dd ul li { + list-style-type: none; +} + /* ppb: * Some styling for legacy mode fieldsets */ -fieldset.legacy { background: #fff; padding: 10px; margin: 10px 10px 35px; border: 1px solid #e4e4e4 !important; position: relative; } -fieldset.legacy h2 { width: 100%; background: #f5f5f5; margin: -10px -10px 1rem -10px; padding: 0 10px; border-bottom: 1px solid #e4e4e4 !important; } + +fieldset.legacy { + background: #fff; + padding: 10px; + margin: 10px 10px 35px; + border: 1px solid #e4e4e4 !important; + position: relative; +} + +fieldset.legacy h2 { + width: 100%; + background: #f5f5f5; + margin: -10px -10px 1rem -10px; + padding: 0 10px; + border-bottom: 1px solid #e4e4e4 !important; +} + /* System Alert Box ---------------------------------------------------------- */ -.cbOverlay { background-color: #000; z-index: 50000; } -.cbContainer { padding: 5px; background-color: white; z-index: 50000; } -.cbBox h3 { color: #000; background: #bee860 repeat-x top; padding: 5px; font-weight: 500; } -.cbBox p { margin: 3px; } -.cbBox .cbButtons { text-align: center; } -.sysAlert { width: 500px; height: 330px; white-space: nowrap; overflow: auto; } -.phptextarea { font-family: Consolas, 'Courier New', 'Courier', monospace; } + +.cbOverlay { + background-color: #000; + z-index: 50000; +} + +.cbContainer { + padding: 5px; + background-color: white; + z-index: 50000; +} + +.cbBox h3 { + color: #000; + background: #bee860 repeat-x top; + padding: 5px; + font-weight: 500; +} + +.cbBox p { + margin: 3px; +} + +.cbBox .cbButtons { + text-align: center; +} + +.sysAlert { + width: 500px; + height: 330px; + white-space: nowrap; + overflow: auto; +} + +.phptextarea { + font-family: Consolas, 'Courier New', 'Courier', monospace; +} + /* Custom */ + /* normalize some td paddings */ -#displayparams table { background: #fff; } -#displayparams table tbody td { border-bottom: 1px dotted #d3d3d3; } -.permissiongroups { margin: 0; } -.permissiongroups ul { clear: both; margin: 0; padding: 0.5rem 0; } -.permissiongroup input[type=submit], .permissiongroup input[type=button], .permissiongroups input[type=submit], .permissiongroups input[type=button] { float: left; margin: 0.3em 0.3em 0 0; } -td#displayparams > table.displayparams { border: none; } + +#displayparams table { + background: #fff; +} + +#displayparams table tbody td { + border-bottom: 1px dotted #d3d3d3; +} + +.permissiongroups { + margin: 0; +} + +.permissiongroups ul { + clear: both; + margin: 0; + padding: 0.5rem 0; +} + +.permissiongroup input[type=submit], +.permissiongroup input[type=button], +.permissiongroups input[type=submit], +.permissiongroups input[type=button] { + float: left; + margin: 0.3em 0.3em 0 0; +} + +td#displayparams > table.displayparams { + border: none; +} + /* replace warning red color in tabs */ -strong[style*='color:#EF1D1D'] { color: yellow !important; } -.selected strong[style*='color:#ffeb00'] { color: red !important; } -code { font-size: inherit; font-family: Consolas, 'Courier New', 'Courier', monospace; background-color: #eee; border: 1px solid #ccc; padding: 1px 2px; } -#resourcesPane .disabledPlugin a:hover { color: #aaa; } + +strong[style*='color:#EF1D1D'] { + color: yellow !important; +} + +.selected strong[style*='color:#ffeb00'] { + color: red !important; +} + +code { + font-size: inherit; + font-family: Consolas, 'Courier New', 'Courier', monospace; + background-color: #eee; + border: 1px solid #ccc; + padding: 1px 2px; +} + +#resourcesPane .disabledPlugin a:hover { + color: #aaa; +} + /* table styles*/ -.table, #documentPane #tv_body table, #documentPane .tmplvars table, #documentPane [id*="table-"], #documentPane [id*="table-tv"] { width: 100%; } -#documentPane .tab-page > table > tr > td:first-child, #documentPane .tab-page > table > tbody > tr > td:first-child, #documentPane .tab-page .tmplvars > table > tbody > tr > td:first-child, #tmplvarsPane .tab-page > table > tbody > tr > td:first-child, #tmplvarsPane .tab-page > table > tbody > tr > th:first-child, #chunkPane .tab-page > table > tbody > tr > td:first-child, #chunkPane .tab-page > table > tbody > tr > th:first-child, #snipetPane .tab-page > table > tbody > tr > td:first-child, #snipetPane .tab-page > table > tbody > tr > th:first-child, #pluginPane .tab-page > table > tbody > tr > td:first-child, #pluginPane .tab-page > table > tbody > tr > th:first-child, #modulePane .tab-page > table > tbody > tr > td:first-child, #modulePane .tab-page > table > tbody > tr > th:first-child, #docManagerPane .tab-page #dates > table > tbody > tr > td:first-child { width: 200px } -#documentPane .tab-page > table > tr > td:last-child, #documentPane .tab-page .tmplvars > table > tbody > tr > td:last-child { width: inherit !important } -#documentPane .tab-page > table > tbody > tr > td:first-child > .warning { display: inline-block; width: calc(100% - 1rem); } -#documentPane .tab-page > table > tbody > tr > td:first-child > [data-tooltip] { margin-top: 0.3rem; vertical-align: top } -.table--edit { margin-bottom: 1rem; } -.table th, .table td { text-align: left; vertical-align: middle; } -table th { font-weight: 500; } -.table--edit th { width: 200px; color: #555; font-size: inherit; } -.table--edit input[type="text"], .table--edit input[type="password"], .table--edit input[type="number"], .table--edit textarea, .table--edit select, .settings input[type="text"], .settings input[type="password"], .settings input[type="number"], .settings textarea, .settings select { width: 300px; } + +.table, +#documentPane #tv_body table, +#documentPane .tmplvars table, +#documentPane [id*="table-"], +#documentPane [id*="table-tv"] { + width: 100%; +} + +#documentPane .tab-page > table > tr > td:first-child, +#documentPane .tab-page > table > tbody > tr > td:first-child, +#documentPane .tab-page .tmplvars > table > tbody > tr > td:first-child, +#tmplvarsPane .tab-page > table > tbody > tr > td:first-child, +#tmplvarsPane .tab-page > table > tbody > tr > th:first-child, +#chunkPane .tab-page > table > tbody > tr > td:first-child, +#chunkPane .tab-page > table > tbody > tr > th:first-child, +#snipetPane .tab-page > table > tbody > tr > td:first-child, +#snipetPane .tab-page > table > tbody > tr > th:first-child, +#pluginPane .tab-page > table > tbody > tr > td:first-child, +#pluginPane .tab-page > table > tbody > tr > th:first-child, +#modulePane .tab-page > table > tbody > tr > td:first-child, +#modulePane .tab-page > table > tbody > tr > th:first-child, +#docManagerPane .tab-page #dates > table > tbody > tr > td:first-child { + width: 200px +} + +#documentPane .tab-page > table > tr > td:last-child, +#documentPane .tab-page .tmplvars > table > tbody > tr > td:last-child { + width: inherit !important +} + +#documentPane .tab-page > table > tbody > tr > td:first-child > .warning { + display: inline-block; + width: calc(100% - 1rem); +} + +#documentPane .tab-page > table > tbody > tr > td:first-child > [data-tooltip] { + margin-top: 0.3rem; + vertical-align: top +} + +.table--edit { + margin-bottom: 1rem; +} + +.table th, +.table td { + text-align: left; + vertical-align: middle; +} + +table th { + font-weight: 500; +} + +.table--edit th { + width: 200px; + color: #555; + font-size: inherit; +} + +.table--edit input[type="text"], +.table--edit input[type="password"], +.table--edit input[type="number"], +.table--edit textarea, +.table--edit select, +.settings input[type="text"], +.settings input[type="password"], +.settings input[type="number"], +.settings textarea, +.settings select { + width: 300px; +} + /* * MODxRE2 styles * css above is original MODxRE * css below is basicaly MODxRE overrides to get MODxRE2 look */ + /* nav */ -.no-events { pointer-events: none; } + +.no-events { + pointer-events: none; +} + /* Required for Bootstrap3 Collapse */ -.panel-title > a::before { content: "\f107"; /* fa-angle-down */ font-family: "FontAwesome"; } -.panel-title > a.collapsed::before { content: "\f105"; /* fa-angle-right */ padding: 0 1px 0 3px; } -.panel-title > a { font-size: 1.1em; color: #657587; display: block; padding: 3px 0; } -.panel-title > a:hover { text-decoration: none; color: #1377c5; background: rgba(255, 255, 255, 0.27); } + +.panel-title > a::before { + content: "\f107"; + /* fa-angle-down */ + font-family: "FontAwesome"; +} + +.panel-title > a.collapsed::before { + content: "\f105"; + /* fa-angle-right */ + padding: 0 1px 0 3px; +} + +.panel-title > a { + font-size: 1.1em; + color: #657587; + display: block; + padding: 3px 0; +} + +.panel-title > a:hover { + text-decoration: none; + color: #1377c5; + background: rgba(255, 255, 255, 0.27); +} + /* category icons in manage elements */ -#site_templates, #site_tmplvars, #site_htmlsnippets, #site_snippets, #site_plugins { padding-left: 0; } -#site_templates li, #site_tmplvars li, #site_htmlsnippets li, #site_snippets li, #site_snippets li, #site_plugins li, #categories_list li { list-style: none; margin-left: -21px; } -#site_templates li strong:before, #site_tmplvars li strong:before, #site_htmlsnippets li strong:before, #site_snippets li strong:before, #site_snippets li strong:before, #site_plugins li strong:before, #categories_list li strong:before { font-family: "FontAwesome"; font-style: normal; font-weight: normal; color: #5b6f7a; padding: 0 5px 0 5px; content: '\f105'; } -.tab-pane ul li ul li strong:before { content: ''; } + +#site_templates, +#site_tmplvars, +#site_htmlsnippets, +#site_snippets, +#site_plugins { + padding-left: 0; +} + +#site_templates li, +#site_tmplvars li, +#site_htmlsnippets li, +#site_snippets li, +#site_snippets li, +#site_plugins li, +#categories_list li { + list-style: none; + margin-left: -21px; +} + +#site_templates li strong:before, +#site_tmplvars li strong:before, +#site_htmlsnippets li strong:before, +#site_snippets li strong:before, +#site_snippets li strong:before, +#site_plugins li strong:before, +#categories_list li strong:before { + font-family: "FontAwesome"; + font-style: normal; + font-weight: normal; + color: #5b6f7a; + padding: 0 5px 0 5px; + content: '\f105'; +} + +.tab-pane ul li ul li strong:before { + content: ''; +} + /* elements icons in manage elements */ -a.man_el_name:before { font-family: "FontAwesome"; font-style: normal; font-weight: normal; font-size: 0.875rem; color: #5b6f7a; } -a.man_el_name.site_templates:before { content: '\f1ea'; } -a.man_el_name.site_tmplvars:before { content: '\f022'; } -a.man_el_name.site_htmlsnippets:before { content: '\f009'; } -a.man_el_name.site_snippets:before { content: '\f121'; } -a.man_el_name.site_plugins:before { content: '\f1e6'; } -a.man_el_name.site_modules:before { content: '\f085'; } -div#tabCategory.tab-page ul li ul li { padding-top: 7px; padding-bottom: 7px; } + +a.man_el_name:before { + font-family: "FontAwesome"; + font-style: normal; + font-weight: normal; + font-size: 0.875rem; + color: #5b6f7a; +} + +a.man_el_name.site_templates:before { + content: '\f1ea'; +} + +a.man_el_name.site_tmplvars:before { + content: '\f022'; +} + +a.man_el_name.site_htmlsnippets:before { + content: '\f009'; +} + +a.man_el_name.site_snippets:before { + content: '\f121'; +} + +a.man_el_name.site_plugins:before { + content: '\f1e6'; +} + +a.man_el_name.site_modules:before { + content: '\f085'; +} + +div#tabCategory.tab-page ul li ul li { + padding-top: 7px; + padding-bottom: 7px; +} + /*Fake tables for providing dynamic amount of cells per row*/ -.rTable { display: table; width: 100%; padding: 0; } -.rTableRow { display: table-row; padding: 0; } -.rTableHeading { display: table-header-group; } -.rTableBody { display: table-row-group; } -.rTableFoot { display: table-footer-group; } -.lockCell, .mainCell, .btnCell, .rTableHead { display: table-cell; padding: 0; } -.lockCell { width: 2.5em; padding-left: 10px; } -.mainCell { width: auto; } -.btnCell { width: 6em; text-align: right; padding-right: 1rem; } -.mainCell > span { display: block } + +.rTable { + display: table; + width: 100%; + padding: 0; +} + +.rTableRow { + display: table-row; + padding: 0; +} + +.rTableHeading { + display: table-header-group; +} + +.rTableBody { + display: table-row-group; +} + +.rTableFoot { + display: table-footer-group; +} + +.lockCell, +.mainCell, +.btnCell, +.rTableHead { + display: table-cell; + padding: 0; +} + +.lockCell { + width: 2.5em; + padding-left: 10px; +} + +.mainCell { + width: auto; +} + +.btnCell { + width: 6em; + text-align: right; + padding-right: 1rem; +} + +.mainCell > span { + display: block +} + /* Manage elements general styles */ -a.man_el_name { display: block; padding: .1em 0 .1em 1.25rem; } -a.man_el_name:hover { text-decoration: none; } -.lockCell + .mainCell a.man_el_name { padding-left: 0 !important; } -.lockCell + .mainCell a.man_el_name:before { display: none; } -.elements_descr { color: #222; margin-left: 1em; font-size: 0.88em; } -.resourceTable .panel-heading { margin: 0 -1.25rem !important; background-color: #f5f5f5; border-top: 1px dotted #dedede; border-bottom: 1px dotted #dedede; } -.resourceTable .panel-title > a { padding: 5px 1.25rem; text-decoration: none } -.resourceTable ul.elements { margin: 0 -1.25rem; padding: 0 0 10px 0; } -.resourceTable ul.elements > li { padding: 0 !important; border-bottom: 1px dotted #dedede; border-left: 3px solid #fff; transition: all 0.1s ease; margin: 0 !important; } -.resourceTable ul.elements > li:hover { background: #f9f9f9; border-left: 3px solid #1377c5; } -.resourceTable ul.elements > li::before { display: none } -#resourcesPane .panel-group ul { } -ul.resourceTable .category_name { float: none; display: block; clear: both; margin-top: 20px; } + +a.man_el_name { + display: block; + padding: .1em 0 .1em 1.25rem; +} + +a.man_el_name:hover { + text-decoration: none; +} + +.lockCell + .mainCell a.man_el_name { + padding-left: 0 !important; +} + +.lockCell + .mainCell a.man_el_name:before { + display: none; +} + +.elements_descr { + color: #222; + margin-left: 1em; + font-size: 0.88em; +} + +.resourceTable .panel-heading { + margin: 0 -1.25rem !important; + background-color: #f5f5f5; + border-top: 1px dotted #dedede; + border-bottom: 1px dotted #dedede; +} + +.resourceTable .panel-title > a { + padding: 5px 1.25rem; + text-decoration: none +} + +.resourceTable ul.elements { + margin: 0 -1.25rem; + padding: 0 0 10px 0; +} + +.resourceTable ul.elements > li { + padding: 0 !important; + border-bottom: 1px dotted #dedede; + border-left: 3px solid #fff; + transition: all 0.1s ease; + margin: 0 !important; +} + +.resourceTable ul.elements > li:hover { + background: #f9f9f9; + border-left: 3px solid #1377c5; +} + +.resourceTable ul.elements > li::before { + display: none +} + +#resourcesPane .panel-group ul {} + +ul.resourceTable .category_name { + float: none; + display: block; + clear: both; + margin-top: 20px; +} + /* Manager Elements Buttons bar*/ -ul.elements_buttonbar { list-style: none; margin: 0; padding: 0; display: table; table-layout: fixed; } -ul.elements_buttonbar li { display: table-cell; padding: 0 !important; width: 2em; } -ul.elements_buttonbar li a { display: block; width: 2em; padding: 4px 2px 2px 2px; margin: 1px; min-width: 22px; } -ul.elements_buttonbar .fa { font-size: 0.875rem; padding: 1px 1px 0; } + +ul.elements_buttonbar { + list-style: none; + margin: 0; + padding: 0; + display: table; + table-layout: fixed; +} + +ul.elements_buttonbar li { + display: table-cell; + padding: 0 !important; + width: 2em; +} + +ul.elements_buttonbar li a { + display: block; + width: 2em; + padding: 4px 2px 2px 2px; + margin: 1px; + min-width: 22px; +} + +ul.elements_buttonbar .fa { + font-size: 0.875rem; + padding: 1px 1px 0; +} + /* Checkbox "Icons" */ -.noicons.tab-page ul li ul li a:before, .noicons .elements_description a:before { display: none !important; } + +.noicons.tab-page ul li ul li a:before, +.noicons .elements_description a:before { + display: none !important; +} + /* View-dependent styles */ + /* List-view */ -.resourceTable.list li { } -.sortableList > li::before { display: none } + +.resourceTable.list li {} + +.sortableList > li::before { + display: none +} + /* Inline-view */ -.resourceTable.inline ul.elements { margin: 0 !important; } -.resourceTable.inline ul.elements > li { float: left; margin: 10px 10px 0 0 !important; padding: 0 !important; border: 1px dotted #dedede; } -.resourceTable.inline ul.elements_buttonbar { margin: 0 5px 0 0 !important; } -.resourceTable.inline a.man_el_name { padding: 5px 10px; } -.resourceTable.inline ul.elements > li:hover { border: 1px solid #aaa } + +.resourceTable.inline ul.elements { + margin: 0 !important; +} + +.resourceTable.inline ul.elements > li { + float: left; + margin: 10px 10px 0 0 !important; + padding: 0 !important; + border: 1px dotted #dedede; +} + +.resourceTable.inline ul.elements_buttonbar { + margin: 0 5px 0 0 !important; +} + +.resourceTable.inline a.man_el_name { + padding: 5px 10px; +} + +.resourceTable.inline ul.elements > li:hover { + border: 1px solid #aaa +} + /* Flex-view */ -.resourceTable.flex ul.elements { -webkit-column-gap: 10px; -moz-column-gap: 10px; -o-column-gap: 10px; column-gap: 10px; } -.resourceTable.flex ul.elements { } -.resourceTable.flex ul.elements > li { overflow: hidden; /* fix for Firefox */ break-inside: avoid-column; -webkit-column-break-inside: avoid; -moz-column-break-inside: avoid; -o-column-break-inside: avoid; -ms-column-break-inside: avoid; column-break-inside: avoid; page-break-inside: avoid } -.resourceTable.flex .elements_descr { display: block; margin-left: 1.5em; } -#content_body #which_editor { margin-top: 12px; } + +.resourceTable.flex ul.elements { + -webkit-column-gap: 10px; + -moz-column-gap: 10px; + -o-column-gap: 10px; + column-gap: 10px; +} + +.resourceTable.flex ul.elements {} + +.resourceTable.flex ul.elements > li { + overflow: hidden; + /* fix for Firefox */ + break-inside: avoid-column; + -webkit-column-break-inside: avoid; + -moz-column-break-inside: avoid; + -o-column-break-inside: avoid; + -ms-column-break-inside: avoid; + column-break-inside: avoid; + page-break-inside: avoid +} + +.resourceTable.flex .elements_descr { + display: block; + margin-left: 1.5em; +} + +#content_body #which_editor { + margin-top: 12px; +} + /* resource children list */ -#tabChildren .grid th, #tabChildren .grid tr > td:nth-child(5), #tabChildren .grid tr > td:nth-child(6) { text-align: center; white-space: nowrap } -#tabChildren .grid td { text-align: right; white-space: nowrap } -#tabChildren .grid tr > th:nth-child(2), #tabChildren .grid tr > td:nth-child(2) { text-align: left; white-space: normal } -#tabChildren .grid tr > td:nth-child(6) a { padding: 0 .2em; font-size: 0.9rem; color: #444; } + +#tabChildren .grid th, +#tabChildren .grid tr > td:nth-child(5), +#tabChildren .grid tr > td:nth-child(6) { + text-align: center; + white-space: nowrap +} + +#tabChildren .grid td { + text-align: right; + white-space: nowrap +} + +#tabChildren .grid tr > th:nth-child(2), +#tabChildren .grid tr > td:nth-child(2) { + text-align: left; + white-space: normal +} + +#tabChildren .grid tr > td:nth-child(6) a { + padding: 0 .2em; + font-size: 0.9rem; + color: #444; +} + /* element-edit-message */ -.msg-container { padding-bottom: 10px; border-bottom: 1px solid #ededed; margin-bottom: 1rem; color: #777; } -.btn-small { padding: 2px 4px !important; font-size: 11px !important; } -.relative { position: relative; } -.modx-alert { display: block; margin: 60px 10px 10px 10px; padding: 1em; } -.modx-alert.alert-error { background-color: #ffd0d0; border: 1px solid #f00; color: #000; } -tr.userIdle td { color: #aaa; } -tr.userIdle td strong:before { font-family: "FontAwesome"; font-style: normal; font-weight: normal; color: #aaa; padding: 0 5px 0 0; content: '\f017'; } + +.msg-container { + padding-bottom: 10px; + border-bottom: 1px solid #ededed; + margin-bottom: 1rem; + color: #777; +} + +.btn-small { + padding: 2px 4px !important; + font-size: 11px !important; +} + +.relative { + position: relative; +} + +.modx-alert { + display: block; + margin: 60px 10px 10px 10px; + padding: 1em; +} + +.modx-alert.alert-error { + background-color: #ffd0d0; + border: 1px solid #f00; + color: #000; +} + +tr.userIdle td { + color: #aaa; +} + +tr.userIdle td strong:before { + font-family: "FontAwesome"; + font-style: normal; + font-weight: normal; + color: #aaa; + padding: 0 5px 0 0; + content: '\f017'; +} diff --git a/manager/media/style/default/css/mainmenu.css b/manager/media/style/default/css/mainmenu.css index fc0622c5d5..60c2df7e29 100755 --- a/manager/media/style/default/css/mainmenu.css +++ b/manager/media/style/default/css/mainmenu.css @@ -1,130 +1,739 @@ /* #mainMenu */ -#mainMenu { background-color: #343944; color: #8b9298; -webkit-box-shadow: 0 2px 4px rgba(0,0,0,.3); box-shadow: 0 2px 4px rgba(0,0,0,.3); } -#mainMenu.show { overflow: visible } -#mainMenu + #tree::before, #mainMenu + #tree + #main::before { content: ""; position: fixed; z-index: 9999; left: 0; top: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, .1); opacity: 0; visibility: hidden; -webkit-transition: opacity .15s, visibility .15s; transition: opacity .15s, visibility .15s; } -#mainMenu.show + #tree::before, #mainMenu.show + #tree + #main::before { opacity: 1; visibility: visible } -#mainMenu > .container { display: table; width: 100%; border-collapse: collapse } -#mainMenu > .container > .row { display: table-row } -#mainMenu > .container > .row > .cell { display: table-cell; vertical-align: top; } -#mainMenu #nav { float: left; } -#mainMenu #settings { float: right; } -#mainMenu .nav { margin: 0; white-space: nowrap; font-size: 0 } -#mainMenu .nav > li { position: relative; display: inline-block; font-size: 0.8rem; vertical-align: top } -#mainMenu .nav > li.active > a { color: #fff; background-color: rgba(255, 255, 255, 0.07) } -#mainMenu .nav > li > a, #mainMenu .nav .label_searchid { display: block; position: relative; z-index: 1; padding: 0 1rem; height: 2.2rem; line-height: 2.3rem; text-decoration: none; color: #DCD9E3; transition-duration: 0.15s } -#mainMenu .nav > li > a:hover, #mainMenu .nav .label_searchid:hover { color: #f3f3f3; } + +#mainMenu { + background-color: #343944; + color: #8b9298; + -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, .3); + box-shadow: 0 2px 4px rgba(0, 0, 0, .3); +} + +#mainMenu.show { + overflow: visible +} + +#mainMenu + #tree::before, +#mainMenu + #tree + #main::before { + content: ""; + position: fixed; + z-index: 9999; + left: 0; + top: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, .1); + opacity: 0; + visibility: hidden; + -webkit-transition: opacity .15s, visibility .15s; + transition: opacity .15s, visibility .15s; +} + +#mainMenu.show + #tree::before, +#mainMenu.show + #tree + #main::before { + opacity: 1; + visibility: visible +} + +#mainMenu > .container { + display: table; + width: 100%; + border-collapse: collapse +} + +#mainMenu > .container > .row { + display: table-row +} + +#mainMenu > .container > .row > .cell { + display: table-cell; + vertical-align: top; +} + +#mainMenu #nav { + float: left; +} + +#mainMenu #settings { + float: right; +} + +#mainMenu .nav { + margin: 0; + white-space: nowrap; + font-size: 0 +} + +#mainMenu .nav > li { + position: relative; + display: inline-block; + font-size: 0.8rem; + vertical-align: top +} + +#mainMenu .nav > li.active > a { + color: #fff; + background-color: rgba(255, 255, 255, 0.07) +} + +#mainMenu .nav > li > a, +#mainMenu .nav .label_searchid { + display: block; + position: relative; + z-index: 1; + padding: 0 1rem; + height: 2.2rem; + line-height: 2.3rem; + text-decoration: none; + color: #DCD9E3; + transition-duration: 0.15s +} + +#mainMenu .nav > li > a:hover, +#mainMenu .nav .label_searchid:hover { + color: #f3f3f3; +} + /*#mainMenu.show .nav > li.dropdown:hover > a, */ -#mainMenu.show .nav > li.dropdown.hover > a { background-color: #fff; color: #444; } -#mainMenu .nav > li > a .icon { display: inline-block; overflow: hidden; width: auto; height: 2rem; line-height: 2rem; font-size: 1.5em; text-align: center; margin: 0.05rem 0 0 0.5rem; vertical-align: top; border-radius: 50%; background: no-repeat 50% 50%; background-size: cover; } -#mainMenu .nav > li > a .icon.photo { width: 2rem } -#mainMenu .nav > li > a .icon .fa { font-size: 1.2rem; line-height: 2.1rem } -#mainMenu .nav > li .fa { min-width: 1em; line-height: 2.2rem; font-size: 0.875rem; vertical-align: top } -#mainMenu #nav > li > a > .fa { display: none } -#mainMenu #nav #bars { width: 3.5rem; text-align: center } -#mainMenu #nav #bars a { padding: 0 1rem; } -#mainMenu #nav #bars .fa { display: inline-block; min-width: 0.25rem; width: 1.5rem; margin: 0; text-align: center; overflow: hidden; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } -.sidebar-closed #mainMenu #nav #bars .fa { width: 0.25rem; } -#mainMenu #system > a > .fa { font-size: 1.3rem } -#mainMenu .nav .caret, #mainMenu .nav .divider, .dropdown-toggle::after { display: none } -#mainMenu .nav > li > ul { display: block; position: absolute; z-index: 0; overflow: auto; overflow-x: hidden; top: 100%; left: 0; margin: 0; padding: 0 0 0.25rem; min-width: 15rem; max-height: -webkit-calc(100vh - 2.2rem); max-height: calc(100vh - 2.2rem); font-size: 1em; border: none; border-radius: 0 0 0.25rem 0.25rem; background-color: #fff; box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2); opacity: 0; visibility: hidden; -webkit-transition-duration: 0.1s; transition-duration: 0.1s; } + +#mainMenu.show .nav > li.dropdown.hover > a { + background-color: #fff; + color: #444; +} + +#mainMenu .nav > li > a .icon { + display: inline-block; + overflow: hidden; + width: auto; + height: 2rem; + line-height: 2rem; + font-size: 1.5em; + text-align: center; + margin: 0.05rem 0 0 0.5rem; + vertical-align: top; + border-radius: 50%; + background: no-repeat 50% 50%; + background-size: cover; +} + +#mainMenu .nav > li > a .icon.photo { + width: 2rem +} + +#mainMenu .nav > li > a .icon .fa { + font-size: 1.2rem; + line-height: 2.1rem +} + +#mainMenu .nav > li .fa { + min-width: 1em; + line-height: 2.2rem; + font-size: 0.875rem; + vertical-align: top +} + +#mainMenu #nav > li > a > .fa { + display: none +} + +#mainMenu #nav #bars { + width: 3.5rem; + text-align: center +} + +#mainMenu #nav #bars a { + padding: 0 1rem; +} + +#mainMenu #nav #bars .fa { + display: inline-block; + min-width: 0.25rem; + width: 1.5rem; + margin: 0; + text-align: center; + overflow: hidden; + -webkit-transition-duration: 0.15s; + transition-duration: 0.15s +} + +.sidebar-closed #mainMenu #nav #bars .fa { + width: 0.25rem; +} + +#mainMenu #system > a > .fa { + font-size: 1.3rem +} + +#mainMenu .nav .caret, +#mainMenu .nav .divider, +.dropdown-toggle::after { + display: none +} + +#mainMenu .nav > li > ul { + display: block; + position: absolute; + z-index: 0; + overflow: auto; + overflow-x: hidden; + top: 100%; + left: 0; + margin: 0; + padding: 0 0 0.25rem; + min-width: 15rem; + max-height: -webkit-calc(100vh - 2.2rem); + max-height: calc(100vh - 2.2rem); + font-size: 1em; + border: none; + border-radius: 0 0 0.25rem 0.25rem; + background-color: #fff; + box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2); + opacity: 0; + visibility: hidden; + -webkit-transition-duration: 0.1s; + transition-duration: 0.1s; +} + /*#mainMenu.show .nav > li:hover > a + ul, */ -#mainMenu.show .nav > li.hover > a + ul, #mainMenu.show .nav > li.hover > ul.sub-menu.show { opacity: 1; visibility: visible } -#mainMenu.show .nav > li > ul.sub-menu { left: 15rem; opacity: 0; visibility: hidden; } -#mainMenu.show .nav > li:hover > ul.sub-menu { } -#mainMenu.show .nav > li:hover > ul.sub-menu.show { } -#mainMenu #settings.nav > li > ul { left: auto; right: 0 } -#mainMenu .nav > li > ul > li { border-bottom: 1px solid rgba(0, 0, 0, 0.05); margin-bottom: -1px; } -#mainMenu .nav > li > ul > li:last-child { border: none; margin-bottom: 0 } -#mainMenu .nav > li > ul > li.item-input { padding: 0.375em 0.5em; } -#mainMenu .nav > li > ul > li > a:first-child, #mainMenu .nav > li > ul > li > span { display: block; position: relative; padding: 0 2rem 0 1rem; line-height: 2.2rem; color: #444; text-decoration: none } -#mainMenu .nav > li > ul > li.hover > a:first-child { color: #444; background-color: #eee; } -#mainMenu .nav > li > ul > li > span:first-child { padding: 0 1rem; text-align: center; font-size: 0.875em; color: #aaa; } -#mainMenu .nav > li > ul > li.dropdown-back > span { text-align: left; font-size: inherit; color: inherit } -#mainMenu .nav > li > ul > li.dropdown-back > span * { pointer-events: none } -#mainMenu .nav > li > ul > li .fa { width: 1.3em; margin-right: 0.5em; font-size: .9rem; line-height: .8rem; text-align: center; vertical-align: baseline } -#mainMenu .nav > li > ul > li.selected a:first-child::before, #main .evo-tab-row .tab.changed::before { content: ''; position: absolute; right: 0.25em; top: 0.25em; width: 0.5em; height: 0.5em; background-color: #ffc107; -webkit-border-radius: 50%; border-radius: 50%; pointer-events: none } -#mainMenu .nav > li > ul > li.dropdown-toggle > a > .toggle { position: absolute; top: 0; right: 0; height: 100%; width: 2rem; margin: 0; line-height: 2rem; text-align: center; } -#mainMenu .nav > li > ul > li.disabled > a { opacity: 0.5; color: #7d2a24; } -#mainMenu .nav > li > ul > li.locked > a { font-style: italic } -#mainMenu .nav > li > ul > li > a small { line-height: 1em } -#mainMenu .nav li.item-group { display: table; width: 100%; border-collapse: separate } -#mainMenu .nav li.item-group > * { display: table-cell !important; width: 1%; padding: 0 .75rem; border: none !important; border-left: 1px solid rgba(0, 0, 0, 0.05) !important; border-radius: 0 } -#mainMenu .nav li.item-group > *:first-child { width: 100% } -#mainMenu .nav li.item-group > *:not(:first-child) .fa { margin-right: 0 } -#mainMenu .account #msgCounter { display: none; position: absolute; z-index: 1; right: 0.4rem; top: 0.4rem; width: 0.4rem; height: 0.4rem; background-color: #ffc107; font-size: 0; border-radius: 50%;; } -#mainMenu .account #newMail { display: none } + +#mainMenu.show .nav > li.hover > a + ul, +#mainMenu.show .nav > li.hover > ul.sub-menu.show { + opacity: 1; + visibility: visible +} + +#mainMenu.show .nav > li > ul.sub-menu { + left: 15rem; + opacity: 0; + visibility: hidden; +} + +#mainMenu.show .nav > li:hover > ul.sub-menu {} + +#mainMenu.show .nav > li:hover > ul.sub-menu.show {} + +#mainMenu #settings.nav > li > ul { + left: auto; + right: 0 +} + +#mainMenu .nav > li > ul > li { + border-bottom: 1px solid rgba(0, 0, 0, 0.05); + margin-bottom: -1px; +} + +#mainMenu .nav > li > ul > li:last-child { + border: none; + margin-bottom: 0 +} + +#mainMenu .nav > li > ul > li.item-input { + padding: 0.375em 0.5em; +} + +#mainMenu .nav > li > ul > li > a:first-child, +#mainMenu .nav > li > ul > li > span { + display: block; + position: relative; + padding: 0 2rem 0 1rem; + line-height: 2.2rem; + color: #444; + text-decoration: none +} + +#mainMenu .nav > li > ul > li.hover > a:first-child { + color: #444; + background-color: #eee; +} + +#mainMenu .nav > li > ul > li > span:first-child { + padding: 0 1rem; + text-align: center; + font-size: 0.875em; + color: #aaa; +} + +#mainMenu .nav > li > ul > li.dropdown-back > span { + text-align: left; + font-size: inherit; + color: inherit +} + +#mainMenu .nav > li > ul > li.dropdown-back > span * { + pointer-events: none +} + +#mainMenu .nav > li > ul > li .fa { + width: 1.3em; + margin-right: 0.5em; + font-size: .9rem; + line-height: .8rem; + text-align: center; + vertical-align: baseline +} + +#mainMenu .nav > li > ul > li.selected a:first-child::before, +#main .evo-tab-row .tab.changed::before { + content: ''; + position: absolute; + right: 0.25em; + top: 0.25em; + width: 0.5em; + height: 0.5em; + background-color: #ffc107; + -webkit-border-radius: 50%; + border-radius: 50%; + pointer-events: none +} + +#mainMenu .nav > li > ul > li.dropdown-toggle > a > .toggle { + position: absolute; + top: 0; + right: 0; + height: 100%; + width: 2rem; + margin: 0; + line-height: 2rem; + text-align: center; +} + +#mainMenu .nav > li > ul > li.disabled > a { + opacity: 0.5; + color: #7d2a24; +} + +#mainMenu .nav > li > ul > li.locked > a { + font-style: italic +} + +#mainMenu .nav > li > ul > li > a small { + line-height: 1em +} + +#mainMenu .nav li.item-group { + display: table; + width: 100%; + border-collapse: separate +} + +#mainMenu .nav li.item-group > * { + display: table-cell !important; + width: 1%; + padding: 0 .75rem; + border: none !important; + border-left: 1px solid rgba(0, 0, 0, 0.05) !important; + border-radius: 0 +} + +#mainMenu .nav li.item-group > *:first-child { + width: 100% +} + +#mainMenu .nav li.item-group > *:not(:first-child) .fa { + margin-right: 0 +} + +#mainMenu .account #msgCounter { + display: none; + position: absolute; + z-index: 1; + right: 0.4rem; + top: 0.4rem; + width: 0.4rem; + height: 0.4rem; + background-color: #ffc107; + font-size: 0; + border-radius: 50%; + ; +} + +#mainMenu .account #newMail { + display: none +} + /* statusbar */ -#statusbar { position: relative; width: 1rem; height: 2.2rem; line-height: 2.4rem; font-size: 0.875em; white-space: nowrap; float: left; } -#statusbar .fa { font-size: 0.875rem } -#statusbar #buildText, #statusbar #workText { display: none } -#statusbar .fa { margin-right: 0.375rem } -#statusbar .fa-warning { color: #f44336 } + +#statusbar { + position: relative; + width: 1rem; + height: 2.2rem; + line-height: 2.4rem; + font-size: 0.875em; + white-space: nowrap; + float: left; +} + +#statusbar .fa { + font-size: 0.875rem +} + +#statusbar #buildText, +#statusbar #workText { + display: none +} + +#statusbar .fa { + margin-right: 0.375rem +} + +#statusbar .fa-warning { + color: #f44336 +} + /* search */ -#mainMenu #searchform { position: relative } -#mainMenu #searchform label { position: relative; z-index: 1; margin: 0; cursor: pointer; } -#mainMenu #searchform input { position: absolute; z-index: 0; top: 0; right: 0; min-height: 1.5rem; height: 1.5rem; width: 0; padding: 0 0.5rem; margin: 0.345rem; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 0; background: rgba(0, 0, 0, 0.1); color: #fff; text-align: left; opacity: 0; outline: none; -webkit-transition: opacity 0.2s, width 0.2s; transition: opacity 0.2s, width 0.2s; } -#mainMenu #searchform input:focus { z-index: 9; width: 15rem; max-width: 15rem; background: #000; text-align: left; border-color: rgba(255, 255, 255, 0.75); opacity: 1 } -#mainMenu #searchform input:focus + .mask { opacity: 0.7; visibility: visible; } -#mainMenu #searchform .mask { content: ""; position: absolute; z-index: 5; top: 0; right: -999rem; right: -100vw; left: -999rem; left: -100vw; height: 2.2rem; opacity: 0; visibility: hidden; background-color: rgba(0, 0, 0, 0.65); -webkit-transition-duration: 0.3s; transition-duration: 0.3s; transform: translateZ(0) } -#mainMenu #searchform .fa-search { position: relative; z-index: 1 } -#mainMenu #searchform .fa-refresh { position: absolute; z-index: 9; display: none; top: 0.6rem; right: 0.8rem; line-height: 1em } + +#mainMenu #searchform { + position: relative +} + +#mainMenu #searchform label { + position: relative; + z-index: 1; + margin: 0; + cursor: pointer; +} + +#mainMenu #searchform input { + position: absolute; + z-index: 0; + top: 0; + right: 0; + min-height: 1.5rem; + height: 1.5rem; + width: 0; + padding: 0 0.5rem; + margin: 0.345rem; + border: 1px solid rgba(255, 255, 255, 0.1); + border-radius: 0; + background: rgba(0, 0, 0, 0.1); + color: #fff; + text-align: left; + opacity: 0; + outline: none; + -webkit-transition: opacity 0.2s, width 0.2s; + transition: opacity 0.2s, width 0.2s; +} + +#mainMenu #searchform input:focus { + z-index: 9; + width: 15rem; + max-width: 15rem; + background: #000; + text-align: left; + border-color: rgba(255, 255, 255, 0.75); + opacity: 1 +} + +#mainMenu #searchform input:focus + .mask { + opacity: 0.7; + visibility: visible; +} + +#mainMenu #searchform .mask { + content: ""; + position: absolute; + z-index: 5; + top: 0; + right: -999rem; + right: -100vw; + left: -999rem; + left: -100vw; + height: 2.2rem; + opacity: 0; + visibility: hidden; + background-color: rgba(0, 0, 0, 0.65); + -webkit-transition-duration: 0.3s; + transition-duration: 0.3s; + transform: translateZ(0) +} + +#mainMenu #searchform .fa-search { + position: relative; + z-index: 1 +} + +#mainMenu #searchform .fa-refresh { + position: absolute; + z-index: 9; + display: none; + top: 0.6rem; + right: 0.8rem; + line-height: 1em +} + /* #searchresult */ -#searchresult { position: absolute; z-index: 99; overflow: hidden; top: 2.2rem; right: 0; bottom: 0; width: 0; max-width: 100%; background-color: #fff; border-left: 1px solid rgba(0, 0, 0, 0.1); opacity: 0; visibility: hidden; -webkit-transition: 0.25s ease 0.5s; transition: 0.25s ease 0.5s; -webkit-transition-delay: 0.3s; transition-delay: 0.3s; } -#searchresult.open { width: 20rem; box-shadow: 0 0 4.5rem rgba(0, 0, 0, 0.15); opacity: 1; visibility: visible; -webkit-transition: 0.5s ease 0.5s; transition: 0.5s ease 0.5s; -webkit-transition-delay: 0s; transition-delay: 0s } -#searchresult .ajaxSearchResults { width: 20rem; height: 100%; overflow: auto; } -#searchresult .ajaxSearchResults ul, #searchresult .ajaxSearchResults li { margin: 0; padding: 0; list-style: none } -#searchresult .ajaxSearchResults b, #searchresult .ajaxSearchResults strong, #searchresult .ajaxSearchResults a { position: relative; z-index: 0; display: block; color: #333; padding: 0.25rem 1rem; margin-top: -1px; border-top: 1px solid rgba(0, 0, 0, 0.03); border-bottom: 1px solid rgba(0, 0, 0, 0.03); box-sizing: border-box } -#searchresult .ajaxSearchResults b { z-index: 1; background-color: #ddd } -#searchresult .ajaxSearchResults a { padding: 0.25rem 2rem 0.25rem 1rem; text-decoration: none; } -#searchresult .ajaxSearchResults a:hover { color: #333; background-color: #f2f2f2; } -#searchresult .ajaxSearchResults a > i { position: absolute; right: 0; top: 50%; width: 2rem; height: 2rem; margin-top: -1rem; line-height: 2rem; text-align: center; color: #1976d2; } -#searchresult .ajaxSearchResults a.selected > i { color: #fff } -#searchresult .ajaxSearchResults a.selected { z-index: 1; background-color: #1976d2; color: #fff; font-weight: 700; } -#searchresult .ajaxSearchResults a .text-danger { color: #333; font-weight: 700 } -#searchresult .ajaxSearchResults a.selected .text-danger { color: #ffc107; text-shadow: 0 0 1px rgba(0, 0, 0, 0.5); } -#searchresult .ajaxSearchResults .locked a { font-style: italic; color: #646464; } -#searchresult .ajaxSearchResults .disabled a { opacity: .5; color: #7d2a24; } -#searchresult .ajaxSearchResults .deleted a { color: #a52a2a; text-decoration: line-through } + +#searchresult { + position: absolute; + z-index: 99; + overflow: hidden; + top: 2.2rem; + right: 0; + bottom: 0; + width: 0; + max-width: 100%; + background-color: #fff; + border-left: 1px solid rgba(0, 0, 0, 0.1); + opacity: 0; + visibility: hidden; + -webkit-transition: 0.25s ease 0.5s; + transition: 0.25s ease 0.5s; + -webkit-transition-delay: 0.3s; + transition-delay: 0.3s; +} + +#searchresult.open { + width: 20rem; + box-shadow: 0 0 4.5rem rgba(0, 0, 0, 0.15); + opacity: 1; + visibility: visible; + -webkit-transition: 0.5s ease 0.5s; + transition: 0.5s ease 0.5s; + -webkit-transition-delay: 0s; + transition-delay: 0s +} + +#searchresult .ajaxSearchResults { + width: 20rem; + height: 100%; + overflow: auto; +} + +#searchresult .ajaxSearchResults ul, +#searchresult .ajaxSearchResults li { + margin: 0; + padding: 0; + list-style: none +} + +#searchresult .ajaxSearchResults b, +#searchresult .ajaxSearchResults strong, +#searchresult .ajaxSearchResults a { + position: relative; + z-index: 0; + display: block; + color: #333; + padding: 0.25rem 1rem; + margin-top: -1px; + border-top: 1px solid rgba(0, 0, 0, 0.03); + border-bottom: 1px solid rgba(0, 0, 0, 0.03); + box-sizing: border-box +} + +#searchresult .ajaxSearchResults b { + z-index: 1; + background-color: #ddd +} + +#searchresult .ajaxSearchResults a { + padding: 0.25rem 2rem 0.25rem 1rem; + text-decoration: none; +} + +#searchresult .ajaxSearchResults a:hover { + color: #333; + background-color: #f2f2f2; +} + +#searchresult .ajaxSearchResults a > i { + position: absolute; + right: 0; + top: 50%; + width: 2rem; + height: 2rem; + margin-top: -1rem; + line-height: 2rem; + text-align: center; + color: #1976d2; +} + +#searchresult .ajaxSearchResults a.selected > i { + color: #fff +} + +#searchresult .ajaxSearchResults a.selected { + z-index: 1; + background-color: #1976d2; + color: #fff; + font-weight: 700; +} + +#searchresult .ajaxSearchResults a .text-danger { + color: #333; + font-weight: 700 +} + +#searchresult .ajaxSearchResults a.selected .text-danger { + color: #ffc107; + text-shadow: 0 0 1px rgba(0, 0, 0, 0.5); +} + +#searchresult .ajaxSearchResults .locked a { + font-style: italic; + color: #646464; +} + +#searchresult .ajaxSearchResults .disabled a { + opacity: .5; + color: #7d2a24; +} + +#searchresult .ajaxSearchResults .deleted a { + color: #a52a2a; + text-decoration: line-through +} + @media (min-width: 1200px) { -#searchresult { top: 3.125rem; } -#mainMenu #nav #site::before { content: ""; display: block; overflow: hidden; width: 10rem; background: url("../images/misc/logo-navbar.png") 0 50% no-repeat; background-size: 88%; } -#mainMenu #nav #site::before , #mainMenu #nav #site a { float: left } -#mainMenu, #mainMenu .nav > li > a, #mainMenu .nav .label_searchid, #mainMenu .nav > li > a .icon, #mainMenu #searchform .mask, #mainMenu #nav #site::before { height: 3.125rem; } -#mainMenu .nav > li > a, #mainMenu .nav .label_searchid, #mainMenu .nav > li .fa, #mainMenu .nav > li > a .icon { line-height: 3.1rem; } -#mainMenu .nav > li > a .icon.photo { width: 2.5rem; height: 2.5rem; margin-top: .3rem; } -#mainMenu #nav > li > a { padding: 0 1.3rem; font-size: .875rem; } -#mainMenu #nav > li > a > .fa { display: none } -#mainMenu .nav > li > a .icon .fa { line-height: 3rem; font-size: 1.5rem; } -#mainMenu .nav > li > ul { -webkit-transform: scale(.9); transform: scale(.9); box-shadow: 0 0.5rem 3rem rgba(0, 0, 0, 0.4); } -#mainMenu .nav > li > ul > li.item-input { padding: 0.575em 0.5em; } -#mainMenu.show .nav > li.hover > a + ul, #mainMenu.show .nav > li.hover > ul.sub-menu.show { -webkit-transform: scale(1); transform: scale(1); } -#mainMenu.show + #tree, #mainMenu.show + #tree + #main { -webkit-filter: blur(1px); filter: blur(1px) } -#mainMenu.show .nav > li.dropdown.hover > a { background-color: #48535f; color: #fff; } -#mainMenu .nav > li > ul > li > a:first-child, #mainMenu .nav > li > ul > li > span { line-height: 2.5rem; } -#mainMenu #searchform input { min-height: 2rem; height: 2rem; margin-top: 0.6rem; } -#mainMenu .nav > li > ul > li.dropdown-toggle > a > .toggle { line-height: 2.4rem; font-size: 1rem; } + #searchresult { + top: 3.125rem; + } + #mainMenu #nav #site::before { + content: ""; + display: block; + overflow: hidden; + width: 10rem; + background: url("../images/misc/logo-navbar.png") 0 50% no-repeat; + background-size: 88%; + } + #mainMenu #nav #site::before, + #mainMenu #nav #site a { + float: left + } + #mainMenu, + #mainMenu .nav > li > a, + #mainMenu .nav .label_searchid, + #mainMenu .nav > li > a .icon, + #mainMenu #searchform .mask, + #mainMenu #nav #site::before { + height: 3.125rem; + } + #mainMenu .nav > li > a, + #mainMenu .nav .label_searchid, + #mainMenu .nav > li .fa, + #mainMenu .nav > li > a .icon { + line-height: 3.1rem; + } + #mainMenu .nav > li > a .icon.photo { + width: 2.5rem; + height: 2.5rem; + margin-top: .3rem; + } + #mainMenu #nav > li > a { + padding: 0 1.3rem; + font-size: .875rem; + } + #mainMenu #nav > li > a > .fa { + display: none + } + #mainMenu .nav > li > a .icon .fa { + line-height: 3rem; + font-size: 1.5rem; + } + #mainMenu .nav > li > ul { + -webkit-transform: scale(.9); + transform: scale(.9); + box-shadow: 0 0.5rem 3rem rgba(0, 0, 0, 0.4); + } + #mainMenu .nav > li > ul > li.item-input { + padding: 0.575em 0.5em; + } + #mainMenu.show .nav > li.hover > a + ul, + #mainMenu.show .nav > li.hover > ul.sub-menu.show { + -webkit-transform: scale(1); + transform: scale(1); + } + #mainMenu.show + #tree, + #mainMenu.show + #tree + #main { + -webkit-filter: blur(1px); + filter: blur(1px) + } + #mainMenu.show .nav > li.dropdown.hover > a { + background-color: #48535f; + color: #fff; + } + #mainMenu .nav > li > ul > li > a:first-child, + #mainMenu .nav > li > ul > li > span { + line-height: 2.5rem; + } + #mainMenu #searchform input { + min-height: 2rem; + height: 2rem; + margin-top: 0.6rem; + } + #mainMenu .nav > li > ul > li.dropdown-toggle > a > .toggle { + line-height: 2.4rem; + font-size: 1rem; + } } + @media (max-width: 1020px) { -.nav > li > a, #mainMenu .nav > li > ul > li > a, #mainMenu .nav > li > ul > li > span, #mainMenu .nav .label_searchid { padding: 0 0.75rem; } + .nav > li > a, + #mainMenu .nav > li > ul > li > a, + #mainMenu .nav > li > ul > li > span, + #mainMenu .nav .label_searchid { + padding: 0 0.75rem; + } } + @media (max-width: 840px) { -#statusbar { display: none } -#mainMenu #nav #bars { width: 2.5rem } -#mainMenu .nav > li { position: static; } -#mainMenu .nav > li > a { font-size: 0; } -#mainMenu .nav > li > a, #mainMenu .nav .label_searchid { padding: 0 0.5rem; } -#mainMenu .nav > li > a > .username { font-size: .75rem; } -#mainMenu #nav > li > a > .fa { display: inline-block; } -#mainMenu .nav > li > a > .fa { display: inline-block; width: 1.3em; margin-right: 0 !important; text-align: center; } -#mainMenu .nav > li > ul { left: 0 !important; width: 100%; } -#mainMenu .nav > li > ul.sub-menu { transform: translate3d(-100%, 0, 0) } -#mainMenu.show .nav > li.active > ul.selected, #mainMenu.show .nav > li.hover > ul.selected + ul.sub-menu { opacity: 1; visibility: visible; } -#mainMenu.show .nav > li.active > ul.selected { transform: translate3d(-100%, 0, 0); } -#mainMenu.show .nav > li.hover > ul.selected + ul.sub-menu { transform: translate3d(0, 0, 0); } + #statusbar { + display: none + } + #mainMenu #nav #bars { + width: 2.5rem + } + #mainMenu .nav > li { + position: static; + } + #mainMenu .nav > li > a { + font-size: 0; + } + #mainMenu .nav > li > a, + #mainMenu .nav .label_searchid { + padding: 0 0.5rem; + } + #mainMenu .nav > li > a > .username { + font-size: .75rem; + } + #mainMenu #nav > li > a > .fa { + display: inline-block; + } + #mainMenu .nav > li > a > .fa { + display: inline-block; + width: 1.3em; + margin-right: 0 !important; + text-align: center; + } + #mainMenu .nav > li > ul { + left: 0 !important; + width: 100%; + } + #mainMenu .nav > li > ul.sub-menu { + transform: translate3d(-100%, 0, 0) + } + #mainMenu.show .nav > li.active > ul.selected, + #mainMenu.show .nav > li.hover > ul.selected + ul.sub-menu { + opacity: 1; + visibility: visible; + } + #mainMenu.show .nav > li.active > ul.selected { + transform: translate3d(-100%, 0, 0); + } + #mainMenu.show .nav > li.hover > ul.selected + ul.sub-menu { + transform: translate3d(0, 0, 0); + } } + @media (max-width: 480px) { -#mainMenu .nav > li > a .username, #searchresult .ajaxSearchResults a > i { display: none } -#mainMenu .nav > li > a .icon { margin-left: 0 } -#searchresult.open, #searchresult .ajaxSearchResults { width: 100% } + #mainMenu .nav > li > a .username, + #searchresult .ajaxSearchResults a > i { + display: none + } + #mainMenu .nav > li > a .icon { + margin-left: 0 + } + #searchresult.open, + #searchresult .ajaxSearchResults { + width: 100% + } } + /* dark */ diff --git a/manager/media/style/default/css/tabpane.css b/manager/media/style/default/css/tabpane.css index 9acc2f6a46..676a839421 100755 --- a/manager/media/style/default/css/tabpane.css +++ b/manager/media/style/default/css/tabpane.css @@ -1,135 +1,807 @@ /* [ Tabs ] */ -.tab-row { position: relative; z-index: 1; white-space: nowrap; padding: 0 1.5rem } -.tab-row::after, .tab-row-container::after { content: ""; position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; height: 1px; background-color: #ddd } -.tab-row .tab, .tab-pane > .tab-page > .tab { position: relative; display: inline-block; margin: 0; padding: 0 0.875rem; line-height: 2.7rem; height: 2.5rem; text-transform: uppercase; border: 1px solid rgba(0, 0, 0, 0); border-bottom: none; cursor: pointer; -webkit-user-select: none; user-select: none; } -.tab-row .tab, .tab-row .tab a, .tab-pane > .tab-page > .tab { color: rgba(0, 0, 0, 0.6); font-size: 0.75rem } -.tab-row .tab.selected { z-index: 2; border-color: #ddd; background-color: #fff; color: #444; font-weight: 700 } -.tab-row .tab .fa { margin-right: 0.1em; font-size: 0.875rem } + +.tab-row { + position: relative; + z-index: 1; + white-space: nowrap; + padding: 0 1.5rem +} + +.tab-row::after, +.tab-row-container::after { + content: ""; + position: absolute; + z-index: 1; + left: 0; + right: 0; + bottom: 0; + height: 1px; + background-color: #ddd +} + +.tab-row .tab, +.tab-pane > .tab-page > .tab { + position: relative; + display: inline-block; + margin: 0; + padding: 0 0.875rem; + line-height: 2.7rem; + height: 2.5rem; + text-transform: uppercase; + border: 1px solid rgba(0, 0, 0, 0); + border-bottom: none; + cursor: pointer; + -webkit-user-select: none; + user-select: none; +} + +.tab-row .tab, +.tab-row .tab a, +.tab-pane > .tab-page > .tab { + color: rgba(0, 0, 0, 0.6); + font-size: 0.75rem +} + +.tab-row .tab.selected { + z-index: 2; + border-color: #ddd; + background-color: #fff; + color: #444; + font-weight: 700 +} + +.tab-row .tab .fa { + margin-right: 0.1em; + font-size: 0.875rem +} + /* tabs-container */ -.tab-row-container { height: 2.5rem; left: 0; overflow-y: hidden; padding: 0 1.5rem; position: relative; z-index: 0 } -.tab-row-container .tab-row { z-index: 2; -webkit-overflow-scrolling: touch; overflow-x: auto; padding: 0 0 2rem; white-space: nowrap } -.tab-row-container .tab-row::after { display: none } -.tab-row-container > i { position: absolute; top: 0; height: 100%; text-align: center; font: normal normal normal 1.2rem/2.7rem FontAwesome; cursor: pointer; transition-duration: 0.2s; width: 1.5rem; } -.tab-row-container > i.prev { left: 0; } -.tab-row-container > i.next { right: 0; } -.tab-row-container > i.disable { font-size: 0.8rem; color: rgba(0, 0, 0, 0.2); pointer-events: none } + +.tab-row-container { + height: 2.5rem; + left: 0; + overflow-y: hidden; + padding: 0 1.5rem; + position: relative; + z-index: 0 +} + +.tab-row-container .tab-row { + z-index: 2; + -webkit-overflow-scrolling: touch; + overflow-x: auto; + padding: 0 0 2rem; + white-space: nowrap +} + +.tab-row-container .tab-row::after { + display: none +} + +.tab-row-container > i { + position: absolute; + top: 0; + height: 100%; + text-align: center; + font: normal normal normal 1.2rem/2.7rem FontAwesome; + cursor: pointer; + transition-duration: 0.2s; + width: 1.5rem; +} + +.tab-row-container > i.prev { + left: 0; +} + +.tab-row-container > i.next { + right: 0; +} + +.tab-row-container > i.disable { + font-size: 0.8rem; + color: rgba(0, 0, 0, 0.2); + pointer-events: none +} + /* tab-page */ -.tab-pane > .tab-page { display: block } -.tab-pane > .tab-page ~ .tab-page { display: none } -.tab-pane > .tab-page:first-of-type { display: block; margin-top: 2.5rem; } -.tab-pane > .tab-page > .tab { top: -2.5rem; left: 1.5rem; background-color: #f9f9f9; border-color: #ddd; } -.sectionBody > .tab-pane > .tab-page > .tab { top: -3.7rem; left: 0.3rem; } -.tab-pane > .tab-page > div:first-of-type, .tab-pane > .tab-page > table { margin-top: -2.5rem } -.dynamic-tab-pane-control.tab-pane > .tab-page > div:first-of-type, .dynamic-tab-pane-control.tab-pane > .tab-page > table { margin-top: 0 } -.tab-page { clear: both; width: 100%; background-color: #fff; padding: 0; border: 0; border-radius: 0; box-shadow: 0 0 0.3rem 0 rgba(0, 0, 0, .1) } -.tab-page .tab-header, .sectionHeader { margin-top: 1em; padding: .5rem 1.25rem; letter-spacing: 0; font-size: 0.875rem; font-weight: bold; } -.tab-page .tab-header, .tab-page .tab-section .tab-header, .tab-page .sectionHeader { background-color: #f3f3f3; border-bottom-width: 1px; } -.tab-page .tab-header + .tab-header, .tab-page .sectionHeader + .sectionHeader { margin-top: 0; border-top: 1px solid #ccc; } -.tab-page > .tab-body .tab-header { padding-left: 0; padding-right: 0 } -.tab-page > .tab-header:first-child, .tab-page > .tab-body > .tab-header:first-child, .tab-page .sectionHeader:first-child, .tab-page > script + .sectionHeader, .sectionBody .tab-page > script + .tab-section { margin-top: 0 } -.tab-page > .tab-body { width: 100%; padding: 1.25rem; } -.tab-page > .tab-body > .tab-body, .tab-page .sectionBody { padding: 1rem 0; } -.tab-page > .tab-header + .tab-body, .tab-page > .tab-body .tab-header + .tab-body, .tab-page .sectionHeader + .sectionBody { padding-top: 1em; border-top: 1px solid rgba(0, 0, 0, 0.1); } -.tab-page > .tab-body::after { display: table; width: 100%; content: '' } -.tab-page .tab-body > .form-group:last-child, .tab-page .tab-body > .form-row:last-child, .tab-page .tab-body > p:last-child, .tab-page .tab-body > .form-group:last-child > p:last-child, .tab-page .sectionBody:last-child { margin-bottom: 0 } -.tab-page .tab-section, .tab-page .sectionHeader + .sectionBody { margin-top: 1.25rem; background-color: #fafafa; border: 1px solid #e0e0e0; border-radius: .1rem; } -.tab-page .tab-section:first-child, .tab-page .sectionHeader + .sectionBody, .tab-page .sectionBody ~ .sectionHeader { margin-top: 0 } -.tab-page .tab-section .tab-header, .tab-page .sectionHeader { margin-left: -1px; margin-right: -1px; padding-left: .5rem; padding-right: .5rem; background-color: #efeff6; border: 1px solid #e0e0e0; border-bottom: 2px solid #e0e0ec; } -.tab-page .tab-header, .tab-page .tab-section .tab-header, .tab-page .sectionHeader { background-color: #f3f3f3; border-bottom-width: 1px; } -.tab-page .tab-section .tab-header:first-child, .tab-page .sectionHeader { margin-top: 0; border-top: none } -.tab-page .tab-section .tab-header + .tab-header, .tab-page .tab-section .tab-body + .tab-header, .tab-page .sectionHeader { border-top: 1px solid #e0e0e0; } -.tab-page .tab-section .tab-body, .tab-page .sectionBody { padding: 1rem; } -.tab-page > .sectionHeader, .sectionBody .tab-page > .tab-section { margin-top: 1rem; margin-left: .25rem; margin-right: .25rem } -.tab-page .sectionBody { margin: 1rem .25rem; } -.tab-page .sectionHeader + .sectionBody { border-top-color: transparent; border-radius: 0 } -.tab-page > .tab-section .tab-pane { padding-top: 1.25rem } -.tab-page > .tab-pane { margin-left: -1.25rem; margin-right: -1.25rem } -.tab-page > .tab-pane > .tab-page { box-shadow: none; } -.tab-page > .tab-pane > .tab-page > .tab-body { padding-bottom: 0 } + +.tab-pane > .tab-page { + display: block +} + +.tab-pane > .tab-page ~ .tab-page { + display: none +} + +.tab-pane > .tab-page:first-of-type { + display: block; + margin-top: 2.5rem; +} + +.tab-pane > .tab-page > .tab { + top: -2.5rem; + left: 1.5rem; + background-color: #f9f9f9; + border-color: #ddd; +} + +.sectionBody > .tab-pane > .tab-page > .tab { + top: -3.7rem; + left: 0.3rem; +} + +.tab-pane > .tab-page > div:first-of-type, +.tab-pane > .tab-page > table { + margin-top: -2.5rem +} + +.dynamic-tab-pane-control.tab-pane > .tab-page > div:first-of-type, +.dynamic-tab-pane-control.tab-pane > .tab-page > table { + margin-top: 0 +} + +.tab-page { + clear: both; + width: 100%; + background-color: #fff; + padding: 0; + border: 0; + border-radius: 0; + box-shadow: 0 0 0.3rem 0 rgba(0, 0, 0, .1) +} + +.tab-page .tab-header, +.sectionHeader { + margin-top: 1em; + padding: .5rem 1.25rem; + letter-spacing: 0; + font-size: 0.875rem; + font-weight: bold; +} + +.tab-page .tab-header, +.tab-page .tab-section .tab-header, +.tab-page .sectionHeader { + background-color: #f3f3f3; + border-bottom-width: 1px; +} + +.tab-page .tab-header + .tab-header, +.tab-page .sectionHeader + .sectionHeader { + margin-top: 0; + border-top: 1px solid #ccc; +} + +.tab-page > .tab-body .tab-header { + padding-left: 0; + padding-right: 0 +} + +.tab-page > .tab-header:first-child, +.tab-page > .tab-body > .tab-header:first-child, +.tab-page .sectionHeader:first-child, +.tab-page > script + .sectionHeader, +.sectionBody .tab-page > script + .tab-section { + margin-top: 0 +} + +.tab-page > .tab-body { + width: 100%; + padding: 1.25rem; +} + +.tab-page > .tab-body > .tab-body, +.tab-page .sectionBody { + padding: 1rem 0; +} + +.tab-page > .tab-header + .tab-body, +.tab-page > .tab-body .tab-header + .tab-body, +.tab-page .sectionHeader + .sectionBody { + padding-top: 1em; + border-top: 1px solid rgba(0, 0, 0, 0.1); +} + +.tab-page > .tab-body::after { + display: table; + width: 100%; + content: '' +} + +.tab-page .tab-body > .form-group:last-child, +.tab-page .tab-body > .form-row:last-child, +.tab-page .tab-body > p:last-child, +.tab-page .tab-body > .form-group:last-child > p:last-child, +.tab-page .sectionBody:last-child { + margin-bottom: 0 +} + +.tab-page .tab-section, +.tab-page .sectionHeader + .sectionBody { + margin-top: 1.25rem; + background-color: #fafafa; + border: 1px solid #e0e0e0; + border-radius: .1rem; +} + +.tab-page .tab-section:first-child, +.tab-page .sectionHeader + .sectionBody, +.tab-page .sectionBody ~ .sectionHeader { + margin-top: 0 +} + +.tab-page .tab-section .tab-header, +.tab-page .sectionHeader { + margin-left: -1px; + margin-right: -1px; + padding-left: .5rem; + padding-right: .5rem; + background-color: #efeff6; + border: 1px solid #e0e0e0; + border-bottom: 2px solid #e0e0ec; +} + +.tab-page .tab-header, +.tab-page .tab-section .tab-header, +.tab-page .sectionHeader { + background-color: #f3f3f3; + border-bottom-width: 1px; +} + +.tab-page .tab-section .tab-header:first-child, +.tab-page .sectionHeader { + margin-top: 0; + border-top: none +} + +.tab-page .tab-section .tab-header + .tab-header, +.tab-page .tab-section .tab-body + .tab-header, +.tab-page .sectionHeader { + border-top: 1px solid #e0e0e0; +} + +.tab-page .tab-section .tab-body, +.tab-page .sectionBody { + padding: 1rem; +} + +.tab-page > .sectionHeader, +.sectionBody .tab-page > .tab-section { + margin-top: 1rem; + margin-left: .25rem; + margin-right: .25rem +} + +.tab-page .sectionBody { + margin: 1rem .25rem; +} + +.tab-page .sectionHeader + .sectionBody { + border-top-color: transparent; + border-radius: 0 +} + +.tab-page > .tab-section .tab-pane { + padding-top: 1.25rem +} + +.tab-page > .tab-pane { + margin-left: -1.25rem; + margin-right: -1.25rem +} + +.tab-page > .tab-pane > .tab-page { + box-shadow: none; +} + +.tab-page > .tab-pane > .tab-page > .tab-body { + padding-bottom: 0 +} + /* tab-page-header collapse */ -.tab-page .tab-header[data-toggle="collapse"]::after { float: right; content: "\f107"; font-family: FontAwesome; font-size: 1rem; line-height: 1em; color: #777; cursor: pointer; transition-duration: .3s } -.tab-page .tab-header[data-toggle="collapse"].collapsed::after { transform: rotate(180deg) } -.tab-page .tab-header[data-toggle="collapse"]:hover::after { color: #333 } + +.tab-page .tab-header[data-toggle="collapse"]::after { + float: right; + content: "\f107"; + font-family: FontAwesome; + font-size: 1rem; + line-height: 1em; + color: #777; + cursor: pointer; + transition-duration: .3s +} + +.tab-page .tab-header[data-toggle="collapse"].collapsed::after { + transform: rotate(180deg) +} + +.tab-page .tab-header[data-toggle="collapse"]:hover::after { + color: #333 +} + /* old style */ -.sectionBody .tab-page { clear: both; width: 100%; background-color: #fff; padding: 0; border: 0; border-radius: 0; box-shadow: 0 0 0.3rem 0 rgba(0, 0, 0, .1) } -.sectionBody > .tab-pane > .tab-page { padding: 1.25rem; } -.tab-page > table { width: 100%; border-collapse: collapse } -.sectionBody .displayparams, .sectionBody .permissiongroup { margin-bottom: 0.15rem; background-color: #eee; border-collapse: separate; border-spacing: 1px; } -.sectionBody .displayparams th, .sectionBody .displayparams td { padding: 4px 4px; } -.sectionBody .displayparams thead td, .sectionBody .permissiongroup thead td { border-top: none; } -.sectionBody fieldset { background: none repeat scroll 0 0 #fdfdfd; border: 1px solid #ccc; padding: 1rem !important; } -.sectionBody legend { font-weight: 500; padding: 5px 1rem; background: #fff; border: 1px solid #ccc; -webkit-box-shadow: 1px 1px 3px #ccc; box-shadow: 1px 1px 3px #ccc; -webkit-border-radius: 3px; border-radius: 3px; } -.sectionBody fieldset h3 { font-size: 14px; color: #789; font-weight: 500; padding-bottom: 0; margin-bottom: 0; } -.showHideVisible { color: #333; margin: 0 1rem; padding: 5px 3px 5px; font-weight: 500; text-shadow: 0 1px 0 #fff; } -.showHideVisible + .sectionBody { margin-top: -1px !important } -.sectionBody, .layerVisible { position: relative; } -.sectionBody > p:first-child { margin-left: 1rem; margin-right: 1rem } -.showHideVisible, .layerVisible { margin: 0 10px 4px; } -.sectionBody td, .sectionBody th { padding: 0.15rem 0.25rem; vertical-align: top; } + +.sectionBody .tab-page { + clear: both; + width: 100%; + background-color: #fff; + padding: 0; + border: 0; + border-radius: 0; + box-shadow: 0 0 0.3rem 0 rgba(0, 0, 0, .1) +} + +.sectionBody > .tab-pane > .tab-page { + padding: 1.25rem; +} + +.tab-page > table { + width: 100%; + border-collapse: collapse +} + +.sectionBody .displayparams, +.sectionBody .permissiongroup { + margin-bottom: 0.15rem; + background-color: #eee; + border-collapse: separate; + border-spacing: 1px; +} + +.sectionBody .displayparams th, +.sectionBody .displayparams td { + padding: 4px 4px; +} + +.sectionBody .displayparams thead td, +.sectionBody .permissiongroup thead td { + border-top: none; +} + +.sectionBody fieldset { + background: none repeat scroll 0 0 #fdfdfd; + border: 1px solid #ccc; + padding: 1rem !important; +} + +.sectionBody legend { + font-weight: 500; + padding: 5px 1rem; + background: #fff; + border: 1px solid #ccc; + -webkit-box-shadow: 1px 1px 3px #ccc; + box-shadow: 1px 1px 3px #ccc; + -webkit-border-radius: 3px; + border-radius: 3px; +} + +.sectionBody fieldset h3 { + font-size: 14px; + color: #789; + font-weight: 500; + padding-bottom: 0; + margin-bottom: 0; +} + +.showHideVisible { + color: #333; + margin: 0 1rem; + padding: 5px 3px 5px; + font-weight: 500; + text-shadow: 0 1px 0 #fff; +} + +.showHideVisible + .sectionBody { + margin-top: -1px !important +} + +.sectionBody, +.layerVisible { + position: relative; +} + +.sectionBody > p:first-child { + margin-left: 1rem; + margin-right: 1rem +} + +.showHideVisible, +.layerVisible { + margin: 0 10px 4px; +} + +.sectionBody td, +.sectionBody th { + padding: 0.15rem 0.25rem; + vertical-align: top; +} + /* [ POPUPS ] */ -.evo-popup { display: none; position: absolute; z-index: 10500; box-shadow: 0 0.2rem 2rem rgba(0, 0, 0, 0.1); } -.evo-popup.animation { -webkit-transition: .25s; transition: .25s } -.evo-popup:hover { box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); } -.evo-popup.alert { margin: 0; height: 100%; border-color: rgba(0, 0, 0, 0.1); background-color: #fff; color: #444; border-radius: .15rem; } -.evo-popup.alert-dark { background-color: #202329; color: #ccc; } -.evo-popup.alert-dark hr { border-color: rgba(255, 255, 255, 0.5); } -.evo-popup.alert-dark .close { color: #fff; text-shadow: 0 0 #000; } -.evo-popup.alert-success { border-color: rgba(0, 0, 0, 0.1); background-color: #5cb85c; color: #fff; } -.evo-popup.alert-success hr { border-color: rgba(255, 255, 255, 0.5); } -.evo-popup.alert-info { border-color: rgba(0, 0, 0, 0.1); background-color: #1976d2; color: #fff; } -.evo-popup.alert-info hr { border-color: rgba(255, 255, 255, 0.5); } -.evo-popup.alert-warning { border-color: rgba(0, 0, 0, 0.1); background-color: #ffe082; color: #795548; } -.evo-popup.alert-warning hr { border-color: rgba(0, 0, 0, 0.1); } -.evo-popup.alert-danger { border-color: rgba(0, 0, 0, 0.1); background-color: #d9534f; color: #fff; } -.evo-popup.alert-danger hr { border-color: rgba(255, 255, 255, 0.5); } -.evo-popup.alert.evo-popup-iframe { padding: 0; border: none; background-color: #fafafa; overflow: hidden; } -.evo-popup.alert .evo-popup-header { padding-bottom: .5rem; margin-bottom: .5rem; border-bottom: 1px solid } -.evo-popup .close { position: absolute; top: .3em; right: .3em; } -.evo-popup.evo-popup-iframe .close { position: absolute; z-index: 9; opacity: 1; top: 0; right: 0; width: 1.5rem; height: 1.5rem; line-height: 1.4rem; color: #fff; background-color: #e5a2a0; text-align: center; font-weight: 100; } -.evo-popup.evo-popup-iframe .close:hover { opacity: 1; background-color: #d9534f; } -.evo-popup.evo-popup-iframe .evo-popup-header { position: relative; height: 1.5rem; margin: 0; padding: 0 1.5rem 0 .5rem; line-height: 1.5rem; font-size: .9rem; border-bottom: 1px solid #dedede; } -.evo-popup.evo-popup-iframe .evo-popup-header i { line-height: 1.5rem !important; } -.evo-popup.evo-popup-iframe .evo-popup-body { position: absolute; z-index: 1; left: 0; top: 0; right: 0; bottom: 0; } -.evo-popup.evo-popup-iframe .evo-popup-header + .evo-popup-body { top: 1.5rem } -.evo-popup.evo-popup-iframe.changed { box-shadow: 0 0.2rem 2rem rgba(0, 0, 0, 0.1), 0 0 .2rem .2rem #ffc107 } -.evo-popup-overlay { position: fixed; z-index: 10499; left: 0; top: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.3); } -.evo-popup-overlay::before { position: absolute; left: 20%; top: 20%; width: 45%; height: 45%; opacity: 0; background-color: rgba(0, 0, 0, 0.3); transition: all 0.25s ease-in-out; } -.evo-popup.is-drag::before, .evo-popup.is-resize::before { content: ""; position: absolute; z-index: 9; left: 0; top: 0; right: 0; bottom: 0; background-color: transparent; } -.evo-popup.resize .border-outline { display: none; } -.evo-popup.resize:hover .border-outline, .evo-popup.is-resize .border-outline, .evo-popup.resize:hover .border-outline i, .evo-popup.is-resize .border-outline i { display: block !important } -.evo-popup.resize .border-outline i { position: absolute; z-index: 99; display: none; background-color: transparent } -.evo-popup.resize .border-outline .bo-left, .evo-popup.resize .border-outline .bo-right { width: .25rem; height: 100%; } -.evo-popup.resize .border-outline .bo-left { left: 0; } -.evo-popup.resize .border-outline .bo-right { right: 0; } -.evo-popup.resize .border-outline .bo-top, .evo-popup.resize .border-outline .bo-bottom { height: .25rem; width: 100%; } -.evo-popup.resize .border-outline .bo-top { top: 0; } -.evo-popup.resize .border-outline .bo-bottom { bottom: 0; } -.dark .evo-popup.alert.evo-popup-iframe { background-color: #ecf0f1 } + +.evo-popup { + display: none; + position: absolute; + z-index: 10500; + box-shadow: 0 0.2rem 2rem rgba(0, 0, 0, 0.1); +} + +.evo-popup.animation { + -webkit-transition: .25s; + transition: .25s +} + +.evo-popup:hover { + box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); +} + +.evo-popup.alert { + margin: 0; + height: 100%; + border-color: rgba(0, 0, 0, 0.1); + background-color: #fff; + color: #444; + border-radius: .15rem; +} + +.evo-popup.alert-dark { + background-color: #202329; + color: #ccc; +} + +.evo-popup.alert-dark hr { + border-color: rgba(255, 255, 255, 0.5); +} + +.evo-popup.alert-dark .close { + color: #fff; + text-shadow: 0 0 #000; +} + +.evo-popup.alert-success { + border-color: rgba(0, 0, 0, 0.1); + background-color: #5cb85c; + color: #fff; +} + +.evo-popup.alert-success hr { + border-color: rgba(255, 255, 255, 0.5); +} + +.evo-popup.alert-info { + border-color: rgba(0, 0, 0, 0.1); + background-color: #1976d2; + color: #fff; +} + +.evo-popup.alert-info hr { + border-color: rgba(255, 255, 255, 0.5); +} + +.evo-popup.alert-warning { + border-color: rgba(0, 0, 0, 0.1); + background-color: #ffe082; + color: #795548; +} + +.evo-popup.alert-warning hr { + border-color: rgba(0, 0, 0, 0.1); +} + +.evo-popup.alert-danger { + border-color: rgba(0, 0, 0, 0.1); + background-color: #d9534f; + color: #fff; +} + +.evo-popup.alert-danger hr { + border-color: rgba(255, 255, 255, 0.5); +} + +.evo-popup.alert.evo-popup-iframe { + padding: 0; + border: none; + background-color: #fafafa; + overflow: hidden; +} + +.evo-popup.alert .evo-popup-header { + padding-bottom: .5rem; + margin-bottom: .5rem; + border-bottom: 1px solid +} + +.evo-popup .close { + position: absolute; + top: .3em; + right: .3em; +} + +.evo-popup.evo-popup-iframe .close { + position: absolute; + z-index: 9; + opacity: 1; + top: 0; + right: 0; + width: 1.5rem; + height: 1.5rem; + line-height: 1.4rem; + color: #fff; + background-color: #e5a2a0; + text-align: center; + font-weight: 100; +} + +.evo-popup.evo-popup-iframe .close:hover { + opacity: 1; + background-color: #d9534f; +} + +.evo-popup.evo-popup-iframe .evo-popup-header { + position: relative; + height: 1.5rem; + margin: 0; + padding: 0 1.5rem 0 .5rem; + line-height: 1.5rem; + font-size: .9rem; + border-bottom: 1px solid #dedede; +} + +.evo-popup.evo-popup-iframe .evo-popup-header i { + line-height: 1.5rem !important; +} + +.evo-popup.evo-popup-iframe .evo-popup-body { + position: absolute; + z-index: 1; + left: 0; + top: 0; + right: 0; + bottom: 0; +} + +.evo-popup.evo-popup-iframe .evo-popup-header + .evo-popup-body { + top: 1.5rem +} + +.evo-popup.evo-popup-iframe.changed { + box-shadow: 0 0.2rem 2rem rgba(0, 0, 0, 0.1), 0 0 .2rem .2rem #ffc107 +} + +.evo-popup-overlay { + position: fixed; + z-index: 10499; + left: 0; + top: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.3); +} + +.evo-popup-overlay::before { + position: absolute; + left: 20%; + top: 20%; + width: 45%; + height: 45%; + opacity: 0; + background-color: rgba(0, 0, 0, 0.3); + transition: all 0.25s ease-in-out; +} + +.evo-popup.is-drag::before, +.evo-popup.is-resize::before { + content: ""; + position: absolute; + z-index: 9; + left: 0; + top: 0; + right: 0; + bottom: 0; + background-color: transparent; +} + +.evo-popup.resize .border-outline { + display: none; +} + +.evo-popup.resize:hover .border-outline, +.evo-popup.is-resize .border-outline, +.evo-popup.resize:hover .border-outline i, +.evo-popup.is-resize .border-outline i { + display: block !important +} + +.evo-popup.resize .border-outline i { + position: absolute; + z-index: 99; + display: none; + background-color: transparent +} + +.evo-popup.resize .border-outline .bo-left, +.evo-popup.resize .border-outline .bo-right { + width: .25rem; + height: 100%; +} + +.evo-popup.resize .border-outline .bo-left { + left: 0; +} + +.evo-popup.resize .border-outline .bo-right { + right: 0; +} + +.evo-popup.resize .border-outline .bo-top, +.evo-popup.resize .border-outline .bo-bottom { + height: .25rem; + width: 100%; +} + +.evo-popup.resize .border-outline .bo-top { + top: 0; +} + +.evo-popup.resize .border-outline .bo-bottom { + bottom: 0; +} + +.dark .evo-popup.alert.evo-popup-iframe { + background-color: #ecf0f1 +} + /* [ EVO-TABS ] */ -.evo-tab-row { height: 1.875rem; padding: 0; background-color: #dfdfdf; } -.evo-tab-row:after { background-color: #cfd2d6 } -.evo-tab-row .tab-row .tab { height: 1.875rem; line-height: 2rem; font-size: .8125rem; text-transform: none; border: none; border-right: 1px solid #cfd2d6; border-left: 1px solid #cfd2d6; margin-left: -1px; } -.evo-tab-row .tab-row .tab:hover { background-color: rgba(255, 255, 255, 0.5) } -.evo-tab-row .tab-row .tab.changed { color: #0275d8; } -.evo-tab-row .tab-row .tab.selected { font-weight: normal; color: #444; background-color: #fafafa; } -.evo-tab-row .tab-row .tab i, .evo-popup.evo-popup-iframe .evo-popup-header i { float: left; margin: 0; line-height: 2.2em; } -.evo-tab-row .tab-row .tab small, .evo-popup.evo-popup-iframe .evo-popup-header small { margin-left: .25em } -.evo-tab-row .tab-row .tab:not(#evo-tab-home) i.help, .evo-popup.evo-popup-iframe .evo-popup-header i.help { display: none } -.evo-tab-row .tab-row .tab:not(#evo-tab-home) i, .evo-popup.evo-popup-iframe .evo-popup-header i { margin-right: .25em } -.evo-tab-row .tab-row .tab span { background: none !important } -.evo-tab-row .tab-row .tab .tab-title { float: left; width: 8rem; line-height: 2rem; text-overflow: ellipsis; overflow: hidden; } -.evo-tab-row .tab-row .tab .tab-close { float: right; margin: 0 -.75rem 0 .5rem; padding: .25em; line-height: 1.3em; font-size: 1.3em; font-weight: 700; color: #9e9e9e } -.evo-tab-row .tab-row .tab .tab-close:hover { color: #d9534f } -.evo-tab-page { position: absolute; overflow: hidden; z-index: -1; display: block; left: 0; top: 2.3em; right: 0; bottom: 0; height: auto; box-shadow: none; background-color: #fafafa; } -.evo-tab-page.show { z-index: 1; } -.evo-tab-page iframe { position: absolute; left: 0; top: 0; width: 100%; height: 100%; background-color: #fafafa; overflow: hidden; } -#tabGeneral > table { margin-bottom: 1rem; } + +.evo-tab-row { + height: 1.875rem; + padding: 0; + background-color: #dfdfdf; +} + +.evo-tab-row:after { + background-color: #cfd2d6 +} + +.evo-tab-row .tab-row .tab { + height: 1.875rem; + line-height: 2rem; + font-size: .8125rem; + text-transform: none; + border: none; + border-right: 1px solid #cfd2d6; + border-left: 1px solid #cfd2d6; + margin-left: -1px; +} + +.evo-tab-row .tab-row .tab:hover { + background-color: rgba(255, 255, 255, 0.5) +} + +.evo-tab-row .tab-row .tab.changed { + color: #0275d8; +} + +.evo-tab-row .tab-row .tab.selected { + font-weight: normal; + color: #444; + background-color: #fafafa; +} + +.evo-tab-row .tab-row .tab i, +.evo-popup.evo-popup-iframe .evo-popup-header i { + float: left; + margin: 0; + line-height: 2.2em; +} + +.evo-tab-row .tab-row .tab small, +.evo-popup.evo-popup-iframe .evo-popup-header small { + margin-left: .25em +} + +.evo-tab-row .tab-row .tab:not(#evo-tab-home) i.help, +.evo-popup.evo-popup-iframe .evo-popup-header i.help { + display: none +} + +.evo-tab-row .tab-row .tab:not(#evo-tab-home) i, +.evo-popup.evo-popup-iframe .evo-popup-header i { + margin-right: .25em +} + +.evo-tab-row .tab-row .tab span { + background: none !important +} + +.evo-tab-row .tab-row .tab .tab-title { + float: left; + width: 8rem; + line-height: 2rem; + text-overflow: ellipsis; + overflow: hidden; +} + +.evo-tab-row .tab-row .tab .tab-close { + float: right; + margin: 0 -.75rem 0 .5rem; + padding: .25em; + line-height: 1.3em; + font-size: 1.3em; + font-weight: 700; + color: #9e9e9e +} + +.evo-tab-row .tab-row .tab .tab-close:hover { + color: #d9534f +} + +.evo-tab-page { + position: absolute; + overflow: hidden; + z-index: -1; + display: block; + left: 0; + top: 2.3em; + right: 0; + bottom: 0; + height: auto; + box-shadow: none; + background-color: #fafafa; +} + +.evo-tab-page.show { + z-index: 1; +} + +.evo-tab-page iframe { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + background-color: #fafafa; + overflow: hidden; +} + +#tabGeneral > table { + margin-bottom: 1rem; +} + /* dark */ -.dark .evo-popup-overlay { background-color: rgba(0, 0, 0, 0.3); } -.dark .evo-tab-row { background-color: #1a1c21; border-bottom: none; } -.dark .evo-tab-row:after { background-color: #1a1c21; } -.dark .evo-tab-row .tab-row .tab { color: #aaa; border-color: #2a2d33 } -.dark .evo-tab-row .tab-row .tab:hover { background-color: #2d3033 } -.dark .evo-tab-row .tab-row .tab.changed { color: #7cb2dc; } -.dark .evo-tab-row .tab-row .tab.selected { background-color: #414550; color: #eee; border-bottom: 3px solid #1976d2; } -.dark .evo-tab-page, .dark .evo-tab-page iframe { background-color: #ecf0f1 } + +.dark .evo-popup-overlay { + background-color: rgba(0, 0, 0, 0.3); +} + +.dark .evo-tab-row { + background-color: #1a1c21; + border-bottom: none; +} + +.dark .evo-tab-row:after { + background-color: #1a1c21; +} + +.dark .evo-tab-row .tab-row .tab { + color: #aaa; + border-color: #2a2d33 +} + +.dark .evo-tab-row .tab-row .tab:hover { + background-color: #2d3033 +} + +.dark .evo-tab-row .tab-row .tab.changed { + color: #7cb2dc; +} + +.dark .evo-tab-row .tab-row .tab.selected { + background-color: #414550; + color: #eee; + border-bottom: 3px solid #1976d2; +} + +.dark .evo-tab-page, +.dark .evo-tab-page iframe { + background-color: #ecf0f1 +} \ No newline at end of file diff --git a/manager/media/style/default/css/tree.css b/manager/media/style/default/css/tree.css index 60c0fb8504..a882a17663 100755 --- a/manager/media/style/default/css/tree.css +++ b/manager/media/style/default/css/tree.css @@ -1,71 +1,400 @@ /* tree */ -#treeloader { position: absolute; display: block; overflow: hidden; right: 0.3em; top: 0.15em; opacity: 0; visibility: hidden; -webkit-transition-duration: 0.5s; transition-duration: 0.5s } -#treeloader .fa { font-size: 1em; } -#treeloader.visible { opacity: 0.7; visibility: visible; -webkit-transition-duration: 0s; transition-duration: 0s } -.treeframebody { height: 100%; min-height: calc(100% + 1px); background-color: #fafafa; border-right: 1px solid #cfd2d6; } -#treeMenu { display: table; width: 100%; height: 1.875rem; table-layout: fixed; margin-top: -1px; background-color: #dfdfdf; border-bottom: 1px solid #cfd2d6 } -#treeMenu .treeButton { display: table-cell; cursor: pointer; height: 1.875rem; line-height: 2rem; white-space: nowrap; text-align: center; vertical-align: middle; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } -#treeMenu .treeButton:hover:not(.disabled) { background-color: rgba(255, 255, 255, .5); cursor: pointer; -webkit-transition-duration: 0s; transition-duration: 0s } -#treeMenu .treeButton:not(.disabled):active { background-color: #d5d5d5 } -#treeMenu .treeButton .fa { display: block; width: 1.2em; height: 1.2em; margin: auto; line-height: 1.3em; font-size: 1.1em; } -#treeMenu .treeButton.disabled { color: #777; opacity: 0.5 } -#treeHolder { position: relative; z-index: 1; cursor: default; overflow: auto; height: 100%; max-height: calc(100% - 30px); white-space: nowrap } -#treeHolder .rootNode { position: relative; } -#treeHolder .rootNode a { display: block; overflow: hidden; padding: 1em 1em 0.5em 1rem; text-overflow: ellipsis; color: #333; cursor: pointer; -webkit-transition-duration: 0.15s; transition-duration: 0.15s; font-weight: bold } -#treeHolder .rootNode a .fa { margin-right: 0.5em } -#treeHolder .rootNode .icon { display: none; } -#treeRoot { float: left; width: 100%; color: #333; } -#treeRoot a { display: block; clear: both; overflow: hidden; text-decoration: none; padding: 0.2em 0 0.2em 2rem !important; font-size: 0.875rem; text-overflow: ellipsis; color: #333; cursor: default; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } -#treeRoot a:hover:not(.empty), #treeRoot a.current { background-color: rgba(33, 150, 243, 0.1) } -#treeRoot a small { margin: 0 0.8em 0 0.2em } -#treeRoot a.selected, #treeRoot .dragenter > a { background-color: rgba(0, 0, 0, 0.1); } -#treeRoot a .title { padding: 0 0.2em; color: #0275d8; cursor: pointer; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } -#treeRoot a.deleted .title { color: #a52a2a; text-decoration: line-through; } -#treeRoot a.unpublished .title { color: #b68282; font-style: italic; } -#treeRoot a.hidemenu .title { color: #404040; } -#treeRoot a.protected { position: relative; opacity: .5; background-color: transparent !important; } -#treeRoot a .lockedResource { cursor: pointer; } -#treeRoot a .editResource { margin-left: 0.2em } -#treeRoot .indent { position: relative; z-index: -1; float: left; height: 1.5em; } -#treeRoot .indent i { float: left; height: 1.2em; width: 1.5em } -#treeRoot .dragafter > a .indent, #treeRoot .dragbefore > a .indent { z-index: 1; } -#treeRoot .dragafter > a .indent::after, #treeRoot .dragbefore > a .indent::before { content: "\f0da"; display: block; position: absolute; right: 0.1em; bottom: -0.5em; height: 1em; font: normal normal normal 1em/1em FontAwesome; color: #f04 } -#treeRoot .dragbefore > a .indent::before { bottom: auto; top: -0.5em; } -#treeRoot .empty { color: #aaa; cursor: default; } -#treeRoot .icon { cursor: pointer; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } -#treeRoot .icon:hover > .fa { color: #000 } -#treeRoot .toggle { float: left; margin: 1px 0.2em 1px -1.5em; width: 1.3em; height: 1.3em; line-height: 1.4em; text-align: center; vertical-align: top; cursor: pointer; border-radius: 50%; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } -#treeRoot .toggle:hover { background-color: rgba(255, 255, 255, 0.5); } -#treeRoot .toggle .fa { margin: 0; width: auto; } -#treeRoot .fa, #treeHolder .rootNode .fa { margin-right: 1px; width: 1em; font-size: 1.1em; text-align: center; color: #565656; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } -#treeRoot a[data-private="1"] .icon::after { position: relative; float: left; margin: .5em -1em 0 0; content: "\f023"; font-family: FontAwesome; font-size: 0.75em; color: #d9534f; } -#treeRoot .fa-file, #treeRoot .fa-file-o, #treeRoot .fa-file-code, #treeRoot .fa-file-code-o { } -#treeRoot .fa-folder, #treeRoot .fa-folder-open, #treeRoot .fa-folder-o, #treeRoot .fa-folder-open-o, #treeRoot .fa-exclamation-triangle { margin-top: 0.1em; text-align: left } -#treeRoot .fa-link { margin-right: 0; font-size: 0.8em } -#treeRoot #binFull { display: none } + +#treeloader { + position: absolute; + display: block; + overflow: hidden; + right: 0.3em; + top: 0.15em; + opacity: 0; + visibility: hidden; + -webkit-transition-duration: 0.5s; + transition-duration: 0.5s +} + +#treeloader .fa { + font-size: 1em; +} + +#treeloader.visible { + opacity: 0.7; + visibility: visible; + -webkit-transition-duration: 0s; + transition-duration: 0s +} + +.treeframebody { + height: 100%; + min-height: calc(100% + 1px); + background-color: #fafafa; + border-right: 1px solid #cfd2d6; +} + +#treeMenu { + display: table; + width: 100%; + height: 1.875rem; + table-layout: fixed; + margin-top: -1px; + background-color: #dfdfdf; + border-bottom: 1px solid #cfd2d6 +} + +#treeMenu .treeButton { + display: table-cell; + cursor: pointer; + height: 1.875rem; + line-height: 2rem; + white-space: nowrap; + text-align: center; + vertical-align: middle; + -webkit-transition-duration: 0.15s; + transition-duration: 0.15s +} + +#treeMenu .treeButton:hover:not(.disabled) { + background-color: rgba(255, 255, 255, .5); + cursor: pointer; + -webkit-transition-duration: 0s; + transition-duration: 0s +} + +#treeMenu .treeButton:not(.disabled):active { + background-color: #d5d5d5 +} + +#treeMenu .treeButton .fa { + display: block; + width: 1.2em; + height: 1.2em; + margin: auto; + line-height: 1.3em; + font-size: 1.1em; +} + +#treeMenu .treeButton.disabled { + color: #777; + opacity: 0.5 +} + +#treeHolder { + position: relative; + z-index: 1; + cursor: default; + overflow: auto; + height: 100%; + max-height: calc(100% - 30px); + white-space: nowrap +} + +#treeHolder .rootNode { + position: relative; +} + +#treeHolder .rootNode a { + display: block; + overflow: hidden; + padding: 1em 1em 0.5em 1rem; + text-overflow: ellipsis; + color: #333; + cursor: pointer; + -webkit-transition-duration: 0.15s; + transition-duration: 0.15s; + font-weight: bold +} + +#treeHolder .rootNode a .fa { + margin-right: 0.5em +} + +#treeHolder .rootNode .icon { + display: none; +} + +#treeRoot { + float: left; + width: 100%; + color: #333; +} + +#treeRoot a { + display: block; + clear: both; + overflow: hidden; + text-decoration: none; + padding: 0.2em 0 0.2em 2rem !important; + font-size: 0.875rem; + text-overflow: ellipsis; + color: #333; + cursor: default; + -webkit-transition-duration: 0.15s; + transition-duration: 0.15s +} + +#treeRoot a:hover:not(.empty), +#treeRoot a.current { + background-color: rgba(33, 150, 243, 0.1) +} + +#treeRoot a small { + margin: 0 0.8em 0 0.2em +} + +#treeRoot a.selected, +#treeRoot .dragenter > a { + background-color: rgba(0, 0, 0, 0.1); +} + +#treeRoot a .title { + padding: 0 0.2em; + color: #0275d8; + cursor: pointer; + -webkit-transition-duration: 0.15s; + transition-duration: 0.15s +} + +#treeRoot a.deleted .title { + color: #a52a2a; + text-decoration: line-through; +} + +#treeRoot a.unpublished .title { + color: #b68282; + font-style: italic; +} + +#treeRoot a.hidemenu .title { + color: #404040; +} + +#treeRoot a.protected { + position: relative; + opacity: .5; + background-color: transparent !important; +} + +#treeRoot a .lockedResource { + cursor: pointer; +} + +#treeRoot a .editResource { + margin-left: 0.2em +} + +#treeRoot .indent { + position: relative; + z-index: -1; + float: left; + height: 1.5em; +} + +#treeRoot .indent i { + float: left; + height: 1.2em; + width: 1.5em +} + +#treeRoot .dragafter > a .indent, +#treeRoot .dragbefore > a .indent { + z-index: 1; +} + +#treeRoot .dragafter > a .indent::after, +#treeRoot .dragbefore > a .indent::before { + content: "\f0da"; + display: block; + position: absolute; + right: 0.1em; + bottom: -0.5em; + height: 1em; + font: normal normal normal 1em/1em FontAwesome; + color: #f04 +} + +#treeRoot .dragbefore > a .indent::before { + bottom: auto; + top: -0.5em; +} + +#treeRoot .empty { + color: #aaa; + cursor: default; +} + +#treeRoot .icon { + cursor: pointer; + -webkit-transition-duration: 0.15s; + transition-duration: 0.15s +} + +#treeRoot .icon:hover > .fa { + color: #000 +} + +#treeRoot .toggle { + float: left; + margin: 1px 0.2em 1px -1.5em; + width: 1.3em; + height: 1.3em; + line-height: 1.4em; + text-align: center; + vertical-align: top; + cursor: pointer; + border-radius: 50%; + -webkit-transition-duration: 0.15s; + transition-duration: 0.15s +} + +#treeRoot .toggle:hover { + background-color: rgba(255, 255, 255, 0.5); +} + +#treeRoot .toggle .fa { + margin: 0; + width: auto; +} + +#treeRoot .fa, +#treeHolder .rootNode .fa { + margin-right: 1px; + width: 1em; + font-size: 1.1em; + text-align: center; + color: #565656; + -webkit-transition-duration: 0.15s; + transition-duration: 0.15s +} + +#treeRoot a[data-private="1"] .icon::after { + position: relative; + float: left; + margin: .5em -1em 0 0; + content: "\f023"; + font-family: FontAwesome; + font-size: 0.75em; + color: #d9534f; +} + +#treeRoot .fa-file, +#treeRoot .fa-file-o, +#treeRoot .fa-file-code, +#treeRoot .fa-file-code-o {} + +#treeRoot .fa-folder, +#treeRoot .fa-folder-open, +#treeRoot .fa-folder-o, +#treeRoot .fa-folder-open-o, +#treeRoot .fa-exclamation-triangle { + margin-top: 0.1em; + text-align: left +} + +#treeRoot .fa-link { + margin-right: 0; + font-size: 0.8em +} + +#treeRoot #binFull { + display: none +} + /* treeRoot dark */ -.dark #treeMenu { background-color: rgba(0, 0, 0, 0.2); border-bottom-color: rgba(0, 0, 0, 0.2); border-right-color: #2a2d33 } -.dark #treeMenu .treeButton { color: #a9a9a9; } -.dark #treeMenu .treeButton:hover:not(.disabled) { background-color: #2d3033; color: #fff } -.dark #tree .treeframebody { background-color: #202329; border-color: #2a2d33 } -.dark #treeHolder .rootNode a { color: #c5c5c5; } -.dark #treeHolder .rootNode a:hover { color: #eee } -.dark #treeRoot { color: #b3b3b3; } -.dark #treeRoot a { color: #b3b3b3; } -.dark #treeRoot a:hover:not(.empty), .dark #treeRoot a.current { background-color: rgba(255, 255, 255, 0.15); } -.dark #treeRoot a.selected, #treeRoot .dragenter > a { background-color: rgba(0, 142, 255, 0.19); } -.dark #treeRoot .dragafter > a::after, .dark #treeRoot .dragbefore > a::before { background-color: rgba(255, 255, 255, 0.25); } -.dark #treeRoot a .title { color: #7cb2dc; } -.dark #treeRoot a.hidemenu .title { color: #c5c5c5; } -.dark #treeRoot a.deleted .title { color: #a52a2a; } -.dark #treeRoot a.unpublished .title { color: #d0726b } -.dark #treeRoot .icon:hover > .fa { color: #fff } -.dark #treeRoot a .title:hover { color: #a2d4fb; } -.dark #treeRoot a.hidemenu .title:hover { color: #eee } -.dark #treeRoot a.unpublished .title:hover { color: #f38e86 } -.dark #treeRoot a.deleted .title:hover { color: #e23d3d } -.dark #treeRoot .toggle:hover { background-color: rgba(255, 255, 255, 0.19); } -.dark #treeRoot .fa, .dark #treeHolder .rootNode .fa { color: #bcbec0; } + +.dark #treeMenu { + background-color: rgba(0, 0, 0, 0.2); + border-bottom-color: rgba(0, 0, 0, 0.2); + border-right-color: #2a2d33 +} + +.dark #treeMenu .treeButton { + color: #a9a9a9; +} + +.dark #treeMenu .treeButton:hover:not(.disabled) { + background-color: #2d3033; + color: #fff +} + +.dark #tree .treeframebody { + background-color: #202329; + border-color: #2a2d33 +} + +.dark #treeHolder .rootNode a { + color: #c5c5c5; +} + +.dark #treeHolder .rootNode a:hover { + color: #eee +} + +.dark #treeRoot { + color: #b3b3b3; +} + +.dark #treeRoot a { + color: #b3b3b3; +} + +.dark #treeRoot a:hover:not(.empty), +.dark #treeRoot a.current { + background-color: rgba(255, 255, 255, 0.15); +} + +.dark #treeRoot a.selected, +#treeRoot .dragenter > a { + background-color: rgba(0, 142, 255, 0.19); +} + +.dark #treeRoot .dragafter > a::after, +.dark #treeRoot .dragbefore > a::before { + background-color: rgba(255, 255, 255, 0.25); +} + +.dark #treeRoot a .title { + color: #7cb2dc; +} + +.dark #treeRoot a.hidemenu .title { + color: #c5c5c5; +} + +.dark #treeRoot a.deleted .title { + color: #a52a2a; +} + +.dark #treeRoot a.unpublished .title { + color: #d0726b +} + +.dark #treeRoot .icon:hover > .fa { + color: #fff +} + +.dark #treeRoot a .title:hover { + color: #a2d4fb; +} + +.dark #treeRoot a.hidemenu .title:hover { + color: #eee +} + +.dark #treeRoot a.unpublished .title:hover { + color: #f38e86 +} + +.dark #treeRoot a.deleted .title:hover { + color: #e23d3d +} + +.dark #treeRoot .toggle:hover { + background-color: rgba(255, 255, 255, 0.19); +} + +.dark #treeRoot .fa, +.dark #treeHolder .rootNode .fa { + color: #bcbec0; +} /* ElementsInTree plugin */ From 6fe01d7175b1569e00251d7ea8320e7a12553dd0 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Fri, 30 Mar 2018 22:48:56 +0200 Subject: [PATCH 102/274] tab-header color --- manager/media/style/default/css/tabpane.css | 1 + 1 file changed, 1 insertion(+) diff --git a/manager/media/style/default/css/tabpane.css b/manager/media/style/default/css/tabpane.css index 676a839421..ec3b444302 100755 --- a/manager/media/style/default/css/tabpane.css +++ b/manager/media/style/default/css/tabpane.css @@ -157,6 +157,7 @@ letter-spacing: 0; font-size: 0.875rem; font-weight: bold; + color: #777; } .tab-page .tab-header, From e72ae269bf99d94cf3429790dff86253c280218f Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Fri, 30 Mar 2018 22:59:41 +0200 Subject: [PATCH 103/274] Tree panel title font size (EIT) --- manager/media/style/default/css/tree.css | 1 + 1 file changed, 1 insertion(+) diff --git a/manager/media/style/default/css/tree.css b/manager/media/style/default/css/tree.css index a882a17663..e9c07214e9 100755 --- a/manager/media/style/default/css/tree.css +++ b/manager/media/style/default/css/tree.css @@ -404,6 +404,7 @@ #treePane .panel-title a { padding: 4px 0 6px 0.6rem !important; + font-size: 0.8125rem; } #treePane .panel-title > a:before { From 998f3a2fa8bfb34591e3829b2a3156eabb16cf62 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Sat, 31 Mar 2018 11:24:35 +0200 Subject: [PATCH 104/274] Fix #603 --- .../elementsintree/assets/txt_content.tpl | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/assets/plugins/elementsintree/assets/txt_content.tpl b/assets/plugins/elementsintree/assets/txt_content.tpl index bafac515fd..8b119cec7f 100755 --- a/assets/plugins/elementsintree/assets/txt_content.tpl +++ b/assets/plugins/elementsintree/assets/txt_content.tpl @@ -278,9 +278,24 @@ .ElementsInTree #tree .tab-page .panel-group .panel, .ElementsInTree #tree #tabDoc.tab-page>div { - max-height: calc(100vh - 8rem) !important; overflow: auto; } + + .ElementsInTree #tree #tabDoc.tab-page>div { + max-height: calc(100vh - 10rem) !important; + } + + .ElementsInTree #tree.has-treemenu-intab #tabDoc.tab-page>div { + max-height: calc(100vh - 10.3rem) !important; + } + + .ElementsInTree #tree .tab-page .panel-group .panel { + max-height: calc(100vh - 9rem) !important; + } + + .ElementsInTree #tree.has-treemenu-intab .tab-page .panel-group .panel { + max-height: calc(100vh - 7.125rem) !important; + } .ElementsInTree #tree .tab-page .panel-group { overflow: visible !important; From 6fb2778965b41a2a7f2f38f3214e6a5c085a669f Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Sat, 31 Mar 2018 12:36:23 +0200 Subject: [PATCH 105/274] Missing introtext in Recent Resources --- manager/actions/welcome.static.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/actions/welcome.static.php b/manager/actions/welcome.static.php index 3a39c89665..fdd3de0e94 100755 --- a/manager/actions/welcome.static.php +++ b/manager/actions/welcome.static.php @@ -579,7 +579,7 @@ function getRecentInfoRowTpl() {
    • [%long_title%]: [+longtitle+]
    • [%description%]: [+description+]
    • -
    • [%resource_summary%]: [+longtitle+]
    • +
    • [%resource_summary%]: [+introtext+]
    • [%type%]: [+type:is(reference):then([%weblink%]):else([%resource%])+]
    • [%resource_alias%]: [+alias+]
    • [%page_data_cacheable%]: [+cacheable:is(1):then([%yes%]):else([%no%])+]
    • From 5a8ad98e2159c4e0188e2c288730ad3adc6eb3b8 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Sat, 31 Mar 2018 17:03:07 +0200 Subject: [PATCH 106/274] Logo margin in About EVO tab Fixes missing logo margin in About EVO tab (Help page) --- manager/media/style/default/css/tabpane.css | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/manager/media/style/default/css/tabpane.css b/manager/media/style/default/css/tabpane.css index ec3b444302..f1b63291ff 100755 --- a/manager/media/style/default/css/tabpane.css +++ b/manager/media/style/default/css/tabpane.css @@ -768,6 +768,14 @@ margin-bottom: 1rem; } +#tab1Help > img { + margin-bottom: 20px; +} + +.tmplvars .tvimage img { + box-shadow: 0 0.1rem 0.2rem 0 rgba(0, 0, 0, 0.1); +} + /* dark */ .dark .evo-popup-overlay { @@ -805,4 +813,5 @@ .dark .evo-tab-page, .dark .evo-tab-page iframe { background-color: #ecf0f1 -} \ No newline at end of file +} + From 097a1076b0a511de5630e3418e0a264c7ff9331d Mon Sep 17 00:00:00 2001 From: Pathologic Date: Sun, 1 Apr 2018 19:42:29 +0300 Subject: [PATCH 107/274] more checks in cli mode --- install/config.inc.tpl | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/install/config.inc.tpl b/install/config.inc.tpl index a6f300b069..74e1db07fe 100755 --- a/install/config.inc.tpl +++ b/install/config.inc.tpl @@ -82,9 +82,19 @@ if (empty($base_path) || empty($base_url)) { if (!defined('MODX_BASE_PATH')) { define('MODX_BASE_PATH', $base_path); } + +if( ! preg_match('/\/$/', MODX_BASE_PATH)) { + throw new RuntimeException('Please, use trailing slash at the end of MODX_BASE_PATH'); +} + if (!defined('MODX_BASE_URL')) { define('MODX_BASE_URL', $base_url); } + +if( ! preg_match('/\/$/', MODX_BASE_URL)) { + throw new RuntimeException('Please, use trailing slash at the end of MODX_BASE_URL'); +} + if (!defined('MODX_MANAGER_PATH')) { define('MODX_MANAGER_PATH', $base_path . MGR_DIR . '/'); } @@ -119,12 +129,12 @@ if (!defined('MODX_SITE_URL')) { define('MODX_SITE_URL', $site_url); } -if (!defined('MODX_MANAGER_URL')) { - define('MODX_MANAGER_URL', MODX_SITE_URL . MGR_DIR . '/'); +if( ! preg_match('/\/$/', MODX_SITE_URL)) { + throw new RuntimeException('Please, use trailing slash at the end of MODX_SITE_URL'); } -if( ! preg_match('/\/$/', MODX_SITE_URL)) { - throw new RuntimeException('Please, use trailing slash at end of MODX_SITE_URL'); +if (!defined('MODX_MANAGER_URL')) { + define('MODX_MANAGER_URL', MODX_SITE_URL . MGR_DIR . '/'); } include_once(MODX_MANAGER_PATH . 'includes/preload.functions.inc.php'); From e053124ff99fa68dabd2dea20dba2113eef09abf Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Mon, 2 Apr 2018 14:24:22 +0300 Subject: [PATCH 108/274] return back toggleTheme --- manager/frames/tree.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manager/frames/tree.php b/manager/frames/tree.php index 394415f7e9..7520ba7796 100755 --- a/manager/frames/tree.php +++ b/manager/frames/tree.php @@ -46,6 +46,8 @@ + +
      From 657830057e6a2f1c4f92fe1a8f6395865b43bf3c Mon Sep 17 00:00:00 2001 From: Serg <64j@mail.ru> Date: Mon, 2 Apr 2018 21:23:01 +0300 Subject: [PATCH 109/274] revert class name --- manager/media/script/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/media/script/main.js b/manager/media/script/main.js index 6a1f7b78aa..1410c9e69e 100644 --- a/manager/media/script/main.js +++ b/manager/media/script/main.js @@ -171,7 +171,7 @@ evo.draggable = function(a, b) { } }; - o.container.els = document.getElementsByClassName(o.container.className); + o.container.els = document.querySelectorAll('.' + o.container.className); function onmousedown(e) { o.el = this; @@ -208,7 +208,7 @@ evo.draggable = function(a, b) { o.el.style.left = ''; o.el.style.top = ''; o.el.draggable = false; - var h = document.getElementsByClassName(o.container.classOver); + var h = document.querySelector('.' + o.container.classOver); if (h && h !== o.parent) { h.appendChild(o.el); o.container.drop(h, o.el); From 8526ee4b5fd1a25798fbb6614b0d42f268639d5f Mon Sep 17 00:00:00 2001 From: Serg <64j@mail.ru> Date: Tue, 3 Apr 2018 01:02:32 +0300 Subject: [PATCH 110/274] add styles for modes theme --- .../media/style/default/css/contextmenu.css | 105 +- manager/media/style/default/css/custom.css | 2315 ++++------------- manager/media/style/default/css/fonts.css | 562 +--- manager/media/style/default/css/forms.css | 459 +--- manager/media/style/default/css/index.css | 272 +- manager/media/style/default/css/layout.css | 180 +- manager/media/style/default/css/main.css | 995 ++----- manager/media/style/default/css/mainmenu.css | 867 +----- manager/media/style/default/css/tabpane.css | 960 ++----- manager/media/style/default/css/tree.css | 504 +--- 10 files changed, 1220 insertions(+), 5999 deletions(-) diff --git a/manager/media/style/default/css/contextmenu.css b/manager/media/style/default/css/contextmenu.css index 6d14313886..1c1135483a 100755 --- a/manager/media/style/default/css/contextmenu.css +++ b/manager/media/style/default/css/contextmenu.css @@ -1,93 +1,14 @@ /* contextmenu */ - -#mx_contextmenu, -#contextmenu, -.nu-context-menu, -.contextMenu { - display: block !important; - position: absolute; - overflow: hidden; - top: 0; - max-width: 25rem; - width: auto !important; - height: auto; - padding: 0.25rem 0; - visibility: hidden; - opacity: 0; - z-index: 10000; - background: #fff; - font-size: 0.9em; - border: none; - border-radius: 0.25rem; - -webkit-box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); - box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); - transition: opacity 0s, visibility 0s; - transform: translateZ(0) -} - -#mx_contextmenu .fa, -#contextmenu .fa, -.nu-context-menu .fa, -.contextMenu .fa { - width: 1.3em; - font-size: 0.9rem; - text-align: center; -} - -#mx_contextmenu.show, -#contextmenu.show, -.nu-context-menu.active, -.contextMenu { - visibility: visible; - opacity: 1; - transition: opacity 0.1s, visibility 0.1s; -} - -#mx_contextmenu > div, -#contextmenu > div, -.nu-context-menu ul li, -.contextMenu > div { - padding: 0.5em 2em 0.5em 1em; -} - -#mx_contextmenu #nameHolder, -#contextmenu .menuHeader, -.nu-context-menu-title { - color: #1377c5; - padding: 0.75em 1em; -} - -#mx_contextmenu .menuLink, -#contextmenu .menuLink, -.nu-context-menu ul li, -.contextMenu > div { - cursor: pointer; -} - -#mx_contextmenu .menuLink:hover, -#contextmenu .menuLink:hover, -.nu-context-menu ul li:hover, -.contextMenu > div:hover { - background-color: #1976d2; - color: #fff; -} - -#mx_contextmenu .seperator, -#contextmenu .seperator, -.nu-context-menu ul hr, -.contextMenu .cntxMnuSeparator { - height: 1px; - background-color: rgba(0, 0, 0, 0.07) !important; - margin: 0.25em 0; - padding: 0; - cursor: default; -} - -.nu-context-menu ul { - margin: 0; - padding: 0; -} - -.contextMenu .cntxMnuItem { - white-space: nowrap -} +#mx_contextmenu, #contextmenu, .nu-context-menu, .contextMenu { display: block !important; position: absolute; overflow: hidden; top: 0; max-width: 25rem; width: auto !important; height: auto; padding: 0.25rem 0; visibility: hidden; opacity: 0; z-index: 10000; background: #fff; font-size: 0.9em; border: none; border-radius: 0.25rem; -webkit-box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); transition: opacity 0s, visibility 0s; transform: translateZ(0) } +#mx_contextmenu .fa, #contextmenu .fa, .nu-context-menu .fa, .contextMenu .fa { width: 1.3em; font-size: 0.9rem; text-align: center; } +#mx_contextmenu.show, #contextmenu.show, .nu-context-menu.active, .contextMenu { visibility: visible; opacity: 1; transition: opacity 0.1s, visibility 0.1s; } +#mx_contextmenu > div, #contextmenu > div, .nu-context-menu ul li, .contextMenu > div { padding: 0.5em 2em 0.5em 1em; } +#mx_contextmenu #nameHolder, #contextmenu .menuHeader, .nu-context-menu-title { color: #1377c5; padding: 0.75em 1em; } +#mx_contextmenu .menuLink, #contextmenu .menuLink, .nu-context-menu ul li, .contextMenu > div { cursor: pointer; } +#mx_contextmenu .menuLink:hover, #contextmenu .menuLink:hover, .nu-context-menu ul li:hover, .contextMenu > div:hover { background-color: #1976d2; color: #fff; } +#mx_contextmenu .seperator, #contextmenu .seperator, .nu-context-menu ul hr, .contextMenu .cntxMnuSeparator { height: 1px; background-color: rgba(0, 0, 0, 0.07) !important; margin: 0.25em 0; padding: 0; cursor: default; } +.nu-context-menu ul { margin: 0; padding: 0; } +.contextMenu .cntxMnuItem { white-space: nowrap } +/* modes theme */ +/* darkness */ +.darkness #mx_contextmenu, .darkness #contextmenu, .darkness .nu-context-menu, .darkness .contextMenu { background-color: #343942; } \ No newline at end of file diff --git a/manager/media/style/default/css/custom.css b/manager/media/style/default/css/custom.css index 1072c01362..0f343f9ad9 100755 --- a/manager/media/style/default/css/custom.css +++ b/manager/media/style/default/css/custom.css @@ -1,1920 +1,483 @@ /* [ COLS ] */ - -.row { - margin-left: -1.25rem; - margin-right: -1.25rem -} - -.container { - padding-left: 1.25rem; - padding-right: 1.25rem; - width: 100% -} - -/* :TODO .container-body need remove and replace .tab-content */ - -.container-body { - padding: 1.25rem -} - -/* [ FORMS ] */ - -.form-row { - margin-bottom: 0.25rem; -} - -.form-row.row { - margin-left: 0; - margin-right: -1rem -} - -.form-row label { - margin-bottom: 0.15rem -} - -.form-row .col, -.form-row .col-1, -.form-row .col-10, -.form-row .col-11, -.form-row .col-12, -.form-row .col-2, -.form-row .col-3, -.form-row .col-4, -.form-row .col-5, -.form-row .col-6, -.form-row .col-7, -.form-row .col-8, -.form-row .col-9, -.form-row .col-lg, -.form-row .col-lg-1, -.form-row .col-lg-10, -.form-row .col-lg-11, -.form-row .col-lg-12, -.form-row .col-lg-2, -.form-row .col-lg-3, -.form-row .col-lg-4, -.form-row .col-lg-5, -.form-row .col-lg-6, -.form-row .col-lg-7, -.form-row .col-lg-8, -.form-row .col-lg-9, -.form-row .col-md, -.form-row .col-md-1, -.form-row .col-md-10, -.form-row .col-md-11, -.form-row .col-md-12, -.form-row .col-md-2, -.form-row .col-md-3, -.form-row .col-md-4, -.form-row .col-md-5, -.form-row .col-md-6, -.form-row .col-md-7, -.form-row .col-md-8, -.form-row .col-md-9, -.form-row .col-sm, -.form-row .col-sm-1, -.form-row .col-sm-10, -.form-row .col-sm-11, -.form-row .col-sm-12, -.form-row .col-sm-2, -.form-row .col-sm-3, -.form-row .col-sm-4, -.form-row .col-sm-5, -.form-row .col-sm-6, -.form-row .col-sm-7, -.form-row .col-sm-8, -.form-row .col-sm-9, -.form-row .col-xl, -.form-row .col-xl-1, -.form-row .col-xl-10, -.form-row .col-xl-11, -.form-row .col-xl-12, -.form-row .col-xl-2, -.form-row .col-xl-3, -.form-row .col-xl-4, -.form-row .col-xl-5, -.form-row .col-xl-6, -.form-row .col-xl-7, -.form-row .col-xl-8, -.form-row .col-xl-9, -.form-row .col-xs, -.form-row .col-xs-1, -.form-row .col-xs-10, -.form-row .col-xs-11, -.form-row .col-xs-12, -.form-row .col-xs-2, -.form-row .col-xs-3, -.form-row .col-xs-4, -.form-row .col-xs-5, -.form-row .col-xs-6, -.form-row .col-xs-7, -.form-row .col-xs-8, -.form-row .col-xs-9 { - padding-left: 0 -} - -.form-row .form-control { - float: left; -} - -.form-inline .form-row .form-control { - float: none; -} - -.container-body > .form-group:last-child, -.container-body > .form-row:last-child, -.container-body > p:last-child, -.container-body > .form-group:last-child > p:last-child { - margin-bottom: 0 -} - -.form-control-name { - position: relative; -} - -.form-control-name .form-control { - padding-right: 2em -} - -.form-control-name .custom-control { - display: block; - overflow: hidden; - position: absolute; - z-index: 3; - top: 0; - right: 0; - width: 2em; - height: 100%; - margin: 0; - padding: 0; - cursor: pointer -} - -.form-control-name .custom-control input { - position: absolute; - left: -100% -} - -.form-control-name .custom-control .fa-lock { - margin-top: 0.6em; - font-size: 1.5em -} - -.form-control-name .custom-control .fa-lock::before { - content: "\f09c"; - color: #ddd -} - -.form-control-name .custom-control input:checked ~ .fa-lock::before { - content: "\f023"; - color: #d9534f -} - -input[type=date]:not(.unstyled), -input[name*=date]:not(.unstyled):not([type=checkbox]):not([type=radio]), -input[name=createdon], -input[name=editedon], -input[size="1"], -select[name=usergroup]:not(.unstyled), -select[name=docgroup]:not(.unstyled) { - width: auto !important; - vertical-align: middle -} - -select[size="1"]:not(.unstyled) { - vertical-align: middle -} - -input[name*=date]:not(.unstyled) + .input-group-addon { - float: left; - width: auto; -} - -input[size="50"], -select[size="50"] { - width: 10rem !important -} - -select[name=usergroup], -select[name=docgroup] { - margin: 0 0.5em; -} - -select[name=docgroup] + input[type=submit] { - float: none; - margin: 0; -} - -#settingsPane #filemanager_path, -#settingsPane #rb_base_dir, -#settingsPane input[name=txt_custom_contenttype] { - border-top-right-radius: 0; - border-bottom-right-radius: 0 -} - -#settingsPane #filemanager_path + input[name=reset_filemanager_path], -#settingsPane #rb_base_dir + input[name=reset_rb_base_dir], -#settingsPane input[name=txt_custom_contenttype] + input[type=button], -input[name=photo] + input[type=button], -#range input#pids + input[name=fsubmit], -input[name="ta"].inputBox + input[type=button], -input[name="ta"].inputBox + .CodeMirror + input[type=button], -#documentPane input[name^=tv]:not([class*=mtv]) + input[type=button] { - z-index: 5; - float: right; - margin-top: -2.30769em; - width: auto !important; - border-top-left-radius: 0; - border-bottom-left-radius: 0 -} - -#settingsPane [name=site_name], -#settingsPane [name=txt_custom_contenttype], -#settingsPane [name=filemanager_path], -#settingsPane [name=rb_base_dir], -input[name=photo], -#range input#pids, -input[maxlength="350"], -textarea.mce, -#editorRow_TinyMCE { - width: 100% !important -} - -#range::after { - content: ""; - display: table; - width: 100% -} - -/* [ Editor ] */ - -.navbar.navbar-editor { - padding: .5rem 1.25rem; - border-radius: 0 -} - -.navbar-editor > label { - margin-bottom: 0 -} - -.section-editor textarea { - float: left; - border-left: none; - border-right: none; - font-family: 'Inconsolata', 'Monaco', 'Consolas', 'Courier New', 'Courier', monospace; - font-weight: 300; - font-size: 0.875rem; -} - -/* [ Action Buttons ] */ - -/* new style */ - -#actions { - background: rgba(199, 199, 199, 0.25); - padding: 0.5rem; - position: fixed; - top: 0; - right: 1rem; - text-align: right; - z-index: 1001; - border-radius: 0 0 0.3rem 0.3rem; -} - -#actions .btn-group { - margin: 0 -} - -#actions .btn-group > .btn-group { - display: block -} - -#actions .btn-group .btn, -#actions .btn-group .form-control { - font-size: .6772rem; - height: 2.4em; - line-height: 1.4 -} - -#actions .btn-group .btn .fa, -#_actions .btn-group .btn .fa { - display: none; - width: 1em; - font-size: 1em; - text-align: center -} - -#actions .btn-group .btn-group #Button1 { - min-width: 100%; - text-align: left; - float: right; -} - -#actions .btn-group .btn-success { - box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .07); -} - -#actions .btn-group .btn-success:hover { - box-shadow: none -} - -#actions .btn-group .plus { - z-index: 2; - float: right; - margin: -2.4em 0 0 0; - width: 2rem; - padding-left: 0; - padding-right: 0; - text-align: center; - cursor: default; -} - -#actions .btn-group .plus::before { - content: "\f107"; - font-family: FontAwesome -} - -#actions .btn-group .show .plus::before { - content: "\f106"; -} - -#actions .btn-group select#stay { - display: block; - position: relative; - z-index: -1; - clear: both; - width: auto; - height: 0; - margin: -100% 0 -2rem 0; - font-size: 0.675rem; - opacity: 0; - visibility: hidden; -} - -#actions .btn-group .dropdown-menu { - display: none; - position: absolute; - z-index: -1; - left: auto; - right: 0; - top: 100%; - width: 100%; - min-width: 2rem; - margin: 0; - padding: 0; - text-align: left; - font-size: .6772rem; - border-top: none; - border-radius: 0 0 0.1em 0.1em; - overflow: hidden; -} - -#actions .btn-group .show > .dropdown-menu { - display: block -} - -#actions .btn-group .dropdown-menu > span { - display: block; - margin: 0; - text-align: left; - border: none; - border-top: 1px solid rgba(0, 0, 0, 0.1) -} - -#actions .btn-group .dropdown-menu > span:first-child { - border-color: transparent -} - -#actions .btn-group .dropdown-menu > span:hover { - background-color: #e6e6e6; -} - -#actions .btn-group .dropdown-toggle::after { - margin: 0; - border-width: 0.4em; - transition-duration: 0.25s -} - -#actions .btn-group .show .dropdown-toggle::after { - transform: rotate(180deg) -} - -#_actions .btn-group .input-group-btn .btn { - margin-left: .1875rem -} - -#_actions .btn-group .form-control, -#_actions .btn-group .btn { - border-radius: .1em -} - -@media (max-width: 840px) { - #actions { - right: 0 - } - #actions .btn-group .btn span, - #actions .btn-group select#stay, - #_actions .btn-group .btn span { - display: none - } - #actions .btn-group .btn .fa, - #_actions .btn-group .btn .fa { - display: inline-block - } - #actions .btn-group .dropdown-menu { - width: 2rem - } - #actions .btn-group .dropdown-menu span { - padding-left: 0; - padding-right: 0; - text-align: center - } - #_actions .btn-group .input-group-btn .btn { - margin-left: -1px - } - #_actions .btn-group .form-control, - #_actions .btn-group .btn { - border-radius: 0 - } - #_actions .btn-group .form-control:first-child { - border-top-left-radius: .1em; - border-bottom-left-radius: .1em; - } - #_actions .btn-group .btn:last-child { - border-top-right-radius: .1em; - border-bottom-right-radius: .1em; - } -} - -/* old style */ - -#actions .actionButtons { - float: left; - min-height: 32px -} - -#actions .actionButtons li { - position: relative; - float: left; - margin-right: 3px; - border: none -} - -#actions .actionButtons li a, -#actions .actionButtons .plus { - float: left; - padding: 0 10px !important; - height: 32px; - line-height: 30px; - -webkit-user-select: none; - user-select: none; -} - -#actions .actionButtons li:last-child { - margin: 0 -} - -#actions .actionButtons #Button1 a { - width: 100%; - text-align: left; -} - -#actions .actionButtons .plus { - overflow: hidden; - float: right; - margin: -32px 0 0 0; - width: 35px; - border-radius: 0 3px 3px 0 !important; - text-align: center; - cursor: default; - font: normal normal normal 0/30px FontAwesome -} - -#actions .actionButtons .plus::before { - content: "\f107"; - font-size: 14px -} - -#actions .actionButtons .show .plus::before { - content: "\f106"; -} - -#actions .actionButtons .dropdown-menu { - display: none; - position: absolute; - z-index: -1; - left: auto; - right: 0; - top: 100%; - width: 100%; - min-width: 35px; - margin: -2px 0 0; - padding: 2px 0 0; - text-align: left; - font-size: 1em; - background-color: #fff; - border: 1px solid #32ab9a; - border-top: none; - border-radius: 0 0 3px 3px; - overflow: hidden; -} - -#actions .actionButtons .show > .dropdown-menu { - display: block -} - -#actions .actionButtons .dropdown-menu > span { - display: block; - padding: 0 10px; - height: 32px; - line-height: 30px; - border: none; - border-top: 1px solid #f2f2f2; - cursor: pointer; -} - -#actions .actionButtons .dropdown-menu > span:hover { - background-color: #fbfbfb; -} - -#actions .actionButtons select#stay { - display: block; - position: relative; - z-index: -1; - clear: both; - width: auto; - height: 0; - padding: 0 10px; - margin: -100% 0 -32px 0; - font-size: 1em; - opacity: 0; - visibility: hidden; -} - -#actions .actionButtons #Button1 a, -#actions .actionButtons .plus { - color: #fff; - border-color: #32ab9a; - background: #32ab9a linear-gradient(#32ab9a, #00948e); -} - -#actions .actionButtons #Button1 a:hover, -#actions .actionButtons .plus:hover { - background: #2b9385 linear-gradient(#2b9385, #007571); - border-color: #2b9385; -} - -#actions .actionButtons #Button1 a:active, -#actions .actionButtons .plus:active { - background: #32ab9a; - border-color: #32ab9a; -} - -@media (max-width: 900px) { - #actions .actionButtons li a, - #actions .actionButtons .dropdown-menu span { - font-size: 0 - } - #actions .actionButtons li a .fa, - #actions .actionButtons .dropdown-menu span .fa { - display: inline-block; - font-size: 14px; - line-height: 30px - } - #actions .actionButtons .dropdown-menu { - width: 35px - } - #actions .actionButtons #Button1 a { - margin: 0; - width: auto - } - #actions .actionButtons .plus { - margin: 0 0 0 -2px - } - #actions .actionButtons select#stay { - display: none - } -} - -/* actionButtons in content ( old style ) */ - -.actionButtons { - margin: 0; - padding: 0; - background: none; - width: auto; - white-space: nowrap; -} - -.actionButtons li { - float: left; - margin: 0; - padding: 0; - list-style: none; -} - -.actionButtons li:before, -.mmTagList li:before, -.rTable li:before, -.tab-pane ul li ul li:before, -.dashboard li:before, -div#idShowHideSocialBox.sectionBody > div.btn-group.ope > ul.dropdown-menu > li:before, -.sectionBody .multitv .list li:before { - display: none; - content: ''; -} - -.actionButtons img { - vertical-align: top; - margin-top: 1px; - opacity: 0.3; -} - -.actionButtons:hover img { - opacity: 1; -} - -.actionButtons a:hover { - border-color: #999; - -webkit-box-shadow: 1px 1px 2px #aaa; - box-shadow: 1px 1px 2px #aaa; - -webkit-transition: .3s ease; - transition: .3s ease; - background: -moz-linear-gradient(#fff, #f5f5f5); - background: -webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#f5f5f5)); - background: -o-linear-gradient(#fff, #f5f5f5); - text-decoration: none !important; -} - -.actionButtons a:active { - background: #92aac4 bottom left; - -webkit-box-shadow: 0 0 10px #b8c7d6; - box-shadow: 0 0 10px #b8c7d6; -} - -.actionButtons a { - float: left; - padding: 5px 10px; - height: 32px; - font-size: 13px; - font-weight: 500; -} - -.actionButtons a, -.actionButtons li.primary a, -.actionButtons a.primary, -.actionButtons a.default { - text-shadow: none; - background: #fff; - color: #555; - border: 1px solid #e4e4e4; - border-radius: 3px; - /*box-shadow: 0 0 0 1px #E4E4E4;*/ - box-shadow: none; - transition: none; -} - -.actionButtons a:hover { - background: #1377c5; - box-shadow: none; - border-color: #1377c5; - color: #fff !important; - transition: none; -} - -.actionButtons a:active { - background-color: #3189ba; - border-color: #3189ba; -} - -.actionButtons li.primary a, -.actionButtons a.primary { - color: #fff; - border-color: #32ab9a; - background: #32ab9a linear-gradient(#32ab9a, #00948e); -} - -.actionButtons li.primary a:hover, -.actionButtons a.primary:hover { - background: #2b9385 linear-gradient(#2b9385, #007571); - border-color: #2b9385; -} - -.actionButtons li.primary a:active, -.actionButtons a.primary:active { - background: #32ab9a; - border-color: #32ab9a; -} - -.actionButtons img { - display: none; -} - -#treePane .actionButtons img { - display: inline; -} - -.actionButtons--tableheader .fa { - font-size: 14px; -} - -.sectionBody .actionButtons { - padding-top: 0; - min-height: 40px; -} - -.sectionBody .actionButtons li { - margin-right: 10px; -} - -.sectionBody .actionButtons a { - display: inline-block; - padding: 9px 10px; - line-height: 1; -} - -table.actionButtons { - margin-top: 1rem; - margin-bottom: 10px; -} - -table.actionButtons img { - display: inline-block; -} - -table.actionButtons .searchtext { - padding: 5px; - height: 24px; - width: 150px; -} - -.actionButtons .fa { - display: none; - text-align: center; - font-size: 1em; - line-height: 1em; - width: 1.1em; - vertical-align: initial -} - -.actionButtons .fa, -.actionButtons--eit .fa { - display: inline-block; -} - -.optionsTitle .fa { - display: inline-block; -} - -@media (max-width: 900px) { - .actionButtons a { - display: inline-block; - padding: 6px 10px - } - .tab-page .actionButtons a { - margin-top: 0 !important - } - .actionButtons a span { - display: none; - } - .actionButtons a .fa { - display: inline-block; - } -} - -/* [ TABLES ] */ - -/* table */ - -.table th, -.table td { - padding: 0.15rem 0.25rem; -} - -/* table-data */ - -.table.data { - width: 100%; - max-width: 100%; - margin-bottom: 0; - border-bottom: 1px solid #eceeef -} - -.table.data th, -.table.data thead td { - padding: 0.75rem; - text-transform: uppercase; - white-space: nowrap; - font-size: 0.675rem; - color: #777; - border-bottom: 1px solid #eceeef -} - -.table.data td { - padding: 0.55rem 0.75rem; -} - -.table.data td, -.table.data th, -.table.data thead td { - vertical-align: top; - border-top: 1px solid #eceeef -} - -.table.data td:first-child, -.table.data th:first-child, -.table.data.table-sm td:first-child, -.table.data.table-sm th:first-child { - padding-left: 1.25rem -} - -.table.data td:last-child, -.table.data th:last-child, -.table.data.table-sm td:last-child, -.table.data.table-sm th:last-child { - padding-right: 1.25rem -} - -.table.data thead { - background-color: #fff; -} - -.table.data > tbody > tr { - background-color: #f9f9f9; - transition-duration: .5s -} - -.table.data > tbody > tr:nth-child(2n) { - background-color: #fff -} - -.table.data > tbody > tr:hover { - cursor: default; - background-color: rgba(93, 109, 202, 0.16); - transition-duration: .05s -} - -.table.data tr.unstyled:hover { - background-color: inherit -} - -.table.data .actions { - white-space: nowrap -} - -.table.data .actions a { - color: #555 -} - -.table.data .actions a .fa, -.table.data .actions span .fa { - position: relative; - margin: 0 0.375rem; - font-size: 0.9rem; - color: #555 -} - -.table.data .actions a:hover .fa { - color: #000; -} - -.table.data .actions a:hover .fa.fa-trash { - color: #d80030 -} - -.table.data .actions a .fa::before { - position: relative; - z-index: 2; -} - -.table.data .actions a .fa::after { - content: ""; - position: absolute; - z-index: 1; - left: 50%; - top: 50%; - width: 1.5rem; - height: 1.5rem; - margin: -0.75rem 0 0 -0.75rem; - border-radius: 50%; - -webkit-transition: 0.15s; - transition: 0.15s; -} - -.table.data .actions a:hover .fa::after { - background-color: #fff -} - -.table.data .actions .disabled { - visibility: hidden -} - -/* table-data-nowrap */ - -.table.data.nowrap th, -.table.data.nowrap td { - white-space: nowrap -} - -/* table-data-sortable */ - -.table.data thead .sortable a, -.table.data thead .sortable-text a { - color: #777; - text-decoration: none !important; -} - -.table.data thead .sortable a:hover, -.table.data thead .sortable-text a:hover { - color: #222 -} - -.table.data thead .sortable a::after, -.table.data thead .sortable-text a::after { - content: "\f107"; - font-family: FontAwesome; - opacity: .3; - margin-left: .5em; -} - -.table.data thead .sortable.forwardSort a::after, -.table.data thead .sortable-text.forwardSort a::after { - opacity: 1; - content: "\f106"; - color: #d9534f -} - -.table.data thead .sortable.reverseSort a::after, -.table.data thead .sortable-text.reverseSort a::after { - opacity: 1; - content: "\f107"; - color: #d9534f -} - -.table.data thead .sortable:hover a::after, -.table.data thead .sortable-text:hover a::after, -.table.data thead .sortable-numeric:hover a::after, -.table.data thead .sortable-date:hover a::after { - opacity: 1 -} - -.table.data thead .sortable, -.table.data thead .sortable-text, -.table.data thead .sortable-numeric, -.table.data thead .sortable-date { - cursor: pointer -} - -.table.data thead .sortable-text span, -.table.data thead .sortable-numeric span, -.table.data thead .sortable-date span { - display: none -} - -.table.data.table-sortable > tbody > tr { - cursor: move; - transition-duration: .5s -} - -.table.data.table-sortable > tbody > tr.ghost { - background-color: rgba(93, 109, 202, 0.16); - color: #d9534f !important; - transition: background-color .5s, color .5s, transform 0s -} - -/* table-data-sm */ - -.table.data.table-sm td, -.table.data.table-sm th { - padding: .25rem .5rem; -} - -.table.data.table-sm th, -.table.data.table-sm thead td { - font-size: 0.75rem; - text-transform: none; -} - -/* table-data-even */ - -.table.data.table-even > tbody > tr:not(:hover) { - background-color: #fff -} - -.table.data.table-even > tbody > tr:nth-child(4n+1):not(:hover) { - background-color: #f6f8f8 -} - -.table.data.table-even > tbody > tr:nth-child(2n) { - background-color: #fff -} - -/* table-data-docs */ - -.table.data .doc-item .fa { - width: 1.2em; - font-size: 0.9rem; - text-align: center; - margin-right: 0.25rem -} - -.table.data .doc-item { - text-decoration: none -} - -.table.data .doc-item:hover span { - text-decoration: underline -} - -.table.data .doc-item.private .fa::after { - position: relative; - float: left; - margin: .5em -1em 0 0; - content: "\f023"; - font-size: 0.75em; - color: #d9534f; -} - -/* [ BREADCRUMBS ] */ - -ul.breadcrumbs { - margin: 0 1rem .5rem; - padding: 0 0 .5rem; - line-height: normal; - font-size: .675rem; - color: #888; - border-bottom: 1px dotted #cecaca; -} - -ul.breadcrumbs li { - list-style: none; - display: inline-block; - padding: 0; - margin: 0; -} - -ul.breadcrumbs a { - text-decoration: none; -} - -ul.breadcrumbs span { - display: inline-block; - width: 1.25em; - vertical-align: top; - text-indent: -2.25em; - overflow: hidden; -} - -ul.breadcrumbs span::after { - margin-left: 2em; - font-family: FontAwesome; - content: "\f105" -} - -/* [ PAGINATION ] */ - -#pagination { - padding: 0 1.25rem; - margin: .5rem 0 0; -} - -#pagination ul { - margin: 0 0 0 .5rem; - display: inline-block; -} - -#pagination li { - list-style: none; - display: inline-block; - margin: 0 0 0 1px; -} - -#pagination li a { - display: inline-block; - padding: 0 .5rem; - line-height: 1.7; - border: 1px solid #ddd; - text-decoration: none; - color: #333; -} - -#pagination li.currentPage a, -#pagination li a:hover { - color: #555; - border: 1px solid #555; -} - -/* [ SEARCHBAR ] */ - -.searchbar input[type=text] { - max-width: 10rem -} - -/* [ WIDGETS ] */ - -.widgets .card { - margin-bottom: 1rem; - border-width: 0; - border-radius: 0; - background-color: #fff; - -webkit-transition: box-shadow .35s; - transition: box-shadow .35s; - box-shadow: 0 0.1rem 0.3rem 0 rgba(0, 0, 0, 0.075); -} - -.widgets .card:hover { - box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.07); -} - -.widgets .card-header { - padding: .5rem 1rem; - font-size: .9rem; - color: #616a73; - font-weight: 700; - border-radius: 0; - border: none; - border-bottom: 1px solid rgba(0, 0, 0, .05); - text-transform: none; - background-color: transparent; - border-bottom: 1px solid rgba(0, 0, 0, 0.05); -} - -.widgets .card-header .fa { - font-size: .9rem -} - -.widgets .card-block { - padding: 0; -} - -.widgets .card-block .card-block p { - padding: 0 1rem -} - -.widgets .card-block .card-body { - padding: 1rem; -} - -.widgets .card-block .card-body + .card-body { - padding-top: 0 -} - -.widgets .table { - margin-bottom: 0rem -} - -.widgets .table:not(.data) tr th, -.widgets .table:not(.data) tr td { - padding: .15rem; -} - -.widgets .table tr th:first-child, -.widgets .table tr td:first-child { - padding-left: 1rem !important -} - -.widgets .table tr th:last-child, -.widgets .table tr td:last-child { - padding-right: 1rem !important -} - -.widgets .table .actions a .fa { - margin: 0 .05rem; -} - -/* widgets custom */ - -.widgets #welcome .wm_buttons { - display: -ms-flexbox; - display: flex; - -ms-flex-wrap: wrap; - flex-wrap: wrap; - margin-bottom: 1rem; - padding: 0; - text-align: center; - border-bottom: 1px solid rgba(0, 0, 0, .05); -} - -.widgets #welcome .wm_button { - max-width: 16.666667%; - flex: 0 0 16.666667%; -} - -.widgets #welcome .wm_button a { - display: block; - height: 100%; - padding: 1rem 1rem .5rem; - text-decoration: none; - color: #646b7b; - box-shadow: none; - transition-duration: .5s -} - -.widgets #welcome .wm_button a:hover { - color: #373b46; - background-color: rgba(93, 109, 202, 0.16) -} - -.widgets #welcome .wm_button a .fa { - display: inline-block; -} - -.widgets #welcome .wm_button a .fa + span { - display: block; - padding: .5em 0; - line-height: 1em; - font-size: .7rem; -} - -.widgets #modxrecent_widget .table.data tbody tr:not(:hover) { - background-color: #fff +.row { margin-left: -1.25rem; margin-right: -1.25rem } +.container { padding-left: 1.25rem; padding-right: 1.25rem; width: 100% } +/* :TODO .container-body need remove and replace .tab-content */ +.container-body { padding: 1.25rem } +/* [ FORMS ] */ +.form-row { margin-bottom: 0.25rem; } +.form-row.row { margin-left: 0; margin-right: -1rem } +.form-row label { margin-bottom: 0.15rem } +.form-row .col, .form-row .col-1, .form-row .col-10, .form-row .col-11, .form-row .col-12, .form-row .col-2, .form-row .col-3, .form-row .col-4, .form-row .col-5, .form-row .col-6, .form-row .col-7, .form-row .col-8, .form-row .col-9, .form-row .col-lg, .form-row .col-lg-1, .form-row .col-lg-10, .form-row .col-lg-11, .form-row .col-lg-12, .form-row .col-lg-2, .form-row .col-lg-3, .form-row .col-lg-4, .form-row .col-lg-5, .form-row .col-lg-6, .form-row .col-lg-7, .form-row .col-lg-8, .form-row .col-lg-9, .form-row .col-md, .form-row .col-md-1, .form-row .col-md-10, .form-row .col-md-11, .form-row .col-md-12, .form-row .col-md-2, .form-row .col-md-3, .form-row .col-md-4, .form-row .col-md-5, .form-row .col-md-6, .form-row .col-md-7, .form-row .col-md-8, .form-row .col-md-9, .form-row .col-sm, .form-row .col-sm-1, .form-row .col-sm-10, .form-row .col-sm-11, .form-row .col-sm-12, .form-row .col-sm-2, .form-row .col-sm-3, .form-row .col-sm-4, .form-row .col-sm-5, .form-row .col-sm-6, .form-row .col-sm-7, .form-row .col-sm-8, .form-row .col-sm-9, .form-row .col-xl, .form-row .col-xl-1, .form-row .col-xl-10, .form-row .col-xl-11, .form-row .col-xl-12, .form-row .col-xl-2, .form-row .col-xl-3, .form-row .col-xl-4, .form-row .col-xl-5, .form-row .col-xl-6, .form-row .col-xl-7, .form-row .col-xl-8, .form-row .col-xl-9, .form-row .col-xs, .form-row .col-xs-1, .form-row .col-xs-10, .form-row .col-xs-11, .form-row .col-xs-12, .form-row .col-xs-2, .form-row .col-xs-3, .form-row .col-xs-4, .form-row .col-xs-5, .form-row .col-xs-6, .form-row .col-xs-7, .form-row .col-xs-8, .form-row .col-xs-9 { padding-left: 0 } +.form-row .form-control { float: left; } +.form-inline .form-row .form-control { float: none; } +.container-body > .form-group:last-child, .container-body > .form-row:last-child, .container-body > p:last-child, .container-body > .form-group:last-child > p:last-child { margin-bottom: 0 } +.form-control-name { position: relative; } +.form-control-name .form-control { padding-right: 2em } +.form-control-name .custom-control { display: block; overflow: hidden; position: absolute; z-index: 3; top: 0; right: 0; width: 2em; height: 100%; margin: 0; padding: 0; cursor: pointer } +.form-control-name .custom-control input { position: absolute; left: -100% } +.form-control-name .custom-control .fa-lock { margin-top: 0.6em; font-size: 1.5em } +.form-control-name .custom-control .fa-lock::before { content: "\f09c"; color: #ddd } +.form-control-name .custom-control input:checked ~ .fa-lock::before { content: "\f023"; color: #d9534f } +input[type=date]:not(.unstyled), input[name*=date]:not(.unstyled):not([type=checkbox]):not([type=radio]), input[name=createdon], input[name=editedon], input[size="1"], select[name=usergroup]:not(.unstyled), select[name=docgroup]:not(.unstyled) { width: auto !important; vertical-align: middle } +select[size="1"]:not(.unstyled) { vertical-align: middle } +input[name*=date]:not(.unstyled) + .input-group-addon { float: left; width: auto; } +input[size="50"], select[size="50"] { width: 10rem !important } +select[name=usergroup], select[name=docgroup] { margin: 0 0.5em; } +select[name=docgroup] + input[type=submit] { float: none; margin: 0; } +#settingsPane #filemanager_path, #settingsPane #rb_base_dir, #settingsPane input[name=txt_custom_contenttype] { border-top-right-radius: 0; border-bottom-right-radius: 0 } +#settingsPane #filemanager_path + input[name=reset_filemanager_path], #settingsPane #rb_base_dir + input[name=reset_rb_base_dir], #settingsPane input[name=txt_custom_contenttype] + input[type=button], input[name=photo] + input[type=button], #range input#pids + input[name=fsubmit], input[name="ta"].inputBox + input[type=button], input[name="ta"].inputBox + .CodeMirror + input[type=button], #documentPane input[name^=tv]:not([class*=mtv]) + input[type=button] { z-index: 5; float: right; margin-top: -2.30769em; width: auto !important; border-top-left-radius: 0; border-bottom-left-radius: 0 } +#settingsPane [name=site_name], #settingsPane [name=txt_custom_contenttype], #settingsPane [name=filemanager_path], #settingsPane [name=rb_base_dir], input[name=photo], #range input#pids, input[maxlength="350"], textarea.mce, #editorRow_TinyMCE { width: 100% !important } +#range::after { content: ""; display: table; width: 100% } +/* [ Editor ] */ +.navbar.navbar-editor { padding: .5rem 1.25rem; border-radius: 0 } +.navbar-editor > label { margin-bottom: 0 } +.section-editor textarea { float: left; border-left: none; border-right: none; font-family: 'Inconsolata', 'Monaco', 'Consolas', 'Courier New', 'Courier', monospace; font-weight: 300; font-size: 0.875rem; } +/* [ Action Buttons ] */ +/* new style */ +#actions { background: rgba(199, 199, 199, 0.25); padding: 0.5rem; position: fixed; top: 0; right: 1rem; text-align: right; z-index: 1001; border-radius: 0 0 0.3rem 0.3rem; } +#actions .btn-group { margin: 0 } +#actions .btn-group > .btn-group { display: block } +#actions .btn-group .btn, #actions .btn-group .form-control { font-size: .6772rem; height: 2.4em; line-height: 1.4 } +#actions .btn-group .btn .fa, #_actions .btn-group .btn .fa { display: none; width: 1em; font-size: 1em; text-align: center } +#actions .btn-group .btn-group #Button1 { min-width: 100%; text-align: left; float: right; } +#actions .btn-group .btn-success { box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .07); } +#actions .btn-group .btn-success:hover { box-shadow: none } +#actions .btn-group .plus { z-index: 2; float: right; margin: -2.4em 0 0 0; width: 2rem; padding-left: 0; padding-right: 0; text-align: center; cursor: default; } +#actions .btn-group .plus::before { content: "\f107"; font-family: FontAwesome } +#actions .btn-group .show .plus::before { content: "\f106"; } +#actions .btn-group select#stay { display: block; position: relative; z-index: -1; clear: both; width: auto; height: 0; margin: -100% 0 -2rem 0; font-size: 0.675rem; opacity: 0; visibility: hidden; } +#actions .btn-group .dropdown-menu { display: none; position: absolute; z-index: -1; left: auto; right: 0; top: 100%; width: 100%; min-width: 2rem; margin: 0; padding: 0; text-align: left; font-size: .6772rem; border-top: none; border-radius: 0 0 0.1em 0.1em; overflow: hidden; } +#actions .btn-group .show > .dropdown-menu { display: block } +#actions .btn-group .dropdown-menu > span { display: block; margin: 0; text-align: left; border: none; border-top: 1px solid rgba(0, 0, 0, 0.1) } +#actions .btn-group .dropdown-menu > span:first-child { border-color: transparent } +#actions .btn-group .dropdown-menu > span:hover { background-color: #e6e6e6; } +#actions .btn-group .dropdown-toggle::after { margin: 0; border-width: 0.4em; transition-duration: 0.25s } +#actions .btn-group .show .dropdown-toggle::after { transform: rotate(180deg) } +#_actions .btn-group .input-group-btn .btn { margin-left: .1875rem } +#_actions .btn-group .form-control, #_actions .btn-group .btn { border-radius: .1em } +@media (max-width: 840px) { +#actions { right: 0 } +#actions .btn-group .btn span, #actions .btn-group select#stay, #_actions .btn-group .btn span { display: none } +#actions .btn-group .btn .fa, #_actions .btn-group .btn .fa { display: inline-block } +#actions .btn-group .dropdown-menu { width: 2rem } +#actions .btn-group .dropdown-menu span { padding-left: 0; padding-right: 0; text-align: center } +#_actions .btn-group .input-group-btn .btn { margin-left: -1px } +#_actions .btn-group .form-control, #_actions .btn-group .btn { border-radius: 0 } +#_actions .btn-group .form-control:first-child { border-top-left-radius: .1em; border-bottom-left-radius: .1em; } +#_actions .btn-group .btn:last-child { border-top-right-radius: .1em; border-bottom-right-radius: .1em; } } - -.widgets #modxrecent_widget .table.data tbody tr:nth-child(4n+1):not(:hover) { - background-color: #f6f8f8 +/* old style */ +#actions .actionButtons { float: left; min-height: 32px } +#actions .actionButtons li { position: relative; float: left; margin-right: 3px; border: none } +#actions .actionButtons li a, #actions .actionButtons .plus { float: left; padding: 0 10px !important; height: 32px; line-height: 30px; -webkit-user-select: none; user-select: none; } +#actions .actionButtons li:last-child { margin: 0 } +#actions .actionButtons #Button1 a { width: 100%; text-align: left; } +#actions .actionButtons .plus { overflow: hidden; float: right; margin: -32px 0 0 0; width: 35px; border-radius: 0 3px 3px 0 !important; text-align: center; cursor: default; font: normal normal normal 0/30px FontAwesome } +#actions .actionButtons .plus::before { content: "\f107"; font-size: 14px } +#actions .actionButtons .show .plus::before { content: "\f106"; } +#actions .actionButtons .dropdown-menu { display: none; position: absolute; z-index: -1; left: auto; right: 0; top: 100%; width: 100%; min-width: 35px; margin: -2px 0 0; padding: 2px 0 0; text-align: left; font-size: 1em; background-color: #fff; border: 1px solid #32ab9a; border-top: none; border-radius: 0 0 3px 3px; overflow: hidden; } +#actions .actionButtons .show > .dropdown-menu { display: block } +#actions .actionButtons .dropdown-menu > span { display: block; padding: 0 10px; height: 32px; line-height: 30px; border: none; border-top: 1px solid #f2f2f2; cursor: pointer; } +#actions .actionButtons .dropdown-menu > span:hover { background-color: #fbfbfb; } +#actions .actionButtons select#stay { display: block; position: relative; z-index: -1; clear: both; width: auto; height: 0; padding: 0 10px; margin: -100% 0 -32px 0; font-size: 1em; opacity: 0; visibility: hidden; } +#actions .actionButtons #Button1 a, #actions .actionButtons .plus { color: #fff; border-color: #32ab9a; background: #32ab9a linear-gradient(#32ab9a, #00948e); } +#actions .actionButtons #Button1 a:hover, #actions .actionButtons .plus:hover { background: #2b9385 linear-gradient(#2b9385, #007571); border-color: #2b9385; } +#actions .actionButtons #Button1 a:active, #actions .actionButtons .plus:active { background: #32ab9a; border-color: #32ab9a; } +@media (max-width: 900px) { +#actions .actionButtons li a, #actions .actionButtons .dropdown-menu span { font-size: 0 } +#actions .actionButtons li a .fa, #actions .actionButtons .dropdown-menu span .fa { display: inline-block; font-size: 14px; line-height: 30px } +#actions .actionButtons .dropdown-menu { width: 35px } +#actions .actionButtons #Button1 a { margin: 0; width: auto } +#actions .actionButtons .plus { margin: 0 0 0 -2px } +#actions .actionButtons select#stay { display: none } } - -.widgets #modxrecent_widget .table.data tbody tr:nth-child(2n) { - background-color: #fff +/* actionButtons in content ( old style ) */ +.actionButtons { margin: 0; padding: 0; background: none; width: auto; white-space: nowrap; } +.actionButtons li { float: left; margin: 0; padding: 0; list-style: none; } +.actionButtons li:before, .mmTagList li:before, .rTable li:before, .tab-pane ul li ul li:before, .dashboard li:before, div#idShowHideSocialBox.sectionBody > div.btn-group.ope > ul.dropdown-menu > li:before, .sectionBody .multitv .list li:before { display: none; content: ''; } +.actionButtons img { vertical-align: top; margin-top: 1px; opacity: 0.3; } +.actionButtons:hover img { opacity: 1; } +.actionButtons a:hover { border-color: #999; -webkit-box-shadow: 1px 1px 2px #aaa; box-shadow: 1px 1px 2px #aaa; -webkit-transition: .3s ease; transition: .3s ease; background: -moz-linear-gradient(#fff, #f5f5f5); background: -webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#f5f5f5)); background: -o-linear-gradient(#fff, #f5f5f5); text-decoration: none !important; } +.actionButtons a:active { background: #92aac4 bottom left; -webkit-box-shadow: 0 0 10px #b8c7d6; box-shadow: 0 0 10px #b8c7d6; } +.actionButtons a { float: left; padding: 5px 10px; height: 32px; font-size: 13px; font-weight: 500; } +.actionButtons a, .actionButtons li.primary a, .actionButtons a.primary, .actionButtons a.default { text-shadow: none; background: #fff; color: #555; border: 1px solid #e4e4e4; border-radius: 3px; /*box-shadow: 0 0 0 1px #E4E4E4;*/ box-shadow: none; transition: none; } +.actionButtons a:hover { background: #1377c5; box-shadow: none; border-color: #1377c5; color: #fff !important; transition: none; } +.actionButtons a:active { background-color: #3189ba; border-color: #3189ba; } +.actionButtons li.primary a, .actionButtons a.primary { color: #fff; border-color: #32ab9a; background: #32ab9a linear-gradient(#32ab9a, #00948e); } +.actionButtons li.primary a:hover, .actionButtons a.primary:hover { background: #2b9385 linear-gradient(#2b9385, #007571); border-color: #2b9385; } +.actionButtons li.primary a:active, .actionButtons a.primary:active { background: #32ab9a; border-color: #32ab9a; } +.actionButtons img { display: none; } +#treePane .actionButtons img { display: inline; } +.actionButtons--tableheader .fa { font-size: 14px; } +.sectionBody .actionButtons { padding-top: 0; min-height: 40px; } +.sectionBody .actionButtons li { margin-right: 10px; } +.sectionBody .actionButtons a { display: inline-block; padding: 9px 10px; line-height: 1; } +table.actionButtons { margin-top: 1rem; margin-bottom: 10px; } +table.actionButtons img { display: inline-block; } +table.actionButtons .searchtext { padding: 5px; height: 24px; width: 150px; } +.actionButtons .fa { display: none; text-align: center; font-size: 1em; line-height: 1em; width: 1.1em; vertical-align: initial } +.actionButtons .fa, .actionButtons--eit .fa { display: inline-block; } +.optionsTitle .fa { display: inline-block; } +@media (max-width: 900px) { +.actionButtons a { display: inline-block; padding: 6px 10px } +.tab-page .actionButtons a { margin-top: 0 !important } +.actionButtons a span { display: none; } +.actionButtons a .fa { display: inline-block; } } - +/* [ TABLES ] */ +/* table */ +.table th, .table td { padding: 0.15rem 0.25rem; } +/* table-data */ +.table.data { width: 100%; max-width: 100%; margin-bottom: 0; border-bottom: 1px solid #eceeef } +.table.data th, .table.data thead td { padding: 0.75rem; text-transform: uppercase; white-space: nowrap; font-size: 0.675rem; color: #777; border-bottom: 1px solid #eceeef } +.table.data td { padding: 0.55rem 0.75rem; } +.table.data td, .table.data th, .table.data thead td { vertical-align: top; border-top: 1px solid #eceeef } +.table.data td:first-child, .table.data th:first-child, .table.data.table-sm td:first-child, .table.data.table-sm th:first-child { padding-left: 1.25rem } +.table.data td:last-child, .table.data th:last-child, .table.data.table-sm td:last-child, .table.data.table-sm th:last-child { padding-right: 1.25rem } +.table.data thead { background-color: #fff; } +.table.data > tbody > tr { background-color: #f9f9f9; transition-duration: .5s } +.table.data > tbody > tr:nth-child(2n) { background-color: #fff } +.table.data > tbody > tr:hover { cursor: default; background-color: rgba(93, 109, 202, 0.16); transition-duration: .05s } +.table.data tr.unstyled:hover { background-color: inherit } +.table.data .actions { white-space: nowrap } +.table.data .actions a { color: #555 } +.table.data .actions a .fa, .table.data .actions span .fa { position: relative; margin: 0 0.375rem; font-size: 0.9rem; color: #555 } +.table.data .actions a:hover .fa { color: #000; } +.table.data .actions a:hover .fa.fa-trash { color: #d80030 } +.table.data .actions a .fa::before { position: relative; z-index: 2; } +.table.data .actions a .fa::after { content: ""; position: absolute; z-index: 1; left: 50%; top: 50%; width: 1.5rem; height: 1.5rem; margin: -0.75rem 0 0 -0.75rem; border-radius: 50%; -webkit-transition: 0.15s; transition: 0.15s; } +.table.data .actions a:hover .fa::after { background-color: #fff } +.table.data .actions .disabled { visibility: hidden } +/* table-data-nowrap */ +.table.data.nowrap th, .table.data.nowrap td { white-space: nowrap } +/* table-data-sortable */ +.table.data thead .sortable a, .table.data thead .sortable-text a { color: #777; text-decoration: none !important; } +.table.data thead .sortable a:hover, .table.data thead .sortable-text a:hover { color: #222 } +.table.data thead .sortable a::after, .table.data thead .sortable-text a::after { content: "\f107"; font-family: FontAwesome; opacity: .3; margin-left: .5em; } +.table.data thead .sortable.forwardSort a::after, .table.data thead .sortable-text.forwardSort a::after { opacity: 1; content: "\f106"; color: #d9534f } +.table.data thead .sortable.reverseSort a::after, .table.data thead .sortable-text.reverseSort a::after { opacity: 1; content: "\f107"; color: #d9534f } +.table.data thead .sortable:hover a::after, .table.data thead .sortable-text:hover a::after, .table.data thead .sortable-numeric:hover a::after, .table.data thead .sortable-date:hover a::after { opacity: 1 } +.table.data thead .sortable, .table.data thead .sortable-text, .table.data thead .sortable-numeric, .table.data thead .sortable-date { cursor: pointer } +.table.data thead .sortable-text span, .table.data thead .sortable-numeric span, .table.data thead .sortable-date span { display: none } +.table.data.table-sortable > tbody > tr { cursor: move; transition-duration: .5s } +.table.data.table-sortable > tbody > tr.ghost { background-color: rgba(93, 109, 202, 0.16); color: #d9534f !important; transition: background-color .5s, color .5s, transform 0s } +/* table-data-sm */ +.table.data.table-sm td, .table.data.table-sm th { padding: .25rem .5rem; } +.table.data.table-sm th, .table.data.table-sm thead td { font-size: 0.75rem; text-transform: none; } +/* table-data-even */ +.table.data.table-even > tbody > tr:not(:hover) { background-color: #fff } +.table.data.table-even > tbody > tr:nth-child(4n+1):not(:hover) { background-color: #f6f8f8 } +.table.data.table-even > tbody > tr:nth-child(2n) { background-color: #fff } +/* table-data-docs */ +.table.data .doc-item .fa { width: 1.2em; font-size: 0.9rem; text-align: center; margin-right: 0.25rem } +.table.data .doc-item { text-decoration: none } +.table.data .doc-item:hover span { text-decoration: underline } +.table.data .doc-item.private .fa::after { position: relative; float: left; margin: .5em -1em 0 0; content: "\f023"; font-size: 0.75em; color: #d9534f; } +/* [ BREADCRUMBS ] */ +ul.breadcrumbs { margin: 0 1rem .5rem; padding: 0 0 .5rem; line-height: normal; font-size: .675rem; color: #888; border-bottom: 1px dotted #cecaca; } +ul.breadcrumbs li { list-style: none; display: inline-block; padding: 0; margin: 0; } +ul.breadcrumbs a { text-decoration: none; } +ul.breadcrumbs span { display: inline-block; width: 1.25em; vertical-align: top; text-indent: -2.25em; overflow: hidden; } +ul.breadcrumbs span::after { margin-left: 2em; font-family: FontAwesome; content: "\f105" } +/* [ PAGINATION ] */ +#pagination { padding: 0 1.25rem; margin: .5rem 0 0; } +#pagination ul { margin: 0 0 0 .5rem; display: inline-block; } +#pagination li { list-style: none; display: inline-block; margin: 0 0 0 1px; } +#pagination li a { display: inline-block; padding: 0 .5rem; line-height: 1.7; border: 1px solid #ddd; text-decoration: none; color: #333; } +#pagination li.currentPage a, #pagination li a:hover { color: #555; border: 1px solid #555; } +/* [ SEARCHBAR ] */ +.searchbar input[type=text] { max-width: 10rem } +/* [ WIDGETS ] */ +.widgets .card { margin-bottom: 1rem; border-width: 0; border-radius: 0; background-color: #fff; -webkit-transition: box-shadow .35s; transition: box-shadow .35s; box-shadow: 0 0.1rem 0.3rem 0 rgba(0, 0, 0, 0.075);} +.widgets .card:hover { box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.07); } +.widgets .card-header { padding: .5rem 1rem; font-size: .9rem; color: #616a73; font-weight: 700; border-radius: 0; border: none; border-bottom: 1px solid rgba(0, 0, 0, .05); text-transform: none;background-color: transparent;border-bottom: 1px solid rgba(0, 0, 0, 0.05); } +.widgets .card-header .fa { font-size: .9rem } +.widgets .card-block { padding: 0; } +.widgets .card-block .card-block p { padding: 0 1rem } +.widgets .card-block .card-body { padding: 1rem; } +.widgets .card-block .card-body + .card-body { padding-top: 0 } +.widgets .table { margin-bottom: 0rem } +.widgets .table.data td, .widgets .table.data th, .widgets .table.data thead td {border-top: 0px;} +.widgets .table:not(.data) tr th, .widgets .table:not(.data) tr td { padding: .15rem; } +.widgets .table tr th:first-child, .widgets .table tr td:first-child { padding-left: 1rem !important } +.widgets .table tr th:last-child, .widgets .table tr td:last-child { padding-right: 1rem !important } +.widgets .table .actions a .fa { margin: 0 .05rem; } +/* widgets custom */ +.widgets #welcome .wm_buttons { display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; margin-bottom: 1rem; padding: 0; text-align: center; border-bottom: 1px solid rgba(0, 0, 0, .05); } +.widgets #welcome .wm_button { max-width: 16.666667%; flex: 0 0 16.666667%; } +.widgets #welcome .wm_button a { display: block; height: 100%; padding: 1rem 1rem .5rem; text-decoration: none; color: #646b7b; box-shadow: none; transition-duration: .5s } +.widgets #welcome .wm_button a:hover { color: #373b46; background-color: rgba(93, 109, 202, 0.16) } +.widgets #welcome .wm_button a .fa { display: inline-block; } +.widgets #welcome .wm_button a .fa + span { display: block; padding: .5em 0; line-height: 1em; font-size: .7rem; } +.widgets #modxrecent_widget .table.data tbody tr:not(:hover) { background-color: #fff } +.widgets #modxrecent_widget .table.data tbody tr:nth-child(4n+1):not(:hover) { background-color: #f6f8f8 } +.widgets #modxrecent_widget .table.data tbody tr:nth-child(2n) { background-color: #fff } @media (max-width: 1399px) { - .widgets #welcome .wm_button { - max-width: 20%; - flex: 0 0 20%; - } +.widgets #welcome .wm_button { max-width: 20%; flex: 0 0 20%; } } - @media (max-width: 1199px) { - .widgets #welcome .wm_button { - max-width: 25%; - flex: 0 0 25%; - } +.widgets #welcome .wm_button { max-width: 25%; flex: 0 0 25%; } } - @media (max-width: 991px) { - .widgets #welcome .wm_button { - max-width: 33.3333%; - flex: 0 0 33.3333%; - } +.widgets #welcome .wm_button { max-width: 33.3333%; flex: 0 0 33.3333%; } } - @media (max-width: 767px) { - .widgets #welcome .wm_button { - max-width: 50%; - flex: 0 0 50%; - } +.widgets #welcome .wm_button { max-width: 50%; flex: 0 0 50%; } } - /* [ DATEPICKER ] */ - -.dp_container { - position: absolute; - z-index: 500; -} - -.dp_cal { - overflow: hidden; - width: 220px; - margin: 0.25rem 0; - background-color: #fff; - -webkit-box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.3); - box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.3); -} - -.dp_cal p { - position: relative; - margin: 10px; -} - -.dp_cal select { - font-size: 1em; - margin: 2px 3px; - width: auto !important -} - -.dp_cal select option { - padding: 1px 3px -} - -.dp_cal table { - border-collapse: collapse; - border-spacing: 0; - width: 100% -} - -.dp_cal td.dp_roll { - background-color: rgba(0, 0, 0, 0.1); - color: #333 !important -} - -.dp_cal th, -.dp_cal td { - font-size: 1em; - padding: 0.5em 0 !important; - text-align: center !important; - width: 14.2857%; - cursor: default -} - -.dp_cal tbody th { - background-color: #656d79; - color: #fff; -} - -.dp_cal tbody td:nth-child(6), -.dp_cal tbody td:nth-child(7) { - color: indianred -} - -.dp_cal .dp_empty { - background-color: #f9f9f9 -} - -.dp_cal .dp_hide { - visibility: hidden -} - -.dp_cal .dp_today { - background-color: #4caf50; - color: #fff !important -} - -.dp_cal .dp_selected { - background-color: #3189ba; - color: #fff !important -} - -.dp_cal input { - width: 68% !important -} - -.dp_cal button { - position: absolute; - top: 0; - right: 0; - margin: 0 !important; - width: 30% !important -} - +.dp_container { position: absolute; z-index: 500; } +.dp_cal { overflow: hidden; width: 220px; margin: 0.25rem 0; background-color: #fff; -webkit-box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.3); box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.3); } +.dp_cal p { position: relative; margin: 10px; } +.dp_cal select { font-size: 1em; margin: 2px 3px; width: auto !important } +.dp_cal select option { padding: 1px 3px } +.dp_cal table { border-collapse: collapse; border-spacing: 0; width: 100% } +.dp_cal td.dp_roll { background-color: rgba(0, 0, 0, 0.1); color: #333 !important } +.dp_cal th, .dp_cal td { font-size: 1em; padding: 0.5em 0 !important; text-align: center !important; width: 14.2857%; cursor: default } +.dp_cal tbody th { background-color: #656d79; color: #fff; } +.dp_cal tbody td:nth-child(6), .dp_cal tbody td:nth-child(7) { color: indianred } +.dp_cal .dp_empty { background-color: #f9f9f9 } +.dp_cal .dp_hide { visibility: hidden } +.dp_cal .dp_today { background-color: #4caf50; color: #fff !important } +.dp_cal .dp_selected { background-color: #3189ba; color: #fff !important } +.dp_cal input { width: 68% !important } +.dp_cal button { position: absolute; top: 0; right: 0; margin: 0 !important; width: 30% !important } /* datepicker icon clear */ - -.clearDate { - position: relative; - margin: 0.5rem 0 0 -1.5rem; - z-index: 10; -} - +.clearDate { position: relative; margin: 0.5rem 0 0 -1.5rem; z-index: 10; } /* [ GRID STYLE ] */ - -.grid { - width: 100%; - background-color: #fff !important; - border: 1px solid rgba(0, 0, 0, 0.1); - border-collapse: collapse; -} - -.grid thead, -.grid tfoot { - background-color: #e9e9e9 -} - -.grid th, -.grid td { - padding: 0.375rem !important; - border: 1px solid #ddd -} - -.gridHeader, -.grid th { - color: #333; - font-weight: 500; - white-space: nowrap; - background-color: #e9e9e9; - text-align: left; -} - -.grid > tbody > tr:nth-child(2n) > td { - background-color: rgba(0, 0, 0, 0.03) -} - -.gridItem { - background-color: #fff; - padding: 3px; -} - -.gridAltItem { - background-color: #f7f7f7; - padding: 3px; -} - -.grid tbody tr:hover td { - background: #e9edf3; -} - -.grid a { - text-decoration: none; -} - -.grid img { - vertical-align: middle; - padding-right: 4px; -} - +.grid { width: 100%; background-color: #fff !important; border: 1px solid rgba(0, 0, 0, 0.1); border-collapse: collapse; } +.grid thead, .grid tfoot { background-color: #e9e9e9 } +.grid th, .grid td { padding: 0.375rem !important; border: 1px solid #ddd } +.gridHeader, .grid th { color: #333; font-weight: 500; white-space: nowrap; background-color: #e9e9e9; text-align: left; } +.grid > tbody > tr:nth-child(2n) > td { background-color: rgba(0, 0, 0, 0.03) } +.gridItem { background-color: #fff; padding: 3px; } +.gridAltItem { background-color: #f7f7f7; padding: 3px; } +.grid tbody tr:hover td { background: #e9edf3; } +.grid a { text-decoration: none; } +.grid img { vertical-align: middle; padding-right: 4px; } /* SORTABLELIST */ - -ul.sortableList { - margin: 0; -} - -ul.sortableList li { - position: relative; - z-index: 1; - float: left; - clear: both; - max-width: 100%; - width: 30rem; - list-style: none; - font-weight: bold; - cursor: move; - padding: 0.46153846em 1em; - margin: .0625rem 0; - border: 1px solid #ccc; - line-height: 1.23076923; - background-color: #fff; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - box-shadow: none; - transition: color .3s, box-shadow .3s, transform .3s, z-index .3s step-end; -} - -ul.sortableList li.ghost { - z-index: 2; - box-shadow: 0 0.25rem 1.5rem rgba(0, 0, 0, 0.15); - transition: color .3s, box-shadow .3s, transform 0s, z-index 0s; -} - +ul.sortableList { margin: 0; } +ul.sortableList li { position: relative; z-index: 1; float: left; clear: both; max-width: 100%; width: 30rem; list-style: none; font-weight: bold; cursor: move; padding: 0.46153846em 1em; margin: .0625rem 0; border: 1px solid #ccc; line-height: 1.23076923; background-color: #fff; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); box-shadow: none; transition: color .3s, box-shadow .3s, transform .3s, z-index .3s step-end; } +ul.sortableList li.ghost { z-index: 2; box-shadow: 0 0.25rem 1.5rem rgba(0, 0, 0, 0.15); transition: color .3s, box-shadow .3s, transform 0s, z-index 0s; } /* [ TOOLTIPS ] */ - -.evo-tooltip, -.custom-tip { - position: fixed; - z-index: 13000; - width: 13rem; - margin: 1rem; - padding: 0.9rem 1rem; - font-size: 0.75rem; - line-height: 1.5; - font-family: sans-serif; - text-align: left; - color: #333; - background-color: #fff; - visibility: hidden; - transition-duration: .3s; - transform: translate3d(1rem, 0, 0); - -webkit-box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.15); - box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.15); -} - -.evo-tooltip { - opacity: 0; - content: attr(data-tooltip); -} - -.evo-tooltip.show { - opacity: 1; - visibility: visible; - transform: translate3d(0, 0, 0); -} - -[data-tooltip] { - cursor: help -} - -[data-tooltip].fa-question-circle { - opacity: 0.15; -} - -[data-tooltip].fa-question-circle:hover { - opacity: 1; -} - +.evo-tooltip, .custom-tip { position: fixed; z-index: 13000; width: 13rem; margin: 1rem; padding: 0.9rem 1rem; font-size: 0.75rem; line-height: 1.5; font-family: sans-serif; text-align: left; color: #333; background-color: #fff; visibility: hidden; transition-duration: .3s; transform: translate3d(1rem, 0, 0); -webkit-box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.15); box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.15); } +.evo-tooltip { opacity: 0; content: attr(data-tooltip); } +.evo-tooltip.show { opacity: 1; visibility: visible; transform: translate3d(0, 0, 0); } +[data-tooltip] { cursor: help } +[data-tooltip].fa-question-circle { opacity: 0.15; } +[data-tooltip].fa-question-circle:hover { opacity: 1; } /* [ FILES MANAGER ] */ - -#ManageFiles { - padding-bottom: 1rem; -} - -#ManageFiles .breadcrumbs {} - -#ManageFiles .breadcrumbs a, -#ManageFiles .breadcrumbs span { - display: inline-block; - padding: 0 0.25em; -} - -#ManageFiles #imageviewer { - text-align: center; -} - -#ManageFiles #imageviewer img { - display: inline-block; - max-width: 100%; - margin-top: 1rem -} - -#FilesTable { - margin-bottom: 1rem; - border-bottom: 1px solid #ddd; -} - -#file_editfile.section .sectionHeader { - margin: 0; - padding: 0.5rem 1rem; - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - background-color: #f9f9f9 -} - -#file_editfile.section .sectionBody { - margin: 0 !important; - padding: 0 0 1rem; - border: none; - border-bottom: 1px solid #ddd; - background-color: #f9f9f9 -} - -#file_editfile td { - padding: 0 !important; -} - -#file_editfile #content { - float: left; - width: 100%; - min-height: 25rem; - border: none; - border-bottom: 1px solid rgba(0, 0, 0, .15) -} - +#ManageFiles { padding-bottom: 1rem; } +#ManageFiles .breadcrumbs { } +#ManageFiles .breadcrumbs a, #ManageFiles .breadcrumbs span { display: inline-block; padding: 0 0.25em; } +#ManageFiles #imageviewer { text-align: center; } +#ManageFiles #imageviewer img { display: inline-block; max-width: 100%; margin-top: 1rem } +#FilesTable { margin-bottom: 1rem; border-bottom: 1px solid #ddd; } +#file_editfile.section .sectionHeader { margin: 0; padding: 0.5rem 1rem; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; background-color: #f9f9f9 } +#file_editfile.section .sectionBody { margin: 0 !important; padding: 0 0 1rem; border: none; border-bottom: 1px solid #ddd; background-color: #f9f9f9 } +#file_editfile td { padding: 0 !important; } +#file_editfile #content { float: left; width: 100%; min-height: 25rem; border: none; border-bottom: 1px solid rgba(0, 0, 0, .15) } /* STYLES FOR PAGE HELP */ - -#helpPane h1 { - margin-bottom: 1em; - padding: .5rem; - font-size: .8rem; - border-bottom: 1px solid #e0e0e0; -} - -#helpPane li:not(:first-child) > strong { - margin-top: 1.4em; -} - -#helpPane li > strong { - display: block; - font-size: 14px; -} - -#helpPane pre { - border: 1px solid rgba(0, 0, 0, 0.1); - padding: 1em; -} - -/* [ DARK THEME ] */ - -.dark .section-editor textarea { - background-color: #282c34; - color: #abb2bf -} - -.dark .tab-page, -.dark .sectionBody .tab-page, -.dark .tab-row .tab.selected, -.dark .tab-row .tab.selected.hover, -.dark .tab-row .tab.selected:before, -.dark .tab-row .tab.selected span { - background-color: #f9f9f9; -} - -.dark, -.dark .resourceTable .panel-heading { - background: #ecf0f1 !important; -} - -.dark .resourceTable .panel-heading:hover { - background: #ecf0f1 !important; -} - -.dark .multitv .list li.element a.copy, -.multitv .list li.element a.remove { - background: transparent !important; -} - -.dark .multitv .list li.element { - background: #fefefe !important; -} - -.dark .split { - border-color: rgba(0, 0, 0, .05) -} - -.dark hr { - background: transparent; -} - +#helpPane h1 { margin-bottom: 1em; padding: .5rem; font-size: .8rem; border-bottom: 1px solid #e0e0e0; } +#helpPane li:not(:first-child) > strong { margin-top: 1.4em; } +#helpPane li > strong { display: block; font-size: 14px; } +#helpPane pre { border: 1px solid rgba(0, 0, 0, 0.1); padding: 1em; } +#helpPane #tab2Help img { margin-bottom: 1rem; } +/* modes theme */ +/* lightness */ +/* light */ +/* dark */ +.dark .section-editor textarea { background-color: #282c34; color: #abb2bf } +.dark .tab-page, .dark .sectionBody .tab-page, .dark .tab-row .tab.selected, .dark .tab-row .tab.selected.hover, .dark .tab-row .tab.selected:before, .dark .tab-row .tab.selected span { background-color: #f9f9f9; } +.dark, .dark .resourceTable .panel-heading { background: #ecf0f1 !important; } +.dark .resourceTable .panel-heading:hover { background: #ecf0f1 !important; } +.dark .multitv .list li.element a.copy, .multitv .list li.element a.remove { background: transparent !important; } +.dark .multitv .list li.element { background: #fefefe !important; } +.dark .split { border-color: rgba(0, 0, 0, .05) } +.dark hr { background: transparent; } /*.dark .content-blocks .block { background: #fefefe; border: 1px solid #e3e3e3; } .dark .content-blocks .block .fields-group { border: 1px dashed #e2e2e2; }*/ - -.dark .content-blocks input[type="text"], -.dark .content-blocks input[type="password"], -.dark .content-blocks input[type="number"], -.dark .content-blocks textarea { - background-color: #fbfbfb !important; - border-color: #dbdbdb !important; -} - -.dark .content-blocks .controls { - background: #f9f9f9 !important; -} - -.dark .widgets .card-header { - color: #616a73; - background-color: #fafafa; -} - +.dark .content-blocks input[type="text"], .dark .content-blocks input[type="password"], .dark .content-blocks input[type="number"], .dark .content-blocks textarea { background-color: #fbfbfb !important; border-color: #dbdbdb !important; } +.dark .content-blocks .controls { background: #f9f9f9 !important; } +.dark .widgets .card-header { color: #616a73; background-color: #fafafa; } +/* darkness */ +.darkness { background-color: #282c34; color: #aaa } +.darkness .container-body { background-color: #282c34; } +.darkness > .container-body, .darkness .page { background-color: #282c34; } +.darkness .sectionBody .tab-page, .darkness .tab-page { background-color: #282c34; box-shadow: none; } +.darkness .widgets .card, .darkness h1, .darkness .element-edit-message, .darkness #ManageFiles .breadcrumbs { background-color: #202329; } +.darkness #edit-info.element-edit-message, .darkness #add-info.element-edit-message, .darkness #sort-info.element-edit-message, .darkness #categorize-info.element-edit-message { background-color: #282c34; } +.darkness .msg-container { border-bottom: 1px solid #414449; } +.darkness .widgets #welcome .wm_button a { color: #aaa; } +.darkness .widgets #welcome .wm_button a:hover { background-color: rgba(255, 255, 255, 0.08); color: #e8e8e8; } +.darkness .widgets .card-header { color: #b0b0b1; border-bottom: 1px solid #2b2e34; } +.darkness #news .card-block ul li, .darkness #security .card-block ul li { border-bottom: 1px solid #2b2e34; } +.darkness #news .card-block ul li:last-child, .darkness #security .card-block ul li:last-child, .darkness table.table.table--edit > tbody > tr > td { border: none } +.darkness .multitv .list li.element { background: #282c34 !important; border-color: #414449; } +.darkness .multitv .list li.element input[type="text"], .darkness .multitv .list li.element input[type="password"], .darkness .multitv .list li.element input[type="number"], .darkness .multitv .list li.element textarea { background-color: #202329 !important; border-color: #414449 !important; } +.darkness #displayparams { width: calc(100% + 2.5rem); max-width: calc(100% + 2.5rem); margin: 0 -1.25rem !important; } +.darkness #content_body { margin: 0 -1.5rem; } +.darkness .card .table.data, .darkness .table td[style="background-color:#ffffff;"] { background: #202329 !important; } +.darkness .table.data, .darkness .grid { background: #282c34 !important; border: none !important } +.darkness .table.data thead, .darkness .grid thead, .darkness #editorRow_TinyMCE { background: none } +.darkness .table.data thead th, .darkness .table.data thead td, .darkness .grid th, .darkness .grid thead td { padding: 0.75rem !important; background-color: #202329; border: none; border-bottom: 1px solid #1f5994; color: #777; text-transform: uppercase; font-size: 0.675rem; } +.darkness .table.data thead .sortable a, .darkness .table.data thead .sortable-text a, .darkness .sortabletable th a { color: #777; } +.darkness .table th a:hover, .darkness .table thead td a:hover, .darkness .grid th a:hover, .darkness .grid thead td a:hover, .darkness .table .sortable:hover a, .darkness .table .sortable-text:hover a { color: #eee !important; } +.darkness .table.data thead .sortable a::after, .darkness .table.data thead .sortable-text a::after { opacity: 1; } +.darkness .sortabletable thead tr, .darkness .sortabletable th:active { background-color: #202329 } +.darkness .table tbody tr, .darkness .grid tbody tr, .darkness table.table.table--edit > tbody > tr { background: none !important; } +.darkness .table > tbody > tr > td, .darkness .grid > tbody > tr > td { background: none; border: none !important; border-bottom: 1px solid #2b2e34 !important; color: inherit; } +.darkness .table > tbody > tr:nth-child(2n), .darkness .grid > tbody > tr:nth-child(2n) { background-color: #252930 !important; } +.darkness .table.data tr > td:first-child, .darkness .table.data tr > th:first-child, .darkness .grid tr > td:first-child, .darkness .grid > tr > th:first-child { padding-left: 1.25rem !important; } +.darkness .table.data tr > td:last-child, .darkness .table.data tr > th:last-child, .darkness .grid tr > td:last-child, .darkness .grid > tr > th:last-child { padding-right: 1.25rem !important; } +.darkness table.table.table--edit > tbody > tr > th, .darkness table.table.table--edit > tbody > tr > td, .darkness form[name="settings"] table > tbody td, .darkness form[name="settings"] table > tbody th { padding: .25rem .5rem; background: none; border: none !important; color: inherit; } +.darkness .table.data .actions a, .darkness .table.data .actions a .fa, .darkness .table.data .actions span .fa { color: inherit; } +.darkness .table.data .actions a:hover .fa::before { color: #eee; } +.darkness .table.data .actions a:hover .fa::after { background-color: #3b414e; } +.darkness .table.data .actions a:hover .fa.fa-trash::before { color: #d80030; } +.darkness table .split, .darkness #editorRow_TinyMCE tr, .darkness table.table.table--edit > tbody > tr, .darkness .sysSettings > tbody > tr { border: none; border-bottom: 1px solid #23262b !important; } +.darkness table .split { margin: 0 -.5rem; } +.darkness table tr.noborder { border: none !important; } +.darkness table .comment { color: #999 !important; } +.darkness #editorRow_TinyMCE > tbody > tr:first-child > th { background: none !important; color: inherit !important; } +.darkness .section-editor, .darkness #content_body { border-top: 1px solid #414449; } +.darkness #file_editfile .navbar-editor, .darkness #file_editfile [name="editFile"], .darkness #content_body, .darkness .section-editor { border-bottom: 1px solid #414449; } +.darkness .section-editor > textarea, .darkness #content_body > div > textarea, .darkness #content_body > .section-editor { margin-top: 0 } +.darkness #content_body textarea, .darkness .section-editor textarea, .darkness #content_body > .section-editor { display: block; border: none } +.darkness ul.sortableList li { background-color: #202329; border: 1px solid #414449; } +.darkness ul.sortableList li:hover { border-color: #5d5d5d; } +.darkness ul.sortableList li.ghost { background-color: #282c34; border-color: #1976d2; } +.darkness .disabledPlugin, .darkness .disabledPlugin a { color: #de6961; } +.darkness .alert { box-shadow: 0 0.25rem 2rem rgba(0, 0, 0, 0.15); } +.darkness .alert-danger { background-color: #612329; border-color: #612329; color: #da706d; } +.darkness .alert-danger b { color: #f7e6e8 !important } +.darkness .alert-info { background-color: #193048; border-color: #193048; color: #a3b3bd; } +.darkness .alert-warning { background-color: #6c591d; border-color: #6c591d; color: #c7bd9e; } +.darkness .alert-success { background-color: #3d7544; border-color: #3d7544; color: #c4efc5; } +.darkness .loginbox, .darkness .loginbox form { background-color: #202329 } +.darkness .loginbox .logo img { content: url("../images/misc/logo-navbar-white.png"); } +.darkness #mainloader { background-color: transparent !important; } +.darkness #FilesTable { border-bottom: 1px solid #202329 } +.darkness #mce-modal-block { background-color: #000; } +.darkness .resourceTable .panel-heading { margin-top: -1px !important; background-color: #202329; border-top: 1px solid #414449; border-bottom: 1px solid #414449; } +.darkness .panel-title > a { color: #aaa; } +.darkness .panel-title > a:hover { background: #202329; color: #eee; } +.darkness .resourceTable ul.elements > li { border-left: 3px solid transparent; border-bottom: 1px solid #303338; } +.darkness .resourceTable ul.elements > li:hover { background-color: #202329;} +.darkness .elements_descr { color: #aaa; } +.darkness ul.elements_buttonbar li a { color: inherit; } +.darkness .msg-container { color: inherit } +.darkness .evo-tooltip, .darkness .custom-tip { background-color: #343942; color: #eee; box-shadow: 0 0.5rem 3rem rgba(0, 0, 0, 0.4); } +.darkness div#section-body-categories div.uncategorized_elements, .darkness div#section-body-categories div.drop { border: 1px solid #414449; background-color: #202329; } +.darkness div#section-body-categories div.uncategorized_elements h2, .darkness div#section-body-categories div.drop h2 { color: #1976d2; border-bottom: 1px solid #1976d2; } +.darkness div#section-body-categories div.drag { background-color: #1976d2; } +.darkness #helpPane h1 { border-bottom: 1px solid #414449; } +.darkness #helpPane ul + h1 { margin-top: 1rem; } +.darkness #helpPane ul { margin: 0; } +.darkness #helpPane #tab2Help img { content: url("../images/misc/logo-navbar-white.png"); } +.darkness #helpPane pre { border: 1px solid #414449; padding: 1em; color: #aaa; } +.darkness code { background-color: #202329; border: 1px solid #414449; } +.darkness .h, .darkness .e, .darkness .v { background-color: #202329; border-color: #414449; color: #eee; } +.darkness .v { background-color: #282c34; } +.darkness tr:hover .e { background-color: #282c33; } +.darkness tr:hover .v { background-color: #2b3038; } +.darkness .dp_cal { box-shadow: 0 0.5rem 3rem rgba(0, 0, 0, 0.4); } +.darkness .dp_cal, .darkness .dp_cal .dp_empty { background-color: #343942; } +.darkness .dp_cal td.dp_roll { background-color: #202329; color: #aaa !important; } +.darkness .dp_cal td.dp_selected { background-color: #3189ba; color: #fff !important; } +.darkness ul.breadcrumbs a { color: #3481bc; } +.darkness h2[style="color:#003399"], .darkness h3[style="color:#003399"] { color: #f44336 !important; } +.darkness h3[style="color:#003399"] + div[style] { background-color: transparent !important; border-color: #f44336 !important; color: #f44336 !important; } +.darkness .mce-container, .darkness .mce-container *, .darkness .mce-widget, .darkness .mce-widget *, .darkness .mce-reset { color: #aaa; } +.darkness .mce-panel { background: #202329; border: none !important; } +.darkness .mce-reset .mce-panel { background: #1a1c21; } +.darkness .mce-btn { background-color: #202329; border-color: transparent; } +.darkness .mce-toolbar .mce-btn-group { border-color: #414449 !important; } +.darkness .mce-label { text-shadow: none; } +.darkness .mce-menu-item.mce-selected, .darkness .mce-menu-item:hover, .darkness .mce-menu-item:focus { background: #1976d2; } +.darkness .mce-menu-item.mce-selected .mce-text, .darkness .mce-menu-item.mce-selected .mce-ico, .darkness .mce-menu-item:hover .mce-text, .darkness .mce-menu-item:focus .mce-text, .darkness .mce-menu-item:hover .mce-ico, .darkness .mce-menu-item:focus .mce-ico { color: #fff; } +.darkness .mce-menu-item .mce-caret { border-left-color: #fff; } +.darkness .mce-tabs, .darkness .mce-tabs + .mce-container-body { background: #202329;} +.darkness .mce-tab { background: #202329; border-color: #414449; border-top: 1px solid transparent; text-shadow: none !important } +.darkness .mce-tab:hover { background-color: #1a1c21; } +.darkness .mce-tab:focus { color: #eee; } +.darkness .mce-tab.mce-active { border-top-color: #414449; } +.darkness .mce-tabs { border-bottom: 1px solid #414449; } +.darkness .mce-tab.mce-active { background-color: #202329; } +.darkness .mce-menu-item.mce-disabled, .darkness .mce-menu-item.mce-disabled:hover { background: #202329; } +.darkness .mce-menu-item.mce-disabled .mce-text, .darkness .mce-menu-item.mce-disabled:hover .mce-text, .darkness .mce-menu-item.mce-disabled .mce-ico, .darkness .mce-menu-item.mce-disabled:hover .mce-ico { color: #414449; } +.darkness .mce-window-head .mce-close { background-color: #6d1215 !important; } +.darkness .mce-window-head { background: #1a1c21; border: none; } +.darkness i.mce-i-checkbox, .darkness .mce-textbox, .darkness .mce-window-body .mce-btn, .darkness .mce-foot .mce-btn { background-color: #1a1c21; border: 1px solid #414449; } +.darkness .mce-btn:hover, .darkness .mce-btn:active { background: #282c34; border-color: #414449; } +.darkness .mce-btn:focus { background: #282c34; } +.darkness .mce-btn button { background-color: transparent } +.darkness .mce-splitbtn .mce-open:hover, .darkness .mce-splitbtn .mce-open:active, .darkness .mce-splitbtn:hover .mce-open, .darkness .mce-splitbtn.mce-active:hover .mce-open { border-left: 1px solid #3d4045; } +.darkness .mce-checked i.mce-i-checkbox { color: #aaa; } +.darkness .mce-textbox { font-family: monospace; } +.darkness::-webkit-scrollbar, .darkness::-webkit-scrollbar-thumb , .darkness *::-webkit-scrollbar, .darkness *::-webkit-scrollbar-thumb { width: 1rem; height: 1rem; background-color: transparent; border-radius: .5rem; border: .25rem solid transparent; } +.darkness:hover::-webkit-scrollbar-thumb, .darkness *:hover::-webkit-scrollbar-thumb { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); } +.darkness::-webkit-scrollbar-thumb:hover, .darkness *::-webkit-scrollbar-thumb:hover { box-shadow: inset 0 0 0 1rem rgba(255, 255, 255, 0.15); } +.darkness::-webkit-resizer, .darkness *::-webkit-resizer, .darkness::-webkit-scrollbar-corner, .darkness *::-webkit-scrollbar-corner { background-color: transparent; } /* [ OTHERS COMPONENTS ] - this components need fix css */ - /* extras */ - -.catalog_item select[name=link] { - width: auto !important; - margin-left: 0.5rem -} - +.catalog_item select[name=link] { width: auto !important; margin-left: 0.5rem } /* ManagerManager */ - -.sectionHeader.minimizable { - position: relative; - z-index: 1; - background-color: #fafafa; - padding: 0.5rem; - border: 1px solid rgba(0, 0, 0, 0.15); -} - -.dark .sectionHeader.minimizable { - background-color: #f2f2f2 -} - -.imageField { - min-width: 100% !important; - width: 100% !important -} - -ul.mmTagList { - float: left; - margin-top: .25rem !important -} - +.sectionHeader.minimizable { position: relative; z-index: 1; background-color: #fafafa; padding: 0.5rem; border: 1px solid rgba(0, 0, 0, 0.15); } +.dark .sectionHeader.minimizable { background-color: #f2f2f2 } +.imageField { min-width: 100% !important; width: 100% !important } +ul.mmTagList { float: left; margin-top: .25rem !important } /* MCE */ - -.mce-container, -.mce-container-body { - box-sizing: border-box !important -} - -.mce-container button { - border: none; - border-radius: 0; - background-color: transparent; -} - -.mce-window-head .mce-close { - padding: 0; -} - -#editorRow_TinyMCE { - background-color: #fff; -} - -#editorRow_TinyMCE tr { - border: 1px dotted rgba(0, 0, 0, .05); -} - -#editorRow_TinyMCE th { - white-space: nowrap -} - -#editorRow_TinyMCE th, -#editorRow_TinyMCE td { - padding: 0.5em; - border: none !important -} - +.mce-container, .mce-container-body { box-sizing: border-box !important } +.mce-container button { border: none; border-radius: 0; background-color: transparent; } +.mce-window-head .mce-close { padding: 0; } +#editorRow_TinyMCE { background-color: #fff; } +#editorRow_TinyMCE tr { border: 1px dotted rgba(0, 0, 0, .05); } +#editorRow_TinyMCE th { white-space: nowrap } +#editorRow_TinyMCE th, #editorRow_TinyMCE td { padding: 0.5em; border: none !important } /* wrap TinyMCE3 toolbar */ - -.mceEditor .mceToolbar td { - height: 24px; - float: left -} - +.mceEditor .mceToolbar td { height: 24px; float: left } /* codeMirror */ - -.CodeMirror { - width: 100%; - margin: 0 !important; -} - -.CodeMirror pre { - word-break: break-all !important; -} - -.CodeMirror > div:first-child > textarea { - /*opacity: 0;*/ - z-index: -1; - left: -9999rem; -} - -div.CodeMirror-cursors { - pointer-events: none; -} - +.CodeMirror { width: 100%; margin: 0 !important; } +.CodeMirror pre { word-break: break-all !important; } +.CodeMirror > div:first-child > textarea { /*opacity: 0;*/ z-index: -1; left: -9999rem; } +div.CodeMirror-cursors { pointer-events: none; } /* docFinder */ - -form#docfinder div.tab-page { - height: auto !important -} - +form#docfinder div.tab-page { height: auto !important } /* SimpleGallery */ - -#SimpleGallery .pagination { - display: block -} - -#SimpleGallery .sg_image { - width: auto -} - +#SimpleGallery .pagination { display: block } +#SimpleGallery .sg_image { width: auto } /* multiTV */ - -.multitv .list li.element a.copy, -.multitv .list li.element a.remove { - width: 25px !important; - text-align: center; - background: transparent !important; - top: -10px !important; -} - -.multitv .list li.element { - border-radius: .25rem; - border: 1px solid rgba(0, 0, 0, .125); - background: #fefefe !important; - margin-bottom: 10px !important; -} - +.multitv .list li.element a.copy, .multitv .list li.element a.remove { width: 25px !important; text-align: center; background: transparent !important; top: -10px !important; } +.multitv .list li.element { border-radius: .25rem; border: 1px solid rgba(0, 0, 0, .125); background: #fefefe !important; margin-bottom: 10px !important; } /* loginbox animation */ - @keyframes anim-loginbox { - from { - opacity: 0; - transform: translateY(30px); - } - to { - opacity: 1; - transform: translateY(0); - } +from { opacity: 0; transform: translateY(30px); } +to { opacity: 1; transform: translateY(0); } } - @-webkit-keyframes anim-loginbox { - from { - opacity: 0; - transform: translateY(30px); - } - to { - opacity: 1; - transform: translateY(0); - } +from { opacity: 0; transform: translateY(30px); } +to { opacity: 1; transform: translateY(0); } } - -.loginbox { - -webkit-animation-name: anim-loginbox; - -webkit-animation-duration: .5s; - -webkit-animation-iteration-count: 1; - -webkit-animation-timing-function: ease; - -webkit-animation-fill-mode: forwards; - -moz-animation-name: anim-loginbox; - -moz-animation-duration: .5s; - -moz-animation-iteration-count: 1; - -moz-animation-timing-function: ease; - -moz-animation-fill-mode: forwards; - animation-name: anim-loginbox; - animation-duration: .5s; - animation-iteration-count: 1; - animation-timing-function: ease; - animation-fill-mode: forwards; -} - +.loginbox { -webkit-animation-name: anim-loginbox; -webkit-animation-duration: .5s; -webkit-animation-iteration-count: 1; -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: forwards; -moz-animation-name: anim-loginbox; -moz-animation-duration: .5s; -moz-animation-iteration-count: 1; -moz-animation-timing-function: ease; -moz-animation-fill-mode: forwards; animation-name: anim-loginbox; animation-duration: .5s; animation-iteration-count: 1; animation-timing-function: ease; animation-fill-mode: forwards; } /* end loginbox animation */ /* pmfx theme */ - -#actions .dropdown-toggle:after { - display: none !important; -} - -.card .table.data { - margin-bottom: 0; - border-bottom-width: 0; -} - -.table.data th, -.table.data thead td { - border-bottom-width: 1px; -} - -.card .table.data > thead > tr:first-child td, -.card .table.data > thead > tr:first-child th, -.card .table.data > tbody > tr:first-child td, -.card .table.data > tbody > tr:first-child th { - border-top-width: 0; -} - +#actions .dropdown-toggle:after { display: none !important; } +/* .table.data > tbody > tr, .table.data > tbody > tr:nth-child(2n), .widgets #modxrecent_widget .table.data tbody tr:nth-child(4n+1):not(:hover) { background-color: #fff; -} - -.table.data > tbody > tr:hover { - background-color: rgba(0, 0, 0, 0.03) !important; -} - -ul.breadcrumbs { - margin: 0 0 1rem 0; - padding: .5rem 0.8rem; - line-height: normal; - font-size: .675rem; - color: #888; - border-width: 0; - background-image: linear-gradient(to right, rgba(0, 0, 0, 0.04), transparent 60%); -} - -ul.breadcrumbs a { - color: #333; -} - -#settingsPane [name="site_name"], -#settingsPane [name="emailsender"], -#settingsPane [name="emailsubject"], -#settingsPane [name="datepicker_offset"], -#settingsPane [name="editor_css_path"], -#settingsPane [name="safe_functions_at_eval"], -#settingsPane [name="valid_hostnames"], -#settingsPane [name="upload_files"], -#settingsPane [name="upload_images"], -#settingsPane [name="upload_media"], -#settingsPane [name="upload_flash"], -#settingsPane [name="txt_custom_contenttype"], -#settingsPane [name="filemanager_path"], -#settingsPane [name="rb_base_url"], -#settingsPane [name="rb_base_dir"], -#settingsPane [name="thumbsDir"], -input[name="photo"], -#range input#pids, -input[maxlength="350"], -textarea.mce, -#editorRow_TinyMCE { - width: 100% !important; -} - -#news .card-block > div, -#security .card-block > div { - padding: 0 !important; -} - -#news .card-block ul, -#security .card-block ul { - padding: 0; - margin: 0; -} - -#news .card-block ul li, -#security .card-block ul li { - padding: 0.75rem 1rem; - border-bottom: 1px solid #ebebeb; -} - -ul.mmTagList li { - padding: 2px 8px !important; - margin-bottom: 5px !important; - border-radius: 3px !important; - -webkit-border-radius: 3px !important; - background-color: #eaeaea !important; - text-decoration: none !important; -} - -ul.mmTagList li.tagSelected { - border-radius: 3px !important; - -webkit-border-radius: 3px !important; - background-color: #5A5E63 !important; -} +}*/ +ul.breadcrumbs { margin: 0 0 1rem 0; padding: .5rem 0.8rem; +line-height: normal; font-size: .675rem; +color: #888; border-width: 0; background-image: linear-gradient(to right, rgba(0, 0, 0, 0.04), transparent 60%); } +ul.breadcrumbs a { color: #333; } +#settingsPane [name="site_name"], #settingsPane [name="emailsender"], #settingsPane [name="emailsubject"], #settingsPane [name="datepicker_offset"], #settingsPane [name="editor_css_path"], #settingsPane [name="safe_functions_at_eval"], #settingsPane [name="valid_hostnames"], #settingsPane [name="upload_files"], #settingsPane [name="upload_images"], #settingsPane [name="upload_media"], #settingsPane [name="upload_flash"], #settingsPane [name="txt_custom_contenttype"], #settingsPane [name="filemanager_path"], #settingsPane [name="rb_base_url"], #settingsPane [name="rb_base_dir"], #settingsPane [name="thumbsDir"], input[name="photo"], #range input#pids, input[maxlength="350"], textarea.mce, #editorRow_TinyMCE { width: 100% !important; } +#news .card-block > div, #security .card-block > div { padding: 0 !important; } +#news .card-block ul, #security .card-block ul { padding: 0; margin: 0; } +#news .card-block ul li, #security .card-block ul li { padding: 0.75rem 1rem; border-bottom: 1px solid #ebebeb; } +ul.mmTagList li { padding: 2px 8px !important; border-radius: 3px !important; -webkit-border-radius: 3px !important; background-color: #eaeaea !important; text-decoration: none !important; } +ul.mmTagList li.tagSelected { border-radius: 3px !important; -webkit-border-radius: 3px !important; background-color: #5a5e63 !important; } \ No newline at end of file diff --git a/manager/media/style/default/css/fonts.css b/manager/media/style/default/css/fonts.css index c065e96b0f..e4287d419c 100755 --- a/manager/media/style/default/css/fonts.css +++ b/manager/media/style/default/css/fonts.css @@ -1,484 +1,108 @@ -html { - font-size: 16px -} - +html { font-size: 16px } @media (max-width: 900px) { - html { - font-size: 16px; - } +html { font-size: 16px; } } - @media (max-width: 400px) { - html { - font-size: 16px; - } -} - -body { - font-weight: normal; - font-style: normal; - font-size: 0.8125rem; - line-height: 1.5; - font-family: sans-serif; - -webkit-font-smoothing: subpixel-antialiased +html { font-size: 16px; } } - +body { font-weight: normal; font-style: normal; font-size: 0.8125rem; line-height: 1.5; font-family: sans-serif; -webkit-font-smoothing: subpixel-antialiased } /* For Arabic Font */ - -html[lang="ar"] body, -html[lang="ary"] body, -html[lang="azb"] body, -html[lang="fa-IR"] body, -html[lang="haz"] body, -html[lang="ps"] body, -html[lang="ur"] body { - font-family: Tahoma, Arial, sans-serif; -} - +html[lang="ar"] body, html[lang="ary"] body, html[lang="azb"] body, html[lang="fa-IR"] body, html[lang="haz"] body, html[lang="ps"] body, html[lang="ur"] body { font-family: Tahoma, Arial, sans-serif; } /* For Chinese Font */ - -html[lang="zh"] body { - font-family: "PingFang SC", "Microsoft JhengHei", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", Helvetica, sans-serif; -} - +html[lang="zh"] body { font-family: "PingFang SC", "Microsoft JhengHei", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", Helvetica, sans-serif; } /* For Devanagari Font */ - -html[lang="bn-BD"] body, -html[lang="hi-IN"] body, -html[lang="mr-IN"] body { - font-family: Arial, sans-serif; -} - +html[lang="bn-BD"] body, html[lang="hi-IN"] body, html[lang="mr-IN"] body { font-family: Arial, sans-serif; } /* For Greek Font */ - -html[lang="el"] body { - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -} - +html[lang="el"] body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } /* For Gujarati Font */ - -html[lang="gu-IN"] body { - font-family: Arial, sans-serif; -} - +html[lang="gu-IN"] body { font-family: Arial, sans-serif; } /* For Hebrew Font */ - -html[lang="he"] body { - font-family: "Arial Hebrew", Arial, sans-serif; -} - +html[lang="he"] body { font-family: "Arial Hebrew", Arial, sans-serif; } /* For Japanese Font */ - -html[lang="ja"] body { - font-family: Meiryo, "Hiragino Kaku Gothic Pro", sans-serif; -} - +html[lang="ja"] body { font-family: Meiryo, "Hiragino Kaku Gothic Pro", sans-serif; } /* For Korean font */ - -html[lang="ko-KR"] body { - font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Nanum Gothic", Dotum, sans-serif; -} - +html[lang="ko-KR"] body { font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Nanum Gothic", Dotum, sans-serif; } /* For Thai Font */ - -html[lang="th"] body { - font-family: "Sukhumvit Set", "Helvetica Neue", Helvetica, Arial, sans-serif; -} - +html[lang="th"] body { font-family: "Sukhumvit Set", "Helvetica Neue", Helvetica, Arial, sans-serif; } /* For Arabic Font */ - -html[lang="fa"] body { - font-family: Tahoma, Arial, sans-serif; -} - -body { - background-color: #fafafa; - color: #444; -} - -body.drag *, -body.drag::after { - cursor: grabbing !important; - cursor: -moz-grabbing !important; - cursor: -webkit-grabbing !important; - cursor: -moz-grab !important; - -moz-user-select: none !important; - -webkit-user-select: none !important; - user-select: none !important -} - -body.drag::after { - bottom: 0; - content: ""; - left: 0; - position: fixed; - right: 0; - top: 0; - z-index: 999 -} - -body, -ul, -li { - padding: 0; - margin: 0; -} - -ul { - margin-left: 1rem; - margin-right: 1rem; -} - -li { - list-style: none -} - -img { - max-width: 100%; - height: auto -} - -.h1, -.h2, -.h3, -.h4, -.h5, -.h6, -h1, -h2, -h3, -h4, -h5, -h6 { - margin-bottom: .5rem; - font-family: inherit; - font-weight: 500; - line-height: 1.1; - color: inherit -} - -.h1, -h1 { - font-size: 1.75rem -} - -.h2, -h2 { - font-size: 1.5rem -} - -.h3, -h3 { - font-size: 1.25rem -} - -.h4, -h4 { - font-size: 1rem -} - -.h5, -h5 { - font-size: 0.8125rem -} - -.h6, -h6 { - font-size: 0.7rem -} - -h1 .fa { - display: none; -} - -a { - color: #3481bc; - text-decoration: none -} - -.text-primary { - color: #3481bc !important; -} - -a:focus, -a:hover { - color: #014c8c; - text-decoration: underline -} - -a[href=""], -a:not([href]) { - cursor: default -} - -a:not([href]):not([tabindex]) { - color: inherit; - text-decoration: none -} - -a:not([href]):not([tabindex]):focus, -a:not([href]):not([tabindex]):hover { - color: inherit; - text-decoration: none -} - -a:not([href]):not([tabindex]):focus { - outline: 0 -} - -* { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box -} - -*::-ms-clear { - display: none; -} - -.text-justify { - text-align: justify !important -} - -.text-nowrap { - white-space: nowrap !important -} - -.text-truncate { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap -} - -.text-left { - text-align: left !important -} - -.text-right { - text-align: right !important -} - -.text-center { - text-align: center !important -} - -.text-lowercase { - text-transform: lowercase !important -} - -.text-uppercase { - text-transform: uppercase !important -} - -.text-capitalize { - text-transform: capitalize !important -} - -.font-weight-normal { - font-weight: 400 -} - -.font-weight-bold { - font-weight: 700 -} - -.font-italic { - font-style: italic -} - -.text-white { - color: #fff !important -} - -.text-muted { - color: #818a91 !important -} - -.text-decoration-through { - text-decoration: line-through !important -} - -.text-underline { - text-decoration: underline !important -} - -a.text-underline:hover { - text-decoration: none !important -} - -a.text-muted:focus, -a.text-muted:hover { - color: #4b5257 !important -} - -.text-primary { - color: #0275d8 !important -} - -a.text-primary:focus, -a.text-primary:hover { - color: #025aa5 !important -} - -.text-success { - color: #5cb85c !important -} - -a.text-success:focus, -a.text-success:hover { - color: #449d44 !important -} - -.text-info { - color: #5bc0de !important -} - -a.text-info:focus, -a.text-info:hover { - color: #31b0d5 !important -} - -.text-warning { - color: #f0ad4e !important -} - -a.text-warning:focus, -a.text-warning:hover { - color: #ec971f !important -} - -.text-danger { - color: #d9534f !important -} - -a.text-danger:focus, -a.text-danger:hover { - color: #c9302c !important -} - -.text-gray-dark { - color: #292b2c !important -} - -a.text-gray-dark:focus, -a.text-gray-dark:hover { - color: #101112 !important -} - -.text-hide { - font: 0/0 a; - color: transparent; - text-shadow: none; - background-color: transparent; - border: 0 -} - -.hide { - display: none !important -} - -.show { - display: block !important -} - -.visible { - visibility: visible !important; -} - -.invisible { - visibility: hidden !important; -} - -.clear { - clear: both; -} - +html[lang="fa"] body { font-family: Tahoma, Arial, sans-serif; } +body { background-color: #fafafa; color: #444; } +body.drag *, body.drag::after { cursor: grabbing !important; cursor: -moz-grabbing !important; cursor: -webkit-grabbing !important; cursor: -moz-grab !important; -moz-user-select: none !important; -webkit-user-select: none !important; user-select: none !important } +body.drag::after { bottom: 0; content: ""; left: 0; position: fixed; right: 0; top: 0; z-index: 999 } +body, ul, li { padding: 0; margin: 0; } +ul { margin-left: 1rem; margin-right: 1rem; } +li { list-style: none } +img { max-width: 100%; height: auto } +.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 { margin-bottom: .5rem; font-family: inherit; font-weight: 500; line-height: 1.1; color: inherit } +.h1, h1 { font-size: 1.75rem } +.h2, h2 { font-size: 1.5rem } +.h3, h3 { font-size: 1.25rem } +.h4, h4 { font-size: 1rem } +.h5, h5 { font-size: 0.8125rem } +.h6, h6 { font-size: 0.7rem } +h1 .fa:first-child {display: none;} +a { color: #3481bc; text-decoration: none } +.text-primary {color: #3481bc !important;} +a:focus, a:hover { color: #014c8c; text-decoration: underline } +a[href=""], a:not([href]) { cursor: default } +a:not([href]):not([tabindex]) { color: inherit; text-decoration: none } +a:not([href]):not([tabindex]):focus, a:not([href]):not([tabindex]):hover { color: inherit; text-decoration: none } +a:not([href]):not([tabindex]):focus { outline: 0 } +* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box } +*::-ms-clear { display: none; } +.text-justify { text-align: justify !important } +.text-nowrap { white-space: nowrap !important } +.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap } +.text-left { text-align: left !important } +.text-right { text-align: right !important } +.text-center { text-align: center !important } +.text-lowercase { text-transform: lowercase !important } +.text-uppercase { text-transform: uppercase !important } +.text-capitalize { text-transform: capitalize !important } +.font-weight-normal { font-weight: 400 } +.font-weight-bold { font-weight: 700 } +.font-italic { font-style: italic } +.text-white { color: #fff !important } +.text-muted { color: #818a91 !important } +.text-decoration-through { text-decoration: line-through !important } +.text-underline { text-decoration: underline !important } +a.text-underline:hover { text-decoration: none !important } +a.text-muted:focus, a.text-muted:hover { color: #4b5257 !important } +.text-primary { color: #0275d8 !important } +a.text-primary:focus, a.text-primary:hover { color: #025aa5 !important } +.text-success { color: #5cb85c !important } +a.text-success:focus, a.text-success:hover { color: #449d44 !important } +.text-info { color: #5bc0de !important } +a.text-info:focus, a.text-info:hover { color: #31b0d5 !important } +.text-warning { color: #f0ad4e !important } +a.text-warning:focus, a.text-warning:hover { color: #ec971f !important } +.text-danger { color: #d9534f !important } +a.text-danger:focus, a.text-danger:hover { color: #c9302c !important } +.text-gray-dark { color: #292b2c !important } +a.text-gray-dark:focus, a.text-gray-dark:hover { color: #101112 !important } +.text-hide { font: 0/0 a; color: transparent; text-shadow: none; background-color: transparent; border: 0 } +.hide { display: none !important } +.show { display: block !important } +.visible { visibility: visible !important; } +.invisible { visibility: hidden !important; } +.clear { clear: both; } /* custom */ - -#loadingmask { - display: none !important; -} - -.fa > .fa-lock { - position: relative; - float: left; - width: auto !important; - margin-top: -1em; - font-size: 0.7em !important; - color: #FFC107 !important; - -webkit-text-stroke: 1px rgba(0, 0, 0, 0.39); - text-stroke: 1px rgba(0, 0, 0, 0.39); -} - -.rotate180 { - -webkit-transform: rotate(180deg); - -moz-transform: rotate(180deg); - -ms-transform: rotate(180deg); - -o-transform: rotate(180deg); - transform: rotate(180deg); -} - -.disabledPlugin, -.disabledPlugin a { - color: #B68282; - font-style: italic; -} - -h1 { - font-size: 1.5em; - line-height: 1.5rem; - padding: 0.8rem; - margin: 0; -} - -h1 .fa { - margin-right: 0.25em; - color: #1377c5; -} - -h1 .help { - margin: 0 0 0 0.25em; - color: rgba(0, 0, 0, 0.15); - font-size: 0.8em; - cursor: pointer -} - -h1 .help:hover { - color: rgba(0, 0, 0, 0.3); -} - -h1 small { - margin-left: 0.5em; - line-height: 1em -} - -.split { - height: 0; - font-size: 0; - clear: both; - padding: 0; - border-top: 1px dotted rgba(0, 0, 0, .1) -} - -#previewIframe { - width: 100%; - height: 400px; -} - -.messageRead { - color: #333; -} - -.messageUnread { - color: #3CB371; - font-weight: 500; -} - -.element-edit-message { - display: none -} - -.element-edit-message p:last-child, -.element-edit-message-tab p:last-child { - margin-bottom: 0 -} +#loadingmask { display: none !important; } +.fa > .fa-lock { position: relative; float: left; width: auto !important; margin-top: -1em; font-size: 0.7em !important; color: #ffc107 !important; -webkit-text-stroke: 1px rgba(0, 0, 0, 0.39); text-stroke: 1px rgba(0, 0, 0, 0.39); } +.rotate180 { -webkit-transform: rotate(180deg); -moz-transform: rotate(180deg); -ms-transform: rotate(180deg); -o-transform: rotate(180deg); transform: rotate(180deg); } +.disabledPlugin, .disabledPlugin a { color: #b68282; font-style: italic; } +h1 { font-size: 1.5em; line-height: 1.5rem; padding: 0.8rem; margin: 0; } +h1 .fa { margin-right: 0.25em; color: #1377c5; } +h1 .help { margin: 0 0 0 0.25em; color: rgba(0, 0, 0, 0.15); font-size: 0.8em; cursor: pointer } +h1 .help:hover { color: rgba(0, 0, 0, 0.3); } +h1 small { margin-left: 0.5em; line-height: 1em } +.split { height: 0; font-size: 0; clear: both; padding: 0; border-top: 1px dotted rgba(0, 0, 0, .1) } +#previewIframe { width: 100%; height: 400px; } +.messageRead { color: #333; } +.messageUnread { color: #3cb371; font-weight: 500; } +.element-edit-message { display: none } +.element-edit-message p:last-child, .element-edit-message-tab p:last-child { margin-bottom: 0 } +/* modes theme */ +/* darkness */ +.darkness h1 .help { color: #1976d2; opacity: .5; } +.darkness h1 .help:hover { opacity: 1; } diff --git a/manager/media/style/default/css/forms.css b/manager/media/style/default/css/forms.css index 4b8adb280c..736c6cd410 100755 --- a/manager/media/style/default/css/forms.css +++ b/manager/media/style/default/css/forms.css @@ -1,372 +1,93 @@ /* [ FORMS ] */ - -legend { - font-size: 1em; -} - -label { - cursor: pointer; - display: inline-block; - margin-bottom: .5em -} - -label:not([for]) { - cursor: default -} - -button, -input { - margin: 0; - padding: 0; - border: none; - font: inherit; - line-height: normal; -} - -input[type=checkbox], -input[type=radio] { - width: 0.8125rem !important; - height: 0.8125rem !important; - margin-right: 0.25em; - vertical-align: -0.15em; - border-radius: .1rem; - border: 1px solid #d4d4d4; - background: #fff no-repeat 50% -1em; - outline: none; - transition: border-color .2s, background-position .1s; -} - -input[type=checkbox] { - background-image: url("data:image/svg+xml;utf8,%3Csvg%20viewBox%3D%270%200%201792%201792%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M1671%20566q0%2040-28%2068l-724%20724-136%20136q-28%2028-68%2028t-68-28l-136-136-362-362q-28-28-28-68t28-68l136-136q28-28%2068-28t68%2028l294%20295%20656-657q28-28%2068-28t68%2028l136%20136q28%2028%2028%2068z%27%20fill%3D%27%23444%27/%3E%3C/svg%3E"); - background-size: .875em; -} - -input[type=radio] { - background-image: url("data:image/svg+xml;utf-8,%3Csvg%20viewBox%3D%270%200%201792%201792%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M1664%20896q0%20209-103%20385.5t-279.5%20279.5-385.5%20103-385.5-103-279.5-279.5-103-385.5%20103-385.5%20279.5-279.5%20385.5-103%20385.5%20103%20279.5%20279.5%20103%20385.5z%27%20fill%3D%27%23444%27/%3E%3C/svg%3E"); - background-size: .6em; - border-radius: 50% -} - -input[type=checkbox]:hover, -input[type=radio]:hover { - border-color: #bcbcbc -} - -input[type=checkbox]:active, -input[type=radio]:active { - background-color: #fafafa; -} - -input[type=checkbox]:focus, -input[type=radio]:focus { - border-color: #4d8ef9 !important; - box-shadow: 0 0 0 1px rgba(77, 142, 249, 0.5) -} - -input[type=checkbox]:checked, -input[type=radio]:checked { - background-position: 50% 50% -} - -input[type=checkbox]:disabled { - background-image: url("data:image/svg+xml;utf8,%3Csvg%20viewBox%3D%270%200%201792%201792%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M1671%20566q0%2040-28%2068l-724%20724-136%20136q-28%2028-68%2028t-68-28l-136-136-362-362q-28-28-28-68t28-68l136-136q28-28%2068-28t68%2028l294%20295%20656-657q28-28%2068-28t68%2028l136%20136q28%2028%2028%2068z%27%20fill%3D%27%23bbb%27/%3E%3C/svg%3E"); - background-size: .875em; -} - -button, -input, -optgroup, -select, -textarea { - position: relative; - font-family: sans-serif; - font-size: 0.8125rem; - line-height: 1.23076923; - margin: 0; - -webkit-appearance: none; - -moz-appearance: none; -} - -.form-control, -input[type=text]:not(.form-control), -input[type=password], -input[type=number], -input[type=email], -input[type=date], -input[type=url], -input[type=search], -select, -textarea { - display: inline-block; - width: 100%; - max-width: 100%; - padding: 0.46153846em .5em; - line-height: 1.23076923; - vertical-align: inherit; - font-size: 0.8125rem; - color: #464a4c; - background-color: #fff; - -webkit-background-clip: padding-box; - background-clip: padding-box; - border: 1px solid #d4d4d4; - border-color: rgba(0, 0, 0, 0.08); - border-radius: .1em; - -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; - transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; - -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; -} - -.form-control:focus, -input:not([type=radio]):not([type=checkbox]):focus, -select:focus, -textarea:focus, -.btn.focus, -.btn:focus { - z-index: 3; - outline-offset: -1px; - outline: rgba(77, 142, 249, 0.5) solid 2px; - border-color: #66afe9; -} - -input:not([type=button]):not([type=submit]):hover:not(:focus), -select:hover:not(:focus), -textarea:hover:not(:focus) { - border-color: #bbb; - transition: border-color 0s, background-position .1s; -} - -.btn, -button:not(.btn), -input[type=button]:not(.btn), -input[type=submit]:not(.btn) { - display: inline-block; - padding: 0.46153846em 1em; - line-height: 1.23076923; - vertical-align: inherit; - text-align: center; - text-decoration: none !important; - font-size: 0.8125rem; - font-weight: 400; - white-space: nowrap; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - cursor: pointer; - background-color: #fff; - border: 1px solid #d4d4d4; - border-radius: .1em; - -webkit-transition: all .2s ease-in-out; - -o-transition: all .2s ease-in-out; - transition: all .2s ease-in-out -} - -select:not([size]):not([multiple]), -select.form-control:not([size]):not([multiple]), -select[size="1"]:not([multiple]) { - height: 2.3076923em; - line-height: 1.38461538 -} - -.form-control-sm, -.input-group-sm > .form-control, -.input-group-sm > .input-group-addon, -.input-group-sm > .input-group-btn > .btn, -input.form-control-sm, -.btn-group-sm > .btn, -.btn-sm, -.input-group-addon.form-control-sm, -.input-group-sm > .input-group-addon, -.input-group-sm > .input-group-btn > .input-group-addon.btn { - padding: 0.46153846em .5rem; - font-size: .6772rem; - border-radius: .1rem; -} - -.form-control-lg, -.input-group-lg > .form-control, -.input-group-lg > .input-group-addon, -.input-group-lg > .input-group-btn > .btn, -input.form-control-lg, -.btn-group-lg > .btn, -.btn-lg, -.input-group-addon.form-control-lg, -.input-group-lg > .input-group-addon, -.input-group-lg > .input-group-btn > .input-group-addon.btn { - padding: 0.46153846em .5rem; - font-size: 1.15rem; - border-radius: .1rem; -} - -.btn:hover, -input[type=button]:not(.btn):hover, -input[type=submit]:not(.btn):hover { - color: #292b2c; - background-color: #efefef; - border-color: #c3c3c3 -} - -.btn:focus, -input[type=button]:not(.btn):focus, -input[type=submit]:not(.btn):focus { - background-color: #e6e6e6; - border-color: #adadad -} - -.btn-primary { - color: #fff; - background-color: #0275d8; - border-color: #0275d8 -} - -.btn-primary:hover { - color: #fff; - background-color: #025aa5; - border-color: #01549b -} - -.btn-secondary { - color: #292b2c; - background-color: #fff; - border-color: #d4d4d4 -} - -.btn-secondary:hover { - color: #292b2c; - background-color: #e6e6e6; - border-color: #adadad -} - -.btn-success { - color: #fff; - background-color: #5cb85c; - border-color: #56ac56 -} - -.btn-success:hover { - color: #fff; - background-color: #449d44; - border-color: #419641 -} - -.btn-danger { - color: #fff; - background-color: #d9534f; - border-color: #d9534f -} - -.btn-danger:hover { - color: #fff; - background-color: #c9302c; - border-color: #c12e2a -} - -.btn-warning { - color: #fff; - background-color: #f0ad4e; - border-color: #f0ad4e; -} - -.btn-warning:hover { - color: #fff; - background-color: #ec971f; - border-color: #eb9316; -} - -.btn-info { - color: #fff; - background-color: #5bc0de; - border-color: #5bc0de; -} - -.btn-info:hover { - color: #fff; - background-color: #31b0d5; - border-color: #2aabd2; -} - -.btn-default { - color: #bbb; - background-color: #202329; - border-color: #202329 -} - -.btn-default:hover { - color: #fff; - background-color: #1a1c21; - border-color: #1a1c21 -} - -textarea, -textarea.form-control { - width: 100%; - line-height: 1.5; - overflow: auto; - resize: vertical -} - -select:not([size]):not([multiple]), -select[size="1"] { - padding-right: 2em !important; - background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTc5MiAxNzkyJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnPjxwYXRoIGQ9J00xMzk1IDczNnEwIDEzLTEwIDIzbC00NjYgNDY2cS0xMCAxMC0yMyAxMHQtMjMtMTBsLTQ2Ni00NjZxLTEwLTEwLTEwLTIzdDEwLTIzbDUwLTUwcTEwLTEwIDIzLTEwdDIzIDEwbDM5MyAzOTMgMzkzLTM5M3ExMC0xMCAyMy0xMHQyMyAxMGw1MCA1MHExMCAxMCAxMCAyM3onIGZpbGw9JyUyMzQ0NCcvPjwvc3ZnPg==") !important; - background-repeat: no-repeat; - background-position: right center; - background-size: 2em 1.3em -} - -optgroup { - font-style: normal; - font-weight: 500; - background-color: #ddd; -} - -optgroup option { - font-weight: normal; - background-color: #fff; -} - -input[type=color] { - width: 2.308em; - height: 2.308em; - -webkit-appearance: menulist; - -moz-appearance: menupopup -} - -input[type=range] { - -webkit-appearance: slider-horizontal; - -moz-appearance: initial; -} - -.input-group-addon { - padding: 0.46153846em .75em; - font-size: 0.8125rem; - border: 1px solid rgba(0, 0, 0, .15); - border-radius: .1em; -} - -.form-control.dropdown-item:focus, -.form-control.dropdown-item:hover { - background-color: inherit -} - -::-ms-value { - border: none; - margin: 0; - padding: 0 0 1px; - line-height: 1 -} - -select::-ms-expand { - display: none; -} - -::-moz-focus-inner { - border: 0; - padding: 0; -} - +legend { font-size: 1em; } +label { cursor: pointer; display: inline-block; margin-bottom: .5em } +label:not([for]) { cursor: default } +button, input { margin: 0; padding: 0; border: none; font: inherit; line-height: normal; } +input[type=checkbox], input[type=radio] { width: 0.8125rem !important; height: 0.8125rem !important; margin-right: 0.25em; vertical-align: -0.15em; border-radius: .1rem; border: 1px solid #d4d4d4; background: #fff no-repeat 50% -1em; outline: none; transition: border-color .2s, background-position .1s; } +input[type=checkbox] { background-image: url("data:image/svg+xml;utf8,%3Csvg%20viewBox%3D%270%200%201792%201792%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M1671%20566q0%2040-28%2068l-724%20724-136%20136q-28%2028-68%2028t-68-28l-136-136-362-362q-28-28-28-68t28-68l136-136q28-28%2068-28t68%2028l294%20295%20656-657q28-28%2068-28t68%2028l136%20136q28%2028%2028%2068z%27%20fill%3D%27%23444%27/%3E%3C/svg%3E"); background-size: 1em; } +input[type=radio] { background-image: url("data:image/svg+xml;utf-8,%3Csvg%20viewBox%3D%270%200%201792%201792%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M1664%20896q0%20209-103%20385.5t-279.5%20279.5-385.5%20103-385.5-103-279.5-279.5-103-385.5%20103-385.5%20279.5-279.5%20385.5-103%20385.5%20103%20279.5%20279.5%20103%20385.5z%27%20fill%3D%27%23444%27/%3E%3C/svg%3E"); background-size: .609375em; border-radius: 50% } +input[type=checkbox]:hover, input[type=radio]:hover { border-color: #bcbcbc } +input[type=checkbox]:active, input[type=radio]:active { background-color: #fafafa; } +input[type=checkbox]:focus, input[type=radio]:focus { border-color: #4d8ef9 !important; box-shadow: 0 0 0 1px rgba(77, 142, 249, 0.5) } +input[type=checkbox]:checked, input[type=radio]:checked { background-position: 50% 50% } +input[type=checkbox]:disabled { background-image: url("data:image/svg+xml;utf8,%3Csvg%20viewBox%3D%270%200%201792%201792%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M1671%20566q0%2040-28%2068l-724%20724-136%20136q-28%2028-68%2028t-68-28l-136-136-362-362q-28-28-28-68t28-68l136-136q28-28%2068-28t68%2028l294%20295%20656-657q28-28%2068-28t68%2028l136%20136q28%2028%2028%2068z%27%20fill%3D%27%23bbb%27/%3E%3C/svg%3E"); background-size: .875em; } +button, input, optgroup, select, textarea { position: relative; font-family: sans-serif; font-size: 0.8125rem; line-height: 1.23076923; margin: 0; -webkit-appearance: none; -moz-appearance: none; } +.form-control, input[type=text]:not(.form-control), input[type=password], input[type=number], input[type=email], input[type=date], input[type=url], input[type=search], select, textarea { display: inline-block; width: 100%; max-width: 100%; padding: 0.46153846em .5em; line-height: 1.23076923; vertical-align: inherit; font-size: 0.8125rem; color: #464a4c; background-color: #fff; -webkit-background-clip: padding-box; background-clip: padding-box; border: 1px solid #d4d4d4; border-radius: .1em; -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; } +.form-control:focus, input:not([type=radio]):not([type=checkbox]):focus, select:focus, textarea:focus, .btn.focus, .btn:focus { z-index: 3; outline-offset: -1px; outline: rgba(77, 142, 249, 0.5) solid 2px; border-color: #66afe9; } +input:not([type=button]):not([type=submit]):hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: #bbb; transition: border-color 0s, background-position .1s; } +.btn, button:not(.btn), input[type=button]:not(.btn), input[type=submit]:not(.btn) { display: inline-block; padding: 0.46153846em 1em; line-height: 1.23076923; vertical-align: inherit; text-align: center; text-decoration: none !important; font-size: 0.8125rem; font-weight: 400; white-space: nowrap; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: pointer; background-color: #fff; border: 1px solid #d4d4d4; border-radius: .1em; -webkit-transition: all .2s ease-in-out; -o-transition: all .2s ease-in-out; transition: all .2s ease-in-out } +select:not([size]):not([multiple]), select.form-control:not([size]):not([multiple]), select[size="1"]:not([multiple]) { height: 2.3076923em; line-height: 1.38461538 } +.form-control-sm, .input-group-sm > .form-control, .input-group-sm > .input-group-addon, .input-group-sm > .input-group-btn > .btn, input.form-control-sm, .btn-group-sm > .btn, .btn-sm, .input-group-addon.form-control-sm, .input-group-sm > .input-group-addon, .input-group-sm > .input-group-btn > .input-group-addon.btn { padding: 0.46153846em .5rem; font-size: .6772rem; border-radius: .1rem; } +.form-control-lg, .input-group-lg > .form-control, .input-group-lg > .input-group-addon, .input-group-lg > .input-group-btn > .btn, input.form-control-lg, .btn-group-lg > .btn, .btn-lg, .input-group-addon.form-control-lg, .input-group-lg > .input-group-addon, .input-group-lg > .input-group-btn > .input-group-addon.btn { padding: 0.46153846em .5rem; font-size: 1.15rem; border-radius: .1rem; } +.btn:hover, input[type=button]:not(.btn):hover, input[type=submit]:not(.btn):hover { color: #292b2c; background-color: #efefef; border-color: #c3c3c3 } +.btn:focus, input[type=button]:not(.btn):focus, input[type=submit]:not(.btn):focus { background-color: #e6e6e6; border-color: #adadad } +.btn-primary { color: #fff; background-color: #0275d8; border-color: #0275d8 } +.btn-primary:hover { color: #fff; background-color: #025aa5; border-color: #01549b } +.btn-secondary { color: #292b2c; background-color: #fff; border-color: #d4d4d4 } +.btn-secondary:hover { color: #292b2c; background-color: #e6e6e6; border-color: #adadad } +.btn-success { color: #fff; background-color: #5cb85c; border-color: #56ac56 } +.btn-success:hover { color: #fff; background-color: #449d44; border-color: #419641 } +.btn-danger { color: #fff; background-color: #d9534f; border-color: #d9534f } +.btn-danger:hover { color: #fff; background-color: #c9302c; border-color: #c12e2a } +.btn-warning { color: #fff; background-color: #f0ad4e; border-color: #f0ad4e; } +.btn-warning:hover { color: #fff; background-color: #ec971f; border-color: #eb9316; } +.btn-info { color: #fff; background-color: #5bc0de; border-color: #5bc0de; } +.btn-info:hover { color: #fff; background-color: #31b0d5; border-color: #2aabd2; } +.btn-default { color: #bbb; background-color: #202329; border-color: #202329 } +.btn-default:hover { color: #fff; background-color: #1a1c21; border-color: #1a1c21 } +textarea, textarea.form-control { width: 100%; line-height: 1.5; overflow: auto; resize: vertical } +select:not([size]):not([multiple]), select[size="1"] { padding-right: 2em !important; background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTc5MiAxNzkyJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnPjxwYXRoIGQ9J00xMzk1IDczNnEwIDEzLTEwIDIzbC00NjYgNDY2cS0xMCAxMC0yMyAxMHQtMjMtMTBsLTQ2Ni00NjZxLTEwLTEwLTEwLTIzdDEwLTIzbDUwLTUwcTEwLTEwIDIzLTEwdDIzIDEwbDM5MyAzOTMgMzkzLTM5M3ExMC0xMCAyMy0xMHQyMyAxMGw1MCA1MHExMCAxMCAxMCAyM3onIGZpbGw9JyUyMzQ0NCcvPjwvc3ZnPg==") !important; background-repeat: no-repeat; background-position: right center; background-size: 2em 1.3em } +optgroup { font-style: normal; font-weight: 500; background-color: #ddd; } +optgroup option { font-weight: normal; background-color: #fff; } +input[type=color] { width: 2.308em; height: 2.308em; -webkit-appearance: menulist; -moz-appearance: menupopup } +input[type=range] { -webkit-appearance: slider-horizontal; -moz-appearance: initial; } +.input-group-addon { padding: 0.46153846em .75em; font-size: 0.8125rem; border: 1px solid rgba(0, 0, 0, .15); border-radius: .1em; } +.form-control.dropdown-item:focus, .form-control.dropdown-item:hover { background-color: inherit } +::-ms-value { border: none; margin: 0; padding: 0 0 1px; line-height: 1 } +select::-ms-expand { display: none; } +::-moz-focus-inner { border: 0; padding: 0; } @-moz-document url-prefix() { - select:not([size]):not([multiple]) { - text-indent: -2px - } +select:not([size]):not([multiple]) { text-indent: -2px } +} +/* darkness */ +.darkness .form-control, .darkness input[type=text]:not(.form-control), .darkness input[type=password], .darkness input[type=number], .darkness input[type=email], .darkness input[type=date], .darkness input[type=url], .darkness input[type=search], .darkness select, .darkness textarea, .darkness .btn, .darkness button:not(.btn), .darkness input[type=button]:not(.btn), .darkness input[type=submit]:not(.btn) { border-color: #414449; background-color: #202329; color: #bbb; } +.darkness input:not([type=button]):not([type=submit]):hover:not(:focus), .darkness select:hover:not(:focus), .darkness textarea:hover:not(:focus) { border-color: #5d5d5d } +.darkness .btn:hover, .darkness input[type=button]:not(.btn):hover, .darkness input[type=submit]:not(.btn):hover { border-color: #414449; background-color: #282c34; color: #eee; } +.darkness .btn-primary { color: #fff; background-color: #0275d8; border-color: #0275d8 } +.darkness .btn-primary:hover { color: #fff; background-color: #025aa5; border-color: #01549b } +.darkness .btn-secondary.active.focus, .darkness .btn-secondary.active:focus, .darkness .btn-secondary.active:hover, .darkness .btn-secondary:active.focus, .darkness .btn-secondary:active:focus, .darkness .btn-secondary:active:hover, .darkness .open > .btn-secondary.dropdown-toggle.focus, .darkness .open > .btn-secondary.dropdown-toggle:focus, .darkness .open > .btn-secondary.dropdown-toggle:hover { border-color: #414449; background-color: #1a1c21; color: #eee; } +.darkness .btn-secondary.focus, .darkness .btn-secondary:focus { border-color: #414449; background-color: #1a1c21; color: #eee; } +.darkness .btn-success { color: #fff; background-color: #428743; border-color: #479048; } +.darkness .btn-success.active, .darkness .btn-success:active, .darkness .open > .btn-success.dropdown-toggle { color: #fff; border-color: #419641; background: #448546 none; } +.darkness .btn-success:hover { color: #fff; background-color: #39773a; border-color: #39773a; } +.darkness .btn-danger { color: #fff; background-color: #d9534f; border-color: #d9534f } +.darkness .btn-danger:hover { color: #fff; background-color: #c9302c; border-color: #c12e2a } +.darkness .btn-warning { color: #fff; background-color: #f0ad4e; border-color: #f0ad4e; } +.darkness .btn-warning:hover { color: #fff; background-color: #ec971f; border-color: #eb9316; } +.darkness .btn-info { color: #fff; background-color: #5bc0de; border-color: #5bc0de; } +.darkness .btn-info:hover { color: #fff; background-color: #31b0d5; border-color: #2aabd2; } +.darkness .btn-default { color: #bbb; background-color: #202329; border-color: #202329 } +.darkness .btn-default:hover { color: #fff; background-color: #1a1c21; border-color: #1a1c21 } +.darkness #actions { right: 0; background-color: #282c34 } +.darkness #actions .btn-group .btn-success { box-shadow: none } +.darkness #actions .dropdown-menu .btn { background-color: #343942; border-radius: 0; color: #fff; } +.darkness #actions .dropdown-menu .btn:hover { background-color: #3c424e; color: #fff } +.darkness optgroup { background-color: #202329 } +.darkness optgroup option { background-color: #1a1c21 } +.darkness .float-xs-right > select { width: auto } +.darkness input[type=checkbox], .darkness input[type=radio] { border: 1px solid #414449; background-color: #202329 } +.darkness input[type=checkbox]:checked, .darkness input[type=radio]:checked { background-color: #ffc107; border-color: #ffc107 !important } +.darkness input[type=checkbox]:checked:hover, .darkness input[type=radio]:checked:hover { box-shadow: 0 0 .5em #ffc107 } +.darkness input[type=checkbox]:checked + label { background-color: transparent !important; color: #fff; } +.darkness input[type=checkbox] + label:hover { color: #fff; } +.darkness input[type=checkbox]:disabled, .darkness input[type=radio]:disabled, .darkness input[type=checkbox]:checked:disabled, .darkness input[type=radio]:checked:disabled { background-color: #282c34; border-color: #414449 !important; box-shadow: none !important; } +.darkness select:not([size]):not([multiple]), .darkness select[size="1"] { background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTc5MiAxNzkyJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIGZpbGw9JyNlZWUnPjxwYXRoIGQ9J00xMzk1IDczNnEwIDEzLTEwIDIzbC00NjYgNDY2cS0xMCAxMC0yMyAxMHQtMjMtMTBsLTQ2Ni00NjZxLTEwLTEwLTEwLTIzdDEwLTIzbDUwLTUwcTEwLTEwIDIzLTEwdDIzIDEwbDM5MyAzOTMgMzkzLTM5M3ExMC0xMCAyMy0xMHQyMyAxMGw1MCA1MHExMCAxMCAxMCAyM3onLz48L3N2Zz4=") !important; background-repeat: no-repeat; } +.darkness select[size="1"]:not(.unstyled), .darkness select[name="which_editor"] { width: auto; } +.darkness input:-webkit-autofill, .darkness textarea:-webkit-autofill, .darkness select:-webkit-autofill, .darkness input:-webkit-autofill:focus { border-color: #ffc107 !important; -webkit-animation-name: autofill; -webkit-animation-fill-mode: both; outline: none } +.darkness input:-webkit-autofill:focus { box-shadow: 0 0 0.5em #ffc107; } +@-webkit-keyframes autofill { +to { +color: #bbb; +background: transparent; +} } diff --git a/manager/media/style/default/css/index.css b/manager/media/style/default/css/index.css index 3df15941e1..bfbfad49fb 100755 --- a/manager/media/style/default/css/index.css +++ b/manager/media/style/default/css/index.css @@ -1,244 +1,48 @@ -#frameset { - position: absolute; - left: 0; - top: 0; - right: 0; - bottom: 0; - overflow: hidden; -} - -#mainMenu, -#tree, -#main { - position: absolute; -} - -#mainMenu { - top: 0; - left: 0; - width: 100%; - height: 2.2rem; - z-index: 100; -} - -#tree { - left: 0; - top: 2.2rem; - bottom: 0; - width: 25rem; - max-width: 100%; - overflow: hidden; - z-index: 2; -} - -#main { - left: 25rem; - top: 2.2rem; - right: 0; - bottom: 0; - z-index: 1; -} - -#main #mainframe { - display: block; - position: absolute; - width: 100%; - height: 100%; - overflow: auto; -} - +#frameset { position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; } +#mainMenu, #tree, #main { position: absolute; } +#mainMenu { top: 0; left: 0; width: 100%; height: 2.2rem; z-index: 100; } +#tree { left: 0; top: 2.2rem; bottom: 0; width: 25rem; max-width: 100%; overflow: hidden; z-index: 2; } +#main { left: 25rem; top: 2.2rem; right: 0; bottom: 0; z-index: 1; } +#main #mainframe { display: block; position: absolute; width: 100%; height: 100%; overflow: auto; } /* floater */ - -#floater { - position: fixed; - z-index: 1000; - opacity: 0; - visibility: hidden; - max-width: 20rem; - padding: 1.5rem; - top: 4rem; - left: 2rem; - border-radius: 0.25rem; - background-color: #fff; - -webkit-box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); - box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); - transition-duration: 0.15s -} - -#floater.show { - opacity: 1; - visibility: visible; -} - +#floater { position: fixed; z-index: 1000; opacity: 0; visibility: hidden; max-width: 20rem; padding: 1.5rem; top: 4rem; left: 2rem; border-radius: 0.25rem; background-color: #fff; -webkit-box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); transition-duration: 0.15s } +#floater.show { opacity: 1; visibility: visible; } /*resizer*/ - -#resizer { - position: absolute; - z-index: 99; - top: 2.2rem; - bottom: 0; - left: 25rem; - width: 5px; - margin-left: -1px; - cursor: col-resize; - background-color: transparent; - transition: background-color .3s -} - -#resizer:hover { - background-color: rgba(0, 0, 0, 0.1); -} - -#mask_resizer { - position: absolute; - width: 100%; - height: 100%; -} - +#resizer { position: absolute; z-index: 99; top: 2.2rem; bottom: 0; left: 25rem; width: 5px; margin-left: -1px; cursor: col-resize; background-color: transparent; transition: background-color .3s } +#resizer:hover { background-color: rgba(0, 0, 0, 0.1); } +#mask_resizer { position: absolute; width: 100%; height: 100%; } /* mainloader */ - -#mainloader { - position: absolute; - z-index: 50000; - top: 0; - left: 0; - width: 100%; - height: 100%; - text-align: center; - vertical-align: middle; - padding: 15% 0 0 0; - background-color: rgba(255, 255, 255, 0.64); - opacity: 0; - visibility: hidden; - -webkit-transition-duration: 0.3s; - transition-duration: 0.3s -} - -#mainloader.show { - opacity: 0.75; - visibility: visible; - -webkit-transition-duration: 0.1s; - transition-duration: 0.1s -} - -#mainloader::before { - content: ""; - display: block; - position: absolute; - z-index: 1; - left: 50%; - top: 30%; - width: 120px; - height: 120px; - margin: -60px 0 0 -60px; - border-radius: 50%; - animation: rotate 2s linear infinite; - box-shadow: 5px 5px 0 0 rgb(234, 132, 82), 14px -7px 0 0 rgba(111, 163, 219, 0.7), -7px 11px 0 0 rgba(112, 193, 92, 0.74), -11px -7px 0 0 rgba(147, 205, 99, 0.78); -} - -.sidebar-closed #tree { - width: 0 !important; -} - -.sidebar-closed #main, -.sidebar-closed #resizer { - left: 0 !important; -} - +#mainloader { position: absolute; z-index: 50000; top: 0; left: 0; width: 100%; height: 100%; text-align: center; vertical-align: middle; padding: 15% 0 0 0; background-color: rgba(255, 255, 255, 0.64); opacity: 0; visibility: hidden; -webkit-transition-duration: 0.3s; transition-duration: 0.3s } +#mainloader.show { opacity: 0.75; visibility: visible; -webkit-transition-duration: 0.1s; transition-duration: 0.1s } +#mainloader::before { content: ""; display: block; position: absolute; z-index: 1; left: 50%; top: 30%; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; animation: rotate 2s linear infinite; box-shadow: 5px 5px 0 0 rgb(234, 132, 82), 14px -7px 0 0 rgba(111, 163, 219, 0.7), -7px 11px 0 0 rgba(112, 193, 92, 0.74), -11px -7px 0 0 rgba(147, 205, 99, 0.78); } +.sidebar-closed #tree { width: 0 !important; } +.sidebar-closed #main, .sidebar-closed #resizer { left: 0 !important; } @media (min-width: 1200px) { - #mainMenu { - height: 3.125rem; - } - #tree, - #main { - top: 3.125rem; - } - #tree { - font-size: .875rem - } +#mainMenu { height: 2.5rem; } +#tree, #main { top: 2.5rem; } } - @media (max-width: 840px) { - #floater { - left: 0; - right: 0; - margin: 0 auto; - } - #resizer { - display: none - } - #frameset #mask_resizer { - z-index: 3 !important; - opacity: 0.5; - visibility: visible; - background-color: #000; - -webkit-transition: 0.2s; - transition: 0.2s - } - .sidebar-closed #frameset #mask_resizer { - opacity: 0; - visibility: hidden; - } - #tree { - z-index: 5; - width: 100% !important; - max-width: 20rem; - box-shadow: 0 0 1rem rgba(0, 0, 0, 0.25); - -webkit-transition: 0.25s; - transition: 0.25s - } - .sidebar-closed #tree { - width: auto !important; - box-shadow: none; - -webkit-transform: translate3d(-100%, 0, 0); - transform: translate3d(-100%, 0, 0); - } - #tree .treeframebody { - box-shadow: none - } - .sidebar-closed #main::after { - content: ""; - position: absolute; - z-index: 1; - left: 0; - top: 6rem; - bottom: 0; - width: 1rem; - } - #main { - left: 0 !important; - } - #main::before { - content: ""; - position: absolute; - z-index: 9999; - left: 0; - top: 0; - right: 0; - bottom: 0; - background-color: rgba(0, 0, 0, 0); - } - .sidebar-closed #mainMenu:not(.show) + #tree + #main::before { - display: none - } +#floater { left: 0; right: 0; margin: 0 auto; } +#resizer { display: none } +#frameset #mask_resizer { z-index: 3 !important; opacity: 0.5; visibility: visible; background-color: #000; -webkit-transition: 0.2s; transition: 0.2s } +.sidebar-closed #frameset #mask_resizer { opacity: 0; visibility: hidden; } +#tree { z-index: 5; width: 100% !important; max-width: 20rem; box-shadow: 0 0 1rem rgba(0, 0, 0, 0.25); -webkit-transition: 0.25s; transition: 0.25s } +.sidebar-closed #tree { width: auto !important; box-shadow: none; -webkit-transform: translate3d(-100%, 0, 0); transform: translate3d(-100%, 0, 0); } +#tree .treeframebody { box-shadow: none } +.sidebar-closed #main::after { content: ""; position: absolute; z-index: 1; left: 0; top: 6rem; bottom: 0; width: 1rem; } +#main { left: 0 !important; } +#main::before { content: ""; position: absolute; z-index: 9999; left: 0; top: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0); } +.sidebar-closed #mainMenu:not(.show) + #tree + #main::before { display: none } } - @keyframes rotate { - to { - transform: rotate(360deg) - } +to { transform: rotate(360deg) } } - /* dark */ - -.dark #frameset { - background-color: #202329 -} - -.dark #main { - background-color: #ecf0f1 -} - -.dark #mainloader { - background-color: rgba(0, 0, 0, 0.1); -} +.dark #frameset { background-color: #202329 } +.dark #main { background-color: #ecf0f1 } +.dark #mainloader { background-color: rgba(0, 0, 0, 0.1); } +/* darkness */ +.darkness { letter-spacing: .021em } +.darkness #mainloader { background-color: rgba(0, 0, 0, 0.1); } +.darkness, .darkness #frameset, .darkness #main { background-color: #282c34; color: #bdbdbd; } +.darkness > form { background-color: #202329 } diff --git a/manager/media/style/default/css/layout.css b/manager/media/style/default/css/layout.css index 05bf9d5463..173a9bcd6c 100755 --- a/manager/media/style/default/css/layout.css +++ b/manager/media/style/default/css/layout.css @@ -1,151 +1,29 @@ -.layout { - display: table; - table-layout: fixed; - height: 100%; - width: 100% -} - -.layout > .layout-row { - display: table-row; - vertical-align: top; - height: 100% -} - -.layout > .layout-row > .layout-cell { - display: table-cell; - vertical-align: top; - height: 100% -} - -.layout > .layout-row > .layout-cell.layout-container, -.layout > .layout-row > .layout-cell .layout-container, -.layout > .layout-row > .layout-cell.padded-container, -.layout > .layout-row > .layout-cell .padded-container { - padding: 1rem 1rem 0 1rem -} - -.layout > .layout-row > .layout-cell.layout-container .container-flush, -.layout > .layout-row > .layout-cell .layout-container .container-flush, -.layout > .layout-row > .layout-cell.padded-container .container-flush, -.layout > .layout-row > .layout-cell .padded-container .container-flush { - padding-top: 0 -} - -.layout > .layout-row > .layout-cell .layout-relative { - position: relative; - height: 100% -} - -.layout > .layout-row > .layout-cell .layout-absolute { - position: absolute; - height: 100%; - width: 100% -} - -.layout > .layout-row > .layout-cell.min-size { - width: 0 -} - -.layout > .layout-row > .layout-cell.min-height { - height: 0 -} - -.layout > .layout-row > .layout-cell.center { - text-align: center -} - -.layout > .layout-row > .layout-cell.middle { - vertical-align: middle -} - -.layout > .layout-row > .layout-cell.layout-container, -.layout > .layout-row > .layout-cell .layout-container, -.layout > .layout-row > .layout-cell.padded-container, -.layout > .layout-row > .layout-cell .padded-container { - padding: 1rem 1rem 0 1rem -} - -.layout > .layout-row > .layout-cell.layout-container .container-flush, -.layout > .layout-row > .layout-cell .layout-container .container-flush, -.layout > .layout-row > .layout-cell.padded-container .container-flush, -.layout > .layout-row > .layout-cell .padded-container .container-flush { - padding-top: 0 -} - -.layout > .layout-row > .layout-cell .layout-relative { - position: relative; - height: 100% -} - -.layout > .layout-row > .layout-cell .layout-absolute { - position: absolute; - height: 100%; - width: 100% -} - -.layout > .layout-row > .layout-cell.min-size { - width: 0 -} - -.layout > .layout-row > .layout-cell.min-height { - height: 0 -} - -.layout > .layout-row > .layout-cell.center { - text-align: center -} - -.layout > .layout-row > .layout-cell.middle { - vertical-align: middle -} - -.layout > .layout-row.min-size { - height: 0 -} - -.layout > .layout-cell { - display: table-cell; - vertical-align: top; - height: 100% -} - -.layout > .layout-cell.layout-container, -.layout > .layout-cell .layout-container, -.layout > .layout-cell.padded-container, -.layout > .layout-cell .padded-container { - padding: 1rem 1rem 0 1rem -} - -.layout > .layout-cell.layout-container .container-flush, -.layout > .layout-cell .layout-container .container-flush, -.layout > .layout-cell.padded-container .container-flush, -.layout > .layout-cell .padded-container .container-flush { - padding-top: 0 -} - -.layout > .layout-cell .layout-relative { - position: relative; - height: 100% -} - -.layout > .layout-cell .layout-absolute { - position: absolute; - height: 100%; - width: 100% -} - -.layout > .layout-cell.min-size { - width: 0 -} - -.layout > .layout-cell.min-height { - height: 0 -} - -.layout > .layout-cell.center { - text-align: center -} - -.layout > .layout-cell.middle { - vertical-align: middle -} +.layout { display: table; table-layout: fixed; height: 100%; width: 100% } +.layout > .layout-row { display: table-row; vertical-align: top; height: 100% } +.layout > .layout-row > .layout-cell { display: table-cell; vertical-align: top; height: 100% } +.layout > .layout-row > .layout-cell.layout-container, .layout > .layout-row > .layout-cell .layout-container, .layout > .layout-row > .layout-cell.padded-container, .layout > .layout-row > .layout-cell .padded-container { padding: 1rem 1rem 0 1rem } +.layout > .layout-row > .layout-cell.layout-container .container-flush, .layout > .layout-row > .layout-cell .layout-container .container-flush, .layout > .layout-row > .layout-cell.padded-container .container-flush, .layout > .layout-row > .layout-cell .padded-container .container-flush { padding-top: 0 } +.layout > .layout-row > .layout-cell .layout-relative { position: relative; height: 100% } +.layout > .layout-row > .layout-cell .layout-absolute { position: absolute; height: 100%; width: 100% } +.layout > .layout-row > .layout-cell.min-size { width: 0 } +.layout > .layout-row > .layout-cell.min-height { height: 0 } +.layout > .layout-row > .layout-cell.center { text-align: center } +.layout > .layout-row > .layout-cell.middle { vertical-align: middle } +.layout > .layout-row > .layout-cell.layout-container, .layout > .layout-row > .layout-cell .layout-container, .layout > .layout-row > .layout-cell.padded-container, .layout > .layout-row > .layout-cell .padded-container { padding: 1rem 1rem 0 1rem } +.layout > .layout-row > .layout-cell.layout-container .container-flush, .layout > .layout-row > .layout-cell .layout-container .container-flush, .layout > .layout-row > .layout-cell.padded-container .container-flush, .layout > .layout-row > .layout-cell .padded-container .container-flush { padding-top: 0 } +.layout > .layout-row > .layout-cell .layout-relative { position: relative; height: 100% } +.layout > .layout-row > .layout-cell .layout-absolute { position: absolute; height: 100%; width: 100% } +.layout > .layout-row > .layout-cell.min-size { width: 0 } +.layout > .layout-row > .layout-cell.min-height { height: 0 } +.layout > .layout-row > .layout-cell.center { text-align: center } +.layout > .layout-row > .layout-cell.middle { vertical-align: middle } +.layout > .layout-row.min-size { height: 0 } +.layout > .layout-cell { display: table-cell; vertical-align: top; height: 100% } +.layout > .layout-cell.layout-container, .layout > .layout-cell .layout-container, .layout > .layout-cell.padded-container, .layout > .layout-cell .padded-container { padding: 1rem 1rem 0 1rem } +.layout > .layout-cell.layout-container .container-flush, .layout > .layout-cell .layout-container .container-flush, .layout > .layout-cell.padded-container .container-flush, .layout > .layout-cell .padded-container .container-flush { padding-top: 0 } +.layout > .layout-cell .layout-relative { position: relative; height: 100% } +.layout > .layout-cell .layout-absolute { position: absolute; height: 100%; width: 100% } +.layout > .layout-cell.min-size { width: 0 } +.layout > .layout-cell.min-height { height: 0 } +.layout > .layout-cell.center { text-align: center } +.layout > .layout-cell.middle { vertical-align: middle } diff --git a/manager/media/style/default/css/main.css b/manager/media/style/default/css/main.css index 65a04dc862..a3807f7e73 100755 --- a/manager/media/style/default/css/main.css +++ b/manager/media/style/default/css/main.css @@ -1,898 +1,193 @@ /* -------------------------[ Misc stuff ]--- */ - -.comment { - font-size: 11px; - color: #999; - padding: 4px 0; -} - -.screen { - border: 1px solid #ddd; - text-align: center; -} - -.even { - background: #d9e7c2; -} - -.odd { - background: #fff; -} - +.comment { font-size: 11px; color: #999; padding: 4px 0; } +.screen { border: 1px solid #ddd; text-align: center; } +.even { background: #d9e7c2; } +.odd { background: #fff; } /* -------------------------[ end sortable table ]--- */ - -.disabledImage { - width: 20px; - opacity: 0.3; - filter: alpha(opacity=30); -} - -.disabledImage img { - border: 0; -} - -.editorCell { - border-top: 1px solid #808080; - text-align: left; - vertical-align: baseline; -} - +.disabledImage { width: 20px; opacity: 0.3; filter: alpha(opacity=30); } +.disabledImage img { border: 0; } +.editorCell { border-top: 1px solid #808080; text-align: left; vertical-align: baseline; } /* */ - -.unpublished a, -.unpublish { - color: #b68282; - font-style: italic; -} - -.notInMenuNode { - color: #39515d; - text-decoration: none; -} - -#treeSplitter { - width: 10px; - height: 100%; - position: absolute; - right: -10px; -} - -.deleted { - color: #a52a2a; - text-decoration: line-through; -} - -label.disabled { - color: #aaa; -} - +.unpublished a, .unpublish { color: #b68282; font-style: italic; } +.notInMenuNode { color: #39515d; text-decoration: none; } +#treeSplitter { width: 10px; height: 100%; position: absolute; right: -10px; } +.deleted { color: #a52a2a; text-decoration: line-through; } +label.disabled { color: #aaa; } /* -------------------------[ home page main links ]--- */ - /*a.hometblink, a.hometblink:active, .hometblink { text-decoration: underline; color: #333; font-weight: 500; font-size: 12px; } a.hometblink:hover { text-decoration: underline; color: Gray; }*/ - -.notice { - width: 100%; - padding: 5px; - border: 1px solid #eee; - background-color: #f5f5f5; - color: #707070; -} - +.notice { width: 100%; padding: 5px; border: 1px solid #eee; background-color: #f5f5f5; color: #707070; } /* -------------------------[ Settings Table ]--- */ - -.filelist td { - border-bottom: 1px solid #c2c3cf; -} - +.filelist td { border-bottom: 1px solid #c2c3cf; } /* -------------------------[ Welcome Page ]--- */ - /*#mainActionPages { background: #f5f5f5; }*/ - /* -------------------------[ New sortable table class ]--- */ - -.sortabletable { - width: 100%; - border-collapse: collapse; -} - -.sortabletable thead tr { - color: #333; - font-weight: 500; - white-space: nowrap; - background-color: #d2d2d2; - text-align: left; -} - -.sortabletable tr { - background: #fff; -} - -.sortabletable tr.even { - background: #f7f7f7; -} - -.sortabletable tbody tr:hover { - background: #e9f0f3; -} - -.sortabletable td, -.sortabletable th { - padding: 5px !important; - border: 1px solid #ccc; -} - -.sortabletable th { - text-align: left; - cursor: pointer; - color: #333; -} - -.sortabletable th a { - text-decoration: none; - color: #333; -} - -.sortabletable th:active { - background: #ccc; - padding: 3px 4px 1px 6px; -} - +.sortabletable { width: 100%; border-collapse: collapse; } +.sortabletable thead tr { color: #333; font-weight: 500; white-space: nowrap; background-color: #d2d2d2; text-align: left; } +.sortabletable tr { background: #fff; } +.sortabletable tr.even { background: #f7f7f7; } +.sortabletable tbody tr:hover { background: #e9f0f3; } +.sortabletable td, .sortabletable th { padding: 5px !important; border: 1px solid #ccc; } +.sortabletable th { text-align: left; cursor: pointer; color: #333; } +.sortabletable th a { text-decoration: none; color: #333; } +.sortabletable th:active { background: #ccc; padding: 3px 4px 1px 6px; } /* -------------------------[ Pagination table ]--- */ - -#max-display-records { - margin: 10px 0; -} - -fieldset.tab-page { - border: 1px solid #e4e4e4 !important; -} - -h2#edit_document_title { - font-size: 0.9rem; - color: #f5f5f5; - width: 100%; - border-bottom: none; - padding: 5px 10px; -} - -fieldset#preview h2.tab { - float: right; -} - +#max-display-records { margin: 10px 0; } +fieldset.tab-page { border: 1px solid #e4e4e4 !important; } +h2#edit_document_title { font-size: 0.9rem; color: #f5f5f5; width: 100%; border-bottom: none; padding: 5px 10px; } +fieldset#preview h2.tab { float: right; } /* * Generic styles for all form elements */ - -form#mutate dt, -form#mutate dd { - margin-bottom: 10px; -} - -form#mutate dt label, -form#mutate dt h3.label { - font-size: 1em; - display: inline; - float: left; - width: 200px; - color: #821517 !important; - font-weight: 500; -} - -form#mutate dd { - margin-left: 210px; -} - -form#mutate input.disabled { - background-color: #f5f5f5 !important; -} - +form#mutate dt, form#mutate dd { margin-bottom: 10px; } +form#mutate dt label, form#mutate dt h3.label { font-size: 1em; display: inline; float: left; width: 200px; color: #821517 !important; font-weight: 500; } +form#mutate dd { margin-left: 210px; } +form#mutate input.disabled { background-color: #f5f5f5 !important; } /*form#mutate select.inputBox { margin-right: 5px; }*/ - -form#mutate .multitv input[type="text"] { - width: 300px; -} - -form#mutate .imageField { - width: 50%; - min-width: 300px; -} - -form#mutate input[name="menuindex"] { - text-align: center; - width: 80px; - padding-left: 0; - padding-right: 0; -} - -form#mutate input[name="ta"].inputBox { - padding-left: 30px -} - -form#mutate input[name="ta"].inputBox:focus + input[type=button], -form#mutate input[name="ta"].inputBox:focus + .CodeMirror + input[type=button] { - border-color: #1377c5 #1377c5 #1377c5 #bbb; -} - -input[name^=tv].DatePicker, -input[name*=date].DatePicker, -input[name=createdon].DatePicker, -input[name=editedon].DatePicker { - float: left; - width: auto; - padding-right: 2em -} - -input[name^=tv].DatePicker + a, -input[name*=date].DatePicker + a { - position: relative; - z-index: 5; - margin-top: 0.5em; - margin-left: -1.5em; - float: left; -} - -form#mutate textarea.tv_textareamini { - height: 100px; - width: 300px; - overflow-y: scroll; -} - -form#mutate textarea.tv_textarea { - height: 100px; - width: 100%; - overflow-y: scroll; -} - -form#mutate #llock { - position: relative; - z-index: 5; - float: left; - width: 1.9rem; - height: 1.9rem; - margin: 0 -2rem 0 0; - line-height: 2rem; - cursor: pointer; - text-align: center; -} - -form#mutate #llock + #ta { - display: block !important; - padding-left: 2rem -} - -form#mutate #llock + #ta + .CodeMirror { - display: none !important; -} - -form#mutate #plock { - width: 1.4em; - cursor: pointer; - font-size: 14px -} - +form#mutate .multitv input[type="text"] { width: 300px; } +form#mutate .imageField { width: 50%; min-width: 300px; } +form#mutate input[name="menuindex"] { text-align: center; width: 80px; padding-left: 0; padding-right: 0; } +form#mutate input[name="ta"].inputBox { padding-left: 30px } +form#mutate input[name="ta"].inputBox:focus + input[type=button], form#mutate input[name="ta"].inputBox:focus + .CodeMirror + input[type=button] { border-color: #1377c5 #1377c5 #1377c5 #bbb; } +input[name^=tv].DatePicker, input[name*=date].DatePicker, input[name=createdon].DatePicker, input[name=editedon].DatePicker { float: left; width: auto; padding-right: 2em } +input[name^=tv].DatePicker + a, input[name*=date].DatePicker + a { position: relative; z-index: 5; margin-top: 0.5em; margin-left: -1.5em; float: left; } +form#mutate textarea.tv_textareamini { height: 100px; width: 300px; overflow-y: scroll; } +form#mutate textarea.tv_textarea { height: 100px; width: 100%; overflow-y: scroll; } +form#mutate #llock { position: relative; z-index: 5; float: left; width: 1.9rem; height: 1.9rem; margin: 0 -2rem 0 0; line-height: 2rem; cursor: pointer; text-align: center; } +form#mutate #llock + #ta { display: block !important; padding-left: 2rem } +form#mutate #llock + #ta + .CodeMirror { display: none !important; } +form#mutate #plock { width: 1.4em; cursor: pointer; font-size: 14px } /* * Individual Styles for fieldset#preview */ - -fieldset#preview iframe { - width: 100%; - margin: 0 auto; - border: 1px solid #f5f5f5; -} - +fieldset#preview iframe { width: 100%; margin: 0 auto; border: 1px solid #f5f5f5; } /* * Individual Styles for fieldset#access_permissions */ - -fieldset#access_permissions dt label { - width: 200px; -} - -fieldset#access_permissions dd { - margin-left: 210px; -} - -fieldset#access_permissions dl dd ul li { - list-style-type: none; -} - +fieldset#access_permissions dt label { width: 200px; } +fieldset#access_permissions dd { margin-left: 210px; } +fieldset#access_permissions dl dd ul li { list-style-type: none; } /* ppb: * Some styling for legacy mode fieldsets */ - -fieldset.legacy { - background: #fff; - padding: 10px; - margin: 10px 10px 35px; - border: 1px solid #e4e4e4 !important; - position: relative; -} - -fieldset.legacy h2 { - width: 100%; - background: #f5f5f5; - margin: -10px -10px 1rem -10px; - padding: 0 10px; - border-bottom: 1px solid #e4e4e4 !important; -} - +fieldset.legacy { background: #fff; padding: 10px; margin: 10px 10px 35px; border: 1px solid #e4e4e4 !important; position: relative; } +fieldset.legacy h2 { width: 100%; background: #f5f5f5; margin: -10px -10px 1rem -10px; padding: 0 10px; border-bottom: 1px solid #e4e4e4 !important; } /* System Alert Box ---------------------------------------------------------- */ - -.cbOverlay { - background-color: #000; - z-index: 50000; -} - -.cbContainer { - padding: 5px; - background-color: white; - z-index: 50000; -} - -.cbBox h3 { - color: #000; - background: #bee860 repeat-x top; - padding: 5px; - font-weight: 500; -} - -.cbBox p { - margin: 3px; -} - -.cbBox .cbButtons { - text-align: center; -} - -.sysAlert { - width: 500px; - height: 330px; - white-space: nowrap; - overflow: auto; -} - -.phptextarea { - font-family: Consolas, 'Courier New', 'Courier', monospace; -} - +.cbOverlay { background-color: #000; z-index: 50000; } +.cbContainer { padding: 5px; background-color: white; z-index: 50000; } +.cbBox h3 { color: #000; background: #bee860 repeat-x top; padding: 5px; font-weight: 500; } +.cbBox p { margin: 3px; } +.cbBox .cbButtons { text-align: center; } +.sysAlert { width: 500px; height: 330px; white-space: nowrap; overflow: auto; } +.phptextarea { font-family: Consolas, 'Courier New', 'Courier', monospace; } /* Custom */ - /* normalize some td paddings */ - -#displayparams table { - background: #fff; -} - -#displayparams table tbody td { - border-bottom: 1px dotted #d3d3d3; -} - -.permissiongroups { - margin: 0; -} - -.permissiongroups ul { - clear: both; - margin: 0; - padding: 0.5rem 0; -} - -.permissiongroup input[type=submit], -.permissiongroup input[type=button], -.permissiongroups input[type=submit], -.permissiongroups input[type=button] { - float: left; - margin: 0.3em 0.3em 0 0; -} - -td#displayparams > table.displayparams { - border: none; -} - +#displayparams table { background: #fff; } +#displayparams table tbody td { border-bottom: 1px dotted #d3d3d3; } +.permissiongroups { margin: 0; } +.permissiongroups ul { clear: both; margin: 0; padding: 0.5rem 0; } +.permissiongroup input[type=submit], .permissiongroup input[type=button], .permissiongroups input[type=submit], .permissiongroups input[type=button] { float: left; margin: 0.3em 0.3em 0 0; } +td#displayparams > table.displayparams { border: none; } /* replace warning red color in tabs */ - -strong[style*='color:#EF1D1D'] { - color: yellow !important; -} - -.selected strong[style*='color:#ffeb00'] { - color: red !important; -} - -code { - font-size: inherit; - font-family: Consolas, 'Courier New', 'Courier', monospace; - background-color: #eee; - border: 1px solid #ccc; - padding: 1px 2px; -} - -#resourcesPane .disabledPlugin a:hover { - color: #aaa; -} - +strong[style*='color:#EF1D1D'] { color: yellow !important; } +.selected strong[style*='color:#ffeb00'] { color: red !important; } +code { font-size: inherit; font-family: Consolas, 'Courier New', 'Courier', monospace; background-color: #eee; border: 1px solid #ccc; padding: 1px 2px; } +#resourcesPane .disabledPlugin a:hover { color: #aaa; } /* table styles*/ - -.table, -#documentPane #tv_body table, -#documentPane .tmplvars table, -#documentPane [id*="table-"], -#documentPane [id*="table-tv"] { - width: 100%; -} - -#documentPane .tab-page > table > tr > td:first-child, -#documentPane .tab-page > table > tbody > tr > td:first-child, -#documentPane .tab-page .tmplvars > table > tbody > tr > td:first-child, -#tmplvarsPane .tab-page > table > tbody > tr > td:first-child, -#tmplvarsPane .tab-page > table > tbody > tr > th:first-child, -#chunkPane .tab-page > table > tbody > tr > td:first-child, -#chunkPane .tab-page > table > tbody > tr > th:first-child, -#snipetPane .tab-page > table > tbody > tr > td:first-child, -#snipetPane .tab-page > table > tbody > tr > th:first-child, -#pluginPane .tab-page > table > tbody > tr > td:first-child, -#pluginPane .tab-page > table > tbody > tr > th:first-child, -#modulePane .tab-page > table > tbody > tr > td:first-child, -#modulePane .tab-page > table > tbody > tr > th:first-child, -#docManagerPane .tab-page #dates > table > tbody > tr > td:first-child { - width: 200px -} - -#documentPane .tab-page > table > tr > td:last-child, -#documentPane .tab-page .tmplvars > table > tbody > tr > td:last-child { - width: inherit !important -} - -#documentPane .tab-page > table > tbody > tr > td:first-child > .warning { - display: inline-block; - width: calc(100% - 1rem); -} - -#documentPane .tab-page > table > tbody > tr > td:first-child > [data-tooltip] { - margin-top: 0.3rem; - vertical-align: top -} - -.table--edit { - margin-bottom: 1rem; -} - -.table th, -.table td { - text-align: left; - vertical-align: middle; -} - -table th { - font-weight: 500; -} - -.table--edit th { - width: 200px; - color: #555; - font-size: inherit; -} - -.table--edit input[type="text"], -.table--edit input[type="password"], -.table--edit input[type="number"], -.table--edit textarea, -.table--edit select, -.settings input[type="text"], -.settings input[type="password"], -.settings input[type="number"], -.settings textarea, -.settings select { - width: 300px; -} - +.table, #documentPane #tv_body table, #documentPane .tmplvars table, #documentPane [id*="table-"], #documentPane [id*="table-tv"] { width: 100%; } +#documentPane .tab-page > table > tr > td:first-child, #documentPane .tab-page > table > tbody > tr > td:first-child, #documentPane .tab-page .tmplvars > table > tbody > tr > td:first-child, #tmplvarsPane .tab-page > table > tbody > tr > td:first-child, #tmplvarsPane .tab-page > table > tbody > tr > th:first-child, #chunkPane .tab-page > table > tbody > tr > td:first-child, #chunkPane .tab-page > table > tbody > tr > th:first-child, #snipetPane .tab-page > table > tbody > tr > td:first-child, #snipetPane .tab-page > table > tbody > tr > th:first-child, #pluginPane .tab-page > table > tbody > tr > td:first-child, #pluginPane .tab-page > table > tbody > tr > th:first-child, #modulePane .tab-page > table > tbody > tr > td:first-child, #modulePane .tab-page > table > tbody > tr > th:first-child, #docManagerPane .tab-page #dates > table > tbody > tr > td:first-child { width: 200px } +#documentPane .tab-page > table > tr > td:last-child, #documentPane .tab-page .tmplvars > table > tbody > tr > td:last-child { width: inherit !important } +#documentPane .tab-page > table > tbody > tr > td:first-child > .warning { display: inline-block; width: calc(100% - 1rem); } +#documentPane .tab-page > table > tbody > tr > td:first-child > [data-tooltip] { margin-top: 0.3rem; vertical-align: top } +.table--edit { margin-bottom: 1rem; } +.table th, .table td { text-align: left; vertical-align: middle; } +table th { font-weight: 500; } +.table--edit th { width: 200px; color: #555; font-size: inherit; } +.table--edit input[type="text"], .table--edit input[type="password"], .table--edit input[type="number"], .table--edit textarea, .table--edit select, .settings input[type="text"], .settings input[type="password"], .settings input[type="number"], .settings textarea, .settings select { width: 300px; } /* * MODxRE2 styles * css above is original MODxRE * css below is basicaly MODxRE overrides to get MODxRE2 look */ - /* nav */ - -.no-events { - pointer-events: none; -} - +.no-events { pointer-events: none; } /* Required for Bootstrap3 Collapse */ - -.panel-title > a::before { - content: "\f107"; - /* fa-angle-down */ - font-family: "FontAwesome"; -} - -.panel-title > a.collapsed::before { - content: "\f105"; - /* fa-angle-right */ - padding: 0 1px 0 3px; -} - -.panel-title > a { - font-size: 1.1em; - color: #657587; - display: block; - padding: 3px 0; -} - -.panel-title > a:hover { - text-decoration: none; - color: #1377c5; - background: rgba(255, 255, 255, 0.27); -} - +.panel-title > a::before { content: "\f107"; /* fa-angle-down */ font-family: "FontAwesome"; } +.panel-title > a.collapsed::before { content: "\f105"; /* fa-angle-right */ padding: 0 1px 0 3px; } +.panel-title > a { font-size: 1.1em; color: #657587; display: block; padding: 3px 0; } +.panel-title > a:hover { text-decoration: none; color: #1377c5; background: rgba(255, 255, 255, 0.27); } /* category icons in manage elements */ - -#site_templates, -#site_tmplvars, -#site_htmlsnippets, -#site_snippets, -#site_plugins { - padding-left: 0; -} - -#site_templates li, -#site_tmplvars li, -#site_htmlsnippets li, -#site_snippets li, -#site_snippets li, -#site_plugins li, -#categories_list li { - list-style: none; - margin-left: -21px; -} - -#site_templates li strong:before, -#site_tmplvars li strong:before, -#site_htmlsnippets li strong:before, -#site_snippets li strong:before, -#site_snippets li strong:before, -#site_plugins li strong:before, -#categories_list li strong:before { - font-family: "FontAwesome"; - font-style: normal; - font-weight: normal; - color: #5b6f7a; - padding: 0 5px 0 5px; - content: '\f105'; -} - -.tab-pane ul li ul li strong:before { - content: ''; -} - +#site_templates, #site_tmplvars, #site_htmlsnippets, #site_snippets, #site_plugins { padding-left: 0; } +#site_templates li, #site_tmplvars li, #site_htmlsnippets li, #site_snippets li, #site_snippets li, #site_plugins li, #categories_list li { list-style: none; margin-left: -21px; } +#site_templates li strong:before, #site_tmplvars li strong:before, #site_htmlsnippets li strong:before, #site_snippets li strong:before, #site_snippets li strong:before, #site_plugins li strong:before, #categories_list li strong:before { font-family: "FontAwesome"; font-style: normal; font-weight: normal; color: #5b6f7a; padding: 0 5px 0 5px; content: '\f105'; } +.tab-pane ul li ul li strong:before { content: ''; } /* elements icons in manage elements */ - -a.man_el_name:before { - font-family: "FontAwesome"; - font-style: normal; - font-weight: normal; - font-size: 0.875rem; - color: #5b6f7a; -} - -a.man_el_name.site_templates:before { - content: '\f1ea'; -} - -a.man_el_name.site_tmplvars:before { - content: '\f022'; -} - -a.man_el_name.site_htmlsnippets:before { - content: '\f009'; -} - -a.man_el_name.site_snippets:before { - content: '\f121'; -} - -a.man_el_name.site_plugins:before { - content: '\f1e6'; -} - -a.man_el_name.site_modules:before { - content: '\f085'; -} - -div#tabCategory.tab-page ul li ul li { - padding-top: 7px; - padding-bottom: 7px; -} - +a.man_el_name:before { font-family: "FontAwesome"; font-style: normal; font-weight: normal; font-size: 0.875rem; color: #5b6f7a; } +a.man_el_name.site_templates:before { content: '\f1ea'; } +a.man_el_name.site_tmplvars:before { content: '\f022'; } +a.man_el_name.site_htmlsnippets:before { content: '\f009'; } +a.man_el_name.site_snippets:before { content: '\f121'; } +a.man_el_name.site_plugins:before { content: '\f1e6'; } +a.man_el_name.site_modules:before { content: '\f085'; } +div#tabCategory.tab-page ul li ul li { padding-top: 7px; padding-bottom: 7px; } /*Fake tables for providing dynamic amount of cells per row*/ - -.rTable { - display: table; - width: 100%; - padding: 0; -} - -.rTableRow { - display: table-row; - padding: 0; -} - -.rTableHeading { - display: table-header-group; -} - -.rTableBody { - display: table-row-group; -} - -.rTableFoot { - display: table-footer-group; -} - -.lockCell, -.mainCell, -.btnCell, -.rTableHead { - display: table-cell; - padding: 0; -} - -.lockCell { - width: 2.5em; - padding-left: 10px; -} - -.mainCell { - width: auto; -} - -.btnCell { - width: 6em; - text-align: right; - padding-right: 1rem; -} - -.mainCell > span { - display: block -} - +.rTable { display: table; width: 100%; padding: 0; } +.rTableRow { display: table-row; padding: 0; } +.rTableHeading { display: table-header-group; } +.rTableBody { display: table-row-group; } +.rTableFoot { display: table-footer-group; } +.lockCell, .mainCell, .btnCell, .rTableHead { display: table-cell; padding: 0; } +.lockCell { width: 2.5em; padding-left: 10px; } +.mainCell { width: auto; } +.btnCell { width: 6em; text-align: right; padding-right: 1rem; } +.mainCell > span { display: block } /* Manage elements general styles */ - -a.man_el_name { - display: block; - padding: .1em 0 .1em 1.25rem; -} - -a.man_el_name:hover { - text-decoration: none; -} - -.lockCell + .mainCell a.man_el_name { - padding-left: 0 !important; -} - -.lockCell + .mainCell a.man_el_name:before { - display: none; -} - -.elements_descr { - color: #222; - margin-left: 1em; - font-size: 0.88em; -} - -.resourceTable .panel-heading { - margin: 0 -1.25rem !important; - background-color: #f5f5f5; - border-top: 1px dotted #dedede; - border-bottom: 1px dotted #dedede; -} - -.resourceTable .panel-title > a { - padding: 5px 1.25rem; - text-decoration: none -} - -.resourceTable ul.elements { - margin: 0 -1.25rem; - padding: 0 0 10px 0; -} - -.resourceTable ul.elements > li { - padding: 0 !important; - border-bottom: 1px dotted #dedede; - border-left: 3px solid #fff; - transition: all 0.1s ease; - margin: 0 !important; -} - -.resourceTable ul.elements > li:hover { - background: #f9f9f9; - border-left: 3px solid #1377c5; -} - -.resourceTable ul.elements > li::before { - display: none -} - -#resourcesPane .panel-group ul {} - -ul.resourceTable .category_name { - float: none; - display: block; - clear: both; - margin-top: 20px; -} - +a.man_el_name { display: block; padding: .1em 0 .1em 1.25rem; } +a.man_el_name:hover { text-decoration: none; } +.lockCell + .mainCell a.man_el_name { padding-left: 0 !important; } +.lockCell + .mainCell a.man_el_name:before { display: none; } +.elements_descr { color: #222; margin-left: 1em; font-size: 0.88em; } +.resourceTable .panel-heading { margin: 0 -1.25rem !important; background-color: #f5f5f5; border-top: 1px dotted #dedede; border-bottom: 1px dotted #dedede; } +.resourceTable .panel-title > a { padding: 5px 1.25rem; text-decoration: none } +.resourceTable ul.elements { margin: 0 -1.25rem; padding: 0 0 10px 0; } +.resourceTable ul.elements > li { padding: 0 !important; border-bottom: 1px dotted #dedede; border-left: 3px solid #fff; transition: all 0.1s ease; margin: 0 !important; } +.resourceTable ul.elements > li:hover { background: #f9f9f9; border-left: 3px solid #1377c5; } +.resourceTable ul.elements > li::before { display: none } +#resourcesPane .panel-group ul { } +ul.resourceTable .category_name { float: none; display: block; clear: both; margin-top: 20px; } /* Manager Elements Buttons bar*/ - -ul.elements_buttonbar { - list-style: none; - margin: 0; - padding: 0; - display: table; - table-layout: fixed; -} - -ul.elements_buttonbar li { - display: table-cell; - padding: 0 !important; - width: 2em; -} - -ul.elements_buttonbar li a { - display: block; - width: 2em; - padding: 4px 2px 2px 2px; - margin: 1px; - min-width: 22px; -} - -ul.elements_buttonbar .fa { - font-size: 0.875rem; - padding: 1px 1px 0; -} - +ul.elements_buttonbar { list-style: none; margin: 0; padding: 0; display: table; table-layout: fixed; } +ul.elements_buttonbar li { display: table-cell; padding: 0 !important; width: 2em; } +ul.elements_buttonbar li a { display: block; width: 2em; padding: 4px 2px 2px 2px; margin: 1px; min-width: 22px; } +ul.elements_buttonbar .fa { font-size: 0.875rem; padding: 1px 1px 0; } /* Checkbox "Icons" */ - -.noicons.tab-page ul li ul li a:before, -.noicons .elements_description a:before { - display: none !important; -} - +.noicons.tab-page ul li ul li a:before, .noicons .elements_description a:before { display: none !important; } /* View-dependent styles */ - /* List-view */ - -.resourceTable.list li {} - -.sortableList > li::before { - display: none -} - +.resourceTable.list li { } +.sortableList > li::before { display: none } /* Inline-view */ - -.resourceTable.inline ul.elements { - margin: 0 !important; -} - -.resourceTable.inline ul.elements > li { - float: left; - margin: 10px 10px 0 0 !important; - padding: 0 !important; - border: 1px dotted #dedede; -} - -.resourceTable.inline ul.elements_buttonbar { - margin: 0 5px 0 0 !important; -} - -.resourceTable.inline a.man_el_name { - padding: 5px 10px; -} - -.resourceTable.inline ul.elements > li:hover { - border: 1px solid #aaa -} - +.resourceTable.inline ul.elements { margin: 0 !important; } +.resourceTable.inline ul.elements > li { float: left; margin: 10px 10px 0 0 !important; padding: 0 !important; border: 1px dotted #dedede; } +.resourceTable.inline ul.elements_buttonbar { margin: 0 5px 0 0 !important; } +.resourceTable.inline a.man_el_name { padding: 5px 10px; } +.resourceTable.inline ul.elements > li:hover { border: 1px solid #aaa } /* Flex-view */ - -.resourceTable.flex ul.elements { - -webkit-column-gap: 10px; - -moz-column-gap: 10px; - -o-column-gap: 10px; - column-gap: 10px; -} - -.resourceTable.flex ul.elements {} - -.resourceTable.flex ul.elements > li { - overflow: hidden; - /* fix for Firefox */ - break-inside: avoid-column; - -webkit-column-break-inside: avoid; - -moz-column-break-inside: avoid; - -o-column-break-inside: avoid; - -ms-column-break-inside: avoid; - column-break-inside: avoid; - page-break-inside: avoid -} - -.resourceTable.flex .elements_descr { - display: block; - margin-left: 1.5em; -} - -#content_body #which_editor { - margin-top: 12px; -} - +.resourceTable.flex ul.elements { -webkit-column-gap: 10px; -moz-column-gap: 10px; -o-column-gap: 10px; column-gap: 10px; } +.resourceTable.flex ul.elements { } +.resourceTable.flex ul.elements > li { overflow: hidden; /* fix for Firefox */ break-inside: avoid-column; -webkit-column-break-inside: avoid; -moz-column-break-inside: avoid; -o-column-break-inside: avoid; -ms-column-break-inside: avoid; column-break-inside: avoid; page-break-inside: avoid } +.resourceTable.flex .elements_descr { display: block; margin-left: 1.5em; } +#content_body #which_editor { margin-top: 12px; } /* resource children list */ - -#tabChildren .grid th, -#tabChildren .grid tr > td:nth-child(5), -#tabChildren .grid tr > td:nth-child(6) { - text-align: center; - white-space: nowrap -} - -#tabChildren .grid td { - text-align: right; - white-space: nowrap -} - -#tabChildren .grid tr > th:nth-child(2), -#tabChildren .grid tr > td:nth-child(2) { - text-align: left; - white-space: normal -} - -#tabChildren .grid tr > td:nth-child(6) a { - padding: 0 .2em; - font-size: 0.9rem; - color: #444; -} - +#tabChildren .grid th, #tabChildren .grid tr > td:nth-child(5), #tabChildren .grid tr > td:nth-child(6) { text-align: center; white-space: nowrap } +#tabChildren .grid td { text-align: right; white-space: nowrap } +#tabChildren .grid tr > th:nth-child(2), #tabChildren .grid tr > td:nth-child(2) { text-align: left; white-space: normal } +#tabChildren .grid tr > td:nth-child(6) a { padding: 0 .2em; font-size: 0.9rem; color: #444; } /* element-edit-message */ - -.msg-container { - padding-bottom: 10px; - border-bottom: 1px solid #ededed; - margin-bottom: 1rem; - color: #777; -} - -.btn-small { - padding: 2px 4px !important; - font-size: 11px !important; -} - -.relative { - position: relative; -} - -.modx-alert { - display: block; - margin: 60px 10px 10px 10px; - padding: 1em; -} - -.modx-alert.alert-error { - background-color: #ffd0d0; - border: 1px solid #f00; - color: #000; -} - -tr.userIdle td { - color: #aaa; -} - -tr.userIdle td strong:before { - font-family: "FontAwesome"; - font-style: normal; - font-weight: normal; - color: #aaa; - padding: 0 5px 0 0; - content: '\f017'; -} +.msg-container { padding-bottom: 10px; border-bottom: 1px solid #ededed; margin-bottom: 1rem; color: #777; } +.btn-small { padding: 2px 4px !important; font-size: 11px !important; } +.relative { position: relative; } +.modx-alert { display: block; margin: 60px 10px 10px 10px; padding: 1em; } +.modx-alert.alert-error { background-color: #ffd0d0; border: 1px solid #f00; color: #000; } +tr.userIdle td { color: #aaa; } +tr.userIdle td strong:before { font-family: "FontAwesome"; font-style: normal; font-weight: normal; color: #aaa; padding: 0 5px 0 0; content: '\f017'; } diff --git a/manager/media/style/default/css/mainmenu.css b/manager/media/style/default/css/mainmenu.css index 60c2df7e29..9aae587a8d 100755 --- a/manager/media/style/default/css/mainmenu.css +++ b/manager/media/style/default/css/mainmenu.css @@ -1,739 +1,156 @@ /* #mainMenu */ - -#mainMenu { - background-color: #343944; - color: #8b9298; - -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, .3); - box-shadow: 0 2px 4px rgba(0, 0, 0, .3); -} - -#mainMenu.show { - overflow: visible -} - -#mainMenu + #tree::before, -#mainMenu + #tree + #main::before { - content: ""; - position: fixed; - z-index: 9999; - left: 0; - top: 0; - right: 0; - bottom: 0; - background-color: rgba(0, 0, 0, .1); - opacity: 0; - visibility: hidden; - -webkit-transition: opacity .15s, visibility .15s; - transition: opacity .15s, visibility .15s; -} - -#mainMenu.show + #tree::before, -#mainMenu.show + #tree + #main::before { - opacity: 1; - visibility: visible -} - -#mainMenu > .container { - display: table; - width: 100%; - border-collapse: collapse -} - -#mainMenu > .container > .row { - display: table-row -} - -#mainMenu > .container > .row > .cell { - display: table-cell; - vertical-align: top; -} - -#mainMenu #nav { - float: left; -} - -#mainMenu #settings { - float: right; -} - -#mainMenu .nav { - margin: 0; - white-space: nowrap; - font-size: 0 -} - -#mainMenu .nav > li { - position: relative; - display: inline-block; - font-size: 0.8rem; - vertical-align: top -} - -#mainMenu .nav > li.active > a { - color: #fff; - background-color: rgba(255, 255, 255, 0.07) -} - -#mainMenu .nav > li > a, -#mainMenu .nav .label_searchid { - display: block; - position: relative; - z-index: 1; - padding: 0 1rem; - height: 2.2rem; - line-height: 2.3rem; - text-decoration: none; - color: #DCD9E3; - transition-duration: 0.15s -} - -#mainMenu .nav > li > a:hover, -#mainMenu .nav .label_searchid:hover { - color: #f3f3f3; -} - +#mainMenu { background-color: #2b323a; color: #8b9298; -webkit-box-shadow: 0 0.15rem 0.15rem rgba(0, 0, 0, 0.25); box-shadow: 0 0.15rem 0.15rem rgba(0, 0, 0, 0.25); } +#mainMenu.show { overflow: visible } +#mainMenu + #tree::before, #mainMenu + #tree + #main::before { content: ""; position: absolute; z-index: 9999; left: 0; top: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, .1); opacity: 0; visibility: hidden; -webkit-transition: opacity .15s, visibility .15s; transition: opacity .15s, visibility .15s; } +#mainMenu.show + #tree::before, #mainMenu.show + #tree + #main::before { opacity: 1; visibility: visible } +#mainMenu > .container { display: table; width: 100%; border-collapse: collapse } +#mainMenu > .container > .row { display: table-row } +#mainMenu > .container > .row > .cell { display: table-cell; vertical-align: top; } +#mainMenu #nav { float: left; } +#mainMenu #settings { float: right; } +#mainMenu .nav { margin: 0; white-space: nowrap; font-size: 0 } +#mainMenu .nav > li { position: relative; display: inline-block; font-size: 0.8rem; vertical-align: top } +#mainMenu .nav > li.active > a { color: #fff; background-color: rgba(255, 255, 255, 0.07) } +#mainMenu .nav > li > a, #mainMenu .nav .label_searchid { display: block; position: relative; z-index: 1; padding: 0 1rem; height: 2.2rem; line-height: 2.3rem; text-decoration: none; color: #bbb; transition-duration: 0.15s } +#mainMenu .nav > li > a:hover, #mainMenu .nav .label_searchid:hover { color: #f3f3f3; } /*#mainMenu.show .nav > li.dropdown:hover > a, */ - -#mainMenu.show .nav > li.dropdown.hover > a { - background-color: #fff; - color: #444; -} - -#mainMenu .nav > li > a .icon { - display: inline-block; - overflow: hidden; - width: auto; - height: 2rem; - line-height: 2rem; - font-size: 1.5em; - text-align: center; - margin: 0.05rem 0 0 0.5rem; - vertical-align: top; - border-radius: 50%; - background: no-repeat 50% 50%; - background-size: cover; -} - -#mainMenu .nav > li > a .icon.photo { - width: 2rem -} - -#mainMenu .nav > li > a .icon .fa { - font-size: 1.2rem; - line-height: 2.1rem -} - -#mainMenu .nav > li .fa { - min-width: 1em; - line-height: 2.2rem; - font-size: 0.875rem; - vertical-align: top -} - -#mainMenu #nav > li > a > .fa { - display: none -} - -#mainMenu #nav #bars { - width: 3.5rem; - text-align: center -} - -#mainMenu #nav #bars a { - padding: 0 1rem; -} - -#mainMenu #nav #bars .fa { - display: inline-block; - min-width: 0.25rem; - width: 1.5rem; - margin: 0; - text-align: center; - overflow: hidden; - -webkit-transition-duration: 0.15s; - transition-duration: 0.15s -} - -.sidebar-closed #mainMenu #nav #bars .fa { - width: 0.25rem; -} - -#mainMenu #system > a > .fa { - font-size: 1.3rem -} - -#mainMenu .nav .caret, -#mainMenu .nav .divider, -.dropdown-toggle::after { - display: none -} - -#mainMenu .nav > li > ul { - display: block; - position: absolute; - z-index: 0; - overflow: auto; - overflow-x: hidden; - top: 100%; - left: 0; - margin: 0; - padding: 0 0 0.25rem; - min-width: 15rem; - max-height: -webkit-calc(100vh - 2.2rem); - max-height: calc(100vh - 2.2rem); - font-size: 1em; - border: none; - border-radius: 0 0 0.25rem 0.25rem; - background-color: #fff; - box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2); - opacity: 0; - visibility: hidden; - -webkit-transition-duration: 0.1s; - transition-duration: 0.1s; -} - +#mainMenu.show .nav > li.dropdown.hover > a { background-color: #fff; color: #444; } +#mainMenu .nav > li > a .icon { display: inline-block; overflow: hidden; width: auto; height: 2rem; line-height: 2rem; font-size: 1.5em; text-align: center; margin: 0.05rem 0 0 0.5rem; vertical-align: top; border-radius: 50%; background: no-repeat 50% 50%; background-size: cover; } +#mainMenu .nav > li > a .icon.photo { width: 2rem } +#mainMenu .nav > li > a .icon .fa { font-size: 1.2rem; line-height: 2.1rem } +#mainMenu .nav > li .fa { min-width: 1em; line-height: 2.2rem; font-size: .875rem; vertical-align: top } +#mainMenu #nav > li > a > .fa { display: none } +#mainMenu #nav #bars { width: 3.5rem; text-align: center } +#mainMenu #nav #bars a { padding: 0 1rem; } +#mainMenu #nav #bars .fa { display: inline-block; min-width: 0.25rem; width: 1.5rem; margin: 0; text-align: center; overflow: hidden; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } +.sidebar-closed #mainMenu #nav #bars .fa { width: 0.25rem; } +#mainMenu #system > a > .fa { font-size: 1.1rem } +#mainMenu .nav .caret, #mainMenu .nav .divider, .dropdown-toggle::after { display: none } +#mainMenu .nav > li > ul { display: block; position: absolute; z-index: 0; overflow: auto; overflow-x: hidden; top: 100%; left: 0; margin: 0; padding: 0 0 0.25rem; min-width: 15rem; max-height: -webkit-calc(100vh - 2.2rem); max-height: calc(100vh - 2.2rem); font-size: 1em; border: none; border-radius: 0 0 0.25rem 0.25rem; background-color: #fff; box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2); opacity: 0; visibility: hidden; -webkit-transition-duration: 0.1s; transition-duration: 0.1s; } /*#mainMenu.show .nav > li:hover > a + ul, */ - -#mainMenu.show .nav > li.hover > a + ul, -#mainMenu.show .nav > li.hover > ul.sub-menu.show { - opacity: 1; - visibility: visible -} - -#mainMenu.show .nav > li > ul.sub-menu { - left: 15rem; - opacity: 0; - visibility: hidden; -} - -#mainMenu.show .nav > li:hover > ul.sub-menu {} - -#mainMenu.show .nav > li:hover > ul.sub-menu.show {} - -#mainMenu #settings.nav > li > ul { - left: auto; - right: 0 -} - -#mainMenu .nav > li > ul > li { - border-bottom: 1px solid rgba(0, 0, 0, 0.05); - margin-bottom: -1px; -} - -#mainMenu .nav > li > ul > li:last-child { - border: none; - margin-bottom: 0 -} - -#mainMenu .nav > li > ul > li.item-input { - padding: 0.375em 0.5em; -} - -#mainMenu .nav > li > ul > li > a:first-child, -#mainMenu .nav > li > ul > li > span { - display: block; - position: relative; - padding: 0 2rem 0 1rem; - line-height: 2.2rem; - color: #444; - text-decoration: none -} - -#mainMenu .nav > li > ul > li.hover > a:first-child { - color: #444; - background-color: #eee; -} - -#mainMenu .nav > li > ul > li > span:first-child { - padding: 0 1rem; - text-align: center; - font-size: 0.875em; - color: #aaa; -} - -#mainMenu .nav > li > ul > li.dropdown-back > span { - text-align: left; - font-size: inherit; - color: inherit -} - -#mainMenu .nav > li > ul > li.dropdown-back > span * { - pointer-events: none -} - -#mainMenu .nav > li > ul > li .fa { - width: 1.3em; - margin-right: 0.5em; - font-size: .9rem; - line-height: .8rem; - text-align: center; - vertical-align: baseline -} - -#mainMenu .nav > li > ul > li.selected a:first-child::before, -#main .evo-tab-row .tab.changed::before { - content: ''; - position: absolute; - right: 0.25em; - top: 0.25em; - width: 0.5em; - height: 0.5em; - background-color: #ffc107; - -webkit-border-radius: 50%; - border-radius: 50%; - pointer-events: none -} - -#mainMenu .nav > li > ul > li.dropdown-toggle > a > .toggle { - position: absolute; - top: 0; - right: 0; - height: 100%; - width: 2rem; - margin: 0; - line-height: 2rem; - text-align: center; -} - -#mainMenu .nav > li > ul > li.disabled > a { - opacity: 0.5; - color: #7d2a24; -} - -#mainMenu .nav > li > ul > li.locked > a { - font-style: italic -} - -#mainMenu .nav > li > ul > li > a small { - line-height: 1em -} - -#mainMenu .nav li.item-group { - display: table; - width: 100%; - border-collapse: separate -} - -#mainMenu .nav li.item-group > * { - display: table-cell !important; - width: 1%; - padding: 0 .75rem; - border: none !important; - border-left: 1px solid rgba(0, 0, 0, 0.05) !important; - border-radius: 0 -} - -#mainMenu .nav li.item-group > *:first-child { - width: 100% -} - -#mainMenu .nav li.item-group > *:not(:first-child) .fa { - margin-right: 0 -} - -#mainMenu .account #msgCounter { - display: none; - position: absolute; - z-index: 1; - right: 0.4rem; - top: 0.4rem; - width: 0.4rem; - height: 0.4rem; - background-color: #ffc107; - font-size: 0; - border-radius: 50%; - ; -} - -#mainMenu .account #newMail { - display: none -} - +#mainMenu.show .nav > li.hover > a + ul, #mainMenu.show .nav > li.hover > ul.sub-menu.show { opacity: 1; visibility: visible } +#mainMenu.show .nav > li > ul.sub-menu { left: 15rem; opacity: 0; visibility: hidden; } +#mainMenu.show .nav > li:hover > ul.sub-menu { } +#mainMenu.show .nav > li:hover > ul.sub-menu.show { } +#mainMenu #settings.nav > li > ul { left: auto; right: 0 } +#mainMenu .nav > li > ul > li { border-bottom: 1px solid rgba(0, 0, 0, 0.05); margin-bottom: -1px; } +#mainMenu .nav > li > ul > li:last-child { border: none; margin-bottom: 0 } +#mainMenu .nav > li > ul > li.item-input { padding: 0.375em 0.5em; } +#mainMenu .nav > li > ul > li > a:first-child, #mainMenu .nav > li > ul > li > span { display: block; position: relative; padding: 0 2rem 0 1rem; line-height: 2.2rem; color: #444; text-decoration: none } +#mainMenu .nav > li > ul > li.hover > a:first-child { color: #fff; background-color: #1976d2; } +#mainMenu .nav > li > ul > li > span:first-child { padding: 0 1rem; text-align: center; font-size: 0.875em; color: #aaa; } +#mainMenu .nav > li > ul > li.dropdown-back > span { text-align: left; font-size: inherit; color: inherit } +#mainMenu .nav > li > ul > li.dropdown-back > span * { pointer-events: none } +#mainMenu .nav > li > ul > li .fa { width: 1.3em; margin-right: 0.5em; font-size: .875rem; line-height: .8rem; text-align: center; vertical-align: baseline } +#mainMenu .nav > li > ul > li.selected a:first-child::before, #main .evo-tab-row .tab.changed::before { content: ''; position: absolute; right: 0.25em; top: 0.25em; width: 0.5em; height: 0.5em; background-color: #ffc107; -webkit-border-radius: 50%; border-radius: 50%; pointer-events: none } +#mainMenu .nav > li > ul > li.dropdown-toggle > a > .toggle { position: absolute; top: 0; right: 0; height: 100%; width: 2rem; margin: 0; line-height: 2rem; text-align: center; } +#mainMenu .nav > li > ul > li.disabled > a { opacity: 0.5; color: #7d2a24; } +#mainMenu .nav > li > ul > li.locked > a { font-style: italic } +#mainMenu .nav > li > ul > li > a small { line-height: 1em } +#mainMenu .nav li.item-group { display: table; width: 100%; border-collapse: separate } +#mainMenu .nav li.item-group > * { display: table-cell !important; width: 1%; padding: 0 .75rem; border: none !important; border-left: 1px solid rgba(0, 0, 0, 0.05) !important; border-radius: 0 } +#mainMenu .nav li.item-group > *:first-child { width: 100% } +#mainMenu .nav li.item-group > *:not(:first-child) .fa { margin-right: 0 } +#mainMenu .account #msgCounter { display: none; position: absolute; z-index: 1; right: 0.4rem; top: 0.4rem; width: 0.4rem; height: 0.4rem; background-color: #ffc107; font-size: 0; border-radius: 50%;; } +#mainMenu .account #newMail { display: none } /* statusbar */ - -#statusbar { - position: relative; - width: 1rem; - height: 2.2rem; - line-height: 2.4rem; - font-size: 0.875em; - white-space: nowrap; - float: left; -} - -#statusbar .fa { - font-size: 0.875rem -} - -#statusbar #buildText, -#statusbar #workText { - display: none -} - -#statusbar .fa { - margin-right: 0.375rem -} - -#statusbar .fa-warning { - color: #f44336 -} - +#statusbar { position: relative; width: 1rem; height: 2.2rem; line-height: 2.4rem; font-size: 0.875em; white-space: nowrap; float: left; } +#statusbar .fa { font-size: 0.875rem } +#statusbar #buildText, #statusbar #workText { display: none } +#statusbar .fa { margin-right: 0.375rem } +#statusbar .fa-warning { color: #f44336 } /* search */ - -#mainMenu #searchform { - position: relative -} - -#mainMenu #searchform label { - position: relative; - z-index: 1; - margin: 0; - cursor: pointer; -} - -#mainMenu #searchform input { - position: absolute; - z-index: 0; - top: 0; - right: 0; - min-height: 1.5rem; - height: 1.5rem; - width: 0; - padding: 0 0.5rem; - margin: 0.345rem; - border: 1px solid rgba(255, 255, 255, 0.1); - border-radius: 0; - background: rgba(0, 0, 0, 0.1); - color: #fff; - text-align: left; - opacity: 0; - outline: none; - -webkit-transition: opacity 0.2s, width 0.2s; - transition: opacity 0.2s, width 0.2s; -} - -#mainMenu #searchform input:focus { - z-index: 9; - width: 15rem; - max-width: 15rem; - background: #000; - text-align: left; - border-color: rgba(255, 255, 255, 0.75); - opacity: 1 -} - -#mainMenu #searchform input:focus + .mask { - opacity: 0.7; - visibility: visible; -} - -#mainMenu #searchform .mask { - content: ""; - position: absolute; - z-index: 5; - top: 0; - right: -999rem; - right: -100vw; - left: -999rem; - left: -100vw; - height: 2.2rem; - opacity: 0; - visibility: hidden; - background-color: rgba(0, 0, 0, 0.65); - -webkit-transition-duration: 0.3s; - transition-duration: 0.3s; - transform: translateZ(0) -} - -#mainMenu #searchform .fa-search { - position: relative; - z-index: 1 -} - -#mainMenu #searchform .fa-refresh { - position: absolute; - z-index: 9; - display: none; - top: 0.6rem; - right: 0.8rem; - line-height: 1em -} - +#mainMenu #searchform { position: relative } +#mainMenu #searchform label { position: relative; z-index: 1; margin: 0; cursor: pointer; } +#mainMenu #searchform input { position: absolute; z-index: 0; top: 0; right: 0; min-height: 1.5rem; height: 1.5rem; width: 0; padding: 0 0.5rem; margin: 0.345rem; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 0; background: rgba(0, 0, 0, 0.1); color: #fff; text-align: left; opacity: 0; outline: none; -webkit-transition: opacity 0.2s, width 0.2s; transition: opacity 0.2s, width 0.2s; } +#mainMenu #searchform input:focus { z-index: 9; width: 15rem; max-width: 15rem; background: #000; text-align: left; border-color: rgba(255, 255, 255, 0.75); opacity: 1 } +#mainMenu #searchform input:focus + .mask { opacity: 0.7; visibility: visible; } +#mainMenu #searchform .mask { content: ""; position: absolute; z-index: 5; top: 0; right: -999rem; right: -100vw; left: -999rem; left: -100vw; height: 2.2rem; opacity: 0; visibility: hidden; background-color: rgba(0, 0, 0, 0.65); -webkit-transition-duration: 0.3s; transition-duration: 0.3s; transform: translateZ(0) } +#mainMenu #searchform .fa-search { position: relative; z-index: 1 } +#mainMenu #searchform .fa-refresh { position: absolute; z-index: 9; display: none; top: 0.6rem; right: 0.8rem; line-height: 1em } /* #searchresult */ - -#searchresult { - position: absolute; - z-index: 99; - overflow: hidden; - top: 2.2rem; - right: 0; - bottom: 0; - width: 0; - max-width: 100%; - background-color: #fff; - border-left: 1px solid rgba(0, 0, 0, 0.1); - opacity: 0; - visibility: hidden; - -webkit-transition: 0.25s ease 0.5s; - transition: 0.25s ease 0.5s; - -webkit-transition-delay: 0.3s; - transition-delay: 0.3s; -} - -#searchresult.open { - width: 20rem; - box-shadow: 0 0 4.5rem rgba(0, 0, 0, 0.15); - opacity: 1; - visibility: visible; - -webkit-transition: 0.5s ease 0.5s; - transition: 0.5s ease 0.5s; - -webkit-transition-delay: 0s; - transition-delay: 0s -} - -#searchresult .ajaxSearchResults { - width: 20rem; - height: 100%; - overflow: auto; -} - -#searchresult .ajaxSearchResults ul, -#searchresult .ajaxSearchResults li { - margin: 0; - padding: 0; - list-style: none -} - -#searchresult .ajaxSearchResults b, -#searchresult .ajaxSearchResults strong, -#searchresult .ajaxSearchResults a { - position: relative; - z-index: 0; - display: block; - color: #333; - padding: 0.25rem 1rem; - margin-top: -1px; - border-top: 1px solid rgba(0, 0, 0, 0.03); - border-bottom: 1px solid rgba(0, 0, 0, 0.03); - box-sizing: border-box -} - -#searchresult .ajaxSearchResults b { - z-index: 1; - background-color: #ddd -} - -#searchresult .ajaxSearchResults a { - padding: 0.25rem 2rem 0.25rem 1rem; - text-decoration: none; -} - -#searchresult .ajaxSearchResults a:hover { - color: #333; - background-color: #f2f2f2; -} - -#searchresult .ajaxSearchResults a > i { - position: absolute; - right: 0; - top: 50%; - width: 2rem; - height: 2rem; - margin-top: -1rem; - line-height: 2rem; - text-align: center; - color: #1976d2; -} - -#searchresult .ajaxSearchResults a.selected > i { - color: #fff -} - -#searchresult .ajaxSearchResults a.selected { - z-index: 1; - background-color: #1976d2; - color: #fff; - font-weight: 700; -} - -#searchresult .ajaxSearchResults a .text-danger { - color: #333; - font-weight: 700 -} - -#searchresult .ajaxSearchResults a.selected .text-danger { - color: #ffc107; - text-shadow: 0 0 1px rgba(0, 0, 0, 0.5); -} - -#searchresult .ajaxSearchResults .locked a { - font-style: italic; - color: #646464; -} - -#searchresult .ajaxSearchResults .disabled a { - opacity: .5; - color: #7d2a24; -} - -#searchresult .ajaxSearchResults .deleted a { - color: #a52a2a; - text-decoration: line-through -} - +#searchresult { position: absolute; z-index: 99; overflow: hidden; top: 2.2rem; right: 0; bottom: 0; width: 0; max-width: 100%; background-color: #fff; border-left: 1px solid rgba(0, 0, 0, 0.1); opacity: 0; visibility: hidden; -webkit-transition: 0.25s ease 0.5s; transition: 0.25s ease 0.5s; -webkit-transition-delay: 0.3s; transition-delay: 0.3s; } +#searchresult.open { width: 20rem; box-shadow: 0 0 4.5rem rgba(0, 0, 0, 0.15); opacity: 1; visibility: visible; -webkit-transition: 0.5s ease 0.5s; transition: 0.5s ease 0.5s; -webkit-transition-delay: 0s; transition-delay: 0s } +#searchresult .ajaxSearchResults { width: 20rem; height: 100%; overflow: auto; } +#searchresult .ajaxSearchResults ul, #searchresult .ajaxSearchResults li { margin: 0; padding: 0; list-style: none } +#searchresult .ajaxSearchResults b, #searchresult .ajaxSearchResults strong, #searchresult .ajaxSearchResults a { position: relative; z-index: 0; display: block; color: #333; padding: 0.25rem 1rem; margin-top: -1px; border-top: 1px solid rgba(0, 0, 0, 0.03); border-bottom: 1px solid rgba(0, 0, 0, 0.03); box-sizing: border-box } +#searchresult .ajaxSearchResults b { z-index: 1; background-color: #ddd } +#searchresult .ajaxSearchResults a { padding: 0.25rem 2rem 0.25rem 1rem; text-decoration: none; } +#searchresult .ajaxSearchResults a:hover { color: #333; background-color: #f2f2f2; } +#searchresult .ajaxSearchResults a > i { position: absolute; right: 0; top: 50%; width: 2rem; height: 2rem; margin-top: -1rem; line-height: 2rem; text-align: center; color: #1976d2; } +#searchresult .ajaxSearchResults a.selected > i { color: #fff } +#searchresult .ajaxSearchResults a.selected { z-index: 1; background-color: #1976d2; color: #fff; font-weight: 700; } +#searchresult .ajaxSearchResults a .text-danger { color: #333; font-weight: 700 } +#searchresult .ajaxSearchResults a.selected .text-danger { color: #ffc107; text-shadow: 0 0 1px rgba(0, 0, 0, 0.5); } +#searchresult .ajaxSearchResults .locked a { font-style: italic; color: #646464; } +#searchresult .ajaxSearchResults .disabled a { opacity: .5; color: #7d2a24; } +#searchresult .ajaxSearchResults .deleted a { color: #a52a2a; text-decoration: line-through } @media (min-width: 1200px) { - #searchresult { - top: 3.125rem; - } - #mainMenu #nav #site::before { - content: ""; - display: block; - overflow: hidden; - width: 10rem; - background: url("../images/misc/logo-navbar.png") 0 50% no-repeat; - background-size: 88%; - } - #mainMenu #nav #site::before, - #mainMenu #nav #site a { - float: left - } - #mainMenu, - #mainMenu .nav > li > a, - #mainMenu .nav .label_searchid, - #mainMenu .nav > li > a .icon, - #mainMenu #searchform .mask, - #mainMenu #nav #site::before { - height: 3.125rem; - } - #mainMenu .nav > li > a, - #mainMenu .nav .label_searchid, - #mainMenu .nav > li .fa, - #mainMenu .nav > li > a .icon { - line-height: 3.1rem; - } - #mainMenu .nav > li > a .icon.photo { - width: 2.5rem; - height: 2.5rem; - margin-top: .3rem; - } - #mainMenu #nav > li > a { - padding: 0 1.3rem; - font-size: .875rem; - } - #mainMenu #nav > li > a > .fa { - display: none - } - #mainMenu .nav > li > a .icon .fa { - line-height: 3rem; - font-size: 1.5rem; - } - #mainMenu .nav > li > ul { - -webkit-transform: scale(.9); - transform: scale(.9); - box-shadow: 0 0.5rem 3rem rgba(0, 0, 0, 0.4); - } - #mainMenu .nav > li > ul > li.item-input { - padding: 0.575em 0.5em; - } - #mainMenu.show .nav > li.hover > a + ul, - #mainMenu.show .nav > li.hover > ul.sub-menu.show { - -webkit-transform: scale(1); - transform: scale(1); - } - #mainMenu.show + #tree, - #mainMenu.show + #tree + #main { - -webkit-filter: blur(1px); - filter: blur(1px) - } - #mainMenu.show .nav > li.dropdown.hover > a { - background-color: #48535f; - color: #fff; - } - #mainMenu .nav > li > ul > li > a:first-child, - #mainMenu .nav > li > ul > li > span { - line-height: 2.5rem; - } - #mainMenu #searchform input { - min-height: 2rem; - height: 2rem; - margin-top: 0.6rem; - } - #mainMenu .nav > li > ul > li.dropdown-toggle > a > .toggle { - line-height: 2.4rem; - font-size: 1rem; - } +#searchresult { top: 2.5rem; } +#mainMenu #nav #site a { padding-left: 11.25rem; } +#mainMenu #nav #site a::before { content: ""; display: block; overflow: hidden; position: absolute; left: 0; top: 0; width: 10rem; height: 100%; background: url("../images/misc/logo-navbar.png") 1rem 50% no-repeat; background-size: 8rem; } +#mainMenu, #mainMenu .nav > li > a, #mainMenu .nav .label_searchid, #mainMenu .nav > li > a .icon, #mainMenu #searchform .mask, #mainMenu #nav #site::before { height: 2.5rem; } +#mainMenu .nav > li > a, #mainMenu .nav .label_searchid, #mainMenu .nav > li .fa, #mainMenu .nav > li > a .icon { line-height: 2.6rem; } +#mainMenu .nav > li > a .icon.photo { width: 2.1rem; height: 2.1rem; margin-top: .2rem; } +#mainMenu .nav > li .fa { font-size: 1rem; } +#mainMenu #nav > li > a { padding: 0 1.25rem; } +#mainMenu #nav > li > a > .fa { display: none; } +#mainMenu .nav > li > a .icon .fa { line-height: 2.5rem; font-size: 1.5rem; } +#mainMenu .nav > li > ul { box-shadow: 0 0.5rem 3rem rgba(0, 0, 0, 0.4); } +#mainMenu .nav > li > ul > li.item-input { padding: 0.575em 0.5em; } +#mainMenu .nav > li > ul > li > a:first-child, #mainMenu .nav > li > ul > li > span { line-height: 2.5rem; } +#mainMenu #searchform input { min-height: 1.875rem; height: 1.875rem; } +#mainMenu .nav > li > ul > li.dropdown-toggle > a > .toggle { line-height: 2.4rem; font-size: 1rem; } } - @media (max-width: 1020px) { - .nav > li > a, - #mainMenu .nav > li > ul > li > a, - #mainMenu .nav > li > ul > li > span, - #mainMenu .nav .label_searchid { - padding: 0 0.75rem; - } +.nav > li > a, #mainMenu .nav > li > ul > li > a, #mainMenu .nav > li > ul > li > span, #mainMenu .nav .label_searchid { padding: 0 0.75rem; } } - @media (max-width: 840px) { - #statusbar { - display: none - } - #mainMenu #nav #bars { - width: 2.5rem - } - #mainMenu .nav > li { - position: static; - } - #mainMenu .nav > li > a { - font-size: 0; - } - #mainMenu .nav > li > a, - #mainMenu .nav .label_searchid { - padding: 0 0.5rem; - } - #mainMenu .nav > li > a > .username { - font-size: .75rem; - } - #mainMenu #nav > li > a > .fa { - display: inline-block; - } - #mainMenu .nav > li > a > .fa { - display: inline-block; - width: 1.3em; - margin-right: 0 !important; - text-align: center; - } - #mainMenu .nav > li > ul { - left: 0 !important; - width: 100%; - } - #mainMenu .nav > li > ul.sub-menu { - transform: translate3d(-100%, 0, 0) - } - #mainMenu.show .nav > li.active > ul.selected, - #mainMenu.show .nav > li.hover > ul.selected + ul.sub-menu { - opacity: 1; - visibility: visible; - } - #mainMenu.show .nav > li.active > ul.selected { - transform: translate3d(-100%, 0, 0); - } - #mainMenu.show .nav > li.hover > ul.selected + ul.sub-menu { - transform: translate3d(0, 0, 0); - } +#statusbar { display: none } +#mainMenu #nav #bars { width: 2.5rem } +#mainMenu .nav > li { position: static; } +#mainMenu .nav > li > a { font-size: 0; } +#mainMenu .nav > li > a, #mainMenu .nav .label_searchid { padding: 0 0.5rem; } +#mainMenu .nav > li > a > .username { font-size: .75rem; } +#mainMenu #nav > li > a > .fa { display: inline-block; } +#mainMenu .nav > li > a > .fa { display: inline-block; width: 1.3em; margin-right: 0 !important; text-align: center; } +#mainMenu .nav > li > ul { left: 0 !important; width: 100%; } +#mainMenu .nav > li > ul.sub-menu { transform: translate3d(-100%, 0, 0) } +#mainMenu.show .nav > li.active > ul.selected, #mainMenu.show .nav > li.hover > ul.selected + ul.sub-menu { opacity: 1; visibility: visible; } +#mainMenu.show .nav > li.active > ul.selected { transform: translate3d(-100%, 0, 0); } +#mainMenu.show .nav > li.hover > ul.selected + ul.sub-menu { transform: translate3d(0, 0, 0); } } - @media (max-width: 480px) { - #mainMenu .nav > li > a .username, - #searchresult .ajaxSearchResults a > i { - display: none - } - #mainMenu .nav > li > a .icon { - margin-left: 0 - } - #searchresult.open, - #searchresult .ajaxSearchResults { - width: 100% - } -} - +#mainMenu .nav > li > a .username, #searchresult .ajaxSearchResults a > i { display: none } +#mainMenu .nav > li > a .icon { margin-left: 0 } +#searchresult.open, #searchresult .ajaxSearchResults { width: 100% } +} +/* theme modes */ +/* lightness */ +.lightness #mainMenu, .lightness #mainMenu #nav #site a::before { background-color: #f1f1f1; color: #464646; } +.lightness #mainMenu .nav > li > a, .lightness #mainMenu .nav .label_searchid { color: #464646 } +.lightness #mainMenu.show .nav > li.dropdown.hover > a { color: #222; } +.lightness #mainMenu #nav #site a::before { background-image: url("../images/misc/login-logo.png") } +/* light */ +.light #mainMenu { -webkit-box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); } +.light #mainMenu, .light #mainMenu #nav #site a::before { background-color: #2b323a; color: #cacaca; } +.light #mainMenu .nav > li > a, .light #mainMenu .nav .label_searchid { color: #cacaca } +.light #mainMenu.show .nav > li.dropdown.hover > a { color: #444; } /* dark */ +.dark #mainMenu { -webkit-box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); } +.dark #mainMenu, .dark #mainMenu #nav #site a::before { background-color: #202329; color: #bbb; } +.dark #mainMenu .nav > li > a, .dark #mainMenu .nav .label_searchid { color: #bbb } +.dark #mainMenu.show .nav > li.dropdown.hover > a { color: #444; } +/* darkness */ +.darkness #mainMenu { -webkit-box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); } +.darkness #mainMenu, .darkness #mainMenu #nav #site a::before { background-color: #202329; color: #bbb; } +.darkness #mainMenu .nav > li > a, .darkness #mainMenu .nav .label_searchid { color: #bbb } +.darkness #mainMenu.show .nav > li.dropdown.hover > a { color: #eee; background-color: #343942; } +.darkness #mainMenu .nav > li > ul { background-color: #343942; } +.darkness #mainMenu .nav > li > ul > li > a:first-child, .darkness #mainMenu .nav > li > ul > li > span { color: #eee; } +.darkness #mainMenu .nav li.item-group > * { background-color: transparent } +.darkness #searchresult { background-color: #202329; border-left: 1px solid #282c34; } +.darkness #searchresult .ajaxSearchResults b { background-color: #1a1c21; } +.darkness #searchresult .ajaxSearchResults b, .darkness #searchresult .ajaxSearchResults strong, .darkness #searchresult .ajaxSearchResults a { border-color: #282c34; color: #aaa; } +.darkness #searchresult .ajaxSearchResults a:hover { background-color: #343942; } +.darkness #searchresult .ajaxSearchResults .disabled a { color: #da4439; } \ No newline at end of file diff --git a/manager/media/style/default/css/tabpane.css b/manager/media/style/default/css/tabpane.css index f1b63291ff..52aa7cd52d 100755 --- a/manager/media/style/default/css/tabpane.css +++ b/manager/media/style/default/css/tabpane.css @@ -1,817 +1,159 @@ /* [ Tabs ] */ - -.tab-row { - position: relative; - z-index: 1; - white-space: nowrap; - padding: 0 1.5rem -} - -.tab-row::after, -.tab-row-container::after { - content: ""; - position: absolute; - z-index: 1; - left: 0; - right: 0; - bottom: 0; - height: 1px; - background-color: #ddd -} - -.tab-row .tab, -.tab-pane > .tab-page > .tab { - position: relative; - display: inline-block; - margin: 0; - padding: 0 0.875rem; - line-height: 2.7rem; - height: 2.5rem; - text-transform: uppercase; - border: 1px solid rgba(0, 0, 0, 0); - border-bottom: none; - cursor: pointer; - -webkit-user-select: none; - user-select: none; -} - -.tab-row .tab, -.tab-row .tab a, -.tab-pane > .tab-page > .tab { - color: rgba(0, 0, 0, 0.6); - font-size: 0.75rem -} - -.tab-row .tab.selected { - z-index: 2; - border-color: #ddd; - background-color: #fff; - color: #444; - font-weight: 700 -} - -.tab-row .tab .fa { - margin-right: 0.1em; - font-size: 0.875rem -} - +.tab-row { position: relative; z-index: 1; white-space: nowrap; padding: 0 1.5rem } +.tab-row::after, .tab-row-container::after { content: ""; position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; height: 1px; background-color: #ddd } +.tab-row .tab, .tab-pane > .tab-page > .tab { position: relative; display: inline-block; margin: 0; padding: 0 0.875rem; line-height: 2.7rem; height: 2.5rem; text-transform: uppercase; border: 1px solid rgba(0, 0, 0, 0); border-bottom: none; cursor: pointer; -webkit-user-select: none; user-select: none; } +.tab-row .tab, .tab-row .tab a, .tab-pane > .tab-page > .tab { color: rgba(0, 0, 0, 0.6); font-size: 0.75rem } +.tab-row .tab.selected { z-index: 2; border-color: #ddd; background-color: #fff; color: #444; font-weight: 700 } +.tab-row .tab .fa { margin-right: 0.1em; font-size: 0.875rem } /* tabs-container */ - -.tab-row-container { - height: 2.5rem; - left: 0; - overflow-y: hidden; - padding: 0 1.5rem; - position: relative; - z-index: 0 -} - -.tab-row-container .tab-row { - z-index: 2; - -webkit-overflow-scrolling: touch; - overflow-x: auto; - padding: 0 0 2rem; - white-space: nowrap -} - -.tab-row-container .tab-row::after { - display: none -} - -.tab-row-container > i { - position: absolute; - top: 0; - height: 100%; - text-align: center; - font: normal normal normal 1.2rem/2.7rem FontAwesome; - cursor: pointer; - transition-duration: 0.2s; - width: 1.5rem; -} - -.tab-row-container > i.prev { - left: 0; -} - -.tab-row-container > i.next { - right: 0; -} - -.tab-row-container > i.disable { - font-size: 0.8rem; - color: rgba(0, 0, 0, 0.2); - pointer-events: none -} - +.tab-row-container { height: 2.5rem; left: 0; overflow-y: hidden; padding: 0 1.5rem; position: relative; z-index: 0 } +.tab-row-container .tab-row { z-index: 2; -webkit-overflow-scrolling: touch; overflow-x: auto; padding: 0 0 2rem; white-space: nowrap } +.tab-row-container .tab-row::after { display: none } +.tab-row-container > i { position: absolute; top: 0; height: 100%; text-align: center; font: normal normal normal 1.2rem/2.7rem FontAwesome; cursor: pointer; transition-duration: 0.2s; width: 1.5rem; } +.tab-row-container > i.prev { left: 0; } +.tab-row-container > i.next { right: 0; } +.tab-row-container > i.disable { font-size: 0.8rem; color: rgba(0, 0, 0, 0.2); pointer-events: none } /* tab-page */ - -.tab-pane > .tab-page { - display: block -} - -.tab-pane > .tab-page ~ .tab-page { - display: none -} - -.tab-pane > .tab-page:first-of-type { - display: block; - margin-top: 2.5rem; -} - -.tab-pane > .tab-page > .tab { - top: -2.5rem; - left: 1.5rem; - background-color: #f9f9f9; - border-color: #ddd; -} - -.sectionBody > .tab-pane > .tab-page > .tab { - top: -3.7rem; - left: 0.3rem; -} - -.tab-pane > .tab-page > div:first-of-type, -.tab-pane > .tab-page > table { - margin-top: -2.5rem -} - -.dynamic-tab-pane-control.tab-pane > .tab-page > div:first-of-type, -.dynamic-tab-pane-control.tab-pane > .tab-page > table { - margin-top: 0 -} - -.tab-page { - clear: both; - width: 100%; - background-color: #fff; - padding: 0; - border: 0; - border-radius: 0; - box-shadow: 0 0 0.3rem 0 rgba(0, 0, 0, .1) -} - -.tab-page .tab-header, -.sectionHeader { - margin-top: 1em; - padding: .5rem 1.25rem; - letter-spacing: 0; - font-size: 0.875rem; - font-weight: bold; - color: #777; -} - -.tab-page .tab-header, -.tab-page .tab-section .tab-header, -.tab-page .sectionHeader { - background-color: #f3f3f3; - border-bottom-width: 1px; -} - -.tab-page .tab-header + .tab-header, -.tab-page .sectionHeader + .sectionHeader { - margin-top: 0; - border-top: 1px solid #ccc; -} - -.tab-page > .tab-body .tab-header { - padding-left: 0; - padding-right: 0 -} - -.tab-page > .tab-header:first-child, -.tab-page > .tab-body > .tab-header:first-child, -.tab-page .sectionHeader:first-child, -.tab-page > script + .sectionHeader, -.sectionBody .tab-page > script + .tab-section { - margin-top: 0 -} - -.tab-page > .tab-body { - width: 100%; - padding: 1.25rem; -} - -.tab-page > .tab-body > .tab-body, -.tab-page .sectionBody { - padding: 1rem 0; -} - -.tab-page > .tab-header + .tab-body, -.tab-page > .tab-body .tab-header + .tab-body, -.tab-page .sectionHeader + .sectionBody { - padding-top: 1em; - border-top: 1px solid rgba(0, 0, 0, 0.1); -} - -.tab-page > .tab-body::after { - display: table; - width: 100%; - content: '' -} - -.tab-page .tab-body > .form-group:last-child, -.tab-page .tab-body > .form-row:last-child, -.tab-page .tab-body > p:last-child, -.tab-page .tab-body > .form-group:last-child > p:last-child, -.tab-page .sectionBody:last-child { - margin-bottom: 0 -} - -.tab-page .tab-section, -.tab-page .sectionHeader + .sectionBody { - margin-top: 1.25rem; - background-color: #fafafa; - border: 1px solid #e0e0e0; - border-radius: .1rem; -} - -.tab-page .tab-section:first-child, -.tab-page .sectionHeader + .sectionBody, -.tab-page .sectionBody ~ .sectionHeader { - margin-top: 0 -} - -.tab-page .tab-section .tab-header, -.tab-page .sectionHeader { - margin-left: -1px; - margin-right: -1px; - padding-left: .5rem; - padding-right: .5rem; - background-color: #efeff6; - border: 1px solid #e0e0e0; - border-bottom: 2px solid #e0e0ec; -} - -.tab-page .tab-header, -.tab-page .tab-section .tab-header, -.tab-page .sectionHeader { - background-color: #f3f3f3; - border-bottom-width: 1px; -} - -.tab-page .tab-section .tab-header:first-child, -.tab-page .sectionHeader { - margin-top: 0; - border-top: none -} - -.tab-page .tab-section .tab-header + .tab-header, -.tab-page .tab-section .tab-body + .tab-header, -.tab-page .sectionHeader { - border-top: 1px solid #e0e0e0; -} - -.tab-page .tab-section .tab-body, -.tab-page .sectionBody { - padding: 1rem; -} - -.tab-page > .sectionHeader, -.sectionBody .tab-page > .tab-section { - margin-top: 1rem; - margin-left: .25rem; - margin-right: .25rem -} - -.tab-page .sectionBody { - margin: 1rem .25rem; -} - -.tab-page .sectionHeader + .sectionBody { - border-top-color: transparent; - border-radius: 0 -} - -.tab-page > .tab-section .tab-pane { - padding-top: 1.25rem -} - -.tab-page > .tab-pane { - margin-left: -1.25rem; - margin-right: -1.25rem -} - -.tab-page > .tab-pane > .tab-page { - box-shadow: none; -} - -.tab-page > .tab-pane > .tab-page > .tab-body { - padding-bottom: 0 -} - +.tab-pane > .tab-page { display: block } +.tab-pane > .tab-page ~ .tab-page { display: none } +.tab-pane > .tab-page:first-of-type { display: block; margin-top: 2.5rem; } +.tab-pane > .tab-page > .tab { top: -2.5rem; left: 1.5rem; background-color: #f9f9f9; border-color: #ddd; } +.sectionBody > .tab-pane > .tab-page > .tab { top: -3.7rem; left: 0.3rem; } +.tab-pane > .tab-page > div:first-of-type, .tab-pane > .tab-page > table { margin-top: -2.5rem } +.dynamic-tab-pane-control.tab-pane > .tab-page > div:first-of-type, .dynamic-tab-pane-control.tab-pane > .tab-page > table { margin-top: 0 } +.tab-page { clear: both; width: 100%; background-color: #fff; padding: 0; border: 0; border-radius: 0; box-shadow: 0 0 0.3rem 0 rgba(0, 0, 0, .1) } +.tab-page .tab-header, .sectionHeader { margin-top: 1em; padding: .5rem 1.25rem; letter-spacing: .03rem } +.tab-page .tab-header + .tab-header, .tab-page .sectionHeader + .sectionHeader { margin-top: 0; border-top: 1px solid #ccc; } +.tab-page > .tab-body .tab-header { padding-left: 0; padding-right: 0 } +.tab-page > .tab-header:first-child, .tab-page > .tab-body > .tab-header:first-child, .tab-page .sectionHeader:first-child, .tab-page > script + .sectionHeader, .sectionBody .tab-page > script + .tab-section { margin-top: 0 } +.tab-page > .tab-body { width: 100%; padding: 1.25rem; } +.tab-page > .tab-body > .tab-body, .tab-page .sectionBody { padding: 1rem 0; } +.tab-page > .tab-header + .tab-body, .tab-page > .tab-body .tab-header + .tab-body, .tab-page .sectionHeader + .sectionBody { padding-top: 1em; border-top: 1px solid rgba(0, 0, 0, 0.1); } +.tab-page > .tab-body::after { display: table; width: 100%; content: '' } +.tab-page .tab-body > .form-group:last-child, .tab-page .tab-body > .form-row:last-child, .tab-page .tab-body > p:last-child, .tab-page .tab-body > .form-group:last-child > p:last-child, .tab-page .sectionBody:last-child { margin-bottom: 0 } +.tab-page .tab-section, .tab-page .sectionHeader + .sectionBody { margin-top: 1.25rem; background-color: #fafafa; border: 1px solid #e0e0e0; border-radius: .1rem; } +.tab-page .tab-section:first-child, .tab-page .sectionHeader + .sectionBody, .tab-page .sectionBody ~ .sectionHeader { margin-top: 0 } +.tab-page .tab-section .tab-header, .tab-page .sectionHeader { margin-left: -1px; margin-right: -1px; padding-left: .5rem; padding-right: .5rem; background-color: #efeff6; border: 1px solid #e0e0e0; border-bottom: 2px solid #e0e0ec; } +.tab-page .tab-section .tab-header:first-child, .tab-page .sectionHeader { margin-top: -1px; border-top: none } +.tab-page .tab-section .tab-header + .tab-header, .tab-page .tab-section .tab-body + .tab-header, .tab-page .sectionHeader { border-top: 1px solid #e0e0e0; } +.tab-page .tab-section .tab-body, .tab-page .sectionBody { padding: 1rem; } +.tab-page > .sectionHeader, .sectionBody .tab-page > .tab-section { margin-top: 1rem; margin-left: .25rem; margin-right: .25rem } +.tab-page .sectionBody { margin: 1rem .25rem; } +.tab-page .sectionHeader + .sectionBody { border-top-color: transparent; border-radius: 0 } +.tab-page > .tab-section .tab-pane { padding-top: 1.25rem } +.tab-page > .tab-pane { margin-left: -1.25rem; margin-right: -1.25rem } +.tab-page > .tab-pane > .tab-page { box-shadow: none; } +.tab-page > .tab-pane > .tab-page > .tab-body { padding-bottom: 0 } /* tab-page-header collapse */ - -.tab-page .tab-header[data-toggle="collapse"]::after { - float: right; - content: "\f107"; - font-family: FontAwesome; - font-size: 1rem; - line-height: 1em; - color: #777; - cursor: pointer; - transition-duration: .3s -} - -.tab-page .tab-header[data-toggle="collapse"].collapsed::after { - transform: rotate(180deg) -} - -.tab-page .tab-header[data-toggle="collapse"]:hover::after { - color: #333 -} - +.tab-page .tab-header[data-toggle="collapse"]::after { float: right; content: "\f107"; font-family: FontAwesome; font-size: 1rem; line-height: 1em; color: #777; cursor: pointer; transition-duration: .3s } +.tab-page .tab-header[data-toggle="collapse"].collapsed::after { transform: rotate(180deg) } +.tab-page .tab-header[data-toggle="collapse"]:hover::after { color: #333 } /* old style */ - -.sectionBody .tab-page { - clear: both; - width: 100%; - background-color: #fff; - padding: 0; - border: 0; - border-radius: 0; - box-shadow: 0 0 0.3rem 0 rgba(0, 0, 0, .1) -} - -.sectionBody > .tab-pane > .tab-page { - padding: 1.25rem; -} - -.tab-page > table { - width: 100%; - border-collapse: collapse -} - -.sectionBody .displayparams, -.sectionBody .permissiongroup { - margin-bottom: 0.15rem; - background-color: #eee; - border-collapse: separate; - border-spacing: 1px; -} - -.sectionBody .displayparams th, -.sectionBody .displayparams td { - padding: 4px 4px; -} - -.sectionBody .displayparams thead td, -.sectionBody .permissiongroup thead td { - border-top: none; -} - -.sectionBody fieldset { - background: none repeat scroll 0 0 #fdfdfd; - border: 1px solid #ccc; - padding: 1rem !important; -} - -.sectionBody legend { - font-weight: 500; - padding: 5px 1rem; - background: #fff; - border: 1px solid #ccc; - -webkit-box-shadow: 1px 1px 3px #ccc; - box-shadow: 1px 1px 3px #ccc; - -webkit-border-radius: 3px; - border-radius: 3px; -} - -.sectionBody fieldset h3 { - font-size: 14px; - color: #789; - font-weight: 500; - padding-bottom: 0; - margin-bottom: 0; -} - -.showHideVisible { - color: #333; - margin: 0 1rem; - padding: 5px 3px 5px; - font-weight: 500; - text-shadow: 0 1px 0 #fff; -} - -.showHideVisible + .sectionBody { - margin-top: -1px !important -} - -.sectionBody, -.layerVisible { - position: relative; -} - -.sectionBody > p:first-child { - margin-left: 1rem; - margin-right: 1rem -} - -.showHideVisible, -.layerVisible { - margin: 0 10px 4px; -} - -.sectionBody td, -.sectionBody th { - padding: 0.15rem 0.25rem; - vertical-align: top; -} - +.sectionBody .tab-page { clear: both; width: 100%; background-color: #fff; padding: 0; border: 0; border-radius: 0; box-shadow: 0 0 0.3rem 0 rgba(0, 0, 0, .1) } +.sectionBody > .tab-pane > .tab-page { padding: 1.25rem; } +.tab-page > table { width: 100%; border-collapse: collapse } +.sectionBody .displayparams, .sectionBody .permissiongroup { margin-bottom: 0.15rem; background-color: #eee; border-collapse: separate; border-spacing: 1px; } +.sectionBody .displayparams th, .sectionBody .displayparams td { padding: 4px 4px; } +.sectionBody .displayparams thead td, .sectionBody .permissiongroup thead td { border-top: none; } +.sectionBody fieldset { background: none repeat scroll 0 0 #fdfdfd; border: 1px solid #ccc; padding: 1rem !important; } +.sectionBody legend { font-weight: 500; padding: 5px 1rem; background: #fff; border: 1px solid #ccc; -webkit-box-shadow: 1px 1px 3px #ccc; box-shadow: 1px 1px 3px #ccc; -webkit-border-radius: 3px; border-radius: 3px; } +.sectionBody fieldset h3 { font-size: 14px; color: #789; font-weight: 500; padding-bottom: 0; margin-bottom: 0; } +.showHideVisible { color: #333; margin: 0 1rem; padding: 5px 3px 5px; font-weight: 500; text-shadow: 0 1px 0 #fff; } +.showHideVisible + .sectionBody { margin-top: -1px !important } +.sectionBody, .layerVisible { position: relative; } +.sectionBody > p:first-child { margin-left: 1rem; margin-right: 1rem } +.showHideVisible, .layerVisible { margin: 0 10px 4px; } +.sectionBody td, .sectionBody th { padding: 0.15rem 0.25rem; vertical-align: top; } +.sectionBody .tab-page#tabGeneral > table + div { margin-top: 1.3rem; } /* [ POPUPS ] */ - -.evo-popup { - display: none; - position: absolute; - z-index: 10500; - box-shadow: 0 0.2rem 2rem rgba(0, 0, 0, 0.1); -} - -.evo-popup.animation { - -webkit-transition: .25s; - transition: .25s -} - -.evo-popup:hover { - box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); -} - -.evo-popup.alert { - margin: 0; - height: 100%; - border-color: rgba(0, 0, 0, 0.1); - background-color: #fff; - color: #444; - border-radius: .15rem; -} - -.evo-popup.alert-dark { - background-color: #202329; - color: #ccc; -} - -.evo-popup.alert-dark hr { - border-color: rgba(255, 255, 255, 0.5); -} - -.evo-popup.alert-dark .close { - color: #fff; - text-shadow: 0 0 #000; -} - -.evo-popup.alert-success { - border-color: rgba(0, 0, 0, 0.1); - background-color: #5cb85c; - color: #fff; -} - -.evo-popup.alert-success hr { - border-color: rgba(255, 255, 255, 0.5); -} - -.evo-popup.alert-info { - border-color: rgba(0, 0, 0, 0.1); - background-color: #1976d2; - color: #fff; -} - -.evo-popup.alert-info hr { - border-color: rgba(255, 255, 255, 0.5); -} - -.evo-popup.alert-warning { - border-color: rgba(0, 0, 0, 0.1); - background-color: #ffe082; - color: #795548; -} - -.evo-popup.alert-warning hr { - border-color: rgba(0, 0, 0, 0.1); -} - -.evo-popup.alert-danger { - border-color: rgba(0, 0, 0, 0.1); - background-color: #d9534f; - color: #fff; -} - -.evo-popup.alert-danger hr { - border-color: rgba(255, 255, 255, 0.5); -} - -.evo-popup.alert.evo-popup-iframe { - padding: 0; - border: none; - background-color: #fafafa; - overflow: hidden; -} - -.evo-popup.alert .evo-popup-header { - padding-bottom: .5rem; - margin-bottom: .5rem; - border-bottom: 1px solid -} - -.evo-popup .close { - position: absolute; - top: .3em; - right: .3em; -} - -.evo-popup.evo-popup-iframe .close { - position: absolute; - z-index: 9; - opacity: 1; - top: 0; - right: 0; - width: 1.5rem; - height: 1.5rem; - line-height: 1.4rem; - color: #fff; - background-color: #e5a2a0; - text-align: center; - font-weight: 100; -} - -.evo-popup.evo-popup-iframe .close:hover { - opacity: 1; - background-color: #d9534f; -} - -.evo-popup.evo-popup-iframe .evo-popup-header { - position: relative; - height: 1.5rem; - margin: 0; - padding: 0 1.5rem 0 .5rem; - line-height: 1.5rem; - font-size: .9rem; - border-bottom: 1px solid #dedede; -} - -.evo-popup.evo-popup-iframe .evo-popup-header i { - line-height: 1.5rem !important; -} - -.evo-popup.evo-popup-iframe .evo-popup-body { - position: absolute; - z-index: 1; - left: 0; - top: 0; - right: 0; - bottom: 0; -} - -.evo-popup.evo-popup-iframe .evo-popup-header + .evo-popup-body { - top: 1.5rem -} - -.evo-popup.evo-popup-iframe.changed { - box-shadow: 0 0.2rem 2rem rgba(0, 0, 0, 0.1), 0 0 .2rem .2rem #ffc107 -} - -.evo-popup-overlay { - position: fixed; - z-index: 10499; - left: 0; - top: 0; - right: 0; - bottom: 0; - background-color: rgba(0, 0, 0, 0.3); -} - -.evo-popup-overlay::before { - position: absolute; - left: 20%; - top: 20%; - width: 45%; - height: 45%; - opacity: 0; - background-color: rgba(0, 0, 0, 0.3); - transition: all 0.25s ease-in-out; -} - -.evo-popup.is-drag::before, -.evo-popup.is-resize::before { - content: ""; - position: absolute; - z-index: 9; - left: 0; - top: 0; - right: 0; - bottom: 0; - background-color: transparent; -} - -.evo-popup.resize .border-outline { - display: none; -} - -.evo-popup.resize:hover .border-outline, -.evo-popup.is-resize .border-outline, -.evo-popup.resize:hover .border-outline i, -.evo-popup.is-resize .border-outline i { - display: block !important -} - -.evo-popup.resize .border-outline i { - position: absolute; - z-index: 99; - display: none; - background-color: transparent -} - -.evo-popup.resize .border-outline .bo-left, -.evo-popup.resize .border-outline .bo-right { - width: .25rem; - height: 100%; -} - -.evo-popup.resize .border-outline .bo-left { - left: 0; -} - -.evo-popup.resize .border-outline .bo-right { - right: 0; -} - -.evo-popup.resize .border-outline .bo-top, -.evo-popup.resize .border-outline .bo-bottom { - height: .25rem; - width: 100%; -} - -.evo-popup.resize .border-outline .bo-top { - top: 0; -} - -.evo-popup.resize .border-outline .bo-bottom { - bottom: 0; -} - -.dark .evo-popup.alert.evo-popup-iframe { - background-color: #ecf0f1 -} - +.evo-popup { display: none; position: absolute; z-index: 10500; box-shadow: 0 0.2rem 2rem rgba(0, 0, 0, 0.1); } +.evo-popup.animation { -webkit-transition: .25s; transition: .25s } +.evo-popup:hover { box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); } +.evo-popup.alert { margin: 0; height: 100%; border-color: rgba(0, 0, 0, 0.1); background-color: #fff; color: #444; border-radius: .15rem; } +.evo-popup.alert-dark { background-color: #202329; color: #ccc; } +.evo-popup.alert-dark hr { border-color: rgba(255, 255, 255, 0.5); } +.evo-popup.alert-dark .close { color: #fff; text-shadow: 0 0 #000; } +.evo-popup.alert-success { border-color: rgba(0, 0, 0, 0.1); background-color: #5cb85c; color: #fff; } +.evo-popup.alert-success hr { border-color: rgba(255, 255, 255, 0.5); } +.evo-popup.alert-info { border-color: rgba(0, 0, 0, 0.1); background-color: #1976d2; color: #fff; } +.evo-popup.alert-info hr { border-color: rgba(255, 255, 255, 0.5); } +.evo-popup.alert-warning { border-color: rgba(0, 0, 0, 0.1); background-color: #ffe082; color: #795548; } +.evo-popup.alert-warning hr { border-color: rgba(0, 0, 0, 0.1); } +.evo-popup.alert-danger { border-color: rgba(0, 0, 0, 0.1); background-color: #d9534f; color: #fff; } +.evo-popup.alert-danger hr { border-color: rgba(255, 255, 255, 0.5); } +.evo-popup.alert.evo-popup-iframe { padding: 0; border: none; background-color: #fafafa; overflow: hidden; } +.evo-popup.alert .evo-popup-header { padding-bottom: .5rem; margin-bottom: .5rem; border-bottom: 1px solid } +.evo-popup .close { position: absolute; top: .3em; right: .3em; } +.evo-popup.evo-popup-iframe .close { position: absolute; z-index: 9; opacity: 1; top: 0; right: 0; width: 1.5rem; height: 1.5rem; line-height: 1.4rem; color: #fff; background-color: #e5a2a0; text-align: center; font-weight: 100; } +.evo-popup.evo-popup-iframe .close:hover { opacity: 1; background-color: #d9534f; } +.evo-popup.evo-popup-iframe .evo-popup-header { position: relative; height: 1.5rem; margin: 0; padding: 0 1.5rem 0 .5rem; line-height: 1.5rem; font-size: .9rem; border-bottom: 1px solid #dedede; } +.evo-popup.evo-popup-iframe .evo-popup-header i { line-height: 1.5rem !important; } +.evo-popup.evo-popup-iframe .evo-popup-body { position: absolute; z-index: 1; left: 0; top: 0; right: 0; bottom: 0; } +.evo-popup.evo-popup-iframe .evo-popup-header + .evo-popup-body { top: 1.5rem } +.evo-popup.evo-popup-iframe.changed { box-shadow: 0 0.2rem 2rem rgba(0, 0, 0, 0.1), 0 0 .2rem .2rem #ffc107 } +.evo-popup-overlay { position: fixed; z-index: 10499; left: 0; top: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.3); } +.evo-popup-overlay::before { position: absolute; left: 20%; top: 20%; width: 45%; height: 45%; opacity: 0; background-color: rgba(0, 0, 0, 0.3); transition: all 0.25s ease-in-out; } +.evo-popup.is-drag::before, .evo-popup.is-resize::before { content: ""; position: absolute; z-index: 9; left: 0; top: 0; right: 0; bottom: 0; background-color: transparent; } +.evo-popup.resize .border-outline { display: none; } +.evo-popup.resize:hover .border-outline, .evo-popup.is-resize .border-outline, .evo-popup.resize:hover .border-outline i, .evo-popup.is-resize .border-outline i { display: block !important } +.evo-popup.resize .border-outline i { position: absolute; z-index: 99; display: none; background-color: transparent } +.evo-popup.resize .border-outline .bo-left, .evo-popup.resize .border-outline .bo-right { width: .25rem; height: 100%; } +.evo-popup.resize .border-outline .bo-left { left: 0; } +.evo-popup.resize .border-outline .bo-right { right: 0; } +.evo-popup.resize .border-outline .bo-top, .evo-popup.resize .border-outline .bo-bottom { height: .25rem; width: 100%; } +.evo-popup.resize .border-outline .bo-top { top: 0; } +.evo-popup.resize .border-outline .bo-bottom { bottom: 0; } /* [ EVO-TABS ] */ - -.evo-tab-row { - height: 1.875rem; - padding: 0; - background-color: #dfdfdf; -} - -.evo-tab-row:after { - background-color: #cfd2d6 -} - -.evo-tab-row .tab-row .tab { - height: 1.875rem; - line-height: 2rem; - font-size: .8125rem; - text-transform: none; - border: none; - border-right: 1px solid #cfd2d6; - border-left: 1px solid #cfd2d6; - margin-left: -1px; -} - -.evo-tab-row .tab-row .tab:hover { - background-color: rgba(255, 255, 255, 0.5) -} - -.evo-tab-row .tab-row .tab.changed { - color: #0275d8; -} - -.evo-tab-row .tab-row .tab.selected { - font-weight: normal; - color: #444; - background-color: #fafafa; -} - -.evo-tab-row .tab-row .tab i, -.evo-popup.evo-popup-iframe .evo-popup-header i { - float: left; - margin: 0; - line-height: 2.2em; -} - -.evo-tab-row .tab-row .tab small, -.evo-popup.evo-popup-iframe .evo-popup-header small { - margin-left: .25em -} - -.evo-tab-row .tab-row .tab:not(#evo-tab-home) i.help, -.evo-popup.evo-popup-iframe .evo-popup-header i.help { - display: none -} - -.evo-tab-row .tab-row .tab:not(#evo-tab-home) i, -.evo-popup.evo-popup-iframe .evo-popup-header i { - margin-right: .25em -} - -.evo-tab-row .tab-row .tab span { - background: none !important -} - -.evo-tab-row .tab-row .tab .tab-title { - float: left; - width: 8rem; - line-height: 2rem; - text-overflow: ellipsis; - overflow: hidden; -} - -.evo-tab-row .tab-row .tab .tab-close { - float: right; - margin: 0 -.75rem 0 .5rem; - padding: .25em; - line-height: 1.3em; - font-size: 1.3em; - font-weight: 700; - color: #9e9e9e -} - -.evo-tab-row .tab-row .tab .tab-close:hover { - color: #d9534f -} - -.evo-tab-page { - position: absolute; - overflow: hidden; - z-index: -1; - display: block; - left: 0; - top: 2.3em; - right: 0; - bottom: 0; - height: auto; - box-shadow: none; - background-color: #fafafa; -} - -.evo-tab-page.show { - z-index: 1; -} - -.evo-tab-page iframe { - position: absolute; - left: 0; - top: 0; - width: 100%; - height: 100%; - background-color: #fafafa; - overflow: hidden; -} - -#tabGeneral > table { - margin-bottom: 1rem; -} - -#tab1Help > img { - margin-bottom: 20px; -} - -.tmplvars .tvimage img { - box-shadow: 0 0.1rem 0.2rem 0 rgba(0, 0, 0, 0.1); -} - +.evo-tab-row { height: 1.875rem; padding: 0; background-color: #dfdfdf; } +.evo-tab-row:after { background-color: #cfd2d6 } +.evo-tab-row .tab-row .tab { height: 1.875rem; line-height: 2rem; font-size: .8125rem; text-transform: none; border: none; border-right: 1px solid #cfd2d6; border-left: 1px solid #cfd2d6; margin-left: -1px; } +.evo-tab-row .tab-row .tab:hover { background-color: rgba(255, 255, 255, 0.5) } +.evo-tab-row .tab-row .tab.changed { color: #0275d8; } +.evo-tab-row .tab-row .tab.selected { font-weight: normal; color: #444; background-color: #fafafa; } +.evo-tab-row .tab-row .tab i, .evo-popup.evo-popup-iframe .evo-popup-header i { float: left; margin: 0; line-height: 2.2em; } +.evo-tab-row .tab-row .tab small, .evo-popup.evo-popup-iframe .evo-popup-header small { margin-left: .25em } +.evo-tab-row .tab-row .tab:not(#evo-tab-home) i.help, .evo-popup.evo-popup-iframe .evo-popup-header i.help { display: none } +.evo-tab-row .tab-row .tab:not(#evo-tab-home) i, .evo-popup.evo-popup-iframe .evo-popup-header i { margin-right: .25em } +.evo-tab-row .tab-row .tab span { background: none !important } +.evo-tab-row .tab-row .tab .tab-title { float: left; width: 5rem; line-height: 2rem; text-overflow: ellipsis; overflow: hidden; } +.evo-tab-row .tab-row .tab .tab-close { float: right; margin: 0 -.75rem 0 .5rem; padding: .25em; line-height: 1.3em; font-size: 1.3em; font-weight: 700; color: #9e9e9e } +.evo-tab-row .tab-row .tab .tab-close:hover { color: #d9534f } +.evo-tab-page { position: absolute; overflow: hidden; z-index: -1; display: block; left: 0; top: 2.3em; right: 0; bottom: 0; height: auto; box-shadow: none; background-color: #fafafa; } +.evo-tab-page.show { z-index: 1; } +.evo-tab-page iframe { position: absolute; left: 0; top: 0; width: 100%; height: 100%; background-color: #fafafa; overflow: hidden; } +@media (min-width: 1200px) { +.evo-tab-row .tab-row .tab .tab-title { width: 7rem; } +} +/* modes theme */ +/* lightness */ +.lightness .evo-tab-row { background-color: #e8e8e8; } +/* light */ +.light .evo-tab-row { background-color: #dfdfdf; } /* dark */ - -.dark .evo-popup-overlay { - background-color: rgba(0, 0, 0, 0.3); -} - -.dark .evo-tab-row { - background-color: #1a1c21; - border-bottom: none; -} - -.dark .evo-tab-row:after { - background-color: #1a1c21; -} - -.dark .evo-tab-row .tab-row .tab { - color: #aaa; - border-color: #2a2d33 -} - -.dark .evo-tab-row .tab-row .tab:hover { - background-color: #2d3033 -} - -.dark .evo-tab-row .tab-row .tab.changed { - color: #7cb2dc; -} - -.dark .evo-tab-row .tab-row .tab.selected { - background-color: #414550; - color: #eee; - border-bottom: 3px solid #1976d2; -} - -.dark .evo-tab-page, -.dark .evo-tab-page iframe { - background-color: #ecf0f1 -} - +.dark .evo-popup.alert.evo-popup-iframe { background-color: #ecf0f1 } +.dark .evo-popup-overlay, .darkness .evo-popup-overlay { background-color: rgba(0, 0, 0, 0.3); } +.dark .evo-tab-row, .darkness .evo-tab-row { background-color: #1a1c21; border-bottom: none; } +.dark .evo-tab-row:after, .darkness .evo-tab-row:after { background-color: #1a1c21; } +.dark .evo-tab-row .tab-row .tab, .darkness .evo-tab-row .tab-row .tab { color: #aaa; border-color: #2a2d33 } +.dark .evo-tab-row .tab-row .tab:hover, .darkness .evo-tab-row .tab-row .tab:hover { background-color: #2d3033 } +.dark .evo-tab-row .tab-row .tab.changed, .darkness .evo-tab-row .tab-row .tab.changed { color: #7cb2dc; } +.dark .evo-tab-row .tab-row .tab.selected, .darkness .evo-tab-row .tab-row .tab.selected { background-color: #414550; color: #eee; border-bottom: 3px solid #1976d2; } +.dark .evo-tab-page, .dark .evo-tab-page iframe, .darkness .evo-tab-page, .darkness .evo-tab-page iframe { background-color: #ecf0f1 } +/* darkness */ +.darkness .evo-popup.alert.evo-popup-iframe, .darkness .evo-tab-page iframe { background-color: #282c34 } +.darkness .evo-popup.evo-popup-iframe .close { opacity: 0.64; background-color: #ca000c; font-family: serif; } +.darkness .evo-popup.evo-popup-iframe .close:hover { opacity: 1; } +.darkness .evo-popup.evo-popup-iframe .evo-popup-header { border-bottom: 1px solid #17191d; } +.darkness .evo-popup.evo-popup-iframe .evo-popup-header { color: #eee; } +.darkness .sectionBody .tab-row-container, .darkness .tab-pane .tab-row-container, .darkness .tab-pane .tab-row { background-color: #202329; } +.darkness .tab-pane .tab-pane .tab-row { background-color: #282c34; } +.darkness .tab-row .tab.selected { border-color: #414449; background-color: #282c34; color: #eee; } +.darkness .tab-row .tab, .darkness .tab-row .tab a, .darkness .tab-pane > .tab-page > .tab { color: inherit } +.darkness .tab-row::after, .darkness .tab-row-container::after { background-color: #414449; } +.darkness .tab-row-container .tab-row { z-index: auto; } +.darkness .evo-tab-row .tab-row .tab:hover { background-color: #282c34; } +.darkness .evo-tab-row .tab-row .tab.selected { background-color: #282c34; border-color: #343942; border-bottom: 3px solid #1976d2; } +.darkness .sectionBody fieldset, .darkness .sectionBody legend { background: none; border: 1px solid #414449; box-shadow: none; } +.darkness .tab-page .tab-section .tab-header, .darkness .tab-page .sectionHeader { background-color: #202329; border: 1px solid #414449; } +.darkness .tab-page .tab-section, .darkness .tab-page .sectionHeader + .sectionBody { background: none; border: 1px solid #414449; } +.darkness .tab-page .sectionHeader + .sectionBody { border-top: none; } diff --git a/manager/media/style/default/css/tree.css b/manager/media/style/default/css/tree.css index e9c07214e9..3d8b48d65e 100755 --- a/manager/media/style/default/css/tree.css +++ b/manager/media/style/default/css/tree.css @@ -1,426 +1,82 @@ /* tree */ +#treeloader { position: absolute; display: block; overflow: hidden; right: 0.3em; top: 0.15em; opacity: 0; visibility: hidden; -webkit-transition-duration: 0.5s; transition-duration: 0.5s } +#treeloader .fa { font-size: 1em; } +#treeloader.visible { opacity: 0.7; visibility: visible; -webkit-transition-duration: 0s; transition-duration: 0s } +.treeframebody { height: 100%; min-height: calc(100% + 1px); background-color: #fafafa; border-right: 1px solid #cfd2d6; } +#treeMenu { display: table; width: 100%; height: 1.875rem; table-layout: fixed; margin-top: -1px; background-color: #dfdfdf; border-bottom: 1px solid #cfd2d6 } +#treeMenu .treeButton { display: table-cell; cursor: pointer; height: 1.875rem; line-height: 2rem; white-space: nowrap; text-align: center; vertical-align: middle; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } +#treeMenu .treeButton:hover:not(.disabled) { background-color: rgba(255, 255, 255, .5); cursor: pointer; -webkit-transition-duration: 0s; transition-duration: 0s } +#treeMenu .treeButton:not(.disabled):active { background-color: #d5d5d5 } +#treeMenu .treeButton .fa { display: block; width: 1.2em; height: 1.2em; margin: auto; line-height: 1.3em; font-size: 1.1em; } +#treeMenu .treeButton.disabled { color: #777; opacity: 0.5 } +#treeHolder { position: relative; z-index: 1; cursor: default; overflow: auto; height: 100%; max-height: calc(100% - 30px); white-space: nowrap } +#treeHolder .rootNode { position: relative; } +#treeHolder .rootNode a { display: block; overflow: hidden; padding: .55em 1em 0.5em 1em; text-overflow: ellipsis; color: #333; cursor: pointer; -webkit-transition-duration: 0.15s; transition-duration: 0.15s; font-weight: bold } +#treeHolder .rootNode a .fa { margin-right: 0.5em } +#treeHolder .rootNode .icon { display: none; } +#treeRoot { float: left; width: 100%; color: #333; } +#treeRoot a { display: block; clear: both; overflow: hidden; text-decoration: none; padding: 0.1em 0 0.1em 2.2em; font-size: 1em; text-overflow: ellipsis; color: #333; cursor: default; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } +#treeRoot a:hover:not(.empty), #treeRoot a.current { background-color: rgba(33, 150, 243, 0.1) } +#treeRoot a small { margin: 0 0.8em 0 0.2em } +#treeRoot a.selected, #treeRoot .dragenter > a { background-color: rgba(0, 0, 0, 0.1); } +#treeRoot a .title { padding: 0 0.2em; color: #0275d8; cursor: pointer; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } +#treeRoot a.deleted .title { color: #a52a2a; text-decoration: line-through; } +#treeRoot a.unpublished .title { color: #b68282; font-style: italic; } +#treeRoot a.hidemenu .title { color: #404040; } +#treeRoot a.protected { position: relative; opacity: .5; background-color: transparent !important; } +#treeRoot a .lockedResource { cursor: pointer; } +#treeRoot a .editResource { margin-left: 0.2em } +#treeRoot .indent { position: relative; z-index: -1; float: left; height: 1.5em; } +#treeRoot .indent i { float: left; height: 1.2em; width: 1.5em } +#treeRoot .dragafter > a .indent, #treeRoot .dragbefore > a .indent { z-index: 1; } +#treeRoot .dragafter > a .indent::after, #treeRoot .dragbefore > a .indent::before { content: "\f0da"; display: block; position: absolute; right: 0.1em; bottom: -0.5em; height: 1em; font: normal normal normal 1em/1em FontAwesome; color: #f04 } +#treeRoot .dragbefore > a .indent::before { bottom: auto; top: -0.5em; } +#treeRoot .empty { color: #aaa; cursor: default; } +#treeRoot .icon { cursor: pointer; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } +#treeRoot .icon:hover > .fa { color: #000 } +#treeRoot .toggle { float: left; margin: 1px 0.2em 1px -1.5em; width: 1.3em; height: 1.3em; line-height: 1.4em; text-align: center; vertical-align: top; cursor: pointer; border-radius: 50%; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } +#treeRoot .toggle:hover { background-color: rgba(255, 255, 255, 0.5); } +#treeRoot .toggle .fa { margin: 0; width: auto; } +#treeRoot .fa, #treeHolder .rootNode .fa { margin-right: 1px; width: 1em; font-size: 1.1em; text-align: center; color: #565656; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } +#treeRoot a[data-private="1"] .icon::after { position: relative; float: left; margin: .5em -1em 0 0; content: "\f023"; font-family: FontAwesome; font-size: 0.75em; color: #d9534f; } +#treeRoot .fa-file, #treeRoot .fa-file-o, #treeRoot .fa-file-code, #treeRoot .fa-file-code-o { } +#treeRoot .fa-folder, #treeRoot .fa-folder-open, #treeRoot .fa-folder-o, #treeRoot .fa-folder-open-o, #treeRoot .fa-exclamation-triangle { margin-top: 0.1em; text-align: left } +#treeRoot .fa-link { margin-right: 0; font-size: 0.8em } +#treeRoot #binFull { display: none } +@media (min-width: 1200px) { +#tree { font-size: .875rem; letter-spacing: 0.0321em; } +} +/* modes theme */ +/* lightness */ +.lightness #treeMenu { background-color: #e8e8e8 } +.lightness .treeframebody { background-color: #fafafa; } +/* light */ +.light #treeMenu { background-color: #dfdfdf } +.light .treeframebody { background-color: #fafafa; } +/* dark */ +.dark #treeMenu { background-color: rgba(0, 0, 0, 0.2); border-bottom-color: rgba(0, 0, 0, 0.2); border-right-color: #2a2d33 } +.dark #treeMenu .treeButton, .darkness #treeMenu .treeButton { color: #a9a9a9; } +.dark #treeMenu .treeButton:hover:not(.disabled), .darkness #treeMenu .treeButton:hover:not(.disabled) { background-color: #2d3033; color: #fff } +.dark #tree .treeframebody, .darkness #tree .treeframebody { background-color: #202329; border-color: #2a2d33 } +.dark #treeHolder .rootNode a, .darkness #treeHolder .rootNode a { color: #c5c5c5; } +.dark #treeHolder .rootNode a:hover, .darkness #treeHolder .rootNode a:hover { color: #eee } +.dark #treeRoot, .darkness #treeRoot { color: #b3b3b3; } +.dark #treeRoot a, .darkness #treeRoot a { color: #b3b3b3; } +.dark #treeRoot a:hover:not(.empty), .dark #treeRoot a.current, .darkness #treeRoot a:hover:not(.empty), .darkness #treeRoot a.current { background-color: rgba(255, 255, 255, 0.15); } +.dark #treeRoot a.selected, .dark #treeRoot .dragenter > a, .darkness #treeRoot a.selected, .darkness#treeRoot .dragenter > a { background-color: rgba(0, 142, 255, 0.19); } +.dark #treeRoot .dragafter > a::after, .dark #treeRoot .dragbefore > a::before, .darkness #treeRoot .dragafter > a::after, .darkness #treeRoot .dragbefore > a::before { background-color: rgba(255, 255, 255, 0.25); } +.dark #treeRoot a .title, .darkness #treeRoot a .title { color: #7cb2dc; } +.dark #treeRoot a.hidemenu .title, .darkness #treeRoot a.hidemenu .title { color: #c5c5c5; } +.dark #treeRoot a.deleted .title, .darkness #treeRoot a.deleted .title { color: #a52a2a; } +.dark #treeRoot a.unpublished .title, .darkness #treeRoot a.unpublished .title { color: #d0726b } +.dark #treeRoot .icon:hover > .fa, .darkness #treeRoot .icon:hover > .fa { color: #fff } +.dark #treeRoot a .title:hover, .darkness #treeRoot a .title:hover { color: #a2d4fb; } +.dark #treeRoot a.hidemenu .title:hover, .darkness #treeRoot a.hidemenu .title:hover { color: #eee } +.dark #treeRoot a.unpublished .title:hover, .darkness #treeRoot a.unpublished .title:hover { color: #f38e86 } +.dark #treeRoot a.deleted .title:hover, .darkness #treeRoot a.deleted .title:hover { color: #e23d3d } +.dark #treeRoot .toggle:hover, .darkness #treeRoot .toggle:hover { background-color: rgba(255, 255, 255, 0.19); } +.dark #treeRoot .fa, .dark #treeHolder .rootNode .fa, .darkness #treeRoot .fa, .darkness #treeHolder .rootNode .fa { color: #bcbec0; } +/* darkness */ +.darkness #tree .treeframebody { background-color: #202329; border-color: #414449; } +.darkness #treeMenu { background-color: #1a1c21; border-color: #414449; } -#treeloader { - position: absolute; - display: block; - overflow: hidden; - right: 0.3em; - top: 0.15em; - opacity: 0; - visibility: hidden; - -webkit-transition-duration: 0.5s; - transition-duration: 0.5s -} - -#treeloader .fa { - font-size: 1em; -} - -#treeloader.visible { - opacity: 0.7; - visibility: visible; - -webkit-transition-duration: 0s; - transition-duration: 0s -} - -.treeframebody { - height: 100%; - min-height: calc(100% + 1px); - background-color: #fafafa; - border-right: 1px solid #cfd2d6; -} - -#treeMenu { - display: table; - width: 100%; - height: 1.875rem; - table-layout: fixed; - margin-top: -1px; - background-color: #dfdfdf; - border-bottom: 1px solid #cfd2d6 -} - -#treeMenu .treeButton { - display: table-cell; - cursor: pointer; - height: 1.875rem; - line-height: 2rem; - white-space: nowrap; - text-align: center; - vertical-align: middle; - -webkit-transition-duration: 0.15s; - transition-duration: 0.15s -} - -#treeMenu .treeButton:hover:not(.disabled) { - background-color: rgba(255, 255, 255, .5); - cursor: pointer; - -webkit-transition-duration: 0s; - transition-duration: 0s -} - -#treeMenu .treeButton:not(.disabled):active { - background-color: #d5d5d5 -} - -#treeMenu .treeButton .fa { - display: block; - width: 1.2em; - height: 1.2em; - margin: auto; - line-height: 1.3em; - font-size: 1.1em; -} - -#treeMenu .treeButton.disabled { - color: #777; - opacity: 0.5 -} - -#treeHolder { - position: relative; - z-index: 1; - cursor: default; - overflow: auto; - height: 100%; - max-height: calc(100% - 30px); - white-space: nowrap -} - -#treeHolder .rootNode { - position: relative; -} - -#treeHolder .rootNode a { - display: block; - overflow: hidden; - padding: 1em 1em 0.5em 1rem; - text-overflow: ellipsis; - color: #333; - cursor: pointer; - -webkit-transition-duration: 0.15s; - transition-duration: 0.15s; - font-weight: bold -} - -#treeHolder .rootNode a .fa { - margin-right: 0.5em -} - -#treeHolder .rootNode .icon { - display: none; -} - -#treeRoot { - float: left; - width: 100%; - color: #333; -} - -#treeRoot a { - display: block; - clear: both; - overflow: hidden; - text-decoration: none; - padding: 0.2em 0 0.2em 2rem !important; - font-size: 0.875rem; - text-overflow: ellipsis; - color: #333; - cursor: default; - -webkit-transition-duration: 0.15s; - transition-duration: 0.15s -} - -#treeRoot a:hover:not(.empty), -#treeRoot a.current { - background-color: rgba(33, 150, 243, 0.1) -} - -#treeRoot a small { - margin: 0 0.8em 0 0.2em -} - -#treeRoot a.selected, -#treeRoot .dragenter > a { - background-color: rgba(0, 0, 0, 0.1); -} - -#treeRoot a .title { - padding: 0 0.2em; - color: #0275d8; - cursor: pointer; - -webkit-transition-duration: 0.15s; - transition-duration: 0.15s -} - -#treeRoot a.deleted .title { - color: #a52a2a; - text-decoration: line-through; -} - -#treeRoot a.unpublished .title { - color: #b68282; - font-style: italic; -} - -#treeRoot a.hidemenu .title { - color: #404040; -} - -#treeRoot a.protected { - position: relative; - opacity: .5; - background-color: transparent !important; -} - -#treeRoot a .lockedResource { - cursor: pointer; -} - -#treeRoot a .editResource { - margin-left: 0.2em -} - -#treeRoot .indent { - position: relative; - z-index: -1; - float: left; - height: 1.5em; -} - -#treeRoot .indent i { - float: left; - height: 1.2em; - width: 1.5em -} - -#treeRoot .dragafter > a .indent, -#treeRoot .dragbefore > a .indent { - z-index: 1; -} - -#treeRoot .dragafter > a .indent::after, -#treeRoot .dragbefore > a .indent::before { - content: "\f0da"; - display: block; - position: absolute; - right: 0.1em; - bottom: -0.5em; - height: 1em; - font: normal normal normal 1em/1em FontAwesome; - color: #f04 -} - -#treeRoot .dragbefore > a .indent::before { - bottom: auto; - top: -0.5em; -} - -#treeRoot .empty { - color: #aaa; - cursor: default; -} - -#treeRoot .icon { - cursor: pointer; - -webkit-transition-duration: 0.15s; - transition-duration: 0.15s -} - -#treeRoot .icon:hover > .fa { - color: #000 -} - -#treeRoot .toggle { - float: left; - margin: 1px 0.2em 1px -1.5em; - width: 1.3em; - height: 1.3em; - line-height: 1.4em; - text-align: center; - vertical-align: top; - cursor: pointer; - border-radius: 50%; - -webkit-transition-duration: 0.15s; - transition-duration: 0.15s -} - -#treeRoot .toggle:hover { - background-color: rgba(255, 255, 255, 0.5); -} - -#treeRoot .toggle .fa { - margin: 0; - width: auto; -} - -#treeRoot .fa, -#treeHolder .rootNode .fa { - margin-right: 1px; - width: 1em; - font-size: 1.1em; - text-align: center; - color: #565656; - -webkit-transition-duration: 0.15s; - transition-duration: 0.15s -} - -#treeRoot a[data-private="1"] .icon::after { - position: relative; - float: left; - margin: .5em -1em 0 0; - content: "\f023"; - font-family: FontAwesome; - font-size: 0.75em; - color: #d9534f; -} - -#treeRoot .fa-file, -#treeRoot .fa-file-o, -#treeRoot .fa-file-code, -#treeRoot .fa-file-code-o {} - -#treeRoot .fa-folder, -#treeRoot .fa-folder-open, -#treeRoot .fa-folder-o, -#treeRoot .fa-folder-open-o, -#treeRoot .fa-exclamation-triangle { - margin-top: 0.1em; - text-align: left -} - -#treeRoot .fa-link { - margin-right: 0; - font-size: 0.8em -} - -#treeRoot #binFull { - display: none -} - -/* treeRoot dark */ - -.dark #treeMenu { - background-color: rgba(0, 0, 0, 0.2); - border-bottom-color: rgba(0, 0, 0, 0.2); - border-right-color: #2a2d33 -} - -.dark #treeMenu .treeButton { - color: #a9a9a9; -} - -.dark #treeMenu .treeButton:hover:not(.disabled) { - background-color: #2d3033; - color: #fff -} - -.dark #tree .treeframebody { - background-color: #202329; - border-color: #2a2d33 -} - -.dark #treeHolder .rootNode a { - color: #c5c5c5; -} - -.dark #treeHolder .rootNode a:hover { - color: #eee -} - -.dark #treeRoot { - color: #b3b3b3; -} - -.dark #treeRoot a { - color: #b3b3b3; -} - -.dark #treeRoot a:hover:not(.empty), -.dark #treeRoot a.current { - background-color: rgba(255, 255, 255, 0.15); -} - -.dark #treeRoot a.selected, -#treeRoot .dragenter > a { - background-color: rgba(0, 142, 255, 0.19); -} - -.dark #treeRoot .dragafter > a::after, -.dark #treeRoot .dragbefore > a::before { - background-color: rgba(255, 255, 255, 0.25); -} - -.dark #treeRoot a .title { - color: #7cb2dc; -} - -.dark #treeRoot a.hidemenu .title { - color: #c5c5c5; -} - -.dark #treeRoot a.deleted .title { - color: #a52a2a; -} - -.dark #treeRoot a.unpublished .title { - color: #d0726b -} - -.dark #treeRoot .icon:hover > .fa { - color: #fff -} - -.dark #treeRoot a .title:hover { - color: #a2d4fb; -} - -.dark #treeRoot a.hidemenu .title:hover { - color: #eee -} - -.dark #treeRoot a.unpublished .title:hover { - color: #f38e86 -} - -.dark #treeRoot a.deleted .title:hover { - color: #e23d3d -} - -.dark #treeRoot .toggle:hover { - background-color: rgba(255, 255, 255, 0.19); -} - -.dark #treeRoot .fa, -.dark #treeHolder .rootNode .fa { - color: #bcbec0; -} - -/* ElementsInTree plugin */ - -#treePane .panel-title { - font-size: 0.8125rem; -} - -#treePane .panel-title a { - padding: 4px 0 6px 0.6rem !important; - font-size: 0.8125rem; -} - -#treePane .panel-title > a:before { - display: none !important; -} - -#treePane .tab-page ul { - margin: 7px 0 !important; -} - -.ElementsInTree #tree .eltree { - padding-left: 1rem !important; - font-size: 13px; -} - -.dark #treePane .panel-heading { - border-top-color: #3e4144 !important; - border-bottom-color: transparent !important; -} \ No newline at end of file From 070ebaf3b01d4794a9638bf0c95bae4adcb24c7b Mon Sep 17 00:00:00 2001 From: Serg <64j@mail.ru> Date: Tue, 3 Apr 2018 01:05:30 +0300 Subject: [PATCH 111/274] add horizontal white logo image --- .../default/images/misc/logo-navbar-white.png | Bin 0 -> 5867 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 manager/media/style/default/images/misc/logo-navbar-white.png diff --git a/manager/media/style/default/images/misc/logo-navbar-white.png b/manager/media/style/default/images/misc/logo-navbar-white.png new file mode 100644 index 0000000000000000000000000000000000000000..41fa6a72bf9156cfe78b9095ed07f7493658c845 GIT binary patch literal 5867 zcmV7~22wIEGY5!7q55OUwfF(q+h4g=dX*zFztN{@JC(*$Jh5-VI5mw{@i@OOxY6GyyYXBB^4h(}C zU@P)K84!ps4B8?OTNzDeIlX~EDe#|!QUWh#I&$+p))<(6tB6n}!Ab{M=@EdD%gF;5 z2q|Eqz;FjDI1n4q$0OGOCXq`GGVli+QEot`^t%9?ov}PNQ?aNpAR>iet9{8y(G6s#=nrJrg(45H4D%1f{r~&tKf@H4#W>qOUz`0wiUqlA zH+~>g^y7(TWbgpm#l!{{0C7A4{ed5I`6K4Q%2$K+C}kz~1czXgPBL*raP14K6AKG%$cKz`8i+?tfZ4Cv0U1 zhz)E%}5K7>-~39ZC3ks2UH;*AhQc@fL8v_C!!o3N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rn#+4{DngUzT4JECOb(yHB_gW?PMsf>^NRxL_~>g)PiBsa`%FJ6NPc6ts^z` z&LxM3>GWMEJZiHU6bgW&y0FXbmT=LAiGb?G&M2)XaM)#bVynN&AKbPkU;g!4Cut<- z!cNHX_BYZuHtitU>_T;(c2r^vegxLWy(A2Q7+tZU=Ty5GweIvbY!Qn26e;g;%orM7QWUkh z9yDVZyPdoiLmMK~DP9D7LO&v7ovQcs4?cdLC+pW#UlYu5>ZrP{Z8Wql zB>oX3>TwIsMLQEx4o#ZV1_$~Kqrk^e6Mjd`e~aK zsBCbQK#7(;RGA)toMb{YH1T{y<#)p_5J(tmH{B>}A9Uo$BEi^`%)E2fp4c4YR?^=( zQ7=7P&DXEwkyi>)OQ65ACV$+O8^_cu#H@AfRV@%RYvgu@fn>0M!XkjAB340x2AFq5 z$;hvA97P^AqQ+ZgzqtoZK~#}6jL8* z1Jz4yuj9Ih#wsLjM;NS literal 0 HcmV?d00001 From 4fd89e6182421ce1621c5515ee78ee1553572567 Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Tue, 3 Apr 2018 01:38:31 +0300 Subject: [PATCH 112/274] add Darkness style for tinyMCE --- .../skins/darkness/content.inline.min.css | 1 + .../tinymce/skins/darkness/content.min.css | 1 + .../skins/darkness/fonts/tinymce-small.eot | Bin 0 -> 9492 bytes .../skins/darkness/fonts/tinymce-small.svg | 63 +++++++++ .../skins/darkness/fonts/tinymce-small.ttf | Bin 0 -> 9304 bytes .../skins/darkness/fonts/tinymce-small.woff | Bin 0 -> 9380 bytes .../tinymce/skins/darkness/fonts/tinymce.eot | Bin 0 -> 17572 bytes .../tinymce/skins/darkness/fonts/tinymce.svg | 131 ++++++++++++++++++ .../tinymce/skins/darkness/fonts/tinymce.ttf | Bin 0 -> 17408 bytes .../tinymce/skins/darkness/fonts/tinymce.woff | Bin 0 -> 17484 bytes .../tinymce/skins/darkness/img/anchor.gif | Bin 0 -> 53 bytes .../tinymce/skins/darkness/img/loader.gif | Bin 0 -> 2608 bytes .../tinymce/skins/darkness/img/object.gif | Bin 0 -> 152 bytes .../tinymce/skins/darkness/img/trans.gif | Bin 0 -> 43 bytes .../tinymce/skins/darkness/skin.ie7.min.css | 1 + .../tinymce/skins/darkness/skin.min.css | 1 + .../tinymce/skins/lightgray/content.min.css | 2 +- 17 files changed, 199 insertions(+), 1 deletion(-) create mode 100644 assets/plugins/tinymce4/tinymce/skins/darkness/content.inline.min.css create mode 100644 assets/plugins/tinymce4/tinymce/skins/darkness/content.min.css create mode 100644 assets/plugins/tinymce4/tinymce/skins/darkness/fonts/tinymce-small.eot create mode 100644 assets/plugins/tinymce4/tinymce/skins/darkness/fonts/tinymce-small.svg create mode 100644 assets/plugins/tinymce4/tinymce/skins/darkness/fonts/tinymce-small.ttf create mode 100644 assets/plugins/tinymce4/tinymce/skins/darkness/fonts/tinymce-small.woff create mode 100644 assets/plugins/tinymce4/tinymce/skins/darkness/fonts/tinymce.eot create mode 100644 assets/plugins/tinymce4/tinymce/skins/darkness/fonts/tinymce.svg create mode 100644 assets/plugins/tinymce4/tinymce/skins/darkness/fonts/tinymce.ttf create mode 100644 assets/plugins/tinymce4/tinymce/skins/darkness/fonts/tinymce.woff create mode 100644 assets/plugins/tinymce4/tinymce/skins/darkness/img/anchor.gif create mode 100644 assets/plugins/tinymce4/tinymce/skins/darkness/img/loader.gif create mode 100644 assets/plugins/tinymce4/tinymce/skins/darkness/img/object.gif create mode 100644 assets/plugins/tinymce4/tinymce/skins/darkness/img/trans.gif create mode 100644 assets/plugins/tinymce4/tinymce/skins/darkness/skin.ie7.min.css create mode 100644 assets/plugins/tinymce4/tinymce/skins/darkness/skin.min.css diff --git a/assets/plugins/tinymce4/tinymce/skins/darkness/content.inline.min.css b/assets/plugins/tinymce4/tinymce/skins/darkness/content.inline.min.css new file mode 100644 index 0000000000..7b45d33971 --- /dev/null +++ b/assets/plugins/tinymce4/tinymce/skins/darkness/content.inline.min.css @@ -0,0 +1 @@ +.word-wrap{word-wrap:break-word;-ms-word-break:break-all;word-break:break-all;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.mce-content-body .mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:black;font-family:Arial;font-size:11px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;line-height:normal;font-weight:normal;text-align:left;-webkit-tap-highlight-color:transparent;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-object{border:1px dotted #3A3A3A;background:#D5D5D5 url(img/object.gif) no-repeat center}.mce-preview-object{display:inline-block;position:relative;margin:0 2px 0 2px;line-height:0;border:1px solid gray}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-preview-object .mce-shim{position:absolute;top:0;left:0;width:100%;height:100%;background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}figure.align-left{float:left}figure.align-right{float:right}figure.image.align-center{display:table;margin-left:auto;margin-right:auto}figure.image{display:inline-block;border:1px solid gray;margin:0 2px 0 1px;background:#f5f2f0}figure.image img{margin:8px 8px 0 8px}figure.image figcaption{margin:6px 8px 6px 8px;text-align:center}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc li{list-style-type:none}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#D5D5D5 url(img/anchor.gif) no-repeat center}.mce-nbsp,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid rgba(208,2,27,0.5);cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td[data-mce-selected],th[data-mce-selected]{background-color:#2276d2 !important}.mce-edit-focus{outline:1px dotted #333}.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus{outline:2px solid #2276d2}.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover{outline:2px solid #2276d2}.mce-content-body *[contentEditable=false][data-mce-selected]{outline:2px solid #2276d2}.mce-content-body *[data-mce-selected="inline-boundary"]{background:#bfe6ff}.mce-content-body .mce-item-anchor[data-mce-selected]{background:#D5D5D5 url(img/anchor.gif) no-repeat center}.mce-content-body hr{cursor:default}.ephox-snooker-resizer-bar{background-color:#2276d2;opacity:0}.ephox-snooker-resizer-cols{cursor:col-resize}.ephox-snooker-resizer-rows{cursor:row-resize}.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging{opacity:.2}.mce-content-body{line-height:1.3} \ No newline at end of file diff --git a/assets/plugins/tinymce4/tinymce/skins/darkness/content.min.css b/assets/plugins/tinymce4/tinymce/skins/darkness/content.min.css new file mode 100644 index 0000000000..eccfc94a92 --- /dev/null +++ b/assets/plugins/tinymce4/tinymce/skins/darkness/content.min.css @@ -0,0 +1 @@ +body{border-color: #414449;background-color:#202329;color:#bbb;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:14px;line-height:1.3;scrollbar-3dlight-color:#F0F0EE;scrollbar-arrow-color:#676662;scrollbar-base-color:#F0F0EE;scrollbar-darkshadow-color:#DDDDDD;scrollbar-face-color:#E0E0DD;scrollbar-highlight-color:#F0F0EE;scrollbar-shadow-color:#F0F0EE;scrollbar-track-color:#F5F5F5}td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:14px}.word-wrap{word-wrap:break-word;-ms-word-break:break-all;word-break:break-all;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.mce-content-body .mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:black;font-family:Arial;font-size:11px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;line-height:normal;font-weight:normal;text-align:left;-webkit-tap-highlight-color:transparent;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-object{border:1px dotted #3A3A3A;background:#D5D5D5 url(img/object.gif) no-repeat center}.mce-preview-object{display:inline-block;position:relative;margin:0 2px 0 2px;line-height:0;border:1px solid gray}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-preview-object .mce-shim{position:absolute;top:0;left:0;width:100%;height:100%;background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}figure.align-left{float:left}figure.align-right{float:right}figure.image.align-center{display:table;margin-left:auto;margin-right:auto}figure.image{display:inline-block;border:1px solid gray;margin:0 2px 0 1px;background:#f5f2f0}figure.image img{margin:8px 8px 0 8px}figure.image figcaption{margin:6px 8px 6px 8px;text-align:center}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc li{list-style-type:none}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#D5D5D5 url(img/anchor.gif) no-repeat center}.mce-nbsp,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid rgba(208,2,27,0.5);cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td[data-mce-selected],th[data-mce-selected]{background-color:#2276d2 !important}.mce-edit-focus{outline:1px dotted #333}.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus{outline:2px solid #2276d2}.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover{outline:2px solid #2276d2}.mce-content-body *[contentEditable=false][data-mce-selected]{outline:2px solid #2276d2}.mce-content-body *[data-mce-selected="inline-boundary"]{background:#bfe6ff}.mce-content-body .mce-item-anchor[data-mce-selected]{background:#D5D5D5 url(img/anchor.gif) no-repeat center}.mce-content-body hr{cursor:default}.ephox-snooker-resizer-bar{background-color:#2276d2;opacity:0}.ephox-snooker-resizer-cols{cursor:col-resize}.ephox-snooker-resizer-rows{cursor:row-resize}.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging{opacity:.2} diff --git a/assets/plugins/tinymce4/tinymce/skins/darkness/fonts/tinymce-small.eot b/assets/plugins/tinymce4/tinymce/skins/darkness/fonts/tinymce-small.eot new file mode 100644 index 0000000000000000000000000000000000000000..b144ba0bd949de3c0f87abdd78b517067169884f GIT binary patch literal 9492 zcmcgyYj7Lab-s5Oz=CfqL2yNo1o0rSA|ZkhKoF!Pk}Fb@EmM-IM`Za;N@gTQlt?}7 zN^YjzI+ml=>J6ee66+Gi(ljj5V?YXgkiHL~VwhLrW_=jFxj4b&}2FxhUJr zGAxUpyHmmdVx*4QOl8^o5BBGpnpMn%-9VZ?c6w&v`+xksXECS)^||9S=NFKJUw#F- z|M=Xc&)3`&`5x+58SC<#n4Nh-J1%~evFHovA3T8u?G5!8sK0}H_leUNF8)|){yo$` zLjC64{IQw$x_|f(W3dlVzi@iy;sV>v-eW9&FY3`VGpA>rJwN#k)KB0Y?=H-rzW_dQ zbq`TLQ`P^%o4t%FzpKz2zV7DypIM&Q(6|*B2ivPJi?N@ps#p@tQjyR}Yf-(TvOsU6 z)PX)XSLLV<=3!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j?Y~tiBZ$a8S1Ef?ezQ{c;zu*NO4*0@FILL6@G<}8 z!pSq2P9K}?JAZm+Ztl*%#W_5C?)=I5GtteN?D{{z`HXZv$Df>=Ik)=PKcDg0 zUGrxyM32v&nLRgiVfKmW(M!?Y$L9CW&!5S#UGgVG7g!WODVoKPhv + + +Generated by IcoMoon + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/plugins/tinymce4/tinymce/skins/darkness/fonts/tinymce-small.ttf b/assets/plugins/tinymce4/tinymce/skins/darkness/fonts/tinymce-small.ttf new file mode 100644 index 0000000000000000000000000000000000000000..a983e2dc4cb30880fffe00e1f0879be4d95eb4cc GIT binary patch literal 9304 zcmcgyYj7Lab-s5Ozyf??34$wvB!~xr6$uf90D>SbkzA3IY?+cwJtDttQZgecqA2QN zS8_A$#<3iwZW2{-ovAyiIrXDI+=r%r>Si?Q&5S4YbR3WCaoZ$KV@#^abf)c$o3^go z5tjYVU4W!$N%fy*!MpdlXV1O&-0wV=j5EgSnaxy|yYIk2zPUy1LCZCynIk7>7r*~U z-+PuZ-iiAB(b=<$$b+a~Lhe60f8q0iyQAMj{W4?So?~;fPiRNQuQC>U0sTYA(4f7c z{sQ%PQ13Z*^4$3!D=oi^`bVf=pFeeE_Pw4TKEzo31Juu*oIStDcCq&uOWcEcY+?4~ zoU{8UUqbyD-tq3@sk7(6C$64h>SwC@UwE^ZG39p@dc!x|oc}W`@Boclb8)bJ^JOvi zb5#|~f>|mOI%zFxS40VR z&3M8W)?3>O@%&Jc7sAP6D6S9l&2c2Xkkkj$NjV~^7sBqSQEup}C|9n=2L|FwIX>Xn zmSsCOw{0sOaqLLiLe8y7+MZUX%LDOBOpd%NM8)Q88FPrF(~)JS*n$dg*iIO8w!xbX z-de#~7E5Mkx%=iSZ{Wn#qTEOpqr97kB!9%GF4-|1#g3#qTC%=6_02ln zd$9v=#e0<>JlE2Zj#T8!l~`n3O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9s%;7~l5|MY_oy~bNWH|soc); zo6o%tL>rck8k;||D&;iM~^_>H!gkk`(n3Y}5TCte& ziO(I11-PK~C%nOE;0r3kva$9nAG4Upug*c=%&gOi**R@uk5m0UkkpgtO#Er;~5>$0CuL6LgRDpO~S0 zXC%_8oW6bgyJMNm7^P#GvHq=1`Q)}e+r~1=oK zE}gN=i({GIEoz&gjw`8$4rRs|E*u|9!KbJG;_=3<|H*1S)XLt=j?q^lnXeS_71s|h zgCd>^wc^4v@_RmXDEdG4_$4K`&%KYjl-vqEhPs7hQ+v5g^-B8csxpnCROzGqw1@Fk zb$~Yr01|V=9~1*`Cjq;kG4l!(*DW+l>asVM*&Y@I4~FZ z^}u^Ivo+7x{8jD7+S%Ig)H-#Ob5^%KO1#vAerWBQ^Fyxm`v3z2!1_y|0(c6m2rgWwQ29mCH5oi{Asr z;>#&oBIt3;3ef)B@(%E2jw@)WiM;N_cnLD5A9zpmuui-{>%B}OBYWbS?D`= za(;0U|EzMHEwPLElyL;%n?809rFs18%;Ld?v*(VVT8eGz&$5H)I*YF3;BJY<5c%w9 z*-uI5Qx4m=aP-N=`Lk>vUUif`2@dAj*-!cG^r@xuv7-x13uougFFX-Dd@;83$f@0@ uPA&DbY02?<@O%`6m*hO=G3f>N1lkT`;`CoRM=)wP63q_(y@A!b>-E1{Pg!yR literal 0 HcmV?d00001 diff --git a/assets/plugins/tinymce4/tinymce/skins/darkness/fonts/tinymce.eot b/assets/plugins/tinymce4/tinymce/skins/darkness/fonts/tinymce.eot new file mode 100644 index 0000000000000000000000000000000000000000..f99c13f32f5c968849f08a3d8a399157bfb0cccb GIT binary patch literal 17572 zcmdsfd3+pKo#%U1eW)dMt6P0kt97_r?e3N(t97(WE!&b@wru%O6f1Uo#KeglTk(M% z%U1{)GE>-$0W%3+t{Jik7VBil1_FE*$ZkUBGqnR`2R7l851V0tnXrN^83YL*K7pA8 zR$bcf?^Tu5lI?hy{p>$m-LKw#|L*s?AKSnfgX2s>p#0(N5~ui0W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35!H<61`lw6>JUiJRf3EebEwVLf{e+C zl9cE=vNebEYzSw(1L95%@iwqQ;+Q!9G+!}a*~^>FAMfR9p5ANzSb7yN-n=M7tiu#& z>NwWH4Hj9Xiv-e?!xf3&TI><)<;!Z9s8UNf&d-*hLzu*h}g0 zpAjr^o!<4C(z`^|L=+Zek@&OHyR1#O%KS`v+=^m+L=O$Y7iwXV!!H5o_pW4Y0kMGM zAjmYNHwC{eAne0EB9agAB5?tF2-hS7>5wyV)L`hKbCgDsAi;oe`cKk-cV|uiKeH+b z{CHjt|Kb;pKQ}$6;}q9Gyn^;rJg6srCk~Q_{I^{dq9r?1cn?@DSxHol;&7VnJ8{Q9 zz9esHImEdKW%71?V@W$yzSmBBX-QrK;^f#8M|H~5$STVWINkOc{3$pME(wP?hZFha zYgQWTgx`*pc-xLs-XH3mww!vci`yWnb-vB(g{dy`xDG#1R-V$yU0#xASaF(@D75x<-sQ6gL-&DNri}}WV->-~Uj#YlK@}(-R>Ri?H z)eJ`To2nnHe!lwG{)B(b|Aha!Kr(P9@Ly_J&3!=@>JQ}^RUB+-)SPmCq*NE}O?OFWVI$NFG>bA3(@yDg5Qf8Tbd0b{Br*mc(yN S4xrR19F>Jx9kYDL=l=i@ywbP; literal 0 HcmV?d00001 diff --git a/assets/plugins/tinymce4/tinymce/skins/darkness/fonts/tinymce.svg b/assets/plugins/tinymce4/tinymce/skins/darkness/fonts/tinymce.svg new file mode 100644 index 0000000000..5727cea425 --- /dev/null +++ b/assets/plugins/tinymce4/tinymce/skins/darkness/fonts/tinymce.svg @@ -0,0 +1,131 @@ + + + +Generated by IcoMoon + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/plugins/tinymce4/tinymce/skins/darkness/fonts/tinymce.ttf b/assets/plugins/tinymce4/tinymce/skins/darkness/fonts/tinymce.ttf new file mode 100644 index 0000000000000000000000000000000000000000..16536bfd7a292e7090b9d4e0ae61061da9bc042f GIT binary patch literal 17408 zcmdsed3+pKo#%U1eW)dMt6P0kt97_r?e3O!v|4JFTDB#*Y}xXmC|2zFh=~(9w&DXH z@)bgc%oH|bf|&#_*9_SNi*Yh!0s%e?WH%x6nc4xe1Do*4hs`p;Ojtpd41$CYp8%7< zs!RL*y{eX4vK-Ns>n%b&QBjq``@%_j4P5!UD zFaL}&-T>EgaNp@kr283@#^6^RJo?_d@2`An0P)?7^?&@(#J&Snov{F8gRdjM_Ye}? zpL6swwq`lv%MTqpbMMck(EAbJg!X=O^u+#s-<|l$t&FYhNB-=wefLhX2iYeWTi1tp z{P@0O6IX5xIT1(u{KDjk(`PVFJVVoz&t!R)Ut-9YJ|(??l#f_G{{_o)58~wy$FLVa z8e_k_S2pGhrpa)~q_rqLaS@>2$Tc9(@?}w~fjM{->FZF>$t0x3r(34g*Q#Fgz1H?K zK2tGMH4~T#&os`o%(TvQ%&0R1Gizt|{rt(FfBqM}zxeFyM_zyN^_Sl`@`mxo?|ymj zTybtr^cJ6H)2*+u*SxQ_{*28q(MD*dVJ0ow$jz*rS%Ws7KpU!P+GlIe)jBZ0 z^7)Ga{Tp7Kam=QstSyPL!b;KfLi_KWhLxT(Fd&0DSOo(-@k9W>d?1NH9>KgK>$AFp znM~KYUSyi2ji|CQ%Vd2Hi83<{uBq^~IYY*e1+jx&XeX29$wad&90*17iSAxC(35sI zaV4qZ6%4tMmquDI@*+w&-^9c62Oo-#CCqrDvoj%0Cpr@wWQTM`c1d6LxQlVO$K&SH zjtYm#x%9h-qR5|}5=F-oV-d+EUy&U0?9)_C9(Q{m#vo0__Ady3tbZ2O|VQEJe*UW?al&uO>A%iH5(bkwN%ZyBRC>xH)%V`*e1 zU(8v0Bn4|yBAxY zDJZUp9qUbJoB$5-Pd29kG-?l(vHp30EC4p-DgcH7!rc*sQQj&^5LPO0l|*5yyj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gE5|CoQ2A1oR&}oG`Dz9u`c2i3RX<<-D{ss@=6%BZoG

      %>5G!E9d;po#12=2c3%XA;0_N`e8{oF62b@VFl-07 zDP*NP5PqK>cH-t++zz{tzReC-;@n$2TVXQEC*9 N%EGLUS-#`*e*qFO!Ds*g literal 0 HcmV?d00001 diff --git a/assets/plugins/tinymce4/tinymce/skins/darkness/fonts/tinymce.woff b/assets/plugins/tinymce4/tinymce/skins/darkness/fonts/tinymce.woff new file mode 100644 index 0000000000000000000000000000000000000000..74b50f4c3001da7fdfffd8638213dcf1a396da78 GIT binary patch literal 17484 zcmdsed3+pKo#%U1eW)dMt6P0kt97_r?e3O!v|4JFTDB#*EZOp*C|2y)PMkQAV=F%J zeT0x9Glk8VU?#!KHA6PRVw?<_K!DEz*-glNrgnhrz$Se1VY3V{6IPHVgCOCe7CHud1b%Y{!$C&;GO3{p#KK?|!e|yJcjAafWBz4XjG|%!*TZ@v~)HXE!n{kUBxG zrnc%cdyninj>q^-Isp8f6pnTNspiml_lrjfB1cOBkeK9`aePL{>rBY4ovRZ z$Jm-aWl>rAQ5S(&z6&Of8No1;K=EFk%oHwx8!~yg+6fj*j|)d`vA(!lKbA| zPj5c5=U&ts`XJ(Q;T~k4Ji6z|B+}3?KTq!R%^~OUW2a7IzU}knWQ1gSmS1E}jPcXb z3y6Qz^7$`Wo_i24f4ILqMq!PyU)?Jka|Y97IHZU*g-=ghyhSevH6V||4R}+j2Ik;V z_(Q1YWD?Ti(=F5LYgMoLUTga~pQ)IsnhDH=XBuZ(W?E-DX4IL1nYA-}e(~flzVOT5 zUw-cOL$AO1`pa(|dc%0*_rJP#t~fV`w$SG^n{IuLz2<$b_2+Dci8ewr4Kr!cMs8;1 z%o?=u1lmwV8!s$rgU`Jhcf{q`%2;2lF}g_^RW>Q>lp&>G=~41Zm(r=UD{V@3`1$a+ z!ULffLsh{igO3GkYM-q=TkEiACI<5FcyY!tn;Nl7Rx=V~g_UAy7uNTk)3DNW1_op> z2Ou$kjY$O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4<3{B`T< z4%hu%-H&6TSWB!wHXgepb~tu6_C)NT>izZ2^*!~UsDHiT_J(^JH#Xke_+;Y?jnhpH zO`8P<+|NEvngyN`rih6B^06<9QiOAEq!IQ}NjICY!^B~G?XUykGj^E1C<)tP7t%-V za3yH>1yBg?@F2y994jm#yx$JPc7U5gR=NY>_uFA7Zob9sunXy1?QkXT{XTa3;L-OT z**git|3P*XAB!CU^Pb!>dGgf3V@Km%*&I#UK1Co#}7_z+|dJ9*WTBgc-Oj_;p5I(c%>>B)WZyWSVywD;K9v13QGkSVC|)98Ia jnmH;)vjEB<5wG8q|kKzxu40~1eAV&{y5e`l1KFoiKNSOWkz C+YCGa literal 0 HcmV?d00001 diff --git a/assets/plugins/tinymce4/tinymce/skins/darkness/img/loader.gif b/assets/plugins/tinymce4/tinymce/skins/darkness/img/loader.gif new file mode 100644 index 0000000000000000000000000000000000000000..c69e937232b24ea30f01c68bbd2ebc798dcecfcb GIT binary patch literal 2608 zcmdVcdr(tX9tZGC9yiG~=H_*Q-0%n(kWqP*D#hw{AQu8;1%gl-Hrf&{2?48KX;hHy z3Ze*zEz4t3XdUFyLbNPUYlA`|B}P=N1fqtL1*}S;87#|-W9v<#G;ul(e%d3)N(^9c$d2Dz{7}?ErjNd;{EMKkCsk21~b9Gvg zDo<7L=3Z5HNbVlZUcm1eg#o#CZCJU`3IYHwM->zCd?uYrF3vKFeM}v?f+%s?E>ly|3W25ry9#NNbTx-}0ON58dTrs^ix{_1O0Wh~SVSBlH)Ajn zPn^Gbjz}PCtN@#keR&hK&Dhl-b$kZ8^S)x#dh0{7X=X%CCJk7P1PSO>T&S8I4{#Lg zb5#)o=;!ZP*1nM{cI4@(x7o27*SA()NHmrn67aN@Pmi~(i_SnrjYnwh36aG%!@i0d zqbvfa44f|?OG4ntP|nbjhEl1)Yp6ZN@yjy zy4==QmLy%t;ps3R?~f2KfTTI|2?q8dFd6^z5GF+Xa&Y)sjG)hxit80pPcOP zJ z*LW{SyGHD%hUotV+W%I}fBLAIx!8|7#}$;clKQ+{&FjDqGQ2ZNx(lYM3*%~}ILnao zM`aui55~ZFJlu^!5rdA9Q_7H68H_;##u{x(Yn-vSfIRCb^Nqsg zGRS!Egm>h+o<}LeV4&CLReo9FrDjDvs}8?JwC)#Qs|ie=r?~xUh)&*d`Fx>FG}%X# zNdtDHBKhLPC0wpooFDAQKL%*6T|ULH$=wX!NhcasgD3d;-d$I6yRK3yN+E~C1335_iLOt+*9uvSZ`>*KA}vm}08wRq=>5l|t*Na&jR z-C1&C`nkEk#sB|@yyt-#fXngP04My zm7u$Q%EJbHp`>~`5W&L{W!6`y&}LMS;jfUpgO~7TLVMRZ9IC)IZp0A${`yp0{&wco z#1nx@XMkhqeK%7?RE7JdLr1^nwFfaJ0Q&Lv?WNJ%9}VSJsNY2+UYs2%EU0J~ayFXv zi*?7KCXQHkD)O6!0Q%4N+HTODHxJ{kQSuQX$l-rSwkwh(zMkdfzxyGwl@yHC)C4p< z&n2%8#M?)Q@mgHL1ot8`SFdSEj9ye|jHy+U8#@HoUExG=@AVkRAe_qYm4EpzK6L*& zh`)26?V#f4#_h^P9G^%>h2-H3)$QP zQovu6J9qDvsxqweDdNNa!Lb?L4_UF{tLX_nN7r0U_vF14YKcGR-*Gl} zx3oG)bzf|65dBxD-;2ZCp??K;+TuQ9onnK?==5hzbkb^r_g>z4#D8mcv8(+XdoszA zCx-qhdgxMNMotj}SiL_6V(tLcsK7(M(r(%u<}QrVfOvyK6_;~NOTlPGfX@M7S5YQF z&*$(ylJMHJt^_aQeu{C6NaTE$G3HNN@_SnN8YcaKn%`)F@~L1x+ah7-gEJPpc6w%3 zyX}r+Qk$4RHZzfH){e~F*qJ{d*L8a6n4;U?+{de0-t)mal#TVxe)3F}^UBh+zd T)6_**#cgp_+?JL9(ew3BlNF>u literal 0 HcmV?d00001 diff --git a/assets/plugins/tinymce4/tinymce/skins/darkness/img/object.gif b/assets/plugins/tinymce4/tinymce/skins/darkness/img/object.gif new file mode 100644 index 0000000000000000000000000000000000000000..cccd7f023fb80908cb33bb7d9604236cd21b7ae7 GIT binary patch literal 152 zcmV;J0B8S4Nk%w1VG#fg0J9GO<>lo+KR<78Z?v?uS65g4{r%Y3*xlXT%F4>`@9+2b z_ww@cot>Tk|Nk>HGXMYpA^8LW000jFEC2ui01*HU000C<(8)=wd#<&tyXIMjHBV`d zBSi|xsj3(;nD0kQ0aJq8eLH~x02P|t2!_J&Wqb%0io?#xD.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:rgba(0,0,0,0.2);border-bottom-color:rgba(0,0,0,0.25);top:-11px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow:after{top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.mce-floatpanel.mce-popover.mce-bottom.mce-start{margin-left:-22px}.mce-floatpanel.mce-popover.mce-bottom.mce-start>.mce-arrow{left:20px}.mce-floatpanel.mce-popover.mce-bottom.mce-end{margin-left:22px}.mce-floatpanel.mce-popover.mce-bottom.mce-end>.mce-arrow{right:10px;left:auto}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;height:100%}div.mce-fullscreen{position:fixed;top:0;left:0}#mce-modal-block{opacity:0;filter:alpha(opacity=0);zoom:1;position:fixed;left:0;top:0;width:100%;height:100%;background:#000}#mce-modal-block.mce-in{opacity:.3;filter:alpha(opacity=30);zoom:1}.mce-window-move{cursor:move}.mce-window{filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;background:#fff;position:fixed;top:0;left:0;opacity:0;transform:scale(.1);transition:transform 100ms ease-in,opacity 150ms ease-in}.mce-window.mce-in{transform:scale(1);opacity:1}.mce-window-head{padding:9px 15px;border-bottom:1px solid #c5c5c5;position:relative}.mce-window-head .mce-close{position:absolute;right:0;top:0;height:38px;width:38px;text-align:center;cursor:pointer}.mce-window-head .mce-close i{color:#858585}.mce-close:hover i{color:#adadad}.mce-window-head .mce-title{line-height:20px;font-size:20px;font-weight:bold;text-rendering:optimizelegibility;padding-right:20px}.mce-window .mce-container-body{display:block}.mce-foot{display:block;background-color:#fff;border-top:1px solid #c5c5c5}.mce-window-head .mce-dragh{position:absolute;top:0;left:0;cursor:move;width:90%;height:100%}.mce-window iframe{width:100%;height:100%}.mce-window-body .mce-listbox{border-color:#ccc}.mce-rtl .mce-window-head .mce-close{position:absolute;right:auto;left:15px}.mce-rtl .mce-window-head .mce-dragh{left:auto;right:0}.mce-rtl .mce-window-head .mce-title{direction:rtl;text-align:right}.mce-tooltip{position:absolute;padding:5px;opacity:.8;filter:alpha(opacity=80);zoom:1}.mce-tooltip-inner{font-size:11px;background-color:#000;color:white;max-width:200px;padding:5px 8px 4px 8px;text-align:center;white-space:normal}.mce-tooltip-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.mce-tooltip-arrow-n{border-bottom-color:#000}.mce-tooltip-arrow-s{border-top-color:#000}.mce-tooltip-arrow-e{border-left-color:#000}.mce-tooltip-arrow-w{border-right-color:#000}.mce-tooltip-nw,.mce-tooltip-sw{margin-left:-14px}.mce-tooltip-n .mce-tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-s .mce-tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-e .mce-tooltip-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:none;border-top-color:transparent;border-bottom-color:transparent}.mce-tooltip-w .mce-tooltip-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:none;border-top-color:transparent;border-bottom-color:transparent}.mce-progress{display:inline-block;position:relative;height:20px}.mce-progress .mce-bar-container{display:inline-block;width:100px;height:100%;margin-right:8px;border:1px solid #ccc;overflow:hidden}.mce-progress .mce-text{display:inline-block;margin-top:auto;margin-bottom:auto;font-size:14px;width:40px;color:#333}.mce-bar{display:block;width:0;height:100%;background-color:#d7d7d7;-webkit-transition:width .2s ease;transition:width .2s ease}.mce-notification{position:absolute;background-color:#f0f0f0;padding:5px;margin-top:5px;border-width:1px;border-style:solid;border-color:#ccc;transform:scale(.1);transition:transform 100ms ease-in,opacity 150ms ease-in;opacity:0}.mce-notification.mce-in{opacity:1;transform:scale(1)}.mce-notification-success{background-color:#dff0d8;border-color:#d6e9c6}.mce-notification-info{background-color:#d9edf7;border-color:#779ecb}.mce-notification-warning{background-color:#fcf8e3;border-color:#faebcc}.mce-notification-error{background-color:#f2dede;border-color:#ebccd1}.mce-notification.mce-has-close{padding-right:15px}.mce-notification .mce-ico{margin-top:5px}.mce-notification-inner{display:inline-block;font-size:14px;margin:5px 8px 4px 8px;text-align:center;white-space:normal;color:#31708f}.mce-notification-inner a{text-decoration:underline;cursor:pointer}.mce-notification .mce-progress{margin-right:8px}.mce-notification .mce-progress .mce-text{margin-top:5px}.mce-notification *,.mce-notification .mce-progress .mce-text{color:#333}.mce-notification .mce-progress .mce-bar-container{border-color:#ccc}.mce-notification .mce-progress .mce-bar-container .mce-bar{background-color:#333}.mce-notification-success *,.mce-notification-success .mce-progress .mce-text{color:#3c763d}.mce-notification-success .mce-progress .mce-bar-container{border-color:#d6e9c6}.mce-notification-success .mce-progress .mce-bar-container .mce-bar{background-color:#3c763d}.mce-notification-info *,.mce-notification-info .mce-progress .mce-text{color:#31708f}.mce-notification-info .mce-progress .mce-bar-container{border-color:#779ecb}.mce-notification-info .mce-progress .mce-bar-container .mce-bar{background-color:#31708f}.mce-notification-warning *,.mce-notification-warning .mce-progress .mce-text{color:#8a6d3b}.mce-notification-warning .mce-progress .mce-bar-container{border-color:#faebcc}.mce-notification-warning .mce-progress .mce-bar-container .mce-bar{background-color:#8a6d3b}.mce-notification-error *,.mce-notification-error .mce-progress .mce-text{color:#a94442}.mce-notification-error .mce-progress .mce-bar-container{border-color:#ebccd1}.mce-notification-error .mce-progress .mce-bar-container .mce-bar{background-color:#a94442}.mce-notification .mce-close{position:absolute;top:6px;right:8px;font-size:20px;font-weight:bold;line-height:20px;color:#858585;cursor:pointer;height:20px;overflow:hidden}.mce-abs-layout{position:relative}body .mce-abs-layout-item,.mce-abs-end{position:absolute}.mce-abs-end{width:1px;height:1px}.mce-container-body.mce-abs-layout{overflow:hidden}.mce-btn{border:1px solid #b1b1b1;border-color:transparent transparent transparent transparent;position:relative;text-shadow:0 1px 1px rgba(255,255,255,0.75);display:inline-block;*display:inline;*zoom:1;background-color:#f0f0f0}.mce-btn:hover,.mce-btn:focus{color:#333;background-color:#e3e3e3;border-color:#ccc}.mce-btn.mce-disabled button,.mce-btn.mce-disabled:hover button{cursor:default;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{background-color:#dbdbdb;border-color:#ccc}.mce-btn:active{background-color:#e0e0e0;border-color:#ccc}.mce-btn button{padding:4px 8px;font-size:14px;line-height:20px;*line-height:16px;cursor:pointer;color:#333;text-align:center;overflow:visible;-webkit-appearance:none}.mce-btn button::-moz-focus-inner{border:0;padding:0}.mce-btn i{text-shadow:1px 1px none}.mce-primary{min-width:50px;color:#fff;border:1px solid transparent;border-color:transparent;background-color:#2d8ac7}.mce-primary:hover,.mce-primary:focus{background-color:#257cb6;border-color:transparent}.mce-primary.mce-disabled button,.mce-primary.mce-disabled:hover button{cursor:default;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-primary.mce-active,.mce-primary.mce-active:hover,.mce-primary:not(.mce-disabled):active{background-color:#206ea1}.mce-primary button,.mce-primary button i{color:#fff;text-shadow:1px 1px none}.mce-btn .mce-txt{font-size:inherit;line-height:inherit;color:inherit}.mce-btn-large button{padding:9px 14px;font-size:16px;line-height:normal}.mce-btn-large i{margin-top:2px}.mce-btn-small button{padding:1px 5px;font-size:12px;*padding-bottom:2px}.mce-btn-small i{line-height:20px;vertical-align:top;*line-height:18px}.mce-btn .mce-caret{margin-top:8px;margin-left:0}.mce-btn-small .mce-caret{margin-top:8px;margin-left:0}.mce-caret{display:inline-block;*display:inline;*zoom:1;width:0;height:0;vertical-align:top;border-top:4px solid #333;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#aaa}.mce-caret.mce-up{border-bottom:4px solid #333;border-top:0}.mce-btn-flat{border:0;background:transparent;filter:none}.mce-btn-flat:hover,.mce-btn-flat.mce-active,.mce-btn-flat:focus,.mce-btn-flat:active{border:0;background:#e6e6e6;filter:none}.mce-btn-has-text .mce-ico{padding-right:5px}.mce-rtl .mce-btn button{direction:rtl}.mce-btn-group .mce-btn{border-width:1px;margin:0;margin-left:2px}.mce-btn-group:not(:first-child){border-left:1px solid #d9d9d9;padding-left:3px;margin-left:3px}.mce-btn-group .mce-first{margin-left:0}.mce-btn-group .mce-btn.mce-flow-layout-item{margin:0}.mce-rtl .mce-btn-group .mce-btn{margin-left:0;margin-right:2px}.mce-rtl .mce-btn-group .mce-first{margin-right:0}.mce-rtl .mce-btn-group:not(:first-child){border-left:none;border-right:1px solid #d9d9d9;padding-right:4px;margin-right:4px}.mce-checkbox{cursor:pointer}i.mce-i-checkbox{margin:0 3px 0 0;border:1px solid #c5c5c5;background-color:#f0f0f0;text-indent:-10em;*font-size:0;*line-height:0;*text-indent:0;overflow:hidden}.mce-checked i.mce-i-checkbox{color:#333;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox,.mce-checkbox.mce-focus i.mce-i-checkbox{border:1px solid rgba(82,168,236,0.8)}.mce-checkbox.mce-disabled .mce-label,.mce-checkbox.mce-disabled i.mce-i-checkbox{color:#acacac}.mce-checkbox .mce-label{vertical-align:middle}.mce-rtl .mce-checkbox{direction:rtl;text-align:right}.mce-rtl i.mce-i-checkbox{margin:0 0 0 3px}.mce-combobox{display:inline-block;*display:inline;*zoom:1;*height:32px}.mce-combobox input{border:1px solid #c5c5c5;border-right-color:#c5c5c5;height:28px}.mce-combobox.mce-disabled input{color:#adadad}.mce-combobox .mce-btn{border:1px solid #c5c5c5;border-left:0}.mce-combobox button{padding-right:8px;padding-left:8px}.mce-combobox.mce-disabled .mce-btn button{cursor:default;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-colorbox i{border:1px solid #c5c5c5;width:14px;height:14px}.mce-colorbutton .mce-ico{position:relative}.mce-colorbutton-grid{margin:4px}.mce-colorbutton button{padding-right:6px;padding-left:6px}.mce-colorbutton .mce-preview{padding-right:3px;display:block;position:absolute;left:50%;top:50%;margin-left:-17px;margin-top:7px;background:gray;width:13px;height:2px;overflow:hidden}.mce-colorbutton.mce-btn-small .mce-preview{margin-left:-16px;padding-right:0;width:16px}.mce-colorbutton .mce-open{padding-left:4px;padding-right:4px;border-left:1px solid transparent}.mce-colorbutton:hover .mce-open{border-color:#ccc}.mce-colorbutton.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-colorbutton{direction:rtl}.mce-rtl .mce-colorbutton .mce-preview{margin-left:0;padding-right:0;padding-left:3px}.mce-rtl .mce-colorbutton.mce-btn-small .mce-preview{margin-left:0;padding-right:0;padding-left:2px}.mce-rtl .mce-colorbutton .mce-open{padding-left:4px;padding-right:4px;border-left:0}.mce-colorpicker{position:relative;width:250px;height:220px}.mce-colorpicker-sv{position:absolute;top:0;left:0;width:90%;height:100%;border:1px solid #c5c5c5;cursor:crosshair;overflow:hidden}.mce-colorpicker-h-chunk{width:100%}.mce-colorpicker-overlay1,.mce-colorpicker-overlay2{width:100%;height:100%;position:absolute;top:0;left:0}.mce-colorpicker-overlay1{filter:progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr='#ffffff', endColorstr='#00ffffff');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff')";background:linear-gradient(to right, #fff, rgba(255,255,255,0))}.mce-colorpicker-overlay2{filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#00000000', endColorstr='#000000');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000')";background:linear-gradient(to bottom, rgba(0,0,0,0), #000)}.mce-colorpicker-selector1{background:none;position:absolute;width:12px;height:12px;margin:-8px 0 0 -8px;border:1px solid black;border-radius:50%}.mce-colorpicker-selector2{position:absolute;width:10px;height:10px;border:1px solid white;border-radius:50%}.mce-colorpicker-h{position:absolute;top:0;right:0;width:6.5%;height:100%;border:1px solid #c5c5c5;cursor:crosshair}.mce-colorpicker-h-marker{margin-top:-4px;position:absolute;top:0;left:-1px;width:100%;border:1px solid #333;background:#fff;height:4px;z-index:100}.mce-path{display:inline-block;*display:inline;*zoom:1;padding:8px;white-space:normal}.mce-path .mce-txt{display:inline-block;padding-right:3px}.mce-path .mce-path-body{display:inline-block}.mce-path-item{display:inline-block;*display:inline;*zoom:1;cursor:pointer;color:#333}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:#666;color:#fff}.mce-path .mce-divider{display:inline}.mce-disabled .mce-path-item{color:#aaa}.mce-rtl .mce-path{direction:rtl}.mce-fieldset{border:0 solid #9e9e9e}.mce-fieldset>.mce-container-body{margin-top:-15px}.mce-fieldset-title{margin-left:5px;padding:0 5px 0 5px}.mce-fit-layout{display:inline-block;*display:inline;*zoom:1}.mce-fit-layout-item{position:absolute}.mce-flow-layout-item{display:inline-block;*display:inline;*zoom:1}.mce-flow-layout-item{margin:2px 0 2px 2px}.mce-flow-layout-item.mce-last{margin-right:2px}.mce-flow-layout{white-space:normal}.mce-tinymce-inline .mce-flow-layout{white-space:nowrap}.mce-rtl .mce-flow-layout{text-align:right;direction:rtl}.mce-rtl .mce-flow-layout-item{margin:2px 2px 2px 0}.mce-rtl .mce-flow-layout-item.mce-last{margin-left:2px}.mce-iframe{border:0 solid rgba(0,0,0,0.2);width:100%;height:100%}.mce-infobox{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);overflow:hidden;border:1px solid red}.mce-infobox div{display:block;margin:5px}.mce-infobox div button{position:absolute;top:50%;right:4px;cursor:pointer;margin-top:-8px;display:none}.mce-infobox div button:focus{outline:2px solid #ccc}.mce-infobox.mce-has-help div{margin-right:25px}.mce-infobox.mce-has-help button{display:block}.mce-infobox.mce-success{background:#dff0d8;border-color:#d6e9c6}.mce-infobox.mce-success div{color:#3c763d}.mce-infobox.mce-warning{background:#fcf8e3;border-color:#faebcc}.mce-infobox.mce-warning div{color:#8a6d3b}.mce-infobox.mce-error{background:#f2dede;border-color:#ebccd1}.mce-infobox.mce-error div{color:#a94442}.mce-rtl .mce-infobox div{text-align:right;direction:rtl}.mce-label{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label.mce-disabled{color:#aaa}.mce-label.mce-multiline{white-space:pre-wrap}.mce-label.mce-success{color:#468847}.mce-label.mce-warning{color:#c09853}.mce-label.mce-error{color:#b94a48}.mce-rtl .mce-label{text-align:right;direction:rtl}.mce-menubar .mce-menubtn{border-color:transparent;background:transparent;filter:none}.mce-menubar .mce-menubtn button{color:#333}.mce-menubar{border:1px solid rgba(217,217,217,0.52)}.mce-menubar .mce-menubtn button span{color:#333}.mce-menubar .mce-caret{border-top-color:#333}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus{border-color:#ccc;background:#fff;filter:none}.mce-menubtn button{color:#333}.mce-menubtn.mce-btn-small span{font-size:12px}.mce-menubtn.mce-fixed-width span{display:inline-block;overflow-x:hidden;text-overflow:ellipsis;width:90px}.mce-menubtn.mce-fixed-width.mce-btn-small span{width:70px}.mce-menubtn .mce-caret{*margin-top:6px}.mce-rtl .mce-menubtn button{direction:rtl;text-align:right}.mce-menu-item{display:block;padding:6px 15px 6px 12px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal;border-left:4px solid transparent;margin-bottom:1px}.mce-menu-item .mce-ico,.mce-menu-item .mce-text{color:#333}.mce-menu-item.mce-disabled .mce-text,.mce-menu-item.mce-disabled .mce-ico{color:#adadad}.mce-menu-item:hover .mce-text,.mce-menu-item.mce-selected .mce-text,.mce-menu-item:focus .mce-text{color:white}.mce-menu-item:hover .mce-ico,.mce-menu-item.mce-selected .mce-ico,.mce-menu-item:focus .mce-ico{color:white}.mce-menu-item.mce-disabled:hover{background:#ccc}.mce-menu-shortcut{display:inline-block;color:#adadad}.mce-menu-shortcut{display:inline-block;*display:inline;*zoom:1;padding:0 15px 0 20px}.mce-menu-item:hover .mce-menu-shortcut,.mce-menu-item.mce-selected .mce-menu-shortcut,.mce-menu-item:focus .mce-menu-shortcut{color:white}.mce-menu-item .mce-caret{margin-top:4px;*margin-top:3px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #333}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .mce-caret,.mce-menu-item:hover .mce-caret{border-left-color:white}.mce-menu-align .mce-menu-shortcut{*margin-top:-2px}.mce-menu-align .mce-menu-shortcut,.mce-menu-align .mce-caret{position:absolute;right:0}.mce-menu-item.mce-active i{visibility:visible}.mce-menu-item-normal.mce-active{background-color:#3498db}.mce-menu-item-preview.mce-active{border-left:5px solid #aaa}.mce-menu-item-normal.mce-active .mce-text{color:white}.mce-menu-item-normal.mce-active:hover .mce-text,.mce-menu-item-normal.mce-active:hover .mce-ico{color:white}.mce-menu-item-normal.mce-active:focus .mce-text,.mce-menu-item-normal.mce-active:focus .mce-ico{color:white}.mce-menu-item:hover,.mce-menu-item.mce-selected,.mce-menu-item:focus{text-decoration:none;color:white;background-color:#2d8ac7}div.mce-menu .mce-menu-item-sep,.mce-menu-item-sep:hover{border:0;padding:0;height:1px;margin:9px 1px;overflow:hidden;background:transparent;border-bottom:1px solid rgba(0,0,0,0.1);cursor:default;filter:none}.mce-menu.mce-rtl{direction:rtl}.mce-rtl .mce-menu-item{text-align:right;direction:rtl;padding:6px 12px 6px 15px}.mce-menu-align.mce-rtl .mce-menu-shortcut,.mce-menu-align.mce-rtl .mce-caret{right:auto;left:0}.mce-rtl .mce-menu-item .mce-caret{margin-left:6px;margin-right:0;border-right:4px solid #333;border-left:0}.mce-rtl .mce-menu-item.mce-selected .mce-caret,.mce-rtl .mce-menu-item:focus .mce-caret,.mce-rtl .mce-menu-item:hover .mce-caret{border-left-color:transparent;border-right-color:white}.mce-throbber{position:absolute;top:0;left:0;width:100%;height:100%;opacity:.6;filter:alpha(opacity=60);zoom:1;background:#fff url('img/loader.gif') no-repeat center center}.mce-throbber-inline{position:static;height:50px}.mce-menu .mce-throbber-inline{height:25px;background-size:contain}.mce-menu{position:absolute;left:0;top:0;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;z-index:1000;padding:5px 0 5px 0;margin:-1px 0 0;min-width:160px;background:#fff;border:1px solid #989898;border:1px solid rgba(0,0,0,0.2);z-index:1002;max-height:400px;overflow:auto;overflow-x:hidden}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;*display:inline}.mce-menu-sub-tr-tl{margin:-6px 0 0 -1px}.mce-menu-sub-br-bl{margin:6px 0 0 -1px}.mce-menu-sub-tl-tr{margin:-6px 0 0 1px}.mce-menu-sub-bl-br{margin:6px 0 0 1px}.mce-listbox button{text-align:left;padding-right:20px;position:relative}.mce-listbox .mce-caret{position:absolute;margin-top:-2px;right:8px;top:50%}.mce-rtl .mce-listbox .mce-caret{right:auto;left:8px}.mce-rtl .mce-listbox button{padding-right:10px;padding-left:20px}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-container-body .mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#333}.mce-selectbox{background:#fff;border:1px solid #c5c5c5}.mce-slider{border:1px solid #aaa;background:#eee;width:100px;height:10px;position:relative;display:block}.mce-slider.mce-vertical{width:10px;height:100px}.mce-slider-handle{border:1px solid #bbb;background:#ddd;display:block;width:13px;height:13px;position:absolute;top:0;left:0;margin-left:-1px;margin-top:-2px}.mce-spacer{visibility:hidden}.mce-splitbtn .mce-open{border-left:1px solid transparent}.mce-splitbtn:hover .mce-open{border-left-color:#ccc}.mce-splitbtn button{padding-right:6px;padding-left:6px}.mce-splitbtn .mce-open{padding-right:4px;padding-left:4px}.mce-splitbtn .mce-open.mce-active{background-color:#dbdbdb;outline:1px solid #ccc}.mce-splitbtn.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-splitbtn{direction:rtl;text-align:right}.mce-rtl .mce-splitbtn button{padding-right:4px;padding-left:4px}.mce-rtl .mce-splitbtn .mce-open{border-left:0}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #c5c5c5}.mce-tabs,.mce-tabs+.mce-container-body{background:#fff}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #c5c5c5;border-width:0 1px 0 0;background:#fff;padding:8px;text-shadow:0 1px 1px rgba(255,255,255,0.75);height:13px;cursor:pointer}.mce-tab:hover{background:#fdfdfd}.mce-tab.mce-active{background:#fdfdfd;border-bottom-color:transparent;margin-bottom:-1px;height:14px}.mce-rtl .mce-tabs{text-align:right;direction:rtl}.mce-rtl .mce-tab{border-width:0 0 0 1px}.mce-textbox{background:#fff;border:1px solid #c5c5c5;display:inline-block;-webkit-transition:border linear .2s, box-shadow linear .2s;transition:border linear .2s, box-shadow linear .2s;height:28px;resize:none;padding:0 4px 0 4px;white-space:pre-wrap;*white-space:pre;color:#333}.mce-textbox:focus,.mce-textbox.mce-focus{border-color:#3498db}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px;height:auto}.mce-textbox.mce-disabled{color:#adadad}.mce-rtl .mce-textbox{text-align:right;direction:rtl}@font-face{font-family:'tinymce';src:url('fonts/tinymce.eot');src:url('fonts/tinymce.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce.woff') format('woff'),url('fonts/tinymce.ttf') format('truetype'),url('fonts/tinymce.svg#tinymce') format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'tinymce-small';src:url('fonts/tinymce-small.eot');src:url('fonts/tinymce-small.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce-small.woff') format('woff'),url('fonts/tinymce-small.ttf') format('truetype'),url('fonts/tinymce-small.svg#tinymce') format('svg');font-weight:normal;font-style:normal}.mce-ico{font-family:'tinymce';font-style:normal;font-weight:normal;font-size:16px;line-height:16px;vertical-align:text-top;-webkit-font-smoothing:antialiased;display:inline-block;background:transparent center center;width:16px;height:16px;color:#333;-ie7-icon:' '}.mce-btn-small .mce-ico{font-family:'tinymce-small'}.mce-ico,i.mce-i-checkbox{zoom:expression(this.runtimeStyle['zoom'] = '1', this.innerHTML = this.currentStyle['-ie7-icon'].substr(1, 1) + ' ')}.mce-i-save{-ie7-icon:"\e000"}.mce-i-newdocument{-ie7-icon:"\e001"}.mce-i-fullpage{-ie7-icon:"\e002"}.mce-i-alignleft{-ie7-icon:"\e003"}.mce-i-aligncenter{-ie7-icon:"\e004"}.mce-i-alignright{-ie7-icon:"\e005"}.mce-i-alignjustify{-ie7-icon:"\e006"}.mce-i-alignnone{-ie7-icon:"\e003"}.mce-i-cut{-ie7-icon:"\e007"}.mce-i-paste{-ie7-icon:"\e008"}.mce-i-searchreplace{-ie7-icon:"\e009"}.mce-i-bullist{-ie7-icon:"\e00a"}.mce-i-numlist{-ie7-icon:"\e00b"}.mce-i-indent{-ie7-icon:"\e00c"}.mce-i-outdent{-ie7-icon:"\e00d"}.mce-i-blockquote{-ie7-icon:"\e00e"}.mce-i-undo{-ie7-icon:"\e00f"}.mce-i-redo{-ie7-icon:"\e010"}.mce-i-link{-ie7-icon:"\e011"}.mce-i-unlink{-ie7-icon:"\e012"}.mce-i-anchor{-ie7-icon:"\e013"}.mce-i-image{-ie7-icon:"\e014"}.mce-i-media{-ie7-icon:"\e015"}.mce-i-help{-ie7-icon:"\e016"}.mce-i-code{-ie7-icon:"\e017"}.mce-i-insertdatetime{-ie7-icon:"\e018"}.mce-i-preview{-ie7-icon:"\e019"}.mce-i-forecolor{-ie7-icon:"\e01a"}.mce-i-backcolor{-ie7-icon:"\e01a"}.mce-i-table{-ie7-icon:"\e01b"}.mce-i-hr{-ie7-icon:"\e01c"}.mce-i-removeformat{-ie7-icon:"\e01d"}.mce-i-subscript{-ie7-icon:"\e01e"}.mce-i-superscript{-ie7-icon:"\e01f"}.mce-i-charmap{-ie7-icon:"\e020"}.mce-i-emoticons{-ie7-icon:"\e021"}.mce-i-print{-ie7-icon:"\e022"}.mce-i-fullscreen{-ie7-icon:"\e023"}.mce-i-spellchecker{-ie7-icon:"\e024"}.mce-i-nonbreaking{-ie7-icon:"\e025"}.mce-i-template{-ie7-icon:"\e026"}.mce-i-pagebreak{-ie7-icon:"\e027"}.mce-i-restoredraft{-ie7-icon:"\e028"}.mce-i-untitled{-ie7-icon:"\e029"}.mce-i-bold{-ie7-icon:"\e02a"}.mce-i-italic{-ie7-icon:"\e02b"}.mce-i-underline{-ie7-icon:"\e02c"}.mce-i-strikethrough{-ie7-icon:"\e02d"}.mce-i-visualchars{-ie7-icon:"\e02e"}.mce-i-ltr{-ie7-icon:"\e02f"}.mce-i-rtl{-ie7-icon:"\e030"}.mce-i-copy{-ie7-icon:"\e031"}.mce-i-resize{-ie7-icon:"\e032"}.mce-i-browse{-ie7-icon:"\e034"}.mce-i-pastetext{-ie7-icon:"\e035"}.mce-i-rotateleft{-ie7-icon:"\eaa8"}.mce-i-rotateright{-ie7-icon:"\eaa9"}.mce-i-crop{-ie7-icon:"\ee78"}.mce-i-editimage{-ie7-icon:"\e914"}.mce-i-options{-ie7-icon:"\ec6a"}.mce-i-flipv{-ie7-icon:"\eaaa"}.mce-i-fliph{-ie7-icon:"\eaac"}.mce-i-zoomin{-ie7-icon:"\eb35"}.mce-i-zoomout{-ie7-icon:"\eb36"}.mce-i-sun{-ie7-icon:"\eccc"}.mce-i-moon{-ie7-icon:"\eccd"}.mce-i-arrowleft{-ie7-icon:"\edc0"}.mce-i-arrowright{-ie7-icon:"\edb8"}.mce-i-drop{-ie7-icon:"\e934"}.mce-i-contrast{-ie7-icon:"\ecd4"}.mce-i-sharpen{-ie7-icon:"\eba7"}.mce-i-palette{-ie7-icon:"\e92a"}.mce-i-resize2{-ie7-icon:"\edf9"}.mce-i-orientation{-ie7-icon:"\e601"}.mce-i-invert{-ie7-icon:"\e602"}.mce-i-gamma{-ie7-icon:"\e600"}.mce-i-remove{-ie7-icon:"\ed6a"}.mce-i-codesample{-ie7-icon:"\e603"}.mce-i-checkbox,.mce-i-selected{-ie7-icon:"\e033"}.mce-i-selected{visibility:hidden}.mce-i-backcolor{background:#bbb} \ No newline at end of file diff --git a/assets/plugins/tinymce4/tinymce/skins/darkness/skin.min.css b/assets/plugins/tinymce4/tinymce/skins/darkness/skin.min.css new file mode 100644 index 0000000000..e246cef7d1 --- /dev/null +++ b/assets/plugins/tinymce4/tinymce/skins/darkness/skin.min.css @@ -0,0 +1 @@ +.mce-container,.mce-container *,.mce-widget,.mce-widget *,.mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:#595959;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;-webkit-tap-highlight-color:transparent;line-height:normal;font-weight:normal;text-align:left;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-widget button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.mce-container *[unselectable]{-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}.word-wrap{word-wrap:break-word;-ms-word-break:break-all;word-break:break-all;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.mce-fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.mce-fade.mce-in{opacity:1}.mce-tinymce{visibility:inherit !important;position:relative}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block;-webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);box-shadow:0 1px 2px rgba(0, 0, 0, 0.2)}.mce-statusbar>.mce-container-body{display:flex;padding-right:16px}.mce-statusbar>.mce-container-body .mce-path{flex:1}.mce-wordcount{font-size:inherit;text-transform:uppercase;padding:8px 0}div.mce-edit-area{background:#FFF;filter:none}.mce-statusbar{position:relative}.mce-statusbar .mce-container-body{position:relative;font-size:11px}.mce-fullscreen .mce-resizehandle{display:none}.mce-statusbar .mce-flow-layout-item{margin:0}.mce-charmap{border-collapse:collapse}.mce-charmap td{cursor:default;border:1px solid #c5c5c5;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:middle;padding:2px}.mce-charmap td div{text-align:center}.mce-charmap td:hover{background:white}.mce-grid td.mce-grid-cell div{border:1px solid #c5c5c5;width:15px;height:15px;margin:0;cursor:pointer}.mce-grid td.mce-grid-cell div:focus{border-color:#91bbe9}.mce-grid td.mce-grid-cell div[disabled]{cursor:not-allowed}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover,.mce-grid a:focus{border-color:#91bbe9}.mce-grid-border{margin:0 4px 0 4px}.mce-grid-border a{border-color:#c5c5c5;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#91bbe9;background:#bdd6f2}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%}.mce-colorbtn-trans div{text-align:center;vertical-align:middle;font-weight:bold;font-size:20px;line-height:16px;color:#8b8b8b}.mce-monospace{font-family:"Courier New",Courier,monospace}.mce-toolbar-grp .mce-flow-layout-item{margin-bottom:0}.mce-container b{font-weight:bold}.mce-container p{margin-bottom:5px}.mce-container a{cursor:pointer;color:#2276d2}.mce-container a:hover{text-decoration:underline}.mce-container ul{margin-left:15px}.mce-container .mce-table-striped{border-collapse:collapse;margin:10px}.mce-container .mce-table-striped thead>tr{background-color:#fafafa}.mce-container .mce-table-striped thead>tr th{font-weight:bold}.mce-container .mce-table-striped td,.mce-container .mce-table-striped th{padding:5px}.mce-container .mce-table-striped tr:nth-child(even){background-color:#fafafa}.mce-container .mce-table-striped tbody>tr:hover{background-color:#e1e1e1}.mce-branding{font-size:inherit;text-transform:uppercase;white-space:pre;padding:8px 0}.mce-branding a{font-size:inherit;color:inherit}.mce-top-part{position:relative}.mce-top-part::before{content:'';position:absolute;-webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);top:0;right:0;bottom:0;left:0;pointer-events:none}.mce-rtl .mce-wordcount{left:0;right:auto}.mce-rtl .mce-statusbar>.mce-container-body>*:last-child{padding-right:0;padding-left:10px}.mce-rtl .mce-path{text-align:right;padding-right:16px}.mce-croprect-container{position:absolute;top:0;left:0}.mce-croprect-handle{position:absolute;top:0;left:0;width:20px;height:20px;border:2px solid white}.mce-croprect-handle-nw{border-width:2px 0 0 2px;margin:-2px 0 0 -2px;cursor:nw-resize;top:100px;left:100px}.mce-croprect-handle-ne{border-width:2px 2px 0 0;margin:-2px 0 0 -20px;cursor:ne-resize;top:100px;left:200px}.mce-croprect-handle-sw{border-width:0 0 2px 2px;margin:-20px 2px 0 -2px;cursor:sw-resize;top:200px;left:100px}.mce-croprect-handle-se{border-width:0 2px 2px 0;margin:-20px 0 0 -20px;cursor:se-resize;top:200px;left:200px}.mce-croprect-handle-move{position:absolute;cursor:move;border:0}.mce-croprect-block{opacity:.5;filter:alpha(opacity=50);zoom:1;position:absolute;background:black}.mce-croprect-handle:focus{border-color:#2276d2}.mce-croprect-handle-move:focus{outline:1px solid #2276d2}.mce-imagepanel{overflow:auto;background:black}.mce-imagepanel-bg{position:absolute;background:url('data:image/gif;base64,R0lGODdhDAAMAIABAMzMzP///ywAAAAADAAMAAACFoQfqYeabNyDMkBQb81Uat85nxguUAEAOw==')}.mce-imagepanel img{position:absolute}.mce-imagetool.mce-btn .mce-ico{display:block;width:20px;height:20px;text-align:center;line-height:20px;font-size:20px;padding:5px}.mce-arrow-up{margin-top:12px}.mce-arrow-down{margin-top:-12px}.mce-arrow:before,.mce-arrow:after{position:absolute;left:50%;display:block;width:0;height:0;border-style:solid;border-color:transparent;content:""}.mce-arrow.mce-arrow-up:before{top:-9px;border-bottom-color:#c5c5c5;border-width:0 9px 9px;margin-left:-9px}.mce-arrow.mce-arrow-down:before{bottom:-9px;border-top-color:#c5c5c5;border-width:9px 9px 0;margin-left:-9px}.mce-arrow.mce-arrow-up:after{top:-8px;border-bottom-color:#fff;border-width:0 8px 8px;margin-left:-8px}.mce-arrow.mce-arrow-down:after{bottom:-8px;border-top-color:#fff;border-width:8px 8px 0;margin-left:-8px}.mce-arrow.mce-arrow-left:before,.mce-arrow.mce-arrow-left:after{margin:0}.mce-arrow.mce-arrow-left:before{left:8px}.mce-arrow.mce-arrow-left:after{left:9px}.mce-arrow.mce-arrow-right:before,.mce-arrow.mce-arrow-right:after{left:auto;margin:0}.mce-arrow.mce-arrow-right:before{right:8px}.mce-arrow.mce-arrow-right:after{right:9px}.mce-arrow.mce-arrow-center.mce-arrow.mce-arrow-left:before{left:-9px;top:50%;border-right-color:#c5c5c5;border-width:9px 9px 9px 0;margin-top:-9px}.mce-arrow.mce-arrow-center.mce-arrow.mce-arrow-left:after{left:-8px;top:50%;border-right-color:#fff;border-width:8px 8px 8px 0;margin-top:-8px}.mce-arrow.mce-arrow-center.mce-arrow.mce-arrow-left{margin-left:12px}.mce-arrow.mce-arrow-center.mce-arrow.mce-arrow-right:before{right:-9px;top:50%;border-left-color:#c5c5c5;border-width:9px 0 9px 9px;margin-top:-9px}.mce-arrow.mce-arrow-center.mce-arrow.mce-arrow-right:after{right:-8px;top:50%;border-left-color:#fff;border-width:8px 0 8px 8px;margin-top:-8px}.mce-arrow.mce-arrow-center.mce-arrow.mce-arrow-right{margin-left:-14px}.mce-edit-aria-container>.mce-container-body{display:flex}.mce-edit-aria-container>.mce-container-body .mce-edit-area{flex:1}.mce-edit-aria-container>.mce-container-body .mce-sidebar>.mce-container-body{display:flex;align-items:stretch;height:100%}.mce-edit-aria-container>.mce-container-body .mce-sidebar-panel{min-width:250px;max-width:250px;position:relative}.mce-edit-aria-container>.mce-container-body .mce-sidebar-panel>.mce-container-body{position:absolute;width:100%;height:100%;overflow:auto;top:0;left:0}.mce-sidebar-toolbar{border:0 solid #c5c5c5;border-left-width:1px}.mce-sidebar-toolbar .mce-btn{border-left:0;border-right:0}.mce-sidebar-toolbar .mce-btn.mce-active,.mce-sidebar-toolbar .mce-btn.mce-active:hover{background-color:#555c66}.mce-sidebar-toolbar .mce-btn.mce-active button,.mce-sidebar-toolbar .mce-btn.mce-active:hover button,.mce-sidebar-toolbar .mce-btn.mce-active button i,.mce-sidebar-toolbar .mce-btn.mce-active:hover button i{color:white;text-shadow:1px 1px none}.mce-sidebar-panel{border:0 solid #c5c5c5;border-left-width:1px}.mce-container,.mce-container-body{display:block}.mce-autoscroll{overflow:hidden}.mce-scrollbar{position:absolute;width:7px;height:100%;top:2px;right:2px;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-scrollbar-h{top:auto;right:auto;left:2px;bottom:2px;width:100%;height:7px}.mce-scrollbar-thumb{position:absolute;background-color:#000;border:1px solid #888;border-color:rgba(85,85,85,0.6);width:5px;height:100%}.mce-scrollbar-h .mce-scrollbar-thumb{width:100%;height:5px}.mce-scrollbar:hover,.mce-scrollbar.mce-active{background-color:#AAA;opacity:.6;filter:alpha(opacity=60);zoom:1}.mce-scroll{position:relative}.mce-panel{border:0 solid #f3f3f3;border:0 solid #c5c5c5;background-color:#fff}.mce-floatpanel{position:absolute;-webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);box-shadow:0 1px 2px rgba(0, 0, 0, 0.2)}.mce-floatpanel.mce-fixed{position:fixed}.mce-floatpanel .mce-arrow,.mce-floatpanel .mce-arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.mce-floatpanel .mce-arrow{border-width:11px}.mce-floatpanel .mce-arrow:after{border-width:10px;content:""}.mce-floatpanel.mce-popover{filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;-webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);top:0;left:0;background:#FFF;border:1px solid #c5c5c5;border:1px solid rgba(0,0,0,0.25)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:10px;*margin-top:0}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#c5c5c5;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow:after{top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#FFF}.mce-floatpanel.mce-popover.mce-bottom.mce-start{margin-left:-22px}.mce-floatpanel.mce-popover.mce-bottom.mce-start>.mce-arrow{left:20px}.mce-floatpanel.mce-popover.mce-bottom.mce-end{margin-left:22px}.mce-floatpanel.mce-popover.mce-bottom.mce-end>.mce-arrow{right:10px;left:auto}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;height:100%}div.mce-fullscreen{position:fixed;top:0;left:0}#mce-modal-block{opacity:0;filter:alpha(opacity=0);zoom:1;position:fixed;left:0;top:0;width:100%;height:100%;background:#FFF}#mce-modal-block.mce-in{opacity:.5;filter:alpha(opacity=50);zoom:1}.mce-window-move{cursor:move}.mce-window{-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;background:#FFF;position:fixed;top:0;left:0;opacity:0;transform:scale(.1);transition:transform 100ms ease-in,opacity 150ms ease-in}.mce-window.mce-in{transform:scale(1);opacity:1}.mce-window-head{padding:9px 15px;border-bottom:1px solid #c5c5c5;position:relative}.mce-window-head .mce-close{position:absolute;right:0;top:0;height:38px;width:38px;text-align:center;cursor:pointer}.mce-window-head .mce-close i{color:#9b9b9b}.mce-close:hover i{color:#bdbdbd}.mce-window-head .mce-title{line-height:20px;font-size:20px;font-weight:bold;text-rendering:optimizelegibility;padding-right:20px}.mce-window .mce-container-body{display:block}.mce-foot{display:block;background-color:#FFF;border-top:1px solid #c5c5c5}.mce-window-head .mce-dragh{position:absolute;top:0;left:0;cursor:move;width:90%;height:100%}.mce-window iframe{width:100%;height:100%}.mce-window-body .mce-listbox{border-color:#e2e4e7}.mce-window .mce-btn:hover{border-color:#c5c5c5}.mce-window .mce-btn:focus{border-color:#2276d2}.mce-window-body .mce-btn,.mce-foot .mce-btn{border-color:#c5c5c5}.mce-foot .mce-btn.mce-primary{border-color:transparent}.mce-rtl .mce-window-head .mce-close{position:absolute;right:auto;left:15px}.mce-rtl .mce-window-head .mce-dragh{left:auto;right:0}.mce-rtl .mce-window-head .mce-title{direction:rtl;text-align:right}.mce-tooltip{position:absolute;padding:5px;opacity:.8;filter:alpha(opacity=80);zoom:1;margin-top:1px}.mce-tooltip-inner{font-size:11px;background-color:#000;color:white;max-width:200px;padding:5px 8px 4px 8px;text-align:center;white-space:normal}.mce-tooltip-inner{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-tooltip-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.mce-tooltip-arrow-n{border-bottom-color:#000}.mce-tooltip-arrow-s{border-top-color:#000}.mce-tooltip-arrow-e{border-left-color:#000}.mce-tooltip-arrow-w{border-right-color:#000}.mce-tooltip-nw,.mce-tooltip-sw{margin-left:-14px}.mce-tooltip-ne,.mce-tooltip-se{margin-left:14px}.mce-tooltip-n .mce-tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-s .mce-tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-e .mce-tooltip-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:none;border-top-color:transparent;border-bottom-color:transparent}.mce-tooltip-w .mce-tooltip-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:none;border-top-color:transparent;border-bottom-color:transparent}.mce-progress{display:inline-block;position:relative;height:20px}.mce-progress .mce-bar-container{display:inline-block;width:100px;height:100%;margin-right:8px;border:1px solid #ccc;overflow:hidden}.mce-progress .mce-text{display:inline-block;margin-top:auto;margin-bottom:auto;font-size:14px;width:40px;color:#595959}.mce-bar{display:block;width:0;height:100%;background-color:#dfdfdf;-webkit-transition:width .2s ease;transition:width .2s ease}.mce-notification{position:absolute;background-color:#fff;padding:5px;margin-top:5px;border-width:1px;border-style:solid;border-color:#c5c5c5;transition:transform 100ms ease-in,opacity 150ms ease-in;opacity:0;box-sizing:border-box}.mce-notification.mce-in{opacity:1}.mce-notification-success{background-color:#dff0d8;border-color:#d6e9c6}.mce-notification-info{background-color:#d9edf7;border-color:#779ECB}.mce-notification-warning{background-color:#fcf8e3;border-color:#faebcc}.mce-notification-error{background-color:#f2dede;border-color:#ebccd1}.mce-notification.mce-has-close{padding-right:15px}.mce-notification .mce-ico{margin-top:5px}.mce-notification-inner{word-wrap:break-word;-ms-word-break:break-all;word-break:break-all;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;display:inline-block;font-size:14px;margin:5px 8px 4px 8px;text-align:center;white-space:normal;color:#31708f}.mce-notification-inner a{text-decoration:underline;cursor:pointer}.mce-notification .mce-progress{margin-right:8px}.mce-notification .mce-progress .mce-text{margin-top:5px}.mce-notification *,.mce-notification .mce-progress .mce-text{color:#595959}.mce-notification .mce-progress .mce-bar-container{border-color:#c5c5c5}.mce-notification .mce-progress .mce-bar-container .mce-bar{background-color:#595959}.mce-notification-success *,.mce-notification-success .mce-progress .mce-text{color:#3c763d}.mce-notification-success .mce-progress .mce-bar-container{border-color:#d6e9c6}.mce-notification-success .mce-progress .mce-bar-container .mce-bar{background-color:#3c763d}.mce-notification-info *,.mce-notification-info .mce-progress .mce-text{color:#31708f}.mce-notification-info .mce-progress .mce-bar-container{border-color:#779ECB}.mce-notification-info .mce-progress .mce-bar-container .mce-bar{background-color:#31708f}.mce-notification-warning *,.mce-notification-warning .mce-progress .mce-text{color:#8a6d3b}.mce-notification-warning .mce-progress .mce-bar-container{border-color:#faebcc}.mce-notification-warning .mce-progress .mce-bar-container .mce-bar{background-color:#8a6d3b}.mce-notification-error *,.mce-notification-error .mce-progress .mce-text{color:#a94442}.mce-notification-error .mce-progress .mce-bar-container{border-color:#ebccd1}.mce-notification-error .mce-progress .mce-bar-container .mce-bar{background-color:#a94442}.mce-notification .mce-close{position:absolute;top:6px;right:8px;font-size:20px;font-weight:bold;line-height:20px;color:#9b9b9b;cursor:pointer}.mce-abs-layout{position:relative}body .mce-abs-layout-item,.mce-abs-end{position:absolute}.mce-abs-end{width:1px;height:1px}.mce-container-body.mce-abs-layout{overflow:hidden}.mce-btn{border:1px solid #b3b3b3;border-color:transparent transparent transparent transparent;position:relative;text-shadow:0 1px 1px rgba(255,255,255,0.75);background:white;display:inline-block;*display:inline;*zoom:1;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-btn:hover,.mce-btn:active{background:white;color:#595959;border-color:#e2e4e7}.mce-btn:focus{background:white;color:#595959;border-color:#e2e4e7}.mce-btn.mce-disabled button,.mce-btn.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover,.mce-btn.mce-active:focus,.mce-btn.mce-active:active{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;background:#555c66;color:white;border-color:transparent}.mce-btn.mce-active button,.mce-btn.mce-active:hover button,.mce-btn.mce-active i,.mce-btn.mce-active:hover i{color:white}.mce-btn:hover .mce-caret{border-top-color:#b5bcc2}.mce-btn.mce-active .mce-caret,.mce-btn.mce-active:hover .mce-caret{border-top-color:white}.mce-btn button{padding:4px 6px;font-size:14px;line-height:20px;*line-height:16px;cursor:pointer;color:#595959;text-align:center;overflow:visible;-webkit-appearance:none}.mce-btn button::-moz-focus-inner{border:0;padding:0}.mce-btn i{text-shadow:1px 1px none}.mce-primary.mce-btn-has-text{min-width:50px}.mce-primary{color:white;border:1px solid transparent;border-color:transparent;background-color:#2276d2}.mce-primary:hover,.mce-primary:focus{background-color:#1e6abc;border-color:transparent}.mce-primary.mce-disabled button,.mce-primary.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-primary.mce-active,.mce-primary.mce-active:hover,.mce-primary:not(.mce-disabled):active{background-color:#1e6abc;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-primary button,.mce-primary button i{color:white;text-shadow:1px 1px none}.mce-btn .mce-txt{font-size:inherit;line-height:inherit;color:inherit}.mce-btn-large button{padding:9px 14px;font-size:16px;line-height:normal}.mce-btn-large i{margin-top:2px}.mce-btn-small button{padding:1px 5px;font-size:12px;*padding-bottom:2px}.mce-btn-small i{line-height:20px;vertical-align:top;*line-height:18px}.mce-btn .mce-caret{margin-top:8px;margin-left:0}.mce-btn-small .mce-caret{margin-top:8px;margin-left:0}.mce-caret{display:inline-block;*display:inline;*zoom:1;width:0;height:0;vertical-align:top;border-top:4px solid #b5bcc2;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#aaa}.mce-caret.mce-up{border-bottom:4px solid #b5bcc2;border-top:0}.mce-btn-flat{border:0;background:transparent;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:none}.mce-btn-flat:hover,.mce-btn-flat.mce-active,.mce-btn-flat:focus,.mce-btn-flat:active{border:0;background:#e6e6e6;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-btn-has-text .mce-ico{padding-right:5px}.mce-rtl .mce-btn button{direction:rtl}.mce-toolbar .mce-btn-group{margin:0;padding:2px 0}.mce-btn-group .mce-btn{border-width:1px;margin:0;margin-left:2px}.mce-btn-group:not(:first-child){border-left:1px solid #d9d9d9;padding-left:0;margin-left:2px}.mce-btn-group{margin-left:2px}.mce-btn-group .mce-btn.mce-flow-layout-item{margin:0}.mce-rtl .mce-btn-group .mce-btn{margin-left:0;margin-right:2px}.mce-rtl .mce-btn-group .mce-first{margin-right:0}.mce-rtl .mce-btn-group:not(:first-child){border-left:none;border-right:1px solid #d9d9d9;padding-right:4px;margin-right:4px}.mce-checkbox{cursor:pointer}i.mce-i-checkbox{margin:0 3px 0 0;border:1px solid #c5c5c5;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;background-color:white;text-indent:-10em;overflow:hidden}.mce-checked i.mce-i-checkbox{color:#595959;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox,.mce-checkbox.mce-focus i.mce-i-checkbox{border:1px solid #2276d2;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-checkbox.mce-disabled .mce-label,.mce-checkbox.mce-disabled i.mce-i-checkbox{color:#bdbdbd}.mce-checkbox .mce-label{vertical-align:middle}.mce-rtl .mce-checkbox{direction:rtl;text-align:right}.mce-rtl i.mce-i-checkbox{margin:0 0 0 3px}.mce-combobox{position:relative;display:inline-block;*display:inline;*zoom:1;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;*height:32px}.mce-combobox input{border:1px solid #c5c5c5;border-right-color:#c5c5c5;height:28px}.mce-combobox.mce-disabled input{color:#bdbdbd}.mce-combobox .mce-btn{border:1px solid #c5c5c5;border-left:0;margin:0}.mce-combobox button{padding-right:8px;padding-left:8px}.mce-combobox.mce-disabled .mce-btn button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-combobox .mce-status{position:absolute;right:2px;top:50%;line-height:16px;margin-top:-8px;font-size:12px;width:15px;height:15px;text-align:center;cursor:pointer}.mce-combobox.mce-has-status input{padding-right:20px}.mce-combobox.mce-has-open .mce-status{right:37px}.mce-combobox .mce-status.mce-i-warning{color:#c09853}.mce-combobox .mce-status.mce-i-checkmark{color:#468847}.mce-menu.mce-combobox-menu{border-top:0;margin-top:0;max-height:200px}.mce-menu.mce-combobox-menu .mce-menu-item{padding:4px 6px 4px 4px;font-size:11px}.mce-menu.mce-combobox-menu .mce-menu-item-sep{padding:0}.mce-menu.mce-combobox-menu .mce-text{font-size:11px}.mce-menu.mce-combobox-menu .mce-menu-item-link,.mce-menu.mce-combobox-menu .mce-menu-item-link b{font-size:11px}.mce-menu.mce-combobox-menu .mce-text b{font-size:11px}.mce-colorbox i{border:1px solid #c5c5c5;width:14px;height:14px}.mce-colorbutton .mce-ico{position:relative}.mce-colorbutton-grid{margin:4px}.mce-colorbutton .mce-preview{padding-right:3px;display:block;position:absolute;left:50%;top:50%;margin-left:-17px;margin-top:7px;background:gray;width:13px;height:2px;overflow:hidden}.mce-colorbutton.mce-btn-small .mce-preview{margin-left:-16px;padding-right:0;width:16px}.mce-rtl .mce-colorbutton{direction:rtl}.mce-rtl .mce-colorbutton .mce-preview{margin-left:0;padding-right:0;padding-left:3px}.mce-rtl .mce-colorbutton.mce-btn-small .mce-preview{margin-left:0;padding-right:0;padding-left:2px}.mce-rtl .mce-colorbutton .mce-open{padding-left:4px;padding-right:4px;border-left:0}.mce-colorpicker{position:relative;width:250px;height:220px}.mce-colorpicker-sv{position:absolute;top:0;left:0;width:90%;height:100%;border:1px solid #c5c5c5;cursor:crosshair;overflow:hidden}.mce-colorpicker-h-chunk{width:100%}.mce-colorpicker-overlay1,.mce-colorpicker-overlay2{width:100%;height:100%;position:absolute;top:0;left:0}.mce-colorpicker-overlay1{filter:progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr='#ffffff', endColorstr='#00ffffff');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff')";background:linear-gradient(to right, #fff, rgba(255,255,255,0))}.mce-colorpicker-overlay2{filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#00000000', endColorstr='#000000');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000')";background:linear-gradient(to bottom, rgba(0,0,0,0), #000)}.mce-colorpicker-selector1{background:none;position:absolute;width:12px;height:12px;margin:-8px 0 0 -8px;border:1px solid black;border-radius:50%}.mce-colorpicker-selector2{position:absolute;width:10px;height:10px;border:1px solid white;border-radius:50%}.mce-colorpicker-h{position:absolute;top:0;right:0;width:6.5%;height:100%;border:1px solid #c5c5c5;cursor:crosshair}.mce-colorpicker-h-marker{margin-top:-4px;position:absolute;top:0;left:-1px;width:100%;border:1px solid black;background:white;height:4px;z-index:100}.mce-path{display:inline-block;*display:inline;*zoom:1;padding:8px;white-space:normal;font-size:inherit}.mce-path .mce-txt{display:inline-block;padding-right:3px}.mce-path .mce-path-body{display:inline-block}.mce-path-item{display:inline-block;*display:inline;*zoom:1;cursor:pointer;color:#595959;font-size:inherit;text-transform:uppercase}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:#555c66;color:white}.mce-path .mce-divider{display:inline;font-size:inherit}.mce-disabled .mce-path-item{color:#aaa}.mce-rtl .mce-path{direction:rtl}.mce-fieldset{border:0 solid #9E9E9E}.mce-fieldset>.mce-container-body{margin-top:-15px}.mce-fieldset-title{margin-left:5px;padding:0 5px 0 5px}.mce-fit-layout{display:inline-block;*display:inline;*zoom:1}.mce-fit-layout-item{position:absolute}.mce-flow-layout-item{display:inline-block;*display:inline;*zoom:1}.mce-flow-layout-item{margin:2px 0 2px 2px}.mce-flow-layout-item.mce-last{margin-right:2px}.mce-flow-layout{white-space:normal}.mce-tinymce-inline .mce-flow-layout{white-space:nowrap}.mce-rtl .mce-flow-layout{text-align:right;direction:rtl}.mce-rtl .mce-flow-layout-item{margin:2px 2px 2px 0}.mce-rtl .mce-flow-layout-item.mce-last{margin-left:2px}.mce-iframe{border:0 solid #c5c5c5;width:100%;height:100%}.mce-infobox{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);overflow:hidden;border:1px solid red}.mce-infobox div{display:block;margin:5px}.mce-infobox div button{position:absolute;top:50%;right:4px;cursor:pointer;margin-top:-8px;display:none}.mce-infobox div button:focus{outline:2px solid #e2e4e7}.mce-infobox.mce-has-help div{margin-right:25px}.mce-infobox.mce-has-help button{display:block}.mce-infobox.mce-success{background:#dff0d8;border-color:#d6e9c6}.mce-infobox.mce-success div{color:#3c763d}.mce-infobox.mce-warning{background:#fcf8e3;border-color:#faebcc}.mce-infobox.mce-warning div{color:#8a6d3b}.mce-infobox.mce-error{background:#f2dede;border-color:#ebccd1}.mce-infobox.mce-error div{color:#a94442}.mce-rtl .mce-infobox div{text-align:right;direction:rtl}.mce-label{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label.mce-disabled{color:#aaa}.mce-label.mce-multiline{white-space:pre-wrap}.mce-label.mce-success{color:#468847}.mce-label.mce-warning{color:#c09853}.mce-label.mce-error{color:#b94a48}.mce-rtl .mce-label{text-align:right;direction:rtl}.mce-menubar{border:1px solid #e2e4e7}.mce-menubar .mce-menubtn{border-color:transparent;background:transparent;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:none}.mce-menubar .mce-menubtn button span{color:#595959}.mce-menubar .mce-caret{border-top-color:#b5bcc2}.mce-menubar .mce-active .mce-caret,.mce-menubar .mce-menubtn:hover .mce-caret{border-top-color:#b5bcc2}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus{border-color:#e2e4e7;background:white;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-menubar .mce-menubtn.mce-active{border-bottom:none;z-index:65537}div.mce-menubtn.mce-opened{border-bottom-color:white;z-index:65537}.mce-menubtn button{color:#595959}.mce-menubtn.mce-btn-small span{font-size:12px}.mce-menubtn.mce-fixed-width span{display:inline-block;overflow-x:hidden;text-overflow:ellipsis;width:90px}.mce-menubtn.mce-fixed-width.mce-btn-small span{width:70px}.mce-menubtn .mce-caret{*margin-top:6px}.mce-rtl .mce-menubtn button{direction:rtl;text-align:right}.mce-menu-item{display:block;padding:6px 4px 6px 4px;clear:both;font-weight:normal;line-height:20px;color:#595959;white-space:nowrap;cursor:pointer;line-height:normal;border-left:4px solid transparent;margin-bottom:1px}.mce-menu-item .mce-caret{margin-top:4px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #595959}.mce-menu-item .mce-menu-shortcut{display:inline-block;padding:0 10px 0 20px;color:#aaa}.mce-menu-item .mce-ico{padding-right:4px}.mce-menu-item:hover,.mce-menu-item:focus{background:#ededee}.mce-menu-item:hover .mce-menu-shortcut,.mce-menu-item:focus .mce-menu-shortcut{color:#aaa}.mce-menu-item:hover .mce-text,.mce-menu-item:focus .mce-text,.mce-menu-item:hover .mce-ico,.mce-menu-item:focus .mce-ico{color:#595959}.mce-menu-item.mce-selected{background:#ededee}.mce-menu-item.mce-selected .mce-text,.mce-menu-item.mce-selected .mce-ico{color:#595959}.mce-menu-item.mce-active.mce-menu-item-normal{background:#555c66}.mce-menu-item.mce-active.mce-menu-item-normal .mce-text,.mce-menu-item.mce-active.mce-menu-item-normal .mce-ico{color:white}.mce-menu-item.mce-active.mce-menu-item-checkbox .mce-ico{visibility:visible}.mce-menu-item.mce-disabled,.mce-menu-item.mce-disabled:hover{background:white}.mce-menu-item.mce-disabled:focus,.mce-menu-item.mce-disabled:hover:focus{background:#ededee}.mce-menu-item.mce-disabled .mce-text,.mce-menu-item.mce-disabled:hover .mce-text,.mce-menu-item.mce-disabled .mce-ico,.mce-menu-item.mce-disabled:hover .mce-ico{color:#aaa}.mce-menu-item.mce-menu-item-preview.mce-active{border-left:5px solid #555c66;background:white}.mce-menu-item.mce-menu-item-preview.mce-active .mce-text,.mce-menu-item.mce-menu-item-preview.mce-active .mce-ico{color:#595959}.mce-menu-item.mce-menu-item-preview.mce-active:hover{background:#ededee}.mce-menu-item-link{color:#093;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mce-menu-item-link b{color:#093}.mce-menu-item-ellipsis{display:block;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.mce-menu-item:hover *,.mce-menu-item.mce-selected *,.mce-menu-item:focus *{color:#595959}div.mce-menu .mce-menu-item-sep,.mce-menu-item-sep:hover{border:0;padding:0;height:1px;margin:9px 1px;overflow:hidden;background:transparent;border-bottom:1px solid rgba(0,0,0,0.1);cursor:default;filter:none}div.mce-menu .mce-menu-item b{font-weight:bold}.mce-menu-item-indent-1{padding-left:20px}.mce-menu-item-indent-2{padding-left:35px}.mce-menu-item-indent-2{padding-left:35px}.mce-menu-item-indent-3{padding-left:40px}.mce-menu-item-indent-4{padding-left:45px}.mce-menu-item-indent-5{padding-left:50px}.mce-menu-item-indent-6{padding-left:55px}.mce-menu.mce-rtl{direction:rtl}.mce-rtl .mce-menu-item{text-align:right;direction:rtl;padding:6px 12px 6px 15px}.mce-rtl .mce-menu-item .mce-caret{margin-left:6px;margin-right:0;border-right:4px solid #595959;border-left:0}.mce-rtl .mce-menu-item.mce-selected .mce-caret,.mce-rtl .mce-menu-item:focus .mce-caret,.mce-rtl .mce-menu-item:hover .mce-caret{border-left-color:transparent;border-right-color:#595959}.mce-rtl .mce-menu-item .mce-ico{padding-right:0;padding-left:4px}.mce-throbber{position:absolute;top:0;left:0;width:100%;height:100%;opacity:.6;filter:alpha(opacity=60);zoom:1;background:#fff url('img/loader.gif') no-repeat center center}.mce-throbber-inline{position:static;height:50px}.mce-menu .mce-throbber-inline{height:25px;background-size:contain}.mce-menu{position:absolute;left:0;top:0;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;z-index:1000;padding:5px 0 5px 0;margin:-1px 0 0;min-width:180px;background:white;border:1px solid #c5c9cf;border:1px solid #e2e4e7;z-index:1002;-webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);max-height:500px;overflow:auto;overflow-x:hidden}.mce-menu.mce-animate{opacity:.01;transform:rotateY(10deg) rotateX(-10deg);transform-origin:left top}.mce-menu.mce-menu-align .mce-menu-shortcut,.mce-menu.mce-menu-align .mce-caret{position:absolute;right:0}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block}.mce-menu.mce-in.mce-animate{opacity:1;transform:rotateY(0) rotateX(0);transition:opacity .075s ease,transform .1s ease}.mce-menu-sub-tr-tl{margin:-6px 0 0 -1px}.mce-menu-sub-br-bl{margin:6px 0 0 -1px}.mce-menu-sub-tl-tr{margin:-6px 0 0 1px}.mce-menu-sub-bl-br{margin:6px 0 0 1px}.mce-rtl .mce-menu-item .mce-ico{padding-right:0;padding-left:4px}.mce-rtl.mce-menu-align .mce-caret,.mce-rtl .mce-menu-shortcut{right:auto;left:0}.mce-listbox button{text-align:left;padding-right:20px;position:relative}.mce-listbox .mce-caret{position:absolute;margin-top:-2px;right:8px;top:50%}.mce-rtl .mce-listbox .mce-caret{right:auto;left:8px}.mce-rtl .mce-listbox button{padding-right:10px;padding-left:20px}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-container-body .mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#595959}.mce-selectbox{background:#fff;border:1px solid #c5c5c5}.mce-slider{border:1px solid #c5c5c5;background:#fff;width:100px;height:10px;position:relative;display:block}.mce-slider.mce-vertical{width:10px;height:100px}.mce-slider-handle{border:1px solid #c5c5c5;background:#e6e6e6;display:block;width:13px;height:13px;position:absolute;top:0;left:0;margin-left:-1px;margin-top:-2px}.mce-slider-handle:focus{border-color:#2276d2}.mce-spacer{visibility:hidden}.mce-splitbtn:hover .mce-open{border-left:1px solid #e2e4e7}.mce-splitbtn .mce-open{border-left:1px solid transparent;padding-right:4px;padding-left:4px}.mce-splitbtn .mce-open:focus{border-left:1px solid #e2e4e7}.mce-splitbtn .mce-open:hover,.mce-splitbtn .mce-open:active{border-left:1px solid #e2e4e7}.mce-splitbtn.mce-active:hover .mce-open{border-left:1px solid white}.mce-splitbtn.mce-opened{border-color:#e2e4e7}.mce-splitbtn.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-splitbtn{direction:rtl;text-align:right}.mce-rtl .mce-splitbtn button{padding-right:4px;padding-left:4px}.mce-rtl .mce-splitbtn .mce-open{border-left:0}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #c5c5c5}.mce-tabs,.mce-tabs+.mce-container-body{background:#fff}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #c5c5c5;border-width:0 1px 0 0;background:#fff;padding:8px 15px;text-shadow:0 1px 1px rgba(255,255,255,0.75);height:13px;cursor:pointer}.mce-tab:hover{background:#FDFDFD}.mce-tab.mce-active{background:#FDFDFD;border-bottom-color:transparent;margin-bottom:-1px;height:14px}.mce-tab:focus{color:#2276d2}.mce-rtl .mce-tabs{text-align:right;direction:rtl}.mce-rtl .mce-tab{border-width:0 0 0 1px}.mce-textbox{background:#fff;border:1px solid #c5c5c5;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;display:inline-block;-webkit-transition:border linear .2s, box-shadow linear .2s;transition:border linear .2s, box-shadow linear .2s;height:28px;resize:none;padding:0 4px 0 4px;white-space:pre-wrap;*white-space:pre;color:#595959}.mce-textbox:focus,.mce-textbox.mce-focus{border-color:#2276d2;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px;height:auto}.mce-textbox.mce-disabled{color:#bdbdbd}.mce-rtl .mce-textbox{text-align:right;direction:rtl}.mce-dropzone{border:3px dashed gray;text-align:center}.mce-dropzone span{text-transform:uppercase;display:inline-block;vertical-align:middle}.mce-dropzone:after{content:"";height:100%;display:inline-block;vertical-align:middle}.mce-dropzone.mce-disabled{opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-dropzone.mce-disabled.mce-dragenter{cursor:not-allowed}.mce-browsebutton{position:relative;overflow:hidden}.mce-browsebutton button{position:relative;z-index:1}.mce-browsebutton input{opacity:0;filter:alpha(opacity=0);zoom:1;position:absolute;top:0;left:0;width:100%;height:100%;z-index:0}@font-face{font-family:'tinymce';src:url('fonts/tinymce.eot');src:url('fonts/tinymce.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce.woff') format('woff'),url('fonts/tinymce.ttf') format('truetype'),url('fonts/tinymce.svg#tinymce') format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'tinymce-small';src:url('fonts/tinymce-small.eot');src:url('fonts/tinymce-small.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce-small.woff') format('woff'),url('fonts/tinymce-small.ttf') format('truetype'),url('fonts/tinymce-small.svg#tinymce') format('svg');font-weight:normal;font-style:normal}.mce-ico{font-family:'tinymce',Arial;font-style:normal;font-weight:normal;font-variant:normal;font-size:16px;line-height:16px;speak:none;vertical-align:text-top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;background:transparent center center;background-size:cover;width:16px;height:16px;color:#595959}.mce-btn-small .mce-ico{font-family:'tinymce-small',Arial}.mce-i-save:before{content:"\e000"}.mce-i-newdocument:before{content:"\e001"}.mce-i-fullpage:before{content:"\e002"}.mce-i-alignleft:before{content:"\e003"}.mce-i-aligncenter:before{content:"\e004"}.mce-i-alignright:before{content:"\e005"}.mce-i-alignjustify:before{content:"\e006"}.mce-i-alignnone:before{content:"\e003"}.mce-i-cut:before{content:"\e007"}.mce-i-paste:before{content:"\e008"}.mce-i-searchreplace:before{content:"\e009"}.mce-i-bullist:before{content:"\e00a"}.mce-i-numlist:before{content:"\e00b"}.mce-i-indent:before{content:"\e00c"}.mce-i-outdent:before{content:"\e00d"}.mce-i-blockquote:before{content:"\e00e"}.mce-i-undo:before{content:"\e00f"}.mce-i-redo:before{content:"\e010"}.mce-i-link:before{content:"\e011"}.mce-i-unlink:before{content:"\e012"}.mce-i-anchor:before{content:"\e013"}.mce-i-image:before{content:"\e014"}.mce-i-media:before{content:"\e015"}.mce-i-help:before{content:"\e016"}.mce-i-code:before{content:"\e017"}.mce-i-insertdatetime:before{content:"\e018"}.mce-i-preview:before{content:"\e019"}.mce-i-forecolor:before{content:"\e01a"}.mce-i-backcolor:before{content:"\e01a"}.mce-i-table:before{content:"\e01b"}.mce-i-hr:before{content:"\e01c"}.mce-i-removeformat:before{content:"\e01d"}.mce-i-subscript:before{content:"\e01e"}.mce-i-superscript:before{content:"\e01f"}.mce-i-charmap:before{content:"\e020"}.mce-i-emoticons:before{content:"\e021"}.mce-i-print:before{content:"\e022"}.mce-i-fullscreen:before{content:"\e023"}.mce-i-spellchecker:before{content:"\e024"}.mce-i-nonbreaking:before{content:"\e025"}.mce-i-template:before{content:"\e026"}.mce-i-pagebreak:before{content:"\e027"}.mce-i-restoredraft:before{content:"\e028"}.mce-i-bold:before{content:"\e02a"}.mce-i-italic:before{content:"\e02b"}.mce-i-underline:before{content:"\e02c"}.mce-i-strikethrough:before{content:"\e02d"}.mce-i-visualchars:before{content:"\e02e"}.mce-i-visualblocks:before{content:"\e02e"}.mce-i-ltr:before{content:"\e02f"}.mce-i-rtl:before{content:"\e030"}.mce-i-copy:before{content:"\e031"}.mce-i-resize:before{content:"\e032"}.mce-i-browse:before{content:"\e034"}.mce-i-pastetext:before{content:"\e035"}.mce-i-rotateleft:before{content:"\eaa8"}.mce-i-rotateright:before{content:"\eaa9"}.mce-i-crop:before{content:"\ee78"}.mce-i-editimage:before{content:"\e915"}.mce-i-options:before{content:"\ec6a"}.mce-i-flipv:before{content:"\eaaa"}.mce-i-fliph:before{content:"\eaac"}.mce-i-zoomin:before{content:"\eb35"}.mce-i-zoomout:before{content:"\eb36"}.mce-i-sun:before{content:"\eccc"}.mce-i-moon:before{content:"\eccd"}.mce-i-arrowleft:before{content:"\edc0"}.mce-i-arrowright:before{content:"\e93c"}.mce-i-drop:before{content:"\e935"}.mce-i-contrast:before{content:"\ecd4"}.mce-i-sharpen:before{content:"\eba7"}.mce-i-resize2:before{content:"\edf9"}.mce-i-orientation:before{content:"\e601"}.mce-i-invert:before{content:"\e602"}.mce-i-gamma:before{content:"\e600"}.mce-i-remove:before{content:"\ed6a"}.mce-i-tablerowprops:before{content:"\e604"}.mce-i-tablecellprops:before{content:"\e605"}.mce-i-table2:before{content:"\e606"}.mce-i-tablemergecells:before{content:"\e607"}.mce-i-tableinsertcolbefore:before{content:"\e608"}.mce-i-tableinsertcolafter:before{content:"\e609"}.mce-i-tableinsertrowbefore:before{content:"\e60a"}.mce-i-tableinsertrowafter:before{content:"\e60b"}.mce-i-tablesplitcells:before{content:"\e60d"}.mce-i-tabledelete:before{content:"\e60e"}.mce-i-tableleftheader:before{content:"\e62a"}.mce-i-tabletopheader:before{content:"\e62b"}.mce-i-tabledeleterow:before{content:"\e800"}.mce-i-tabledeletecol:before{content:"\e801"}.mce-i-codesample:before{content:"\e603"}.mce-i-fill:before{content:"\e902"}.mce-i-borderwidth:before{content:"\e903"}.mce-i-line:before{content:"\e904"}.mce-i-count:before{content:"\e905"}.mce-i-translate:before{content:"\e907"}.mce-i-drag:before{content:"\e908"}.mce-i-home:before{content:"\e90b"}.mce-i-upload:before{content:"\e914"}.mce-i-bubble:before{content:"\e91c"}.mce-i-user:before{content:"\e91d"}.mce-i-lock:before{content:"\e926"}.mce-i-unlock:before{content:"\e927"}.mce-i-settings:before{content:"\e928"}.mce-i-remove2:before{content:"\e92a"}.mce-i-menu:before{content:"\e92d"}.mce-i-warning:before{content:"\e930"}.mce-i-question:before{content:"\e931"}.mce-i-pluscircle:before{content:"\e932"}.mce-i-info:before{content:"\e933"}.mce-i-notice:before{content:"\e934"}.mce-i-arrowup:before{content:"\e93b"}.mce-i-arrowdown:before{content:"\e93d"}.mce-i-arrowup2:before{content:"\e93f"}.mce-i-arrowdown2:before{content:"\e940"}.mce-i-menu2:before{content:"\e941"}.mce-i-newtab:before{content:"\e961"}.mce-i-a11y:before{content:"\e900"}.mce-i-plus:before{content:"\e93a"}.mce-i-insert:before{content:"\e93a"}.mce-i-minus:before{content:"\e939"}.mce-i-books:before{content:"\e911"}.mce-i-reload:before{content:"\e906"}.mce-i-toc:before{content:"\e901"}.mce-i-checkmark:before{content:"\e033"}.mce-i-checkbox:before,.mce-i-selected:before{content:"\e033"}.mce-i-insert{font-size:14px}.mce-i-selected{visibility:hidden}i.mce-i-backcolor{text-shadow:none;background:#BBB}/*# sourceMappingURL=skin.min.css.map */ \ No newline at end of file diff --git a/assets/plugins/tinymce4/tinymce/skins/lightgray/content.min.css b/assets/plugins/tinymce4/tinymce/skins/lightgray/content.min.css index fe9bcdefd0..0fd2b9c18e 100755 --- a/assets/plugins/tinymce4/tinymce/skins/lightgray/content.min.css +++ b/assets/plugins/tinymce4/tinymce/skins/lightgray/content.min.css @@ -1 +1 @@ -body{background-color:#FFFFFF;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:14px;line-height:1.3;scrollbar-3dlight-color:#F0F0EE;scrollbar-arrow-color:#676662;scrollbar-base-color:#F0F0EE;scrollbar-darkshadow-color:#DDDDDD;scrollbar-face-color:#E0E0DD;scrollbar-highlight-color:#F0F0EE;scrollbar-shadow-color:#F0F0EE;scrollbar-track-color:#F5F5F5}td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:14px}.word-wrap{word-wrap:break-word;-ms-word-break:break-all;word-break:break-all;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.mce-content-body .mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:black;font-family:Arial;font-size:11px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;line-height:normal;font-weight:normal;text-align:left;-webkit-tap-highlight-color:transparent;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-object{border:1px dotted #3A3A3A;background:#D5D5D5 url(img/object.gif) no-repeat center}.mce-preview-object{display:inline-block;position:relative;margin:0 2px 0 2px;line-height:0;border:1px solid gray}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-preview-object .mce-shim{position:absolute;top:0;left:0;width:100%;height:100%;background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}figure.align-left{float:left}figure.align-right{float:right}figure.image.align-center{display:table;margin-left:auto;margin-right:auto}figure.image{display:inline-block;border:1px solid gray;margin:0 2px 0 1px;background:#f5f2f0}figure.image img{margin:8px 8px 0 8px}figure.image figcaption{margin:6px 8px 6px 8px;text-align:center}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc li{list-style-type:none}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#D5D5D5 url(img/anchor.gif) no-repeat center}.mce-nbsp,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid rgba(208,2,27,0.5);cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td[data-mce-selected],th[data-mce-selected]{background-color:#2276d2 !important}.mce-edit-focus{outline:1px dotted #333}.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus{outline:2px solid #2276d2}.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover{outline:2px solid #2276d2}.mce-content-body *[contentEditable=false][data-mce-selected]{outline:2px solid #2276d2}.mce-content-body *[data-mce-selected="inline-boundary"]{background:#bfe6ff}.mce-content-body .mce-item-anchor[data-mce-selected]{background:#D5D5D5 url(img/anchor.gif) no-repeat center}.mce-content-body hr{cursor:default}.ephox-snooker-resizer-bar{background-color:#2276d2;opacity:0}.ephox-snooker-resizer-cols{cursor:col-resize}.ephox-snooker-resizer-rows{cursor:row-resize}.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging{opacity:.2} \ No newline at end of file +body{background-color:#FFFFFF;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:14px;line-height:1.3;scrollbar-3dlight-color:#F0F0EE;scrollbar-arrow-color:#676662;scrollbar-base-color:#F0F0EE;scrollbar-darkshadow-color:#DDDDDD;scrollbar-face-color:#E0E0DD;scrollbar-highlight-color:#F0F0EE;scrollbar-shadow-color:#F0F0EE;scrollbar-track-color:#F5F5F5}td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:14px}.word-wrap{word-wrap:break-word;-ms-word-break:break-all;word-break:break-all;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.mce-content-body .mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:black;font-family:Arial;font-size:11px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;line-height:normal;font-weight:normal;text-align:left;-webkit-tap-highlight-color:transparent;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-object{border:1px dotted #3A3A3A;background:#D5D5D5 url(img/object.gif) no-repeat center}.mce-preview-object{display:inline-block;position:relative;margin:0 2px 0 2px;line-height:0;border:1px solid gray}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-preview-object .mce-shim{position:absolute;top:0;left:0;width:100%;height:100%;background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}figure.align-left{float:left}figure.align-right{float:right}figure.image.align-center{display:table;margin-left:auto;margin-right:auto}figure.image{display:inline-block;border:1px solid gray;margin:0 2px 0 1px;background:#f5f2f0}figure.image img{margin:8px 8px 0 8px}figure.image figcaption{margin:6px 8px 6px 8px;text-align:center}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc li{list-style-type:none}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#D5D5D5 url(img/anchor.gif) no-repeat center}.mce-nbsp,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid rgba(208,2,27,0.5);cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td[data-mce-selected],th[data-mce-selected]{background-color:#2276d2 !important}.mce-edit-focus{outline:1px dotted #333}.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus{outline:2px solid #2276d2}.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover{outline:2px solid #2276d2}.mce-content-body *[contentEditable=false][data-mce-selected]{outline:2px solid #2276d2}.mce-content-body *[data-mce-selected="inline-boundary"]{background:#bfe6ff}.mce-content-body .mce-item-anchor[data-mce-selected]{background:#D5D5D5 url(img/anchor.gif) no-repeat center}.mce-content-body hr{cursor:default}.ephox-snooker-resizer-bar{background-color:#2276d2;opacity:0}.ephox-snooker-resizer-cols{cursor:col-resize}.ephox-snooker-resizer-rows{cursor:row-resize}.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging{opacity:.2} From c6dbdf92784fb35a60c55ee7c3487b39d4f9153f Mon Sep 17 00:00:00 2001 From: Serg <64j@mail.ru> Date: Tue, 3 Apr 2018 01:57:16 +0300 Subject: [PATCH 113/274] fix style mainmenu --- manager/media/style/default/css/mainmenu.css | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/manager/media/style/default/css/mainmenu.css b/manager/media/style/default/css/mainmenu.css index 9aae587a8d..006728e2dc 100755 --- a/manager/media/style/default/css/mainmenu.css +++ b/manager/media/style/default/css/mainmenu.css @@ -21,7 +21,7 @@ #mainMenu .nav > li .fa { min-width: 1em; line-height: 2.2rem; font-size: .875rem; vertical-align: top } #mainMenu #nav > li > a > .fa { display: none } #mainMenu #nav #bars { width: 3.5rem; text-align: center } -#mainMenu #nav #bars a { padding: 0 1rem; } +#mainMenu #nav #bars a { padding: 0; } #mainMenu #nav #bars .fa { display: inline-block; min-width: 0.25rem; width: 1.5rem; margin: 0; text-align: center; overflow: hidden; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } .sidebar-closed #mainMenu #nav #bars .fa { width: 0.25rem; } #mainMenu #system > a > .fa { font-size: 1.1rem } @@ -87,8 +87,8 @@ #searchresult .ajaxSearchResults .deleted a { color: #a52a2a; text-decoration: line-through } @media (min-width: 1200px) { #searchresult { top: 2.5rem; } -#mainMenu #nav #site a { padding-left: 11.25rem; } -#mainMenu #nav #site a::before { content: ""; display: block; overflow: hidden; position: absolute; left: 0; top: 0; width: 10rem; height: 100%; background: url("../images/misc/logo-navbar.png") 1rem 50% no-repeat; background-size: 8rem; } +#mainMenu #nav #site a { padding-left: 10.25rem; } +#mainMenu #nav #site a::before { content: ""; display: block; overflow: hidden; position: absolute; left: 0; top: 0; width: 9rem; height: 100%; background: url("../images/misc/logo-navbar.png") 0 50% no-repeat; background-size: 8rem; } #mainMenu, #mainMenu .nav > li > a, #mainMenu .nav .label_searchid, #mainMenu .nav > li > a .icon, #mainMenu #searchform .mask, #mainMenu #nav #site::before { height: 2.5rem; } #mainMenu .nav > li > a, #mainMenu .nav .label_searchid, #mainMenu .nav > li .fa, #mainMenu .nav > li > a .icon { line-height: 2.6rem; } #mainMenu .nav > li > a .icon.photo { width: 2.1rem; height: 2.1rem; margin-top: .2rem; } @@ -103,6 +103,7 @@ #mainMenu .nav > li > ul > li.dropdown-toggle > a > .toggle { line-height: 2.4rem; font-size: 1rem; } } @media (max-width: 1020px) { +#mainMenu #nav #bars { width: 3rem } .nav > li > a, #mainMenu .nav > li > ul > li > a, #mainMenu .nav > li > ul > li > span, #mainMenu .nav .label_searchid { padding: 0 0.75rem; } } @media (max-width: 840px) { From 1ea13f060b7e5c3b3c3739dc9e665d2a5e46c7ca Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Tue, 3 Apr 2018 01:57:36 +0300 Subject: [PATCH 114/274] fix darkness theme in tinyMCE color links --- assets/plugins/tinymce4/tinymce/skins/darkness/content.min.css | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/plugins/tinymce4/tinymce/skins/darkness/content.min.css b/assets/plugins/tinymce4/tinymce/skins/darkness/content.min.css index eccfc94a92..25085d7c0a 100644 --- a/assets/plugins/tinymce4/tinymce/skins/darkness/content.min.css +++ b/assets/plugins/tinymce4/tinymce/skins/darkness/content.min.css @@ -1 +1,2 @@ body{border-color: #414449;background-color:#202329;color:#bbb;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:14px;line-height:1.3;scrollbar-3dlight-color:#F0F0EE;scrollbar-arrow-color:#676662;scrollbar-base-color:#F0F0EE;scrollbar-darkshadow-color:#DDDDDD;scrollbar-face-color:#E0E0DD;scrollbar-highlight-color:#F0F0EE;scrollbar-shadow-color:#F0F0EE;scrollbar-track-color:#F5F5F5}td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:14px}.word-wrap{word-wrap:break-word;-ms-word-break:break-all;word-break:break-all;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.mce-content-body .mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:black;font-family:Arial;font-size:11px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;line-height:normal;font-weight:normal;text-align:left;-webkit-tap-highlight-color:transparent;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-object{border:1px dotted #3A3A3A;background:#D5D5D5 url(img/object.gif) no-repeat center}.mce-preview-object{display:inline-block;position:relative;margin:0 2px 0 2px;line-height:0;border:1px solid gray}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-preview-object .mce-shim{position:absolute;top:0;left:0;width:100%;height:100%;background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}figure.align-left{float:left}figure.align-right{float:right}figure.image.align-center{display:table;margin-left:auto;margin-right:auto}figure.image{display:inline-block;border:1px solid gray;margin:0 2px 0 1px;background:#f5f2f0}figure.image img{margin:8px 8px 0 8px}figure.image figcaption{margin:6px 8px 6px 8px;text-align:center}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc li{list-style-type:none}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#D5D5D5 url(img/anchor.gif) no-repeat center}.mce-nbsp,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid rgba(208,2,27,0.5);cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td[data-mce-selected],th[data-mce-selected]{background-color:#2276d2 !important}.mce-edit-focus{outline:1px dotted #333}.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus{outline:2px solid #2276d2}.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover{outline:2px solid #2276d2}.mce-content-body *[contentEditable=false][data-mce-selected]{outline:2px solid #2276d2}.mce-content-body *[data-mce-selected="inline-boundary"]{background:#bfe6ff}.mce-content-body .mce-item-anchor[data-mce-selected]{background:#D5D5D5 url(img/anchor.gif) no-repeat center}.mce-content-body hr{cursor:default}.ephox-snooker-resizer-bar{background-color:#2276d2;opacity:0}.ephox-snooker-resizer-cols{cursor:col-resize}.ephox-snooker-resizer-rows{cursor:row-resize}.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging{opacity:.2} +a{color: #3481bc;} \ No newline at end of file From 6d88b75f9d2075b7ccd7b3f23fa28d797bce9352 Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Tue, 3 Apr 2018 02:15:56 +0300 Subject: [PATCH 115/274] add Darkness to Doc Manager --- assets/modules/docmanager/templates/main.tpl | 1 + assets/modules/docmanager/templates/update.tpl | 1 + 2 files changed, 2 insertions(+) diff --git a/assets/modules/docmanager/templates/main.tpl b/assets/modules/docmanager/templates/main.tpl index 81d9b610cc..332668cd70 100755 --- a/assets/modules/docmanager/templates/main.tpl +++ b/assets/modules/docmanager/templates/main.tpl @@ -75,6 +75,7 @@ [+onManagerMainFrameHeaderHTMLBlock+] +

      [+lang.DM_module_title+] diff --git a/assets/modules/docmanager/templates/update.tpl b/assets/modules/docmanager/templates/update.tpl index 14f0688cdb..0b948c845c 100755 --- a/assets/modules/docmanager/templates/update.tpl +++ b/assets/modules/docmanager/templates/update.tpl @@ -24,6 +24,7 @@ +

      [+lang.DM_module_title+]

      From 9064f5e14698b394035b072de0fbc66e2d74b586 Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Tue, 3 Apr 2018 02:35:06 +0300 Subject: [PATCH 116/274] no message --- assets/modules/store/core.php | 3 +++ assets/modules/store/css/style.css | 13 ++++++++++++- assets/modules/store/template/main.html | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) mode change 100755 => 100644 assets/modules/store/core.php mode change 100755 => 100644 assets/modules/store/css/style.css mode change 100755 => 100644 assets/modules/store/template/main.html diff --git a/assets/modules/store/core.php b/assets/modules/store/core.php old mode 100755 new mode 100644 index 5361b406f5..30f6fb69a0 --- a/assets/modules/store/core.php +++ b/assets/modules/store/core.php @@ -110,6 +110,9 @@ $Store->lang['lang'] = $Store->language; $Store->lang['_type'] = json_encode($PACK); $Store->lang['v'] = $version; + if ($modx->config['manager_theme_mode'] == 4 ){ + $Store->lang['body_class_name'] = 'darkness'; + } $tpl = Store::parse( $Store->tpl(dirname( __FILE__ ).'/template/main.html') ,$modx->config ) ; $tpl = Store::parse( $tpl ,$Store->lang ) ; echo $tpl; diff --git a/assets/modules/store/css/style.css b/assets/modules/store/css/style.css old mode 100755 new mode 100644 index ca81e7931e..600d861dd8 --- a/assets/modules/store/css/style.css +++ b/assets/modules/store/css/style.css @@ -544,4 +544,15 @@ body, #hide-side { min-width: 40px; margin-right:8px; -} \ No newline at end of file +} + +.darkness .box, .darkness .item_content, .darkness .install_extras, .darkness .info, .darkness .catalog_item.liststyle .install_extras{ + border: 1px solid #414449; + background: #202329; +} +.darkness #store_search{ + border: #414449 1px solid!important; +} + + + diff --git a/assets/modules/store/template/main.html b/assets/modules/store/template/main.html old mode 100755 new mode 100644 index b9fea6c2cc..36b3b4e404 --- a/assets/modules/store/template/main.html +++ b/assets/modules/store/template/main.html @@ -17,7 +17,7 @@ [+onManagerMainFrameHeaderHTMLBlock+] - +

      From c2f05b8447ff896d12499648bf75d458d3dee829 Mon Sep 17 00:00:00 2001 From: Serg <64j@mail.ru> Date: Tue, 3 Apr 2018 02:48:47 +0300 Subject: [PATCH 117/274] fix color contextmenu darkness mode --- manager/media/style/default/css/contextmenu.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/media/style/default/css/contextmenu.css b/manager/media/style/default/css/contextmenu.css index 1c1135483a..a82ea08e9b 100755 --- a/manager/media/style/default/css/contextmenu.css +++ b/manager/media/style/default/css/contextmenu.css @@ -11,4 +11,4 @@ .contextMenu .cntxMnuItem { white-space: nowrap } /* modes theme */ /* darkness */ -.darkness #mx_contextmenu, .darkness #contextmenu, .darkness .nu-context-menu, .darkness .contextMenu { background-color: #343942; } \ No newline at end of file +.darkness #mx_contextmenu, .darkness #contextmenu, .darkness .nu-context-menu, .darkness .contextMenu { background-color: #343942; color: inherit; } \ No newline at end of file From 0d7820cdedaf470c70387acd7d8551a07de15b9f Mon Sep 17 00:00:00 2001 From: Serg <64j@mail.ru> Date: Tue, 3 Apr 2018 04:08:07 +0300 Subject: [PATCH 118/274] added switch modes theme --- .../plugins/codemirror/codemirror.plugin.php | 8 +++-- manager/frames/1.php | 19 ++++------- manager/includes/header.inc.php | 18 +++------- manager/media/style/default/js/modx.js | 34 +++++++++++++++++++ manager/media/style/default/js/modx.min.js | 2 +- 5 files changed, 52 insertions(+), 29 deletions(-) diff --git a/assets/plugins/codemirror/codemirror.plugin.php b/assets/plugins/codemirror/codemirror.plugin.php index 363325a043..e2464a3460 100755 --- a/assets/plugins/codemirror/codemirror.plugin.php +++ b/assets/plugins/codemirror/codemirror.plugin.php @@ -38,8 +38,12 @@ $fontSize = (isset($fontSize) ? 'font-size:' . $fontSize . 'px !important;' : ''); $lineHeight = (isset($lineHeight) ? 'line-height:' . $lineHeight . ' !important;' : ''); -if ($modx->config['manager_theme_mode'] == 3 || $modx->config['manager_theme_mode'] == 4) { - $theme = $darktheme; +if (!empty($_COOKIE['MODX_themeMode'])) { + if ($_COOKIE['MODX_themeMode'] == 3 || $_COOKIE['MODX_themeMode'] == 4) { + $theme = $darktheme; + } +} elseif ($modx->config['manager_theme_mode'] == 3 || $modx->config['manager_theme_mode'] == 4) { + $theme = $darktheme; } /* * This plugin is only valid in "text" mode. So check for the current Editor diff --git a/manager/frames/1.php b/manager/frames/1.php index da7a84f62c..b3a1bcb176 100755 --- a/manager/frames/1.php +++ b/manager/frames/1.php @@ -45,19 +45,11 @@ $body_class .= 'sidebar-closed'; } -switch ($modx->config['manager_theme_mode']) { - case '1': - $body_class .= ' lightness'; - break; - case '2': - $body_class .= ' light'; - break; - case '3': - $body_class .= ' dark'; - break; - case '4': - $body_class .= ' darkness'; - break; +$theme_modes = array('', 'lightness', 'light', 'dark', 'darkness'); +if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) { + $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']]; +} elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) { + $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode']]; } @@ -158,6 +150,7 @@ site_start: config['site_start'] ?>, tree_page_click: config['tree_page_click']) ? (int)$modx->config['tree_page_click'] : 27) ?>, theme: 'config['manager_theme'] ?>', + theme_mode: 'config['manager_theme_mode'] ?>', which_browser: '', layout: , textdir: '', diff --git a/manager/includes/header.inc.php b/manager/includes/header.inc.php index 9c397558a6..a3c173149d 100755 --- a/manager/includes/header.inc.php +++ b/manager/includes/header.inc.php @@ -17,19 +17,11 @@ $modx->config['mgr_date_picker_path'] = 'media/script/air-datepicker/datepicker.inc.php'; } -switch ($modx->config['manager_theme_mode']) { - case '1': - $body_class .= ' lightness'; - break; - case '2': - $body_class .= ' light'; - break; - case '3': - $body_class .= ' dark'; - break; - case '4': - $body_class .= ' darkness'; - break; +$theme_modes = array('', 'lightness', 'light', 'dark', 'darkness'); +if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) { + $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']]; +} elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) { + $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode']]; } $css = 'media/style/' . $modx->config['manager_theme'] . '/style.css?v=' . $lastInstallTime; diff --git a/manager/media/style/default/js/modx.js b/manager/media/style/default/js/modx.js index e62b4e5761..6c1d5dbfdc 100755 --- a/manager/media/style/default/js/modx.js +++ b/manager/media/style/default/js/modx.js @@ -5,6 +5,7 @@ minWidth: 840, isMobile: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), typesactions: {'16': 1, '301': 2, '78': 3, '22': 4, '102': 5, '108': 6, '3': 7, '4': 7, '6': 7, '27': 7, '61': 7, '62': 7, '63': 7, '72': 7}, + thememodes: ['', 'lightness', 'light', 'dark', 'darkness'], tabsTimer: 0, popupTimer: 0, init: function() { @@ -889,6 +890,39 @@ } } }, + toggleTheme: function() { + var a, b = 1, myCodeMirrors = w.main.myCodeMirrors, key; + if (typeof localStorage['MODX_themeMode'] === 'undefined') { + localStorage['MODX_themeMode'] = modx.config.theme_mode; + } + if (modx.thememodes[parseInt(localStorage['MODX_themeMode']) + 1]) { + b = parseInt(localStorage['MODX_themeMode']) + 1; + } + a = modx.thememodes[b]; + for (key in modx.thememodes) { + if (modx.thememodes[key]) { + d.body.classList.remove(modx.thememodes[key]); + w.main.document.body.classList.remove(modx.thememodes[key]); + } + } + d.body.classList.add(a); + w.main.document.body.classList.add(a); + d.cookie = 'MODX_themeMode=' + b; + localStorage['MODX_themeMode'] = b; + if (typeof myCodeMirrors !== 'undefined') { + for (key in myCodeMirrors) { + if (myCodeMirrors.hasOwnProperty(key)) { + if (~a.indexOf('dark')) { + w.main.document.getElementsByName(key)[0].nextElementSibling.classList.add('cm-s-' + myCodeMirrors[key].options.darktheme); + w.main.document.getElementsByName(key)[0].nextElementSibling.classList.remove('cm-s-' + myCodeMirrors[key].options.defaulttheme); + } else { + w.main.document.getElementsByName(key)[0].nextElementSibling.classList.remove('cm-s-' + myCodeMirrors[key].options.darktheme); + w.main.document.getElementsByName(key)[0].nextElementSibling.classList.add('cm-s-' + myCodeMirrors[key].options.defaulttheme); + } + } + } + } + }, toggleNode: function(e, id) { e = e || w.event; if (e.ctrlKey) return; diff --git a/manager/media/style/default/js/modx.min.js b/manager/media/style/default/js/modx.min.js index f66aecc735..952bc3ffd5 100755 --- a/manager/media/style/default/js/modx.min.js +++ b/manager/media/style/default/js/modx.min.js @@ -1 +1 @@ -(function($,w,d,u){'use strict';modx.extended({frameset:'frameset',minWidth:840,isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),typesactions:{'16':1,'301':2,'78':3,'22':4,'102':5,'108':6,'3':7,'4':7,'6':7,'27':7,'61':7,'62':7,'63':7,'72':7},tabsTimer:0,popupTimer:0,init:function(){if(!localStorage.getItem('MODX_widthSideBar')){localStorage.setItem('MODX_widthSideBar',this.config.tree_width)}this.mainmenu.init();if(w.location.hash){if(modx.getActionFromUrl(w.location.hash,2)){w.history.replaceState(null,d.title,modx.MODX_MANAGER_URL)}else if(modx.getActionFromUrl(w.location.hash)||modx.main.getQueryVariable('filemanager',w.location.hash)){var url=modx.main.getQueryVariable('filemanager',w.location.hash)?modx.MODX_MANAGER_URL+modx.main.getQueryVariable('filemanager',w.location.hash)+w.location.hash.replace('#?','?'):w.location.href.replace('#?','?');if(modx.config.global_tabs){modx.tabs({url:url,title:'blank'})}else if(w.main){w.main.frameElement.src=url}else{modx.openWindow(url)}}}this.resizer.init();this.search.init();if(this.config.session_timeout>0){w.setInterval(this.keepMeAlive,1000*60*this.config.session_timeout)}if(modx.config.mail_check_timeperiod>0&&modx.permission.messages){setTimeout('modx.updateMail(true)',1000)}d.addEventListener('click',this.hideDropDown,false);if(modx.config.global_tabs){d.addEventListener('click',this.tabs,false);this.tabs({url:'?a=2',reload:0})}},mainmenu:{id:'mainMenu',init:function(){var $mm=$('#mainMenu'),mm=d.getElementById('mainMenu'),timer;$mm.on('click','a',function(e){if($(this).hasClass('dropdown-toggle')){if($mm.hasClass('show')&&($(this).hasClass('selected')||!modx.isMobile&&$(this).parent().hasClass('hover'))){$(this).removeClass('selected');$mm.removeClass('show')}else{$('.nav > li > a:not(:hover)').removeClass('selected');$(this).addClass('selected');$mm.addClass('show')}e.stopPropagation();e.target.dataset.toggle='#mainMenu';modx.hideDropDown(e)}if($(this).closest('ul').hasClass('dropdown-menu')&&!$(this).parent('li').hasClass('dropdown-back')){$('.nav > .active').removeClass('active');$('.nav li.selected').removeClass('selected');$(this).closest('.nav > li').addClass('active');if(this.offsetParent.id){d.getElementById(this.offsetParent.id.substr(7)).classList.add('selected')}if((modx.isMobile||w.innerWidth li',function(){var els=mm.querySelectorAll('.nav > li.hover:not(:hover)');for(var i=0;i li li',function(e){var self=this,ul;var els=mm.querySelectorAll('.nav > li li.hover:not(:hover)');for(var i=0;i'+modx.lang.paging_prev+''+data}ul.id='parent_'+self.id;ul.innerHTML=data;var id=w.location.hash.substr(2).replace(/=/g,'_').replace(/&/g,'__');var el=d.getElementById(id);if(el){el.parentNode.classList.add('selected');d.getElementById(el.parentNode.parentNode.id.substr(7)).classList.add('selected')}for(var i=0;iitems.length-1){index=items.length-1}if(index>=0&&index2){s.timer=setTimeout(function(){s.loader.style.display='block';modx.get(modx.MODX_MANAGER_URL+'?a=71&ajax=1&submitok=Search&searchid='+s.input.value,function(data){s.loader.style.display='none';s.results=data.querySelector('.ajaxSearchResults');if(s.results&&s.results.innerHTML!==''){s.result.innerHTML=s.results.outerHTML;s.open();s.result.onclick=function(e){var t=e.target,p=t.parentNode;if(t.tagName==='I'){modx.openWindow({title:p.innerText,id:p.id,url:p.href});e.preventDefault();e.stopPropagation()}else{var a=t.tagName==='A'&&t||p.tagName==='A'&&p;if(a){var el=s.result.querySelector('.selected');if(el)el.className='';a.className='selected';if(modx.isMobile)s.close()}}}}else{s.empty()}},'document')},300)}else{s.empty()}};if(modx.isMobile){this.input.onblur=this.close}this.input.onfocus=this.open;this.input.onclick=this.open;this.input.onmouseenter=this.open;this.result.onmouseenter=this.open;this.result.onmouseleave=this.close;this.mask.onmouseenter=this.open;this.mask.onmouseleave=this.close},open:function(){if(modx.search.results){modx.search.result.classList.add('open')}},close:function(){modx.search.result.classList.remove('open')},empty:function(){modx.search.result.classList.remove('open');modx.search.result.innerHTML=''}},main:{id:'main',idFrame:'mainframe',as:null,onload:function(e){w.main=e.target.contentWindow||e.target.defaultView;modx.main.tabRow.init();modx.main.stopWork();modx.main.scrollWork();w.main.document.addEventListener('click',modx.hideDropDown,false);w.main.document.addEventListener('contextmenu',modx.main.oncontextmenu,false);if(modx.config.global_tabs){w.main.document.addEventListener('click',modx.tabs,false)}w.history.replaceState(null,d.title,modx.getActionFromUrl(w.main.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.main.location.search);setTimeout('modx.tree.restoreTree()',100)},oncontextmenu:function(e){if(e.ctrlKey)return;var el=e.target;if(modx.user.role===1&&/modxtv|modxplaceholder|modxattributevalue|modxchunk|modxsnippet|modxsnippetnocache/i.test(el.className)){var id=Date.now(),name=el.innerText.replace(/[\[|\]|{|}|\*||\#|\+|?|\!|&|=|`|:]/g,''),type=el.className.replace(/cm-modx/,''),n=!!name.replace(/^\d+$/,'');if(name&&n){e.preventDefault();modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',{a:'modxTagHelper',name:name,type:type},function(r){if(r){r=JSON.parse(r);for(var k in r){if(r.hasOwnProperty(k)&&r[k].url){r[k]['onclick']='if(event.shiftKey){modx.openWindow({url:\''+r[k].url+'\'})}else{modx.popup({url:\''+r[k].url+'\',title:\''+r.header.innerHTML+'\',width:\'95%\',height:\'95%\',margin:0,hide:0,hover:0,overlay:1,overlayclose:0,position:\'center elements\',animation:0,icon:\'none\'})}'}}r=JSON.stringify(r);el.id='node'+id;el.dataset.contextmenu=r;modx.tree.showPopup(e,id,name)}})}e.preventDefault()}},tabRow:{init:function(){var row=w.main.document.querySelector('.tab-pane > .tab-row');if(row)this.build(row)},build:function(row){var rowContainer=d.createElement('div'),sel=row.querySelector('.selected');rowContainer.className='tab-row-container';row.parentNode.insertBefore(rowContainer,row);rowContainer.appendChild(row);var p=d.createElement('i');p.className='fa fa-angle-left prev disable';p.onclick=function(e){e.stopPropagation();e.preventDefault();var sel=row.querySelector('.selected');if(sel.previousSibling){sel.previousSibling.click();modx.main.tabRow.scroll(row)}};rowContainer.appendChild(p);var n=d.createElement('i');n.className='fa fa-angle-right next disable';n.onclick=function(e){e.stopPropagation();e.preventDefault();var sel=row.querySelector('.selected');if(sel.nextSibling){sel.nextSibling.click();modx.main.tabRow.scroll(row)}};rowContainer.appendChild(n);setTimeout(function(){sel=row.querySelector('.selected');modx.main.tabRow.scroll(row,sel);w.main.addEventListener('resize',function(){modx.main.tabRow.scroll(row)},false);if(sel){if(sel.previousSibling)p.classList.remove('disable');if(sel.nextSibling)n.classList.remove('disable')}},100);row.onclick=function(e){var sel=e.target.tagName==='H2'?e.target:e.target.tagName==='SPAN'?e.target.parentNode:null;if(sel){if(sel.previousSibling){this.parentNode.querySelector('i.prev').classList.remove('disable')}else{this.parentNode.querySelector('i.prev').classList.add('disable')}if(sel.nextSibling){this.parentNode.querySelector('i.next').classList.remove('disable')}else{this.parentNode.querySelector('i.next').classList.add('disable')}modx.main.tabRow.scroll(this,sel)}}},scroll:function(row,sel,a){sel=sel||row.querySelector('.selected')||row.firstChild;a=a||100;var c=0,elms=row.childNodes;for(var i=0;isel.offsetLeft){$(row).animate({scrollLeft:sel.offsetLeft-(sel.previousSibling?30:1)},a)}if(sel.offsetLeft+sel.offsetWidth>row.offsetWidth+row.scrollLeft){$(row).animate({scrollLeft:sel.offsetLeft-row.offsetWidth+sel.offsetWidth+(sel.nextSibling?30:0)},a)}if(c>row.offsetWidth){this.drag(row)}},drag:function(row){row.onmousedown=function(e){if(e.button===0){e.preventDefault();var x=e.clientX,f=row.scrollLeft;row.ownerDocument.body.focus();row.onmousemove=row.ownerDocument.onmousemove=function(e){if(Math.abs(e.clientX-x)>5){e.stopPropagation();row.scrollLeft=f-(e.clientX-x);row.ownerDocument.body.classList.add('drag')}};row.onmouseup=row.ownerDocument.onmouseup=function(e){e.stopPropagation();row.onmousemove=null;row.ownerDocument.onmousemove=null;row.ownerDocument.body.classList.remove('drag')}}}}},work:function(){d.getElementById('mainloader').classList.add('show')},stopWork:function(){d.getElementById('mainloader').classList.remove('show')},scrollWork:function(){var a=w.main.frameElement.contentWindow,b=a.location.search.substring(1)||a.location.hash.substring(2),c=localStorage.getItem('page_y')||0,f=localStorage.getItem('page_url')||b;if(((modx.getActionFromUrl(f)===modx.getActionFromUrl(b))&&(modx.main.getQueryVariable('id',f)&&modx.main.getQueryVariable('id',f)===modx.main.getQueryVariable('id',b)))||(f===b)){a.scrollTo(0,c)}a.addEventListener('scroll',function(){if(this.pageYOffset>=0){localStorage.setItem('page_y',this.pageYOffset.toString());localStorage.setItem('page_url',b)}},false)},getQueryVariable:function(a,b){var f='';if(b||typeof b==='string'){b=b.split('?');b=b[1]||b[0];b=b.split('&');for(var i=0;iMath.abs(ay)&&this.swipe){if(ax<0&&this.sidebar){if(Math.abs(ax)>h)ax=-h;tree.style.transform='translate3d('+ax+'px, 0, 0)';tree.style.WebkitTransform='translate3d('+ax+'px, 0, 0)';modx.resizer.mask.style.opacity=(0.5-0.5/-h*ax).toFixed(2);if(Math.abs(ax)>h/3){this.swipe='left'}else{this.swipe='right'}}else if(ax>0&&!this.sidebar){if(Math.abs(ax)>h)ax=h;tree.style.transform='translate3d('+ -(h-ax)+'px, 0, 0)';tree.style.WebkitTransform='translate3d('+ -(h-ax)+'px, 0, 0)';modx.resizer.mask.style.opacity=(0.5/h*ax).toFixed(2);if(Math.abs(ax)>h/3){this.swipe='right'}else{this.swipe='left'}}}},false);w.addEventListener('touchend',function(){if(this.swipe==='left'){d.body.classList.add('sidebar-closed');modx.resizer.setWidth(0)}if(this.swipe==='right'){d.body.classList.remove('sidebar-closed');modx.resizer.setWidth(h)}tree.style.cssText='';modx.resizer.mask.style.cssText=''},false)}},onMouseDown:function(e){e=e||w.event;modx.resizer.dragElement=e.target!==null?e.target:e.srcElement;if((e.buttons===1||e.button===0)&&modx.resizer.dragElement.id===modx.resizer.id){modx.resizer.oldZIndex=modx.resizer.dragElement.style.zIndex;modx.resizer.dragElement.style.zIndex=modx.resizer.newZIndex;modx.resizer.dragElement.style.background=modx.resizer.background;localStorage.setItem('MODX_widthSideBar',modx.resizer.dragElement.offsetLeft>0?modx.resizer.dragElement.offsetLeft:0);d.body.appendChild(modx.resizer.mask);d.onmousemove=modx.resizer.onMouseMove;d.body.focus();d.body.classList.add('resizer_move');d.onselectstart=function(){return false};modx.resizer.dragElement.ondragstart=function(){return false};return false}},onMouseMove:function(e){e=e||w.event;if(e.clientX>0){modx.resizer.left=e.clientX}else{modx.resizer.left=0}modx.resizer.dragElement.style.left=modx.pxToRem(modx.resizer.left)+'rem';d.getElementById('tree').style.width=modx.pxToRem(modx.resizer.left)+'rem';d.getElementById('main').style.left=modx.pxToRem(modx.resizer.left)+'rem';if(e.clientX<-2||e.clientY<-2){modx.resizer.onMouseUp(e)}},onMouseUp:function(e){if(modx.resizer.dragElement!==null&&e.button===0&&modx.resizer.dragElement.id===modx.resizer.id){if(e.clientX>0){d.body.classList.remove('sidebar-closed');modx.resizer.left=e.clientX}else{d.body.classList.add('sidebar-closed');modx.resizer.left=0}d.cookie='MODX_widthSideBar='+modx.pxToRem(modx.resizer.left);modx.resizer.dragElement.style.zIndex=modx.resizer.oldZIndex;modx.resizer.dragElement.style.background='';modx.resizer.dragElement.ondragstart=null;modx.resizer.dragElement=null;d.body.classList.remove('resizer_move');d.body.removeChild(modx.resizer.mask);d.onmousemove=null;d.onselectstart=null}},toggle:function(){if(modx.isMobile||w.innerWidth<=modx.minWidth){if(d.body.classList.contains('sidebar-closed')){d.body.classList.remove('sidebar-closed');localStorage.setItem('MODX_widthSideBar',0);d.cookie='MODX_widthSideBar='+modx.pxToRem(parseInt(d.getElementById('tree').offsetWidth))}else{localStorage.setItem('MODX_widthSideBar',parseInt(d.getElementById('tree').offsetWidth));d.body.classList.add('sidebar-closed');d.cookie='MODX_widthSideBar=0'}}else{var p=d.getElementById('tree').offsetWidth!==0?0:parseInt(localStorage.getItem('MODX_widthSideBar'))?parseInt(localStorage.getItem('MODX_widthSideBar')):modx.config.tree_width;modx.resizer.setWidth(p)}},setWidth:function(a){if(a>0){localStorage.setItem('MODX_widthSideBar',0);d.body.classList.remove('sidebar-closed')}else{localStorage.setItem('MODX_widthSideBar',parseInt(d.getElementById('tree').offsetWidth));d.body.classList.add('sidebar-closed')}d.cookie='MODX_widthSideBar='+modx.pxToRem(a);d.getElementById('tree').style.width=modx.pxToRem(a)+'rem';d.getElementById('resizer').style.left=modx.pxToRem(a)+'rem';d.getElementById('main').style.left=modx.pxToRem(a)+'rem'},setDefaultWidth:function(){modx.resizer.setWidth(modx.remToPx(modx.config.tree_width))}},tree:{ctx:null,rpcNode:null,itemToChange:'',selectedObjectName:null,selectedObject:0,selectedObjectDeleted:0,selectedObjectUrl:'',drag:false,deleted:[],init:function(){this.restoreTree()},draggable:function(){if(modx.permission.dragndropdocintree){var els=d.querySelectorAll('#treeRoot a:not(.empty)');for(var i=0;i-1:true;modx.tree.itemToChange=this.dataset.id||this.parentNode.id.replace('node','');modx.tree.selectedObjectName=this.dataset.titleEsc;if(draggable){this.parentNode.draggable=true;this.parentNode.ondragstart=modx.tree.ondragstart}else{this.parentNode.draggable=false;this.parentNode.ondragstart=function(){return false}}}},ondragstart:function(e){e.dataTransfer.effectAllowed='all';e.dataTransfer.dropEffect='all';e.dataTransfer.setData('text',this.id.substr(4))},ondragenter:function(e){if(d.getElementById('node'+modx.tree.itemToChange)===(this.parentNode.closest('#node'+modx.tree.itemToChange)||this.parentNode)){this.parentNode.className='';e.dataTransfer.effectAllowed='none';e.dataTransfer.dropEffect='none';modx.tree.drag=false}else{this.parentNode.className='dragenter';e.dataTransfer.effectAllowed='copy';e.dataTransfer.dropEffect='copy';modx.tree.drag=true}e.preventDefault()},ondragover:function(e){if(modx.tree.drag){var a=e.clientY;var b=parseInt(this.getBoundingClientRect().top);var c=a-b;if(c>this.offsetHeight/1.51){this.parentNode.classList.add('dragafter');this.parentNode.classList.remove('dragbefore');this.parentNode.classList.remove('dragenter');e.dataTransfer.effectAllowed='link';e.dataTransfer.dropEffect='link'}else if(c'}if(this.nextSibling){if(this.nextSibling.innerHTML){this.nextSibling.appendChild(el)}else{el.parentNode.removeChild(el)}els=this.parentNode.lastChild.children;for(i=0;i'}this.parentNode.parentNode.insertBefore(el,this.parentNode.nextSibling);els=this.parentNode.parentNode.children;for(i=0;i'}this.parentNode.parentNode.insertBefore(el,this.parentNode);els=this.parentNode.parentNode.children;for(i=0;i-1:true)){alert(modx.lang.error_no_privileges);modx.tree.restoreTree();return}modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',{a:'movedocument',id:id,parent:parent,menuindex:menuindex},function(r){if(r.errors)alert(r.errors);modx.tree.restoreTree()},'json');var b=w.main.frameElement.contentWindow.location.search.substr(1);if(modx.getActionFromUrl(b,27)&&parseInt(modx.main.getQueryVariable('id',b))===parseInt(id)){var index=menuindex.indexOf(id),elMenuIndex=w.main.document.querySelector('#documentPane input[name=menuindex]'),elParent=w.main.document.querySelector('#documentPane input[name=parent]'),elParentName=w.main.document.querySelector('#documentPane #parentName');if(elMenuIndex&&index>=0)elMenuIndex.value=index;if(elParent&&elParentName){elParent.value=parent;elParentName.innerHTML=parent+' ('+d.querySelector('#node'+parent+' > a').dataset.titleEsc+')'}}},toggleNode:function(e,id){e=e||w.event;if(e.ctrlKey)return;e.stopPropagation();var el=d.getElementById('node'+id).firstChild;this.rpcNode=el.nextSibling;var toggle=el.querySelector('.toggle'),icon=el.querySelector('.icon');if(this.rpcNode.innerHTML===''){if(toggle)toggle.innerHTML=el.dataset.iconCollapsed;icon.innerHTML=el.dataset.iconFolderOpen;var rpcNodeText=this.rpcNode.innerHTML,loadText=modx.lang.loading_doc_tree;modx.openedArray[id]=1;if(rpcNodeText===''||rpcNodeText.indexOf(loadText)>0){var folderState=this.getFolderState();d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent='+el.dataset.indent+'&parent='+id+'&expandAll='+el.dataset.expandall+folderState,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})}this.saveFolderState()}else{if(toggle)toggle.innerHTML=el.dataset.iconExpanded;icon.innerHTML=el.dataset.iconFolderClose;delete modx.openedArray[id];this.rpcNode.style.overflow='hidden';$(this.rpcNode.firstChild).animate({marginTop:-this.rpcNode.offsetHeight+'px'},100,function(){this.parentNode.innerHTML=''});this.saveFolderState()}e.preventDefault()},rpcLoadData:function(a){if(this.rpcNode!==null){var el;this.rpcNode.innerHTML=typeof a==='object'?a.responseText:a;this.rpcNode.loaded=true;if(this.rpcNode.firstChild.tagName==='DIV'){if(this.rpcNode.id==='treeRoot'){el=d.getElementById('binFull');if(el){this.showBin(true)}else{this.showBin(false)}}else{this.rpcNode.style.overflow='hidden';this.rpcNode.firstElementChild.style.marginTop=-this.rpcNode.offsetHeight+'px';$(this.rpcNode.firstChild).animate({marginTop:0},100)}d.getElementById('treeloader').classList.remove('visible')}else{el=d.getElementById('loginfrm');if(el){this.rpcNode.parentNode.removeChild(this.rpcNode);w.location.href=modx.MODX_MANAGER_URL}}}},treeAction:function(e,id,title){if(e.ctrlKey)return;var el=d.getElementById('node'+id).firstChild,treepageclick=el.dataset.treepageclick,showchildren=parseInt(el.dataset.showchildren),openfolder=parseInt(el.dataset.openfolder);title=title||el.dataset&&el.dataset.titleEsc;if(tree.ca==='move'){try{this.setSelectedByContext(id);w.main.setMoveValue(id,title)}catch(oException){alert(modx.lang.unable_set_parent)}}if(tree.ca==='open'||tree.ca===''){if(id===0){href='?a=2'}else{var href='';if(!isNaN(treepageclick)&&isFinite(treepageclick)){href='?a='+treepageclick+'&r=1&id='+id+(openfolder===0?this.getFolderState():'')}else{href=treepageclick}if(openfolder===2){if(showchildren!==1){href=''}this.toggleNode(e,id)}}if(href){if(e.shiftKey){w.getSelection().removeAllRanges();modx.openWindow(href);this.restoreTree()}else{modx.tabs({url:modx.MODX_MANAGER_URL+href,title:title+'('+id+')'});if(modx.isMobile)modx.resizer.toggle()}}this.itemToChange=id;this.setSelected(id)}if(tree.ca==='parent'){try{this.setSelectedByContext(id);w.main.setParent(id,title)}catch(oException){alert(modx.lang.unable_set_parent)}}if(tree.ca==='link'){try{this.setSelectedByContext(id);w.main.setLink(id)}catch(oException){alert(modx.lang.unable_set_link)}}e.preventDefault()},showPopup:function(e,id,title){if(e.ctrlKey)return;e.preventDefault();var tree=d.getElementById('tree'),el=d.getElementById('node'+id)||e.target,x=0,y=0;if(el.firstChild&&el.firstChild.dataset&&el.firstChild.dataset.contextmenu){el=el.firstChild}if(el){if(el.dataset.contextmenu){e.target.dataset.toggle='#contextmenu';modx.hideDropDown(e);this.ctx=d.createElement('div');this.ctx.id='contextmenu';this.ctx.className='dropdown-menu';d.getElementById(modx.frameset).appendChild(this.ctx);this.setSelectedByContext(id);var dataJson=JSON.parse(el.dataset.contextmenu);for(var key in dataJson){if(dataJson.hasOwnProperty(key)){var item=d.createElement('div');for(var k in dataJson[key]){if(dataJson[key].hasOwnProperty(k)){if(k.substring(0,2)==='on'){var onEvent=dataJson[key][k];item[k]=function(onEvent){return function(event){eval(onEvent)}}(onEvent)}else{item[k]=dataJson[key][k]}}}if(key.indexOf('header')===0)item.className+=' menuHeader';if(key.indexOf('item')===0)item.className+=' menuLink';if(key.indexOf('seperator')===0||key.indexOf('separator')===0)item.className+=' seperator separator';this.ctx.appendChild(item)}}x=e.clientX>0?e.clientX:e.pageX;y=e.clientY>0?e.clientY:e.pageY;e.view.position=e.view.frameElement?e.view.frameElement.getBoundingClientRect():e.target.offsetParent.getBoundingClientRect();if(e.view.frameElement){x+=e.view.position.left;y+=e.view.frameElement.offsetParent.offsetTop}else{if(e.target.parentNode.parentNode.classList.contains('node')){x+=50}}if(x>e.view.position.width){x=e.view.position.width-this.ctx.offsetWidth}if(y+this.ctx.offsetHeight/2>e.view.position.height){y=e.view.position.height-this.ctx.offsetHeight-5}else if(y-this.ctx.offsetHeight/20?e.clientX:e.pageX;y=e.clientY>0?e.clientY:e.pageY;if(y+ctx.offsetHeight/2>bodyHeight){y=bodyHeight-ctx.offsetHeight-5}else if(y-ctx.offsetHeight/230){this.selectedObjectName=this.selectedObjectName.substr(0,30)+'...'}var f=d.getElementById('nameHolder');f.innerHTML=this.selectedObjectName;el.style.left=a+(modx.config.textdir?'-190':'')+'px';el.style.top=b+'px';el.classList.add('show')},menuHandler:function(a){switch(a){case 1:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=3&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 2:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=27&r=1&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 3:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=4&pid='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 4:if(this.selectedObjectDeleted){alert('"'+this.selectedObjectName+'" '+modx.lang.already_deleted)}else if(confirm('"'+this.selectedObjectName+'"\n\n'+modx.lang.confirm_delete_resource)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=6&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 5:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=51&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 6:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=72&pid='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 7:if(confirm(modx.lang.confirm_resource_duplicate)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=94&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 8:if(d.getElementById('node'+this.itemToChange).firstChild.dataset.deleted){if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_undelete)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=63&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}}else{alert('"'+this.selectedObjectName+'"'+modx.lang.not_deleted)}break;case 9:if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_publish)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=61&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 10:if(this.itemToChange!==modx.config.site_start){if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_unpublish)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=62&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}}else{alert('Document is linked to site_start variable and cannot be unpublished!')}break;case 11:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=56&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 12:w.open(d.getElementById('node'+this.itemToChange).firstChild.dataset.href,'previeWin');break;default:alert('Unknown operation command.')}},setSelected:function(a){var el=d.querySelector('#tree .current');if(el)el.classList.remove('current');if(a){if(typeof a==='object'){a.classList.add('current')}else{el=d.querySelector('#node'+a+'>.node')||d.getElementById('node'+a);if(el)el.classList.add('current')}}},setActiveFromContextMenu:function(a){var el=d.querySelector('#node'+a+'>.node');if(el)this.setSelected(el)},setSelectedByContext:function(a){var el=d.querySelector('#treeRoot .selected');if(el)el.classList.remove('selected');el=d.querySelector('#node'+a+'>.node');if(el)el.classList.add('selected')},setItemToChange:function(){var a=w.main.document&&(w.main.document.URL||w.main.document.location.search),b=modx.getActionFromUrl(a);if(a&&modx.typesactions[b]){this.itemToChange=(modx.typesactions[b]===7?'':modx.typesactions[b]+'_')+parseInt(modx.main.getQueryVariable('id',a))}else{this.itemToChange=''}this.setSelected(this.itemToChange)},restoreTree:function(){if(d.getElementById('treeRoot')){d.getElementById('treeloader').classList.add('visible');this.setItemToChange();this.rpcNode=d.getElementById('treeRoot');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=2&id='+this.itemToChange,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})}},expandTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=1&id='+this.itemToChange,function(r){modx.tree.rpcLoadData(r);modx.tree.saveFolderState();modx.tree.draggable()})},collapseTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=0&id='+this.itemToChange,function(r){modx.openedArray=[];modx.tree.saveFolderState();modx.tree.rpcLoadData(r);modx.tree.draggable()})},updateTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');var a=d.sortFrm;var b='a=1&f=nodes&indent=1&parent=0&expandAll=2&dt='+a.dt.value+'&tree_sortby='+a.sortby.value+'&tree_sortdir='+a.sortdir.value+'&tree_nodename='+a.nodename.value+'&id='+this.itemToChange+'&showonlyfolders='+a.showonlyfolders.value;modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',b,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})},getFolderState:function(){var a;if(modx.openedArray!==[0]){a='&opened=';for(var key in modx.openedArray){if(modx.openedArray[key]){a+=key+'|'}}}else{a='&opened='}return a},saveFolderState:function(){modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&savestateonly=1'+this.getFolderState())},showSorter:function(e){e=e||w.event;var el=d.getElementById('floater');e.target.dataset.toggle='#floater';el.classList.toggle('show');el.onclick=function(e){e.stopPropagation()}},emptyTrash:function(){if(confirm(modx.lang.confirm_empty_trash)===true){modx.get(modx.MODX_MANAGER_URL+'?a=64',function(){modx.tabsClose(modx.tree.deleted);modx.tree.deleted=[];modx.tree.restoreTree()})}},showBin:function(a){var el=d.getElementById('treeMenu_emptytrash');if(el){if(a){el.title=modx.lang.empty_recycle_bin;el.classList.remove('disabled');el.innerHTML=modx.style.empty_recycle_bin;el.onclick=function(){modx.tree.emptyTrash()};var els=d.getElementById('tree').querySelectorAll('.deleted');for(var i=0;i0){if(el){el.innerHTML=c[0];el.style.display='block'}}else{if(el)el.style.display='none'}if(c[1]>0){el=d.getElementById('newMail');if(el){el.innerHTML=''+modx.style.email+modx.lang.inbox+' ('+c[0]+' / '+c[1]+')';el.style.display='block'}}if(modx.config.mail_check_timeperiod>0)setTimeout('modx.updateMail(true)',1000*modx.config.mail_check_timeperiod)})}}catch(oException){setTimeout('modx.updateMail(true)',1000*modx.config.mail_check_timeperiod)}},openWindow:function(a){if(typeof a!=='object'){a={'url':a}}if(!a.width)a.width=parseInt(w.innerWidth*0.9)+'px';if(!a.height)a.height=parseInt(w.innerHeight*0.8)+'px';if(!a.left)a.left=parseInt(w.innerWidth*0.05)+'px';if(!a.top)a.top=parseInt(w.innerHeight*0.1)+'px';if(!a.title)a.title=Math.floor((Math.random()*999999)+1);if(a.url){if(this.plugins.EVOmodal===1){top.EVO.modal.show(a)}else{w.open(a.url,a.title,'width='+a.width+',height='+a.height+',top='+a.top+',left='+a.left+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no')}}},tabsClose:function(a){if(modx.config.global_tabs&&a){for(var k in a){if(a.hasOwnProperty(k)){var el=d.getElementById(a[k]);if(el){el.firstElementChild.contentWindow.documentDirty=false;el.close()}}}}},tabs:function(a){function Tabs(a){var s=this;this.url=a.url;this.title=a.title||'';this.name=a.name||'';this.timer=null;this.olduid='';this.closeactions=[6,61,62,63,94];this.reload=typeof a.reload!=='undefined'?a.reload:1;this.action=modx.getActionFromUrl(a.url);this.uid=modx.getActionFromUrl(a.url,2)?'home':modx.urlToUid(a.url);this.page=d.getElementById('evo-tab-page-'+this.uid);this.row=d.getElementsByClassName('evo-tab-row')[0].firstElementChild;this.tab=d.getElementById('evo-tab-'+this.uid);if(this.page){if(this.uid==='home'){if(this.reload){this.page.firstElementChild.src=this.url;this.show()}else{this.reload=1;if(this.tab.onclick===null){this.tab.onclick=function(e){s.select.call(s,e,this)}}this.tab.show=function(e){s.show.call(s,e)};modx.tabs.selected=this.tab}}else{this.show();if(~this.closeactions.indexOf(this.action)){this.setDocPublished();modx.get(this.url,function(){modx.tree.restoreTree()})}}}else if(~this.closeactions.indexOf(this.action)){modx.get(this.url,function(){modx.tree.restoreTree()})}else{this.create()}}Tabs.prototype={create:function(){var s=this;modx.main.work();modx.tabs.selected=this.row.querySelector('.selected');if(modx.tabs.selected){d.getElementById(modx.tabs.selected.id.replace('tab','tab-page')).classList.remove('show');modx.tabs.selected.classList.remove('selected')}this.page=d.createElement('div');this.page.id='evo-tab-page-'+this.uid;this.page.className='evo-tab-page show';this.page.innerHTML='';d.getElementById('main').appendChild(this.page);console.time('load-tab');this.page.firstElementChild.onload=function(e){s.onload.call(s,e);console.timeEnd('load-tab')};this.tab=d.createElement('h2');this.tab.id='evo-tab-'+this.uid;this.tab.className='tab selected';this.icon='';if(!/'}this.tab.innerHTML=''+this.icon+this.title+'×';this.row.appendChild(this.tab);this.tab.onclick=function(e){s.select.call(s,e,this)};this.tab.close=function(e){s.close.call(s,e)};this.tab.show=function(e){s.show.call(s,e)};this.page.close=function(e){s.close.call(s,e)}},onload:function(e){var s=this;w.main=e.target.contentWindow||e.target.defaultView;this.url=w.main.location.search||w.location.hash.substring(1);this.olduid=this.uid;this.uid=modx.urlToUid(this.url);if(!!w.main.__alertQuit){w.main.alert=function(a){};var message=w.main.document.body.innerHTML;w.main.document.body.innerHTML='';history.pushState(null,d.title,modx.getActionFromUrl(w.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.location.search);w.onpopstate=function(){history.go(1)};modx.popup({type:'warning',title:'MODX :: Alert',position:'top center alertQuit',content:message,wrap:'body'});modx.getLockedElements(modx.getActionFromUrl(this.url),modx.main.getQueryVariable('id',this.url),function(data){if(!!data){s.page.close();modx.tree.restoreTree()}else{w.main.location.href=modx.MODX_MANAGER_URL+s.url;w.history.replaceState(null,d.title,modx.getActionFromUrl(s.url,2)?modx.MODX_MANAGER_URL:'#'+s.url)}})}else{if(modx.getActionFromUrl(this.url,2)){this.close(e)}else if(this.olduid!==this.uid&&d.getElementById('evo-tab-'+this.uid)){this.close(e);d.getElementById('evo-tab-'+this.uid).show()}else{this.title=w.main.document.body.querySelectorAll('h1')[0]&&w.main.document.body.querySelectorAll('h1')[0].innerHTML||this.title;if(this.title&&this.uid!=='home'){this.tab.innerHTML=''+this.title+'×'}this.page.id='evo-tab-page-'+this.uid;this.tab.id='evo-tab-'+this.uid;this.tab.classList.remove('changed');this.show();modx.main.onload(e);w.main.document.addEventListener('click',function a(e){if(typeof e.view.documentDirty!=='undefined'&&e.view.documentDirty&&!s.tab.classList.contains('changed')){s.tab.classList.add('changed');this.removeEventListener(e.type,a,false)}},false);w.main.document.addEventListener('keyup',function a(e){if(typeof e.view.documentDirty!=='undefined'&&e.view.documentDirty&&!s.tab.classList.contains('changed')){s.tab.classList.add('changed');this.removeEventListener(e.type,a,false)}},false)}}},show:function(){var s=this;modx.tabs.selected=this.row.querySelector('.selected');if(modx.tabs.selected&&modx.tabs.selected!==this.tab){d.getElementById(modx.tabs.selected.id.replace('tab','tab-page')).classList.remove('show');modx.tabs.selected.classList.remove('selected')}this.page.classList.add('show');this.tab.classList.add('selected');modx.tabs.selected=this.tab;w.main=this.page.firstElementChild.contentWindow;w.history.replaceState(null,w.main.document.title,modx.getActionFromUrl(w.main.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.main.location.search);modx.tree.setItemToChange();modx.main.tabRow.scroll(this.row,this.tab,350)},close:function(e){var documentDirty=this.page.firstElementChild.contentWindow.documentDirty;var checkDirt=!!this.page.firstElementChild.contentWindow.checkDirt;if(documentDirty&&checkDirt&&confirm(this.page.firstElementChild.contentWindow.checkDirt(e))||!documentDirty){modx.tabs.selected=this.tab.classList.contains('selected')?this.tab.previousElementSibling:this.row.querySelector('.selected');this.page.parentNode.removeChild(this.page);this.row.removeChild(this.tab);modx.tabs.selected.show()}},select:function(e){if(e.target.className==='tab-close'){this.close(e)}else if(modx.tabs.selected===this.tab){var s=this;if(this.timer){clearTimeout(this.timer);this.timer=null;w.main.location.reload()}else{this.timer=setTimeout(function(){s.timer=null},250)}}else{this.show()}},setDocPublished:function(){var el=w.main.document.getElementsByName('publishedcheck')[0];if(el){el.checked=this.action===61;w.main.document.getElementsByName('published')[0].value=+el.checked}if(modx.getActionFromUrl(w.main.location.search,3)){w.main.location.reload()}}};if(modx.config.global_tabs){if(typeof a.currentTarget!=='undefined'){var e=a;if(e.button===0&&e.target&&(e.target.tagName==='A'&&e.target.target==='main'||(e.target.parentNode&&e.target.parentNode.tagName==='A'&&e.target.parentNode.target==='main'))){a=e.target.tagName==='A'&&e.target||e.target.parentNode.tagName==='A'&&e.target.parentNode;if(e.shiftKey){modx.openWindow({url:a.href})}else{modx.tabs({url:a.href,title:a.innerHTML})}e.preventDefault()}}else{return new Tabs(a)}}else if(a.url){if(w.main){w.main.frameElement.src=a.url}else{modx.openWindow(a.url)}}},popup:function(a){if(typeof a==='object'&&(a.url||a.content||a.text)){var o={addclass:'',animation:'fade',content:a.content||a.text||'',clickclose:0,closeall:0,data:'',dataType:'document',delay:5000,draggable:!1,event:null,height:'auto',hide:1,hover:1,icon:'',iframe:'iframe',margin:'.5rem',maxheight:'',method:'GET',overlay:0,overlayclose:0,position:'center',resize:!1,selector:'',showclose:1,target:'main',uid:'',type:'default',title:'',url:'',width:'20rem',wrap:w.main.document.body,zIndex:10500,w:null,show:function(){if(~o.position.indexOf('center')){if(o.event){o.el.style.left=o.event.clientX+o.mt+'px';o.el.style.bottom=o.w.innerHeight-o.el.offsetHeight-o.event.clientY+o.mt+'px'}else{o.el.style.left=/(%)/.test(o.width)?(100-parseInt(o.width))/2-o.mt/(o.w.innerWidth/100)+'%':(o.w.innerWidth-o.el.offsetWidth)/2-o.mt+'px';o.el.style.bottom=/(%)/.test(o.height)?(100-parseInt(o.height))/2-o.mt/(o.w.innerHeight/100)+'%':(o.w.innerHeight-o.el.offsetHeight-o.wrap.offsetTop)/2-o.mt+'px'}}if(~o.position.indexOf('left')){o.el.style.left=0}if(~o.position.indexOf('right')){o.el.style.right=0}else{o.el.style.right='auto'}if(~o.position.indexOf('top')){o.el.style.top=0;o.el.style.bottom=''}else{o.el.style.top='auto'}if(~o.position.indexOf('bottom')){o.el.style.bottom=0}o.calc();o.el.className+=' in';if(o.showclose){o.el.querySelector('.close').onclick=o.close}if(o.hide){o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);o.close()},o.delay)}if(o.hover){o.el.onmouseenter=function(){clearTimeout(o.el.timer)};o.el.onmouseleave=o.close}if(o.overlayclose&&o.o){o.o.onclick=o.close}if(o.clickclose){o.el.onclick=o.close}if(o.draggable){modx.dragging(o.el,{wrap:o.wrap,resize:o.resize})}},close:function(e){o.event=e||o.event||w.event;if(o.url&&o.iframe==='iframe'){var els=o.wrap.ownerDocument.querySelectorAll('.'+o.className+'.in');if(els){var documentDirty=o.el.lastElementChild.firstElementChild.contentWindow.documentDirty;if(documentDirty&&confirm(o.el.lastElementChild.firstElementChild.contentWindow.checkDirt(o.event))||!documentDirty){o.el.classList.remove('in');if(!o.animation){o.el.classList.remove('show')}o.calc(1);if(o.o&&o.o.parentNode){o.o.parentNode.removeChild(o.o);o.wrap.style.overflow=''}o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);if(o.el.parentNode){o.el.parentNode.removeChild(o.el)}},200)}}}else{o.el.classList.remove('in');if(!o.animation){o.el.classList.remove('show')}o.calc(1);if(o.o&&o.o.parentNode){o.o.parentNode.removeChild(o.o);o.wrap.style.overflow=''}o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);if(o.el.parentNode){o.el.parentNode.removeChild(o.el)}},200)}if(typeof o.onclose==='function'){o.onclose(e,o.el)}},calc:function(f){var els=o.wrap.ownerDocument.querySelectorAll('.'+o.className+'.in[data-position="'+o.el.dataset.position+'"]');if(els&&els.length){o.els=[];for(var i=0;i×

      '}if(o.title){o.header=document.createElement('div');if(o.icon!=='none'){o.header.innerHTML+=''}o.header.innerHTML+=o.title;o.header.className='evo-popup-header';o.el.appendChild(o.header)}o.el.innerHTML+='
      ';o.wrap.appendChild(o.el);o.mt=parseFloat(getComputedStyle(o.el).marginTop);if(o.maxheight){o.maxheight=/(%)/.test(o.maxheight)?(o.w.innerHeight-o.el.offsetHeight-o.mt)/100*parseInt(o.maxheight):o.maxheight;o.el.lastChild.style.overflowY='auto';o.el.lastChild.style.maxHeight=o.maxheight+'px'}if(o.url){o.draggable=1;if(o.iframe==='iframe'){o.resize=1;o.uid=modx.urlToUid(a.url);o.el.className+=' '+o.addclass+' '+o.className+'-iframe';o.el.id='evo-popup-'+o.uid;d.getElementById('mainloader').className='show';o.frame=d.createElement('iframe');o.frame.width='100%';o.frame.height='100%';o.frame.frameBorder='0';o.frame.src=o.url;o.frame.onload=function(e){e.target.contentWindow.opener=o.w;a.url=e.target.contentWindow.location.href;o.uid=modx.urlToUid(a.url);o.event=e;if(!!e.target.contentWindow.__alertQuit){modx.popup({type:'warning',title:'MODX :: Alert',position:'top center alertQuit',content:e.target.contentWindow.document.body.querySelector('p').innerHTML});e.target.contentWindow.document.body.innerHTML='';e.target.contentWindow.alert=function(){}}else{if(modx.getActionFromUrl(a.url,2)||o.wrap.querySelectorAll('#evo-popup-'+o.uid).length>1){o.el.close()}else{if(e.target.contentDocument.querySelectorAll('h1')[0]){a.title=e.target.contentDocument.querySelectorAll('h1')[0].innerHTML}else if(e.target.contentDocument.title){a.title=e.target.contentDocument.title}if(o.header){e.target.offsetParent.offsetParent.getElementsByClassName(o.header.className)[0].innerHTML=a.title}e.target.offsetParent.offsetParent.id='evo-popup-'+o.uid;e.target.offsetParent.offsetParent.classList.remove('changed')}}e.target.contentWindow.close=o.close;modx.main.stopWork()};o.el.lastChild.appendChild(o.frame);o.show()}else{var xhr=new XMLHttpRequest();xhr.open(o.method,o.url,true);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');xhr.setRequestHeader('X-REQUESTED-WITH','XMLHttpRequest');if(o.dataType){xhr.responseType=o.dataType}xhr.onload=function(){if(this.readyState===4){o.el.className+=' '+o.className+'-ajax';if(o.dataType==='document'){if(o.selector){var r=this.response.documentElement.querySelector(o.selector);if(r){o.el.lastChild.innerHTML+=r.innerHTML}}else{o.el.lastChild.innerHTML+=this.response.body.innerHTML}}else{o.el.lastChild.innerHTML+=this.response}o.show()}};xhr.send(o.data)}}else{o.el.lastChild.innerHTML+=o.content;o.show()}}return o}},getWindowDimension:function(){var a=0,b=0,c=d.documentElement,e=d.body;if(typeof(w.innerWidth)==='number'){a=w.innerWidth;b=w.innerHeight}else if(c&&(c.clientWidth||c.clientHeight)){a=c.clientWidth;b=c.clientHeight}else if(e&&(e.clientWidth||e.clientHeight)){a=e.clientWidth;b=e.clientHeight}return{'width':a,'height':b}},hideDropDown:function(e){e=e||w.event||w.main.event;if(tree.ca==='open'||tree.ca===''){modx.tree.setSelectedByContext()}if(modx.tree.ctx!==null){d.getElementById(modx.frameset).removeChild(modx.tree.ctx);modx.tree.ctx=null}if(!/dropdown\-item/.test(e.target.className)){var els=d.querySelectorAll('.dropdown.show'),n=null,t=e.target||e.target.parentNode,i;if(typeof t.dataset.toggle!=='undefined'){n=d.querySelector(t.dataset.toggle)}else if(t.classList.contains('dropdown-toggle')){n=t.offsetParent}for(i=0;i';if(this.classDrag)this.el.classList.add(this.classDrag);if(this.classResize)this.el.classList.add(this.classResize);this.el.insertBefore(this.borders,this.el.firstChild);if(this.handler&&this.el.getElementsByClassName(this.handler)[0]){this.handler=this.el.getElementsByClassName(this.handler)[0];this.handlerHeight=this.handler.offsetHeight}this.el.onmousedown=function(e){s.mousedown(e)};this.el.ontouchstart=function(e){s.mousedown(e.changedTouches[0])};this.wrap.addEventListener('mousemove',function(e){s.calc(e)},false);this.wrap.addEventListener('touchmove',function(e){s.calc(e.changedTouches[0])},false)};this.dragging.init.prototype={mousedown:function(e){if(e.target.classList.contains('close')){return}e=document.all?window.event:e;var s=this,x=document.all?window.event.clientX:e.clientX,y=document.all?window.event.clientY:e.clientY,style=w.getComputedStyle(this.el);this.elmX=(x-this.el.offsetLeft+parseInt(style.marginLeft));this.elmY=(y-this.el.offsetTop+parseInt(style.marginTop));this.el.position=this.el.getBoundingClientRect();this.el.style.position='fixed';this.el.style.transitionDuration='0s';this.el.style.webkitTransitionDuration='0s';this.el.style.left=this.el.offsetLeft-parseInt(style.marginLeft)+'px';this.el.style.top=this.el.offsetTop-parseInt(style.marginTop)+'px';this.el.style.right='auto';this.el.style.bottom='auto';this.el.style.width=this.el.position.width+'px';this.el.style.height=this.el.position.height+'px';if(e.target.parentNode===this.borders){this.isresize=this.resize;this.el.classList.add('is-resize')}else{if(!this.handler||(this.handler&&e.target===this.handler)){this.isdrag=true;this.el.classList.add('is-drag')}}if(typeof this.start==='function'){this.onstart(e,this.el)}if(e.preventDefault){e.preventDefault()}else{document.onselectstart=function(){return false}}this.wrap.onmousemove=function(e){s.mousemove(e)};this.wrap.ontouchmove=function(e){s.mousemove(e.changedTouches[0]);e.stopPropagation()};this.wrap.onmouseup=function(e){s.mouseup(e)};this.wrap.ontouchend=function(e){s.mouseup(e.changedTouches[0]);e.stopPropagation()}},mousemove:function(e){var x=document.all?window.event.clientX:e.clientX,y=document.all?window.event.clientY:e.clientY;if(this.isresize){if(this.onRight)this.el.style.width=Math.max(x-this.el.position.left+(this.el.position.width-this.x),this.minWidth)+'px';if(this.onBottom)this.el.style.height=Math.max(y-this.el.position.top+(this.el.position.height-this.y),this.minHeight)+'px';if(this.onLeft){this.width=Math.max(this.el.position.left-x+this.el.position.width+this.x,this.minWidth);if(this.width>this.minWidth){this.el.style.width=this.width+'px';this.el.style.left=x-this.elmX+'px'}}if(this.onTop){var currentHeight=Math.max(this.el.position.top-y+this.el.position.height+this.y,this.minHeight);if(currentHeight>this.minHeight){this.el.style.height=currentHeight+'px';this.el.style.top=y-this.elmY+'px'}}if(typeof this.onresize==='function'){this.onresize(e,this.el)}}else if(this.isdrag){this.el.style.opacity=this.opacity;this.el.style.left=x-this.elmX+'px';this.el.style.top=y-this.elmY+'px';if(typeof this.drag==='function'){this.ondrag(e,this.el)}}},mouseup:function(e){if(this.isdrag||this.isresize){this.el.classList.remove('is-resize');this.el.classList.remove('is-drag');this.el.style.opacity='';this.el.style.transitionDuration='';this.el.style.webkitTransitionDuration='';this.el.position=this.el.getBoundingClientRect();this.isdrag=false;this.isresize=false;this.wrap.onmousemove=null;this.wrap.onselectstart=null;if(typeof this.stop==='function'){this.onstop(e,this.el)}}},calc:function(e){if(this.isresize||this.isdrag){return}this.x=e.clientX-this.el.offsetLeft;this.y=e.clientY-this.el.offsetTop;if(this.resize){this.onTop=this.y=this.el.offsetWidth-this.border;this.onBottom=this.y>=this.el.offsetHeight-this.border;if(this.onRight&&this.onBottom||this.onLeft&&this.onTop){this.el.style.cursor='nwse-resize'}else if(this.onRight&&this.onTop||this.onBottom&&this.onLeft){this.el.style.cursor='nesw-resize'}else if(this.onRight||this.onLeft){this.el.style.cursor='ew-resize'}else if(this.onBottom||this.onTop){this.el.style.cursor='ns-resize'}else if(this.x>0&&this.y>0&&(this.x=this.border)){this.el.style.cursor='move'}else{this.el.style.cursor='default'}}else{if(this.x>0&&this.y>0&&(this.x=this.border)){this.el.style.cursor='move'}}}};return new this.dragging.init(a,b)},setTypeIcon:function(a){var b='';switch(this.typesactions[a]){case 1:b='fa fa-newspaper-o';break;case 2:b='fa fa-list-alt';break;case 3:b='fa fa-th-large';break;case 4:b='fa fa-code';break;case 5:b='fa fa-plug';break;case 6:b='fa fa-cube';break;case 7:b='fa fa-pencil-square-o';break;default:b='fa fa-circle'}return b}});w.mainMenu={};w.mainMenu.stopWork=function(){modx.main.stopWork()};w.mainMenu.work=function(){modx.main.work()};w.mainMenu.reloadtree=function(){if(modx.plugins.ElementsInTree){setTimeout('reloadElementsInTree()',50)}if(modx.config.global_tabs){setTimeout('modx.tree.restoreTree()',100)}};w.mainMenu.startrefresh=function(a){if(a===1){}if(a===2){}if(a===9){modx.tree.restoreTree()}if(a===10){w.location.href=modx.MODX_MANAGER_URL}};w.mainMenu.startmsgcount=function(a,b,c){modx.updateMail(c)};w.mainMenu.hideTreeFrame=function(){modx.resizer.setWidth(0)};w.mainMenu.defaultTreeFrame=function(){modx.resizer.setDefaultWidth()};w.tree={};w.tree.ca='open';w.tree.document=document;w.tree.saveFolderState=function(){};w.tree.updateTree=function(){modx.tree.updateTree()};w.tree.restoreTree=function(){modx.tree.restoreTree()};w.tree.resizeTree=function(){};w.onbeforeunload=function(){var a=w.main.frameElement.contentWindow;if(modx.getActionFromUrl(a.location.search,27)){modx.get(modx.MODX_MANAGER_URL+'?a=67&type=7&id='+modx.main.getQueryVariable('id',a.location.search.substring(1)))}};d.addEventListener('DOMContentLoaded',function(){modx.init()})})(typeof jQuery!=='undefined'?jQuery:'',window,document,undefined);(function(){if(!Element.prototype.closest){Element.prototype.closest=function(a){var b=this,c,d;['matches','webkitMatchesSelector','mozMatchesSelector','msMatchesSelector','oMatchesSelector'].some(function(fn){if(typeof document.body[fn]==='function'){c=fn;return true}return false});if(b&&c&&b[c](a))return b;while(b){d=b.parentElement;if(d&&c&&d[c](a))return d;b=d}return null}}})(); \ No newline at end of file +(function($,w,d,u){'use strict';modx.extended({frameset:'frameset',minWidth:840,isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),typesactions:{'16':1,'301':2,'78':3,'22':4,'102':5,'108':6,'3':7,'4':7,'6':7,'27':7,'61':7,'62':7,'63':7,'72':7},thememodes:['','lightness','light','dark','darkness'],tabsTimer:0,popupTimer:0,init:function(){if(!localStorage.getItem('MODX_widthSideBar')){localStorage.setItem('MODX_widthSideBar',this.config.tree_width)}this.mainmenu.init();if(w.location.hash){if(modx.getActionFromUrl(w.location.hash,2)){w.history.replaceState(null,d.title,modx.MODX_MANAGER_URL)}else if(modx.getActionFromUrl(w.location.hash)||modx.main.getQueryVariable('filemanager',w.location.hash)){var url=modx.main.getQueryVariable('filemanager',w.location.hash)?modx.MODX_MANAGER_URL+modx.main.getQueryVariable('filemanager',w.location.hash)+w.location.hash.replace('#?','?'):w.location.href.replace('#?','?');if(modx.config.global_tabs){modx.tabs({url:url,title:'blank'})}else if(w.main){w.main.frameElement.src=url}else{modx.openWindow(url)}}}this.resizer.init();this.search.init();if(this.config.session_timeout>0){w.setInterval(this.keepMeAlive,1000*60*this.config.session_timeout)}if(modx.config.mail_check_timeperiod>0&&modx.permission.messages){setTimeout('modx.updateMail(true)',1000)}d.addEventListener('click',this.hideDropDown,false);if(modx.config.global_tabs){d.addEventListener('click',this.tabs,false);this.tabs({url:'?a=2',reload:0})}},mainmenu:{id:'mainMenu',init:function(){var $mm=$('#mainMenu'),mm=d.getElementById('mainMenu'),timer;$mm.on('click','a',function(e){if($(this).hasClass('dropdown-toggle')){if($mm.hasClass('show')&&($(this).hasClass('selected')||!modx.isMobile&&$(this).parent().hasClass('hover'))){$(this).removeClass('selected');$mm.removeClass('show')}else{$('.nav > li > a:not(:hover)').removeClass('selected');$(this).addClass('selected');$mm.addClass('show')}e.stopPropagation();e.target.dataset.toggle='#mainMenu';modx.hideDropDown(e)}if($(this).closest('ul').hasClass('dropdown-menu')&&!$(this).parent('li').hasClass('dropdown-back')){$('.nav > .active').removeClass('active');$('.nav li.selected').removeClass('selected');$(this).closest('.nav > li').addClass('active');if(this.offsetParent.id){d.getElementById(this.offsetParent.id.substr(7)).classList.add('selected')}if((modx.isMobile||w.innerWidth li',function(){var els=mm.querySelectorAll('.nav > li.hover:not(:hover)');for(var i=0;i li li',function(e){var self=this,ul;var els=mm.querySelectorAll('.nav > li li.hover:not(:hover)');for(var i=0;i'+modx.lang.paging_prev+''+data}ul.id='parent_'+self.id;ul.innerHTML=data;var id=w.location.hash.substr(2).replace(/=/g,'_').replace(/&/g,'__');var el=d.getElementById(id);if(el){el.parentNode.classList.add('selected');d.getElementById(el.parentNode.parentNode.id.substr(7)).classList.add('selected')}for(var i=0;iitems.length-1){index=items.length-1}if(index>=0&&index2){s.timer=setTimeout(function(){s.loader.style.display='block';modx.get(modx.MODX_MANAGER_URL+'?a=71&ajax=1&submitok=Search&searchid='+s.input.value,function(data){s.loader.style.display='none';s.results=data.querySelector('.ajaxSearchResults');if(s.results&&s.results.innerHTML!==''){s.result.innerHTML=s.results.outerHTML;s.open();s.result.onclick=function(e){var t=e.target,p=t.parentNode;if(t.tagName==='I'){modx.openWindow({title:p.innerText,id:p.id,url:p.href});e.preventDefault();e.stopPropagation()}else{var a=t.tagName==='A'&&t||p.tagName==='A'&&p;if(a){var el=s.result.querySelector('.selected');if(el)el.className='';a.className='selected';if(modx.isMobile)s.close()}}}}else{s.empty()}},'document')},300)}else{s.empty()}};if(modx.isMobile){this.input.onblur=this.close}this.input.onfocus=this.open;this.input.onclick=this.open;this.input.onmouseenter=this.open;this.result.onmouseenter=this.open;this.result.onmouseleave=this.close;this.mask.onmouseenter=this.open;this.mask.onmouseleave=this.close},open:function(){if(modx.search.results){modx.search.result.classList.add('open')}},close:function(){modx.search.result.classList.remove('open')},empty:function(){modx.search.result.classList.remove('open');modx.search.result.innerHTML=''}},main:{id:'main',idFrame:'mainframe',as:null,onload:function(e){w.main=e.target.contentWindow||e.target.defaultView;modx.main.tabRow.init();modx.main.stopWork();modx.main.scrollWork();w.main.document.addEventListener('click',modx.hideDropDown,false);w.main.document.addEventListener('contextmenu',modx.main.oncontextmenu,false);if(modx.config.global_tabs){w.main.document.addEventListener('click',modx.tabs,false)}w.history.replaceState(null,d.title,modx.getActionFromUrl(w.main.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.main.location.search);setTimeout('modx.tree.restoreTree()',100)},oncontextmenu:function(e){if(e.ctrlKey)return;var el=e.target;if(modx.user.role===1&&/modxtv|modxplaceholder|modxattributevalue|modxchunk|modxsnippet|modxsnippetnocache/i.test(el.className)){var id=Date.now(),name=el.innerText.replace(/[\[|\]|{|}|\*||\#|\+|?|\!|&|=|`|:]/g,''),type=el.className.replace(/cm-modx/,''),n=!!name.replace(/^\d+$/,'');if(name&&n){e.preventDefault();modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',{a:'modxTagHelper',name:name,type:type},function(r){if(r){r=JSON.parse(r);for(var k in r){if(r.hasOwnProperty(k)&&r[k].url){r[k]['onclick']='if(event.shiftKey){modx.openWindow({url:\''+r[k].url+'\'})}else{modx.popup({url:\''+r[k].url+'\',title:\''+r.header.innerHTML+'\',width:\'95%\',height:\'95%\',margin:0,hide:0,hover:0,overlay:1,overlayclose:0,position:\'center elements\',animation:0,icon:\'none\'})}'}}r=JSON.stringify(r);el.id='node'+id;el.dataset.contextmenu=r;modx.tree.showPopup(e,id,name)}})}e.preventDefault()}},tabRow:{init:function(){var row=w.main.document.querySelector('.tab-pane > .tab-row');if(row)this.build(row)},build:function(row){var rowContainer=d.createElement('div'),sel=row.querySelector('.selected');rowContainer.className='tab-row-container';row.parentNode.insertBefore(rowContainer,row);rowContainer.appendChild(row);var p=d.createElement('i');p.className='fa fa-angle-left prev disable';p.onclick=function(e){e.stopPropagation();e.preventDefault();var sel=row.querySelector('.selected');if(sel.previousSibling){sel.previousSibling.click();modx.main.tabRow.scroll(row)}};rowContainer.appendChild(p);var n=d.createElement('i');n.className='fa fa-angle-right next disable';n.onclick=function(e){e.stopPropagation();e.preventDefault();var sel=row.querySelector('.selected');if(sel.nextSibling){sel.nextSibling.click();modx.main.tabRow.scroll(row)}};rowContainer.appendChild(n);setTimeout(function(){sel=row.querySelector('.selected');modx.main.tabRow.scroll(row,sel);w.main.addEventListener('resize',function(){modx.main.tabRow.scroll(row)},false);if(sel){if(sel.previousSibling)p.classList.remove('disable');if(sel.nextSibling)n.classList.remove('disable')}},100);row.onclick=function(e){var sel=e.target.tagName==='H2'?e.target:e.target.tagName==='SPAN'?e.target.parentNode:null;if(sel){if(sel.previousSibling){this.parentNode.querySelector('i.prev').classList.remove('disable')}else{this.parentNode.querySelector('i.prev').classList.add('disable')}if(sel.nextSibling){this.parentNode.querySelector('i.next').classList.remove('disable')}else{this.parentNode.querySelector('i.next').classList.add('disable')}modx.main.tabRow.scroll(this,sel)}}},scroll:function(row,sel,a){sel=sel||row.querySelector('.selected')||row.firstChild;a=a||100;var c=0,elms=row.childNodes;for(var i=0;isel.offsetLeft){$(row).animate({scrollLeft:sel.offsetLeft-(sel.previousSibling?30:1)},a)}if(sel.offsetLeft+sel.offsetWidth>row.offsetWidth+row.scrollLeft){$(row).animate({scrollLeft:sel.offsetLeft-row.offsetWidth+sel.offsetWidth+(sel.nextSibling?30:0)},a)}if(c>row.offsetWidth){this.drag(row)}},drag:function(row){row.onmousedown=function(e){if(e.button===0){e.preventDefault();var x=e.clientX,f=row.scrollLeft;row.ownerDocument.body.focus();row.onmousemove=row.ownerDocument.onmousemove=function(e){if(Math.abs(e.clientX-x)>5){e.stopPropagation();row.scrollLeft=f-(e.clientX-x);row.ownerDocument.body.classList.add('drag')}};row.onmouseup=row.ownerDocument.onmouseup=function(e){e.stopPropagation();row.onmousemove=null;row.ownerDocument.onmousemove=null;row.ownerDocument.body.classList.remove('drag')}}}}},work:function(){d.getElementById('mainloader').classList.add('show')},stopWork:function(){d.getElementById('mainloader').classList.remove('show')},scrollWork:function(){var a=w.main.frameElement.contentWindow,b=a.location.search.substring(1)||a.location.hash.substring(2),c=localStorage.getItem('page_y')||0,f=localStorage.getItem('page_url')||b;if(((modx.getActionFromUrl(f)===modx.getActionFromUrl(b))&&(modx.main.getQueryVariable('id',f)&&modx.main.getQueryVariable('id',f)===modx.main.getQueryVariable('id',b)))||(f===b)){a.scrollTo(0,c)}a.addEventListener('scroll',function(){if(this.pageYOffset>=0){localStorage.setItem('page_y',this.pageYOffset.toString());localStorage.setItem('page_url',b)}},false)},getQueryVariable:function(a,b){var f='';if(b||typeof b==='string'){b=b.split('?');b=b[1]||b[0];b=b.split('&');for(var i=0;iMath.abs(ay)&&this.swipe){if(ax<0&&this.sidebar){if(Math.abs(ax)>h)ax=-h;tree.style.transform='translate3d('+ax+'px, 0, 0)';tree.style.WebkitTransform='translate3d('+ax+'px, 0, 0)';modx.resizer.mask.style.opacity=(0.5-0.5/-h*ax).toFixed(2);if(Math.abs(ax)>h/3){this.swipe='left'}else{this.swipe='right'}}else if(ax>0&&!this.sidebar){if(Math.abs(ax)>h)ax=h;tree.style.transform='translate3d('+ -(h-ax)+'px, 0, 0)';tree.style.WebkitTransform='translate3d('+ -(h-ax)+'px, 0, 0)';modx.resizer.mask.style.opacity=(0.5/h*ax).toFixed(2);if(Math.abs(ax)>h/3){this.swipe='right'}else{this.swipe='left'}}}},false);w.addEventListener('touchend',function(){if(this.swipe==='left'){d.body.classList.add('sidebar-closed');modx.resizer.setWidth(0)}if(this.swipe==='right'){d.body.classList.remove('sidebar-closed');modx.resizer.setWidth(h)}tree.style.cssText='';modx.resizer.mask.style.cssText=''},false)}},onMouseDown:function(e){e=e||w.event;modx.resizer.dragElement=e.target!==null?e.target:e.srcElement;if((e.buttons===1||e.button===0)&&modx.resizer.dragElement.id===modx.resizer.id){modx.resizer.oldZIndex=modx.resizer.dragElement.style.zIndex;modx.resizer.dragElement.style.zIndex=modx.resizer.newZIndex;modx.resizer.dragElement.style.background=modx.resizer.background;localStorage.setItem('MODX_widthSideBar',modx.resizer.dragElement.offsetLeft>0?modx.resizer.dragElement.offsetLeft:0);d.body.appendChild(modx.resizer.mask);d.onmousemove=modx.resizer.onMouseMove;d.body.focus();d.body.classList.add('resizer_move');d.onselectstart=function(){return false};modx.resizer.dragElement.ondragstart=function(){return false};return false}},onMouseMove:function(e){e=e||w.event;if(e.clientX>0){modx.resizer.left=e.clientX}else{modx.resizer.left=0}modx.resizer.dragElement.style.left=modx.pxToRem(modx.resizer.left)+'rem';d.getElementById('tree').style.width=modx.pxToRem(modx.resizer.left)+'rem';d.getElementById('main').style.left=modx.pxToRem(modx.resizer.left)+'rem';if(e.clientX<-2||e.clientY<-2){modx.resizer.onMouseUp(e)}},onMouseUp:function(e){if(modx.resizer.dragElement!==null&&e.button===0&&modx.resizer.dragElement.id===modx.resizer.id){if(e.clientX>0){d.body.classList.remove('sidebar-closed');modx.resizer.left=e.clientX}else{d.body.classList.add('sidebar-closed');modx.resizer.left=0}d.cookie='MODX_widthSideBar='+modx.pxToRem(modx.resizer.left);modx.resizer.dragElement.style.zIndex=modx.resizer.oldZIndex;modx.resizer.dragElement.style.background='';modx.resizer.dragElement.ondragstart=null;modx.resizer.dragElement=null;d.body.classList.remove('resizer_move');d.body.removeChild(modx.resizer.mask);d.onmousemove=null;d.onselectstart=null}},toggle:function(){if(modx.isMobile||w.innerWidth<=modx.minWidth){if(d.body.classList.contains('sidebar-closed')){d.body.classList.remove('sidebar-closed');localStorage.setItem('MODX_widthSideBar',0);d.cookie='MODX_widthSideBar='+modx.pxToRem(parseInt(d.getElementById('tree').offsetWidth))}else{localStorage.setItem('MODX_widthSideBar',parseInt(d.getElementById('tree').offsetWidth));d.body.classList.add('sidebar-closed');d.cookie='MODX_widthSideBar=0'}}else{var p=d.getElementById('tree').offsetWidth!==0?0:parseInt(localStorage.getItem('MODX_widthSideBar'))?parseInt(localStorage.getItem('MODX_widthSideBar')):modx.config.tree_width;modx.resizer.setWidth(p)}},setWidth:function(a){if(a>0){localStorage.setItem('MODX_widthSideBar',0);d.body.classList.remove('sidebar-closed')}else{localStorage.setItem('MODX_widthSideBar',parseInt(d.getElementById('tree').offsetWidth));d.body.classList.add('sidebar-closed')}d.cookie='MODX_widthSideBar='+modx.pxToRem(a);d.getElementById('tree').style.width=modx.pxToRem(a)+'rem';d.getElementById('resizer').style.left=modx.pxToRem(a)+'rem';d.getElementById('main').style.left=modx.pxToRem(a)+'rem'},setDefaultWidth:function(){modx.resizer.setWidth(modx.remToPx(modx.config.tree_width))}},tree:{ctx:null,rpcNode:null,itemToChange:'',selectedObjectName:null,selectedObject:0,selectedObjectDeleted:0,selectedObjectUrl:'',drag:false,deleted:[],init:function(){this.restoreTree()},draggable:function(){if(modx.permission.dragndropdocintree){var els=d.querySelectorAll('#treeRoot a:not(.empty)');for(var i=0;i-1:true;modx.tree.itemToChange=this.dataset.id||this.parentNode.id.replace('node','');modx.tree.selectedObjectName=this.dataset.titleEsc;if(draggable){this.parentNode.draggable=true;this.parentNode.ondragstart=modx.tree.ondragstart}else{this.parentNode.draggable=false;this.parentNode.ondragstart=function(){return false}}}},ondragstart:function(e){e.dataTransfer.effectAllowed='all';e.dataTransfer.dropEffect='all';e.dataTransfer.setData('text',this.id.substr(4))},ondragenter:function(e){if(d.getElementById('node'+modx.tree.itemToChange)===(this.parentNode.closest('#node'+modx.tree.itemToChange)||this.parentNode)){this.parentNode.className='';e.dataTransfer.effectAllowed='none';e.dataTransfer.dropEffect='none';modx.tree.drag=false}else{this.parentNode.className='dragenter';e.dataTransfer.effectAllowed='copy';e.dataTransfer.dropEffect='copy';modx.tree.drag=true}e.preventDefault()},ondragover:function(e){if(modx.tree.drag){var a=e.clientY;var b=parseInt(this.getBoundingClientRect().top);var c=a-b;if(c>this.offsetHeight/1.51){this.parentNode.classList.add('dragafter');this.parentNode.classList.remove('dragbefore');this.parentNode.classList.remove('dragenter');e.dataTransfer.effectAllowed='link';e.dataTransfer.dropEffect='link'}else if(c'}if(this.nextSibling){if(this.nextSibling.innerHTML){this.nextSibling.appendChild(el)}else{el.parentNode.removeChild(el)}els=this.parentNode.lastChild.children;for(i=0;i'}this.parentNode.parentNode.insertBefore(el,this.parentNode.nextSibling);els=this.parentNode.parentNode.children;for(i=0;i'}this.parentNode.parentNode.insertBefore(el,this.parentNode);els=this.parentNode.parentNode.children;for(i=0;i-1:true)){alert(modx.lang.error_no_privileges);modx.tree.restoreTree();return}modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',{a:'movedocument',id:id,parent:parent,menuindex:menuindex},function(r){if(r.errors)alert(r.errors);modx.tree.restoreTree()},'json');var b=w.main.frameElement.contentWindow.location.search.substr(1);if(modx.getActionFromUrl(b,27)&&parseInt(modx.main.getQueryVariable('id',b))===parseInt(id)){var index=menuindex.indexOf(id),elMenuIndex=w.main.document.querySelector('#documentPane input[name=menuindex]'),elParent=w.main.document.querySelector('#documentPane input[name=parent]'),elParentName=w.main.document.querySelector('#documentPane #parentName');if(elMenuIndex&&index>=0)elMenuIndex.value=index;if(elParent&&elParentName){elParent.value=parent;elParentName.innerHTML=parent+' ('+d.querySelector('#node'+parent+' > a').dataset.titleEsc+')'}}},toggleTheme:function(){var a,b=1,myCodeMirrors=w.main.myCodeMirrors,key;if(typeof localStorage['MODX_themeMode']==='undefined'){localStorage['MODX_themeMode']=modx.config.theme_mode}if(modx.thememodes[parseInt(localStorage['MODX_themeMode'])+1]){b=parseInt(localStorage['MODX_themeMode'])+1}a=modx.thememodes[b];for(key in modx.thememodes){if(modx.thememodes[key]){d.body.classList.remove(modx.thememodes[key]);w.main.document.body.classList.remove(modx.thememodes[key])}}d.body.classList.add(a);w.main.document.body.classList.add(a);d.cookie='MODX_themeMode='+b;localStorage['MODX_themeMode']=b;if(typeof myCodeMirrors!=='undefined'){for(key in myCodeMirrors){if(myCodeMirrors.hasOwnProperty(key)){if(~a.indexOf('dark')){w.main.document.getElementsByName(key)[0].nextElementSibling.classList.add('cm-s-'+myCodeMirrors[key].options.darktheme);w.main.document.getElementsByName(key)[0].nextElementSibling.classList.remove('cm-s-'+myCodeMirrors[key].options.defaulttheme)}else{w.main.document.getElementsByName(key)[0].nextElementSibling.classList.remove('cm-s-'+myCodeMirrors[key].options.darktheme);w.main.document.getElementsByName(key)[0].nextElementSibling.classList.add('cm-s-'+myCodeMirrors[key].options.defaulttheme)}}}}},toggleNode:function(e,id){e=e||w.event;if(e.ctrlKey)return;e.stopPropagation();var el=d.getElementById('node'+id).firstChild;this.rpcNode=el.nextSibling;var toggle=el.querySelector('.toggle'),icon=el.querySelector('.icon');if(this.rpcNode.innerHTML===''){if(toggle)toggle.innerHTML=el.dataset.iconCollapsed;icon.innerHTML=el.dataset.iconFolderOpen;var rpcNodeText=this.rpcNode.innerHTML,loadText=modx.lang.loading_doc_tree;modx.openedArray[id]=1;if(rpcNodeText===''||rpcNodeText.indexOf(loadText)>0){var folderState=this.getFolderState();d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent='+el.dataset.indent+'&parent='+id+'&expandAll='+el.dataset.expandall+folderState,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})}this.saveFolderState()}else{if(toggle)toggle.innerHTML=el.dataset.iconExpanded;icon.innerHTML=el.dataset.iconFolderClose;delete modx.openedArray[id];this.rpcNode.style.overflow='hidden';$(this.rpcNode.firstChild).animate({marginTop:-this.rpcNode.offsetHeight+'px'},100,function(){this.parentNode.innerHTML=''});this.saveFolderState()}e.preventDefault()},rpcLoadData:function(a){if(this.rpcNode!==null){var el;this.rpcNode.innerHTML=typeof a==='object'?a.responseText:a;this.rpcNode.loaded=true;if(this.rpcNode.firstChild.tagName==='DIV'){if(this.rpcNode.id==='treeRoot'){el=d.getElementById('binFull');if(el){this.showBin(true)}else{this.showBin(false)}}else{this.rpcNode.style.overflow='hidden';this.rpcNode.firstElementChild.style.marginTop=-this.rpcNode.offsetHeight+'px';$(this.rpcNode.firstChild).animate({marginTop:0},100)}d.getElementById('treeloader').classList.remove('visible')}else{el=d.getElementById('loginfrm');if(el){this.rpcNode.parentNode.removeChild(this.rpcNode);w.location.href=modx.MODX_MANAGER_URL}}}},treeAction:function(e,id,title){if(e.ctrlKey)return;var el=d.getElementById('node'+id).firstChild,treepageclick=el.dataset.treepageclick,showchildren=parseInt(el.dataset.showchildren),openfolder=parseInt(el.dataset.openfolder);title=title||el.dataset&&el.dataset.titleEsc;if(tree.ca==='move'){try{this.setSelectedByContext(id);w.main.setMoveValue(id,title)}catch(oException){alert(modx.lang.unable_set_parent)}}if(tree.ca==='open'||tree.ca===''){if(id===0){href='?a=2'}else{var href='';if(!isNaN(treepageclick)&&isFinite(treepageclick)){href='?a='+treepageclick+'&r=1&id='+id+(openfolder===0?this.getFolderState():'')}else{href=treepageclick}if(openfolder===2){if(showchildren!==1){href=''}this.toggleNode(e,id)}}if(href){if(e.shiftKey){w.getSelection().removeAllRanges();modx.openWindow(href);this.restoreTree()}else{modx.tabs({url:modx.MODX_MANAGER_URL+href,title:title+'('+id+')'});if(modx.isMobile)modx.resizer.toggle()}}this.itemToChange=id;this.setSelected(id)}if(tree.ca==='parent'){try{this.setSelectedByContext(id);w.main.setParent(id,title)}catch(oException){alert(modx.lang.unable_set_parent)}}if(tree.ca==='link'){try{this.setSelectedByContext(id);w.main.setLink(id)}catch(oException){alert(modx.lang.unable_set_link)}}e.preventDefault()},showPopup:function(e,id,title){if(e.ctrlKey)return;e.preventDefault();var tree=d.getElementById('tree'),el=d.getElementById('node'+id)||e.target,x=0,y=0;if(el.firstChild&&el.firstChild.dataset&&el.firstChild.dataset.contextmenu){el=el.firstChild}if(el){if(el.dataset.contextmenu){e.target.dataset.toggle='#contextmenu';modx.hideDropDown(e);this.ctx=d.createElement('div');this.ctx.id='contextmenu';this.ctx.className='dropdown-menu';d.getElementById(modx.frameset).appendChild(this.ctx);this.setSelectedByContext(id);var dataJson=JSON.parse(el.dataset.contextmenu);for(var key in dataJson){if(dataJson.hasOwnProperty(key)){var item=d.createElement('div');for(var k in dataJson[key]){if(dataJson[key].hasOwnProperty(k)){if(k.substring(0,2)==='on'){var onEvent=dataJson[key][k];item[k]=function(onEvent){return function(event){eval(onEvent)}}(onEvent)}else{item[k]=dataJson[key][k]}}}if(key.indexOf('header')===0)item.className+=' menuHeader';if(key.indexOf('item')===0)item.className+=' menuLink';if(key.indexOf('seperator')===0||key.indexOf('separator')===0)item.className+=' seperator separator';this.ctx.appendChild(item)}}x=e.clientX>0?e.clientX:e.pageX;y=e.clientY>0?e.clientY:e.pageY;e.view.position=e.view.frameElement?e.view.frameElement.getBoundingClientRect():e.target.offsetParent.getBoundingClientRect();if(e.view.frameElement){x+=e.view.position.left;y+=e.view.frameElement.offsetParent.offsetTop}else{if(e.target.parentNode.parentNode.classList.contains('node')){x+=50}}if(x>e.view.position.width){x=e.view.position.width-this.ctx.offsetWidth}if(y+this.ctx.offsetHeight/2>e.view.position.height){y=e.view.position.height-this.ctx.offsetHeight-5}else if(y-this.ctx.offsetHeight/20?e.clientX:e.pageX;y=e.clientY>0?e.clientY:e.pageY;if(y+ctx.offsetHeight/2>bodyHeight){y=bodyHeight-ctx.offsetHeight-5}else if(y-ctx.offsetHeight/230){this.selectedObjectName=this.selectedObjectName.substr(0,30)+'...'}var f=d.getElementById('nameHolder');f.innerHTML=this.selectedObjectName;el.style.left=a+(modx.config.textdir?'-190':'')+'px';el.style.top=b+'px';el.classList.add('show')},menuHandler:function(a){switch(a){case 1:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=3&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 2:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=27&r=1&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 3:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=4&pid='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 4:if(this.selectedObjectDeleted){alert('"'+this.selectedObjectName+'" '+modx.lang.already_deleted)}else if(confirm('"'+this.selectedObjectName+'"\n\n'+modx.lang.confirm_delete_resource)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=6&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 5:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=51&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 6:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=72&pid='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 7:if(confirm(modx.lang.confirm_resource_duplicate)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=94&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 8:if(d.getElementById('node'+this.itemToChange).firstChild.dataset.deleted){if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_undelete)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=63&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}}else{alert('"'+this.selectedObjectName+'"'+modx.lang.not_deleted)}break;case 9:if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_publish)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=61&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 10:if(this.itemToChange!==modx.config.site_start){if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_unpublish)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=62&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}}else{alert('Document is linked to site_start variable and cannot be unpublished!')}break;case 11:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=56&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 12:w.open(d.getElementById('node'+this.itemToChange).firstChild.dataset.href,'previeWin');break;default:alert('Unknown operation command.')}},setSelected:function(a){var el=d.querySelector('#tree .current');if(el)el.classList.remove('current');if(a){if(typeof a==='object'){a.classList.add('current')}else{el=d.querySelector('#node'+a+'>.node')||d.getElementById('node'+a);if(el)el.classList.add('current')}}},setActiveFromContextMenu:function(a){var el=d.querySelector('#node'+a+'>.node');if(el)this.setSelected(el)},setSelectedByContext:function(a){var el=d.querySelector('#treeRoot .selected');if(el)el.classList.remove('selected');el=d.querySelector('#node'+a+'>.node');if(el)el.classList.add('selected')},setItemToChange:function(){var a=w.main.document&&(w.main.document.URL||w.main.document.location.search),b=modx.getActionFromUrl(a);if(a&&modx.typesactions[b]){this.itemToChange=(modx.typesactions[b]===7?'':modx.typesactions[b]+'_')+parseInt(modx.main.getQueryVariable('id',a))}else{this.itemToChange=''}this.setSelected(this.itemToChange)},restoreTree:function(){if(d.getElementById('treeRoot')){d.getElementById('treeloader').classList.add('visible');this.setItemToChange();this.rpcNode=d.getElementById('treeRoot');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=2&id='+this.itemToChange,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})}},expandTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=1&id='+this.itemToChange,function(r){modx.tree.rpcLoadData(r);modx.tree.saveFolderState();modx.tree.draggable()})},collapseTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=0&id='+this.itemToChange,function(r){modx.openedArray=[];modx.tree.saveFolderState();modx.tree.rpcLoadData(r);modx.tree.draggable()})},updateTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');var a=d.sortFrm;var b='a=1&f=nodes&indent=1&parent=0&expandAll=2&dt='+a.dt.value+'&tree_sortby='+a.sortby.value+'&tree_sortdir='+a.sortdir.value+'&tree_nodename='+a.nodename.value+'&id='+this.itemToChange+'&showonlyfolders='+a.showonlyfolders.value;modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',b,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})},getFolderState:function(){var a;if(modx.openedArray!==[0]){a='&opened=';for(var key in modx.openedArray){if(modx.openedArray[key]){a+=key+'|'}}}else{a='&opened='}return a},saveFolderState:function(){modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&savestateonly=1'+this.getFolderState())},showSorter:function(e){e=e||w.event;var el=d.getElementById('floater');e.target.dataset.toggle='#floater';el.classList.toggle('show');el.onclick=function(e){e.stopPropagation()}},emptyTrash:function(){if(confirm(modx.lang.confirm_empty_trash)===true){modx.get(modx.MODX_MANAGER_URL+'?a=64',function(){modx.tabsClose(modx.tree.deleted);modx.tree.deleted=[];modx.tree.restoreTree()})}},showBin:function(a){var el=d.getElementById('treeMenu_emptytrash');if(el){if(a){el.title=modx.lang.empty_recycle_bin;el.classList.remove('disabled');el.innerHTML=modx.style.empty_recycle_bin;el.onclick=function(){modx.tree.emptyTrash()};var els=d.getElementById('tree').querySelectorAll('.deleted');for(var i=0;i0){if(el){el.innerHTML=c[0];el.style.display='block'}}else{if(el)el.style.display='none'}if(c[1]>0){el=d.getElementById('newMail');if(el){el.innerHTML=''+modx.style.email+modx.lang.inbox+' ('+c[0]+' / '+c[1]+')';el.style.display='block'}}if(modx.config.mail_check_timeperiod>0)setTimeout('modx.updateMail(true)',1000*modx.config.mail_check_timeperiod)})}}catch(oException){setTimeout('modx.updateMail(true)',1000*modx.config.mail_check_timeperiod)}},openWindow:function(a){if(typeof a!=='object'){a={'url':a}}if(!a.width)a.width=parseInt(w.innerWidth*0.9)+'px';if(!a.height)a.height=parseInt(w.innerHeight*0.8)+'px';if(!a.left)a.left=parseInt(w.innerWidth*0.05)+'px';if(!a.top)a.top=parseInt(w.innerHeight*0.1)+'px';if(!a.title)a.title=Math.floor((Math.random()*999999)+1);if(a.url){if(this.plugins.EVOmodal===1){top.EVO.modal.show(a)}else{w.open(a.url,a.title,'width='+a.width+',height='+a.height+',top='+a.top+',left='+a.left+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no')}}},tabsClose:function(a){if(modx.config.global_tabs&&a){for(var k in a){if(a.hasOwnProperty(k)){var el=d.getElementById(a[k]);if(el){el.firstElementChild.contentWindow.documentDirty=false;el.close()}}}}},tabs:function(a){function Tabs(a){var s=this;this.url=a.url;this.title=a.title||'';this.name=a.name||'';this.timer=null;this.olduid='';this.closeactions=[6,61,62,63,94];this.reload=typeof a.reload!=='undefined'?a.reload:1;this.action=modx.getActionFromUrl(a.url);this.uid=modx.getActionFromUrl(a.url,2)?'home':modx.urlToUid(a.url);this.page=d.getElementById('evo-tab-page-'+this.uid);this.row=d.getElementsByClassName('evo-tab-row')[0].firstElementChild;this.tab=d.getElementById('evo-tab-'+this.uid);if(this.page){if(this.uid==='home'){if(this.reload){this.page.firstElementChild.src=this.url;this.show()}else{this.reload=1;if(this.tab.onclick===null){this.tab.onclick=function(e){s.select.call(s,e,this)}}this.tab.show=function(e){s.show.call(s,e)};modx.tabs.selected=this.tab}}else{this.show();if(~this.closeactions.indexOf(this.action)){this.setDocPublished();modx.get(this.url,function(){modx.tree.restoreTree()})}}}else if(~this.closeactions.indexOf(this.action)){modx.get(this.url,function(){modx.tree.restoreTree()})}else{this.create()}}Tabs.prototype={create:function(){var s=this;modx.main.work();modx.tabs.selected=this.row.querySelector('.selected');if(modx.tabs.selected){d.getElementById(modx.tabs.selected.id.replace('tab','tab-page')).classList.remove('show');modx.tabs.selected.classList.remove('selected')}this.page=d.createElement('div');this.page.id='evo-tab-page-'+this.uid;this.page.className='evo-tab-page show';this.page.innerHTML='';d.getElementById('main').appendChild(this.page);console.time('load-tab');this.page.firstElementChild.onload=function(e){s.onload.call(s,e);console.timeEnd('load-tab')};this.tab=d.createElement('h2');this.tab.id='evo-tab-'+this.uid;this.tab.className='tab selected';this.icon='';if(!/'}this.tab.innerHTML=''+this.icon+this.title+'×';this.row.appendChild(this.tab);this.tab.onclick=function(e){s.select.call(s,e,this)};this.tab.close=function(e){s.close.call(s,e)};this.tab.show=function(e){s.show.call(s,e)};this.page.close=function(e){s.close.call(s,e)}},onload:function(e){var s=this;w.main=e.target.contentWindow||e.target.defaultView;this.url=w.main.location.search||w.location.hash.substring(1);this.olduid=this.uid;this.uid=modx.urlToUid(this.url);if(!!w.main.__alertQuit){w.main.alert=function(a){};var message=w.main.document.body.innerHTML;w.main.document.body.innerHTML='';history.pushState(null,d.title,modx.getActionFromUrl(w.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.location.search);w.onpopstate=function(){history.go(1)};modx.popup({type:'warning',title:'MODX :: Alert',position:'top center alertQuit',content:message,wrap:'body'});modx.getLockedElements(modx.getActionFromUrl(this.url),modx.main.getQueryVariable('id',this.url),function(data){if(!!data){s.page.close();modx.tree.restoreTree()}else{w.main.location.href=modx.MODX_MANAGER_URL+s.url;w.history.replaceState(null,d.title,modx.getActionFromUrl(s.url,2)?modx.MODX_MANAGER_URL:'#'+s.url)}})}else{if(modx.getActionFromUrl(this.url,2)){this.close(e)}else if(this.olduid!==this.uid&&d.getElementById('evo-tab-'+this.uid)){this.close(e);d.getElementById('evo-tab-'+this.uid).show()}else{this.title=w.main.document.body.querySelectorAll('h1')[0]&&w.main.document.body.querySelectorAll('h1')[0].innerHTML||this.title;if(this.title&&this.uid!=='home'){this.tab.innerHTML=''+this.title+'×'}this.page.id='evo-tab-page-'+this.uid;this.tab.id='evo-tab-'+this.uid;this.tab.classList.remove('changed');this.show();modx.main.onload(e);w.main.document.addEventListener('click',function a(e){if(typeof e.view.documentDirty!=='undefined'&&e.view.documentDirty&&!s.tab.classList.contains('changed')){s.tab.classList.add('changed');this.removeEventListener(e.type,a,false)}},false);w.main.document.addEventListener('keyup',function a(e){if(typeof e.view.documentDirty!=='undefined'&&e.view.documentDirty&&!s.tab.classList.contains('changed')){s.tab.classList.add('changed');this.removeEventListener(e.type,a,false)}},false)}}},show:function(){var s=this;modx.tabs.selected=this.row.querySelector('.selected');if(modx.tabs.selected&&modx.tabs.selected!==this.tab){d.getElementById(modx.tabs.selected.id.replace('tab','tab-page')).classList.remove('show');modx.tabs.selected.classList.remove('selected')}this.page.classList.add('show');this.tab.classList.add('selected');modx.tabs.selected=this.tab;w.main=this.page.firstElementChild.contentWindow;w.history.replaceState(null,w.main.document.title,modx.getActionFromUrl(w.main.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.main.location.search);modx.tree.setItemToChange();modx.main.tabRow.scroll(this.row,this.tab,350)},close:function(e){var documentDirty=this.page.firstElementChild.contentWindow.documentDirty;var checkDirt=!!this.page.firstElementChild.contentWindow.checkDirt;if(documentDirty&&checkDirt&&confirm(this.page.firstElementChild.contentWindow.checkDirt(e))||!documentDirty){modx.tabs.selected=this.tab.classList.contains('selected')?this.tab.previousElementSibling:this.row.querySelector('.selected');this.page.parentNode.removeChild(this.page);this.row.removeChild(this.tab);modx.tabs.selected.show()}},select:function(e){if(e.target.className==='tab-close'){this.close(e)}else if(modx.tabs.selected===this.tab){var s=this;if(this.timer){clearTimeout(this.timer);this.timer=null;w.main.location.reload()}else{this.timer=setTimeout(function(){s.timer=null},250)}}else{this.show()}},setDocPublished:function(){var el=w.main.document.getElementsByName('publishedcheck')[0];if(el){el.checked=this.action===61;w.main.document.getElementsByName('published')[0].value=+el.checked}if(modx.getActionFromUrl(w.main.location.search,3)){w.main.location.reload()}}};if(modx.config.global_tabs){if(typeof a.currentTarget!=='undefined'){var e=a;if(e.button===0&&e.target&&(e.target.tagName==='A'&&e.target.target==='main'||(e.target.parentNode&&e.target.parentNode.tagName==='A'&&e.target.parentNode.target==='main'))){a=e.target.tagName==='A'&&e.target||e.target.parentNode.tagName==='A'&&e.target.parentNode;if(e.shiftKey){modx.openWindow({url:a.href})}else{modx.tabs({url:a.href,title:a.innerHTML})}e.preventDefault()}}else{return new Tabs(a)}}else if(a.url){if(w.main){w.main.frameElement.src=a.url}else{modx.openWindow(a.url)}}},popup:function(a){if(typeof a==='object'&&(a.url||a.content||a.text)){var o={addclass:'',animation:'fade',content:a.content||a.text||'',clickclose:0,closeall:0,data:'',dataType:'document',delay:5000,draggable:!1,event:null,height:'auto',hide:1,hover:1,icon:'',iframe:'iframe',margin:'.5rem',maxheight:'',method:'GET',overlay:0,overlayclose:0,position:'center',resize:!1,selector:'',showclose:1,target:'main',uid:'',type:'default',title:'',url:'',width:'20rem',wrap:w.main.document.body,zIndex:10500,w:null,show:function(){if(~o.position.indexOf('center')){if(o.event){o.el.style.left=o.event.clientX+o.mt+'px';o.el.style.bottom=o.w.innerHeight-o.el.offsetHeight-o.event.clientY+o.mt+'px'}else{o.el.style.left=/(%)/.test(o.width)?(100-parseInt(o.width))/2-o.mt/(o.w.innerWidth/100)+'%':(o.w.innerWidth-o.el.offsetWidth)/2-o.mt+'px';o.el.style.bottom=/(%)/.test(o.height)?(100-parseInt(o.height))/2-o.mt/(o.w.innerHeight/100)+'%':(o.w.innerHeight-o.el.offsetHeight-o.wrap.offsetTop)/2-o.mt+'px'}}if(~o.position.indexOf('left')){o.el.style.left=0}if(~o.position.indexOf('right')){o.el.style.right=0}else{o.el.style.right='auto'}if(~o.position.indexOf('top')){o.el.style.top=0;o.el.style.bottom=''}else{o.el.style.top='auto'}if(~o.position.indexOf('bottom')){o.el.style.bottom=0}o.calc();o.el.className+=' in';if(o.showclose){o.el.querySelector('.close').onclick=o.close}if(o.hide){o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);o.close()},o.delay)}if(o.hover){o.el.onmouseenter=function(){clearTimeout(o.el.timer)};o.el.onmouseleave=o.close}if(o.overlayclose&&o.o){o.o.onclick=o.close}if(o.clickclose){o.el.onclick=o.close}if(o.draggable){modx.dragging(o.el,{wrap:o.wrap,resize:o.resize})}},close:function(e){o.event=e||o.event||w.event;if(o.url&&o.iframe==='iframe'){var els=o.wrap.ownerDocument.querySelectorAll('.'+o.className+'.in');if(els){var documentDirty=o.el.lastElementChild.firstElementChild.contentWindow.documentDirty;if(documentDirty&&confirm(o.el.lastElementChild.firstElementChild.contentWindow.checkDirt(o.event))||!documentDirty){o.el.classList.remove('in');if(!o.animation){o.el.classList.remove('show')}o.calc(1);if(o.o&&o.o.parentNode){o.o.parentNode.removeChild(o.o);o.wrap.style.overflow=''}o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);if(o.el.parentNode){o.el.parentNode.removeChild(o.el)}},200)}}}else{o.el.classList.remove('in');if(!o.animation){o.el.classList.remove('show')}o.calc(1);if(o.o&&o.o.parentNode){o.o.parentNode.removeChild(o.o);o.wrap.style.overflow=''}o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);if(o.el.parentNode){o.el.parentNode.removeChild(o.el)}},200)}if(typeof o.onclose==='function'){o.onclose(e,o.el)}},calc:function(f){var els=o.wrap.ownerDocument.querySelectorAll('.'+o.className+'.in[data-position="'+o.el.dataset.position+'"]');if(els&&els.length){o.els=[];for(var i=0;i×'}if(o.title){o.header=document.createElement('div');if(o.icon!=='none'){o.header.innerHTML+=''}o.header.innerHTML+=o.title;o.header.className='evo-popup-header';o.el.appendChild(o.header)}o.el.innerHTML+='
      ';o.wrap.appendChild(o.el);o.mt=parseFloat(getComputedStyle(o.el).marginTop);if(o.maxheight){o.maxheight=/(%)/.test(o.maxheight)?(o.w.innerHeight-o.el.offsetHeight-o.mt)/100*parseInt(o.maxheight):o.maxheight;o.el.lastChild.style.overflowY='auto';o.el.lastChild.style.maxHeight=o.maxheight+'px'}if(o.url){o.draggable=1;if(o.iframe==='iframe'){o.resize=1;o.uid=modx.urlToUid(a.url);o.el.className+=' '+o.addclass+' '+o.className+'-iframe';o.el.id='evo-popup-'+o.uid;d.getElementById('mainloader').className='show';o.frame=d.createElement('iframe');o.frame.width='100%';o.frame.height='100%';o.frame.frameBorder='0';o.frame.src=o.url;o.frame.onload=function(e){e.target.contentWindow.opener=o.w;a.url=e.target.contentWindow.location.href;o.uid=modx.urlToUid(a.url);o.event=e;if(!!e.target.contentWindow.__alertQuit){modx.popup({type:'warning',title:'MODX :: Alert',position:'top center alertQuit',content:e.target.contentWindow.document.body.querySelector('p').innerHTML});e.target.contentWindow.document.body.innerHTML='';e.target.contentWindow.alert=function(){}}else{if(modx.getActionFromUrl(a.url,2)||o.wrap.querySelectorAll('#evo-popup-'+o.uid).length>1){o.el.close()}else{if(e.target.contentDocument.querySelectorAll('h1')[0]){a.title=e.target.contentDocument.querySelectorAll('h1')[0].innerHTML}else if(e.target.contentDocument.title){a.title=e.target.contentDocument.title}if(o.header){e.target.offsetParent.offsetParent.getElementsByClassName(o.header.className)[0].innerHTML=a.title}e.target.offsetParent.offsetParent.id='evo-popup-'+o.uid;e.target.offsetParent.offsetParent.classList.remove('changed')}}e.target.contentWindow.close=o.close;modx.main.stopWork()};o.el.lastChild.appendChild(o.frame);o.show()}else{var xhr=new XMLHttpRequest();xhr.open(o.method,o.url,true);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');xhr.setRequestHeader('X-REQUESTED-WITH','XMLHttpRequest');if(o.dataType){xhr.responseType=o.dataType}xhr.onload=function(){if(this.readyState===4){o.el.className+=' '+o.className+'-ajax';if(o.dataType==='document'){if(o.selector){var r=this.response.documentElement.querySelector(o.selector);if(r){o.el.lastChild.innerHTML+=r.innerHTML}}else{o.el.lastChild.innerHTML+=this.response.body.innerHTML}}else{o.el.lastChild.innerHTML+=this.response}o.show()}};xhr.send(o.data)}}else{o.el.lastChild.innerHTML+=o.content;o.show()}}return o}},getWindowDimension:function(){var a=0,b=0,c=d.documentElement,e=d.body;if(typeof(w.innerWidth)==='number'){a=w.innerWidth;b=w.innerHeight}else if(c&&(c.clientWidth||c.clientHeight)){a=c.clientWidth;b=c.clientHeight}else if(e&&(e.clientWidth||e.clientHeight)){a=e.clientWidth;b=e.clientHeight}return{'width':a,'height':b}},hideDropDown:function(e){e=e||w.event||w.main.event;if(tree.ca==='open'||tree.ca===''){modx.tree.setSelectedByContext()}if(modx.tree.ctx!==null){d.getElementById(modx.frameset).removeChild(modx.tree.ctx);modx.tree.ctx=null}if(!/dropdown\-item/.test(e.target.className)){var els=d.querySelectorAll('.dropdown.show'),n=null,t=e.target||e.target.parentNode,i;if(typeof t.dataset.toggle!=='undefined'){n=d.querySelector(t.dataset.toggle)}else if(t.classList.contains('dropdown-toggle')){n=t.offsetParent}for(i=0;i';if(this.classDrag)this.el.classList.add(this.classDrag);if(this.classResize)this.el.classList.add(this.classResize);this.el.insertBefore(this.borders,this.el.firstChild);if(this.handler&&this.el.getElementsByClassName(this.handler)[0]){this.handler=this.el.getElementsByClassName(this.handler)[0];this.handlerHeight=this.handler.offsetHeight}this.el.onmousedown=function(e){s.mousedown(e)};this.el.ontouchstart=function(e){s.mousedown(e.changedTouches[0])};this.wrap.addEventListener('mousemove',function(e){s.calc(e)},false);this.wrap.addEventListener('touchmove',function(e){s.calc(e.changedTouches[0])},false)};this.dragging.init.prototype={mousedown:function(e){if(e.target.classList.contains('close')){return}e=document.all?window.event:e;var s=this,x=document.all?window.event.clientX:e.clientX,y=document.all?window.event.clientY:e.clientY,style=w.getComputedStyle(this.el);this.elmX=(x-this.el.offsetLeft+parseInt(style.marginLeft));this.elmY=(y-this.el.offsetTop+parseInt(style.marginTop));this.el.position=this.el.getBoundingClientRect();this.el.style.position='fixed';this.el.style.transitionDuration='0s';this.el.style.webkitTransitionDuration='0s';this.el.style.left=this.el.offsetLeft-parseInt(style.marginLeft)+'px';this.el.style.top=this.el.offsetTop-parseInt(style.marginTop)+'px';this.el.style.right='auto';this.el.style.bottom='auto';this.el.style.width=this.el.position.width+'px';this.el.style.height=this.el.position.height+'px';if(e.target.parentNode===this.borders){this.isresize=this.resize;this.el.classList.add('is-resize')}else{if(!this.handler||(this.handler&&e.target===this.handler)){this.isdrag=true;this.el.classList.add('is-drag')}}if(typeof this.start==='function'){this.onstart(e,this.el)}if(e.preventDefault){e.preventDefault()}else{document.onselectstart=function(){return false}}this.wrap.onmousemove=function(e){s.mousemove(e)};this.wrap.ontouchmove=function(e){s.mousemove(e.changedTouches[0]);e.stopPropagation()};this.wrap.onmouseup=function(e){s.mouseup(e)};this.wrap.ontouchend=function(e){s.mouseup(e.changedTouches[0]);e.stopPropagation()}},mousemove:function(e){var x=document.all?window.event.clientX:e.clientX,y=document.all?window.event.clientY:e.clientY;if(this.isresize){if(this.onRight)this.el.style.width=Math.max(x-this.el.position.left+(this.el.position.width-this.x),this.minWidth)+'px';if(this.onBottom)this.el.style.height=Math.max(y-this.el.position.top+(this.el.position.height-this.y),this.minHeight)+'px';if(this.onLeft){this.width=Math.max(this.el.position.left-x+this.el.position.width+this.x,this.minWidth);if(this.width>this.minWidth){this.el.style.width=this.width+'px';this.el.style.left=x-this.elmX+'px'}}if(this.onTop){var currentHeight=Math.max(this.el.position.top-y+this.el.position.height+this.y,this.minHeight);if(currentHeight>this.minHeight){this.el.style.height=currentHeight+'px';this.el.style.top=y-this.elmY+'px'}}if(typeof this.onresize==='function'){this.onresize(e,this.el)}}else if(this.isdrag){this.el.style.opacity=this.opacity;this.el.style.left=x-this.elmX+'px';this.el.style.top=y-this.elmY+'px';if(typeof this.drag==='function'){this.ondrag(e,this.el)}}},mouseup:function(e){if(this.isdrag||this.isresize){this.el.classList.remove('is-resize');this.el.classList.remove('is-drag');this.el.style.opacity='';this.el.style.transitionDuration='';this.el.style.webkitTransitionDuration='';this.el.position=this.el.getBoundingClientRect();this.isdrag=false;this.isresize=false;this.wrap.onmousemove=null;this.wrap.onselectstart=null;if(typeof this.stop==='function'){this.onstop(e,this.el)}}},calc:function(e){if(this.isresize||this.isdrag){return}this.x=e.clientX-this.el.offsetLeft;this.y=e.clientY-this.el.offsetTop;if(this.resize){this.onTop=this.y=this.el.offsetWidth-this.border;this.onBottom=this.y>=this.el.offsetHeight-this.border;if(this.onRight&&this.onBottom||this.onLeft&&this.onTop){this.el.style.cursor='nwse-resize'}else if(this.onRight&&this.onTop||this.onBottom&&this.onLeft){this.el.style.cursor='nesw-resize'}else if(this.onRight||this.onLeft){this.el.style.cursor='ew-resize'}else if(this.onBottom||this.onTop){this.el.style.cursor='ns-resize'}else if(this.x>0&&this.y>0&&(this.x=this.border)){this.el.style.cursor='move'}else{this.el.style.cursor='default'}}else{if(this.x>0&&this.y>0&&(this.x=this.border)){this.el.style.cursor='move'}}}};return new this.dragging.init(a,b)},setTypeIcon:function(a){var b='';switch(this.typesactions[a]){case 1:b='fa fa-newspaper-o';break;case 2:b='fa fa-list-alt';break;case 3:b='fa fa-th-large';break;case 4:b='fa fa-code';break;case 5:b='fa fa-plug';break;case 6:b='fa fa-cube';break;case 7:b='fa fa-pencil-square-o';break;default:b='fa fa-circle'}return b}});w.mainMenu={};w.mainMenu.stopWork=function(){modx.main.stopWork()};w.mainMenu.work=function(){modx.main.work()};w.mainMenu.reloadtree=function(){if(modx.plugins.ElementsInTree){setTimeout('reloadElementsInTree()',50)}if(modx.config.global_tabs){setTimeout('modx.tree.restoreTree()',100)}};w.mainMenu.startrefresh=function(a){if(a===1){}if(a===2){}if(a===9){modx.tree.restoreTree()}if(a===10){w.location.href=modx.MODX_MANAGER_URL}};w.mainMenu.startmsgcount=function(a,b,c){modx.updateMail(c)};w.mainMenu.hideTreeFrame=function(){modx.resizer.setWidth(0)};w.mainMenu.defaultTreeFrame=function(){modx.resizer.setDefaultWidth()};w.tree={};w.tree.ca='open';w.tree.document=document;w.tree.saveFolderState=function(){};w.tree.updateTree=function(){modx.tree.updateTree()};w.tree.restoreTree=function(){modx.tree.restoreTree()};w.tree.resizeTree=function(){};w.onbeforeunload=function(){var a=w.main.frameElement.contentWindow;if(modx.getActionFromUrl(a.location.search,27)){modx.get(modx.MODX_MANAGER_URL+'?a=67&type=7&id='+modx.main.getQueryVariable('id',a.location.search.substring(1)))}};d.addEventListener('DOMContentLoaded',function(){modx.init()})})(typeof jQuery!=='undefined'?jQuery:'',window,document,undefined);(function(){if(!Element.prototype.closest){Element.prototype.closest=function(a){var b=this,c,d;['matches','webkitMatchesSelector','mozMatchesSelector','msMatchesSelector','oMatchesSelector'].some(function(fn){if(typeof document.body[fn]==='function'){c=fn;return true}return false});if(b&&c&&b[c](a))return b;while(b){d=b.parentElement;if(d&&c&&d[c](a))return d;b=d}return null}}})(); \ No newline at end of file From e4401c8a201da17d03bef7bad724bd4ec8b92c1c Mon Sep 17 00:00:00 2001 From: Serg <64j@mail.ru> Date: Tue, 3 Apr 2018 04:12:44 +0300 Subject: [PATCH 119/274] fix empty body class --- manager/includes/header.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/manager/includes/header.inc.php b/manager/includes/header.inc.php index a3c173149d..ce215984f8 100755 --- a/manager/includes/header.inc.php +++ b/manager/includes/header.inc.php @@ -17,6 +17,7 @@ $modx->config['mgr_date_picker_path'] = 'media/script/air-datepicker/datepicker.inc.php'; } +$body_class = ''; $theme_modes = array('', 'lightness', 'light', 'dark', 'darkness'); if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) { $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']]; From 44f8f6c8804e82ac75830dd5a3027ef2c94e3e1b Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Tue, 3 Apr 2018 16:17:16 +0300 Subject: [PATCH 120/274] fix for not touch composer.json on update --- assets/plugins/updater/plugin.updater.php | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/plugins/updater/plugin.updater.php b/assets/plugins/updater/plugin.updater.php index b6242ca5ad..129142abdf 100755 --- a/assets/plugins/updater/plugin.updater.php +++ b/assets/plugins/updater/plugin.updater.php @@ -321,6 +321,7 @@ function mmkDir($folder, $perm = 0777) unlink(__DIR__ . "/temp/" . $dir . "/ht.access"); unlink(__DIR__ . "/temp/" . $dir . "/README.md"); unlink(__DIR__ . "/temp/" . $dir . "/sample-robots.txt"); +unlink(__DIR__ . "/temp/" . $dir . "/composer.json"); if(is_file(__DIR__ . "/assets/cache/siteManager.php")){ From 64c4e9adf8ac1ab41ea7616b2223e39f775b7d1a Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Tue, 3 Apr 2018 16:29:47 +0300 Subject: [PATCH 121/274] =?UTF-8?q?add=20select=20fo=D0=BA=20theme=20mode?= =?UTF-8?q?=20in=20managers=20settings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manager/actions/mutate_user.dynamic.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/manager/actions/mutate_user.dynamic.php b/manager/actions/mutate_user.dynamic.php index 19c728bc36..58fa1b8445 100755 --- a/manager/actions/mutate_user.dynamic.php +++ b/manager/actions/mutate_user.dynamic.php @@ -551,6 +551,26 @@ function showHide(what, onoff) {   + + +
      + [(manager_theme_mode)] + + + +
      + +
      + +
      + + + + /> + +
      +
      From 2654f2c59c4f6dac78b1415cbf0ce60190b1ba54 Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Tue, 3 Apr 2018 16:59:13 +0300 Subject: [PATCH 123/274] update Formlister --- assets/snippets/FormLister/core/controller/Login.php | 4 +--- assets/snippets/FormLister/core/controller/Profile.php | 8 ++++---- assets/snippets/FormLister/core/controller/Register.php | 8 ++++---- ...2\320\260_\320\277\320\270\321\201\320\265\320\274.md" | 2 +- 4 files changed, 10 insertions(+), 12 deletions(-) mode change 100755 => 100644 assets/snippets/FormLister/core/controller/Login.php diff --git a/assets/snippets/FormLister/core/controller/Login.php b/assets/snippets/FormLister/core/controller/Login.php old mode 100755 new mode 100644 index 5885c42c57..9b991d7d05 --- a/assets/snippets/FormLister/core/controller/Login.php +++ b/assets/snippets/FormLister/core/controller/Login.php @@ -63,9 +63,7 @@ public function process() return; } $login = $this->getField($this->getCFGDef('loginField', 'username')); - if (is_scalar($login)) { - $login = mb_strtolower($login); - } else { + if (!is_scalar($login)) { $login = ''; } $password = $this->getField($this->getCFGDef('passwordField', 'password')); diff --git a/assets/snippets/FormLister/core/controller/Profile.php b/assets/snippets/FormLister/core/controller/Profile.php index 2a35891df9..1142e67245 100644 --- a/assets/snippets/FormLister/core/controller/Profile.php +++ b/assets/snippets/FormLister/core/controller/Profile.php @@ -92,7 +92,7 @@ public static function uniqueEmail($fl, $value) { $result = true; if (is_scalar($value) && !is_null($fl->user) && ($fl->user->get("email") !== $value)) { - $fl->user->set('email', mb_strtolower($value)); + $fl->user->set('email', $value); $result = $fl->user->checkUnique('web_user_attributes', 'email', 'internalKey'); } @@ -108,7 +108,7 @@ public static function uniqueUsername($fl, $value) { $result = true; if (is_scalar($value) && !is_null($fl->user) && ($fl->user->get("email") !== $value)) { - $fl->user->set('username', mb_strtolower($value)); + $fl->user->set('username', $value); $result = $fl->user->checkUnique('web_users', 'username'); } @@ -144,10 +144,10 @@ public function process() } $fields = $this->filterFields($this->getFormData('fields'), $this->allowedFields, $this->forbiddenFields); if (isset($fields['username'])) { - $fields['username'] = is_scalar($fields['username']) ? mb_strtolower($fields['username']) : ''; + $fields['username'] = is_scalar($fields['username']) ? $fields['username'] : ''; } if (isset($fields['email'])) { - $fields['email'] = is_scalar($fields['username']) ? mb_strtolower($fields['email']) : ''; + $fields['email'] = is_scalar($fields['username']) ? $fields['email'] : ''; } $result = $this->user->fromArray($fields)->save(true); $this->log('Update profile', array('data' => $fields, 'result' => $result, 'log' => $this->user->getLog())); diff --git a/assets/snippets/FormLister/core/controller/Register.php b/assets/snippets/FormLister/core/controller/Register.php index 7413c0af16..00e387ba22 100644 --- a/assets/snippets/FormLister/core/controller/Register.php +++ b/assets/snippets/FormLister/core/controller/Register.php @@ -73,7 +73,7 @@ public static function uniqueEmail($fl, $value) { $result = true; if (is_scalar($value) && !is_null($fl->user)) { - $fl->user->set('email', mb_strtolower($value)); + $fl->user->set('email', $value); $result = $fl->user->checkUnique('web_user_attributes', 'email', 'internalKey'); } @@ -91,7 +91,7 @@ public static function uniqueUsername($fl, $value) { $result = true; if (is_scalar($value) && !is_null($fl->user)) { - $fl->user->set('username', mb_strtolower($value)); + $fl->user->set('username', $value); $result = $fl->user->checkUnique('web_users', 'username'); } @@ -131,8 +131,8 @@ public function process() if ($checkActivation) { $fields['logincount'] = -1; } - $fields['username'] = is_scalar($fields['username']) ? mb_strtolower($fields['username']) : ''; - $fields['email'] = is_scalar($fields['email']) ? mb_strtolower($fields['email']) : ''; + $fields['username'] = is_scalar($fields['username']) ? $fields['username'] : ''; + $fields['email'] = is_scalar($fields['email']) ? $fields['email'] : ''; $this->user->create($fields); $this->addWebUserToGroups(0, $this->config->loadArray($this->getCFGDef('userGroups'))); $result = $this->user->save(true); diff --git "a/assets/snippets/FormLister/docs/ru/050_\320\236\321\202\320\277\321\200\320\260\320\262\320\272\320\260_\320\277\320\270\321\201\320\265\320\274.md" "b/assets/snippets/FormLister/docs/ru/050_\320\236\321\202\320\277\321\200\320\260\320\262\320\272\320\260_\320\277\320\270\321\201\320\265\320\274.md" index c0506883ee..fc31025e5a 100644 --- "a/assets/snippets/FormLister/docs/ru/050_\320\236\321\202\320\277\321\200\320\260\320\262\320\272\320\260_\320\277\320\270\321\201\320\265\320\274.md" +++ "b/assets/snippets/FormLister/docs/ru/050_\320\236\321\202\320\277\321\200\320\260\320\262\320\272\320\260_\320\277\320\270\321\201\320\265\320\274.md" @@ -4,7 +4,7 @@ ## Параметры отправки почты ### parseMailerParams -Разрешает использовать данные формы в параметрах отправки почты (&to=\`@CODE:[+user.email.value+]\` и т.п.). +Разрешает использовать данные формы в параметрах отправки почты (&to=\`[+user.email.value+]\` и т.п.). Возможные значения - 1, 0. From e10383b14a3e93da329f0a6c1302b6dcd4dee1f9 Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Tue, 3 Apr 2018 17:00:55 +0300 Subject: [PATCH 124/274] update DL --- assets/lib/MODxAPI/modManagers.php | 2 +- assets/lib/MODxAPI/modUsers.php | 2 +- assets/snippets/DocLister/snippet.DLMenu.php | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) mode change 100755 => 100644 assets/lib/MODxAPI/modManagers.php diff --git a/assets/lib/MODxAPI/modManagers.php b/assets/lib/MODxAPI/modManagers.php old mode 100755 new mode 100644 index 536f201ae5..dedef4be23 --- a/assets/lib/MODxAPI/modManagers.php +++ b/assets/lib/MODxAPI/modManagers.php @@ -150,7 +150,7 @@ public function edit($id) $result = $this->query(" SELECT * from {$this->makeTable('user_attributes')} as attribute LEFT JOIN {$this->makeTable('manager_users')} as user ON user.id=attribute.internalKey - WHERE BINARY {$find}='{$this->escape($id)}' + WHERE {$find}='{$this->escape($id)}' "); $this->field = $this->modx->db->getRow($result); diff --git a/assets/lib/MODxAPI/modUsers.php b/assets/lib/MODxAPI/modUsers.php index a5a8bcbb0f..708fb2667b 100644 --- a/assets/lib/MODxAPI/modUsers.php +++ b/assets/lib/MODxAPI/modUsers.php @@ -170,7 +170,7 @@ protected function editQuery($find, $id) $result = $this->query(" SELECT * from {$this->makeTable('web_user_attributes')} as attribute LEFT JOIN {$this->makeTable('web_users')} as user ON user.id=attribute.internalKey - WHERE BINARY {$find}='{$this->escape($id)}' + WHERE {$find}='{$this->escape($id)}' "); $this->field = $this->modx->db->getRow($result); } diff --git a/assets/snippets/DocLister/snippet.DLMenu.php b/assets/snippets/DocLister/snippet.DLMenu.php index 0bae536dd9..c48d08a540 100644 --- a/assets/snippets/DocLister/snippet.DLMenu.php +++ b/assets/snippets/DocLister/snippet.DLMenu.php @@ -6,7 +6,11 @@ $params['addWhereList'] = 'c.hidemenu = 0'; } if (!isset($params['sortBy'])) { - $params['sortBy'] = 'c.menuindex'; + if (isset($params['sortType']) && $params['sortType'] === 'doclist') { + $params['sortBy'] = 'c.id'; + } else { + $params['sortBy'] = 'c.menuindex'; + } } if (!isset($params['sortDir'])) { $params['sortDir'] = 'ASC'; From 4f598f2c2f0ef1a11bd66fc2712e1eb83d66a60b Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Tue, 3 Apr 2018 17:13:10 +0300 Subject: [PATCH 125/274] fix ExtrasCheck for darkness mode --- install/assets/plugins/OutdatedExtrasCheck.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/assets/plugins/OutdatedExtrasCheck.tpl b/install/assets/plugins/OutdatedExtrasCheck.tpl index 38415c0343..faacb57ac1 100755 --- a/install/assets/plugins/OutdatedExtrasCheck.tpl +++ b/install/assets/plugins/OutdatedExtrasCheck.tpl @@ -275,7 +275,7 @@ $widgets['xtraCheck'] = array( 'id' => 'xtraCheck'.$pluginid.'', 'cols' => 'col-md-12', 'headAttr' => 'style="background-color:#B60205; color:#FFFFFF;"', - 'bodyAttr' => 'style="background-color:#FFFFFF; color:#24292E;"', + 'bodyAttr' => '', 'icon' => 'fa-warning', 'title' => ''.$wdgTitle.' '.$button_pl_config.'', 'body' => '
      '.$out.'
      ', From 2c168aef29b6814b50742a534dc8fd2c92dcfadf Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Tue, 3 Apr 2018 17:15:58 +0300 Subject: [PATCH 126/274] fix elementstree for darkness --- .../elementsintree/assets/txt_content.tpl | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/assets/plugins/elementsintree/assets/txt_content.tpl b/assets/plugins/elementsintree/assets/txt_content.tpl index 8b119cec7f..9b89ba8e14 100755 --- a/assets/plugins/elementsintree/assets/txt_content.tpl +++ b/assets/plugins/elementsintree/assets/txt_content.tpl @@ -478,6 +478,72 @@ } + + .darkness.ElementsInTree #tree .treeframebody { + background-color: #202329 !important; + color: #828282; + border-color: #2a2d33 + } + + .darkness.ElementsInTree #tree .tab-row .tab { + color: #7b7b7b; + border-color: #2a2d33; + background-color: #1a1c21; + } + + .darkness.ElementsInTree #tree .tab-row .tab:hover { + background-color: #2d3033; + } + + .darkness.ElementsInTree #tree .tab-row .tab.selected { + background-color: #202329; + color: #bfbfbf; + } + + .darkness.ElementsInTree #tree .tab-row .tab span { + background-color: transparent; + } + + .darkness.ElementsInTree #tree .tab-page { + background-color: #202329; + } + + .darkness.ElementsInTree #tree .tab-page .panel-group { + border-color: #3e4144; + } + + .darkness.ElementsInTree #tree .form-control { + background-color: transparent; + color: #c7c7c7; + } + + .darkness.ElementsInTree #tree a { + color: #b7b7b7; + } + + .darkness.ElementsInTree #tree .disabledPlugin, + .darkness.ElementsInTree #tree .disabledPlugin a { + color: #B68282; + } + + .darkness.ElementsInTree #tree a:hover { + color: #dbdbdb; + } + + .darkness.ElementsInTree #tree .disabledPlugin a { + color: #b68282; + } + + .darkness.ElementsInTree #treeMenu { + background-color: rgba(0, 0, 0, 0.2) !important; + } + + .darkness.ElementsInTree #treeMenu.is-intab { + background-color: transparent !important; + } + + + /* Unify frames */ body, From 2e5b2d8e229e111b44b20527a015fe9d65c1b80d Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Tue, 3 Apr 2018 17:18:16 +0300 Subject: [PATCH 127/274] update version to 1.4.3 --- manager/includes/version.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/includes/version.inc.php b/manager/includes/version.inc.php index 74d7def995..e3ce8845d6 100755 --- a/manager/includes/version.inc.php +++ b/manager/includes/version.inc.php @@ -1,5 +1,5 @@ Date: Tue, 3 Apr 2018 17:51:49 +0300 Subject: [PATCH 128/274] changelog 1.4.3 --- assets/docs/changelog.txt | 43 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/assets/docs/changelog.txt b/assets/docs/changelog.txt index 40a4fd37cf..e60db9fc09 100755 --- a/assets/docs/changelog.txt +++ b/assets/docs/changelog.txt @@ -1,6 +1,49 @@ This file shows the changes in recent releases of Evolution CMS. The most current release is usually the development release, and is only shown to give an idea of what's currently in the pipeline. +Evolution CMS 1.4.3 (Apr 03, 2018) +* [GitHub:#e10383b14] - update DocLister (dmi3yy) +* [GitHub:#2654f2c59] - update Formlister (dmi3yy) +* [GitHub:#64c4e9adf] - add select for theme mode in managers settings (dmi3yy) +* [GitHub:#44f8f6c88] - fix for not touch composer.json on update (dmi3yy) +* [GitHub:#4fd89e618] - add Darkness style for tinyMCE (dmi3yy) +* [GitHub:#8526ee4b5] - add styles for modes theme (Serg) +* [GitHub:#097a1076b] - more checks in cli mode (Pathologic) +* [GitHub:#5a8ad98e2] - Logo margin in About EVO tab (Piotr Matysiak) +* [GitHub:#6fb277896] - Missing introtext in Recent Resources (Piotr Matysiak) +* [GitHub:#998f3a2fa] - Fix #603 bug for resource tree scrolling (Piotr Matysiak) +* [GitHub:#e72ae269b] - Tree panel title font size (EIT) (Piotr Matysiak) +* [GitHub:#6fe01d717] - tab-header color (Piotr Matysiak) +* [GitHub:#f0f0e2aaa] - Refactor CSS source files (Piotr Matysiak) +* [GitHub:#dde4173e8] - tab-header styles (Piotr Matysiak) +* [GitHub:#c4c8db2fc] - Wider Global Tabs (Piotr Matysiak) +* [GitHub:#002353afd] - Input border (Piotr Matysiak) +* [GitHub:#c0efeb457] - Navbar styles (Piotr Matysiak) +* [GitHub:#660855906] - Tree styles (Piotr Matysiak) +* [GitHub:#a1ade4a8e] - Table style (Piotr Matysiak) +* [GitHub:#72ceb3130] - Navbar links color (Piotr Matysiak) +* [GitHub:#109d38195] - Navbar height (Piotr Matysiak) +* [GitHub:#b61aa6c47] - Navbar bg color (Piotr Matysiak) +* [GitHub:#857140587] - Better navbar icon rendering (Piotr Matysiak) +* [GitHub:#f8c17c495] - moved JS code to a file manager/media/script/main.js (Serg) +* [GitHub:#060e49f1d] - fix empty template on save tv (Serg) +* [GitHub:#3fb227540] - [F] #577 Fix TinyMCE for [*introtext*] (Deesen) +* [GitHub:#1a5a68027] - Fix Extras buttons on 1.4.1 #571 (dmi3yy) +* [GitHub:#263737fbe] - add user_agent info to manager_log (dmi3yy) +* [GitHub:#36dfe9c6d] - write manager IP address to manager_log (dmi3yy) +* [GitHub:#8a3bee0ce] - new settings manager_theme_mode (dmi3yy) +* [GitHub:#745f633af] - setting color schema for manager template (dmi3yy) +* [GitHub:#f25ec1e59] - fix 577 TinyMCE introtext mode not work (dmi3yy) +* [GitHub:#d27e12bdc] - fix notice (Serg) +* [GitHub:#10ce1f270] - fix TinyMCE disable after update to 1.4.2 (dmi3yy) +* [GitHub:#dc06fb72f] - fix possible wrong path calculation (Pathologic) +* [GitHub:#b6fecddec] - [I] Wrap TinyMCE3 Toolbar (Mr B) +* [GitHub:#f55089ba7] - [F] Prevent long select option text values overflowing container (Mr B) +* [GitHub:#40f2a53d4] - add view ability for ini files in manager files (dmi3yy) +* [GitHub:#d3117b1c2] - fix demo site (Formlister, param reply-to) (dmi3yy) +* [GitHub:#a5aff20db] - formlister fix typo (dmi3yy) + + Evolution CMS 1.4.2 (Mar 23, 2018) * [GitHub:#6a33e6f2b] - now you can use argv like this: php cli-install.php --database_server=localhost --database=db --database_user=dbuser --database_password=dbpass --table_prefix=evo_ --cmsadmin=admin --cmsadminemail=dmi3yy@gmail.com --cmspassword=123456 --language=ru --mode=new --installData=n --removeInstall=y (dmi3yy) * [GitHub:#d8e7ec072] - run install file (dmi3yy) From a36d1950bd13904c461cbbc2079249c5b472b1ff Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Tue, 3 Apr 2018 18:39:17 +0300 Subject: [PATCH 129/274] update changelog --- assets/docs/changelog.txt | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/assets/docs/changelog.txt b/assets/docs/changelog.txt index e60db9fc09..bf382f67fb 100755 --- a/assets/docs/changelog.txt +++ b/assets/docs/changelog.txt @@ -9,22 +9,8 @@ Evolution CMS 1.4.3 (Apr 03, 2018) * [GitHub:#4fd89e618] - add Darkness style for tinyMCE (dmi3yy) * [GitHub:#8526ee4b5] - add styles for modes theme (Serg) * [GitHub:#097a1076b] - more checks in cli mode (Pathologic) -* [GitHub:#5a8ad98e2] - Logo margin in About EVO tab (Piotr Matysiak) * [GitHub:#6fb277896] - Missing introtext in Recent Resources (Piotr Matysiak) * [GitHub:#998f3a2fa] - Fix #603 bug for resource tree scrolling (Piotr Matysiak) -* [GitHub:#e72ae269b] - Tree panel title font size (EIT) (Piotr Matysiak) -* [GitHub:#6fe01d717] - tab-header color (Piotr Matysiak) -* [GitHub:#f0f0e2aaa] - Refactor CSS source files (Piotr Matysiak) -* [GitHub:#dde4173e8] - tab-header styles (Piotr Matysiak) -* [GitHub:#c4c8db2fc] - Wider Global Tabs (Piotr Matysiak) -* [GitHub:#002353afd] - Input border (Piotr Matysiak) -* [GitHub:#c0efeb457] - Navbar styles (Piotr Matysiak) -* [GitHub:#660855906] - Tree styles (Piotr Matysiak) -* [GitHub:#a1ade4a8e] - Table style (Piotr Matysiak) -* [GitHub:#72ceb3130] - Navbar links color (Piotr Matysiak) -* [GitHub:#109d38195] - Navbar height (Piotr Matysiak) -* [GitHub:#b61aa6c47] - Navbar bg color (Piotr Matysiak) -* [GitHub:#857140587] - Better navbar icon rendering (Piotr Matysiak) * [GitHub:#f8c17c495] - moved JS code to a file manager/media/script/main.js (Serg) * [GitHub:#060e49f1d] - fix empty template on save tv (Serg) * [GitHub:#3fb227540] - [F] #577 Fix TinyMCE for [*introtext*] (Deesen) From 24de5782185aba11ea7e7be4d48d9d473ec2183e Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Tue, 3 Apr 2018 18:40:03 +0300 Subject: [PATCH 130/274] release will be tomorrow) --- assets/docs/changelog.txt | 2 +- manager/includes/version.inc.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/docs/changelog.txt b/assets/docs/changelog.txt index bf382f67fb..88bcbd4b03 100755 --- a/assets/docs/changelog.txt +++ b/assets/docs/changelog.txt @@ -1,7 +1,7 @@ This file shows the changes in recent releases of Evolution CMS. The most current release is usually the development release, and is only shown to give an idea of what's currently in the pipeline. -Evolution CMS 1.4.3 (Apr 03, 2018) +Evolution CMS 1.4.3 (Apr 04, 2018) * [GitHub:#e10383b14] - update DocLister (dmi3yy) * [GitHub:#2654f2c59] - update Formlister (dmi3yy) * [GitHub:#64c4e9adf] - add select for theme mode in managers settings (dmi3yy) diff --git a/manager/includes/version.inc.php b/manager/includes/version.inc.php index e3ce8845d6..efd575dd01 100755 --- a/manager/includes/version.inc.php +++ b/manager/includes/version.inc.php @@ -1,5 +1,5 @@ Date: Tue, 3 Apr 2018 21:21:31 +0300 Subject: [PATCH 131/274] =?UTF-8?q?=D0=BA=D1=91=D1=80=D0=BD=D0=B8=D0=BD?= =?UTF-8?q?=D0=B3=20=D0=B4=D0=BB=D1=8F=20=D1=81=D0=B2=D0=B5=D1=82=D0=BB?= =?UTF-8?q?=D0=BE=D0=B9=20=D1=82=D0=B5=D0=BC=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Межбуквенно расстояние на светлом фоне плохо смотрится, лучше оставить как было до того. А в чёрной прибавлять --- manager/media/style/default/css/tree.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/media/style/default/css/tree.css b/manager/media/style/default/css/tree.css index 3d8b48d65e..dee0749f69 100755 --- a/manager/media/style/default/css/tree.css +++ b/manager/media/style/default/css/tree.css @@ -44,7 +44,7 @@ #treeRoot .fa-link { margin-right: 0; font-size: 0.8em } #treeRoot #binFull { display: none } @media (min-width: 1200px) { -#tree { font-size: .875rem; letter-spacing: 0.0321em; } +.dark #tree, .darkness #tree { font-size: .875rem; letter-spacing: 0.0321em; } } /* modes theme */ /* lightness */ From b46e74d5a8db31c2a7f7573251be98dd56e0f7ee Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Tue, 3 Apr 2018 21:31:28 +0200 Subject: [PATCH 132/274] CSS code formatting --- .../media/style/default/css/contextmenu.css | 113 +- manager/media/style/default/css/custom.css | 2954 ++++++++++++++--- manager/media/style/default/css/fonts.css | 571 +++- manager/media/style/default/css/forms.css | 687 +++- manager/media/style/default/css/index.css | 288 +- manager/media/style/default/css/layout.css | 180 +- manager/media/style/default/css/main.css | 995 +++++- manager/media/style/default/css/mainmenu.css | 974 +++++- manager/media/style/default/css/tabpane.css | 1040 +++++- manager/media/style/default/css/tree.css | 528 ++- 10 files changed, 7130 insertions(+), 1200 deletions(-) diff --git a/manager/media/style/default/css/contextmenu.css b/manager/media/style/default/css/contextmenu.css index a82ea08e9b..34c539cd08 100755 --- a/manager/media/style/default/css/contextmenu.css +++ b/manager/media/style/default/css/contextmenu.css @@ -1,14 +1,105 @@ /* contextmenu */ -#mx_contextmenu, #contextmenu, .nu-context-menu, .contextMenu { display: block !important; position: absolute; overflow: hidden; top: 0; max-width: 25rem; width: auto !important; height: auto; padding: 0.25rem 0; visibility: hidden; opacity: 0; z-index: 10000; background: #fff; font-size: 0.9em; border: none; border-radius: 0.25rem; -webkit-box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); transition: opacity 0s, visibility 0s; transform: translateZ(0) } -#mx_contextmenu .fa, #contextmenu .fa, .nu-context-menu .fa, .contextMenu .fa { width: 1.3em; font-size: 0.9rem; text-align: center; } -#mx_contextmenu.show, #contextmenu.show, .nu-context-menu.active, .contextMenu { visibility: visible; opacity: 1; transition: opacity 0.1s, visibility 0.1s; } -#mx_contextmenu > div, #contextmenu > div, .nu-context-menu ul li, .contextMenu > div { padding: 0.5em 2em 0.5em 1em; } -#mx_contextmenu #nameHolder, #contextmenu .menuHeader, .nu-context-menu-title { color: #1377c5; padding: 0.75em 1em; } -#mx_contextmenu .menuLink, #contextmenu .menuLink, .nu-context-menu ul li, .contextMenu > div { cursor: pointer; } -#mx_contextmenu .menuLink:hover, #contextmenu .menuLink:hover, .nu-context-menu ul li:hover, .contextMenu > div:hover { background-color: #1976d2; color: #fff; } -#mx_contextmenu .seperator, #contextmenu .seperator, .nu-context-menu ul hr, .contextMenu .cntxMnuSeparator { height: 1px; background-color: rgba(0, 0, 0, 0.07) !important; margin: 0.25em 0; padding: 0; cursor: default; } -.nu-context-menu ul { margin: 0; padding: 0; } -.contextMenu .cntxMnuItem { white-space: nowrap } + +#mx_contextmenu, +#contextmenu, +.nu-context-menu, +.contextMenu { + display: block !important; + position: absolute; + overflow: hidden; + top: 0; + max-width: 25rem; + width: auto !important; + height: auto; + padding: 0.25rem 0; + visibility: hidden; + opacity: 0; + z-index: 10000; + background: #fff; + font-size: 0.9em; + border: none; + border-radius: 0.25rem; + -webkit-box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); + box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); + transition: opacity 0s, visibility 0s; + transform: translateZ(0) +} + +#mx_contextmenu .fa, +#contextmenu .fa, +.nu-context-menu .fa, +.contextMenu .fa { + width: 1.3em; + font-size: 0.9rem; + text-align: center; +} + +#mx_contextmenu.show, +#contextmenu.show, +.nu-context-menu.active, +.contextMenu { + visibility: visible; + opacity: 1; + transition: opacity 0.1s, visibility 0.1s; +} + +#mx_contextmenu > div, +#contextmenu > div, +.nu-context-menu ul li, +.contextMenu > div { + padding: 0.5em 2em 0.5em 1em; +} + +#mx_contextmenu #nameHolder, +#contextmenu .menuHeader, +.nu-context-menu-title { + color: #1377c5; + padding: 0.75em 1em; +} + +#mx_contextmenu .menuLink, +#contextmenu .menuLink, +.nu-context-menu ul li, +.contextMenu > div { + cursor: pointer; +} + +#mx_contextmenu .menuLink:hover, +#contextmenu .menuLink:hover, +.nu-context-menu ul li:hover, +.contextMenu > div:hover { + background-color: #1976d2; + color: #fff; +} + +#mx_contextmenu .seperator, +#contextmenu .seperator, +.nu-context-menu ul hr, +.contextMenu .cntxMnuSeparator { + height: 1px; + background-color: rgba(0, 0, 0, 0.07) !important; + margin: 0.25em 0; + padding: 0; + cursor: default; +} + +.nu-context-menu ul { + margin: 0; + padding: 0; +} + +.contextMenu .cntxMnuItem { + white-space: nowrap +} + /* modes theme */ + /* darkness */ -.darkness #mx_contextmenu, .darkness #contextmenu, .darkness .nu-context-menu, .darkness .contextMenu { background-color: #343942; color: inherit; } \ No newline at end of file + +.darkness #mx_contextmenu, +.darkness #contextmenu, +.darkness .nu-context-menu, +.darkness .contextMenu { + background-color: #343942; + color: inherit; +} diff --git a/manager/media/style/default/css/custom.css b/manager/media/style/default/css/custom.css index 0f343f9ad9..edd8689722 100755 --- a/manager/media/style/default/css/custom.css +++ b/manager/media/style/default/css/custom.css @@ -1,483 +1,2549 @@ /* [ COLS ] */ -.row { margin-left: -1.25rem; margin-right: -1.25rem } -.container { padding-left: 1.25rem; padding-right: 1.25rem; width: 100% } + +.row { + margin-left: -1.25rem; + margin-right: -1.25rem +} + +.container { + padding-left: 1.25rem; + padding-right: 1.25rem; + width: 100% +} + /* :TODO .container-body need remove and replace .tab-content */ -.container-body { padding: 1.25rem } + +.container-body { + padding: 1.25rem +} + /* [ FORMS ] */ -.form-row { margin-bottom: 0.25rem; } -.form-row.row { margin-left: 0; margin-right: -1rem } -.form-row label { margin-bottom: 0.15rem } -.form-row .col, .form-row .col-1, .form-row .col-10, .form-row .col-11, .form-row .col-12, .form-row .col-2, .form-row .col-3, .form-row .col-4, .form-row .col-5, .form-row .col-6, .form-row .col-7, .form-row .col-8, .form-row .col-9, .form-row .col-lg, .form-row .col-lg-1, .form-row .col-lg-10, .form-row .col-lg-11, .form-row .col-lg-12, .form-row .col-lg-2, .form-row .col-lg-3, .form-row .col-lg-4, .form-row .col-lg-5, .form-row .col-lg-6, .form-row .col-lg-7, .form-row .col-lg-8, .form-row .col-lg-9, .form-row .col-md, .form-row .col-md-1, .form-row .col-md-10, .form-row .col-md-11, .form-row .col-md-12, .form-row .col-md-2, .form-row .col-md-3, .form-row .col-md-4, .form-row .col-md-5, .form-row .col-md-6, .form-row .col-md-7, .form-row .col-md-8, .form-row .col-md-9, .form-row .col-sm, .form-row .col-sm-1, .form-row .col-sm-10, .form-row .col-sm-11, .form-row .col-sm-12, .form-row .col-sm-2, .form-row .col-sm-3, .form-row .col-sm-4, .form-row .col-sm-5, .form-row .col-sm-6, .form-row .col-sm-7, .form-row .col-sm-8, .form-row .col-sm-9, .form-row .col-xl, .form-row .col-xl-1, .form-row .col-xl-10, .form-row .col-xl-11, .form-row .col-xl-12, .form-row .col-xl-2, .form-row .col-xl-3, .form-row .col-xl-4, .form-row .col-xl-5, .form-row .col-xl-6, .form-row .col-xl-7, .form-row .col-xl-8, .form-row .col-xl-9, .form-row .col-xs, .form-row .col-xs-1, .form-row .col-xs-10, .form-row .col-xs-11, .form-row .col-xs-12, .form-row .col-xs-2, .form-row .col-xs-3, .form-row .col-xs-4, .form-row .col-xs-5, .form-row .col-xs-6, .form-row .col-xs-7, .form-row .col-xs-8, .form-row .col-xs-9 { padding-left: 0 } -.form-row .form-control { float: left; } -.form-inline .form-row .form-control { float: none; } -.container-body > .form-group:last-child, .container-body > .form-row:last-child, .container-body > p:last-child, .container-body > .form-group:last-child > p:last-child { margin-bottom: 0 } -.form-control-name { position: relative; } -.form-control-name .form-control { padding-right: 2em } -.form-control-name .custom-control { display: block; overflow: hidden; position: absolute; z-index: 3; top: 0; right: 0; width: 2em; height: 100%; margin: 0; padding: 0; cursor: pointer } -.form-control-name .custom-control input { position: absolute; left: -100% } -.form-control-name .custom-control .fa-lock { margin-top: 0.6em; font-size: 1.5em } -.form-control-name .custom-control .fa-lock::before { content: "\f09c"; color: #ddd } -.form-control-name .custom-control input:checked ~ .fa-lock::before { content: "\f023"; color: #d9534f } -input[type=date]:not(.unstyled), input[name*=date]:not(.unstyled):not([type=checkbox]):not([type=radio]), input[name=createdon], input[name=editedon], input[size="1"], select[name=usergroup]:not(.unstyled), select[name=docgroup]:not(.unstyled) { width: auto !important; vertical-align: middle } -select[size="1"]:not(.unstyled) { vertical-align: middle } -input[name*=date]:not(.unstyled) + .input-group-addon { float: left; width: auto; } -input[size="50"], select[size="50"] { width: 10rem !important } -select[name=usergroup], select[name=docgroup] { margin: 0 0.5em; } -select[name=docgroup] + input[type=submit] { float: none; margin: 0; } -#settingsPane #filemanager_path, #settingsPane #rb_base_dir, #settingsPane input[name=txt_custom_contenttype] { border-top-right-radius: 0; border-bottom-right-radius: 0 } -#settingsPane #filemanager_path + input[name=reset_filemanager_path], #settingsPane #rb_base_dir + input[name=reset_rb_base_dir], #settingsPane input[name=txt_custom_contenttype] + input[type=button], input[name=photo] + input[type=button], #range input#pids + input[name=fsubmit], input[name="ta"].inputBox + input[type=button], input[name="ta"].inputBox + .CodeMirror + input[type=button], #documentPane input[name^=tv]:not([class*=mtv]) + input[type=button] { z-index: 5; float: right; margin-top: -2.30769em; width: auto !important; border-top-left-radius: 0; border-bottom-left-radius: 0 } -#settingsPane [name=site_name], #settingsPane [name=txt_custom_contenttype], #settingsPane [name=filemanager_path], #settingsPane [name=rb_base_dir], input[name=photo], #range input#pids, input[maxlength="350"], textarea.mce, #editorRow_TinyMCE { width: 100% !important } -#range::after { content: ""; display: table; width: 100% } + +.form-row { + margin-bottom: 0.25rem; +} + +.form-row.row { + margin-left: 0; + margin-right: -1rem +} + +.form-row label { + margin-bottom: 0.15rem +} + +.form-row .col, +.form-row .col-1, +.form-row .col-10, +.form-row .col-11, +.form-row .col-12, +.form-row .col-2, +.form-row .col-3, +.form-row .col-4, +.form-row .col-5, +.form-row .col-6, +.form-row .col-7, +.form-row .col-8, +.form-row .col-9, +.form-row .col-lg, +.form-row .col-lg-1, +.form-row .col-lg-10, +.form-row .col-lg-11, +.form-row .col-lg-12, +.form-row .col-lg-2, +.form-row .col-lg-3, +.form-row .col-lg-4, +.form-row .col-lg-5, +.form-row .col-lg-6, +.form-row .col-lg-7, +.form-row .col-lg-8, +.form-row .col-lg-9, +.form-row .col-md, +.form-row .col-md-1, +.form-row .col-md-10, +.form-row .col-md-11, +.form-row .col-md-12, +.form-row .col-md-2, +.form-row .col-md-3, +.form-row .col-md-4, +.form-row .col-md-5, +.form-row .col-md-6, +.form-row .col-md-7, +.form-row .col-md-8, +.form-row .col-md-9, +.form-row .col-sm, +.form-row .col-sm-1, +.form-row .col-sm-10, +.form-row .col-sm-11, +.form-row .col-sm-12, +.form-row .col-sm-2, +.form-row .col-sm-3, +.form-row .col-sm-4, +.form-row .col-sm-5, +.form-row .col-sm-6, +.form-row .col-sm-7, +.form-row .col-sm-8, +.form-row .col-sm-9, +.form-row .col-xl, +.form-row .col-xl-1, +.form-row .col-xl-10, +.form-row .col-xl-11, +.form-row .col-xl-12, +.form-row .col-xl-2, +.form-row .col-xl-3, +.form-row .col-xl-4, +.form-row .col-xl-5, +.form-row .col-xl-6, +.form-row .col-xl-7, +.form-row .col-xl-8, +.form-row .col-xl-9, +.form-row .col-xs, +.form-row .col-xs-1, +.form-row .col-xs-10, +.form-row .col-xs-11, +.form-row .col-xs-12, +.form-row .col-xs-2, +.form-row .col-xs-3, +.form-row .col-xs-4, +.form-row .col-xs-5, +.form-row .col-xs-6, +.form-row .col-xs-7, +.form-row .col-xs-8, +.form-row .col-xs-9 { + padding-left: 0 +} + +.form-row .form-control { + float: left; +} + +.form-inline .form-row .form-control { + float: none; +} + +.container-body > .form-group:last-child, +.container-body > .form-row:last-child, +.container-body > p:last-child, +.container-body > .form-group:last-child > p:last-child { + margin-bottom: 0 +} + +.form-control-name { + position: relative; +} + +.form-control-name .form-control { + padding-right: 2em +} + +.form-control-name .custom-control { + display: block; + overflow: hidden; + position: absolute; + z-index: 3; + top: 0; + right: 0; + width: 2em; + height: 100%; + margin: 0; + padding: 0; + cursor: pointer +} + +.form-control-name .custom-control input { + position: absolute; + left: -100% +} + +.form-control-name .custom-control .fa-lock { + margin-top: 0.6em; + font-size: 1.5em +} + +.form-control-name .custom-control .fa-lock::before { + content: "\f09c"; + color: #ddd +} + +.form-control-name .custom-control input:checked ~ .fa-lock::before { + content: "\f023"; + color: #d9534f +} + +input[type=date]:not(.unstyled), +input[name*=date]:not(.unstyled):not([type=checkbox]):not([type=radio]), +input[name=createdon], +input[name=editedon], +input[size="1"], +select[name=usergroup]:not(.unstyled), +select[name=docgroup]:not(.unstyled) { + width: auto !important; + vertical-align: middle +} + +select[size="1"]:not(.unstyled) { + vertical-align: middle +} + +input[name*=date]:not(.unstyled) + .input-group-addon { + float: left; + width: auto; +} + +input[size="50"], +select[size="50"] { + width: 10rem !important +} + +select[name=usergroup], +select[name=docgroup] { + margin: 0 0.5em; +} + +select[name=docgroup] + input[type=submit] { + float: none; + margin: 0; +} + +#settingsPane #filemanager_path, +#settingsPane #rb_base_dir, +#settingsPane input[name=txt_custom_contenttype] { + border-top-right-radius: 0; + border-bottom-right-radius: 0 +} + +#settingsPane #filemanager_path + input[name=reset_filemanager_path], +#settingsPane #rb_base_dir + input[name=reset_rb_base_dir], +#settingsPane input[name=txt_custom_contenttype] + input[type=button], +input[name=photo] + input[type=button], +#range input#pids + input[name=fsubmit], +input[name="ta"].inputBox + input[type=button], +input[name="ta"].inputBox + .CodeMirror + input[type=button], +#documentPane input[name^=tv]:not([class*=mtv]) + input[type=button] { + z-index: 5; + float: right; + margin-top: -2.30769em; + width: auto !important; + border-top-left-radius: 0; + border-bottom-left-radius: 0 +} + +#settingsPane [name=site_name], +#settingsPane [name=txt_custom_contenttype], +#settingsPane [name=filemanager_path], +#settingsPane [name=rb_base_dir], +input[name=photo], +#range input#pids, +input[maxlength="350"], +textarea.mce, +#editorRow_TinyMCE { + width: 100% !important +} + +#range::after { + content: ""; + display: table; + width: 100% +} + /* [ Editor ] */ -.navbar.navbar-editor { padding: .5rem 1.25rem; border-radius: 0 } -.navbar-editor > label { margin-bottom: 0 } -.section-editor textarea { float: left; border-left: none; border-right: none; font-family: 'Inconsolata', 'Monaco', 'Consolas', 'Courier New', 'Courier', monospace; font-weight: 300; font-size: 0.875rem; } + +.navbar.navbar-editor { + padding: .5rem 1.25rem; + border-radius: 0 +} + +.navbar-editor > label { + margin-bottom: 0 +} + +.section-editor textarea { + float: left; + border-left: none; + border-right: none; + font-family: 'Inconsolata', 'Monaco', 'Consolas', 'Courier New', 'Courier', monospace; + font-weight: 300; + font-size: 0.875rem; +} + /* [ Action Buttons ] */ + /* new style */ -#actions { background: rgba(199, 199, 199, 0.25); padding: 0.5rem; position: fixed; top: 0; right: 1rem; text-align: right; z-index: 1001; border-radius: 0 0 0.3rem 0.3rem; } -#actions .btn-group { margin: 0 } -#actions .btn-group > .btn-group { display: block } -#actions .btn-group .btn, #actions .btn-group .form-control { font-size: .6772rem; height: 2.4em; line-height: 1.4 } -#actions .btn-group .btn .fa, #_actions .btn-group .btn .fa { display: none; width: 1em; font-size: 1em; text-align: center } -#actions .btn-group .btn-group #Button1 { min-width: 100%; text-align: left; float: right; } -#actions .btn-group .btn-success { box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .07); } -#actions .btn-group .btn-success:hover { box-shadow: none } -#actions .btn-group .plus { z-index: 2; float: right; margin: -2.4em 0 0 0; width: 2rem; padding-left: 0; padding-right: 0; text-align: center; cursor: default; } -#actions .btn-group .plus::before { content: "\f107"; font-family: FontAwesome } -#actions .btn-group .show .plus::before { content: "\f106"; } -#actions .btn-group select#stay { display: block; position: relative; z-index: -1; clear: both; width: auto; height: 0; margin: -100% 0 -2rem 0; font-size: 0.675rem; opacity: 0; visibility: hidden; } -#actions .btn-group .dropdown-menu { display: none; position: absolute; z-index: -1; left: auto; right: 0; top: 100%; width: 100%; min-width: 2rem; margin: 0; padding: 0; text-align: left; font-size: .6772rem; border-top: none; border-radius: 0 0 0.1em 0.1em; overflow: hidden; } -#actions .btn-group .show > .dropdown-menu { display: block } -#actions .btn-group .dropdown-menu > span { display: block; margin: 0; text-align: left; border: none; border-top: 1px solid rgba(0, 0, 0, 0.1) } -#actions .btn-group .dropdown-menu > span:first-child { border-color: transparent } -#actions .btn-group .dropdown-menu > span:hover { background-color: #e6e6e6; } -#actions .btn-group .dropdown-toggle::after { margin: 0; border-width: 0.4em; transition-duration: 0.25s } -#actions .btn-group .show .dropdown-toggle::after { transform: rotate(180deg) } -#_actions .btn-group .input-group-btn .btn { margin-left: .1875rem } -#_actions .btn-group .form-control, #_actions .btn-group .btn { border-radius: .1em } + +#actions { + background: rgba(199, 199, 199, 0.25); + padding: 0.5rem; + position: fixed; + top: 0; + right: 1rem; + text-align: right; + z-index: 1001; + border-radius: 0 0 0.3rem 0.3rem; +} + +#actions .btn-group { + margin: 0 +} + +#actions .btn-group > .btn-group { + display: block +} + +#actions .btn-group .btn, +#actions .btn-group .form-control { + font-size: .6772rem; + height: 2.4em; + line-height: 1.4 +} + +#actions .btn-group .btn .fa, +#_actions .btn-group .btn .fa { + display: none; + width: 1em; + font-size: 1em; + text-align: center +} + +#actions .btn-group .btn-group #Button1 { + min-width: 100%; + text-align: left; + float: right; +} + +#actions .btn-group .btn-success { + box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .07); +} + +#actions .btn-group .btn-success:hover { + box-shadow: none +} + +#actions .btn-group .plus { + z-index: 2; + float: right; + margin: -2.4em 0 0 0; + width: 2rem; + padding-left: 0; + padding-right: 0; + text-align: center; + cursor: default; +} + +#actions .btn-group .plus::before { + content: "\f107"; + font-family: FontAwesome +} + +#actions .btn-group .show .plus::before { + content: "\f106"; +} + +#actions .btn-group select#stay { + display: block; + position: relative; + z-index: -1; + clear: both; + width: auto; + height: 0; + margin: -100% 0 -2rem 0; + font-size: 0.675rem; + opacity: 0; + visibility: hidden; +} + +#actions .btn-group .dropdown-menu { + display: none; + position: absolute; + z-index: -1; + left: auto; + right: 0; + top: 100%; + width: 100%; + min-width: 2rem; + margin: 0; + padding: 0; + text-align: left; + font-size: .6772rem; + border-top: none; + border-radius: 0 0 0.1em 0.1em; + overflow: hidden; +} + +#actions .btn-group .show > .dropdown-menu { + display: block +} + +#actions .btn-group .dropdown-menu > span { + display: block; + margin: 0; + text-align: left; + border: none; + border-top: 1px solid rgba(0, 0, 0, 0.1) +} + +#actions .btn-group .dropdown-menu > span:first-child { + border-color: transparent +} + +#actions .btn-group .dropdown-menu > span:hover { + background-color: #e6e6e6; +} + +#actions .btn-group .dropdown-toggle::after { + margin: 0; + border-width: 0.4em; + transition-duration: 0.25s +} + +#actions .btn-group .show .dropdown-toggle::after { + transform: rotate(180deg) +} + +#_actions .btn-group .input-group-btn .btn { + margin-left: .1875rem +} + +#_actions .btn-group .form-control, +#_actions .btn-group .btn { + border-radius: .1em +} + @media (max-width: 840px) { -#actions { right: 0 } -#actions .btn-group .btn span, #actions .btn-group select#stay, #_actions .btn-group .btn span { display: none } -#actions .btn-group .btn .fa, #_actions .btn-group .btn .fa { display: inline-block } -#actions .btn-group .dropdown-menu { width: 2rem } -#actions .btn-group .dropdown-menu span { padding-left: 0; padding-right: 0; text-align: center } -#_actions .btn-group .input-group-btn .btn { margin-left: -1px } -#_actions .btn-group .form-control, #_actions .btn-group .btn { border-radius: 0 } -#_actions .btn-group .form-control:first-child { border-top-left-radius: .1em; border-bottom-left-radius: .1em; } -#_actions .btn-group .btn:last-child { border-top-right-radius: .1em; border-bottom-right-radius: .1em; } + #actions { + right: 0 + } + #actions .btn-group .btn span, + #actions .btn-group select#stay, + #_actions .btn-group .btn span { + display: none + } + #actions .btn-group .btn .fa, + #_actions .btn-group .btn .fa { + display: inline-block + } + #actions .btn-group .dropdown-menu { + width: 2rem + } + #actions .btn-group .dropdown-menu span { + padding-left: 0; + padding-right: 0; + text-align: center + } + #_actions .btn-group .input-group-btn .btn { + margin-left: -1px + } + #_actions .btn-group .form-control, + #_actions .btn-group .btn { + border-radius: 0 + } + #_actions .btn-group .form-control:first-child { + border-top-left-radius: .1em; + border-bottom-left-radius: .1em; + } + #_actions .btn-group .btn:last-child { + border-top-right-radius: .1em; + border-bottom-right-radius: .1em; + } +} + +/* old style */ + +#actions .actionButtons { + float: left; + min-height: 32px +} + +#actions .actionButtons li { + position: relative; + float: left; + margin-right: 3px; + border: none +} + +#actions .actionButtons li a, +#actions .actionButtons .plus { + float: left; + padding: 0 10px !important; + height: 32px; + line-height: 30px; + -webkit-user-select: none; + user-select: none; +} + +#actions .actionButtons li:last-child { + margin: 0 +} + +#actions .actionButtons #Button1 a { + width: 100%; + text-align: left; +} + +#actions .actionButtons .plus { + overflow: hidden; + float: right; + margin: -32px 0 0 0; + width: 35px; + border-radius: 0 3px 3px 0 !important; + text-align: center; + cursor: default; + font: normal normal normal 0/30px FontAwesome +} + +#actions .actionButtons .plus::before { + content: "\f107"; + font-size: 14px +} + +#actions .actionButtons .show .plus::before { + content: "\f106"; +} + +#actions .actionButtons .dropdown-menu { + display: none; + position: absolute; + z-index: -1; + left: auto; + right: 0; + top: 100%; + width: 100%; + min-width: 35px; + margin: -2px 0 0; + padding: 2px 0 0; + text-align: left; + font-size: 1em; + background-color: #fff; + border: 1px solid #32ab9a; + border-top: none; + border-radius: 0 0 3px 3px; + overflow: hidden; +} + +#actions .actionButtons .show > .dropdown-menu { + display: block +} + +#actions .actionButtons .dropdown-menu > span { + display: block; + padding: 0 10px; + height: 32px; + line-height: 30px; + border: none; + border-top: 1px solid #f2f2f2; + cursor: pointer; +} + +#actions .actionButtons .dropdown-menu > span:hover { + background-color: #fbfbfb; +} + +#actions .actionButtons select#stay { + display: block; + position: relative; + z-index: -1; + clear: both; + width: auto; + height: 0; + padding: 0 10px; + margin: -100% 0 -32px 0; + font-size: 1em; + opacity: 0; + visibility: hidden; +} + +#actions .actionButtons #Button1 a, +#actions .actionButtons .plus { + color: #fff; + border-color: #32ab9a; + background: #32ab9a linear-gradient(#32ab9a, #00948e); +} + +#actions .actionButtons #Button1 a:hover, +#actions .actionButtons .plus:hover { + background: #2b9385 linear-gradient(#2b9385, #007571); + border-color: #2b9385; +} + +#actions .actionButtons #Button1 a:active, +#actions .actionButtons .plus:active { + background: #32ab9a; + border-color: #32ab9a; +} + +@media (max-width: 900px) { + #actions .actionButtons li a, + #actions .actionButtons .dropdown-menu span { + font-size: 0 + } + #actions .actionButtons li a .fa, + #actions .actionButtons .dropdown-menu span .fa { + display: inline-block; + font-size: 14px; + line-height: 30px + } + #actions .actionButtons .dropdown-menu { + width: 35px + } + #actions .actionButtons #Button1 a { + margin: 0; + width: auto + } + #actions .actionButtons .plus { + margin: 0 0 0 -2px + } + #actions .actionButtons select#stay { + display: none + } +} + +/* actionButtons in content ( old style ) */ + +.actionButtons { + margin: 0; + padding: 0; + background: none; + width: auto; + white-space: nowrap; +} + +.actionButtons li { + float: left; + margin: 0; + padding: 0; + list-style: none; +} + +.actionButtons li:before, +.mmTagList li:before, +.rTable li:before, +.tab-pane ul li ul li:before, +.dashboard li:before, +div#idShowHideSocialBox.sectionBody > div.btn-group.ope > ul.dropdown-menu > li:before, +.sectionBody .multitv .list li:before { + display: none; + content: ''; +} + +.actionButtons img { + vertical-align: top; + margin-top: 1px; + opacity: 0.3; +} + +.actionButtons:hover img { + opacity: 1; +} + +.actionButtons a:hover { + border-color: #999; + -webkit-box-shadow: 1px 1px 2px #aaa; + box-shadow: 1px 1px 2px #aaa; + -webkit-transition: .3s ease; + transition: .3s ease; + background: -moz-linear-gradient(#fff, #f5f5f5); + background: -webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#f5f5f5)); + background: -o-linear-gradient(#fff, #f5f5f5); + text-decoration: none !important; +} + +.actionButtons a:active { + background: #92aac4 bottom left; + -webkit-box-shadow: 0 0 10px #b8c7d6; + box-shadow: 0 0 10px #b8c7d6; +} + +.actionButtons a { + float: left; + padding: 5px 10px; + height: 32px; + font-size: 13px; + font-weight: 500; +} + +.actionButtons a, +.actionButtons li.primary a, +.actionButtons a.primary, +.actionButtons a.default { + text-shadow: none; + background: #fff; + color: #555; + border: 1px solid #e4e4e4; + border-radius: 3px; + /*box-shadow: 0 0 0 1px #E4E4E4;*/ + box-shadow: none; + transition: none; +} + +.actionButtons a:hover { + background: #1377c5; + box-shadow: none; + border-color: #1377c5; + color: #fff !important; + transition: none; +} + +.actionButtons a:active { + background-color: #3189ba; + border-color: #3189ba; +} + +.actionButtons li.primary a, +.actionButtons a.primary { + color: #fff; + border-color: #32ab9a; + background: #32ab9a linear-gradient(#32ab9a, #00948e); +} + +.actionButtons li.primary a:hover, +.actionButtons a.primary:hover { + background: #2b9385 linear-gradient(#2b9385, #007571); + border-color: #2b9385; +} + +.actionButtons li.primary a:active, +.actionButtons a.primary:active { + background: #32ab9a; + border-color: #32ab9a; +} + +.actionButtons img { + display: none; +} + +#treePane .actionButtons img { + display: inline; +} + +.actionButtons--tableheader .fa { + font-size: 14px; +} + +.sectionBody .actionButtons { + padding-top: 0; + min-height: 40px; +} + +.sectionBody .actionButtons li { + margin-right: 10px; +} + +.sectionBody .actionButtons a { + display: inline-block; + padding: 9px 10px; + line-height: 1; +} + +table.actionButtons { + margin-top: 1rem; + margin-bottom: 10px; +} + +table.actionButtons img { + display: inline-block; +} + +table.actionButtons .searchtext { + padding: 5px; + height: 24px; + width: 150px; +} + +.actionButtons .fa { + display: none; + text-align: center; + font-size: 1em; + line-height: 1em; + width: 1.1em; + vertical-align: initial +} + +.actionButtons .fa, +.actionButtons--eit .fa { + display: inline-block; +} + +.optionsTitle .fa { + display: inline-block; +} + +@media (max-width: 900px) { + .actionButtons a { + display: inline-block; + padding: 6px 10px + } + .tab-page .actionButtons a { + margin-top: 0 !important + } + .actionButtons a span { + display: none; + } + .actionButtons a .fa { + display: inline-block; + } +} + +/* [ TABLES ] */ + +/* table */ + +.table th, +.table td { + padding: 0.15rem 0.25rem; +} + +/* table-data */ + +.table.data { + width: 100%; + max-width: 100%; + margin-bottom: 0; + border-bottom: 1px solid #eceeef +} + +.table.data th, +.table.data thead td { + padding: 0.75rem; + text-transform: uppercase; + white-space: nowrap; + font-size: 0.675rem; + color: #777; + border-bottom: 1px solid #eceeef +} + +.table.data td { + padding: 0.55rem 0.75rem; +} + +.table.data td, +.table.data th, +.table.data thead td { + vertical-align: top; + border-top: 1px solid #eceeef +} + +.table.data td:first-child, +.table.data th:first-child, +.table.data.table-sm td:first-child, +.table.data.table-sm th:first-child { + padding-left: 1.25rem +} + +.table.data td:last-child, +.table.data th:last-child, +.table.data.table-sm td:last-child, +.table.data.table-sm th:last-child { + padding-right: 1.25rem +} + +.table.data thead { + background-color: #fff; +} + +.table.data > tbody > tr { + background-color: #f9f9f9; + transition-duration: .5s +} + +.table.data > tbody > tr:nth-child(2n) { + background-color: #fff +} + +.table.data > tbody > tr:hover { + cursor: default; + background-color: rgba(93, 109, 202, 0.16); + transition-duration: .05s +} + +.table.data tr.unstyled:hover { + background-color: inherit +} + +.table.data .actions { + white-space: nowrap +} + +.table.data .actions a { + color: #555 +} + +.table.data .actions a .fa, +.table.data .actions span .fa { + position: relative; + margin: 0 0.375rem; + font-size: 0.9rem; + color: #555 +} + +.table.data .actions a:hover .fa { + color: #000; +} + +.table.data .actions a:hover .fa.fa-trash { + color: #d80030 +} + +.table.data .actions a .fa::before { + position: relative; + z-index: 2; +} + +.table.data .actions a .fa::after { + content: ""; + position: absolute; + z-index: 1; + left: 50%; + top: 50%; + width: 1.5rem; + height: 1.5rem; + margin: -0.75rem 0 0 -0.75rem; + border-radius: 50%; + -webkit-transition: 0.15s; + transition: 0.15s; +} + +.table.data .actions a:hover .fa::after { + background-color: #fff +} + +.table.data .actions .disabled { + visibility: hidden +} + +/* table-data-nowrap */ + +.table.data.nowrap th, +.table.data.nowrap td { + white-space: nowrap +} + +/* table-data-sortable */ + +.table.data thead .sortable a, +.table.data thead .sortable-text a { + color: #777; + text-decoration: none !important; +} + +.table.data thead .sortable a:hover, +.table.data thead .sortable-text a:hover { + color: #222 +} + +.table.data thead .sortable a::after, +.table.data thead .sortable-text a::after { + content: "\f107"; + font-family: FontAwesome; + opacity: .3; + margin-left: .5em; +} + +.table.data thead .sortable.forwardSort a::after, +.table.data thead .sortable-text.forwardSort a::after { + opacity: 1; + content: "\f106"; + color: #d9534f +} + +.table.data thead .sortable.reverseSort a::after, +.table.data thead .sortable-text.reverseSort a::after { + opacity: 1; + content: "\f107"; + color: #d9534f +} + +.table.data thead .sortable:hover a::after, +.table.data thead .sortable-text:hover a::after, +.table.data thead .sortable-numeric:hover a::after, +.table.data thead .sortable-date:hover a::after { + opacity: 1 +} + +.table.data thead .sortable, +.table.data thead .sortable-text, +.table.data thead .sortable-numeric, +.table.data thead .sortable-date { + cursor: pointer +} + +.table.data thead .sortable-text span, +.table.data thead .sortable-numeric span, +.table.data thead .sortable-date span { + display: none +} + +.table.data.table-sortable > tbody > tr { + cursor: move; + transition-duration: .5s +} + +.table.data.table-sortable > tbody > tr.ghost { + background-color: rgba(93, 109, 202, 0.16); + color: #d9534f !important; + transition: background-color .5s, color .5s, transform 0s +} + +/* table-data-sm */ + +.table.data.table-sm td, +.table.data.table-sm th { + padding: .25rem .5rem; +} + +.table.data.table-sm th, +.table.data.table-sm thead td { + font-size: 0.75rem; + text-transform: none; +} + +/* table-data-even */ + +.table.data.table-even > tbody > tr:not(:hover) { + background-color: #fff +} + +.table.data.table-even > tbody > tr:nth-child(4n+1):not(:hover) { + background-color: #f6f8f8 +} + +.table.data.table-even > tbody > tr:nth-child(2n) { + background-color: #fff +} + +/* table-data-docs */ + +.table.data .doc-item .fa { + width: 1.2em; + font-size: 0.9rem; + text-align: center; + margin-right: 0.25rem +} + +.table.data .doc-item { + text-decoration: none +} + +.table.data .doc-item:hover span { + text-decoration: underline +} + +.table.data .doc-item.private .fa::after { + position: relative; + float: left; + margin: .5em -1em 0 0; + content: "\f023"; + font-size: 0.75em; + color: #d9534f; +} + +/* [ BREADCRUMBS ] */ + +ul.breadcrumbs { + margin: 0 1rem .5rem; + padding: 0 0 .5rem; + line-height: normal; + font-size: .675rem; + color: #888; + border-bottom: 1px dotted #cecaca; +} + +ul.breadcrumbs li { + list-style: none; + display: inline-block; + padding: 0; + margin: 0; +} + +ul.breadcrumbs a { + text-decoration: none; +} + +ul.breadcrumbs span { + display: inline-block; + width: 1.25em; + vertical-align: top; + text-indent: -2.25em; + overflow: hidden; +} + +ul.breadcrumbs span::after { + margin-left: 2em; + font-family: FontAwesome; + content: "\f105" +} + +/* [ PAGINATION ] */ + +#pagination { + padding: 0 1.25rem; + margin: .5rem 0 0; +} + +#pagination ul { + margin: 0 0 0 .5rem; + display: inline-block; +} + +#pagination li { + list-style: none; + display: inline-block; + margin: 0 0 0 1px; +} + +#pagination li a { + display: inline-block; + padding: 0 .5rem; + line-height: 1.7; + border: 1px solid #ddd; + text-decoration: none; + color: #333; +} + +#pagination li.currentPage a, +#pagination li a:hover { + color: #555; + border: 1px solid #555; +} + +/* [ SEARCHBAR ] */ + +.searchbar input[type=text] { + max-width: 10rem +} + +/* [ WIDGETS ] */ + +.widgets .card { + margin-bottom: 1rem; + border-width: 0; + border-radius: 0; + background-color: #fff; + -webkit-transition: box-shadow .35s; + transition: box-shadow .35s; + box-shadow: 0 0.1rem 0.3rem 0 rgba(0, 0, 0, 0.075); +} + +.widgets .card:hover { + box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.07); +} + +.widgets .card-header { + padding: .5rem 1rem; + font-size: .9rem; + color: #616a73; + font-weight: 700; + border-radius: 0; + border: none; + border-bottom: 1px solid rgba(0, 0, 0, .05); + text-transform: none; + background-color: transparent; + border-bottom: 1px solid rgba(0, 0, 0, 0.05); +} + +.widgets .card-header .fa { + font-size: .9rem +} + +.widgets .card-block { + padding: 0; +} + +.widgets .card-block .card-block p { + padding: 0 1rem +} + +.widgets .card-block .card-body { + padding: 1rem; +} + +.widgets .card-block .card-body + .card-body { + padding-top: 0 +} + +.widgets .table { + margin-bottom: 0rem +} + +.widgets .table.data td, +.widgets .table.data th, +.widgets .table.data thead td { + border-top: 0px; +} + +.widgets .table:not(.data) tr th, +.widgets .table:not(.data) tr td { + padding: .15rem; +} + +.widgets .table tr th:first-child, +.widgets .table tr td:first-child { + padding-left: 1rem !important +} + +.widgets .table tr th:last-child, +.widgets .table tr td:last-child { + padding-right: 1rem !important +} + +.widgets .table .actions a .fa { + margin: 0 .05rem; +} + +/* widgets custom */ + +.widgets #welcome .wm_buttons { + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + margin-bottom: 1rem; + padding: 0; + text-align: center; + border-bottom: 1px solid rgba(0, 0, 0, .05); +} + +.widgets #welcome .wm_button { + max-width: 16.666667%; + flex: 0 0 16.666667%; +} + +.widgets #welcome .wm_button a { + display: block; + height: 100%; + padding: 1rem 1rem .5rem; + text-decoration: none; + color: #646b7b; + box-shadow: none; + transition-duration: .5s +} + +.widgets #welcome .wm_button a:hover { + color: #373b46; + background-color: rgba(93, 109, 202, 0.16) +} + +.widgets #welcome .wm_button a .fa { + display: inline-block; +} + +.widgets #welcome .wm_button a .fa + span { + display: block; + padding: .5em 0; + line-height: 1em; + font-size: .7rem; +} + +.widgets #modxrecent_widget .table.data tbody tr:not(:hover) { + background-color: #fff +} + +.widgets #modxrecent_widget .table.data tbody tr:nth-child(4n+1):not(:hover) { + background-color: #f6f8f8 +} + +.widgets #modxrecent_widget .table.data tbody tr:nth-child(2n) { + background-color: #fff +} + +@media (max-width: 1399px) { + .widgets #welcome .wm_button { + max-width: 20%; + flex: 0 0 20%; + } +} + +@media (max-width: 1199px) { + .widgets #welcome .wm_button { + max-width: 25%; + flex: 0 0 25%; + } +} + +@media (max-width: 991px) { + .widgets #welcome .wm_button { + max-width: 33.3333%; + flex: 0 0 33.3333%; + } +} + +@media (max-width: 767px) { + .widgets #welcome .wm_button { + max-width: 50%; + flex: 0 0 50%; + } +} + +/* [ DATEPICKER ] */ + +.dp_container { + position: absolute; + z-index: 500; +} + +.dp_cal { + overflow: hidden; + width: 220px; + margin: 0.25rem 0; + background-color: #fff; + -webkit-box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.3); + box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.3); +} + +.dp_cal p { + position: relative; + margin: 10px; +} + +.dp_cal select { + font-size: 1em; + margin: 2px 3px; + width: auto !important +} + +.dp_cal select option { + padding: 1px 3px +} + +.dp_cal table { + border-collapse: collapse; + border-spacing: 0; + width: 100% +} + +.dp_cal td.dp_roll { + background-color: rgba(0, 0, 0, 0.1); + color: #333 !important +} + +.dp_cal th, +.dp_cal td { + font-size: 1em; + padding: 0.5em 0 !important; + text-align: center !important; + width: 14.2857%; + cursor: default +} + +.dp_cal tbody th { + background-color: #656d79; + color: #fff; +} + +.dp_cal tbody td:nth-child(6), +.dp_cal tbody td:nth-child(7) { + color: indianred +} + +.dp_cal .dp_empty { + background-color: #f9f9f9 +} + +.dp_cal .dp_hide { + visibility: hidden +} + +.dp_cal .dp_today { + background-color: #4caf50; + color: #fff !important +} + +.dp_cal .dp_selected { + background-color: #3189ba; + color: #fff !important +} + +.dp_cal input { + width: 68% !important +} + +.dp_cal button { + position: absolute; + top: 0; + right: 0; + margin: 0 !important; + width: 30% !important +} + +/* datepicker icon clear */ + +.clearDate { + position: relative; + margin: 0.5rem 0 0 -1.5rem; + z-index: 10; +} + +/* [ GRID STYLE ] */ + +.grid { + width: 100%; + background-color: #fff !important; + border: 1px solid rgba(0, 0, 0, 0.1); + border-collapse: collapse; +} + +.grid thead, +.grid tfoot { + background-color: #e9e9e9 +} + +.grid th, +.grid td { + padding: 0.375rem !important; + border: 1px solid #ddd +} + +.gridHeader, +.grid th { + color: #333; + font-weight: 500; + white-space: nowrap; + background-color: #e9e9e9; + text-align: left; +} + +.grid > tbody > tr:nth-child(2n) > td { + background-color: rgba(0, 0, 0, 0.03) +} + +.gridItem { + background-color: #fff; + padding: 3px; +} + +.gridAltItem { + background-color: #f7f7f7; + padding: 3px; +} + +.grid tbody tr:hover td { + background: #e9edf3; +} + +.grid a { + text-decoration: none; +} + +.grid img { + vertical-align: middle; + padding-right: 4px; +} + +/* SORTABLELIST */ + +ul.sortableList { + margin: 0; +} + +ul.sortableList li { + position: relative; + z-index: 1; + float: left; + clear: both; + max-width: 100%; + width: 30rem; + list-style: none; + font-weight: bold; + cursor: move; + padding: 0.46153846em 1em; + margin: .0625rem 0; + border: 1px solid #ccc; + line-height: 1.23076923; + background-color: #fff; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + box-shadow: none; + transition: color .3s, box-shadow .3s, transform .3s, z-index .3s step-end; +} + +ul.sortableList li.ghost { + z-index: 2; + box-shadow: 0 0.25rem 1.5rem rgba(0, 0, 0, 0.15); + transition: color .3s, box-shadow .3s, transform 0s, z-index 0s; +} + +/* [ TOOLTIPS ] */ + +.evo-tooltip, +.custom-tip { + position: fixed; + z-index: 13000; + width: 13rem; + margin: 1rem; + padding: 0.9rem 1rem; + font-size: 0.75rem; + line-height: 1.5; + font-family: sans-serif; + text-align: left; + color: #333; + background-color: #fff; + visibility: hidden; + transition-duration: .3s; + transform: translate3d(1rem, 0, 0); + -webkit-box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.15); + box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.15); +} + +.evo-tooltip { + opacity: 0; + content: attr(data-tooltip); +} + +.evo-tooltip.show { + opacity: 1; + visibility: visible; + transform: translate3d(0, 0, 0); +} + +[data-tooltip] { + cursor: help +} + +[data-tooltip].fa-question-circle { + opacity: 0.15; +} + +[data-tooltip].fa-question-circle:hover { + opacity: 1; +} + +/* [ FILES MANAGER ] */ + +#ManageFiles { + padding-bottom: 1rem; +} + +#ManageFiles .breadcrumbs {} + +#ManageFiles .breadcrumbs a, +#ManageFiles .breadcrumbs span { + display: inline-block; + padding: 0 0.25em; +} + +#ManageFiles #imageviewer { + text-align: center; +} + +#ManageFiles #imageviewer img { + display: inline-block; + max-width: 100%; + margin-top: 1rem +} + +#FilesTable { + margin-bottom: 1rem; + border-bottom: 1px solid #ddd; +} + +#file_editfile.section .sectionHeader { + margin: 0; + padding: 0.5rem 1rem; + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + background-color: #f9f9f9 +} + +#file_editfile.section .sectionBody { + margin: 0 !important; + padding: 0 0 1rem; + border: none; + border-bottom: 1px solid #ddd; + background-color: #f9f9f9 +} + +#file_editfile td { + padding: 0 !important; +} + +#file_editfile #content { + float: left; + width: 100%; + min-height: 25rem; + border: none; + border-bottom: 1px solid rgba(0, 0, 0, .15) +} + +/* STYLES FOR PAGE HELP */ + +#helpPane h1 { + margin-bottom: 1em; + padding: .5rem; + font-size: .8rem; + border-bottom: 1px solid #e0e0e0; +} + +#helpPane li:not(:first-child) > strong { + margin-top: 1.4em; +} + +#helpPane li > strong { + display: block; + font-size: 14px; +} + +#helpPane pre { + border: 1px solid rgba(0, 0, 0, 0.1); + padding: 1em; +} + +#helpPane #tab2Help img { + margin-bottom: 1rem; +} + +/* modes theme */ + +/* lightness */ + +/* light */ + +/* dark */ + +.dark .section-editor textarea { + background-color: #282c34; + color: #abb2bf +} + +.dark .tab-page, +.dark .sectionBody .tab-page, +.dark .tab-row .tab.selected, +.dark .tab-row .tab.selected.hover, +.dark .tab-row .tab.selected:before, +.dark .tab-row .tab.selected span { + background-color: #f9f9f9; +} + +.dark, +.dark .resourceTable .panel-heading { + background: #ecf0f1 !important; +} + +.dark .resourceTable .panel-heading:hover { + background: #ecf0f1 !important; +} + +.dark .multitv .list li.element a.copy, +.multitv .list li.element a.remove { + background: transparent !important; +} + +.dark .multitv .list li.element { + background: #fefefe !important; +} + +.dark .split { + border-color: rgba(0, 0, 0, .05) +} + +.dark hr { + background: transparent; +} + +/*.dark .content-blocks .block { background: #fefefe; border: 1px solid #e3e3e3; } +.dark .content-blocks .block .fields-group { border: 1px dashed #e2e2e2; }*/ + +.dark .content-blocks input[type="text"], +.dark .content-blocks input[type="password"], +.dark .content-blocks input[type="number"], +.dark .content-blocks textarea { + background-color: #fbfbfb !important; + border-color: #dbdbdb !important; +} + +.dark .content-blocks .controls { + background: #f9f9f9 !important; +} + +.dark .widgets .card-header { + color: #616a73; + background-color: #fafafa; +} + +/* darkness */ + +.darkness { + background-color: #282c34; + color: #aaa +} + +.darkness .container-body { + background-color: #282c34; +} + +.darkness > .container-body, +.darkness .page { + background-color: #282c34; +} + +.darkness .sectionBody .tab-page, +.darkness .tab-page { + background-color: #282c34; + box-shadow: none; +} + +.darkness .widgets .card, +.darkness h1, +.darkness .element-edit-message, +.darkness #ManageFiles .breadcrumbs { + background-color: #202329; +} + +.darkness #edit-info.element-edit-message, +.darkness #add-info.element-edit-message, +.darkness #sort-info.element-edit-message, +.darkness #categorize-info.element-edit-message { + background-color: #282c34; +} + +.darkness .msg-container { + border-bottom: 1px solid #414449; +} + +.darkness .widgets #welcome .wm_button a { + color: #aaa; +} + +.darkness .widgets #welcome .wm_button a:hover { + background-color: rgba(255, 255, 255, 0.08); + color: #e8e8e8; +} + +.darkness .widgets .card-header { + color: #b0b0b1; + border-bottom: 1px solid #2b2e34; +} + +.darkness #news .card-block ul li, +.darkness #security .card-block ul li { + border-bottom: 1px solid #2b2e34; +} + +.darkness #news .card-block ul li:last-child, +.darkness #security .card-block ul li:last-child, +.darkness table.table.table--edit > tbody > tr > td { + border: none +} + +.darkness .multitv .list li.element { + background: #282c34 !important; + border-color: #414449; +} + +.darkness .multitv .list li.element input[type="text"], +.darkness .multitv .list li.element input[type="password"], +.darkness .multitv .list li.element input[type="number"], +.darkness .multitv .list li.element textarea { + background-color: #202329 !important; + border-color: #414449 !important; +} + +.darkness #displayparams { + width: calc(100% + 2.5rem); + max-width: calc(100% + 2.5rem); + margin: 0 -1.25rem !important; +} + +.darkness #content_body { + margin: 0 -1.5rem; +} + +.darkness .card .table.data, +.darkness .table td[style="background-color:#ffffff;"] { + background: #202329 !important; +} + +.darkness .table.data, +.darkness .grid { + background: #282c34 !important; + border: none !important +} + +.darkness .table.data thead, +.darkness .grid thead, +.darkness #editorRow_TinyMCE { + background: none +} + +.darkness .table.data thead th, +.darkness .table.data thead td, +.darkness .grid th, +.darkness .grid thead td { + padding: 0.75rem !important; + background-color: #202329; + border: none; + border-bottom: 1px solid #1f5994; + color: #777; + text-transform: uppercase; + font-size: 0.675rem; +} + +.darkness .table.data thead .sortable a, +.darkness .table.data thead .sortable-text a, +.darkness .sortabletable th a { + color: #777; +} + +.darkness .table th a:hover, +.darkness .table thead td a:hover, +.darkness .grid th a:hover, +.darkness .grid thead td a:hover, +.darkness .table .sortable:hover a, +.darkness .table .sortable-text:hover a { + color: #eee !important; +} + +.darkness .table.data thead .sortable a::after, +.darkness .table.data thead .sortable-text a::after { + opacity: 1; +} + +.darkness .sortabletable thead tr, +.darkness .sortabletable th:active { + background-color: #202329 +} + +.darkness .table tbody tr, +.darkness .grid tbody tr, +.darkness table.table.table--edit > tbody > tr { + background: none !important; +} + +.darkness .table > tbody > tr > td, +.darkness .grid > tbody > tr > td { + background: none; + border: none !important; + border-bottom: 1px solid #2b2e34 !important; + color: inherit; +} + +.darkness .table > tbody > tr:nth-child(2n), +.darkness .grid > tbody > tr:nth-child(2n) { + background-color: #252930 !important; +} + +.darkness .table.data tr > td:first-child, +.darkness .table.data tr > th:first-child, +.darkness .grid tr > td:first-child, +.darkness .grid > tr > th:first-child { + padding-left: 1.25rem !important; +} + +.darkness .table.data tr > td:last-child, +.darkness .table.data tr > th:last-child, +.darkness .grid tr > td:last-child, +.darkness .grid > tr > th:last-child { + padding-right: 1.25rem !important; +} + +.darkness table.table.table--edit > tbody > tr > th, +.darkness table.table.table--edit > tbody > tr > td, +.darkness form[name="settings"] table > tbody td, +.darkness form[name="settings"] table > tbody th { + padding: .25rem .5rem; + background: none; + border: none !important; + color: inherit; +} + +.darkness .table.data .actions a, +.darkness .table.data .actions a .fa, +.darkness .table.data .actions span .fa { + color: inherit; +} + +.darkness .table.data .actions a:hover .fa::before { + color: #eee; +} + +.darkness .table.data .actions a:hover .fa::after { + background-color: #3b414e; +} + +.darkness .table.data .actions a:hover .fa.fa-trash::before { + color: #d80030; +} + +.darkness table .split, +.darkness #editorRow_TinyMCE tr, +.darkness table.table.table--edit > tbody > tr, +.darkness .sysSettings > tbody > tr { + border: none; + border-bottom: 1px solid #23262b !important; +} + +.darkness table .split { + margin: 0 -.5rem; +} + +.darkness table tr.noborder { + border: none !important; +} + +.darkness table .comment { + color: #999 !important; +} + +.darkness #editorRow_TinyMCE > tbody > tr:first-child > th { + background: none !important; + color: inherit !important; +} + +.darkness .section-editor, +.darkness #content_body { + border-top: 1px solid #414449; +} + +.darkness #file_editfile .navbar-editor, +.darkness #file_editfile [name="editFile"], +.darkness #content_body, +.darkness .section-editor { + border-bottom: 1px solid #414449; +} + +.darkness .section-editor > textarea, +.darkness #content_body > div > textarea, +.darkness #content_body > .section-editor { + margin-top: 0 +} + +.darkness #content_body textarea, +.darkness .section-editor textarea, +.darkness #content_body > .section-editor { + display: block; + border: none +} + +.darkness ul.sortableList li { + background-color: #202329; + border: 1px solid #414449; } -/* old style */ -#actions .actionButtons { float: left; min-height: 32px } -#actions .actionButtons li { position: relative; float: left; margin-right: 3px; border: none } -#actions .actionButtons li a, #actions .actionButtons .plus { float: left; padding: 0 10px !important; height: 32px; line-height: 30px; -webkit-user-select: none; user-select: none; } -#actions .actionButtons li:last-child { margin: 0 } -#actions .actionButtons #Button1 a { width: 100%; text-align: left; } -#actions .actionButtons .plus { overflow: hidden; float: right; margin: -32px 0 0 0; width: 35px; border-radius: 0 3px 3px 0 !important; text-align: center; cursor: default; font: normal normal normal 0/30px FontAwesome } -#actions .actionButtons .plus::before { content: "\f107"; font-size: 14px } -#actions .actionButtons .show .plus::before { content: "\f106"; } -#actions .actionButtons .dropdown-menu { display: none; position: absolute; z-index: -1; left: auto; right: 0; top: 100%; width: 100%; min-width: 35px; margin: -2px 0 0; padding: 2px 0 0; text-align: left; font-size: 1em; background-color: #fff; border: 1px solid #32ab9a; border-top: none; border-radius: 0 0 3px 3px; overflow: hidden; } -#actions .actionButtons .show > .dropdown-menu { display: block } -#actions .actionButtons .dropdown-menu > span { display: block; padding: 0 10px; height: 32px; line-height: 30px; border: none; border-top: 1px solid #f2f2f2; cursor: pointer; } -#actions .actionButtons .dropdown-menu > span:hover { background-color: #fbfbfb; } -#actions .actionButtons select#stay { display: block; position: relative; z-index: -1; clear: both; width: auto; height: 0; padding: 0 10px; margin: -100% 0 -32px 0; font-size: 1em; opacity: 0; visibility: hidden; } -#actions .actionButtons #Button1 a, #actions .actionButtons .plus { color: #fff; border-color: #32ab9a; background: #32ab9a linear-gradient(#32ab9a, #00948e); } -#actions .actionButtons #Button1 a:hover, #actions .actionButtons .plus:hover { background: #2b9385 linear-gradient(#2b9385, #007571); border-color: #2b9385; } -#actions .actionButtons #Button1 a:active, #actions .actionButtons .plus:active { background: #32ab9a; border-color: #32ab9a; } -@media (max-width: 900px) { -#actions .actionButtons li a, #actions .actionButtons .dropdown-menu span { font-size: 0 } -#actions .actionButtons li a .fa, #actions .actionButtons .dropdown-menu span .fa { display: inline-block; font-size: 14px; line-height: 30px } -#actions .actionButtons .dropdown-menu { width: 35px } -#actions .actionButtons #Button1 a { margin: 0; width: auto } -#actions .actionButtons .plus { margin: 0 0 0 -2px } -#actions .actionButtons select#stay { display: none } + +.darkness ul.sortableList li:hover { + border-color: #5d5d5d; } -/* actionButtons in content ( old style ) */ -.actionButtons { margin: 0; padding: 0; background: none; width: auto; white-space: nowrap; } -.actionButtons li { float: left; margin: 0; padding: 0; list-style: none; } -.actionButtons li:before, .mmTagList li:before, .rTable li:before, .tab-pane ul li ul li:before, .dashboard li:before, div#idShowHideSocialBox.sectionBody > div.btn-group.ope > ul.dropdown-menu > li:before, .sectionBody .multitv .list li:before { display: none; content: ''; } -.actionButtons img { vertical-align: top; margin-top: 1px; opacity: 0.3; } -.actionButtons:hover img { opacity: 1; } -.actionButtons a:hover { border-color: #999; -webkit-box-shadow: 1px 1px 2px #aaa; box-shadow: 1px 1px 2px #aaa; -webkit-transition: .3s ease; transition: .3s ease; background: -moz-linear-gradient(#fff, #f5f5f5); background: -webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#f5f5f5)); background: -o-linear-gradient(#fff, #f5f5f5); text-decoration: none !important; } -.actionButtons a:active { background: #92aac4 bottom left; -webkit-box-shadow: 0 0 10px #b8c7d6; box-shadow: 0 0 10px #b8c7d6; } -.actionButtons a { float: left; padding: 5px 10px; height: 32px; font-size: 13px; font-weight: 500; } -.actionButtons a, .actionButtons li.primary a, .actionButtons a.primary, .actionButtons a.default { text-shadow: none; background: #fff; color: #555; border: 1px solid #e4e4e4; border-radius: 3px; /*box-shadow: 0 0 0 1px #E4E4E4;*/ box-shadow: none; transition: none; } -.actionButtons a:hover { background: #1377c5; box-shadow: none; border-color: #1377c5; color: #fff !important; transition: none; } -.actionButtons a:active { background-color: #3189ba; border-color: #3189ba; } -.actionButtons li.primary a, .actionButtons a.primary { color: #fff; border-color: #32ab9a; background: #32ab9a linear-gradient(#32ab9a, #00948e); } -.actionButtons li.primary a:hover, .actionButtons a.primary:hover { background: #2b9385 linear-gradient(#2b9385, #007571); border-color: #2b9385; } -.actionButtons li.primary a:active, .actionButtons a.primary:active { background: #32ab9a; border-color: #32ab9a; } -.actionButtons img { display: none; } -#treePane .actionButtons img { display: inline; } -.actionButtons--tableheader .fa { font-size: 14px; } -.sectionBody .actionButtons { padding-top: 0; min-height: 40px; } -.sectionBody .actionButtons li { margin-right: 10px; } -.sectionBody .actionButtons a { display: inline-block; padding: 9px 10px; line-height: 1; } -table.actionButtons { margin-top: 1rem; margin-bottom: 10px; } -table.actionButtons img { display: inline-block; } -table.actionButtons .searchtext { padding: 5px; height: 24px; width: 150px; } -.actionButtons .fa { display: none; text-align: center; font-size: 1em; line-height: 1em; width: 1.1em; vertical-align: initial } -.actionButtons .fa, .actionButtons--eit .fa { display: inline-block; } -.optionsTitle .fa { display: inline-block; } -@media (max-width: 900px) { -.actionButtons a { display: inline-block; padding: 6px 10px } -.tab-page .actionButtons a { margin-top: 0 !important } -.actionButtons a span { display: none; } -.actionButtons a .fa { display: inline-block; } + +.darkness ul.sortableList li.ghost { + background-color: #282c34; + border-color: #1976d2; } -/* [ TABLES ] */ -/* table */ -.table th, .table td { padding: 0.15rem 0.25rem; } -/* table-data */ -.table.data { width: 100%; max-width: 100%; margin-bottom: 0; border-bottom: 1px solid #eceeef } -.table.data th, .table.data thead td { padding: 0.75rem; text-transform: uppercase; white-space: nowrap; font-size: 0.675rem; color: #777; border-bottom: 1px solid #eceeef } -.table.data td { padding: 0.55rem 0.75rem; } -.table.data td, .table.data th, .table.data thead td { vertical-align: top; border-top: 1px solid #eceeef } -.table.data td:first-child, .table.data th:first-child, .table.data.table-sm td:first-child, .table.data.table-sm th:first-child { padding-left: 1.25rem } -.table.data td:last-child, .table.data th:last-child, .table.data.table-sm td:last-child, .table.data.table-sm th:last-child { padding-right: 1.25rem } -.table.data thead { background-color: #fff; } -.table.data > tbody > tr { background-color: #f9f9f9; transition-duration: .5s } -.table.data > tbody > tr:nth-child(2n) { background-color: #fff } -.table.data > tbody > tr:hover { cursor: default; background-color: rgba(93, 109, 202, 0.16); transition-duration: .05s } -.table.data tr.unstyled:hover { background-color: inherit } -.table.data .actions { white-space: nowrap } -.table.data .actions a { color: #555 } -.table.data .actions a .fa, .table.data .actions span .fa { position: relative; margin: 0 0.375rem; font-size: 0.9rem; color: #555 } -.table.data .actions a:hover .fa { color: #000; } -.table.data .actions a:hover .fa.fa-trash { color: #d80030 } -.table.data .actions a .fa::before { position: relative; z-index: 2; } -.table.data .actions a .fa::after { content: ""; position: absolute; z-index: 1; left: 50%; top: 50%; width: 1.5rem; height: 1.5rem; margin: -0.75rem 0 0 -0.75rem; border-radius: 50%; -webkit-transition: 0.15s; transition: 0.15s; } -.table.data .actions a:hover .fa::after { background-color: #fff } -.table.data .actions .disabled { visibility: hidden } -/* table-data-nowrap */ -.table.data.nowrap th, .table.data.nowrap td { white-space: nowrap } -/* table-data-sortable */ -.table.data thead .sortable a, .table.data thead .sortable-text a { color: #777; text-decoration: none !important; } -.table.data thead .sortable a:hover, .table.data thead .sortable-text a:hover { color: #222 } -.table.data thead .sortable a::after, .table.data thead .sortable-text a::after { content: "\f107"; font-family: FontAwesome; opacity: .3; margin-left: .5em; } -.table.data thead .sortable.forwardSort a::after, .table.data thead .sortable-text.forwardSort a::after { opacity: 1; content: "\f106"; color: #d9534f } -.table.data thead .sortable.reverseSort a::after, .table.data thead .sortable-text.reverseSort a::after { opacity: 1; content: "\f107"; color: #d9534f } -.table.data thead .sortable:hover a::after, .table.data thead .sortable-text:hover a::after, .table.data thead .sortable-numeric:hover a::after, .table.data thead .sortable-date:hover a::after { opacity: 1 } -.table.data thead .sortable, .table.data thead .sortable-text, .table.data thead .sortable-numeric, .table.data thead .sortable-date { cursor: pointer } -.table.data thead .sortable-text span, .table.data thead .sortable-numeric span, .table.data thead .sortable-date span { display: none } -.table.data.table-sortable > tbody > tr { cursor: move; transition-duration: .5s } -.table.data.table-sortable > tbody > tr.ghost { background-color: rgba(93, 109, 202, 0.16); color: #d9534f !important; transition: background-color .5s, color .5s, transform 0s } -/* table-data-sm */ -.table.data.table-sm td, .table.data.table-sm th { padding: .25rem .5rem; } -.table.data.table-sm th, .table.data.table-sm thead td { font-size: 0.75rem; text-transform: none; } -/* table-data-even */ -.table.data.table-even > tbody > tr:not(:hover) { background-color: #fff } -.table.data.table-even > tbody > tr:nth-child(4n+1):not(:hover) { background-color: #f6f8f8 } -.table.data.table-even > tbody > tr:nth-child(2n) { background-color: #fff } -/* table-data-docs */ -.table.data .doc-item .fa { width: 1.2em; font-size: 0.9rem; text-align: center; margin-right: 0.25rem } -.table.data .doc-item { text-decoration: none } -.table.data .doc-item:hover span { text-decoration: underline } -.table.data .doc-item.private .fa::after { position: relative; float: left; margin: .5em -1em 0 0; content: "\f023"; font-size: 0.75em; color: #d9534f; } -/* [ BREADCRUMBS ] */ -ul.breadcrumbs { margin: 0 1rem .5rem; padding: 0 0 .5rem; line-height: normal; font-size: .675rem; color: #888; border-bottom: 1px dotted #cecaca; } -ul.breadcrumbs li { list-style: none; display: inline-block; padding: 0; margin: 0; } -ul.breadcrumbs a { text-decoration: none; } -ul.breadcrumbs span { display: inline-block; width: 1.25em; vertical-align: top; text-indent: -2.25em; overflow: hidden; } -ul.breadcrumbs span::after { margin-left: 2em; font-family: FontAwesome; content: "\f105" } -/* [ PAGINATION ] */ -#pagination { padding: 0 1.25rem; margin: .5rem 0 0; } -#pagination ul { margin: 0 0 0 .5rem; display: inline-block; } -#pagination li { list-style: none; display: inline-block; margin: 0 0 0 1px; } -#pagination li a { display: inline-block; padding: 0 .5rem; line-height: 1.7; border: 1px solid #ddd; text-decoration: none; color: #333; } -#pagination li.currentPage a, #pagination li a:hover { color: #555; border: 1px solid #555; } -/* [ SEARCHBAR ] */ -.searchbar input[type=text] { max-width: 10rem } -/* [ WIDGETS ] */ -.widgets .card { margin-bottom: 1rem; border-width: 0; border-radius: 0; background-color: #fff; -webkit-transition: box-shadow .35s; transition: box-shadow .35s; box-shadow: 0 0.1rem 0.3rem 0 rgba(0, 0, 0, 0.075);} -.widgets .card:hover { box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.07); } -.widgets .card-header { padding: .5rem 1rem; font-size: .9rem; color: #616a73; font-weight: 700; border-radius: 0; border: none; border-bottom: 1px solid rgba(0, 0, 0, .05); text-transform: none;background-color: transparent;border-bottom: 1px solid rgba(0, 0, 0, 0.05); } -.widgets .card-header .fa { font-size: .9rem } -.widgets .card-block { padding: 0; } -.widgets .card-block .card-block p { padding: 0 1rem } -.widgets .card-block .card-body { padding: 1rem; } -.widgets .card-block .card-body + .card-body { padding-top: 0 } -.widgets .table { margin-bottom: 0rem } -.widgets .table.data td, .widgets .table.data th, .widgets .table.data thead td {border-top: 0px;} -.widgets .table:not(.data) tr th, .widgets .table:not(.data) tr td { padding: .15rem; } -.widgets .table tr th:first-child, .widgets .table tr td:first-child { padding-left: 1rem !important } -.widgets .table tr th:last-child, .widgets .table tr td:last-child { padding-right: 1rem !important } -.widgets .table .actions a .fa { margin: 0 .05rem; } -/* widgets custom */ -.widgets #welcome .wm_buttons { display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; margin-bottom: 1rem; padding: 0; text-align: center; border-bottom: 1px solid rgba(0, 0, 0, .05); } -.widgets #welcome .wm_button { max-width: 16.666667%; flex: 0 0 16.666667%; } -.widgets #welcome .wm_button a { display: block; height: 100%; padding: 1rem 1rem .5rem; text-decoration: none; color: #646b7b; box-shadow: none; transition-duration: .5s } -.widgets #welcome .wm_button a:hover { color: #373b46; background-color: rgba(93, 109, 202, 0.16) } -.widgets #welcome .wm_button a .fa { display: inline-block; } -.widgets #welcome .wm_button a .fa + span { display: block; padding: .5em 0; line-height: 1em; font-size: .7rem; } -.widgets #modxrecent_widget .table.data tbody tr:not(:hover) { background-color: #fff } -.widgets #modxrecent_widget .table.data tbody tr:nth-child(4n+1):not(:hover) { background-color: #f6f8f8 } -.widgets #modxrecent_widget .table.data tbody tr:nth-child(2n) { background-color: #fff } -@media (max-width: 1399px) { -.widgets #welcome .wm_button { max-width: 20%; flex: 0 0 20%; } + +.darkness .disabledPlugin, +.darkness .disabledPlugin a { + color: #de6961; } -@media (max-width: 1199px) { -.widgets #welcome .wm_button { max-width: 25%; flex: 0 0 25%; } + +.darkness .alert { + box-shadow: 0 0.25rem 2rem rgba(0, 0, 0, 0.15); } -@media (max-width: 991px) { -.widgets #welcome .wm_button { max-width: 33.3333%; flex: 0 0 33.3333%; } + +.darkness .alert-danger { + background-color: #612329; + border-color: #612329; + color: #da706d; } -@media (max-width: 767px) { -.widgets #welcome .wm_button { max-width: 50%; flex: 0 0 50%; } + +.darkness .alert-danger b { + color: #f7e6e8 !important } -/* [ DATEPICKER ] */ -.dp_container { position: absolute; z-index: 500; } -.dp_cal { overflow: hidden; width: 220px; margin: 0.25rem 0; background-color: #fff; -webkit-box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.3); box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.3); } -.dp_cal p { position: relative; margin: 10px; } -.dp_cal select { font-size: 1em; margin: 2px 3px; width: auto !important } -.dp_cal select option { padding: 1px 3px } -.dp_cal table { border-collapse: collapse; border-spacing: 0; width: 100% } -.dp_cal td.dp_roll { background-color: rgba(0, 0, 0, 0.1); color: #333 !important } -.dp_cal th, .dp_cal td { font-size: 1em; padding: 0.5em 0 !important; text-align: center !important; width: 14.2857%; cursor: default } -.dp_cal tbody th { background-color: #656d79; color: #fff; } -.dp_cal tbody td:nth-child(6), .dp_cal tbody td:nth-child(7) { color: indianred } -.dp_cal .dp_empty { background-color: #f9f9f9 } -.dp_cal .dp_hide { visibility: hidden } -.dp_cal .dp_today { background-color: #4caf50; color: #fff !important } -.dp_cal .dp_selected { background-color: #3189ba; color: #fff !important } -.dp_cal input { width: 68% !important } -.dp_cal button { position: absolute; top: 0; right: 0; margin: 0 !important; width: 30% !important } -/* datepicker icon clear */ -.clearDate { position: relative; margin: 0.5rem 0 0 -1.5rem; z-index: 10; } -/* [ GRID STYLE ] */ -.grid { width: 100%; background-color: #fff !important; border: 1px solid rgba(0, 0, 0, 0.1); border-collapse: collapse; } -.grid thead, .grid tfoot { background-color: #e9e9e9 } -.grid th, .grid td { padding: 0.375rem !important; border: 1px solid #ddd } -.gridHeader, .grid th { color: #333; font-weight: 500; white-space: nowrap; background-color: #e9e9e9; text-align: left; } -.grid > tbody > tr:nth-child(2n) > td { background-color: rgba(0, 0, 0, 0.03) } -.gridItem { background-color: #fff; padding: 3px; } -.gridAltItem { background-color: #f7f7f7; padding: 3px; } -.grid tbody tr:hover td { background: #e9edf3; } -.grid a { text-decoration: none; } -.grid img { vertical-align: middle; padding-right: 4px; } -/* SORTABLELIST */ -ul.sortableList { margin: 0; } -ul.sortableList li { position: relative; z-index: 1; float: left; clear: both; max-width: 100%; width: 30rem; list-style: none; font-weight: bold; cursor: move; padding: 0.46153846em 1em; margin: .0625rem 0; border: 1px solid #ccc; line-height: 1.23076923; background-color: #fff; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); box-shadow: none; transition: color .3s, box-shadow .3s, transform .3s, z-index .3s step-end; } -ul.sortableList li.ghost { z-index: 2; box-shadow: 0 0.25rem 1.5rem rgba(0, 0, 0, 0.15); transition: color .3s, box-shadow .3s, transform 0s, z-index 0s; } -/* [ TOOLTIPS ] */ -.evo-tooltip, .custom-tip { position: fixed; z-index: 13000; width: 13rem; margin: 1rem; padding: 0.9rem 1rem; font-size: 0.75rem; line-height: 1.5; font-family: sans-serif; text-align: left; color: #333; background-color: #fff; visibility: hidden; transition-duration: .3s; transform: translate3d(1rem, 0, 0); -webkit-box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.15); box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.15); } -.evo-tooltip { opacity: 0; content: attr(data-tooltip); } -.evo-tooltip.show { opacity: 1; visibility: visible; transform: translate3d(0, 0, 0); } -[data-tooltip] { cursor: help } -[data-tooltip].fa-question-circle { opacity: 0.15; } -[data-tooltip].fa-question-circle:hover { opacity: 1; } -/* [ FILES MANAGER ] */ -#ManageFiles { padding-bottom: 1rem; } -#ManageFiles .breadcrumbs { } -#ManageFiles .breadcrumbs a, #ManageFiles .breadcrumbs span { display: inline-block; padding: 0 0.25em; } -#ManageFiles #imageviewer { text-align: center; } -#ManageFiles #imageviewer img { display: inline-block; max-width: 100%; margin-top: 1rem } -#FilesTable { margin-bottom: 1rem; border-bottom: 1px solid #ddd; } -#file_editfile.section .sectionHeader { margin: 0; padding: 0.5rem 1rem; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; background-color: #f9f9f9 } -#file_editfile.section .sectionBody { margin: 0 !important; padding: 0 0 1rem; border: none; border-bottom: 1px solid #ddd; background-color: #f9f9f9 } -#file_editfile td { padding: 0 !important; } -#file_editfile #content { float: left; width: 100%; min-height: 25rem; border: none; border-bottom: 1px solid rgba(0, 0, 0, .15) } -/* STYLES FOR PAGE HELP */ -#helpPane h1 { margin-bottom: 1em; padding: .5rem; font-size: .8rem; border-bottom: 1px solid #e0e0e0; } -#helpPane li:not(:first-child) > strong { margin-top: 1.4em; } -#helpPane li > strong { display: block; font-size: 14px; } -#helpPane pre { border: 1px solid rgba(0, 0, 0, 0.1); padding: 1em; } -#helpPane #tab2Help img { margin-bottom: 1rem; } -/* modes theme */ -/* lightness */ -/* light */ -/* dark */ -.dark .section-editor textarea { background-color: #282c34; color: #abb2bf } -.dark .tab-page, .dark .sectionBody .tab-page, .dark .tab-row .tab.selected, .dark .tab-row .tab.selected.hover, .dark .tab-row .tab.selected:before, .dark .tab-row .tab.selected span { background-color: #f9f9f9; } -.dark, .dark .resourceTable .panel-heading { background: #ecf0f1 !important; } -.dark .resourceTable .panel-heading:hover { background: #ecf0f1 !important; } -.dark .multitv .list li.element a.copy, .multitv .list li.element a.remove { background: transparent !important; } -.dark .multitv .list li.element { background: #fefefe !important; } -.dark .split { border-color: rgba(0, 0, 0, .05) } -.dark hr { background: transparent; } -/*.dark .content-blocks .block { background: #fefefe; border: 1px solid #e3e3e3; } -.dark .content-blocks .block .fields-group { border: 1px dashed #e2e2e2; }*/ -.dark .content-blocks input[type="text"], .dark .content-blocks input[type="password"], .dark .content-blocks input[type="number"], .dark .content-blocks textarea { background-color: #fbfbfb !important; border-color: #dbdbdb !important; } -.dark .content-blocks .controls { background: #f9f9f9 !important; } -.dark .widgets .card-header { color: #616a73; background-color: #fafafa; } -/* darkness */ -.darkness { background-color: #282c34; color: #aaa } -.darkness .container-body { background-color: #282c34; } -.darkness > .container-body, .darkness .page { background-color: #282c34; } -.darkness .sectionBody .tab-page, .darkness .tab-page { background-color: #282c34; box-shadow: none; } -.darkness .widgets .card, .darkness h1, .darkness .element-edit-message, .darkness #ManageFiles .breadcrumbs { background-color: #202329; } -.darkness #edit-info.element-edit-message, .darkness #add-info.element-edit-message, .darkness #sort-info.element-edit-message, .darkness #categorize-info.element-edit-message { background-color: #282c34; } -.darkness .msg-container { border-bottom: 1px solid #414449; } -.darkness .widgets #welcome .wm_button a { color: #aaa; } -.darkness .widgets #welcome .wm_button a:hover { background-color: rgba(255, 255, 255, 0.08); color: #e8e8e8; } -.darkness .widgets .card-header { color: #b0b0b1; border-bottom: 1px solid #2b2e34; } -.darkness #news .card-block ul li, .darkness #security .card-block ul li { border-bottom: 1px solid #2b2e34; } -.darkness #news .card-block ul li:last-child, .darkness #security .card-block ul li:last-child, .darkness table.table.table--edit > tbody > tr > td { border: none } -.darkness .multitv .list li.element { background: #282c34 !important; border-color: #414449; } -.darkness .multitv .list li.element input[type="text"], .darkness .multitv .list li.element input[type="password"], .darkness .multitv .list li.element input[type="number"], .darkness .multitv .list li.element textarea { background-color: #202329 !important; border-color: #414449 !important; } -.darkness #displayparams { width: calc(100% + 2.5rem); max-width: calc(100% + 2.5rem); margin: 0 -1.25rem !important; } -.darkness #content_body { margin: 0 -1.5rem; } -.darkness .card .table.data, .darkness .table td[style="background-color:#ffffff;"] { background: #202329 !important; } -.darkness .table.data, .darkness .grid { background: #282c34 !important; border: none !important } -.darkness .table.data thead, .darkness .grid thead, .darkness #editorRow_TinyMCE { background: none } -.darkness .table.data thead th, .darkness .table.data thead td, .darkness .grid th, .darkness .grid thead td { padding: 0.75rem !important; background-color: #202329; border: none; border-bottom: 1px solid #1f5994; color: #777; text-transform: uppercase; font-size: 0.675rem; } -.darkness .table.data thead .sortable a, .darkness .table.data thead .sortable-text a, .darkness .sortabletable th a { color: #777; } -.darkness .table th a:hover, .darkness .table thead td a:hover, .darkness .grid th a:hover, .darkness .grid thead td a:hover, .darkness .table .sortable:hover a, .darkness .table .sortable-text:hover a { color: #eee !important; } -.darkness .table.data thead .sortable a::after, .darkness .table.data thead .sortable-text a::after { opacity: 1; } -.darkness .sortabletable thead tr, .darkness .sortabletable th:active { background-color: #202329 } -.darkness .table tbody tr, .darkness .grid tbody tr, .darkness table.table.table--edit > tbody > tr { background: none !important; } -.darkness .table > tbody > tr > td, .darkness .grid > tbody > tr > td { background: none; border: none !important; border-bottom: 1px solid #2b2e34 !important; color: inherit; } -.darkness .table > tbody > tr:nth-child(2n), .darkness .grid > tbody > tr:nth-child(2n) { background-color: #252930 !important; } -.darkness .table.data tr > td:first-child, .darkness .table.data tr > th:first-child, .darkness .grid tr > td:first-child, .darkness .grid > tr > th:first-child { padding-left: 1.25rem !important; } -.darkness .table.data tr > td:last-child, .darkness .table.data tr > th:last-child, .darkness .grid tr > td:last-child, .darkness .grid > tr > th:last-child { padding-right: 1.25rem !important; } -.darkness table.table.table--edit > tbody > tr > th, .darkness table.table.table--edit > tbody > tr > td, .darkness form[name="settings"] table > tbody td, .darkness form[name="settings"] table > tbody th { padding: .25rem .5rem; background: none; border: none !important; color: inherit; } -.darkness .table.data .actions a, .darkness .table.data .actions a .fa, .darkness .table.data .actions span .fa { color: inherit; } -.darkness .table.data .actions a:hover .fa::before { color: #eee; } -.darkness .table.data .actions a:hover .fa::after { background-color: #3b414e; } -.darkness .table.data .actions a:hover .fa.fa-trash::before { color: #d80030; } -.darkness table .split, .darkness #editorRow_TinyMCE tr, .darkness table.table.table--edit > tbody > tr, .darkness .sysSettings > tbody > tr { border: none; border-bottom: 1px solid #23262b !important; } -.darkness table .split { margin: 0 -.5rem; } -.darkness table tr.noborder { border: none !important; } -.darkness table .comment { color: #999 !important; } -.darkness #editorRow_TinyMCE > tbody > tr:first-child > th { background: none !important; color: inherit !important; } -.darkness .section-editor, .darkness #content_body { border-top: 1px solid #414449; } -.darkness #file_editfile .navbar-editor, .darkness #file_editfile [name="editFile"], .darkness #content_body, .darkness .section-editor { border-bottom: 1px solid #414449; } -.darkness .section-editor > textarea, .darkness #content_body > div > textarea, .darkness #content_body > .section-editor { margin-top: 0 } -.darkness #content_body textarea, .darkness .section-editor textarea, .darkness #content_body > .section-editor { display: block; border: none } -.darkness ul.sortableList li { background-color: #202329; border: 1px solid #414449; } -.darkness ul.sortableList li:hover { border-color: #5d5d5d; } -.darkness ul.sortableList li.ghost { background-color: #282c34; border-color: #1976d2; } -.darkness .disabledPlugin, .darkness .disabledPlugin a { color: #de6961; } -.darkness .alert { box-shadow: 0 0.25rem 2rem rgba(0, 0, 0, 0.15); } -.darkness .alert-danger { background-color: #612329; border-color: #612329; color: #da706d; } -.darkness .alert-danger b { color: #f7e6e8 !important } -.darkness .alert-info { background-color: #193048; border-color: #193048; color: #a3b3bd; } -.darkness .alert-warning { background-color: #6c591d; border-color: #6c591d; color: #c7bd9e; } -.darkness .alert-success { background-color: #3d7544; border-color: #3d7544; color: #c4efc5; } -.darkness .loginbox, .darkness .loginbox form { background-color: #202329 } -.darkness .loginbox .logo img { content: url("../images/misc/logo-navbar-white.png"); } -.darkness #mainloader { background-color: transparent !important; } -.darkness #FilesTable { border-bottom: 1px solid #202329 } -.darkness #mce-modal-block { background-color: #000; } -.darkness .resourceTable .panel-heading { margin-top: -1px !important; background-color: #202329; border-top: 1px solid #414449; border-bottom: 1px solid #414449; } -.darkness .panel-title > a { color: #aaa; } -.darkness .panel-title > a:hover { background: #202329; color: #eee; } -.darkness .resourceTable ul.elements > li { border-left: 3px solid transparent; border-bottom: 1px solid #303338; } -.darkness .resourceTable ul.elements > li:hover { background-color: #202329;} -.darkness .elements_descr { color: #aaa; } -.darkness ul.elements_buttonbar li a { color: inherit; } -.darkness .msg-container { color: inherit } -.darkness .evo-tooltip, .darkness .custom-tip { background-color: #343942; color: #eee; box-shadow: 0 0.5rem 3rem rgba(0, 0, 0, 0.4); } -.darkness div#section-body-categories div.uncategorized_elements, .darkness div#section-body-categories div.drop { border: 1px solid #414449; background-color: #202329; } -.darkness div#section-body-categories div.uncategorized_elements h2, .darkness div#section-body-categories div.drop h2 { color: #1976d2; border-bottom: 1px solid #1976d2; } -.darkness div#section-body-categories div.drag { background-color: #1976d2; } -.darkness #helpPane h1 { border-bottom: 1px solid #414449; } -.darkness #helpPane ul + h1 { margin-top: 1rem; } -.darkness #helpPane ul { margin: 0; } -.darkness #helpPane #tab2Help img { content: url("../images/misc/logo-navbar-white.png"); } -.darkness #helpPane pre { border: 1px solid #414449; padding: 1em; color: #aaa; } -.darkness code { background-color: #202329; border: 1px solid #414449; } -.darkness .h, .darkness .e, .darkness .v { background-color: #202329; border-color: #414449; color: #eee; } -.darkness .v { background-color: #282c34; } -.darkness tr:hover .e { background-color: #282c33; } -.darkness tr:hover .v { background-color: #2b3038; } -.darkness .dp_cal { box-shadow: 0 0.5rem 3rem rgba(0, 0, 0, 0.4); } -.darkness .dp_cal, .darkness .dp_cal .dp_empty { background-color: #343942; } -.darkness .dp_cal td.dp_roll { background-color: #202329; color: #aaa !important; } -.darkness .dp_cal td.dp_selected { background-color: #3189ba; color: #fff !important; } -.darkness ul.breadcrumbs a { color: #3481bc; } -.darkness h2[style="color:#003399"], .darkness h3[style="color:#003399"] { color: #f44336 !important; } -.darkness h3[style="color:#003399"] + div[style] { background-color: transparent !important; border-color: #f44336 !important; color: #f44336 !important; } -.darkness .mce-container, .darkness .mce-container *, .darkness .mce-widget, .darkness .mce-widget *, .darkness .mce-reset { color: #aaa; } -.darkness .mce-panel { background: #202329; border: none !important; } -.darkness .mce-reset .mce-panel { background: #1a1c21; } -.darkness .mce-btn { background-color: #202329; border-color: transparent; } -.darkness .mce-toolbar .mce-btn-group { border-color: #414449 !important; } -.darkness .mce-label { text-shadow: none; } -.darkness .mce-menu-item.mce-selected, .darkness .mce-menu-item:hover, .darkness .mce-menu-item:focus { background: #1976d2; } -.darkness .mce-menu-item.mce-selected .mce-text, .darkness .mce-menu-item.mce-selected .mce-ico, .darkness .mce-menu-item:hover .mce-text, .darkness .mce-menu-item:focus .mce-text, .darkness .mce-menu-item:hover .mce-ico, .darkness .mce-menu-item:focus .mce-ico { color: #fff; } -.darkness .mce-menu-item .mce-caret { border-left-color: #fff; } -.darkness .mce-tabs, .darkness .mce-tabs + .mce-container-body { background: #202329;} -.darkness .mce-tab { background: #202329; border-color: #414449; border-top: 1px solid transparent; text-shadow: none !important } -.darkness .mce-tab:hover { background-color: #1a1c21; } -.darkness .mce-tab:focus { color: #eee; } -.darkness .mce-tab.mce-active { border-top-color: #414449; } -.darkness .mce-tabs { border-bottom: 1px solid #414449; } -.darkness .mce-tab.mce-active { background-color: #202329; } -.darkness .mce-menu-item.mce-disabled, .darkness .mce-menu-item.mce-disabled:hover { background: #202329; } -.darkness .mce-menu-item.mce-disabled .mce-text, .darkness .mce-menu-item.mce-disabled:hover .mce-text, .darkness .mce-menu-item.mce-disabled .mce-ico, .darkness .mce-menu-item.mce-disabled:hover .mce-ico { color: #414449; } -.darkness .mce-window-head .mce-close { background-color: #6d1215 !important; } -.darkness .mce-window-head { background: #1a1c21; border: none; } -.darkness i.mce-i-checkbox, .darkness .mce-textbox, .darkness .mce-window-body .mce-btn, .darkness .mce-foot .mce-btn { background-color: #1a1c21; border: 1px solid #414449; } -.darkness .mce-btn:hover, .darkness .mce-btn:active { background: #282c34; border-color: #414449; } -.darkness .mce-btn:focus { background: #282c34; } -.darkness .mce-btn button { background-color: transparent } -.darkness .mce-splitbtn .mce-open:hover, .darkness .mce-splitbtn .mce-open:active, .darkness .mce-splitbtn:hover .mce-open, .darkness .mce-splitbtn.mce-active:hover .mce-open { border-left: 1px solid #3d4045; } -.darkness .mce-checked i.mce-i-checkbox { color: #aaa; } -.darkness .mce-textbox { font-family: monospace; } -.darkness::-webkit-scrollbar, .darkness::-webkit-scrollbar-thumb , .darkness *::-webkit-scrollbar, .darkness *::-webkit-scrollbar-thumb { width: 1rem; height: 1rem; background-color: transparent; border-radius: .5rem; border: .25rem solid transparent; } -.darkness:hover::-webkit-scrollbar-thumb, .darkness *:hover::-webkit-scrollbar-thumb { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); } -.darkness::-webkit-scrollbar-thumb:hover, .darkness *::-webkit-scrollbar-thumb:hover { box-shadow: inset 0 0 0 1rem rgba(255, 255, 255, 0.15); } -.darkness::-webkit-resizer, .darkness *::-webkit-resizer, .darkness::-webkit-scrollbar-corner, .darkness *::-webkit-scrollbar-corner { background-color: transparent; } + +.darkness .alert-info { + background-color: #193048; + border-color: #193048; + color: #a3b3bd; +} + +.darkness .alert-warning { + background-color: #6c591d; + border-color: #6c591d; + color: #c7bd9e; +} + +.darkness .alert-success { + background-color: #3d7544; + border-color: #3d7544; + color: #c4efc5; +} + +.darkness .loginbox, +.darkness .loginbox form { + background-color: #202329 +} + +.darkness .loginbox .logo img { + content: url("../images/misc/logo-navbar-white.png"); +} + +.darkness #mainloader { + background-color: transparent !important; +} + +.darkness #FilesTable { + border-bottom: 1px solid #202329 +} + +.darkness #mce-modal-block { + background-color: #000; +} + +.darkness .resourceTable .panel-heading { + margin-top: -1px !important; + background-color: #202329; + border-top: 1px solid #414449; + border-bottom: 1px solid #414449; +} + +.darkness .panel-title > a { + color: #aaa; +} + +.darkness .panel-title > a:hover { + background: #202329; + color: #eee; +} + +.darkness .resourceTable ul.elements > li { + border-left: 3px solid transparent; + border-bottom: 1px solid #303338; +} + +.darkness .resourceTable ul.elements > li:hover { + background-color: #202329; +} + +.darkness .elements_descr { + color: #aaa; +} + +.darkness ul.elements_buttonbar li a { + color: inherit; +} + +.darkness .msg-container { + color: inherit +} + +.darkness .evo-tooltip, +.darkness .custom-tip { + background-color: #343942; + color: #eee; + box-shadow: 0 0.5rem 3rem rgba(0, 0, 0, 0.4); +} + +.darkness div#section-body-categories div.uncategorized_elements, +.darkness div#section-body-categories div.drop { + border: 1px solid #414449; + background-color: #202329; +} + +.darkness div#section-body-categories div.uncategorized_elements h2, +.darkness div#section-body-categories div.drop h2 { + color: #1976d2; + border-bottom: 1px solid #1976d2; +} + +.darkness div#section-body-categories div.drag { + background-color: #1976d2; +} + +.darkness #helpPane h1 { + border-bottom: 1px solid #414449; +} + +.darkness #helpPane ul + h1 { + margin-top: 1rem; +} + +.darkness #helpPane ul { + margin: 0; +} + +.darkness #helpPane #tab2Help img { + content: url("../images/misc/logo-navbar-white.png"); +} + +.darkness #helpPane pre { + border: 1px solid #414449; + padding: 1em; + color: #aaa; +} + +.darkness code { + background-color: #202329; + border: 1px solid #414449; +} + +.darkness .h, +.darkness .e, +.darkness .v { + background-color: #202329; + border-color: #414449; + color: #eee; +} + +.darkness .v { + background-color: #282c34; +} + +.darkness tr:hover .e { + background-color: #282c33; +} + +.darkness tr:hover .v { + background-color: #2b3038; +} + +.darkness .dp_cal { + box-shadow: 0 0.5rem 3rem rgba(0, 0, 0, 0.4); +} + +.darkness .dp_cal, +.darkness .dp_cal .dp_empty { + background-color: #343942; +} + +.darkness .dp_cal td.dp_roll { + background-color: #202329; + color: #aaa !important; +} + +.darkness .dp_cal td.dp_selected { + background-color: #3189ba; + color: #fff !important; +} + +.darkness ul.breadcrumbs a { + color: #3481bc; +} + +.darkness h2[style="color:#003399"], +.darkness h3[style="color:#003399"] { + color: #f44336 !important; +} + +.darkness h3[style="color:#003399"] + div[style] { + background-color: transparent !important; + border-color: #f44336 !important; + color: #f44336 !important; +} + +.darkness .mce-container, +.darkness .mce-container *, +.darkness .mce-widget, +.darkness .mce-widget *, +.darkness .mce-reset { + color: #aaa; +} + +.darkness .mce-panel { + background: #202329; + border: none !important; +} + +.darkness .mce-reset .mce-panel { + background: #1a1c21; +} + +.darkness .mce-btn { + background-color: #202329; + border-color: transparent; +} + +.darkness .mce-toolbar .mce-btn-group { + border-color: #414449 !important; +} + +.darkness .mce-label { + text-shadow: none; +} + +.darkness .mce-menu-item.mce-selected, +.darkness .mce-menu-item:hover, +.darkness .mce-menu-item:focus { + background: #1976d2; +} + +.darkness .mce-menu-item.mce-selected .mce-text, +.darkness .mce-menu-item.mce-selected .mce-ico, +.darkness .mce-menu-item:hover .mce-text, +.darkness .mce-menu-item:focus .mce-text, +.darkness .mce-menu-item:hover .mce-ico, +.darkness .mce-menu-item:focus .mce-ico { + color: #fff; +} + +.darkness .mce-menu-item .mce-caret { + border-left-color: #fff; +} + +.darkness .mce-tabs, +.darkness .mce-tabs + .mce-container-body { + background: #202329; +} + +.darkness .mce-tab { + background: #202329; + border-color: #414449; + border-top: 1px solid transparent; + text-shadow: none !important +} + +.darkness .mce-tab:hover { + background-color: #1a1c21; +} + +.darkness .mce-tab:focus { + color: #eee; +} + +.darkness .mce-tab.mce-active { + border-top-color: #414449; +} + +.darkness .mce-tabs { + border-bottom: 1px solid #414449; +} + +.darkness .mce-tab.mce-active { + background-color: #202329; +} + +.darkness .mce-menu-item.mce-disabled, +.darkness .mce-menu-item.mce-disabled:hover { + background: #202329; +} + +.darkness .mce-menu-item.mce-disabled .mce-text, +.darkness .mce-menu-item.mce-disabled:hover .mce-text, +.darkness .mce-menu-item.mce-disabled .mce-ico, +.darkness .mce-menu-item.mce-disabled:hover .mce-ico { + color: #414449; +} + +.darkness .mce-window-head .mce-close { + background-color: #6d1215 !important; +} + +.darkness .mce-window-head { + background: #1a1c21; + border: none; +} + +.darkness i.mce-i-checkbox, +.darkness .mce-textbox, +.darkness .mce-window-body .mce-btn, +.darkness .mce-foot .mce-btn { + background-color: #1a1c21; + border: 1px solid #414449; +} + +.darkness .mce-btn:hover, +.darkness .mce-btn:active { + background: #282c34; + border-color: #414449; +} + +.darkness .mce-btn:focus { + background: #282c34; +} + +.darkness .mce-btn button { + background-color: transparent +} + +.darkness .mce-splitbtn .mce-open:hover, +.darkness .mce-splitbtn .mce-open:active, +.darkness .mce-splitbtn:hover .mce-open, +.darkness .mce-splitbtn.mce-active:hover .mce-open { + border-left: 1px solid #3d4045; +} + +.darkness .mce-checked i.mce-i-checkbox { + color: #aaa; +} + +.darkness .mce-textbox { + font-family: monospace; +} + +.darkness::-webkit-scrollbar, +.darkness::-webkit-scrollbar-thumb, +.darkness *::-webkit-scrollbar, +.darkness *::-webkit-scrollbar-thumb { + width: 1rem; + height: 1rem; + background-color: transparent; + border-radius: .5rem; + border: .25rem solid transparent; +} + +.darkness:hover::-webkit-scrollbar-thumb, +.darkness *:hover::-webkit-scrollbar-thumb { + box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); +} + +.darkness::-webkit-scrollbar-thumb:hover, +.darkness *::-webkit-scrollbar-thumb:hover { + box-shadow: inset 0 0 0 1rem rgba(255, 255, 255, 0.15); +} + +.darkness::-webkit-resizer, +.darkness *::-webkit-resizer, +.darkness::-webkit-scrollbar-corner, +.darkness *::-webkit-scrollbar-corner { + background-color: transparent; +} + /* [ OTHERS COMPONENTS ] - this components need fix css */ + /* extras */ -.catalog_item select[name=link] { width: auto !important; margin-left: 0.5rem } + +.catalog_item select[name=link] { + width: auto !important; + margin-left: 0.5rem +} + /* ManagerManager */ -.sectionHeader.minimizable { position: relative; z-index: 1; background-color: #fafafa; padding: 0.5rem; border: 1px solid rgba(0, 0, 0, 0.15); } -.dark .sectionHeader.minimizable { background-color: #f2f2f2 } -.imageField { min-width: 100% !important; width: 100% !important } -ul.mmTagList { float: left; margin-top: .25rem !important } + +.sectionHeader.minimizable { + position: relative; + z-index: 1; + background-color: #fafafa; + padding: 0.5rem; + border: 1px solid rgba(0, 0, 0, 0.15); +} + +.dark .sectionHeader.minimizable { + background-color: #f2f2f2 +} + +.imageField { + min-width: 100% !important; + width: 100% !important +} + +ul.mmTagList { + float: left; + margin-top: .25rem !important +} + /* MCE */ -.mce-container, .mce-container-body { box-sizing: border-box !important } -.mce-container button { border: none; border-radius: 0; background-color: transparent; } -.mce-window-head .mce-close { padding: 0; } -#editorRow_TinyMCE { background-color: #fff; } -#editorRow_TinyMCE tr { border: 1px dotted rgba(0, 0, 0, .05); } -#editorRow_TinyMCE th { white-space: nowrap } -#editorRow_TinyMCE th, #editorRow_TinyMCE td { padding: 0.5em; border: none !important } + +.mce-container, +.mce-container-body { + box-sizing: border-box !important +} + +.mce-container button { + border: none; + border-radius: 0; + background-color: transparent; +} + +.mce-window-head .mce-close { + padding: 0; +} + +#editorRow_TinyMCE { + background-color: #fff; +} + +#editorRow_TinyMCE tr { + border: 1px dotted rgba(0, 0, 0, .05); +} + +#editorRow_TinyMCE th { + white-space: nowrap +} + +#editorRow_TinyMCE th, +#editorRow_TinyMCE td { + padding: 0.5em; + border: none !important +} + /* wrap TinyMCE3 toolbar */ -.mceEditor .mceToolbar td { height: 24px; float: left } + +.mceEditor .mceToolbar td { + height: 24px; + float: left +} + /* codeMirror */ -.CodeMirror { width: 100%; margin: 0 !important; } -.CodeMirror pre { word-break: break-all !important; } -.CodeMirror > div:first-child > textarea { /*opacity: 0;*/ z-index: -1; left: -9999rem; } -div.CodeMirror-cursors { pointer-events: none; } + +.CodeMirror { + width: 100%; + margin: 0 !important; +} + +.CodeMirror pre { + word-break: break-all !important; +} + +.CodeMirror > div:first-child > textarea { + /*opacity: 0;*/ + z-index: -1; + left: -9999rem; +} + +div.CodeMirror-cursors { + pointer-events: none; +} + /* docFinder */ -form#docfinder div.tab-page { height: auto !important } + +form#docfinder div.tab-page { + height: auto !important +} + /* SimpleGallery */ -#SimpleGallery .pagination { display: block } -#SimpleGallery .sg_image { width: auto } + +#SimpleGallery .pagination { + display: block +} + +#SimpleGallery .sg_image { + width: auto +} + /* multiTV */ -.multitv .list li.element a.copy, .multitv .list li.element a.remove { width: 25px !important; text-align: center; background: transparent !important; top: -10px !important; } -.multitv .list li.element { border-radius: .25rem; border: 1px solid rgba(0, 0, 0, .125); background: #fefefe !important; margin-bottom: 10px !important; } + +.multitv .list li.element a.copy, +.multitv .list li.element a.remove { + width: 25px !important; + text-align: center; + background: transparent !important; + top: -10px !important; +} + +.multitv .list li.element { + border-radius: .25rem; + border: 1px solid rgba(0, 0, 0, .125); + background: #fefefe !important; + margin-bottom: 10px !important; +} + /* loginbox animation */ + @keyframes anim-loginbox { -from { opacity: 0; transform: translateY(30px); } -to { opacity: 1; transform: translateY(0); } + from { + opacity: 0; + transform: translateY(30px); + } + to { + opacity: 1; + transform: translateY(0); + } } + @-webkit-keyframes anim-loginbox { -from { opacity: 0; transform: translateY(30px); } -to { opacity: 1; transform: translateY(0); } + from { + opacity: 0; + transform: translateY(30px); + } + to { + opacity: 1; + transform: translateY(0); + } +} + +.loginbox { + -webkit-animation-name: anim-loginbox; + -webkit-animation-duration: .5s; + -webkit-animation-iteration-count: 1; + -webkit-animation-timing-function: ease; + -webkit-animation-fill-mode: forwards; + -moz-animation-name: anim-loginbox; + -moz-animation-duration: .5s; + -moz-animation-iteration-count: 1; + -moz-animation-timing-function: ease; + -moz-animation-fill-mode: forwards; + animation-name: anim-loginbox; + animation-duration: .5s; + animation-iteration-count: 1; + animation-timing-function: ease; + animation-fill-mode: forwards; } -.loginbox { -webkit-animation-name: anim-loginbox; -webkit-animation-duration: .5s; -webkit-animation-iteration-count: 1; -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: forwards; -moz-animation-name: anim-loginbox; -moz-animation-duration: .5s; -moz-animation-iteration-count: 1; -moz-animation-timing-function: ease; -moz-animation-fill-mode: forwards; animation-name: anim-loginbox; animation-duration: .5s; animation-iteration-count: 1; animation-timing-function: ease; animation-fill-mode: forwards; } + /* end loginbox animation */ /* pmfx theme */ -#actions .dropdown-toggle:after { display: none !important; } + +#actions .dropdown-toggle:after { + display: none !important; +} + /* .table.data > tbody > tr, .table.data > tbody > tr:nth-child(2n), .widgets #modxrecent_widget .table.data tbody tr:nth-child(4n+1):not(:hover) { background-color: #fff; }*/ -ul.breadcrumbs { margin: 0 0 1rem 0; padding: .5rem 0.8rem; -line-height: normal; font-size: .675rem; -color: #888; border-width: 0; background-image: linear-gradient(to right, rgba(0, 0, 0, 0.04), transparent 60%); } -ul.breadcrumbs a { color: #333; } -#settingsPane [name="site_name"], #settingsPane [name="emailsender"], #settingsPane [name="emailsubject"], #settingsPane [name="datepicker_offset"], #settingsPane [name="editor_css_path"], #settingsPane [name="safe_functions_at_eval"], #settingsPane [name="valid_hostnames"], #settingsPane [name="upload_files"], #settingsPane [name="upload_images"], #settingsPane [name="upload_media"], #settingsPane [name="upload_flash"], #settingsPane [name="txt_custom_contenttype"], #settingsPane [name="filemanager_path"], #settingsPane [name="rb_base_url"], #settingsPane [name="rb_base_dir"], #settingsPane [name="thumbsDir"], input[name="photo"], #range input#pids, input[maxlength="350"], textarea.mce, #editorRow_TinyMCE { width: 100% !important; } -#news .card-block > div, #security .card-block > div { padding: 0 !important; } -#news .card-block ul, #security .card-block ul { padding: 0; margin: 0; } -#news .card-block ul li, #security .card-block ul li { padding: 0.75rem 1rem; border-bottom: 1px solid #ebebeb; } -ul.mmTagList li { padding: 2px 8px !important; border-radius: 3px !important; -webkit-border-radius: 3px !important; background-color: #eaeaea !important; text-decoration: none !important; } -ul.mmTagList li.tagSelected { border-radius: 3px !important; -webkit-border-radius: 3px !important; background-color: #5a5e63 !important; } \ No newline at end of file + +ul.breadcrumbs { + margin: 0 0 1rem 0; + padding: .5rem 0.8rem; + line-height: normal; + font-size: .675rem; + color: #888; + border-width: 0; + background-image: linear-gradient(to right, rgba(0, 0, 0, 0.04), transparent 60%); +} + +ul.breadcrumbs a { + color: #333; +} + +#settingsPane [name="site_name"], +#settingsPane [name="emailsender"], +#settingsPane [name="emailsubject"], +#settingsPane [name="datepicker_offset"], +#settingsPane [name="editor_css_path"], +#settingsPane [name="safe_functions_at_eval"], +#settingsPane [name="valid_hostnames"], +#settingsPane [name="upload_files"], +#settingsPane [name="upload_images"], +#settingsPane [name="upload_media"], +#settingsPane [name="upload_flash"], +#settingsPane [name="txt_custom_contenttype"], +#settingsPane [name="filemanager_path"], +#settingsPane [name="rb_base_url"], +#settingsPane [name="rb_base_dir"], +#settingsPane [name="thumbsDir"], +input[name="photo"], +#range input#pids, +input[maxlength="350"], +textarea.mce, +#editorRow_TinyMCE { + width: 100% !important; +} + +#news .card-block > div, +#security .card-block > div { + padding: 0 !important; +} + +#news .card-block ul, +#security .card-block ul { + padding: 0; + margin: 0; +} + +#news .card-block ul li, +#security .card-block ul li { + padding: 0.75rem 1rem; + border-bottom: 1px solid #ebebeb; +} + +ul.mmTagList li { + padding: 2px 8px !important; + border-radius: 3px !important; + -webkit-border-radius: 3px !important; + background-color: #eaeaea !important; + text-decoration: none !important; +} + +ul.mmTagList li.tagSelected { + border-radius: 3px !important; + -webkit-border-radius: 3px !important; + background-color: #5a5e63 !important; +} diff --git a/manager/media/style/default/css/fonts.css b/manager/media/style/default/css/fonts.css index e4287d419c..03cbc8c641 100755 --- a/manager/media/style/default/css/fonts.css +++ b/manager/media/style/default/css/fonts.css @@ -1,108 +1,497 @@ -html { font-size: 16px } +html { + font-size: 16px +} + @media (max-width: 900px) { -html { font-size: 16px; } + html { + font-size: 16px; + } } + @media (max-width: 400px) { -html { font-size: 16px; } + html { + font-size: 16px; + } +} + +body { + font-weight: normal; + font-style: normal; + font-size: 0.8125rem; + line-height: 1.5; + font-family: sans-serif; + -webkit-font-smoothing: subpixel-antialiased } -body { font-weight: normal; font-style: normal; font-size: 0.8125rem; line-height: 1.5; font-family: sans-serif; -webkit-font-smoothing: subpixel-antialiased } + /* For Arabic Font */ -html[lang="ar"] body, html[lang="ary"] body, html[lang="azb"] body, html[lang="fa-IR"] body, html[lang="haz"] body, html[lang="ps"] body, html[lang="ur"] body { font-family: Tahoma, Arial, sans-serif; } + +html[lang="ar"] body, +html[lang="ary"] body, +html[lang="azb"] body, +html[lang="fa-IR"] body, +html[lang="haz"] body, +html[lang="ps"] body, +html[lang="ur"] body { + font-family: Tahoma, Arial, sans-serif; +} + /* For Chinese Font */ -html[lang="zh"] body { font-family: "PingFang SC", "Microsoft JhengHei", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", Helvetica, sans-serif; } + +html[lang="zh"] body { + font-family: "PingFang SC", "Microsoft JhengHei", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", Helvetica, sans-serif; +} + /* For Devanagari Font */ -html[lang="bn-BD"] body, html[lang="hi-IN"] body, html[lang="mr-IN"] body { font-family: Arial, sans-serif; } + +html[lang="bn-BD"] body, +html[lang="hi-IN"] body, +html[lang="mr-IN"] body { + font-family: Arial, sans-serif; +} + /* For Greek Font */ -html[lang="el"] body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } + +html[lang="el"] body { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; +} + /* For Gujarati Font */ -html[lang="gu-IN"] body { font-family: Arial, sans-serif; } + +html[lang="gu-IN"] body { + font-family: Arial, sans-serif; +} + /* For Hebrew Font */ -html[lang="he"] body { font-family: "Arial Hebrew", Arial, sans-serif; } + +html[lang="he"] body { + font-family: "Arial Hebrew", Arial, sans-serif; +} + /* For Japanese Font */ -html[lang="ja"] body { font-family: Meiryo, "Hiragino Kaku Gothic Pro", sans-serif; } + +html[lang="ja"] body { + font-family: Meiryo, "Hiragino Kaku Gothic Pro", sans-serif; +} + /* For Korean font */ -html[lang="ko-KR"] body { font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Nanum Gothic", Dotum, sans-serif; } + +html[lang="ko-KR"] body { + font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Nanum Gothic", Dotum, sans-serif; +} + /* For Thai Font */ -html[lang="th"] body { font-family: "Sukhumvit Set", "Helvetica Neue", Helvetica, Arial, sans-serif; } + +html[lang="th"] body { + font-family: "Sukhumvit Set", "Helvetica Neue", Helvetica, Arial, sans-serif; +} + /* For Arabic Font */ -html[lang="fa"] body { font-family: Tahoma, Arial, sans-serif; } -body { background-color: #fafafa; color: #444; } -body.drag *, body.drag::after { cursor: grabbing !important; cursor: -moz-grabbing !important; cursor: -webkit-grabbing !important; cursor: -moz-grab !important; -moz-user-select: none !important; -webkit-user-select: none !important; user-select: none !important } -body.drag::after { bottom: 0; content: ""; left: 0; position: fixed; right: 0; top: 0; z-index: 999 } -body, ul, li { padding: 0; margin: 0; } -ul { margin-left: 1rem; margin-right: 1rem; } -li { list-style: none } -img { max-width: 100%; height: auto } -.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 { margin-bottom: .5rem; font-family: inherit; font-weight: 500; line-height: 1.1; color: inherit } -.h1, h1 { font-size: 1.75rem } -.h2, h2 { font-size: 1.5rem } -.h3, h3 { font-size: 1.25rem } -.h4, h4 { font-size: 1rem } -.h5, h5 { font-size: 0.8125rem } -.h6, h6 { font-size: 0.7rem } -h1 .fa:first-child {display: none;} -a { color: #3481bc; text-decoration: none } -.text-primary {color: #3481bc !important;} -a:focus, a:hover { color: #014c8c; text-decoration: underline } -a[href=""], a:not([href]) { cursor: default } -a:not([href]):not([tabindex]) { color: inherit; text-decoration: none } -a:not([href]):not([tabindex]):focus, a:not([href]):not([tabindex]):hover { color: inherit; text-decoration: none } -a:not([href]):not([tabindex]):focus { outline: 0 } -* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box } -*::-ms-clear { display: none; } -.text-justify { text-align: justify !important } -.text-nowrap { white-space: nowrap !important } -.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap } -.text-left { text-align: left !important } -.text-right { text-align: right !important } -.text-center { text-align: center !important } -.text-lowercase { text-transform: lowercase !important } -.text-uppercase { text-transform: uppercase !important } -.text-capitalize { text-transform: capitalize !important } -.font-weight-normal { font-weight: 400 } -.font-weight-bold { font-weight: 700 } -.font-italic { font-style: italic } -.text-white { color: #fff !important } -.text-muted { color: #818a91 !important } -.text-decoration-through { text-decoration: line-through !important } -.text-underline { text-decoration: underline !important } -a.text-underline:hover { text-decoration: none !important } -a.text-muted:focus, a.text-muted:hover { color: #4b5257 !important } -.text-primary { color: #0275d8 !important } -a.text-primary:focus, a.text-primary:hover { color: #025aa5 !important } -.text-success { color: #5cb85c !important } -a.text-success:focus, a.text-success:hover { color: #449d44 !important } -.text-info { color: #5bc0de !important } -a.text-info:focus, a.text-info:hover { color: #31b0d5 !important } -.text-warning { color: #f0ad4e !important } -a.text-warning:focus, a.text-warning:hover { color: #ec971f !important } -.text-danger { color: #d9534f !important } -a.text-danger:focus, a.text-danger:hover { color: #c9302c !important } -.text-gray-dark { color: #292b2c !important } -a.text-gray-dark:focus, a.text-gray-dark:hover { color: #101112 !important } -.text-hide { font: 0/0 a; color: transparent; text-shadow: none; background-color: transparent; border: 0 } -.hide { display: none !important } -.show { display: block !important } -.visible { visibility: visible !important; } -.invisible { visibility: hidden !important; } -.clear { clear: both; } + +html[lang="fa"] body { + font-family: Tahoma, Arial, sans-serif; +} + +body { + background-color: #fafafa; + color: #444; +} + +body.drag *, +body.drag::after { + cursor: grabbing !important; + cursor: -moz-grabbing !important; + cursor: -webkit-grabbing !important; + cursor: -moz-grab !important; + -moz-user-select: none !important; + -webkit-user-select: none !important; + user-select: none !important +} + +body.drag::after { + bottom: 0; + content: ""; + left: 0; + position: fixed; + right: 0; + top: 0; + z-index: 999 +} + +body, +ul, +li { + padding: 0; + margin: 0; +} + +ul { + margin-left: 1rem; + margin-right: 1rem; +} + +li { + list-style: none +} + +img { + max-width: 100%; + height: auto +} + +.h1, +.h2, +.h3, +.h4, +.h5, +.h6, +h1, +h2, +h3, +h4, +h5, +h6 { + margin-bottom: .5rem; + font-family: inherit; + font-weight: 500; + line-height: 1.1; + color: inherit +} + +.h1, +h1 { + font-size: 1.75rem +} + +.h2, +h2 { + font-size: 1.5rem +} + +.h3, +h3 { + font-size: 1.25rem +} + +.h4, +h4 { + font-size: 1rem +} + +.h5, +h5 { + font-size: 0.8125rem +} + +.h6, +h6 { + font-size: 0.7rem +} + +h1 .fa:first-child { + display: none; +} + +a { + color: #3481bc; + text-decoration: none +} + +.text-primary { + color: #3481bc !important; +} + +a:focus, +a:hover { + color: #014c8c; + text-decoration: underline +} + +a[href=""], +a:not([href]) { + cursor: default +} + +a:not([href]):not([tabindex]) { + color: inherit; + text-decoration: none +} + +a:not([href]):not([tabindex]):focus, +a:not([href]):not([tabindex]):hover { + color: inherit; + text-decoration: none +} + +a:not([href]):not([tabindex]):focus { + outline: 0 +} + +* { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box +} + +*::-ms-clear { + display: none; +} + +.text-justify { + text-align: justify !important +} + +.text-nowrap { + white-space: nowrap !important +} + +.text-truncate { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap +} + +.text-left { + text-align: left !important +} + +.text-right { + text-align: right !important +} + +.text-center { + text-align: center !important +} + +.text-lowercase { + text-transform: lowercase !important +} + +.text-uppercase { + text-transform: uppercase !important +} + +.text-capitalize { + text-transform: capitalize !important +} + +.font-weight-normal { + font-weight: 400 +} + +.font-weight-bold { + font-weight: 700 +} + +.font-italic { + font-style: italic +} + +.text-white { + color: #fff !important +} + +.text-muted { + color: #818a91 !important +} + +.text-decoration-through { + text-decoration: line-through !important +} + +.text-underline { + text-decoration: underline !important +} + +a.text-underline:hover { + text-decoration: none !important +} + +a.text-muted:focus, +a.text-muted:hover { + color: #4b5257 !important +} + +.text-primary { + color: #0275d8 !important +} + +a.text-primary:focus, +a.text-primary:hover { + color: #025aa5 !important +} + +.text-success { + color: #5cb85c !important +} + +a.text-success:focus, +a.text-success:hover { + color: #449d44 !important +} + +.text-info { + color: #5bc0de !important +} + +a.text-info:focus, +a.text-info:hover { + color: #31b0d5 !important +} + +.text-warning { + color: #f0ad4e !important +} + +a.text-warning:focus, +a.text-warning:hover { + color: #ec971f !important +} + +.text-danger { + color: #d9534f !important +} + +a.text-danger:focus, +a.text-danger:hover { + color: #c9302c !important +} + +.text-gray-dark { + color: #292b2c !important +} + +a.text-gray-dark:focus, +a.text-gray-dark:hover { + color: #101112 !important +} + +.text-hide { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0 +} + +.hide { + display: none !important +} + +.show { + display: block !important +} + +.visible { + visibility: visible !important; +} + +.invisible { + visibility: hidden !important; +} + +.clear { + clear: both; +} + /* custom */ -#loadingmask { display: none !important; } -.fa > .fa-lock { position: relative; float: left; width: auto !important; margin-top: -1em; font-size: 0.7em !important; color: #ffc107 !important; -webkit-text-stroke: 1px rgba(0, 0, 0, 0.39); text-stroke: 1px rgba(0, 0, 0, 0.39); } -.rotate180 { -webkit-transform: rotate(180deg); -moz-transform: rotate(180deg); -ms-transform: rotate(180deg); -o-transform: rotate(180deg); transform: rotate(180deg); } -.disabledPlugin, .disabledPlugin a { color: #b68282; font-style: italic; } -h1 { font-size: 1.5em; line-height: 1.5rem; padding: 0.8rem; margin: 0; } -h1 .fa { margin-right: 0.25em; color: #1377c5; } -h1 .help { margin: 0 0 0 0.25em; color: rgba(0, 0, 0, 0.15); font-size: 0.8em; cursor: pointer } -h1 .help:hover { color: rgba(0, 0, 0, 0.3); } -h1 small { margin-left: 0.5em; line-height: 1em } -.split { height: 0; font-size: 0; clear: both; padding: 0; border-top: 1px dotted rgba(0, 0, 0, .1) } -#previewIframe { width: 100%; height: 400px; } -.messageRead { color: #333; } -.messageUnread { color: #3cb371; font-weight: 500; } -.element-edit-message { display: none } -.element-edit-message p:last-child, .element-edit-message-tab p:last-child { margin-bottom: 0 } + +#loadingmask { + display: none !important; +} + +.fa > .fa-lock { + position: relative; + float: left; + width: auto !important; + margin-top: -1em; + font-size: 0.7em !important; + color: #ffc107 !important; + -webkit-text-stroke: 1px rgba(0, 0, 0, 0.39); + text-stroke: 1px rgba(0, 0, 0, 0.39); +} + +.rotate180 { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + -ms-transform: rotate(180deg); + -o-transform: rotate(180deg); + transform: rotate(180deg); +} + +.disabledPlugin, +.disabledPlugin a { + color: #b68282; + font-style: italic; +} + +h1 { + font-size: 1.5em; + line-height: 1.5rem; + padding: 0.8rem; + margin: 0; +} + +h1 .fa { + margin-right: 0.25em; + color: #1377c5; +} + +h1 .help { + margin: 0 0 0 0.25em; + color: rgba(0, 0, 0, 0.15); + font-size: 0.8em; + cursor: pointer +} + +h1 .help:hover { + color: rgba(0, 0, 0, 0.3); +} + +h1 small { + margin-left: 0.5em; + line-height: 1em +} + +.split { + height: 0; + font-size: 0; + clear: both; + padding: 0; + border-top: 1px dotted rgba(0, 0, 0, .1) +} + +#previewIframe { + width: 100%; + height: 400px; +} + +.messageRead { + color: #333; +} + +.messageUnread { + color: #3cb371; + font-weight: 500; +} + +.element-edit-message { + display: none +} + +.element-edit-message p:last-child, +.element-edit-message-tab p:last-child { + margin-bottom: 0 +} + /* modes theme */ + /* darkness */ -.darkness h1 .help { color: #1976d2; opacity: .5; } -.darkness h1 .help:hover { opacity: 1; } + +.darkness h1 .help { + color: #1976d2; + opacity: .5; +} + +.darkness h1 .help:hover { + opacity: 1; +} diff --git a/manager/media/style/default/css/forms.css b/manager/media/style/default/css/forms.css index 736c6cd410..9a5271c341 100755 --- a/manager/media/style/default/css/forms.css +++ b/manager/media/style/default/css/forms.css @@ -1,93 +1,606 @@ /* [ FORMS ] */ -legend { font-size: 1em; } -label { cursor: pointer; display: inline-block; margin-bottom: .5em } -label:not([for]) { cursor: default } -button, input { margin: 0; padding: 0; border: none; font: inherit; line-height: normal; } -input[type=checkbox], input[type=radio] { width: 0.8125rem !important; height: 0.8125rem !important; margin-right: 0.25em; vertical-align: -0.15em; border-radius: .1rem; border: 1px solid #d4d4d4; background: #fff no-repeat 50% -1em; outline: none; transition: border-color .2s, background-position .1s; } -input[type=checkbox] { background-image: url("data:image/svg+xml;utf8,%3Csvg%20viewBox%3D%270%200%201792%201792%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M1671%20566q0%2040-28%2068l-724%20724-136%20136q-28%2028-68%2028t-68-28l-136-136-362-362q-28-28-28-68t28-68l136-136q28-28%2068-28t68%2028l294%20295%20656-657q28-28%2068-28t68%2028l136%20136q28%2028%2028%2068z%27%20fill%3D%27%23444%27/%3E%3C/svg%3E"); background-size: 1em; } -input[type=radio] { background-image: url("data:image/svg+xml;utf-8,%3Csvg%20viewBox%3D%270%200%201792%201792%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M1664%20896q0%20209-103%20385.5t-279.5%20279.5-385.5%20103-385.5-103-279.5-279.5-103-385.5%20103-385.5%20279.5-279.5%20385.5-103%20385.5%20103%20279.5%20279.5%20103%20385.5z%27%20fill%3D%27%23444%27/%3E%3C/svg%3E"); background-size: .609375em; border-radius: 50% } -input[type=checkbox]:hover, input[type=radio]:hover { border-color: #bcbcbc } -input[type=checkbox]:active, input[type=radio]:active { background-color: #fafafa; } -input[type=checkbox]:focus, input[type=radio]:focus { border-color: #4d8ef9 !important; box-shadow: 0 0 0 1px rgba(77, 142, 249, 0.5) } -input[type=checkbox]:checked, input[type=radio]:checked { background-position: 50% 50% } -input[type=checkbox]:disabled { background-image: url("data:image/svg+xml;utf8,%3Csvg%20viewBox%3D%270%200%201792%201792%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M1671%20566q0%2040-28%2068l-724%20724-136%20136q-28%2028-68%2028t-68-28l-136-136-362-362q-28-28-28-68t28-68l136-136q28-28%2068-28t68%2028l294%20295%20656-657q28-28%2068-28t68%2028l136%20136q28%2028%2028%2068z%27%20fill%3D%27%23bbb%27/%3E%3C/svg%3E"); background-size: .875em; } -button, input, optgroup, select, textarea { position: relative; font-family: sans-serif; font-size: 0.8125rem; line-height: 1.23076923; margin: 0; -webkit-appearance: none; -moz-appearance: none; } -.form-control, input[type=text]:not(.form-control), input[type=password], input[type=number], input[type=email], input[type=date], input[type=url], input[type=search], select, textarea { display: inline-block; width: 100%; max-width: 100%; padding: 0.46153846em .5em; line-height: 1.23076923; vertical-align: inherit; font-size: 0.8125rem; color: #464a4c; background-color: #fff; -webkit-background-clip: padding-box; background-clip: padding-box; border: 1px solid #d4d4d4; border-radius: .1em; -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; } -.form-control:focus, input:not([type=radio]):not([type=checkbox]):focus, select:focus, textarea:focus, .btn.focus, .btn:focus { z-index: 3; outline-offset: -1px; outline: rgba(77, 142, 249, 0.5) solid 2px; border-color: #66afe9; } -input:not([type=button]):not([type=submit]):hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: #bbb; transition: border-color 0s, background-position .1s; } -.btn, button:not(.btn), input[type=button]:not(.btn), input[type=submit]:not(.btn) { display: inline-block; padding: 0.46153846em 1em; line-height: 1.23076923; vertical-align: inherit; text-align: center; text-decoration: none !important; font-size: 0.8125rem; font-weight: 400; white-space: nowrap; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: pointer; background-color: #fff; border: 1px solid #d4d4d4; border-radius: .1em; -webkit-transition: all .2s ease-in-out; -o-transition: all .2s ease-in-out; transition: all .2s ease-in-out } -select:not([size]):not([multiple]), select.form-control:not([size]):not([multiple]), select[size="1"]:not([multiple]) { height: 2.3076923em; line-height: 1.38461538 } -.form-control-sm, .input-group-sm > .form-control, .input-group-sm > .input-group-addon, .input-group-sm > .input-group-btn > .btn, input.form-control-sm, .btn-group-sm > .btn, .btn-sm, .input-group-addon.form-control-sm, .input-group-sm > .input-group-addon, .input-group-sm > .input-group-btn > .input-group-addon.btn { padding: 0.46153846em .5rem; font-size: .6772rem; border-radius: .1rem; } -.form-control-lg, .input-group-lg > .form-control, .input-group-lg > .input-group-addon, .input-group-lg > .input-group-btn > .btn, input.form-control-lg, .btn-group-lg > .btn, .btn-lg, .input-group-addon.form-control-lg, .input-group-lg > .input-group-addon, .input-group-lg > .input-group-btn > .input-group-addon.btn { padding: 0.46153846em .5rem; font-size: 1.15rem; border-radius: .1rem; } -.btn:hover, input[type=button]:not(.btn):hover, input[type=submit]:not(.btn):hover { color: #292b2c; background-color: #efefef; border-color: #c3c3c3 } -.btn:focus, input[type=button]:not(.btn):focus, input[type=submit]:not(.btn):focus { background-color: #e6e6e6; border-color: #adadad } -.btn-primary { color: #fff; background-color: #0275d8; border-color: #0275d8 } -.btn-primary:hover { color: #fff; background-color: #025aa5; border-color: #01549b } -.btn-secondary { color: #292b2c; background-color: #fff; border-color: #d4d4d4 } -.btn-secondary:hover { color: #292b2c; background-color: #e6e6e6; border-color: #adadad } -.btn-success { color: #fff; background-color: #5cb85c; border-color: #56ac56 } -.btn-success:hover { color: #fff; background-color: #449d44; border-color: #419641 } -.btn-danger { color: #fff; background-color: #d9534f; border-color: #d9534f } -.btn-danger:hover { color: #fff; background-color: #c9302c; border-color: #c12e2a } -.btn-warning { color: #fff; background-color: #f0ad4e; border-color: #f0ad4e; } -.btn-warning:hover { color: #fff; background-color: #ec971f; border-color: #eb9316; } -.btn-info { color: #fff; background-color: #5bc0de; border-color: #5bc0de; } -.btn-info:hover { color: #fff; background-color: #31b0d5; border-color: #2aabd2; } -.btn-default { color: #bbb; background-color: #202329; border-color: #202329 } -.btn-default:hover { color: #fff; background-color: #1a1c21; border-color: #1a1c21 } -textarea, textarea.form-control { width: 100%; line-height: 1.5; overflow: auto; resize: vertical } -select:not([size]):not([multiple]), select[size="1"] { padding-right: 2em !important; background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTc5MiAxNzkyJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnPjxwYXRoIGQ9J00xMzk1IDczNnEwIDEzLTEwIDIzbC00NjYgNDY2cS0xMCAxMC0yMyAxMHQtMjMtMTBsLTQ2Ni00NjZxLTEwLTEwLTEwLTIzdDEwLTIzbDUwLTUwcTEwLTEwIDIzLTEwdDIzIDEwbDM5MyAzOTMgMzkzLTM5M3ExMC0xMCAyMy0xMHQyMyAxMGw1MCA1MHExMCAxMCAxMCAyM3onIGZpbGw9JyUyMzQ0NCcvPjwvc3ZnPg==") !important; background-repeat: no-repeat; background-position: right center; background-size: 2em 1.3em } -optgroup { font-style: normal; font-weight: 500; background-color: #ddd; } -optgroup option { font-weight: normal; background-color: #fff; } -input[type=color] { width: 2.308em; height: 2.308em; -webkit-appearance: menulist; -moz-appearance: menupopup } -input[type=range] { -webkit-appearance: slider-horizontal; -moz-appearance: initial; } -.input-group-addon { padding: 0.46153846em .75em; font-size: 0.8125rem; border: 1px solid rgba(0, 0, 0, .15); border-radius: .1em; } -.form-control.dropdown-item:focus, .form-control.dropdown-item:hover { background-color: inherit } -::-ms-value { border: none; margin: 0; padding: 0 0 1px; line-height: 1 } -select::-ms-expand { display: none; } -::-moz-focus-inner { border: 0; padding: 0; } + +legend { + font-size: 1em; +} + +label { + cursor: pointer; + display: inline-block; + margin-bottom: .5em +} + +label:not([for]) { + cursor: default +} + +button, +input { + margin: 0; + padding: 0; + border: none; + font: inherit; + line-height: normal; +} + +input[type=checkbox], +input[type=radio] { + width: 0.8125rem !important; + height: 0.8125rem !important; + margin-right: 0.25em; + vertical-align: -0.15em; + border-radius: .1rem; + border: 1px solid #d4d4d4; + background: #fff no-repeat 50% -1em; + outline: none; + transition: border-color .2s, background-position .1s; +} + +input[type=checkbox] { + background-image: url("data:image/svg+xml;utf8,%3Csvg%20viewBox%3D%270%200%201792%201792%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M1671%20566q0%2040-28%2068l-724%20724-136%20136q-28%2028-68%2028t-68-28l-136-136-362-362q-28-28-28-68t28-68l136-136q28-28%2068-28t68%2028l294%20295%20656-657q28-28%2068-28t68%2028l136%20136q28%2028%2028%2068z%27%20fill%3D%27%23444%27/%3E%3C/svg%3E"); + background-size: 1em; +} + +input[type=radio] { + background-image: url("data:image/svg+xml;utf-8,%3Csvg%20viewBox%3D%270%200%201792%201792%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M1664%20896q0%20209-103%20385.5t-279.5%20279.5-385.5%20103-385.5-103-279.5-279.5-103-385.5%20103-385.5%20279.5-279.5%20385.5-103%20385.5%20103%20279.5%20279.5%20103%20385.5z%27%20fill%3D%27%23444%27/%3E%3C/svg%3E"); + background-size: .609375em; + border-radius: 50% +} + +input[type=checkbox]:hover, +input[type=radio]:hover { + border-color: #bcbcbc +} + +input[type=checkbox]:active, +input[type=radio]:active { + background-color: #fafafa; +} + +input[type=checkbox]:focus, +input[type=radio]:focus { + border-color: #4d8ef9 !important; + box-shadow: 0 0 0 1px rgba(77, 142, 249, 0.5) +} + +input[type=checkbox]:checked, +input[type=radio]:checked { + background-position: 50% 50% +} + +input[type=checkbox]:disabled { + background-image: url("data:image/svg+xml;utf8,%3Csvg%20viewBox%3D%270%200%201792%201792%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M1671%20566q0%2040-28%2068l-724%20724-136%20136q-28%2028-68%2028t-68-28l-136-136-362-362q-28-28-28-68t28-68l136-136q28-28%2068-28t68%2028l294%20295%20656-657q28-28%2068-28t68%2028l136%20136q28%2028%2028%2068z%27%20fill%3D%27%23bbb%27/%3E%3C/svg%3E"); + background-size: .875em; +} + +button, +input, +optgroup, +select, +textarea { + position: relative; + font-family: sans-serif; + font-size: 0.8125rem; + line-height: 1.23076923; + margin: 0; + -webkit-appearance: none; + -moz-appearance: none; +} + +.form-control, +input[type=text]:not(.form-control), +input[type=password], +input[type=number], +input[type=email], +input[type=date], +input[type=url], +input[type=search], +select, +textarea { + display: inline-block; + width: 100%; + max-width: 100%; + padding: 0.46153846em .5em; + line-height: 1.23076923; + vertical-align: inherit; + font-size: 0.8125rem; + color: #464a4c; + background-color: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #d4d4d4; + border-radius: .1em; + -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; + -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; +} + +.form-control:focus, +input:not([type=radio]):not([type=checkbox]):focus, +select:focus, +textarea:focus, +.btn.focus, +.btn:focus { + z-index: 3; + outline-offset: -1px; + outline: rgba(77, 142, 249, 0.5) solid 2px; + border-color: #66afe9; +} + +input:not([type=button]):not([type=submit]):hover:not(:focus), +select:hover:not(:focus), +textarea:hover:not(:focus) { + border-color: #bbb; + transition: border-color 0s, background-position .1s; +} + +.btn, +button:not(.btn), +input[type=button]:not(.btn), +input[type=submit]:not(.btn) { + display: inline-block; + padding: 0.46153846em 1em; + line-height: 1.23076923; + vertical-align: inherit; + text-align: center; + text-decoration: none !important; + font-size: 0.8125rem; + font-weight: 400; + white-space: nowrap; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; + background-color: #fff; + border: 1px solid #d4d4d4; + border-radius: .1em; + -webkit-transition: all .2s ease-in-out; + -o-transition: all .2s ease-in-out; + transition: all .2s ease-in-out +} + +select:not([size]):not([multiple]), +select.form-control:not([size]):not([multiple]), +select[size="1"]:not([multiple]) { + height: 2.3076923em; + line-height: 1.38461538 +} + +.form-control-sm, +.input-group-sm > .form-control, +.input-group-sm > .input-group-addon, +.input-group-sm > .input-group-btn > .btn, +input.form-control-sm, +.btn-group-sm > .btn, +.btn-sm, +.input-group-addon.form-control-sm, +.input-group-sm > .input-group-addon, +.input-group-sm > .input-group-btn > .input-group-addon.btn { + padding: 0.46153846em .5rem; + font-size: .6772rem; + border-radius: .1rem; +} + +.form-control-lg, +.input-group-lg > .form-control, +.input-group-lg > .input-group-addon, +.input-group-lg > .input-group-btn > .btn, +input.form-control-lg, +.btn-group-lg > .btn, +.btn-lg, +.input-group-addon.form-control-lg, +.input-group-lg > .input-group-addon, +.input-group-lg > .input-group-btn > .input-group-addon.btn { + padding: 0.46153846em .5rem; + font-size: 1.15rem; + border-radius: .1rem; +} + +.btn:hover, +input[type=button]:not(.btn):hover, +input[type=submit]:not(.btn):hover { + color: #292b2c; + background-color: #efefef; + border-color: #c3c3c3 +} + +.btn:focus, +input[type=button]:not(.btn):focus, +input[type=submit]:not(.btn):focus { + background-color: #e6e6e6; + border-color: #adadad +} + +.btn-primary { + color: #fff; + background-color: #0275d8; + border-color: #0275d8 +} + +.btn-primary:hover { + color: #fff; + background-color: #025aa5; + border-color: #01549b +} + +.btn-secondary { + color: #292b2c; + background-color: #fff; + border-color: #d4d4d4 +} + +.btn-secondary:hover { + color: #292b2c; + background-color: #e6e6e6; + border-color: #adadad +} + +.btn-success { + color: #fff; + background-color: #5cb85c; + border-color: #56ac56 +} + +.btn-success:hover { + color: #fff; + background-color: #449d44; + border-color: #419641 +} + +.btn-danger { + color: #fff; + background-color: #d9534f; + border-color: #d9534f +} + +.btn-danger:hover { + color: #fff; + background-color: #c9302c; + border-color: #c12e2a +} + +.btn-warning { + color: #fff; + background-color: #f0ad4e; + border-color: #f0ad4e; +} + +.btn-warning:hover { + color: #fff; + background-color: #ec971f; + border-color: #eb9316; +} + +.btn-info { + color: #fff; + background-color: #5bc0de; + border-color: #5bc0de; +} + +.btn-info:hover { + color: #fff; + background-color: #31b0d5; + border-color: #2aabd2; +} + +.btn-default { + color: #bbb; + background-color: #202329; + border-color: #202329 +} + +.btn-default:hover { + color: #fff; + background-color: #1a1c21; + border-color: #1a1c21 +} + +textarea, +textarea.form-control { + width: 100%; + line-height: 1.5; + overflow: auto; + resize: vertical +} + +select:not([size]):not([multiple]), +select[size="1"] { + padding-right: 2em !important; + background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTc5MiAxNzkyJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnPjxwYXRoIGQ9J00xMzk1IDczNnEwIDEzLTEwIDIzbC00NjYgNDY2cS0xMCAxMC0yMyAxMHQtMjMtMTBsLTQ2Ni00NjZxLTEwLTEwLTEwLTIzdDEwLTIzbDUwLTUwcTEwLTEwIDIzLTEwdDIzIDEwbDM5MyAzOTMgMzkzLTM5M3ExMC0xMCAyMy0xMHQyMyAxMGw1MCA1MHExMCAxMCAxMCAyM3onIGZpbGw9JyUyMzQ0NCcvPjwvc3ZnPg==") !important; + background-repeat: no-repeat; + background-position: right center; + background-size: 2em 1.3em +} + +optgroup { + font-style: normal; + font-weight: 500; + background-color: #ddd; +} + +optgroup option { + font-weight: normal; + background-color: #fff; +} + +input[type=color] { + width: 2.308em; + height: 2.308em; + -webkit-appearance: menulist; + -moz-appearance: menupopup +} + +input[type=range] { + -webkit-appearance: slider-horizontal; + -moz-appearance: initial; +} + +.input-group-addon { + padding: 0.46153846em .75em; + font-size: 0.8125rem; + border: 1px solid rgba(0, 0, 0, .15); + border-radius: .1em; +} + +.form-control.dropdown-item:focus, +.form-control.dropdown-item:hover { + background-color: inherit +} + +::-ms-value { + border: none; + margin: 0; + padding: 0 0 1px; + line-height: 1 +} + +select::-ms-expand { + display: none; +} + +::-moz-focus-inner { + border: 0; + padding: 0; +} + @-moz-document url-prefix() { -select:not([size]):not([multiple]) { text-indent: -2px } + select:not([size]):not([multiple]) { + text-indent: -2px + } } + /* darkness */ -.darkness .form-control, .darkness input[type=text]:not(.form-control), .darkness input[type=password], .darkness input[type=number], .darkness input[type=email], .darkness input[type=date], .darkness input[type=url], .darkness input[type=search], .darkness select, .darkness textarea, .darkness .btn, .darkness button:not(.btn), .darkness input[type=button]:not(.btn), .darkness input[type=submit]:not(.btn) { border-color: #414449; background-color: #202329; color: #bbb; } -.darkness input:not([type=button]):not([type=submit]):hover:not(:focus), .darkness select:hover:not(:focus), .darkness textarea:hover:not(:focus) { border-color: #5d5d5d } -.darkness .btn:hover, .darkness input[type=button]:not(.btn):hover, .darkness input[type=submit]:not(.btn):hover { border-color: #414449; background-color: #282c34; color: #eee; } -.darkness .btn-primary { color: #fff; background-color: #0275d8; border-color: #0275d8 } -.darkness .btn-primary:hover { color: #fff; background-color: #025aa5; border-color: #01549b } -.darkness .btn-secondary.active.focus, .darkness .btn-secondary.active:focus, .darkness .btn-secondary.active:hover, .darkness .btn-secondary:active.focus, .darkness .btn-secondary:active:focus, .darkness .btn-secondary:active:hover, .darkness .open > .btn-secondary.dropdown-toggle.focus, .darkness .open > .btn-secondary.dropdown-toggle:focus, .darkness .open > .btn-secondary.dropdown-toggle:hover { border-color: #414449; background-color: #1a1c21; color: #eee; } -.darkness .btn-secondary.focus, .darkness .btn-secondary:focus { border-color: #414449; background-color: #1a1c21; color: #eee; } -.darkness .btn-success { color: #fff; background-color: #428743; border-color: #479048; } -.darkness .btn-success.active, .darkness .btn-success:active, .darkness .open > .btn-success.dropdown-toggle { color: #fff; border-color: #419641; background: #448546 none; } -.darkness .btn-success:hover { color: #fff; background-color: #39773a; border-color: #39773a; } -.darkness .btn-danger { color: #fff; background-color: #d9534f; border-color: #d9534f } -.darkness .btn-danger:hover { color: #fff; background-color: #c9302c; border-color: #c12e2a } -.darkness .btn-warning { color: #fff; background-color: #f0ad4e; border-color: #f0ad4e; } -.darkness .btn-warning:hover { color: #fff; background-color: #ec971f; border-color: #eb9316; } -.darkness .btn-info { color: #fff; background-color: #5bc0de; border-color: #5bc0de; } -.darkness .btn-info:hover { color: #fff; background-color: #31b0d5; border-color: #2aabd2; } -.darkness .btn-default { color: #bbb; background-color: #202329; border-color: #202329 } -.darkness .btn-default:hover { color: #fff; background-color: #1a1c21; border-color: #1a1c21 } -.darkness #actions { right: 0; background-color: #282c34 } -.darkness #actions .btn-group .btn-success { box-shadow: none } -.darkness #actions .dropdown-menu .btn { background-color: #343942; border-radius: 0; color: #fff; } -.darkness #actions .dropdown-menu .btn:hover { background-color: #3c424e; color: #fff } -.darkness optgroup { background-color: #202329 } -.darkness optgroup option { background-color: #1a1c21 } -.darkness .float-xs-right > select { width: auto } -.darkness input[type=checkbox], .darkness input[type=radio] { border: 1px solid #414449; background-color: #202329 } -.darkness input[type=checkbox]:checked, .darkness input[type=radio]:checked { background-color: #ffc107; border-color: #ffc107 !important } -.darkness input[type=checkbox]:checked:hover, .darkness input[type=radio]:checked:hover { box-shadow: 0 0 .5em #ffc107 } -.darkness input[type=checkbox]:checked + label { background-color: transparent !important; color: #fff; } -.darkness input[type=checkbox] + label:hover { color: #fff; } -.darkness input[type=checkbox]:disabled, .darkness input[type=radio]:disabled, .darkness input[type=checkbox]:checked:disabled, .darkness input[type=radio]:checked:disabled { background-color: #282c34; border-color: #414449 !important; box-shadow: none !important; } -.darkness select:not([size]):not([multiple]), .darkness select[size="1"] { background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTc5MiAxNzkyJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIGZpbGw9JyNlZWUnPjxwYXRoIGQ9J00xMzk1IDczNnEwIDEzLTEwIDIzbC00NjYgNDY2cS0xMCAxMC0yMyAxMHQtMjMtMTBsLTQ2Ni00NjZxLTEwLTEwLTEwLTIzdDEwLTIzbDUwLTUwcTEwLTEwIDIzLTEwdDIzIDEwbDM5MyAzOTMgMzkzLTM5M3ExMC0xMCAyMy0xMHQyMyAxMGw1MCA1MHExMCAxMCAxMCAyM3onLz48L3N2Zz4=") !important; background-repeat: no-repeat; } -.darkness select[size="1"]:not(.unstyled), .darkness select[name="which_editor"] { width: auto; } -.darkness input:-webkit-autofill, .darkness textarea:-webkit-autofill, .darkness select:-webkit-autofill, .darkness input:-webkit-autofill:focus { border-color: #ffc107 !important; -webkit-animation-name: autofill; -webkit-animation-fill-mode: both; outline: none } -.darkness input:-webkit-autofill:focus { box-shadow: 0 0 0.5em #ffc107; } -@-webkit-keyframes autofill { -to { -color: #bbb; -background: transparent; + +.darkness .form-control, +.darkness input[type=text]:not(.form-control), +.darkness input[type=password], +.darkness input[type=number], +.darkness input[type=email], +.darkness input[type=date], +.darkness input[type=url], +.darkness input[type=search], +.darkness select, +.darkness textarea, +.darkness .btn, +.darkness button:not(.btn), +.darkness input[type=button]:not(.btn), +.darkness input[type=submit]:not(.btn) { + border-color: #414449; + background-color: #202329; + color: #bbb; +} + +.darkness input:not([type=button]):not([type=submit]):hover:not(:focus), +.darkness select:hover:not(:focus), +.darkness textarea:hover:not(:focus) { + border-color: #5d5d5d +} + +.darkness .btn:hover, +.darkness input[type=button]:not(.btn):hover, +.darkness input[type=submit]:not(.btn):hover { + border-color: #414449; + background-color: #282c34; + color: #eee; +} + +.darkness .btn-primary { + color: #fff; + background-color: #0275d8; + border-color: #0275d8 +} + +.darkness .btn-primary:hover { + color: #fff; + background-color: #025aa5; + border-color: #01549b +} + +.darkness .btn-secondary.active.focus, +.darkness .btn-secondary.active:focus, +.darkness .btn-secondary.active:hover, +.darkness .btn-secondary:active.focus, +.darkness .btn-secondary:active:focus, +.darkness .btn-secondary:active:hover, +.darkness .open > .btn-secondary.dropdown-toggle.focus, +.darkness .open > .btn-secondary.dropdown-toggle:focus, +.darkness .open > .btn-secondary.dropdown-toggle:hover { + border-color: #414449; + background-color: #1a1c21; + color: #eee; +} + +.darkness .btn-secondary.focus, +.darkness .btn-secondary:focus { + border-color: #414449; + background-color: #1a1c21; + color: #eee; +} + +.darkness .btn-success { + color: #fff; + background-color: #428743; + border-color: #479048; +} + +.darkness .btn-success.active, +.darkness .btn-success:active, +.darkness .open > .btn-success.dropdown-toggle { + color: #fff; + border-color: #419641; + background: #448546 none; +} + +.darkness .btn-success:hover { + color: #fff; + background-color: #39773a; + border-color: #39773a; +} + +.darkness .btn-danger { + color: #fff; + background-color: #d9534f; + border-color: #d9534f +} + +.darkness .btn-danger:hover { + color: #fff; + background-color: #c9302c; + border-color: #c12e2a +} + +.darkness .btn-warning { + color: #fff; + background-color: #f0ad4e; + border-color: #f0ad4e; +} + +.darkness .btn-warning:hover { + color: #fff; + background-color: #ec971f; + border-color: #eb9316; +} + +.darkness .btn-info { + color: #fff; + background-color: #5bc0de; + border-color: #5bc0de; +} + +.darkness .btn-info:hover { + color: #fff; + background-color: #31b0d5; + border-color: #2aabd2; } + +.darkness .btn-default { + color: #bbb; + background-color: #202329; + border-color: #202329 +} + +.darkness .btn-default:hover { + color: #fff; + background-color: #1a1c21; + border-color: #1a1c21 +} + +.darkness #actions { + right: 0; + background-color: #282c34 +} + +.darkness #actions .btn-group .btn-success { + box-shadow: none +} + +.darkness #actions .dropdown-menu .btn { + background-color: #343942; + border-radius: 0; + color: #fff; +} + +.darkness #actions .dropdown-menu .btn:hover { + background-color: #3c424e; + color: #fff +} + +.darkness optgroup { + background-color: #202329 +} + +.darkness optgroup option { + background-color: #1a1c21 +} + +.darkness .float-xs-right > select { + width: auto +} + +.darkness input[type=checkbox], +.darkness input[type=radio] { + border: 1px solid #414449; + background-color: #202329 +} + +.darkness input[type=checkbox]:checked, +.darkness input[type=radio]:checked { + background-color: #ffc107; + border-color: #ffc107 !important +} + +.darkness input[type=checkbox]:checked:hover, +.darkness input[type=radio]:checked:hover { + box-shadow: 0 0 .5em #ffc107 +} + +.darkness input[type=checkbox]:checked + label { + background-color: transparent !important; + color: #fff; +} + +.darkness input[type=checkbox] + label:hover { + color: #fff; +} + +.darkness input[type=checkbox]:disabled, +.darkness input[type=radio]:disabled, +.darkness input[type=checkbox]:checked:disabled, +.darkness input[type=radio]:checked:disabled { + background-color: #282c34; + border-color: #414449 !important; + box-shadow: none !important; +} + +.darkness select:not([size]):not([multiple]), +.darkness select[size="1"] { + background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTc5MiAxNzkyJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIGZpbGw9JyNlZWUnPjxwYXRoIGQ9J00xMzk1IDczNnEwIDEzLTEwIDIzbC00NjYgNDY2cS0xMCAxMC0yMyAxMHQtMjMtMTBsLTQ2Ni00NjZxLTEwLTEwLTEwLTIzdDEwLTIzbDUwLTUwcTEwLTEwIDIzLTEwdDIzIDEwbDM5MyAzOTMgMzkzLTM5M3ExMC0xMCAyMy0xMHQyMyAxMGw1MCA1MHExMCAxMCAxMCAyM3onLz48L3N2Zz4=") !important; + background-repeat: no-repeat; +} + +.darkness select[size="1"]:not(.unstyled), +.darkness select[name="which_editor"] { + width: auto; +} + +.darkness input:-webkit-autofill, +.darkness textarea:-webkit-autofill, +.darkness select:-webkit-autofill, +.darkness input:-webkit-autofill:focus { + border-color: #ffc107 !important; + -webkit-animation-name: autofill; + -webkit-animation-fill-mode: both; + outline: none +} + +.darkness input:-webkit-autofill:focus { + box-shadow: 0 0 0.5em #ffc107; +} + +@-webkit-keyframes autofill { + to { + color: #bbb; + background: transparent; + } } diff --git a/manager/media/style/default/css/index.css b/manager/media/style/default/css/index.css index bfbfad49fb..611d2d96e2 100755 --- a/manager/media/style/default/css/index.css +++ b/manager/media/style/default/css/index.css @@ -1,48 +1,262 @@ -#frameset { position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; } -#mainMenu, #tree, #main { position: absolute; } -#mainMenu { top: 0; left: 0; width: 100%; height: 2.2rem; z-index: 100; } -#tree { left: 0; top: 2.2rem; bottom: 0; width: 25rem; max-width: 100%; overflow: hidden; z-index: 2; } -#main { left: 25rem; top: 2.2rem; right: 0; bottom: 0; z-index: 1; } -#main #mainframe { display: block; position: absolute; width: 100%; height: 100%; overflow: auto; } +#frameset { + position: absolute; + left: 0; + top: 0; + right: 0; + bottom: 0; + overflow: hidden; +} + +#mainMenu, +#tree, +#main { + position: absolute; +} + +#mainMenu { + top: 0; + left: 0; + width: 100%; + height: 2.2rem; + z-index: 100; +} + +#tree { + left: 0; + top: 2.2rem; + bottom: 0; + width: 25rem; + max-width: 100%; + overflow: hidden; + z-index: 2; +} + +#main { + left: 25rem; + top: 2.2rem; + right: 0; + bottom: 0; + z-index: 1; +} + +#main #mainframe { + display: block; + position: absolute; + width: 100%; + height: 100%; + overflow: auto; +} + /* floater */ -#floater { position: fixed; z-index: 1000; opacity: 0; visibility: hidden; max-width: 20rem; padding: 1.5rem; top: 4rem; left: 2rem; border-radius: 0.25rem; background-color: #fff; -webkit-box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); transition-duration: 0.15s } -#floater.show { opacity: 1; visibility: visible; } + +#floater { + position: fixed; + z-index: 1000; + opacity: 0; + visibility: hidden; + max-width: 20rem; + padding: 1.5rem; + top: 4rem; + left: 2rem; + border-radius: 0.25rem; + background-color: #fff; + -webkit-box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); + box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); + transition-duration: 0.15s +} + +#floater.show { + opacity: 1; + visibility: visible; +} + /*resizer*/ -#resizer { position: absolute; z-index: 99; top: 2.2rem; bottom: 0; left: 25rem; width: 5px; margin-left: -1px; cursor: col-resize; background-color: transparent; transition: background-color .3s } -#resizer:hover { background-color: rgba(0, 0, 0, 0.1); } -#mask_resizer { position: absolute; width: 100%; height: 100%; } + +#resizer { + position: absolute; + z-index: 99; + top: 2.2rem; + bottom: 0; + left: 25rem; + width: 5px; + margin-left: -1px; + cursor: col-resize; + background-color: transparent; + transition: background-color .3s +} + +#resizer:hover { + background-color: rgba(0, 0, 0, 0.1); +} + +#mask_resizer { + position: absolute; + width: 100%; + height: 100%; +} + /* mainloader */ -#mainloader { position: absolute; z-index: 50000; top: 0; left: 0; width: 100%; height: 100%; text-align: center; vertical-align: middle; padding: 15% 0 0 0; background-color: rgba(255, 255, 255, 0.64); opacity: 0; visibility: hidden; -webkit-transition-duration: 0.3s; transition-duration: 0.3s } -#mainloader.show { opacity: 0.75; visibility: visible; -webkit-transition-duration: 0.1s; transition-duration: 0.1s } -#mainloader::before { content: ""; display: block; position: absolute; z-index: 1; left: 50%; top: 30%; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; animation: rotate 2s linear infinite; box-shadow: 5px 5px 0 0 rgb(234, 132, 82), 14px -7px 0 0 rgba(111, 163, 219, 0.7), -7px 11px 0 0 rgba(112, 193, 92, 0.74), -11px -7px 0 0 rgba(147, 205, 99, 0.78); } -.sidebar-closed #tree { width: 0 !important; } -.sidebar-closed #main, .sidebar-closed #resizer { left: 0 !important; } + +#mainloader { + position: absolute; + z-index: 50000; + top: 0; + left: 0; + width: 100%; + height: 100%; + text-align: center; + vertical-align: middle; + padding: 15% 0 0 0; + background-color: rgba(255, 255, 255, 0.64); + opacity: 0; + visibility: hidden; + -webkit-transition-duration: 0.3s; + transition-duration: 0.3s +} + +#mainloader.show { + opacity: 0.75; + visibility: visible; + -webkit-transition-duration: 0.1s; + transition-duration: 0.1s +} + +#mainloader::before { + content: ""; + display: block; + position: absolute; + z-index: 1; + left: 50%; + top: 30%; + width: 120px; + height: 120px; + margin: -60px 0 0 -60px; + border-radius: 50%; + animation: rotate 2s linear infinite; + box-shadow: 5px 5px 0 0 rgb(234, 132, 82), 14px -7px 0 0 rgba(111, 163, 219, 0.7), -7px 11px 0 0 rgba(112, 193, 92, 0.74), -11px -7px 0 0 rgba(147, 205, 99, 0.78); +} + +.sidebar-closed #tree { + width: 0 !important; +} + +.sidebar-closed #main, +.sidebar-closed #resizer { + left: 0 !important; +} + @media (min-width: 1200px) { -#mainMenu { height: 2.5rem; } -#tree, #main { top: 2.5rem; } + #mainMenu { + height: 2.5rem; + } + #tree, + #main { + top: 2.5rem; + } } + @media (max-width: 840px) { -#floater { left: 0; right: 0; margin: 0 auto; } -#resizer { display: none } -#frameset #mask_resizer { z-index: 3 !important; opacity: 0.5; visibility: visible; background-color: #000; -webkit-transition: 0.2s; transition: 0.2s } -.sidebar-closed #frameset #mask_resizer { opacity: 0; visibility: hidden; } -#tree { z-index: 5; width: 100% !important; max-width: 20rem; box-shadow: 0 0 1rem rgba(0, 0, 0, 0.25); -webkit-transition: 0.25s; transition: 0.25s } -.sidebar-closed #tree { width: auto !important; box-shadow: none; -webkit-transform: translate3d(-100%, 0, 0); transform: translate3d(-100%, 0, 0); } -#tree .treeframebody { box-shadow: none } -.sidebar-closed #main::after { content: ""; position: absolute; z-index: 1; left: 0; top: 6rem; bottom: 0; width: 1rem; } -#main { left: 0 !important; } -#main::before { content: ""; position: absolute; z-index: 9999; left: 0; top: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0); } -.sidebar-closed #mainMenu:not(.show) + #tree + #main::before { display: none } + #floater { + left: 0; + right: 0; + margin: 0 auto; + } + #resizer { + display: none + } + #frameset #mask_resizer { + z-index: 3 !important; + opacity: 0.5; + visibility: visible; + background-color: #000; + -webkit-transition: 0.2s; + transition: 0.2s + } + .sidebar-closed #frameset #mask_resizer { + opacity: 0; + visibility: hidden; + } + #tree { + z-index: 5; + width: 100% !important; + max-width: 20rem; + box-shadow: 0 0 1rem rgba(0, 0, 0, 0.25); + -webkit-transition: 0.25s; + transition: 0.25s + } + .sidebar-closed #tree { + width: auto !important; + box-shadow: none; + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + } + #tree .treeframebody { + box-shadow: none + } + .sidebar-closed #main::after { + content: ""; + position: absolute; + z-index: 1; + left: 0; + top: 6rem; + bottom: 0; + width: 1rem; + } + #main { + left: 0 !important; + } + #main::before { + content: ""; + position: absolute; + z-index: 9999; + left: 0; + top: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0); + } + .sidebar-closed #mainMenu:not(.show) + #tree + #main::before { + display: none + } } + @keyframes rotate { -to { transform: rotate(360deg) } + to { + transform: rotate(360deg) + } } + /* dark */ -.dark #frameset { background-color: #202329 } -.dark #main { background-color: #ecf0f1 } -.dark #mainloader { background-color: rgba(0, 0, 0, 0.1); } + +.dark #frameset { + background-color: #202329 +} + +.dark #main { + background-color: #ecf0f1 +} + +.dark #mainloader { + background-color: rgba(0, 0, 0, 0.1); +} + /* darkness */ -.darkness { letter-spacing: .021em } -.darkness #mainloader { background-color: rgba(0, 0, 0, 0.1); } -.darkness, .darkness #frameset, .darkness #main { background-color: #282c34; color: #bdbdbd; } -.darkness > form { background-color: #202329 } + +.darkness { + letter-spacing: .021em +} + +.darkness #mainloader { + background-color: rgba(0, 0, 0, 0.1); +} + +.darkness, +.darkness #frameset, +.darkness #main { + background-color: #282c34; + color: #bdbdbd; +} + +.darkness > form { + background-color: #202329 +} diff --git a/manager/media/style/default/css/layout.css b/manager/media/style/default/css/layout.css index 173a9bcd6c..05bf9d5463 100755 --- a/manager/media/style/default/css/layout.css +++ b/manager/media/style/default/css/layout.css @@ -1,29 +1,151 @@ -.layout { display: table; table-layout: fixed; height: 100%; width: 100% } -.layout > .layout-row { display: table-row; vertical-align: top; height: 100% } -.layout > .layout-row > .layout-cell { display: table-cell; vertical-align: top; height: 100% } -.layout > .layout-row > .layout-cell.layout-container, .layout > .layout-row > .layout-cell .layout-container, .layout > .layout-row > .layout-cell.padded-container, .layout > .layout-row > .layout-cell .padded-container { padding: 1rem 1rem 0 1rem } -.layout > .layout-row > .layout-cell.layout-container .container-flush, .layout > .layout-row > .layout-cell .layout-container .container-flush, .layout > .layout-row > .layout-cell.padded-container .container-flush, .layout > .layout-row > .layout-cell .padded-container .container-flush { padding-top: 0 } -.layout > .layout-row > .layout-cell .layout-relative { position: relative; height: 100% } -.layout > .layout-row > .layout-cell .layout-absolute { position: absolute; height: 100%; width: 100% } -.layout > .layout-row > .layout-cell.min-size { width: 0 } -.layout > .layout-row > .layout-cell.min-height { height: 0 } -.layout > .layout-row > .layout-cell.center { text-align: center } -.layout > .layout-row > .layout-cell.middle { vertical-align: middle } -.layout > .layout-row > .layout-cell.layout-container, .layout > .layout-row > .layout-cell .layout-container, .layout > .layout-row > .layout-cell.padded-container, .layout > .layout-row > .layout-cell .padded-container { padding: 1rem 1rem 0 1rem } -.layout > .layout-row > .layout-cell.layout-container .container-flush, .layout > .layout-row > .layout-cell .layout-container .container-flush, .layout > .layout-row > .layout-cell.padded-container .container-flush, .layout > .layout-row > .layout-cell .padded-container .container-flush { padding-top: 0 } -.layout > .layout-row > .layout-cell .layout-relative { position: relative; height: 100% } -.layout > .layout-row > .layout-cell .layout-absolute { position: absolute; height: 100%; width: 100% } -.layout > .layout-row > .layout-cell.min-size { width: 0 } -.layout > .layout-row > .layout-cell.min-height { height: 0 } -.layout > .layout-row > .layout-cell.center { text-align: center } -.layout > .layout-row > .layout-cell.middle { vertical-align: middle } -.layout > .layout-row.min-size { height: 0 } -.layout > .layout-cell { display: table-cell; vertical-align: top; height: 100% } -.layout > .layout-cell.layout-container, .layout > .layout-cell .layout-container, .layout > .layout-cell.padded-container, .layout > .layout-cell .padded-container { padding: 1rem 1rem 0 1rem } -.layout > .layout-cell.layout-container .container-flush, .layout > .layout-cell .layout-container .container-flush, .layout > .layout-cell.padded-container .container-flush, .layout > .layout-cell .padded-container .container-flush { padding-top: 0 } -.layout > .layout-cell .layout-relative { position: relative; height: 100% } -.layout > .layout-cell .layout-absolute { position: absolute; height: 100%; width: 100% } -.layout > .layout-cell.min-size { width: 0 } -.layout > .layout-cell.min-height { height: 0 } -.layout > .layout-cell.center { text-align: center } -.layout > .layout-cell.middle { vertical-align: middle } +.layout { + display: table; + table-layout: fixed; + height: 100%; + width: 100% +} + +.layout > .layout-row { + display: table-row; + vertical-align: top; + height: 100% +} + +.layout > .layout-row > .layout-cell { + display: table-cell; + vertical-align: top; + height: 100% +} + +.layout > .layout-row > .layout-cell.layout-container, +.layout > .layout-row > .layout-cell .layout-container, +.layout > .layout-row > .layout-cell.padded-container, +.layout > .layout-row > .layout-cell .padded-container { + padding: 1rem 1rem 0 1rem +} + +.layout > .layout-row > .layout-cell.layout-container .container-flush, +.layout > .layout-row > .layout-cell .layout-container .container-flush, +.layout > .layout-row > .layout-cell.padded-container .container-flush, +.layout > .layout-row > .layout-cell .padded-container .container-flush { + padding-top: 0 +} + +.layout > .layout-row > .layout-cell .layout-relative { + position: relative; + height: 100% +} + +.layout > .layout-row > .layout-cell .layout-absolute { + position: absolute; + height: 100%; + width: 100% +} + +.layout > .layout-row > .layout-cell.min-size { + width: 0 +} + +.layout > .layout-row > .layout-cell.min-height { + height: 0 +} + +.layout > .layout-row > .layout-cell.center { + text-align: center +} + +.layout > .layout-row > .layout-cell.middle { + vertical-align: middle +} + +.layout > .layout-row > .layout-cell.layout-container, +.layout > .layout-row > .layout-cell .layout-container, +.layout > .layout-row > .layout-cell.padded-container, +.layout > .layout-row > .layout-cell .padded-container { + padding: 1rem 1rem 0 1rem +} + +.layout > .layout-row > .layout-cell.layout-container .container-flush, +.layout > .layout-row > .layout-cell .layout-container .container-flush, +.layout > .layout-row > .layout-cell.padded-container .container-flush, +.layout > .layout-row > .layout-cell .padded-container .container-flush { + padding-top: 0 +} + +.layout > .layout-row > .layout-cell .layout-relative { + position: relative; + height: 100% +} + +.layout > .layout-row > .layout-cell .layout-absolute { + position: absolute; + height: 100%; + width: 100% +} + +.layout > .layout-row > .layout-cell.min-size { + width: 0 +} + +.layout > .layout-row > .layout-cell.min-height { + height: 0 +} + +.layout > .layout-row > .layout-cell.center { + text-align: center +} + +.layout > .layout-row > .layout-cell.middle { + vertical-align: middle +} + +.layout > .layout-row.min-size { + height: 0 +} + +.layout > .layout-cell { + display: table-cell; + vertical-align: top; + height: 100% +} + +.layout > .layout-cell.layout-container, +.layout > .layout-cell .layout-container, +.layout > .layout-cell.padded-container, +.layout > .layout-cell .padded-container { + padding: 1rem 1rem 0 1rem +} + +.layout > .layout-cell.layout-container .container-flush, +.layout > .layout-cell .layout-container .container-flush, +.layout > .layout-cell.padded-container .container-flush, +.layout > .layout-cell .padded-container .container-flush { + padding-top: 0 +} + +.layout > .layout-cell .layout-relative { + position: relative; + height: 100% +} + +.layout > .layout-cell .layout-absolute { + position: absolute; + height: 100%; + width: 100% +} + +.layout > .layout-cell.min-size { + width: 0 +} + +.layout > .layout-cell.min-height { + height: 0 +} + +.layout > .layout-cell.center { + text-align: center +} + +.layout > .layout-cell.middle { + vertical-align: middle +} diff --git a/manager/media/style/default/css/main.css b/manager/media/style/default/css/main.css index a3807f7e73..65a04dc862 100755 --- a/manager/media/style/default/css/main.css +++ b/manager/media/style/default/css/main.css @@ -1,193 +1,898 @@ /* -------------------------[ Misc stuff ]--- */ -.comment { font-size: 11px; color: #999; padding: 4px 0; } -.screen { border: 1px solid #ddd; text-align: center; } -.even { background: #d9e7c2; } -.odd { background: #fff; } + +.comment { + font-size: 11px; + color: #999; + padding: 4px 0; +} + +.screen { + border: 1px solid #ddd; + text-align: center; +} + +.even { + background: #d9e7c2; +} + +.odd { + background: #fff; +} + /* -------------------------[ end sortable table ]--- */ -.disabledImage { width: 20px; opacity: 0.3; filter: alpha(opacity=30); } -.disabledImage img { border: 0; } -.editorCell { border-top: 1px solid #808080; text-align: left; vertical-align: baseline; } + +.disabledImage { + width: 20px; + opacity: 0.3; + filter: alpha(opacity=30); +} + +.disabledImage img { + border: 0; +} + +.editorCell { + border-top: 1px solid #808080; + text-align: left; + vertical-align: baseline; +} + /* */ -.unpublished a, .unpublish { color: #b68282; font-style: italic; } -.notInMenuNode { color: #39515d; text-decoration: none; } -#treeSplitter { width: 10px; height: 100%; position: absolute; right: -10px; } -.deleted { color: #a52a2a; text-decoration: line-through; } -label.disabled { color: #aaa; } + +.unpublished a, +.unpublish { + color: #b68282; + font-style: italic; +} + +.notInMenuNode { + color: #39515d; + text-decoration: none; +} + +#treeSplitter { + width: 10px; + height: 100%; + position: absolute; + right: -10px; +} + +.deleted { + color: #a52a2a; + text-decoration: line-through; +} + +label.disabled { + color: #aaa; +} + /* -------------------------[ home page main links ]--- */ + /*a.hometblink, a.hometblink:active, .hometblink { text-decoration: underline; color: #333; font-weight: 500; font-size: 12px; } a.hometblink:hover { text-decoration: underline; color: Gray; }*/ -.notice { width: 100%; padding: 5px; border: 1px solid #eee; background-color: #f5f5f5; color: #707070; } + +.notice { + width: 100%; + padding: 5px; + border: 1px solid #eee; + background-color: #f5f5f5; + color: #707070; +} + /* -------------------------[ Settings Table ]--- */ -.filelist td { border-bottom: 1px solid #c2c3cf; } + +.filelist td { + border-bottom: 1px solid #c2c3cf; +} + /* -------------------------[ Welcome Page ]--- */ + /*#mainActionPages { background: #f5f5f5; }*/ + /* -------------------------[ New sortable table class ]--- */ -.sortabletable { width: 100%; border-collapse: collapse; } -.sortabletable thead tr { color: #333; font-weight: 500; white-space: nowrap; background-color: #d2d2d2; text-align: left; } -.sortabletable tr { background: #fff; } -.sortabletable tr.even { background: #f7f7f7; } -.sortabletable tbody tr:hover { background: #e9f0f3; } -.sortabletable td, .sortabletable th { padding: 5px !important; border: 1px solid #ccc; } -.sortabletable th { text-align: left; cursor: pointer; color: #333; } -.sortabletable th a { text-decoration: none; color: #333; } -.sortabletable th:active { background: #ccc; padding: 3px 4px 1px 6px; } + +.sortabletable { + width: 100%; + border-collapse: collapse; +} + +.sortabletable thead tr { + color: #333; + font-weight: 500; + white-space: nowrap; + background-color: #d2d2d2; + text-align: left; +} + +.sortabletable tr { + background: #fff; +} + +.sortabletable tr.even { + background: #f7f7f7; +} + +.sortabletable tbody tr:hover { + background: #e9f0f3; +} + +.sortabletable td, +.sortabletable th { + padding: 5px !important; + border: 1px solid #ccc; +} + +.sortabletable th { + text-align: left; + cursor: pointer; + color: #333; +} + +.sortabletable th a { + text-decoration: none; + color: #333; +} + +.sortabletable th:active { + background: #ccc; + padding: 3px 4px 1px 6px; +} + /* -------------------------[ Pagination table ]--- */ -#max-display-records { margin: 10px 0; } -fieldset.tab-page { border: 1px solid #e4e4e4 !important; } -h2#edit_document_title { font-size: 0.9rem; color: #f5f5f5; width: 100%; border-bottom: none; padding: 5px 10px; } -fieldset#preview h2.tab { float: right; } + +#max-display-records { + margin: 10px 0; +} + +fieldset.tab-page { + border: 1px solid #e4e4e4 !important; +} + +h2#edit_document_title { + font-size: 0.9rem; + color: #f5f5f5; + width: 100%; + border-bottom: none; + padding: 5px 10px; +} + +fieldset#preview h2.tab { + float: right; +} + /* * Generic styles for all form elements */ -form#mutate dt, form#mutate dd { margin-bottom: 10px; } -form#mutate dt label, form#mutate dt h3.label { font-size: 1em; display: inline; float: left; width: 200px; color: #821517 !important; font-weight: 500; } -form#mutate dd { margin-left: 210px; } -form#mutate input.disabled { background-color: #f5f5f5 !important; } + +form#mutate dt, +form#mutate dd { + margin-bottom: 10px; +} + +form#mutate dt label, +form#mutate dt h3.label { + font-size: 1em; + display: inline; + float: left; + width: 200px; + color: #821517 !important; + font-weight: 500; +} + +form#mutate dd { + margin-left: 210px; +} + +form#mutate input.disabled { + background-color: #f5f5f5 !important; +} + /*form#mutate select.inputBox { margin-right: 5px; }*/ -form#mutate .multitv input[type="text"] { width: 300px; } -form#mutate .imageField { width: 50%; min-width: 300px; } -form#mutate input[name="menuindex"] { text-align: center; width: 80px; padding-left: 0; padding-right: 0; } -form#mutate input[name="ta"].inputBox { padding-left: 30px } -form#mutate input[name="ta"].inputBox:focus + input[type=button], form#mutate input[name="ta"].inputBox:focus + .CodeMirror + input[type=button] { border-color: #1377c5 #1377c5 #1377c5 #bbb; } -input[name^=tv].DatePicker, input[name*=date].DatePicker, input[name=createdon].DatePicker, input[name=editedon].DatePicker { float: left; width: auto; padding-right: 2em } -input[name^=tv].DatePicker + a, input[name*=date].DatePicker + a { position: relative; z-index: 5; margin-top: 0.5em; margin-left: -1.5em; float: left; } -form#mutate textarea.tv_textareamini { height: 100px; width: 300px; overflow-y: scroll; } -form#mutate textarea.tv_textarea { height: 100px; width: 100%; overflow-y: scroll; } -form#mutate #llock { position: relative; z-index: 5; float: left; width: 1.9rem; height: 1.9rem; margin: 0 -2rem 0 0; line-height: 2rem; cursor: pointer; text-align: center; } -form#mutate #llock + #ta { display: block !important; padding-left: 2rem } -form#mutate #llock + #ta + .CodeMirror { display: none !important; } -form#mutate #plock { width: 1.4em; cursor: pointer; font-size: 14px } + +form#mutate .multitv input[type="text"] { + width: 300px; +} + +form#mutate .imageField { + width: 50%; + min-width: 300px; +} + +form#mutate input[name="menuindex"] { + text-align: center; + width: 80px; + padding-left: 0; + padding-right: 0; +} + +form#mutate input[name="ta"].inputBox { + padding-left: 30px +} + +form#mutate input[name="ta"].inputBox:focus + input[type=button], +form#mutate input[name="ta"].inputBox:focus + .CodeMirror + input[type=button] { + border-color: #1377c5 #1377c5 #1377c5 #bbb; +} + +input[name^=tv].DatePicker, +input[name*=date].DatePicker, +input[name=createdon].DatePicker, +input[name=editedon].DatePicker { + float: left; + width: auto; + padding-right: 2em +} + +input[name^=tv].DatePicker + a, +input[name*=date].DatePicker + a { + position: relative; + z-index: 5; + margin-top: 0.5em; + margin-left: -1.5em; + float: left; +} + +form#mutate textarea.tv_textareamini { + height: 100px; + width: 300px; + overflow-y: scroll; +} + +form#mutate textarea.tv_textarea { + height: 100px; + width: 100%; + overflow-y: scroll; +} + +form#mutate #llock { + position: relative; + z-index: 5; + float: left; + width: 1.9rem; + height: 1.9rem; + margin: 0 -2rem 0 0; + line-height: 2rem; + cursor: pointer; + text-align: center; +} + +form#mutate #llock + #ta { + display: block !important; + padding-left: 2rem +} + +form#mutate #llock + #ta + .CodeMirror { + display: none !important; +} + +form#mutate #plock { + width: 1.4em; + cursor: pointer; + font-size: 14px +} + /* * Individual Styles for fieldset#preview */ -fieldset#preview iframe { width: 100%; margin: 0 auto; border: 1px solid #f5f5f5; } + +fieldset#preview iframe { + width: 100%; + margin: 0 auto; + border: 1px solid #f5f5f5; +} + /* * Individual Styles for fieldset#access_permissions */ -fieldset#access_permissions dt label { width: 200px; } -fieldset#access_permissions dd { margin-left: 210px; } -fieldset#access_permissions dl dd ul li { list-style-type: none; } + +fieldset#access_permissions dt label { + width: 200px; +} + +fieldset#access_permissions dd { + margin-left: 210px; +} + +fieldset#access_permissions dl dd ul li { + list-style-type: none; +} + /* ppb: * Some styling for legacy mode fieldsets */ -fieldset.legacy { background: #fff; padding: 10px; margin: 10px 10px 35px; border: 1px solid #e4e4e4 !important; position: relative; } -fieldset.legacy h2 { width: 100%; background: #f5f5f5; margin: -10px -10px 1rem -10px; padding: 0 10px; border-bottom: 1px solid #e4e4e4 !important; } + +fieldset.legacy { + background: #fff; + padding: 10px; + margin: 10px 10px 35px; + border: 1px solid #e4e4e4 !important; + position: relative; +} + +fieldset.legacy h2 { + width: 100%; + background: #f5f5f5; + margin: -10px -10px 1rem -10px; + padding: 0 10px; + border-bottom: 1px solid #e4e4e4 !important; +} + /* System Alert Box ---------------------------------------------------------- */ -.cbOverlay { background-color: #000; z-index: 50000; } -.cbContainer { padding: 5px; background-color: white; z-index: 50000; } -.cbBox h3 { color: #000; background: #bee860 repeat-x top; padding: 5px; font-weight: 500; } -.cbBox p { margin: 3px; } -.cbBox .cbButtons { text-align: center; } -.sysAlert { width: 500px; height: 330px; white-space: nowrap; overflow: auto; } -.phptextarea { font-family: Consolas, 'Courier New', 'Courier', monospace; } + +.cbOverlay { + background-color: #000; + z-index: 50000; +} + +.cbContainer { + padding: 5px; + background-color: white; + z-index: 50000; +} + +.cbBox h3 { + color: #000; + background: #bee860 repeat-x top; + padding: 5px; + font-weight: 500; +} + +.cbBox p { + margin: 3px; +} + +.cbBox .cbButtons { + text-align: center; +} + +.sysAlert { + width: 500px; + height: 330px; + white-space: nowrap; + overflow: auto; +} + +.phptextarea { + font-family: Consolas, 'Courier New', 'Courier', monospace; +} + /* Custom */ + /* normalize some td paddings */ -#displayparams table { background: #fff; } -#displayparams table tbody td { border-bottom: 1px dotted #d3d3d3; } -.permissiongroups { margin: 0; } -.permissiongroups ul { clear: both; margin: 0; padding: 0.5rem 0; } -.permissiongroup input[type=submit], .permissiongroup input[type=button], .permissiongroups input[type=submit], .permissiongroups input[type=button] { float: left; margin: 0.3em 0.3em 0 0; } -td#displayparams > table.displayparams { border: none; } + +#displayparams table { + background: #fff; +} + +#displayparams table tbody td { + border-bottom: 1px dotted #d3d3d3; +} + +.permissiongroups { + margin: 0; +} + +.permissiongroups ul { + clear: both; + margin: 0; + padding: 0.5rem 0; +} + +.permissiongroup input[type=submit], +.permissiongroup input[type=button], +.permissiongroups input[type=submit], +.permissiongroups input[type=button] { + float: left; + margin: 0.3em 0.3em 0 0; +} + +td#displayparams > table.displayparams { + border: none; +} + /* replace warning red color in tabs */ -strong[style*='color:#EF1D1D'] { color: yellow !important; } -.selected strong[style*='color:#ffeb00'] { color: red !important; } -code { font-size: inherit; font-family: Consolas, 'Courier New', 'Courier', monospace; background-color: #eee; border: 1px solid #ccc; padding: 1px 2px; } -#resourcesPane .disabledPlugin a:hover { color: #aaa; } + +strong[style*='color:#EF1D1D'] { + color: yellow !important; +} + +.selected strong[style*='color:#ffeb00'] { + color: red !important; +} + +code { + font-size: inherit; + font-family: Consolas, 'Courier New', 'Courier', monospace; + background-color: #eee; + border: 1px solid #ccc; + padding: 1px 2px; +} + +#resourcesPane .disabledPlugin a:hover { + color: #aaa; +} + /* table styles*/ -.table, #documentPane #tv_body table, #documentPane .tmplvars table, #documentPane [id*="table-"], #documentPane [id*="table-tv"] { width: 100%; } -#documentPane .tab-page > table > tr > td:first-child, #documentPane .tab-page > table > tbody > tr > td:first-child, #documentPane .tab-page .tmplvars > table > tbody > tr > td:first-child, #tmplvarsPane .tab-page > table > tbody > tr > td:first-child, #tmplvarsPane .tab-page > table > tbody > tr > th:first-child, #chunkPane .tab-page > table > tbody > tr > td:first-child, #chunkPane .tab-page > table > tbody > tr > th:first-child, #snipetPane .tab-page > table > tbody > tr > td:first-child, #snipetPane .tab-page > table > tbody > tr > th:first-child, #pluginPane .tab-page > table > tbody > tr > td:first-child, #pluginPane .tab-page > table > tbody > tr > th:first-child, #modulePane .tab-page > table > tbody > tr > td:first-child, #modulePane .tab-page > table > tbody > tr > th:first-child, #docManagerPane .tab-page #dates > table > tbody > tr > td:first-child { width: 200px } -#documentPane .tab-page > table > tr > td:last-child, #documentPane .tab-page .tmplvars > table > tbody > tr > td:last-child { width: inherit !important } -#documentPane .tab-page > table > tbody > tr > td:first-child > .warning { display: inline-block; width: calc(100% - 1rem); } -#documentPane .tab-page > table > tbody > tr > td:first-child > [data-tooltip] { margin-top: 0.3rem; vertical-align: top } -.table--edit { margin-bottom: 1rem; } -.table th, .table td { text-align: left; vertical-align: middle; } -table th { font-weight: 500; } -.table--edit th { width: 200px; color: #555; font-size: inherit; } -.table--edit input[type="text"], .table--edit input[type="password"], .table--edit input[type="number"], .table--edit textarea, .table--edit select, .settings input[type="text"], .settings input[type="password"], .settings input[type="number"], .settings textarea, .settings select { width: 300px; } + +.table, +#documentPane #tv_body table, +#documentPane .tmplvars table, +#documentPane [id*="table-"], +#documentPane [id*="table-tv"] { + width: 100%; +} + +#documentPane .tab-page > table > tr > td:first-child, +#documentPane .tab-page > table > tbody > tr > td:first-child, +#documentPane .tab-page .tmplvars > table > tbody > tr > td:first-child, +#tmplvarsPane .tab-page > table > tbody > tr > td:first-child, +#tmplvarsPane .tab-page > table > tbody > tr > th:first-child, +#chunkPane .tab-page > table > tbody > tr > td:first-child, +#chunkPane .tab-page > table > tbody > tr > th:first-child, +#snipetPane .tab-page > table > tbody > tr > td:first-child, +#snipetPane .tab-page > table > tbody > tr > th:first-child, +#pluginPane .tab-page > table > tbody > tr > td:first-child, +#pluginPane .tab-page > table > tbody > tr > th:first-child, +#modulePane .tab-page > table > tbody > tr > td:first-child, +#modulePane .tab-page > table > tbody > tr > th:first-child, +#docManagerPane .tab-page #dates > table > tbody > tr > td:first-child { + width: 200px +} + +#documentPane .tab-page > table > tr > td:last-child, +#documentPane .tab-page .tmplvars > table > tbody > tr > td:last-child { + width: inherit !important +} + +#documentPane .tab-page > table > tbody > tr > td:first-child > .warning { + display: inline-block; + width: calc(100% - 1rem); +} + +#documentPane .tab-page > table > tbody > tr > td:first-child > [data-tooltip] { + margin-top: 0.3rem; + vertical-align: top +} + +.table--edit { + margin-bottom: 1rem; +} + +.table th, +.table td { + text-align: left; + vertical-align: middle; +} + +table th { + font-weight: 500; +} + +.table--edit th { + width: 200px; + color: #555; + font-size: inherit; +} + +.table--edit input[type="text"], +.table--edit input[type="password"], +.table--edit input[type="number"], +.table--edit textarea, +.table--edit select, +.settings input[type="text"], +.settings input[type="password"], +.settings input[type="number"], +.settings textarea, +.settings select { + width: 300px; +} + /* * MODxRE2 styles * css above is original MODxRE * css below is basicaly MODxRE overrides to get MODxRE2 look */ + /* nav */ -.no-events { pointer-events: none; } + +.no-events { + pointer-events: none; +} + /* Required for Bootstrap3 Collapse */ -.panel-title > a::before { content: "\f107"; /* fa-angle-down */ font-family: "FontAwesome"; } -.panel-title > a.collapsed::before { content: "\f105"; /* fa-angle-right */ padding: 0 1px 0 3px; } -.panel-title > a { font-size: 1.1em; color: #657587; display: block; padding: 3px 0; } -.panel-title > a:hover { text-decoration: none; color: #1377c5; background: rgba(255, 255, 255, 0.27); } + +.panel-title > a::before { + content: "\f107"; + /* fa-angle-down */ + font-family: "FontAwesome"; +} + +.panel-title > a.collapsed::before { + content: "\f105"; + /* fa-angle-right */ + padding: 0 1px 0 3px; +} + +.panel-title > a { + font-size: 1.1em; + color: #657587; + display: block; + padding: 3px 0; +} + +.panel-title > a:hover { + text-decoration: none; + color: #1377c5; + background: rgba(255, 255, 255, 0.27); +} + /* category icons in manage elements */ -#site_templates, #site_tmplvars, #site_htmlsnippets, #site_snippets, #site_plugins { padding-left: 0; } -#site_templates li, #site_tmplvars li, #site_htmlsnippets li, #site_snippets li, #site_snippets li, #site_plugins li, #categories_list li { list-style: none; margin-left: -21px; } -#site_templates li strong:before, #site_tmplvars li strong:before, #site_htmlsnippets li strong:before, #site_snippets li strong:before, #site_snippets li strong:before, #site_plugins li strong:before, #categories_list li strong:before { font-family: "FontAwesome"; font-style: normal; font-weight: normal; color: #5b6f7a; padding: 0 5px 0 5px; content: '\f105'; } -.tab-pane ul li ul li strong:before { content: ''; } + +#site_templates, +#site_tmplvars, +#site_htmlsnippets, +#site_snippets, +#site_plugins { + padding-left: 0; +} + +#site_templates li, +#site_tmplvars li, +#site_htmlsnippets li, +#site_snippets li, +#site_snippets li, +#site_plugins li, +#categories_list li { + list-style: none; + margin-left: -21px; +} + +#site_templates li strong:before, +#site_tmplvars li strong:before, +#site_htmlsnippets li strong:before, +#site_snippets li strong:before, +#site_snippets li strong:before, +#site_plugins li strong:before, +#categories_list li strong:before { + font-family: "FontAwesome"; + font-style: normal; + font-weight: normal; + color: #5b6f7a; + padding: 0 5px 0 5px; + content: '\f105'; +} + +.tab-pane ul li ul li strong:before { + content: ''; +} + /* elements icons in manage elements */ -a.man_el_name:before { font-family: "FontAwesome"; font-style: normal; font-weight: normal; font-size: 0.875rem; color: #5b6f7a; } -a.man_el_name.site_templates:before { content: '\f1ea'; } -a.man_el_name.site_tmplvars:before { content: '\f022'; } -a.man_el_name.site_htmlsnippets:before { content: '\f009'; } -a.man_el_name.site_snippets:before { content: '\f121'; } -a.man_el_name.site_plugins:before { content: '\f1e6'; } -a.man_el_name.site_modules:before { content: '\f085'; } -div#tabCategory.tab-page ul li ul li { padding-top: 7px; padding-bottom: 7px; } + +a.man_el_name:before { + font-family: "FontAwesome"; + font-style: normal; + font-weight: normal; + font-size: 0.875rem; + color: #5b6f7a; +} + +a.man_el_name.site_templates:before { + content: '\f1ea'; +} + +a.man_el_name.site_tmplvars:before { + content: '\f022'; +} + +a.man_el_name.site_htmlsnippets:before { + content: '\f009'; +} + +a.man_el_name.site_snippets:before { + content: '\f121'; +} + +a.man_el_name.site_plugins:before { + content: '\f1e6'; +} + +a.man_el_name.site_modules:before { + content: '\f085'; +} + +div#tabCategory.tab-page ul li ul li { + padding-top: 7px; + padding-bottom: 7px; +} + /*Fake tables for providing dynamic amount of cells per row*/ -.rTable { display: table; width: 100%; padding: 0; } -.rTableRow { display: table-row; padding: 0; } -.rTableHeading { display: table-header-group; } -.rTableBody { display: table-row-group; } -.rTableFoot { display: table-footer-group; } -.lockCell, .mainCell, .btnCell, .rTableHead { display: table-cell; padding: 0; } -.lockCell { width: 2.5em; padding-left: 10px; } -.mainCell { width: auto; } -.btnCell { width: 6em; text-align: right; padding-right: 1rem; } -.mainCell > span { display: block } + +.rTable { + display: table; + width: 100%; + padding: 0; +} + +.rTableRow { + display: table-row; + padding: 0; +} + +.rTableHeading { + display: table-header-group; +} + +.rTableBody { + display: table-row-group; +} + +.rTableFoot { + display: table-footer-group; +} + +.lockCell, +.mainCell, +.btnCell, +.rTableHead { + display: table-cell; + padding: 0; +} + +.lockCell { + width: 2.5em; + padding-left: 10px; +} + +.mainCell { + width: auto; +} + +.btnCell { + width: 6em; + text-align: right; + padding-right: 1rem; +} + +.mainCell > span { + display: block +} + /* Manage elements general styles */ -a.man_el_name { display: block; padding: .1em 0 .1em 1.25rem; } -a.man_el_name:hover { text-decoration: none; } -.lockCell + .mainCell a.man_el_name { padding-left: 0 !important; } -.lockCell + .mainCell a.man_el_name:before { display: none; } -.elements_descr { color: #222; margin-left: 1em; font-size: 0.88em; } -.resourceTable .panel-heading { margin: 0 -1.25rem !important; background-color: #f5f5f5; border-top: 1px dotted #dedede; border-bottom: 1px dotted #dedede; } -.resourceTable .panel-title > a { padding: 5px 1.25rem; text-decoration: none } -.resourceTable ul.elements { margin: 0 -1.25rem; padding: 0 0 10px 0; } -.resourceTable ul.elements > li { padding: 0 !important; border-bottom: 1px dotted #dedede; border-left: 3px solid #fff; transition: all 0.1s ease; margin: 0 !important; } -.resourceTable ul.elements > li:hover { background: #f9f9f9; border-left: 3px solid #1377c5; } -.resourceTable ul.elements > li::before { display: none } -#resourcesPane .panel-group ul { } -ul.resourceTable .category_name { float: none; display: block; clear: both; margin-top: 20px; } + +a.man_el_name { + display: block; + padding: .1em 0 .1em 1.25rem; +} + +a.man_el_name:hover { + text-decoration: none; +} + +.lockCell + .mainCell a.man_el_name { + padding-left: 0 !important; +} + +.lockCell + .mainCell a.man_el_name:before { + display: none; +} + +.elements_descr { + color: #222; + margin-left: 1em; + font-size: 0.88em; +} + +.resourceTable .panel-heading { + margin: 0 -1.25rem !important; + background-color: #f5f5f5; + border-top: 1px dotted #dedede; + border-bottom: 1px dotted #dedede; +} + +.resourceTable .panel-title > a { + padding: 5px 1.25rem; + text-decoration: none +} + +.resourceTable ul.elements { + margin: 0 -1.25rem; + padding: 0 0 10px 0; +} + +.resourceTable ul.elements > li { + padding: 0 !important; + border-bottom: 1px dotted #dedede; + border-left: 3px solid #fff; + transition: all 0.1s ease; + margin: 0 !important; +} + +.resourceTable ul.elements > li:hover { + background: #f9f9f9; + border-left: 3px solid #1377c5; +} + +.resourceTable ul.elements > li::before { + display: none +} + +#resourcesPane .panel-group ul {} + +ul.resourceTable .category_name { + float: none; + display: block; + clear: both; + margin-top: 20px; +} + /* Manager Elements Buttons bar*/ -ul.elements_buttonbar { list-style: none; margin: 0; padding: 0; display: table; table-layout: fixed; } -ul.elements_buttonbar li { display: table-cell; padding: 0 !important; width: 2em; } -ul.elements_buttonbar li a { display: block; width: 2em; padding: 4px 2px 2px 2px; margin: 1px; min-width: 22px; } -ul.elements_buttonbar .fa { font-size: 0.875rem; padding: 1px 1px 0; } + +ul.elements_buttonbar { + list-style: none; + margin: 0; + padding: 0; + display: table; + table-layout: fixed; +} + +ul.elements_buttonbar li { + display: table-cell; + padding: 0 !important; + width: 2em; +} + +ul.elements_buttonbar li a { + display: block; + width: 2em; + padding: 4px 2px 2px 2px; + margin: 1px; + min-width: 22px; +} + +ul.elements_buttonbar .fa { + font-size: 0.875rem; + padding: 1px 1px 0; +} + /* Checkbox "Icons" */ -.noicons.tab-page ul li ul li a:before, .noicons .elements_description a:before { display: none !important; } + +.noicons.tab-page ul li ul li a:before, +.noicons .elements_description a:before { + display: none !important; +} + /* View-dependent styles */ + /* List-view */ -.resourceTable.list li { } -.sortableList > li::before { display: none } + +.resourceTable.list li {} + +.sortableList > li::before { + display: none +} + /* Inline-view */ -.resourceTable.inline ul.elements { margin: 0 !important; } -.resourceTable.inline ul.elements > li { float: left; margin: 10px 10px 0 0 !important; padding: 0 !important; border: 1px dotted #dedede; } -.resourceTable.inline ul.elements_buttonbar { margin: 0 5px 0 0 !important; } -.resourceTable.inline a.man_el_name { padding: 5px 10px; } -.resourceTable.inline ul.elements > li:hover { border: 1px solid #aaa } + +.resourceTable.inline ul.elements { + margin: 0 !important; +} + +.resourceTable.inline ul.elements > li { + float: left; + margin: 10px 10px 0 0 !important; + padding: 0 !important; + border: 1px dotted #dedede; +} + +.resourceTable.inline ul.elements_buttonbar { + margin: 0 5px 0 0 !important; +} + +.resourceTable.inline a.man_el_name { + padding: 5px 10px; +} + +.resourceTable.inline ul.elements > li:hover { + border: 1px solid #aaa +} + /* Flex-view */ -.resourceTable.flex ul.elements { -webkit-column-gap: 10px; -moz-column-gap: 10px; -o-column-gap: 10px; column-gap: 10px; } -.resourceTable.flex ul.elements { } -.resourceTable.flex ul.elements > li { overflow: hidden; /* fix for Firefox */ break-inside: avoid-column; -webkit-column-break-inside: avoid; -moz-column-break-inside: avoid; -o-column-break-inside: avoid; -ms-column-break-inside: avoid; column-break-inside: avoid; page-break-inside: avoid } -.resourceTable.flex .elements_descr { display: block; margin-left: 1.5em; } -#content_body #which_editor { margin-top: 12px; } + +.resourceTable.flex ul.elements { + -webkit-column-gap: 10px; + -moz-column-gap: 10px; + -o-column-gap: 10px; + column-gap: 10px; +} + +.resourceTable.flex ul.elements {} + +.resourceTable.flex ul.elements > li { + overflow: hidden; + /* fix for Firefox */ + break-inside: avoid-column; + -webkit-column-break-inside: avoid; + -moz-column-break-inside: avoid; + -o-column-break-inside: avoid; + -ms-column-break-inside: avoid; + column-break-inside: avoid; + page-break-inside: avoid +} + +.resourceTable.flex .elements_descr { + display: block; + margin-left: 1.5em; +} + +#content_body #which_editor { + margin-top: 12px; +} + /* resource children list */ -#tabChildren .grid th, #tabChildren .grid tr > td:nth-child(5), #tabChildren .grid tr > td:nth-child(6) { text-align: center; white-space: nowrap } -#tabChildren .grid td { text-align: right; white-space: nowrap } -#tabChildren .grid tr > th:nth-child(2), #tabChildren .grid tr > td:nth-child(2) { text-align: left; white-space: normal } -#tabChildren .grid tr > td:nth-child(6) a { padding: 0 .2em; font-size: 0.9rem; color: #444; } + +#tabChildren .grid th, +#tabChildren .grid tr > td:nth-child(5), +#tabChildren .grid tr > td:nth-child(6) { + text-align: center; + white-space: nowrap +} + +#tabChildren .grid td { + text-align: right; + white-space: nowrap +} + +#tabChildren .grid tr > th:nth-child(2), +#tabChildren .grid tr > td:nth-child(2) { + text-align: left; + white-space: normal +} + +#tabChildren .grid tr > td:nth-child(6) a { + padding: 0 .2em; + font-size: 0.9rem; + color: #444; +} + /* element-edit-message */ -.msg-container { padding-bottom: 10px; border-bottom: 1px solid #ededed; margin-bottom: 1rem; color: #777; } -.btn-small { padding: 2px 4px !important; font-size: 11px !important; } -.relative { position: relative; } -.modx-alert { display: block; margin: 60px 10px 10px 10px; padding: 1em; } -.modx-alert.alert-error { background-color: #ffd0d0; border: 1px solid #f00; color: #000; } -tr.userIdle td { color: #aaa; } -tr.userIdle td strong:before { font-family: "FontAwesome"; font-style: normal; font-weight: normal; color: #aaa; padding: 0 5px 0 0; content: '\f017'; } + +.msg-container { + padding-bottom: 10px; + border-bottom: 1px solid #ededed; + margin-bottom: 1rem; + color: #777; +} + +.btn-small { + padding: 2px 4px !important; + font-size: 11px !important; +} + +.relative { + position: relative; +} + +.modx-alert { + display: block; + margin: 60px 10px 10px 10px; + padding: 1em; +} + +.modx-alert.alert-error { + background-color: #ffd0d0; + border: 1px solid #f00; + color: #000; +} + +tr.userIdle td { + color: #aaa; +} + +tr.userIdle td strong:before { + font-family: "FontAwesome"; + font-style: normal; + font-weight: normal; + color: #aaa; + padding: 0 5px 0 0; + content: '\f017'; +} diff --git a/manager/media/style/default/css/mainmenu.css b/manager/media/style/default/css/mainmenu.css index 006728e2dc..586aeee1f4 100755 --- a/manager/media/style/default/css/mainmenu.css +++ b/manager/media/style/default/css/mainmenu.css @@ -1,157 +1,855 @@ /* #mainMenu */ -#mainMenu { background-color: #2b323a; color: #8b9298; -webkit-box-shadow: 0 0.15rem 0.15rem rgba(0, 0, 0, 0.25); box-shadow: 0 0.15rem 0.15rem rgba(0, 0, 0, 0.25); } -#mainMenu.show { overflow: visible } -#mainMenu + #tree::before, #mainMenu + #tree + #main::before { content: ""; position: absolute; z-index: 9999; left: 0; top: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, .1); opacity: 0; visibility: hidden; -webkit-transition: opacity .15s, visibility .15s; transition: opacity .15s, visibility .15s; } -#mainMenu.show + #tree::before, #mainMenu.show + #tree + #main::before { opacity: 1; visibility: visible } -#mainMenu > .container { display: table; width: 100%; border-collapse: collapse } -#mainMenu > .container > .row { display: table-row } -#mainMenu > .container > .row > .cell { display: table-cell; vertical-align: top; } -#mainMenu #nav { float: left; } -#mainMenu #settings { float: right; } -#mainMenu .nav { margin: 0; white-space: nowrap; font-size: 0 } -#mainMenu .nav > li { position: relative; display: inline-block; font-size: 0.8rem; vertical-align: top } -#mainMenu .nav > li.active > a { color: #fff; background-color: rgba(255, 255, 255, 0.07) } -#mainMenu .nav > li > a, #mainMenu .nav .label_searchid { display: block; position: relative; z-index: 1; padding: 0 1rem; height: 2.2rem; line-height: 2.3rem; text-decoration: none; color: #bbb; transition-duration: 0.15s } -#mainMenu .nav > li > a:hover, #mainMenu .nav .label_searchid:hover { color: #f3f3f3; } + +#mainMenu { + background-color: #2b323a; + color: #8b9298; + -webkit-box-shadow: 0 0.15rem 0.15rem rgba(0, 0, 0, 0.25); + box-shadow: 0 0.15rem 0.15rem rgba(0, 0, 0, 0.25); +} + +#mainMenu.show { + overflow: visible +} + +#mainMenu + #tree::before, +#mainMenu + #tree + #main::before { + content: ""; + position: absolute; + z-index: 9999; + left: 0; + top: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, .1); + opacity: 0; + visibility: hidden; + -webkit-transition: opacity .15s, visibility .15s; + transition: opacity .15s, visibility .15s; +} + +#mainMenu.show + #tree::before, +#mainMenu.show + #tree + #main::before { + opacity: 1; + visibility: visible +} + +#mainMenu > .container { + display: table; + width: 100%; + border-collapse: collapse +} + +#mainMenu > .container > .row { + display: table-row +} + +#mainMenu > .container > .row > .cell { + display: table-cell; + vertical-align: top; +} + +#mainMenu #nav { + float: left; +} + +#mainMenu #settings { + float: right; +} + +#mainMenu .nav { + margin: 0; + white-space: nowrap; + font-size: 0 +} + +#mainMenu .nav > li { + position: relative; + display: inline-block; + font-size: 0.8rem; + vertical-align: top +} + +#mainMenu .nav > li.active > a { + color: #fff; + background-color: rgba(255, 255, 255, 0.07) +} + +#mainMenu .nav > li > a, +#mainMenu .nav .label_searchid { + display: block; + position: relative; + z-index: 1; + padding: 0 1rem; + height: 2.2rem; + line-height: 2.3rem; + text-decoration: none; + color: #bbb; + transition-duration: 0.15s +} + +#mainMenu .nav > li > a:hover, +#mainMenu .nav .label_searchid:hover { + color: #f3f3f3; +} + /*#mainMenu.show .nav > li.dropdown:hover > a, */ -#mainMenu.show .nav > li.dropdown.hover > a { background-color: #fff; color: #444; } -#mainMenu .nav > li > a .icon { display: inline-block; overflow: hidden; width: auto; height: 2rem; line-height: 2rem; font-size: 1.5em; text-align: center; margin: 0.05rem 0 0 0.5rem; vertical-align: top; border-radius: 50%; background: no-repeat 50% 50%; background-size: cover; } -#mainMenu .nav > li > a .icon.photo { width: 2rem } -#mainMenu .nav > li > a .icon .fa { font-size: 1.2rem; line-height: 2.1rem } -#mainMenu .nav > li .fa { min-width: 1em; line-height: 2.2rem; font-size: .875rem; vertical-align: top } -#mainMenu #nav > li > a > .fa { display: none } -#mainMenu #nav #bars { width: 3.5rem; text-align: center } -#mainMenu #nav #bars a { padding: 0; } -#mainMenu #nav #bars .fa { display: inline-block; min-width: 0.25rem; width: 1.5rem; margin: 0; text-align: center; overflow: hidden; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } -.sidebar-closed #mainMenu #nav #bars .fa { width: 0.25rem; } -#mainMenu #system > a > .fa { font-size: 1.1rem } -#mainMenu .nav .caret, #mainMenu .nav .divider, .dropdown-toggle::after { display: none } -#mainMenu .nav > li > ul { display: block; position: absolute; z-index: 0; overflow: auto; overflow-x: hidden; top: 100%; left: 0; margin: 0; padding: 0 0 0.25rem; min-width: 15rem; max-height: -webkit-calc(100vh - 2.2rem); max-height: calc(100vh - 2.2rem); font-size: 1em; border: none; border-radius: 0 0 0.25rem 0.25rem; background-color: #fff; box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2); opacity: 0; visibility: hidden; -webkit-transition-duration: 0.1s; transition-duration: 0.1s; } + +#mainMenu.show .nav > li.dropdown.hover > a { + background-color: #fff; + color: #444; +} + +#mainMenu .nav > li > a .icon { + display: inline-block; + overflow: hidden; + width: auto; + height: 2rem; + line-height: 2rem; + font-size: 1.5em; + text-align: center; + margin: 0.05rem 0 0 0.5rem; + vertical-align: top; + border-radius: 50%; + background: no-repeat 50% 50%; + background-size: cover; +} + +#mainMenu .nav > li > a .icon.photo { + width: 2rem +} + +#mainMenu .nav > li > a .icon .fa { + font-size: 1.2rem; + line-height: 2.1rem +} + +#mainMenu .nav > li .fa { + min-width: 1em; + line-height: 2.2rem; + font-size: .875rem; + vertical-align: top +} + +#mainMenu #nav > li > a > .fa { + display: none +} + +#mainMenu #nav #bars { + width: 3.5rem; + text-align: center +} + +#mainMenu #nav #bars a { + padding: 0; +} + +#mainMenu #nav #bars .fa { + display: inline-block; + min-width: 0.25rem; + width: 1.5rem; + margin: 0; + text-align: center; + overflow: hidden; + -webkit-transition-duration: 0.15s; + transition-duration: 0.15s +} + +.sidebar-closed #mainMenu #nav #bars .fa { + width: 0.25rem; +} + +#mainMenu #system > a > .fa { + font-size: 1.1rem +} + +#mainMenu .nav .caret, +#mainMenu .nav .divider, +.dropdown-toggle::after { + display: none +} + +#mainMenu .nav > li > ul { + display: block; + position: absolute; + z-index: 0; + overflow: auto; + overflow-x: hidden; + top: 100%; + left: 0; + margin: 0; + padding: 0 0 0.25rem; + min-width: 15rem; + max-height: -webkit-calc(100vh - 2.2rem); + max-height: calc(100vh - 2.2rem); + font-size: 1em; + border: none; + border-radius: 0 0 0.25rem 0.25rem; + background-color: #fff; + box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2); + opacity: 0; + visibility: hidden; + -webkit-transition-duration: 0.1s; + transition-duration: 0.1s; +} + /*#mainMenu.show .nav > li:hover > a + ul, */ -#mainMenu.show .nav > li.hover > a + ul, #mainMenu.show .nav > li.hover > ul.sub-menu.show { opacity: 1; visibility: visible } -#mainMenu.show .nav > li > ul.sub-menu { left: 15rem; opacity: 0; visibility: hidden; } -#mainMenu.show .nav > li:hover > ul.sub-menu { } -#mainMenu.show .nav > li:hover > ul.sub-menu.show { } -#mainMenu #settings.nav > li > ul { left: auto; right: 0 } -#mainMenu .nav > li > ul > li { border-bottom: 1px solid rgba(0, 0, 0, 0.05); margin-bottom: -1px; } -#mainMenu .nav > li > ul > li:last-child { border: none; margin-bottom: 0 } -#mainMenu .nav > li > ul > li.item-input { padding: 0.375em 0.5em; } -#mainMenu .nav > li > ul > li > a:first-child, #mainMenu .nav > li > ul > li > span { display: block; position: relative; padding: 0 2rem 0 1rem; line-height: 2.2rem; color: #444; text-decoration: none } -#mainMenu .nav > li > ul > li.hover > a:first-child { color: #fff; background-color: #1976d2; } -#mainMenu .nav > li > ul > li > span:first-child { padding: 0 1rem; text-align: center; font-size: 0.875em; color: #aaa; } -#mainMenu .nav > li > ul > li.dropdown-back > span { text-align: left; font-size: inherit; color: inherit } -#mainMenu .nav > li > ul > li.dropdown-back > span * { pointer-events: none } -#mainMenu .nav > li > ul > li .fa { width: 1.3em; margin-right: 0.5em; font-size: .875rem; line-height: .8rem; text-align: center; vertical-align: baseline } -#mainMenu .nav > li > ul > li.selected a:first-child::before, #main .evo-tab-row .tab.changed::before { content: ''; position: absolute; right: 0.25em; top: 0.25em; width: 0.5em; height: 0.5em; background-color: #ffc107; -webkit-border-radius: 50%; border-radius: 50%; pointer-events: none } -#mainMenu .nav > li > ul > li.dropdown-toggle > a > .toggle { position: absolute; top: 0; right: 0; height: 100%; width: 2rem; margin: 0; line-height: 2rem; text-align: center; } -#mainMenu .nav > li > ul > li.disabled > a { opacity: 0.5; color: #7d2a24; } -#mainMenu .nav > li > ul > li.locked > a { font-style: italic } -#mainMenu .nav > li > ul > li > a small { line-height: 1em } -#mainMenu .nav li.item-group { display: table; width: 100%; border-collapse: separate } -#mainMenu .nav li.item-group > * { display: table-cell !important; width: 1%; padding: 0 .75rem; border: none !important; border-left: 1px solid rgba(0, 0, 0, 0.05) !important; border-radius: 0 } -#mainMenu .nav li.item-group > *:first-child { width: 100% } -#mainMenu .nav li.item-group > *:not(:first-child) .fa { margin-right: 0 } -#mainMenu .account #msgCounter { display: none; position: absolute; z-index: 1; right: 0.4rem; top: 0.4rem; width: 0.4rem; height: 0.4rem; background-color: #ffc107; font-size: 0; border-radius: 50%;; } -#mainMenu .account #newMail { display: none } + +#mainMenu.show .nav > li.hover > a + ul, +#mainMenu.show .nav > li.hover > ul.sub-menu.show { + opacity: 1; + visibility: visible +} + +#mainMenu.show .nav > li > ul.sub-menu { + left: 15rem; + opacity: 0; + visibility: hidden; +} + +#mainMenu.show .nav > li:hover > ul.sub-menu {} + +#mainMenu.show .nav > li:hover > ul.sub-menu.show {} + +#mainMenu #settings.nav > li > ul { + left: auto; + right: 0 +} + +#mainMenu .nav > li > ul > li { + border-bottom: 1px solid rgba(0, 0, 0, 0.05); + margin-bottom: -1px; +} + +#mainMenu .nav > li > ul > li:last-child { + border: none; + margin-bottom: 0 +} + +#mainMenu .nav > li > ul > li.item-input { + padding: 0.375em 0.5em; +} + +#mainMenu .nav > li > ul > li > a:first-child, +#mainMenu .nav > li > ul > li > span { + display: block; + position: relative; + padding: 0 2rem 0 1rem; + line-height: 2.2rem; + color: #444; + text-decoration: none +} + +#mainMenu .nav > li > ul > li.hover > a:first-child { + color: #fff; + background-color: #1976d2; +} + +#mainMenu .nav > li > ul > li > span:first-child { + padding: 0 1rem; + text-align: center; + font-size: 0.875em; + color: #aaa; +} + +#mainMenu .nav > li > ul > li.dropdown-back > span { + text-align: left; + font-size: inherit; + color: inherit +} + +#mainMenu .nav > li > ul > li.dropdown-back > span * { + pointer-events: none +} + +#mainMenu .nav > li > ul > li .fa { + width: 1.3em; + margin-right: 0.5em; + font-size: .875rem; + line-height: .8rem; + text-align: center; + vertical-align: baseline +} + +#mainMenu .nav > li > ul > li.selected a:first-child::before, +#main .evo-tab-row .tab.changed::before { + content: ''; + position: absolute; + right: 0.25em; + top: 0.25em; + width: 0.5em; + height: 0.5em; + background-color: #ffc107; + -webkit-border-radius: 50%; + border-radius: 50%; + pointer-events: none +} + +#mainMenu .nav > li > ul > li.dropdown-toggle > a > .toggle { + position: absolute; + top: 0; + right: 0; + height: 100%; + width: 2rem; + margin: 0; + line-height: 2rem; + text-align: center; +} + +#mainMenu .nav > li > ul > li.disabled > a { + opacity: 0.5; + color: #7d2a24; +} + +#mainMenu .nav > li > ul > li.locked > a { + font-style: italic +} + +#mainMenu .nav > li > ul > li > a small { + line-height: 1em +} + +#mainMenu .nav li.item-group { + display: table; + width: 100%; + border-collapse: separate +} + +#mainMenu .nav li.item-group > * { + display: table-cell !important; + width: 1%; + padding: 0 .75rem; + border: none !important; + border-left: 1px solid rgba(0, 0, 0, 0.05) !important; + border-radius: 0 +} + +#mainMenu .nav li.item-group > *:first-child { + width: 100% +} + +#mainMenu .nav li.item-group > *:not(:first-child) .fa { + margin-right: 0 +} + +#mainMenu .account #msgCounter { + display: none; + position: absolute; + z-index: 1; + right: 0.4rem; + top: 0.4rem; + width: 0.4rem; + height: 0.4rem; + background-color: #ffc107; + font-size: 0; + border-radius: 50%; + ; +} + +#mainMenu .account #newMail { + display: none +} + /* statusbar */ -#statusbar { position: relative; width: 1rem; height: 2.2rem; line-height: 2.4rem; font-size: 0.875em; white-space: nowrap; float: left; } -#statusbar .fa { font-size: 0.875rem } -#statusbar #buildText, #statusbar #workText { display: none } -#statusbar .fa { margin-right: 0.375rem } -#statusbar .fa-warning { color: #f44336 } + +#statusbar { + position: relative; + width: 1rem; + height: 2.2rem; + line-height: 2.4rem; + font-size: 0.875em; + white-space: nowrap; + float: left; +} + +#statusbar .fa { + font-size: 0.875rem +} + +#statusbar #buildText, +#statusbar #workText { + display: none +} + +#statusbar .fa { + margin-right: 0.375rem +} + +#statusbar .fa-warning { + color: #f44336 +} + /* search */ -#mainMenu #searchform { position: relative } -#mainMenu #searchform label { position: relative; z-index: 1; margin: 0; cursor: pointer; } -#mainMenu #searchform input { position: absolute; z-index: 0; top: 0; right: 0; min-height: 1.5rem; height: 1.5rem; width: 0; padding: 0 0.5rem; margin: 0.345rem; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 0; background: rgba(0, 0, 0, 0.1); color: #fff; text-align: left; opacity: 0; outline: none; -webkit-transition: opacity 0.2s, width 0.2s; transition: opacity 0.2s, width 0.2s; } -#mainMenu #searchform input:focus { z-index: 9; width: 15rem; max-width: 15rem; background: #000; text-align: left; border-color: rgba(255, 255, 255, 0.75); opacity: 1 } -#mainMenu #searchform input:focus + .mask { opacity: 0.7; visibility: visible; } -#mainMenu #searchform .mask { content: ""; position: absolute; z-index: 5; top: 0; right: -999rem; right: -100vw; left: -999rem; left: -100vw; height: 2.2rem; opacity: 0; visibility: hidden; background-color: rgba(0, 0, 0, 0.65); -webkit-transition-duration: 0.3s; transition-duration: 0.3s; transform: translateZ(0) } -#mainMenu #searchform .fa-search { position: relative; z-index: 1 } -#mainMenu #searchform .fa-refresh { position: absolute; z-index: 9; display: none; top: 0.6rem; right: 0.8rem; line-height: 1em } + +#mainMenu #searchform { + position: relative +} + +#mainMenu #searchform label { + position: relative; + z-index: 1; + margin: 0; + cursor: pointer; +} + +#mainMenu #searchform input { + position: absolute; + z-index: 0; + top: 0; + right: 0; + min-height: 1.5rem; + height: 1.5rem; + width: 0; + padding: 0 0.5rem; + margin: 0.345rem; + border: 1px solid rgba(255, 255, 255, 0.1); + border-radius: 0; + background: rgba(0, 0, 0, 0.1); + color: #fff; + text-align: left; + opacity: 0; + outline: none; + -webkit-transition: opacity 0.2s, width 0.2s; + transition: opacity 0.2s, width 0.2s; +} + +#mainMenu #searchform input:focus { + z-index: 9; + width: 15rem; + max-width: 15rem; + background: #000; + text-align: left; + border-color: rgba(255, 255, 255, 0.75); + opacity: 1 +} + +#mainMenu #searchform input:focus + .mask { + opacity: 0.7; + visibility: visible; +} + +#mainMenu #searchform .mask { + content: ""; + position: absolute; + z-index: 5; + top: 0; + right: -999rem; + right: -100vw; + left: -999rem; + left: -100vw; + height: 2.2rem; + opacity: 0; + visibility: hidden; + background-color: rgba(0, 0, 0, 0.65); + -webkit-transition-duration: 0.3s; + transition-duration: 0.3s; + transform: translateZ(0) +} + +#mainMenu #searchform .fa-search { + position: relative; + z-index: 1 +} + +#mainMenu #searchform .fa-refresh { + position: absolute; + z-index: 9; + display: none; + top: 0.6rem; + right: 0.8rem; + line-height: 1em +} + /* #searchresult */ -#searchresult { position: absolute; z-index: 99; overflow: hidden; top: 2.2rem; right: 0; bottom: 0; width: 0; max-width: 100%; background-color: #fff; border-left: 1px solid rgba(0, 0, 0, 0.1); opacity: 0; visibility: hidden; -webkit-transition: 0.25s ease 0.5s; transition: 0.25s ease 0.5s; -webkit-transition-delay: 0.3s; transition-delay: 0.3s; } -#searchresult.open { width: 20rem; box-shadow: 0 0 4.5rem rgba(0, 0, 0, 0.15); opacity: 1; visibility: visible; -webkit-transition: 0.5s ease 0.5s; transition: 0.5s ease 0.5s; -webkit-transition-delay: 0s; transition-delay: 0s } -#searchresult .ajaxSearchResults { width: 20rem; height: 100%; overflow: auto; } -#searchresult .ajaxSearchResults ul, #searchresult .ajaxSearchResults li { margin: 0; padding: 0; list-style: none } -#searchresult .ajaxSearchResults b, #searchresult .ajaxSearchResults strong, #searchresult .ajaxSearchResults a { position: relative; z-index: 0; display: block; color: #333; padding: 0.25rem 1rem; margin-top: -1px; border-top: 1px solid rgba(0, 0, 0, 0.03); border-bottom: 1px solid rgba(0, 0, 0, 0.03); box-sizing: border-box } -#searchresult .ajaxSearchResults b { z-index: 1; background-color: #ddd } -#searchresult .ajaxSearchResults a { padding: 0.25rem 2rem 0.25rem 1rem; text-decoration: none; } -#searchresult .ajaxSearchResults a:hover { color: #333; background-color: #f2f2f2; } -#searchresult .ajaxSearchResults a > i { position: absolute; right: 0; top: 50%; width: 2rem; height: 2rem; margin-top: -1rem; line-height: 2rem; text-align: center; color: #1976d2; } -#searchresult .ajaxSearchResults a.selected > i { color: #fff } -#searchresult .ajaxSearchResults a.selected { z-index: 1; background-color: #1976d2; color: #fff; font-weight: 700; } -#searchresult .ajaxSearchResults a .text-danger { color: #333; font-weight: 700 } -#searchresult .ajaxSearchResults a.selected .text-danger { color: #ffc107; text-shadow: 0 0 1px rgba(0, 0, 0, 0.5); } -#searchresult .ajaxSearchResults .locked a { font-style: italic; color: #646464; } -#searchresult .ajaxSearchResults .disabled a { opacity: .5; color: #7d2a24; } -#searchresult .ajaxSearchResults .deleted a { color: #a52a2a; text-decoration: line-through } + +#searchresult { + position: absolute; + z-index: 99; + overflow: hidden; + top: 2.2rem; + right: 0; + bottom: 0; + width: 0; + max-width: 100%; + background-color: #fff; + border-left: 1px solid rgba(0, 0, 0, 0.1); + opacity: 0; + visibility: hidden; + -webkit-transition: 0.25s ease 0.5s; + transition: 0.25s ease 0.5s; + -webkit-transition-delay: 0.3s; + transition-delay: 0.3s; +} + +#searchresult.open { + width: 20rem; + box-shadow: 0 0 4.5rem rgba(0, 0, 0, 0.15); + opacity: 1; + visibility: visible; + -webkit-transition: 0.5s ease 0.5s; + transition: 0.5s ease 0.5s; + -webkit-transition-delay: 0s; + transition-delay: 0s +} + +#searchresult .ajaxSearchResults { + width: 20rem; + height: 100%; + overflow: auto; +} + +#searchresult .ajaxSearchResults ul, +#searchresult .ajaxSearchResults li { + margin: 0; + padding: 0; + list-style: none +} + +#searchresult .ajaxSearchResults b, +#searchresult .ajaxSearchResults strong, +#searchresult .ajaxSearchResults a { + position: relative; + z-index: 0; + display: block; + color: #333; + padding: 0.25rem 1rem; + margin-top: -1px; + border-top: 1px solid rgba(0, 0, 0, 0.03); + border-bottom: 1px solid rgba(0, 0, 0, 0.03); + box-sizing: border-box +} + +#searchresult .ajaxSearchResults b { + z-index: 1; + background-color: #ddd +} + +#searchresult .ajaxSearchResults a { + padding: 0.25rem 2rem 0.25rem 1rem; + text-decoration: none; +} + +#searchresult .ajaxSearchResults a:hover { + color: #333; + background-color: #f2f2f2; +} + +#searchresult .ajaxSearchResults a > i { + position: absolute; + right: 0; + top: 50%; + width: 2rem; + height: 2rem; + margin-top: -1rem; + line-height: 2rem; + text-align: center; + color: #1976d2; +} + +#searchresult .ajaxSearchResults a.selected > i { + color: #fff +} + +#searchresult .ajaxSearchResults a.selected { + z-index: 1; + background-color: #1976d2; + color: #fff; + font-weight: 700; +} + +#searchresult .ajaxSearchResults a .text-danger { + color: #333; + font-weight: 700 +} + +#searchresult .ajaxSearchResults a.selected .text-danger { + color: #ffc107; + text-shadow: 0 0 1px rgba(0, 0, 0, 0.5); +} + +#searchresult .ajaxSearchResults .locked a { + font-style: italic; + color: #646464; +} + +#searchresult .ajaxSearchResults .disabled a { + opacity: .5; + color: #7d2a24; +} + +#searchresult .ajaxSearchResults .deleted a { + color: #a52a2a; + text-decoration: line-through +} + @media (min-width: 1200px) { -#searchresult { top: 2.5rem; } -#mainMenu #nav #site a { padding-left: 10.25rem; } -#mainMenu #nav #site a::before { content: ""; display: block; overflow: hidden; position: absolute; left: 0; top: 0; width: 9rem; height: 100%; background: url("../images/misc/logo-navbar.png") 0 50% no-repeat; background-size: 8rem; } -#mainMenu, #mainMenu .nav > li > a, #mainMenu .nav .label_searchid, #mainMenu .nav > li > a .icon, #mainMenu #searchform .mask, #mainMenu #nav #site::before { height: 2.5rem; } -#mainMenu .nav > li > a, #mainMenu .nav .label_searchid, #mainMenu .nav > li .fa, #mainMenu .nav > li > a .icon { line-height: 2.6rem; } -#mainMenu .nav > li > a .icon.photo { width: 2.1rem; height: 2.1rem; margin-top: .2rem; } -#mainMenu .nav > li .fa { font-size: 1rem; } -#mainMenu #nav > li > a { padding: 0 1.25rem; } -#mainMenu #nav > li > a > .fa { display: none; } -#mainMenu .nav > li > a .icon .fa { line-height: 2.5rem; font-size: 1.5rem; } -#mainMenu .nav > li > ul { box-shadow: 0 0.5rem 3rem rgba(0, 0, 0, 0.4); } -#mainMenu .nav > li > ul > li.item-input { padding: 0.575em 0.5em; } -#mainMenu .nav > li > ul > li > a:first-child, #mainMenu .nav > li > ul > li > span { line-height: 2.5rem; } -#mainMenu #searchform input { min-height: 1.875rem; height: 1.875rem; } -#mainMenu .nav > li > ul > li.dropdown-toggle > a > .toggle { line-height: 2.4rem; font-size: 1rem; } + #searchresult { + top: 2.5rem; + } + #mainMenu #nav #site a { + padding-left: 10.25rem; + } + #mainMenu #nav #site a::before { + content: ""; + display: block; + overflow: hidden; + position: absolute; + left: 0; + top: 0; + width: 9rem; + height: 100%; + background: url("../images/misc/logo-navbar.png") 0 50% no-repeat; + background-size: 8rem; + } + #mainMenu, + #mainMenu .nav > li > a, + #mainMenu .nav .label_searchid, + #mainMenu .nav > li > a .icon, + #mainMenu #searchform .mask, + #mainMenu #nav #site::before { + height: 2.5rem; + } + #mainMenu .nav > li > a, + #mainMenu .nav .label_searchid, + #mainMenu .nav > li .fa, + #mainMenu .nav > li > a .icon { + line-height: 2.6rem; + } + #mainMenu .nav > li > a .icon.photo { + width: 2.1rem; + height: 2.1rem; + margin-top: .2rem; + } + #mainMenu .nav > li .fa { + font-size: 1rem; + } + #mainMenu #nav > li > a { + padding: 0 1.25rem; + } + #mainMenu #nav > li > a > .fa { + display: none; + } + #mainMenu .nav > li > a .icon .fa { + line-height: 2.5rem; + font-size: 1.5rem; + } + #mainMenu .nav > li > ul { + box-shadow: 0 0.5rem 3rem rgba(0, 0, 0, 0.4); + } + #mainMenu .nav > li > ul > li.item-input { + padding: 0.575em 0.5em; + } + #mainMenu .nav > li > ul > li > a:first-child, + #mainMenu .nav > li > ul > li > span { + line-height: 2.5rem; + } + #mainMenu #searchform input { + min-height: 1.875rem; + height: 1.875rem; + } + #mainMenu .nav > li > ul > li.dropdown-toggle > a > .toggle { + line-height: 2.4rem; + font-size: 1rem; + } } + @media (max-width: 1020px) { -#mainMenu #nav #bars { width: 3rem } -.nav > li > a, #mainMenu .nav > li > ul > li > a, #mainMenu .nav > li > ul > li > span, #mainMenu .nav .label_searchid { padding: 0 0.75rem; } + #mainMenu #nav #bars { + width: 3rem + } + .nav > li > a, + #mainMenu .nav > li > ul > li > a, + #mainMenu .nav > li > ul > li > span, + #mainMenu .nav .label_searchid { + padding: 0 0.75rem; + } } + @media (max-width: 840px) { -#statusbar { display: none } -#mainMenu #nav #bars { width: 2.5rem } -#mainMenu .nav > li { position: static; } -#mainMenu .nav > li > a { font-size: 0; } -#mainMenu .nav > li > a, #mainMenu .nav .label_searchid { padding: 0 0.5rem; } -#mainMenu .nav > li > a > .username { font-size: .75rem; } -#mainMenu #nav > li > a > .fa { display: inline-block; } -#mainMenu .nav > li > a > .fa { display: inline-block; width: 1.3em; margin-right: 0 !important; text-align: center; } -#mainMenu .nav > li > ul { left: 0 !important; width: 100%; } -#mainMenu .nav > li > ul.sub-menu { transform: translate3d(-100%, 0, 0) } -#mainMenu.show .nav > li.active > ul.selected, #mainMenu.show .nav > li.hover > ul.selected + ul.sub-menu { opacity: 1; visibility: visible; } -#mainMenu.show .nav > li.active > ul.selected { transform: translate3d(-100%, 0, 0); } -#mainMenu.show .nav > li.hover > ul.selected + ul.sub-menu { transform: translate3d(0, 0, 0); } + #statusbar { + display: none + } + #mainMenu #nav #bars { + width: 2.5rem + } + #mainMenu .nav > li { + position: static; + } + #mainMenu .nav > li > a { + font-size: 0; + } + #mainMenu .nav > li > a, + #mainMenu .nav .label_searchid { + padding: 0 0.5rem; + } + #mainMenu .nav > li > a > .username { + font-size: .75rem; + } + #mainMenu #nav > li > a > .fa { + display: inline-block; + } + #mainMenu .nav > li > a > .fa { + display: inline-block; + width: 1.3em; + margin-right: 0 !important; + text-align: center; + } + #mainMenu .nav > li > ul { + left: 0 !important; + width: 100%; + } + #mainMenu .nav > li > ul.sub-menu { + transform: translate3d(-100%, 0, 0) + } + #mainMenu.show .nav > li.active > ul.selected, + #mainMenu.show .nav > li.hover > ul.selected + ul.sub-menu { + opacity: 1; + visibility: visible; + } + #mainMenu.show .nav > li.active > ul.selected { + transform: translate3d(-100%, 0, 0); + } + #mainMenu.show .nav > li.hover > ul.selected + ul.sub-menu { + transform: translate3d(0, 0, 0); + } } + @media (max-width: 480px) { -#mainMenu .nav > li > a .username, #searchresult .ajaxSearchResults a > i { display: none } -#mainMenu .nav > li > a .icon { margin-left: 0 } -#searchresult.open, #searchresult .ajaxSearchResults { width: 100% } + #mainMenu .nav > li > a .username, + #searchresult .ajaxSearchResults a > i { + display: none + } + #mainMenu .nav > li > a .icon { + margin-left: 0 + } + #searchresult.open, + #searchresult .ajaxSearchResults { + width: 100% + } } + /* theme modes */ + /* lightness */ -.lightness #mainMenu, .lightness #mainMenu #nav #site a::before { background-color: #f1f1f1; color: #464646; } -.lightness #mainMenu .nav > li > a, .lightness #mainMenu .nav .label_searchid { color: #464646 } -.lightness #mainMenu.show .nav > li.dropdown.hover > a { color: #222; } -.lightness #mainMenu #nav #site a::before { background-image: url("../images/misc/login-logo.png") } + +.lightness #mainMenu, +.lightness #mainMenu #nav #site a::before { + background-color: #f1f1f1; + color: #464646; +} + +.lightness #mainMenu .nav > li > a, +.lightness #mainMenu .nav .label_searchid { + color: #464646 +} + +.lightness #mainMenu.show .nav > li.dropdown.hover > a { + color: #222; +} + +.lightness #mainMenu #nav #site a::before { + background-image: url("../images/misc/login-logo.png") +} + /* light */ -.light #mainMenu { -webkit-box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); } -.light #mainMenu, .light #mainMenu #nav #site a::before { background-color: #2b323a; color: #cacaca; } -.light #mainMenu .nav > li > a, .light #mainMenu .nav .label_searchid { color: #cacaca } -.light #mainMenu.show .nav > li.dropdown.hover > a { color: #444; } + +.light #mainMenu { + -webkit-box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); + box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); +} + +.light #mainMenu, +.light #mainMenu #nav #site a::before { + background-color: #2b323a; + color: #cacaca; +} + +.light #mainMenu .nav > li > a, +.light #mainMenu .nav .label_searchid { + color: #cacaca +} + +.light #mainMenu.show .nav > li.dropdown.hover > a { + color: #444; +} + /* dark */ -.dark #mainMenu { -webkit-box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); } -.dark #mainMenu, .dark #mainMenu #nav #site a::before { background-color: #202329; color: #bbb; } -.dark #mainMenu .nav > li > a, .dark #mainMenu .nav .label_searchid { color: #bbb } -.dark #mainMenu.show .nav > li.dropdown.hover > a { color: #444; } + +.dark #mainMenu { + -webkit-box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); + box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); +} + +.dark #mainMenu, +.dark #mainMenu #nav #site a::before { + background-color: #202329; + color: #bbb; +} + +.dark #mainMenu .nav > li > a, +.dark #mainMenu .nav .label_searchid { + color: #bbb +} + +.dark #mainMenu.show .nav > li.dropdown.hover > a { + color: #444; +} + /* darkness */ -.darkness #mainMenu { -webkit-box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); } -.darkness #mainMenu, .darkness #mainMenu #nav #site a::before { background-color: #202329; color: #bbb; } -.darkness #mainMenu .nav > li > a, .darkness #mainMenu .nav .label_searchid { color: #bbb } -.darkness #mainMenu.show .nav > li.dropdown.hover > a { color: #eee; background-color: #343942; } -.darkness #mainMenu .nav > li > ul { background-color: #343942; } -.darkness #mainMenu .nav > li > ul > li > a:first-child, .darkness #mainMenu .nav > li > ul > li > span { color: #eee; } -.darkness #mainMenu .nav li.item-group > * { background-color: transparent } -.darkness #searchresult { background-color: #202329; border-left: 1px solid #282c34; } -.darkness #searchresult .ajaxSearchResults b { background-color: #1a1c21; } -.darkness #searchresult .ajaxSearchResults b, .darkness #searchresult .ajaxSearchResults strong, .darkness #searchresult .ajaxSearchResults a { border-color: #282c34; color: #aaa; } -.darkness #searchresult .ajaxSearchResults a:hover { background-color: #343942; } -.darkness #searchresult .ajaxSearchResults .disabled a { color: #da4439; } \ No newline at end of file + +.darkness #mainMenu { + -webkit-box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); + box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); +} + +.darkness #mainMenu, +.darkness #mainMenu #nav #site a::before { + background-color: #202329; + color: #bbb; +} + +.darkness #mainMenu .nav > li > a, +.darkness #mainMenu .nav .label_searchid { + color: #bbb +} + +.darkness #mainMenu.show .nav > li.dropdown.hover > a { + color: #eee; + background-color: #343942; +} + +.darkness #mainMenu .nav > li > ul { + background-color: #343942; +} + +.darkness #mainMenu .nav > li > ul > li > a:first-child, +.darkness #mainMenu .nav > li > ul > li > span { + color: #eee; +} + +.darkness #mainMenu .nav li.item-group > * { + background-color: transparent +} + +.darkness #searchresult { + background-color: #202329; + border-left: 1px solid #282c34; +} + +.darkness #searchresult .ajaxSearchResults b { + background-color: #1a1c21; +} + +.darkness #searchresult .ajaxSearchResults b, +.darkness #searchresult .ajaxSearchResults strong, +.darkness #searchresult .ajaxSearchResults a { + border-color: #282c34; + color: #aaa; +} + +.darkness #searchresult .ajaxSearchResults a:hover { + background-color: #343942; +} + +.darkness #searchresult .ajaxSearchResults .disabled a { + color: #da4439; +} diff --git a/manager/media/style/default/css/tabpane.css b/manager/media/style/default/css/tabpane.css index 52aa7cd52d..120e8a0bd2 100755 --- a/manager/media/style/default/css/tabpane.css +++ b/manager/media/style/default/css/tabpane.css @@ -1,159 +1,909 @@ /* [ Tabs ] */ -.tab-row { position: relative; z-index: 1; white-space: nowrap; padding: 0 1.5rem } -.tab-row::after, .tab-row-container::after { content: ""; position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; height: 1px; background-color: #ddd } -.tab-row .tab, .tab-pane > .tab-page > .tab { position: relative; display: inline-block; margin: 0; padding: 0 0.875rem; line-height: 2.7rem; height: 2.5rem; text-transform: uppercase; border: 1px solid rgba(0, 0, 0, 0); border-bottom: none; cursor: pointer; -webkit-user-select: none; user-select: none; } -.tab-row .tab, .tab-row .tab a, .tab-pane > .tab-page > .tab { color: rgba(0, 0, 0, 0.6); font-size: 0.75rem } -.tab-row .tab.selected { z-index: 2; border-color: #ddd; background-color: #fff; color: #444; font-weight: 700 } -.tab-row .tab .fa { margin-right: 0.1em; font-size: 0.875rem } + +.tab-row { + position: relative; + z-index: 1; + white-space: nowrap; + padding: 0 1.5rem +} + +.tab-row::after, +.tab-row-container::after { + content: ""; + position: absolute; + z-index: 1; + left: 0; + right: 0; + bottom: 0; + height: 1px; + background-color: #ddd +} + +.tab-row .tab, +.tab-pane > .tab-page > .tab { + position: relative; + display: inline-block; + margin: 0; + padding: 0 0.875rem; + line-height: 2.7rem; + height: 2.5rem; + text-transform: uppercase; + border: 1px solid rgba(0, 0, 0, 0); + border-bottom: none; + cursor: pointer; + -webkit-user-select: none; + user-select: none; +} + +.tab-row .tab, +.tab-row .tab a, +.tab-pane > .tab-page > .tab { + color: rgba(0, 0, 0, 0.6); + font-size: 0.75rem +} + +.tab-row .tab.selected { + z-index: 2; + border-color: #ddd; + background-color: #fff; + color: #444; + font-weight: 700 +} + +.tab-row .tab .fa { + margin-right: 0.1em; + font-size: 0.875rem +} + /* tabs-container */ -.tab-row-container { height: 2.5rem; left: 0; overflow-y: hidden; padding: 0 1.5rem; position: relative; z-index: 0 } -.tab-row-container .tab-row { z-index: 2; -webkit-overflow-scrolling: touch; overflow-x: auto; padding: 0 0 2rem; white-space: nowrap } -.tab-row-container .tab-row::after { display: none } -.tab-row-container > i { position: absolute; top: 0; height: 100%; text-align: center; font: normal normal normal 1.2rem/2.7rem FontAwesome; cursor: pointer; transition-duration: 0.2s; width: 1.5rem; } -.tab-row-container > i.prev { left: 0; } -.tab-row-container > i.next { right: 0; } -.tab-row-container > i.disable { font-size: 0.8rem; color: rgba(0, 0, 0, 0.2); pointer-events: none } + +.tab-row-container { + height: 2.5rem; + left: 0; + overflow-y: hidden; + padding: 0 1.5rem; + position: relative; + z-index: 0 +} + +.tab-row-container .tab-row { + z-index: 2; + -webkit-overflow-scrolling: touch; + overflow-x: auto; + padding: 0 0 2rem; + white-space: nowrap +} + +.tab-row-container .tab-row::after { + display: none +} + +.tab-row-container > i { + position: absolute; + top: 0; + height: 100%; + text-align: center; + font: normal normal normal 1.2rem/2.7rem FontAwesome; + cursor: pointer; + transition-duration: 0.2s; + width: 1.5rem; +} + +.tab-row-container > i.prev { + left: 0; +} + +.tab-row-container > i.next { + right: 0; +} + +.tab-row-container > i.disable { + font-size: 0.8rem; + color: rgba(0, 0, 0, 0.2); + pointer-events: none +} + /* tab-page */ -.tab-pane > .tab-page { display: block } -.tab-pane > .tab-page ~ .tab-page { display: none } -.tab-pane > .tab-page:first-of-type { display: block; margin-top: 2.5rem; } -.tab-pane > .tab-page > .tab { top: -2.5rem; left: 1.5rem; background-color: #f9f9f9; border-color: #ddd; } -.sectionBody > .tab-pane > .tab-page > .tab { top: -3.7rem; left: 0.3rem; } -.tab-pane > .tab-page > div:first-of-type, .tab-pane > .tab-page > table { margin-top: -2.5rem } -.dynamic-tab-pane-control.tab-pane > .tab-page > div:first-of-type, .dynamic-tab-pane-control.tab-pane > .tab-page > table { margin-top: 0 } -.tab-page { clear: both; width: 100%; background-color: #fff; padding: 0; border: 0; border-radius: 0; box-shadow: 0 0 0.3rem 0 rgba(0, 0, 0, .1) } -.tab-page .tab-header, .sectionHeader { margin-top: 1em; padding: .5rem 1.25rem; letter-spacing: .03rem } -.tab-page .tab-header + .tab-header, .tab-page .sectionHeader + .sectionHeader { margin-top: 0; border-top: 1px solid #ccc; } -.tab-page > .tab-body .tab-header { padding-left: 0; padding-right: 0 } -.tab-page > .tab-header:first-child, .tab-page > .tab-body > .tab-header:first-child, .tab-page .sectionHeader:first-child, .tab-page > script + .sectionHeader, .sectionBody .tab-page > script + .tab-section { margin-top: 0 } -.tab-page > .tab-body { width: 100%; padding: 1.25rem; } -.tab-page > .tab-body > .tab-body, .tab-page .sectionBody { padding: 1rem 0; } -.tab-page > .tab-header + .tab-body, .tab-page > .tab-body .tab-header + .tab-body, .tab-page .sectionHeader + .sectionBody { padding-top: 1em; border-top: 1px solid rgba(0, 0, 0, 0.1); } -.tab-page > .tab-body::after { display: table; width: 100%; content: '' } -.tab-page .tab-body > .form-group:last-child, .tab-page .tab-body > .form-row:last-child, .tab-page .tab-body > p:last-child, .tab-page .tab-body > .form-group:last-child > p:last-child, .tab-page .sectionBody:last-child { margin-bottom: 0 } -.tab-page .tab-section, .tab-page .sectionHeader + .sectionBody { margin-top: 1.25rem; background-color: #fafafa; border: 1px solid #e0e0e0; border-radius: .1rem; } -.tab-page .tab-section:first-child, .tab-page .sectionHeader + .sectionBody, .tab-page .sectionBody ~ .sectionHeader { margin-top: 0 } -.tab-page .tab-section .tab-header, .tab-page .sectionHeader { margin-left: -1px; margin-right: -1px; padding-left: .5rem; padding-right: .5rem; background-color: #efeff6; border: 1px solid #e0e0e0; border-bottom: 2px solid #e0e0ec; } -.tab-page .tab-section .tab-header:first-child, .tab-page .sectionHeader { margin-top: -1px; border-top: none } -.tab-page .tab-section .tab-header + .tab-header, .tab-page .tab-section .tab-body + .tab-header, .tab-page .sectionHeader { border-top: 1px solid #e0e0e0; } -.tab-page .tab-section .tab-body, .tab-page .sectionBody { padding: 1rem; } -.tab-page > .sectionHeader, .sectionBody .tab-page > .tab-section { margin-top: 1rem; margin-left: .25rem; margin-right: .25rem } -.tab-page .sectionBody { margin: 1rem .25rem; } -.tab-page .sectionHeader + .sectionBody { border-top-color: transparent; border-radius: 0 } -.tab-page > .tab-section .tab-pane { padding-top: 1.25rem } -.tab-page > .tab-pane { margin-left: -1.25rem; margin-right: -1.25rem } -.tab-page > .tab-pane > .tab-page { box-shadow: none; } -.tab-page > .tab-pane > .tab-page > .tab-body { padding-bottom: 0 } + +.tab-pane > .tab-page { + display: block +} + +.tab-pane > .tab-page ~ .tab-page { + display: none +} + +.tab-pane > .tab-page:first-of-type { + display: block; + margin-top: 2.5rem; +} + +.tab-pane > .tab-page > .tab { + top: -2.5rem; + left: 1.5rem; + background-color: #f9f9f9; + border-color: #ddd; +} + +.sectionBody > .tab-pane > .tab-page > .tab { + top: -3.7rem; + left: 0.3rem; +} + +.tab-pane > .tab-page > div:first-of-type, +.tab-pane > .tab-page > table { + margin-top: -2.5rem +} + +.dynamic-tab-pane-control.tab-pane > .tab-page > div:first-of-type, +.dynamic-tab-pane-control.tab-pane > .tab-page > table { + margin-top: 0 +} + +.tab-page { + clear: both; + width: 100%; + background-color: #fff; + padding: 0; + border: 0; + border-radius: 0; + box-shadow: 0 0 0.3rem 0 rgba(0, 0, 0, .1) +} + +.tab-page .tab-header, +.sectionHeader { + margin-top: 1em; + padding: .5rem 1.25rem; + letter-spacing: .03rem +} + +.tab-page .tab-header + .tab-header, +.tab-page .sectionHeader + .sectionHeader { + margin-top: 0; + border-top: 1px solid #ccc; +} + +.tab-page > .tab-body .tab-header { + padding-left: 0; + padding-right: 0 +} + +.tab-page > .tab-header:first-child, +.tab-page > .tab-body > .tab-header:first-child, +.tab-page .sectionHeader:first-child, +.tab-page > script + .sectionHeader, +.sectionBody .tab-page > script + .tab-section { + margin-top: 0 +} + +.tab-page > .tab-body { + width: 100%; + padding: 1.25rem; +} + +.tab-page > .tab-body > .tab-body, +.tab-page .sectionBody { + padding: 1rem 0; +} + +.tab-page > .tab-header + .tab-body, +.tab-page > .tab-body .tab-header + .tab-body, +.tab-page .sectionHeader + .sectionBody { + padding-top: 1em; + border-top: 1px solid rgba(0, 0, 0, 0.1); +} + +.tab-page > .tab-body::after { + display: table; + width: 100%; + content: '' +} + +.tab-page .tab-body > .form-group:last-child, +.tab-page .tab-body > .form-row:last-child, +.tab-page .tab-body > p:last-child, +.tab-page .tab-body > .form-group:last-child > p:last-child, +.tab-page .sectionBody:last-child { + margin-bottom: 0 +} + +.tab-page .tab-section, +.tab-page .sectionHeader + .sectionBody { + margin-top: 1.25rem; + background-color: #fafafa; + border: 1px solid #e0e0e0; + border-radius: .1rem; +} + +.tab-page .tab-section:first-child, +.tab-page .sectionHeader + .sectionBody, +.tab-page .sectionBody ~ .sectionHeader { + margin-top: 0 +} + +.tab-page .tab-section .tab-header, +.tab-page .sectionHeader { + margin-left: -1px; + margin-right: -1px; + padding-left: .5rem; + padding-right: .5rem; + background-color: #efeff6; + border: 1px solid #e0e0e0; + border-bottom: 2px solid #e0e0ec; +} + +.tab-page .tab-section .tab-header:first-child, +.tab-page .sectionHeader { + margin-top: -1px; + border-top: none +} + +.tab-page .tab-section .tab-header + .tab-header, +.tab-page .tab-section .tab-body + .tab-header, +.tab-page .sectionHeader { + border-top: 1px solid #e0e0e0; +} + +.tab-page .tab-section .tab-body, +.tab-page .sectionBody { + padding: 1rem; +} + +.tab-page > .sectionHeader, +.sectionBody .tab-page > .tab-section { + margin-top: 1rem; + margin-left: .25rem; + margin-right: .25rem +} + +.tab-page .sectionBody { + margin: 1rem .25rem; +} + +.tab-page .sectionHeader + .sectionBody { + border-top-color: transparent; + border-radius: 0 +} + +.tab-page > .tab-section .tab-pane { + padding-top: 1.25rem +} + +.tab-page > .tab-pane { + margin-left: -1.25rem; + margin-right: -1.25rem +} + +.tab-page > .tab-pane > .tab-page { + box-shadow: none; +} + +.tab-page > .tab-pane > .tab-page > .tab-body { + padding-bottom: 0 +} + /* tab-page-header collapse */ -.tab-page .tab-header[data-toggle="collapse"]::after { float: right; content: "\f107"; font-family: FontAwesome; font-size: 1rem; line-height: 1em; color: #777; cursor: pointer; transition-duration: .3s } -.tab-page .tab-header[data-toggle="collapse"].collapsed::after { transform: rotate(180deg) } -.tab-page .tab-header[data-toggle="collapse"]:hover::after { color: #333 } + +.tab-page .tab-header[data-toggle="collapse"]::after { + float: right; + content: "\f107"; + font-family: FontAwesome; + font-size: 1rem; + line-height: 1em; + color: #777; + cursor: pointer; + transition-duration: .3s +} + +.tab-page .tab-header[data-toggle="collapse"].collapsed::after { + transform: rotate(180deg) +} + +.tab-page .tab-header[data-toggle="collapse"]:hover::after { + color: #333 +} + /* old style */ -.sectionBody .tab-page { clear: both; width: 100%; background-color: #fff; padding: 0; border: 0; border-radius: 0; box-shadow: 0 0 0.3rem 0 rgba(0, 0, 0, .1) } -.sectionBody > .tab-pane > .tab-page { padding: 1.25rem; } -.tab-page > table { width: 100%; border-collapse: collapse } -.sectionBody .displayparams, .sectionBody .permissiongroup { margin-bottom: 0.15rem; background-color: #eee; border-collapse: separate; border-spacing: 1px; } -.sectionBody .displayparams th, .sectionBody .displayparams td { padding: 4px 4px; } -.sectionBody .displayparams thead td, .sectionBody .permissiongroup thead td { border-top: none; } -.sectionBody fieldset { background: none repeat scroll 0 0 #fdfdfd; border: 1px solid #ccc; padding: 1rem !important; } -.sectionBody legend { font-weight: 500; padding: 5px 1rem; background: #fff; border: 1px solid #ccc; -webkit-box-shadow: 1px 1px 3px #ccc; box-shadow: 1px 1px 3px #ccc; -webkit-border-radius: 3px; border-radius: 3px; } -.sectionBody fieldset h3 { font-size: 14px; color: #789; font-weight: 500; padding-bottom: 0; margin-bottom: 0; } -.showHideVisible { color: #333; margin: 0 1rem; padding: 5px 3px 5px; font-weight: 500; text-shadow: 0 1px 0 #fff; } -.showHideVisible + .sectionBody { margin-top: -1px !important } -.sectionBody, .layerVisible { position: relative; } -.sectionBody > p:first-child { margin-left: 1rem; margin-right: 1rem } -.showHideVisible, .layerVisible { margin: 0 10px 4px; } -.sectionBody td, .sectionBody th { padding: 0.15rem 0.25rem; vertical-align: top; } -.sectionBody .tab-page#tabGeneral > table + div { margin-top: 1.3rem; } + +.sectionBody .tab-page { + clear: both; + width: 100%; + background-color: #fff; + padding: 0; + border: 0; + border-radius: 0; + box-shadow: 0 0 0.3rem 0 rgba(0, 0, 0, .1) +} + +.sectionBody > .tab-pane > .tab-page { + padding: 1.25rem; +} + +.tab-page > table { + width: 100%; + border-collapse: collapse +} + +.sectionBody .displayparams, +.sectionBody .permissiongroup { + margin-bottom: 0.15rem; + background-color: #eee; + border-collapse: separate; + border-spacing: 1px; +} + +.sectionBody .displayparams th, +.sectionBody .displayparams td { + padding: 4px 4px; +} + +.sectionBody .displayparams thead td, +.sectionBody .permissiongroup thead td { + border-top: none; +} + +.sectionBody fieldset { + background: none repeat scroll 0 0 #fdfdfd; + border: 1px solid #ccc; + padding: 1rem !important; +} + +.sectionBody legend { + font-weight: 500; + padding: 5px 1rem; + background: #fff; + border: 1px solid #ccc; + -webkit-box-shadow: 1px 1px 3px #ccc; + box-shadow: 1px 1px 3px #ccc; + -webkit-border-radius: 3px; + border-radius: 3px; +} + +.sectionBody fieldset h3 { + font-size: 14px; + color: #789; + font-weight: 500; + padding-bottom: 0; + margin-bottom: 0; +} + +.showHideVisible { + color: #333; + margin: 0 1rem; + padding: 5px 3px 5px; + font-weight: 500; + text-shadow: 0 1px 0 #fff; +} + +.showHideVisible + .sectionBody { + margin-top: -1px !important +} + +.sectionBody, +.layerVisible { + position: relative; +} + +.sectionBody > p:first-child { + margin-left: 1rem; + margin-right: 1rem +} + +.showHideVisible, +.layerVisible { + margin: 0 10px 4px; +} + +.sectionBody td, +.sectionBody th { + padding: 0.15rem 0.25rem; + vertical-align: top; +} + +.sectionBody .tab-page#tabGeneral > table + div { + margin-top: 1.3rem; +} + /* [ POPUPS ] */ -.evo-popup { display: none; position: absolute; z-index: 10500; box-shadow: 0 0.2rem 2rem rgba(0, 0, 0, 0.1); } -.evo-popup.animation { -webkit-transition: .25s; transition: .25s } -.evo-popup:hover { box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); } -.evo-popup.alert { margin: 0; height: 100%; border-color: rgba(0, 0, 0, 0.1); background-color: #fff; color: #444; border-radius: .15rem; } -.evo-popup.alert-dark { background-color: #202329; color: #ccc; } -.evo-popup.alert-dark hr { border-color: rgba(255, 255, 255, 0.5); } -.evo-popup.alert-dark .close { color: #fff; text-shadow: 0 0 #000; } -.evo-popup.alert-success { border-color: rgba(0, 0, 0, 0.1); background-color: #5cb85c; color: #fff; } -.evo-popup.alert-success hr { border-color: rgba(255, 255, 255, 0.5); } -.evo-popup.alert-info { border-color: rgba(0, 0, 0, 0.1); background-color: #1976d2; color: #fff; } -.evo-popup.alert-info hr { border-color: rgba(255, 255, 255, 0.5); } -.evo-popup.alert-warning { border-color: rgba(0, 0, 0, 0.1); background-color: #ffe082; color: #795548; } -.evo-popup.alert-warning hr { border-color: rgba(0, 0, 0, 0.1); } -.evo-popup.alert-danger { border-color: rgba(0, 0, 0, 0.1); background-color: #d9534f; color: #fff; } -.evo-popup.alert-danger hr { border-color: rgba(255, 255, 255, 0.5); } -.evo-popup.alert.evo-popup-iframe { padding: 0; border: none; background-color: #fafafa; overflow: hidden; } -.evo-popup.alert .evo-popup-header { padding-bottom: .5rem; margin-bottom: .5rem; border-bottom: 1px solid } -.evo-popup .close { position: absolute; top: .3em; right: .3em; } -.evo-popup.evo-popup-iframe .close { position: absolute; z-index: 9; opacity: 1; top: 0; right: 0; width: 1.5rem; height: 1.5rem; line-height: 1.4rem; color: #fff; background-color: #e5a2a0; text-align: center; font-weight: 100; } -.evo-popup.evo-popup-iframe .close:hover { opacity: 1; background-color: #d9534f; } -.evo-popup.evo-popup-iframe .evo-popup-header { position: relative; height: 1.5rem; margin: 0; padding: 0 1.5rem 0 .5rem; line-height: 1.5rem; font-size: .9rem; border-bottom: 1px solid #dedede; } -.evo-popup.evo-popup-iframe .evo-popup-header i { line-height: 1.5rem !important; } -.evo-popup.evo-popup-iframe .evo-popup-body { position: absolute; z-index: 1; left: 0; top: 0; right: 0; bottom: 0; } -.evo-popup.evo-popup-iframe .evo-popup-header + .evo-popup-body { top: 1.5rem } -.evo-popup.evo-popup-iframe.changed { box-shadow: 0 0.2rem 2rem rgba(0, 0, 0, 0.1), 0 0 .2rem .2rem #ffc107 } -.evo-popup-overlay { position: fixed; z-index: 10499; left: 0; top: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.3); } -.evo-popup-overlay::before { position: absolute; left: 20%; top: 20%; width: 45%; height: 45%; opacity: 0; background-color: rgba(0, 0, 0, 0.3); transition: all 0.25s ease-in-out; } -.evo-popup.is-drag::before, .evo-popup.is-resize::before { content: ""; position: absolute; z-index: 9; left: 0; top: 0; right: 0; bottom: 0; background-color: transparent; } -.evo-popup.resize .border-outline { display: none; } -.evo-popup.resize:hover .border-outline, .evo-popup.is-resize .border-outline, .evo-popup.resize:hover .border-outline i, .evo-popup.is-resize .border-outline i { display: block !important } -.evo-popup.resize .border-outline i { position: absolute; z-index: 99; display: none; background-color: transparent } -.evo-popup.resize .border-outline .bo-left, .evo-popup.resize .border-outline .bo-right { width: .25rem; height: 100%; } -.evo-popup.resize .border-outline .bo-left { left: 0; } -.evo-popup.resize .border-outline .bo-right { right: 0; } -.evo-popup.resize .border-outline .bo-top, .evo-popup.resize .border-outline .bo-bottom { height: .25rem; width: 100%; } -.evo-popup.resize .border-outline .bo-top { top: 0; } -.evo-popup.resize .border-outline .bo-bottom { bottom: 0; } + +.evo-popup { + display: none; + position: absolute; + z-index: 10500; + box-shadow: 0 0.2rem 2rem rgba(0, 0, 0, 0.1); +} + +.evo-popup.animation { + -webkit-transition: .25s; + transition: .25s +} + +.evo-popup:hover { + box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); +} + +.evo-popup.alert { + margin: 0; + height: 100%; + border-color: rgba(0, 0, 0, 0.1); + background-color: #fff; + color: #444; + border-radius: .15rem; +} + +.evo-popup.alert-dark { + background-color: #202329; + color: #ccc; +} + +.evo-popup.alert-dark hr { + border-color: rgba(255, 255, 255, 0.5); +} + +.evo-popup.alert-dark .close { + color: #fff; + text-shadow: 0 0 #000; +} + +.evo-popup.alert-success { + border-color: rgba(0, 0, 0, 0.1); + background-color: #5cb85c; + color: #fff; +} + +.evo-popup.alert-success hr { + border-color: rgba(255, 255, 255, 0.5); +} + +.evo-popup.alert-info { + border-color: rgba(0, 0, 0, 0.1); + background-color: #1976d2; + color: #fff; +} + +.evo-popup.alert-info hr { + border-color: rgba(255, 255, 255, 0.5); +} + +.evo-popup.alert-warning { + border-color: rgba(0, 0, 0, 0.1); + background-color: #ffe082; + color: #795548; +} + +.evo-popup.alert-warning hr { + border-color: rgba(0, 0, 0, 0.1); +} + +.evo-popup.alert-danger { + border-color: rgba(0, 0, 0, 0.1); + background-color: #d9534f; + color: #fff; +} + +.evo-popup.alert-danger hr { + border-color: rgba(255, 255, 255, 0.5); +} + +.evo-popup.alert.evo-popup-iframe { + padding: 0; + border: none; + background-color: #fafafa; + overflow: hidden; +} + +.evo-popup.alert .evo-popup-header { + padding-bottom: .5rem; + margin-bottom: .5rem; + border-bottom: 1px solid +} + +.evo-popup .close { + position: absolute; + top: .3em; + right: .3em; +} + +.evo-popup.evo-popup-iframe .close { + position: absolute; + z-index: 9; + opacity: 1; + top: 0; + right: 0; + width: 1.5rem; + height: 1.5rem; + line-height: 1.4rem; + color: #fff; + background-color: #e5a2a0; + text-align: center; + font-weight: 100; +} + +.evo-popup.evo-popup-iframe .close:hover { + opacity: 1; + background-color: #d9534f; +} + +.evo-popup.evo-popup-iframe .evo-popup-header { + position: relative; + height: 1.5rem; + margin: 0; + padding: 0 1.5rem 0 .5rem; + line-height: 1.5rem; + font-size: .9rem; + border-bottom: 1px solid #dedede; +} + +.evo-popup.evo-popup-iframe .evo-popup-header i { + line-height: 1.5rem !important; +} + +.evo-popup.evo-popup-iframe .evo-popup-body { + position: absolute; + z-index: 1; + left: 0; + top: 0; + right: 0; + bottom: 0; +} + +.evo-popup.evo-popup-iframe .evo-popup-header + .evo-popup-body { + top: 1.5rem +} + +.evo-popup.evo-popup-iframe.changed { + box-shadow: 0 0.2rem 2rem rgba(0, 0, 0, 0.1), 0 0 .2rem .2rem #ffc107 +} + +.evo-popup-overlay { + position: fixed; + z-index: 10499; + left: 0; + top: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.3); +} + +.evo-popup-overlay::before { + position: absolute; + left: 20%; + top: 20%; + width: 45%; + height: 45%; + opacity: 0; + background-color: rgba(0, 0, 0, 0.3); + transition: all 0.25s ease-in-out; +} + +.evo-popup.is-drag::before, +.evo-popup.is-resize::before { + content: ""; + position: absolute; + z-index: 9; + left: 0; + top: 0; + right: 0; + bottom: 0; + background-color: transparent; +} + +.evo-popup.resize .border-outline { + display: none; +} + +.evo-popup.resize:hover .border-outline, +.evo-popup.is-resize .border-outline, +.evo-popup.resize:hover .border-outline i, +.evo-popup.is-resize .border-outline i { + display: block !important +} + +.evo-popup.resize .border-outline i { + position: absolute; + z-index: 99; + display: none; + background-color: transparent +} + +.evo-popup.resize .border-outline .bo-left, +.evo-popup.resize .border-outline .bo-right { + width: .25rem; + height: 100%; +} + +.evo-popup.resize .border-outline .bo-left { + left: 0; +} + +.evo-popup.resize .border-outline .bo-right { + right: 0; +} + +.evo-popup.resize .border-outline .bo-top, +.evo-popup.resize .border-outline .bo-bottom { + height: .25rem; + width: 100%; +} + +.evo-popup.resize .border-outline .bo-top { + top: 0; +} + +.evo-popup.resize .border-outline .bo-bottom { + bottom: 0; +} + /* [ EVO-TABS ] */ -.evo-tab-row { height: 1.875rem; padding: 0; background-color: #dfdfdf; } -.evo-tab-row:after { background-color: #cfd2d6 } -.evo-tab-row .tab-row .tab { height: 1.875rem; line-height: 2rem; font-size: .8125rem; text-transform: none; border: none; border-right: 1px solid #cfd2d6; border-left: 1px solid #cfd2d6; margin-left: -1px; } -.evo-tab-row .tab-row .tab:hover { background-color: rgba(255, 255, 255, 0.5) } -.evo-tab-row .tab-row .tab.changed { color: #0275d8; } -.evo-tab-row .tab-row .tab.selected { font-weight: normal; color: #444; background-color: #fafafa; } -.evo-tab-row .tab-row .tab i, .evo-popup.evo-popup-iframe .evo-popup-header i { float: left; margin: 0; line-height: 2.2em; } -.evo-tab-row .tab-row .tab small, .evo-popup.evo-popup-iframe .evo-popup-header small { margin-left: .25em } -.evo-tab-row .tab-row .tab:not(#evo-tab-home) i.help, .evo-popup.evo-popup-iframe .evo-popup-header i.help { display: none } -.evo-tab-row .tab-row .tab:not(#evo-tab-home) i, .evo-popup.evo-popup-iframe .evo-popup-header i { margin-right: .25em } -.evo-tab-row .tab-row .tab span { background: none !important } -.evo-tab-row .tab-row .tab .tab-title { float: left; width: 5rem; line-height: 2rem; text-overflow: ellipsis; overflow: hidden; } -.evo-tab-row .tab-row .tab .tab-close { float: right; margin: 0 -.75rem 0 .5rem; padding: .25em; line-height: 1.3em; font-size: 1.3em; font-weight: 700; color: #9e9e9e } -.evo-tab-row .tab-row .tab .tab-close:hover { color: #d9534f } -.evo-tab-page { position: absolute; overflow: hidden; z-index: -1; display: block; left: 0; top: 2.3em; right: 0; bottom: 0; height: auto; box-shadow: none; background-color: #fafafa; } -.evo-tab-page.show { z-index: 1; } -.evo-tab-page iframe { position: absolute; left: 0; top: 0; width: 100%; height: 100%; background-color: #fafafa; overflow: hidden; } + +.evo-tab-row { + height: 1.875rem; + padding: 0; + background-color: #dfdfdf; +} + +.evo-tab-row:after { + background-color: #cfd2d6 +} + +.evo-tab-row .tab-row .tab { + height: 1.875rem; + line-height: 2rem; + font-size: .8125rem; + text-transform: none; + border: none; + border-right: 1px solid #cfd2d6; + border-left: 1px solid #cfd2d6; + margin-left: -1px; +} + +.evo-tab-row .tab-row .tab:hover { + background-color: rgba(255, 255, 255, 0.5) +} + +.evo-tab-row .tab-row .tab.changed { + color: #0275d8; +} + +.evo-tab-row .tab-row .tab.selected { + font-weight: normal; + color: #444; + background-color: #fafafa; +} + +.evo-tab-row .tab-row .tab i, +.evo-popup.evo-popup-iframe .evo-popup-header i { + float: left; + margin: 0; + line-height: 2.2em; +} + +.evo-tab-row .tab-row .tab small, +.evo-popup.evo-popup-iframe .evo-popup-header small { + margin-left: .25em +} + +.evo-tab-row .tab-row .tab:not(#evo-tab-home) i.help, +.evo-popup.evo-popup-iframe .evo-popup-header i.help { + display: none +} + +.evo-tab-row .tab-row .tab:not(#evo-tab-home) i, +.evo-popup.evo-popup-iframe .evo-popup-header i { + margin-right: .25em +} + +.evo-tab-row .tab-row .tab span { + background: none !important +} + +.evo-tab-row .tab-row .tab .tab-title { + float: left; + width: 5rem; + line-height: 2rem; + text-overflow: ellipsis; + overflow: hidden; +} + +.evo-tab-row .tab-row .tab .tab-close { + float: right; + margin: 0 -.75rem 0 .5rem; + padding: .25em; + line-height: 1.3em; + font-size: 1.3em; + font-weight: 700; + color: #9e9e9e +} + +.evo-tab-row .tab-row .tab .tab-close:hover { + color: #d9534f +} + +.evo-tab-page { + position: absolute; + overflow: hidden; + z-index: -1; + display: block; + left: 0; + top: 2.3em; + right: 0; + bottom: 0; + height: auto; + box-shadow: none; + background-color: #fafafa; +} + +.evo-tab-page.show { + z-index: 1; +} + +.evo-tab-page iframe { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + background-color: #fafafa; + overflow: hidden; +} + @media (min-width: 1200px) { -.evo-tab-row .tab-row .tab .tab-title { width: 7rem; } + .evo-tab-row .tab-row .tab .tab-title { + width: 7rem; + } } + /* modes theme */ + /* lightness */ -.lightness .evo-tab-row { background-color: #e8e8e8; } + +.lightness .evo-tab-row { + background-color: #e8e8e8; +} + /* light */ -.light .evo-tab-row { background-color: #dfdfdf; } + +.light .evo-tab-row { + background-color: #dfdfdf; +} + /* dark */ -.dark .evo-popup.alert.evo-popup-iframe { background-color: #ecf0f1 } -.dark .evo-popup-overlay, .darkness .evo-popup-overlay { background-color: rgba(0, 0, 0, 0.3); } -.dark .evo-tab-row, .darkness .evo-tab-row { background-color: #1a1c21; border-bottom: none; } -.dark .evo-tab-row:after, .darkness .evo-tab-row:after { background-color: #1a1c21; } -.dark .evo-tab-row .tab-row .tab, .darkness .evo-tab-row .tab-row .tab { color: #aaa; border-color: #2a2d33 } -.dark .evo-tab-row .tab-row .tab:hover, .darkness .evo-tab-row .tab-row .tab:hover { background-color: #2d3033 } -.dark .evo-tab-row .tab-row .tab.changed, .darkness .evo-tab-row .tab-row .tab.changed { color: #7cb2dc; } -.dark .evo-tab-row .tab-row .tab.selected, .darkness .evo-tab-row .tab-row .tab.selected { background-color: #414550; color: #eee; border-bottom: 3px solid #1976d2; } -.dark .evo-tab-page, .dark .evo-tab-page iframe, .darkness .evo-tab-page, .darkness .evo-tab-page iframe { background-color: #ecf0f1 } + +.dark .evo-popup.alert.evo-popup-iframe { + background-color: #ecf0f1 +} + +.dark .evo-popup-overlay, +.darkness .evo-popup-overlay { + background-color: rgba(0, 0, 0, 0.3); +} + +.dark .evo-tab-row, +.darkness .evo-tab-row { + background-color: #1a1c21; + border-bottom: none; +} + +.dark .evo-tab-row:after, +.darkness .evo-tab-row:after { + background-color: #1a1c21; +} + +.dark .evo-tab-row .tab-row .tab, +.darkness .evo-tab-row .tab-row .tab { + color: #aaa; + border-color: #2a2d33 +} + +.dark .evo-tab-row .tab-row .tab:hover, +.darkness .evo-tab-row .tab-row .tab:hover { + background-color: #2d3033 +} + +.dark .evo-tab-row .tab-row .tab.changed, +.darkness .evo-tab-row .tab-row .tab.changed { + color: #7cb2dc; +} + +.dark .evo-tab-row .tab-row .tab.selected, +.darkness .evo-tab-row .tab-row .tab.selected { + background-color: #414550; + color: #eee; + border-bottom: 3px solid #1976d2; +} + +.dark .evo-tab-page, +.dark .evo-tab-page iframe, +.darkness .evo-tab-page, +.darkness .evo-tab-page iframe { + background-color: #ecf0f1 +} + /* darkness */ -.darkness .evo-popup.alert.evo-popup-iframe, .darkness .evo-tab-page iframe { background-color: #282c34 } -.darkness .evo-popup.evo-popup-iframe .close { opacity: 0.64; background-color: #ca000c; font-family: serif; } -.darkness .evo-popup.evo-popup-iframe .close:hover { opacity: 1; } -.darkness .evo-popup.evo-popup-iframe .evo-popup-header { border-bottom: 1px solid #17191d; } -.darkness .evo-popup.evo-popup-iframe .evo-popup-header { color: #eee; } -.darkness .sectionBody .tab-row-container, .darkness .tab-pane .tab-row-container, .darkness .tab-pane .tab-row { background-color: #202329; } -.darkness .tab-pane .tab-pane .tab-row { background-color: #282c34; } -.darkness .tab-row .tab.selected { border-color: #414449; background-color: #282c34; color: #eee; } -.darkness .tab-row .tab, .darkness .tab-row .tab a, .darkness .tab-pane > .tab-page > .tab { color: inherit } -.darkness .tab-row::after, .darkness .tab-row-container::after { background-color: #414449; } -.darkness .tab-row-container .tab-row { z-index: auto; } -.darkness .evo-tab-row .tab-row .tab:hover { background-color: #282c34; } -.darkness .evo-tab-row .tab-row .tab.selected { background-color: #282c34; border-color: #343942; border-bottom: 3px solid #1976d2; } -.darkness .sectionBody fieldset, .darkness .sectionBody legend { background: none; border: 1px solid #414449; box-shadow: none; } -.darkness .tab-page .tab-section .tab-header, .darkness .tab-page .sectionHeader { background-color: #202329; border: 1px solid #414449; } -.darkness .tab-page .tab-section, .darkness .tab-page .sectionHeader + .sectionBody { background: none; border: 1px solid #414449; } -.darkness .tab-page .sectionHeader + .sectionBody { border-top: none; } + +.darkness .evo-popup.alert.evo-popup-iframe, +.darkness .evo-tab-page iframe { + background-color: #282c34 +} + +.darkness .evo-popup.evo-popup-iframe .close { + opacity: 0.64; + background-color: #ca000c; + font-family: serif; +} + +.darkness .evo-popup.evo-popup-iframe .close:hover { + opacity: 1; +} + +.darkness .evo-popup.evo-popup-iframe .evo-popup-header { + border-bottom: 1px solid #17191d; +} + +.darkness .evo-popup.evo-popup-iframe .evo-popup-header { + color: #eee; +} + +.darkness .sectionBody .tab-row-container, +.darkness .tab-pane .tab-row-container, +.darkness .tab-pane .tab-row { + background-color: #202329; +} + +.darkness .tab-pane .tab-pane .tab-row { + background-color: #282c34; +} + +.darkness .tab-row .tab.selected { + border-color: #414449; + background-color: #282c34; + color: #eee; +} + +.darkness .tab-row .tab, +.darkness .tab-row .tab a, +.darkness .tab-pane > .tab-page > .tab { + color: inherit +} + +.darkness .tab-row::after, +.darkness .tab-row-container::after { + background-color: #414449; +} + +.darkness .tab-row-container .tab-row { + z-index: auto; +} + +.darkness .evo-tab-row .tab-row .tab:hover { + background-color: #282c34; +} + +.darkness .evo-tab-row .tab-row .tab.selected { + background-color: #282c34; + border-color: #343942; + border-bottom: 3px solid #1976d2; +} + +.darkness .sectionBody fieldset, +.darkness .sectionBody legend { + background: none; + border: 1px solid #414449; + box-shadow: none; +} + +.darkness .tab-page .tab-section .tab-header, +.darkness .tab-page .sectionHeader { + background-color: #202329; + border: 1px solid #414449; +} + +.darkness .tab-page .tab-section, +.darkness .tab-page .sectionHeader + .sectionBody { + background: none; + border: 1px solid #414449; +} + +.darkness .tab-page .sectionHeader + .sectionBody { + border-top: none; +} diff --git a/manager/media/style/default/css/tree.css b/manager/media/style/default/css/tree.css index dee0749f69..f77c0b568f 100755 --- a/manager/media/style/default/css/tree.css +++ b/manager/media/style/default/css/tree.css @@ -1,82 +1,464 @@ /* tree */ -#treeloader { position: absolute; display: block; overflow: hidden; right: 0.3em; top: 0.15em; opacity: 0; visibility: hidden; -webkit-transition-duration: 0.5s; transition-duration: 0.5s } -#treeloader .fa { font-size: 1em; } -#treeloader.visible { opacity: 0.7; visibility: visible; -webkit-transition-duration: 0s; transition-duration: 0s } -.treeframebody { height: 100%; min-height: calc(100% + 1px); background-color: #fafafa; border-right: 1px solid #cfd2d6; } -#treeMenu { display: table; width: 100%; height: 1.875rem; table-layout: fixed; margin-top: -1px; background-color: #dfdfdf; border-bottom: 1px solid #cfd2d6 } -#treeMenu .treeButton { display: table-cell; cursor: pointer; height: 1.875rem; line-height: 2rem; white-space: nowrap; text-align: center; vertical-align: middle; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } -#treeMenu .treeButton:hover:not(.disabled) { background-color: rgba(255, 255, 255, .5); cursor: pointer; -webkit-transition-duration: 0s; transition-duration: 0s } -#treeMenu .treeButton:not(.disabled):active { background-color: #d5d5d5 } -#treeMenu .treeButton .fa { display: block; width: 1.2em; height: 1.2em; margin: auto; line-height: 1.3em; font-size: 1.1em; } -#treeMenu .treeButton.disabled { color: #777; opacity: 0.5 } -#treeHolder { position: relative; z-index: 1; cursor: default; overflow: auto; height: 100%; max-height: calc(100% - 30px); white-space: nowrap } -#treeHolder .rootNode { position: relative; } -#treeHolder .rootNode a { display: block; overflow: hidden; padding: .55em 1em 0.5em 1em; text-overflow: ellipsis; color: #333; cursor: pointer; -webkit-transition-duration: 0.15s; transition-duration: 0.15s; font-weight: bold } -#treeHolder .rootNode a .fa { margin-right: 0.5em } -#treeHolder .rootNode .icon { display: none; } -#treeRoot { float: left; width: 100%; color: #333; } -#treeRoot a { display: block; clear: both; overflow: hidden; text-decoration: none; padding: 0.1em 0 0.1em 2.2em; font-size: 1em; text-overflow: ellipsis; color: #333; cursor: default; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } -#treeRoot a:hover:not(.empty), #treeRoot a.current { background-color: rgba(33, 150, 243, 0.1) } -#treeRoot a small { margin: 0 0.8em 0 0.2em } -#treeRoot a.selected, #treeRoot .dragenter > a { background-color: rgba(0, 0, 0, 0.1); } -#treeRoot a .title { padding: 0 0.2em; color: #0275d8; cursor: pointer; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } -#treeRoot a.deleted .title { color: #a52a2a; text-decoration: line-through; } -#treeRoot a.unpublished .title { color: #b68282; font-style: italic; } -#treeRoot a.hidemenu .title { color: #404040; } -#treeRoot a.protected { position: relative; opacity: .5; background-color: transparent !important; } -#treeRoot a .lockedResource { cursor: pointer; } -#treeRoot a .editResource { margin-left: 0.2em } -#treeRoot .indent { position: relative; z-index: -1; float: left; height: 1.5em; } -#treeRoot .indent i { float: left; height: 1.2em; width: 1.5em } -#treeRoot .dragafter > a .indent, #treeRoot .dragbefore > a .indent { z-index: 1; } -#treeRoot .dragafter > a .indent::after, #treeRoot .dragbefore > a .indent::before { content: "\f0da"; display: block; position: absolute; right: 0.1em; bottom: -0.5em; height: 1em; font: normal normal normal 1em/1em FontAwesome; color: #f04 } -#treeRoot .dragbefore > a .indent::before { bottom: auto; top: -0.5em; } -#treeRoot .empty { color: #aaa; cursor: default; } -#treeRoot .icon { cursor: pointer; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } -#treeRoot .icon:hover > .fa { color: #000 } -#treeRoot .toggle { float: left; margin: 1px 0.2em 1px -1.5em; width: 1.3em; height: 1.3em; line-height: 1.4em; text-align: center; vertical-align: top; cursor: pointer; border-radius: 50%; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } -#treeRoot .toggle:hover { background-color: rgba(255, 255, 255, 0.5); } -#treeRoot .toggle .fa { margin: 0; width: auto; } -#treeRoot .fa, #treeHolder .rootNode .fa { margin-right: 1px; width: 1em; font-size: 1.1em; text-align: center; color: #565656; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } -#treeRoot a[data-private="1"] .icon::after { position: relative; float: left; margin: .5em -1em 0 0; content: "\f023"; font-family: FontAwesome; font-size: 0.75em; color: #d9534f; } -#treeRoot .fa-file, #treeRoot .fa-file-o, #treeRoot .fa-file-code, #treeRoot .fa-file-code-o { } -#treeRoot .fa-folder, #treeRoot .fa-folder-open, #treeRoot .fa-folder-o, #treeRoot .fa-folder-open-o, #treeRoot .fa-exclamation-triangle { margin-top: 0.1em; text-align: left } -#treeRoot .fa-link { margin-right: 0; font-size: 0.8em } -#treeRoot #binFull { display: none } + +#treeloader { + position: absolute; + display: block; + overflow: hidden; + right: 0.3em; + top: 0.15em; + opacity: 0; + visibility: hidden; + -webkit-transition-duration: 0.5s; + transition-duration: 0.5s +} + +#treeloader .fa { + font-size: 1em; +} + +#treeloader.visible { + opacity: 0.7; + visibility: visible; + -webkit-transition-duration: 0s; + transition-duration: 0s +} + +.treeframebody { + height: 100%; + min-height: calc(100% + 1px); + background-color: #fafafa; + border-right: 1px solid #cfd2d6; +} + +#treeMenu { + display: table; + width: 100%; + height: 1.875rem; + table-layout: fixed; + margin-top: -1px; + background-color: #dfdfdf; + border-bottom: 1px solid #cfd2d6 +} + +#treeMenu .treeButton { + display: table-cell; + cursor: pointer; + height: 1.875rem; + line-height: 2rem; + white-space: nowrap; + text-align: center; + vertical-align: middle; + -webkit-transition-duration: 0.15s; + transition-duration: 0.15s +} + +#treeMenu .treeButton:hover:not(.disabled) { + background-color: rgba(255, 255, 255, .5); + cursor: pointer; + -webkit-transition-duration: 0s; + transition-duration: 0s +} + +#treeMenu .treeButton:not(.disabled):active { + background-color: #d5d5d5 +} + +#treeMenu .treeButton .fa { + display: block; + width: 1.2em; + height: 1.2em; + margin: auto; + line-height: 1.3em; + font-size: 1.1em; +} + +#treeMenu .treeButton.disabled { + color: #777; + opacity: 0.5 +} + +#treeHolder { + position: relative; + z-index: 1; + cursor: default; + overflow: auto; + height: 100%; + max-height: calc(100% - 30px); + white-space: nowrap +} + +#treeHolder .rootNode { + position: relative; +} + +#treeHolder .rootNode a { + display: block; + overflow: hidden; + padding: .55em 1em 0.5em 1em; + text-overflow: ellipsis; + color: #333; + cursor: pointer; + -webkit-transition-duration: 0.15s; + transition-duration: 0.15s; + font-weight: bold +} + +#treeHolder .rootNode a .fa { + margin-right: 0.5em +} + +#treeHolder .rootNode .icon { + display: none; +} + +#treeRoot { + float: left; + width: 100%; + color: #333; +} + +#treeRoot a { + display: block; + clear: both; + overflow: hidden; + text-decoration: none; + padding: 0.1em 0 0.1em 2.2em; + font-size: 1em; + text-overflow: ellipsis; + color: #333; + cursor: default; + -webkit-transition-duration: 0.15s; + transition-duration: 0.15s +} + +#treeRoot a:hover:not(.empty), +#treeRoot a.current { + background-color: rgba(33, 150, 243, 0.1) +} + +#treeRoot a small { + margin: 0 0.8em 0 0.2em +} + +#treeRoot a.selected, +#treeRoot .dragenter > a { + background-color: rgba(0, 0, 0, 0.1); +} + +#treeRoot a .title { + padding: 0 0.2em; + color: #0275d8; + cursor: pointer; + -webkit-transition-duration: 0.15s; + transition-duration: 0.15s +} + +#treeRoot a.deleted .title { + color: #a52a2a; + text-decoration: line-through; +} + +#treeRoot a.unpublished .title { + color: #b68282; + font-style: italic; +} + +#treeRoot a.hidemenu .title { + color: #404040; +} + +#treeRoot a.protected { + position: relative; + opacity: .5; + background-color: transparent !important; +} + +#treeRoot a .lockedResource { + cursor: pointer; +} + +#treeRoot a .editResource { + margin-left: 0.2em +} + +#treeRoot .indent { + position: relative; + z-index: -1; + float: left; + height: 1.5em; +} + +#treeRoot .indent i { + float: left; + height: 1.2em; + width: 1.5em +} + +#treeRoot .dragafter > a .indent, +#treeRoot .dragbefore > a .indent { + z-index: 1; +} + +#treeRoot .dragafter > a .indent::after, +#treeRoot .dragbefore > a .indent::before { + content: "\f0da"; + display: block; + position: absolute; + right: 0.1em; + bottom: -0.5em; + height: 1em; + font: normal normal normal 1em/1em FontAwesome; + color: #f04 +} + +#treeRoot .dragbefore > a .indent::before { + bottom: auto; + top: -0.5em; +} + +#treeRoot .empty { + color: #aaa; + cursor: default; +} + +#treeRoot .icon { + cursor: pointer; + -webkit-transition-duration: 0.15s; + transition-duration: 0.15s +} + +#treeRoot .icon:hover > .fa { + color: #000 +} + +#treeRoot .toggle { + float: left; + margin: 1px 0.2em 1px -1.5em; + width: 1.3em; + height: 1.3em; + line-height: 1.4em; + text-align: center; + vertical-align: top; + cursor: pointer; + border-radius: 50%; + -webkit-transition-duration: 0.15s; + transition-duration: 0.15s +} + +#treeRoot .toggle:hover { + background-color: rgba(255, 255, 255, 0.5); +} + +#treeRoot .toggle .fa { + margin: 0; + width: auto; +} + +#treeRoot .fa, +#treeHolder .rootNode .fa { + margin-right: 1px; + width: 1em; + font-size: 1.1em; + text-align: center; + color: #565656; + -webkit-transition-duration: 0.15s; + transition-duration: 0.15s +} + +#treeRoot a[data-private="1"] .icon::after { + position: relative; + float: left; + margin: .5em -1em 0 0; + content: "\f023"; + font-family: FontAwesome; + font-size: 0.75em; + color: #d9534f; +} + +#treeRoot .fa-file, +#treeRoot .fa-file-o, +#treeRoot .fa-file-code, +#treeRoot .fa-file-code-o {} + +#treeRoot .fa-folder, +#treeRoot .fa-folder-open, +#treeRoot .fa-folder-o, +#treeRoot .fa-folder-open-o, +#treeRoot .fa-exclamation-triangle { + margin-top: 0.1em; + text-align: left +} + +#treeRoot .fa-link { + margin-right: 0; + font-size: 0.8em +} + +#treeRoot #binFull { + display: none +} + @media (min-width: 1200px) { -.dark #tree, .darkness #tree { font-size: .875rem; letter-spacing: 0.0321em; } + .dark #tree, + .darkness #tree { + font-size: .875rem; + letter-spacing: 0.0321em; + } } + /* modes theme */ + /* lightness */ -.lightness #treeMenu { background-color: #e8e8e8 } -.lightness .treeframebody { background-color: #fafafa; } + +.lightness #treeMenu { + background-color: #e8e8e8 +} + +.lightness .treeframebody { + background-color: #fafafa; +} + /* light */ -.light #treeMenu { background-color: #dfdfdf } -.light .treeframebody { background-color: #fafafa; } + +.light #treeMenu { + background-color: #dfdfdf +} + +.light .treeframebody { + background-color: #fafafa; +} + /* dark */ -.dark #treeMenu { background-color: rgba(0, 0, 0, 0.2); border-bottom-color: rgba(0, 0, 0, 0.2); border-right-color: #2a2d33 } -.dark #treeMenu .treeButton, .darkness #treeMenu .treeButton { color: #a9a9a9; } -.dark #treeMenu .treeButton:hover:not(.disabled), .darkness #treeMenu .treeButton:hover:not(.disabled) { background-color: #2d3033; color: #fff } -.dark #tree .treeframebody, .darkness #tree .treeframebody { background-color: #202329; border-color: #2a2d33 } -.dark #treeHolder .rootNode a, .darkness #treeHolder .rootNode a { color: #c5c5c5; } -.dark #treeHolder .rootNode a:hover, .darkness #treeHolder .rootNode a:hover { color: #eee } -.dark #treeRoot, .darkness #treeRoot { color: #b3b3b3; } -.dark #treeRoot a, .darkness #treeRoot a { color: #b3b3b3; } -.dark #treeRoot a:hover:not(.empty), .dark #treeRoot a.current, .darkness #treeRoot a:hover:not(.empty), .darkness #treeRoot a.current { background-color: rgba(255, 255, 255, 0.15); } -.dark #treeRoot a.selected, .dark #treeRoot .dragenter > a, .darkness #treeRoot a.selected, .darkness#treeRoot .dragenter > a { background-color: rgba(0, 142, 255, 0.19); } -.dark #treeRoot .dragafter > a::after, .dark #treeRoot .dragbefore > a::before, .darkness #treeRoot .dragafter > a::after, .darkness #treeRoot .dragbefore > a::before { background-color: rgba(255, 255, 255, 0.25); } -.dark #treeRoot a .title, .darkness #treeRoot a .title { color: #7cb2dc; } -.dark #treeRoot a.hidemenu .title, .darkness #treeRoot a.hidemenu .title { color: #c5c5c5; } -.dark #treeRoot a.deleted .title, .darkness #treeRoot a.deleted .title { color: #a52a2a; } -.dark #treeRoot a.unpublished .title, .darkness #treeRoot a.unpublished .title { color: #d0726b } -.dark #treeRoot .icon:hover > .fa, .darkness #treeRoot .icon:hover > .fa { color: #fff } -.dark #treeRoot a .title:hover, .darkness #treeRoot a .title:hover { color: #a2d4fb; } -.dark #treeRoot a.hidemenu .title:hover, .darkness #treeRoot a.hidemenu .title:hover { color: #eee } -.dark #treeRoot a.unpublished .title:hover, .darkness #treeRoot a.unpublished .title:hover { color: #f38e86 } -.dark #treeRoot a.deleted .title:hover, .darkness #treeRoot a.deleted .title:hover { color: #e23d3d } -.dark #treeRoot .toggle:hover, .darkness #treeRoot .toggle:hover { background-color: rgba(255, 255, 255, 0.19); } -.dark #treeRoot .fa, .dark #treeHolder .rootNode .fa, .darkness #treeRoot .fa, .darkness #treeHolder .rootNode .fa { color: #bcbec0; } + +.dark #treeMenu { + background-color: rgba(0, 0, 0, 0.2); + border-bottom-color: rgba(0, 0, 0, 0.2); + border-right-color: #2a2d33 +} + +.dark #treeMenu .treeButton, +.darkness #treeMenu .treeButton { + color: #a9a9a9; +} + +.dark #treeMenu .treeButton:hover:not(.disabled), +.darkness #treeMenu .treeButton:hover:not(.disabled) { + background-color: #2d3033; + color: #fff +} + +.dark #tree .treeframebody, +.darkness #tree .treeframebody { + background-color: #202329; + border-color: #2a2d33 +} + +.dark #treeHolder .rootNode a, +.darkness #treeHolder .rootNode a { + color: #c5c5c5; +} + +.dark #treeHolder .rootNode a:hover, +.darkness #treeHolder .rootNode a:hover { + color: #eee +} + +.dark #treeRoot, +.darkness #treeRoot { + color: #b3b3b3; +} + +.dark #treeRoot a, +.darkness #treeRoot a { + color: #b3b3b3; +} + +.dark #treeRoot a:hover:not(.empty), +.dark #treeRoot a.current, +.darkness #treeRoot a:hover:not(.empty), +.darkness #treeRoot a.current { + background-color: rgba(255, 255, 255, 0.15); +} + +.dark #treeRoot a.selected, +.dark #treeRoot .dragenter > a, +.darkness #treeRoot a.selected, +.darkness#treeRoot .dragenter > a { + background-color: rgba(0, 142, 255, 0.19); +} + +.dark #treeRoot .dragafter > a::after, +.dark #treeRoot .dragbefore > a::before, +.darkness #treeRoot .dragafter > a::after, +.darkness #treeRoot .dragbefore > a::before { + background-color: rgba(255, 255, 255, 0.25); +} + +.dark #treeRoot a .title, +.darkness #treeRoot a .title { + color: #7cb2dc; +} + +.dark #treeRoot a.hidemenu .title, +.darkness #treeRoot a.hidemenu .title { + color: #c5c5c5; +} + +.dark #treeRoot a.deleted .title, +.darkness #treeRoot a.deleted .title { + color: #a52a2a; +} + +.dark #treeRoot a.unpublished .title, +.darkness #treeRoot a.unpublished .title { + color: #d0726b +} + +.dark #treeRoot .icon:hover > .fa, +.darkness #treeRoot .icon:hover > .fa { + color: #fff +} + +.dark #treeRoot a .title:hover, +.darkness #treeRoot a .title:hover { + color: #a2d4fb; +} + +.dark #treeRoot a.hidemenu .title:hover, +.darkness #treeRoot a.hidemenu .title:hover { + color: #eee +} + +.dark #treeRoot a.unpublished .title:hover, +.darkness #treeRoot a.unpublished .title:hover { + color: #f38e86 +} + +.dark #treeRoot a.deleted .title:hover, +.darkness #treeRoot a.deleted .title:hover { + color: #e23d3d +} + +.dark #treeRoot .toggle:hover, +.darkness #treeRoot .toggle:hover { + background-color: rgba(255, 255, 255, 0.19); +} + +.dark #treeRoot .fa, +.dark #treeHolder .rootNode .fa, +.darkness #treeRoot .fa, +.darkness #treeHolder .rootNode .fa { + color: #bcbec0; +} + /* darkness */ -.darkness #tree .treeframebody { background-color: #202329; border-color: #414449; } -.darkness #treeMenu { background-color: #1a1c21; border-color: #414449; } +.darkness #tree .treeframebody { + background-color: #202329; + border-color: #414449; +} + +.darkness #treeMenu { + background-color: #1a1c21; + border-color: #414449; +} From f6ec4ba47d04d7928ddef48c6952bb4f0e97ee91 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Tue, 3 Apr 2018 21:36:46 +0200 Subject: [PATCH 133/274] Better navbar small icons rendering Better small icons rendering in eg. Firefox. 0.875rem = 14px = native FA size. --- manager/media/style/default/css/mainmenu.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/media/style/default/css/mainmenu.css b/manager/media/style/default/css/mainmenu.css index 586aeee1f4..b01af8df1c 100755 --- a/manager/media/style/default/css/mainmenu.css +++ b/manager/media/style/default/css/mainmenu.css @@ -126,7 +126,7 @@ #mainMenu .nav > li .fa { min-width: 1em; line-height: 2.2rem; - font-size: .875rem; + font-size: 0.875rem; vertical-align: top } @@ -620,7 +620,7 @@ margin-top: .2rem; } #mainMenu .nav > li .fa { - font-size: 1rem; + font-size: 0.875rem; } #mainMenu #nav > li > a { padding: 0 1.25rem; From fcd42afb5e4c612079860bcf54eb69c928a45f48 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Tue, 3 Apr 2018 21:46:09 +0200 Subject: [PATCH 134/274] Navbar links color --- manager/media/style/default/css/mainmenu.css | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/manager/media/style/default/css/mainmenu.css b/manager/media/style/default/css/mainmenu.css index b01af8df1c..0639a37b94 100755 --- a/manager/media/style/default/css/mainmenu.css +++ b/manager/media/style/default/css/mainmenu.css @@ -83,7 +83,7 @@ height: 2.2rem; line-height: 2.3rem; text-decoration: none; - color: #bbb; + color: #DCD9E3; transition-duration: 0.15s } @@ -765,7 +765,7 @@ .light #mainMenu .nav > li > a, .light #mainMenu .nav .label_searchid { - color: #cacaca + color: #DCD9E3; } .light #mainMenu.show .nav > li.dropdown.hover > a { @@ -782,12 +782,12 @@ .dark #mainMenu, .dark #mainMenu #nav #site a::before { background-color: #202329; - color: #bbb; + color: #DCD9E3; } .dark #mainMenu .nav > li > a, .dark #mainMenu .nav .label_searchid { - color: #bbb + color: #DCD9E3 } .dark #mainMenu.show .nav > li.dropdown.hover > a { @@ -809,7 +809,7 @@ .darkness #mainMenu .nav > li > a, .darkness #mainMenu .nav .label_searchid { - color: #bbb + color: #bbb; } .darkness #mainMenu.show .nav > li.dropdown.hover > a { From 9d7bd60b867926f75c376769abf83e347bd931c1 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Tue, 3 Apr 2018 21:46:46 +0200 Subject: [PATCH 135/274] Remove unnecessary letter spacing --- manager/media/style/default/css/index.css | 4 ---- 1 file changed, 4 deletions(-) diff --git a/manager/media/style/default/css/index.css b/manager/media/style/default/css/index.css index 611d2d96e2..e371390a1b 100755 --- a/manager/media/style/default/css/index.css +++ b/manager/media/style/default/css/index.css @@ -242,10 +242,6 @@ /* darkness */ -.darkness { - letter-spacing: .021em -} - .darkness #mainloader { background-color: rgba(0, 0, 0, 0.1); } From 9a22443653a93b36810bd6baebd1ec675dd0f729 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Tue, 3 Apr 2018 21:51:41 +0200 Subject: [PATCH 136/274] Navbar light bg color --- manager/media/style/default/css/mainmenu.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/media/style/default/css/mainmenu.css b/manager/media/style/default/css/mainmenu.css index 0639a37b94..f364e34b31 100755 --- a/manager/media/style/default/css/mainmenu.css +++ b/manager/media/style/default/css/mainmenu.css @@ -759,7 +759,7 @@ .light #mainMenu, .light #mainMenu #nav #site a::before { - background-color: #2b323a; + background-color: #343944; color: #cacaca; } From 4b974808d5b1d4149f6efbfe86c8434cb5f85b91 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Tue, 3 Apr 2018 21:57:29 +0200 Subject: [PATCH 137/274] Table styles --- manager/media/style/default/css/custom.css | 35 +++++++++++++++------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/manager/media/style/default/css/custom.css b/manager/media/style/default/css/custom.css index edd8689722..4de8996ee1 100755 --- a/manager/media/style/default/css/custom.css +++ b/manager/media/style/default/css/custom.css @@ -1163,12 +1163,6 @@ ul.breadcrumbs span::after { margin-bottom: 0rem } -.widgets .table.data td, -.widgets .table.data th, -.widgets .table.data thead td { - border-top: 0px; -} - .widgets .table:not(.data) tr th, .widgets .table:not(.data) tr td { padding: .15rem; @@ -2292,7 +2286,7 @@ ul.sortableList li.ghost { } /* - [ OTHERS COMPONENTS ] - this components need fix css +[ OTHERS COMPONENTS ] - this components need fix css */ /* extras */ @@ -2466,18 +2460,36 @@ form#docfinder div.tab-page { /* end loginbox animation */ -/* pmfx theme */ - #actions .dropdown-toggle:after { display: none !important; } -/* +.card .table.data { + margin-bottom: 0; + border-bottom-width: 0; +} + +.table.data th, +.table.data thead td { + border-bottom-width: 1px; +} + +.card .table.data > thead > tr:first-child td, +.card .table.data > thead > tr:first-child th, +.card .table.data > tbody > tr:first-child td, +.card .table.data > tbody > tr:first-child th { + border-top-width: 0; +} + .table.data > tbody > tr, .table.data > tbody > tr:nth-child(2n), .widgets #modxrecent_widget .table.data tbody tr:nth-child(4n+1):not(:hover) { background-color: #fff; -}*/ +} + +.table.data > tbody > tr:hover { + background-color: rgba(0, 0, 0, 0.03) !important; +} ul.breadcrumbs { margin: 0 0 1rem 0; @@ -2536,6 +2548,7 @@ textarea.mce, ul.mmTagList li { padding: 2px 8px !important; + margin-bottom: 5px !important; border-radius: 3px !important; -webkit-border-radius: 3px !important; background-color: #eaeaea !important; From 9d92a0bbbb6b0d7b8564e1862eec4e46c3b73211 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Tue, 3 Apr 2018 22:45:18 +0200 Subject: [PATCH 138/274] Tree styles --- .../elementsintree/assets/txt_content.tpl | 138 ++++++++---------- manager/media/style/default/css/tree.css | 21 ++- 2 files changed, 74 insertions(+), 85 deletions(-) diff --git a/assets/plugins/elementsintree/assets/txt_content.tpl b/assets/plugins/elementsintree/assets/txt_content.tpl index 9b89ba8e14..45b02d1d88 100755 --- a/assets/plugins/elementsintree/assets/txt_content.tpl +++ b/assets/plugins/elementsintree/assets/txt_content.tpl @@ -128,10 +128,6 @@ margin-top: -1px; } - #treePane .panel-heading:first-child { - border-top-color: transparent !important; - } - #treePane .panel { padding-top: 1px; } @@ -140,13 +136,19 @@ background-color: #eaeaea; } - .dark #treePane .panel-heading { + #treePane .panel-title a:hover { + background-color: transparent; + } + + .dark #treePane .panel-heading, + .darkness #treePane .panel-heading { border-top: 1px solid #3e4144; border-bottom: 1px solid #3e4144; background-color: #2f323a; } - .dark #treePane .panel-heading:hover { + .dark #treePane .panel-heading:hover, + .darkness #treePane .panel-heading:hover { background-color: #363942; } @@ -264,7 +266,8 @@ color: #404040; } - .dark.ElementsInTree #tree .actionButtons--eit li a:hover { + .dark.ElementsInTree #tree .actionButtons--eit li a:hover, + .darkness.ElementsInTree #tree .actionButtons--eit li a:hover { color: #bfbfbf; } @@ -361,11 +364,15 @@ color: #657587; } - .ElementsInTree #tree .eltree:hover, .ElementsInTree #tree .eltree.current { + .ElementsInTree #tree .eltree:hover, + .ElementsInTree #tree .eltree.current { background-color: rgba(33, 150, 243, 0.1); } - .dark.ElementsInTree #tree .eltree:hover, .dark.ElementsInTree #tree .eltree.current { + .dark.ElementsInTree #tree .eltree:hover, + .dark.ElementsInTree #tree .eltree.current, + .darkness.ElementsInTree #tree .eltree:hover, + .darkness.ElementsInTree #tree .eltree.current { background-color: rgba(255, 255, 255, 0.15); } @@ -414,134 +421,117 @@ background-color: #fafafa; } - .dark.ElementsInTree #tree .treeframebody { - background-color: #202329 !important; - color: #828282; - border-color: #2a2d33 - } - - .dark.ElementsInTree #tree .tab-row .tab { - color: #7b7b7b; - border-color: #2a2d33; - background-color: #1a1c21; - } - - .dark.ElementsInTree #tree .tab-row .tab:hover { - background-color: #2d3033; - } - - .dark.ElementsInTree #tree .tab-row .tab.selected { - background-color: #202329; - color: #bfbfbf; - } - - .dark.ElementsInTree #tree .tab-row .tab span { - background-color: transparent; - } - - .dark.ElementsInTree #tree .tab-page { - background-color: #202329; - } - - .dark.ElementsInTree #tree .tab-page .panel-group { - border-color: #3e4144; - } - - .dark.ElementsInTree #tree .form-control { - background-color: transparent; - color: #c7c7c7; - } - - .dark.ElementsInTree #tree a { - color: #b7b7b7; - } - - .dark.ElementsInTree #tree .disabledPlugin, - .dark.ElementsInTree #tree .disabledPlugin a { - color: #B68282; - } - - .dark.ElementsInTree #tree a:hover { - color: #dbdbdb; - } - - .dark.ElementsInTree #tree .disabledPlugin a { - color: #b68282; - } - - .dark.ElementsInTree #treeMenu { - background-color: rgba(0, 0, 0, 0.2) !important; - } - - .dark.ElementsInTree #treeMenu.is-intab { - background-color: transparent !important; - } - - - + .dark.ElementsInTree #tree .treeframebody, .darkness.ElementsInTree #tree .treeframebody { background-color: #202329 !important; color: #828282; border-color: #2a2d33 } + .dark.ElementsInTree #tree .tab-row .tab, .darkness.ElementsInTree #tree .tab-row .tab { color: #7b7b7b; border-color: #2a2d33; background-color: #1a1c21; } + .dark.ElementsInTree #tree .tab-row .tab:hover, .darkness.ElementsInTree #tree .tab-row .tab:hover { background-color: #2d3033; } + .dark.ElementsInTree #tree .tab-row .tab.selected, .darkness.ElementsInTree #tree .tab-row .tab.selected { background-color: #202329; color: #bfbfbf; } + .dark.ElementsInTree #tree .tab-row .tab span, .darkness.ElementsInTree #tree .tab-row .tab span { background-color: transparent; } + .dark.ElementsInTree #tree .tab-page, .darkness.ElementsInTree #tree .tab-page { background-color: #202329; } + .dark.ElementsInTree #tree .tab-page .panel-group, .darkness.ElementsInTree #tree .tab-page .panel-group { border-color: #3e4144; } + .dark.ElementsInTree #tree .form-control, .darkness.ElementsInTree #tree .form-control { background-color: transparent; color: #c7c7c7; } + .dark.ElementsInTree #tree a, .darkness.ElementsInTree #tree a { color: #b7b7b7; } + .dark.ElementsInTree #tree .disabledPlugin, + .dark.ElementsInTree #tree .disabledPlugin a, .darkness.ElementsInTree #tree .disabledPlugin, .darkness.ElementsInTree #tree .disabledPlugin a { color: #B68282; } + .dark.ElementsInTree #tree a:hover, .darkness.ElementsInTree #tree a:hover { color: #dbdbdb; } + .dark.ElementsInTree #tree .disabledPlugin a, .darkness.ElementsInTree #tree .disabledPlugin a { color: #b68282; } + .dark.ElementsInTree #treeMenu, .darkness.ElementsInTree #treeMenu { background-color: rgba(0, 0, 0, 0.2) !important; } + .dark.ElementsInTree #treeMenu.is-intab, .darkness.ElementsInTree #treeMenu.is-intab { background-color: transparent !important; } + + #treePane .panel-title { + font-size: 0.8125rem; + } + + #treePane .panel-title a { + padding: 4px 0 6px 0.6rem !important; + } + + #treePane .panel-title > a:before { + display: none !important; + } + + #treePane .tab-page ul { + margin: 7px 0 !important; + } + + .ElementsInTree #tree .eltree { + padding-left: 1rem !important; + font-size: 13px; + } + .dark #treePane .panel-heading, + .darkness #treePane .panel-heading { + border-top-color: #3e4144 !important; + border-bottom-color: transparent !important; + } + + + #treePane .panel-heading:first-child, + .dark #treePane .panel-heading:first-child, + .darkness #treePane .panel-heading:first-child { + border-top-color: transparent !important; + } /* Unify frames */ diff --git a/manager/media/style/default/css/tree.css b/manager/media/style/default/css/tree.css index f77c0b568f..daee161e67 100755 --- a/manager/media/style/default/css/tree.css +++ b/manager/media/style/default/css/tree.css @@ -1,5 +1,9 @@ /* tree */ +#tree { + font-size: 0.875rem; +} + #treeloader { position: absolute; display: block; @@ -94,7 +98,7 @@ #treeHolder .rootNode a { display: block; overflow: hidden; - padding: .55em 1em 0.5em 1em; + padding: 1em 1em 0.5em 1.25em; text-overflow: ellipsis; color: #333; cursor: pointer; @@ -122,7 +126,10 @@ clear: both; overflow: hidden; text-decoration: none; - padding: 0.1em 0 0.1em 2.2em; + padding-top: 0.2em; + padding-bottom: 0.2em; + padding-left: 2.5em !important; + padding-right: 0; font-size: 1em; text-overflow: ellipsis; color: #333; @@ -298,14 +305,6 @@ display: none } -@media (min-width: 1200px) { - .dark #tree, - .darkness #tree { - font-size: .875rem; - letter-spacing: 0.0321em; - } -} - /* modes theme */ /* lightness */ @@ -461,4 +460,4 @@ .darkness #treeMenu { background-color: #1a1c21; border-color: #414449; -} +} \ No newline at end of file From 46f35a4912d913567c02b5b277c01f1433264fbf Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Tue, 3 Apr 2018 23:11:06 +0200 Subject: [PATCH 139/274] Menu and Tree --- manager/media/style/default/css/mainmenu.css | 30 ++++++++++++-------- manager/media/style/default/css/tree.css | 2 +- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/manager/media/style/default/css/mainmenu.css b/manager/media/style/default/css/mainmenu.css index f364e34b31..c5ba5e44c6 100755 --- a/manager/media/style/default/css/mainmenu.css +++ b/manager/media/style/default/css/mainmenu.css @@ -3,8 +3,8 @@ #mainMenu { background-color: #2b323a; color: #8b9298; - -webkit-box-shadow: 0 0.15rem 0.15rem rgba(0, 0, 0, 0.25); - box-shadow: 0 0.15rem 0.15rem rgba(0, 0, 0, 0.25); + -webkit-box-shadow: 0 2px 4px rgba(0,0,0,.3); + box-shadow: 0 2px 4px rgba(0,0,0,.3); } #mainMenu.show { @@ -65,7 +65,7 @@ #mainMenu .nav > li { position: relative; display: inline-block; - font-size: 0.8rem; + font-size: 0.8125rem; vertical-align: top } @@ -206,10 +206,6 @@ visibility: hidden; } -#mainMenu.show .nav > li:hover > ul.sub-menu {} - -#mainMenu.show .nav > li:hover > ul.sub-menu.show {} - #mainMenu #settings.nav > li > ul { left: auto; right: 0 @@ -240,8 +236,8 @@ } #mainMenu .nav > li > ul > li.hover > a:first-child { - color: #fff; - background-color: #1976d2; + color: #444; + background-color: #eee; } #mainMenu .nav > li > ul > li > span:first-child { @@ -612,7 +608,7 @@ #mainMenu .nav .label_searchid, #mainMenu .nav > li .fa, #mainMenu .nav > li > a .icon { - line-height: 2.6rem; + line-height: 2.5rem; } #mainMenu .nav > li > a .icon.photo { width: 2.1rem; @@ -731,6 +727,11 @@ /* lightness */ +.lightness #mainMenu { + -webkit-box-shadow: 0 2px 4px rgba(0,0,0,0.15); + box-shadow: 0 2px 4px rgba(0,0,0,0.15); +} + .lightness #mainMenu, .lightness #mainMenu #nav #site a::before { background-color: #f1f1f1; @@ -753,8 +754,8 @@ /* light */ .light #mainMenu { - -webkit-box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); - box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); + -webkit-box-shadow: 0 2px 4px rgba(0,0,0,.3); + box-shadow: 0 2px 4px rgba(0,0,0,.3); } .light #mainMenu, @@ -817,6 +818,11 @@ background-color: #343942; } +.darkness #mainMenu .nav > li > ul > li.hover > a:first-child { + color: #eee; + background-color: #454c57; +} + .darkness #mainMenu .nav > li > ul { background-color: #343942; } diff --git a/manager/media/style/default/css/tree.css b/manager/media/style/default/css/tree.css index daee161e67..ecb728bda0 100755 --- a/manager/media/style/default/css/tree.css +++ b/manager/media/style/default/css/tree.css @@ -265,7 +265,7 @@ #treeHolder .rootNode .fa { margin-right: 1px; width: 1em; - font-size: 1.1em; + font-size: 1em; text-align: center; color: #565656; -webkit-transition-duration: 0.15s; From f1c7dbf6c68f77c0d87509d23ada715215a90fe3 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Tue, 3 Apr 2018 23:15:19 +0200 Subject: [PATCH 140/274] tab-header styles --- manager/media/style/default/css/tabpane.css | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/manager/media/style/default/css/tabpane.css b/manager/media/style/default/css/tabpane.css index 120e8a0bd2..c3b060d0d7 100755 --- a/manager/media/style/default/css/tabpane.css +++ b/manager/media/style/default/css/tabpane.css @@ -154,7 +154,9 @@ .sectionHeader { margin-top: 1em; padding: .5rem 1.25rem; - letter-spacing: .03rem + letter-spacing: 0; + font-size: 0.875rem; + font-weight: bold; } .tab-page .tab-header + .tab-header, @@ -232,6 +234,13 @@ border-bottom: 2px solid #e0e0ec; } +.tab-page .tab-header, +.tab-page .tab-section .tab-header, +.tab-page .sectionHeader { + background-color: #f3f3f3; + border-bottom-width: 1px; +} + .tab-page .tab-section .tab-header:first-child, .tab-page .sectionHeader { margin-top: -1px; @@ -404,6 +413,10 @@ margin-top: 1.3rem; } +#tabGeneral > table { + margin-bottom: 1rem; +} + /* [ POPUPS ] */ .evo-popup { From 3d1d44de27920cdde88b2952355d4e8c40dfe487 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Tue, 3 Apr 2018 23:19:42 +0200 Subject: [PATCH 141/274] tab-header color --- manager/media/style/default/css/tabpane.css | 1 + 1 file changed, 1 insertion(+) diff --git a/manager/media/style/default/css/tabpane.css b/manager/media/style/default/css/tabpane.css index c3b060d0d7..e7d834f2ad 100755 --- a/manager/media/style/default/css/tabpane.css +++ b/manager/media/style/default/css/tabpane.css @@ -157,6 +157,7 @@ letter-spacing: 0; font-size: 0.875rem; font-weight: bold; + color: #777; } .tab-page .tab-header + .tab-header, From 13fcbd7f8f8394e3d34c343e7d3a8ba1a3635ebc Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Tue, 3 Apr 2018 23:25:54 +0200 Subject: [PATCH 142/274] treeMenu --- manager/media/style/default/css/tree.css | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/manager/media/style/default/css/tree.css b/manager/media/style/default/css/tree.css index ecb728bda0..dde86142b0 100755 --- a/manager/media/style/default/css/tree.css +++ b/manager/media/style/default/css/tree.css @@ -458,6 +458,7 @@ } .darkness #treeMenu { - background-color: #1a1c21; - border-color: #414449; + background-color: rgba(0, 0, 0, 0.2); + border-bottom-color: rgba(255,255,255,0.1); + border-right-color: #2a2d33 } \ No newline at end of file From d96842b58cb69c4d1b52cad9d09e13ee7807930e Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Tue, 3 Apr 2018 23:27:13 +0200 Subject: [PATCH 143/274] darkness Menu dropdowns border --- manager/media/style/default/css/tree.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manager/media/style/default/css/tree.css b/manager/media/style/default/css/tree.css index dde86142b0..8c344f01a3 100755 --- a/manager/media/style/default/css/tree.css +++ b/manager/media/style/default/css/tree.css @@ -461,4 +461,8 @@ background-color: rgba(0, 0, 0, 0.2); border-bottom-color: rgba(255,255,255,0.1); border-right-color: #2a2d33 +} + +.darkness #mainMenu .nav > li > ul > li { + border-bottom-color: rgba(0,0,0,0.15); } \ No newline at end of file From 82ae3372653b73465afbe9337ede2aee0581e17e Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Tue, 3 Apr 2018 23:30:58 +0200 Subject: [PATCH 144/274] Logo margin in About EVO tab Fixes missing logo margin in About EVO tab (Help page) --- manager/media/style/default/css/tabpane.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manager/media/style/default/css/tabpane.css b/manager/media/style/default/css/tabpane.css index e7d834f2ad..ed5de4ffd6 100755 --- a/manager/media/style/default/css/tabpane.css +++ b/manager/media/style/default/css/tabpane.css @@ -418,6 +418,10 @@ margin-bottom: 1rem; } +#tab1Help > img { + margin-bottom: 20px; +} + /* [ POPUPS ] */ .evo-popup { From 71b0e25bd06fd513af5122729cfa39f6ab8c84d1 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Wed, 4 Apr 2018 00:27:13 +0200 Subject: [PATCH 145/274] px to rem --- manager/media/style/default/css/tabpane.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/media/style/default/css/tabpane.css b/manager/media/style/default/css/tabpane.css index ed5de4ffd6..728e9fbe52 100755 --- a/manager/media/style/default/css/tabpane.css +++ b/manager/media/style/default/css/tabpane.css @@ -419,7 +419,7 @@ } #tab1Help > img { - margin-bottom: 20px; + margin-bottom: 1.25rem; } /* [ POPUPS ] */ From 8b6f4389c91030cf205e691a18cfcde456f2b55b Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Wed, 4 Apr 2018 00:29:34 +0200 Subject: [PATCH 146/274] px to rem --- manager/media/style/default/css/mainmenu.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/media/style/default/css/mainmenu.css b/manager/media/style/default/css/mainmenu.css index c5ba5e44c6..393115aee7 100755 --- a/manager/media/style/default/css/mainmenu.css +++ b/manager/media/style/default/css/mainmenu.css @@ -754,8 +754,8 @@ /* light */ .light #mainMenu { - -webkit-box-shadow: 0 2px 4px rgba(0,0,0,.3); - box-shadow: 0 2px 4px rgba(0,0,0,.3); + -webkit-box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.3); + box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.3); } .light #mainMenu, From 04033804d1d853871773c637862527f80f8bce9b Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Wed, 4 Apr 2018 00:32:57 +0200 Subject: [PATCH 147/274] darkness mode - fix letter spacing --- manager/media/style/default/css/index.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manager/media/style/default/css/index.css b/manager/media/style/default/css/index.css index e371390a1b..244977fe48 100755 --- a/manager/media/style/default/css/index.css +++ b/manager/media/style/default/css/index.css @@ -242,6 +242,10 @@ /* darkness */ +.darkness { + letter-spacing: .021em; +} + .darkness #mainloader { background-color: rgba(0, 0, 0, 0.1); } From 42b55057c9dd26700365818ae4429c54f553049e Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Wed, 4 Apr 2018 00:34:54 +0200 Subject: [PATCH 148/274] dark mode - grey color --- manager/media/style/default/css/mainmenu.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/media/style/default/css/mainmenu.css b/manager/media/style/default/css/mainmenu.css index 393115aee7..5306833a21 100755 --- a/manager/media/style/default/css/mainmenu.css +++ b/manager/media/style/default/css/mainmenu.css @@ -783,12 +783,12 @@ .dark #mainMenu, .dark #mainMenu #nav #site a::before { background-color: #202329; - color: #DCD9E3; + color: #bbb; } .dark #mainMenu .nav > li > a, .dark #mainMenu .nav .label_searchid { - color: #DCD9E3 + color: #bbb } .dark #mainMenu.show .nav > li.dropdown.hover > a { From ad42a3cad0b5809690cc443f16b838e041475a56 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Wed, 4 Apr 2018 11:29:54 +0200 Subject: [PATCH 149/274] Revert tree font size --- manager/media/style/default/css/tree.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/media/style/default/css/tree.css b/manager/media/style/default/css/tree.css index 8c344f01a3..35eb2693d0 100755 --- a/manager/media/style/default/css/tree.css +++ b/manager/media/style/default/css/tree.css @@ -1,7 +1,7 @@ /* tree */ #tree { - font-size: 0.875rem; + font-size: 0.8125rem; } #treeloader { @@ -265,7 +265,7 @@ #treeHolder .rootNode .fa { margin-right: 1px; width: 1em; - font-size: 1em; + font-size: 1.08em; text-align: center; color: #565656; -webkit-transition-duration: 0.15s; From 897404b443a012a8711cab2c60790d1cca14a0f0 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Wed, 4 Apr 2018 11:34:05 +0200 Subject: [PATCH 150/274] Revert hover color --- manager/media/style/default/css/mainmenu.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/media/style/default/css/mainmenu.css b/manager/media/style/default/css/mainmenu.css index 5306833a21..cd9432a981 100755 --- a/manager/media/style/default/css/mainmenu.css +++ b/manager/media/style/default/css/mainmenu.css @@ -236,8 +236,8 @@ } #mainMenu .nav > li > ul > li.hover > a:first-child { - color: #444; - background-color: #eee; + color: #fff; + background-color: #1976d2; } #mainMenu .nav > li > ul > li > span:first-child { From 03ab7658bc25e2267d17bc415f46f6f5723826e1 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Wed, 4 Apr 2018 11:47:31 +0200 Subject: [PATCH 151/274] Revert bigger padding --- manager/media/style/default/css/tree.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/media/style/default/css/tree.css b/manager/media/style/default/css/tree.css index 35eb2693d0..948bc59199 100755 --- a/manager/media/style/default/css/tree.css +++ b/manager/media/style/default/css/tree.css @@ -126,8 +126,8 @@ clear: both; overflow: hidden; text-decoration: none; - padding-top: 0.2em; - padding-bottom: 0.2em; + padding-top: 0.1em; + padding-bottom: 0.1em; padding-left: 2.5em !important; padding-right: 0; font-size: 1em; From 347b73ac333994d9981a93a723fd0245f372e404 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Wed, 4 Apr 2018 11:59:50 +0200 Subject: [PATCH 152/274] treeMenu treeMenu border, background. --- manager/media/style/default/css/tree.css | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/manager/media/style/default/css/tree.css b/manager/media/style/default/css/tree.css index 948bc59199..5753cfe479 100755 --- a/manager/media/style/default/css/tree.css +++ b/manager/media/style/default/css/tree.css @@ -458,9 +458,8 @@ } .darkness #treeMenu { - background-color: rgba(0, 0, 0, 0.2); - border-bottom-color: rgba(255,255,255,0.1); - border-right-color: #2a2d33 + background-color: #1a1c21; + border-color: #414449; } .darkness #mainMenu .nav > li > ul > li { From 799fa4358eb924f512d5068432c4bdd18ce01a55 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Wed, 4 Apr 2018 12:12:49 +0200 Subject: [PATCH 153/274] darkness mode dropdown hover color --- manager/media/style/default/css/mainmenu.css | 5 ----- 1 file changed, 5 deletions(-) diff --git a/manager/media/style/default/css/mainmenu.css b/manager/media/style/default/css/mainmenu.css index cd9432a981..ab0dd5087b 100755 --- a/manager/media/style/default/css/mainmenu.css +++ b/manager/media/style/default/css/mainmenu.css @@ -818,11 +818,6 @@ background-color: #343942; } -.darkness #mainMenu .nav > li > ul > li.hover > a:first-child { - color: #eee; - background-color: #454c57; -} - .darkness #mainMenu .nav > li > ul { background-color: #343942; } From 27b5a37fbfc10ca18e49a38cb6697e9232e2fc0b Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Thu, 5 Apr 2018 00:12:29 +0200 Subject: [PATCH 154/274] Fix missing border tab-header was covering tab-section top border. --- manager/media/style/default/css/tabpane.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/media/style/default/css/tabpane.css b/manager/media/style/default/css/tabpane.css index 728e9fbe52..094479d78a 100755 --- a/manager/media/style/default/css/tabpane.css +++ b/manager/media/style/default/css/tabpane.css @@ -244,7 +244,7 @@ .tab-page .tab-section .tab-header:first-child, .tab-page .sectionHeader { - margin-top: -1px; + margin-top: 0; border-top: none } From 19b1f5534df499eebe2b649a4ebfbbfedca03bd3 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Thu, 5 Apr 2018 00:31:23 +0200 Subject: [PATCH 155/274] last commit fix for darkness mode --- manager/media/style/default/css/tabpane.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/manager/media/style/default/css/tabpane.css b/manager/media/style/default/css/tabpane.css index 094479d78a..1d6fd38cd8 100755 --- a/manager/media/style/default/css/tabpane.css +++ b/manager/media/style/default/css/tabpane.css @@ -916,6 +916,12 @@ border: 1px solid #414449; } +.darkness .tab-page .tab-section .tab-header:first-child, +.darkness .tab-page .sectionHeader { + margin-top: 0; + border-top: none +} + .darkness .tab-page .tab-section, .darkness .tab-page .sectionHeader + .sectionBody { background: none; From 576e34fc7e2bee40fe5dd3aeafbf3b8397fa9aed Mon Sep 17 00:00:00 2001 From: Serg <64j@mail.ru> Date: Thu, 5 Apr 2018 03:04:21 +0300 Subject: [PATCH 156/274] revert commit 27b5a37 19b1f55 --- manager/media/style/default/css/tabpane.css | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/manager/media/style/default/css/tabpane.css b/manager/media/style/default/css/tabpane.css index 1d6fd38cd8..728e9fbe52 100755 --- a/manager/media/style/default/css/tabpane.css +++ b/manager/media/style/default/css/tabpane.css @@ -244,7 +244,7 @@ .tab-page .tab-section .tab-header:first-child, .tab-page .sectionHeader { - margin-top: 0; + margin-top: -1px; border-top: none } @@ -916,12 +916,6 @@ border: 1px solid #414449; } -.darkness .tab-page .tab-section .tab-header:first-child, -.darkness .tab-page .sectionHeader { - margin-top: 0; - border-top: none -} - .darkness .tab-page .tab-section, .darkness .tab-page .sectionHeader + .sectionBody { background: none; From 4eb2414d32039624b0eda4233a3e533afedd586a Mon Sep 17 00:00:00 2001 From: Serg <64j@mail.ru> Date: Thu, 5 Apr 2018 03:11:36 +0300 Subject: [PATCH 157/274] fix hover background-color mainMenu item version --- manager/media/style/default/css/mainmenu.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/manager/media/style/default/css/mainmenu.css b/manager/media/style/default/css/mainmenu.css index ab0dd5087b..c78f40f328 100755 --- a/manager/media/style/default/css/mainmenu.css +++ b/manager/media/style/default/css/mainmenu.css @@ -826,6 +826,9 @@ .darkness #mainMenu .nav > li > ul > li > span { color: #eee; } +#mainMenu .nav > li > ul > li > span:hover { + background-color: inherit; +} .darkness #mainMenu .nav li.item-group > * { background-color: transparent From f8f91e41a70e9963f282ef260cdc2194a97932ba Mon Sep 17 00:00:00 2001 From: Serg <64j@mail.ru> Date: Thu, 5 Apr 2018 03:19:06 +0300 Subject: [PATCH 158/274] fix pagination darkness theme --- manager/media/style/default/css/custom.css | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/manager/media/style/default/css/custom.css b/manager/media/style/default/css/custom.css index 4de8996ee1..4d346ecfef 100755 --- a/manager/media/style/default/css/custom.css +++ b/manager/media/style/default/css/custom.css @@ -2107,6 +2107,17 @@ ul.sortableList li.ghost { color: #3481bc; } +.darkness #pagination li a { + border: 1px solid #414449; + color: #bbb; +} + +.darkness #pagination li.currentPage a, +.darkness #pagination li a:hover { + color: #eee; + border: 1px solid #1976d2; +} + .darkness h2[style="color:#003399"], .darkness h3[style="color:#003399"] { color: #f44336 !important; From 74da26055c76c0cd417e8f99714397ba2cc98dc8 Mon Sep 17 00:00:00 2001 From: Serg <64j@mail.ru> Date: Thu, 5 Apr 2018 03:28:46 +0300 Subject: [PATCH 159/274] fix class input-group-addon --- manager/media/style/default/css/forms.css | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/manager/media/style/default/css/forms.css b/manager/media/style/default/css/forms.css index 9a5271c341..aea637a894 100755 --- a/manager/media/style/default/css/forms.css +++ b/manager/media/style/default/css/forms.css @@ -385,7 +385,8 @@ select::-ms-expand { .darkness .btn, .darkness button:not(.btn), .darkness input[type=button]:not(.btn), -.darkness input[type=submit]:not(.btn) { +.darkness input[type=submit]:not(.btn), +.darkness .input-group-addon { border-color: #414449; background-color: #202329; color: #bbb; @@ -399,7 +400,8 @@ select::-ms-expand { .darkness .btn:hover, .darkness input[type=button]:not(.btn):hover, -.darkness input[type=submit]:not(.btn):hover { +.darkness input[type=submit]:not(.btn):hover, +.darkness .input-group-addon:hover { border-color: #414449; background-color: #282c34; color: #eee; @@ -425,12 +427,7 @@ select::-ms-expand { .darkness .btn-secondary:active:hover, .darkness .open > .btn-secondary.dropdown-toggle.focus, .darkness .open > .btn-secondary.dropdown-toggle:focus, -.darkness .open > .btn-secondary.dropdown-toggle:hover { - border-color: #414449; - background-color: #1a1c21; - color: #eee; -} - +.darkness .open > .btn-secondary.dropdown-toggle:hover, .darkness .btn-secondary.focus, .darkness .btn-secondary:focus { border-color: #414449; From c2a4032d77ccbbfc527fc9d66088cea59da7998f Mon Sep 17 00:00:00 2001 From: Serg <64j@mail.ru> Date: Thu, 5 Apr 2018 03:40:03 +0300 Subject: [PATCH 160/274] fix logo page help --- manager/media/style/default/css/custom.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/media/style/default/css/custom.css b/manager/media/style/default/css/custom.css index 4d346ecfef..ac18a16d66 100755 --- a/manager/media/style/default/css/custom.css +++ b/manager/media/style/default/css/custom.css @@ -1579,7 +1579,7 @@ ul.sortableList li.ghost { padding: 1em; } -#helpPane #tab2Help img { +#helpPane .tab-page > img:first-of-type { margin-bottom: 1rem; } @@ -2049,7 +2049,7 @@ ul.sortableList li.ghost { margin: 0; } -.darkness #helpPane #tab2Help img { +.darkness #helpPane .tab-page > img:first-of-type { content: url("../images/misc/logo-navbar-white.png"); } From 3cf94bf7d40c65933208065dd265273d5ea78fd2 Mon Sep 17 00:00:00 2001 From: Serg <64j@mail.ru> Date: Thu, 5 Apr 2018 03:46:03 +0300 Subject: [PATCH 161/274] fix width auto for select size=1 --- manager/media/style/default/css/forms.css | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/manager/media/style/default/css/forms.css b/manager/media/style/default/css/forms.css index aea637a894..56a42072d7 100755 --- a/manager/media/style/default/css/forms.css +++ b/manager/media/style/default/css/forms.css @@ -313,6 +313,11 @@ select[size="1"] { background-size: 2em 1.3em } +select[size="1"]:not(.unstyled), +select[name="which_editor"] { +width: auto; +} + optgroup { font-style: normal; font-weight: 500; @@ -576,11 +581,6 @@ select::-ms-expand { background-repeat: no-repeat; } -.darkness select[size="1"]:not(.unstyled), -.darkness select[name="which_editor"] { - width: auto; -} - .darkness input:-webkit-autofill, .darkness textarea:-webkit-autofill, .darkness select:-webkit-autofill, From 0840e3a31d60bca47b35ac7734a7f260e97fa14f Mon Sep 17 00:00:00 2001 From: Serg <64j@mail.ru> Date: Thu, 5 Apr 2018 04:26:05 +0300 Subject: [PATCH 162/274] minify css default theme --- .../style/default/css/color.switcher.css | 411 +-- .../media/style/default/css/contextmenu.css | 113 +- manager/media/style/default/css/custom.css | 2927 +++-------------- manager/media/style/default/css/fonts.css | 572 +--- manager/media/style/default/css/forms.css | 681 +--- manager/media/style/default/css/index.css | 288 +- manager/media/style/default/css/layout.css | 180 +- manager/media/style/default/css/main.css | 1000 +----- manager/media/style/default/css/mainmenu.css | 979 +----- manager/media/style/default/css/tabpane.css | 1070 +----- manager/media/style/default/css/tree.css | 535 +-- 11 files changed, 1259 insertions(+), 7497 deletions(-) diff --git a/manager/media/style/default/css/color.switcher.css b/manager/media/style/default/css/color.switcher.css index 765bf0dff3..3405354bfd 100755 --- a/manager/media/style/default/css/color.switcher.css +++ b/manager/media/style/default/css/color.switcher.css @@ -1,358 +1,69 @@ -* { - margin: 0; - padding: 0; - box-sizing: border-box; -} - -.evocp-box { - position: fixed; - width: 300px; - min-height: 100%; - top: 35px; - right: -300px; - color: #444; - z-index: 10; - transition: 0.5s cubic-bezier(1, 1.48, 0.76, 0.95) right, box-shadow .5s; -} - -.evocp-icon { - position: absolute; - width: 34px; - height: 29px; - vertical-align: middle; - line-height: 28px; - left: -34px; - background: #fafafa; - box-shadow: -3px 0 2px 1px rgba(0, 0, 0, 0.1); - border-radius: 50% 0 0 50%; - text-align: center; - font-size: 17px; - cursor: pointer; - z-index: 10; - -webkit-animation: colorchange 15s infinite alternate; -} - -.dark .evocp-icon { - background: #2f323a; - border: 1px solid #2f323a; - border-right: 0; - -webkit-animation: colorchange 15s infinite alternate; -} - -i.evocpicon:hover { - -webkit-transform: rotate(30deg); - -moz-transform: rotate(30deg); - -ms-transform: rotate(30deg); - -o-transform: rotate(30deg); - transform: rotate(30deg); - -} - +* { margin: 0; padding: 0; box-sizing: border-box; } +.evocp-box { position: fixed; width: 300px; min-height: 100%; top: 35px; right: -300px; color: #444; z-index: 10; transition: 0.5s cubic-bezier(1, 1.48, 0.76, 0.95) right, box-shadow .5s; } +.evocp-icon { position: absolute; width: 34px; height: 29px; vertical-align: middle; line-height: 28px; left: -34px; background: #fafafa; box-shadow: -3px 0 2px 1px rgba(0, 0, 0, 0.1); border-radius: 50% 0 0 50%; text-align: center; font-size: 17px; cursor: pointer; z-index: 10; -webkit-animation: colorchange 15s infinite alternate; } +.dark .evocp-icon { background: #2f323a; border: 1px solid #2f323a; border-right: 0; -webkit-animation: colorchange 15s infinite alternate; } +i.evocpicon:hover { -webkit-transform: rotate(30deg); -moz-transform: rotate(30deg); -ms-transform: rotate(30deg); -o-transform: rotate(30deg); transform: rotate(30deg); } @keyframes colorchange { - 0% { - color: #b45f06; - } - 10% { - color: #38761d; - } - 20% { - color: #134f5c; - } - 30% { - color: #0b5394; - } - 40% { - color: #351c75; - } - 50% { - color: #741b47; - } - 60% { - color: blue; - } - 70% { - color: #2980b9; - } - 80% { - color: #f1c40f; - } - 90% { - color: #2980b9; - } - 100% { - color: #900; - } -} - -@-webkit-keyframes colorchange -/* Safari and Chrome - necessary duplicate */ - - { - 0% { - color: #b45f06; - } - 10% { - color: #38761d; - } - 20% { - color: #134f5c; - } - 30% { - color: #0b5394; - } - 40% { - color: #351c75; - } - 50% { - color: #741b47; - } - 60% { - color: blue; - } - 70% { - color: #2980b9; - } - 80% { - color: #f1c40f; - } - 90% { - color: #2980b9; - } - 100% { - color: #900; - } -} - -.evocp-box .evocp-frame { - position: absolute; - width: 100%; - height: 100%; - top: 0; - right: 0; - background: #fafafa; - text-align: center; - font-weight: 700; - color: #444; - padding: 0 0 20px 0; -} - -.dark .evocp-box .evocp-frame { - color: #dedede; - background: #202329; - border-top: 1px solid #2f323a; -} - -.evocp-box .evocp-menuHColors, -.evocp-box .evocp-menuColors, -.evocp-box .evocp-bgmcolors, -.evocp-box .evocp-colors, -.evocp-box .evocp-alinkcolors { - margin: 10px; - overflow: hidden; -} - -.evocp-box .evocp-menuHColor, -.evocp-box .evocp-menuColor, -.evocp-box .evocp-bgmcolor, -.evocp-box .evocp-color, -.evocp-box .evocp-alinkcolor { - position: relative; - float: left; - margin: 2px; - height: 31px; - width: 31px; - max-height: 31px; - max-width: 31px; - background: #2f323a; - color: transparent; - overflow: hidden; - cursor: pointer; - border: 1px solid #646b7b; - border-radius: 50%; -} - -.evocp-box .evocp-custom-colors, -.evocp-box .evocp-custom-colors { - clear: both; - padding-top: 20px; -} - -.evocp-box input[name="evocpCustomalinkcolor"], -.evocp-box input[name="evocpCustommenuColor"], -.evocp-box input[name="evocpCustommenuHColor"], -.evocp-box input[name="evocpCustombgmColor"], -.evocp-box input[name="evocpCustomTXColor"] { - margin: 10px 0 0 -4px; - cursor: pointer; - height: 30px; - width: 30px; - border-radius: 50%; - border: none; - outline: none; - background: transparent; - padding: 0; -} - -.appear-it { - right: 0; - box-shadow: -3px 0 4px 1px rgba(0, 0, 0, 0.1); -} - -.evocp-frame h2 { - font-size: 1.0rem; - line-height: 1.6rem; - border-bottom: 1px solid #dedede; - padding-top: 4px; - /* -webkit-animation: colorchange 20s infinite alternate;*/ -} - -.dark .evocp-frame h2 { - background-color: #2f323a; - border-bottom: 1px solid #dedede; -} - -.evocp-frame .panel-heading h3 { - cursor: pointer; - display: inline-block; - font-size: 0.8rem; - line-height: 1.1rem; - margin-top: 9px; -} - -.evocp-frame .panel-heading h3:hover { - color: #000; -} - -.dark .evocp-frame h3:hover { - color: #fff; -} - -.evocp-frame .panel { - margin-bottom: 2px; -} - -.evocp-frame .panel-heading { - text-align: left; - border-top: 1px solid #dedede; - border-bottom: 1px solid #dedede; - background-color: #f2f2f2; - padding: 0 0 0 8px; - text-transform: uppercase; -} - -.dark .evocp-frame .panel-heading { - background-color: #2f323a; - border-color: #3e4144; -} - -.evocp-frame .panel-heading .btn { - margin-top: 2px -} - -.dark .evocp-frame .panel-heading .btn { - background-color: #2f323a; - border-color: #3e4144; - color: #fafafa; -} - -.dark .evocp-frame .panel-heading .btn:hover { - background-color: #1a1c21; -} - -.dark .evocp-frame h2 { - border-color: #3e4144; -} - -.evocp-frame .panel-heading .togglearrow { - width: 10px; - font-size: 10px; - color: #bbb; - margin-right: 2px; - margin-top: -5px; -} - -.evocp-box .evocp-menuHColor.colorSelected:before, -.evocp-box .evocp-menuColor.colorSelected:before, -.evocp-box .evocp-bgmcolor.colorSelected:before, -.evocp-box .evocp-color.colorSelected:before, -.evocp-box .evocp-alinkcolor.colorSelected:before { - font-family: FontAwesome; - content: "\f1fc"; - display: inline-block; - padding-top: 3px; - vertical-align: middle; - color: #FFF; -} - -.evocp-box .evocp-menuHColor.evocp_light.colorSelected:before, -.evocp-box .evocp-menuColor.evocp_light.colorSelected:before, -.evocp-box .evocp-bgmcolor.evocp_light.colorSelected:before, -.evocp-box .evocp-color.evocp_light.colorSelected:before, -.evocp-box .evocp-alinkcolor.evocp_light.colorSelected:before { - color: #444!important; -} - -.dark .evocp-box .btn-secondary { - background-color: #2f323a; - border-color: #3e4144; - color: #fafafa; -} - +0% { color: #b45f06; } +10% { color: #38761d; } +20% { color: #134f5c; } +30% { color: #0b5394; } +40% { color: #351c75; } +50% { color: #741b47; } +60% { color: blue; } +70% { color: #2980b9; } +80% { color: #f1c40f; } +90% { color: #2980b9; } +100% { color: #900;} +} +@-webkit-keyframes colorchange /* Safari and Chrome - necessary duplicate */ { +0% { color: #b45f06; } +10% { color: #38761d; } +20% { color: #134f5c; } +30% { color: #0b5394; } +40% { color: #351c75; } +50% { color: #741b47; } +60% { color: blue; } +70% { color: #2980b9; } +80% { color: #f1c40f; } +90% { color: #2980b9; } +100% { color: #900; } +} +.evocp-box .evocp-frame { position: absolute; width: 100%; height: 100%; top: 0; right: 0; background: #fafafa; text-align: center; font-weight: 700; color: #444; padding: 0 0 20px 0; } +.dark .evocp-box .evocp-frame { color: #dedede; background: #202329; border-top: 1px solid #2f323a; } +.evocp-box .evocp-menuHColors, .evocp-box .evocp-menuColors, .evocp-box .evocp-bgmcolors, .evocp-box .evocp-colors, .evocp-box .evocp-alinkcolors { margin: 10px; overflow: hidden; } +.evocp-box .evocp-menuHColor, .evocp-box .evocp-menuColor, .evocp-box .evocp-bgmcolor, .evocp-box .evocp-color, .evocp-box .evocp-alinkcolor { position: relative; float: left; margin: 2px; height: 31px; width: 31px; max-height: 31px; max-width: 31px; background: #2f323a; color: transparent; overflow: hidden; cursor: pointer; border: 1px solid #646b7b; border-radius: 50%; } +.evocp-box .evocp-custom-colors, .evocp-box .evocp-custom-colors { clear: both; padding-top: 20px; } +.evocp-box input[name="evocpCustomalinkcolor"], .evocp-box input[name="evocpCustommenuColor"], .evocp-box input[name="evocpCustommenuHColor"], .evocp-box input[name="evocpCustombgmColor"], .evocp-box input[name="evocpCustomTXColor"] { margin: 10px 0 0 -4px; cursor: pointer; height: 30px; width: 30px; border-radius: 50%; border: none; outline: none; background: transparent; padding: 0; } +.appear-it { right: 0; box-shadow: -3px 0 4px 1px rgba(0, 0, 0, 0.1); } +.evocp-frame h2 { font-size: 1.0rem; line-height: 1.6rem; border-bottom: 1px solid #dedede; padding-top: 4px; /* -webkit-animation: colorchange 20s infinite alternate;*/ } +.dark .evocp-frame h2 { background-color: #2f323a; border-bottom: 1px solid #dedede; } +.evocp-frame .panel-heading h3 { cursor: pointer; display: inline-block; font-size: 0.8rem; line-height: 1.1rem; margin-top: 9px; } +.evocp-frame .panel-heading h3:hover { color: #000; } +.dark .evocp-frame h3:hover { color: #fff; } +.evocp-frame .panel { margin-bottom: 2px; } +.evocp-frame .panel-heading { text-align: left; border-top: 1px solid #dedede; border-bottom: 1px solid #dedede; background-color: #f2f2f2; padding: 0 0 0 8px; text-transform: uppercase; } +.dark .evocp-frame .panel-heading { background-color: #2f323a; border-color: #3e4144; } +.evocp-frame .panel-heading .btn { margin-top: 2px } +.dark .evocp-frame .panel-heading .btn { background-color: #2f323a; border-color: #3e4144; color: #fafafa; } +.dark .evocp-frame .panel-heading .btn:hover { background-color: #1a1c21; } +.dark .evocp-frame h2 { border-color: #3e4144; } +.evocp-frame .panel-heading .togglearrow { width: 10px; font-size: 10px; color: #bbb; margin-right: 2px; margin-top: -5px; } +.evocp-box .evocp-menuHColor.colorSelected:before, .evocp-box .evocp-menuColor.colorSelected:before, .evocp-box .evocp-bgmcolor.colorSelected:before, .evocp-box .evocp-color.colorSelected:before, .evocp-box .evocp-alinkcolor.colorSelected:before { font-family: FontAwesome; content: "\f1fc"; display: inline-block; padding-top: 3px; vertical-align: middle; color: #fff; } +.evocp-box .evocp-menuHColor.evocp_light.colorSelected:before, .evocp-box .evocp-menuColor.evocp_light.colorSelected:before, .evocp-box .evocp-bgmcolor.evocp_light.colorSelected:before, .evocp-box .evocp-color.evocp_light.colorSelected:before, .evocp-box .evocp-alinkcolor.evocp_light.colorSelected:before { color: #444 !important; } +.dark .evocp-box .btn-secondary { background-color: #2f323a; border-color: #3e4144; color: #fafafa; } /*fix for mainmenu*/ - /* #mainMenu.show .nav > li.dropdown.hover > a { background-color: #fff; color: #666!important; } /* color picker*/ - -.sp-picker-container { - width: 200px; - border-left: 0!important; -} - -.sp-container { - width: 300px; - background: #f2f2f2; - border: 1px solid #dedede; -} - -.dark .sp-container { - background: #2f323a; - border: 1px solid #3e4144; -} - -.evo-cp-replacer, -.sp-replacer.sp-light { - padding: 2px; - background: #f2f2f2; - border-color: #dedede; - margin: 3px auto; -} - -.dark .evo-cp-replacer, -.dark .sp-replacer.sp-light { - background: #2f323a; - border-color: #3e4144; -} - -.sp-dd { - margin-top: 4px; - color: #666; -} - -.dark .sp-dd { - color: #bcbec0; -} - -.sp-preview { - height: 25px; - width: 25px; - max-height: 25px; - max-width: 25px; - overflow: hidden; - cursor: pointer; - border-radius: 50%; - border: 0px solid #2f323a; -} +.sp-picker-container { width: 200px; border-left: 0 !important; } +.sp-container { width: 300px; background: #f2f2f2; border: 1px solid #dedede; } +.dark .sp-container { background: #2f323a; border: 1px solid #3e4144; } +.evo-cp-replacer, .sp-replacer.sp-light { padding: 2px; background: #f2f2f2; border-color: #dedede; margin: 3px auto; } +.dark .evo-cp-replacer, .dark .sp-replacer.sp-light { background: #2f323a; border-color: #3e4144; } +.sp-dd { margin-top: 4px; color: #666; } +.dark .sp-dd { color: #bcbec0; } +.sp-preview { height: 25px; width: 25px; max-height: 25px; max-width: 25px; overflow: hidden; cursor: pointer; border-radius: 50%; border: 0px solid #2f323a; } diff --git a/manager/media/style/default/css/contextmenu.css b/manager/media/style/default/css/contextmenu.css index 34c539cd08..1148c979fb 100755 --- a/manager/media/style/default/css/contextmenu.css +++ b/manager/media/style/default/css/contextmenu.css @@ -1,105 +1,14 @@ /* contextmenu */ - -#mx_contextmenu, -#contextmenu, -.nu-context-menu, -.contextMenu { - display: block !important; - position: absolute; - overflow: hidden; - top: 0; - max-width: 25rem; - width: auto !important; - height: auto; - padding: 0.25rem 0; - visibility: hidden; - opacity: 0; - z-index: 10000; - background: #fff; - font-size: 0.9em; - border: none; - border-radius: 0.25rem; - -webkit-box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); - box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); - transition: opacity 0s, visibility 0s; - transform: translateZ(0) -} - -#mx_contextmenu .fa, -#contextmenu .fa, -.nu-context-menu .fa, -.contextMenu .fa { - width: 1.3em; - font-size: 0.9rem; - text-align: center; -} - -#mx_contextmenu.show, -#contextmenu.show, -.nu-context-menu.active, -.contextMenu { - visibility: visible; - opacity: 1; - transition: opacity 0.1s, visibility 0.1s; -} - -#mx_contextmenu > div, -#contextmenu > div, -.nu-context-menu ul li, -.contextMenu > div { - padding: 0.5em 2em 0.5em 1em; -} - -#mx_contextmenu #nameHolder, -#contextmenu .menuHeader, -.nu-context-menu-title { - color: #1377c5; - padding: 0.75em 1em; -} - -#mx_contextmenu .menuLink, -#contextmenu .menuLink, -.nu-context-menu ul li, -.contextMenu > div { - cursor: pointer; -} - -#mx_contextmenu .menuLink:hover, -#contextmenu .menuLink:hover, -.nu-context-menu ul li:hover, -.contextMenu > div:hover { - background-color: #1976d2; - color: #fff; -} - -#mx_contextmenu .seperator, -#contextmenu .seperator, -.nu-context-menu ul hr, -.contextMenu .cntxMnuSeparator { - height: 1px; - background-color: rgba(0, 0, 0, 0.07) !important; - margin: 0.25em 0; - padding: 0; - cursor: default; -} - -.nu-context-menu ul { - margin: 0; - padding: 0; -} - -.contextMenu .cntxMnuItem { - white-space: nowrap -} - +#mx_contextmenu, #contextmenu, .nu-context-menu, .contextMenu { display: block !important; position: absolute; overflow: hidden; top: 0; max-width: 25rem; width: auto !important; height: auto; padding: 0.25rem 0; visibility: hidden; opacity: 0; z-index: 10000; background: #fff; font-size: 0.9em; border: none; border-radius: 0.25rem; -webkit-box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); transition: opacity 0s, visibility 0s; transform: translateZ(0) } +#mx_contextmenu .fa, #contextmenu .fa, .nu-context-menu .fa, .contextMenu .fa { width: 1.3em; font-size: 0.9rem; text-align: center; } +#mx_contextmenu.show, #contextmenu.show, .nu-context-menu.active, .contextMenu { visibility: visible; opacity: 1; transition: opacity 0.1s, visibility 0.1s; } +#mx_contextmenu > div, #contextmenu > div, .nu-context-menu ul li, .contextMenu > div { padding: 0.5em 2em 0.5em 1em; } +#mx_contextmenu #nameHolder, #contextmenu .menuHeader, .nu-context-menu-title { color: #1377c5; padding: 0.75em 1em; } +#mx_contextmenu .menuLink, #contextmenu .menuLink, .nu-context-menu ul li, .contextMenu > div { cursor: pointer; } +#mx_contextmenu .menuLink:hover, #contextmenu .menuLink:hover, .nu-context-menu ul li:hover, .contextMenu > div:hover { background-color: #1976d2; color: #fff; } +#mx_contextmenu .seperator, #contextmenu .seperator, .nu-context-menu ul hr, .contextMenu .cntxMnuSeparator { height: 1px; background-color: rgba(0, 0, 0, 0.07) !important; margin: 0.25em 0; padding: 0; cursor: default; } +.nu-context-menu ul { margin: 0; padding: 0; } +.contextMenu .cntxMnuItem { white-space: nowrap } /* modes theme */ - /* darkness */ - -.darkness #mx_contextmenu, -.darkness #contextmenu, -.darkness .nu-context-menu, -.darkness .contextMenu { - background-color: #343942; - color: inherit; -} +.darkness #mx_contextmenu, .darkness #contextmenu, .darkness .nu-context-menu, .darkness .contextMenu { background-color: #343942; color: inherit; } diff --git a/manager/media/style/default/css/custom.css b/manager/media/style/default/css/custom.css index ac18a16d66..838ad6d52d 100755 --- a/manager/media/style/default/css/custom.css +++ b/manager/media/style/default/css/custom.css @@ -1,2573 +1,496 @@ /* [ COLS ] */ - -.row { - margin-left: -1.25rem; - margin-right: -1.25rem -} - -.container { - padding-left: 1.25rem; - padding-right: 1.25rem; - width: 100% -} - +.row { margin-left: -1.25rem; margin-right: -1.25rem } +.container { padding-left: 1.25rem; padding-right: 1.25rem; width: 100% } /* :TODO .container-body need remove and replace .tab-content */ - -.container-body { - padding: 1.25rem -} - +.container-body { padding: 1.25rem } /* [ FORMS ] */ - -.form-row { - margin-bottom: 0.25rem; -} - -.form-row.row { - margin-left: 0; - margin-right: -1rem -} - -.form-row label { - margin-bottom: 0.15rem -} - -.form-row .col, -.form-row .col-1, -.form-row .col-10, -.form-row .col-11, -.form-row .col-12, -.form-row .col-2, -.form-row .col-3, -.form-row .col-4, -.form-row .col-5, -.form-row .col-6, -.form-row .col-7, -.form-row .col-8, -.form-row .col-9, -.form-row .col-lg, -.form-row .col-lg-1, -.form-row .col-lg-10, -.form-row .col-lg-11, -.form-row .col-lg-12, -.form-row .col-lg-2, -.form-row .col-lg-3, -.form-row .col-lg-4, -.form-row .col-lg-5, -.form-row .col-lg-6, -.form-row .col-lg-7, -.form-row .col-lg-8, -.form-row .col-lg-9, -.form-row .col-md, -.form-row .col-md-1, -.form-row .col-md-10, -.form-row .col-md-11, -.form-row .col-md-12, -.form-row .col-md-2, -.form-row .col-md-3, -.form-row .col-md-4, -.form-row .col-md-5, -.form-row .col-md-6, -.form-row .col-md-7, -.form-row .col-md-8, -.form-row .col-md-9, -.form-row .col-sm, -.form-row .col-sm-1, -.form-row .col-sm-10, -.form-row .col-sm-11, -.form-row .col-sm-12, -.form-row .col-sm-2, -.form-row .col-sm-3, -.form-row .col-sm-4, -.form-row .col-sm-5, -.form-row .col-sm-6, -.form-row .col-sm-7, -.form-row .col-sm-8, -.form-row .col-sm-9, -.form-row .col-xl, -.form-row .col-xl-1, -.form-row .col-xl-10, -.form-row .col-xl-11, -.form-row .col-xl-12, -.form-row .col-xl-2, -.form-row .col-xl-3, -.form-row .col-xl-4, -.form-row .col-xl-5, -.form-row .col-xl-6, -.form-row .col-xl-7, -.form-row .col-xl-8, -.form-row .col-xl-9, -.form-row .col-xs, -.form-row .col-xs-1, -.form-row .col-xs-10, -.form-row .col-xs-11, -.form-row .col-xs-12, -.form-row .col-xs-2, -.form-row .col-xs-3, -.form-row .col-xs-4, -.form-row .col-xs-5, -.form-row .col-xs-6, -.form-row .col-xs-7, -.form-row .col-xs-8, -.form-row .col-xs-9 { - padding-left: 0 -} - -.form-row .form-control { - float: left; -} - -.form-inline .form-row .form-control { - float: none; -} - -.container-body > .form-group:last-child, -.container-body > .form-row:last-child, -.container-body > p:last-child, -.container-body > .form-group:last-child > p:last-child { - margin-bottom: 0 -} - -.form-control-name { - position: relative; -} - -.form-control-name .form-control { - padding-right: 2em -} - -.form-control-name .custom-control { - display: block; - overflow: hidden; - position: absolute; - z-index: 3; - top: 0; - right: 0; - width: 2em; - height: 100%; - margin: 0; - padding: 0; - cursor: pointer -} - -.form-control-name .custom-control input { - position: absolute; - left: -100% -} - -.form-control-name .custom-control .fa-lock { - margin-top: 0.6em; - font-size: 1.5em -} - -.form-control-name .custom-control .fa-lock::before { - content: "\f09c"; - color: #ddd -} - -.form-control-name .custom-control input:checked ~ .fa-lock::before { - content: "\f023"; - color: #d9534f -} - -input[type=date]:not(.unstyled), -input[name*=date]:not(.unstyled):not([type=checkbox]):not([type=radio]), -input[name=createdon], -input[name=editedon], -input[size="1"], -select[name=usergroup]:not(.unstyled), -select[name=docgroup]:not(.unstyled) { - width: auto !important; - vertical-align: middle -} - -select[size="1"]:not(.unstyled) { - vertical-align: middle -} - -input[name*=date]:not(.unstyled) + .input-group-addon { - float: left; - width: auto; -} - -input[size="50"], -select[size="50"] { - width: 10rem !important -} - -select[name=usergroup], -select[name=docgroup] { - margin: 0 0.5em; -} - -select[name=docgroup] + input[type=submit] { - float: none; - margin: 0; -} - -#settingsPane #filemanager_path, -#settingsPane #rb_base_dir, -#settingsPane input[name=txt_custom_contenttype] { - border-top-right-radius: 0; - border-bottom-right-radius: 0 -} - -#settingsPane #filemanager_path + input[name=reset_filemanager_path], -#settingsPane #rb_base_dir + input[name=reset_rb_base_dir], -#settingsPane input[name=txt_custom_contenttype] + input[type=button], -input[name=photo] + input[type=button], -#range input#pids + input[name=fsubmit], -input[name="ta"].inputBox + input[type=button], -input[name="ta"].inputBox + .CodeMirror + input[type=button], -#documentPane input[name^=tv]:not([class*=mtv]) + input[type=button] { - z-index: 5; - float: right; - margin-top: -2.30769em; - width: auto !important; - border-top-left-radius: 0; - border-bottom-left-radius: 0 -} - -#settingsPane [name=site_name], -#settingsPane [name=txt_custom_contenttype], -#settingsPane [name=filemanager_path], -#settingsPane [name=rb_base_dir], -input[name=photo], -#range input#pids, -input[maxlength="350"], -textarea.mce, -#editorRow_TinyMCE { - width: 100% !important -} - -#range::after { - content: ""; - display: table; - width: 100% -} - +.form-row { margin-bottom: 0.25rem; } +.form-row.row { margin-left: 0; margin-right: -1rem } +.form-row label { margin-bottom: 0.15rem } +.form-row .col, .form-row .col-1, .form-row .col-10, .form-row .col-11, .form-row .col-12, .form-row .col-2, .form-row .col-3, .form-row .col-4, .form-row .col-5, .form-row .col-6, .form-row .col-7, .form-row .col-8, .form-row .col-9, .form-row .col-lg, .form-row .col-lg-1, .form-row .col-lg-10, .form-row .col-lg-11, .form-row .col-lg-12, .form-row .col-lg-2, .form-row .col-lg-3, .form-row .col-lg-4, .form-row .col-lg-5, .form-row .col-lg-6, .form-row .col-lg-7, .form-row .col-lg-8, .form-row .col-lg-9, .form-row .col-md, .form-row .col-md-1, .form-row .col-md-10, .form-row .col-md-11, .form-row .col-md-12, .form-row .col-md-2, .form-row .col-md-3, .form-row .col-md-4, .form-row .col-md-5, .form-row .col-md-6, .form-row .col-md-7, .form-row .col-md-8, .form-row .col-md-9, .form-row .col-sm, .form-row .col-sm-1, .form-row .col-sm-10, .form-row .col-sm-11, .form-row .col-sm-12, .form-row .col-sm-2, .form-row .col-sm-3, .form-row .col-sm-4, .form-row .col-sm-5, .form-row .col-sm-6, .form-row .col-sm-7, .form-row .col-sm-8, .form-row .col-sm-9, .form-row .col-xl, .form-row .col-xl-1, .form-row .col-xl-10, .form-row .col-xl-11, .form-row .col-xl-12, .form-row .col-xl-2, .form-row .col-xl-3, .form-row .col-xl-4, .form-row .col-xl-5, .form-row .col-xl-6, .form-row .col-xl-7, .form-row .col-xl-8, .form-row .col-xl-9, .form-row .col-xs, .form-row .col-xs-1, .form-row .col-xs-10, .form-row .col-xs-11, .form-row .col-xs-12, .form-row .col-xs-2, .form-row .col-xs-3, .form-row .col-xs-4, .form-row .col-xs-5, .form-row .col-xs-6, .form-row .col-xs-7, .form-row .col-xs-8, .form-row .col-xs-9 { padding-left: 0 } +.form-row .form-control { float: left; } +.form-inline .form-row .form-control { float: none; } +.container-body > .form-group:last-child, .container-body > .form-row:last-child, .container-body > p:last-child, .container-body > .form-group:last-child > p:last-child { margin-bottom: 0 } +.form-control-name { position: relative; } +.form-control-name .form-control { padding-right: 2em } +.form-control-name .custom-control { display: block; overflow: hidden; position: absolute; z-index: 3; top: 0; right: 0; width: 2em; height: 100%; margin: 0; padding: 0; cursor: pointer } +.form-control-name .custom-control input { position: absolute; left: -100% } +.form-control-name .custom-control .fa-lock { margin-top: 0.6em; font-size: 1.5em } +.form-control-name .custom-control .fa-lock::before { content: "\f09c"; color: #ddd } +.form-control-name .custom-control input:checked ~ .fa-lock::before { content: "\f023"; color: #d9534f } +input[type=date]:not(.unstyled), input[name*=date]:not(.unstyled):not([type=checkbox]):not([type=radio]), input[name=createdon], input[name=editedon], input[size="1"], select[name=usergroup]:not(.unstyled), select[name=docgroup]:not(.unstyled) { width: auto !important; vertical-align: middle } +select[size="1"]:not(.unstyled) { vertical-align: middle } +input[name*=date]:not(.unstyled) + .input-group-addon { float: left; width: auto; } +input[size="50"], select[size="50"] { width: 10rem !important } +select[name=usergroup], select[name=docgroup] { margin: 0 0.5em; } +select[name=docgroup] + input[type=submit] { float: none; margin: 0; } +#settingsPane #filemanager_path, #settingsPane #rb_base_dir, #settingsPane input[name=txt_custom_contenttype] { border-top-right-radius: 0; border-bottom-right-radius: 0 } +#settingsPane #filemanager_path + input[name=reset_filemanager_path], #settingsPane #rb_base_dir + input[name=reset_rb_base_dir], #settingsPane input[name=txt_custom_contenttype] + input[type=button], input[name=photo] + input[type=button], #range input#pids + input[name=fsubmit], input[name="ta"].inputBox + input[type=button], input[name="ta"].inputBox + .CodeMirror + input[type=button], #documentPane input[name^=tv]:not([class*=mtv]) + input[type=button] { z-index: 5; float: right; margin-top: -2.30769em; width: auto !important; border-top-left-radius: 0; border-bottom-left-radius: 0 } +#settingsPane [name=site_name], #settingsPane [name=txt_custom_contenttype], #settingsPane [name=filemanager_path], #settingsPane [name=rb_base_dir], input[name=photo], #range input#pids, input[maxlength="350"], textarea.mce, #editorRow_TinyMCE { width: 100% !important } +#range::after { content: ""; display: table; width: 100% } /* [ Editor ] */ - .navbar.navbar-editor { - padding: .5rem 1.25rem; - border-radius: 0 -} - -.navbar-editor > label { - margin-bottom: 0 -} - -.section-editor textarea { - float: left; - border-left: none; - border-right: none; - font-family: 'Inconsolata', 'Monaco', 'Consolas', 'Courier New', 'Courier', monospace; - font-weight: 300; - font-size: 0.875rem; -} - +padding: .5rem 1.25rem; border-radius: 0 } +.navbar-editor > label { margin-bottom: 0 } +.section-editor textarea { float: left; border-left: none; border-right: none; font-family: 'Inconsolata', 'Monaco', 'Consolas', 'Courier New', 'Courier', monospace; font-weight: 300; font-size: 0.875rem; } /* [ Action Buttons ] */ - /* new style */ - -#actions { - background: rgba(199, 199, 199, 0.25); - padding: 0.5rem; - position: fixed; - top: 0; - right: 1rem; - text-align: right; - z-index: 1001; - border-radius: 0 0 0.3rem 0.3rem; -} - -#actions .btn-group { - margin: 0 -} - -#actions .btn-group > .btn-group { - display: block -} - -#actions .btn-group .btn, -#actions .btn-group .form-control { - font-size: .6772rem; - height: 2.4em; - line-height: 1.4 -} - -#actions .btn-group .btn .fa, -#_actions .btn-group .btn .fa { - display: none; - width: 1em; - font-size: 1em; - text-align: center -} - -#actions .btn-group .btn-group #Button1 { - min-width: 100%; - text-align: left; - float: right; -} - -#actions .btn-group .btn-success { - box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .07); -} - -#actions .btn-group .btn-success:hover { - box-shadow: none -} - -#actions .btn-group .plus { - z-index: 2; - float: right; - margin: -2.4em 0 0 0; - width: 2rem; - padding-left: 0; - padding-right: 0; - text-align: center; - cursor: default; -} - -#actions .btn-group .plus::before { - content: "\f107"; - font-family: FontAwesome -} - -#actions .btn-group .show .plus::before { - content: "\f106"; -} - -#actions .btn-group select#stay { - display: block; - position: relative; - z-index: -1; - clear: both; - width: auto; - height: 0; - margin: -100% 0 -2rem 0; - font-size: 0.675rem; - opacity: 0; - visibility: hidden; -} - -#actions .btn-group .dropdown-menu { - display: none; - position: absolute; - z-index: -1; - left: auto; - right: 0; - top: 100%; - width: 100%; - min-width: 2rem; - margin: 0; - padding: 0; - text-align: left; - font-size: .6772rem; - border-top: none; - border-radius: 0 0 0.1em 0.1em; - overflow: hidden; -} - -#actions .btn-group .show > .dropdown-menu { - display: block -} - -#actions .btn-group .dropdown-menu > span { - display: block; - margin: 0; - text-align: left; - border: none; - border-top: 1px solid rgba(0, 0, 0, 0.1) -} - -#actions .btn-group .dropdown-menu > span:first-child { - border-color: transparent -} - -#actions .btn-group .dropdown-menu > span:hover { - background-color: #e6e6e6; -} - -#actions .btn-group .dropdown-toggle::after { - margin: 0; - border-width: 0.4em; - transition-duration: 0.25s -} - -#actions .btn-group .show .dropdown-toggle::after { - transform: rotate(180deg) -} - -#_actions .btn-group .input-group-btn .btn { - margin-left: .1875rem -} - -#_actions .btn-group .form-control, -#_actions .btn-group .btn { - border-radius: .1em -} - +#actions { background: rgba(199, 199, 199, 0.25); padding: 0.5rem; position: fixed; top: 0; right: 1rem; text-align: right; z-index: 1001; border-radius: 0 0 0.3rem 0.3rem; } +#actions .btn-group { margin: 0 } +#actions .btn-group > .btn-group { display: block } +#actions .btn-group .btn, #actions .btn-group .form-control { +font-size: .6772rem; height: 2.4em; line-height: 1.4 } +#actions .btn-group .btn .fa, #_actions .btn-group .btn .fa { display: none; width: 1em; font-size: 1em; text-align: center } +#actions .btn-group .btn-group #Button1 { min-width: 100%; text-align: left; float: right; } +#actions .btn-group .btn-success { box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .07); } +#actions .btn-group .btn-success:hover { box-shadow: none } +#actions .btn-group .plus { z-index: 2; float: right; margin: -2.4em 0 0 0; width: 2rem; padding-left: 0; padding-right: 0; text-align: center; cursor: default; } +#actions .btn-group .plus::before { content: "\f107"; font-family: FontAwesome } +#actions .btn-group .show .plus::before { content: "\f106"; } +#actions .btn-group select#stay { display: block; position: relative; z-index: -1; clear: both; width: auto; height: 0; margin: -100% 0 -2rem 0; font-size: 0.675rem; opacity: 0; visibility: hidden; } +#actions .btn-group .dropdown-menu { display: none; position: absolute; z-index: -1; left: auto; right: 0; top: 100%; width: 100%; min-width: 2rem; margin: 0; padding: 0; text-align: left; font-size: .6772rem; +border-top: none; border-radius: 0 0 0.1em 0.1em; overflow: hidden; } +#actions .btn-group .show > .dropdown-menu { display: block } +#actions .btn-group .dropdown-menu > span { display: block; margin: 0; text-align: left; border: none; border-top: 1px solid rgba(0, 0, 0, 0.1) } +#actions .btn-group .dropdown-menu > span:first-child { border-color: transparent } +#actions .btn-group .dropdown-menu > span:hover { background-color: #e6e6e6; } +#actions .btn-group .dropdown-toggle::after { margin: 0; border-width: 0.4em; transition-duration: 0.25s } +#actions .btn-group .show .dropdown-toggle::after { transform: rotate(180deg) } +#_actions .btn-group .input-group-btn .btn { margin-left: .1875rem } +#_actions .btn-group .form-control, #_actions .btn-group .btn { border-radius: .1em } @media (max-width: 840px) { - #actions { - right: 0 - } - #actions .btn-group .btn span, - #actions .btn-group select#stay, - #_actions .btn-group .btn span { - display: none - } - #actions .btn-group .btn .fa, - #_actions .btn-group .btn .fa { - display: inline-block - } - #actions .btn-group .dropdown-menu { - width: 2rem - } - #actions .btn-group .dropdown-menu span { - padding-left: 0; - padding-right: 0; - text-align: center - } - #_actions .btn-group .input-group-btn .btn { - margin-left: -1px - } - #_actions .btn-group .form-control, - #_actions .btn-group .btn { - border-radius: 0 - } - #_actions .btn-group .form-control:first-child { - border-top-left-radius: .1em; - border-bottom-left-radius: .1em; - } - #_actions .btn-group .btn:last-child { - border-top-right-radius: .1em; - border-bottom-right-radius: .1em; - } +#actions { right: 0 } +#actions .btn-group .btn span, #actions .btn-group select#stay, #_actions .btn-group .btn span { display: none } +#actions .btn-group .btn .fa, #_actions .btn-group .btn .fa { display: inline-block } +#actions .btn-group .dropdown-menu { width: 2rem } +#actions .btn-group .dropdown-menu span { padding-left: 0; padding-right: 0; text-align: center } +#_actions .btn-group .input-group-btn .btn { margin-left: -1px } +#_actions .btn-group .form-control, #_actions .btn-group .btn { border-radius: 0 } +#_actions .btn-group .form-control:first-child { border-top-left-radius: .1em; border-bottom-left-radius: .1em; } +#_actions .btn-group .btn:last-child { border-top-right-radius: .1em; border-bottom-right-radius: .1em; } } - /* old style */ - -#actions .actionButtons { - float: left; - min-height: 32px -} - -#actions .actionButtons li { - position: relative; - float: left; - margin-right: 3px; - border: none -} - -#actions .actionButtons li a, -#actions .actionButtons .plus { - float: left; - padding: 0 10px !important; - height: 32px; - line-height: 30px; - -webkit-user-select: none; - user-select: none; -} - -#actions .actionButtons li:last-child { - margin: 0 -} - -#actions .actionButtons #Button1 a { - width: 100%; - text-align: left; -} - -#actions .actionButtons .plus { - overflow: hidden; - float: right; - margin: -32px 0 0 0; - width: 35px; - border-radius: 0 3px 3px 0 !important; - text-align: center; - cursor: default; - font: normal normal normal 0/30px FontAwesome -} - -#actions .actionButtons .plus::before { - content: "\f107"; - font-size: 14px -} - -#actions .actionButtons .show .plus::before { - content: "\f106"; -} - -#actions .actionButtons .dropdown-menu { - display: none; - position: absolute; - z-index: -1; - left: auto; - right: 0; - top: 100%; - width: 100%; - min-width: 35px; - margin: -2px 0 0; - padding: 2px 0 0; - text-align: left; - font-size: 1em; - background-color: #fff; - border: 1px solid #32ab9a; - border-top: none; - border-radius: 0 0 3px 3px; - overflow: hidden; -} - -#actions .actionButtons .show > .dropdown-menu { - display: block -} - -#actions .actionButtons .dropdown-menu > span { - display: block; - padding: 0 10px; - height: 32px; - line-height: 30px; - border: none; - border-top: 1px solid #f2f2f2; - cursor: pointer; -} - -#actions .actionButtons .dropdown-menu > span:hover { - background-color: #fbfbfb; -} - -#actions .actionButtons select#stay { - display: block; - position: relative; - z-index: -1; - clear: both; - width: auto; - height: 0; - padding: 0 10px; - margin: -100% 0 -32px 0; - font-size: 1em; - opacity: 0; - visibility: hidden; -} - -#actions .actionButtons #Button1 a, -#actions .actionButtons .plus { - color: #fff; - border-color: #32ab9a; - background: #32ab9a linear-gradient(#32ab9a, #00948e); -} - -#actions .actionButtons #Button1 a:hover, -#actions .actionButtons .plus:hover { - background: #2b9385 linear-gradient(#2b9385, #007571); - border-color: #2b9385; -} - -#actions .actionButtons #Button1 a:active, -#actions .actionButtons .plus:active { - background: #32ab9a; - border-color: #32ab9a; -} - +#actions .actionButtons { float: left; min-height: 32px } +#actions .actionButtons li { position: relative; float: left; margin-right: 3px; border: none } +#actions .actionButtons li a, #actions .actionButtons .plus { float: left; padding: 0 10px !important; height: 32px; line-height: 30px; -webkit-user-select: none; user-select: none; } +#actions .actionButtons li:last-child { margin: 0 } +#actions .actionButtons #Button1 a { width: 100%; text-align: left; } +#actions .actionButtons .plus { overflow: hidden; float: right; margin: -32px 0 0 0; width: 35px; border-radius: 0 3px 3px 0 !important; text-align: center; cursor: default; font: normal normal normal 0/30px FontAwesome } +#actions .actionButtons .plus::before { content: "\f107"; font-size: 14px } +#actions .actionButtons .show .plus::before { content: "\f106"; } +#actions .actionButtons .dropdown-menu { display: none; position: absolute; z-index: -1; left: auto; right: 0; top: 100%; width: 100%; min-width: 35px; margin: -2px 0 0; padding: 2px 0 0; text-align: left; font-size: 1em; background-color: #fff; border: 1px solid #32ab9a; border-top: none; border-radius: 0 0 3px 3px; overflow: hidden; } +#actions .actionButtons .show > .dropdown-menu { display: block } +#actions .actionButtons .dropdown-menu > span { display: block; padding: 0 10px; height: 32px; line-height: 30px; border: none; border-top: 1px solid #f2f2f2; cursor: pointer; } +#actions .actionButtons .dropdown-menu > span:hover { background-color: #fbfbfb; } +#actions .actionButtons select#stay { display: block; position: relative; z-index: -1; clear: both; width: auto; height: 0; padding: 0 10px; margin: -100% 0 -32px 0; font-size: 1em; opacity: 0; visibility: hidden; } +#actions .actionButtons #Button1 a, #actions .actionButtons .plus { color: #fff; border-color: #32ab9a; background: #32ab9a linear-gradient(#32ab9a, #00948e); } +#actions .actionButtons #Button1 a:hover, #actions .actionButtons .plus:hover { background: #2b9385 linear-gradient(#2b9385, #007571); border-color: #2b9385; } +#actions .actionButtons #Button1 a:active, #actions .actionButtons .plus:active { background: #32ab9a; border-color: #32ab9a; } @media (max-width: 900px) { - #actions .actionButtons li a, - #actions .actionButtons .dropdown-menu span { - font-size: 0 - } - #actions .actionButtons li a .fa, - #actions .actionButtons .dropdown-menu span .fa { - display: inline-block; - font-size: 14px; - line-height: 30px - } - #actions .actionButtons .dropdown-menu { - width: 35px - } - #actions .actionButtons #Button1 a { - margin: 0; - width: auto - } - #actions .actionButtons .plus { - margin: 0 0 0 -2px - } - #actions .actionButtons select#stay { - display: none - } +#actions .actionButtons li a, #actions .actionButtons .dropdown-menu span { font-size: 0 } +#actions .actionButtons li a .fa, #actions .actionButtons .dropdown-menu span .fa { display: inline-block; font-size: 14px; line-height: 30px } +#actions .actionButtons .dropdown-menu { width: 35px } +#actions .actionButtons #Button1 a { margin: 0; width: auto } +#actions .actionButtons .plus { margin: 0 0 0 -2px } +#actions .actionButtons select#stay { display: none } } - /* actionButtons in content ( old style ) */ - -.actionButtons { - margin: 0; - padding: 0; - background: none; - width: auto; - white-space: nowrap; -} - -.actionButtons li { - float: left; - margin: 0; - padding: 0; - list-style: none; -} - -.actionButtons li:before, -.mmTagList li:before, -.rTable li:before, -.tab-pane ul li ul li:before, -.dashboard li:before, -div#idShowHideSocialBox.sectionBody > div.btn-group.ope > ul.dropdown-menu > li:before, -.sectionBody .multitv .list li:before { - display: none; - content: ''; -} - -.actionButtons img { - vertical-align: top; - margin-top: 1px; - opacity: 0.3; -} - -.actionButtons:hover img { - opacity: 1; -} - -.actionButtons a:hover { - border-color: #999; - -webkit-box-shadow: 1px 1px 2px #aaa; - box-shadow: 1px 1px 2px #aaa; - -webkit-transition: .3s ease; - transition: .3s ease; - background: -moz-linear-gradient(#fff, #f5f5f5); - background: -webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#f5f5f5)); - background: -o-linear-gradient(#fff, #f5f5f5); - text-decoration: none !important; -} - -.actionButtons a:active { - background: #92aac4 bottom left; - -webkit-box-shadow: 0 0 10px #b8c7d6; - box-shadow: 0 0 10px #b8c7d6; -} - -.actionButtons a { - float: left; - padding: 5px 10px; - height: 32px; - font-size: 13px; - font-weight: 500; -} - -.actionButtons a, -.actionButtons li.primary a, -.actionButtons a.primary, -.actionButtons a.default { - text-shadow: none; - background: #fff; - color: #555; - border: 1px solid #e4e4e4; - border-radius: 3px; - /*box-shadow: 0 0 0 1px #E4E4E4;*/ - box-shadow: none; - transition: none; -} - -.actionButtons a:hover { - background: #1377c5; - box-shadow: none; - border-color: #1377c5; - color: #fff !important; - transition: none; -} - -.actionButtons a:active { - background-color: #3189ba; - border-color: #3189ba; -} - -.actionButtons li.primary a, -.actionButtons a.primary { - color: #fff; - border-color: #32ab9a; - background: #32ab9a linear-gradient(#32ab9a, #00948e); -} - -.actionButtons li.primary a:hover, -.actionButtons a.primary:hover { - background: #2b9385 linear-gradient(#2b9385, #007571); - border-color: #2b9385; -} - -.actionButtons li.primary a:active, -.actionButtons a.primary:active { - background: #32ab9a; - border-color: #32ab9a; -} - -.actionButtons img { - display: none; -} - -#treePane .actionButtons img { - display: inline; -} - -.actionButtons--tableheader .fa { - font-size: 14px; -} - -.sectionBody .actionButtons { - padding-top: 0; - min-height: 40px; -} - -.sectionBody .actionButtons li { - margin-right: 10px; -} - -.sectionBody .actionButtons a { - display: inline-block; - padding: 9px 10px; - line-height: 1; -} - -table.actionButtons { - margin-top: 1rem; - margin-bottom: 10px; -} - -table.actionButtons img { - display: inline-block; -} - -table.actionButtons .searchtext { - padding: 5px; - height: 24px; - width: 150px; -} - -.actionButtons .fa { - display: none; - text-align: center; - font-size: 1em; - line-height: 1em; - width: 1.1em; - vertical-align: initial -} - -.actionButtons .fa, -.actionButtons--eit .fa { - display: inline-block; -} - -.optionsTitle .fa { - display: inline-block; -} - +.actionButtons { margin: 0; padding: 0; background: none; width: auto; white-space: nowrap; } +.actionButtons li { float: left; margin: 0; padding: 0; list-style: none; } +.actionButtons li:before, .mmTagList li:before, .rTable li:before, .tab-pane ul li ul li:before, .dashboard li:before, div#idShowHideSocialBox.sectionBody > div.btn-group.ope > ul.dropdown-menu > li:before, .sectionBody .multitv .list li:before { display: none; content: ''; } +.actionButtons img { vertical-align: top; margin-top: 1px; opacity: 0.3; } +.actionButtons:hover img { opacity: 1; } +.actionButtons a:hover { border-color: #999; -webkit-box-shadow: 1px 1px 2px #aaa; box-shadow: 1px 1px 2px #aaa; -webkit-transition: .3s ease; transition: .3s ease; background: -moz-linear-gradient(#fff, #f5f5f5); background: -webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#f5f5f5)); background: -o-linear-gradient(#fff, #f5f5f5); text-decoration: none !important; } +.actionButtons a:active { background: #92aac4 bottom left; -webkit-box-shadow: 0 0 10px #b8c7d6; box-shadow: 0 0 10px #b8c7d6; } +.actionButtons a { float: left; padding: 5px 10px; height: 32px; font-size: 13px; font-weight: 500; } +.actionButtons a, .actionButtons li.primary a, .actionButtons a.primary, .actionButtons a.default { text-shadow: none; background: #fff; color: #555; border: 1px solid #e4e4e4; border-radius: 3px; /*box-shadow: 0 0 0 1px #E4E4E4;*/ +box-shadow: none; transition: none; } +.actionButtons a:hover { background: #1377c5; box-shadow: none; border-color: #1377c5; color: #fff !important; transition: none; } +.actionButtons a:active { background-color: #3189ba; border-color: #3189ba; } +.actionButtons li.primary a, .actionButtons a.primary { color: #fff; border-color: #32ab9a; background: #32ab9a linear-gradient(#32ab9a, #00948e); } +.actionButtons li.primary a:hover, .actionButtons a.primary:hover { background: #2b9385 linear-gradient(#2b9385, #007571); border-color: #2b9385; } +.actionButtons li.primary a:active, .actionButtons a.primary:active { background: #32ab9a; border-color: #32ab9a; } +.actionButtons img { display: none; } +#treePane .actionButtons img { display: inline; } +.actionButtons--tableheader .fa { font-size: 14px; } +.sectionBody .actionButtons { padding-top: 0; min-height: 40px; } +.sectionBody .actionButtons li { margin-right: 10px; } +.sectionBody .actionButtons a { display: inline-block; padding: 9px 10px; line-height: 1; } +table.actionButtons { margin-top: 1rem; margin-bottom: 10px; } +table.actionButtons img { display: inline-block; } +table.actionButtons .searchtext { padding: 5px; height: 24px; width: 150px; } +.actionButtons .fa { display: none; text-align: center; font-size: 1em; line-height: 1em; width: 1.1em; vertical-align: initial } +.actionButtons .fa, .actionButtons--eit .fa { display: inline-block; } +.optionsTitle .fa { display: inline-block; } @media (max-width: 900px) { - .actionButtons a { - display: inline-block; - padding: 6px 10px - } - .tab-page .actionButtons a { - margin-top: 0 !important - } - .actionButtons a span { - display: none; - } - .actionButtons a .fa { - display: inline-block; - } +.actionButtons a { display: inline-block; padding: 6px 10px } +.tab-page .actionButtons a { margin-top: 0 !important } +.actionButtons a span { display: none; } +.actionButtons a .fa { display: inline-block; } } - /* [ TABLES ] */ - /* table */ - -.table th, -.table td { - padding: 0.15rem 0.25rem; -} - +.table th, .table td { padding: 0.15rem 0.25rem; } /* table-data */ - -.table.data { - width: 100%; - max-width: 100%; - margin-bottom: 0; - border-bottom: 1px solid #eceeef -} - -.table.data th, -.table.data thead td { - padding: 0.75rem; - text-transform: uppercase; - white-space: nowrap; - font-size: 0.675rem; - color: #777; - border-bottom: 1px solid #eceeef -} - -.table.data td { - padding: 0.55rem 0.75rem; -} - -.table.data td, -.table.data th, -.table.data thead td { - vertical-align: top; - border-top: 1px solid #eceeef -} - -.table.data td:first-child, -.table.data th:first-child, -.table.data.table-sm td:first-child, -.table.data.table-sm th:first-child { - padding-left: 1.25rem -} - -.table.data td:last-child, -.table.data th:last-child, -.table.data.table-sm td:last-child, -.table.data.table-sm th:last-child { - padding-right: 1.25rem -} - -.table.data thead { - background-color: #fff; -} - -.table.data > tbody > tr { - background-color: #f9f9f9; - transition-duration: .5s -} - -.table.data > tbody > tr:nth-child(2n) { - background-color: #fff -} - -.table.data > tbody > tr:hover { - cursor: default; - background-color: rgba(93, 109, 202, 0.16); - transition-duration: .05s -} - -.table.data tr.unstyled:hover { - background-color: inherit -} - -.table.data .actions { - white-space: nowrap -} - -.table.data .actions a { - color: #555 -} - -.table.data .actions a .fa, -.table.data .actions span .fa { - position: relative; - margin: 0 0.375rem; - font-size: 0.9rem; - color: #555 -} - -.table.data .actions a:hover .fa { - color: #000; -} - -.table.data .actions a:hover .fa.fa-trash { - color: #d80030 -} - -.table.data .actions a .fa::before { - position: relative; - z-index: 2; -} - -.table.data .actions a .fa::after { - content: ""; - position: absolute; - z-index: 1; - left: 50%; - top: 50%; - width: 1.5rem; - height: 1.5rem; - margin: -0.75rem 0 0 -0.75rem; - border-radius: 50%; - -webkit-transition: 0.15s; - transition: 0.15s; -} - -.table.data .actions a:hover .fa::after { - background-color: #fff -} - -.table.data .actions .disabled { - visibility: hidden -} - +.table.data { width: 100%; max-width: 100%; margin-bottom: 0; border-bottom: 1px solid #eceeef } +.table.data th, .table.data thead td { padding: 0.75rem; text-transform: uppercase; white-space: nowrap; font-size: 0.675rem; color: #777; border-bottom: 1px solid #eceeef } +.table.data td { padding: 0.55rem 0.75rem; } +.table.data td, .table.data th, .table.data thead td { vertical-align: top; border-top: 1px solid #eceeef } +.table.data td:first-child, .table.data th:first-child, .table.data.table-sm td:first-child, .table.data.table-sm th:first-child { padding-left: 1.25rem } +.table.data td:last-child, .table.data th:last-child, .table.data.table-sm td:last-child, .table.data.table-sm th:last-child { padding-right: 1.25rem } +.table.data thead { background-color: #fff; } +.table.data > tbody > tr { background-color: #f9f9f9; transition-duration: .5s } +.table.data > tbody > tr:nth-child(2n) { background-color: #fff } +.table.data > tbody > tr:hover { cursor: default; background-color: rgba(93, 109, 202, 0.16); transition-duration: .05s } +.table.data tr.unstyled:hover { background-color: inherit } +.table.data .actions { white-space: nowrap } +.table.data .actions a { color: #555 } +.table.data .actions a .fa, .table.data .actions span .fa { position: relative; margin: 0 0.375rem; font-size: 0.9rem; color: #555 } +.table.data .actions a:hover .fa { color: #000; } +.table.data .actions a:hover .fa.fa-trash { color: #d80030 } +.table.data .actions a .fa::before { position: relative; z-index: 2; } +.table.data .actions a .fa::after { content: ""; position: absolute; z-index: 1; left: 50%; top: 50%; width: 1.5rem; height: 1.5rem; margin: -0.75rem 0 0 -0.75rem; border-radius: 50%; -webkit-transition: 0.15s; transition: 0.15s; } +.table.data .actions a:hover .fa::after { background-color: #fff } +.table.data .actions .disabled { visibility: hidden } /* table-data-nowrap */ - -.table.data.nowrap th, -.table.data.nowrap td { - white-space: nowrap -} - +.table.data.nowrap th, .table.data.nowrap td { white-space: nowrap } /* table-data-sortable */ - -.table.data thead .sortable a, -.table.data thead .sortable-text a { - color: #777; - text-decoration: none !important; -} - -.table.data thead .sortable a:hover, -.table.data thead .sortable-text a:hover { - color: #222 -} - -.table.data thead .sortable a::after, -.table.data thead .sortable-text a::after { - content: "\f107"; - font-family: FontAwesome; - opacity: .3; - margin-left: .5em; -} - -.table.data thead .sortable.forwardSort a::after, -.table.data thead .sortable-text.forwardSort a::after { - opacity: 1; - content: "\f106"; - color: #d9534f -} - -.table.data thead .sortable.reverseSort a::after, -.table.data thead .sortable-text.reverseSort a::after { - opacity: 1; - content: "\f107"; - color: #d9534f -} - -.table.data thead .sortable:hover a::after, -.table.data thead .sortable-text:hover a::after, -.table.data thead .sortable-numeric:hover a::after, -.table.data thead .sortable-date:hover a::after { - opacity: 1 -} - -.table.data thead .sortable, -.table.data thead .sortable-text, -.table.data thead .sortable-numeric, -.table.data thead .sortable-date { - cursor: pointer -} - -.table.data thead .sortable-text span, -.table.data thead .sortable-numeric span, -.table.data thead .sortable-date span { - display: none -} - -.table.data.table-sortable > tbody > tr { - cursor: move; - transition-duration: .5s -} - -.table.data.table-sortable > tbody > tr.ghost { - background-color: rgba(93, 109, 202, 0.16); - color: #d9534f !important; - transition: background-color .5s, color .5s, transform 0s -} - +.table.data thead .sortable a, .table.data thead .sortable-text a { color: #777; text-decoration: none !important; } +.table.data thead .sortable a:hover, .table.data thead .sortable-text a:hover { color: #222 } +.table.data thead .sortable a::after, .table.data thead .sortable-text a::after { content: "\f107"; font-family: FontAwesome; opacity: .3; margin-left: .5em; } +.table.data thead .sortable.forwardSort a::after, .table.data thead .sortable-text.forwardSort a::after { opacity: 1; content: "\f106"; color: #d9534f } +.table.data thead .sortable.reverseSort a::after, .table.data thead .sortable-text.reverseSort a::after { opacity: 1; content: "\f107"; color: #d9534f } +.table.data thead .sortable:hover a::after, .table.data thead .sortable-text:hover a::after, .table.data thead .sortable-numeric:hover a::after, .table.data thead .sortable-date:hover a::after { opacity: 1 } +.table.data thead .sortable, .table.data thead .sortable-text, .table.data thead .sortable-numeric, .table.data thead .sortable-date { cursor: pointer } +.table.data thead .sortable-text span, .table.data thead .sortable-numeric span, .table.data thead .sortable-date span { display: none } +.table.data.table-sortable > tbody > tr { cursor: move; transition-duration: .5s } +.table.data.table-sortable > tbody > tr.ghost { background-color: rgba(93, 109, 202, 0.16); color: #d9534f !important; transition: background-color .5s, color .5s, transform 0s } /* table-data-sm */ - -.table.data.table-sm td, -.table.data.table-sm th { - padding: .25rem .5rem; -} - -.table.data.table-sm th, -.table.data.table-sm thead td { - font-size: 0.75rem; - text-transform: none; -} - +.table.data.table-sm td, .table.data.table-sm th { padding: .25rem .5rem; } +.table.data.table-sm th, .table.data.table-sm thead td { font-size: 0.75rem; text-transform: none; } /* table-data-even */ - -.table.data.table-even > tbody > tr:not(:hover) { - background-color: #fff -} - -.table.data.table-even > tbody > tr:nth-child(4n+1):not(:hover) { - background-color: #f6f8f8 -} - -.table.data.table-even > tbody > tr:nth-child(2n) { - background-color: #fff -} - +.table.data.table-even > tbody > tr:not(:hover) { background-color: #fff } +.table.data.table-even > tbody > tr:nth-child(4n+1):not(:hover) { background-color: #f6f8f8 } +.table.data.table-even > tbody > tr:nth-child(2n) { background-color: #fff } /* table-data-docs */ - -.table.data .doc-item .fa { - width: 1.2em; - font-size: 0.9rem; - text-align: center; - margin-right: 0.25rem -} - -.table.data .doc-item { - text-decoration: none -} - -.table.data .doc-item:hover span { - text-decoration: underline -} - -.table.data .doc-item.private .fa::after { - position: relative; - float: left; - margin: .5em -1em 0 0; - content: "\f023"; - font-size: 0.75em; - color: #d9534f; -} - +.table.data .doc-item .fa { width: 1.2em; font-size: 0.9rem; text-align: center; margin-right: 0.25rem } +.table.data .doc-item { text-decoration: none } +.table.data .doc-item:hover span { text-decoration: underline } +.table.data .doc-item.private .fa::after { position: relative; float: left; margin: .5em -1em 0 0; content: "\f023"; font-size: 0.75em; color: #d9534f; } /* [ BREADCRUMBS ] */ - ul.breadcrumbs { - margin: 0 1rem .5rem; - padding: 0 0 .5rem; - line-height: normal; - font-size: .675rem; - color: #888; - border-bottom: 1px dotted #cecaca; -} - -ul.breadcrumbs li { - list-style: none; - display: inline-block; - padding: 0; - margin: 0; -} - -ul.breadcrumbs a { - text-decoration: none; -} - -ul.breadcrumbs span { - display: inline-block; - width: 1.25em; - vertical-align: top; - text-indent: -2.25em; - overflow: hidden; -} - -ul.breadcrumbs span::after { - margin-left: 2em; - font-family: FontAwesome; - content: "\f105" -} - +margin: 0 1rem .5rem; +padding: 0 0 .5rem; line-height: normal; font-size: .675rem; +color: #888; border-bottom: 1px dotted #cecaca; } +ul.breadcrumbs li { list-style: none; display: inline-block; padding: 0; margin: 0; } +ul.breadcrumbs a { text-decoration: none; } +ul.breadcrumbs span { display: inline-block; width: 1.25em; vertical-align: top; text-indent: -2.25em; overflow: hidden; } +ul.breadcrumbs span::after { margin-left: 2em; font-family: FontAwesome; content: "\f105" } /* [ PAGINATION ] */ - -#pagination { - padding: 0 1.25rem; - margin: .5rem 0 0; -} - +#pagination { padding: 0 1.25rem; margin: .5rem 0 0; } #pagination ul { - margin: 0 0 0 .5rem; - display: inline-block; -} - -#pagination li { - list-style: none; - display: inline-block; - margin: 0 0 0 1px; -} - -#pagination li a { - display: inline-block; - padding: 0 .5rem; - line-height: 1.7; - border: 1px solid #ddd; - text-decoration: none; - color: #333; -} - -#pagination li.currentPage a, -#pagination li a:hover { - color: #555; - border: 1px solid #555; -} - +margin: 0 0 0 .5rem; display: inline-block; } +#pagination li { list-style: none; display: inline-block; margin: 0 0 0 1px; } +#pagination li a { display: inline-block; padding: 0 .5rem; +line-height: 1.7; border: 1px solid #ddd; text-decoration: none; color: #333; } +#pagination li.currentPage a, #pagination li a:hover { color: #555; border: 1px solid #555; } /* [ SEARCHBAR ] */ - -.searchbar input[type=text] { - max-width: 10rem -} - +.searchbar input[type=text] { max-width: 10rem } /* [ WIDGETS ] */ - -.widgets .card { - margin-bottom: 1rem; - border-width: 0; - border-radius: 0; - background-color: #fff; - -webkit-transition: box-shadow .35s; - transition: box-shadow .35s; - box-shadow: 0 0.1rem 0.3rem 0 rgba(0, 0, 0, 0.075); -} - -.widgets .card:hover { - box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.07); -} - -.widgets .card-header { - padding: .5rem 1rem; - font-size: .9rem; - color: #616a73; - font-weight: 700; - border-radius: 0; - border: none; - border-bottom: 1px solid rgba(0, 0, 0, .05); - text-transform: none; - background-color: transparent; - border-bottom: 1px solid rgba(0, 0, 0, 0.05); -} - -.widgets .card-header .fa { - font-size: .9rem -} - -.widgets .card-block { - padding: 0; -} - -.widgets .card-block .card-block p { - padding: 0 1rem -} - -.widgets .card-block .card-body { - padding: 1rem; -} - -.widgets .card-block .card-body + .card-body { - padding-top: 0 -} - -.widgets .table { - margin-bottom: 0rem -} - -.widgets .table:not(.data) tr th, -.widgets .table:not(.data) tr td { - padding: .15rem; -} - -.widgets .table tr th:first-child, -.widgets .table tr td:first-child { - padding-left: 1rem !important -} - -.widgets .table tr th:last-child, -.widgets .table tr td:last-child { - padding-right: 1rem !important -} - -.widgets .table .actions a .fa { - margin: 0 .05rem; -} - +.widgets .card { margin-bottom: 1rem; border-width: 0; border-radius: 0; background-color: #fff; -webkit-transition: box-shadow .35s; transition: box-shadow .35s; box-shadow: 0 0.1rem 0.3rem 0 rgba(0, 0, 0, 0.075); } +.widgets .card:hover { box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.07); } +.widgets .card-header { padding: .5rem 1rem; font-size: .9rem; color: #616a73; font-weight: 700; border-radius: 0; border: none; border-bottom: 1px solid rgba(0, 0, 0, .05); text-transform: none; background-color: transparent; border-bottom: 1px solid rgba(0, 0, 0, 0.05); } +.widgets .card-header .fa { font-size: .9rem } +.widgets .card-block { padding: 0; } +.widgets .card-block .card-block p { padding: 0 1rem } +.widgets .card-block .card-body { padding: 1rem; } +.widgets .card-block .card-body + .card-body { padding-top: 0 } +.widgets .table { margin-bottom: 0rem } +.widgets .table:not(.data) tr th, .widgets .table:not(.data) tr td { padding: .15rem; } +.widgets .table tr th:first-child, .widgets .table tr td:first-child { padding-left: 1rem !important } +.widgets .table tr th:last-child, .widgets .table tr td:last-child { padding-right: 1rem !important } +.widgets .table .actions a .fa { margin: 0 .05rem; } /* widgets custom */ - -.widgets #welcome .wm_buttons { - display: -ms-flexbox; - display: flex; - -ms-flex-wrap: wrap; - flex-wrap: wrap; - margin-bottom: 1rem; - padding: 0; - text-align: center; - border-bottom: 1px solid rgba(0, 0, 0, .05); -} - -.widgets #welcome .wm_button { - max-width: 16.666667%; - flex: 0 0 16.666667%; -} - -.widgets #welcome .wm_button a { - display: block; - height: 100%; - padding: 1rem 1rem .5rem; - text-decoration: none; - color: #646b7b; - box-shadow: none; - transition-duration: .5s -} - -.widgets #welcome .wm_button a:hover { - color: #373b46; - background-color: rgba(93, 109, 202, 0.16) -} - -.widgets #welcome .wm_button a .fa { - display: inline-block; -} - -.widgets #welcome .wm_button a .fa + span { - display: block; - padding: .5em 0; - line-height: 1em; - font-size: .7rem; -} - -.widgets #modxrecent_widget .table.data tbody tr:not(:hover) { - background-color: #fff -} - -.widgets #modxrecent_widget .table.data tbody tr:nth-child(4n+1):not(:hover) { - background-color: #f6f8f8 -} - -.widgets #modxrecent_widget .table.data tbody tr:nth-child(2n) { - background-color: #fff -} - +.widgets #welcome .wm_buttons { display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; margin-bottom: 1rem; padding: 0; text-align: center; border-bottom: 1px solid rgba(0, 0, 0, .05); } +.widgets #welcome .wm_button { max-width: 16.666667%; flex: 0 0 16.666667%; } +.widgets #welcome .wm_button a { display: block; height: 100%; padding: 1rem 1rem .5rem; +text-decoration: none; color: #646b7b; box-shadow: none; transition-duration: .5s } +.widgets #welcome .wm_button a:hover { color: #373b46; background-color: rgba(93, 109, 202, 0.16) } +.widgets #welcome .wm_button a .fa { display: inline-block; } +.widgets #welcome .wm_button a .fa + span { display: block; padding: .5em 0; line-height: 1em; font-size: .7rem; } +.widgets #modxrecent_widget .table.data tbody tr:not(:hover) { background-color: #fff } +.widgets #modxrecent_widget .table.data tbody tr:nth-child(4n+1):not(:hover) { background-color: #f6f8f8 } +.widgets #modxrecent_widget .table.data tbody tr:nth-child(2n) { background-color: #fff } @media (max-width: 1399px) { - .widgets #welcome .wm_button { - max-width: 20%; - flex: 0 0 20%; - } +.widgets #welcome .wm_button { max-width: 20%; flex: 0 0 20%; } } - @media (max-width: 1199px) { - .widgets #welcome .wm_button { - max-width: 25%; - flex: 0 0 25%; - } +.widgets #welcome .wm_button { max-width: 25%; flex: 0 0 25%; } } - @media (max-width: 991px) { - .widgets #welcome .wm_button { - max-width: 33.3333%; - flex: 0 0 33.3333%; - } +.widgets #welcome .wm_button { max-width: 33.3333%; flex: 0 0 33.3333%; } } - @media (max-width: 767px) { - .widgets #welcome .wm_button { - max-width: 50%; - flex: 0 0 50%; - } +.widgets #welcome .wm_button { max-width: 50%; flex: 0 0 50%; } } - /* [ DATEPICKER ] */ - -.dp_container { - position: absolute; - z-index: 500; -} - -.dp_cal { - overflow: hidden; - width: 220px; - margin: 0.25rem 0; - background-color: #fff; - -webkit-box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.3); - box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.3); -} - -.dp_cal p { - position: relative; - margin: 10px; -} - -.dp_cal select { - font-size: 1em; - margin: 2px 3px; - width: auto !important -} - -.dp_cal select option { - padding: 1px 3px -} - -.dp_cal table { - border-collapse: collapse; - border-spacing: 0; - width: 100% -} - -.dp_cal td.dp_roll { - background-color: rgba(0, 0, 0, 0.1); - color: #333 !important -} - -.dp_cal th, -.dp_cal td { - font-size: 1em; - padding: 0.5em 0 !important; - text-align: center !important; - width: 14.2857%; - cursor: default -} - -.dp_cal tbody th { - background-color: #656d79; - color: #fff; -} - -.dp_cal tbody td:nth-child(6), -.dp_cal tbody td:nth-child(7) { - color: indianred -} - -.dp_cal .dp_empty { - background-color: #f9f9f9 -} - -.dp_cal .dp_hide { - visibility: hidden -} - -.dp_cal .dp_today { - background-color: #4caf50; - color: #fff !important -} - -.dp_cal .dp_selected { - background-color: #3189ba; - color: #fff !important -} - -.dp_cal input { - width: 68% !important -} - -.dp_cal button { - position: absolute; - top: 0; - right: 0; - margin: 0 !important; - width: 30% !important -} - +.dp_container { position: absolute; z-index: 500; } +.dp_cal { overflow: hidden; width: 220px; margin: 0.25rem 0; background-color: #fff; -webkit-box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.3); box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.3); } +.dp_cal p { position: relative; margin: 10px; } +.dp_cal select { font-size: 1em; margin: 2px 3px; width: auto !important } +.dp_cal select option { padding: 1px 3px } +.dp_cal table { border-collapse: collapse; border-spacing: 0; width: 100% } +.dp_cal td.dp_roll { background-color: rgba(0, 0, 0, 0.1); color: #333 !important } +.dp_cal th, .dp_cal td { font-size: 1em; padding: 0.5em 0 !important; text-align: center !important; width: 14.2857%; cursor: default } +.dp_cal tbody th { background-color: #656d79; color: #fff; } +.dp_cal tbody td:nth-child(6), .dp_cal tbody td:nth-child(7) { color: indianred } +.dp_cal .dp_empty { background-color: #f9f9f9 } +.dp_cal .dp_hide { visibility: hidden } +.dp_cal .dp_today { background-color: #4caf50; color: #fff !important } +.dp_cal .dp_selected { background-color: #3189ba; color: #fff !important } +.dp_cal input { width: 68% !important } +.dp_cal button { position: absolute; top: 0; right: 0; margin: 0 !important; width: 30% !important } /* datepicker icon clear */ - -.clearDate { - position: relative; - margin: 0.5rem 0 0 -1.5rem; - z-index: 10; -} - +.clearDate { position: relative; margin: 0.5rem 0 0 -1.5rem; z-index: 10; } /* [ GRID STYLE ] */ - -.grid { - width: 100%; - background-color: #fff !important; - border: 1px solid rgba(0, 0, 0, 0.1); - border-collapse: collapse; -} - -.grid thead, -.grid tfoot { - background-color: #e9e9e9 -} - -.grid th, -.grid td { - padding: 0.375rem !important; - border: 1px solid #ddd -} - -.gridHeader, -.grid th { - color: #333; - font-weight: 500; - white-space: nowrap; - background-color: #e9e9e9; - text-align: left; -} - -.grid > tbody > tr:nth-child(2n) > td { - background-color: rgba(0, 0, 0, 0.03) -} - -.gridItem { - background-color: #fff; - padding: 3px; -} - -.gridAltItem { - background-color: #f7f7f7; - padding: 3px; -} - -.grid tbody tr:hover td { - background: #e9edf3; -} - -.grid a { - text-decoration: none; -} - -.grid img { - vertical-align: middle; - padding-right: 4px; -} - +.grid { width: 100%; background-color: #fff !important; border: 1px solid rgba(0, 0, 0, 0.1); border-collapse: collapse; } +.grid thead, .grid tfoot { background-color: #e9e9e9 } +.grid th, .grid td { padding: 0.375rem !important; border: 1px solid #ddd } +.gridHeader, .grid th { color: #333; font-weight: 500; white-space: nowrap; background-color: #e9e9e9; text-align: left; } +.grid > tbody > tr:nth-child(2n) > td { background-color: rgba(0, 0, 0, 0.03) } +.gridItem { background-color: #fff; padding: 3px; } +.gridAltItem { background-color: #f7f7f7; padding: 3px; } +.grid tbody tr:hover td { background: #e9edf3; } +.grid a { text-decoration: none; } +.grid img { vertical-align: middle; padding-right: 4px; } /* SORTABLELIST */ - -ul.sortableList { - margin: 0; -} - -ul.sortableList li { - position: relative; - z-index: 1; - float: left; - clear: both; - max-width: 100%; - width: 30rem; - list-style: none; - font-weight: bold; - cursor: move; - padding: 0.46153846em 1em; - margin: .0625rem 0; - border: 1px solid #ccc; - line-height: 1.23076923; - background-color: #fff; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - box-shadow: none; - transition: color .3s, box-shadow .3s, transform .3s, z-index .3s step-end; -} - -ul.sortableList li.ghost { - z-index: 2; - box-shadow: 0 0.25rem 1.5rem rgba(0, 0, 0, 0.15); - transition: color .3s, box-shadow .3s, transform 0s, z-index 0s; -} - +ul.sortableList { margin: 0; } +ul.sortableList li { position: relative; z-index: 1; float: left; clear: both; max-width: 100%; width: 30rem; list-style: none; font-weight: bold; cursor: move; padding: 0.46153846em 1em; margin: .0625rem 0; +border: 1px solid #ccc; line-height: 1.23076923; background-color: #fff; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); box-shadow: none; transition: color .3s, box-shadow .3s, transform .3s, z-index .3s step-end; } +ul.sortableList li.ghost { z-index: 2; box-shadow: 0 0.25rem 1.5rem rgba(0, 0, 0, 0.15); transition: color .3s, box-shadow .3s, transform 0s, z-index 0s; } /* [ TOOLTIPS ] */ - -.evo-tooltip, -.custom-tip { - position: fixed; - z-index: 13000; - width: 13rem; - margin: 1rem; - padding: 0.9rem 1rem; - font-size: 0.75rem; - line-height: 1.5; - font-family: sans-serif; - text-align: left; - color: #333; - background-color: #fff; - visibility: hidden; - transition-duration: .3s; - transform: translate3d(1rem, 0, 0); - -webkit-box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.15); - box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.15); -} - -.evo-tooltip { - opacity: 0; - content: attr(data-tooltip); -} - -.evo-tooltip.show { - opacity: 1; - visibility: visible; - transform: translate3d(0, 0, 0); -} - -[data-tooltip] { - cursor: help -} - -[data-tooltip].fa-question-circle { - opacity: 0.15; -} - -[data-tooltip].fa-question-circle:hover { - opacity: 1; -} - +.evo-tooltip, .custom-tip { position: fixed; z-index: 13000; width: 13rem; margin: 1rem; padding: 0.9rem 1rem; font-size: 0.75rem; line-height: 1.5; font-family: sans-serif; text-align: left; color: #333; background-color: #fff; visibility: hidden; transition-duration: .3s; transform: translate3d(1rem, 0, 0); -webkit-box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.15); box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.15); } +.evo-tooltip { opacity: 0; content: attr(data-tooltip); } +.evo-tooltip.show { opacity: 1; visibility: visible; transform: translate3d(0, 0, 0); } +[data-tooltip] { cursor: help } +[data-tooltip].fa-question-circle { opacity: 0.15; } +[data-tooltip].fa-question-circle:hover { opacity: 1; } /* [ FILES MANAGER ] */ - -#ManageFiles { - padding-bottom: 1rem; -} - -#ManageFiles .breadcrumbs {} - -#ManageFiles .breadcrumbs a, -#ManageFiles .breadcrumbs span { - display: inline-block; - padding: 0 0.25em; -} - -#ManageFiles #imageviewer { - text-align: center; -} - -#ManageFiles #imageviewer img { - display: inline-block; - max-width: 100%; - margin-top: 1rem -} - -#FilesTable { - margin-bottom: 1rem; - border-bottom: 1px solid #ddd; -} - -#file_editfile.section .sectionHeader { - margin: 0; - padding: 0.5rem 1rem; - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - background-color: #f9f9f9 -} - -#file_editfile.section .sectionBody { - margin: 0 !important; - padding: 0 0 1rem; - border: none; - border-bottom: 1px solid #ddd; - background-color: #f9f9f9 -} - -#file_editfile td { - padding: 0 !important; -} - -#file_editfile #content { - float: left; - width: 100%; - min-height: 25rem; - border: none; - border-bottom: 1px solid rgba(0, 0, 0, .15) -} - +#ManageFiles { padding-bottom: 1rem; } +#ManageFiles .breadcrumbs { } +#ManageFiles .breadcrumbs a, #ManageFiles .breadcrumbs span { display: inline-block; padding: 0 0.25em; } +#ManageFiles #imageviewer { text-align: center; } +#ManageFiles #imageviewer img { display: inline-block; max-width: 100%; margin-top: 1rem } +#FilesTable { margin-bottom: 1rem; border-bottom: 1px solid #ddd; } +#file_editfile.section .sectionHeader { margin: 0; padding: 0.5rem 1rem; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; background-color: #f9f9f9 } +#file_editfile.section .sectionBody { margin: 0 !important; padding: 0 0 1rem; border: none; border-bottom: 1px solid #ddd; background-color: #f9f9f9 } +#file_editfile td { padding: 0 !important; } +#file_editfile #content { float: left; width: 100%; min-height: 25rem; border: none; border-bottom: 1px solid rgba(0, 0, 0, .15) } /* STYLES FOR PAGE HELP */ - -#helpPane h1 { - margin-bottom: 1em; - padding: .5rem; - font-size: .8rem; - border-bottom: 1px solid #e0e0e0; -} - -#helpPane li:not(:first-child) > strong { - margin-top: 1.4em; -} - -#helpPane li > strong { - display: block; - font-size: 14px; -} - -#helpPane pre { - border: 1px solid rgba(0, 0, 0, 0.1); - padding: 1em; -} - -#helpPane .tab-page > img:first-of-type { - margin-bottom: 1rem; -} - +#helpPane h1 { margin-bottom: 1em; padding: .5rem; +font-size: .8rem; +border-bottom: 1px solid #e0e0e0; } +#helpPane li:not(:first-child) > strong { margin-top: 1.4em; } +#helpPane li > strong { display: block; font-size: 14px; } +#helpPane pre { border: 1px solid rgba(0, 0, 0, 0.1); padding: 1em; } +#helpPane .tab-page > img:first-of-type { margin-bottom: 1rem; } /* modes theme */ - /* lightness */ - /* light */ - /* dark */ - -.dark .section-editor textarea { - background-color: #282c34; - color: #abb2bf -} - -.dark .tab-page, -.dark .sectionBody .tab-page, -.dark .tab-row .tab.selected, -.dark .tab-row .tab.selected.hover, -.dark .tab-row .tab.selected:before, -.dark .tab-row .tab.selected span { - background-color: #f9f9f9; -} - -.dark, -.dark .resourceTable .panel-heading { - background: #ecf0f1 !important; -} - -.dark .resourceTable .panel-heading:hover { - background: #ecf0f1 !important; -} - -.dark .multitv .list li.element a.copy, -.multitv .list li.element a.remove { - background: transparent !important; -} - -.dark .multitv .list li.element { - background: #fefefe !important; -} - -.dark .split { - border-color: rgba(0, 0, 0, .05) -} - -.dark hr { - background: transparent; -} - +.dark .section-editor textarea { background-color: #282c34; color: #abb2bf } +.dark .tab-page, .dark .sectionBody .tab-page, .dark .tab-row .tab.selected, .dark .tab-row .tab.selected.hover, .dark .tab-row .tab.selected:before, .dark .tab-row .tab.selected span { background-color: #f9f9f9; } +.dark, .dark .resourceTable .panel-heading { background: #ecf0f1 !important; } +.dark .resourceTable .panel-heading:hover { background: #ecf0f1 !important; } +.dark .multitv .list li.element a.copy, .multitv .list li.element a.remove { background: transparent !important; } +.dark .multitv .list li.element { background: #fefefe !important; } +.dark .split { border-color: rgba(0, 0, 0, .05) } +.dark hr { background: transparent; } /*.dark .content-blocks .block { background: #fefefe; border: 1px solid #e3e3e3; } .dark .content-blocks .block .fields-group { border: 1px dashed #e2e2e2; }*/ - -.dark .content-blocks input[type="text"], -.dark .content-blocks input[type="password"], -.dark .content-blocks input[type="number"], -.dark .content-blocks textarea { - background-color: #fbfbfb !important; - border-color: #dbdbdb !important; -} - -.dark .content-blocks .controls { - background: #f9f9f9 !important; -} - -.dark .widgets .card-header { - color: #616a73; - background-color: #fafafa; -} - +.dark .content-blocks input[type="text"], .dark .content-blocks input[type="password"], .dark .content-blocks input[type="number"], .dark .content-blocks textarea { background-color: #fbfbfb !important; border-color: #dbdbdb !important; } +.dark .content-blocks .controls { background: #f9f9f9 !important; } +.dark .widgets .card-header { color: #616a73; background-color: #fafafa; } /* darkness */ - -.darkness { - background-color: #282c34; - color: #aaa -} - -.darkness .container-body { - background-color: #282c34; -} - -.darkness > .container-body, -.darkness .page { - background-color: #282c34; -} - -.darkness .sectionBody .tab-page, -.darkness .tab-page { - background-color: #282c34; - box-shadow: none; -} - -.darkness .widgets .card, -.darkness h1, -.darkness .element-edit-message, -.darkness #ManageFiles .breadcrumbs { - background-color: #202329; -} - -.darkness #edit-info.element-edit-message, -.darkness #add-info.element-edit-message, -.darkness #sort-info.element-edit-message, -.darkness #categorize-info.element-edit-message { - background-color: #282c34; -} - -.darkness .msg-container { - border-bottom: 1px solid #414449; -} - -.darkness .widgets #welcome .wm_button a { - color: #aaa; -} - -.darkness .widgets #welcome .wm_button a:hover { - background-color: rgba(255, 255, 255, 0.08); - color: #e8e8e8; -} - -.darkness .widgets .card-header { - color: #b0b0b1; - border-bottom: 1px solid #2b2e34; -} - -.darkness #news .card-block ul li, -.darkness #security .card-block ul li { - border-bottom: 1px solid #2b2e34; -} - -.darkness #news .card-block ul li:last-child, -.darkness #security .card-block ul li:last-child, -.darkness table.table.table--edit > tbody > tr > td { - border: none -} - -.darkness .multitv .list li.element { - background: #282c34 !important; - border-color: #414449; -} - -.darkness .multitv .list li.element input[type="text"], -.darkness .multitv .list li.element input[type="password"], -.darkness .multitv .list li.element input[type="number"], -.darkness .multitv .list li.element textarea { - background-color: #202329 !important; - border-color: #414449 !important; -} - -.darkness #displayparams { - width: calc(100% + 2.5rem); - max-width: calc(100% + 2.5rem); - margin: 0 -1.25rem !important; -} - -.darkness #content_body { - margin: 0 -1.5rem; -} - -.darkness .card .table.data, -.darkness .table td[style="background-color:#ffffff;"] { - background: #202329 !important; -} - -.darkness .table.data, -.darkness .grid { - background: #282c34 !important; - border: none !important -} - -.darkness .table.data thead, -.darkness .grid thead, -.darkness #editorRow_TinyMCE { - background: none -} - -.darkness .table.data thead th, -.darkness .table.data thead td, -.darkness .grid th, -.darkness .grid thead td { - padding: 0.75rem !important; - background-color: #202329; - border: none; - border-bottom: 1px solid #1f5994; - color: #777; - text-transform: uppercase; - font-size: 0.675rem; -} - -.darkness .table.data thead .sortable a, -.darkness .table.data thead .sortable-text a, -.darkness .sortabletable th a { - color: #777; -} - -.darkness .table th a:hover, -.darkness .table thead td a:hover, -.darkness .grid th a:hover, -.darkness .grid thead td a:hover, -.darkness .table .sortable:hover a, -.darkness .table .sortable-text:hover a { - color: #eee !important; -} - -.darkness .table.data thead .sortable a::after, -.darkness .table.data thead .sortable-text a::after { - opacity: 1; -} - -.darkness .sortabletable thead tr, -.darkness .sortabletable th:active { - background-color: #202329 -} - -.darkness .table tbody tr, -.darkness .grid tbody tr, -.darkness table.table.table--edit > tbody > tr { - background: none !important; -} - -.darkness .table > tbody > tr > td, -.darkness .grid > tbody > tr > td { - background: none; - border: none !important; - border-bottom: 1px solid #2b2e34 !important; - color: inherit; -} - -.darkness .table > tbody > tr:nth-child(2n), -.darkness .grid > tbody > tr:nth-child(2n) { - background-color: #252930 !important; -} - -.darkness .table.data tr > td:first-child, -.darkness .table.data tr > th:first-child, -.darkness .grid tr > td:first-child, -.darkness .grid > tr > th:first-child { - padding-left: 1.25rem !important; -} - -.darkness .table.data tr > td:last-child, -.darkness .table.data tr > th:last-child, -.darkness .grid tr > td:last-child, -.darkness .grid > tr > th:last-child { - padding-right: 1.25rem !important; -} - -.darkness table.table.table--edit > tbody > tr > th, -.darkness table.table.table--edit > tbody > tr > td, -.darkness form[name="settings"] table > tbody td, -.darkness form[name="settings"] table > tbody th { - padding: .25rem .5rem; - background: none; - border: none !important; - color: inherit; -} - -.darkness .table.data .actions a, -.darkness .table.data .actions a .fa, -.darkness .table.data .actions span .fa { - color: inherit; -} - -.darkness .table.data .actions a:hover .fa::before { - color: #eee; -} - -.darkness .table.data .actions a:hover .fa::after { - background-color: #3b414e; -} - -.darkness .table.data .actions a:hover .fa.fa-trash::before { - color: #d80030; -} - -.darkness table .split, -.darkness #editorRow_TinyMCE tr, -.darkness table.table.table--edit > tbody > tr, -.darkness .sysSettings > tbody > tr { - border: none; - border-bottom: 1px solid #23262b !important; -} - -.darkness table .split { - margin: 0 -.5rem; -} - -.darkness table tr.noborder { - border: none !important; -} - -.darkness table .comment { - color: #999 !important; -} - -.darkness #editorRow_TinyMCE > tbody > tr:first-child > th { - background: none !important; - color: inherit !important; -} - -.darkness .section-editor, -.darkness #content_body { - border-top: 1px solid #414449; -} - -.darkness #file_editfile .navbar-editor, -.darkness #file_editfile [name="editFile"], -.darkness #content_body, -.darkness .section-editor { - border-bottom: 1px solid #414449; -} - -.darkness .section-editor > textarea, -.darkness #content_body > div > textarea, -.darkness #content_body > .section-editor { - margin-top: 0 -} - -.darkness #content_body textarea, -.darkness .section-editor textarea, -.darkness #content_body > .section-editor { - display: block; - border: none -} - -.darkness ul.sortableList li { - background-color: #202329; - border: 1px solid #414449; -} - -.darkness ul.sortableList li:hover { - border-color: #5d5d5d; -} - -.darkness ul.sortableList li.ghost { - background-color: #282c34; - border-color: #1976d2; -} - -.darkness .disabledPlugin, -.darkness .disabledPlugin a { - color: #de6961; -} - -.darkness .alert { - box-shadow: 0 0.25rem 2rem rgba(0, 0, 0, 0.15); -} - -.darkness .alert-danger { - background-color: #612329; - border-color: #612329; - color: #da706d; -} - -.darkness .alert-danger b { - color: #f7e6e8 !important -} - -.darkness .alert-info { - background-color: #193048; - border-color: #193048; - color: #a3b3bd; -} - -.darkness .alert-warning { - background-color: #6c591d; - border-color: #6c591d; - color: #c7bd9e; -} - -.darkness .alert-success { - background-color: #3d7544; - border-color: #3d7544; - color: #c4efc5; -} - -.darkness .loginbox, -.darkness .loginbox form { - background-color: #202329 -} - -.darkness .loginbox .logo img { - content: url("../images/misc/logo-navbar-white.png"); -} - -.darkness #mainloader { - background-color: transparent !important; -} - -.darkness #FilesTable { - border-bottom: 1px solid #202329 -} - -.darkness #mce-modal-block { - background-color: #000; -} - -.darkness .resourceTable .panel-heading { - margin-top: -1px !important; - background-color: #202329; - border-top: 1px solid #414449; - border-bottom: 1px solid #414449; -} - -.darkness .panel-title > a { - color: #aaa; -} - -.darkness .panel-title > a:hover { - background: #202329; - color: #eee; -} - -.darkness .resourceTable ul.elements > li { - border-left: 3px solid transparent; - border-bottom: 1px solid #303338; -} - -.darkness .resourceTable ul.elements > li:hover { - background-color: #202329; -} - -.darkness .elements_descr { - color: #aaa; -} - -.darkness ul.elements_buttonbar li a { - color: inherit; -} - -.darkness .msg-container { - color: inherit -} - -.darkness .evo-tooltip, -.darkness .custom-tip { - background-color: #343942; - color: #eee; - box-shadow: 0 0.5rem 3rem rgba(0, 0, 0, 0.4); -} - -.darkness div#section-body-categories div.uncategorized_elements, -.darkness div#section-body-categories div.drop { - border: 1px solid #414449; - background-color: #202329; -} - -.darkness div#section-body-categories div.uncategorized_elements h2, -.darkness div#section-body-categories div.drop h2 { - color: #1976d2; - border-bottom: 1px solid #1976d2; -} - -.darkness div#section-body-categories div.drag { - background-color: #1976d2; -} - -.darkness #helpPane h1 { - border-bottom: 1px solid #414449; -} - -.darkness #helpPane ul + h1 { - margin-top: 1rem; -} - -.darkness #helpPane ul { - margin: 0; -} - -.darkness #helpPane .tab-page > img:first-of-type { - content: url("../images/misc/logo-navbar-white.png"); -} - -.darkness #helpPane pre { - border: 1px solid #414449; - padding: 1em; - color: #aaa; -} - -.darkness code { - background-color: #202329; - border: 1px solid #414449; -} - -.darkness .h, -.darkness .e, -.darkness .v { - background-color: #202329; - border-color: #414449; - color: #eee; -} - -.darkness .v { - background-color: #282c34; -} - -.darkness tr:hover .e { - background-color: #282c33; -} - -.darkness tr:hover .v { - background-color: #2b3038; -} - -.darkness .dp_cal { - box-shadow: 0 0.5rem 3rem rgba(0, 0, 0, 0.4); -} - -.darkness .dp_cal, -.darkness .dp_cal .dp_empty { - background-color: #343942; -} - -.darkness .dp_cal td.dp_roll { - background-color: #202329; - color: #aaa !important; -} - -.darkness .dp_cal td.dp_selected { - background-color: #3189ba; - color: #fff !important; -} - -.darkness ul.breadcrumbs a { - color: #3481bc; -} - -.darkness #pagination li a { - border: 1px solid #414449; - color: #bbb; -} - -.darkness #pagination li.currentPage a, -.darkness #pagination li a:hover { - color: #eee; - border: 1px solid #1976d2; -} - -.darkness h2[style="color:#003399"], -.darkness h3[style="color:#003399"] { - color: #f44336 !important; -} - -.darkness h3[style="color:#003399"] + div[style] { - background-color: transparent !important; - border-color: #f44336 !important; - color: #f44336 !important; -} - -.darkness .mce-container, -.darkness .mce-container *, -.darkness .mce-widget, -.darkness .mce-widget *, -.darkness .mce-reset { - color: #aaa; -} - -.darkness .mce-panel { - background: #202329; - border: none !important; -} - -.darkness .mce-reset .mce-panel { - background: #1a1c21; -} - -.darkness .mce-btn { - background-color: #202329; - border-color: transparent; -} - -.darkness .mce-toolbar .mce-btn-group { - border-color: #414449 !important; -} - -.darkness .mce-label { - text-shadow: none; -} - -.darkness .mce-menu-item.mce-selected, -.darkness .mce-menu-item:hover, -.darkness .mce-menu-item:focus { - background: #1976d2; -} - -.darkness .mce-menu-item.mce-selected .mce-text, -.darkness .mce-menu-item.mce-selected .mce-ico, -.darkness .mce-menu-item:hover .mce-text, -.darkness .mce-menu-item:focus .mce-text, -.darkness .mce-menu-item:hover .mce-ico, -.darkness .mce-menu-item:focus .mce-ico { - color: #fff; -} - -.darkness .mce-menu-item .mce-caret { - border-left-color: #fff; -} - -.darkness .mce-tabs, -.darkness .mce-tabs + .mce-container-body { - background: #202329; -} - -.darkness .mce-tab { - background: #202329; - border-color: #414449; - border-top: 1px solid transparent; - text-shadow: none !important -} - -.darkness .mce-tab:hover { - background-color: #1a1c21; -} - -.darkness .mce-tab:focus { - color: #eee; -} - -.darkness .mce-tab.mce-active { - border-top-color: #414449; -} - -.darkness .mce-tabs { - border-bottom: 1px solid #414449; -} - -.darkness .mce-tab.mce-active { - background-color: #202329; -} - -.darkness .mce-menu-item.mce-disabled, -.darkness .mce-menu-item.mce-disabled:hover { - background: #202329; -} - -.darkness .mce-menu-item.mce-disabled .mce-text, -.darkness .mce-menu-item.mce-disabled:hover .mce-text, -.darkness .mce-menu-item.mce-disabled .mce-ico, -.darkness .mce-menu-item.mce-disabled:hover .mce-ico { - color: #414449; -} - -.darkness .mce-window-head .mce-close { - background-color: #6d1215 !important; -} - -.darkness .mce-window-head { - background: #1a1c21; - border: none; -} - -.darkness i.mce-i-checkbox, -.darkness .mce-textbox, -.darkness .mce-window-body .mce-btn, -.darkness .mce-foot .mce-btn { - background-color: #1a1c21; - border: 1px solid #414449; -} - -.darkness .mce-btn:hover, -.darkness .mce-btn:active { - background: #282c34; - border-color: #414449; -} - -.darkness .mce-btn:focus { - background: #282c34; -} - -.darkness .mce-btn button { - background-color: transparent -} - -.darkness .mce-splitbtn .mce-open:hover, -.darkness .mce-splitbtn .mce-open:active, -.darkness .mce-splitbtn:hover .mce-open, -.darkness .mce-splitbtn.mce-active:hover .mce-open { - border-left: 1px solid #3d4045; -} - -.darkness .mce-checked i.mce-i-checkbox { - color: #aaa; -} - -.darkness .mce-textbox { - font-family: monospace; -} - -.darkness::-webkit-scrollbar, -.darkness::-webkit-scrollbar-thumb, -.darkness *::-webkit-scrollbar, -.darkness *::-webkit-scrollbar-thumb { - width: 1rem; - height: 1rem; - background-color: transparent; - border-radius: .5rem; - border: .25rem solid transparent; -} - -.darkness:hover::-webkit-scrollbar-thumb, -.darkness *:hover::-webkit-scrollbar-thumb { - box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); -} - -.darkness::-webkit-scrollbar-thumb:hover, -.darkness *::-webkit-scrollbar-thumb:hover { - box-shadow: inset 0 0 0 1rem rgba(255, 255, 255, 0.15); -} - -.darkness::-webkit-resizer, -.darkness *::-webkit-resizer, -.darkness::-webkit-scrollbar-corner, -.darkness *::-webkit-scrollbar-corner { - background-color: transparent; -} - +.darkness { background-color: #282c34; color: #aaa } +.darkness .container-body { background-color: #282c34; } +.darkness > .container-body, .darkness .page { background-color: #282c34; } +.darkness .sectionBody .tab-page, .darkness .tab-page { background-color: #282c34; box-shadow: none; } +.darkness .widgets .card, .darkness h1, .darkness .element-edit-message, .darkness #ManageFiles .breadcrumbs { background-color: #202329; } +.darkness #edit-info.element-edit-message, .darkness #add-info.element-edit-message, .darkness #sort-info.element-edit-message, .darkness #categorize-info.element-edit-message { background-color: #282c34; } +.darkness .msg-container { border-bottom: 1px solid #414449; } +.darkness .widgets #welcome .wm_button a { color: #aaa; } +.darkness .widgets #welcome .wm_button a:hover { background-color: rgba(255, 255, 255, 0.08); color: #e8e8e8; } +.darkness .widgets .card-header { color: #b0b0b1; border-bottom: 1px solid #2b2e34; } +.darkness #news .card-block ul li, .darkness #security .card-block ul li { border-bottom: 1px solid #2b2e34; } +.darkness #news .card-block ul li:last-child, .darkness #security .card-block ul li:last-child, .darkness table.table.table--edit > tbody > tr > td { border: none } +.darkness .multitv .list li.element { background: #282c34 !important; border-color: #414449; } +.darkness .multitv .list li.element input[type="text"], .darkness .multitv .list li.element input[type="password"], .darkness .multitv .list li.element input[type="number"], .darkness .multitv .list li.element textarea { background-color: #202329 !important; border-color: #414449 !important; } +.darkness #displayparams { width: calc(100% + 2.5rem); max-width: calc(100% + 2.5rem); margin: 0 -1.25rem !important; } +.darkness #content_body { margin: 0 -1.5rem; } +.darkness .card .table.data, .darkness .table td[style="background-color:#ffffff;"] { background: #202329 !important; } +.darkness .table.data, .darkness .grid { background: #282c34 !important; border: none !important } +.darkness .table.data thead, .darkness .grid thead, .darkness #editorRow_TinyMCE { background: none } +.darkness .table.data thead th, .darkness .table.data thead td, .darkness .grid th, .darkness .grid thead td { padding: 0.75rem !important; background-color: #202329; border: none; border-bottom: 1px solid #1f5994; color: #777; text-transform: uppercase; font-size: 0.675rem; } +.darkness .table.data thead .sortable a, .darkness .table.data thead .sortable-text a, .darkness .sortabletable th a { color: #777; } +.darkness .table th a:hover, .darkness .table thead td a:hover, .darkness .grid th a:hover, .darkness .grid thead td a:hover, .darkness .table .sortable:hover a, .darkness .table .sortable-text:hover a { color: #eee !important; } +.darkness .table.data thead .sortable a::after, .darkness .table.data thead .sortable-text a::after { opacity: 1; } +.darkness .sortabletable thead tr, .darkness .sortabletable th:active { background-color: #202329 } +.darkness .table tbody tr, .darkness .grid tbody tr, .darkness table.table.table--edit > tbody > tr { background: none !important; } +.darkness .table > tbody > tr > td, .darkness .grid > tbody > tr > td { background: none; border: none !important; border-bottom: 1px solid #2b2e34 !important; color: inherit; } +.darkness .table > tbody > tr:nth-child(2n), .darkness .grid > tbody > tr:nth-child(2n) { background-color: #252930 !important; } +.darkness .table.data tr > td:first-child, .darkness .table.data tr > th:first-child, .darkness .grid tr > td:first-child, .darkness .grid > tr > th:first-child { padding-left: 1.25rem !important; } +.darkness .table.data tr > td:last-child, .darkness .table.data tr > th:last-child, .darkness .grid tr > td:last-child, .darkness .grid > tr > th:last-child { padding-right: 1.25rem !important; } +.darkness table.table.table--edit > tbody > tr > th, .darkness table.table.table--edit > tbody > tr > td, .darkness form[name="settings"] table > tbody td, .darkness form[name="settings"] table > tbody th { +padding: .25rem .5rem; background: none; border: none !important; color: inherit; } +.darkness .table.data .actions a, .darkness .table.data .actions a .fa, .darkness .table.data .actions span .fa { color: inherit; } +.darkness .table.data .actions a:hover .fa::before { color: #eee; } +.darkness .table.data .actions a:hover .fa::after { background-color: #3b414e; } +.darkness .table.data .actions a:hover .fa.fa-trash::before { color: #d80030; } +.darkness table .split, .darkness #editorRow_TinyMCE tr, .darkness table.table.table--edit > tbody > tr, .darkness .sysSettings > tbody > tr { border: none; border-bottom: 1px solid #23262b !important; } +.darkness table .split { margin: 0 -.5rem; } +.darkness table tr.noborder { border: none !important; } +.darkness table .comment { color: #999 !important; } +.darkness #editorRow_TinyMCE > tbody > tr:first-child > th { background: none !important; color: inherit !important; } +.darkness .section-editor, .darkness #content_body { border-top: 1px solid #414449; } +.darkness #file_editfile .navbar-editor, .darkness #file_editfile [name="editFile"], .darkness #content_body, .darkness .section-editor { border-bottom: 1px solid #414449; } +.darkness .section-editor > textarea, .darkness #content_body > div > textarea, .darkness #content_body > .section-editor { margin-top: 0 } +.darkness #content_body textarea, .darkness .section-editor textarea, .darkness #content_body > .section-editor { display: block; border: none } +.darkness ul.sortableList li { background-color: #202329; border: 1px solid #414449; } +.darkness ul.sortableList li:hover { border-color: #5d5d5d; } +.darkness ul.sortableList li.ghost { background-color: #282c34; border-color: #1976d2; } +.darkness .disabledPlugin, .darkness .disabledPlugin a { color: #de6961; } +.darkness .alert { box-shadow: 0 0.25rem 2rem rgba(0, 0, 0, 0.15); } +.darkness .alert-danger { background-color: #612329; border-color: #612329; color: #da706d; } +.darkness .alert-danger b { color: #f7e6e8 !important } +.darkness .alert-info { background-color: #193048; border-color: #193048; color: #a3b3bd; } +.darkness .alert-warning { background-color: #6c591d; border-color: #6c591d; color: #c7bd9e; } +.darkness .alert-success { background-color: #3d7544; border-color: #3d7544; color: #c4efc5; } +.darkness .loginbox, .darkness .loginbox form { background-color: #202329 } +.darkness .loginbox .logo img { content: url("../images/misc/logo-navbar-white.png"); } +.darkness #mainloader { background-color: transparent !important; } +.darkness #FilesTable { border-bottom: 1px solid #202329 } +.darkness #mce-modal-block { background-color: #000; } +.darkness .resourceTable .panel-heading { margin-top: -1px !important; background-color: #202329; border-top: 1px solid #414449; border-bottom: 1px solid #414449; } +.darkness .panel-title > a { color: #aaa; } +.darkness .panel-title > a:hover { background: #202329; color: #eee; } +.darkness .resourceTable ul.elements > li { border-left: 3px solid transparent; border-bottom: 1px solid #303338; } +.darkness .resourceTable ul.elements > li:hover { background-color: #202329; } +.darkness .elements_descr { color: #aaa; } +.darkness ul.elements_buttonbar li a { color: inherit; } +.darkness .msg-container { color: inherit } +.darkness .evo-tooltip, .darkness .custom-tip { background-color: #343942; color: #eee; box-shadow: 0 0.5rem 3rem rgba(0, 0, 0, 0.4); } +.darkness div#section-body-categories div.uncategorized_elements, .darkness div#section-body-categories div.drop { border: 1px solid #414449; background-color: #202329; } +.darkness div#section-body-categories div.uncategorized_elements h2, .darkness div#section-body-categories div.drop h2 { color: #1976d2; border-bottom: 1px solid #1976d2; } +.darkness div#section-body-categories div.drag { background-color: #1976d2; } +.darkness #helpPane h1 { border-bottom: 1px solid #414449; } +.darkness #helpPane ul + h1 { margin-top: 1rem; } +.darkness #helpPane ul { margin: 0; } +.darkness #helpPane .tab-page > img:first-of-type { content: url("../images/misc/logo-navbar-white.png"); } +.darkness #helpPane pre { border: 1px solid #414449; padding: 1em; color: #aaa; } +.darkness code { background-color: #202329; border: 1px solid #414449; } +.darkness .h, .darkness .e, .darkness .v { background-color: #202329; border-color: #414449; color: #eee; } +.darkness .v { background-color: #282c34; } +.darkness tr:hover .e { background-color: #282c33; } +.darkness tr:hover .v { background-color: #2b3038; } +.darkness .dp_cal { box-shadow: 0 0.5rem 3rem rgba(0, 0, 0, 0.4); } +.darkness .dp_cal, .darkness .dp_cal .dp_empty { background-color: #343942; } +.darkness .dp_cal td.dp_roll { background-color: #202329; color: #aaa !important; } +.darkness .dp_cal td.dp_selected { background-color: #3189ba; color: #fff !important; } +.darkness ul.breadcrumbs a { color: #3481bc; } +.darkness #pagination li a { border: 1px solid #414449; color: #bbb; } +.darkness #pagination li.currentPage a, .darkness #pagination li a:hover { color: #eee; border: 1px solid #1976d2; } +.darkness h2[style="color:#003399"], .darkness h3[style="color:#003399"] { color: #f44336 !important; } +.darkness h3[style="color:#003399"] + div[style] { background-color: transparent !important; border-color: #f44336 !important; color: #f44336 !important; } +.darkness .mce-container, .darkness .mce-container *, .darkness .mce-widget, .darkness .mce-widget *, .darkness .mce-reset { color: #aaa; } +.darkness .mce-panel { background: #202329; border: none !important; } +.darkness .mce-reset .mce-panel { background: #1a1c21; } +.darkness .mce-btn { background-color: #202329; border-color: transparent; } +.darkness .mce-toolbar .mce-btn-group { border-color: #414449 !important; } +.darkness .mce-label { text-shadow: none; } +.darkness .mce-menu-item.mce-selected, .darkness .mce-menu-item:hover, .darkness .mce-menu-item:focus { background: #1976d2; } +.darkness .mce-menu-item.mce-selected .mce-text, .darkness .mce-menu-item.mce-selected .mce-ico, .darkness .mce-menu-item:hover .mce-text, .darkness .mce-menu-item:focus .mce-text, .darkness .mce-menu-item:hover .mce-ico, .darkness .mce-menu-item:focus .mce-ico { color: #fff; } +.darkness .mce-menu-item .mce-caret { border-left-color: #fff; } +.darkness .mce-tabs, .darkness .mce-tabs + .mce-container-body { background: #202329; } +.darkness .mce-tab { background: #202329; border-color: #414449; border-top: 1px solid transparent; text-shadow: none !important } +.darkness .mce-tab:hover { background-color: #1a1c21; } +.darkness .mce-tab:focus { color: #eee; } +.darkness .mce-tab.mce-active { border-top-color: #414449; } +.darkness .mce-tabs { border-bottom: 1px solid #414449; } +.darkness .mce-tab.mce-active { background-color: #202329; } +.darkness .mce-menu-item.mce-disabled, .darkness .mce-menu-item.mce-disabled:hover { background: #202329; } +.darkness .mce-menu-item.mce-disabled .mce-text, .darkness .mce-menu-item.mce-disabled:hover .mce-text, .darkness .mce-menu-item.mce-disabled .mce-ico, .darkness .mce-menu-item.mce-disabled:hover .mce-ico { color: #414449; } +.darkness .mce-window-head .mce-close { background-color: #6d1215 !important; } +.darkness .mce-window-head { background: #1a1c21; border: none; } +.darkness i.mce-i-checkbox, .darkness .mce-textbox, .darkness .mce-window-body .mce-btn, .darkness .mce-foot .mce-btn { background-color: #1a1c21; border: 1px solid #414449; } +.darkness .mce-btn:hover, .darkness .mce-btn:active { background: #282c34; border-color: #414449; } +.darkness .mce-btn:focus { background: #282c34; } +.darkness .mce-btn button { background-color: transparent } +.darkness .mce-splitbtn .mce-open:hover, .darkness .mce-splitbtn .mce-open:active, .darkness .mce-splitbtn:hover .mce-open, .darkness .mce-splitbtn.mce-active:hover .mce-open { border-left: 1px solid #3d4045; } +.darkness .mce-checked i.mce-i-checkbox { color: #aaa; } +.darkness .mce-textbox { font-family: monospace; } +.darkness::-webkit-scrollbar, .darkness::-webkit-scrollbar-thumb, .darkness *::-webkit-scrollbar, .darkness *::-webkit-scrollbar-thumb { width: 1rem; height: 1rem; background-color: transparent; border-radius: .5rem; border: .25rem solid transparent; } +.darkness:hover::-webkit-scrollbar-thumb, .darkness *:hover::-webkit-scrollbar-thumb { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); } +.darkness::-webkit-scrollbar-thumb:hover, .darkness *::-webkit-scrollbar-thumb:hover { box-shadow: inset 0 0 0 1rem rgba(255, 255, 255, 0.15); } +.darkness::-webkit-resizer, .darkness *::-webkit-resizer, .darkness::-webkit-scrollbar-corner, .darkness *::-webkit-scrollbar-corner { background-color: transparent; } /* [ OTHERS COMPONENTS ] - this components need fix css */ - /* extras */ - -.catalog_item select[name=link] { - width: auto !important; - margin-left: 0.5rem -} - +.catalog_item select[name=link] { width: auto !important; margin-left: 0.5rem } /* ManagerManager */ - -.sectionHeader.minimizable { - position: relative; - z-index: 1; - background-color: #fafafa; - padding: 0.5rem; - border: 1px solid rgba(0, 0, 0, 0.15); +.sectionHeader.minimizable { position: relative; z-index: 1; background-color: #fafafa; padding: 0.5rem; border: 1px solid rgba(0, 0, 0, 0.15); } +.dark .sectionHeader.minimizable { background-color: #f2f2f2 } +.imageField { min-width: 100% !important; width: 100% !important } +ul.mmTagList { float: left; margin-top: .25rem !important } - -.dark .sectionHeader.minimizable { - background-color: #f2f2f2 -} - -.imageField { - min-width: 100% !important; - width: 100% !important -} - -ul.mmTagList { - float: left; - margin-top: .25rem !important -} - /* MCE */ - -.mce-container, -.mce-container-body { - box-sizing: border-box !important -} - -.mce-container button { - border: none; - border-radius: 0; - background-color: transparent; -} - -.mce-window-head .mce-close { - padding: 0; -} - -#editorRow_TinyMCE { - background-color: #fff; -} - -#editorRow_TinyMCE tr { - border: 1px dotted rgba(0, 0, 0, .05); -} - -#editorRow_TinyMCE th { - white-space: nowrap -} - -#editorRow_TinyMCE th, -#editorRow_TinyMCE td { - padding: 0.5em; - border: none !important -} - +.mce-container, .mce-container-body { box-sizing: border-box !important } +.mce-container button { border: none; border-radius: 0; background-color: transparent; } +.mce-window-head .mce-close { padding: 0; } +#editorRow_TinyMCE { background-color: #fff; } +#editorRow_TinyMCE tr { border: 1px dotted rgba(0, 0, 0, .05); } +#editorRow_TinyMCE th { white-space: nowrap } +#editorRow_TinyMCE th, #editorRow_TinyMCE td { padding: 0.5em; border: none !important } /* wrap TinyMCE3 toolbar */ - -.mceEditor .mceToolbar td { - height: 24px; - float: left -} - +.mceEditor .mceToolbar td { height: 24px; float: left } /* codeMirror */ - -.CodeMirror { - width: 100%; - margin: 0 !important; -} - -.CodeMirror pre { - word-break: break-all !important; -} - -.CodeMirror > div:first-child > textarea { - /*opacity: 0;*/ - z-index: -1; - left: -9999rem; -} - -div.CodeMirror-cursors { - pointer-events: none; -} - +.CodeMirror { width: 100%; margin: 0 !important; } +.CodeMirror pre { word-break: break-all !important; } +.CodeMirror > div:first-child > textarea { /*opacity: 0;*/ +z-index: -1; left: -9999rem; } +div.CodeMirror-cursors { pointer-events: none; } /* docFinder */ - -form#docfinder div.tab-page { - height: auto !important -} - +form#docfinder div.tab-page { height: auto !important } /* SimpleGallery */ - -#SimpleGallery .pagination { - display: block -} - -#SimpleGallery .sg_image { - width: auto -} - +#SimpleGallery .pagination { display: block } +#SimpleGallery .sg_image { width: auto } /* multiTV */ - -.multitv .list li.element a.copy, -.multitv .list li.element a.remove { - width: 25px !important; - text-align: center; - background: transparent !important; - top: -10px !important; -} - +.multitv .list li.element a.copy, .multitv .list li.element a.remove { width: 25px !important; text-align: center; background: transparent !important; top: -10px !important; } .multitv .list li.element { - border-radius: .25rem; - border: 1px solid rgba(0, 0, 0, .125); - background: #fefefe !important; - margin-bottom: 10px !important; -} - +border-radius: .25rem; border: 1px solid rgba(0, 0, 0, .125); background: #fefefe !important; margin-bottom: 10px !important; } /* loginbox animation */ - @keyframes anim-loginbox { - from { - opacity: 0; - transform: translateY(30px); - } - to { - opacity: 1; - transform: translateY(0); - } +from { opacity: 0; transform: translateY(30px); } +to { opacity: 1; transform: translateY(0); } } - @-webkit-keyframes anim-loginbox { - from { - opacity: 0; - transform: translateY(30px); - } - to { - opacity: 1; - transform: translateY(0); - } -} - -.loginbox { - -webkit-animation-name: anim-loginbox; - -webkit-animation-duration: .5s; - -webkit-animation-iteration-count: 1; - -webkit-animation-timing-function: ease; - -webkit-animation-fill-mode: forwards; - -moz-animation-name: anim-loginbox; - -moz-animation-duration: .5s; - -moz-animation-iteration-count: 1; - -moz-animation-timing-function: ease; - -moz-animation-fill-mode: forwards; - animation-name: anim-loginbox; - animation-duration: .5s; - animation-iteration-count: 1; - animation-timing-function: ease; - animation-fill-mode: forwards; +from { opacity: 0; transform: translateY(30px); } +to { opacity: 1; transform: translateY(0); } } - +.loginbox { -webkit-animation-name: anim-loginbox; -webkit-animation-duration: .5s; -webkit-animation-iteration-count: 1; -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: forwards; -moz-animation-name: anim-loginbox; -moz-animation-duration: .5s; -moz-animation-iteration-count: 1; -moz-animation-timing-function: ease; -moz-animation-fill-mode: forwards; animation-name: anim-loginbox; animation-duration: .5s; animation-iteration-count: 1; animation-timing-function: ease; animation-fill-mode: forwards; } /* end loginbox animation */ - -#actions .dropdown-toggle:after { - display: none !important; -} - -.card .table.data { - margin-bottom: 0; - border-bottom-width: 0; -} - -.table.data th, -.table.data thead td { - border-bottom-width: 1px; -} - -.card .table.data > thead > tr:first-child td, -.card .table.data > thead > tr:first-child th, -.card .table.data > tbody > tr:first-child td, -.card .table.data > tbody > tr:first-child th { - border-top-width: 0; -} - -.table.data > tbody > tr, -.table.data > tbody > tr:nth-child(2n), -.widgets #modxrecent_widget .table.data tbody tr:nth-child(4n+1):not(:hover) { - background-color: #fff; -} - -.table.data > tbody > tr:hover { - background-color: rgba(0, 0, 0, 0.03) !important; -} - -ul.breadcrumbs { - margin: 0 0 1rem 0; - padding: .5rem 0.8rem; - line-height: normal; - font-size: .675rem; - color: #888; - border-width: 0; - background-image: linear-gradient(to right, rgba(0, 0, 0, 0.04), transparent 60%); -} - -ul.breadcrumbs a { - color: #333; -} - -#settingsPane [name="site_name"], -#settingsPane [name="emailsender"], -#settingsPane [name="emailsubject"], -#settingsPane [name="datepicker_offset"], -#settingsPane [name="editor_css_path"], -#settingsPane [name="safe_functions_at_eval"], -#settingsPane [name="valid_hostnames"], -#settingsPane [name="upload_files"], -#settingsPane [name="upload_images"], -#settingsPane [name="upload_media"], -#settingsPane [name="upload_flash"], -#settingsPane [name="txt_custom_contenttype"], -#settingsPane [name="filemanager_path"], -#settingsPane [name="rb_base_url"], -#settingsPane [name="rb_base_dir"], -#settingsPane [name="thumbsDir"], -input[name="photo"], -#range input#pids, -input[maxlength="350"], -textarea.mce, -#editorRow_TinyMCE { - width: 100% !important; -} - -#news .card-block > div, -#security .card-block > div { - padding: 0 !important; -} - -#news .card-block ul, -#security .card-block ul { - padding: 0; - margin: 0; -} - -#news .card-block ul li, -#security .card-block ul li { - padding: 0.75rem 1rem; - border-bottom: 1px solid #ebebeb; -} - -ul.mmTagList li { - padding: 2px 8px !important; - margin-bottom: 5px !important; - border-radius: 3px !important; - -webkit-border-radius: 3px !important; - background-color: #eaeaea !important; - text-decoration: none !important; -} - -ul.mmTagList li.tagSelected { - border-radius: 3px !important; - -webkit-border-radius: 3px !important; - background-color: #5a5e63 !important; -} +#actions .dropdown-toggle:after { display: none !important; } +.card .table.data { margin-bottom: 0; border-bottom-width: 0; } +.table.data th, .table.data thead td { border-bottom-width: 1px; } +.card .table.data > thead > tr:first-child td, .card .table.data > thead > tr:first-child th, .card .table.data > tbody > tr:first-child td, .card .table.data > tbody > tr:first-child th { border-top-width: 0; } +.table.data > tbody > tr, .table.data > tbody > tr:nth-child(2n), .widgets #modxrecent_widget .table.data tbody tr:nth-child(4n+1):not(:hover) { background-color: #fff; } +.table.data > tbody > tr:hover { background-color: rgba(0, 0, 0, 0.03) !important; } +ul.breadcrumbs { margin: 0 0 1rem 0; padding: .5rem 0.8rem; line-height: normal; font-size: .675rem; color: #888; border-width: 0; background-image: linear-gradient(to right, rgba(0, 0, 0, 0.04), transparent 60%); } +ul.breadcrumbs a { color: #333; } +#settingsPane [name="site_name"], #settingsPane [name="emailsender"], #settingsPane [name="emailsubject"], #settingsPane [name="datepicker_offset"], #settingsPane [name="editor_css_path"], #settingsPane [name="safe_functions_at_eval"], #settingsPane [name="valid_hostnames"], #settingsPane [name="upload_files"], #settingsPane [name="upload_images"], #settingsPane [name="upload_media"], #settingsPane [name="upload_flash"], #settingsPane [name="txt_custom_contenttype"], #settingsPane [name="filemanager_path"], #settingsPane [name="rb_base_url"], #settingsPane [name="rb_base_dir"], #settingsPane [name="thumbsDir"], input[name="photo"], #range input#pids, input[maxlength="350"], textarea.mce, #editorRow_TinyMCE { width: 100% !important; } +#news .card-block > div, #security .card-block > div { padding: 0 !important; } +#news .card-block ul, #security .card-block ul { padding: 0; margin: 0; } +#news .card-block ul li, #security .card-block ul li { padding: 0.75rem 1rem; border-bottom: 1px solid #ebebeb; } +ul.mmTagList li { padding: 2px 8px !important; margin-bottom: 5px !important; border-radius: 3px !important; -webkit-border-radius: 3px !important; background-color: #eaeaea !important; text-decoration: none !important; } +ul.mmTagList li.tagSelected { border-radius: 3px !important; -webkit-border-radius: 3px !important; background-color: #5a5e63 !important; } diff --git a/manager/media/style/default/css/fonts.css b/manager/media/style/default/css/fonts.css index 03cbc8c641..596ddb2854 100755 --- a/manager/media/style/default/css/fonts.css +++ b/manager/media/style/default/css/fonts.css @@ -1,497 +1,109 @@ -html { - font-size: 16px -} - +html { font-size: 16px } @media (max-width: 900px) { - html { - font-size: 16px; - } +html { font-size: 16px; } } - @media (max-width: 400px) { - html { - font-size: 16px; - } -} - -body { - font-weight: normal; - font-style: normal; - font-size: 0.8125rem; - line-height: 1.5; - font-family: sans-serif; - -webkit-font-smoothing: subpixel-antialiased +html { font-size: 16px; } } - +body { font-weight: normal; font-style: normal; font-size: 0.8125rem; line-height: 1.5; font-family: sans-serif; -webkit-font-smoothing: subpixel-antialiased } /* For Arabic Font */ - -html[lang="ar"] body, -html[lang="ary"] body, -html[lang="azb"] body, -html[lang="fa-IR"] body, -html[lang="haz"] body, -html[lang="ps"] body, -html[lang="ur"] body { - font-family: Tahoma, Arial, sans-serif; -} - +html[lang="ar"] body, html[lang="ary"] body, html[lang="azb"] body, html[lang="fa-IR"] body, html[lang="haz"] body, html[lang="ps"] body, html[lang="ur"] body { font-family: Tahoma, Arial, sans-serif; } /* For Chinese Font */ - -html[lang="zh"] body { - font-family: "PingFang SC", "Microsoft JhengHei", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", Helvetica, sans-serif; -} - +html[lang="zh"] body { font-family: "PingFang SC", "Microsoft JhengHei", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", Helvetica, sans-serif; } /* For Devanagari Font */ - -html[lang="bn-BD"] body, -html[lang="hi-IN"] body, -html[lang="mr-IN"] body { - font-family: Arial, sans-serif; -} - +html[lang="bn-BD"] body, html[lang="hi-IN"] body, html[lang="mr-IN"] body { font-family: Arial, sans-serif; } /* For Greek Font */ - -html[lang="el"] body { - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -} - +html[lang="el"] body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } /* For Gujarati Font */ - -html[lang="gu-IN"] body { - font-family: Arial, sans-serif; -} - +html[lang="gu-IN"] body { font-family: Arial, sans-serif; } /* For Hebrew Font */ - -html[lang="he"] body { - font-family: "Arial Hebrew", Arial, sans-serif; -} - +html[lang="he"] body { font-family: "Arial Hebrew", Arial, sans-serif; } /* For Japanese Font */ - -html[lang="ja"] body { - font-family: Meiryo, "Hiragino Kaku Gothic Pro", sans-serif; -} - +html[lang="ja"] body { font-family: Meiryo, "Hiragino Kaku Gothic Pro", sans-serif; } /* For Korean font */ - -html[lang="ko-KR"] body { - font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Nanum Gothic", Dotum, sans-serif; -} - +html[lang="ko-KR"] body { font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Nanum Gothic", Dotum, sans-serif; } /* For Thai Font */ - -html[lang="th"] body { - font-family: "Sukhumvit Set", "Helvetica Neue", Helvetica, Arial, sans-serif; -} - +html[lang="th"] body { font-family: "Sukhumvit Set", "Helvetica Neue", Helvetica, Arial, sans-serif; } /* For Arabic Font */ - -html[lang="fa"] body { - font-family: Tahoma, Arial, sans-serif; -} - -body { - background-color: #fafafa; - color: #444; -} - -body.drag *, -body.drag::after { - cursor: grabbing !important; - cursor: -moz-grabbing !important; - cursor: -webkit-grabbing !important; - cursor: -moz-grab !important; - -moz-user-select: none !important; - -webkit-user-select: none !important; - user-select: none !important -} - -body.drag::after { - bottom: 0; - content: ""; - left: 0; - position: fixed; - right: 0; - top: 0; - z-index: 999 -} - -body, -ul, -li { - padding: 0; - margin: 0; -} - -ul { - margin-left: 1rem; - margin-right: 1rem; -} - -li { - list-style: none -} - -img { - max-width: 100%; - height: auto -} - -.h1, -.h2, -.h3, -.h4, -.h5, -.h6, -h1, -h2, -h3, -h4, -h5, -h6 { - margin-bottom: .5rem; - font-family: inherit; - font-weight: 500; - line-height: 1.1; - color: inherit -} - -.h1, -h1 { - font-size: 1.75rem -} - -.h2, -h2 { - font-size: 1.5rem -} - -.h3, -h3 { - font-size: 1.25rem -} - -.h4, -h4 { - font-size: 1rem -} - -.h5, -h5 { - font-size: 0.8125rem -} - -.h6, -h6 { - font-size: 0.7rem -} - -h1 .fa:first-child { - display: none; -} - -a { - color: #3481bc; - text-decoration: none -} - -.text-primary { - color: #3481bc !important; -} - -a:focus, -a:hover { - color: #014c8c; - text-decoration: underline -} - -a[href=""], -a:not([href]) { - cursor: default -} - -a:not([href]):not([tabindex]) { - color: inherit; - text-decoration: none -} - -a:not([href]):not([tabindex]):focus, -a:not([href]):not([tabindex]):hover { - color: inherit; - text-decoration: none -} - -a:not([href]):not([tabindex]):focus { - outline: 0 -} - -* { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box -} - -*::-ms-clear { - display: none; -} - -.text-justify { - text-align: justify !important -} - -.text-nowrap { - white-space: nowrap !important -} - -.text-truncate { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap -} - -.text-left { - text-align: left !important -} - -.text-right { - text-align: right !important -} - -.text-center { - text-align: center !important -} - -.text-lowercase { - text-transform: lowercase !important -} - -.text-uppercase { - text-transform: uppercase !important -} - -.text-capitalize { - text-transform: capitalize !important -} - -.font-weight-normal { - font-weight: 400 -} - -.font-weight-bold { - font-weight: 700 -} - -.font-italic { - font-style: italic -} - -.text-white { - color: #fff !important -} - -.text-muted { - color: #818a91 !important -} - -.text-decoration-through { - text-decoration: line-through !important -} - -.text-underline { - text-decoration: underline !important -} - -a.text-underline:hover { - text-decoration: none !important -} - -a.text-muted:focus, -a.text-muted:hover { - color: #4b5257 !important -} - -.text-primary { - color: #0275d8 !important -} - -a.text-primary:focus, -a.text-primary:hover { - color: #025aa5 !important -} - -.text-success { - color: #5cb85c !important -} - -a.text-success:focus, -a.text-success:hover { - color: #449d44 !important -} - -.text-info { - color: #5bc0de !important -} - -a.text-info:focus, -a.text-info:hover { - color: #31b0d5 !important -} - -.text-warning { - color: #f0ad4e !important -} - -a.text-warning:focus, -a.text-warning:hover { - color: #ec971f !important -} - -.text-danger { - color: #d9534f !important -} - -a.text-danger:focus, -a.text-danger:hover { - color: #c9302c !important -} - -.text-gray-dark { - color: #292b2c !important -} - -a.text-gray-dark:focus, -a.text-gray-dark:hover { - color: #101112 !important -} - -.text-hide { - font: 0/0 a; - color: transparent; - text-shadow: none; - background-color: transparent; - border: 0 -} - -.hide { - display: none !important -} - -.show { - display: block !important -} - -.visible { - visibility: visible !important; -} - -.invisible { - visibility: hidden !important; -} - -.clear { - clear: both; -} - +html[lang="fa"] body { font-family: Tahoma, Arial, sans-serif; } +body { background-color: #fafafa; color: #444; } +body.drag *, body.drag::after { cursor: grabbing !important; cursor: -moz-grabbing !important; cursor: -webkit-grabbing !important; cursor: -moz-grab !important; -moz-user-select: none !important; -webkit-user-select: none !important; user-select: none !important } +body.drag::after { bottom: 0; content: ""; left: 0; position: fixed; right: 0; top: 0; z-index: 999 } +body, ul, li { padding: 0; margin: 0; } +ul { margin-left: 1rem; margin-right: 1rem; } +li { list-style: none } +img { max-width: 100%; height: auto } +.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 { +margin-bottom: .5rem; font-family: inherit; font-weight: 500; line-height: 1.1; color: inherit } +.h1, h1 { font-size: 1.75rem } +.h2, h2 { font-size: 1.5rem } +.h3, h3 { font-size: 1.25rem } +.h4, h4 { font-size: 1rem } +.h5, h5 { font-size: 0.8125rem } +.h6, h6 { font-size: 0.7rem } +h1 .fa:first-child { display: none; } +a { color: #3481bc; text-decoration: none } +.text-primary { color: #3481bc !important; } +a:focus, a:hover { color: #014c8c; text-decoration: underline } +a[href=""], a:not([href]) { cursor: default } +a:not([href]):not([tabindex]) { color: inherit; text-decoration: none } +a:not([href]):not([tabindex]):focus, a:not([href]):not([tabindex]):hover { color: inherit; text-decoration: none } +a:not([href]):not([tabindex]):focus { outline: 0 } +* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box } +*::-ms-clear { display: none; } +.text-justify { text-align: justify !important } +.text-nowrap { white-space: nowrap !important } +.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap } +.text-left { text-align: left !important } +.text-right { text-align: right !important } +.text-center { text-align: center !important } +.text-lowercase { text-transform: lowercase !important } +.text-uppercase { text-transform: uppercase !important } +.text-capitalize { text-transform: capitalize !important } +.font-weight-normal { font-weight: 400 } +.font-weight-bold { font-weight: 700 } +.font-italic { font-style: italic } +.text-white { color: #fff !important } +.text-muted { color: #818a91 !important } +.text-decoration-through { text-decoration: line-through !important } +.text-underline { text-decoration: underline !important } +a.text-underline:hover { text-decoration: none !important } +a.text-muted:focus, a.text-muted:hover { color: #4b5257 !important } +.text-primary { color: #0275d8 !important } +a.text-primary:focus, a.text-primary:hover { color: #025aa5 !important } +.text-success { color: #5cb85c !important } +a.text-success:focus, a.text-success:hover { color: #449d44 !important } +.text-info { color: #5bc0de !important } +a.text-info:focus, a.text-info:hover { color: #31b0d5 !important } +.text-warning { color: #f0ad4e !important } +a.text-warning:focus, a.text-warning:hover { color: #ec971f !important } +.text-danger { color: #d9534f !important } +a.text-danger:focus, a.text-danger:hover { color: #c9302c !important } +.text-gray-dark { color: #292b2c !important } +a.text-gray-dark:focus, a.text-gray-dark:hover { color: #101112 !important } +.text-hide { font: 0/0 a; color: transparent; text-shadow: none; background-color: transparent; border: 0 } +.hide { display: none !important } +.show { display: block !important } +.visible { visibility: visible !important; } +.invisible { visibility: hidden !important; } +.clear { clear: both; } /* custom */ - -#loadingmask { - display: none !important; -} - -.fa > .fa-lock { - position: relative; - float: left; - width: auto !important; - margin-top: -1em; - font-size: 0.7em !important; - color: #ffc107 !important; - -webkit-text-stroke: 1px rgba(0, 0, 0, 0.39); - text-stroke: 1px rgba(0, 0, 0, 0.39); -} - -.rotate180 { - -webkit-transform: rotate(180deg); - -moz-transform: rotate(180deg); - -ms-transform: rotate(180deg); - -o-transform: rotate(180deg); - transform: rotate(180deg); -} - -.disabledPlugin, -.disabledPlugin a { - color: #b68282; - font-style: italic; -} - -h1 { - font-size: 1.5em; - line-height: 1.5rem; - padding: 0.8rem; - margin: 0; -} - -h1 .fa { - margin-right: 0.25em; - color: #1377c5; -} - -h1 .help { - margin: 0 0 0 0.25em; - color: rgba(0, 0, 0, 0.15); - font-size: 0.8em; - cursor: pointer -} - -h1 .help:hover { - color: rgba(0, 0, 0, 0.3); -} - -h1 small { - margin-left: 0.5em; - line-height: 1em -} - -.split { - height: 0; - font-size: 0; - clear: both; - padding: 0; - border-top: 1px dotted rgba(0, 0, 0, .1) -} - -#previewIframe { - width: 100%; - height: 400px; -} - -.messageRead { - color: #333; -} - -.messageUnread { - color: #3cb371; - font-weight: 500; -} - -.element-edit-message { - display: none -} - -.element-edit-message p:last-child, -.element-edit-message-tab p:last-child { - margin-bottom: 0 -} - +#loadingmask { display: none !important; } +.fa > .fa-lock { position: relative; float: left; width: auto !important; margin-top: -1em; font-size: 0.7em !important; color: #ffc107 !important; -webkit-text-stroke: 1px rgba(0, 0, 0, 0.39); text-stroke: 1px rgba(0, 0, 0, 0.39); } +.rotate180 { -webkit-transform: rotate(180deg); -moz-transform: rotate(180deg); -ms-transform: rotate(180deg); -o-transform: rotate(180deg); transform: rotate(180deg); } +.disabledPlugin, .disabledPlugin a { color: #b68282; font-style: italic; } +h1 { font-size: 1.5em; line-height: 1.5rem; padding: 0.8rem; margin: 0; } +h1 .fa { margin-right: 0.25em; color: #1377c5; } +h1 .help { margin: 0 0 0 0.25em; color: rgba(0, 0, 0, 0.15); font-size: 0.8em; cursor: pointer } +h1 .help:hover { color: rgba(0, 0, 0, 0.3); } +h1 small { margin-left: 0.5em; line-height: 1em } +.split { height: 0; font-size: 0; clear: both; padding: 0; border-top: 1px dotted rgba(0, 0, 0, .1) } +#previewIframe { width: 100%; height: 400px; } +.messageRead { color: #333; } +.messageUnread { color: #3cb371; font-weight: 500; } +.element-edit-message { display: none } +.element-edit-message p:last-child, .element-edit-message-tab p:last-child { margin-bottom: 0 } /* modes theme */ - /* darkness */ - -.darkness h1 .help { - color: #1976d2; - opacity: .5; -} - -.darkness h1 .help:hover { - opacity: 1; -} +.darkness h1 .help { color: #1976d2; opacity: .5; } +.darkness h1 .help:hover { opacity: 1; } diff --git a/manager/media/style/default/css/forms.css b/manager/media/style/default/css/forms.css index 56a42072d7..c361076a4e 100755 --- a/manager/media/style/default/css/forms.css +++ b/manager/media/style/default/css/forms.css @@ -1,603 +1,90 @@ /* [ FORMS ] */ - -legend { - font-size: 1em; -} - -label { - cursor: pointer; - display: inline-block; - margin-bottom: .5em -} - -label:not([for]) { - cursor: default -} - -button, -input { - margin: 0; - padding: 0; - border: none; - font: inherit; - line-height: normal; -} - -input[type=checkbox], -input[type=radio] { - width: 0.8125rem !important; - height: 0.8125rem !important; - margin-right: 0.25em; - vertical-align: -0.15em; - border-radius: .1rem; - border: 1px solid #d4d4d4; - background: #fff no-repeat 50% -1em; - outline: none; - transition: border-color .2s, background-position .1s; -} - -input[type=checkbox] { - background-image: url("data:image/svg+xml;utf8,%3Csvg%20viewBox%3D%270%200%201792%201792%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M1671%20566q0%2040-28%2068l-724%20724-136%20136q-28%2028-68%2028t-68-28l-136-136-362-362q-28-28-28-68t28-68l136-136q28-28%2068-28t68%2028l294%20295%20656-657q28-28%2068-28t68%2028l136%20136q28%2028%2028%2068z%27%20fill%3D%27%23444%27/%3E%3C/svg%3E"); - background-size: 1em; -} - -input[type=radio] { - background-image: url("data:image/svg+xml;utf-8,%3Csvg%20viewBox%3D%270%200%201792%201792%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M1664%20896q0%20209-103%20385.5t-279.5%20279.5-385.5%20103-385.5-103-279.5-279.5-103-385.5%20103-385.5%20279.5-279.5%20385.5-103%20385.5%20103%20279.5%20279.5%20103%20385.5z%27%20fill%3D%27%23444%27/%3E%3C/svg%3E"); - background-size: .609375em; - border-radius: 50% -} - -input[type=checkbox]:hover, -input[type=radio]:hover { - border-color: #bcbcbc -} - -input[type=checkbox]:active, -input[type=radio]:active { - background-color: #fafafa; -} - -input[type=checkbox]:focus, -input[type=radio]:focus { - border-color: #4d8ef9 !important; - box-shadow: 0 0 0 1px rgba(77, 142, 249, 0.5) -} - -input[type=checkbox]:checked, -input[type=radio]:checked { - background-position: 50% 50% -} - -input[type=checkbox]:disabled { - background-image: url("data:image/svg+xml;utf8,%3Csvg%20viewBox%3D%270%200%201792%201792%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M1671%20566q0%2040-28%2068l-724%20724-136%20136q-28%2028-68%2028t-68-28l-136-136-362-362q-28-28-28-68t28-68l136-136q28-28%2068-28t68%2028l294%20295%20656-657q28-28%2068-28t68%2028l136%20136q28%2028%2028%2068z%27%20fill%3D%27%23bbb%27/%3E%3C/svg%3E"); - background-size: .875em; -} - -button, -input, -optgroup, -select, -textarea { - position: relative; - font-family: sans-serif; - font-size: 0.8125rem; - line-height: 1.23076923; - margin: 0; - -webkit-appearance: none; - -moz-appearance: none; -} - -.form-control, -input[type=text]:not(.form-control), -input[type=password], -input[type=number], -input[type=email], -input[type=date], -input[type=url], -input[type=search], -select, -textarea { - display: inline-block; - width: 100%; - max-width: 100%; - padding: 0.46153846em .5em; - line-height: 1.23076923; - vertical-align: inherit; - font-size: 0.8125rem; - color: #464a4c; - background-color: #fff; - -webkit-background-clip: padding-box; - background-clip: padding-box; - border: 1px solid #d4d4d4; - border-radius: .1em; - -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; - transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; - -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; -} - -.form-control:focus, -input:not([type=radio]):not([type=checkbox]):focus, -select:focus, -textarea:focus, -.btn.focus, -.btn:focus { - z-index: 3; - outline-offset: -1px; - outline: rgba(77, 142, 249, 0.5) solid 2px; - border-color: #66afe9; -} - -input:not([type=button]):not([type=submit]):hover:not(:focus), -select:hover:not(:focus), -textarea:hover:not(:focus) { - border-color: #bbb; - transition: border-color 0s, background-position .1s; -} - -.btn, -button:not(.btn), -input[type=button]:not(.btn), -input[type=submit]:not(.btn) { - display: inline-block; - padding: 0.46153846em 1em; - line-height: 1.23076923; - vertical-align: inherit; - text-align: center; - text-decoration: none !important; - font-size: 0.8125rem; - font-weight: 400; - white-space: nowrap; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - cursor: pointer; - background-color: #fff; - border: 1px solid #d4d4d4; - border-radius: .1em; - -webkit-transition: all .2s ease-in-out; - -o-transition: all .2s ease-in-out; - transition: all .2s ease-in-out -} - -select:not([size]):not([multiple]), -select.form-control:not([size]):not([multiple]), -select[size="1"]:not([multiple]) { - height: 2.3076923em; - line-height: 1.38461538 -} - -.form-control-sm, -.input-group-sm > .form-control, -.input-group-sm > .input-group-addon, -.input-group-sm > .input-group-btn > .btn, -input.form-control-sm, -.btn-group-sm > .btn, -.btn-sm, -.input-group-addon.form-control-sm, -.input-group-sm > .input-group-addon, -.input-group-sm > .input-group-btn > .input-group-addon.btn { - padding: 0.46153846em .5rem; - font-size: .6772rem; - border-radius: .1rem; -} - -.form-control-lg, -.input-group-lg > .form-control, -.input-group-lg > .input-group-addon, -.input-group-lg > .input-group-btn > .btn, -input.form-control-lg, -.btn-group-lg > .btn, -.btn-lg, -.input-group-addon.form-control-lg, -.input-group-lg > .input-group-addon, -.input-group-lg > .input-group-btn > .input-group-addon.btn { - padding: 0.46153846em .5rem; - font-size: 1.15rem; - border-radius: .1rem; -} - -.btn:hover, -input[type=button]:not(.btn):hover, -input[type=submit]:not(.btn):hover { - color: #292b2c; - background-color: #efefef; - border-color: #c3c3c3 -} - -.btn:focus, -input[type=button]:not(.btn):focus, -input[type=submit]:not(.btn):focus { - background-color: #e6e6e6; - border-color: #adadad -} - -.btn-primary { - color: #fff; - background-color: #0275d8; - border-color: #0275d8 -} - -.btn-primary:hover { - color: #fff; - background-color: #025aa5; - border-color: #01549b -} - -.btn-secondary { - color: #292b2c; - background-color: #fff; - border-color: #d4d4d4 -} - -.btn-secondary:hover { - color: #292b2c; - background-color: #e6e6e6; - border-color: #adadad -} - -.btn-success { - color: #fff; - background-color: #5cb85c; - border-color: #56ac56 -} - -.btn-success:hover { - color: #fff; - background-color: #449d44; - border-color: #419641 -} - -.btn-danger { - color: #fff; - background-color: #d9534f; - border-color: #d9534f -} - -.btn-danger:hover { - color: #fff; - background-color: #c9302c; - border-color: #c12e2a -} - -.btn-warning { - color: #fff; - background-color: #f0ad4e; - border-color: #f0ad4e; -} - -.btn-warning:hover { - color: #fff; - background-color: #ec971f; - border-color: #eb9316; -} - -.btn-info { - color: #fff; - background-color: #5bc0de; - border-color: #5bc0de; -} - -.btn-info:hover { - color: #fff; - background-color: #31b0d5; - border-color: #2aabd2; -} - -.btn-default { - color: #bbb; - background-color: #202329; - border-color: #202329 -} - -.btn-default:hover { - color: #fff; - background-color: #1a1c21; - border-color: #1a1c21 -} - -textarea, -textarea.form-control { - width: 100%; - line-height: 1.5; - overflow: auto; - resize: vertical -} - -select:not([size]):not([multiple]), -select[size="1"] { - padding-right: 2em !important; - background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTc5MiAxNzkyJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnPjxwYXRoIGQ9J00xMzk1IDczNnEwIDEzLTEwIDIzbC00NjYgNDY2cS0xMCAxMC0yMyAxMHQtMjMtMTBsLTQ2Ni00NjZxLTEwLTEwLTEwLTIzdDEwLTIzbDUwLTUwcTEwLTEwIDIzLTEwdDIzIDEwbDM5MyAzOTMgMzkzLTM5M3ExMC0xMCAyMy0xMHQyMyAxMGw1MCA1MHExMCAxMCAxMCAyM3onIGZpbGw9JyUyMzQ0NCcvPjwvc3ZnPg==") !important; - background-repeat: no-repeat; - background-position: right center; - background-size: 2em 1.3em -} - -select[size="1"]:not(.unstyled), -select[name="which_editor"] { -width: auto; -} - -optgroup { - font-style: normal; - font-weight: 500; - background-color: #ddd; -} - -optgroup option { - font-weight: normal; - background-color: #fff; -} - -input[type=color] { - width: 2.308em; - height: 2.308em; - -webkit-appearance: menulist; - -moz-appearance: menupopup -} - -input[type=range] { - -webkit-appearance: slider-horizontal; - -moz-appearance: initial; -} - -.input-group-addon { - padding: 0.46153846em .75em; - font-size: 0.8125rem; - border: 1px solid rgba(0, 0, 0, .15); - border-radius: .1em; -} - -.form-control.dropdown-item:focus, -.form-control.dropdown-item:hover { - background-color: inherit -} - -::-ms-value { - border: none; - margin: 0; - padding: 0 0 1px; - line-height: 1 -} - -select::-ms-expand { - display: none; -} - -::-moz-focus-inner { - border: 0; - padding: 0; -} - +legend { font-size: 1em; } +label { cursor: pointer; display: inline-block; margin-bottom: .5em } +label:not([for]) { cursor: default } +button, input { margin: 0; padding: 0; border: none; font: inherit; line-height: normal; } +input[type=checkbox], input[type=radio] { width: 0.8125rem !important; height: 0.8125rem !important; margin-right: 0.25em; vertical-align: -0.15em; border-radius: .1rem; +border: 1px solid #d4d4d4; background: #fff no-repeat 50% -1em; outline: none; transition: border-color .2s, background-position .1s; } +input[type=checkbox] { background-image: url("data:image/svg+xml;utf8,%3Csvg%20viewBox%3D%270%200%201792%201792%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M1671%20566q0%2040-28%2068l-724%20724-136%20136q-28%2028-68%2028t-68-28l-136-136-362-362q-28-28-28-68t28-68l136-136q28-28%2068-28t68%2028l294%20295%20656-657q28-28%2068-28t68%2028l136%20136q28%2028%2028%2068z%27%20fill%3D%27%23444%27/%3E%3C/svg%3E"); background-size: 1em; } +input[type=radio] { background-image: url("data:image/svg+xml;utf-8,%3Csvg%20viewBox%3D%270%200%201792%201792%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M1664%20896q0%20209-103%20385.5t-279.5%20279.5-385.5%20103-385.5-103-279.5-279.5-103-385.5%20103-385.5%20279.5-279.5%20385.5-103%20385.5%20103%20279.5%20279.5%20103%20385.5z%27%20fill%3D%27%23444%27/%3E%3C/svg%3E"); background-size: .609375em; border-radius: 50% } +input[type=checkbox]:hover, input[type=radio]:hover { border-color: #bcbcbc } +input[type=checkbox]:active, input[type=radio]:active { background-color: #fafafa; } +input[type=checkbox]:focus, input[type=radio]:focus { border-color: #4d8ef9 !important; box-shadow: 0 0 0 1px rgba(77, 142, 249, 0.5) } +input[type=checkbox]:checked, input[type=radio]:checked { background-position: 50% 50% } +input[type=checkbox]:disabled { background-image: url("data:image/svg+xml;utf8,%3Csvg%20viewBox%3D%270%200%201792%201792%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M1671%20566q0%2040-28%2068l-724%20724-136%20136q-28%2028-68%2028t-68-28l-136-136-362-362q-28-28-28-68t28-68l136-136q28-28%2068-28t68%2028l294%20295%20656-657q28-28%2068-28t68%2028l136%20136q28%2028%2028%2068z%27%20fill%3D%27%23bbb%27/%3E%3C/svg%3E"); background-size: .875em; } +button, input, optgroup, select, textarea { position: relative; font-family: sans-serif; font-size: 0.8125rem; line-height: 1.23076923; margin: 0; -webkit-appearance: none; -moz-appearance: none; } +.form-control, input[type=text]:not(.form-control), input[type=password], input[type=number], input[type=email], input[type=date], input[type=url], input[type=search], select, textarea { display: inline-block; width: 100%; max-width: 100%; padding: 0.46153846em .5em; line-height: 1.23076923; vertical-align: inherit; font-size: 0.8125rem; color: #464a4c; background-color: #fff; -webkit-background-clip: padding-box; background-clip: padding-box; border: 1px solid #d4d4d4; border-radius: .1em; -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; } +.form-control:focus, input:not([type=radio]):not([type=checkbox]):focus, select:focus, textarea:focus, .btn.focus, .btn:focus { z-index: 3; outline-offset: -1px; outline: rgba(77, 142, 249, 0.5) solid 2px; border-color: #66afe9; } +input:not([type=button]):not([type=submit]):hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: #bbb; transition: border-color 0s, background-position .1s; } +.btn, button:not(.btn), input[type=button]:not(.btn), input[type=submit]:not(.btn) { display: inline-block; padding: 0.46153846em 1em; line-height: 1.23076923; vertical-align: inherit; text-align: center; text-decoration: none !important; font-size: 0.8125rem; font-weight: 400; white-space: nowrap; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: pointer; background-color: #fff; border: 1px solid #d4d4d4; border-radius: .1em; -webkit-transition: all .2s ease-in-out; -o-transition: all .2s ease-in-out; transition: all .2s ease-in-out } +select:not([size]):not([multiple]), select.form-control:not([size]):not([multiple]), select[size="1"]:not([multiple]) { height: 2.3076923em; line-height: 1.38461538 } +.form-control-sm, .input-group-sm > .form-control, .input-group-sm > .input-group-addon, .input-group-sm > .input-group-btn > .btn, input.form-control-sm, .btn-group-sm > .btn, .btn-sm, .input-group-addon.form-control-sm, .input-group-sm > .input-group-addon, .input-group-sm > .input-group-btn > .input-group-addon.btn { padding: 0.46153846em .5rem; font-size: .6772rem; border-radius: .1rem; } +.form-control-lg, .input-group-lg > .form-control, .input-group-lg > .input-group-addon, .input-group-lg > .input-group-btn > .btn, input.form-control-lg, .btn-group-lg > .btn, .btn-lg, .input-group-addon.form-control-lg, .input-group-lg > .input-group-addon, .input-group-lg > .input-group-btn > .input-group-addon.btn { padding: 0.46153846em .5rem; font-size: 1.15rem; border-radius: .1rem; } +.btn:hover, input[type=button]:not(.btn):hover, input[type=submit]:not(.btn):hover { color: #292b2c; background-color: #efefef; border-color: #c3c3c3 } +.btn:focus, input[type=button]:not(.btn):focus, input[type=submit]:not(.btn):focus { background-color: #e6e6e6; border-color: #adadad } +.btn-primary { color: #fff; background-color: #0275d8; border-color: #0275d8 } +.btn-primary:hover { color: #fff; background-color: #025aa5; border-color: #01549b } +.btn-secondary { color: #292b2c; background-color: #fff; border-color: #d4d4d4 } +.btn-secondary:hover { color: #292b2c; background-color: #e6e6e6; border-color: #adadad } +.btn-success { color: #fff; background-color: #5cb85c; border-color: #56ac56 } +.btn-success:hover { color: #fff; background-color: #449d44; border-color: #419641 } +.btn-danger { color: #fff; background-color: #d9534f; border-color: #d9534f } +.btn-danger:hover { color: #fff; background-color: #c9302c; border-color: #c12e2a } +.btn-warning { color: #fff; background-color: #f0ad4e; border-color: #f0ad4e; } +.btn-warning:hover { color: #fff; background-color: #ec971f; border-color: #eb9316; } +.btn-info { color: #fff; background-color: #5bc0de; border-color: #5bc0de; } +.btn-info:hover { color: #fff; background-color: #31b0d5; border-color: #2aabd2; } +.btn-default { color: #bbb; background-color: #202329; border-color: #202329 } +.btn-default:hover { color: #fff; background-color: #1a1c21; border-color: #1a1c21 } +textarea, textarea.form-control { width: 100%; line-height: 1.5; overflow: auto; resize: vertical } +select:not([size]):not([multiple]), select[size="1"] { padding-right: 2em !important; background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTc5MiAxNzkyJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnPjxwYXRoIGQ9J00xMzk1IDczNnEwIDEzLTEwIDIzbC00NjYgNDY2cS0xMCAxMC0yMyAxMHQtMjMtMTBsLTQ2Ni00NjZxLTEwLTEwLTEwLTIzdDEwLTIzbDUwLTUwcTEwLTEwIDIzLTEwdDIzIDEwbDM5MyAzOTMgMzkzLTM5M3ExMC0xMCAyMy0xMHQyMyAxMGw1MCA1MHExMCAxMCAxMCAyM3onIGZpbGw9JyUyMzQ0NCcvPjwvc3ZnPg==") !important; background-repeat: no-repeat; background-position: right center; background-size: 2em 1.3em } +select[size="1"]:not(.unstyled), select[name="which_editor"] { width: auto; } +optgroup { font-style: normal; font-weight: 500; background-color: #ddd; } +optgroup option { font-weight: normal; background-color: #fff; } +input[type=color] { width: 2.308em; height: 2.308em; -webkit-appearance: menulist; -moz-appearance: menupopup } +input[type=range] { -webkit-appearance: slider-horizontal; -moz-appearance: initial; } +.input-group-addon { padding: 0.46153846em .75em; font-size: 0.8125rem; border: 1px solid rgba(0, 0, 0, .15); border-radius: .1em; } +.form-control.dropdown-item:focus, .form-control.dropdown-item:hover { background-color: inherit } +::-ms-value { border: none; margin: 0; padding: 0 0 1px; line-height: 1 } +select::-ms-expand { display: none; } +::-moz-focus-inner { border: 0; padding: 0; } @-moz-document url-prefix() { - select:not([size]):not([multiple]) { - text-indent: -2px - } +select:not([size]):not([multiple]) { text-indent: -2px } } - /* darkness */ - -.darkness .form-control, -.darkness input[type=text]:not(.form-control), -.darkness input[type=password], -.darkness input[type=number], -.darkness input[type=email], -.darkness input[type=date], -.darkness input[type=url], -.darkness input[type=search], -.darkness select, -.darkness textarea, -.darkness .btn, -.darkness button:not(.btn), -.darkness input[type=button]:not(.btn), -.darkness input[type=submit]:not(.btn), -.darkness .input-group-addon { - border-color: #414449; - background-color: #202329; - color: #bbb; -} - -.darkness input:not([type=button]):not([type=submit]):hover:not(:focus), -.darkness select:hover:not(:focus), -.darkness textarea:hover:not(:focus) { - border-color: #5d5d5d -} - -.darkness .btn:hover, -.darkness input[type=button]:not(.btn):hover, -.darkness input[type=submit]:not(.btn):hover, -.darkness .input-group-addon:hover { - border-color: #414449; - background-color: #282c34; - color: #eee; -} - -.darkness .btn-primary { - color: #fff; - background-color: #0275d8; - border-color: #0275d8 -} - -.darkness .btn-primary:hover { - color: #fff; - background-color: #025aa5; - border-color: #01549b -} - -.darkness .btn-secondary.active.focus, -.darkness .btn-secondary.active:focus, -.darkness .btn-secondary.active:hover, -.darkness .btn-secondary:active.focus, -.darkness .btn-secondary:active:focus, -.darkness .btn-secondary:active:hover, -.darkness .open > .btn-secondary.dropdown-toggle.focus, -.darkness .open > .btn-secondary.dropdown-toggle:focus, -.darkness .open > .btn-secondary.dropdown-toggle:hover, -.darkness .btn-secondary.focus, -.darkness .btn-secondary:focus { - border-color: #414449; - background-color: #1a1c21; - color: #eee; -} - -.darkness .btn-success { - color: #fff; - background-color: #428743; - border-color: #479048; -} - -.darkness .btn-success.active, -.darkness .btn-success:active, -.darkness .open > .btn-success.dropdown-toggle { - color: #fff; - border-color: #419641; - background: #448546 none; -} - -.darkness .btn-success:hover { - color: #fff; - background-color: #39773a; - border-color: #39773a; -} - -.darkness .btn-danger { - color: #fff; - background-color: #d9534f; - border-color: #d9534f -} - -.darkness .btn-danger:hover { - color: #fff; - background-color: #c9302c; - border-color: #c12e2a -} - -.darkness .btn-warning { - color: #fff; - background-color: #f0ad4e; - border-color: #f0ad4e; -} - -.darkness .btn-warning:hover { - color: #fff; - background-color: #ec971f; - border-color: #eb9316; -} - -.darkness .btn-info { - color: #fff; - background-color: #5bc0de; - border-color: #5bc0de; -} - -.darkness .btn-info:hover { - color: #fff; - background-color: #31b0d5; - border-color: #2aabd2; -} - -.darkness .btn-default { - color: #bbb; - background-color: #202329; - border-color: #202329 -} - -.darkness .btn-default:hover { - color: #fff; - background-color: #1a1c21; - border-color: #1a1c21 -} - -.darkness #actions { - right: 0; - background-color: #282c34 -} - -.darkness #actions .btn-group .btn-success { - box-shadow: none -} - -.darkness #actions .dropdown-menu .btn { - background-color: #343942; - border-radius: 0; - color: #fff; -} - -.darkness #actions .dropdown-menu .btn:hover { - background-color: #3c424e; - color: #fff -} - -.darkness optgroup { - background-color: #202329 -} - -.darkness optgroup option { - background-color: #1a1c21 -} - -.darkness .float-xs-right > select { - width: auto -} - -.darkness input[type=checkbox], -.darkness input[type=radio] { - border: 1px solid #414449; - background-color: #202329 -} - -.darkness input[type=checkbox]:checked, -.darkness input[type=radio]:checked { - background-color: #ffc107; - border-color: #ffc107 !important -} - -.darkness input[type=checkbox]:checked:hover, -.darkness input[type=radio]:checked:hover { - box-shadow: 0 0 .5em #ffc107 -} - -.darkness input[type=checkbox]:checked + label { - background-color: transparent !important; - color: #fff; -} - -.darkness input[type=checkbox] + label:hover { - color: #fff; -} - -.darkness input[type=checkbox]:disabled, -.darkness input[type=radio]:disabled, -.darkness input[type=checkbox]:checked:disabled, -.darkness input[type=radio]:checked:disabled { - background-color: #282c34; - border-color: #414449 !important; - box-shadow: none !important; -} - -.darkness select:not([size]):not([multiple]), -.darkness select[size="1"] { - background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTc5MiAxNzkyJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIGZpbGw9JyNlZWUnPjxwYXRoIGQ9J00xMzk1IDczNnEwIDEzLTEwIDIzbC00NjYgNDY2cS0xMCAxMC0yMyAxMHQtMjMtMTBsLTQ2Ni00NjZxLTEwLTEwLTEwLTIzdDEwLTIzbDUwLTUwcTEwLTEwIDIzLTEwdDIzIDEwbDM5MyAzOTMgMzkzLTM5M3ExMC0xMCAyMy0xMHQyMyAxMGw1MCA1MHExMCAxMCAxMCAyM3onLz48L3N2Zz4=") !important; - background-repeat: no-repeat; -} - -.darkness input:-webkit-autofill, -.darkness textarea:-webkit-autofill, -.darkness select:-webkit-autofill, -.darkness input:-webkit-autofill:focus { - border-color: #ffc107 !important; - -webkit-animation-name: autofill; - -webkit-animation-fill-mode: both; - outline: none -} - -.darkness input:-webkit-autofill:focus { - box-shadow: 0 0 0.5em #ffc107; -} - +.darkness .form-control, .darkness input[type=text]:not(.form-control), .darkness input[type=password], .darkness input[type=number], .darkness input[type=email], .darkness input[type=date], .darkness input[type=url], .darkness input[type=search], .darkness select, .darkness textarea, .darkness .btn, .darkness button:not(.btn), .darkness input[type=button]:not(.btn), .darkness input[type=submit]:not(.btn), .darkness .input-group-addon { border-color: #414449; background-color: #202329; color: #bbb; } +.darkness input:not([type=button]):not([type=submit]):hover:not(:focus), .darkness select:hover:not(:focus), .darkness textarea:hover:not(:focus) { border-color: #5d5d5d } +.darkness .btn:hover, .darkness input[type=button]:not(.btn):hover, .darkness input[type=submit]:not(.btn):hover, .darkness .input-group-addon:hover { border-color: #414449; background-color: #282c34; color: #eee; } +.darkness .btn-primary { color: #fff; background-color: #0275d8; border-color: #0275d8 } +.darkness .btn-primary:hover { color: #fff; background-color: #025aa5; border-color: #01549b } +.darkness .btn-secondary.active.focus, .darkness .btn-secondary.active:focus, .darkness .btn-secondary.active:hover, .darkness .btn-secondary:active.focus, .darkness .btn-secondary:active:focus, .darkness .btn-secondary:active:hover, .darkness .open > .btn-secondary.dropdown-toggle.focus, .darkness .open > .btn-secondary.dropdown-toggle:focus, .darkness .open > .btn-secondary.dropdown-toggle:hover, .darkness .btn-secondary.focus, .darkness .btn-secondary:focus { border-color: #414449; background-color: #1a1c21; color: #eee; } +.darkness .btn-success { color: #fff; background-color: #428743; border-color: #479048; } +.darkness .btn-success.active, .darkness .btn-success:active, .darkness .open > .btn-success.dropdown-toggle { color: #fff; border-color: #419641; background: #448546 none; } +.darkness .btn-success:hover { color: #fff; background-color: #39773a; border-color: #39773a; } +.darkness .btn-danger { color: #fff; background-color: #d9534f; border-color: #d9534f } +.darkness .btn-danger:hover { color: #fff; background-color: #c9302c; border-color: #c12e2a } +.darkness .btn-warning { color: #fff; background-color: #f0ad4e; border-color: #f0ad4e; } +.darkness .btn-warning:hover { color: #fff; background-color: #ec971f; border-color: #eb9316; } +.darkness .btn-info { color: #fff; background-color: #5bc0de; border-color: #5bc0de; } +.darkness .btn-info:hover { color: #fff; background-color: #31b0d5; border-color: #2aabd2; } +.darkness .btn-default { color: #bbb; background-color: #202329; border-color: #202329 } +.darkness .btn-default:hover { color: #fff; background-color: #1a1c21; border-color: #1a1c21 } +.darkness #actions { right: 0; background-color: #282c34 } +.darkness #actions .btn-group .btn-success { box-shadow: none } +.darkness #actions .dropdown-menu .btn { background-color: #343942; border-radius: 0; color: #fff; } +.darkness #actions .dropdown-menu .btn:hover { background-color: #3c424e; color: #fff } +.darkness optgroup { background-color: #202329 } +.darkness optgroup option { background-color: #1a1c21 } +.darkness .float-xs-right > select { width: auto } +.darkness input[type=checkbox], .darkness input[type=radio] { border: 1px solid #414449; background-color: #202329 } +.darkness input[type=checkbox]:checked, .darkness input[type=radio]:checked { background-color: #ffc107; border-color: #ffc107 !important } +.darkness input[type=checkbox]:checked:hover, .darkness input[type=radio]:checked:hover { box-shadow: 0 0 .5em #ffc107 } +.darkness input[type=checkbox]:checked + label { background-color: transparent !important; color: #fff; } +.darkness input[type=checkbox] + label:hover { color: #fff; } +.darkness input[type=checkbox]:disabled, .darkness input[type=radio]:disabled, .darkness input[type=checkbox]:checked:disabled, .darkness input[type=radio]:checked:disabled { background-color: #282c34; border-color: #414449 !important; box-shadow: none !important; } +.darkness select:not([size]):not([multiple]), .darkness select[size="1"] { background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTc5MiAxNzkyJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIGZpbGw9JyNlZWUnPjxwYXRoIGQ9J00xMzk1IDczNnEwIDEzLTEwIDIzbC00NjYgNDY2cS0xMCAxMC0yMyAxMHQtMjMtMTBsLTQ2Ni00NjZxLTEwLTEwLTEwLTIzdDEwLTIzbDUwLTUwcTEwLTEwIDIzLTEwdDIzIDEwbDM5MyAzOTMgMzkzLTM5M3ExMC0xMCAyMy0xMHQyMyAxMGw1MCA1MHExMCAxMCAxMCAyM3onLz48L3N2Zz4=") !important; background-repeat: no-repeat; } +.darkness input:-webkit-autofill, .darkness textarea:-webkit-autofill, .darkness select:-webkit-autofill, .darkness input:-webkit-autofill:focus { border-color: #ffc107 !important; -webkit-animation-name: autofill; -webkit-animation-fill-mode: both; outline: none } +.darkness input:-webkit-autofill:focus { box-shadow: 0 0 0.5em #ffc107; } @-webkit-keyframes autofill { - to { - color: #bbb; - background: transparent; - } +to { color: #bbb; background: transparent; } } diff --git a/manager/media/style/default/css/index.css b/manager/media/style/default/css/index.css index 244977fe48..273b2a5f9c 100755 --- a/manager/media/style/default/css/index.css +++ b/manager/media/style/default/css/index.css @@ -1,262 +1,48 @@ -#frameset { - position: absolute; - left: 0; - top: 0; - right: 0; - bottom: 0; - overflow: hidden; -} - -#mainMenu, -#tree, -#main { - position: absolute; -} - -#mainMenu { - top: 0; - left: 0; - width: 100%; - height: 2.2rem; - z-index: 100; -} - -#tree { - left: 0; - top: 2.2rem; - bottom: 0; - width: 25rem; - max-width: 100%; - overflow: hidden; - z-index: 2; -} - -#main { - left: 25rem; - top: 2.2rem; - right: 0; - bottom: 0; - z-index: 1; -} - -#main #mainframe { - display: block; - position: absolute; - width: 100%; - height: 100%; - overflow: auto; -} - +#frameset { position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; } +#mainMenu, #tree, #main { position: absolute; } +#mainMenu { top: 0; left: 0; width: 100%; height: 2.2rem; z-index: 100; } +#tree { left: 0; top: 2.2rem; bottom: 0; width: 25rem; max-width: 100%; overflow: hidden; z-index: 2; } +#main { left: 25rem; top: 2.2rem; right: 0; bottom: 0; z-index: 1; } +#main #mainframe { display: block; position: absolute; width: 100%; height: 100%; overflow: auto; } /* floater */ - -#floater { - position: fixed; - z-index: 1000; - opacity: 0; - visibility: hidden; - max-width: 20rem; - padding: 1.5rem; - top: 4rem; - left: 2rem; - border-radius: 0.25rem; - background-color: #fff; - -webkit-box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); - box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); - transition-duration: 0.15s -} - -#floater.show { - opacity: 1; - visibility: visible; -} - +#floater { position: fixed; z-index: 1000; opacity: 0; visibility: hidden; max-width: 20rem; padding: 1.5rem; top: 4rem; left: 2rem; border-radius: 0.25rem; background-color: #fff; -webkit-box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); transition-duration: 0.15s } +#floater.show { opacity: 1; visibility: visible; } /*resizer*/ - -#resizer { - position: absolute; - z-index: 99; - top: 2.2rem; - bottom: 0; - left: 25rem; - width: 5px; - margin-left: -1px; - cursor: col-resize; - background-color: transparent; - transition: background-color .3s -} - -#resizer:hover { - background-color: rgba(0, 0, 0, 0.1); -} - -#mask_resizer { - position: absolute; - width: 100%; - height: 100%; -} - +#resizer { position: absolute; z-index: 99; top: 2.2rem; bottom: 0; left: 25rem; width: 5px; margin-left: -1px; cursor: col-resize; background-color: transparent; transition: background-color .3s } +#resizer:hover { background-color: rgba(0, 0, 0, 0.1); } +#mask_resizer { position: absolute; width: 100%; height: 100%; } /* mainloader */ - -#mainloader { - position: absolute; - z-index: 50000; - top: 0; - left: 0; - width: 100%; - height: 100%; - text-align: center; - vertical-align: middle; - padding: 15% 0 0 0; - background-color: rgba(255, 255, 255, 0.64); - opacity: 0; - visibility: hidden; - -webkit-transition-duration: 0.3s; - transition-duration: 0.3s -} - -#mainloader.show { - opacity: 0.75; - visibility: visible; - -webkit-transition-duration: 0.1s; - transition-duration: 0.1s -} - -#mainloader::before { - content: ""; - display: block; - position: absolute; - z-index: 1; - left: 50%; - top: 30%; - width: 120px; - height: 120px; - margin: -60px 0 0 -60px; - border-radius: 50%; - animation: rotate 2s linear infinite; - box-shadow: 5px 5px 0 0 rgb(234, 132, 82), 14px -7px 0 0 rgba(111, 163, 219, 0.7), -7px 11px 0 0 rgba(112, 193, 92, 0.74), -11px -7px 0 0 rgba(147, 205, 99, 0.78); -} - -.sidebar-closed #tree { - width: 0 !important; -} - -.sidebar-closed #main, -.sidebar-closed #resizer { - left: 0 !important; -} - +#mainloader { position: absolute; z-index: 50000; top: 0; left: 0; width: 100%; height: 100%; text-align: center; vertical-align: middle; padding: 15% 0 0 0; background-color: rgba(255, 255, 255, 0.64); opacity: 0; visibility: hidden; -webkit-transition-duration: 0.3s; transition-duration: 0.3s } +#mainloader.show { opacity: 0.75; visibility: visible; -webkit-transition-duration: 0.1s; transition-duration: 0.1s } +#mainloader::before { content: ""; display: block; position: absolute; z-index: 1; left: 50%; top: 30%; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; animation: rotate 2s linear infinite; box-shadow: 5px 5px 0 0 rgb(234, 132, 82), 14px -7px 0 0 rgba(111, 163, 219, 0.7), -7px 11px 0 0 rgba(112, 193, 92, 0.74), -11px -7px 0 0 rgba(147, 205, 99, 0.78); } +.sidebar-closed #tree { width: 0 !important; } +.sidebar-closed #main, .sidebar-closed #resizer { left: 0 !important; } @media (min-width: 1200px) { - #mainMenu { - height: 2.5rem; - } - #tree, - #main { - top: 2.5rem; - } +#mainMenu { height: 2.5rem; } +#tree, #main { top: 2.5rem; } } - @media (max-width: 840px) { - #floater { - left: 0; - right: 0; - margin: 0 auto; - } - #resizer { - display: none - } - #frameset #mask_resizer { - z-index: 3 !important; - opacity: 0.5; - visibility: visible; - background-color: #000; - -webkit-transition: 0.2s; - transition: 0.2s - } - .sidebar-closed #frameset #mask_resizer { - opacity: 0; - visibility: hidden; - } - #tree { - z-index: 5; - width: 100% !important; - max-width: 20rem; - box-shadow: 0 0 1rem rgba(0, 0, 0, 0.25); - -webkit-transition: 0.25s; - transition: 0.25s - } - .sidebar-closed #tree { - width: auto !important; - box-shadow: none; - -webkit-transform: translate3d(-100%, 0, 0); - transform: translate3d(-100%, 0, 0); - } - #tree .treeframebody { - box-shadow: none - } - .sidebar-closed #main::after { - content: ""; - position: absolute; - z-index: 1; - left: 0; - top: 6rem; - bottom: 0; - width: 1rem; - } - #main { - left: 0 !important; - } - #main::before { - content: ""; - position: absolute; - z-index: 9999; - left: 0; - top: 0; - right: 0; - bottom: 0; - background-color: rgba(0, 0, 0, 0); - } - .sidebar-closed #mainMenu:not(.show) + #tree + #main::before { - display: none - } +#floater { left: 0; right: 0; margin: 0 auto; } +#resizer { display: none } +#frameset #mask_resizer { z-index: 3 !important; opacity: 0.5; visibility: visible; background-color: #000; -webkit-transition: 0.2s; transition: 0.2s } +.sidebar-closed #frameset #mask_resizer { opacity: 0; visibility: hidden; } +#tree { z-index: 5; width: 100% !important; max-width: 20rem; box-shadow: 0 0 1rem rgba(0, 0, 0, 0.25); -webkit-transition: 0.25s; transition: 0.25s } +.sidebar-closed #tree { width: auto !important; box-shadow: none; -webkit-transform: translate3d(-100%, 0, 0); transform: translate3d(-100%, 0, 0); } +#tree .treeframebody { box-shadow: none } +.sidebar-closed #main::after { content: ""; position: absolute; z-index: 1; left: 0; top: 6rem; bottom: 0; width: 1rem; } +#main { left: 0 !important; } +#main::before { content: ""; position: absolute; z-index: 9999; left: 0; top: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0); } +.sidebar-closed #mainMenu:not(.show) + #tree + #main::before { display: none } } - @keyframes rotate { - to { - transform: rotate(360deg) - } +to { transform: rotate(360deg) } } - /* dark */ - -.dark #frameset { - background-color: #202329 -} - -.dark #main { - background-color: #ecf0f1 -} - -.dark #mainloader { - background-color: rgba(0, 0, 0, 0.1); -} - +.dark #frameset { background-color: #202329 } +.dark #main { background-color: #ecf0f1 } +.dark #mainloader { background-color: rgba(0, 0, 0, 0.1); } /* darkness */ - -.darkness { - letter-spacing: .021em; -} - -.darkness #mainloader { - background-color: rgba(0, 0, 0, 0.1); -} - -.darkness, -.darkness #frameset, -.darkness #main { - background-color: #282c34; - color: #bdbdbd; -} - -.darkness > form { - background-color: #202329 -} +.darkness { letter-spacing: .021em; } +.darkness #mainloader { background-color: rgba(0, 0, 0, 0.1); } +.darkness, .darkness #frameset, .darkness #main { background-color: #282c34; color: #bdbdbd; } +.darkness > form { background-color: #202329 } diff --git a/manager/media/style/default/css/layout.css b/manager/media/style/default/css/layout.css index 05bf9d5463..173a9bcd6c 100755 --- a/manager/media/style/default/css/layout.css +++ b/manager/media/style/default/css/layout.css @@ -1,151 +1,29 @@ -.layout { - display: table; - table-layout: fixed; - height: 100%; - width: 100% -} - -.layout > .layout-row { - display: table-row; - vertical-align: top; - height: 100% -} - -.layout > .layout-row > .layout-cell { - display: table-cell; - vertical-align: top; - height: 100% -} - -.layout > .layout-row > .layout-cell.layout-container, -.layout > .layout-row > .layout-cell .layout-container, -.layout > .layout-row > .layout-cell.padded-container, -.layout > .layout-row > .layout-cell .padded-container { - padding: 1rem 1rem 0 1rem -} - -.layout > .layout-row > .layout-cell.layout-container .container-flush, -.layout > .layout-row > .layout-cell .layout-container .container-flush, -.layout > .layout-row > .layout-cell.padded-container .container-flush, -.layout > .layout-row > .layout-cell .padded-container .container-flush { - padding-top: 0 -} - -.layout > .layout-row > .layout-cell .layout-relative { - position: relative; - height: 100% -} - -.layout > .layout-row > .layout-cell .layout-absolute { - position: absolute; - height: 100%; - width: 100% -} - -.layout > .layout-row > .layout-cell.min-size { - width: 0 -} - -.layout > .layout-row > .layout-cell.min-height { - height: 0 -} - -.layout > .layout-row > .layout-cell.center { - text-align: center -} - -.layout > .layout-row > .layout-cell.middle { - vertical-align: middle -} - -.layout > .layout-row > .layout-cell.layout-container, -.layout > .layout-row > .layout-cell .layout-container, -.layout > .layout-row > .layout-cell.padded-container, -.layout > .layout-row > .layout-cell .padded-container { - padding: 1rem 1rem 0 1rem -} - -.layout > .layout-row > .layout-cell.layout-container .container-flush, -.layout > .layout-row > .layout-cell .layout-container .container-flush, -.layout > .layout-row > .layout-cell.padded-container .container-flush, -.layout > .layout-row > .layout-cell .padded-container .container-flush { - padding-top: 0 -} - -.layout > .layout-row > .layout-cell .layout-relative { - position: relative; - height: 100% -} - -.layout > .layout-row > .layout-cell .layout-absolute { - position: absolute; - height: 100%; - width: 100% -} - -.layout > .layout-row > .layout-cell.min-size { - width: 0 -} - -.layout > .layout-row > .layout-cell.min-height { - height: 0 -} - -.layout > .layout-row > .layout-cell.center { - text-align: center -} - -.layout > .layout-row > .layout-cell.middle { - vertical-align: middle -} - -.layout > .layout-row.min-size { - height: 0 -} - -.layout > .layout-cell { - display: table-cell; - vertical-align: top; - height: 100% -} - -.layout > .layout-cell.layout-container, -.layout > .layout-cell .layout-container, -.layout > .layout-cell.padded-container, -.layout > .layout-cell .padded-container { - padding: 1rem 1rem 0 1rem -} - -.layout > .layout-cell.layout-container .container-flush, -.layout > .layout-cell .layout-container .container-flush, -.layout > .layout-cell.padded-container .container-flush, -.layout > .layout-cell .padded-container .container-flush { - padding-top: 0 -} - -.layout > .layout-cell .layout-relative { - position: relative; - height: 100% -} - -.layout > .layout-cell .layout-absolute { - position: absolute; - height: 100%; - width: 100% -} - -.layout > .layout-cell.min-size { - width: 0 -} - -.layout > .layout-cell.min-height { - height: 0 -} - -.layout > .layout-cell.center { - text-align: center -} - -.layout > .layout-cell.middle { - vertical-align: middle -} +.layout { display: table; table-layout: fixed; height: 100%; width: 100% } +.layout > .layout-row { display: table-row; vertical-align: top; height: 100% } +.layout > .layout-row > .layout-cell { display: table-cell; vertical-align: top; height: 100% } +.layout > .layout-row > .layout-cell.layout-container, .layout > .layout-row > .layout-cell .layout-container, .layout > .layout-row > .layout-cell.padded-container, .layout > .layout-row > .layout-cell .padded-container { padding: 1rem 1rem 0 1rem } +.layout > .layout-row > .layout-cell.layout-container .container-flush, .layout > .layout-row > .layout-cell .layout-container .container-flush, .layout > .layout-row > .layout-cell.padded-container .container-flush, .layout > .layout-row > .layout-cell .padded-container .container-flush { padding-top: 0 } +.layout > .layout-row > .layout-cell .layout-relative { position: relative; height: 100% } +.layout > .layout-row > .layout-cell .layout-absolute { position: absolute; height: 100%; width: 100% } +.layout > .layout-row > .layout-cell.min-size { width: 0 } +.layout > .layout-row > .layout-cell.min-height { height: 0 } +.layout > .layout-row > .layout-cell.center { text-align: center } +.layout > .layout-row > .layout-cell.middle { vertical-align: middle } +.layout > .layout-row > .layout-cell.layout-container, .layout > .layout-row > .layout-cell .layout-container, .layout > .layout-row > .layout-cell.padded-container, .layout > .layout-row > .layout-cell .padded-container { padding: 1rem 1rem 0 1rem } +.layout > .layout-row > .layout-cell.layout-container .container-flush, .layout > .layout-row > .layout-cell .layout-container .container-flush, .layout > .layout-row > .layout-cell.padded-container .container-flush, .layout > .layout-row > .layout-cell .padded-container .container-flush { padding-top: 0 } +.layout > .layout-row > .layout-cell .layout-relative { position: relative; height: 100% } +.layout > .layout-row > .layout-cell .layout-absolute { position: absolute; height: 100%; width: 100% } +.layout > .layout-row > .layout-cell.min-size { width: 0 } +.layout > .layout-row > .layout-cell.min-height { height: 0 } +.layout > .layout-row > .layout-cell.center { text-align: center } +.layout > .layout-row > .layout-cell.middle { vertical-align: middle } +.layout > .layout-row.min-size { height: 0 } +.layout > .layout-cell { display: table-cell; vertical-align: top; height: 100% } +.layout > .layout-cell.layout-container, .layout > .layout-cell .layout-container, .layout > .layout-cell.padded-container, .layout > .layout-cell .padded-container { padding: 1rem 1rem 0 1rem } +.layout > .layout-cell.layout-container .container-flush, .layout > .layout-cell .layout-container .container-flush, .layout > .layout-cell.padded-container .container-flush, .layout > .layout-cell .padded-container .container-flush { padding-top: 0 } +.layout > .layout-cell .layout-relative { position: relative; height: 100% } +.layout > .layout-cell .layout-absolute { position: absolute; height: 100%; width: 100% } +.layout > .layout-cell.min-size { width: 0 } +.layout > .layout-cell.min-height { height: 0 } +.layout > .layout-cell.center { text-align: center } +.layout > .layout-cell.middle { vertical-align: middle } diff --git a/manager/media/style/default/css/main.css b/manager/media/style/default/css/main.css index 65a04dc862..c4176a3dbd 100755 --- a/manager/media/style/default/css/main.css +++ b/manager/media/style/default/css/main.css @@ -1,898 +1,196 @@ /* -------------------------[ Misc stuff ]--- */ - -.comment { - font-size: 11px; - color: #999; - padding: 4px 0; -} - -.screen { - border: 1px solid #ddd; - text-align: center; -} - -.even { - background: #d9e7c2; -} - -.odd { - background: #fff; -} - +.comment { font-size: 11px; color: #999; padding: 4px 0; } +.screen { border: 1px solid #ddd; text-align: center; } +.even { background: #d9e7c2; } +.odd { background: #fff; } /* -------------------------[ end sortable table ]--- */ - -.disabledImage { - width: 20px; - opacity: 0.3; - filter: alpha(opacity=30); -} - -.disabledImage img { - border: 0; -} - -.editorCell { - border-top: 1px solid #808080; - text-align: left; - vertical-align: baseline; -} - +.disabledImage { width: 20px; opacity: 0.3; filter: alpha(opacity=30); } +.disabledImage img { border: 0; } +.editorCell { border-top: 1px solid #808080; text-align: left; vertical-align: baseline; } /* */ - -.unpublished a, -.unpublish { - color: #b68282; - font-style: italic; -} - -.notInMenuNode { - color: #39515d; - text-decoration: none; -} - -#treeSplitter { - width: 10px; - height: 100%; - position: absolute; - right: -10px; -} - -.deleted { - color: #a52a2a; - text-decoration: line-through; -} - -label.disabled { - color: #aaa; -} - +.unpublished a, .unpublish { color: #b68282; font-style: italic; } +.notInMenuNode { color: #39515d; text-decoration: none; } +#treeSplitter { width: 10px; height: 100%; position: absolute; right: -10px; } +.deleted { color: #a52a2a; text-decoration: line-through; } +label.disabled { color: #aaa; } /* -------------------------[ home page main links ]--- */ - /*a.hometblink, a.hometblink:active, .hometblink { text-decoration: underline; color: #333; font-weight: 500; font-size: 12px; } a.hometblink:hover { text-decoration: underline; color: Gray; }*/ - -.notice { - width: 100%; - padding: 5px; - border: 1px solid #eee; - background-color: #f5f5f5; - color: #707070; -} - +.notice { width: 100%; padding: 5px; border: 1px solid #eee; background-color: #f5f5f5; color: #707070; } /* -------------------------[ Settings Table ]--- */ - -.filelist td { - border-bottom: 1px solid #c2c3cf; -} - +.filelist td { border-bottom: 1px solid #c2c3cf; } /* -------------------------[ Welcome Page ]--- */ - /*#mainActionPages { background: #f5f5f5; }*/ - /* -------------------------[ New sortable table class ]--- */ - -.sortabletable { - width: 100%; - border-collapse: collapse; -} - -.sortabletable thead tr { - color: #333; - font-weight: 500; - white-space: nowrap; - background-color: #d2d2d2; - text-align: left; -} - -.sortabletable tr { - background: #fff; -} - -.sortabletable tr.even { - background: #f7f7f7; -} - -.sortabletable tbody tr:hover { - background: #e9f0f3; -} - -.sortabletable td, -.sortabletable th { - padding: 5px !important; - border: 1px solid #ccc; -} - -.sortabletable th { - text-align: left; - cursor: pointer; - color: #333; -} - -.sortabletable th a { - text-decoration: none; - color: #333; -} - -.sortabletable th:active { - background: #ccc; - padding: 3px 4px 1px 6px; -} - +.sortabletable { width: 100%; border-collapse: collapse; } +.sortabletable thead tr { color: #333; font-weight: 500; white-space: nowrap; background-color: #d2d2d2; text-align: left; } +.sortabletable tr { background: #fff; } +.sortabletable tr.even { background: #f7f7f7; } +.sortabletable tbody tr:hover { background: #e9f0f3; } +.sortabletable td, .sortabletable th { padding: 5px !important; border: 1px solid #ccc; } +.sortabletable th { text-align: left; cursor: pointer; color: #333; } +.sortabletable th a { text-decoration: none; color: #333; } +.sortabletable th:active { background: #ccc; padding: 3px 4px 1px 6px; } /* -------------------------[ Pagination table ]--- */ - -#max-display-records { - margin: 10px 0; -} - -fieldset.tab-page { - border: 1px solid #e4e4e4 !important; -} - -h2#edit_document_title { - font-size: 0.9rem; - color: #f5f5f5; - width: 100%; - border-bottom: none; - padding: 5px 10px; -} - -fieldset#preview h2.tab { - float: right; -} - +#max-display-records { margin: 10px 0; } +fieldset.tab-page { border: 1px solid #e4e4e4 !important; } +h2#edit_document_title { font-size: 0.9rem; color: #f5f5f5; width: 100%; border-bottom: none; padding: 5px 10px; } +fieldset#preview h2.tab { float: right; } /* * Generic styles for all form elements - */ - -form#mutate dt, -form#mutate dd { - margin-bottom: 10px; -} - -form#mutate dt label, -form#mutate dt h3.label { - font-size: 1em; - display: inline; - float: left; - width: 200px; - color: #821517 !important; - font-weight: 500; -} - -form#mutate dd { - margin-left: 210px; -} - -form#mutate input.disabled { - background-color: #f5f5f5 !important; -} - +*/ +form#mutate dt, form#mutate dd { margin-bottom: 10px; } +form#mutate dt label, form#mutate dt h3.label { font-size: 1em; display: inline; float: left; width: 200px; color: #821517 !important; font-weight: 500; } +form#mutate dd { margin-left: 210px; } +form#mutate input.disabled { background-color: #f5f5f5 !important; } /*form#mutate select.inputBox { margin-right: 5px; }*/ - -form#mutate .multitv input[type="text"] { - width: 300px; -} - -form#mutate .imageField { - width: 50%; - min-width: 300px; -} - -form#mutate input[name="menuindex"] { - text-align: center; - width: 80px; - padding-left: 0; - padding-right: 0; -} - -form#mutate input[name="ta"].inputBox { - padding-left: 30px -} - -form#mutate input[name="ta"].inputBox:focus + input[type=button], -form#mutate input[name="ta"].inputBox:focus + .CodeMirror + input[type=button] { - border-color: #1377c5 #1377c5 #1377c5 #bbb; -} - -input[name^=tv].DatePicker, -input[name*=date].DatePicker, -input[name=createdon].DatePicker, -input[name=editedon].DatePicker { - float: left; - width: auto; - padding-right: 2em -} - -input[name^=tv].DatePicker + a, -input[name*=date].DatePicker + a { - position: relative; - z-index: 5; - margin-top: 0.5em; - margin-left: -1.5em; - float: left; -} - -form#mutate textarea.tv_textareamini { - height: 100px; - width: 300px; - overflow-y: scroll; -} - -form#mutate textarea.tv_textarea { - height: 100px; - width: 100%; - overflow-y: scroll; -} - -form#mutate #llock { - position: relative; - z-index: 5; - float: left; - width: 1.9rem; - height: 1.9rem; - margin: 0 -2rem 0 0; - line-height: 2rem; - cursor: pointer; - text-align: center; -} - -form#mutate #llock + #ta { - display: block !important; - padding-left: 2rem -} - -form#mutate #llock + #ta + .CodeMirror { - display: none !important; -} - -form#mutate #plock { - width: 1.4em; - cursor: pointer; - font-size: 14px -} - +form#mutate .multitv input[type="text"] { width: 300px; } +form#mutate .imageField { width: 50%; min-width: 300px; } +form#mutate input[name="menuindex"] { text-align: center; width: 80px; padding-left: 0; padding-right: 0; } +form#mutate input[name="ta"].inputBox { padding-left: 30px } +form#mutate input[name="ta"].inputBox:focus + input[type=button], form#mutate input[name="ta"].inputBox:focus + .CodeMirror + input[type=button] { border-color: #1377c5 #1377c5 #1377c5 #bbb; } +input[name^=tv].DatePicker, input[name*=date].DatePicker, input[name=createdon].DatePicker, input[name=editedon].DatePicker { float: left; width: auto; padding-right: 2em } +input[name^=tv].DatePicker + a, input[name*=date].DatePicker + a { position: relative; z-index: 5; margin-top: 0.5em; margin-left: -1.5em; float: left; } +form#mutate textarea.tv_textareamini { height: 100px; width: 300px; overflow-y: scroll; } +form#mutate textarea.tv_textarea { height: 100px; width: 100%; overflow-y: scroll; } +form#mutate #llock { position: relative; z-index: 5; float: left; width: 1.9rem; height: 1.9rem; margin: 0 -2rem 0 0; line-height: 2rem; cursor: pointer; text-align: center; } +form#mutate #llock + #ta { display: block !important; padding-left: 2rem } +form#mutate #llock + #ta + .CodeMirror { display: none !important; } +form#mutate #plock { width: 1.4em; cursor: pointer; font-size: 14px } /* * Individual Styles for fieldset#preview */ - -fieldset#preview iframe { - width: 100%; - margin: 0 auto; - border: 1px solid #f5f5f5; -} - +fieldset#preview iframe { width: 100%; margin: 0 auto; border: 1px solid #f5f5f5; } /* * Individual Styles for fieldset#access_permissions */ - -fieldset#access_permissions dt label { - width: 200px; -} - -fieldset#access_permissions dd { - margin-left: 210px; -} - -fieldset#access_permissions dl dd ul li { - list-style-type: none; -} - +fieldset#access_permissions dt label { width: 200px; } +fieldset#access_permissions dd { margin-left: 210px; } +fieldset#access_permissions dl dd ul li { list-style-type: none; } /* ppb: * Some styling for legacy mode fieldsets */ - -fieldset.legacy { - background: #fff; - padding: 10px; - margin: 10px 10px 35px; - border: 1px solid #e4e4e4 !important; - position: relative; -} - -fieldset.legacy h2 { - width: 100%; - background: #f5f5f5; - margin: -10px -10px 1rem -10px; - padding: 0 10px; - border-bottom: 1px solid #e4e4e4 !important; -} - +fieldset.legacy { background: #fff; padding: 10px; margin: 10px 10px 35px; border: 1px solid #e4e4e4 !important; position: relative; } +fieldset.legacy h2 { width: 100%; background: #f5f5f5; margin: -10px -10px 1rem -10px; padding: 0 10px; border-bottom: 1px solid #e4e4e4 !important; } /* System Alert Box ---------------------------------------------------------- */ - -.cbOverlay { - background-color: #000; - z-index: 50000; -} - -.cbContainer { - padding: 5px; - background-color: white; - z-index: 50000; -} - -.cbBox h3 { - color: #000; - background: #bee860 repeat-x top; - padding: 5px; - font-weight: 500; -} - -.cbBox p { - margin: 3px; -} - -.cbBox .cbButtons { - text-align: center; -} - -.sysAlert { - width: 500px; - height: 330px; - white-space: nowrap; - overflow: auto; -} - -.phptextarea { - font-family: Consolas, 'Courier New', 'Courier', monospace; -} - +.cbOverlay { background-color: #000; z-index: 50000; } +.cbContainer { padding: 5px; background-color: white; z-index: 50000; } +.cbBox h3 { color: #000; background: #bee860 repeat-x top; padding: 5px; font-weight: 500; } +.cbBox p { margin: 3px; } +.cbBox .cbButtons { text-align: center; } +.sysAlert { width: 500px; height: 330px; white-space: nowrap; overflow: auto; } +.phptextarea { font-family: Consolas, 'Courier New', 'Courier', monospace; } /* Custom */ - /* normalize some td paddings */ - -#displayparams table { - background: #fff; -} - -#displayparams table tbody td { - border-bottom: 1px dotted #d3d3d3; -} - -.permissiongroups { - margin: 0; -} - -.permissiongroups ul { - clear: both; - margin: 0; - padding: 0.5rem 0; -} - -.permissiongroup input[type=submit], -.permissiongroup input[type=button], -.permissiongroups input[type=submit], -.permissiongroups input[type=button] { - float: left; - margin: 0.3em 0.3em 0 0; -} - -td#displayparams > table.displayparams { - border: none; -} - +#displayparams table { background: #fff; } +#displayparams table tbody td { border-bottom: 1px dotted #d3d3d3; } +.permissiongroups { margin: 0; } +.permissiongroups ul { clear: both; margin: 0; padding: 0.5rem 0; } +.permissiongroup input[type=submit], .permissiongroup input[type=button], .permissiongroups input[type=submit], .permissiongroups input[type=button] { float: left; margin: 0.3em 0.3em 0 0; } +td#displayparams > table.displayparams { border: none; } /* replace warning red color in tabs */ - -strong[style*='color:#EF1D1D'] { - color: yellow !important; -} - -.selected strong[style*='color:#ffeb00'] { - color: red !important; -} - -code { - font-size: inherit; - font-family: Consolas, 'Courier New', 'Courier', monospace; - background-color: #eee; - border: 1px solid #ccc; - padding: 1px 2px; -} - -#resourcesPane .disabledPlugin a:hover { - color: #aaa; -} - +strong[style*='color:#EF1D1D'] { color: yellow !important; } +.selected strong[style*='color:#ffeb00'] { color: red !important; } +code { font-size: inherit; font-family: Consolas, 'Courier New', 'Courier', monospace; background-color: #eee; border: 1px solid #ccc; padding: 1px 2px; } +#resourcesPane .disabledPlugin a:hover { color: #aaa; } /* table styles*/ - -.table, -#documentPane #tv_body table, -#documentPane .tmplvars table, -#documentPane [id*="table-"], -#documentPane [id*="table-tv"] { - width: 100%; -} - -#documentPane .tab-page > table > tr > td:first-child, -#documentPane .tab-page > table > tbody > tr > td:first-child, -#documentPane .tab-page .tmplvars > table > tbody > tr > td:first-child, -#tmplvarsPane .tab-page > table > tbody > tr > td:first-child, -#tmplvarsPane .tab-page > table > tbody > tr > th:first-child, -#chunkPane .tab-page > table > tbody > tr > td:first-child, -#chunkPane .tab-page > table > tbody > tr > th:first-child, -#snipetPane .tab-page > table > tbody > tr > td:first-child, -#snipetPane .tab-page > table > tbody > tr > th:first-child, -#pluginPane .tab-page > table > tbody > tr > td:first-child, -#pluginPane .tab-page > table > tbody > tr > th:first-child, -#modulePane .tab-page > table > tbody > tr > td:first-child, -#modulePane .tab-page > table > tbody > tr > th:first-child, -#docManagerPane .tab-page #dates > table > tbody > tr > td:first-child { - width: 200px -} - -#documentPane .tab-page > table > tr > td:last-child, -#documentPane .tab-page .tmplvars > table > tbody > tr > td:last-child { - width: inherit !important -} - -#documentPane .tab-page > table > tbody > tr > td:first-child > .warning { - display: inline-block; - width: calc(100% - 1rem); -} - -#documentPane .tab-page > table > tbody > tr > td:first-child > [data-tooltip] { - margin-top: 0.3rem; - vertical-align: top -} - -.table--edit { - margin-bottom: 1rem; -} - -.table th, -.table td { - text-align: left; - vertical-align: middle; -} - -table th { - font-weight: 500; -} - -.table--edit th { - width: 200px; - color: #555; - font-size: inherit; -} - -.table--edit input[type="text"], -.table--edit input[type="password"], -.table--edit input[type="number"], -.table--edit textarea, -.table--edit select, -.settings input[type="text"], -.settings input[type="password"], -.settings input[type="number"], -.settings textarea, -.settings select { - width: 300px; -} - +.table, #documentPane #tv_body table, #documentPane .tmplvars table, #documentPane [id*="table-"], #documentPane [id*="table-tv"] { width: 100%; } +#documentPane .tab-page > table > tr > td:first-child, #documentPane .tab-page > table > tbody > tr > td:first-child, #documentPane .tab-page .tmplvars > table > tbody > tr > td:first-child, #tmplvarsPane .tab-page > table > tbody > tr > td:first-child, #tmplvarsPane .tab-page > table > tbody > tr > th:first-child, #chunkPane .tab-page > table > tbody > tr > td:first-child, #chunkPane .tab-page > table > tbody > tr > th:first-child, #snipetPane .tab-page > table > tbody > tr > td:first-child, #snipetPane .tab-page > table > tbody > tr > th:first-child, #pluginPane .tab-page > table > tbody > tr > td:first-child, #pluginPane .tab-page > table > tbody > tr > th:first-child, #modulePane .tab-page > table > tbody > tr > td:first-child, #modulePane .tab-page > table > tbody > tr > th:first-child, #docManagerPane .tab-page #dates > table > tbody > tr > td:first-child { width: 200px } +#documentPane .tab-page > table > tr > td:last-child, #documentPane .tab-page .tmplvars > table > tbody > tr > td:last-child { width: inherit !important } +#documentPane .tab-page > table > tbody > tr > td:first-child > .warning { display: inline-block; width: calc(100% - 1rem); } +#documentPane .tab-page > table > tbody > tr > td:first-child > [data-tooltip] { margin-top: 0.3rem; vertical-align: top } +.table--edit { margin-bottom: 1rem; } +.table th, .table td { text-align: left; vertical-align: middle; } +table th { font-weight: 500; } +.table--edit th { width: 200px; color: #555; font-size: inherit; } +.table--edit input[type="text"], .table--edit input[type="password"], .table--edit input[type="number"], .table--edit textarea, .table--edit select, .settings input[type="text"], .settings input[type="password"], .settings input[type="number"], .settings textarea, .settings select { width: 300px; } /* * MODxRE2 styles * css above is original MODxRE * css below is basicaly MODxRE overrides to get MODxRE2 look */ - /* nav */ - -.no-events { - pointer-events: none; -} - +.no-events { pointer-events: none; } /* Required for Bootstrap3 Collapse */ - -.panel-title > a::before { - content: "\f107"; - /* fa-angle-down */ - font-family: "FontAwesome"; -} - -.panel-title > a.collapsed::before { - content: "\f105"; - /* fa-angle-right */ - padding: 0 1px 0 3px; -} - -.panel-title > a { - font-size: 1.1em; - color: #657587; - display: block; - padding: 3px 0; -} - -.panel-title > a:hover { - text-decoration: none; - color: #1377c5; - background: rgba(255, 255, 255, 0.27); -} - +.panel-title > a::before { content: "\f107"; /* fa-angle-down */ +font-family: "FontAwesome"; } +.panel-title > a.collapsed::before { content: "\f105"; /* fa-angle-right */ +padding: 0 1px 0 3px; } +.panel-title > a { font-size: 1.1em; color: #657587; display: block; padding: 3px 0; } +.panel-title > a:hover { text-decoration: none; color: #1377c5; background: rgba(255, 255, 255, 0.27); } /* category icons in manage elements */ - -#site_templates, -#site_tmplvars, -#site_htmlsnippets, -#site_snippets, -#site_plugins { - padding-left: 0; -} - -#site_templates li, -#site_tmplvars li, -#site_htmlsnippets li, -#site_snippets li, -#site_snippets li, -#site_plugins li, -#categories_list li { - list-style: none; - margin-left: -21px; -} - -#site_templates li strong:before, -#site_tmplvars li strong:before, -#site_htmlsnippets li strong:before, -#site_snippets li strong:before, -#site_snippets li strong:before, -#site_plugins li strong:before, -#categories_list li strong:before { - font-family: "FontAwesome"; - font-style: normal; - font-weight: normal; - color: #5b6f7a; - padding: 0 5px 0 5px; - content: '\f105'; -} - -.tab-pane ul li ul li strong:before { - content: ''; -} - +#site_templates, #site_tmplvars, #site_htmlsnippets, #site_snippets, #site_plugins { padding-left: 0; } +#site_templates li, #site_tmplvars li, #site_htmlsnippets li, #site_snippets li, #site_snippets li, #site_plugins li, #categories_list li { list-style: none; margin-left: -21px; } +#site_templates li strong:before, #site_tmplvars li strong:before, #site_htmlsnippets li strong:before, #site_snippets li strong:before, #site_snippets li strong:before, #site_plugins li strong:before, #categories_list li strong:before { font-family: "FontAwesome"; font-style: normal; font-weight: normal; color: #5b6f7a; padding: 0 5px 0 5px; content: '\f105'; } +.tab-pane ul li ul li strong:before { content: ''; } /* elements icons in manage elements */ - -a.man_el_name:before { - font-family: "FontAwesome"; - font-style: normal; - font-weight: normal; - font-size: 0.875rem; - color: #5b6f7a; -} - -a.man_el_name.site_templates:before { - content: '\f1ea'; -} - -a.man_el_name.site_tmplvars:before { - content: '\f022'; -} - -a.man_el_name.site_htmlsnippets:before { - content: '\f009'; -} - -a.man_el_name.site_snippets:before { - content: '\f121'; -} - -a.man_el_name.site_plugins:before { - content: '\f1e6'; -} - -a.man_el_name.site_modules:before { - content: '\f085'; -} - -div#tabCategory.tab-page ul li ul li { - padding-top: 7px; - padding-bottom: 7px; -} - +a.man_el_name:before { font-family: "FontAwesome"; font-style: normal; font-weight: normal; font-size: 0.875rem; color: #5b6f7a; } +a.man_el_name.site_templates:before { content: '\f1ea'; } +a.man_el_name.site_tmplvars:before { content: '\f022'; } +a.man_el_name.site_htmlsnippets:before { content: '\f009'; } +a.man_el_name.site_snippets:before { content: '\f121'; } +a.man_el_name.site_plugins:before { content: '\f1e6'; } +a.man_el_name.site_modules:before { content: '\f085'; } +div#tabCategory.tab-page ul li ul li { padding-top: 7px; padding-bottom: 7px; } /*Fake tables for providing dynamic amount of cells per row*/ - -.rTable { - display: table; - width: 100%; - padding: 0; -} - -.rTableRow { - display: table-row; - padding: 0; -} - -.rTableHeading { - display: table-header-group; -} - -.rTableBody { - display: table-row-group; -} - -.rTableFoot { - display: table-footer-group; -} - -.lockCell, -.mainCell, -.btnCell, -.rTableHead { - display: table-cell; - padding: 0; -} - -.lockCell { - width: 2.5em; - padding-left: 10px; -} - -.mainCell { - width: auto; -} - -.btnCell { - width: 6em; - text-align: right; - padding-right: 1rem; -} - -.mainCell > span { - display: block -} - +.rTable { display: table; width: 100%; padding: 0; } +.rTableRow { display: table-row; padding: 0; } +.rTableHeading { display: table-header-group; } +.rTableBody { display: table-row-group; } +.rTableFoot { display: table-footer-group; } +.lockCell, .mainCell, .btnCell, .rTableHead { display: table-cell; padding: 0; } +.lockCell { width: 2.5em; padding-left: 10px; } +.mainCell { width: auto; } +.btnCell { width: 6em; text-align: right; padding-right: 1rem; } +.mainCell > span { display: block } /* Manage elements general styles */ - -a.man_el_name { - display: block; - padding: .1em 0 .1em 1.25rem; -} - -a.man_el_name:hover { - text-decoration: none; -} - -.lockCell + .mainCell a.man_el_name { - padding-left: 0 !important; -} - -.lockCell + .mainCell a.man_el_name:before { - display: none; -} - -.elements_descr { - color: #222; - margin-left: 1em; - font-size: 0.88em; -} - -.resourceTable .panel-heading { - margin: 0 -1.25rem !important; - background-color: #f5f5f5; - border-top: 1px dotted #dedede; - border-bottom: 1px dotted #dedede; -} - -.resourceTable .panel-title > a { - padding: 5px 1.25rem; - text-decoration: none -} - -.resourceTable ul.elements { - margin: 0 -1.25rem; - padding: 0 0 10px 0; -} - -.resourceTable ul.elements > li { - padding: 0 !important; - border-bottom: 1px dotted #dedede; - border-left: 3px solid #fff; - transition: all 0.1s ease; - margin: 0 !important; -} - -.resourceTable ul.elements > li:hover { - background: #f9f9f9; - border-left: 3px solid #1377c5; -} - -.resourceTable ul.elements > li::before { - display: none -} - -#resourcesPane .panel-group ul {} - -ul.resourceTable .category_name { - float: none; - display: block; - clear: both; - margin-top: 20px; -} - +a.man_el_name { display: block; padding: .1em 0 .1em 1.25rem; } +a.man_el_name:hover { text-decoration: none; } +.lockCell + .mainCell a.man_el_name { padding-left: 0 !important; } +.lockCell + .mainCell a.man_el_name:before { display: none; } +.elements_descr { color: #222; margin-left: 1em; font-size: 0.88em; } +.resourceTable .panel-heading { margin: 0 -1.25rem !important; background-color: #f5f5f5; border-top: 1px dotted #dedede; border-bottom: 1px dotted #dedede; } +.resourceTable .panel-title > a { padding: 5px 1.25rem; text-decoration: none } +.resourceTable ul.elements { margin: 0 -1.25rem; padding: 0 0 10px 0; } +.resourceTable ul.elements > li { padding: 0 !important; border-bottom: 1px dotted #dedede; border-left: 3px solid #fff; transition: all 0.1s ease; margin: 0 !important; } +.resourceTable ul.elements > li:hover { background: #f9f9f9; border-left: 3px solid #1377c5; } +.resourceTable ul.elements > li::before { display: none } +#resourcesPane .panel-group ul { } +ul.resourceTable .category_name { float: none; display: block; clear: both; margin-top: 20px; } /* Manager Elements Buttons bar*/ - -ul.elements_buttonbar { - list-style: none; - margin: 0; - padding: 0; - display: table; - table-layout: fixed; -} - -ul.elements_buttonbar li { - display: table-cell; - padding: 0 !important; - width: 2em; -} - -ul.elements_buttonbar li a { - display: block; - width: 2em; - padding: 4px 2px 2px 2px; - margin: 1px; - min-width: 22px; -} - -ul.elements_buttonbar .fa { - font-size: 0.875rem; - padding: 1px 1px 0; -} - +ul.elements_buttonbar { list-style: none; margin: 0; padding: 0; display: table; table-layout: fixed; } +ul.elements_buttonbar li { display: table-cell; padding: 0 !important; width: 2em; } +ul.elements_buttonbar li a { display: block; width: 2em; padding: 4px 2px 2px 2px; margin: 1px; min-width: 22px; } +ul.elements_buttonbar .fa { font-size: 0.875rem; padding: 1px 1px 0; } /* Checkbox "Icons" */ - -.noicons.tab-page ul li ul li a:before, -.noicons .elements_description a:before { - display: none !important; -} - +.noicons.tab-page ul li ul li a:before, .noicons .elements_description a:before { display: none !important; } /* View-dependent styles */ - /* List-view */ - -.resourceTable.list li {} - -.sortableList > li::before { - display: none -} - +.resourceTable.list li { } +.sortableList > li::before { display: none } /* Inline-view */ - -.resourceTable.inline ul.elements { - margin: 0 !important; -} - -.resourceTable.inline ul.elements > li { - float: left; - margin: 10px 10px 0 0 !important; - padding: 0 !important; - border: 1px dotted #dedede; -} - -.resourceTable.inline ul.elements_buttonbar { - margin: 0 5px 0 0 !important; -} - -.resourceTable.inline a.man_el_name { - padding: 5px 10px; -} - -.resourceTable.inline ul.elements > li:hover { - border: 1px solid #aaa -} - +.resourceTable.inline ul.elements { margin: 0 !important; } +.resourceTable.inline ul.elements > li { float: left; margin: 10px 10px 0 0 !important; padding: 0 !important; border: 1px dotted #dedede; } +.resourceTable.inline ul.elements_buttonbar { margin: 0 5px 0 0 !important; } +.resourceTable.inline a.man_el_name { padding: 5px 10px; } +.resourceTable.inline ul.elements > li:hover { border: 1px solid #aaa } /* Flex-view */ - -.resourceTable.flex ul.elements { - -webkit-column-gap: 10px; - -moz-column-gap: 10px; - -o-column-gap: 10px; - column-gap: 10px; -} - -.resourceTable.flex ul.elements {} - -.resourceTable.flex ul.elements > li { - overflow: hidden; - /* fix for Firefox */ - break-inside: avoid-column; - -webkit-column-break-inside: avoid; - -moz-column-break-inside: avoid; - -o-column-break-inside: avoid; - -ms-column-break-inside: avoid; - column-break-inside: avoid; - page-break-inside: avoid -} - -.resourceTable.flex .elements_descr { - display: block; - margin-left: 1.5em; -} - -#content_body #which_editor { - margin-top: 12px; -} - +.resourceTable.flex ul.elements { -webkit-column-gap: 10px; -moz-column-gap: 10px; -o-column-gap: 10px; column-gap: 10px; } +.resourceTable.flex ul.elements { } +.resourceTable.flex ul.elements > li { overflow: hidden; /* fix for Firefox */ +break-inside: avoid-column; -webkit-column-break-inside: avoid; -moz-column-break-inside: avoid; -o-column-break-inside: avoid; -ms-column-break-inside: avoid; column-break-inside: avoid; page-break-inside: avoid } +.resourceTable.flex .elements_descr { display: block; margin-left: 1.5em; } +#content_body #which_editor { margin-top: 12px; } /* resource children list */ - -#tabChildren .grid th, -#tabChildren .grid tr > td:nth-child(5), -#tabChildren .grid tr > td:nth-child(6) { - text-align: center; - white-space: nowrap -} - -#tabChildren .grid td { - text-align: right; - white-space: nowrap -} - -#tabChildren .grid tr > th:nth-child(2), -#tabChildren .grid tr > td:nth-child(2) { - text-align: left; - white-space: normal -} - -#tabChildren .grid tr > td:nth-child(6) a { - padding: 0 .2em; - font-size: 0.9rem; - color: #444; -} - +#tabChildren .grid th, #tabChildren .grid tr > td:nth-child(5), #tabChildren .grid tr > td:nth-child(6) { text-align: center; white-space: nowrap } +#tabChildren .grid td { text-align: right; white-space: nowrap } +#tabChildren .grid tr > th:nth-child(2), #tabChildren .grid tr > td:nth-child(2) { text-align: left; white-space: normal } +#tabChildren .grid tr > td:nth-child(6) a { padding: 0 .2em; font-size: 0.9rem; color: #444; } /* element-edit-message */ - -.msg-container { - padding-bottom: 10px; - border-bottom: 1px solid #ededed; - margin-bottom: 1rem; - color: #777; -} - -.btn-small { - padding: 2px 4px !important; - font-size: 11px !important; -} - -.relative { - position: relative; -} - -.modx-alert { - display: block; - margin: 60px 10px 10px 10px; - padding: 1em; -} - -.modx-alert.alert-error { - background-color: #ffd0d0; - border: 1px solid #f00; - color: #000; -} - -tr.userIdle td { - color: #aaa; -} - -tr.userIdle td strong:before { - font-family: "FontAwesome"; - font-style: normal; - font-weight: normal; - color: #aaa; - padding: 0 5px 0 0; - content: '\f017'; -} +.msg-container { padding-bottom: 10px; border-bottom: 1px solid #ededed; margin-bottom: 1rem; color: #777; } +.btn-small { padding: 2px 4px !important; font-size: 11px !important; } +.relative { position: relative; } +.modx-alert { display: block; margin: 60px 10px 10px 10px; padding: 1em; } +.modx-alert.alert-error { background-color: #ffd0d0; border: 1px solid #f00; color: #000; } +tr.userIdle td { color: #aaa; } +tr.userIdle td strong:before { font-family: "FontAwesome"; font-style: normal; font-weight: normal; color: #aaa; padding: 0 5px 0 0; content: '\f017'; } diff --git a/manager/media/style/default/css/mainmenu.css b/manager/media/style/default/css/mainmenu.css index c78f40f328..440c1c2f8e 100755 --- a/manager/media/style/default/css/mainmenu.css +++ b/manager/media/style/default/css/mainmenu.css @@ -1,859 +1,158 @@ /* #mainMenu */ - -#mainMenu { - background-color: #2b323a; - color: #8b9298; - -webkit-box-shadow: 0 2px 4px rgba(0,0,0,.3); - box-shadow: 0 2px 4px rgba(0,0,0,.3); -} - -#mainMenu.show { - overflow: visible -} - -#mainMenu + #tree::before, -#mainMenu + #tree + #main::before { - content: ""; - position: absolute; - z-index: 9999; - left: 0; - top: 0; - right: 0; - bottom: 0; - background-color: rgba(0, 0, 0, .1); - opacity: 0; - visibility: hidden; - -webkit-transition: opacity .15s, visibility .15s; - transition: opacity .15s, visibility .15s; -} - -#mainMenu.show + #tree::before, -#mainMenu.show + #tree + #main::before { - opacity: 1; - visibility: visible -} - -#mainMenu > .container { - display: table; - width: 100%; - border-collapse: collapse -} - -#mainMenu > .container > .row { - display: table-row -} - -#mainMenu > .container > .row > .cell { - display: table-cell; - vertical-align: top; -} - -#mainMenu #nav { - float: left; -} - -#mainMenu #settings { - float: right; -} - -#mainMenu .nav { - margin: 0; - white-space: nowrap; - font-size: 0 -} - -#mainMenu .nav > li { - position: relative; - display: inline-block; - font-size: 0.8125rem; - vertical-align: top -} - -#mainMenu .nav > li.active > a { - color: #fff; - background-color: rgba(255, 255, 255, 0.07) -} - -#mainMenu .nav > li > a, -#mainMenu .nav .label_searchid { - display: block; - position: relative; - z-index: 1; - padding: 0 1rem; - height: 2.2rem; - line-height: 2.3rem; - text-decoration: none; - color: #DCD9E3; - transition-duration: 0.15s -} - -#mainMenu .nav > li > a:hover, -#mainMenu .nav .label_searchid:hover { - color: #f3f3f3; -} - +#mainMenu { background-color: #2b323a; color: #8b9298; -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, .3); box-shadow: 0 2px 4px rgba(0, 0, 0, .3); } +#mainMenu.show { overflow: visible } +#mainMenu + #tree::before, #mainMenu + #tree + #main::before { content: ""; position: absolute; z-index: 9999; left: 0; top: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, .1); opacity: 0; visibility: hidden; -webkit-transition: opacity .15s, visibility .15s; transition: opacity .15s, visibility .15s; } +#mainMenu.show + #tree::before, #mainMenu.show + #tree + #main::before { opacity: 1; visibility: visible } +#mainMenu > .container { display: table; width: 100%; border-collapse: collapse } +#mainMenu > .container > .row { display: table-row } +#mainMenu > .container > .row > .cell { display: table-cell; vertical-align: top; } +#mainMenu #nav { float: left; } +#mainMenu #settings { float: right; } +#mainMenu .nav { margin: 0; white-space: nowrap; font-size: 0 } +#mainMenu .nav > li { position: relative; display: inline-block; font-size: 0.8125rem; vertical-align: top } +#mainMenu .nav > li.active > a { color: #fff; background-color: rgba(255, 255, 255, 0.07) } +#mainMenu .nav > li > a, #mainMenu .nav .label_searchid { display: block; position: relative; z-index: 1; padding: 0 1rem; height: 2.2rem; line-height: 2.3rem; text-decoration: none; color: #dcd9e3; transition-duration: 0.15s } +#mainMenu .nav > li > a:hover, #mainMenu .nav .label_searchid:hover { color: #f3f3f3; } /*#mainMenu.show .nav > li.dropdown:hover > a, */ - -#mainMenu.show .nav > li.dropdown.hover > a { - background-color: #fff; - color: #444; -} - -#mainMenu .nav > li > a .icon { - display: inline-block; - overflow: hidden; - width: auto; - height: 2rem; - line-height: 2rem; - font-size: 1.5em; - text-align: center; - margin: 0.05rem 0 0 0.5rem; - vertical-align: top; - border-radius: 50%; - background: no-repeat 50% 50%; - background-size: cover; -} - -#mainMenu .nav > li > a .icon.photo { - width: 2rem -} - -#mainMenu .nav > li > a .icon .fa { - font-size: 1.2rem; - line-height: 2.1rem -} - -#mainMenu .nav > li .fa { - min-width: 1em; - line-height: 2.2rem; - font-size: 0.875rem; - vertical-align: top -} - -#mainMenu #nav > li > a > .fa { - display: none -} - -#mainMenu #nav #bars { - width: 3.5rem; - text-align: center -} - -#mainMenu #nav #bars a { - padding: 0; -} - -#mainMenu #nav #bars .fa { - display: inline-block; - min-width: 0.25rem; - width: 1.5rem; - margin: 0; - text-align: center; - overflow: hidden; - -webkit-transition-duration: 0.15s; - transition-duration: 0.15s -} - -.sidebar-closed #mainMenu #nav #bars .fa { - width: 0.25rem; -} - -#mainMenu #system > a > .fa { - font-size: 1.1rem -} - -#mainMenu .nav .caret, -#mainMenu .nav .divider, -.dropdown-toggle::after { - display: none -} - -#mainMenu .nav > li > ul { - display: block; - position: absolute; - z-index: 0; - overflow: auto; - overflow-x: hidden; - top: 100%; - left: 0; - margin: 0; - padding: 0 0 0.25rem; - min-width: 15rem; - max-height: -webkit-calc(100vh - 2.2rem); - max-height: calc(100vh - 2.2rem); - font-size: 1em; - border: none; - border-radius: 0 0 0.25rem 0.25rem; - background-color: #fff; - box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2); - opacity: 0; - visibility: hidden; - -webkit-transition-duration: 0.1s; - transition-duration: 0.1s; -} - +#mainMenu.show .nav > li.dropdown.hover > a { background-color: #fff; color: #444; } +#mainMenu .nav > li > a .icon { display: inline-block; overflow: hidden; width: auto; height: 2rem; line-height: 2rem; font-size: 1.5em; text-align: center; margin: 0.05rem 0 0 0.5rem; vertical-align: top; border-radius: 50%; background: no-repeat 50% 50%; background-size: cover; } +#mainMenu .nav > li > a .icon.photo { width: 2rem } +#mainMenu .nav > li > a .icon .fa { font-size: 1.2rem; line-height: 2.1rem } +#mainMenu .nav > li .fa { min-width: 1em; line-height: 2.2rem; font-size: 0.875rem; vertical-align: top } +#mainMenu #nav > li > a > .fa { display: none } +#mainMenu #nav #bars { width: 3.5rem; text-align: center } +#mainMenu #nav #bars a { padding: 0; } +#mainMenu #nav #bars .fa { display: inline-block; min-width: 0.25rem; width: 1.5rem; margin: 0; text-align: center; overflow: hidden; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } +.sidebar-closed #mainMenu #nav #bars .fa { width: 0.25rem; } +#mainMenu #system > a > .fa { font-size: 1.1rem } +#mainMenu .nav .caret, #mainMenu .nav .divider, .dropdown-toggle::after { display: none } +#mainMenu .nav > li > ul { display: block; position: absolute; z-index: 0; overflow: auto; overflow-x: hidden; top: 100%; left: 0; margin: 0; padding: 0 0 0.25rem; min-width: 15rem; max-height: -webkit-calc(100vh - 2.2rem); max-height: calc(100vh - 2.2rem); font-size: 1em; border: none; border-radius: 0 0 0.25rem 0.25rem; background-color: #fff; box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2); opacity: 0; visibility: hidden; -webkit-transition-duration: 0.1s; transition-duration: 0.1s; } /*#mainMenu.show .nav > li:hover > a + ul, */ - -#mainMenu.show .nav > li.hover > a + ul, -#mainMenu.show .nav > li.hover > ul.sub-menu.show { - opacity: 1; - visibility: visible -} - -#mainMenu.show .nav > li > ul.sub-menu { - left: 15rem; - opacity: 0; - visibility: hidden; -} - -#mainMenu #settings.nav > li > ul { - left: auto; - right: 0 -} - -#mainMenu .nav > li > ul > li { - border-bottom: 1px solid rgba(0, 0, 0, 0.05); - margin-bottom: -1px; -} - -#mainMenu .nav > li > ul > li:last-child { - border: none; - margin-bottom: 0 -} - -#mainMenu .nav > li > ul > li.item-input { - padding: 0.375em 0.5em; -} - -#mainMenu .nav > li > ul > li > a:first-child, -#mainMenu .nav > li > ul > li > span { - display: block; - position: relative; - padding: 0 2rem 0 1rem; - line-height: 2.2rem; - color: #444; - text-decoration: none -} - -#mainMenu .nav > li > ul > li.hover > a:first-child { - color: #fff; - background-color: #1976d2; -} - -#mainMenu .nav > li > ul > li > span:first-child { - padding: 0 1rem; - text-align: center; - font-size: 0.875em; - color: #aaa; -} - -#mainMenu .nav > li > ul > li.dropdown-back > span { - text-align: left; - font-size: inherit; - color: inherit -} - -#mainMenu .nav > li > ul > li.dropdown-back > span * { - pointer-events: none -} - -#mainMenu .nav > li > ul > li .fa { - width: 1.3em; - margin-right: 0.5em; - font-size: .875rem; - line-height: .8rem; - text-align: center; - vertical-align: baseline -} - -#mainMenu .nav > li > ul > li.selected a:first-child::before, -#main .evo-tab-row .tab.changed::before { - content: ''; - position: absolute; - right: 0.25em; - top: 0.25em; - width: 0.5em; - height: 0.5em; - background-color: #ffc107; - -webkit-border-radius: 50%; - border-radius: 50%; - pointer-events: none -} - -#mainMenu .nav > li > ul > li.dropdown-toggle > a > .toggle { - position: absolute; - top: 0; - right: 0; - height: 100%; - width: 2rem; - margin: 0; - line-height: 2rem; - text-align: center; -} - -#mainMenu .nav > li > ul > li.disabled > a { - opacity: 0.5; - color: #7d2a24; -} - -#mainMenu .nav > li > ul > li.locked > a { - font-style: italic -} - -#mainMenu .nav > li > ul > li > a small { - line-height: 1em -} - -#mainMenu .nav li.item-group { - display: table; - width: 100%; - border-collapse: separate -} - -#mainMenu .nav li.item-group > * { - display: table-cell !important; - width: 1%; - padding: 0 .75rem; - border: none !important; - border-left: 1px solid rgba(0, 0, 0, 0.05) !important; - border-radius: 0 -} - -#mainMenu .nav li.item-group > *:first-child { - width: 100% -} - -#mainMenu .nav li.item-group > *:not(:first-child) .fa { - margin-right: 0 -} - -#mainMenu .account #msgCounter { - display: none; - position: absolute; - z-index: 1; - right: 0.4rem; - top: 0.4rem; - width: 0.4rem; - height: 0.4rem; - background-color: #ffc107; - font-size: 0; - border-radius: 50%; - ; -} - -#mainMenu .account #newMail { - display: none -} - +#mainMenu.show .nav > li.hover > a + ul, #mainMenu.show .nav > li.hover > ul.sub-menu.show { opacity: 1; visibility: visible } +#mainMenu.show .nav > li > ul.sub-menu { left: 15rem; opacity: 0; visibility: hidden; } +#mainMenu #settings.nav > li > ul { left: auto; right: 0 } +#mainMenu .nav > li > ul > li { border-bottom: 1px solid rgba(0, 0, 0, 0.05); margin-bottom: -1px; } +#mainMenu .nav > li > ul > li:last-child { border: none; margin-bottom: 0 } +#mainMenu .nav > li > ul > li.item-input { padding: 0.375em 0.5em; } +#mainMenu .nav > li > ul > li > a:first-child, #mainMenu .nav > li > ul > li > span { display: block; position: relative; padding: 0 2rem 0 1rem; line-height: 2.2rem; color: #444; text-decoration: none } +#mainMenu .nav > li > ul > li.hover > a:first-child { color: #fff; background-color: #1976d2; } +#mainMenu .nav > li > ul > li > span:first-child { padding: 0 1rem; text-align: center; font-size: 0.875em; color: #aaa; } +#mainMenu .nav > li > ul > li.dropdown-back > span { text-align: left; font-size: inherit; color: inherit } +#mainMenu .nav > li > ul > li.dropdown-back > span * { pointer-events: none } +#mainMenu .nav > li > ul > li .fa { width: 1.3em; margin-right: 0.5em; font-size: .875rem; line-height: .8rem; text-align: center; vertical-align: baseline } +#mainMenu .nav > li > ul > li.selected a:first-child::before, #main .evo-tab-row .tab.changed::before { content: ''; position: absolute; right: 0.25em; top: 0.25em; width: 0.5em; height: 0.5em; background-color: #ffc107; -webkit-border-radius: 50%; border-radius: 50%; pointer-events: none } +#mainMenu .nav > li > ul > li.dropdown-toggle > a > .toggle { position: absolute; top: 0; right: 0; height: 100%; width: 2rem; margin: 0; line-height: 2rem; text-align: center; } +#mainMenu .nav > li > ul > li.disabled > a { opacity: 0.5; color: #7d2a24; } +#mainMenu .nav > li > ul > li.locked > a { font-style: italic } +#mainMenu .nav > li > ul > li > a small { line-height: 1em } +#mainMenu .nav li.item-group { display: table; width: 100%; border-collapse: separate } +#mainMenu .nav li.item-group > * { display: table-cell !important; width: 1%; padding: 0 .75rem; +border: none !important; border-left: 1px solid rgba(0, 0, 0, 0.05) !important; border-radius: 0 } +#mainMenu .nav li.item-group > *:first-child { width: 100% } +#mainMenu .nav li.item-group > *:not(:first-child) .fa { margin-right: 0 } +#mainMenu .account #msgCounter { display: none; position: absolute; z-index: 1; right: 0.4rem; top: 0.4rem; width: 0.4rem; height: 0.4rem; background-color: #ffc107; font-size: 0; border-radius: 50%;; } +#mainMenu .account #newMail { display: none } /* statusbar */ - -#statusbar { - position: relative; - width: 1rem; - height: 2.2rem; - line-height: 2.4rem; - font-size: 0.875em; - white-space: nowrap; - float: left; -} - -#statusbar .fa { - font-size: 0.875rem -} - -#statusbar #buildText, -#statusbar #workText { - display: none -} - -#statusbar .fa { - margin-right: 0.375rem -} - -#statusbar .fa-warning { - color: #f44336 -} - +#statusbar { position: relative; width: 1rem; height: 2.2rem; line-height: 2.4rem; font-size: 0.875em; white-space: nowrap; float: left; } +#statusbar .fa { font-size: 0.875rem } +#statusbar #buildText, #statusbar #workText { display: none } +#statusbar .fa { margin-right: 0.375rem } +#statusbar .fa-warning { color: #f44336 } /* search */ - -#mainMenu #searchform { - position: relative -} - -#mainMenu #searchform label { - position: relative; - z-index: 1; - margin: 0; - cursor: pointer; -} - -#mainMenu #searchform input { - position: absolute; - z-index: 0; - top: 0; - right: 0; - min-height: 1.5rem; - height: 1.5rem; - width: 0; - padding: 0 0.5rem; - margin: 0.345rem; - border: 1px solid rgba(255, 255, 255, 0.1); - border-radius: 0; - background: rgba(0, 0, 0, 0.1); - color: #fff; - text-align: left; - opacity: 0; - outline: none; - -webkit-transition: opacity 0.2s, width 0.2s; - transition: opacity 0.2s, width 0.2s; -} - -#mainMenu #searchform input:focus { - z-index: 9; - width: 15rem; - max-width: 15rem; - background: #000; - text-align: left; - border-color: rgba(255, 255, 255, 0.75); - opacity: 1 -} - -#mainMenu #searchform input:focus + .mask { - opacity: 0.7; - visibility: visible; -} - -#mainMenu #searchform .mask { - content: ""; - position: absolute; - z-index: 5; - top: 0; - right: -999rem; - right: -100vw; - left: -999rem; - left: -100vw; - height: 2.2rem; - opacity: 0; - visibility: hidden; - background-color: rgba(0, 0, 0, 0.65); - -webkit-transition-duration: 0.3s; - transition-duration: 0.3s; - transform: translateZ(0) -} - -#mainMenu #searchform .fa-search { - position: relative; - z-index: 1 -} - -#mainMenu #searchform .fa-refresh { - position: absolute; - z-index: 9; - display: none; - top: 0.6rem; - right: 0.8rem; - line-height: 1em -} - +#mainMenu #searchform { position: relative } +#mainMenu #searchform label { position: relative; z-index: 1; margin: 0; cursor: pointer; } +#mainMenu #searchform input { position: absolute; z-index: 0; top: 0; right: 0; min-height: 1.5rem; height: 1.5rem; width: 0; padding: 0 0.5rem; margin: 0.345rem; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 0; background: rgba(0, 0, 0, 0.1); color: #fff; text-align: left; opacity: 0; outline: none; -webkit-transition: opacity 0.2s, width 0.2s; transition: opacity 0.2s, width 0.2s; } +#mainMenu #searchform input:focus { z-index: 9; width: 15rem; max-width: 15rem; background: #000; text-align: left; border-color: rgba(255, 255, 255, 0.75); opacity: 1 } +#mainMenu #searchform input:focus + .mask { opacity: 0.7; visibility: visible; } +#mainMenu #searchform .mask { content: ""; position: absolute; z-index: 5; top: 0; right: -999rem; right: -100vw; left: -999rem; left: -100vw; height: 2.2rem; opacity: 0; visibility: hidden; background-color: rgba(0, 0, 0, 0.65); -webkit-transition-duration: 0.3s; transition-duration: 0.3s; transform: translateZ(0) } +#mainMenu #searchform .fa-search { position: relative; z-index: 1 } +#mainMenu #searchform .fa-refresh { position: absolute; z-index: 9; display: none; top: 0.6rem; right: 0.8rem; line-height: 1em } /* #searchresult */ - -#searchresult { - position: absolute; - z-index: 99; - overflow: hidden; - top: 2.2rem; - right: 0; - bottom: 0; - width: 0; - max-width: 100%; - background-color: #fff; - border-left: 1px solid rgba(0, 0, 0, 0.1); - opacity: 0; - visibility: hidden; - -webkit-transition: 0.25s ease 0.5s; - transition: 0.25s ease 0.5s; - -webkit-transition-delay: 0.3s; - transition-delay: 0.3s; -} - -#searchresult.open { - width: 20rem; - box-shadow: 0 0 4.5rem rgba(0, 0, 0, 0.15); - opacity: 1; - visibility: visible; - -webkit-transition: 0.5s ease 0.5s; - transition: 0.5s ease 0.5s; - -webkit-transition-delay: 0s; - transition-delay: 0s -} - -#searchresult .ajaxSearchResults { - width: 20rem; - height: 100%; - overflow: auto; -} - -#searchresult .ajaxSearchResults ul, -#searchresult .ajaxSearchResults li { - margin: 0; - padding: 0; - list-style: none -} - -#searchresult .ajaxSearchResults b, -#searchresult .ajaxSearchResults strong, -#searchresult .ajaxSearchResults a { - position: relative; - z-index: 0; - display: block; - color: #333; - padding: 0.25rem 1rem; - margin-top: -1px; - border-top: 1px solid rgba(0, 0, 0, 0.03); - border-bottom: 1px solid rgba(0, 0, 0, 0.03); - box-sizing: border-box -} - -#searchresult .ajaxSearchResults b { - z-index: 1; - background-color: #ddd -} - -#searchresult .ajaxSearchResults a { - padding: 0.25rem 2rem 0.25rem 1rem; - text-decoration: none; -} - -#searchresult .ajaxSearchResults a:hover { - color: #333; - background-color: #f2f2f2; -} - -#searchresult .ajaxSearchResults a > i { - position: absolute; - right: 0; - top: 50%; - width: 2rem; - height: 2rem; - margin-top: -1rem; - line-height: 2rem; - text-align: center; - color: #1976d2; -} - -#searchresult .ajaxSearchResults a.selected > i { - color: #fff -} - -#searchresult .ajaxSearchResults a.selected { - z-index: 1; - background-color: #1976d2; - color: #fff; - font-weight: 700; -} - -#searchresult .ajaxSearchResults a .text-danger { - color: #333; - font-weight: 700 -} - -#searchresult .ajaxSearchResults a.selected .text-danger { - color: #ffc107; - text-shadow: 0 0 1px rgba(0, 0, 0, 0.5); -} - -#searchresult .ajaxSearchResults .locked a { - font-style: italic; - color: #646464; -} - -#searchresult .ajaxSearchResults .disabled a { - opacity: .5; - color: #7d2a24; -} - -#searchresult .ajaxSearchResults .deleted a { - color: #a52a2a; - text-decoration: line-through -} - +#searchresult { position: absolute; z-index: 99; overflow: hidden; top: 2.2rem; right: 0; bottom: 0; width: 0; max-width: 100%; background-color: #fff; border-left: 1px solid rgba(0, 0, 0, 0.1); opacity: 0; visibility: hidden; -webkit-transition: 0.25s ease 0.5s; transition: 0.25s ease 0.5s; -webkit-transition-delay: 0.3s; transition-delay: 0.3s; } +#searchresult.open { width: 20rem; box-shadow: 0 0 4.5rem rgba(0, 0, 0, 0.15); opacity: 1; visibility: visible; -webkit-transition: 0.5s ease 0.5s; transition: 0.5s ease 0.5s; -webkit-transition-delay: 0s; transition-delay: 0s } +#searchresult .ajaxSearchResults { width: 20rem; height: 100%; overflow: auto; } +#searchresult .ajaxSearchResults ul, #searchresult .ajaxSearchResults li { margin: 0; padding: 0; list-style: none } +#searchresult .ajaxSearchResults b, #searchresult .ajaxSearchResults strong, #searchresult .ajaxSearchResults a { position: relative; z-index: 0; display: block; color: #333; padding: 0.25rem 1rem; margin-top: -1px; border-top: 1px solid rgba(0, 0, 0, 0.03); border-bottom: 1px solid rgba(0, 0, 0, 0.03); box-sizing: border-box } +#searchresult .ajaxSearchResults b { z-index: 1; background-color: #ddd } +#searchresult .ajaxSearchResults a { padding: 0.25rem 2rem 0.25rem 1rem; text-decoration: none; } +#searchresult .ajaxSearchResults a:hover { color: #333; background-color: #f2f2f2; } +#searchresult .ajaxSearchResults a > i { position: absolute; right: 0; top: 50%; width: 2rem; height: 2rem; margin-top: -1rem; line-height: 2rem; text-align: center; color: #1976d2; } +#searchresult .ajaxSearchResults a.selected > i { color: #fff } +#searchresult .ajaxSearchResults a.selected { z-index: 1; background-color: #1976d2; color: #fff; font-weight: 700; } +#searchresult .ajaxSearchResults a .text-danger { color: #333; font-weight: 700 } +#searchresult .ajaxSearchResults a.selected .text-danger { color: #ffc107; text-shadow: 0 0 1px rgba(0, 0, 0, 0.5); } +#searchresult .ajaxSearchResults .locked a { font-style: italic; color: #646464; } +#searchresult .ajaxSearchResults .disabled a { opacity: .5; color: #7d2a24; } +#searchresult .ajaxSearchResults .deleted a { color: #a52a2a; text-decoration: line-through } @media (min-width: 1200px) { - #searchresult { - top: 2.5rem; - } - #mainMenu #nav #site a { - padding-left: 10.25rem; - } - #mainMenu #nav #site a::before { - content: ""; - display: block; - overflow: hidden; - position: absolute; - left: 0; - top: 0; - width: 9rem; - height: 100%; - background: url("../images/misc/logo-navbar.png") 0 50% no-repeat; - background-size: 8rem; - } - #mainMenu, - #mainMenu .nav > li > a, - #mainMenu .nav .label_searchid, - #mainMenu .nav > li > a .icon, - #mainMenu #searchform .mask, - #mainMenu #nav #site::before { - height: 2.5rem; - } - #mainMenu .nav > li > a, - #mainMenu .nav .label_searchid, - #mainMenu .nav > li .fa, - #mainMenu .nav > li > a .icon { - line-height: 2.5rem; - } - #mainMenu .nav > li > a .icon.photo { - width: 2.1rem; - height: 2.1rem; - margin-top: .2rem; - } - #mainMenu .nav > li .fa { - font-size: 0.875rem; - } - #mainMenu #nav > li > a { - padding: 0 1.25rem; - } - #mainMenu #nav > li > a > .fa { - display: none; - } - #mainMenu .nav > li > a .icon .fa { - line-height: 2.5rem; - font-size: 1.5rem; - } - #mainMenu .nav > li > ul { - box-shadow: 0 0.5rem 3rem rgba(0, 0, 0, 0.4); - } - #mainMenu .nav > li > ul > li.item-input { - padding: 0.575em 0.5em; - } - #mainMenu .nav > li > ul > li > a:first-child, - #mainMenu .nav > li > ul > li > span { - line-height: 2.5rem; - } - #mainMenu #searchform input { - min-height: 1.875rem; - height: 1.875rem; - } - #mainMenu .nav > li > ul > li.dropdown-toggle > a > .toggle { - line-height: 2.4rem; - font-size: 1rem; - } +#searchresult { top: 2.5rem; } +#mainMenu #nav #site a { padding-left: 10.25rem; } +#mainMenu #nav #site a::before { content: ""; display: block; overflow: hidden; position: absolute; left: 0; top: 0; width: 9rem; height: 100%; background: url("../images/misc/logo-navbar.png") 0 50% no-repeat; background-size: 8rem; } +#mainMenu, #mainMenu .nav > li > a, #mainMenu .nav .label_searchid, #mainMenu .nav > li > a .icon, #mainMenu #searchform .mask, #mainMenu #nav #site::before { height: 2.5rem; } +#mainMenu .nav > li > a, #mainMenu .nav .label_searchid, #mainMenu .nav > li .fa, #mainMenu .nav > li > a .icon { line-height: 2.5rem; } +#mainMenu .nav > li > a .icon.photo { width: 2.1rem; height: 2.1rem; margin-top: .2rem; } +#mainMenu .nav > li .fa { font-size: 0.875rem; } +#mainMenu #nav > li > a { padding: 0 1.25rem; } +#mainMenu #nav > li > a > .fa { display: none; } +#mainMenu .nav > li > a .icon .fa { line-height: 2.5rem; font-size: 1.5rem; } +#mainMenu .nav > li > ul { box-shadow: 0 0.5rem 3rem rgba(0, 0, 0, 0.4); } +#mainMenu .nav > li > ul > li.item-input { padding: 0.575em 0.5em; } +#mainMenu .nav > li > ul > li > a:first-child, #mainMenu .nav > li > ul > li > span { line-height: 2.5rem; } +#mainMenu #searchform input { min-height: 1.875rem; height: 1.875rem; } +#mainMenu .nav > li > ul > li.dropdown-toggle > a > .toggle { line-height: 2.4rem; font-size: 1rem; } } - @media (max-width: 1020px) { - #mainMenu #nav #bars { - width: 3rem - } - .nav > li > a, - #mainMenu .nav > li > ul > li > a, - #mainMenu .nav > li > ul > li > span, - #mainMenu .nav .label_searchid { - padding: 0 0.75rem; - } +#mainMenu #nav #bars { width: 3rem } +.nav > li > a, #mainMenu .nav > li > ul > li > a, #mainMenu .nav > li > ul > li > span, #mainMenu .nav .label_searchid { padding: 0 0.75rem; } } - @media (max-width: 840px) { - #statusbar { - display: none - } - #mainMenu #nav #bars { - width: 2.5rem - } - #mainMenu .nav > li { - position: static; - } - #mainMenu .nav > li > a { - font-size: 0; - } - #mainMenu .nav > li > a, - #mainMenu .nav .label_searchid { - padding: 0 0.5rem; - } - #mainMenu .nav > li > a > .username { - font-size: .75rem; - } - #mainMenu #nav > li > a > .fa { - display: inline-block; - } - #mainMenu .nav > li > a > .fa { - display: inline-block; - width: 1.3em; - margin-right: 0 !important; - text-align: center; - } - #mainMenu .nav > li > ul { - left: 0 !important; - width: 100%; - } - #mainMenu .nav > li > ul.sub-menu { - transform: translate3d(-100%, 0, 0) - } - #mainMenu.show .nav > li.active > ul.selected, - #mainMenu.show .nav > li.hover > ul.selected + ul.sub-menu { - opacity: 1; - visibility: visible; - } - #mainMenu.show .nav > li.active > ul.selected { - transform: translate3d(-100%, 0, 0); - } - #mainMenu.show .nav > li.hover > ul.selected + ul.sub-menu { - transform: translate3d(0, 0, 0); - } +#statusbar { display: none } +#mainMenu #nav #bars { width: 2.5rem } +#mainMenu .nav > li { position: static; } +#mainMenu .nav > li > a { font-size: 0; } +#mainMenu .nav > li > a, #mainMenu .nav .label_searchid { padding: 0 0.5rem; } +#mainMenu .nav > li > a > .username { font-size: .75rem; } +#mainMenu #nav > li > a > .fa { display: inline-block; } +#mainMenu .nav > li > a > .fa { display: inline-block; width: 1.3em; margin-right: 0 !important; text-align: center; } +#mainMenu .nav > li > ul { left: 0 !important; width: 100%; } +#mainMenu .nav > li > ul.sub-menu { transform: translate3d(-100%, 0, 0) } +#mainMenu.show .nav > li.active > ul.selected, #mainMenu.show .nav > li.hover > ul.selected + ul.sub-menu { opacity: 1; visibility: visible; } +#mainMenu.show .nav > li.active > ul.selected { transform: translate3d(-100%, 0, 0); } +#mainMenu.show .nav > li.hover > ul.selected + ul.sub-menu { transform: translate3d(0, 0, 0); } } - @media (max-width: 480px) { - #mainMenu .nav > li > a .username, - #searchresult .ajaxSearchResults a > i { - display: none - } - #mainMenu .nav > li > a .icon { - margin-left: 0 - } - #searchresult.open, - #searchresult .ajaxSearchResults { - width: 100% - } +#mainMenu .nav > li > a .username, #searchresult .ajaxSearchResults a > i { display: none } +#mainMenu .nav > li > a .icon { margin-left: 0 } +#searchresult.open, #searchresult .ajaxSearchResults { width: 100% } } - /* theme modes */ - /* lightness */ - -.lightness #mainMenu { - -webkit-box-shadow: 0 2px 4px rgba(0,0,0,0.15); - box-shadow: 0 2px 4px rgba(0,0,0,0.15); -} - -.lightness #mainMenu, -.lightness #mainMenu #nav #site a::before { - background-color: #f1f1f1; - color: #464646; -} - -.lightness #mainMenu .nav > li > a, -.lightness #mainMenu .nav .label_searchid { - color: #464646 -} - -.lightness #mainMenu.show .nav > li.dropdown.hover > a { - color: #222; -} - -.lightness #mainMenu #nav #site a::before { - background-image: url("../images/misc/login-logo.png") -} - +.lightness #mainMenu { -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15); } +.lightness #mainMenu, .lightness #mainMenu #nav #site a::before { background-color: #f1f1f1; color: #464646; } +.lightness #mainMenu .nav > li > a, .lightness #mainMenu .nav .label_searchid { color: #464646 } +.lightness #mainMenu.show .nav > li.dropdown.hover > a { color: #222; } +.lightness #mainMenu #nav #site a::before { background-image: url("../images/misc/login-logo.png") } /* light */ - -.light #mainMenu { - -webkit-box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.3); - box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.3); -} - -.light #mainMenu, -.light #mainMenu #nav #site a::before { - background-color: #343944; - color: #cacaca; -} - -.light #mainMenu .nav > li > a, -.light #mainMenu .nav .label_searchid { - color: #DCD9E3; -} - -.light #mainMenu.show .nav > li.dropdown.hover > a { - color: #444; -} - +.light #mainMenu { -webkit-box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, .3); box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, .3); } +.light #mainMenu, .light #mainMenu #nav #site a::before { background-color: #343944; color: #cacaca; } +.light #mainMenu .nav > li > a, .light #mainMenu .nav .label_searchid { color: #dcd9e3; } +.light #mainMenu.show .nav > li.dropdown.hover > a { color: #444; } /* dark */ - -.dark #mainMenu { - -webkit-box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); - box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); -} - -.dark #mainMenu, -.dark #mainMenu #nav #site a::before { - background-color: #202329; - color: #bbb; -} - -.dark #mainMenu .nav > li > a, -.dark #mainMenu .nav .label_searchid { - color: #bbb -} - -.dark #mainMenu.show .nav > li.dropdown.hover > a { - color: #444; -} - +.dark #mainMenu { -webkit-box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); } +.dark #mainMenu, .dark #mainMenu #nav #site a::before { background-color: #202329; color: #bbb; } +.dark #mainMenu .nav > li > a, .dark #mainMenu .nav .label_searchid { color: #bbb } +.dark #mainMenu.show .nav > li.dropdown.hover > a { color: #444; } /* darkness */ - -.darkness #mainMenu { - -webkit-box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); - box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); -} - -.darkness #mainMenu, -.darkness #mainMenu #nav #site a::before { - background-color: #202329; - color: #bbb; -} - -.darkness #mainMenu .nav > li > a, -.darkness #mainMenu .nav .label_searchid { - color: #bbb; -} - -.darkness #mainMenu.show .nav > li.dropdown.hover > a { - color: #eee; - background-color: #343942; -} - -.darkness #mainMenu .nav > li > ul { - background-color: #343942; -} - -.darkness #mainMenu .nav > li > ul > li > a:first-child, -.darkness #mainMenu .nav > li > ul > li > span { - color: #eee; -} -#mainMenu .nav > li > ul > li > span:hover { - background-color: inherit; -} - -.darkness #mainMenu .nav li.item-group > * { - background-color: transparent -} - -.darkness #searchresult { - background-color: #202329; - border-left: 1px solid #282c34; -} - -.darkness #searchresult .ajaxSearchResults b { - background-color: #1a1c21; -} - -.darkness #searchresult .ajaxSearchResults b, -.darkness #searchresult .ajaxSearchResults strong, -.darkness #searchresult .ajaxSearchResults a { - border-color: #282c34; - color: #aaa; -} - -.darkness #searchresult .ajaxSearchResults a:hover { - background-color: #343942; -} - -.darkness #searchresult .ajaxSearchResults .disabled a { - color: #da4439; -} +.darkness #mainMenu { -webkit-box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); } +.darkness #mainMenu, .darkness #mainMenu #nav #site a::before { background-color: #202329; color: #bbb; } +.darkness #mainMenu .nav > li > a, .darkness #mainMenu .nav .label_searchid { color: #bbb; } +.darkness #mainMenu.show .nav > li.dropdown.hover > a { color: #eee; background-color: #343942; } +.darkness #mainMenu .nav > li > ul { background-color: #343942; } +.darkness #mainMenu .nav > li > ul > li > a:first-child, .darkness #mainMenu .nav > li > ul > li > span { color: #eee; } +#mainMenu .nav > li > ul > li > span:hover { background-color: inherit; } +.darkness #mainMenu .nav li.item-group > * { background-color: transparent } +.darkness #searchresult { background-color: #202329; border-left: 1px solid #282c34; } +.darkness #searchresult .ajaxSearchResults b { background-color: #1a1c21; } +.darkness #searchresult .ajaxSearchResults b, .darkness #searchresult .ajaxSearchResults strong, .darkness #searchresult .ajaxSearchResults a { border-color: #282c34; color: #aaa; } +.darkness #searchresult .ajaxSearchResults a:hover { background-color: #343942; } +.darkness #searchresult .ajaxSearchResults .disabled a { color: #da4439; } diff --git a/manager/media/style/default/css/tabpane.css b/manager/media/style/default/css/tabpane.css index 728e9fbe52..8c641f8689 100755 --- a/manager/media/style/default/css/tabpane.css +++ b/manager/media/style/default/css/tabpane.css @@ -1,927 +1,173 @@ /* [ Tabs ] */ - -.tab-row { - position: relative; - z-index: 1; - white-space: nowrap; - padding: 0 1.5rem -} - -.tab-row::after, -.tab-row-container::after { - content: ""; - position: absolute; - z-index: 1; - left: 0; - right: 0; - bottom: 0; - height: 1px; - background-color: #ddd -} - -.tab-row .tab, -.tab-pane > .tab-page > .tab { - position: relative; - display: inline-block; - margin: 0; - padding: 0 0.875rem; - line-height: 2.7rem; - height: 2.5rem; - text-transform: uppercase; - border: 1px solid rgba(0, 0, 0, 0); - border-bottom: none; - cursor: pointer; - -webkit-user-select: none; - user-select: none; -} - -.tab-row .tab, -.tab-row .tab a, -.tab-pane > .tab-page > .tab { - color: rgba(0, 0, 0, 0.6); - font-size: 0.75rem -} - -.tab-row .tab.selected { - z-index: 2; - border-color: #ddd; - background-color: #fff; - color: #444; - font-weight: 700 -} - -.tab-row .tab .fa { - margin-right: 0.1em; - font-size: 0.875rem -} - +.tab-row { position: relative; z-index: 1; white-space: nowrap; padding: 0 1.5rem } +.tab-row::after, .tab-row-container::after { content: ""; position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; height: 1px; background-color: #ddd } +.tab-row .tab, .tab-pane > .tab-page > .tab { position: relative; display: inline-block; margin: 0; padding: 0 0.875rem; line-height: 2.7rem; height: 2.5rem; text-transform: uppercase; border: 1px solid rgba(0, 0, 0, 0); border-bottom: none; cursor: pointer; -webkit-user-select: none; user-select: none; } +.tab-row .tab, .tab-row .tab a, .tab-pane > .tab-page > .tab { color: rgba(0, 0, 0, 0.6); font-size: 0.75rem } +.tab-row .tab.selected { z-index: 2; border-color: #ddd; background-color: #fff; color: #444; font-weight: 700 } +.tab-row .tab .fa { margin-right: 0.1em; font-size: 0.875rem } /* tabs-container */ - -.tab-row-container { - height: 2.5rem; - left: 0; - overflow-y: hidden; - padding: 0 1.5rem; - position: relative; - z-index: 0 -} - -.tab-row-container .tab-row { - z-index: 2; - -webkit-overflow-scrolling: touch; - overflow-x: auto; - padding: 0 0 2rem; - white-space: nowrap -} - -.tab-row-container .tab-row::after { - display: none -} - -.tab-row-container > i { - position: absolute; - top: 0; - height: 100%; - text-align: center; - font: normal normal normal 1.2rem/2.7rem FontAwesome; - cursor: pointer; - transition-duration: 0.2s; - width: 1.5rem; -} - -.tab-row-container > i.prev { - left: 0; -} - -.tab-row-container > i.next { - right: 0; -} - -.tab-row-container > i.disable { - font-size: 0.8rem; - color: rgba(0, 0, 0, 0.2); - pointer-events: none -} - +.tab-row-container { height: 2.5rem; left: 0; overflow-y: hidden; padding: 0 1.5rem; position: relative; z-index: 0 } +.tab-row-container .tab-row { z-index: 2; -webkit-overflow-scrolling: touch; overflow-x: auto; padding: 0 0 2rem; white-space: nowrap } +.tab-row-container .tab-row::after { display: none } +.tab-row-container > i { position: absolute; top: 0; height: 100%; text-align: center; font: normal normal normal 1.2rem/2.7rem FontAwesome; cursor: pointer; transition-duration: 0.2s; width: 1.5rem; } +.tab-row-container > i.prev { left: 0; } +.tab-row-container > i.next { right: 0; } +.tab-row-container > i.disable { font-size: 0.8rem; color: rgba(0, 0, 0, 0.2); pointer-events: none } /* tab-page */ - -.tab-pane > .tab-page { - display: block -} - -.tab-pane > .tab-page ~ .tab-page { - display: none -} - -.tab-pane > .tab-page:first-of-type { - display: block; - margin-top: 2.5rem; -} - -.tab-pane > .tab-page > .tab { - top: -2.5rem; - left: 1.5rem; - background-color: #f9f9f9; - border-color: #ddd; -} - -.sectionBody > .tab-pane > .tab-page > .tab { - top: -3.7rem; - left: 0.3rem; -} - -.tab-pane > .tab-page > div:first-of-type, -.tab-pane > .tab-page > table { - margin-top: -2.5rem -} - -.dynamic-tab-pane-control.tab-pane > .tab-page > div:first-of-type, -.dynamic-tab-pane-control.tab-pane > .tab-page > table { - margin-top: 0 -} - -.tab-page { - clear: both; - width: 100%; - background-color: #fff; - padding: 0; - border: 0; - border-radius: 0; - box-shadow: 0 0 0.3rem 0 rgba(0, 0, 0, .1) -} - -.tab-page .tab-header, -.sectionHeader { - margin-top: 1em; - padding: .5rem 1.25rem; - letter-spacing: 0; - font-size: 0.875rem; - font-weight: bold; - color: #777; -} - -.tab-page .tab-header + .tab-header, -.tab-page .sectionHeader + .sectionHeader { - margin-top: 0; - border-top: 1px solid #ccc; -} - -.tab-page > .tab-body .tab-header { - padding-left: 0; - padding-right: 0 -} - -.tab-page > .tab-header:first-child, -.tab-page > .tab-body > .tab-header:first-child, -.tab-page .sectionHeader:first-child, -.tab-page > script + .sectionHeader, -.sectionBody .tab-page > script + .tab-section { - margin-top: 0 -} - -.tab-page > .tab-body { - width: 100%; - padding: 1.25rem; -} - -.tab-page > .tab-body > .tab-body, -.tab-page .sectionBody { - padding: 1rem 0; -} - -.tab-page > .tab-header + .tab-body, -.tab-page > .tab-body .tab-header + .tab-body, -.tab-page .sectionHeader + .sectionBody { - padding-top: 1em; - border-top: 1px solid rgba(0, 0, 0, 0.1); -} - -.tab-page > .tab-body::after { - display: table; - width: 100%; - content: '' -} - -.tab-page .tab-body > .form-group:last-child, -.tab-page .tab-body > .form-row:last-child, -.tab-page .tab-body > p:last-child, -.tab-page .tab-body > .form-group:last-child > p:last-child, -.tab-page .sectionBody:last-child { - margin-bottom: 0 -} - -.tab-page .tab-section, -.tab-page .sectionHeader + .sectionBody { - margin-top: 1.25rem; - background-color: #fafafa; - border: 1px solid #e0e0e0; - border-radius: .1rem; -} - -.tab-page .tab-section:first-child, -.tab-page .sectionHeader + .sectionBody, -.tab-page .sectionBody ~ .sectionHeader { - margin-top: 0 -} - -.tab-page .tab-section .tab-header, -.tab-page .sectionHeader { - margin-left: -1px; - margin-right: -1px; - padding-left: .5rem; - padding-right: .5rem; - background-color: #efeff6; - border: 1px solid #e0e0e0; - border-bottom: 2px solid #e0e0ec; -} - -.tab-page .tab-header, -.tab-page .tab-section .tab-header, -.tab-page .sectionHeader { - background-color: #f3f3f3; - border-bottom-width: 1px; -} - -.tab-page .tab-section .tab-header:first-child, -.tab-page .sectionHeader { - margin-top: -1px; - border-top: none -} - -.tab-page .tab-section .tab-header + .tab-header, -.tab-page .tab-section .tab-body + .tab-header, -.tab-page .sectionHeader { - border-top: 1px solid #e0e0e0; -} - -.tab-page .tab-section .tab-body, -.tab-page .sectionBody { - padding: 1rem; -} - -.tab-page > .sectionHeader, -.sectionBody .tab-page > .tab-section { - margin-top: 1rem; - margin-left: .25rem; - margin-right: .25rem -} - -.tab-page .sectionBody { - margin: 1rem .25rem; -} - -.tab-page .sectionHeader + .sectionBody { - border-top-color: transparent; - border-radius: 0 -} - -.tab-page > .tab-section .tab-pane { - padding-top: 1.25rem -} - -.tab-page > .tab-pane { - margin-left: -1.25rem; - margin-right: -1.25rem -} - -.tab-page > .tab-pane > .tab-page { - box-shadow: none; -} - -.tab-page > .tab-pane > .tab-page > .tab-body { - padding-bottom: 0 -} - +.tab-pane > .tab-page { display: block } +.tab-pane > .tab-page ~ .tab-page { display: none } +.tab-pane > .tab-page:first-of-type { display: block; margin-top: 2.5rem; } +.tab-pane > .tab-page > .tab { top: -2.5rem; left: 1.5rem; background-color: #f9f9f9; border-color: #ddd; } +.sectionBody > .tab-pane > .tab-page > .tab { top: -3.7rem; left: 0.3rem; } +.tab-pane > .tab-page > div:first-of-type, .tab-pane > .tab-page > table { margin-top: -2.5rem } +.dynamic-tab-pane-control.tab-pane > .tab-page > div:first-of-type, .dynamic-tab-pane-control.tab-pane > .tab-page > table { margin-top: 0 } +.tab-page { clear: both; width: 100%; background-color: #fff; padding: 0; border: 0; border-radius: 0; box-shadow: 0 0 0.3rem 0 rgba(0, 0, 0, .1) } +.tab-page .tab-header, .sectionHeader { margin-top: 1em; padding: .5rem 1.25rem; +letter-spacing: 0; font-size: 0.875rem; font-weight: bold; color: #777; } +.tab-page .tab-header + .tab-header, .tab-page .sectionHeader + .sectionHeader { margin-top: 0; border-top: 1px solid #ccc; } +.tab-page > .tab-body .tab-header { padding-left: 0; padding-right: 0 } +.tab-page > .tab-header:first-child, .tab-page > .tab-body > .tab-header:first-child, .tab-page .sectionHeader:first-child, .tab-page > script + .sectionHeader, .sectionBody .tab-page > script + .tab-section { margin-top: 0 } +.tab-page > .tab-body { width: 100%; padding: 1.25rem; } +.tab-page > .tab-body > .tab-body, .tab-page .sectionBody { padding: 1rem 0; } +.tab-page > .tab-header + .tab-body, .tab-page > .tab-body .tab-header + .tab-body, .tab-page .sectionHeader + .sectionBody { padding-top: 1em; border-top: 1px solid rgba(0, 0, 0, 0.1); } +.tab-page > .tab-body::after { display: table; width: 100%; content: '' } +.tab-page .tab-body > .form-group:last-child, .tab-page .tab-body > .form-row:last-child, .tab-page .tab-body > p:last-child, .tab-page .tab-body > .form-group:last-child > p:last-child, .tab-page .sectionBody:last-child { margin-bottom: 0 } +.tab-page .tab-section, .tab-page .sectionHeader + .sectionBody { margin-top: 1.25rem; background-color: #fafafa; border: 1px solid #e0e0e0; border-radius: .1rem; } +.tab-page .tab-section:first-child, .tab-page .sectionHeader + .sectionBody, .tab-page .sectionBody ~ .sectionHeader { margin-top: 0 } +.tab-page .tab-section .tab-header, .tab-page .sectionHeader { margin-left: -1px; margin-right: -1px; padding-left: .5rem; +padding-right: .5rem; +background-color: #efeff6; border: 1px solid #e0e0e0; border-bottom: 2px solid #e0e0ec; } +.tab-page .tab-header, .tab-page .tab-section .tab-header, .tab-page .sectionHeader { background-color: #f3f3f3; border-bottom-width: 1px; } +.tab-page .tab-section .tab-header:first-child, .tab-page .sectionHeader { margin-top: -1px; border-top: none } +.tab-page .tab-section .tab-header + .tab-header, .tab-page .tab-section .tab-body + .tab-header, .tab-page .sectionHeader { border-top: 1px solid #e0e0e0; } +.tab-page .tab-section .tab-body, .tab-page .sectionBody { padding: 1rem; } +.tab-page > .sectionHeader, .sectionBody .tab-page > .tab-section { margin-top: 1rem; margin-left: .25rem; margin-right: .25rem } +.tab-page .sectionBody { margin: 1rem .25rem; } +.tab-page .sectionHeader + .sectionBody { border-top-color: transparent; border-radius: 0 } +.tab-page > .tab-section .tab-pane { padding-top: 1.25rem } +.tab-page > .tab-pane { margin-left: -1.25rem; margin-right: -1.25rem } +.tab-page > .tab-pane > .tab-page { box-shadow: none; } +.tab-page > .tab-pane > .tab-page > .tab-body { padding-bottom: 0 } /* tab-page-header collapse */ - -.tab-page .tab-header[data-toggle="collapse"]::after { - float: right; - content: "\f107"; - font-family: FontAwesome; - font-size: 1rem; - line-height: 1em; - color: #777; - cursor: pointer; - transition-duration: .3s -} - -.tab-page .tab-header[data-toggle="collapse"].collapsed::after { - transform: rotate(180deg) -} - -.tab-page .tab-header[data-toggle="collapse"]:hover::after { - color: #333 -} - +.tab-page .tab-header[data-toggle="collapse"]::after { float: right; content: "\f107"; font-family: FontAwesome; font-size: 1rem; line-height: 1em; color: #777; cursor: pointer; transition-duration: .3s } +.tab-page .tab-header[data-toggle="collapse"].collapsed::after { transform: rotate(180deg) } +.tab-page .tab-header[data-toggle="collapse"]:hover::after { color: #333 } /* old style */ - -.sectionBody .tab-page { - clear: both; - width: 100%; - background-color: #fff; - padding: 0; - border: 0; - border-radius: 0; - box-shadow: 0 0 0.3rem 0 rgba(0, 0, 0, .1) -} - -.sectionBody > .tab-pane > .tab-page { - padding: 1.25rem; -} - -.tab-page > table { - width: 100%; - border-collapse: collapse -} - -.sectionBody .displayparams, -.sectionBody .permissiongroup { - margin-bottom: 0.15rem; - background-color: #eee; - border-collapse: separate; - border-spacing: 1px; -} - -.sectionBody .displayparams th, -.sectionBody .displayparams td { - padding: 4px 4px; -} - -.sectionBody .displayparams thead td, -.sectionBody .permissiongroup thead td { - border-top: none; -} - -.sectionBody fieldset { - background: none repeat scroll 0 0 #fdfdfd; - border: 1px solid #ccc; - padding: 1rem !important; -} - -.sectionBody legend { - font-weight: 500; - padding: 5px 1rem; - background: #fff; - border: 1px solid #ccc; - -webkit-box-shadow: 1px 1px 3px #ccc; - box-shadow: 1px 1px 3px #ccc; - -webkit-border-radius: 3px; - border-radius: 3px; -} - -.sectionBody fieldset h3 { - font-size: 14px; - color: #789; - font-weight: 500; - padding-bottom: 0; - margin-bottom: 0; -} - -.showHideVisible { - color: #333; - margin: 0 1rem; - padding: 5px 3px 5px; - font-weight: 500; - text-shadow: 0 1px 0 #fff; -} - -.showHideVisible + .sectionBody { - margin-top: -1px !important -} - -.sectionBody, -.layerVisible { - position: relative; -} - -.sectionBody > p:first-child { - margin-left: 1rem; - margin-right: 1rem -} - -.showHideVisible, -.layerVisible { - margin: 0 10px 4px; -} - -.sectionBody td, -.sectionBody th { - padding: 0.15rem 0.25rem; - vertical-align: top; -} - -.sectionBody .tab-page#tabGeneral > table + div { - margin-top: 1.3rem; -} - -#tabGeneral > table { - margin-bottom: 1rem; -} - -#tab1Help > img { - margin-bottom: 1.25rem; -} - +.sectionBody .tab-page { clear: both; width: 100%; background-color: #fff; padding: 0; border: 0; border-radius: 0; box-shadow: 0 0 0.3rem 0 rgba(0, 0, 0, .1) } +.sectionBody > .tab-pane > .tab-page { padding: 1.25rem; } +.tab-page > table { width: 100%; border-collapse: collapse } +.sectionBody .displayparams, .sectionBody .permissiongroup { margin-bottom: 0.15rem; background-color: #eee; border-collapse: separate; border-spacing: 1px; } +.sectionBody .displayparams th, .sectionBody .displayparams td { padding: 4px 4px; } +.sectionBody .displayparams thead td, .sectionBody .permissiongroup thead td { border-top: none; } +.sectionBody fieldset { background: none repeat scroll 0 0 #fdfdfd; border: 1px solid #ccc; padding: 1rem !important; } +.sectionBody legend { font-weight: 500; padding: 5px 1rem; background: #fff; border: 1px solid #ccc; -webkit-box-shadow: 1px 1px 3px #ccc; box-shadow: 1px 1px 3px #ccc; -webkit-border-radius: 3px; border-radius: 3px; } +.sectionBody fieldset h3 { font-size: 14px; color: #789; font-weight: 500; padding-bottom: 0; margin-bottom: 0; } +.showHideVisible { color: #333; margin: 0 1rem; padding: 5px 3px 5px; font-weight: 500; text-shadow: 0 1px 0 #fff; } +.showHideVisible + .sectionBody { margin-top: -1px !important } +.sectionBody, .layerVisible { position: relative; } +.sectionBody > p:first-child { margin-left: 1rem; margin-right: 1rem } +.showHideVisible, .layerVisible { margin: 0 10px 4px; } +.sectionBody td, .sectionBody th { padding: 0.15rem 0.25rem; vertical-align: top; } +.sectionBody .tab-page#tabGeneral > table + div { margin-top: 1.3rem; } +#tabGeneral > table { margin-bottom: 1rem; } +#tab1Help > img { margin-bottom: 1.25rem; } /* [ POPUPS ] */ - -.evo-popup { - display: none; - position: absolute; - z-index: 10500; - box-shadow: 0 0.2rem 2rem rgba(0, 0, 0, 0.1); -} - -.evo-popup.animation { - -webkit-transition: .25s; - transition: .25s -} - -.evo-popup:hover { - box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); -} - -.evo-popup.alert { - margin: 0; - height: 100%; - border-color: rgba(0, 0, 0, 0.1); - background-color: #fff; - color: #444; - border-radius: .15rem; -} - -.evo-popup.alert-dark { - background-color: #202329; - color: #ccc; -} - -.evo-popup.alert-dark hr { - border-color: rgba(255, 255, 255, 0.5); -} - -.evo-popup.alert-dark .close { - color: #fff; - text-shadow: 0 0 #000; -} - -.evo-popup.alert-success { - border-color: rgba(0, 0, 0, 0.1); - background-color: #5cb85c; - color: #fff; -} - -.evo-popup.alert-success hr { - border-color: rgba(255, 255, 255, 0.5); -} - -.evo-popup.alert-info { - border-color: rgba(0, 0, 0, 0.1); - background-color: #1976d2; - color: #fff; -} - -.evo-popup.alert-info hr { - border-color: rgba(255, 255, 255, 0.5); -} - -.evo-popup.alert-warning { - border-color: rgba(0, 0, 0, 0.1); - background-color: #ffe082; - color: #795548; -} - -.evo-popup.alert-warning hr { - border-color: rgba(0, 0, 0, 0.1); -} - -.evo-popup.alert-danger { - border-color: rgba(0, 0, 0, 0.1); - background-color: #d9534f; - color: #fff; -} - -.evo-popup.alert-danger hr { - border-color: rgba(255, 255, 255, 0.5); -} - -.evo-popup.alert.evo-popup-iframe { - padding: 0; - border: none; - background-color: #fafafa; - overflow: hidden; -} - +.evo-popup { display: none; position: absolute; z-index: 10500; box-shadow: 0 0.2rem 2rem rgba(0, 0, 0, 0.1); } +.evo-popup.animation { -webkit-transition: .25s; transition: .25s } +.evo-popup:hover { box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); } +.evo-popup.alert { margin: 0; height: 100%; border-color: rgba(0, 0, 0, 0.1); background-color: #fff; color: #444; border-radius: .15rem; } +.evo-popup.alert-dark { background-color: #202329; color: #ccc; } +.evo-popup.alert-dark hr { border-color: rgba(255, 255, 255, 0.5); } +.evo-popup.alert-dark .close { color: #fff; text-shadow: 0 0 #000; } +.evo-popup.alert-success { border-color: rgba(0, 0, 0, 0.1); background-color: #5cb85c; color: #fff; } +.evo-popup.alert-success hr { border-color: rgba(255, 255, 255, 0.5); } +.evo-popup.alert-info { border-color: rgba(0, 0, 0, 0.1); background-color: #1976d2; color: #fff; } +.evo-popup.alert-info hr { border-color: rgba(255, 255, 255, 0.5); } +.evo-popup.alert-warning { border-color: rgba(0, 0, 0, 0.1); background-color: #ffe082; color: #795548; } +.evo-popup.alert-warning hr { border-color: rgba(0, 0, 0, 0.1); } +.evo-popup.alert-danger { border-color: rgba(0, 0, 0, 0.1); background-color: #d9534f; color: #fff; } +.evo-popup.alert-danger hr { border-color: rgba(255, 255, 255, 0.5); } +.evo-popup.alert.evo-popup-iframe { padding: 0; border: none; background-color: #fafafa; overflow: hidden; } .evo-popup.alert .evo-popup-header { - padding-bottom: .5rem; - margin-bottom: .5rem; - border-bottom: 1px solid -} - -.evo-popup .close { - position: absolute; - top: .3em; - right: .3em; -} - -.evo-popup.evo-popup-iframe .close { - position: absolute; - z-index: 9; - opacity: 1; - top: 0; - right: 0; - width: 1.5rem; - height: 1.5rem; - line-height: 1.4rem; - color: #fff; - background-color: #e5a2a0; - text-align: center; - font-weight: 100; -} - -.evo-popup.evo-popup-iframe .close:hover { - opacity: 1; - background-color: #d9534f; -} - -.evo-popup.evo-popup-iframe .evo-popup-header { - position: relative; - height: 1.5rem; - margin: 0; - padding: 0 1.5rem 0 .5rem; - line-height: 1.5rem; - font-size: .9rem; - border-bottom: 1px solid #dedede; -} - -.evo-popup.evo-popup-iframe .evo-popup-header i { - line-height: 1.5rem !important; -} - -.evo-popup.evo-popup-iframe .evo-popup-body { - position: absolute; - z-index: 1; - left: 0; - top: 0; - right: 0; - bottom: 0; -} - -.evo-popup.evo-popup-iframe .evo-popup-header + .evo-popup-body { - top: 1.5rem -} - -.evo-popup.evo-popup-iframe.changed { - box-shadow: 0 0.2rem 2rem rgba(0, 0, 0, 0.1), 0 0 .2rem .2rem #ffc107 -} - -.evo-popup-overlay { - position: fixed; - z-index: 10499; - left: 0; - top: 0; - right: 0; - bottom: 0; - background-color: rgba(0, 0, 0, 0.3); -} - -.evo-popup-overlay::before { - position: absolute; - left: 20%; - top: 20%; - width: 45%; - height: 45%; - opacity: 0; - background-color: rgba(0, 0, 0, 0.3); - transition: all 0.25s ease-in-out; -} - -.evo-popup.is-drag::before, -.evo-popup.is-resize::before { - content: ""; - position: absolute; - z-index: 9; - left: 0; - top: 0; - right: 0; - bottom: 0; - background-color: transparent; -} - -.evo-popup.resize .border-outline { - display: none; -} - -.evo-popup.resize:hover .border-outline, -.evo-popup.is-resize .border-outline, -.evo-popup.resize:hover .border-outline i, -.evo-popup.is-resize .border-outline i { - display: block !important -} - -.evo-popup.resize .border-outline i { - position: absolute; - z-index: 99; - display: none; - background-color: transparent -} - -.evo-popup.resize .border-outline .bo-left, -.evo-popup.resize .border-outline .bo-right { - width: .25rem; - height: 100%; -} - -.evo-popup.resize .border-outline .bo-left { - left: 0; -} - -.evo-popup.resize .border-outline .bo-right { - right: 0; -} - -.evo-popup.resize .border-outline .bo-top, -.evo-popup.resize .border-outline .bo-bottom { - height: .25rem; - width: 100%; -} - -.evo-popup.resize .border-outline .bo-top { - top: 0; -} - -.evo-popup.resize .border-outline .bo-bottom { - bottom: 0; -} - +padding-bottom: .5rem; +margin-bottom: .5rem; border-bottom: 1px solid } +.evo-popup .close { position: absolute; top: .3em; right: .3em; } +.evo-popup.evo-popup-iframe .close { position: absolute; z-index: 9; opacity: 1; top: 0; right: 0; width: 1.5rem; height: 1.5rem; line-height: 1.4rem; color: #fff; background-color: #e5a2a0; text-align: center; font-weight: 100; } +.evo-popup.evo-popup-iframe .close:hover { opacity: 1; background-color: #d9534f; } +.evo-popup.evo-popup-iframe .evo-popup-header { position: relative; height: 1.5rem; margin: 0; padding: 0 1.5rem 0 .5rem; +line-height: 1.5rem; font-size: .9rem; +border-bottom: 1px solid #dedede; } +.evo-popup.evo-popup-iframe .evo-popup-header i { line-height: 1.5rem !important; } +.evo-popup.evo-popup-iframe .evo-popup-body { position: absolute; z-index: 1; left: 0; top: 0; right: 0; bottom: 0; } +.evo-popup.evo-popup-iframe .evo-popup-header + .evo-popup-body { top: 1.5rem } +.evo-popup.evo-popup-iframe.changed { box-shadow: 0 0.2rem 2rem rgba(0, 0, 0, 0.1), 0 0 .2rem .2rem #ffc107 } +.evo-popup-overlay { position: fixed; z-index: 10499; left: 0; top: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.3); } +.evo-popup-overlay::before { position: absolute; left: 20%; top: 20%; width: 45%; height: 45%; opacity: 0; background-color: rgba(0, 0, 0, 0.3); transition: all 0.25s ease-in-out; } +.evo-popup.is-drag::before, .evo-popup.is-resize::before { content: ""; position: absolute; z-index: 9; left: 0; top: 0; right: 0; bottom: 0; background-color: transparent; } +.evo-popup.resize .border-outline { display: none; } +.evo-popup.resize:hover .border-outline, .evo-popup.is-resize .border-outline, .evo-popup.resize:hover .border-outline i, .evo-popup.is-resize .border-outline i { display: block !important } +.evo-popup.resize .border-outline i { position: absolute; z-index: 99; display: none; background-color: transparent } +.evo-popup.resize .border-outline .bo-left, .evo-popup.resize .border-outline .bo-right { +width: .25rem; height: 100%; } +.evo-popup.resize .border-outline .bo-left { left: 0; } +.evo-popup.resize .border-outline .bo-right { right: 0; } +.evo-popup.resize .border-outline .bo-top, .evo-popup.resize .border-outline .bo-bottom { +height: .25rem; width: 100%; } +.evo-popup.resize .border-outline .bo-top { top: 0; } +.evo-popup.resize .border-outline .bo-bottom { bottom: 0; } /* [ EVO-TABS ] */ - -.evo-tab-row { - height: 1.875rem; - padding: 0; - background-color: #dfdfdf; -} - -.evo-tab-row:after { - background-color: #cfd2d6 -} - -.evo-tab-row .tab-row .tab { - height: 1.875rem; - line-height: 2rem; - font-size: .8125rem; - text-transform: none; - border: none; - border-right: 1px solid #cfd2d6; - border-left: 1px solid #cfd2d6; - margin-left: -1px; -} - -.evo-tab-row .tab-row .tab:hover { - background-color: rgba(255, 255, 255, 0.5) -} - -.evo-tab-row .tab-row .tab.changed { - color: #0275d8; -} - -.evo-tab-row .tab-row .tab.selected { - font-weight: normal; - color: #444; - background-color: #fafafa; -} - -.evo-tab-row .tab-row .tab i, -.evo-popup.evo-popup-iframe .evo-popup-header i { - float: left; - margin: 0; - line-height: 2.2em; -} - -.evo-tab-row .tab-row .tab small, -.evo-popup.evo-popup-iframe .evo-popup-header small { - margin-left: .25em -} - -.evo-tab-row .tab-row .tab:not(#evo-tab-home) i.help, -.evo-popup.evo-popup-iframe .evo-popup-header i.help { - display: none -} - -.evo-tab-row .tab-row .tab:not(#evo-tab-home) i, -.evo-popup.evo-popup-iframe .evo-popup-header i { - margin-right: .25em -} - -.evo-tab-row .tab-row .tab span { - background: none !important -} - -.evo-tab-row .tab-row .tab .tab-title { - float: left; - width: 5rem; - line-height: 2rem; - text-overflow: ellipsis; - overflow: hidden; -} - -.evo-tab-row .tab-row .tab .tab-close { - float: right; - margin: 0 -.75rem 0 .5rem; - padding: .25em; - line-height: 1.3em; - font-size: 1.3em; - font-weight: 700; - color: #9e9e9e -} - -.evo-tab-row .tab-row .tab .tab-close:hover { - color: #d9534f -} - -.evo-tab-page { - position: absolute; - overflow: hidden; - z-index: -1; - display: block; - left: 0; - top: 2.3em; - right: 0; - bottom: 0; - height: auto; - box-shadow: none; - background-color: #fafafa; -} - -.evo-tab-page.show { - z-index: 1; -} - -.evo-tab-page iframe { - position: absolute; - left: 0; - top: 0; - width: 100%; - height: 100%; - background-color: #fafafa; - overflow: hidden; -} - +.evo-tab-row { height: 1.875rem; padding: 0; background-color: #dfdfdf; } +.evo-tab-row:after { background-color: #cfd2d6 } +.evo-tab-row .tab-row .tab { height: 1.875rem; line-height: 2rem; font-size: .8125rem; +text-transform: none; border: none; border-right: 1px solid #cfd2d6; border-left: 1px solid #cfd2d6; margin-left: -1px; } +.evo-tab-row .tab-row .tab:hover { background-color: rgba(255, 255, 255, 0.5) } +.evo-tab-row .tab-row .tab.changed { color: #0275d8; } +.evo-tab-row .tab-row .tab.selected { font-weight: normal; color: #444; background-color: #fafafa; } +.evo-tab-row .tab-row .tab i, .evo-popup.evo-popup-iframe .evo-popup-header i { float: left; margin: 0; line-height: 2.2em; } +.evo-tab-row .tab-row .tab small, .evo-popup.evo-popup-iframe .evo-popup-header small { margin-left: .25em } +.evo-tab-row .tab-row .tab:not(#evo-tab-home) i.help, .evo-popup.evo-popup-iframe .evo-popup-header i.help { display: none } +.evo-tab-row .tab-row .tab:not(#evo-tab-home) i, .evo-popup.evo-popup-iframe .evo-popup-header i { margin-right: .25em } +.evo-tab-row .tab-row .tab span { background: none !important } +.evo-tab-row .tab-row .tab .tab-title { float: left; width: 5rem; line-height: 2rem; text-overflow: ellipsis; overflow: hidden; } +.evo-tab-row .tab-row .tab .tab-close { float: right; margin: 0 -.75rem 0 .5rem; +padding: .25em; line-height: 1.3em; font-size: 1.3em; font-weight: 700; color: #9e9e9e } +.evo-tab-row .tab-row .tab .tab-close:hover { color: #d9534f } +.evo-tab-page { position: absolute; overflow: hidden; z-index: -1; display: block; left: 0; top: 2.3em; right: 0; bottom: 0; height: auto; box-shadow: none; background-color: #fafafa; } +.evo-tab-page.show { z-index: 1; } +.evo-tab-page iframe { position: absolute; left: 0; top: 0; width: 100%; height: 100%; background-color: #fafafa; overflow: hidden; } @media (min-width: 1200px) { - .evo-tab-row .tab-row .tab .tab-title { - width: 7rem; - } +.evo-tab-row .tab-row .tab .tab-title { width: 7rem; } } - /* modes theme */ - /* lightness */ - -.lightness .evo-tab-row { - background-color: #e8e8e8; -} - +.lightness .evo-tab-row { background-color: #e8e8e8; } /* light */ - -.light .evo-tab-row { - background-color: #dfdfdf; -} - +.light .evo-tab-row { background-color: #dfdfdf; } /* dark */ - -.dark .evo-popup.alert.evo-popup-iframe { - background-color: #ecf0f1 -} - -.dark .evo-popup-overlay, -.darkness .evo-popup-overlay { - background-color: rgba(0, 0, 0, 0.3); -} - -.dark .evo-tab-row, -.darkness .evo-tab-row { - background-color: #1a1c21; - border-bottom: none; -} - -.dark .evo-tab-row:after, -.darkness .evo-tab-row:after { - background-color: #1a1c21; -} - -.dark .evo-tab-row .tab-row .tab, -.darkness .evo-tab-row .tab-row .tab { - color: #aaa; - border-color: #2a2d33 -} - -.dark .evo-tab-row .tab-row .tab:hover, -.darkness .evo-tab-row .tab-row .tab:hover { - background-color: #2d3033 -} - -.dark .evo-tab-row .tab-row .tab.changed, -.darkness .evo-tab-row .tab-row .tab.changed { - color: #7cb2dc; -} - -.dark .evo-tab-row .tab-row .tab.selected, -.darkness .evo-tab-row .tab-row .tab.selected { - background-color: #414550; - color: #eee; - border-bottom: 3px solid #1976d2; -} - -.dark .evo-tab-page, -.dark .evo-tab-page iframe, -.darkness .evo-tab-page, -.darkness .evo-tab-page iframe { - background-color: #ecf0f1 -} - +.dark .evo-popup.alert.evo-popup-iframe { background-color: #ecf0f1 } +.dark .evo-popup-overlay, .darkness .evo-popup-overlay { background-color: rgba(0, 0, 0, 0.3); } +.dark .evo-tab-row, .darkness .evo-tab-row { background-color: #1a1c21; border-bottom: none; } +.dark .evo-tab-row:after, .darkness .evo-tab-row:after { background-color: #1a1c21; } +.dark .evo-tab-row .tab-row .tab, .darkness .evo-tab-row .tab-row .tab { color: #aaa; border-color: #2a2d33 } +.dark .evo-tab-row .tab-row .tab:hover, .darkness .evo-tab-row .tab-row .tab:hover { background-color: #2d3033 } +.dark .evo-tab-row .tab-row .tab.changed, .darkness .evo-tab-row .tab-row .tab.changed { color: #7cb2dc; } +.dark .evo-tab-row .tab-row .tab.selected, .darkness .evo-tab-row .tab-row .tab.selected { background-color: #414550; color: #eee; border-bottom: 3px solid #1976d2; } +.dark .evo-tab-page, .dark .evo-tab-page iframe, .darkness .evo-tab-page, .darkness .evo-tab-page iframe { background-color: #ecf0f1 } /* darkness */ - -.darkness .evo-popup.alert.evo-popup-iframe, -.darkness .evo-tab-page iframe { - background-color: #282c34 -} - -.darkness .evo-popup.evo-popup-iframe .close { - opacity: 0.64; - background-color: #ca000c; - font-family: serif; -} - -.darkness .evo-popup.evo-popup-iframe .close:hover { - opacity: 1; -} - -.darkness .evo-popup.evo-popup-iframe .evo-popup-header { - border-bottom: 1px solid #17191d; -} - -.darkness .evo-popup.evo-popup-iframe .evo-popup-header { - color: #eee; -} - -.darkness .sectionBody .tab-row-container, -.darkness .tab-pane .tab-row-container, -.darkness .tab-pane .tab-row { - background-color: #202329; -} - -.darkness .tab-pane .tab-pane .tab-row { - background-color: #282c34; -} - -.darkness .tab-row .tab.selected { - border-color: #414449; - background-color: #282c34; - color: #eee; -} - -.darkness .tab-row .tab, -.darkness .tab-row .tab a, -.darkness .tab-pane > .tab-page > .tab { - color: inherit -} - -.darkness .tab-row::after, -.darkness .tab-row-container::after { - background-color: #414449; -} - -.darkness .tab-row-container .tab-row { - z-index: auto; -} - -.darkness .evo-tab-row .tab-row .tab:hover { - background-color: #282c34; -} - -.darkness .evo-tab-row .tab-row .tab.selected { - background-color: #282c34; - border-color: #343942; - border-bottom: 3px solid #1976d2; -} - -.darkness .sectionBody fieldset, -.darkness .sectionBody legend { - background: none; - border: 1px solid #414449; - box-shadow: none; -} - -.darkness .tab-page .tab-section .tab-header, -.darkness .tab-page .sectionHeader { - background-color: #202329; - border: 1px solid #414449; -} - -.darkness .tab-page .tab-section, -.darkness .tab-page .sectionHeader + .sectionBody { - background: none; - border: 1px solid #414449; -} - -.darkness .tab-page .sectionHeader + .sectionBody { - border-top: none; -} +.darkness .evo-popup.alert.evo-popup-iframe, .darkness .evo-tab-page iframe { background-color: #282c34 } +.darkness .evo-popup.evo-popup-iframe .close { opacity: 0.64; background-color: #ca000c; font-family: serif; } +.darkness .evo-popup.evo-popup-iframe .close:hover { opacity: 1; } +.darkness .evo-popup.evo-popup-iframe .evo-popup-header { border-bottom: 1px solid #17191d; } +.darkness .evo-popup.evo-popup-iframe .evo-popup-header { color: #eee; } +.darkness .sectionBody .tab-row-container, .darkness .tab-pane .tab-row-container, .darkness .tab-pane .tab-row { background-color: #202329; } +.darkness .tab-pane .tab-pane .tab-row { background-color: #282c34; } +.darkness .tab-row .tab.selected { border-color: #414449; background-color: #282c34; color: #eee; } +.darkness .tab-row .tab, .darkness .tab-row .tab a, .darkness .tab-pane > .tab-page > .tab { color: inherit } +.darkness .tab-row::after, .darkness .tab-row-container::after { background-color: #414449; } +.darkness .tab-row-container .tab-row { z-index: auto; } +.darkness .evo-tab-row .tab-row .tab:hover { background-color: #282c34; } +.darkness .evo-tab-row .tab-row .tab.selected { background-color: #282c34; border-color: #343942; border-bottom: 3px solid #1976d2; } +.darkness .sectionBody fieldset, .darkness .sectionBody legend { background: none; border: 1px solid #414449; box-shadow: none; } +.darkness .tab-page .tab-section .tab-header, .darkness .tab-page .sectionHeader { background-color: #202329; border: 1px solid #414449; } +.darkness .tab-page .tab-section, .darkness .tab-page .sectionHeader + .sectionBody { background: none; border: 1px solid #414449; } +.darkness .tab-page .sectionHeader + .sectionBody { border-top: none; } diff --git a/manager/media/style/default/css/tree.css b/manager/media/style/default/css/tree.css index 5753cfe479..f12f594441 100755 --- a/manager/media/style/default/css/tree.css +++ b/manager/media/style/default/css/tree.css @@ -1,467 +1,80 @@ /* tree */ - -#tree { - font-size: 0.8125rem; -} - -#treeloader { - position: absolute; - display: block; - overflow: hidden; - right: 0.3em; - top: 0.15em; - opacity: 0; - visibility: hidden; - -webkit-transition-duration: 0.5s; - transition-duration: 0.5s -} - -#treeloader .fa { - font-size: 1em; -} - -#treeloader.visible { - opacity: 0.7; - visibility: visible; - -webkit-transition-duration: 0s; - transition-duration: 0s -} - -.treeframebody { - height: 100%; - min-height: calc(100% + 1px); - background-color: #fafafa; - border-right: 1px solid #cfd2d6; -} - -#treeMenu { - display: table; - width: 100%; - height: 1.875rem; - table-layout: fixed; - margin-top: -1px; - background-color: #dfdfdf; - border-bottom: 1px solid #cfd2d6 -} - -#treeMenu .treeButton { - display: table-cell; - cursor: pointer; - height: 1.875rem; - line-height: 2rem; - white-space: nowrap; - text-align: center; - vertical-align: middle; - -webkit-transition-duration: 0.15s; - transition-duration: 0.15s -} - -#treeMenu .treeButton:hover:not(.disabled) { - background-color: rgba(255, 255, 255, .5); - cursor: pointer; - -webkit-transition-duration: 0s; - transition-duration: 0s -} - -#treeMenu .treeButton:not(.disabled):active { - background-color: #d5d5d5 -} - -#treeMenu .treeButton .fa { - display: block; - width: 1.2em; - height: 1.2em; - margin: auto; - line-height: 1.3em; - font-size: 1.1em; -} - -#treeMenu .treeButton.disabled { - color: #777; - opacity: 0.5 -} - -#treeHolder { - position: relative; - z-index: 1; - cursor: default; - overflow: auto; - height: 100%; - max-height: calc(100% - 30px); - white-space: nowrap -} - -#treeHolder .rootNode { - position: relative; -} - -#treeHolder .rootNode a { - display: block; - overflow: hidden; - padding: 1em 1em 0.5em 1.25em; - text-overflow: ellipsis; - color: #333; - cursor: pointer; - -webkit-transition-duration: 0.15s; - transition-duration: 0.15s; - font-weight: bold -} - -#treeHolder .rootNode a .fa { - margin-right: 0.5em -} - -#treeHolder .rootNode .icon { - display: none; -} - -#treeRoot { - float: left; - width: 100%; - color: #333; -} - -#treeRoot a { - display: block; - clear: both; - overflow: hidden; - text-decoration: none; - padding-top: 0.1em; - padding-bottom: 0.1em; - padding-left: 2.5em !important; - padding-right: 0; - font-size: 1em; - text-overflow: ellipsis; - color: #333; - cursor: default; - -webkit-transition-duration: 0.15s; - transition-duration: 0.15s -} - -#treeRoot a:hover:not(.empty), -#treeRoot a.current { - background-color: rgba(33, 150, 243, 0.1) -} - -#treeRoot a small { - margin: 0 0.8em 0 0.2em -} - -#treeRoot a.selected, -#treeRoot .dragenter > a { - background-color: rgba(0, 0, 0, 0.1); -} - -#treeRoot a .title { - padding: 0 0.2em; - color: #0275d8; - cursor: pointer; - -webkit-transition-duration: 0.15s; - transition-duration: 0.15s -} - -#treeRoot a.deleted .title { - color: #a52a2a; - text-decoration: line-through; -} - -#treeRoot a.unpublished .title { - color: #b68282; - font-style: italic; -} - -#treeRoot a.hidemenu .title { - color: #404040; -} - -#treeRoot a.protected { - position: relative; - opacity: .5; - background-color: transparent !important; -} - -#treeRoot a .lockedResource { - cursor: pointer; -} - -#treeRoot a .editResource { - margin-left: 0.2em -} - -#treeRoot .indent { - position: relative; - z-index: -1; - float: left; - height: 1.5em; -} - -#treeRoot .indent i { - float: left; - height: 1.2em; - width: 1.5em -} - -#treeRoot .dragafter > a .indent, -#treeRoot .dragbefore > a .indent { - z-index: 1; -} - -#treeRoot .dragafter > a .indent::after, -#treeRoot .dragbefore > a .indent::before { - content: "\f0da"; - display: block; - position: absolute; - right: 0.1em; - bottom: -0.5em; - height: 1em; - font: normal normal normal 1em/1em FontAwesome; - color: #f04 -} - -#treeRoot .dragbefore > a .indent::before { - bottom: auto; - top: -0.5em; -} - -#treeRoot .empty { - color: #aaa; - cursor: default; -} - -#treeRoot .icon { - cursor: pointer; - -webkit-transition-duration: 0.15s; - transition-duration: 0.15s -} - -#treeRoot .icon:hover > .fa { - color: #000 -} - -#treeRoot .toggle { - float: left; - margin: 1px 0.2em 1px -1.5em; - width: 1.3em; - height: 1.3em; - line-height: 1.4em; - text-align: center; - vertical-align: top; - cursor: pointer; - border-radius: 50%; - -webkit-transition-duration: 0.15s; - transition-duration: 0.15s -} - -#treeRoot .toggle:hover { - background-color: rgba(255, 255, 255, 0.5); -} - -#treeRoot .toggle .fa { - margin: 0; - width: auto; -} - -#treeRoot .fa, -#treeHolder .rootNode .fa { - margin-right: 1px; - width: 1em; - font-size: 1.08em; - text-align: center; - color: #565656; - -webkit-transition-duration: 0.15s; - transition-duration: 0.15s -} - -#treeRoot a[data-private="1"] .icon::after { - position: relative; - float: left; - margin: .5em -1em 0 0; - content: "\f023"; - font-family: FontAwesome; - font-size: 0.75em; - color: #d9534f; -} - -#treeRoot .fa-file, -#treeRoot .fa-file-o, -#treeRoot .fa-file-code, -#treeRoot .fa-file-code-o {} - -#treeRoot .fa-folder, -#treeRoot .fa-folder-open, -#treeRoot .fa-folder-o, -#treeRoot .fa-folder-open-o, -#treeRoot .fa-exclamation-triangle { - margin-top: 0.1em; - text-align: left -} - -#treeRoot .fa-link { - margin-right: 0; - font-size: 0.8em -} - -#treeRoot #binFull { - display: none -} - +#tree { font-size: 0.8125rem; } +#treeloader { position: absolute; display: block; overflow: hidden; right: 0.3em; top: 0.15em; opacity: 0; visibility: hidden; -webkit-transition-duration: 0.5s; transition-duration: 0.5s } +#treeloader .fa { font-size: 1em; } +#treeloader.visible { opacity: 0.7; visibility: visible; -webkit-transition-duration: 0s; transition-duration: 0s } +.treeframebody { height: 100%; min-height: calc(100% + 1px); background-color: #fafafa; border-right: 1px solid #cfd2d6; } +#treeMenu { display: table; width: 100%; height: 1.875rem; table-layout: fixed; margin-top: -1px; background-color: #dfdfdf; border-bottom: 1px solid #cfd2d6 } +#treeMenu .treeButton { display: table-cell; cursor: pointer; height: 1.875rem; line-height: 2rem; white-space: nowrap; text-align: center; vertical-align: middle; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } +#treeMenu .treeButton:hover:not(.disabled) { background-color: rgba(255, 255, 255, .5); cursor: pointer; -webkit-transition-duration: 0s; transition-duration: 0s } +#treeMenu .treeButton:not(.disabled):active { background-color: #d5d5d5 } +#treeMenu .treeButton .fa { display: block; width: 1.2em; height: 1.2em; margin: auto; line-height: 1.3em; font-size: 1.1em; } +#treeMenu .treeButton.disabled { color: #777; opacity: 0.5 } +#treeHolder { position: relative; z-index: 1; cursor: default; overflow: auto; height: 100%; max-height: calc(100% - 30px); white-space: nowrap } +#treeHolder .rootNode { position: relative; } +#treeHolder .rootNode a { display: block; overflow: hidden; padding: 1em 1em 0.5em 1.25em; text-overflow: ellipsis; color: #333; cursor: pointer; -webkit-transition-duration: 0.15s; transition-duration: 0.15s; font-weight: bold } +#treeHolder .rootNode a .fa { margin-right: 0.5em } +#treeHolder .rootNode .icon { display: none; } +#treeRoot { float: left; width: 100%; color: #333; } +#treeRoot a { display: block; clear: both; overflow: hidden; text-decoration: none; padding-top: 0.1em; padding-bottom: 0.1em; padding-left: 2.5em !important; padding-right: 0; font-size: 1em; text-overflow: ellipsis; color: #333; cursor: default; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } +#treeRoot a:hover:not(.empty), #treeRoot a.current { background-color: rgba(33, 150, 243, 0.1) } +#treeRoot a small { margin: 0 0.8em 0 0.2em } +#treeRoot a.selected, #treeRoot .dragenter > a { background-color: rgba(0, 0, 0, 0.1); } +#treeRoot a .title { padding: 0 0.2em; color: #0275d8; cursor: pointer; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } +#treeRoot a.deleted .title { color: #a52a2a; text-decoration: line-through; } +#treeRoot a.unpublished .title { color: #b68282; font-style: italic; } +#treeRoot a.hidemenu .title { color: #404040; } +#treeRoot a.protected { position: relative; opacity: .5; background-color: transparent !important; } +#treeRoot a .lockedResource { cursor: pointer; } +#treeRoot a .editResource { margin-left: 0.2em } +#treeRoot .indent { position: relative; z-index: -1; float: left; height: 1.5em; } +#treeRoot .indent i { float: left; height: 1.2em; width: 1.5em } +#treeRoot .dragafter > a .indent, #treeRoot .dragbefore > a .indent { z-index: 1; } +#treeRoot .dragafter > a .indent::after, #treeRoot .dragbefore > a .indent::before { content: "\f0da"; display: block; position: absolute; right: 0.1em; bottom: -0.5em; height: 1em; font: normal normal normal 1em/1em FontAwesome; color: #f04 } +#treeRoot .dragbefore > a .indent::before { bottom: auto; top: -0.5em; } +#treeRoot .empty { color: #aaa; cursor: default; } +#treeRoot .icon { cursor: pointer; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } +#treeRoot .icon:hover > .fa { color: #000 } +#treeRoot .toggle { float: left; margin: 1px 0.2em 1px -1.5em; width: 1.3em; height: 1.3em; line-height: 1.4em; text-align: center; vertical-align: top; cursor: pointer; border-radius: 50%; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } +#treeRoot .toggle:hover { background-color: rgba(255, 255, 255, 0.5); } +#treeRoot .toggle .fa { margin: 0; width: auto; } +#treeRoot .fa, #treeHolder .rootNode .fa { margin-right: 1px; width: 1em; font-size: 1.08em; text-align: center; color: #565656; -webkit-transition-duration: 0.15s; transition-duration: 0.15s } +#treeRoot a[data-private="1"] .icon::after { position: relative; float: left; margin: .5em -1em 0 0; content: "\f023"; font-family: FontAwesome; font-size: 0.75em; color: #d9534f; } +#treeRoot .fa-file, #treeRoot .fa-file-o, #treeRoot .fa-file-code, #treeRoot .fa-file-code-o { } +#treeRoot .fa-folder, #treeRoot .fa-folder-open, #treeRoot .fa-folder-o, #treeRoot .fa-folder-open-o, #treeRoot .fa-exclamation-triangle { margin-top: 0.1em; text-align: left } +#treeRoot .fa-link { margin-right: 0; font-size: 0.8em } +#treeRoot #binFull { display: none } /* modes theme */ - /* lightness */ - -.lightness #treeMenu { - background-color: #e8e8e8 -} - -.lightness .treeframebody { - background-color: #fafafa; -} - +.lightness #treeMenu { background-color: #e8e8e8 } +.lightness .treeframebody { background-color: #fafafa; } /* light */ - -.light #treeMenu { - background-color: #dfdfdf -} - -.light .treeframebody { - background-color: #fafafa; -} - +.light #treeMenu { background-color: #dfdfdf } +.light .treeframebody { background-color: #fafafa; } /* dark */ - -.dark #treeMenu { - background-color: rgba(0, 0, 0, 0.2); - border-bottom-color: rgba(0, 0, 0, 0.2); - border-right-color: #2a2d33 -} - -.dark #treeMenu .treeButton, -.darkness #treeMenu .treeButton { - color: #a9a9a9; -} - -.dark #treeMenu .treeButton:hover:not(.disabled), -.darkness #treeMenu .treeButton:hover:not(.disabled) { - background-color: #2d3033; - color: #fff -} - -.dark #tree .treeframebody, -.darkness #tree .treeframebody { - background-color: #202329; - border-color: #2a2d33 -} - -.dark #treeHolder .rootNode a, -.darkness #treeHolder .rootNode a { - color: #c5c5c5; -} - -.dark #treeHolder .rootNode a:hover, -.darkness #treeHolder .rootNode a:hover { - color: #eee -} - -.dark #treeRoot, -.darkness #treeRoot { - color: #b3b3b3; -} - -.dark #treeRoot a, -.darkness #treeRoot a { - color: #b3b3b3; -} - -.dark #treeRoot a:hover:not(.empty), -.dark #treeRoot a.current, -.darkness #treeRoot a:hover:not(.empty), -.darkness #treeRoot a.current { - background-color: rgba(255, 255, 255, 0.15); -} - -.dark #treeRoot a.selected, -.dark #treeRoot .dragenter > a, -.darkness #treeRoot a.selected, -.darkness#treeRoot .dragenter > a { - background-color: rgba(0, 142, 255, 0.19); -} - -.dark #treeRoot .dragafter > a::after, -.dark #treeRoot .dragbefore > a::before, -.darkness #treeRoot .dragafter > a::after, -.darkness #treeRoot .dragbefore > a::before { - background-color: rgba(255, 255, 255, 0.25); -} - -.dark #treeRoot a .title, -.darkness #treeRoot a .title { - color: #7cb2dc; -} - -.dark #treeRoot a.hidemenu .title, -.darkness #treeRoot a.hidemenu .title { - color: #c5c5c5; -} - -.dark #treeRoot a.deleted .title, -.darkness #treeRoot a.deleted .title { - color: #a52a2a; -} - -.dark #treeRoot a.unpublished .title, -.darkness #treeRoot a.unpublished .title { - color: #d0726b -} - -.dark #treeRoot .icon:hover > .fa, -.darkness #treeRoot .icon:hover > .fa { - color: #fff -} - -.dark #treeRoot a .title:hover, -.darkness #treeRoot a .title:hover { - color: #a2d4fb; -} - -.dark #treeRoot a.hidemenu .title:hover, -.darkness #treeRoot a.hidemenu .title:hover { - color: #eee -} - -.dark #treeRoot a.unpublished .title:hover, -.darkness #treeRoot a.unpublished .title:hover { - color: #f38e86 -} - -.dark #treeRoot a.deleted .title:hover, -.darkness #treeRoot a.deleted .title:hover { - color: #e23d3d -} - -.dark #treeRoot .toggle:hover, -.darkness #treeRoot .toggle:hover { - background-color: rgba(255, 255, 255, 0.19); -} - -.dark #treeRoot .fa, -.dark #treeHolder .rootNode .fa, -.darkness #treeRoot .fa, -.darkness #treeHolder .rootNode .fa { - color: #bcbec0; -} - +.dark #treeMenu { background-color: rgba(0, 0, 0, 0.2); border-bottom-color: rgba(0, 0, 0, 0.2); border-right-color: #2a2d33 } +.dark #treeMenu .treeButton, .darkness #treeMenu .treeButton { color: #a9a9a9; } +.dark #treeMenu .treeButton:hover:not(.disabled), .darkness #treeMenu .treeButton:hover:not(.disabled) { background-color: #2d3033; color: #fff } +.dark #tree .treeframebody, .darkness #tree .treeframebody { background-color: #202329; border-color: #2a2d33 } +.dark #treeHolder .rootNode a, .darkness #treeHolder .rootNode a { color: #c5c5c5; } +.dark #treeHolder .rootNode a:hover, .darkness #treeHolder .rootNode a:hover { color: #eee } +.dark #treeRoot, .darkness #treeRoot { color: #b3b3b3; } +.dark #treeRoot a, .darkness #treeRoot a { color: #b3b3b3; } +.dark #treeRoot a:hover:not(.empty), .dark #treeRoot a.current, .darkness #treeRoot a:hover:not(.empty), .darkness #treeRoot a.current { background-color: rgba(255, 255, 255, 0.15); } +.dark #treeRoot a.selected, .dark #treeRoot .dragenter > a, .darkness #treeRoot a.selected, .darkness#treeRoot .dragenter > a { background-color: rgba(0, 142, 255, 0.19); } +.dark #treeRoot .dragafter > a::after, .dark #treeRoot .dragbefore > a::before, .darkness #treeRoot .dragafter > a::after, .darkness #treeRoot .dragbefore > a::before { background-color: rgba(255, 255, 255, 0.25); } +.dark #treeRoot a .title, .darkness #treeRoot a .title { color: #7cb2dc; } +.dark #treeRoot a.hidemenu .title, .darkness #treeRoot a.hidemenu .title { color: #c5c5c5; } +.dark #treeRoot a.deleted .title, .darkness #treeRoot a.deleted .title { color: #a52a2a; } +.dark #treeRoot a.unpublished .title, .darkness #treeRoot a.unpublished .title { color: #d0726b } +.dark #treeRoot .icon:hover > .fa, .darkness #treeRoot .icon:hover > .fa { color: #fff } +.dark #treeRoot a .title:hover, .darkness #treeRoot a .title:hover { color: #a2d4fb; } +.dark #treeRoot a.hidemenu .title:hover, .darkness #treeRoot a.hidemenu .title:hover { color: #eee } +.dark #treeRoot a.unpublished .title:hover, .darkness #treeRoot a.unpublished .title:hover { color: #f38e86 } +.dark #treeRoot a.deleted .title:hover, .darkness #treeRoot a.deleted .title:hover { color: #e23d3d } +.dark #treeRoot .toggle:hover, .darkness #treeRoot .toggle:hover { background-color: rgba(255, 255, 255, 0.19); } +.dark #treeRoot .fa, .dark #treeHolder .rootNode .fa, .darkness #treeRoot .fa, .darkness #treeHolder .rootNode .fa { color: #bcbec0; } /* darkness */ - -.darkness #tree .treeframebody { - background-color: #202329; - border-color: #414449; -} - -.darkness #treeMenu { - background-color: #1a1c21; - border-color: #414449; -} - -.darkness #mainMenu .nav > li > ul > li { - border-bottom-color: rgba(0,0,0,0.15); -} \ No newline at end of file +.darkness #tree .treeframebody { background-color: #202329; border-color: #414449; } +.darkness #treeMenu { background-color: #1a1c21; border-color: #414449; } +.darkness #mainMenu .nav > li > ul > li { border-bottom-color: rgba(0, 0, 0, 0.15); } From 73ebfee5afc03eb27edde2860a7ea81c2754a24b Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Fri, 6 Apr 2018 13:19:28 +0200 Subject: [PATCH 163/274] Fix missing tabheader border --- manager/media/style/default/css/tabpane.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manager/media/style/default/css/tabpane.css b/manager/media/style/default/css/tabpane.css index 8c641f8689..ec1cb14a39 100755 --- a/manager/media/style/default/css/tabpane.css +++ b/manager/media/style/default/css/tabpane.css @@ -38,7 +38,7 @@ letter-spacing: 0; font-size: 0.875rem; font-weight: bold; color: #777; } padding-right: .5rem; background-color: #efeff6; border: 1px solid #e0e0e0; border-bottom: 2px solid #e0e0ec; } .tab-page .tab-header, .tab-page .tab-section .tab-header, .tab-page .sectionHeader { background-color: #f3f3f3; border-bottom-width: 1px; } -.tab-page .tab-section .tab-header:first-child, .tab-page .sectionHeader { margin-top: -1px; border-top: none } +.tab-page .tab-section .tab-header:first-child, .tab-page .sectionHeader { margin-top: 0; border-top: none } .tab-page .tab-section .tab-header + .tab-header, .tab-page .tab-section .tab-body + .tab-header, .tab-page .sectionHeader { border-top: 1px solid #e0e0e0; } .tab-page .tab-section .tab-body, .tab-page .sectionBody { padding: 1rem; } .tab-page > .sectionHeader, .sectionBody .tab-page > .tab-section { margin-top: 1rem; margin-left: .25rem; margin-right: .25rem } @@ -169,5 +169,6 @@ padding: .25em; line-height: 1.3em; font-size: 1.3em; font-weight: 700; color: # .darkness .evo-tab-row .tab-row .tab.selected { background-color: #282c34; border-color: #343942; border-bottom: 3px solid #1976d2; } .darkness .sectionBody fieldset, .darkness .sectionBody legend { background: none; border: 1px solid #414449; box-shadow: none; } .darkness .tab-page .tab-section .tab-header, .darkness .tab-page .sectionHeader { background-color: #202329; border: 1px solid #414449; } +.darkness .tab-page .tab-section .tab-header:first-child, .darkness .tab-page .sectionHeader { margin-top: -1px; } .darkness .tab-page .tab-section, .darkness .tab-page .sectionHeader + .sectionBody { background: none; border: 1px solid #414449; } .darkness .tab-page .sectionHeader + .sectionBody { border-top: none; } From 9b0f507c26192c088e83f29b0f37ba2ed9d19176 Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Fri, 6 Apr 2018 21:09:38 +0300 Subject: [PATCH 164/274] fix for TinyMCE skin by default lightgray --- assets/plugins/tinymce4/bridge.tinymce4.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/plugins/tinymce4/bridge.tinymce4.inc.php b/assets/plugins/tinymce4/bridge.tinymce4.inc.php index 9f36e24a77..b613530c89 100755 --- a/assets/plugins/tinymce4/bridge.tinymce4.inc.php +++ b/assets/plugins/tinymce4/bridge.tinymce4.inc.php @@ -49,7 +49,8 @@ public function __construct($tvOptions=array()) 'template_docs' => '', 'template_chunks' => '', 'custom_buttons3' => '', - 'custom_buttons4' => '' + 'custom_buttons4' => '', + 'skin' => 'lightgray' ) ); From 0e628b2564794068914577be987b399ab85d8bca Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Fri, 6 Apr 2018 21:54:55 +0300 Subject: [PATCH 165/274] setting for customize login page --- .../tab1_site_settings.inc.php | 123 +++++++++++++++--- manager/includes/lang/english.inc.php | 9 ++ 2 files changed, 111 insertions(+), 21 deletions(-) diff --git a/manager/actions/mutate_settings/tab1_site_settings.inc.php b/manager/actions/mutate_settings/tab1_site_settings.inc.php index 8fe4d2c02b..cdecd16e79 100755 --- a/manager/actions/mutate_settings/tab1_site_settings.inc.php +++ b/manager/actions/mutate_settings/tab1_site_settings.inc.php @@ -1,5 +1,5 @@ - - -
      -
      -
      - [+OnManagerLoginFormPrerender+] -
      - -
      -
      - - -
      -
      - - -
      -
      -
      [+login_captcha_message+]
      -

      [+captcha_image+]

      - [+captcha_input+] -
      -
      - - -
      - [+OnManagerLoginFormRender+] -
      -
      -
      -

      -
      © 2005-2018 by the EVO. EVO™ is licensed under the GPL.
      -
      -
      -
      - - + + [(site_name)] (Evolution CMS Manager Login) + + + + + + + + +
      +
      +
      + + + [+OnManagerLoginFormPrerender+] + + + + + +
      + + +
      + + +
      + + +
      + + +
      +
      [+login_captcha_message+]
      +

      [+captcha_image+]

      + [+captcha_input+] +
      + + +
      + + +
      + + + [+OnManagerLoginFormRender+] + +
      +
      + + +
      +

      +
      © 2005-2018 by the EVO. EVO™ is licensed under the GPL.
      +
      +
      + + +
      + + + + \ No newline at end of file From b69d83b50086a1bfc4f1d30ce0830ba56af60094 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Sat, 7 Apr 2018 11:09:45 +0200 Subject: [PATCH 167/274] Optimized images --- .../images/login/default/login-background.jpg | Bin 307126 -> 201833 bytes .../images/login/default/login-logo.png | Bin 11912 -> 5587 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/manager/media/style/default/images/login/default/login-background.jpg b/manager/media/style/default/images/login/default/login-background.jpg index d07938b9ae5c22a45d177b9f28ae64da6065ea41..f73e282efa5fc0b80738a79ffd17579a4d8ee54f 100644 GIT binary patch literal 201833 zcmb5Wd0bQ1_CCB50)`O10RaPQn}k5aAQB*msO=#H8YWFbK!Tu=A&e@@plI9gfg%P3 z1Z0p&8G_XR_S!rC z=iYxFA%>5aw-+Lj5F)`p^q(J*2cqigEz;AaF49}1Po?V9m(uA526U#O(UPSrm@8K< zXD&DY)WXj4Q??D;e7TkLXEye$`HuWgEM44O9Ng?2_zuJ%B&xnXokm|qr!RA0EoV9W z|33b69T`$}(IQ-jWQfRyBppN2e|pdggmg#?2m0SZBI{59Fcq$vf4oFU^S|Tc)&JZ_ zbR7~RGjtem;Y0qv`PMSQcFfY2^aD9P7+L5>kZ`)51Ct&RVzUL2avKu6D`M`ZO9mw2 z45Y<$NcxN{elteK2_2yx2L|FWjT}h2EE0>%K(urVIgW>;6H34fzBg;$@5E7?~zyQWLXS zQY7aiMAf6QYH)-oT!hg$q)*B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)Y1 zMt{(XB@ta~&nCXpDF=EO;C{aM384ev=@9zIq3_Bn3=AbBjPH%#+doc!#$o=iyo(0V z!L9I6Qo6h*U$fCYy%=`8$R6c@)3|iyz@7|6y&4U*Ki|nt@P=Hqet@nz{~5*#?0H3E a13356-vtS|%>FeSE-$SjRV85(^8Wy{B5XAP From 28a08247208cdff288f3e3ae0d16e02755bcd182 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Sat, 7 Apr 2018 15:35:03 +0200 Subject: [PATCH 168/274] Manager Polish Translation --- manager/includes/lang/polish-utf8.inc.php | 175 ++++++++++++++-------- 1 file changed, 110 insertions(+), 65 deletions(-) diff --git a/manager/includes/lang/polish-utf8.inc.php b/manager/includes/lang/polish-utf8.inc.php index 669c04b57a..8603aa07ce 100755 --- a/manager/includes/lang/polish-utf8.inc.php +++ b/manager/includes/lang/polish-utf8.inc.php @@ -1,10 +1,10 @@ PHP Application Framework i Content Management System objęty licencją GNU GPL.'; -$_lang["about_title"] = 'O MODX'; +$_lang["about_msg"] = 'EVO to PHP Application Framework i Content Management System objęty licencją GNU GPL.'; +$_lang["about_title"] = 'O Evolution'; $_lang["access_permission_denied"] = 'Nie masz właściwych uprawnień do tego dokumentu.'; $_lang["access_permission_parent_denied"] = 'Nie masz uprawnień do tworzenia lub przenoszenia dokumentu tutaj. Proszę wybrać inną lokację.'; $_lang["access_permissions"] = 'Uprawnienia dostępu'; @@ -43,7 +43,7 @@ $_lang["access_permissions_users_in_group"] = 'Użytkownicy w grupie: '; $_lang["access_permissions_users_tab"] = 'Tutaj możesz zobaczyć jakie grupy użytkowników zostały stworzone. Możesz także stworzyć nowe grupy, zmieniać nazwy, usuwać i sprawdzać którzy użytkownicy należą do danej grupy. Aby dodać nowego użytkownika do grupy albo usunać go z grupy, edytuj tego użytkownika bezpośrednio. Administratorzy (ID Roli 1) zawsze mają dostęp do wszystkich dokumentów, więc nie muszą być przypisani do żadnej grupy.'; $_lang["account_email"] = 'Konto e-mail'; -$_lang["actioncomplete"] = 'Akcja zakończona powodzeniem!
      - Proszę zaczekać, aż MODX zakończy porządkowanie.'; +$_lang["actioncomplete"] = 'Akcja zakończona powodzeniem!

      Proszę zaczekać, aż EVO zakończy porządkowanie.'; $_lang["activity_message"] = 'Ta lista pokazuje ostatnie dokumenty, jakie utworzyłeś lub edytowałeś:'; $_lang["activity_title"] = 'Ostatnio edytowane/utworzone dokumenty'; $_lang["add"] = 'Dodaj'; @@ -82,7 +82,7 @@ $_lang["captcha_code"] = 'Kod bezpieczeństwa'; $_lang["captcha_message"] = 'Włącz tę opcję, aby wzmocnić zabezpieczenia i wymóc na użytkownikach wprowadzanie kodu, który jest nieczytelny dla maszyn (i innych niebezpiecznych skryptów).'; $_lang["captcha_title"] = 'Używaj kodów CAPTCHA'; -$_lang["captcha_words_default"] = 'MODX,Access,Better,BitCode,Chunk,Cache,Desc,Design,Excell,Enjoy,URLs,TechView,Gerald,Griff,Humphrey,Holiday,Intel,Integration,Joystick,Join(),Oscope,Genetic,Light,Likeness,Marit,Maaike,Niche,Netherlands,Ordinance,Oscillo,Parser,Phusion,Query,Question,Regalia,Righteous,Snippet,Sentinel,Template,Thespian,Unity,Enterprise,Verily,Tattoo,Veri,Website,WideWeb,Yap,Yellow,Zebra,Zygote'; +$_lang["captcha_words_default"] = 'EVO,Access,Better,BitCode,Chunk,Cache,Desc,Design,Excell,Enjoy,URLs,TechView,Gerald,Griff,Humphrey,Holiday,Intel,Integration,Joystick,Join(),Oscope,Genetic,Light,Likeness,Marit,Maaike,Niche,Netherlands,Ordinance,Oscillo,Parser,Phusion,Query,Question,Regalia,Righteous,Snippet,Sentinel,Template,Thespian,Unity,Enterprise,Verily,Tattoo,Veri,Website,WideWeb,Yap,Yellow,Zebra,Zygote'; $_lang["captcha_words_message"] = 'Tutaj możesz wprowadzić listę słów CAPTCHA do użycia jeśli system CAPTCHA jest włączony. Oddziel słowa przecinkiem. Możesz wprowadzić maksymalnie 255 znaków.'; $_lang["captcha_words_title"] = 'Słowa CAPTCHA'; $_lang["category_heading"] = 'Kategoria'; @@ -98,7 +98,7 @@ $_lang["change_name"] = 'Zmień nazwę'; $_lang["change_password"] = 'Zmień hasło'; $_lang["change_password_confirm"] = 'Potwierdź hasło'; -$_lang["change_password_message"] = 'Proszę wprowadzić nowe hasło a następnie potwierdzić je poprzez ponowne wpisanie. Hasło powinno składać się z 6-15 znaków.'; +$_lang["change_password_message"] = 'Proszę wprowadzić nowe hasło, następnie ponowić je i zatwierdzić. Hasło musi mieć minimum 6 znaków. '; $_lang["change_password_new"] = 'Nowe hasło'; $_lang["charset_message"] = 'Proszę wybrać, którego kodowania znaków chcesz używać w menadżerze. MODX był testowany z wieloma zestawami znaków, ale nie ze wszystkimi. Dla większości języków, wystarczające jest domyślne kodowanie ISO-8859-1.'; $_lang["charset_title"] = 'Kodowanie znaków'; @@ -119,7 +119,7 @@ $_lang["comment"] = 'Komentarz'; $_lang["configcheck_admin"] = 'Proszę skontaktować się z administratorem systemu, aby powiadomić go o tym komunikacie!'; $_lang["configcheck_cache"] = 'katalog cache nie jest zapisywalny'; -$_lang["configcheck_cache_msg"] = 'MODX nie może zapisać do katalogu cache\'u. MODX będzie wciąż działał poprawnie, ale strony nie będą cache\'owane. Aby rozwiązać ten problem, nadaj uprawnienia do zapisu dla katalogu /_cache/.'; +$_lang["configcheck_cache_msg"] = 'EVO nie może zapisywać do katalogu cache. EVO będzie wciąż działał poprawnie, ale strony nie będą używać cache. Aby rozwiązać ten problem, nadaj uprawnienia do zapisu dla katalogu /cache/.'; $_lang["configcheck_configinc"] = 'Plik konfiguracyjny jest zapisywalny'; $_lang["configcheck_configinc_msg"] = 'Dla większego bezpieczeństwa ustaw prawa dostępu do pliku konfiguracji (/[+MGR_DIR+]/includes/config.inc.php) na tylko do odczytu.'; $_lang["configcheck_default_msg"] = 'Wystąpił nieokreślony błąd.'; @@ -127,17 +127,21 @@ $_lang["configcheck_errorpage_unavailable_msg"] = 'Oznacza to, że Twoja strona błędu jest niedostępna dla użytkowników albo nie istnieje. Może to powodować niestabilność i wiele błędnych wpisów w logach serwisu. Upewnij się, że żadna grupa użytkowników nie jest przypisana do strony.'; $_lang["configcheck_errorpage_unpublished"] = 'Strona błędu Twojego serwisu jest nieopublikowana lub nie istnieje.'; $_lang["configcheck_errorpage_unpublished_msg"] = 'Oznacza to, że strona błędu Twojego serwisu jest niedostępna dla odwiedzających. Opublikuj tą stronę albo upewnij się, że jest ona przypisana do istniejącego dokumentu w drzewie zawartości Twojej strony.'; +$_lang["configcheck_filemanager_path"] = 'Obecne ustawienie File Manager path wygląda na niepoprawne. '; +$_lang["configcheck_filemanager_path_msg"] = 'To może się zdarzyć np. po przeniesieniu instalacji do innego katalogu lub innego serwera. Proszę sprawdzić i zapisać Konfigurację EVO.'; $_lang["configcheck_hide_warning"] = 'Nie pokazuj tego ponownie.'; $_lang["configcheck_images"] = 'Katalog obrazów nie jest zapisywalny'; $_lang["configcheck_images_msg"] = 'Katalog z obrazkami nie jest zapisywalny, lub nie istnieje. Oznacza to, że funkcje menadżera obrazków w edytorze nie będą działać!'; $_lang["configcheck_installer"] = 'instalator wciąż obecny'; -$_lang["configcheck_installer_msg"] = 'Katalog install/ zawiera instalator MODX. Wyobraź sobie co może nastąpić jeśli niepowołana osoba odkryje ten folder i uruchomi instalator! Prawdopodobnie nie zajdzie za daleko, ponieważ będzie musiała wprowadź informacje dostępu do bazy danych, ale wciąż najlepszym rozwiązaniem jest usunięcie tego folderu z serwera.'; +$_lang["configcheck_installer_msg"] = 'Katalog /install zawiera instalator EVO. Wyobraź sobie co może nastąpić jeśli niepowołana osoba odkryje ten folder i uruchomi instalator! Prawdopodobnie nie zajdzie za daleko, ponieważ będzie musiała wprowadź informacje dostępu do bazy danych, ale wciąż najlepszym rozwiązaniem jest usunięcie tego katalogu z serwera.'; $_lang["configcheck_lang_difference"] = 'niepoprawna ilość wpisów w pliku językowym'; $_lang["configcheck_lang_difference_msg"] = 'Aktualnie wybrany język posiada inną liczbę wpisów niż język domyślny. Niekoniecznie stanowi to problem, jednakże może to oznaczać, że plik języka wymaga aktualizacji.'; $_lang["configcheck_notok"] = 'Jedno lub więcej z ustawień konfiguracyjnych nie zostało zweryfikowane: '; $_lang["configcheck_ok"] = 'Sprawdzanie przebiegło pomyślnie - brak ostrzeżeń.'; $_lang["configcheck_php_gdzip"] = 'Rozszerzenia GD i/albo Zip PHP nie zostały znalezione.'; -$_lang["configcheck_php_gdzip_msg"] = 'Do poprawnego działania MODX potrzebuje włączonych w konfiguracji PHP rozszerzeń GD oraz Zip. MODX będzie wciąż działał poprawnie, jednak nie będzie możliwe korzystanie z wszystkich jego funkcji: managera plików, edytora obrazów oraz Captcha przy logowaniu.'; +$_lang["configcheck_php_gdzip_msg"] = 'Do poprawnego działania EVO potrzebuje włączonych w konfiguracji PHP rozszerzeń GD oraz Zip. EVO będzie wciąż działał poprawnie, jednak nie będzie możliwe korzystanie z wszystkich jego funkcji: managera plików, edytora obrazów oraz Captcha przy logowaniu.'; +$_lang["configcheck_rb_base_dir"] = 'Obecne ustawienie File base path wygląda nieprawidłowo.'; +$_lang["configcheck_rb_base_dir_msg"] = 'To może się zdarzyć np. po przeniesieniu instalacji do innego katalogu lub innego serwera. Proszę sprawdzić i zapisać Konfigurację EVO.'; $_lang["configcheck_register_globals"] = 'register_globals jest włączona w konfiguracji PHP'; $_lang["configcheck_register_globals_msg"] = 'Taka konfiguracja może zagrozić bezpieczeństwu strony, ponieważ powoduje większą wrażliwość na ataki typu XSS.'; $_lang["configcheck_title"] = 'Sprawdzenie konfiguracji'; @@ -191,7 +195,7 @@ $_lang["createdon"] = 'Data utworzenia'; $_lang["create_new"] = 'Utwórz nowy'; $_lang["credits"] = 'Autorzy'; -$_lang["credits_shouts_msg"] = '

      MODX jest zarządzany i utrzymywany przez modx.com.

      '; +$_lang["credits_shouts_msg"] = '

      EVO jest zarządzane i utrzymywane przez evo.im.

      '; $_lang["custom_contenttype_message"] = 'Tutaj możesz dodać własne typy treści, które zostaną użyte w dokumentach. Aby dodać nową pozycję wprowadź typ treści w polu tekstowym i naciśnij przycisk \'Dodaj\'.'; $_lang["custom_contenttype_title"] = 'Własne typy treści'; $_lang["database_charset"] = 'Baza danych - zestaw znaków'; @@ -301,8 +305,8 @@ $_lang["export_site_failed_no_write"] = 'Nie można zapisać pliku.'; $_lang["export_site_html"] = 'Eksportuj stronę do HTML'; $_lang["export_site_maxtime"] = 'Maksymalny czas eksportu:'; -$_lang["export_site_maxtime_message"] = 'Tutaj możesz ustawić ilość sekund, które system może przeznaczyć na eksportowanie serwisu (pomijając ustawienie PHP). Wprowadź 0 dla nieograniczonego czasu, jednak takie ustawienie może prowadzić do niestabilności serwera i jest niezalecane.'; -$_lang["export_site_message"] = 'Używając tej funkcji możesz wyeksportować cały serwis do statycznego HTML. Pamiętaj, że stracisz wiele funkcjonalności systemu MODX:

      • Wyświetlenia stron, które zostały wyeksportowane nie zostaną zapisane.
      • Interaktywne snippety nie będą działać w wyeksportowanych plikach
      • Tylko zwykłe dokumenty zostaną wyeksportowane, odnośniki web nie.
      • Proces eksportu może się nie udać jeśli Twoje dokumenty zawierają snippety z nagłówkiem przekierowania.
      • Układ i wygląd strony może się różnić od zakładanego, w zależności od tego jak skonstruowałeś swoje dokumenty, arkusze stylów, obrazki. Aby to naprawić możesz spróbować przenieść wyeksportowane pliki do katalogu głównego (tam gdzie jest umieszczony główny plik MODX-a \'index.php\'.

      Proszę wypełnić formularz i nacisnąć \'Eksport\' aby rozpocząć proces eksportu. Pliki zostaną zapisane w lokalizacji, którą podałeś używając aliasu dokumentu jako nazwy pliku. Podczas eksportu dobrze jest ustawić opcję konfiguracji MODX-a \'Przyjazne aliasy\' na \'Tak\'.
      W zależności od rozmiaru serwisu eksport może trochę potrwać.
      Wszystkie istniejące pliki zostaną nadpisane nowymi, jeśli ich nazwy będą identyczne!

      '; +$_lang["export_site_maxtime_message"] = 'Tutaj możesz określić ilość sekund, które EVO może przeznaczyć na eksportowanie serwisu (pomijając ustawienie PHP). Wprowadź 0 dla nieograniczonego czasu, jednak takie ustawienie może prowadzić do niestabilności serwera i jest niezalecane.'; +$_lang["export_site_message"] = '

      Używając tej funkcji możesz wyeksportować cały serwis do statycznego HTML. Pamiętaj, że stracisz wiele funkcjonalności systemu EVO:

      • Wyświetlenia stron, które zostały wyeksportowane nie zostaną zapisane.
      • Interaktywne snippety nie będą działać w wyeksportowanych plikach
      • Tylko zwykłe dokumenty zostaną wyeksportowane, odnośniki web nie.
      • Proces eksportu może się nie udać jeśli Twoje dokumenty zawierają snippety z nagłówkiem przekierowania.
      • Układ i wygląd strony może się różnić od zakładanego, w zależności od tego jak skonstruowałeś swoje dokumenty, arkusze stylów, obrazki. Aby to naprawić możesz spróbować przenieść wyeksportowane pliki do katalogu głównego, tam gdzie jest umieszczony główny plik EVO index.php.

      Proszę wypełnić formularz i nacisnąć \'Eksport\' aby rozpocząć proces eksportu. Pliki zostaną zapisane w lokalizacji, którą podałeś używając aliasu dokumentu jako nazwy pliku. Podczas eksportu dobrze jest ustawić opcję konfiguracji EVO \'Przyjazne aliasy\' na \'Tak\'. W zależności od rozmiaru serwisu eksport może trochę potrwać.
      Wszystkie istniejące pliki zostaną nadpisane nowymi, jeśli ich nazwy będą identyczne!

      '; $_lang["export_site_numberdocs"] = 'Znaleziono %s dokumentów do eksportu...

      '; $_lang["export_site_prefix"] = 'Prefix pliku:'; $_lang["export_site_start"] = 'Rozpocznij eksport'; @@ -321,7 +325,7 @@ $_lang["file_deleted"] = 'Powodzenie!'; $_lang["file_download_file"] = 'Ściągnij plik'; $_lang["file_download_unzip"] = 'Rozpakuj plik'; -$_lang["file_folder_chmod_error"] = 'Nie można zmienić uprawnień; musisz je zmienić poza MODX.'; +$_lang["file_folder_chmod_error"] = 'Nie można zmienić uprawnień, musisz je zmienić poza EVO.'; $_lang["file_folder_created"] = 'Folder został stworzony pomyślnie!'; $_lang["file_folder_deleted"] = 'Folder został usunięty!'; $_lang["file_folder_not_created"] = 'Nie można utworzyć folderu'; @@ -331,7 +335,7 @@ $_lang["file_saved"] = 'Plik uaktualniony pomyślnie!'; $_lang["file_unzip"] = 'Rozpakowanie zakończone sukcesem!'; $_lang["file_unzip_fail"] = 'Błąd podczas rozpakowywania!'; -$_lang["filemanager_path_message"] = 'IIS często błędnie określa ustawienie document_root, które jest używane przez menedżer plików do określenia co może być widoczne dla ciebie. Jeśli masz problemy z menadżerem plików, upewnij się, że ta ścieżka wskazuje na katalog główny instalacji MODX.'; +$_lang["filemanager_path_message"] = 'IIS często błędnie określa ustawienie document_root, które jest używane przez menedżer plików do określenia co może być widoczne dla ciebie. Jeśli masz problemy z menadżerem plików, upewnij się, że ta ścieżka wskazuje na katalog główny instalacji EVO.'; $_lang["filemanager_path_title"] = 'Ścieżka menadżera plików'; $_lang["files_access_denied"] = 'Brak dostępu!'; $_lang["files_data"] = 'Dane'; @@ -373,7 +377,7 @@ $_lang["forgot_password_email_link"] = 'Kliknij tutaj, aby zakończyć proces.'; $_lang["forgot_your_password"] = 'Zapomniane hasło?'; $_lang["friday"] = 'Piątek'; -$_lang["friendly_alias_message"] = 'Jeżeli używasz przyjaznych URL\'i i dokument posiada alias, będzie on miał zawsze pierwszeństwo przed przyjaznym adresem URL. Ustawiając tę opcję na \'tak\', prefiks i sufiks przyjaznego URL\'u zostanie również użyty z aliasem dokumentu. Na przykład, jeżeli dokument z ID 1 ma alias `wprowadzenie` i prefiks ustawiony na `` oraz sufiks na `.html`, ustawiając tę opcję na `tak` otrzymamy `wprowadzenie.html`. Jeżeli nie będzie aliasu, MODX wygeneruje `1.html` jako odsyłacz.'; +$_lang["friendly_alias_message"] = 'Jeżeli używasz przyjaznych URL\'i i dokument posiada alias, będzie on miał zawsze pierwszeństwo przed przyjaznym adresem URL. Ustawiając tę opcję na \'tak\', prefiks i sufiks przyjaznego URL\'u zostanie również użyty z aliasem dokumentu. Na przykład, jeżeli dokument z ID 1 ma alias "wprowadzenie" i prefiks nie jest ustawiony (pusty) oraz sufiks na ".html", ustawiając tę opcję na "tak" otrzymamy "wprowadzenie.html". Jeżeli nie będzie aliasu, EVO wygeneruje "1.html" jako odsyłacz.'; $_lang["friendly_alias_title"] = 'Używaj aliasów URL'; $_lang["friendlyurls_message"] = 'Opcja ta pozwala na używanie przyjaznych dla wyszukiwarek adresów URL z MODX. Proszę zwrócić uwagę, że opcja ta działa jedynie dla instalacji MODX na serwerze Apache i wymaga odpowiednio przygotowanego pliku .htaccess. Zapoznaj się z plikiem .htaccess zawartym w dystrybucji, aby uzyskać dodatkowe informacje.'; $_lang["friendlyurls_title"] = 'Włącz przyjazny URL'; @@ -384,11 +388,13 @@ $_lang["functionnotimpl"] = 'Przepraszam!'; $_lang["functionnotimpl_message"] = 'Ta funkcja nie została jeszcze zaimplementowana.'; $_lang["further_info"] = 'Pozostałe informacje'; +$_lang["global_tabs"] = 'Global Tabs'; $_lang["go"] = 'Dalej'; $_lang["group_access_permissions"] = 'Dostęp grup użytkowników'; +$_lang['group_tvs'] = 'Grupowanie Zmiennych Szablonu'; $_lang["guid"] = 'GUID'; $_lang["help"] = 'Pomoc'; -$_lang["help_msg"] = '

      Możesz uzyskać darmową pomoc poprzez odwiedzenie Forum MODX. Istnieje również wciąż rozwijana Dokumentacja i Instrukcje dla MODX\'a, dotyczące praktycznie wszystkich aspektów pracy z MODX\'em.

      Planujemy również usługę wsparcia komercyjnego dla MODX\'a. Zainteresowanych prosimy o kontakt mailowy.'; +$_lang["help_msg"] = '

      Możesz uzyskać darmową pomoc poprzez odwiedzenie Forum EVO. Istnieje również wciąż rozwijana Dokumentacja i Instrukcje dla EVO, dotyczące praktycznie wszystkich aspektów pracy z EVO.

      Planujemy również usługę wsparcia komercyjnego dla EVO. Zainteresowanych prosimy o kontakt mailowy.

      '; $_lang["help_title"] = 'Pomoc'; $_lang["hide_tree"] = 'Ukryj drzewo'; $_lang["home"] = 'Start'; @@ -400,6 +406,7 @@ $_lang["htmlsnippet_name"] = 'Nazwa chunka'; $_lang["htmlsnippet_title"] = 'Utwórz/edytuj chunka'; $_lang["icon"] = 'Ikona'; +$_lang["icon_description"] = 'Klasa CSS np. fa fa-star'; $_lang["id"] = 'ID'; $_lang["illegal_parent_child"] = 'Przypisanie nadrzędne:\n\nDokument jest dzieckiem wybranego dokumentu.'; $_lang["illegal_parent_self"] = 'Przypisanie nadrzędne:\n\nWybrany dokument nie może być przypisany do samego siebie.'; @@ -445,7 +452,7 @@ $_lang["keyword"] = 'Słowo kluczowe'; $_lang["keywords"] = 'Słowa kluczowe'; $_lang["keywords_intro"] = 'Aby edytować słowo kluczowe wpisz nowe słowo w polu tekstowym obok słowa, które chcesz zmienić. Aby usunąć słowo kluczowe, zaznacz pole \'usuń\' dla danego słowa. Jeśli zaznaczysz pole usunięcia i zmienisz nazwę pola zostanie ono usunięte!'; -$_lang["language_message"] = 'Wybierz język dla EVO Content Manager.'; +$_lang["language_message"] = 'Wybierz język dla zaplecza EVO.'; $_lang["language_title"] = 'Język Managera'; $_lang["last_update"] = 'Ostatnia aktualizacja'; $_lang["launch_site"] = 'Uruchom stronę'; @@ -455,7 +462,7 @@ $_lang["list_mode"] = 'Włącz/wyłącz tryb listy - używany to wyświetlenia listy wszystkich rekordów w tabeli.'; $_lang["loading_doc_tree"] = 'Ładowanie drzewa dokumentów...'; $_lang["loading_menu"] = 'Ładowanie menu...'; -$_lang["loading_page"] = 'Proszę zaczekać, aż MODX załaduje stronę...'; +$_lang["loading_page"] = 'Proszę czekać, EVO ładuje stronę...'; $_lang["localtime"] = 'Czas lokalny'; $_lang["lock_htmlsnippet"] = 'Zablokuj możliwość edycji chunka'; $_lang["lock_htmlsnippet_msg"] = 'Tylko Administrator (ID Roli 1) może edytować tego chunka.'; @@ -483,7 +490,7 @@ $_lang["login_homepage"] = 'Strona po zalogowaniu'; $_lang["login_homepage_message"] = 'Wprowadź ID dokumentu, który chcesz pokazać użytkownikowi po jego zalogowaniu. Uwaga! Upewnij się, że ID, które wprowadziłeś jest przypisane do istniejącego dokumentu oraz, że jest opublikowane i dostępne dla danego użytkownika!'; $_lang["login_message"] = 'Proszę podać swoje dane uwierzytelniające, aby się zalogować. Podając nazwę użytkownika oraz hasło zwróć szczególną uwagę na wielkość znaków!'; -$_lang["logo_slogan"] = 'EVO Content Manager'; +$_lang["logo_slogan"] = 'EVO System Zarządzania Treścią - \nTwórz więcej robiąc mniej'; $_lang["logout"] = 'Wyloguj się'; $_lang["long_title"] = 'Długi tytuł'; $_lang["mail_check_timeperiod_message"] = 'Jak często sprawdzać, czy w Menadżerze są nowe wiadomości, w sekundach'; @@ -502,6 +509,11 @@ $_lang["manager_permissions"] = 'Uprawnienia Menedżera'; $_lang["manager_theme"] = 'Motyw Managera'; $_lang["manager_theme_message"] = 'Wybierz motyw panelu administracji.'; +$_lang["manager_theme_mode"] = 'Schemat kolorów'; +$_lang["manager_theme_mode1"] = 'Wszystko jasne'; +$_lang["manager_theme_mode2"] = 'Ciemna nawigacja'; +$_lang["manager_theme_mode3"] = 'Ciemna nawigacja i drzewo zasobów'; +$_lang["manager_theme_mode4"] = 'Wszystko ciemne'; $_lang["messages"] = 'Wiadomości'; $_lang["messages_all"] = 'Wszystkich'; $_lang["messages_compose"] = 'Nowa wiadomość'; @@ -570,11 +582,11 @@ $_lang["module_title"] = 'Utwórz/edytuj moduł'; $_lang["module_viewdepend_msg"] = 'Przeglądaj elementy, z których korzysta moduł. Kliknij na przycisk "Menedżera zależności" aby modyfikować te powiązania.'; $_lang["modules"] = 'Moduły'; -$_lang["modx_news"] = 'Wiadomości MODX'; -$_lang["modx_news_tab"] = 'Wiadomości MODX'; -$_lang["modx_news_title"] = 'Wiadomości MODX'; -$_lang["modx_security_notices"] = 'Powiadomienia bezpieczeństwa MODX'; -$_lang["modx_version"] = 'Wersja MODX'; +$_lang["modx_news"] = 'EVO Powiadomienia'; +$_lang["modx_news_tab"] = 'EVO Wiadomości'; +$_lang["modx_news_title"] = 'EVO Wiadomości'; +$_lang["modx_security_notices"] = 'EVO Powiadomienia bezpieczeństwa'; +$_lang["modx_version"] = 'Wersja EVO'; $_lang["monday"] = 'Poniedziałek'; $_lang["move"] = 'Przenieś'; $_lang["move_resource"] = 'Przenieś dokument'; @@ -596,7 +608,7 @@ $_lang["new_snippet"] = 'Nowy snippet'; $_lang["new_template"] = 'Nowy szablon'; $_lang["new_tmplvars"] = 'Nowa zmienna szablonu'; -$_lang["new_user"] = 'Nowy użytkownik'; +$_lang["new_user"] = 'Nowy użytkownik zaplecza'; $_lang["new_web_user"] = 'Nowy użytkownik web'; $_lang["new_resource"] = 'Nowy dokument'; $_lang["no"] = 'Nie'; @@ -631,6 +643,7 @@ $_lang["onlineusers_user"] = 'Użytkownik'; $_lang["onlineusers_userid"] = 'ID Użytkownika'; $_lang["optimize_table"] = 'Kliknij tutaj, aby zoptymalizować tabelę'; +$_lang["page_data_alias"] = 'Alias'; $_lang["page_data_cacheable"] = 'Włącz cache'; $_lang["page_data_cacheable_help"] = 'Zaznaczenie tego pola pozwoli na zapisywanie tego dokumentu w cache\'u. Jeśli dokument zawiera snippety, upewnij się że pole jest odznaczone.'; $_lang["page_data_cached"] = 'Źródło pobrane z cache\'u:'; @@ -675,7 +688,7 @@ $_lang["parse_docblock_msg"] = 'Uwaga (!): To zresetuje nazwę, konfigurację, opis oraz kategorię do wartości domyślnych poprzez ponowne skanowanie kodu źródłowego.'; $_lang["password"] = 'Hasło'; $_lang["password_change_request"] = 'Żądanie zmiany hasła'; -$_lang["password_gen_gen"] = 'Pozwól MODX wygenerować hasło.'; +$_lang["password_gen_gen"] = 'Pozwól EVO wygenerować hasło.'; $_lang["password_gen_length"] = 'Hasło, które podałeś musi mieć przynajmniej 6 znaków.'; $_lang["password_gen_method"] = 'Metoda generowania nowego hasła'; $_lang["password_gen_specify"] = 'Pozwól mi wprowadzić hasło:'; @@ -683,7 +696,7 @@ $_lang["password_method_email"] = 'Wyślij nowe hasło emailem.'; $_lang["password_method_screen"] = 'Pokaż nowe hasło na ekranie.'; $_lang["password_msg"] = 'Nowym hasłem dla %s jest %s.'; -$_lang["php_version_check"] = 'MODX jest kompatybilny z PHP wersją 5.0.0 i wyższą. Zaktualizuj swoją instalację PHP!'; +$_lang["php_version_check"] = 'EVO jest kompatybilny z PHP wersją 5.0.0 i wyższą. This server is using version %s%. Zaktualizuj swoją instalację PHP!'; $_lang["plugin"] = 'Wtyczka'; $_lang["plugins"] = 'Wtyczki'; $_lang["plugin_code"] = 'Kod wtyczki (php)'; @@ -700,14 +713,14 @@ $_lang["purge_plugin"] = 'Usuń przestarzałe wtyczki'; $_lang["plugin_title"] = 'Stwórz/edytuj wtyczkę'; $_lang["preview"] = 'Podgląd'; -$_lang["preview_msg"] = 'To jest podgląd ostatnio dokonanych zmian. Kliknij tutaj aby zapisać i odświeżyć bieżące zmiany'; +$_lang["preview_msg"] = 'To jest podgląd twoich ostatnio zapisanych zmian. Kliknij tutaj aby zapisać i odświeżyć obecne zmiany'; $_lang["preview_resource"] = 'Podgląd dokumentu'; $_lang["private"] = 'Prywatny'; $_lang["public"] = 'Publiczny'; $_lang["publish_date"] = 'Data publikacji'; $_lang["publish_events"] = 'Wydarzenia publikacji'; $_lang["publish_resource"] = 'Publikuj dokument'; -$_lang["rb_base_dir_message"] = 'Wprowadź fizyczną ścieżkę do katalogu zasobów. To ustawienie jest zwykle generowane automatycznie. Może nie działać na serwerze IIS.
      Uwaga: katalog zasobów musi zawierać podkatalogi: images, files, flash, media aby przeglądarka zasobów działała poprawnie.'; +$_lang["rb_base_dir_message"] = 'Wprowadź fizyczną ścieżkę do katalogu zasobów. To ustawienie jest zwykle generowane automatycznie. Może nie działać na serwerze IIS. Uwaga: katalog zasobów musi zawierać podkatalogi: images, files, flash, media aby przeglądarka zasobów działała poprawnie.'; $_lang["rb_base_dir_title"] = 'Ścieżka do plików'; $_lang["rb_base_url_message"] = 'Podaj URL do katalogu zasobów. To ustawienia jest zwykle generowane automatycznie. Może nie działać na serwerze IIS.'; $_lang["rb_base_url_title"] = 'URL przeglądarki plików'; @@ -753,7 +766,7 @@ $_lang["resource_opt_contentdispo"] = 'Przetwarzanie treści'; $_lang["resource_opt_contentdispo_help"] = 'Użyj pola przetwarzania treści, aby określić jak ten dokument zostanie obsłużony przez przeglądarkę internetową. Dla plików do pobrania wybierz opcję: załącznik.'; $_lang["resource_opt_emptycache"] = 'Opróżnij cache'; -$_lang["resource_opt_emptycache_help"] = 'Zaznaczenie tego pola spowoduje opróżnienie cache\'u po zapisaniu dokumentu. W ten sposób odwiedzający nie będą widzieli starszej wersji dokumentu.'; +$_lang["resource_opt_emptycache_help"] = 'Zaznaczenie tego pola spowoduje opróżnienie cache po zapisaniu dokumentu. W ten sposób odwiedzający nie będą widzieli starszej wersji dokumentu.'; $_lang["resource_opt_folder"] = 'Folder?'; $_lang["resource_opt_folder_help"] = 'Zaznacz tę opcję, aby dokument pełnił również funkcję folderu dla innych dokumentów. Nie musisz się przejmować tą opcją, gdyż MODX z reguły zajmuje się ustawieniami folderów automatycznie.'; $_lang["resource_opt_menu_index"] = 'Pozycja w menu'; @@ -812,7 +825,7 @@ $_lang["role_delete_role"] = 'Usuwanie ról'; $_lang["role_delete_snippet"] = 'Usuwanie snippetów'; $_lang["role_delete_template"] = 'Usuwanie szablonów'; -$_lang["role_delete_user"] = 'Usuwanie użytkowników'; +$_lang["role_delete_user"] = 'Usuń użytkowników zaplecza'; $_lang["role_delete_web_user"] = 'Usuń użytkowników web'; $_lang["role_edit_chunk"] = 'Edytowanie chunków'; $_lang["role_edit_doc"] = 'Edytowanie dokumentu'; @@ -823,7 +836,7 @@ $_lang["role_edit_settings"] = 'Zmiana ustawień witryny'; $_lang["role_edit_snippet"] = 'Edytowanie snippetów'; $_lang["role_edit_template"] = 'Edytowanie szablonów'; -$_lang["role_edit_user"] = 'Edytowanie użytkowników'; +$_lang["role_edit_user"] = 'Edytuj użytkowników zaplecza'; $_lang["role_edit_web_user"] = 'Edytuj użytkowników web'; $_lang["role_empty_trash"] = 'Trwałe kasowanie usuniętych dokumentów'; $_lang["role_errors"] = 'Pokazuj okno dialogowe błędów'; @@ -844,7 +857,7 @@ $_lang["role_name"] = 'Nazwa roli'; $_lang["role_new_module"] = 'Utwórz nowy moduł'; $_lang["role_new_role"] = 'Tworzenie ról'; -$_lang["role_new_user"] = 'Tworzenie użytkowników'; +$_lang["role_new_user"] = 'Dodaj nowych użytkowników zaplecza'; $_lang["role_new_web_user"] = 'Stwórz nowego użytkownika web'; $_lang["role_plugin_management"] = 'Zarządzenie wtyczkami'; $_lang["role_publish_doc"] = 'Publikowanie dokumentów'; @@ -859,13 +872,13 @@ $_lang["role_save_role"] = 'Zapisywanie ról'; $_lang["role_save_snippet"] = 'Zapisywanie snippetów'; $_lang["role_save_template"] = 'Zapisywanie szablonów'; -$_lang["role_save_user"] = 'Zapisywanie użytkowników'; +$_lang["role_save_user"] = 'Zapisz użytkowników zaplecza'; $_lang["role_save_web_user"] = 'Zapisz użytkowników web'; $_lang["role_snippet_management"] = 'Zarządzanie snippetami'; $_lang["role_template_management"] = 'Zarządzanie szablonami'; $_lang["role_title"] = 'Utwórz/ edytuj rolę'; $_lang["role_udperms"] = 'Zarządzanie uprawnieniami'; -$_lang["role_user_management"] = 'Zarządzanie użytkownikami'; +$_lang["role_user_management"] = 'Zarządzanie użytkownikami zaplecza'; $_lang["role_view_docdata"] = 'Przeglądanie danych dokumentu'; $_lang["role_view_eventlog"] = 'Przeglądanie dziennika zdarzeń'; $_lang["role_view_logs"] = 'Przeglądanie dziennika menadżera'; @@ -873,10 +886,10 @@ $_lang["role_web_access_persmissions"] = 'Uprawnienia dostępu web'; $_lang["role_web_user_management"] = 'Zarządzanie użytkownikami web'; $_lang["rss_url_news_default"] = 'http://feeds.feedburner.com/evocms-release-news'; -$_lang["rss_url_news_message"] = 'Wprowadź URL źródła wiadomości MODX'; +$_lang["rss_url_news_message"] = 'Wprowadź URL źródła wiadomości EVO.'; $_lang["rss_url_news_title"] = 'Żródło RSS wiadomości'; $_lang["rss_url_security_default"] = 'http://feeds.feedburner.com/evocms-security-news'; -$_lang["rss_url_security_message"] = 'Wprowadź URL powiadomień bezpieczeństwa.'; +$_lang["rss_url_security_message"] = 'Wprowadź URL powiadomień bezpieczeństwa EVO.'; $_lang["rss_url_security_title"] = 'Źródło RSS bezpieczeństwa'; $_lang["run_module"] = 'Uruchom moduł'; $_lang["saturday"] = 'Sobota'; @@ -907,7 +920,7 @@ $_lang["search_results_returned_msg"] = 'Twoje kryteria wyszukiwania zwróciły %s dokumentów. Jeżeli wyników wyszukiwania jest bardzo dużo, spróbuj wpisać bardziej szczegółowe kryteria wyszukiwania. Dwie kolumny z lewej pozwolą ci znaleźć dokument w drzewie lub wyświetlić jego zawartość. Dwie kolumny po prawej pokażą odpowiednio, czy dokument został usunięty oraz czy jest opublikowany.

      '; $_lang["search_results_returned_title"] = 'Tytuł'; $_lang["search_view_docdata"] = 'Zobacz tą pozycję'; -$_lang["security"] = 'Bezpieczeństwo'; +$_lang["security"] = 'Użytkownicy '; $_lang["security_notices_tab"] = 'Powiadomienia bezpieczeństwa'; $_lang["security_notices_title"] = 'Powiadomienia bezpieczeństwa'; $_lang["select_date"] = 'Wybierz datę'; @@ -923,20 +936,27 @@ $_lang["set_automatic"] = 'Ustaw automatycznie'; $_lang["set_default"] = 'Ustaw domyślne'; $_lang["set_default_all"] = 'Ustaw domyślne'; -$_lang["settings_after_install"] = 'Ponieważ jest to nowa instalacja, wymagane jest abyś sprawdził ustawienia i zmienił te, które ci nie odpowiadają. Po sprawdzeniu ustawień, naciśnij \'Zapisz\' aby zaktualizowac ustawienia w bazie.

      '; +$_lang["settings_after_install"] = 'Ponieważ jest to nowa instalacja, wymagane jest abyś sprawdził ustawienia i zmienił te, które ci nie odpowiadają. Po sprawdzeniu ustawień, naciśnij \'Zapisz\' aby zaktualizować ustawienia w bazie.'; $_lang["settings_config"] = 'Konfiguracja'; $_lang["settings_dependencies"] = 'Zależności'; $_lang["settings_events"] = 'Zdarzenia systemowe'; $_lang["settings_furls"] = 'Przyjazny URL'; $_lang["settings_general"] = 'Ogólne'; +$_lang["settings_group_tv_message"] = 'Wybierz czy Zmienne Szablonu (TV) mają być grupowane w przypisane im kategorie podczas edycji zasobu'; +$_lang["settings_group_tv_options"] = 'Nie grupuj,Sekcje w głównej karcie,Karty w głównej karcie,Sekcje w osobnej karcie,Karty w osobnej karcie,Osobne karty'; $_lang["settings_misc"] = 'Pliki'; $_lang["settings_security"] = 'Bezpieczeństwo'; $_lang["settings_KC"] = 'Przeglądarka plików'; $_lang["settings_page_settings"] = 'Ustawienia'; $_lang["settings_photo"] = 'Zdjęcie'; $_lang["settings_properties"] = 'Właściwości'; +$_lang["show_fullscreen_btn_message"] = 'Pokaż w nawigacji przełącznik pełnego ekranu'; +$_lang["show_newresource_btn_message"] = 'Pokaż w nawigacji przycisk nowego zasobu'; +$_lang["settings_show_picker_message"] = 'Zmienia wygląd zaplecza i zapisuje w localstorage'; +$_lang["show_fullscreen_btn"] = 'Przełącznik pełnego ekranu'; +$_lang["show_newresource_btn"] = 'Przycisk nowego zasobu'; $_lang["settings_site"] = 'Strona'; -$_lang["settings_strip_image_paths_message"] = 'Włączenie tej opcji spowoduje, że system będzie konwertował źródła do obrazów ze ścieżek bezwzględnych na względne. To użyteczna funkcja, jeśli będziesz chciał kiedyś przenieść instalację systemu w inne miejsce. Jeśli nie masz pojęcia co to oznacza ustaw tą opcję na \'Nie\'.'; +$_lang["settings_strip_image_paths_message"] = 'If this is set to \'No\', EVO will write file browser src\'s (images, files, flash, etc.) as absolute URLs. Relative URLs are helpful should you wish to move your EVO install, e.g., from a staging site to a production site. If you have no idea what this means, it\'s best just to leave it set to \'Yes\'.'; $_lang["settings_strip_image_paths_title"] = 'Przepisuj ścieżki przeglądarki'; $_lang["settings_templvars"] = 'Zmienne szablonu'; $_lang["settings_title"] = 'Konfiguracja systemu'; @@ -945,6 +965,7 @@ $_lang["show_meta"] = 'Pokazuj zakładkę META tagów i słów kluczowych'; $_lang["show_meta_message"] = 'Pokazuj zakładkę META tagów i słów kluczowych podczas edycji dokumentu.'; $_lang["show_tree"] = 'Pokaż drzewo'; +$_lang["show_picker"] = 'Pokaż przełącznik kolorów'; $_lang["showing"] = 'Pokazuje'; $_lang["signupemail_message"] = 'Tutaj możesz ustawić treść wiadomości wysyłanej użytkownikom w momencie utworzenia im konta, pozwalającej MODX na wysłanie im e-maila z nazwą użytkownika i hasłem.
      Uwaga: Następujące zmienne są zamieniane przez Panel Administracyjny kiedy wiadomość jest wysyłana:

      [+sname+] - Nazwa twojej strony,
      [+saddr+] - Adres e-mail twojej strony,
      [+surl+] - Adres url strony,
      [+uid+] - Nazwa lub Id użytkownika,
      [+pwd+] - Hasło użytkownika,
      [+ufn+] - Pełna nazwa użytkownika.

      Pozostaw [+uid+] i [+pwd+] w treści e-maila, ponieważ w przeciwnym wypadku nazwa użytkownika oraz hasło nie zostanie wysłane w wiadomości i użytkownicy nie poznają swojej nazwy lub hasła!'; $_lang["signupemail_title"] = 'E-mail rejestracyjny'; @@ -988,19 +1009,20 @@ $_lang["sys_alert"] = 'Alarm systemowy'; $_lang["sysinfo_activity_message"] = 'Ta lista zawiera wykaz dokumentów, które były ostatnio edytowane.'; $_lang["sysinfo_userid"] = 'Użytkownik'; +$_lang["system"] = 'System'; $_lang["system_email_signup"] = ' Witaj [+uid+] Poniżej znajdziesz dane logowania do systemu zarządzania treścią serwisu [+sname+]: -Nazwa użytkownika: [+uid+] +Login: [+uid+] Hasło: [+pwd+] Hasło możesz zmienić po zalogowaniu do systemu ([+surl+]). Pozdrawiam, -Administrator +Administrator witryny '; $_lang["system_email_webreminder"] = 'Witaj [+uid+] @@ -1010,9 +1032,9 @@ Po zakończeniu możesz użyć następującego hasła do zalogowania się: -Hasło:[+pwd+] +Hasło: [+pwd+] -eśli nie zgłaszałeś zmiany hasła zignoruj ten e-mail. +Jeśli nie zgłaszałeś zmiany hasła zignoruj ten e-mail. Pozdrawiam, Administrator witryny'; @@ -1075,18 +1097,19 @@ $_lang["tmplvars_widget"] = 'Widget'; $_lang["tmplvars_widget_prop"] = 'Widget - właściwości'; $_lang["to"] = 'do'; +$_lang["toggle_fullscreen"] = 'Przełącz pełny ekran'; $_lang["tools"] = 'Narzędzia'; $_lang["top_howmany_message"] = 'Przeglądając raporty, jak duża powinna być lista pierwszych pozycji?'; $_lang["top_howmany_title"] = 'Liczba pierwszych pozycji'; $_lang["total"] = 'razem'; -$_lang["track_visitors_message"] = 'Logowanie wizyt pozwoli na stworzenie statystyk użytkowników twojej strony. Należy pamiętać, że opcja ta zwalnia nieco parser serwisu. Jeżeli nie interesują cię statystyki wizyt, możesz bezpiecznie wyłączyć tę opcję.'; -$_lang["track_visitors_title"] = 'Włącz statystyki'; +$_lang["track_visitors_message"] = 'Zaznacz aby wyświetlać dokumenty folderów w drzewie'; +$_lang["track_visitors_title"] = 'Pokaż dokumenty folderów'; $_lang["tree_page_click"] = 'Po kliknięciu na dokument'; $_lang["tree_page_click_message"] = 'Domyślna akcja wykonywana po kliknięciu na dokument w drzewie dokumentów.'; $_lang["use_breadcrumbs"] = 'Pokaż nawigację'; $_lang["use_breadcrumbs_message"] = 'Pokaż ścieżkę dokumentu podczas tworzenia lub edycji zasobu'; $_lang["tree_show_protected"] = 'Pokazuj chronione dokumenty'; -$_lang["tree_show_protected_message"] = 'Kiedy ta opcja jest ustawiona na "Nie", chronione dokumenty (i wszystkie ich poddokumenty) nie będą wyświetlane na drzewie dokumentów. "Nie" jest ustawieniem zgodnym z wcześniejszymi wersjami MODX.'; +$_lang["tree_show_protected_message"] = 'Kiedy ta opcja jest ustawiona na "Nie", chronione dokumenty (i wszystkie ich dokumenty) nie będą wyświetlane na drzewie dokumentów. "Nie" jest starym ustawieniem dla EVO.'; $_lang["truncate_table"] = 'Kliknij tu, aby skrócić tabelę'; $_lang["tuesday"] = 'Wtorek'; $_lang["tv"] = 'Zmienna Szablonu'; @@ -1122,6 +1145,7 @@ $_lang["use_alias_path_title"] = 'Pełna ścieżka URL'; $_lang["use_editor_message"] = 'Czy chcesz udostępnić edytor RTE? Jeżeli wygodniej ci pisać w HTML, możesz wyłączyć edytor za pomocą tych ustawień. Pamiętaj, że ta opcja dotyczy wszystkich dokumentów i wszystkich użytkowników!'; $_lang["use_editor_title"] = 'Włącz edytor'; +$_lang["use_global_tabs"] = 'Użyj Global Tabs'; $_lang["user"] = 'Użytkownik'; $_lang["user_block"] = 'Zablokowany'; $_lang["user_blockedafter"] = 'Zablokowane po'; @@ -1149,7 +1173,7 @@ $_lang["user_prevlogin"] = 'Ostatnie logowanie'; $_lang["user_role"] = 'Rola użytkownika'; $_lang["user_state"] = 'Województwo'; -$_lang["user_title"] = 'Utwórz/ edytuj użytkownika'; +$_lang["user_title"] = 'Dodaj/edytuj użytkownika zaplecza'; $_lang["user_upload_message"] = 'Jeśli chcesz zabronić temu użytkownikowi ładowania dowolnych typów plików z tej kategorii, upewnij się że opcja "Używaj ustawień konfiguracji systemu" jest odznaczona i pozostaw to pole puste.'; $_lang["user_use_config"] = 'Używaj ustawień konfiguracji systemu'; $_lang["user_zip"] = 'Kod pocztowy'; @@ -1184,12 +1208,12 @@ $_lang["websignupemail_title"] = 'E-mail rejestracyjny Web'; $_lang["wednesday"] = 'Środa'; $_lang["welcome_messages"] = 'Twoja skrzynka wiadomości zawiera %d wiadomość(-ci), z których %s jest nieprzeczytane.'; -$_lang["welcome_title"] = 'Witamy w panelu administracyjnym MODX'; -$_lang["which_editor_message"] = 'Tutaj możesz wybrać który edytor WYSIWYG chcesz używać. Możesz ściągnąć i zainstalować dodatkowe edytory ze strony MODX-a.'; +$_lang["welcome_title"] = 'Witaj w swoim systemie EVO'; +$_lang["which_editor_message"] = 'Tutaj możesz wybrać którego edytora Rich Text (RTE) chcesz używać. Możesz ściągnąć i zainstalować dodatkowe edytory ze strony EVO.'; $_lang["which_editor_title"] = 'Edytor'; $_lang["working"] = 'Przetwarzanie...'; $_lang["wrap_lines"] = 'Zawijaj wiersze'; -$_lang["xhtml_urls_message"] = 'Zamienia znaki ampersand (&) w URLach generowanych przez MODX na walidujące encje &amp;'; +$_lang["xhtml_urls_message"] = 'Zamienia znaki ampersand (&) w URL generowanych przez EVO na walidujące &amp; htmlentity'; $_lang["xhtml_urls_title"] = 'URL XHTML'; $_lang["yes"] = 'Tak'; $_lang["you_got_mail"] = 'Masz wiadomość'; @@ -1213,11 +1237,14 @@ $_lang["enable_bindings_title"] = 'Włącz komendy @Bindings'; $_lang["enable_bindings_message"] = 'Zapobiega wykonywaniu funkcji PHP poprzez TV @Bindings. Użyteczny gdy istnieją użytkownicy Managera, którzy nie powinni mieć dostępu do tworzenia kodu PHP, ale potrzebują tworzyć lub edytować TV. Wynikiem każdej TV która zawiera @Binding będzie "@Bindings disabled".'; $_lang["enable_filter_title"] = 'Włącz filtry'; -$_lang["enable_filter_message"] = 'Filtry pozwalają na manipulowanie pokazywaniem lub przetwarzaniem tagów. Pozwalają zmodyfikować wartości na poziomie szablonu analogicznie jak PHx. Więcej informacji.'; // todo: change link to documentation +$_lang["enable_filter_message"] = 'Filtry pozwalają na manipulowanie pokazywaniem lub przetwarzaniem tagów. Pozwalają zmodyfikować wartości na poziomie szablonu analogicznie jak PHx. Więcej informacji.'; // todo: change link to documentation $_lang["enable_filter_phx_warning"] = 'Jeśli wtyczka PHx zostanie wykryta, wbudowane filtry będą domyślnie wyłączone'; $_lang["enable_filter_phx_warning"] = 'Jeśli wtyczka PHx zostanie wykryta, wbudowane filtry będą domyślnie wyłączone'; +$_lang["enable_at_syntax_title"] = 'Włącz <@SYNTAX>'; +$_lang["enable_at_syntax_message"] = '<@SYNTAX>(atmark syntax) is simple and lightweight template syntax. This is designed to consider coexistence with HTML tags and content strings.'; + $_lang["bkmgr_alert_mkdir"] = 'Plik nie mógł zostać utworzony w katalogu. Proszę sprawdzić uprawnienia [+snapshot_path+]'; $_lang["bkmgr_restore_msg"] = '

      Serwis może zostać przywrócony używając pliku SQL.

      '; $_lang["bkmgr_restore_title"] = 'Przywróć'; @@ -1251,10 +1278,10 @@ $_lang["make_folders_message"] = 'Ukośnik będzie dodany do dokumentów oznaczonych jako foldery, gdy używa się przyjaznych URL.'; $_lang["check_files_onlogin_title"] = 'Sprawdzaj ważne pliki przy logowaniu'; -$_lang["check_files_onlogin_message"] = 'Włączając tę opcję, ważne pliki systemowe będą sprawdzane pod kątem niechcianych modyfikacji typowych dla ataków na stronę www. Chociaż nie jest to 100% zapezpiecznie, to może zaalarmować Cię o zmanipulowanych plikach MODX.'; +$_lang["check_files_onlogin_message"] = 'Włączając tę opcję, ważne pliki systemowe będą sprawdzane pod kątem niechcianych modyfikacji typowych dla ataków na stronę www. Chociaż nie jest to 100% zabezpieczenie, to może zaalarmować Cię o zmodyfikowanych plikach EVO.'; $_lang["configcheck_sysfiles_mod"] = 'Ważne pliki systemowe zostały zmienione.'; -$_lang["configcheck_sysfiles_mod_msg"] = 'System został skonfigurowany tak aby sprawdzać ważne pliki systemowe pod kątem ataków. To ostrzeżenie niekoniecznie oznacza że strona została zaatakowana, jednakże powinno się sprawdzić analizowane pliki wylistowane w Konfiguracja systemu -> Bezpieczeństwo -> Sprawdzaj ważne pliki przy logowaniu. Jeśli pliki są niezmienione lub utworzone przez administratora, przejdź do Konfiguracji systemu i zapisz ponownie ustawienia. Zmiany wykryto w następujących plikach:'; +$_lang["configcheck_sysfiles_mod_msg"] = 'EVO zostało skonfigurowany tak, aby sprawdzać ważne pliki systemowe pod kątem ataków. To ostrzeżenie niekoniecznie oznacza że strona została zaatakowana, jednakże powinno się sprawdzić analizowane pliki (Konfiguracja systemu -> Bezpieczeństwo -> Sprawdzaj ważne pliki przy logowaniu). Jeśli pliki są niezmienione lub utworzone przez administratora, przejdź do Konfiguracji systemu i zapisz ponownie ustawienia. Zmiany wykryto w następujących plikach:'; $_lang['email_method_title'] = 'Metoda wysyłania poczty'; $_lang['email_method_mail'] = 'Funkcja PHP mail()'; @@ -1268,7 +1295,7 @@ $_lang["setting_resource_tree_node_name"] = 'Nazwa węzła drzewa zasobów'; $_lang["setting_resource_tree_node_name_desc"] = 'Określ pole zasobu, które zostanie użyte w czasie renderowania węzłów w drzewie zasobów. Domyślnie to pagetitle, jednakże każde pole zasobu może zostać wykorzystane np. menutitle, alias.'; -$_lang["setting_resource_tree_node_name_desc_add"] = 'Informacja: Od MODX 1.1 możesz zmienić wyświetlaną nazwę w opcjach sortowania drzewa zasobów. To ustawienie jest używane gdy wyświetlana nazwa w drzewie jest ustawiona na "Domyślnie".'; +$_lang["setting_resource_tree_node_name_desc_add"] = 'Informacja: Od wydania EVO 1.1 możesz zmienić wyświetlaną nazwę w opcjach sortowania drzewa zasobów. To ustawienie jest używane gdy wyświetlana nazwa w drzewie jest ustawiona na "Domyślnie".'; $_lang["resource_opt_alvisibled"] = 'Uwzględnij alias w URL'; $_lang["resource_opt_alvisibled_help"] = 'Alias tego zasobu zostanie dołączony do ścieżki przyjaznego URL'; @@ -1278,6 +1305,9 @@ $_lang["docid_incrmnt_method_1"] = 'Minimum missed ID'; $_lang["docid_incrmnt_method_2"] = 'Maximal ID+1'; +$_lang["enable_cache_title"] = 'Cache dokumentu'; +$_lang["disabled_at_login"] = 'Wyłącz po zalogowaniu'; + $_lang["cache_type_title"] = 'Metoda działania cache'; $_lang["cache_type_1"] = 'Cache bazuje tylko na ID zasobu (standardowe)'; $_lang["cache_type_2"] = 'Cache bazuje na ID zasobu oraz parametrach $_GET'; @@ -1286,8 +1316,8 @@ $_lang["aliaslistingfolder_title"] = 'AliasListing tylko dla folderów'; $_lang["aliaslistingfolder_message"] = 'Redukuje zużycie pamięci w przypadku bardzo dużej liczby zasobów'; -$_lang["settings_friendlyurls_alert"] = 'Wymagana jest zmiana nazwy pliku ht.access na .htaccess aby używać przyjaznych adresów.'; -$_lang["settings_friendlyurls_alert2"] = 'Ponieważ serwis zainstalowany został w podkatalogu, wymagana jest zmiana zawartości pliku .htaccess.'; +$_lang["settings_friendlyurls_alert"] = 'Aby używać przyjaznych adresów, wymagana jest zmiana nazwy pliku ht.access na .htaccess.'; +$_lang["settings_friendlyurls_alert2"] = 'Ponieważ EVO zainstalowano w podkatalogu, wymagana jest zmiana zawartości pliku .htaccess.'; $_lang["user_street"] = 'Ulica'; $_lang["user_city"] = 'Miasto'; @@ -1308,9 +1338,9 @@ $_lang["export_site.static.php6"] = 'Target'; $_lang["export_site.static.php7"] = 'Files cannot be outputted to [+rb_base_url+]'; -$_lang["mutate_settings.dynamic.php6"] = 'Wyślij e-mail z błędami MODX'; +$_lang["mutate_settings.dynamic.php6"] = 'Wyślij e-mail w przypadku błędu EVO'; $_lang["mutate_settings.dynamic.php7"] = 'Nie wysyłaj'; -$_lang["mutate_settings.dynamic.php8"] = 'Na adres [(emailsender)] ([+emailsender+]) zostanie wysłana wiadomość, gdy wystąpi błąd MODX. Szczegóły błędu można sprawdzić w Dzienniku zdarzeń.'; +$_lang["mutate_settings.dynamic.php8"] = 'Gdy wystąpi błąd EVO, na adres [(emailsender)] ([+emailsender+]) zostanie wysłana wiadomość. Szczegóły błędu można sprawdzić w Dzienniku zdarzeń.'; $_lang["error_no_privileges"] = "Nie posiadasz wystarczających uprawnień!"; $_lang["error_no_optimise_tablename"] = "Nie znaleziono tabeli do zoptymalizowania w zapytaniu!"; @@ -1326,6 +1356,7 @@ $_lang["error_movedocument1"] = "Dokument nie może być swoim rodzicem!"; $_lang["error_movedocument2"] = "W zapytaniu nie przekazano ID dokumentu!"; $_lang["error_movedocument3"] = "Nowy rodzic nie został ustawiony w zapytaniu!"; +$_lang["error_internet_connection"] = "Serwer jest niedostępny. Sprawdź swoje połączenie z internetem!"; $_lang["login_processor_unknown_user"] = "Podano błędną nazwę użytkownika lub hasło!"; $_lang["login_processor_wrong_password"] = "Podano błędną nazwę użytkownika lub hasło!"; @@ -1364,7 +1395,7 @@ $_lang["are_you_sure"] = "Jesteś pewien?"; $_lang['evo_downloads_title'] = "Pobierania Evolution"; -$_lang['help_translating_title'] = "Pomóż w tłumaczeniu MODX Evolution"; +$_lang['help_translating_title'] = "Pomóż przetłumaczyć Evolution"; $_lang['download'] = "Pobierz"; $_lang['downloads'] = "Pobierania"; $_lang["previous_releases"] = "Poprzednie wydania"; @@ -1373,7 +1404,7 @@ $_lang["display_locks"] = "Wyświetlaj blokady"; $_lang["role_display_locks"] = "Wyświetlaj blokady"; $_lang["session_timeout"] = "Wygaśnięcie sesji"; -$_lang["session_timeout_msg"] = "MODX będzie pingować serwer podobnie jak ustawienie "Okres sprawdzania wiadomości". Jeśli ostatni ping przewyższy ustawienie, powiązana sesja będzie uznana za nieważną i wszystkie powiązane blokady zostaną automatycznie zdjęte. Ustaw wartość w minutach (>2 minuty, domyślnie 15 minut)."; +$_lang["session_timeout_msg"] = "EVO będzie pingować serwer podobnie jak ustawienie "Okres sprawdzania wiadomości". Jeśli ostatni ping przewyższy ustawienie, powiązana sesja będzie uznana za nieważną i wszystkie powiązane blokady zostaną automatycznie zdjęte. Ustaw wartość w minutach (>2 minuty, domyślnie 15 minut)."; $_lang["unlock_element_id_warning"] = "Czy jesteś pewien że chcesz odblokować ten [+element_type+] (ID [+id+])?"; $_lang["lock_element_type_1"] = "Szablon"; $_lang["lock_element_type_2"] = "Zmienna szablonu"; @@ -1452,4 +1483,18 @@ $_lang["viewopts_radio_inline"] = 'Obok siebie'; $_lang["viewopts_radio_flex"] = 'Flex'; $_lang["viewopts_fontsize"] = 'Rozmiar tekstu'; -$_lang["viewopts_cb_alltabs"] = 'Wszystkie karty'; \ No newline at end of file +$_lang["viewopts_cb_alltabs"] = 'Wszystkie karty'; + +$_lang['email_sender_method'] = 'Nadawca wiadomości'; +$_lang['auto'] = 'Wykryj automatycznie'; +$_lang['use_emailsender'] = 'Użyj wartości [(emailsender)]'; +$_lang['email_sender_method_message'] = 'The envelope sender of the message. This will usually be turned into a Return-Path header by the receiver, and is the address that bounces will be sent to. Auto-detect will work in most cases.'; + +$_lang['login_form_position_title'] = 'Pozycja formularza logowania'; +$_lang['login_form_position_left'] = 'Lewa strona'; +$_lang['login_form_position_center'] = 'Wyśrodkowany'; +$_lang['login_form_position_right'] = 'Prawa strona'; +$_lang['login_logo_title'] = 'Logo strony logowania'; +$_lang['login_logo_message'] = 'Zalecana szerokość to 360px i typ pliku PNG'; +$_lang['login_bg_title'] = 'Tło strony logowania'; +$_lang['login_bg_message'] = 'Zalecana szerokość to 1920px'; \ No newline at end of file From 009833f505ef84a14b5b50e1e95731d39373d971 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Sat, 7 Apr 2018 17:32:02 +0200 Subject: [PATCH 169/274] Manager Polish Translation update --- manager/includes/lang/polish-utf8.inc.php | 30 +++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/manager/includes/lang/polish-utf8.inc.php b/manager/includes/lang/polish-utf8.inc.php index 8603aa07ce..0aa42500dc 100755 --- a/manager/includes/lang/polish-utf8.inc.php +++ b/manager/includes/lang/polish-utf8.inc.php @@ -45,7 +45,7 @@ $_lang["account_email"] = 'Konto e-mail'; $_lang["actioncomplete"] = 'Akcja zakończona powodzeniem!

      Proszę zaczekać, aż EVO zakończy porządkowanie.'; $_lang["activity_message"] = 'Ta lista pokazuje ostatnie dokumenty, jakie utworzyłeś lub edytowałeś:'; -$_lang["activity_title"] = 'Ostatnio edytowane/utworzone dokumenty'; +$_lang["activity_title"] = 'Ostatnio edytowane dokumenty'; $_lang["add"] = 'Dodaj'; $_lang["add_chunk"] = 'Dodaj chunk'; $_lang["add_doc"] = 'Dodaj dokument'; @@ -452,7 +452,7 @@ $_lang["keyword"] = 'Słowo kluczowe'; $_lang["keywords"] = 'Słowa kluczowe'; $_lang["keywords_intro"] = 'Aby edytować słowo kluczowe wpisz nowe słowo w polu tekstowym obok słowa, które chcesz zmienić. Aby usunąć słowo kluczowe, zaznacz pole \'usuń\' dla danego słowa. Jeśli zaznaczysz pole usunięcia i zmienisz nazwę pola zostanie ono usunięte!'; -$_lang["language_message"] = 'Wybierz język dla zaplecza EVO.'; +$_lang["language_message"] = 'Wybierz język dla Menedżera EVO.'; $_lang["language_title"] = 'Język Managera'; $_lang["last_update"] = 'Ostatnia aktualizacja'; $_lang["launch_site"] = 'Uruchom stronę'; @@ -583,8 +583,8 @@ $_lang["module_viewdepend_msg"] = 'Przeglądaj elementy, z których korzysta moduł. Kliknij na przycisk "Menedżera zależności" aby modyfikować te powiązania.'; $_lang["modules"] = 'Moduły'; $_lang["modx_news"] = 'EVO Powiadomienia'; -$_lang["modx_news_tab"] = 'EVO Wiadomości'; -$_lang["modx_news_title"] = 'EVO Wiadomości'; +$_lang["modx_news_tab"] = 'Wiadomości'; +$_lang["modx_news_title"] = 'Wiadomości'; $_lang["modx_security_notices"] = 'EVO Powiadomienia bezpieczeństwa'; $_lang["modx_version"] = 'Wersja EVO'; $_lang["monday"] = 'Poniedziałek'; @@ -608,8 +608,8 @@ $_lang["new_snippet"] = 'Nowy snippet'; $_lang["new_template"] = 'Nowy szablon'; $_lang["new_tmplvars"] = 'Nowa zmienna szablonu'; -$_lang["new_user"] = 'Nowy użytkownik zaplecza'; -$_lang["new_web_user"] = 'Nowy użytkownik web'; +$_lang["new_user"] = 'Nowy użytkownik Menedżera'; +$_lang["new_web_user"] = 'Nowy użytkownik Web'; $_lang["new_resource"] = 'Nowy dokument'; $_lang["no"] = 'Nie'; $_lang["no_active_users_found"] = 'Nie znaleziono aktywnych użytkowników.'; @@ -638,7 +638,7 @@ $_lang["onlineusers_actionid"] = 'ID akcji'; $_lang["onlineusers_ipaddress"] = 'Adres IP użytkownika'; $_lang["onlineusers_lasthit"] = 'Ostatnio odwiedzone'; -$_lang["onlineusers_message"] = 'Ta lista pokazuje wszystkich użytkowników aktywnych przez ostatnie 20 minut (aktualny czas '; +$_lang["onlineusers_message"] = 'Użytkownicy aktywni w ostatnich 20 minutach ('; $_lang["onlineusers_title"] = 'Zalogowani użytkownicy'; $_lang["onlineusers_user"] = 'Użytkownik'; $_lang["onlineusers_userid"] = 'ID Użytkownika'; @@ -825,7 +825,7 @@ $_lang["role_delete_role"] = 'Usuwanie ról'; $_lang["role_delete_snippet"] = 'Usuwanie snippetów'; $_lang["role_delete_template"] = 'Usuwanie szablonów'; -$_lang["role_delete_user"] = 'Usuń użytkowników zaplecza'; +$_lang["role_delete_user"] = 'Usuń użytkowników Menedżera'; $_lang["role_delete_web_user"] = 'Usuń użytkowników web'; $_lang["role_edit_chunk"] = 'Edytowanie chunków'; $_lang["role_edit_doc"] = 'Edytowanie dokumentu'; @@ -836,7 +836,7 @@ $_lang["role_edit_settings"] = 'Zmiana ustawień witryny'; $_lang["role_edit_snippet"] = 'Edytowanie snippetów'; $_lang["role_edit_template"] = 'Edytowanie szablonów'; -$_lang["role_edit_user"] = 'Edytuj użytkowników zaplecza'; +$_lang["role_edit_user"] = 'Edytuj użytkowników Menedżera'; $_lang["role_edit_web_user"] = 'Edytuj użytkowników web'; $_lang["role_empty_trash"] = 'Trwałe kasowanie usuniętych dokumentów'; $_lang["role_errors"] = 'Pokazuj okno dialogowe błędów'; @@ -857,8 +857,8 @@ $_lang["role_name"] = 'Nazwa roli'; $_lang["role_new_module"] = 'Utwórz nowy moduł'; $_lang["role_new_role"] = 'Tworzenie ról'; -$_lang["role_new_user"] = 'Dodaj nowych użytkowników zaplecza'; -$_lang["role_new_web_user"] = 'Stwórz nowego użytkownika web'; +$_lang["role_new_user"] = 'Dodaj nowych użytkowników Menedżera'; +$_lang["role_new_web_user"] = 'Dodaj użytkownika Web'; $_lang["role_plugin_management"] = 'Zarządzenie wtyczkami'; $_lang["role_publish_doc"] = 'Publikowanie dokumentów'; $_lang["role_remove_locks"] = 'Usuń blokady'; @@ -872,13 +872,13 @@ $_lang["role_save_role"] = 'Zapisywanie ról'; $_lang["role_save_snippet"] = 'Zapisywanie snippetów'; $_lang["role_save_template"] = 'Zapisywanie szablonów'; -$_lang["role_save_user"] = 'Zapisz użytkowników zaplecza'; +$_lang["role_save_user"] = 'Zapisz użytkowników Menedżera'; $_lang["role_save_web_user"] = 'Zapisz użytkowników web'; $_lang["role_snippet_management"] = 'Zarządzanie snippetami'; $_lang["role_template_management"] = 'Zarządzanie szablonami'; $_lang["role_title"] = 'Utwórz/ edytuj rolę'; $_lang["role_udperms"] = 'Zarządzanie uprawnieniami'; -$_lang["role_user_management"] = 'Zarządzanie użytkownikami zaplecza'; +$_lang["role_user_management"] = 'Zarządzanie użytkownikami Menedżera'; $_lang["role_view_docdata"] = 'Przeglądanie danych dokumentu'; $_lang["role_view_eventlog"] = 'Przeglądanie dziennika zdarzeń'; $_lang["role_view_logs"] = 'Przeglądanie dziennika menadżera'; @@ -952,7 +952,7 @@ $_lang["settings_properties"] = 'Właściwości'; $_lang["show_fullscreen_btn_message"] = 'Pokaż w nawigacji przełącznik pełnego ekranu'; $_lang["show_newresource_btn_message"] = 'Pokaż w nawigacji przycisk nowego zasobu'; -$_lang["settings_show_picker_message"] = 'Zmienia wygląd zaplecza i zapisuje w localstorage'; +$_lang["settings_show_picker_message"] = 'Zmienia wygląd Menedżera i zapisuje w localstorage'; $_lang["show_fullscreen_btn"] = 'Przełącznik pełnego ekranu'; $_lang["show_newresource_btn"] = 'Przycisk nowego zasobu'; $_lang["settings_site"] = 'Strona'; @@ -1173,7 +1173,7 @@ $_lang["user_prevlogin"] = 'Ostatnie logowanie'; $_lang["user_role"] = 'Rola użytkownika'; $_lang["user_state"] = 'Województwo'; -$_lang["user_title"] = 'Dodaj/edytuj użytkownika zaplecza'; +$_lang["user_title"] = 'Dodaj/edytuj użytkownika Menedżera'; $_lang["user_upload_message"] = 'Jeśli chcesz zabronić temu użytkownikowi ładowania dowolnych typów plików z tej kategorii, upewnij się że opcja "Używaj ustawień konfiguracji systemu" jest odznaczona i pozostaw to pole puste.'; $_lang["user_use_config"] = 'Używaj ustawień konfiguracji systemu'; $_lang["user_zip"] = 'Kod pocztowy'; From 160590f23462fefaae7401a3e110de2b81c6adbd Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Sat, 7 Apr 2018 22:15:57 +0200 Subject: [PATCH 170/274] Login page - set images placeholders --- manager/includes/accesscontrol.inc.php | 21 +++++++++++++++++---- manager/media/style/default/login.tpl | 4 ++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/manager/includes/accesscontrol.inc.php b/manager/includes/accesscontrol.inc.php index 25191e4268..09995915b6 100755 --- a/manager/includes/accesscontrol.inc.php +++ b/manager/includes/accesscontrol.inc.php @@ -81,9 +81,22 @@ $modx->setPlaceholder('manager_path', MGR_DIR); $modx->setPlaceholder('logo_slogan', $_lang["logo_slogan"]); $modx->setPlaceholder('login_message', $_lang["login_message"]); - $modx->setPlaceholder('manager_theme_url', - MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/'); + $modx->setPlaceholder('manager_theme_url', MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/'); $modx->setPlaceholder('year', date('Y')); + + // set login logo image + if ( !empty($modx->config['login_logo']) ) { + $modx->setPlaceholder('login_logo', MODX_SITE_URL . $modx->config['login_logo']); + } else { + $modx->setPlaceholder('login_logo', MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/images/login/default/login-logo.png'); + } + + // set login background image + if ( !empty($modx->config['login_bg']) ) { + $modx->setPlaceholder('login_bg', MODX_SITE_URL . $modx->config['login_bg']); + } else { + $modx->setPlaceholder('login_bg', MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/images/login/default/login-background.jpg'); + } switch ($modx->config['manager_theme_mode']) { case '1': @@ -97,8 +110,8 @@ break; case '4': $modx->setPlaceholder('manager_theme_style', 'darkness'); - break; } - + break; + } // andrazk 20070416 - notify user of install/update if (isset($_GET['installGoingOn'])) { diff --git a/manager/media/style/default/login.tpl b/manager/media/style/default/login.tpl index 649a9d5888..3da872b479 100755 --- a/manager/media/style/default/login.tpl +++ b/manager/media/style/default/login.tpl @@ -24,7 +24,7 @@ body.dark, body.darkness { background-color: #2a313b !important; - background-image: url('media/style/[(manager_theme)]/images/login/default/login-background.jpg') !important; + background-image: url('[+login_bg+]') !important; background-size: cover !important; background-position: center !important; background-repeat: no-repeat !important; @@ -364,7 +364,7 @@ From e6fec04582dc643d2017e1713034d3292efd11ef Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Sat, 7 Apr 2018 22:23:40 +0200 Subject: [PATCH 171/274] Set loginbox position CSS class Set loginbox position CSS class from system settings --- manager/includes/accesscontrol.inc.php | 3 +++ manager/media/style/default/login.tpl | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/manager/includes/accesscontrol.inc.php b/manager/includes/accesscontrol.inc.php index 09995915b6..c793e61628 100755 --- a/manager/includes/accesscontrol.inc.php +++ b/manager/includes/accesscontrol.inc.php @@ -97,6 +97,9 @@ } else { $modx->setPlaceholder('login_bg', MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/images/login/default/login-background.jpg'); } + + // set form position css class + $modx->setPlaceholder('login_form_position_class', 'loginbox-' . $modx->config['login_form_position']); switch ($modx->config['manager_theme_mode']) { case '1': diff --git a/manager/media/style/default/login.tpl b/manager/media/style/default/login.tpl index 3da872b479..0a14486384 100755 --- a/manager/media/style/default/login.tpl +++ b/manager/media/style/default/login.tpl @@ -353,7 +353,7 @@ } - +
      From be98308397809c3119f6a249f150f72f74d0a430 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Sat, 7 Apr 2018 23:40:32 +0200 Subject: [PATCH 172/274] Login form positions --- manager/media/style/default/login.tpl | 118 +++++++++++++++++++++++++- 1 file changed, 114 insertions(+), 4 deletions(-) diff --git a/manager/media/style/default/login.tpl b/manager/media/style/default/login.tpl index 0a14486384..ee66117fa6 100755 --- a/manager/media/style/default/login.tpl +++ b/manager/media/style/default/login.tpl @@ -45,6 +45,24 @@ .page { height: 100%; } + + @media (min-width: 480px) { + .loginbox-center .page { + max-width: 25rem; + margin-top: 10vh; + margin-bottom: 10vh; + margin-left: auto; + margin-right: auto; + height: auto; + } + } + + @media (min-width: 1200px) { + .loginbox-center .page { + margin-top: 20vh; + margin-bottom: 20vh; + } + } .darkness .page { background-color: transparent; @@ -55,18 +73,28 @@ .loginbox { will-change: transform; transform: translate3d(0,0,0); - -webkit-animation-name: anim-loginbox-evore3; + -webkit-animation-name: anim-loginbox; -webkit-animation-duration: .5s; -webkit-animation-iteration-count: 1; -webkit-animation-timing-function: ease; -webkit-animation-fill-mode: forwards; - animation-name: anim-loginbox-evore3; + animation-name: anim-loginbox; animation-duration: .5s; animation-iteration-count: 1; animation-timing-function: ease; animation-fill-mode: forwards; } + .loginbox-right .loginbox { + -webkit-animation-name: anim-loginbox-right; + animation-name: anim-loginbox-right; + } + + .loginbox-center .loginbox { + -webkit-animation-name: anim-loginbox-center; + animation-name: anim-loginbox-center; + } + .loginbox { width: 100%; min-height: 100vh; @@ -76,6 +104,14 @@ .loginbox { max-width: 25rem; } + + .loginbox-right .loginbox { + margin-left: auto; + } + + .loginbox-center .loginbox { + min-height: 1px; + } } .loginbox, @@ -133,6 +169,28 @@ .copyrights { max-width: 25rem; padding-left: 2.5rem; + background-color: rgba(0,0,0,0.85); + } + + .loginbox-right .copyrights { + margin-left: auto; + } + } + + @media (min-width: 480px) and (max-width: 767px) { + .loginbox-center .copyrights { + will-change: transform; + transform: translate3d(0,0,0); + -webkit-animation-name: anim-loginbox-center; + -webkit-animation-duration: .5s; + -webkit-animation-iteration-count: 1; + -webkit-animation-timing-function: ease; + -webkit-animation-fill-mode: forwards; + animation-name: anim-loginbox-center; + animation-duration: .5s; + animation-iteration-count: 1; + animation-timing-function: ease; + animation-fill-mode: forwards; } } @@ -146,6 +204,18 @@ text-align: right; background-color: transparent; } + + .loginbox-right .copyrights { + left: 0; + right: auto; + padding-left: 1.5rem; + } + + .loginbox-center .copyrights { + right: auto; + left: 50%; + transform: translate3d(-50%,0,0); + } } .copyrights a { @@ -330,7 +400,7 @@ /* loginbox keyframes */ - @-webkit-keyframes anim-loginbox-evore3 { + @-webkit-keyframes anim-loginbox { from { opacity: 0; transform: translate3d(-10%,0,0); @@ -341,7 +411,7 @@ } } - @keyframes anim-loginbox-evore3 { + @keyframes anim-loginbox { from { opacity: 0; transform: translate3d(-10%,0,0); @@ -351,6 +421,46 @@ transform: translate3d(0,0,0); } } + + @-webkit-keyframes anim-loginbox-right { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @keyframes anim-loginbox-right { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + @-webkit-keyframes anim-loginbox-center { + from { + opacity: 0; + transform: translate3d(0,1.5rem,0); + } + to { + opacity: 1; + transform: translate3d(0,0,0); + } + } + + @keyframes anim-loginbox-center { + from { + opacity: 0; + transform: translate3d(0,1.5rem,0); + } + to { + opacity: 1; + transform: translate3d(0,0,0); + } + } From 57821c93c99e95ce9e9f119b31a391e3415d4129 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Sun, 8 Apr 2018 15:04:55 +0200 Subject: [PATCH 173/274] Remove scrollbars in centered layout --- manager/media/style/default/login.tpl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/manager/media/style/default/login.tpl b/manager/media/style/default/login.tpl index ee66117fa6..c321b84620 100755 --- a/manager/media/style/default/login.tpl +++ b/manager/media/style/default/login.tpl @@ -17,6 +17,11 @@ min-height: 100%; height: 100%; } + + body.loginbox-center { + min-height: 1px; + height: auto; + } body, body.lightness, From 4e6d543873bd063865f8f4d5dfacc0dd748afd54 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Sun, 8 Apr 2018 15:24:49 +0200 Subject: [PATCH 174/274] box-shadow --- manager/media/style/default/login.tpl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/manager/media/style/default/login.tpl b/manager/media/style/default/login.tpl index c321b84620..99a074005e 100755 --- a/manager/media/style/default/login.tpl +++ b/manager/media/style/default/login.tpl @@ -76,6 +76,9 @@ /* loginbox */ .loginbox { + width: 100%; + min-height: 100vh; + box-shadow: none; will-change: transform; transform: translate3d(0,0,0); -webkit-animation-name: anim-loginbox; @@ -100,14 +103,10 @@ animation-name: anim-loginbox-center; } - .loginbox { - width: 100%; - min-height: 100vh; - } - @media (min-width: 480px) { .loginbox { max-width: 25rem; + box-shadow: 0 0 0.5rem 0 rgba(0, 0, 0, .5); } .loginbox-right .loginbox { From aa7892eea4b61e21ce4eeafb618ac385c6aa9bb9 Mon Sep 17 00:00:00 2001 From: mnoskov Date: Wed, 11 Apr 2018 10:24:07 +0500 Subject: [PATCH 175/274] store sql fixed --- .../store/installer/instprocessor-fast.php | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/assets/modules/store/installer/instprocessor-fast.php b/assets/modules/store/installer/instprocessor-fast.php index 8a631efdde..95f1fa23fa 100755 --- a/assets/modules/store/installer/instprocessor-fast.php +++ b/assets/modules/store/installer/instprocessor-fast.php @@ -128,14 +128,14 @@ function parseProperties($propertyString) { $rs = $modx->db->query("SELECT * FROM `" . $table_prefix . "site_templates` WHERE templatename='$name'"); if ($modx->db->getRecordCount($rs)) { - if (!@ $modx->db->query("UPDATE `" . $table_prefix . "site_templates` SET content='$template', description='$desc', category=$category_id, locked='$locked' WHERE templatename='$name';")) { + if (!@ $modx->db->query("UPDATE `" . $table_prefix . "site_templates` SET content='$template', description='$desc', category='$category_id', locked='$locked' WHERE templatename='$name';")) { $errors += 1; echo "

      " . mysql_error() . "

      "; return; } echo "

        $name: " . $_lang['upgraded'] . "

      "; } else { - if (!@ $modx->db->query("INSERT INTO `" . $table_prefix . "site_templates` (templatename,description,content,category,locked) VALUES('$name','$desc','$template',$category_id,'$locked');")) { + if (!@ $modx->db->query("INSERT INTO `" . $table_prefix . "site_templates` (templatename,description,content,category,locked) VALUES('$name','$desc','$template','$category_id','$locked');")) { $errors += 1; echo "

      " . mysql_error() . "

      "; return; @@ -175,7 +175,7 @@ function parseProperties($propertyString) { if ($modx->db->getRecordCount($rs)) { $insert = true; while($row = $modx->db->getRow($rs,'assoc')) { - if (!@ $modx->db->query("UPDATE `" . $table_prefix . "site_tmplvars` SET type='$input_type', caption='$caption', description='$desc', category=$category, locked=$locked, elements='$input_options', display='$output_widget', display_params='$output_widget_params', default_text='$input_default' WHERE id={$row['id']};")) { + if (!@ $modx->db->query("UPDATE `" . $table_prefix . "site_tmplvars` SET type='$input_type', caption='$caption', description='$desc', category='$category', locked='$locked', elements='$input_options', display='$output_widget', display_params='$output_widget_params', default_text='$input_default' WHERE id='{$row['id']}';")) { echo "

      " . mysql_error() . "

      "; return; } @@ -184,7 +184,7 @@ function parseProperties($propertyString) { echo "

        $name: " . $_lang['upgraded'] . "

      "; } else { //$q = "INSERT INTO `" . $table_prefix . "site_tmplvars` (type,name,caption,description,category,locked,elements,display,display_params,default_text) VALUES('$input_type','$name','$caption','$desc',(SELECT (CASE COUNT(*) WHEN 0 THEN 0 ELSE `id` END) `id` FROM `" . $table_prefix . "categories` WHERE `category` = '$category'),$locked,'$input_options','$output_widget','$output_widget_params','$input_default');"; - $q = "INSERT INTO `" . $table_prefix . "site_tmplvars` (type,name,caption,description,category,locked,elements,display,display_params,default_text) VALUES('$input_type','$name','$caption','$desc',$category,$locked,'$input_options','$output_widget','$output_widget_params','$input_default');"; + $q = "INSERT INTO `" . $table_prefix . "site_tmplvars` (type,name,caption,description,category,locked,elements,display,display_params,default_text) VALUES('$input_type','$name','$caption','$desc','$category','$locked','$input_options','$output_widget','$output_widget_params','$input_default');"; if (!@ $modx->db->query($q)) { echo "

      " . mysql_error() . "

      "; return; @@ -212,7 +212,7 @@ function parseProperties($propertyString) { if ($ds && $ts) { $tRow = $modx->db->getRow($ts,'assoc'); $templateId = $tRow['id']; - $modx->db->query("INSERT INTO `" . $table_prefix . "site_tmplvar_templates` (tmplvarid, templateid) VALUES($id, $templateId)"); + $modx->db->query("INSERT INTO `" . $table_prefix . "site_tmplvar_templates` (tmplvarid, templateid) VALUES('$id', '$templateId')"); } } } @@ -253,7 +253,7 @@ function parseProperties($propertyString) { } $update = $count_original_name > 0 && $overwrite == 'true'; if ($update) { - if (!@ $modx->db->query("UPDATE `" . $table_prefix . "site_htmlsnippets` SET snippet='$chunk', description='$desc', category=$category_id WHERE name='$name';")) { + if (!@ $modx->db->query("UPDATE `" . $table_prefix . "site_htmlsnippets` SET snippet='$chunk', description='$desc', category='$category_id' WHERE name='$name';")) { $errors += 1; echo "

      " . mysql_error() . "

      "; return; @@ -263,7 +263,7 @@ function parseProperties($propertyString) { if($count_original_name > 0 && $overwrite == 'false') { $name = $newname; } - if (!@ $modx->db->query("INSERT INTO `" . $table_prefix . "site_htmlsnippets` (name,description,snippet,category) VALUES('$name','$desc','$chunk',$category_id);")) { + if (!@ $modx->db->query("INSERT INTO `" . $table_prefix . "site_htmlsnippets` (name,description,snippet,category) VALUES('$name','$desc','$chunk','$category_id');")) { $errors += 1; echo "

      " . mysql_error() . "

      "; return; @@ -311,7 +311,7 @@ function parseProperties($propertyString) { echo "

        $name: " . $_lang['upgraded'] . "

      "; } else { $properties = $modx->db->escape(parseProperties($properties, true)); - if (!@ $modx->db->query("INSERT INTO `" . $table_prefix . "site_modules` (name,description,modulecode,properties,guid,enable_sharedparams,category) VALUES('$name','$desc','$module','$properties','$guid','$shared', $category);")) { + if (!@ $modx->db->query("INSERT INTO `" . $table_prefix . "site_modules` (name,description,modulecode,properties,guid,enable_sharedparams,category) VALUES('$name','$desc','$module','$properties','$guid','$shared', '$category');")) { echo "

      " . mysql_error() . "

      "; return; } @@ -366,13 +366,13 @@ function parseProperties($propertyString) { while($row = $modx->db->getRow($rs,'assoc')) { $props = $modx->db->escape(propUpdate($properties,$row['properties'])); if($row['description'] == $desc){ - if (!@ $modx->db->query("UPDATE `" . $table_prefix . "site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id={$row['id']};")) { + if (!@ $modx->db->query("UPDATE `" . $table_prefix . "site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id='{$row['id']}';")) { echo "

      " . mysql_error() . "

      "; return; } $insert = false; } else { - if (!@ $modx->db->query("UPDATE `" . $table_prefix . "site_plugins` SET disabled='1' WHERE id={$row['id']};")) { + if (!@ $modx->db->query("UPDATE `" . $table_prefix . "site_plugins` SET disabled='1' WHERE id='{$row['id']}';")) { echo "

      ".mysql_error()."

      "; return; } @@ -380,7 +380,7 @@ function parseProperties($propertyString) { } if($insert === true) { $properties = $modx->db->escape(parseProperties($properties, true)); - if(!@$modx->db->query("INSERT INTO `".$table_prefix."site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$properties','$guid','0',$category);",$sqlParser->conn)) { + if(!@$modx->db->query("INSERT INTO `".$table_prefix."site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$properties','$guid','0','$category');",$sqlParser->conn)) { echo "

      ".mysql_error()."

      "; return; } @@ -388,7 +388,7 @@ function parseProperties($propertyString) { echo "

        $name: " . $_lang['upgraded'] . "

      "; } else { $properties = $modx->db->escape(parseProperties($properties, true)); - if (!@ $modx->db->query("INSERT INTO `" . $table_prefix . "site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$properties','$guid',$disabled,$category);")) { + if (!@ $modx->db->query("INSERT INTO `" . $table_prefix . "site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$properties','$guid','$disabled','$category');")) { echo "

      " . mysql_error() . "

      "; return; } @@ -449,7 +449,7 @@ function parseProperties($propertyString) { echo "

        $name: " . $_lang['upgraded'] . "

      "; } else { $properties = $modx->db->escape(parseProperties($properties, true)); - if (!$modx->db->query("INSERT INTO `" . $table_prefix . "site_snippets` (name,description,snippet,properties,category) VALUES('$name','$desc','$snippet','$properties',$category);")) { + if (!$modx->db->query("INSERT INTO `" . $table_prefix . "site_snippets` (name,description,snippet,properties,category) VALUES('$name','$desc','$snippet','$properties','$category');")) { echo "

      " . mysql_error() . "

      "; return; } From 1c7f67c1b4252ab64f2ed0b39069d5a272d2b100 Mon Sep 17 00:00:00 2001 From: Deesen Date: Wed, 11 Apr 2018 21:15:26 +0200 Subject: [PATCH 176/274] [F] #629 Fix issue with HTTP2/SSL & check connection to server --- manager/media/script/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/media/script/main.js b/manager/media/script/main.js index 1410c9e69e..fbaeac5c57 100644 --- a/manager/media/script/main.js +++ b/manager/media/script/main.js @@ -262,7 +262,7 @@ evo.collapse = function(a, b) { // check connection to server evo.checkConnectionToServer = function() { var xhr = new (window.ActiveXObject || XMLHttpRequest)('Microsoft.XMLHTTP'); - xhr.open('HEAD', evo.urlCheckConnectionToServer + '?time=' + new Date().getTime(), false); + xhr.open('GET', evo.urlCheckConnectionToServer + '?time=' + new Date().getTime(), false); try { xhr.send(); return (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304); From adc14594338f601d96b5878433f63adb524b8234 Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Thu, 12 Apr 2018 23:36:14 +0300 Subject: [PATCH 177/274] Secutiy fix for old version --- assets/modules/store/update.php | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 assets/modules/store/update.php diff --git a/assets/modules/store/update.php b/assets/modules/store/update.php new file mode 100644 index 0000000000..e70c8ba3d8 --- /dev/null +++ b/assets/modules/store/update.php @@ -0,0 +1,2 @@ + Date: Mon, 16 Apr 2018 02:15:19 +0300 Subject: [PATCH 178/274] refactor stay icons --- manager/includes/header.inc.php | 1 + manager/media/script/main.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/manager/includes/header.inc.php b/manager/includes/header.inc.php index ce215984f8..147c0f6e04 100755 --- a/manager/includes/header.inc.php +++ b/manager/includes/header.inc.php @@ -85,6 +85,7 @@ var evo = {}; } var actions; + var actionStay = []; var dontShowWorker = false; var documentDirty = false; var timerForUnload; diff --git a/manager/media/script/main.js b/manager/media/script/main.js index fbaeac5c57..46ed94d449 100644 --- a/manager/media/script/main.js +++ b/manager/media/script/main.js @@ -276,7 +276,7 @@ function document_onload() { var actionButtons = document.getElementById('actions'), actionSelect = document.getElementById('stay'); if (actionButtons !== null && actionSelect !== null) { - var actionPlus = actionButtons.querySelector('.plus'), actionSaveButton = actionButtons.querySelector('a#Button1') || actionButtons.querySelector('#Button1 > a'), actionStay = []; + var actionPlus = actionButtons.querySelector('.plus'), actionSaveButton = actionButtons.querySelector('a#Button1') || actionButtons.querySelector('#Button1 > a'); actionPlus.classList.add('dropdown-toggle'); actionStay['stay1'] = ''; actionStay['stay2'] = ''; From 8ecd06ecfedd937adbdc171afb4a743b21b6fdb1 Mon Sep 17 00:00:00 2001 From: Mr B Date: Mon, 16 Apr 2018 09:44:49 +0100 Subject: [PATCH 179/274] [I] Remove 'Top how many' option as not used --- manager/actions/mutate_settings/tab1_site_settings.inc.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/manager/actions/mutate_settings/tab1_site_settings.inc.php b/manager/actions/mutate_settings/tab1_site_settings.inc.php index cdecd16e79..b3eae06de7 100755 --- a/manager/actions/mutate_settings/tab1_site_settings.inc.php +++ b/manager/actions/mutate_settings/tab1_site_settings.inc.php @@ -293,12 +293,6 @@
      - -
      [(top_howmany)] - -
      - -
      [(login_logo)] From c26f0eaa643367f70b262e7b54b50ccc35739794 Mon Sep 17 00:00:00 2001 From: Mr B Date: Mon, 16 Apr 2018 13:08:31 +0100 Subject: [PATCH 180/274] [I] Add space to bottom of menu tree Add a little 'breathing space' --- manager/media/style/default/css/tree.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/media/style/default/css/tree.css b/manager/media/style/default/css/tree.css index f12f594441..d6c9d5e84f 100755 --- a/manager/media/style/default/css/tree.css +++ b/manager/media/style/default/css/tree.css @@ -10,7 +10,7 @@ #treeMenu .treeButton:not(.disabled):active { background-color: #d5d5d5 } #treeMenu .treeButton .fa { display: block; width: 1.2em; height: 1.2em; margin: auto; line-height: 1.3em; font-size: 1.1em; } #treeMenu .treeButton.disabled { color: #777; opacity: 0.5 } -#treeHolder { position: relative; z-index: 1; cursor: default; overflow: auto; height: 100%; max-height: calc(100% - 30px); white-space: nowrap } +#treeHolder { position: relative; z-index: 1; cursor: default; overflow: auto; height: 100%; max-height: calc(100% - 30px); white-space: nowrap; padding-bottom:10px; } #treeHolder .rootNode { position: relative; } #treeHolder .rootNode a { display: block; overflow: hidden; padding: 1em 1em 0.5em 1.25em; text-overflow: ellipsis; color: #333; cursor: pointer; -webkit-transition-duration: 0.15s; transition-duration: 0.15s; font-weight: bold } #treeHolder .rootNode a .fa { margin-right: 0.5em } From bec6c2f0939cc823f6465b1946caaa8901522d6f Mon Sep 17 00:00:00 2001 From: Deesen Date: Wed, 18 Apr 2018 10:10:50 +0200 Subject: [PATCH 181/274] [F] #643 Fix TinyMCE4 mobile-mode --- .../skins/darkness/content.mobile.min.css | 20 ++++++++++++++++++ .../skins/darkness/fonts/tinymce-mobile.woff | Bin 0 -> 4624 bytes .../skins/darkness/skin.mobile.min.css | 2 ++ .../skins/lightgray/content.mobile.min.css | 20 ++++++++++++++++++ .../skins/lightgray/fonts/tinymce-mobile.woff | Bin 0 -> 4624 bytes .../skins/lightgray/skin.mobile.min.css | 2 ++ .../tinymce/themes/mobile/theme.min.js | 8 +++++++ 7 files changed, 52 insertions(+) create mode 100644 assets/plugins/tinymce4/tinymce/skins/darkness/content.mobile.min.css create mode 100644 assets/plugins/tinymce4/tinymce/skins/darkness/fonts/tinymce-mobile.woff create mode 100644 assets/plugins/tinymce4/tinymce/skins/darkness/skin.mobile.min.css create mode 100644 assets/plugins/tinymce4/tinymce/skins/lightgray/content.mobile.min.css create mode 100644 assets/plugins/tinymce4/tinymce/skins/lightgray/fonts/tinymce-mobile.woff create mode 100644 assets/plugins/tinymce4/tinymce/skins/lightgray/skin.mobile.min.css create mode 100644 assets/plugins/tinymce4/tinymce/themes/mobile/theme.min.js diff --git a/assets/plugins/tinymce4/tinymce/skins/darkness/content.mobile.min.css b/assets/plugins/tinymce4/tinymce/skins/darkness/content.mobile.min.css new file mode 100644 index 0000000000..e2fbaffa4c --- /dev/null +++ b/assets/plugins/tinymce4/tinymce/skins/darkness/content.mobile.min.css @@ -0,0 +1,20 @@ +.tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection { + position: absolute; + display: inline-block; + /* Note: this file is used inside the content, so isn't part of theming */ + background-color: green; + opacity: 0.5; +} + +body { + -webkit-text-size-adjust: none; +} + +body img { + /* this is related to the content margin */ + max-width: 96vw; +} + +body table img { + max-width: 95%; +} \ No newline at end of file diff --git a/assets/plugins/tinymce4/tinymce/skins/darkness/fonts/tinymce-mobile.woff b/assets/plugins/tinymce4/tinymce/skins/darkness/fonts/tinymce-mobile.woff new file mode 100644 index 0000000000000000000000000000000000000000..1e3be038a607cb7c2544ed8ae3d6621f77bf4c38 GIT binary patch literal 4624 zcmb7IeQaFC5#QN&AGUL{efE7g{=BM1W-|RaVdWQe^e?BC`eGz4^i8S3PQw?Hhd_eQHxTkckXZB zdzU((wCVGko!Qyh+1c6InRotvZ%+>+hNrBQtrFOI4t*}DZ$7=>Sr=uD3c$ZlKuKBQ z8~ervCczs9SOk2!>AAqrz+v$CC}f1JfYPDSqx->|V$6{ekbe8M#Bh3Gkg?)-Fdi3B zeB$}UFqn*$pv&q7*net~hsUOlfG7Ho2zaowY%JPRytMvu{&xRPm(h_~w##F>vqE&a5-ssH##mlfAk}44^ zXRJKd!Ifw&ce{$Y9BAg5c>e>p_Z;t!=P{izddGWie?aHLdKL3Cn9rG=d2vt;esWqH zoD}uAoi3Z~4+LABvADt+so4~t%VlyIJ{O3tm$NC+(!yenQD%NVr*btG$T3+_WX=LH z#1M2ZNEtrO+-x;l2i>M^5o%GQ@s?N+gw*19H@G~vl3Q5Zf*t6jjW0GOTmAmlWYgSS zJeiEo%~LA-FW|YAd_Em$OE#@dw)y*#@p!UtnWa);V1HY3ZBw!>(3gY{iFFa_c6iW9 zIQ@xck^{xu9_o;UyQH#ba@y?L$xW?8J35?$p1z46ZjIctZ8QCKCa29bMC1-t@pT>S zTUT1WMjQz-75d)5zJxv~@Yd)bY)ejQBx_XQiaMJ z>$5`NO3?L*ND{UQeF8%xl)$_>w9tmQpfEebzedaz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s>LLYQcC#*~B78EfTt7RQ*l)b{v zqntLNsC`h&zZCY{x*}gfPU4at;nfileU3>zeyLdO7;;lFIft~ zsm6#wb5Jjtv;_VxleU0<%cQON-O*ywHt`@C4fn-Y83}=|hJPOpN>1H%C#7)9etg_yG)$.tinymce-mobile-android-selection-context-toolbar{margin-top:23px}.tinymce-mobile-toolstrip{background:#eceff1;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;z-index:1;-webkit-box-flex:0;-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:100%;height:2.5em;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;color:#455a64}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:first-of-type,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:last-of-type{background:#4682B4;color:#eceff1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:100%;-webkit-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group>div{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:100%;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-exit-container{background:#f44336}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-toolbar-scrollable-group{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item{padding-left:.5em;padding-right:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;margin-left:2px;margin-right:2px;height:80%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button.tinymce-mobile-toolbar-button-selected{background:#455a64;color:#b1bec6}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:100%;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;padding-top:.4em;padding-bottom:.4em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;overflow:hidden;position:relative;width:100%;min-height:1.5em;padding-left:0;padding-right:0}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain{-webkit-transition:left cubic-bezier(.4, 0, 1, 1) .15s;transition:left cubic-bezier(.4, 0, 1, 1) .15s;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:100%;height:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen{-webkit-box-flex:0;-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen input{font-family:Sans-serif}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;position:relative}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container .tinymce-mobile-input-container-x{position:absolute;right:0;color:#888;font-size:.6em;font-weight:bold;background:inherit;-webkit-border-radius:50%;border-radius:50%;border:none;-webkit-align-self:center;-ms-flex-item-align:center;-ms-grid-row-align:center;align-self:center;height:100%;padding-right:2px}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container.tinymce-mobile-input-container-empty .tinymce-mobile-input-container-x{display:none}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous:before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next:before{padding-left:.5em;padding-right:.5em;height:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;font-weight:bold}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous.tinymce-mobile-toolbar-navigation-disabled:before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next.tinymce-mobile-toolbar-navigation-disabled:before{visibility:hidden}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item{margin:0 2px;font-size:10px;line-height:10px;padding-top:3px;color:#b1bec6}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item.tinymce-mobile-dot-active{color:#455a64}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;position:relative;padding:.28em 0;margin-left:10%;margin-right:10%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-font:before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-heading:before{margin-right:.9em;margin-left:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-font:before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-heading:before{margin-left:.9em;margin-right:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider{margin-left:0;margin-right:0}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;height:100%;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container .tinymce-mobile-slider-size-line{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;margin-top:.3em;margin-bottom:.3em;background:#b1bec6;height:.2em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container{padding-left:2em;padding-right:2em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;height:100%;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container .tinymce-mobile-slider-gradient{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;margin-top:.3em;margin-bottom:.3em;background:-webkit-gradient(linear, left top, right top, color-stop(0, #f00), color-stop(17%, #ff0), color-stop(33%, #0f0), color-stop(50%, #0ff), color-stop(67%, #00f), color-stop(83%, #f0f), to(#f00));background:-webkit-linear-gradient(left, #f00 0, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);background:linear-gradient(to right, #f00 0, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);height:.2em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-black{background:black;width:1.2em;height:.2em;margin-top:.3em;margin-bottom:.3em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-white{background:white;width:1.2em;height:.2em;margin-top:.3em;margin-bottom:.3em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb{position:absolute;height:.5em;width:.5em;left:-10px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;margin:auto;top:0;bottom:0;-webkit-transition:border 120ms cubic-bezier(.39, .58, .57, 1);transition:border 120ms cubic-bezier(.39, .58, .57, 1);background-color:#455a64;background-clip:padding-box;color:#eceff1;border:.5em solid rgba(136,136,136,0);-webkit-border-radius:3em;border-radius:3em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb.tinymce-mobile-thumb-active{border:.5em solid rgba(136,136,136,0.39)}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group>div{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:100%;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item:not(.tinymce-mobile-serialised-dialog){height:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-container{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input{padding-top:.1em;padding-bottom:.1em;padding-left:5px;font-size:.85em;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;background:#fff;border:none;-webkit-border-radius:0;border-radius:0;color:#455a64}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::-webkit-input-placeholder{color:#888}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input:-ms-input-placeholder{color:#888}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::placeholder{color:#888}.tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height:200px}@media only screen and (orientation: landscape){.tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height:200px}}@media only screen and (min-device-width : 320px) and (max-device-width : 568px) and (orientation : landscape){.tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height:150px}}.tinymce-mobile-dropup{background:white;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:100%;overflow:hidden}.tinymce-mobile-dropup.tinymce-mobile-dropup-shrinking{-webkit-transition:height .3s ease-out;transition:height .3s ease-out}.tinymce-mobile-dropup.tinymce-mobile-dropup-growing{-webkit-transition:height .3s ease-in;transition:height .3s ease-in}.tinymce-mobile-dropup.tinymce-mobile-dropup-closed{-webkit-box-flex:0;-webkit-flex-grow:0;-ms-flex-positive:0;flex-grow:0}.tinymce-mobile-dropup.tinymce-mobile-dropup-open:not(.tinymce-mobile-dropup-growing){-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1}.tinymce-mobile-styles-menu{overflow:hidden;outline:4px solid black;position:relative;width:100%;font-family:sans-serif}.tinymce-mobile-styles-menu [role="menu"]{height:100%;position:absolute;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;width:100%}.tinymce-mobile-styles-menu [role="menu"].transitioning{-webkit-transition:-webkit-transform .5s ease-in-out;transition:-webkit-transform .5s ease-in-out;transition:transform .5s ease-in-out;transition:transform .5s ease-in-out, -webkit-transform .5s ease-in-out}.tinymce-mobile-styles-menu .tinymce-mobile-styles-item{cursor:pointer;padding:1em 1em;position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;border-bottom:1px solid #ddd;color:#455a64}.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser .tinymce-mobile-styles-collapse-icon:before{font-family:'tinymce-mobile';content:"\e314";color:#455a64}.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-styles-item-is-menu:after{font-family:'tinymce-mobile';content:"\e315";position:absolute;padding-left:1em;padding-right:1em;right:0;color:#455a64}.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-format-matches:after{font-family:'tinymce-mobile';position:absolute;padding-left:1em;padding-right:1em;right:0}.tinymce-mobile-styles-menu .tinymce-mobile-styles-separator,.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser{border-top:#455a64;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;min-height:2.5em;padding-left:1em;padding-right:1em;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;background:#eceff1;color:#455a64}.tinymce-mobile-styles-menu [data-transitioning-destination="before"][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state="before"]{-webkit-transform:translate(-100%);transform:translate(-100%)}.tinymce-mobile-styles-menu [data-transitioning-destination="current"][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state="current"]{-webkit-transform:translate(0);transform:translate(0)}.tinymce-mobile-styles-menu [data-transitioning-destination="after"][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state="after"]{-webkit-transform:translate(100%);transform:translate(100%)}@font-face{font-family:'tinymce-mobile';src:url('fonts/tinymce-mobile.woff?8x92w3') format('woff');font-weight:normal;font-style:normal}@media (min-device-width:700px){.tinymce-mobile-outer-container,.tinymce-mobile-outer-container input{font-size:25px}}@media (max-device-width:700px){.tinymce-mobile-outer-container,.tinymce-mobile-outer-container input{font-size:18px}}.tinymce-mobile-icon{font-family:'tinymce-mobile'}.mixin-flex-and-centre{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}.mixin-flex-bar{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:100%}.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket{overflow:hidden;height:300px}.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-toolstrip{display:none}.tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{position:fixed;right:2em;bottom:1em;color:white;background-color:#4682B4;-webkit-border-radius:50%;border-radius:50%;width:2.1em;height:2.1em;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;font-size:1em}@media only screen and (min-device-width:700px){.tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{font-size:1.2em}}input[type="file"]::-webkit-file-upload-button{display:none}@media only screen and (min-device-width : 320px) and (max-device-width : 568px) and (orientation : landscape){.tinymce-mobile-ios-container .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{bottom:50%}} +/*# sourceMappingURL=skin.mobile.css.map */ \ No newline at end of file diff --git a/assets/plugins/tinymce4/tinymce/skins/lightgray/content.mobile.min.css b/assets/plugins/tinymce4/tinymce/skins/lightgray/content.mobile.min.css new file mode 100644 index 0000000000..e2fbaffa4c --- /dev/null +++ b/assets/plugins/tinymce4/tinymce/skins/lightgray/content.mobile.min.css @@ -0,0 +1,20 @@ +.tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection { + position: absolute; + display: inline-block; + /* Note: this file is used inside the content, so isn't part of theming */ + background-color: green; + opacity: 0.5; +} + +body { + -webkit-text-size-adjust: none; +} + +body img { + /* this is related to the content margin */ + max-width: 96vw; +} + +body table img { + max-width: 95%; +} \ No newline at end of file diff --git a/assets/plugins/tinymce4/tinymce/skins/lightgray/fonts/tinymce-mobile.woff b/assets/plugins/tinymce4/tinymce/skins/lightgray/fonts/tinymce-mobile.woff new file mode 100644 index 0000000000000000000000000000000000000000..1e3be038a607cb7c2544ed8ae3d6621f77bf4c38 GIT binary patch literal 4624 zcmb7IeQaFC5#QN&AGUL{efE7g{=BM1W-|RaVdWQe^e?BC`eGz4^i8S3PQw?Hhd_eQHxTkckXZB zdzU((wCVGko!Qyh+1c6InRotvZ%+>+hNrBQtrFOI4t*}DZ$7=>Sr=uD3c$ZlKuKBQ z8~ervCczs9SOk2!>AAqrz+v$CC}f1JfYPDSqx->|V$6{ekbe8M#Bh3Gkg?)-Fdi3B zeB$}UFqn*$pv&q7*net~hsUOlfG7Ho2zaowY%JPRytMvu{&xRPm(h_~w##F>vqE&a5-ssH##mlfAk}44^ zXRJKd!Ifw&ce{$Y9BAg5c>e>p_Z;t!=P{izddGWie?aHLdKL3Cn9rG=d2vt;esWqH zoD}uAoi3Z~4+LABvADt+so4~t%VlyIJ{O3tm$NC+(!yenQD%NVr*btG$T3+_WX=LH z#1M2ZNEtrO+-x;l2i>M^5o%GQ@s?N+gw*19H@G~vl3Q5Zf*t6jjW0GOTmAmlWYgSS zJeiEo%~LA-FW|YAd_Em$OE#@dw)y*#@p!UtnWa);V1HY3ZBw!>(3gY{iFFa_c6iW9 zIQ@xck^{xu9_o;UyQH#ba@y?L$xW?8J35?$p1z46ZjIctZ8QCKCa29bMC1-t@pT>S zTUT1WMjQz-75d)5zJxv~@Yd)bY)ejQBx_XQiaMJ z>$5`NO3?L*ND{UQeF8%xl)$_>w9tmQpfEebzedazFeh#~d}suN+vzsqLiW~@TLhoe zk1%xEcxP2ZL)FuoXeYzb-J5goljDxPL2@@#RW)d&X#&6QO5U=04_628@ONSvtgpha zDqqmoVep`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%cQON-O*ywHt`@C4fn-Y83}=|hJPOpN>1H%C#7)9etg_yG)$.tinymce-mobile-android-selection-context-toolbar{margin-top:23px}.tinymce-mobile-toolstrip{background:#eceff1;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;z-index:1;-webkit-box-flex:0;-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:100%;height:2.5em;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;color:#455a64}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:first-of-type,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:last-of-type{background:#4682B4;color:#eceff1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:100%;-webkit-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group>div{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:100%;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-exit-container{background:#f44336}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-toolbar-scrollable-group{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item{padding-left:.5em;padding-right:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;margin-left:2px;margin-right:2px;height:80%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button.tinymce-mobile-toolbar-button-selected{background:#455a64;color:#b1bec6}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:100%;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;padding-top:.4em;padding-bottom:.4em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;overflow:hidden;position:relative;width:100%;min-height:1.5em;padding-left:0;padding-right:0}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain{-webkit-transition:left cubic-bezier(.4, 0, 1, 1) .15s;transition:left cubic-bezier(.4, 0, 1, 1) .15s;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:100%;height:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen{-webkit-box-flex:0;-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen input{font-family:Sans-serif}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;position:relative}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container .tinymce-mobile-input-container-x{position:absolute;right:0;color:#888;font-size:.6em;font-weight:bold;background:inherit;-webkit-border-radius:50%;border-radius:50%;border:none;-webkit-align-self:center;-ms-flex-item-align:center;-ms-grid-row-align:center;align-self:center;height:100%;padding-right:2px}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container.tinymce-mobile-input-container-empty .tinymce-mobile-input-container-x{display:none}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous:before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next:before{padding-left:.5em;padding-right:.5em;height:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;font-weight:bold}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous.tinymce-mobile-toolbar-navigation-disabled:before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next.tinymce-mobile-toolbar-navigation-disabled:before{visibility:hidden}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item{margin:0 2px;font-size:10px;line-height:10px;padding-top:3px;color:#b1bec6}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item.tinymce-mobile-dot-active{color:#455a64}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;position:relative;padding:.28em 0;margin-left:10%;margin-right:10%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-font:before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-heading:before{margin-right:.9em;margin-left:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-font:before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-heading:before{margin-left:.9em;margin-right:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider{margin-left:0;margin-right:0}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;height:100%;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container .tinymce-mobile-slider-size-line{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;margin-top:.3em;margin-bottom:.3em;background:#b1bec6;height:.2em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container{padding-left:2em;padding-right:2em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;height:100%;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container .tinymce-mobile-slider-gradient{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;margin-top:.3em;margin-bottom:.3em;background:-webkit-gradient(linear, left top, right top, color-stop(0, #f00), color-stop(17%, #ff0), color-stop(33%, #0f0), color-stop(50%, #0ff), color-stop(67%, #00f), color-stop(83%, #f0f), to(#f00));background:-webkit-linear-gradient(left, #f00 0, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);background:linear-gradient(to right, #f00 0, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);height:.2em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-black{background:black;width:1.2em;height:.2em;margin-top:.3em;margin-bottom:.3em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-white{background:white;width:1.2em;height:.2em;margin-top:.3em;margin-bottom:.3em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb{position:absolute;height:.5em;width:.5em;left:-10px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;margin:auto;top:0;bottom:0;-webkit-transition:border 120ms cubic-bezier(.39, .58, .57, 1);transition:border 120ms cubic-bezier(.39, .58, .57, 1);background-color:#455a64;background-clip:padding-box;color:#eceff1;border:.5em solid rgba(136,136,136,0);-webkit-border-radius:3em;border-radius:3em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb.tinymce-mobile-thumb-active{border:.5em solid rgba(136,136,136,0.39)}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group>div{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:100%;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item:not(.tinymce-mobile-serialised-dialog){height:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-container{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input{padding-top:.1em;padding-bottom:.1em;padding-left:5px;font-size:.85em;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;background:#fff;border:none;-webkit-border-radius:0;border-radius:0;color:#455a64}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::-webkit-input-placeholder{color:#888}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input:-ms-input-placeholder{color:#888}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::placeholder{color:#888}.tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height:200px}@media only screen and (orientation: landscape){.tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height:200px}}@media only screen and (min-device-width : 320px) and (max-device-width : 568px) and (orientation : landscape){.tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height:150px}}.tinymce-mobile-dropup{background:white;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:100%;overflow:hidden}.tinymce-mobile-dropup.tinymce-mobile-dropup-shrinking{-webkit-transition:height .3s ease-out;transition:height .3s ease-out}.tinymce-mobile-dropup.tinymce-mobile-dropup-growing{-webkit-transition:height .3s ease-in;transition:height .3s ease-in}.tinymce-mobile-dropup.tinymce-mobile-dropup-closed{-webkit-box-flex:0;-webkit-flex-grow:0;-ms-flex-positive:0;flex-grow:0}.tinymce-mobile-dropup.tinymce-mobile-dropup-open:not(.tinymce-mobile-dropup-growing){-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1}.tinymce-mobile-styles-menu{overflow:hidden;outline:4px solid black;position:relative;width:100%;font-family:sans-serif}.tinymce-mobile-styles-menu [role="menu"]{height:100%;position:absolute;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;width:100%}.tinymce-mobile-styles-menu [role="menu"].transitioning{-webkit-transition:-webkit-transform .5s ease-in-out;transition:-webkit-transform .5s ease-in-out;transition:transform .5s ease-in-out;transition:transform .5s ease-in-out, -webkit-transform .5s ease-in-out}.tinymce-mobile-styles-menu .tinymce-mobile-styles-item{cursor:pointer;padding:1em 1em;position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;border-bottom:1px solid #ddd;color:#455a64}.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser .tinymce-mobile-styles-collapse-icon:before{font-family:'tinymce-mobile';content:"\e314";color:#455a64}.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-styles-item-is-menu:after{font-family:'tinymce-mobile';content:"\e315";position:absolute;padding-left:1em;padding-right:1em;right:0;color:#455a64}.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-format-matches:after{font-family:'tinymce-mobile';position:absolute;padding-left:1em;padding-right:1em;right:0}.tinymce-mobile-styles-menu .tinymce-mobile-styles-separator,.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser{border-top:#455a64;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;min-height:2.5em;padding-left:1em;padding-right:1em;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;background:#eceff1;color:#455a64}.tinymce-mobile-styles-menu [data-transitioning-destination="before"][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state="before"]{-webkit-transform:translate(-100%);transform:translate(-100%)}.tinymce-mobile-styles-menu [data-transitioning-destination="current"][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state="current"]{-webkit-transform:translate(0);transform:translate(0)}.tinymce-mobile-styles-menu [data-transitioning-destination="after"][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state="after"]{-webkit-transform:translate(100%);transform:translate(100%)}@font-face{font-family:'tinymce-mobile';src:url('fonts/tinymce-mobile.woff?8x92w3') format('woff');font-weight:normal;font-style:normal}@media (min-device-width:700px){.tinymce-mobile-outer-container,.tinymce-mobile-outer-container input{font-size:25px}}@media (max-device-width:700px){.tinymce-mobile-outer-container,.tinymce-mobile-outer-container input{font-size:18px}}.tinymce-mobile-icon{font-family:'tinymce-mobile'}.mixin-flex-and-centre{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}.mixin-flex-bar{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:100%}.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket{overflow:hidden;height:300px}.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-toolstrip{display:none}.tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{position:fixed;right:2em;bottom:1em;color:white;background-color:#4682B4;-webkit-border-radius:50%;border-radius:50%;width:2.1em;height:2.1em;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;font-size:1em}@media only screen and (min-device-width:700px){.tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{font-size:1.2em}}input[type="file"]::-webkit-file-upload-button{display:none}@media only screen and (min-device-width : 320px) and (max-device-width : 568px) and (orientation : landscape){.tinymce-mobile-ios-container .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{bottom:50%}} +/*# sourceMappingURL=skin.mobile.css.map */ \ No newline at end of file diff --git a/assets/plugins/tinymce4/tinymce/themes/mobile/theme.min.js b/assets/plugins/tinymce4/tinymce/themes/mobile/theme.min.js new file mode 100644 index 0000000000..e1fe175fe0 --- /dev/null +++ b/assets/plugins/tinymce4/tinymce/themes/mobile/theme.min.js @@ -0,0 +1,8 @@ +!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i-1},h=function(a,b){return t(a,b).isSome()},i=function(a,b){for(var c=[],d=0;d=0;c--){var d=a[c];b(d,c,a)}},n=function(a,b){for(var c=[],d=[],e=0,f=a.length;e1)throw d.error("HTML does not have a single root node",a),"HTML must have a single root node";return i(f.childNodes[0])},g=function(a,b){var c=b||e,d=c.createElement(a);return i(d)},h=function(a,b){var c=b||e,d=c.createTextNode(a);return i(d)},i=function(b){if(null===b||void 0===b)throw new c("Node cannot be null or undefined");return{dom:a.constant(b)}},j=function(a,c,d){return b.from(a.dom().elementFromPoint(c,d)).map(i)};return{fromHtml:f,fromTag:g,fromText:h,fromDom:i,fromPoint:j}}),g("1d",[],function(){return{ATTRIBUTE:2,CDATA_SECTION:4,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,ELEMENT:1,TEXT:3,PROCESSING_INSTRUCTION:7,ENTITY_REFERENCE:5,ENTITY:6,NOTATION:12}}),g("2r",["y","z","a","1d","v","1b"],function(a,b,c,d,e,f){var g=d.ELEMENT,h=d.DOCUMENT,i=function(a,b){var c=a.dom();if(c.nodeType!==g)return!1;if(void 0!==c.matches)return c.matches(b);if(void 0!==c.msMatchesSelector)return c.msMatchesSelector(b);if(void 0!==c.webkitMatchesSelector)return c.webkitMatchesSelector(b);if(void 0!==c.mozMatchesSelector)return c.mozMatchesSelector(b);throw new e("Browser lacks native selectors")},j=function(a){return a.nodeType!==g&&a.nodeType!==h||0===a.childElementCount},k=function(b,d){var e=void 0===d?f:d.dom();return j(e)?[]:a.map(e.querySelectorAll(b),c.fromDom)},l=function(a,d){var e=void 0===d?f:d.dom();return j(e)?b.none():b.from(e.querySelector(a)).map(c.fromDom)};return{all:k,is:i,one:l}}),g("1a",["y","6","2q","7","2r"],function(a,b,c,d,e){var f=function(a,b){return a.dom()===b.dom()},g=function(a,b){return a.dom().isEqualNode(b.dom())},h=function(c,d){return a.exists(d,b.curry(f,c))},i=function(a,b){var c=a.dom(),d=b.dom();return c!==d&&c.contains(d)},j=function(a,b){return c.documentPositionContainedBy(a.dom(),b.dom())},k=d.detect().browser,l=k.isIE()?j:i;return{eq:f,isEqualNode:g,member:h,contains:l,is:e.is}}),g("43",["1a"],function(a){var b=function(b,c){return a.eq(b.element(),c.event().target())};return{isSource:b}}),g("2g",["6"],function(a){return{contextmenu:a.constant("contextmenu"),touchstart:a.constant("touchstart"),touchmove:a.constant("touchmove"),touchend:a.constant("touchend"),gesturestart:a.constant("gesturestart"),mousedown:a.constant("mousedown"),mousemove:a.constant("mousemove"),mouseout:a.constant("mouseout"),mouseup:a.constant("mouseup"),mouseover:a.constant("mouseover"),focusin:a.constant("focusin"),keydown:a.constant("keydown"),input:a.constant("input"),change:a.constant("change"),focus:a.constant("focus"),click:a.constant("click"),transitionend:a.constant("transitionend"),selectstart:a.constant("selectstart")}}),g("t",["2g","6","7"],function(a,b,c){var d={tap:b.constant("alloy.tap")};return{focus:b.constant("alloy.focus"),postBlur:b.constant("alloy.blur.post"),receive:b.constant("alloy.receive"),execute:b.constant("alloy.execute"),focusItem:b.constant("alloy.focus.item"),tap:d.tap,tapOrClick:c.detect().deviceType.isTouch()?d.tap:a.click,longpress:b.constant("alloy.longpress"),sandboxClose:b.constant("alloy.sandbox.close"),systemInit:b.constant("alloy.system.init"),windowScroll:b.constant("alloy.system.scroll"),attachedToDom:b.constant("alloy.system.attached"),detachedFromDom:b.constant("alloy.system.detached"),changeTab:b.constant("alloy.change.tab"),dismissTab:b.constant("alloy.dismiss.tab")}}),g("1i",["u","2m"],function(a,b){var c=function(c){if(null===c)return"null";var d=typeof c;return"object"===d&&a.prototype.isPrototypeOf(c)?"array":"object"===d&&b.prototype.isPrototypeOf(c)?"string":d},d=function(a){return function(b){return c(b)===a}};return{isString:d("string"),isObject:d("object"),isArray:d("array"),isNull:d("null"),isBoolean:d("boolean"),isUndefined:d("undefined"),isFunction:d("function"),isNumber:d("number")}}),g("w",["1i","u","v"],function(a,b,c){var d=function(a,b){return b},e=function(b,c){var d=a.isObject(b)&&a.isObject(c);return d?g(b,c):c},f=function(a){return function(){for(var d=new b(arguments.length),e=0;e0?g(c.errors):f(c.values,b)},i=function(a){var b=e.partition(a);return b.errors.length>0?g(b.errors):d.value(b.values)};return{consolidateObj:h,consolidateArr:i}}),g("2b",["y","x"],function(a,b){var c=function(b,c){var d={};return a.each(c,function(a){void 0!==b[a]&&b.hasOwnProperty(a)&&(d[a]=b[a])}),d},d=function(b,c){var d={};return a.each(b,function(a){var b=a[c];d[b]=a}),d},e=function(c,d){var e={};return b.each(c,function(b,c){a.contains(d,c)||(e[c]=b)}),e};return{narrow:c,exclude:e,indexOnKey:d}}),g("2c",["z"],function(a){var b=function(b){return function(c){return c.hasOwnProperty(b)?a.from(c[b]):a.none()}},c=function(a,c){return function(d){return b(a)(d).getOr(c)}},d=function(a,c){return b(c)(a)},e=function(a,b){return a.hasOwnProperty(b)&&void 0!==a[b]&&null!==a[b]};return{readOpt:b,readOr:c,readOptFrom:d,hasKey:e}}),g("2d",["y"],function(a){var b=function(a,b){var c={};return c[a]=b,c},c=function(b){var c={};return a.each(b,function(a){c[a.key]=a.value}),c};return{wrap:b,wrapAll:c}}),g("14",["2a","2b","2c","2d"],function(a,b,c,d){var e=function(a,c){return b.narrow(a,c)},f=function(a,c){return b.exclude(a,c)},g=function(a){return c.readOpt(a)},h=function(a,b){return c.readOr(a,b)},i=function(a,b){return c.readOptFrom(a,b)},j=function(a,b){return d.wrap(a,b)},k=function(a){return d.wrapAll(a)},l=function(a,c){return b.indexOnKey(a,c)},m=function(b,c){return a.consolidateObj(b,c)},n=function(a,b){return c.hasKey(a,b)};return{narrow:e,exclude:f,readOpt:g,readOr:h,readOptFrom:i,wrap:j,wrapAll:k,indexOnKey:l,hasKey:n,consolidate:m}}),g("6n",["4m"],function(a){var b=function(){return a.getOrDie("JSON")},c=function(a){return b().parse(a)},d=function(a,c,d){return b().stringify(a,c,d)};return{parse:c,stringify:d}}),g("4f",["y","x","1i","6n"],function(a,b,c,d){var e=function(a){return c.isObject(a)&&b.keys(a).length>100?" removed due to size":d.stringify(a,null,2)},f=function(b){var c=b.length>10?b.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):b;return a.map(c,function(a){return"Failed path: ("+a.path.join(" > ")+")\n"+a.getErrorInfo()})};return{formatObj:e,formatErrors:f}}),g("6l",["4f","48"],function(a,b){var c=function(a,c){return b.error([{path:a,getErrorInfo:c}])},d=function(b,d,e){return c(b,function(){return'Could not find valid *strict* value for "'+d+'" in '+a.formatObj(e)})},e=function(a,b){return c(a,function(){return'Choice schema did not contain choice key: "'+b+'"'})},f=function(b,d,e){return c(b,function(){return'The chosen schema: "'+e+'" did not exist in branches: '+a.formatObj(d)})},g=function(a,b){return c(a,function(){return"There are unsupported fields: ["+b.join(", ")+"] specified"})},h=function(a,b){return c(a,function(){return b})},i=function(a){return"Failed path: ("+a.path.join(" > ")+")\n"+a.getErrorInfo()};return{missingStrict:d,missingKey:e,missingBranch:f,unsupportedFields:g,custom:h,toString:i}}),g("6m",["6k"],function(a){var b=a.generate([{setOf:["validator","valueType"]},{arrOf:["valueType"]},{objOf:["fields"]},{itemOf:["validator"]},{choiceOf:["key","branches"]}]),c=a.generate([{field:["name","presence","type"]},{state:["name"]}]);return{typeAdt:b,fieldAdt:c}}),g("4d",["4c","14","2a","2c","2d","6l","6m","6k","y","6","w","x","z","48","1i"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){var p=h.generate([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),q=function(a,b){return p.state(a,j.constant(b))},r=function(a){return p.state(a,j.identity)},s=function(a,b,c){return d.readOptFrom(b,c).fold(function(){return f.missingStrict(a,c,b)},n.value)},t=function(a,b,c){var e=d.readOptFrom(a,b).fold(function(){return c(a)},j.identity);return n.value(e)},u=function(a,b){return n.value(d.readOptFrom(a,b))},v=function(a,b,c){var e=d.readOptFrom(a,b).map(function(b){return b===!0?c(a):b});return n.value(e)},w=function(a,b,c,d){return c.fold(function(c,f,g,h){var i=function(b){return h.extract(a.concat([c]),d,b).map(function(a){return e.wrap(f,d(a))})},l=function(b){return b.fold(function(){var a=e.wrap(f,d(m.none()));return n.value(a)},function(b){return h.extract(a.concat([c]),d,b).map(function(a){return e.wrap(f,d(m.some(a)))})})};return function(){return g.fold(function(){return s(a,b,c).bind(i)},function(a){return t(b,c,a).bind(i)},function(){return u(b,c).bind(l)},function(a){return v(b,c,a).bind(l)},function(a){var d=a(b);return t(b,c,j.constant({})).map(function(a){return k.deepMerge(d,a)}).bind(i)})}()},function(a,c){var f=c(b);return n.value(e.wrap(a,d(f)))})},x=function(a,b,d,e){var f=i.map(d,function(c){return w(a,b,c,e)});return c.consolidateObj(f,{})},y=function(a){var b=function(b,c,d){return a(d).fold(function(a){return f.custom(b,a)},n.value)},c=function(){return"val"},d=function(){return g.typeAdt.itemOf(a)};return{extract:b,toString:c,toDsl:d}},z=function(a){var c=l.keys(a);return i.filter(c,function(c){return b.hasKey(a,c)})},A=function(a){var c=B(a),d=i.foldr(a,function(a,c){return c.fold(function(c){return k.deepMerge(a,b.wrap(c,!0))},j.constant(a))},{}),e=function(a,e,g){var h=o.isBoolean(g)?[]:z(g),j=i.filter(h,function(a){return!b.hasKey(d,a)});return 0===j.length?c.extract(a,e,g):f.unsupportedFields(a,j)};return{extract:e,toString:c.toString,toDsl:c.toDsl}},B=function(a){var b=function(b,c,d){return x(b,d,a,c)},c=function(){var b=i.map(a,function(a){return a.fold(function(a,b,c,d){return a+" -> "+d.toString()},function(a,b){return"state("+a+")"})});return"obj{\n"+b.join("\n")+"}"},d=function(){return g.typeAdt.objOf(i.map(a,function(a){return a.fold(function(a,b,c,d){return g.fieldAdt.field(a,c,d)},function(a,b){return g.fieldAdt.state(a)})}))};return{extract:b,toString:c,toDsl:d}},C=function(a){var b=function(b,d,e){var f=i.map(e,function(c,e){return a.extract(b.concat(["["+e+"]"]),d,c)});return c.consolidateArr(f)},d=function(){return"array("+a.toString()+")"},e=function(){return g.typeAdt.arrOf(a)};return{extract:b,toString:d,toDsl:e}},D=function(b,c){var d=function(a,c){return C(y(b)).extract(a,j.identity,c)},e=function(b,e,f){var g=l.keys(f);return d(b,g).bind(function(d){var g=i.map(d,function(b){return p.field(b,b,a.strict(),c)});return B(g).extract(b,e,f)})},f=function(){return"setOf("+c.toString()+")"},h=function(){return g.typeAdt.setOf(b,c)};return{extract:e,toString:f,toDsl:h}},E=y(n.value),F=j.compose(C,B);return{anyValue:j.constant(E),value:y,obj:B,objOnly:A,arr:C,setOf:D,arrOfObj:F,state:p.state,field:p.field,output:q,snapshot:r}}),g("29",["4c","4d","48","1i"],function(a,b,c,d){var e=function(c){return b.field(c,c,a.strict(),b.anyValue())},f=function(c,d){return b.field(c,c,a.strict(),d)},g=function(e){return b.field(e,e,a.strict(),b.value(function(a){return d.isFunction(a)?c.value(a):c.error("Not a function")}))},h=function(d,e){return b.field(d,d,a.asOption(),b.value(function(a){return c.error("The field: "+d+" is forbidden. "+e)}))},i=function(a,b){return f(a,b)},j=function(c,d){return b.field(c,c,a.strict(),b.obj(d))},k=function(c,d){return b.field(c,c,a.strict(),b.arrOfObj(d))},l=function(c){return b.field(c,c,a.asOption(),b.anyValue())},m=function(c,d){return b.field(c,c,a.asOption(),d)},n=function(c,d){return b.field(c,c,a.asOption(),b.obj(d))},o=function(c,d){return b.field(c,c,a.asOption(),b.objOnly(d))},p=function(c,d){return b.field(c,c,a.defaulted(d),b.anyValue())},q=function(c,d,e){return b.field(c,c,a.defaulted(d),e)},r=function(c,d,e){return b.field(c,c,a.defaulted(d),b.obj(e))},s=function(a,c,d,e){return b.field(a,c,d,e)},t=function(a,c){return b.state(a,c)};return{strict:e,strictOf:f,strictObjOf:j,strictArrayOf:i,strictArrayOfObj:k,strictFunction:g,forbid:h,option:l,optionOf:m,optionObjOf:n,optionObjOfOnly:o,defaulted:p,defaultedOf:q,defaultedObjOf:r,field:s,state:t}}),g("4e",["14","6l","4d","6m","x"],function(a,b,c,d,e){var f=function(d,e,f,g,h){var i=a.readOptFrom(g,h);return i.fold(function(){return b.missingBranch(d,g,h)},function(a){return c.obj(a).extract(d.concat(["branch: "+h]),e,f)})},g=function(c,g){var h=function(d,e,h){var i=a.readOptFrom(h,c);return i.fold(function(){return b.missingKey(d,c)},function(a){return f(d,e,h,g,a)})},i=function(){return"chooseOn("+c+"). Possible values: "+e.keys(g)},j=function(){return d.typeAdt.choiceOf(c,g)};return{extract:h,toString:i,toDsl:j}};return{choose:g}}),g("2e",["4e","4d","4f","6","48","v"],function(a,b,c,d,e,f){var g=b.value(e.value),h=function(a){return b.arrOfObj(a)},i=function(){return b.arr(g)},j=b.arr,k=b.obj,l=b.objOnly,m=b.setOf,n=function(a){return b.value(a)},o=function(a,b,c,d){return b.extract([a],c,d).fold(function(a){return e.error({input:d,errors:a})},e.value)},p=function(a,b,c){return o(a,b,d.constant,c)},q=function(a,b,c){return o(a,b,d.identity,c)},r=function(a){return a.fold(function(a){throw new f(u(a))},d.identity)},s=function(a,b,c){return r(q(a,b,c))},t=function(a,b,c){return r(p(a,b,c))},u=function(a){return"Errors: \n"+c.formatErrors(a.errors)+"\n\nInput object: "+c.formatObj(a.input)},v=function(b,c){return a.choose(b,c)};return{anyValue:d.constant(g),arrOfObj:h,arrOf:j,arrOfVal:i,valueOf:n,setOf:m,objOf:k,objOfOnly:l,asStruct:p,asRaw:q,asStructOrDie:t,asRawOrDie:s,getOrDie:r,formatError:u,choose:v}}),g("47",["29","14","2e","1i","y","6n","6","u","v"],function(a,b,c,d,e,f,g,h,i){var j=function(d){if(!b.hasKey(d,"can")&&!b.hasKey(d,"abort")&&!b.hasKey(d,"run"))throw new i("EventHandler defined by: "+f.stringify(d,null,2)+" does not have can, abort, or run!");return c.asRawOrDie("Extracting event.handler",c.objOfOnly([a.defaulted("can",g.constant(!0)),a.defaulted("abort",g.constant(!1)),a.defaulted("run",g.noop)]),d)},k=function(a,b){return function(){var c=h.prototype.slice.call(arguments,0);return e.foldl(a,function(a,d){return a&&b(d).apply(void 0,c)},!0)}},l=function(a,b){ +return function(){var c=h.prototype.slice.call(arguments,0);return e.foldl(a,function(a,d){return a||b(d).apply(void 0,c)},!1)}},m=function(a){return d.isFunction(a)?{can:g.constant(!0),abort:g.constant(!1),run:a}:a},n=function(a){var b=k(a,function(a){return a.can}),c=l(a,function(a){return a.abort}),d=function(){var b=h.prototype.slice.call(arguments,0);e.each(a,function(a){a.run.apply(void 0,b)})};return j({can:b,abort:c,run:d})};return{read:m,fuse:n,nu:j}}),g("3d",["43","2","t","47","14"],function(a,b,c,d,e){var f=e.wrapAll,g=function(a,b){return{key:a,value:d.nu({abort:b})}},h=function(a,b){return{key:a,value:d.nu({can:b})}},i=function(a){return{key:a,value:d.nu({run:function(a,b){b.event().prevent()}})}},j=function(a,b){return{key:a,value:d.nu({run:b})}},k=function(a,b,c){return{key:a,value:d.nu({run:function(a){b.apply(void 0,[a].concat(c))}})}},l=function(a){return function(b){return j(a,b)}},m=function(b){return function(c){return{key:b,value:d.nu({run:function(b,d){a.isSource(b,d)&&c(b,d)}})}}},n=function(a,c){return j(a,function(d,e){d.getSystem().getByUid(c).each(function(c){b.dispatchEvent(c,c.element(),a,e)})})},o=function(a,b,c){var d=b.partUids()[c];return n(a,d)},p=function(a,b){return j(a,function(a,c){a.getSystem().getByDom(c.event().target()).each(function(d){b(a,d,c)})})},q=function(a){return j(a,function(a,b){b.cut()})},r=function(a){return j(a,function(a,b){b.stop()})};return{derive:f,run:j,preventDefault:i,runActionExtra:k,runOnAttached:m(c.attachedToDom()),runOnDetached:m(c.detachedFromDom()),runOnInit:m(c.systemInit()),runOnExecute:l(c.execute()),redirectToUid:n,redirectToPart:o,runWithTarget:p,abort:g,can:h,cutter:q,stopper:r}}),g("4a",["z"],function(a){var b=function(a,b,c){return a},c=function(a,b){return a},d=function(a,b){return a},e=a.none;return{markAsBehaviourApi:b,markAsExtraApi:c,markAsSketchApi:d,getAnnotation:e}}),g("4k",["y","6","u","v"],function(a,b,c,d){return function(){var e=arguments;return function(){for(var f=new c(arguments.length),g=0;g0&&e.unsuppMessage(m);var n={};return a.each(h,function(a){n[a]=b.constant(f[a])}),a.each(i,function(a){n[a]=b.constant(g.prototype.hasOwnProperty.call(f,a)?d.some(f[a]):d.none())}),n}}}),g("2o",["4k","4l"],function(a,b){return{immutable:a,immutableBag:b}}),g("6o",["6n","2o","2m"],function(a,b,c){var d=b.immutableBag(["tag"],["classes","attributes","styles","value","innerHtml","domChildren","defChildren"]),e=function(b){var c=f(b);return a.stringify(c,null,2)},f=function(a){return{tag:a.tag(),classes:a.classes().getOr([]),attributes:a.attributes().getOr({}),styles:a.styles().getOr({}),value:a.value().getOr(""),innerHtml:a.innerHtml().getOr(""),defChildren:a.defChildren().getOr(""),domChildren:a.domChildren().fold(function(){return""},function(a){return 0===a.length?"0 children, but still specified":c(a.length)})}};return{nu:d,defToStr:e,defToRaw:f}}),g("4b",["6o","14","y","x","w","6n","2o"],function(a,b,c,d,e,f,g){var h=["classes","attributes","styles","value","innerHtml","defChildren","domChildren"],i=g.immutableBag([],h),j=function(a){var b={},e=d.keys(a);return c.each(e,function(c){a[c].each(function(a){b[c]=a})}),i(b)},k=function(a){var b=l(a);return f.stringify(b,null,2)},l=function(a){return{classes:a.classes().getOr(""),attributes:a.attributes().getOr(""),styles:a.styles().getOr(""),value:a.value().getOr(""),innerHtml:a.innerHtml().getOr(""),defChildren:a.defChildren().getOr(""),domChildren:a.domChildren().fold(function(){return""},function(a){return 0===a.length?"0 children, but still specified":String(a.length)})}},m=function(a,c,d){return c.fold(function(){return d.fold(function(){return{}},function(c){return b.wrap(a,c)})},function(c){return d.fold(function(){return b.wrap(a,c)},function(c){return b.wrap(a,c)})})},n=function(c,d){var f=e.deepMerge({tag:c.tag(),classes:d.classes().getOr([]).concat(c.classes().getOr([])),attributes:e.merge(c.attributes().getOr({}),d.attributes().getOr({})),styles:e.merge(c.styles().getOr({}),d.styles().getOr({}))},d.innerHtml().or(c.innerHtml()).map(function(a){return b.wrap("innerHtml",a)}).getOr({}),m("domChildren",d.domChildren(),c.domChildren()),m("defChildren",d.defChildren(),c.defChildren()),d.value().or(c.value()).map(function(a){return b.wrap("value",a)}).getOr({}));return a.nu(f)};return{nu:i,derive:j,merge:n,modToStr:k,modToRaw:l}}),g("27",["3d","4a","4b","29","14","2e","6","w","x","z","17","u","16","v"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){var o=function(b,c,d){return a.runOnExecute(function(a){d(a,b,c)})},p=function(b,c,d){return a.runOnInit(function(a,e){d(a,b,c)})},q=function(a,b,c,e,g,h){var i=f.objOfOnly(a),j=d.optionObjOf(b,[d.optionObjOfOnly("config",a)]);return u(i,j,b,c,e,g,h)},r=function(a,b,c,e,f,g){var h=a,i=d.optionObjOf(b,[d.optionOf("config",a)]);return u(h,i,b,c,e,f,g)},s=function(a,c,d){var e=function(b){var e=arguments;return b.config({name:g.constant(a)}).fold(function(){throw new n("We could not find any behaviour configuration for: "+a+". Using API: "+d)},function(a){var d=l.prototype.slice.call(e,1);return c.apply(void 0,[b,a.config,a.state].concat(d))})};return b.markAsBehaviourApi(e,d,c)},t=function(a){return{key:a,value:void 0}},u=function(a,d,l,m,n,o,p){var q=function(a){return e.hasKey(a,l)?a[l]():j.none()},r=i.map(n,function(a,b){return s(l,a,b)}),u=i.map(o,function(a,c){return b.markAsExtraApi(a,c)}),v=h.deepMerge(u,r,{revoke:g.curry(t,l),config:function(b){var c=f.asStructOrDie(l+"-config",a,b);return{key:l,value:{config:c,me:v,configAsRaw:k.cached(function(){return f.asRawOrDie(l+"-config",a,b)}),initialConfig:b,state:p}}},schema:function(){return d},exhibit:function(a,b){return q(a).bind(function(a){return e.readOptFrom(m,"exhibit").map(function(c){return c(b,a.config,a.state)})}).getOr(c.nu({}))},name:function(){return l},handlers:function(a){return q(a).bind(function(a){return e.readOptFrom(m,"events").map(function(b){return b(a.config,a.state)})}).getOr({})}});return v};return{executeEvent:o,loadEvent:p,create:q,createModes:r}}),g("6q",["y","6","x","1i","6p","v"],function(a,b,c,d,e,f){var g=function(a,b){return h(a,b,{validate:d.isFunction,label:"function"})},h=function(b,d,g){if(0===d.length)throw new f("You must specify at least one required field.");return e.validateStrArr("required",d),e.checkDupes(d),function(f){var h=c.keys(f),i=a.forall(d,function(b){return a.contains(h,b)});i||e.reqMessage(d,h),b(d,h);var j=a.filter(d,function(a){return!g.validate(f[a],a)});return j.length>0&&e.invalidTypeMessage(j,g.label),f}},i=function(b,c){var d=a.filter(c,function(c){return!a.contains(b,c)});d.length>0&&e.unsuppMessage(d)},j=b.noop;return{exactly:b.curry(g,i),ensure:b.curry(g,j),ensureWith:b.curry(h,j)}}),g("4g",["6q"],function(a){return a.ensure(["readState"])}),h("1w",Math),g("28",["4g","1w"],function(a,b){var c=function(){return a({readState:function(){return"No State required"}})};return{init:c}}),g("q",["27","28","29","14","2e","6"],function(a,b,c,d,e,f){var g=function(a){return d.wrapAll(a)},h=e.objOfOnly([c.strict("fields"),c.strict("name"),c.defaulted("active",{}),c.defaulted("apis",{}),c.defaulted("extra",{}),c.defaulted("state",b)]),i=function(b){var c=e.asRawOrDie("Creating behaviour: "+b.name,h,b);return a.create(c.fields,c.name,c.active,c.apis,c.extra,c.state)},j=e.objOfOnly([c.strict("branchKey"),c.strict("branches"),c.strict("name"),c.defaulted("active",{}),c.defaulted("apis",{}),c.defaulted("extra",{}),c.defaulted("state",b)]),k=function(b){var c=e.asRawOrDie("Creating behaviour: "+b.name,j,b);return a.createModes(e.choose(c.branchKey,c.branches),c.name,c.active,c.apis,c.extra,c.state)};return{derive:g,revoke:f.constant(void 0),noActive:f.constant({}),noApis:f.constant({}),noExtra:f.constant({}),noState:f.constant(b),create:i,createModes:k}}),g("4h",[],function(){return function(a,b,c){var d=c||!1,e=function(){b(),d=!0},f=function(){a(),d=!1},g=function(){var a=d?f:e;a()},h=function(){return d};return{on:e,off:f,toggle:g,isOn:h}}}),g("b",["1d"],function(a){var b=function(a){var b=a.dom().nodeName;return b.toLowerCase()},c=function(a){return a.dom().nodeType},d=function(a){return a.dom().nodeValue},e=function(a){return function(b){return c(b)===a}},f=function(d){return c(d)===a.COMMENT||"#comment"===b(d)},g=e(a.ELEMENT),h=e(a.TEXT),i=e(a.DOCUMENT);return{name:b,type:c,value:d,isElement:g,isText:h,isDocument:i,isComment:f}}),g("4i",["1i","y","x","b","v","16"],function(a,b,c,d,e,f){var g=function(b,c,d){if(!(a.isString(d)||a.isBoolean(d)||a.isNumber(d)))throw f.error("Invalid call to Attr.set. Key ",c,":: Value ",d,":: Element ",b),new e("Attribute value was not simple");b.setAttribute(c,d+"")},h=function(a,b,c){g(a.dom(),b,c)},i=function(a,b){var d=a.dom();c.each(b,function(a,b){g(d,b,a)})},j=function(a,b){var c=a.dom().getAttribute(b);return null===c?void 0:c},k=function(a,b){var c=a.dom();return!(!c||!c.hasAttribute)&&c.hasAttribute(b)},l=function(a,b){a.dom().removeAttribute(b)},m=function(a){var b=a.dom().attributes;return void 0===b||null===b||0===b.length},n=function(a){return b.foldl(a.dom().attributes,function(a,b){return a[b.name]=b.value,a},{})},o=function(a,b,c){k(a,c)&&!k(b,c)&&h(b,c,j(a,c))},p=function(a,c,e){d.isElement(a)&&d.isElement(c)&&b.each(e,function(b){o(a,c,b)})};return{clone:n,set:h,setAll:i,get:j,has:k,remove:l,hasNone:m,transfer:p}}),g("6r",["y","4i"],function(a,b){var c=function(a,c){var d=b.get(a,c);return void 0===d||""===d?[]:d.split(" ")},d=function(a,d,e){var f=c(a,d),g=f.concat([e]);b.set(a,d,g.join(" "))},e=function(d,e,f){var g=a.filter(c(d,e),function(a){return a!==f});g.length>0?b.set(d,e,g.join(" ")):b.remove(d,e)};return{read:c,add:d,remove:e}}),g("4j",["y","6r"],function(a,b){var c=function(a){return void 0!==a.dom().classList},d=function(a){return b.read(a,"class")},e=function(a,c){return b.add(a,"class",c)},f=function(a,c){return b.remove(a,"class",c)},g=function(b,c){a.contains(d(b),c)?f(b,c):e(b,c)};return{get:d,add:e,remove:f,toggle:g,supports:c}}),g("2f",["4h","4i","4j"],function(a,b,c){var d=function(a,b){c.supports(a)?a.dom().classList.add(b):c.add(a,b)},e=function(a){var d=c.supports(a)?a.dom().classList:c.get(a);0===d.length&&b.remove(a,"class")},f=function(a,b){if(c.supports(a)){var d=a.dom().classList;d.remove(b)}else c.remove(a,b);e(a)},g=function(a,b){return c.supports(a)?a.dom().classList.toggle(b):c.toggle(a,b)},h=function(b,d){var e=c.supports(b),f=b.dom().classList,g=function(){e?f.remove(d):c.remove(b,d)},h=function(){e?f.add(d):c.add(b,d)};return a(g,h,i(b,d))},i=function(a,b){return c.supports(a)&&a.dom().classList.contains(b)};return{add:d,remove:f,toggle:g,toggler:h,has:i}}),g("r",["2f"],function(a){var b=function(b,c,d){a.remove(b,d),a.add(b,c)},c=function(a,c,d){b(a.element(),c.alpha(),c.omega())},d=function(a,c,d){b(a.element(),c.omega(),c.alpha())},e=function(b,c,d){a.remove(b.element(),c.alpha()),a.remove(b.element(),c.omega())},f=function(b,c,d){return a.has(b.element(),c.alpha())},g=function(b,c,d){return a.has(b.element(),c.omega())};return{toAlpha:c,toOmega:d,isAlpha:f,isOmega:g,clear:e}}),g("s",["29"],function(a){return[a.strict("alpha"),a.strict("omega")]}),g("1",["q","r","s"],function(a,b,c){return a.create({fields:c,name:"swapping",apis:b})}),g("2p",[],function(){var a=function(a,b){var c=[],d=function(a){return c.push(a),b(a)},e=b(a);do e=e.bind(d);while(e.isSome());return c};return{toArray:a}}),g("10",["1i","y","6","z","2o","2p","1a","a"],function(a,b,c,d,e,f,g,h){var i=function(a){return h.fromDom(a.dom().ownerDocument)},j=function(a){var b=i(a);return h.fromDom(b.dom().documentElement)},k=function(a){var b=a.dom(),c=b.ownerDocument.defaultView;return h.fromDom(c)},l=function(a){var b=a.dom();return d.from(b.parentNode).map(h.fromDom)},m=function(a){return l(a).bind(function(c){var d=u(c);return b.findIndex(d,function(b){return g.eq(a,b)})})},n=function(b,d){for(var e=a.isFunction(d)?d:c.constant(!1),f=b.dom(),g=[];null!==f.parentNode&&void 0!==f.parentNode;){var i=f.parentNode,j=h.fromDom(i);if(g.push(j),e(j)===!0)break;f=i}return g},o=function(a){var c=function(c){return b.filter(c,function(b){return!g.eq(a,b)})};return l(a).map(u).map(c).getOr([])},p=function(a){var b=a.dom();return d.from(b.offsetParent).map(h.fromDom)},q=function(a){var b=a.dom();return d.from(b.previousSibling).map(h.fromDom)},r=function(a){var b=a.dom();return d.from(b.nextSibling).map(h.fromDom)},s=function(a){return b.reverse(f.toArray(a,q))},t=function(a){return f.toArray(a,r)},u=function(a){var c=a.dom();return b.map(c.childNodes,h.fromDom)},v=function(a,b){var c=a.dom().childNodes;return d.from(c[b]).map(h.fromDom)},w=function(a){return v(a,0)},x=function(a){return v(a,a.dom().childNodes.length-1)},y=function(a){return a.dom().childNodes.length},z=function(a){return a.dom().hasChildNodes()},A=e.immutable("element","offset"),B=function(a,b){var c=u(a);return c.length>0&&b0&&b.before(a,d),e(a)};return{empty:d,remove:e,unwrap:f}}),g("12",["17","a","b","1b"],function(a,b,c,d){var e=function(a){var b=c.isText(a)?a.dom().parentNode:a.dom();return void 0!==b&&null!==b&&b.ownerDocument.body.contains(b)},f=a.cached(function(){return g(b.fromDom(d))}),g=function(a){var c=a.dom().body;if(null===c||void 0===c)throw"Body is not available yet";return b.fromDom(c)};return{body:f,getBody:g,inBody:e}}),g("3",["2","t","y","z","9","11","12","10"],function(a,b,c,d,e,f,g,h){var i=function(d){a.emit(d,b.detachedFromDom());var e=d.components();c.each(e,i)},j=function(d){var e=d.components();c.each(e,j),a.emit(d,b.attachedToDom())},k=function(a,b){l(a,b,e.append)},l=function(a,b,c){a.getSystem().addToWorld(b),c(a.element(),b.element()),g.inBody(a.element())&&j(b),a.syncComponents()},m=function(a){i(a),f.remove(a.element()),a.getSystem().removeFromWorld(a)},n=function(a){var b=h.parent(a.element()).bind(function(b){return a.getSystem().getByDom(b).fold(d.none,d.some)});m(a),b.each(function(a){a.syncComponents()})},o=function(a){var b=a.components();c.each(b,m),f.empty(a.element()),a.syncComponents()},p=function(a,b){e.append(a,b.element());var d=h.children(b.element());c.each(d,function(a){b.getByDom(a).each(j)})},q=function(a){var b=h.children(a.element());c.each(b,function(b){a.getByDom(b).each(i)}),f.remove(a.element())};return{attach:k,attachWith:l,detach:n,detachChildren:o,attachSystem:p,detachSystem:q}}),g("6s",["y","a","10","1b"],function(a,b,c,d){var e=function(a,e){var f=e||d,g=f.createElement("div");return g.innerHTML=a,c.children(b.fromDom(g))},f=function(c,d){return a.map(c,function(a){return b.fromTag(a,d)})},g=function(c,d){return a.map(c,function(a){return b.fromText(a,d)})},h=function(c){return a.map(c,b.fromDom)};return{fromHtml:e,fromTags:f,fromText:g,fromDom:h}}),g("4n",["a","6s","9","2s","11","10"],function(a,b,c,d,e,f){var g=function(a){return a.dom().innerHTML},h=function(g,h){var i=f.owner(g),j=i.dom(),k=a.fromDom(j.createDocumentFragment()),l=b.fromHtml(h,j);d.append(k,l),e.empty(g),c.append(g,k)},i=function(b){var d=a.fromTag("div"),e=a.fromDom(b.dom().cloneNode(!0));return c.append(d,e),g(d)};return{get:g,set:h,getOuter:i}}),g("4o",["4i","a","9","2s","11","10"],function(a,b,c,d,e,f){var g=function(a,c){return b.fromDom(a.dom().cloneNode(c))},h=function(a){return g(a,!1)},i=function(a){return g(a,!0)},j=function(c,d){var e=b.fromTag(d),f=a.clone(c);return a.setAll(e,f),e},k=function(a,b){var c=j(a,b),e=f.children(i(a));return d.append(c,e),c},l=function(a,b){var g=j(a,b);c.before(a,g);var h=f.children(a);return d.append(g,h),e.remove(a),g};return{shallow:h,shallowAs:j,deep:i,copy:k,mutate:l}}),g("2t",["4n","4o"],function(a,b){var c=function(c){var d=b.shallow(c);return a.getOuter(d)};return{getHtml:c}}),g("13",["2t"],function(a){var b=function(b){return a.getHtml(b)};return{element:b}}),g("15",["z"],function(a){var b=function(a){for(var b=[],c=function(a){b.push(a)},d=0;d0&&!d.exists(n,function(b){return a.indexOf(b)>-1})}).getOr(j)}return j},p=function(a,b,c){},q={logEventCut:e.noop,logEventStopped:e.noop,logNoParent:e.noop,logEventNoHandlers:e.noop,logEventResponse:e.noop,write:e.noop},r=function(c,e,f){var g=k&&("*"===m||d.contains(m,c))?function(){var f=[];return{logEventCut:function(a,b,c){f.push({outcome:"cut",target:b,purpose:c})},logEventStopped:function(a,b,c){f.push({outcome:"stopped",target:b,purpose:c})},logNoParent:function(a,b,c){f.push({outcome:"no-parent",target:b,purpose:c})},logEventNoHandlers:function(a,b){f.push({outcome:"no-handlers-left",target:b})},logEventResponse:function(a,b,c){f.push({outcome:"response",purpose:c,target:b})},write:function(){d.contains(["mousemove","mouseover","mouseout",a.systemInit()],c)||h.log(c,{event:c,target:e.dom(),sequence:d.map(f,function(a){return d.contains(["cut","stopped","response"],a.outcome)?"{"+a.purpose+"} "+a.outcome+" at ("+b.element(a.target)+")":a.outcome})})}}}():q,i=f(g);return g.write(),i},s=function(a){var c=function(a){var e=a.spec();return{"(original.spec)":e,"(dom.ref)":a.element().dom(),"(element)":b.element(a.element()),"(initComponents)":d.map(void 0!==e.components?e.components:[],c),"(components)":d.map(a.components(),c),"(bound.events)":f.mapToArray(a.events(),function(a,b){return[b]}).join(", "),"(behaviours)":void 0!==e.behaviours?f.map(e.behaviours,function(b,c){return void 0===b?"--revoked--":{config:b.configAsRaw(),"original-config":b.initialConfig,state:a.readState(c)}}):"none"}};return c(a)},t=function(){return void 0!==window[l]?window[l]:(window[l]={systems:{},lookup:function(a){var d=window[l].systems,e=f.keys(d);return g.findMap(e,function(e){var f=d[e];return f.getByUid(a).toOption().map(function(a){return c.wrap(b.element(a.element()),s(a))})})}},window[l])},u=function(a,b){var c=t();c.systems[a]=b};return{logHandler:p,noLogger:e.constant(q),getTrace:o,monitorEvent:r,isDebugging:e.constant(k),registerInspector:u}}),g("5",[],function(){var a=function(b){var c=b,d=function(){return c},e=function(a){c=a},f=function(){return a(d())};return{get:d,set:e,clone:f}};return a}),g("4p",["1i","z"],function(a,b){return function(c,d,e,f,g){return c(e,f)?b.some(e):a.isFunction(g)&&g(e)?b.none():d(e,f,g)}}),g("2u",["1i","y","6","z","12","1a","a","4p"],function(a,b,c,d,e,f,g,h){var i=function(a){return n(e.body(),a)},j=function(b,e,f){for(var h=b.dom(),i=a.isFunction(f)?f:c.constant(!1);h.parentNode;){h=h.parentNode;var j=g.fromDom(h);if(e(j))return d.some(j);if(i(j))break}return d.none()},k=function(a,b,c){var d=function(a){return b(a)};return h(d,j,a,b,c)},l=function(a,b){var c=a.dom();return c.parentNode?m(g.fromDom(c.parentNode),function(c){return!f.eq(a,c)&&b(c)}):d.none()},m=function(a,d){var e=b.find(a.dom().childNodes,c.compose(d,g.fromDom));return e.map(g.fromDom)},n=function(a,b){var c=function(a){for(var e=0;ed?c:e=c?c:a};return{cycleBy:a,cap:b}}),g("7o",["y","12","10"],function(a,b,c){var d=function(a){return h(b.body(),a)},e=function(b,d,e){return a.filter(c.parents(b,e),d)},f=function(b,d){return a.filter(c.siblings(b),d)},g=function(b,d){return a.filter(c.children(b),d)},h=function(b,d){var e=[];return a.each(c.children(b),function(a){d(a)&&(e=e.concat([a])),e=e.concat(h(a,d))}),e};return{all:d,ancestors:e,siblings:f,children:g,descendants:h}}),g("5l",["7o","2r"],function(a,b){var c=function(a){return b.all(a)},d=function(c,d,e){return a.ancestors(c,function(a){return b.is(a,d)},e)},e=function(c,d){return a.siblings(c,function(a){return b.is(a,d)})},f=function(c,d){return a.children(c,function(a){return b.is(a,d)})},g=function(a,c){return b.all(c,a)};return{all:c,ancestors:d,siblings:e,children:f,descendants:g}}),g("7m",["94","y","z","48","2f","5l","4u","v"],function(a,b,c,d,e,f,g,h){var i=function(a,c,d){var g=f.descendants(a.element(),"."+c.highlightClass());b.each(g,function(b){e.remove(b,c.highlightClass()),a.getSystem().getByDom(b).each(function(b){c.onDehighlight()(a,b)})})},j=function(a,b,c,d){var f=o(a,b,c,d);e.remove(d.element(),b.highlightClass()),f&&b.onDehighlight()(a,d)},k=function(a,b,c,d){var f=o(a,b,c,d);i(a,b,c),e.add(d.element(),b.highlightClass()),f||b.onHighlight()(a,d)},l=function(a,b,c){r(a,b,c).each(function(d){k(a,b,c,d)})},m=function(a,b,c){s(a,b,c).each(function(d){k(a,b,c,d)})},n=function(a,b,c,d){q(a,b,c,d).fold(function(a){throw new h(a)},function(d){k(a,b,c,d)})},o=function(a,b,c,d){return e.has(d.element(),b.highlightClass())},p=function(a,b,c){return g.descendant(a.element(),"."+b.highlightClass()).bind(a.getSystem().getByDom)},q=function(a,b,e,g){var h=f.descendants(a.element(),"."+b.itemClass());return c.from(h[g]).fold(function(){return d.error("No element found with index "+g)},a.getSystem().getByDom)},r=function(a,b,c){return g.descendant(a.element(),"."+b.itemClass()).bind(a.getSystem().getByDom)},s=function(a,b,d){var e=f.descendants(a.element(),"."+b.itemClass()),g=e.length>0?c.some(e[e.length-1]):c.none();return g.bind(a.getSystem().getByDom)},t=function(c,d,g,h){var i=f.descendants(c.element(),"."+d.itemClass()),j=b.findIndex(i,function(a){return e.has(a,d.highlightClass())});return j.bind(function(b){var d=a.cycleBy(b,h,0,i.length-1);return c.getSystem().getByDom(i[d])})},u=function(a,b,c){return t(a,b,c,-1)},v=function(a,b,c){return t(a,b,c,1)};return{dehighlightAll:i,dehighlight:j,highlight:k,highlightFirst:l,highlightLast:m,highlightAt:n,isHighlighted:o,getHighlighted:p,getFirst:r,getLast:s,getPrevious:u,getNext:v}}),g("7n",["4q","29"],function(a,b){return[b.strict("highlightClass"),b.strict("itemClass"),a.onHandler("onHighlight"),a.onHandler("onDehighlight")]}),g("5j",["q","7m","7n","u"],function(a,b,c,d){return a.create({fields:c,name:"highlighting",apis:b})}),g("97",["5j","6","8"],function(a,b,c){var d=function(){var a=function(a){return c.search(a.element())},b=function(a,b){a.getSystem().triggerFocus(b,a.element())};return{get:a,set:b}},e=function(){var c=function(b){return a.getHighlighted(b).map(function(a){return a.element()})},d=function(c,d){c.getSystem().getByDom(d).fold(b.noop,function(b){a.highlight(c,b)})};return{get:c,set:d}};return{dom:d,highlights:e}}),g("8t",["y","6"],function(a,b){var c=function(b){return function(c){return a.contains(b,c.raw().which)}},d=function(b){return function(c){return a.forall(b,function(a){return a(c)})}},e=function(a){return function(b){return b.raw().which===a}},f=function(a){return a.raw().shiftKey===!0};return{inSet:c,and:d,is:e,isShift:f,isNotShift:b.not(f)}}),g("8u",["8t","y"],function(a,b){var c=function(b,c){return{matches:a.is(b),classification:c}},d=function(a,b){return{matches:a,classification:b}},e=function(a,c){var d=b.find(a,function(a){return a.matches(c)});return d.map(function(a){return a.classification})};return{basic:c,rule:d,choose:e}}),g("8r",["3d","2g","t","97","4q","8u","29","w"],function(a,b,c,d,e,f,g,h){var i=function(i,j,k,l,m,n){var o=function(){return i.concat([g.defaulted("focusManager",d.dom()),e.output("handler",r),e.output("state",j)])},p=function(a,b,c,d){var e=k(a,b,c,d);return f.choose(e,b.event()).bind(function(e){return e(a,b,c,d)})},q=function(d,e){var f=l(d,e),g=a.derive(n.map(function(b){return a.run(c.focus(),function(a,c){b(a,d,e,c),c.stop()})}).toArray().concat([a.run(b.keydown(),function(a,b){p(a,b,d,e).each(function(a){b.stop()})})]));return h.deepMerge(f,g)},r={schema:o,processKey:p,toEvents:q,toApis:m};return r};return{typical:i}}),g("8s",["y","1w"],function(a,b){var c=function(b,c,d){var e=a.reverse(b.slice(0,c)),f=a.reverse(b.slice(c+1));return a.find(e.concat(f),d)},d=function(b,c,d){var e=a.reverse(b.slice(0,c));return a.find(e,d)},e=function(b,c,d){var e=b.slice(0,c),f=b.slice(c+1);return a.find(f.concat(e),d)},f=function(b,c,d){var e=b.slice(c+1);return a.find(e,d)};return{cyclePrev:c,cycleNext:e,tryPrev:d,tryNext:f}}),g("57",[],function(){var a=function(a){return void 0!==a.style};return{isSupported:a}}),g("39",["1i","y","x","z","4i","12","a","b","57","37","v","16","1k"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){var n=function(b,c,d){if(!a.isString(d))throw l.error("Invalid call to CSS.set. Property ",c,":: Value ",d,":: Element ",b),new k("CSS value must be a string: "+d);i.isSupported(b)&&b.style.setProperty(c,d)},o=function(a,b){i.isSupported(a)&&a.style.removeProperty(b)},p=function(a,b,c){var d=a.dom();n(d,b,c)},q=function(a,b){var d=a.dom();c.each(b,function(a,b){n(d,b,a)})},r=function(a,b){var d=a.dom();c.each(b,function(a,b){a.fold(function(){o(d,b)},function(a){n(d,b,a)})})},s=function(a,b){var c=a.dom(),d=m.getComputedStyle(c),e=d.getPropertyValue(b),g=""!==e||f.inBody(a)?e:t(c,b);return null===g?void 0:g},t=function(a,b){return i.isSupported(a)?a.style.getPropertyValue(b):""},u=function(a,b){var c=a.dom(),e=t(c,b);return d.from(e).filter(function(a){return a.length>0})},v=function(a){var b={},c=a.dom();if(i.isSupported(c))for(var d=0;dd?b-d:0;return e};return{set:g,get:h,getOuter:i,aggregate:j,max:k}}}),g("8a",["12","39","78"],function(a,b,c){var d=c("height",function(b){return a.inBody(b)?b.dom().getBoundingClientRect().height:b.dom().offsetHeight}),e=function(a,b){d.set(a,b)},f=function(a){return d.get(a)},g=function(a){return d.getOuter(a)},h=function(a,c){var e=["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"],f=d.max(a,c,e);b.set(a,"max-height",f+"px")};return{set:e,get:f,getOuter:g,setMax:h}}),g("6u",["8b","28","4q","8r","13","8s","8t","8u","29","y","6","z","1a","8","5l","4u","8a"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){var r=[i.defaulted("selector",'[data-alloy-tabstop="true"]'),i.option("onEscape"),i.option("onEnter"),i.defaulted("firstTabstop",0),i.defaulted("useTabstopAt",k.constant(!0)),i.option("visibilitySelector")],s=function(a,b,c){var d=o.descendants(a.element(),b.selector()),e=j.filter(d,function(a){return t(b,a)}),f=l.from(e[b.firstTabstop()]);f.each(function(b){var c=a.element();a.getSystem().triggerFocus(b,c)})},t=function(a,b){var c=a.visibilitySelector().bind(function(a){return p.closest(b,a)}).getOr(b);return q.get(c)>0},u=function(a,b){return n.search(a.element()).bind(function(a){return p.closest(a,b.selector())})},v=function(a,b,c,d,e){return e(b,c,function(a){return t(d,a)&&d.useTabstopAt(a)}).fold(function(){return l.some(!0)},function(b){var c=a.getSystem(),d=a.element();return c.triggerFocus(b,d),l.some(!0)})},w=function(a,b,c,d){var e=o.descendants(a.element(),c.selector());return u(a,c).bind(function(b){var f=j.findIndex(e,k.curry(m.eq,b));return f.bind(function(b){return v(a,e,b,c,d)})})},x=function(a,b,c,d){return w(a,b,c,f.cyclePrev)},y=function(a,b,c,d){return w(a,b,c,f.cycleNext)},z=function(a,b,c,d){return c.onEnter().bind(function(c){return c(a,b)})},A=function(a,b,c,d){return c.onEscape().bind(function(c){return c(a,b)})},B=k.constant([h.rule(g.and([g.isShift,g.inSet(a.TAB())]),x),h.rule(g.inSet(a.TAB()),y),h.rule(g.inSet(a.ESCAPE()),A),h.rule(g.and([g.isNotShift,g.inSet(a.ENTER())]),z)]),C=k.constant({}),D=k.constant({});return d.typical(r,b.init,B,C,D,l.some(s))}),g("8v",["4i","b"],function(a,b){var c=function(c){return"input"===b.name(c)&&"radio"!==a.get(c,"type")||"textarea"===b.name(c)};return{inside:c}}),g("8w",["8v","8b","2","t","8t","z"],function(a,b,c,d,e,f){var g=function(a,b,e){return c.dispatch(a,e,d.execute()),f.some(!0)},h=function(c,d,h){return a.inside(h)&&e.inSet(b.SPACE())(d.event())?f.none():g(c,d,h)};return{defaultExecute:h}}),g("6v",["8v","8b","28","8r","8w","13","8t","8u","29","6","z"],function(a,b,c,d,e,f,g,h,i,j,k){var l=[i.defaulted("execute",e.defaultExecute),i.defaulted("useSpace",!1),i.defaulted("useEnter",!0),i.defaulted("useDown",!1)],m=function(a,b,c,d){return c.execute()(a,b,a.element())},n=function(c,d,e,f){var i=e.useSpace()&&!a.inside(c.element())?b.SPACE():[],j=e.useEnter()?b.ENTER():[],k=e.useDown()?b.DOWN():[],l=i.concat(j).concat(k);return[h.rule(g.inSet(l),m)]},o=j.constant({}),p=j.constant({});return d.typical(l,c.init,n,o,p,k.none())}),g("4z",["4g","5","6","z"],function(a,b,c,d){var e=function(e){var f=b(d.none()),g=function(a,b){f.set(d.some({numRows:c.constant(a),numColumns:c.constant(b)}))},h=function(){return f.get().map(function(a){return a.numRows()})},i=function(){return f.get().map(function(a){return a.numColumns()})};return a({readState:c.constant({}),setGridSize:g,getNumRows:h,getNumColumns:i})},f=function(a){return a.state()(a)};return{flatgrid:e,init:f}}),g("9y",["39"],function(a){var b=function(a,b){return function(d){return"rtl"===c(d)?b:a}},c=function(b){return"rtl"===a.get(b,"direction")?"rtl":"ltr"};return{onDirection:b,getDirection:c}}),g("8x",["9y"],function(a){var b=function(a){return function(b,c,d,e){var g=a(b.element());return f(g,b,c,d,e)}},c=function(c,d){var e=a.onDirection(c,d);return b(e)},d=function(c,d){var e=a.onDirection(d,c);return b(e)},e=function(a){return function(b,c,d,e){return f(a,b,c,d,e)}},f=function(a,b,c,d,e){var f=d.focusManager().get(b).bind(function(c){return a(b.element(),c,d,e)});return f.map(function(a){return d.focusManager().set(b,a),!0})};return{east:d,west:c,north:e,south:e,move:e}}),g("9z",["y","2o"],function(a,b){var c=b.immutableBag(["index","candidates"],[]),d=function(b,d){return a.findIndex(b,d).map(function(a){return c({index:a,candidates:b})})};return{locate:d}}),g("a0",["6","4h","39"],function(a,b,c){var d=function(d,e,f,g){var h=c.get(d,e);void 0===h&&(h="");var i=h===f?g:f,j=a.curry(c.set,d,e,h),k=a.curry(c.set,d,e,i);return b(j,k,!1)},e=function(a){return d(a,"visibility","hidden","visible")},f=function(a,b){return d(a,"display","none",b)},g=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},h=function(a){var b=a.dom();return!g(b)};return{toggler:e,displayToggler:f,isVisible:h}}),g("8y",["9z","y","6","1a","5l","a0"],function(a,b,c,d,e,f){var g=function(a,b,c){var d=f.isVisible;return h(a,b,c,d)},h=function(g,h,i,j){var k=c.curry(d.eq,h),l=e.descendants(g,i),m=b.filter(l,f.isVisible);return a.locate(m,k)},i=function(a,c){return b.findIndex(a,function(a){return d.eq(c,a)})};return{locateVisible:g,locateIn:h,findIndex:i}}),g("8z",["94","6","z","1w"],function(a,b,c,d){var e=function(a,b,e,f){var g=d.floor(b/e),h=b%e;return f(g,h).bind(function(b){var d=b.row()*e+b.column();return d>=0&&d"}),c.anyValue()),m=b.defaulted("defaults",e.constant({})),n=b.defaulted("overrides",e.constant({})),o=c.objOf([i,j,k,l,m,n]),p=c.objOf([i,j,k,m,n]),q=c.objOf([i,j,k,l,m,n]),r=c.objOf([i,j,k,b.strict("unit"),l,m,n]),s=function(a){return a.fold(g.some,g.none,g.some,g.some)},t=function(a){var b=function(a){return a.name()};return a.fold(b,b,b,b)},u=function(a){return a.fold(e.identity,e.identity,e.identity,e.identity)},v=function(a,b){return function(d){var e=c.asStructOrDie("Converting part type",b,d);return a(e)}};return{required:v(h.required,o),external:v(h.external,p),optional:v(h.optional,q),group:v(h.group,r),asNamedPart:s,name:t,asCommon:u,original:e.constant("entirety")}}),g("72",["14","y","x","w","6n","6","6k","v"],function(a,b,c,d,e,f,g,h){var i="placeholder",j=g.generate([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),k=function(a){return b.contains([i],a)},l=function(b,d,g,i){return b.exists(function(a){return a!==g.owner})?j.single(!0,f.constant(g)):a.readOptFrom(i,g.name).fold(function(){throw new h("Unknown placeholder component: "+g.name+"\nKnown: ["+c.keys(i)+"]\nNamespace: "+b.getOr("none")+"\nSpec: "+e.stringify(g,null,2))},function(a){return a.replace()})},m=function(a,b,c,d){return c.uiType===i?l(a,b,c,d):j.single(!1,f.constant(c))},n=function(c,e,f,g){var h=m(c,e,f,g);return h.fold(function(h,i){var j=i(e,f.config,f.validated),k=a.readOptFrom(j,"components").getOr([]),l=b.bind(k,function(a){return n(c,e,a,g)});return[d.deepMerge(j,{components:l})]},function(a,b){var c=b(e,f.config,f.validated);return c})},o=function(a,c,d,e){return b.bind(d,function(b){return n(a,c,b,e)})},p=function(a,b){var c=!1,d=function(){return c},e=function(){if(c===!0)throw new h("Trying to use the same placeholder more than once: "+a);return c=!0,b},g=function(){return b.fold(function(a,b){return a},function(a,b){return a})};return{name:f.constant(a),required:g,used:d,replace:e}},q=function(a,b,d,f){var g=c.map(f,function(a,b){return p(b,a)}),i=o(a,b,d,g);return c.each(g,function(c){if(c.used()===!1&&c.required())throw new h("Placeholder: "+c.name()+" was not found in components list\nNamespace: "+a.getOr("none")+"\nComponents: "+e.stringify(b.components(),null,2))}),i},r=function(a,b){var c=b;return c.fold(function(b,c){return[c(a)]},function(b,c){return c(a)})};return{single:j.single,multiple:j.multiple,isSubstitute:k,placeholder:f.constant(i),substituteAll:o,substitutePlaces:q,singleReplace:r}}),g("71",["53","72","14","y","6","w"],function(a,b,c,d,e,f){var g=function(a,b,d,e){var g=d;return f.deepMerge(b.defaults()(a,d,e),d,{uid:a.partUids()[b.name()]},b.overrides()(a,d,e),{"debug.sketcher":c.wrap("part-"+b.name(),g)})},h=function(c,h,i){var j={},k={};return d.each(i,function(c){c.fold(function(a){j[a.pname()]=b.single(!0,function(b,c,d){return a.factory().sketch(g(b,a,c,d))})},function(b){var c=h.parts()[b.name()]();k[b.name()]=e.constant(g(h,b,c[a.original()]()))},function(a){j[a.pname()]=b.single(!1,function(b,c,d){return a.factory().sketch(g(b,a,c,d))})},function(a){j[a.pname()]=b.multiple(!0,function(b,c,e){var g=b[a.name()]();return d.map(g,function(c){return a.factory().sketch(f.deepMerge(a.defaults()(b,c),c,a.overrides()(b,c)))})})})}),{internals:e.constant(j),externals:e.constant(k)}};return{subs:h}}),g("52",["4q","71","53","72","4c","29","14","2e","y","6","w","x","z"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){var n=function(a,b){var d={};return i.each(b,function(b){c.asNamedPart(b).each(function(b){var c=o(a,b.pname());d[b.name()]=function(d){var e=h.asRawOrDie("Part: "+b.name()+" in "+a,h.objOf(b.schema()),d);return k.deepMerge(c,{config:d,validated:e})}})}),d},o=function(a,b){return{uiType:d.placeholder(),owner:a,name:b}},p=function(a,b,c){return{uiType:d.placeholder(),owner:a,name:b,config:c,validated:{}}},q=function(b){return i.bind(b,function(b){return b.fold(m.none,m.some,m.none,m.none).map(function(b){return f.strictObjOf(b.name(),b.schema().concat([a.snapshot(c.original())]))}).toArray()})},r=function(a){return i.map(a,c.name)},s=function(a,c,d){return b.subs(a,c,d)},t=function(a,b,c){return d.substitutePlaces(m.some(a),b,b.components(),c)},u=function(a,b,c){var d=b.partUids()[c];return a.getSystem().getByUid(d).toOption()},v=function(a,b,c){return u(a,b,c).getOrDie("Could not find part: "+c)},w=function(a,b,c){var d={},e=b.partUids(),f=a.getSystem();return i.each(c,function(a){d[a]=f.getByUid(e[a])}),l.map(d,j.constant)},x=function(a,b){var c=a.getSystem();return l.map(b.partUids(),function(a,b){return j.constant(c.getByUid(a))})},y=function(a,b,c){var d={},e=b.partUids(),f=a.getSystem();return i.each(c,function(a){d[a]=f.getByUid(e[a]).getOrDie()}),l.map(d,j.constant)},z=function(a,b){var c=r(b);return g.wrapAll(i.map(c,function(b){return{key:b,value:a+"-"+b}}))},A=function(a){return f.field("partUids","partUids",e.mergeWithThunk(function(b){return z(b.uid,a)}),h.anyValue())};return{generate:n,generateOne:p,schemas:q,names:r,substitutes:s,components:t,defaultUids:z,defaultUidsSchema:A,getAllParts:x,getPart:u,getPartOrDie:v,getParts:w,getPartsOrDie:y}}),g("73",["4q","72","29","14","2e","y","6","w","x","6n","v"],function(a,b,c,d,e,f,g,h,i,j,k){var l=function(e,g,h){var l=void 0!==h?h:"Unknown owner",m=function(){return[a.output("partUids",{})]},n=void 0!==g?g:m();if(0===e.length&&0===n.length)return m();var o=c.strictObjOf("parts",f.flatten([f.map(e,c.strict),f.map(n,function(a){return c.defaulted(a,b.single(!1,function(){throw new k("The optional part: "+a+" was not specified in the config, but it was used in components")}))})])),p=c.state("partUids",function(a){if(!d.hasKey(a,"parts"))throw new k("Part uid definition for owner: "+l+' requires "parts"\nExpected parts: '+e.join(", ")+"\nSpec: "+j.stringify(a,null,2));var b=i.map(a.parts,function(b,c){return d.readOptFrom(b,"uid").getOrThunk(function(){return a.uid+"-"+c})});return b});return[o,p]},m=function(b,d,e,f){var g=d.length>0?[c.strictObjOf("parts",d)]:[];return g.concat([c.strict("uid"),c.defaulted("dom",{}),c.defaulted("components",[]),a.snapshot("originalSpec"),c.defaulted("debug.sketcher",{})]).concat(e)},n=function(a,b,c,d){var f=m(a,d,c);return e.asRawOrDie(a+" [SpecSchema]",e.objOfOnly(f.concat(b)),c)},o=function(a,b,c,d,f){var g=m(a,d,f,c);return e.asStructOrDie(a+" [SpecSchema]",e.objOfOnly(g.concat(b)),c)},p=function(a,b,c){var d=h.deepMerge(b,c);return a(d)},q=function(a,b){return h.deepMerge(a,b)};return{asRawOrDie:n,asStructOrDie:o,addBehaviours:q,getPartsSchema:l,extend:p}}),g("51",["52","30","73","14","w"],function(a,b,c,d,e){var f=function(a,b,f,g){var i=h(g),j=c.asStructOrDie(a,b,i,[],[]);return e.deepMerge(f(j,i),{"debug.sketcher":d.wrap(a,g)})},g=function(b,f,g,i,j){var k=h(j),l=a.schemas(g),m=a.defaultUidsSchema(g),n=c.asStructOrDie(b,f,k,l,[m]),o=a.substitutes(b,n,g),p=a.components(b,n,o.internals());return e.deepMerge(i(n,p,k,o.externals()),{"debug.sketcher":d.wrap(b,j)})},h=function(a){return e.deepMerge({uid:b.generate("uid")},a)};return{supplyUid:h,single:f,composite:g}}),g("34",["50","51","4a","52","53","29","2e","6","w","x"],function(a,b,c,d,e,f,g,h,i,j){var k=g.objOfOnly([f.strict("name"),f.strict("factory"),f.strict("configFields"),f.defaulted("apis",{}),f.defaulted("extraApis",{})]),l=g.objOfOnly([f.strict("name"),f.strict("factory"),f.strict("configFields"),f.strict("partFields"),f.defaulted("apis",{}),f.defaulted("extraApis",{})]),m=function(d){var e=g.asRawOrDie("Sketcher for "+d.name,k,d),f=function(a){return b.single(e.name,e.configFields,e.factory,a)},l=j.map(e.apis,a.makeApi),m=j.map(e.extraApis,function(a,b){return c.markAsExtraApi(a,b)});return i.deepMerge({name:h.constant(e.name),partFields:h.constant([]),configFields:h.constant(e.configFields),sketch:f},l,m)},n=function(e){var f=g.asRawOrDie("Sketcher for "+e.name,l,e),k=function(a){return b.composite(f.name,f.configFields,f.partFields,f.factory,a)},m=d.generate(f.name,f.partFields),n=j.map(f.apis,a.makeApi),o=j.map(f.extraApis,function(a,b){return c.markAsExtraApi(a,b)});return i.deepMerge({name:h.constant(f.name),partFields:h.constant(f.partFields),configFields:h.constant(f.configFields),sketch:k,parts:h.constant(m)},n,o)};return{single:m,composite:n}}),g("35",["3d","2","2g","t","y","7"],function(a,b,c,d,e,f){var g=function(g){var h=function(b){return a.run(d.execute(),function(a,c){b(a),c.stop()})},i=function(a,c){c.stop(),b.emitExecute(a)},j=function(a,b){b.cut()},k=f.detect().deviceType.isTouch()?[a.run(d.tap(),i)]:[a.run(c.click(),i),a.run(c.mousedown(),j)];return a.derive(e.flatten([g.map(h).toArray(),k]))};return{events:g}}),g("1n",["q","32","33","34","35","29","w"],function(a,b,c,d,e,f,g){var h=function(d,f){var h=e.events(d.action());return{uid:d.uid(),dom:d.dom(),components:d.components(),events:h,behaviours:g.deepMerge(a.derive([b.config({}),c.config({mode:"execution",useSpace:!0,useEnter:!0})]),d.buttonBehaviours()),domModification:{attributes:{type:"button",role:d.role().getOr("button")}},eventOrder:d.eventOrder()}};return d.single({name:"Button",factory:h,configFields:[f.defaulted("uid",void 0),f.strict("dom"),f.defaulted("components",[]),f.defaulted("buttonBehaviours",{}),f.option("action"),f.option("role"),f.defaulted("eventOrder",{})]})}),g("36",["14","y","w","a","b","4n","10","u"],function(a,b,c,d,e,f,g,h){var i=function(d){var e=void 0!==d.dom().attributes?d.dom().attributes:[];return b.foldl(e,function(b,d){return"class"===d.name?b:c.deepMerge(b,a.wrap(d.name,d.value))},{})},j=function(a){return h.prototype.slice.call(a.dom().classList,0)},k=function(a){var b=d.fromHtml(a),h=g.children(b),k=i(b),l=j(b),m=0===h.length?{}:{innerHtml:f.get(b)};return c.deepMerge({tag:e.name(b),classes:l,attributes:k},m)},l=function(a,b,d){return a.sketch(c.deepMerge({dom:k(b)},d))};return{fromHtml:k,sketch:l}}),g("1o",["36","37","i"],function(a,b,c){var d=function(d){var e=b.supplant(d,{prefix:c.prefix()});return a.fromHtml(e)},e=function(a){ +var b=d(a);return{dom:b}};return{dom:d,spec:e}}),g("l",["q","1g","1m","1n","w","1l","i","1o"],function(a,b,c,d,e,f,g,h){var i=function(a,b){return m(b,function(){a.execCommand(b)},{})},j=function(c){return a.derive([b.config({toggleClass:g.resolve("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),f.format(c,function(a,c){var d=c?b.on:b.off;d(a)})])},k=function(a,b){var c=j(b);return m(b,function(){a.execCommand(b)},c)},l=function(a,b,c,d){var e=j(c);return m(b,d,e)},m=function(b,f,g){return d.sketch({dom:h.dom(''),action:f,buttonBehaviours:e.deepMerge(a.derive([c.config({})]),g)})};return{forToolbar:m,forToolbarCommand:i,forToolbarStateAction:l,forToolbarStateCommand:k}}),g("92",["1w"],function(a){var b=function(b,c,d,e){return bd?d:b===c?c-1:a.max(c,b-e)},c=function(b,c,d,e){return b>d?b:bb.right)return f+1;var l=a.min(b.right,a.max(g,b.left))-b.left,m=d(l/b.width*k+c,c-1,f+1),n=a.round(m);return i&&m>=c&&m<=f?e(b,m,c,f,h,j):n};return{reduceBy:b,increaseBy:c,findValueOfX:f}}),g("74",["2","92","6","z","7","1w"],function(a,b,c,d,e,f){var g="slider.change.value",h=e.detect().deviceType.isTouch(),i=function(a){var b=a.event().raw();return h&&void 0!==b.touches&&1===b.touches.length?d.some(b.touches[0]):h&&void 0!==b.touches?d.none():h||void 0===b.clientX?d.none():d.some(b)},j=function(a){var b=i(a);return b.map(function(a){return a.clientX})},k=function(b,c){a.emitWith(b,g,{value:c})},l=function(a,b){k(a,b.min(),d.none())},m=function(a,b){k(a,b.max(),d.none())},n=function(a,b){k(a,b.max()+1,d.none())},o=function(a,b){k(a,b.min()-1,d.none())},p=function(a,c,d,e){var f=b.findValueOfX(c,d.min(),d.max(),e,d.stepSize(),d.snapToGrid(),d.snapStart());k(a,f)},q=function(a,b,c,d){return j(d).map(function(d){return p(a,c,b,d),d})},r=function(a,c){var e=b.reduceBy(c.value().get(),c.min(),c.max(),c.stepSize());k(a,e,d.none())},s=function(a,c){var e=b.increaseBy(c.value().get(),c.min(),c.max(),c.stepSize());k(a,e,d.none())};return{setXFromEvent:q,setToLedge:o,setToRedge:n,moveLeftFromRedge:m,moveRightFromLedge:l,moveLeft:r,moveRight:s,changeEvent:c.constant(g)}}),g("54",["q","32","33","3d","2g","53","74","29","5","6","z","7"],function(a,b,c,d,e,f,g,h,i,j,k,l){var m=l.detect(),n=m.deviceType.isTouch(),o=function(a,b){return f.optional({name:""+a+"-edge",overrides:function(a){var c=d.derive([d.runActionExtra(e.touchstart(),b,[a])]),f=d.derive([d.runActionExtra(e.mousedown(),b,[a]),d.runActionExtra(e.mousemove(),function(a,c){c.mouseIsDown().get()&&b(a,c)},[a])]);return{events:n?c:f}}})},p=o("left",g.setToLedge),q=o("right",g.setToRedge),r=f.required({name:"thumb",defaults:j.constant({dom:{styles:{position:"absolute"}}}),overrides:function(a){return{events:d.derive([d.redirectToPart(e.touchstart(),a,"spectrum"),d.redirectToPart(e.touchmove(),a,"spectrum"),d.redirectToPart(e.touchend(),a,"spectrum")])}}}),s=f.required({schema:[h.state("mouseIsDown",function(){return i(!1)})],name:"spectrum",overrides:function(f){var h=function(a,b){var c=a.element().dom().getBoundingClientRect();g.setXFromEvent(a,f,c,b)},i=d.derive([d.run(e.touchstart(),h),d.run(e.touchmove(),h)]),j=d.derive([d.run(e.mousedown(),h),d.run(e.mousemove(),function(a,b){f.mouseIsDown().get()&&h(a,b)})]);return{behaviours:a.derive(n?[]:[c.config({mode:"special",onLeft:function(a){return g.moveLeft(a,f),k.some(!0)},onRight:function(a){return g.moveRight(a,f),k.some(!0)}}),b.config({})]),events:n?i:j}}});return[p,q,r,s]}),g("55",["29","5","6","7"],function(a,b,c,d){var e=d.detect().deviceType.isTouch();return[a.strict("min"),a.strict("max"),a.defaulted("stepSize",1),a.defaulted("onChange",c.noop),a.defaulted("onInit",c.noop),a.defaulted("onDragStart",c.noop),a.defaulted("onDragEnd",c.noop),a.defaulted("snapToGrid",!1),a.option("snapStart"),a.strict("getInitialValue"),a.defaulted("sliderBehaviours",{}),a.state("value",function(a){return b(a.min)})].concat(e?[]:[a.state("mouseIsDown",function(){return b(!1)})])}),g("5b",[],function(){var a=function(a,b,c){b.store().manager().onLoad(a,b,c)},b=function(a,b,c){b.store().manager().onUnload(a,b,c)},c=function(a,b,c,d){b.store().manager().setValue(a,b,c,d)},d=function(a,b,c){return b.store().manager().getValue(a,b,c)};return{onLoad:a,onUnload:b,setValue:c,getValue:d}}),g("5a",["3d","27","5b"],function(a,b,c){var d=function(d,e){var f=d.resetOnDom()?[a.runOnAttached(function(a,b){c.onLoad(a,d,e)}),a.runOnDetached(function(a,b){c.onUnload(a,d,e)})]:[b.loadEvent(d,e,c.onLoad)];return a.derive(f)};return{events:d}}),g("5d",["4g","5"],function(a,b){var c=function(){var c=b(null),d=function(){return{mode:"memory",value:c.get()}},e=function(){return null===c.get()},f=function(){c.set(null)};return a({set:c.set,get:c.get,isNotSet:e,clear:f,readState:d})},d=function(){var b=function(){};return a({readState:b})},e=function(){var c=b({}),d=function(){return{mode:"dataset",dataset:c.get()}};return a({readState:d,set:c.set,get:c.get})},f=function(a){return a.store().manager().state(a)};return{memory:c,dataset:e,manual:d,init:f}}),g("75",["5d","4q","29","14","6"],function(a,b,c,d,e){var f=function(a,b,c,d){b.store().getDataKey();c.set({}),b.store().setData()(a,d),b.onSetValue()(a,d)},g=function(a,b,c){var e=b.store().getDataKey()(a),f=c.get();return d.readOptFrom(f,e).fold(function(){return b.store().getFallbackEntry()(e)},function(a){return a})},h=function(a,b,c){b.store().initialValue().each(function(d){f(a,b,c,d)})},i=function(a,b,c){c.set({})};return[c.option("initialValue"),c.strict("getFallbackEntry"),c.strict("getDataKey"),c.strict("setData"),b.output("manager",{setValue:f,getValue:g,onLoad:h,onUnload:i,state:a.dataset})]}),g("76",["28","4q","29","6"],function(a,b,c,d){var e=function(a,b,c){return b.store().getValue()(a)},f=function(a,b,c,d){b.store().setValue()(a,d),b.onSetValue()(a,d)},g=function(a,b,c){b.store().initialValue().each(function(c){b.store().setValue()(a,c)})};return[c.strict("getValue"),c.defaulted("setValue",d.noop),c.option("initialValue"),b.output("manager",{setValue:f,getValue:e,onLoad:g,onUnload:d.noop,state:a.init})]}),g("77",["5d","4q","29"],function(a,b,c){var d=function(a,b,c,d){c.set(d),b.onSetValue()(a,d)},e=function(a,b,c){return c.get()},f=function(a,b,c){b.store().initialValue().each(function(a){c.isNotSet()&&c.set(a)})},g=function(a,b,c){c.clear()};return[c.option("initialValue"),b.output("manager",{setValue:d,getValue:e,onLoad:f,onUnload:g,state:a.memory})]}),g("5c",["75","76","77","4q","29","2e"],function(a,b,c,d,e,f){return[e.defaultedOf("store",{mode:"memory"},f.choose("mode",{memory:c,manual:b,dataset:a})),d.onHandler("onSetValue"),e.defaulted("resetOnDom",!1)]}),g("3g",["q","5a","5b","5c","5d"],function(a,b,c,d,e){var f=a.create({fields:d,name:"representing",active:b,apis:c,extra:{setValueFrom:function(a,b){var c=f.getValue(b);f.setValue(a,c)}},state:e});return f}),g("5m",["39","78"],function(a,b){var c=b("width",function(a){return a.dom().offsetWidth}),d=function(a,b){c.set(a,b)},e=function(a){return c.get(a)},f=function(a){return c.getOuter(a)},g=function(b,d){var e=["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"],f=c.max(b,d,e);a.set(b,"max-width",f+"px")};return{set:d,get:e,getOuter:f,setMax:g}}),g("56",["q","33","3g","3d","2g","52","74","y","6","w","z","7","39","5m"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){var o=l.detect().deviceType.isTouch(),p=function(l,p,q,r){var s=l.max()-l.min(),t=function(a){var b=a.element().dom().getBoundingClientRect();return(b.left+b.right)/2},u=function(a){return f.getPartOrDie(a,l,"thumb")},v=function(a,b,c){var d=c.value().get();return dc.max()?f.getPart(a,c,"right-edge").fold(function(){return b.width},function(a){return t(a)-b.left}):(c.value().get()-c.min())/s*b.width},w=function(a){var b=f.getPartOrDie(a,l,"spectrum"),c=b.element().dom().getBoundingClientRect(),d=a.element().dom().getBoundingClientRect(),e=v(a,c,l);return c.left-d.left+e},x=function(a){var b=w(a),c=u(a),d=n.get(c.element())/2;m.set(c.element(),"left",b-d+"px")},y=function(a,b){var c=l.value().get(),d=u(a);return c!==b||m.getRaw(d.element(),"left").isNone()?(l.value().set(b),x(a),l.onChange()(a,d,b),k.some(!0)):k.none()},z=function(a){y(a,l.min(),k.none())},A=function(a){y(a,l.max(),k.none())},B=o?[d.run(e.touchstart(),function(a,b){l.onDragStart()(a,u(a))}),d.run(e.touchend(),function(a,b){l.onDragEnd()(a,u(a))})]:[d.run(e.mousedown(),function(a,b){b.stop(),l.onDragStart()(a,u(a)),l.mouseIsDown().set(!0)}),d.run(e.mouseup(),function(a,b){l.onDragEnd()(a,u(a)),l.mouseIsDown().set(!1)})];return{uid:l.uid(),dom:l.dom(),components:p,behaviours:j.deepMerge(a.derive(h.flatten([o?[]:[b.config({mode:"special",focusIn:function(a){return f.getPart(a,l,"spectrum").map(b.focusIn).map(i.constant(!0))}})],[c.config({store:{mode:"manual",getValue:function(a){return l.value().get()}}})]])),l.sliderBehaviours()),events:d.derive([d.run(g.changeEvent(),function(a,b){y(a,b.event().value())}),d.runOnAttached(function(a,b){l.value().set(l.getInitialValue()());var c=u(a);x(a),l.onInit()(a,c,l.value().get())})].concat(B)),apis:{resetToMin:z,resetToMax:A,refresh:x},domModification:{styles:{position:"relative"}}}};return{sketch:p}}),g("38",["34","54","55","56","1w"],function(a,b,c,d,e){return a.composite({name:"Slider",configFields:c,partFields:b,factory:d.sketch,apis:{resetToMin:function(a,b){a.resetToMin(b)},resetToMax:function(a,b){a.resetToMax(b)},refresh:function(a,b){a.refresh(b)}}})}),g("3a",["l"],function(a){var b=function(b,c,d){return a.forToolbar(c,function(){var a=d();b.setContextToolbar([{label:c+" group",items:a}])},{})};return{button:b}}),g("1p",["q","1f","1g","38","39","1l","i","3a","1o"],function(a,b,c,d,e,f,g,h,i){var j=-1,k=function(b){var h=function(a){return a<0?"black":a>360?"white":"hsl("+a+", 100%, 50%)"},j=function(a,b,c){var d=h(c);e.set(b.element(),"background-color",d)},k=function(a,c,d){var f=h(d);e.set(c.element(),"background-color",f),b.onChange(a,c,f)};return d.sketch({dom:i.dom('
      '),components:[d.parts()["left-edge"](i.spec('
      ')),d.parts().spectrum({dom:i.dom('
      '),components:[i.spec('
      ')],behaviours:a.derive([c.config({toggleClass:g.resolve("thumb-active")})])}),d.parts()["right-edge"](i.spec('
      ')),d.parts().thumb({dom:i.dom('
      '),behaviours:a.derive([c.config({toggleClass:g.resolve("thumb-active")})])})],onChange:k,onDragStart:function(a,b){c.on(b)},onDragEnd:function(a,b){c.off(b)},onInit:j,stepSize:10,min:0,max:360,getInitialValue:b.getInitialValue,sliderBehaviours:a.derive([f.orientation(d.refresh)])})},l=function(a){return[k(a)]},m=function(a,b){var c={onChange:function(a,c,d){b.undoManager.transact(function(){b.formatter.apply("forecolor",{value:d}),b.nodeChanged()})},getInitialValue:function(){return j}};return h.button(a,"color",function(){return l(c)})};return{makeItems:l,sketch:m}}),g("3b",["q","1f","1g","38","29","2e","1l","i","1o"],function(a,b,c,d,e,f,g,h,i){var j=f.objOfOnly([e.strict("getInitialValue"),e.strict("onChange"),e.strict("category"),e.strict("sizes")]),k=function(b){var e=f.asRawOrDie("SizeSlider",j,b),k=function(a){return a>=0&&a
      '),components:[i.spec('
      ')]}),d.parts().thumb({dom:i.dom('
      '),behaviours:a.derive([c.config({toggleClass:h.resolve("thumb-active")})])})]})};return{sketch:k}}),g("58",["1i","6","z","a"],function(a,b,c,d){var e=function(e,f,g){for(var h=e.dom(),i=a.isFunction(g)?g:b.constant(!1);h.parentNode;){h=h.parentNode;var j=d.fromDom(h),k=f(j);if(k.isSome())return k;if(i(j))break}return c.none()},f=function(a,b,d){var f=b(a);return f.orThunk(function(){return d(a)?c.none():e(a,b,d)})};return{ancestor:e,closest:f}}),g("3c",["y","6","z","1a","a","b","39","58","10"],function(a,b,c,d,e,f,g,h,i){var j=["9px","10px","11px","12px","14px","16px","18px","20px","24px","32px","36px"],k="medium",l=2,m=function(a){return c.from(j[a])},n=function(b){return a.findIndex(j,function(a){return a===b})},o=function(a,b){var d=f.isElement(b)?c.some(b):i.parent(b);return d.map(function(b){var c=h.closest(b,function(a){return g.getRaw(a,"font-size")},a);return c.getOrThunk(function(){return g.get(b,"font-size")})}).getOr("")},p=function(b){var c=b.selection.getStart(),f=e.fromDom(c),g=e.fromDom(b.getBody()),h=function(a){return d.eq(g,a)},i=o(h,f);return a.find(j,function(a){return i===a}).getOr(k)},q=function(a,b){var c=p(a);c!==b&&a.execCommand("fontSize",!1,b)},r=function(a){var b=p(a);return n(b).getOr(l)},s=function(a,b){m(b).each(function(b){q(a,b)})};return{candidates:b.constant(j),get:r,apply:s}}),g("1q",["3b","3a","3c","1o"],function(a,b,c,d){var e=c.candidates(),f=function(b){return a.sketch({onChange:b.onChange,sizes:e,category:"font",getInitialValue:b.getInitialValue})},g=function(a){return[d.spec(''),f(a),d.spec('')]},h=function(a,d){var e={onChange:function(a){c.apply(d,a)},getInitialValue:function(){return c.get(d)}};return b.button(a,"font-size",function(){return g(e)})};return{makeItems:g,sketch:h}});g("79",[],function(){function a(a,b){return e(document.createElement("canvas"),a,b)}function b(b){var d,e;return d=a(b.width,b.height),e=c(d),e.drawImage(b,0,0),d}function c(a){return a.getContext("2d")}function d(a){var b=null;try{b=a.getContext("webgl")||a.getContext("experimental-webgl")}catch(a){}return b||(b=null),b}function e(a,b,c){return a.width=b,a.height=c,a}return{create:a,clone:b,resize:e,get2dContext:c,get3dContext:d}});g("7a",[],function(){function a(a){return a.naturalWidth||a.width}function b(a){return a.naturalHeight||a.height}return{getWidth:a,getHeight:b}}),g("7b",[],function(){function a(a,b){return function(){a.apply(b,arguments)}}function b(b){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof b)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],h(b,a(d,this),a(e,this))}function c(a){var b=this;return null===this._state?void this._deferreds.push(a):void i(function(){var c=b._state?a.onFulfilled:a.onRejected;if(null===c)return void(b._state?a.resolve:a.reject)(b._value);var d;try{d=c(b._value)}catch(b){return void a.reject(b)}a.resolve(d)})}function d(b){try{if(b===this)throw new TypeError("A promise cannot be resolved with itself.");if(b&&("object"==typeof b||"function"==typeof b)){var c=b.then;if("function"==typeof c)return void h(a(c,b),a(d,this),a(e,this))}this._state=!0,this._value=b,f.call(this)}catch(a){e.call(this,a)}}function e(a){this._state=!1,this._value=a,f.call(this)}function f(){for(var a=0,b=this._deferreds.length;a'),components:[g.asSpec()],action:function(a){var b=g.get(a);b.element().dom().click()}})};return{sketch:k}}),g("5e",[],function(){var a=function(a){return a.dom().textContent},b=function(a,b){a.dom().textContent=b};return{get:a,set:b}}),g("3h",["6","z","a","4i","5e","4u"],function(a,b,c,d,e,f){var g=function(a){return a.length>0},h=function(a){return void 0===a||null===a?"":a},i=function(a){var c=a.selection.getContent({format:"text"});return{url:"",text:c,title:"",target:"",link:b.none()}},j=function(a){var c=e.get(a),f=d.get(a,"href"),g=d.get(a,"title"),i=d.get(a,"target");return{url:h(f),text:c!==f?h(c):"",title:h(g),target:h(i),link:b.some(a)}},k=function(a){return q(a).fold(function(){return i(a)},function(a){return j(a)})},l=function(a){var b=d.get(a,"href"),c=e.get(a);return b===c},m=function(a,c,d){return d.text.filter(g).fold(function(){return l(a)?b.some(c):b.none()},b.some)},n=function(b,c){var d=c.link.bind(a.identity);d.each(function(a){b.execCommand("unlink")})},o=function(a,b){var c={};return c.href=a,b.title.filter(g).each(function(a){c.title=a}),b.target.filter(g).each(function(a){c.target=a}),c},p=function(b,c){c.url.filter(g).fold(function(){n(b,c)},function(f){var h=o(f,c),i=c.link.bind(a.identity);i.fold(function(){var a=c.text.filter(g).getOr(f);b.insertContent(b.dom.createHTML("a",h,b.dom.encode(a)))},function(a){var b=m(a,f,c);d.setAll(a,h),b.each(function(b){e.set(a,b)})})})},q=function(a){var b=c.fromDom(a.selection.getStart());return f.closest(b,"a")};return{getInfo:k,applyInfo:p,query:q}}),g("3u",["q","3d","29","6"],function(a,b,c,d){var e=function(e,f){var g=b.derive(f);return a.create({fields:[c.strict("enabled")],name:e,active:{events:d.constant(g)}})},f=function(b,c){var f=e(b,c);return{key:b,value:{config:{},me:f,configAsRaw:d.constant({}),initialConfig:{},state:a.noState()}}};return{events:e,config:f}}),g("7g",[],function(){var a=function(a,b,c){return b.find()(a)};return{getCurrent:a}}),g("7h",["29"],function(a){return[a.strict("find")]}),g("5f",["q","7g","7h"],function(a,b,c){return a.create({fields:c,name:"composing",apis:b})}),g("3v",["34","29","w"],function(a,b,c){var d=function(a,b){return{uid:a.uid(),dom:c.deepMerge({tag:"div",attributes:{role:"presentation"}},a.dom()),components:a.components(),behaviours:a.containerBehaviours(),events:a.events(),domModification:a.domModification(),eventOrder:a.eventOrder()}};return a.single({name:"Container",factory:d,configFields:[b.defaulted("components",[]),b.defaulted("containerBehaviours",{}),b.defaulted("events",{}),b.defaulted("domModification",{}),b.defaulted("eventOrder",{})]})}),g("5g",["q","5f","3g","3d","34","29","z"],function(a,b,c,d,e,f,g){var h=function(e,f){return{uid:e.uid(),dom:e.dom(),behaviours:a.derive([c.config({store:{mode:"memory",initialValue:e.getInitialValue()()}}),b.config({find:g.some})]),events:d.derive([d.runOnAttached(function(a,b){c.setValue(a,e.getInitialValue()())})])}};return e.single({name:"DataField",factory:h,configFields:[f.strict("uid"),f.strict("dom"),f.strict("getInitialValue")]})}),g("87",["4b","14"],function(a,b){var c=function(c,d){return a.nu({attributes:b.wrapAll([{key:d.tabAttr(),value:"true"}])})};return{exhibit:c}}),g("88",["29"],function(a){return[a.defaulted("tabAttr","data-alloy-tabstop")]}),g("64",["q","87","88"],function(a,b,c){return a.create({fields:c,name:"tabstopping",active:b})}),g("93",["v"],function(a){var b=function(a){return a.dom().value},c=function(b,c){if(void 0===c)throw new a("Value.set was undefined");b.dom().value=c};return{set:c,get:b}}),g("7i",["q","32","3g","64","4q","29","14","6","w","93"],function(a,b,c,d,e,f,g,h,i,j){var k=[f.option("data"),f.defaulted("inputAttributes",{}),f.defaulted("inputStyles",{}),f.defaulted("type","input"),f.defaulted("tag","input"),e.onHandler("onSetValue"),f.defaulted("styles",{}),f.option("placeholder"),f.defaulted("eventOrder",{}),f.defaulted("hasTabstop",!0),f.defaulted("inputBehaviours",{}),f.defaulted("selectOnFocus",!0)],l=function(e){return i.deepMerge(a.derive([c.config({store:{mode:"manual",initialValue:e.data().getOr(void 0),getValue:function(a){return j.get(a.element())},setValue:function(a,b){var c=j.get(a.element());c!==b&&j.set(a.element(),b)}},onSetValue:e.onSetValue()}),b.config({onFocus:e.selectOnFocus()===!1?h.noop:function(a){var b=a.element(),c=j.get(b);b.dom().setSelectionRange(0,c.length)}}),e.hasTabstop()?d.config({}):d.revoke()]),e.inputBehaviours())},m=function(a){return{tag:a.tag(),attributes:i.deepMerge(g.wrapAll([{key:"type",value:a.type()}].concat(a.placeholder().map(function(a){return{key:"placeholder",value:a}}).toArray())),a.inputAttributes()),styles:a.inputStyles()}};return{schema:h.constant(k),behaviours:l,dom:m}}),g("5h",["34","7i"],function(a,b){var c=function(a,c){return{uid:a.uid(),dom:b.dom(a),components:[],behaviours:b.behaviours(a),eventOrder:a.eventOrder()}};return a.single({name:"Input",configFields:b.schema(),factory:c})}),g("3i",["3u","q","5f","3g","1g","1h","3d","2","2g","1n","3v","5g","5h","z","i","1o"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){var q="input-clearing",r=function(l,r){var s=f.record(m.sketch({placeholder:r,onSetValue:function(a,b){h.emit(a,i.input())},inputBehaviours:b.derive([c.config({find:n.some})]),selectOnFocus:!1})),t=f.record(j.sketch({dom:p.dom(''),action:function(a){var b=s.get(a);d.setValue(b,"")}}));return{name:l,spec:k.sketch({dom:p.dom('
      '),components:[s.asSpec(),t.asSpec()],containerBehaviours:b.derive([e.config({toggleClass:o.resolve("input-container-empty")}),c.config({find:function(a){return n.some(s.get(a))}}),a.config(q,[g.run(i.input(),function(a){var b=s.get(a),c=d.getValue(b),f=c.length>0?e.off:e.on;f(a)})])])})}},s=function(a){return{name:a,spec:l.sketch({dom:{tag:"span",styles:{display:"none"}},getInitialValue:function(){return n.none()}})}};return{field:r,hidden:s}}),g("7k",["y","4i","2f","b"],function(a,b,c,d){var e=["input","button","textarea"],f=function(a,b,c){b.disabled()&&n(a,b,c)},g=function(b){return a.contains(e,d.name(b.element()))},h=function(a){return b.has(a.element(),"disabled")},i=function(a){b.set(a.element(),"disabled","disabled")},j=function(a){b.remove(a.element(),"disabled")},k=function(a){return"true"===b.get(a.element(),"aria-disabled")},l=function(a){b.set(a.element(),"aria-disabled","true")},m=function(a){b.set(a.element(),"aria-disabled","false")},n=function(a,b,d){b.disableClass().each(function(b){c.add(a.element(),b)});var e=g(a)?i:l;e(a)},o=function(a,b,d){b.disableClass().each(function(b){c.remove(a.element(),b)});var e=g(a)?j:m;e(a)},p=function(a){return g(a)?h(a):k(a)};return{enable:o,disable:n,isDisabled:p,onLoad:f}}),g("7j",["3d","t","27","7k","4b","y"],function(a,b,c,d,e,f){var g=function(a,b,c){return e.nu({classes:b.disabled()?b.disableClass().map(f.pure).getOr([]):[]})},h=function(e,f){return a.derive([a.abort(b.execute(),function(a,b){return d.isDisabled(a,e,f)}),c.loadEvent(e,f,d.onLoad)])};return{exhibit:g,events:h}}),g("7l",["29"],function(a){return[a.defaulted("disabled",!1),a.option("disableClass")]}),g("5i",["q","7j","7k","7l"],function(a,b,c,d){return a.create({fields:d,name:"disabling",active:b,apis:c})}),g("5k",["q","5f","3g","51","52","53","29","y","w","x"],function(a,b,c,d,e,f,g,h,i,j){var k="form",l=[g.defaulted("formBehaviours",{})],m=function(a){return""},n=function(a){var b=function(){var a=[],b=function(b,c){return a.push(b),e.generateOne(k,m(b),c)};return{field:b,record:function(){return a}}}(),c=a(b),g=b.record(),i=h.map(g,function(a){return f.required({name:a,pname:m(a)})});return d.composite(k,l,i,o,c)},o=function(d,f,g){return i.deepMerge({"debug.sketcher":{Form:g},uid:d.uid(),dom:d.dom(),components:f,behaviours:i.deepMerge(a.derive([c.config({store:{mode:"manual",getValue:function(a){var f=e.getAllParts(a,d);return j.map(f,function(a,d){return a().bind(b.getCurrent).map(c.getValue)})},setValue:function(a,f){j.each(f,function(f,g){e.getPart(a,d,g).each(function(a){b.getCurrent(a).each(function(a){c.setValue(a,f)})})})}}})]),d.formBehaviours())})};return{sketch:n}}),g("1z",["z","5"],function(a,b){var c=function(c){var d=b(a.none()),e=function(){d.get().each(c)},f=function(){e(),d.set(a.none())},g=function(b){e(),d.set(a.some(b))},h=function(){return d.get().isSome()};return{clear:f,isSet:h,set:g}},d=function(){return c(function(a){a.destroy()})},e=function(){return c(function(a){a.unbind()})},f=function(){var c=b(a.none()),d=function(){c.get().each(function(a){a.destroy()})},e=function(){d(),c.set(a.none())},f=function(b){d(),c.set(a.some(b))},g=function(a){c.get().each(a)},h=function(){return c.get().isSome()};return{clear:e,isSet:h,set:f,run:g}},g=function(){var c=b(a.none()),d=function(){c.set(a.none())},e=function(b){c.set(a.some(b))},f=function(a){c.get().each(a)},g=function(){return c.get().isSome()};return{clear:d,set:e,isSet:g,on:f}};return{destroyable:d,unbindable:e,api:f,value:g}}),g("5n",[],function(){var a=1,b=-1,c=0,d=function(a){return{xValue:a,points:[]}},e=function(c,d){if(d===c.xValue)return c;var e=d-c.xValue>0?a:b,f={direction:e,xValue:d},g=function(){if(0===c.points.length)return[];var a=c.points[c.points.length-1];return a.direction===e?c.points.slice(0,c.points.length-1):c.points}();return{xValue:d,points:g.concat([f])}},f=function(d){if(0===d.points.length)return c;var e=d.points[0].direction,f=d.points[d.points.length-1].direction;return e===b&&f===b?b:e===a&&f==a?a:c};return{init:d,move:e,complete:f}}),g("3j",["3u","q","5i","5j","33","1f","3g","1h","3d","2","2g","1n","3v","5k","29","2e","y","5","z","1z","39","5l","4u","5m","1l","5n","i","1o"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B){var C=function(f){var C="navigateEvent",D="serializer-wrapper-events",E="form-events",F=p.objOf([o.strict("fields"),o.defaulted("maxFieldIndex",f.fields.length-1),o.strict("onExecute"),o.strict("getInitialValue"),o.state("state",function(){return{dialogSwipeState:t.value(),currentScreen:r(0)}})]),G=p.asRawOrDie("SerialisedDialog",F,f),H=function(a,d,e){return l.sketch({dom:B.dom(''),action:function(b){j.emitWith(b,C,{direction:a})},buttonBehaviours:b.derive([c.config({disableClass:A.resolve("toolbar-navigation-disabled"),disabled:!e})])})},I=function(a,b){w.descendant(a.element(),"."+A.resolve("serialised-dialog-chain")).each(function(a){u.set(a,"left",-G.state.currentScreen.get()*b.width+"px")})},J=function(a,b){var c=v.descendants(a.element(),"."+A.resolve("serialised-dialog-screen"));w.descendant(a.element(),"."+A.resolve("serialised-dialog-chain")).each(function(a){G.state.currentScreen.get()+b>=0&&G.state.currentScreen.get()+b
      '),components:[m.sketch({dom:B.dom('
      '),components:q.map(G.fields,function(a,b){return b<=G.maxFieldIndex?m.sketch({dom:B.dom('
      '),components:q.flatten([[H(-1,"previous",b>0)],[c.field(a.name,a.spec)],[H(1,"next",b'),behaviours:b.derive([d.config({highlightClass:A.resolve("dot-active"),itemClass:A.resolve("dot-item")})]),components:q.bind(G.fields,function(a,b){return b<=G.maxFieldIndex?[B.spec('
      ')]:[]})});return{dom:B.dom('
      '),components:[M.asSpec(),N.asSpec()],behaviours:b.derive([e.config({mode:"special",focusIn:function(a){var b=M.get(a);e.focusIn(b)}}),a.config(D,[i.run(k.touchstart(),function(a,b){G.state.dialogSwipeState.set(z.init(b.event().raw().touches[0].clientX))}),i.run(k.touchmove(),function(a,b){G.state.dialogSwipeState.on(function(a){b.event().prevent(),G.state.dialogSwipeState.set(z.move(a,b.event().raw().touches[0].clientX))})}),i.run(k.touchend(),function(a){G.state.dialogSwipeState.on(function(b){var c=M.get(a),d=-1*z.complete(b);J(c,d)})})])])}};return{sketch:C}}),g("3k",["6","7"],function(a,b){var c=b.detect(),d=function(a,b){var c=b.selection.getRng();a(),b.selection.setRng(c)},e=function(b,e){var f=c.os.isAndroid()?d:a.apply;f(e,b)};return{forAndroid:e}}),g("1s",["3g","z","17","3h","l","3i","3j","3k"],function(a,b,c,d,e,f,g,h){var i=c.cached(function(c,e){return[{label:"the link group",items:[g.sketch({fields:[f.field("url","Type or paste URL"),f.field("text","Link text"),f.field("title","Link title"),f.field("target","Link target"),f.hidden("link")],maxFieldIndex:["url","text","title","target"].length-1,getInitialValue:function(){return b.some(d.getInfo(e))},onExecute:function(b){var f=a.getValue(b);d.applyInfo(e,f),c.restoreToolbar(),e.focus()}})]}]}),j=function(a,b){return e.forToolbarStateAction(b,"link","link",function(){var c=i(a,b);a.setContextToolbar(c),h.forAndroid(b,function(){a.focusToolbar()}),d.query(b).each(function(a){b.selection.select(a.dom())})})};return{sketch:j}}),g("3l",[],function(){return[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}]}),g("7q",["14","6","z","4i","2f"],function(a,b,c,d,e){var f=function(c,d,e,f){return a.readOptFrom(d.routes(),f.start()).map(b.apply).bind(function(c){return a.readOptFrom(c,f.destination()).map(b.apply)})},g=function(a,b,c){var d=k(a,b,c);return d.bind(function(d){return h(a,b,c,d)})},h=function(a,c,d,e){return f(a,c,d,e).bind(function(a){return a.transition().map(function(c){return{transition:b.constant(c),route:b.constant(a)}})})},i=function(a,b,c){g(a,b,c).each(function(c){var f=c.transition();e.remove(a.element(),f.transitionClass()),d.remove(a.element(),b.destinationAttr())})},j=function(a,c,e,f){return{start:b.constant(d.get(a.element(),c.stateAttr())),destination:b.constant(f)}},k=function(a,e,f){var g=a.element();return d.has(g,e.destinationAttr())?c.some({start:b.constant(d.get(a.element(),e.stateAttr())),destination:b.constant(d.get(a.element(),e.destinationAttr()))}):c.none()},l=function(a,b,c,e){i(a,b,c),d.has(a.element(),b.stateAttr())&&d.get(a.element(),b.stateAttr())!==e&&b.onFinish()(a,e),d.set(a.element(),b.stateAttr(),e)},m=function(a,b,c,e){d.has(a.element(),b.destinationAttr())&&(d.set(a.element(),b.stateAttr(),d.get(a.element(),b.destinationAttr())),d.remove(a.element(),b.destinationAttr()))},n=function(a,b,c,f){m(a,b,c,f);var g=j(a,b,c,f);h(a,b,c,g).fold(function(){l(a,b,c,f)},function(g){i(a,b,c);var h=g.transition();e.add(a.element(),h.transitionClass()),d.set(a.element(),b.destinationAttr(),f)})},o=function(a,b,e){var f=a.element();return d.has(f,b.stateAttr())?c.some(d.get(f,b.stateAttr())):c.none()};return{findRoute:f,disableTransition:i,getCurrentRoute:k,jumpTo:l,progressTo:n,getState:o}}),g("7p",["3d","2g","7q"],function(a,b,c){var d=function(d,e){return a.derive([a.run(b.transitionend(),function(a,b){var f=b.event().raw();c.getCurrentRoute(a,d,e).each(function(b){c.findRoute(a,d,e,b).each(function(g){g.transition().each(function(g){f.propertyName===g.property()&&(c.jumpTo(a,d,e,b.destination()),d.onTransition()(a,b))})})})}),a.runOnAttached(function(a,b){c.jumpTo(a,d,e,d.initialState())})])};return{events:d}}),g("7r",["4q","29","2e","48"],function(a,b,c,d){return[b.defaulted("destinationAttr","data-transitioning-destination"),b.defaulted("stateAttr","data-transitioning-state"),b.strict("initialState"),a.onHandler("onTransition"),a.onHandler("onFinish"),b.strictOf("routes",c.setOf(d.value,c.setOf(d.value,c.objOfOnly([b.optionObjOfOnly("transition",[b.strict("property"),b.strict("transitionClass")])]))))]}),g("5o",["q","7p","7q","7r","14","x"],function(a,b,c,d,e,f){var g=function(a){var b={};return f.each(a,function(a,c){var d=c.split("<->");b[d[0]]=e.wrap(d[1],a),b[d[1]]=e.wrap(d[0],a)}),b},h=function(a,b,c){return e.wrapAll([{key:a,value:e.wrap(b,c)},{key:b,value:e.wrap(a,c)}])},i=function(a,b,c,d){return e.wrapAll([{key:a,value:e.wrapAll([{key:b,value:d},{key:c,value:d}])},{key:b,value:e.wrapAll([{key:a,value:d},{key:c,value:d}])},{key:c,value:e.wrapAll([{key:a,value:d},{key:b,value:d}])}])};return a.create({fields:d,name:"transitioning",active:b,apis:c,extra:{createRoutes:g,createBistate:h,createTristate:i}})}),g("7t",["28","4c","29","2e","y","6","x","6n","v"],function(a,b,c,d,e,f,g,h,i){var j=function(j,k){var l=e.map(k,function(e){return c.field(e.name(),e.name(),b.asOption(),d.objOf([c.strict("config"),c.defaulted("state",a)]))}),m=d.asStruct("component.behaviours",d.objOf(l),j.behaviours).fold(function(a){throw new i(d.formatError(a)+"\nComplete spec:\n"+h.stringify(j,null,2))},f.identity);return{list:k,data:g.map(m,function(a){var b=a();return f.constant(b.map(function(a){return{config:a.config(),state:a.state().init(a.config())}}))})}},k=function(a){return a.list},l=function(a){return a.data};return{generateFrom:j,getBehaviours:k,getData:l}}),g("7s",["7t","14","y","x","v"],function(a,b,c,d,e){var f=function(a){var e=b.readOptFrom(a,"behaviours").getOr({}),f=c.filter(d.keys(e),function(a){return void 0!==e[a]});return c.map(f,function(b){return a.behaviours[b].me})},g=function(b,c){return a.generateFrom(b,c)},h=function(a){var b=f(a);return g(a,b)};return{generate:h,generateFrom:g}}),g("5q",["6q"],function(a){return a.exactly(["getSystem","config","spec","connect","disconnect","element","syncComponents","readState","components","events"])}),g("6a",["6q"],function(a){return a.exactly(["debugInfo","triggerFocus","triggerEvent","triggerEscape","addToWorld","removeFromWorld","addToGui","removeFromGui","build","getByUid","getByDom","broadcast","broadcastOn"])}),g("5r",["6a","13","6","v"],function(a,b,c,d){return function(e){var f=function(a){return function(){throw new d("The component must be in a context to send: "+a+"\n"+b.element(e().element())+" is not in context.")}};return a({debugInfo:c.constant("fake"),triggerEvent:f("triggerEvent"),triggerFocus:f("triggerFocus"),triggerEscape:f("triggerEscape"),build:f("build"),addToWorld:f("addToWorld"),removeFromWorld:f("removeFromWorld"),addToGui:f("addToGui"),removeFromGui:f("removeFromGui"),getByUid:f("getByUid"),getByDom:f("getByDom"),broadcast:f("broadcast"),broadcastOn:f("broadcastOn")})}}),g("95",["14","x"],function(a,b){var c=function(c,d){var e={};return b.each(c,function(c,f){b.each(c,function(b,c){var g=a.readOr(c,[])(e);e[c]=g.concat([d(f,b)])})}),e};return{byInnerKey:c}}),g("7u",["95","4b","14","y","x","w","6n","6","48"],function(a,b,c,d,e,f,g,h,i){var j=function(a,b){return{name:h.constant(a),modification:b}},k=function(a,b){var e=d.bind(a,function(a){return a.modification().getOr([])});return i.value(c.wrap(b,e))},l=function(a,b,e){return a.length>1?i.error('Multiple behaviours have tried to change DOM "'+b+'". The guilty behaviours are: '+g.stringify(d.map(a,function(a){return a.name()}))+". At this stage, this is not supported. Future releases might provide strategies for resolving this."):0===a.length?i.value({}):i.value(a[0].modification().fold(function(){return{}},function(a){return c.wrap(b,a)}))},m=function(a,b,c,e){return i.error("Mulitple behaviours have tried to change the _"+b+'_ "'+a+'". The guilty behaviours are: '+g.stringify(d.bind(e,function(a){return void 0!==a.modification().getOr({})[b]?[a.name()]:[]}),null,2)+". This is not currently supported.")},n=function(a,b){var f=d.foldl(a,function(d,f){var g=f.modification().getOr({});return d.bind(function(d){var f=e.mapToArray(g,function(e,f){return void 0!==d[f]?m(b,f,g,a):i.value(c.wrap(f,e))});return c.consolidate(f,d)})},i.value({}));return f.map(function(a){return c.wrap(b,a)})},o={classes:k,attributes:n,styles:n,domChildren:l,defChildren:l,innerHtml:l,value:l},p=function(g,h,k,l){var m=f.deepMerge({},h);d.each(k,function(a){m[a.name()]=a.exhibit(g,l)});var n=a.byInnerKey(m,j),p=e.map(n,function(a,b){return d.bind(a,function(a){return a.modification().fold(function(){return[]},function(b){return[a]})})}),q=e.mapToArray(p,function(a,b){return c.readOptFrom(o,b).fold(function(){return i.error("Unknown field type: "+b)},function(c){return c(a,b)})}),r=c.consolidate(q,{});return r.map(b.nu)};return{combine:p}}),g("96",["6n","48","v"],function(a,b,c){var d=function(d,e,f,g){var h=f.slice(0);try{var i=h.sort(function(b,f){var h=b[e](),i=f[e](),j=g.indexOf(h),k=g.indexOf(i);if(j===-1)throw new c("The ordering for "+d+" does not have an entry for "+h+".\nOrder specified: "+a.stringify(g,null,2));if(k===-1)throw new c("The ordering for "+d+" does not have an entry for "+i+".\nOrder specified: "+a.stringify(g,null,2));return j1?f.filter(b,function(b){return f.contains(a,function(a){return a.name()===b})}).join(" > "):a[0].name();return e.wrap(c,d.nu(h,i))})});return e.consolidate(c,{})};return{combine:q}}),g("7w",["4q","6o","4b","4s","4c","29","14","2e","y","6","w","v"],function(a,b,c,d,e,f,g,h,i,j,k,l){var m=function(b){return h.asStruct("custom.definition",h.objOfOnly([f.field("dom","dom",e.strict(),h.objOfOnly([f.strict("tag"),f.defaulted("styles",{}),f.defaulted("classes",[]),f.defaulted("attributes",{}),f.option("value"),f.option("innerHtml")])),f.strict("components"),f.strict("uid"),f.defaulted("events",{}),f.defaulted("apis",j.constant({})),f.field("eventOrder","eventOrder",e.mergeWith({"alloy.execute":["disabling","alloy.base.behaviour","toggling"],"alloy.focus":["alloy.base.behaviour","keying","focusing"],"alloy.system.init":["alloy.base.behaviour","disabling","toggling","representing"],input:["alloy.base.behaviour","representing","streaming","invalidating"],"alloy.system.detached":["alloy.base.behaviour","representing"]}),h.anyValue()),f.option("domModification"),a.snapshot("originalSpec"),f.defaulted("debug.sketcher","unknown")]),b)},n=function(a){return g.wrap(d.idAttr(),a.uid())},o=function(a){var c={tag:a.dom().tag(),classes:a.dom().classes(),attributes:k.deepMerge(n(a),a.dom().attributes()),styles:a.dom().styles(),domChildren:i.map(a.components(),function(a){return a.element()})};return b.nu(k.deepMerge(c,a.dom().innerHtml().map(function(a){return g.wrap("innerHtml",a)}).getOr({}),a.dom().value().map(function(a){return g.wrap("value",a)}).getOr({})))},p=function(a){return a.domModification().fold(function(){return c.nu({})},c.nu)},q=function(a){return a.apis()},r=function(a){return a.events()};return{toInfo:m,toDefinition:o,toModification:p,toApis:q,toEvents:r}}),g("89",["y","2f","4j","u"],function(a,b,c,d){var e=function(c,d){a.each(d,function(a){b.add(c,a)})},f=function(c,d){a.each(d,function(a){b.remove(c,a)})},g=function(c,d){a.each(d,function(a){b.toggle(c,a)})},h=function(c,d){return a.forall(d,function(a){return b.has(c,a)})},i=function(c,d){return a.exists(d,function(a){return b.has(c,a)})},j=function(a){for(var b=a.dom().classList,c=new d(b.length),e=0;e1?f.some(a.slice(1)):f.none()})},r=function(a){return b.readOptFrom(j.get(),a)},s=function(a){return b.readOptFrom(i.get(),a)},t=function(a){var b=l.get()(i.get());return c.difference(d.keys(b),a)},u=function(){return k.get().bind(s)},v=function(){return i.get()};return{setContents:o,expand:p,refresh:r,collapse:q,lookupMenu:s,otherMenus:t,getPrimary:u,getMenus:v,clear:m,isClear:n}}}),g("80",["8v","q","5f","5j","33","1y","3g","3q","3d","2","t","97","5u","9d","9b","9c","14","y","6","w","x","z","15","12","2f","89","4u"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A){var B=function(s,B){var C=function(a,b){return u.map(b,function(b,c){var d=m.sketch(t.deepMerge(b,{value:c,items:b.items,markers:q.narrow(B.markers,["item","selectedItem"]),fakeFocus:s.fakeFocus(),onHighlight:s.onHighlight(),focusManager:s.fakeFocus()?l.highlights():l.dom()}));return a.getSystem().build(d)})},D=n(),E=function(a){var b=C(a,s.data().menus());return D.setContents(s.data().primary(),b,s.data().expansions(),function(b){return G(a,b)}),D.getPrimary()},F=function(a){return g.getValue(a).value},G=function(a,b){return u.map(s.data().menus(),function(a,b){return r.bind(a.items,function(a){return"separator"===a.type?[]:[a.data.value]})})},H=function(a,b){d.highlight(a,b),d.getHighlighted(b).orThunk(function(){return d.getFirst(b)}).each(function(b){j.dispatch(a,b.element(),k.focusItem())})},I=function(a,b){return w.cat(r.map(b,a.lookupMenu))},J=function(a,b,c){return v.from(c[0]).bind(b.lookupMenu).map(function(d){var e=I(b,c.slice(1));r.each(e,function(a){y.add(a.element(),s.markers().backgroundMenu())}),x.inBody(d.element())||f.append(a,h.premade(d)),z.remove(d.element(),[s.markers().backgroundMenu()]),H(a,d);var g=I(b,b.otherMenus(c));return r.each(g,function(b){z.remove(b.element(),[s.markers().backgroundMenu()]),s.stayInDom()||f.remove(a,b)}),d})},K=function(a,b){var c=F(b);return D.expand(c).bind(function(c){return v.from(c[0]).bind(D.lookupMenu).each(function(c){x.inBody(c.element())||f.append(a,h.premade(c)),s.onOpenSubmenu()(a,b,c),d.highlightFirst(c)}),J(a,D,c)})},L=function(a,b){var c=F(b);return D.collapse(c).bind(function(c){return J(a,D,c).map(function(c){return s.onCollapseMenu()(a,b,c),c})})},M=function(a,b){var c=F(b);return D.refresh(c).bind(function(b){return J(a,D,b)})},N=function(b,c){return a.inside(c.element())?v.none():K(b,c)},O=function(b,c){return a.inside(c.element())?v.none():L(b,c)},P=function(a,b){return L(a,b).orThunk(function(){return s.onEscape()(a,b)})},Q=function(a){return function(b,c){return A.closest(c.getSource(),"."+s.markers().item()).bind(function(c){return b.getSystem().getByDom(c).bind(function(c){return a(b,c)})})}},R=i.derive([i.run(p.focus(),function(a,b){var c=b.event().menu();d.highlight(a,c)}),i.runOnExecute(function(a,b){var c=b.event().target();return a.getSystem().getByDom(c).bind(function(b){var c=F(b);return 0===c.indexOf("collapse-item")?L(a,b):K(a,b).orThunk(function(){return s.onExecute()(a,b)})})}),i.runOnAttached(function(a,b){E(a).each(function(b){f.append(a,h.premade(b)),s.openImmediately()&&(H(a,b),s.onOpenMenu()(a,b))})})].concat(s.navigateOnHover()?[i.run(o.hover(),function(a,b){var c=b.event().item();M(a,c),K(a,c),s.onHover()(a,c)})]:[])),S=function(a){d.getHighlighted(a).each(function(b){d.getHighlighted(b).each(function(b){L(a,b)})})};return{uid:s.uid(),dom:s.dom(),behaviours:t.deepMerge(b.derive([e.config({mode:"special",onRight:Q(N),onLeft:Q(O),onEscape:Q(P),focusIn:function(a,b){D.getPrimary().each(function(b){j.dispatch(a,b.element(),k.focusItem())})}}),d.config({highlightClass:s.markers().selectedMenu(),itemClass:s.markers().menu()}),c.config({find:function(a){return d.getHighlighted(a)}}),f.config({})]),s.tmenuBehaviours()),eventOrder:s.eventOrder(),apis:{collapseMenu:S},events:R}};return{make:B,collapseItem:s.constant("collapse-item")}}),g("5v",["34","4q","80","29","14","3f"],function(a,b,c,d,e,f){var g=function(a,b,c){return{primary:a,menus:b,expansions:c}},h=function(a,b){return{primary:a,menus:e.wrap(a,b),expansions:{}}},i=function(a){return{value:f.generate(c.collapseItem()),text:a}};return a.single({name:"TieredMenu",configFields:[b.onStrictKeyboardHandler("onExecute"),b.onStrictKeyboardHandler("onEscape"),b.onStrictHandler("onOpenMenu"),b.onStrictHandler("onOpenSubmenu"),b.onHandler("onCollapseMenu"),d.defaulted("openImmediately",!0),d.strictObjOf("data",[d.strict("primary"),d.strict("menus"),d.strict("expansions")]),d.defaulted("fakeFocus",!1),b.onHandler("onHighlight"),b.onHandler("onHover"),b.tieredMenuMarkers(),d.strict("dom"),d.defaulted("navigateOnHover",!0),d.defaulted("stayInDom",!1),d.defaulted("tmenuBehaviours",{}),d.defaulted("eventOrder",{})],apis:{collapseMenu:function(a,b){a.collapseMenu(b)}},factory:c.make,extraApis:{tieredData:g,singleData:h,collapseItem:i}})}),g("3z",["6","2f","i"],function(a,b,c){var d=c.resolve("scrollable"),e=function(a){b.add(a,d)},f=function(a){b.remove(a,d)};return{register:e,deregister:f,scrollable:a.constant(d)}}),g("3m",["3u","q","3g","1g","5o","3q","1h","3d","1n","5u","5v","14","y","w","x","39","4u","5m","1l","i","3z"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u){var v=function(a){return l.readOptFrom(a,"format").getOr(a.title)},w=function(a,b){var c=y("Styles",[].concat(m.map(a.items,function(b){return x(v(b),b.title,b.isSelected(),b.getPreview(),l.hasKey(a.expansions,v(b)))})),b,!1),d=o.map(a.menus,function(c,d){var e=m.map(c,function(b){ +return x(v(b),b.title,void 0!==b.isSelected&&b.isSelected(),void 0!==b.getPreview?b.getPreview():"",l.hasKey(a.expansions,v(b)))});return y(d,e,b,!0)}),e=n.deepMerge(d,l.wrap("styles",c)),f=k.tieredData("styles",e,a.expansions);return{tmenu:f}},x=function(a,c,e,f,g){return{data:{value:a,text:c},type:"item",dom:{tag:"div",classes:g?[t.resolve("styles-item-is-menu")]:[]},toggling:{toggleOnExecute:!1,toggleClass:t.resolve("format-matches"),selected:e},itemBehaviours:b.derive(g?[]:[s.format(a,function(a,b){var c=b?d.on:d.off;c(a)})]),components:[{dom:{tag:"div",attributes:{style:f},innerHtml:c}}]}},y=function(c,d,g,l){return{value:c,dom:{tag:"div"},components:[i.sketch({dom:{tag:"div",classes:[t.resolve("styles-collapser")]},components:l?[{dom:{tag:"span",classes:[t.resolve("styles-collapse-icon")]}},f.text(c)]:[f.text(c)],action:function(a){if(l){var b=g().get(a);k.collapseMenu(b)}}}),{dom:{tag:"div",classes:[t.resolve("styles-menu-items-container")]},components:[j.parts().items({})],behaviours:b.derive([a.config("adhoc-scrollable-menu",[h.runOnAttached(function(a,b){p.set(a.element(),"overflow-y","auto"),p.set(a.element(),"-webkit-overflow-scrolling","touch"),u.register(a.element())}),h.runOnDetached(function(a){p.remove(a.element(),"overflow-y"),p.remove(a.element(),"-webkit-overflow-scrolling"),u.deregister(a.element())})])])}],items:d,menuBehaviours:b.derive([e.config({initialState:"after",routes:e.createTristate("before","current","after",{transition:{property:"transform",transitionClass:"transitioning"}})})])}},z=function(a){var b=w(a.formats,function(){return d}),d=g.record(k.sketch({dom:{tag:"div",classes:[t.resolve("styles-menu")]},components:[],fakeFocus:!0,stayInDom:!0,onExecute:function(b,d){var e=c.getValue(d);a.handle(d,e.value)},onEscape:function(){},onOpenMenu:function(a,b){var c=r.get(a.element());r.set(b.element(),c),e.jumpTo(b,"current")},onOpenSubmenu:function(a,b,c){var d=r.get(a.element()),f=q.ancestor(b.element(),'[role="menu"]').getOrDie("hacky"),g=a.getSystem().getByDom(f).getOrDie();r.set(c.element(),d),e.progressTo(g,"before"),e.jumpTo(c,"after"),e.progressTo(c,"current")},onCollapseMenu:function(a,b,c){var d=q.ancestor(b.element(),'[role="menu"]').getOrDie("hacky"),f=a.getSystem().getByDom(d).getOrDie();e.progressTo(f,"after"),e.progressTo(c,"current")},navigateOnHover:!1,openImmediately:!0,data:b.tmenu,markers:{backgroundMenu:t.resolve("styles-background-menu"),menu:t.resolve("styles-menu"),selectedMenu:t.resolve("styles-selected-menu"),item:t.resolve("styles-item"),selectedItem:t.resolve("styles-selected-item")}}));return d.asSpec()};return{sketch:z}}),g("3n",["14","y","w"],function(a,b,c){var d=function(b){var d=c.deepMerge(a.exclude(b,["items"]),{menu:!0}),e=f(b.items,b.title),g=c.deepMerge(e.menus,a.wrap(b.title,e.items)),h=c.deepMerge(e.expansions,a.wrap(b.title,b.title));return{item:d,menus:g,expansions:h}},e=function(b){return a.hasKey(b,"items")?d(b):{item:b,menus:{},expansions:{}}},f=function(a){return b.foldr(a,function(a,b){var d=e(b);return{menus:c.deepMerge(a.menus,d.menus),items:[d.item].concat(a.items),expansions:c.deepMerge(a.expansions,d.expansions)}},{menus:{},expansions:{},items:[]})};return{expand:f}}),g("1t",["1g","14","y","6","3f","w","3l","3m","3n"],function(a,b,c,d,e,f,g,h,i){var j=function(a,h){var i=function(b){return function(){return a.formatter.match(b)}},j=function(b){return function(){var c=a.formatter.getCssText(b);return c}},k=function(a){return f.deepMerge(a,{isSelected:i(a.format),getPreview:j(a.format)})},l=function(a){return f.deepMerge(a,{isSelected:d.constant(!1),getPreview:d.constant("")})},m=function(b){var c=e.generate(b.title),d=f.deepMerge(b,{format:c,isSelected:i(c),getPreview:j(c)});return a.formatter.register(c,d),d},n=b.readOptFrom(h,"style_formats").getOr(g),o=function(a){return c.map(a,function(a){if(b.hasKey(a,"items")){var c=o(a.items);return f.deepMerge(l(a),{items:c})}return b.hasKey(a,"format")?k(a):m(a)})};return o(n)},k=function(a,d){var e=function(d){return c.bind(d,function(c){if(void 0!==c.items){var d=e(c.items);return d.length>0?[c]:[]}var f=!b.hasKey(c,"format")||a.formatter.canApply(c.format);return f?[c]:[]})},f=e(d);return i.expand(f)},l=function(b,c,d){var e=k(b,c);return h.sketch({formats:e,handle:function(c,e){b.undoManager.transact(function(){a.isOn(c)?b.formatter.remove(e):b.formatter.apply(e)}),d()}})};return{register:j,ui:l}}),g("h",["q","1f","1g","1h","14","y","6","z","1i","1j","1k","1l","g","i","l","1p","1q","1r","1s","1t"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t){var u=["undo","bold","italic","link","image","bullist","styleselect"],v=function(a){var b=a.replace(/\|/g," ").trim();return b.length>0?b.split(/\s+/):[]},w=function(a){return f.bind(a,function(a){return i.isArray(a)?w(a):v(a)})},x=function(a){var b=void 0!==a.toolbar?a.toolbar:u;return i.isArray(b)?w(b):v(b)},y=function(d,f){var g=function(a){return function(){return o.forToolbarCommand(f,a)}},i=function(a){return function(){return o.forToolbarStateCommand(f,a)}},j=function(a,b,c){return function(){return o.forToolbarStateAction(f,a,b,c)}},k=g("undo"),u=g("redo"),v=i("bold"),w=i("italic"),x=i("underline"),y=g("removeformat"),z=function(){return s.sketch(d,f)},A=j("unlink","link",function(){f.execCommand("unlink",null,!1)}),B=function(){return r.sketch(f)},C=j("unordered-list","ul",function(){f.execCommand("InsertUnorderedList",null,!1)}),D=j("ordered-list","ol",function(){f.execCommand("InsertOrderedList",null,!1)}),E=function(){return q.sketch(d,f)},F=function(){return p.sketch(d,f)},G=t.register(f,f.settings),H=function(){return t.ui(f,G,function(){f.fire("scrollIntoView")})},I=function(){return o.forToolbar("style-formats",function(a){f.fire("toReading"),d.dropup().appear(H,c.on,a)},a.derive([c.config({toggleClass:n.resolve("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),b.config({channels:e.wrapAll([l.receive(m.orientationChanged(),c.off),l.receive(m.dropupDismissed(),c.off)])})]))},J=function(a,b){return{isSupported:function(){return a.forall(function(a){return e.hasKey(f.buttons,a)})},sketch:b}};return{undo:J(h.none(),k),redo:J(h.none(),u),bold:J(h.none(),v),italic:J(h.none(),w),underline:J(h.none(),x),removeformat:J(h.none(),y),link:J(h.none(),z),unlink:J(h.none(),A),image:J(h.none(),B),bullist:J(h.some("bullist"),C),numlist:J(h.some("numlist"),D),fontsizeselect:J(h.none(),E),forecolor:J(h.none(),F),styleselect:J(h.none(),I)}},z=function(a,b){var c=x(a),d={};return f.bind(c,function(a){var c=!e.hasKey(d,a)&&e.hasKey(b,a)&&b[a].isSupported()?[b[a].sketch()]:[];return d[a]=!0,c})};return{identify:x,setup:y,detect:z}}),g("3o",["6","a"],function(a,b){var c=function(b,c,d,e,f,g,h){return{target:a.constant(b),x:a.constant(c),y:a.constant(d),stop:e,prevent:f,kill:g,raw:a.constant(h)}},d=function(d,e){return function(f){if(d(f)){var g=b.fromDom(f.target),h=function(){f.stopPropagation()},i=function(){f.preventDefault()},j=a.compose(i,h),k=c(g,f.clientX,f.clientY,h,i,j,f);e(k)}}},e=function(b,c,e,f,g){var i=d(e,f);return b.dom().addEventListener(c,i,g),{unbind:a.curry(h,b,c,i,g)}},f=function(a,b,c,d){return e(a,b,c,d,!1)},g=function(a,b,c,d){return e(a,b,c,d,!0)},h=function(a,b,c,d){a.dom().removeEventListener(b,c,d)};return{bind:f,capture:g}}),g("1u",["6","3o"],function(a,b){var c=a.constant(!0),d=function(a,d,e){return b.bind(a,d,c,e)},e=function(a,d,e){return b.capture(a,d,c,e)};return{bind:d,capture:e}}),h("1v",clearInterval),h("1x",setInterval),g("j",["6","z","7","1u","a","1v","1w","1x"],function(a,b,c,d,e,f,g,h){var i=50,j=1e3/i,k=function(b){var c=b.matchMedia("(orientation: portrait)").matches;return{isPortrait:a.constant(c)}},l=function(a){var b=c.detect().os.isiOS(),d=k(a).isPortrait();return b&&!d?a.screen.height:a.screen.width},m=function(a,c){var g=e.fromDom(a),l=null,m=function(){f(l);var b=k(a);c.onChange(b),o(function(){c.onReady(b)})},n=d.bind(g,"orientationchange",m),o=function(c){f(l);var d=a.innerHeight,e=0;l=h(function(){d!==a.innerHeight?(f(l),c(b.some(a.innerHeight))):e>j&&(f(l),c(b.none())),e++},i)},p=function(){n.unbind()};return{onAdjustment:o,destroy:p}};return{get:k,onChange:m,getActualWidth:l}}),h("86",clearTimeout),g("9e",["86","1j"],function(a,b){return function(c,d){var e=null,f=function(){var a=arguments;e=b(function(){c.apply(null,a),e=null},d)},g=function(){null!==e&&(a(e),e=null)};return{cancel:g,schedule:f}}}),g("8c",["9e","2g","t","14","5","6","z","1a","1w"],function(a,b,c,d,e,f,g,h,i){var j=5,k=400,l=function(a){return void 0===a.raw().touches||1!==a.raw().touches.length?g.none():g.some(a.raw().touches[0])},m=function(a,b){var c=i.abs(a.clientX-b.x()),d=i.abs(a.clientY-b.y());return c>j||d>j},n=function(i){var j=e(g.none()),n=a(function(a){j.set(g.none()),i.triggerEvent(c.longpress(),a)},k),o=function(a){return l(a).each(function(b){n.cancel();var c={x:f.constant(b.clientX),y:f.constant(b.clientY),target:a.target};n.schedule(c),j.set(g.some(c))}),g.none()},p=function(a){return n.cancel(),l(a).each(function(a){j.get().each(function(b){m(a,b)&&j.set(g.none())})}),g.none()},q=function(a){n.cancel();var b=function(b){return h.eq(b.target(),a.target())};return j.get().filter(b).map(function(b){return i.triggerEvent(c.tap(),a)})},r=d.wrapAll([{key:b.touchstart(),value:o},{key:b.touchmove(),value:p},{key:b.touchend(),value:q}]),s=function(a,b){return d.readOptFrom(r,b).bind(function(b){return b(a)})};return{fireIfReady:s}};return{monitor:n}}),g("81",["8c","1u"],function(a,b){var c=function(c){var d=a.monitor({triggerEvent:function(a,b){c.onTapContent(b)}}),e=function(){return b.bind(c.body(),"touchend",function(a){d.fireIfReady(a,"touchend")})},f=function(){return b.bind(c.body(),"touchmove",function(a){d.fireIfReady(a,"touchmove")})},g=function(a){d.fireIfReady(a,"touchstart")};return{fireTouchstart:g,onTouchend:e,onTouchmove:f}};return{monitor:c}}),g("5x",["1g","y","6","7","1a","8","1u","a","b","10","81"],function(a,b,c,d,e,f,g,h,i,j,k){var l=d.detect().os.version.major>=6,m=function(d,m,n){var o=k.monitor(d),p=j.owner(m),q=function(a){return!e.eq(a.start(),a.finish())||a.soffset()!==a.foffset()},r=function(){return f.active(p).filter(function(a){return"input"===i.name(a)}).exists(function(a){return a.dom().selectionStart!==a.dom().selectionEnd})},s=function(){var b=d.doc().dom().hasFocus()&&d.getSelection().exists(q);n.getByDom(m).each((b||r())===!0?a.on:a.off)},t=[g.bind(d.body(),"touchstart",function(a){d.onTouchContent(),o.fireTouchstart(a)}),o.onTouchmove(),o.onTouchend(),g.bind(m,"touchstart",function(a){d.onTouchToolstrip()}),d.onToReading(function(){f.blur(d.body())}),d.onToEditing(c.noop),d.onScrollToCursor(function(a){a.preventDefault(),d.getCursorBox().each(function(a){var b=d.win(),c=a.top()>b.innerHeight||a.bottom()>b.innerHeight,e=c?a.bottom()-b.innerHeight+50:0;0!==e&&b.scrollTo(b.pageXOffset,b.pageYOffset+e)})})].concat(l===!0?[]:[g.bind(h.fromDom(d.win()),"blur",function(){n.getByDom(m).each(a.off)}),g.bind(p,"select",s),g.bind(d.doc(),"selectionchange",s)]),u=function(){b.each(t,function(a){a.unbind()})};return{destroy:u}};return{initEvents:m}}),g("82",["y","6","8","a","b","1j"],function(a,b,c,d,e,f){var g=function(){return function(a){f(function(){a()},0)}},h=function(f){f.focus();var h=d.fromDom(f.document.body),i=c.active().exists(function(b){return a.contains(["input","textarea"],e.name(b))}),j=i?g(h):b.apply;j(function(){c.active().each(c.blur),c.focus(h)})};return{resume:h}}),h("9f",isNaN),h("8h",parseInt),g("83",["4i","9f","8h"],function(a,b,c){var d=function(d,e){var f=c(a.get(d,e),10);return b(f)?0:f};return{safeParse:d}}),g("aa",["7","z","v"],function(a,b,c){return function(d,e){var f=function(a){if(!d(a))throw new c("Can only get "+e+" value of a "+e+" node");return j(a).getOr("")},g=function(a){try{return h(a)}catch(a){return b.none()}},h=function(a){return d(a)?b.from(a.dom().nodeValue):b.none()},i=a.detect().browser,j=i.isIE()&&10===i.version.major?g:h,k=function(a,b){if(!d(a))throw new c("Can only set raw "+e+" value of a "+e+" node");a.dom().nodeValue=b};return{get:f,getOption:j,set:k}}}),g("a3",["b","aa"],function(a,b){var c=b(a.isText,"text"),d=function(a){return c.get(a)},e=function(a){return c.getOption(a)},f=function(a,b){c.set(a,b)};return{get:d,getOption:e,set:f}}),g("9g",["y","b","a3","10"],function(a,b,c,d){var e=function(a){return"img"===b.name(a)?1:c.getOption(a).fold(function(){return d.children(a).length},function(a){return a.length})},f=function(a,b){return e(a)===b},g=function(a,b){return 0===b},h="\xa0",i=function(a){return c.getOption(a).filter(function(a){return 0!==a.trim().length||a.indexOf(h)>-1}).isSome()},j=["img","br"],k=function(c){var d=i(c);return d||a.contains(j,b.name(c))};return{getEnd:e,isEnd:f,isStart:g,isCursorPosition:k}}),g("a4",["6k","6"],function(a,b){var c=a.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),d=function(a,b,c,d){return a.fold(b,c,d)},e=function(a){return a.fold(b.identity,b.identity,b.identity)};return{before:c.before,on:c.on,after:c.after,cata:d,getStart:e}}),g("9h",["6k","2o","a","10","a4"],function(a,b,c,d,e){var f=a.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),g=b.immutable("start","soffset","finish","foffset"),h=function(a){return f.exact(a.start(),a.soffset(),a.finish(),a.foffset())},i=function(a){return a.match({domRange:function(a){return c.fromDom(a.startContainer)},relative:function(a,b){return e.getStart(a)},exact:function(a,b,c,d){return a}})},j=function(a){var b=i(a);return d.defaultView(b)};return{domRange:f.domRange,relative:f.relative,exact:f.exact,exactFromRange:h,range:g,getWin:j}}),g("9i",["1a","a","10"],function(a,b,c){var d=function(a,b,d,e){var f=c.owner(a),g=f.dom().createRange();return g.setStart(a.dom(),b),g.setEnd(d.dom(),e),g},e=function(a,c,e,f){var g=d(a,c,e,f);return b.fromDom(g.commonAncestorContainer)},f=function(b,c,e,f){var g=d(b,c,e,f),h=a.eq(b,e)&&c===f;return g.collapsed&&!h};return{after:f,commonAncestorContainer:e}}),g("9j",["y","a","1b"],function(a,b,c){var d=function(d,e){var f=e||c,g=f.createDocumentFragment();return a.each(d,function(a){g.appendChild(a.dom())}),b.fromDom(g)};return{fromElements:d}}),g("9k",["6","z","1a","a"],function(a,b,c,d){var e=function(a,b){var c=a.document.createRange();return f(c,b),c},f=function(a,b){a.selectNodeContents(b.dom())},g=function(a,b){return b.compareBoundaryPoints(a.END_TO_START,a)<1&&b.compareBoundaryPoints(a.START_TO_END,a)>-1},h=function(a){return a.document.createRange()},i=function(a,b){b.fold(function(b){a.setStartBefore(b.dom())},function(b,c){a.setStart(b.dom(),c)},function(b){a.setStartAfter(b.dom())})},j=function(a,b){b.fold(function(b){a.setEndBefore(b.dom())},function(b,c){a.setEnd(b.dom(),c)},function(b){a.setEndAfter(b.dom())})},k=function(a,b){o(a),a.insertNode(b.dom())},l=function(a,b,d,e){return c.eq(a,d)&&b===e},m=function(a,b,c){var d=a.document.createRange();return i(d,b),j(d,c),d},n=function(a,b,c,d,e){var f=a.document.createRange();return f.setStart(b.dom(),c),f.setEnd(d.dom(),e),f},o=function(a){a.deleteContents()},p=function(a){var b=a.cloneContents();return d.fromDom(b)},q=function(b){return{left:a.constant(b.left),top:a.constant(b.top),right:a.constant(b.right),bottom:a.constant(b.bottom),width:a.constant(b.width),height:a.constant(b.height)}},r=function(a){var c=a.getClientRects(),d=c.length>0?c[0]:a.getBoundingClientRect();return d.width>0||d.height>0?b.some(d).map(q):b.none()},s=function(a){var c=a.getBoundingClientRect();return c.width>0||c.height>0?b.some(c).map(q):b.none()},t=function(a){return a.toString()};return{create:h,replaceWith:k,selectNodeContents:e,selectNodeContentsUsing:f,isCollapsed:l,relativeToNative:m,exactToNative:n,deleteContents:o,cloneFragment:p,getFirstRect:r,getBounds:s,isWithin:g,toString:t}}),g("9l",["6k","6","z","17","a","9k"],function(a,b,c,d,e,f){var g=a.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),h=function(a,b,c){return b(e.fromDom(c.startContainer),c.startOffset,e.fromDom(c.endContainer),c.endOffset)},i=function(a,e){return e.match({domRange:function(a){return{ltr:b.constant(a),rtl:c.none}},relative:function(b,e){return{ltr:d.cached(function(){return f.relativeToNative(a,b,e)}),rtl:d.cached(function(){return c.some(f.relativeToNative(a,e,b))})}},exact:function(b,e,g,h){return{ltr:d.cached(function(){return f.exactToNative(a,b,e,g,h)}),rtl:d.cached(function(){return c.some(f.exactToNative(a,g,h,b,e))})}}})},j=function(a,b){var c=b.ltr();if(c.collapsed){var d=b.rtl().filter(function(a){return a.collapsed===!1});return d.map(function(a){return g.rtl(e.fromDom(a.endContainer),a.endOffset,e.fromDom(a.startContainer),a.startOffset)}).getOrThunk(function(){return h(a,g.ltr,c)})}return h(a,g.ltr,c)},k=function(a,b){var c=i(a,b);return j(a,c)},l=function(a,b){var c=k(a,b);return c.match({ltr:function(b,c,d,e){var f=a.document.createRange();return f.setStart(b.dom(),c),f.setEnd(d.dom(),e),f},rtl:function(b,c,d,e){var f=a.document.createRange();return f.setStart(d.dom(),e),f.setEnd(b.dom(),c),f}})};return{ltr:g.ltr,rtl:g.rtl,diagnose:k,asLtrRange:l}}),g("ab",["1w"],function(a){var b=function(b,c,d,e,f){if(0===f)return 0;if(c===e)return f-1;for(var g=e,h=1;hi.bottom);else{if(dg)return h-1;g=j}}return 0},c=function(a,b,c){return b>=a.left&&b<=a.right&&c>=a.top&&c<=a.bottom};return{inRect:c,searchForPoint:b}}),g("ac",["z","15","a3","ab","1w"],function(a,b,c,d,e){var f=function(a,b,e,f,g){var h=function(c){var d=a.dom().createRange();return d.setStart(b.dom(),c),d.collapse(!0),d},i=function(a){var b=h(a);return b.getBoundingClientRect()},j=c.get(b).length,k=d.searchForPoint(i,e,f,g.right,j);return h(k)},g=function(c,e,g,h){var i=c.dom().createRange();i.selectNode(e.dom());var j=i.getClientRects(),k=b.findMap(j,function(b){return d.inRect(b,g,h)?a.some(b):a.none()});return k.map(function(a){return f(c,e,g,h,a)})};return{locate:g}}),g("a5",["z","15","b","10","ab","ac","1w"],function(a,b,c,d,e,f,g){var h=function(c,f,g,h){var j=c.dom().createRange(),k=d.children(f);return b.findMap(k,function(b){return j.selectNode(b.dom()),e.inRect(j.getBoundingClientRect(),g,h)?i(c,b,g,h):a.none()})},i=function(a,b,d,e){var g=c.isText(b)?f.locate:h;return g(a,b,d,e)},j=function(a,b,c,d){var e=a.dom().createRange();e.selectNode(b.dom());var f=e.getBoundingClientRect(),h=g.max(f.left,g.min(f.right,c)),j=g.max(f.top,g.min(f.bottom,d));return i(a,b,h,j)};return{locate:j}}),g("ad",["z","2u","10","9g"],function(a,b,c,d){var e=function(a){return b.descendant(a,d.isCursorPosition)},f=function(a){return g(a,d.isCursorPosition)},g=function(b,d){var e=function(b){for(var f=c.children(b),g=f.length-1;g>=0;g--){var h=f[g];if(d(h))return a.some(h);var i=e(h);if(i.isSome())return i}return a.none()};return e(b)};return{first:e,last:f}}),g("a6",["z","10","ad"],function(a,b,c){var d=!0,e=!1,f=function(a,b){return b-a.left0){var d=b.getRangeAt(0),e=b.getRangeAt(b.rangeCount-1);return a.some(f.range(c.fromDom(d.startContainer),d.startOffset,c.fromDom(e.endContainer),e.endOffset))}return a.none()},t=function(d){var e=c.fromDom(d.anchorNode),g=c.fromDom(d.focusNode);return b.after(e,d.anchorOffset,g,d.focusOffset)?a.some(f.range(c.fromDom(d.anchorNode),d.anchorOffset,c.fromDom(d.focusNode),d.focusOffset)):s(d)},u=function(a,b){var c=g.selectNodeContents(a,b);l(a,c)},v=function(a,b){var d=g.selectNodeContents(a,b);return f.range(c.fromDom(d.startContainer),d.startOffset,c.fromDom(d.endContainer),d.endOffset)},w=function(b){var c=b.getSelection();return c.rangeCount>0?t(c):a.none()},x=function(a){return w(a).map(function(a){return f.exact(a.start(),a.soffset(),a.finish(),a.foffset())})},y=function(a,b){var c=h.asLtrRange(a,b);return g.getFirstRect(c)},z=function(a,b){var c=h.asLtrRange(a,b);return g.getBounds(c)},A=function(a,b,c){return i.fromPoint(a,b,c)},B=function(a,b){var c=h.asLtrRange(a,b);return g.toString(c)},C=function(a){var b=a.getSelection();b.removeAllRanges()},D=function(a,b){var c=h.asLtrRange(a,b);return g.cloneFragment(c)},E=function(a,b,c){var e=h.asLtrRange(a,b),f=d.fromElements(c,a.document);g.replaceWith(e,f)},F=function(a,b){var c=h.asLtrRange(a,b);g.deleteContents(c)};return{setExact:p,getExact:w,get:x,setRelative:q,toNative:r,setToElement:u,clear:C,clone:D,replace:E,deleteAt:F,forElement:v,getFirstRect:y,getBounds:z,getAtPoint:A,findWithin:n,getAsString:B}}),g("84",["y","6","a","10","9g","9h","85"],function(a,b,c,d,e,f,g){var h=2,i=function(a){return{left:a.left,top:a.top,right:a.right,bottom:a.bottom,width:b.constant(h),height:a.height}},j=function(a){return{left:b.constant(a.left),top:b.constant(a.top),right:b.constant(a.right),bottom:b.constant(a.bottom),width:b.constant(a.width),height:b.constant(a.height)}},k=function(b){if(b.collapsed){var h=c.fromDom(b.startContainer);return d.parent(h).bind(function(c){var d=f.exact(h,b.startOffset,c,e.getEnd(c)),j=g.getFirstRect(b.startContainer.ownerDocument.defaultView,d);return j.map(i).map(a.pure)}).getOr([])}return a.map(b.getClientRects(),j)},l=function(a){var b=a.getSelection();return void 0!==b&&b.rangeCount>0?k(b.getRangeAt(0)):[]};return{getRectangles:l}}),g("5y",["6","z","1u","a","4i","1w","82","i","83","84"],function(a,b,c,d,e,f,g,h,i,j){var k=50,l="data-"+h.resolve("last-outer-height"),m=function(a,b){e.set(a,l,b)},n=function(a){return i.safeParse(a,l)},o=function(b){return{top:a.constant(b.top()),bottom:a.constant(b.top()+b.height())}},p=function(a){var c=j.getRectangles(a);return c.length>0?b.some(c[0]).map(o):b.none()},q=function(a,c){var d=n(c),e=a.innerHeight;return d>e?b.some(d-e):b.none()},r=function(a,b,c){var d=b.top()>a.innerHeight||b.bottom()>a.innerHeight;return d?f.min(c,b.bottom()-a.innerHeight+k):0},s=function(a,b){var e=d.fromDom(b.document.body),f=function(){g.resume(b)},h=c.bind(d.fromDom(a),"resize",function(){q(a,e).each(function(a){p(b).each(function(c){var d=r(b,c,a);0!==d&&b.scrollTo(b.pageXOffset,b.pageYOffset+d)})}),m(e,a.innerHeight)});m(e,a.innerHeight);var i=function(){h.unbind()};return{toEditing:f,destroy:i}};return{setup:s}}),g("5z",["6","z","1a","1u","a","85"],function(a,b,c,d,e,f){var g=function(a){return b.some(e.fromDom(a.dom().contentWindow.document.body))},h=function(a){return b.some(e.fromDom(a.dom().contentWindow.document))},i=function(a){return b.from(a.dom().contentWindow)},j=function(a){var b=i(a);return b.bind(f.getExact)},k=function(a){return a.getFrame()},l=function(a,b){return function(c){var d=c[a].getOrThunk(function(){var a=k(c);return function(){return b(a)}});return d()}},m=function(a,b,c,e){return a[c].getOrThunk(function(){return function(a){return d.bind(b,e,a)}})},n=function(b){return{left:a.constant(b.left),top:a.constant(b.top),right:a.constant(b.right),bottom:a.constant(b.bottom),width:a.constant(b.width),height:a.constant(b.height)}},o=function(d){var l=k(d),o=function(a){var d=function(a){return c.eq(a.start(),a.finish())&&a.soffset()===a.foffset()},e=function(a){var c=a.start().dom().getBoundingClientRect();return c.width>0||c.height>0?b.some(c).map(n):b.none()};return f.getExact(a).filter(d).bind(e)};return g(l).bind(function(b){return h(l).bind(function(c){return i(l).map(function(g){var h=e.fromDom(c.dom().documentElement),i=d.getCursorBox.getOrThunk(function(){return function(){return f.get(g).bind(function(a){return f.getFirstRect(g,a).orThunk(function(){return o(g)})})}}),k=d.setSelection.getOrThunk(function(){return function(a,b,c,d){f.setExact(g,a,b,c,d)}}),n=d.clearSelection.getOrThunk(function(){return function(){f.clear(g)}});return{body:a.constant(b),doc:a.constant(c),win:a.constant(g),html:a.constant(h),getSelection:a.curry(j,l),setSelection:k,clearSelection:n,frame:a.constant(l),onKeyup:m(d,c,"onKeyup","keyup"),onNodeChanged:m(d,c,"onNodeChanged","selectionchange"),onDomChanged:d.onDomChanged,onScrollToCursor:d.onScrollToCursor,onScrollToElement:d.onScrollToElement,onToReading:d.onToReading,onToEditing:d.onToEditing,onToolbarScrollStart:d.onToolbarScrollStart,onTouchContent:d.onTouchContent,onTapContent:d.onTapContent,onTouchToolstrip:d.onTouchToolstrip,getCursorBox:i}})})})};return{getBody:l("getBody",g),getDoc:l("getDoc",h),getWin:l("getWin",i),getSelection:l("getSelection",j),getFrame:k,getActiveApi:o}}),g("60",["y","7","4i","39","5l"],function(a,b,c,d,e){var f="data-ephox-mobile-fullscreen-style",g="display:none!important;",h="position:absolute!important;",i="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;",j="background-color:rgb(255,255,255)!important;",k=b.detect().os.isAndroid(),l=function(a){var b=d.get(a,"background-color");return void 0!==b&&""!==b?"background-color:"+b+"!important":j},m=function(b,d){var j=function(a){var b=e.siblings(a,"*");return b},m=function(a){return function(b){var d=c.get(b,"style"),e=void 0===d?"no-styles":d.trim();e!==a&&(c.set(b,f,e),c.set(b,"style",a))}},n=e.ancestors(b,"*"),o=a.bind(n,j),p=l(d);a.each(o,m(g)),a.each(n,m(h+i+p));var q=k===!0?"":h;m(q+i+p)(b)},n=function(){var b=e.all("["+f+"]");a.each(b,function(a){var b=c.get(a,f);"no-styles"!==b?c.set(a,"style",b):c.remove(a,"style"),c.remove(a,f)})};return{clobberStyles:m,restoreStyles:n}}),g("61",["9","a","4i","4u"],function(a,b,c,d){var e=function(){var e=d.first("head").getOrDie(),f=function(){var d=b.fromTag("meta");return c.set(d,"name","viewport"),a.append(e,d),d},g=d.first('meta[name="viewport"]').getOrThunk(f),h=c.get(g,"content"),i=function(){c.set(g,"content","width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0")},j=function(){void 0!==h&&null!==h&&h.length>0?c.set(g,"content",h):c.set(g,"content","user-scalable=yes")};return{maximize:i,restore:j}};return{tag:e}}),g("3r",["1z","2f","5x","5y","5z","60","i","61"],function(a,b,c,d,e,f,g,h){var i=function(i,j){var k=h.tag(),l=a.api(),m=a.api(),n=function(){j.hide(),b.add(i.container,g.resolve("fullscreen-maximized")),b.add(i.container,g.resolve("android-maximized")),k.maximize(),b.add(i.body,g.resolve("android-scroll-reload")),l.set(d.setup(i.win,e.getWin(i.editor).getOrDie("no"))),e.getActiveApi(i.editor).each(function(a){f.clobberStyles(i.container,a.body()),m.set(c.initEvents(a,i.toolstrip,i.alloy))})},o=function(){k.restore(),j.show(),b.remove(i.container,g.resolve("fullscreen-maximized")),b.remove(i.container,g.resolve("android-maximized")),f.restoreStyles(),b.remove(i.body,g.resolve("android-scroll-reload")),m.clear(),l.clear()};return{enter:n,exit:o}};return{create:i}}),g("3s",["29","2e","6","a","10","1k"],function(a,b,c,d,e,f){return b.objOf([a.strictObjOf("editor",[a.strict("getFrame"),a.option("getBody"),a.option("getDoc"),a.option("getWin"),a.option("getSelection"),a.option("setSelection"),a.option("clearSelection"),a.option("cursorSaver"),a.option("onKeyup"),a.option("onNodeChanged"),a.option("getCursorBox"),a.strict("onDomChanged"),a.defaulted("onTouchContent",c.noop),a.defaulted("onTapContent",c.noop),a.defaulted("onTouchToolstrip",c.noop),a.defaulted("onScrollToCursor",c.constant({unbind:c.noop})),a.defaulted("onScrollToElement",c.constant({unbind:c.noop})),a.defaulted("onToEditing",c.constant({unbind:c.noop})),a.defaulted("onToReading",c.constant({unbind:c.noop})),a.defaulted("onToolbarScrollStart",c.identity)]),a.strict("socket"),a.strict("toolstrip"),a.strict("dropup"),a.strict("toolbar"),a.strict("container"),a.strict("alloy"),a.state("win",function(a){return e.owner(a.socket).dom().defaultView}),a.state("body",function(a){return d.fromDom(a.socket.dom().ownerDocument.body)}),a.defaulted("translate",c.identity),a.defaulted("setReadOnly",c.noop)])}),g("62",["86","1j"],function(a,b){var c=function(c,d){var e=null,f=null,g=function(){null!==e&&(a(e),e=null,f=null)},h=function(){f=arguments,null===e&&(e=b(function(){c.apply(null,f),e=null,f=null},d))};return{cancel:g,throttle:h}},d=function(c,d){var e=null,f=function(){null!==e&&(a(e),e=null)},g=function(){var a=arguments;null===e&&(e=b(function(){c.apply(null,a),e=null,a=null},d))};return{cancel:f,throttle:g}},e=function(c,d){var e=null,f=function(){null!==e&&(a(e),e=null)},g=function(){var f=arguments;null!==e&&a(e),e=b(function(){c.apply(null,f),e=null,f=null},d)};return{cancel:f,throttle:g}};return{adaptable:c,first:d,last:e}}),g("3t",["q","1g","1h","1n","3v","62","1j","i","1o"],function(a,b,c,d,e,f,g,h,i){var j=function(g,j){var k=c.record(e.sketch({dom:i.dom(''),containerBehaviours:a.derive([b.config({toggleClass:h.resolve("mask-tap-icon-selected"),toggleOnExecute:!1})])})),l=f.first(g,200);return e.sketch({dom:i.dom('
      '),components:[e.sketch({dom:i.dom('
      '), +components:[d.sketch({dom:i.dom('
      '),components:[k.asSpec()],action:function(a){l.throttle()},buttonBehaviours:a.derive([b.config({toggleClass:h.resolve("mask-tap-icon-selected")})])})]})]})};return{sketch:j}}),g("20",["3q","2e","6","9","39","3r","3s","3t"],function(a,b,c,d,e,f,g,h){var i=function(i){var j=b.asRawOrDie("Getting AndroidWebapp schema",g,i);e.set(j.toolstrip,"width","100%");var k=function(){j.setReadOnly(!0),n.enter()},l=a.build(h.sketch(k,j.translate));j.alloy.add(l);var m={show:function(){j.alloy.add(l)},hide:function(){j.alloy.remove(l)}};d.append(j.container,l.element());var n=f.create(j,m);return{setReadOnly:j.setReadOnly,refreshStructure:c.noop,enter:n.enter,exit:n.exit,destroy:c.noop}};return{produce:i}}),g("63",["q","1y","4q","53","29","6"],function(a,b,c,d,e,f){var g=[e.defaulted("shell",!0),e.defaulted("toolbarBehaviours",{})],h=function(c){return{behaviours:a.derive([b.config({})])}},i=[d.optional({name:"groups",overrides:h})];return{name:f.constant("Toolbar"),schema:f.constant(g),parts:f.constant(i)}}),g("3w",["q","1y","34","52","63","w","z","16","v"],function(a,b,c,d,e,f,g,h,i){var j=function(c,e,j,k){var l=function(a,c){m(a).fold(function(){throw h.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new i("Toolbar was defined to not be a shell, but no groups container was specified in components")},function(a){b.set(a,c)})},m=function(a){return c.shell()?g.some(a):d.getPart(a,c,"groups")},n=c.shell()?{behaviours:[b.config({})],components:[]}:{behaviours:[],components:e};return{uid:c.uid(),dom:c.dom(),components:n.components,behaviours:f.deepMerge(a.derive(n.behaviours),c.toolbarBehaviours()),apis:{setGroups:l},domModification:{attributes:{role:"group"}}}};return c.composite({name:"Toolbar",configFields:e.schema(),partFields:e.parts(),factory:j,apis:{setGroups:function(a,b,c){a.setGroups(b,c)}}})}),g("65",["4q","53","29","6"],function(a,b,c,d){var e=[c.strict("items"),a.markers(["itemClass"]),c.defaulted("hasTabstop",!0),c.defaulted("tgroupBehaviours",{})],f=[b.group({name:"items",unit:"item",overrides:function(a){return{domModification:{classes:[a.markers().itemClass()]}}}})];return{name:d.constant("ToolbarGroup"),schema:d.constant(e),parts:d.constant(f)}}),g("3x",["q","33","64","34","65","w","v"],function(a,b,c,d,e,f,g){var h=function(d,e,g,h){return f.deepMerge({dom:{attributes:{role:"toolbar"}}},{uid:d.uid(),dom:d.dom(),components:e,behaviours:f.deepMerge(a.derive([b.config({mode:"flow",selector:"."+d.markers().itemClass()}),d.hasTabstop()?c.config({}):c.revoke()]),d.tgroupBehaviours()),"debug.sketcher":g["debug.sketcher"]})};return d.composite({name:"ToolbarGroup",configFields:e.schema(),partFields:e.parts(),factory:h})}),g("3y",["6","1u","4i","4u","i"],function(a,b,c,d,e){var f="data-"+e.resolve("horizontal-scroll"),g=function(a){a.dom().scrollTop=1;var b=0!==a.dom().scrollTop;return a.dom().scrollTop=0,b},h=function(a){a.dom().scrollLeft=1;var b=0!==a.dom().scrollLeft;return a.dom().scrollLeft=0,b},i=function(a){return a.dom().scrollTop>0||g(a)},j=function(a){return a.dom().scrollLeft>0||h(a)},k=function(a){c.set(a,f,"true")},l=function(a){return"true"===c.get(a,f)?j:i},m=function(c,e){return b.bind(c,"touchmove",function(b){d.closest(b.target(),e).filter(l).fold(function(){b.raw().preventDefault()},a.noop)})};return{exclusive:m,markAsHorizontal:k}}),g("21",["3u","q","33","1g","3q","3d","3v","3w","3x","y","5","6","39","3y","i","3z","1o"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){return function(){var r=function(c){var d=c.scrollable===!0?"${prefix}-toolbar-scrollable-group":"";return{dom:q.dom('
      '),tgroupBehaviours:b.derive([a.config("adhoc-scrollable-toolbar",c.scrollable===!0?[f.runOnInit(function(a,b){m.set(a.element(),"overflow-x","auto"),n.markAsHorizontal(a.element()),p.register(a.element())})]:[])]),components:[g.sketch({components:[i.parts().items({})]})],markers:{itemClass:o.resolve("toolbar-group-item")},items:c.items}},s=e.build(h.sketch({dom:q.dom('
      '),components:[h.parts().groups({})],toolbarBehaviours:b.derive([d.config({toggleClass:o.resolve("context-toolbar"),toggleOnExecute:!1,aria:{mode:"none"}}),c.config({mode:"cyclic"})]),shell:!0})),t=e.build(g.sketch({dom:{classes:[o.resolve("toolstrip")]},components:[e.premade(s)],containerBehaviours:b.derive([d.config({toggleClass:o.resolve("android-selection-context-toolbar"),toggleOnExecute:!1})])})),u=function(){h.setGroups(s,v.get()),d.off(s)},v=k([]),w=function(a){v.set(a),u()},x=function(a){return j.map(a,l.compose(i.sketch,r))},y=function(){h.refresh(s)},z=function(a){d.on(s),h.setGroups(s,a)},A=function(){d.isOn(s)&&u()},B=function(){c.focusIn(s)};return{wrapper:l.constant(t),toolbar:l.constant(s),createGroups:x,setGroups:w,setContextToolbar:z,restoreToolbar:A,refresh:y,focus:B}}}),g("22",["q","1y","1","3q","1n","3v","6","2f","i","1o"],function(a,b,c,d,e,f,g,h,i,j){var k=function(a){return d.build(e.sketch({dom:j.dom('
      '),action:function(){a.run(function(a){a.setReadOnly(!1)})}}))},l=function(){return d.build(f.sketch({dom:j.dom('
      '),components:[],containerBehaviours:a.derive([b.config({})])}))},m=function(a,c){b.append(a,d.premade(c))},n=function(a,c){b.remove(a,c)},o=function(a,b,d,e){var f=d===!0?c.toAlpha:c.toOmega;f(e);var g=d?m:n;g(a,b)};return{makeEditSwitch:k,makeSocket:l,updateMode:o}}),g("67",["2f","89","39"],function(a,b,c){var d=function(a,b){return b.getAnimationRoot().fold(function(){return a.element()},function(b){return b(a)})},e=function(a){return a.dimension().property()},f=function(a,b){return a.dimension().getDimension()(b)},g=function(a,c){var e=d(a,c);b.remove(e,[c.shrinkingClass(),c.growingClass()])},h=function(b,d){a.remove(b.element(),d.openClass()),a.add(b.element(),d.closedClass()),c.set(b.element(),e(d),"0px"),c.reflow(b.element())},i=function(a,b){j(a,b);var c=f(b,a.element());return h(a,b),c},j=function(b,d){a.remove(b.element(),d.closedClass()),a.add(b.element(),d.openClass()),c.remove(b.element(),e(d))},k=function(a,b,d){d.setCollapsed(),c.set(a.element(),e(b),f(b,a.element())),c.reflow(a.element()),g(a,b),h(a,b),b.onStartShrink()(a),b.onShrunk()(a)},l=function(b,g,i){i.setCollapsed(),c.set(b.element(),e(g),f(g,b.element())),c.reflow(b.element());var j=d(b,g);a.add(j,g.shrinkingClass()),h(b,g),g.onStartShrink()(b)},m=function(b,f,g){var h=i(b,f),k=d(b,f);a.add(k,f.growingClass()),j(b,f),c.set(b.element(),e(f),h),g.setExpanded(),f.onStartGrow()(b)},n=function(a,b,c){c.isExpanded()||m(a,b,c)},o=function(a,b,c){c.isExpanded()&&l(a,b,c)},p=function(a,b,c){c.isExpanded()&&k(a,b,c)},q=function(a,b,c){return c.isExpanded()},r=function(a,b,c){return c.isCollapsed()},s=function(b,c,e){var f=d(b,c);return a.has(f,c.growingClass())===!0},t=function(b,c,e){var f=d(b,c);return a.has(f,c.shrinkingClass())===!0},u=function(a,b,c){return s(a,b,c)===!0||t(a,b,c)===!0},v=function(a,b,c){var d=c.isExpanded()?l:m;d(a,b,c)};return{grow:n,shrink:o,immediateShrink:p,hasGrown:q,hasShrunk:r,isGrowing:s,isShrinking:t,isTransitioning:u,toggleGrow:v,disableTransitions:g}}),g("66",["3d","2g","67","4b","14","39"],function(a,b,c,d,e,f){var g=function(a,b){var c=b.expanded();return c?d.nu({classes:[b.openClass()],styles:{}}):d.nu({classes:[b.closedClass()],styles:e.wrap(b.dimension().property(),"0px")})},h=function(d,e){return a.derive([a.run(b.transitionend(),function(a,b){var g=b.event().raw();if(g.propertyName===d.dimension().property()){c.disableTransitions(a,d,e),e.isExpanded()&&f.remove(a.element(),d.dimension().property());var h=e.isExpanded()?d.onGrown():d.onShrunk();h(a,b)}})])};return{exhibit:g,events:h}}),g("68",["4q","29","2e","8a","5m"],function(a,b,c,d,e){return[b.strict("closedClass"),b.strict("openClass"),b.strict("shrinkingClass"),b.strict("growingClass"),b.option("getAnimationRoot"),a.onHandler("onShrunk"),a.onHandler("onStartShrink"),a.onHandler("onGrown"),a.onHandler("onStartGrow"),b.defaulted("expanded",!1),b.strictOf("dimension",c.choose("property",{width:[a.output("property","width"),a.output("getDimension",function(a){return e.get(a)+"px"})],height:[a.output("property","height"),a.output("getDimension",function(a){return d.get(a)+"px"})]}))]}),g("69",["4g","5","6"],function(a,b,c){var d=function(d){var e=b(d.expanded()),f=function(){return"expanded: "+e.get()};return a({isExpanded:function(){return e.get()===!0},isCollapsed:function(){return e.get()===!1},setCollapsed:c.curry(e.set,!1),setExpanded:c.curry(e.set,!0),readState:f})};return{init:d}}),g("40",["q","66","67","68","69"],function(a,b,c,d,e){return a.create({fields:d,name:"sliding",active:b,apis:c,state:e})}),g("23",["q","1y","40","3q","3v","6","1k","1l","i"],function(a,b,c,d,e,f,g,h,i){var j=function(j,k){var l=d.build(e.sketch({dom:{tag:"div",classes:i.resolve("dropup")},components:[],containerBehaviours:a.derive([b.config({}),c.config({closedClass:i.resolve("dropup-closed"),openClass:i.resolve("dropup-open"),shrinkingClass:i.resolve("dropup-shrinking"),growingClass:i.resolve("dropup-growing"),dimension:{property:"height"},onShrunk:function(a){j(),k(),b.set(a,[])},onGrown:function(a){j(),k()}}),h.orientation(function(a,b){n(f.noop)})])})),m=function(a,d,e){c.hasShrunk(l)===!0&&c.isTransitioning(l)===!1&&g.requestAnimationFrame(function(){d(e),b.set(l,[a()]),c.grow(l)})},n=function(a){g.requestAnimationFrame(function(){a(),c.shrink(l)})};return{appear:m,disappear:n,component:f.constant(l),element:l.element}};return{build:j}}),g("6c",["8b","t","8c","29","2e","y","7","1u","b","10","1j"],function(a,b,c,d,e,f,g,h,i,j,k){var l=function(b){return b.raw().which===a.BACKSPACE()[0]&&!f.contains(["input","textarea"],i.name(b.target()))},m=g.detect().browser.isFirefox(),n=e.objOfOnly([d.strictFunction("triggerEvent"),d.strictFunction("broadcastEvent"),d.defaulted("stopBackspace",!0)]),o=function(a,b){return m?h.capture(a,"focus",b):h.bind(a,"focusin",b)},p=function(a,b){return m?h.capture(a,"blur",b):h.bind(a,"focusout",b)},q=function(a,d){var i=e.asRawOrDie("Getting GUI events settings",n,d),m=g.detect().deviceType.isTouch()?["touchstart","touchmove","touchend","gesturestart"]:["mousedown","mouseup","mouseover","mousemove","mouseout","click"],q=c.monitor(i),r=f.map(m.concat(["selectstart","input","contextmenu","change","transitionend","dragstart","dragover","drop"]),function(b){return h.bind(a,b,function(a){q.fireIfReady(a,b).each(function(b){b&&a.kill()});var c=i.triggerEvent(b,a);c&&a.kill()})}),s=h.bind(a,"keydown",function(a){var b=i.triggerEvent("keydown",a);b?a.kill():i.stopBackspace===!0&&l(a)&&a.prevent()}),t=o(a,function(a){var b=i.triggerEvent("focusin",a);b&&a.kill()}),u=p(a,function(a){var c=i.triggerEvent("focusout",a);c&&a.kill(),k(function(){i.triggerEvent(b.postBlur(),a)},0)}),v=j.defaultView(a),w=h.bind(v,"scroll",function(a){var c=i.broadcastEvent(b.windowScroll(),a);c&&a.kill()}),x=function(){f.each(r,function(a){a.unbind()}),s.unbind(),t.unbind(),u.unbind(),w.unbind()};return{unbind:x}};return{setup:q}}),g("8d",["14","5"],function(a,b){var c=function(c,d){var e=a.readOptFrom(c,"target").map(function(a){return a()}).getOr(d);return b(e)};return{derive:c}}),g("8e",["5","6","v"],function(a,b,c){var d=function(c,d){var e=a(!1),f=a(!1),g=function(){e.set(!0)},h=function(){f.set(!0)};return{stop:g,cut:h,isStopped:e.get,isCut:f.get,event:b.constant(c),setSource:d.set,getSource:d.get}},e=function(d){var e=a(!1),f=function(){e.set(!0)};return{stop:f,cut:b.noop,isStopped:e.get,isCut:b.constant(!1),event:b.constant(d),setTarget:b.die(new c("Cannot set target of a broadcasted event")),getTarget:b.die(new c("Cannot get target of a broadcasted event"))}},f=function(b,c){var e=a(c);return d(b,e)};return{fromSource:d,fromExternal:e,fromTarget:f}}),g("6d",["6b","8d","8e","6k","y","10","v"],function(a,b,c,d,e,f,g){var h=d.generate([{stopped:[]},{resume:["element"]},{complete:[]}]),i=function(b,d,e,g,i,j){var k=b(d,g),l=c.fromSource(e,i);return k.fold(function(){return j.logEventNoHandlers(d,g),h.complete()},function(b){var c=b.descHandler(),e=a.getHandler(c);return e(l),l.isStopped()?(j.logEventStopped(d,b.element(),c.purpose()),h.stopped()):l.isCut()?(j.logEventCut(d,b.element(),c.purpose()),h.complete()):f.parent(b.element()).fold(function(){return j.logNoParent(d,b.element(),c.purpose()),h.complete()},function(a){return j.logEventResponse(d,b.element(),c.purpose()),h.resume(a)})})},j=function(a,b,c,d,e,f){return i(a,b,c,d,e,f).fold(function(){return!0},function(d){return j(a,b,c,d,e,f)},function(){return!1})},k=function(a,c,d,e,f){var g=b.derive(d,e);return i(a,c,d,e,g,f)},l=function(b,d,f){var g=c.fromExternal(d);return e.each(b,function(b){var c=b.descHandler(),d=a.getHandler(c);d(g)}),g.isStopped()},m=function(a,b,c,d){var e=c.target();return n(a,b,c,e,d)},n=function(a,c,d,e,f){var g=b.derive(d,e);return j(a,c,d,e,g,f)};return{triggerHandler:k,triggerUntilStopped:m,triggerOnUntilStopped:n,broadcast:l}}),g("9p",["2u"],function(a){var b=function(b,c,d){var e=a.closest(b,function(a){return c(a).isSome()},d);return e.bind(c)};return{closest:b}}),g("8f",["9p","6b","30","14","6","x","z","2o","16"],function(a,b,c,d,e,f,g,h,i){var j=h.immutable("element","descHandler"),k=function(a,b){return{id:e.constant(a),descHandler:e.constant(b)}};return function(){var e={},h=function(a,c,d){f.each(d,function(d,f){var g=void 0!==e[f]?e[f]:{};g[c]=b.curryArgs(d,a),e[f]=g})},i=function(a,b){return c.read(b).fold(function(a){return g.none()},function(c){var e=d.readOpt(c);return a.bind(e).map(function(a){return j(b,a)})})},l=function(a){return d.readOptFrom(e,a).map(function(a){return f.mapToArray(a,function(a,b){return k(b,a)})}).getOr([])},m=function(b,c,f){var g=d.readOpt(c),h=g(e);return a.closest(f,function(a){return i(h,a)},b)},n=function(a){f.each(e,function(b,c){b.hasOwnProperty(a)&&delete b[a]})};return{registerId:h,unregisterId:n,filterByType:l,find:m}}}),g("6e",["8f","13","30","14","12","v"],function(a,b,c,d,e,f){return function(){var g=a(),h={},i=function(a){var b=a.element();return c.read(b).fold(function(){return c.write("uid-",a.element())},function(a){return a})},j=function(a,c){var d=h[c];if(d!==a)throw new f('The tagId "'+c+'" is already used by: '+b.element(d.element())+"\nCannot use it for: "+b.element(a.element())+"\nThe conflicting element is"+(e.inBody(d.element())?" ":" not ")+"already in the DOM");l(a)},k=function(a){var b=i(a);d.hasKey(h,b)&&j(a,b);var c=[a];g.registerId(c,b,a.events()),h[b]=a},l=function(a){c.read(a.element()).each(function(a){h[a]=void 0,g.unregisterId(a)})},m=function(a){return g.filterByType(a)},n=function(a,b,c){return g.find(a,b,c)},o=function(a){return d.readOpt(a)(h)};return{find:n,filter:m,register:k,unregister:l,getById:o}}}),g("41",["3q","t","3","6a","3v","4","6b","6c","6d","13","6e","30","y","6","48","1a","8","9","11","b","2f","10","v"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w){var x=function(){var b=a.build(e.sketch({dom:{tag:"div"}}));return y(b)},y=function(e){var j=function(a){return v.parent(e.element()).fold(function(){return!0},function(b){return p.eq(a,b)})},r=k(),u=function(a,b){return r.find(j,a,b)},x=h.setup(e.element(),{triggerEvent:function(a,b){return f.monitorEvent(a,b.target(),function(c){return i.triggerUntilStopped(u,a,b,c)})},broadcastEvent:function(a,b){var c=r.filter(a);return i.broadcast(c,b)}}),y=d({debugInfo:n.constant("real"),triggerEvent:function(a,b,c){f.monitorEvent(a,b,function(d){i.triggerOnUntilStopped(u,a,c,b,d)})},triggerFocus:function(a,c){l.read(a).fold(function(){q.focus(a)},function(d){f.monitorEvent(b.focus(),a,function(d){i.triggerHandler(u,b.focus(),{originator:n.constant(c),target:n.constant(a)},a,d)})})},triggerEscape:function(a,b){y.triggerEvent("keydown",a.element(),b.event())},getByUid:function(a){return H(a)},getByDom:function(a){return I(a)},build:a.build,addToGui:function(a){B(a)},removeFromGui:function(a){C(a)},addToWorld:function(a){z(a)},removeFromWorld:function(a){A(a)},broadcast:function(a){F(a)},broadcastOn:function(a,b){G(a,b)}}),z=function(a){a.connect(y),t.isText(a.element())||(r.register(a),m.each(a.components(),z),y.triggerEvent(b.systemInit(),a.element(),{target:n.constant(a.element())}))},A=function(a){t.isText(a.element())||(m.each(a.components(),A),r.unregister(a)),a.disconnect()},B=function(a){c.attach(e,a)},C=function(a){c.detach(a)},D=function(){x.unbind(),s.remove(e.element())},E=function(a){var c=r.filter(b.receive());m.each(c,function(b){var c=b.descHandler(),d=g.getHandler(c);d(a)})},F=function(a){E({universal:n.constant(!0),data:n.constant(a)})},G=function(a,b){E({universal:n.constant(!1),channels:n.constant(a),data:n.constant(b)})},H=function(a){return r.getById(a).fold(function(){return o.error(new w('Could not find component with uid: "'+a+'" in system.'))},o.value)},I=function(a){return l.read(a).bind(H)};return z(e),{root:n.constant(e),element:e.element,destroy:D,add:B,remove:C,getByUid:H,getByDom:I,addToWorld:z,removeFromWorld:A,broadcast:F,broadcastOn:G}};return{create:x,takeover:y}}),g("24",["q","1","3q","41","3v","6","i"],function(a,b,c,d,e,f,g){var h=f.constant(g.resolve("readonly-mode")),i=f.constant(g.resolve("edit-mode"));return function(f){var j=c.build(e.sketch({dom:{classes:[g.resolve("outer-container")].concat(f.classes)},containerBehaviours:a.derive([b.config({alpha:h(),omega:i()})])}));return d.takeover(j)}}),g("k",["1y","1","6","1z","20","i","21","22","23","24"],function(a,b,c,d,e,f,g,h,i,j){return function(b){var k=j({classes:[f.resolve("android-container")]}),l=g(),m=d.api(),n=h.makeEditSwitch(m),o=h.makeSocket(),p=i.build(c.noop,b);k.add(l.wrapper()),k.add(o),k.add(p.component());var q=function(a){var b=l.createGroups(a);l.setGroups(b)},r=function(a){var b=l.createGroups(a);l.setContextToolbar(b)},s=function(){l.focus()},t=function(){l.restoreToolbar()},u=function(a){m.set(e.produce(a))},v=function(){m.run(function(b){b.exit(),a.remove(o,n)})},w=function(a){h.updateMode(o,n,a,k.root())};return{system:c.constant(k),element:k.element,init:u,exit:v,setToolbarGroups:q,setContextToolbar:r,focusToolbar:s,restoreToolbar:t,updateMode:w,socket:c.constant(o),dropup:c.constant(p)}}}),g("9q",["6"],function(a){var b=function(c,d){var e=function(a,e){return b(c+a,d+e)};return{left:a.constant(c),top:a.constant(d),translate:e}};return b}),g("9r",["6","1a","a","b","2u","1b"],function(a,b,c,d,e,f){var g=function(d,g){var h=g||c.fromDom(f.documentElement);return e.ancestor(d,a.curry(b.eq,h)).isSome()},h=function(a){var b=a.dom();return b===b.window?a:d.isDocument(a)?b.defaultView||b.parentWindow:null};return{attached:g,windowOf:h}}),g("8g",["9q","9r","a"],function(a,b,c){var d=function(b){var c=b.getBoundingClientRect();return a(c.left,c.top)},e=function(a,b){return void 0!==a?a:void 0!==b?b:0},f=function(a){var d=a.dom().ownerDocument,f=d.body,g=b.windowOf(c.fromDom(d)),i=d.documentElement,j=e(g.pageYOffset,i.scrollTop),k=e(g.pageXOffset,i.scrollLeft),l=e(i.clientTop,f.clientTop),m=e(i.clientLeft,f.clientLeft);return h(a).translate(k-m,j-l)},g=function(b){var c=b.dom();return a(c.offsetLeft,c.offsetTop)},h=function(e){var f=e.dom(),g=f.ownerDocument,h=g.body,i=c.fromDom(g.documentElement);return h===f?a(h.offsetLeft,h.offsetTop):b.attached(e,i)?d(f):a(0,0)};return{absolute:f,relative:g,viewport:h}}),g("6f",["8c","y","62","1a","1u","8a","8g","81"],function(a,b,c,d,e,f,g,h){var i=function(a,i,j,k,l){var m=function(){i.run(function(a){a.highlightSelection()})},n=function(){i.run(function(a){a.refreshSelection()})},o=function(a,b){var c=a-k.dom().scrollTop;i.run(function(a){a.scrollIntoView(c,c+b)})},p=function(a){var b=g.absolute(a).top(),c=f.get(a);o(i,k,b,c)},q=function(){a.getCursorBox().each(function(a){o(a.top(),a.height())})},r=function(){i.run(function(a){a.clearSelection()})},s=function(){r(),z.throttle()},t=function(){q(a,i,k),i.run(function(a){a.syncHeight()})},u=function(){var b=f.get(j);i.run(function(a){a.setViewportOffset(b)}),n(i),t(a,i,k)},v=function(){i.run(function(a){a.toEditing()})},w=function(){i.run(function(a){a.toReading()})},x=function(a){i.run(function(b){b.onToolbarTouch(a)})},y=h.monitor(a),z=c.last(t,300),A=[a.onKeyup(s),a.onNodeChanged(n),a.onDomChanged(z.throttle),a.onDomChanged(n),a.onScrollToCursor(function(a){a.preventDefault(),z.throttle()}),a.onScrollToElement(function(a){p(a.element())}),a.onToEditing(v),a.onToReading(w),e.bind(a.doc(),"touchend",function(b){d.eq(a.html(),b.target())||d.eq(a.body(),b.target())}),e.bind(j,"transitionend",function(a){"height"===a.raw().propertyName&&u()}),e.capture(j,"touchstart",function(b){m(),x(b),a.onTouchToolstrip()}),e.bind(a.body(),"touchstart",function(b){r(),a.onTouchContent(),y.fireTouchstart(b)}),y.onTouchmove(),y.onTouchend(),e.bind(a.body(),"click",function(a){a.kill()}),e.bind(j,"touchmove",function(){a.onToolbarScrollStart()})],B=function(){b.each(A,function(a){a.unbind()})};return{destroy:B}};return{initEvents:i}}),g("9s",["8","1j"],function(a,b){var c=function(c){var d=c.dom().selectionStart,e=c.dom().selectionEnd,f=c.dom().selectionDirection;b(function(){c.dom().setSelectionRange(d,e,f),a.focus(c)},50)},d=function(a){var b=a.getSelection();if(b.rangeCount>0){var c=b.getRangeAt(0),d=a.document.createRange();d.setStart(c.startContainer,c.startOffset),d.setEnd(c.endContainer,c.endOffset),b.removeAllRanges(),b.addRange(d)}};return{refreshInput:c,refresh:d}}),g("8p",["1a","8","a","9s"],function(a,b,c,d){var e=function(e,f){b.active().each(function(c){a.eq(c,f)||b.blur(c)}),e.focus(),b.focus(c.fromDom(e.document.body)),d.refresh(e)};return{resume:e}}),g("8i",["y","9","2s","11","1u","a","2f","89","39","10","8p","i","84"],function(a,b,c,d,e,f,g,h,i,j,k,l,m){return function(n,o){var p=n.document,q=f.fromTag("div");g.add(q,l.resolve("unfocused-selections")),b.append(f.fromDom(p.documentElement),q);var r=e.bind(q,"touchstart",function(a){a.prevent(),k.resume(n,o),u()}),s=function(a){var b=f.fromTag("span");return h.add(b,[l.resolve("layer-editor"),l.resolve("unfocused-selection")]),i.setAll(b,{left:a.left()+"px",top:a.top()+"px",width:a.width()+"px",height:a.height()+"px"}),b},t=function(){u();var b=m.getRectangles(n),d=a.map(b,s);c.append(q,d)},u=function(){d.empty(q)},v=function(){r.unbind(),d.remove(q)},w=function(){return j.children(q).length>0};return{update:t,isActive:w,destroy:v,clear:u}}}),g("9w",["y","z","1j"],function(a,b,c){var d=function(e){var f=b.none(),g=[],h=function(a){return d(function(b){i(function(c){b(a(c))})})},i=function(a){k()?m(a):g.push(a)},j=function(a){f=b.some(a),l(g),g=[]},k=function(){return f.isSome()},l=function(b){a.each(b,m)},m=function(a){f.each(function(b){c(function(){a(b)},0)})};return e(j),{get:i,map:h,isReady:k}},e=function(a){return d(function(b){b(a)})};return{nu:d,pure:e}}),g("a7",["u","1j"],function(a,b){var c=function(c){return function(){var d=a.prototype.slice.call(arguments),e=this;b(function(){c.apply(e,d)},0)}};return{bounce:c}}),g("9t",["9w","a7"],function(a,b){var c=function(d){var e=function(a){d(b.bounce(a))},f=function(a){return c(function(b){e(function(c){var d=a(c);b(d)})})},g=function(a){return c(function(b){e(function(c){a(c).get(b)})})},h=function(a){return c(function(b){e(function(c){a.get(b)})})},i=function(){return a.nu(e)};return{map:f,bind:g,anonBind:h,toLazy:i,get:e}},d=function(a){return c(function(b){b(a)})};return{nu:c,pure:d}}),g("9u",["z","1v","1w","1x"],function(a,b,c,d){var e=function(b,d,e){return c.abs(b-d)<=e?a.none():bc.abs(d-g))&&(b(a),m(g))}})},k)};return{animate:f}};return{create:f,adjust:e}}),g("a8",["z","15"],function(a,b){var c=function(c,d){var e=[{width:320,height:480,keyboard:{portrait:300,landscape:240}},{width:320,height:568,keyboard:{portrait:300,landscape:240}},{width:375,height:667,keyboard:{portrait:305,landscape:240}},{width:414,height:736,keyboard:{portrait:320,landscape:240}},{width:768,height:1024,keyboard:{portrait:320,landscape:400}},{width:1024,height:1366,keyboard:{portrait:380,landscape:460}}];return b.findMap(e,function(b){return c<=b.width&&d<=b.height?a.some(b.keyboard):a.none()}).getOr({portrait:d/5,landscape:c/4})};return{findDevice:c}}),g("9v",["39","10","8a","a8","j"],function(a,b,c,d,e){var f=function(a){return d.findDevice(a.screen.width,a.screen.height)},g=function(a){var b=e.get(a).isPortrait(),c=f(a),d=b?c.portrait:c.landscape,g=b?a.screen.height:a.screen.width;return g-a.innerHeight>d?0:d},h=function(a,d){var e=b.owner(a).dom().defaultView,f=c.get(a)+c.get(d),h=g(e);return f-h},i=function(b,d,e){var f=h(d,e),g=c.get(d)+c.get(e)-f;a.set(b,"padding-bottom",g+"px")};return{getGreenzone:h,updatePadding:i}}),g("8n",["6k","y","6","4i","39","5l","10","8a","9v","i","3z","83"],function(a,b,c,d,e,f,g,h,i,j,k,l){var m=a.generate([{fixed:["element","property","offsetY"]},{scroller:["element","offsetY"]}]),n="data-"+j.resolve("position-y-fixed"),o="data-"+j.resolve("y-property"),p="data-"+j.resolve("scrolling"),q="data-"+j.resolve("last-window-height"),r=function(a){return l.safeParse(a,n)},s=function(a){return d.get(a,o)},t=function(a){return l.safeParse(a,q)},u=function(a,b){var c=s(a);return m.fixed(a,c,b)},v=function(a,b){return m.scroller(a,b)},w=function(a){var b=r(a),c="true"===d.get(a,p)?v:u;return c(a,b)},x=function(a){var c=f.descendants(a,"["+n+"]");return b.map(c,w)},y=function(a){var b=d.get(a,"style");e.setAll(a,{position:"absolute",top:"0px"}),d.set(a,n,"0px"),d.set(a,o,"top");var c=function(){d.set(a,"style",b||""),d.remove(a,n),d.remove(a,o)};return{restore:c}},z=function(a,b,c){var f=d.get(c,"style");k.register(c),e.setAll(c,{position:"absolute",height:b+"px",width:"100%",top:a+"px"}),d.set(c,n,a+"px"),d.set(c,p,"true"),d.set(c,o,"top");var g=function(){k.deregister(c),d.set(c,"style",f||""),d.remove(c,n),d.remove(c,p),d.remove(c,o)};return{restore:g}},A=function(a,b,c){var f=d.get(a,"style");e.setAll(a,{position:"absolute",bottom:"0px"}),d.set(a,n,"0px"),d.set(a,o,"bottom");var g=function(){d.set(a,"style",f||""),d.remove(a,n),d.remove(a,o)};return{restore:g}},B=function(a,b,c){var e=g.owner(a).dom().defaultView,f=e.innerHeight;return d.set(a,q,f+"px"),f-b-c},C=function(a,b,f,j){var k=g.owner(a).dom().defaultView,l=y(f),m=h.get(f),o=h.get(j),p=B(a,m,o),q=z(m,p,a),r=A(j,m,p),s=!0,u=function(){s=!1,l.restore(),q.restore(),r.restore()},v=function(){var b=k.innerHeight,c=t(a);return b>c},w=function(){if(s){var c=h.get(f),g=h.get(j),k=B(a,c,g);d.set(a,n,c+"px"),e.set(a,"height",k+"px"),e.set(j,"bottom",-(c+k+g)+"px"),i.updatePadding(b,a,j)}},x=function(b){var c=b+"px";d.set(a,n,c),w()};return i.updatePadding(b,a,j),{setViewportOffset:x,isExpanding:v,isShrinking:c.not(v),refresh:w,restore:u}};return{findFixtures:x,takeover:C,getYFixedData:r}}),g("8j",["6","9t","4i","89","39","10","1w","9u","8n","i","83"],function(a,b,c,d,e,f,g,h,i,j,k){var l=h.create(),m=15,n=10,o=10,p="data-"+j.resolve("last-scroll-top"),q=function(a){var b=e.getRaw(a,"top").getOr(0);return parseInt(b,10)},r=function(a){return parseInt(a.dom().scrollTop,10)},s=function(c,d,f){return b.nu(function(b){var g=a.curry(r,c),h=function(a){c.dom().scrollTop=a,e.set(c,"top",q(c)+m+"px")},i=function(){c.dom().scrollTop=d,e.set(c,"top",f+"px"),b(d)};l.animate(g,d,m,h,i,o)})},t=function(d,e){return b.nu(function(b){var f=a.curry(r,d);c.set(d,p,f());var h=function(a,b){var e=k.safeParse(d,p);e!==d.dom().scrollTop?b(d.dom().scrollTop):(d.dom().scrollTop=a,c.set(d,p,a))},i=function(){d.dom().scrollTop=e,c.set(d,p,e),b(e)},j=g.abs(e-f()),m=g.ceil(j/n);l.animate(f,e,m,h,i,o)})},u=function(c,d){return b.nu(function(b){var f=a.curry(q,c),h=function(a){e.set(c,"top",a+"px")},i=function(){h(d),b(d)},j=g.abs(d-f()),k=g.ceil(j/n);l.animate(f,d,k,h,i,o)})},v=function(a,b){var c=b+i.getYFixedData(a)+"px";e.set(a,"top",c)},w=function(a,c,d){var e=f.owner(a).dom().defaultView;return b.nu(function(b){v(a,d),v(c,d),e.scrollTo(0,d),b(d)})};return{moveScrollAndTop:s,moveOnlyScroll:t,moveOnlyTop:u,moveWindowScroll:w}}),g("8k",["5","9w"],function(a,b){return function(c){var d=a(b.pure({})),e=function(a){var e=b.nu(function(b){return c(a).get(b)});d.set(e)},f=function(a){d.get().get(function(){a()})};return{start:e,idle:f}}}),g("8l",["6","8h","8j","9v","9s"],function(a,b,c,d,e){var f=function(b,f,g,h,i){var j=d.getGreenzone(f,g),k=a.curry(e.refresh,b);h>j||i>j?c.moveOnlyScroll(f,f.dom().scrollTop-j+i).get(k):h<0&&c.moveOnlyScroll(f,f.dom().scrollTop+h).get(k)};return{scrollIntoView:f}}),g("a9",["y"],function(a){var b=function(b,c){return c(function(c){var d=[],e=0,f=function(a){return function(f){d[a]=f,e++,e>=b.length&&c(d)}};0===b.length?c([]):a.each(b,function(a,b){a.get(f(b))})})};return{par:b}}),g("9x",["y","9t","a9"],function(a,b,c){var d=function(a){return c.par(a,b.nu)},e=function(b,c){var e=a.map(b,c);return d(e)},f=function(a,b){return function(c){return b(c).bind(a)}};return{par:d,mapM:e,compose:f}}),g("8m",["y","9t","9x","39","8j","8n"],function(a,b,c,d,e,f){var g=function(a,c,e,f){var g=e+f;return d.set(a,c,g+"px"),b.pure(f)},h=function(a,b,c){var f=b+c,g=d.getRaw(a,"top").getOr(c),h=f-parseInt(g,10),i=a.dom().scrollTop+h;return e.moveScrollAndTop(a,i,f)},i=function(a,b){return a.fold(function(a,c,d){return g(a,c,b,d)},function(a,c){return h(a,b,c)})},j=function(b,d){var e=f.findFixtures(b),g=a.map(e,function(a){return i(a,d)});return c.par(g)};return{updatePositions:j}}),g("8o",["8","9","11","a","39"],function(a,b,c,d,e){var f=function(f,g){var h=d.fromTag("input");e.setAll(h,{opacity:"0",position:"absolute",top:"-1000px",left:"-1000px"}),b.append(f,h),a.focus(h),g(h),c.remove(h)};return{input:f}}),g("6g",["6","z","62","8","1u","12","a","39","1v","86","16","1w","8h","1x","1j","8i","8j","8k","8l","8m","8n","j","8o","84"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x){var y=5,z=function(d,f,h,i,j,k){var l=r(function(a){return q.moveWindowScroll(d,f,a)}),m=function(){var c=x.getRectangles(k);return b.from(c[0]).bind(function(c){var d=c.top()-f.dom().scrollTop,e=d>i.innerHeight+y||d<-y;return e?b.some({top:a.constant(d),bottom:a.constant(d+c.height())}):b.none()})},n=c.last(function(){l.idle(function(){t.updatePositions(h,i.pageYOffset).get(function(){var a=m();a.each(function(a){f.dom().scrollTop=f.dom().scrollTop+a.top()}),l.start(0),j.refresh()})})},1e3),o=e.bind(g.fromDom(i),"scroll",function(){i.pageYOffset<0||n.throttle()});return t.updatePositions(h,i.pageYOffset).get(a.identity),{unbind:o.unbind}},A=function(b){var c=b.cWin(),i=b.ceBody(),j=b.socket(),k=b.toolstrip(),l=b.toolbar(),m=b.contentElement(),n=b.keyboardType(),o=b.outerWindow(),r=b.dropup(),t=u.takeover(j,i,k,r),x=n(b.outerBody(),c,f.body(),m,k,l),y=function(){x.toEditing(),I()},A=function(){x.toReading()},B=function(a){x.onToolbarTouch(a)},C=v.onChange(o,{onChange:a.noop,onReady:t.refresh});C.onAdjustment(function(){t.refresh()});var D=e.bind(g.fromDom(o),"resize",function(){t.isExpanding()&&t.refresh()}),E=z(k,j,b.outerBody(),o,t,c),F=p(c,m),G=function(){F.isActive()&&F.update()},H=function(){F.update()},I=function(){F.clear()},J=function(a,b){s.scrollIntoView(c,j,r,a,b)},K=function(){h.set(m,"height",m.dom().contentWindow.document.body.scrollHeight+"px")},L=function(b){t.setViewportOffset(b),q.moveOnlyTop(j,b).get(a.identity)},M=function(){t.restore(),C.destroy(),E.unbind(),D.unbind(),x.destroy(),F.destroy(),w.input(f.body(),d.blur)};return{toEditing:y,toReading:A,onToolbarTouch:B,refreshSelection:G,clearSelection:I,highlightSelection:H,scrollIntoView:J,updateToolbarPadding:a.noop,setViewportOffset:L,syncHeight:K,refreshStructure:t.refresh,destroy:M}};return{setup:A}}),g("6h",["y","6","8","1u","12","b","8p","8o"],function(a,b,c,d,e,f,g,h){ +var i=function(b,e,i,j){var k=function(){g.resume(e,j)},l=function(){h.input(b,c.blur)},m=d.bind(i,"keydown",function(b){a.contains(["input","textarea"],f.name(b.target()))||k()}),n=function(){},o=function(){m.unbind()};return{toReading:l,toEditing:k,onToolbarTouch:n,destroy:o}},j=function(a,d,e,f){var h=function(){c.blur(f)},i=function(){h()},j=function(){h()},k=function(){g.resume(d,f)};return{toReading:j,toEditing:k,onToolbarTouch:i,destroy:b.noop}};return{stubborn:i,timid:j}}),g("42",["6","1z","2o","8","a","2f","39","1b","6f","6g","5z","3y","6h","60","i","3z","61"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){var r=function(r,s){var t=q.tag(),u=b.value(),v=b.value(),w=b.api(),x=b.api(),y=function(){s.hide();var b=e.fromDom(h);k.getActiveApi(r.editor).each(function(e){u.set({socketHeight:g.getRaw(r.socket,"height"),iframeHeight:g.getRaw(e.frame(),"height"),outerScroll:h.body.scrollTop}),v.set({exclusives:l.exclusive(b,"."+p.scrollable())}),f.add(r.container,o.resolve("fullscreen-maximized")),n.clobberStyles(r.container,e.body()),t.maximize(),g.set(r.socket,"overflow","scroll"),g.set(r.socket,"-webkit-overflow-scrolling","touch"),d.focus(e.body());var k=c.immutableBag(["cWin","ceBody","socket","toolstrip","toolbar","dropup","contentElement","cursor","keyboardType","isScrolling","outerWindow","outerBody"],[]);w.set(j.setup(k({cWin:e.win(),ceBody:e.body(),socket:r.socket,toolstrip:r.toolstrip,toolbar:r.toolbar,dropup:r.dropup.element(),contentElement:e.frame(),cursor:a.noop,outerBody:r.body,outerWindow:r.win,keyboardType:m.stubborn,isScrolling:function(){return v.get().exists(function(a){return a.socket.isScrolling()})}}))),w.run(function(a){a.syncHeight()}),x.set(i.initEvents(e,w,r.toolstrip,r.socket,r.dropup))})},z=function(){t.restore(),x.clear(),w.clear(),s.show(),u.on(function(a){a.socketHeight.each(function(a){g.set(r.socket,"height",a)}),a.iframeHeight.each(function(a){g.set(r.editor.getFrame(),"height",a)}),h.body.scrollTop=a.scrollTop}),u.clear(),v.on(function(a){a.exclusives.unbind()}),v.clear(),f.remove(r.container,o.resolve("fullscreen-maximized")),n.restoreStyles(),p.deregister(r.toolbar),g.remove(r.socket,"overflow"),g.remove(r.socket,"-webkit-overflow-scrolling"),d.blur(r.editor.getFrame()),k.getActiveApi(r.editor).each(function(a){a.clearSelection()})},A=function(){w.run(function(a){a.refreshStructure()})};return{enter:y,refreshStructure:A,exit:z}};return{create:r}}),g("25",["3q","2e","6","39","3s","42","3t"],function(a,b,c,d,e,f,g){var h=function(h){var i=b.asRawOrDie("Getting IosWebapp schema",e,h);d.set(i.toolstrip,"width","100%"),d.set(i.container,"position","relative");var j=function(){i.setReadOnly(!0),m.enter()},k=a.build(g.sketch(j,i.translate));i.alloy.add(k);var l={show:function(){i.alloy.add(k)},hide:function(){i.alloy.remove(k)}},m=f.create(i,l);return{setReadOnly:i.setReadOnly,refreshStructure:m.refreshStructure,enter:m.enter,exit:m.exit,destroy:c.noop}};return{produce:h}}),g("m",["1y","6","1z","25","i","21","22","23","24"],function(a,b,c,d,e,f,g,h,i){return function(j){var k=i({classes:[e.resolve("ios-container")]}),l=f(),m=c.api(),n=g.makeEditSwitch(m),o=g.makeSocket(),p=h.build(function(){m.run(function(a){a.refreshStructure()})},j);k.add(l.wrapper()),k.add(o),k.add(p.component());var q=function(a){var b=l.createGroups(a);l.setGroups(b)},r=function(a){var b=l.createGroups(a);l.setContextToolbar(b)},s=function(){l.focus()},t=function(){l.restoreToolbar()},u=function(a){m.set(d.produce(a))},v=function(){m.run(function(b){a.remove(o,n),b.exit()})},w=function(a){g.updateMode(o,n,a,k.root())};return{system:b.constant(k),element:k.element,init:u,exit:v,setToolbarGroups:q,setContextToolbar:r,focusToolbar:s,restoreToolbar:t,updateMode:w,socket:b.constant(o),dropup:b.constant(p)}}}),g("26",["1e"],function(a){return a("tinymce.EditorManager")}),g("n",["14","26"],function(a,b){var c=function(c){var d=a.readOptFrom(c.settings,"skin_url").fold(function(){return b.baseURL+"/skins/lightgray"},function(a){return a});return{content:d+"/content.mobile.min.css",ui:d+"/skin.mobile.min.css"}};return{derive:c}}),g("o",["y","6","x","g"],function(a,b,c,d){var e=["x-small","small","medium","large","x-large"],f=function(a,b,c){a.system().broadcastOn([d.formatChanged()],{command:b,state:c})},g=function(b,d){var e=c.keys(d.formatter.get());a.each(e,function(a){d.formatter.formatChanged(a,function(c){f(b,a,c)})}),a.each(["ul","ol"],function(a){d.selection.selectorChanged(a,function(c,d){f(b,a,c)})})};return{init:g,fontSizes:b.constant(e)}}),g("p",[],function(){var a=function(a){var b=function(){a._skinLoaded=!0,a.fire("SkinLoaded")};return function(){a.initialized?b():a.on("init",b)}};return{fireSkinLoaded:a}}),g("0",["1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y){var z=f.constant("toReading"),A=f.constant("toEditing");return l.add("mobile",function(l){var B=function(B){var C=w.derive(l);o.isSkinDisabled(l)===!1?(l.contentCSS.push(C.content),m.DOM.styleSheetLoader.load(C.ui,y.fireSkinLoaded(l))):y.fireSkinLoaded(l)();var D=function(){l.fire("scrollIntoView")},E=j.fromTag("div"),F=g.detect().os.isAndroid()?t(D):v(D),G=j.fromDom(B.targetNode);i.after(G,E),c.attachSystem(E,F.system());var H=function(a){return h.search(a).bind(function(a){return F.system().getByDom(a).toOption()})},I=B.targetNode.ownerDocument.defaultView,J=s.onChange(I,{onChange:function(){var a=F.system();a.broadcastOn([p.orientationChanged()],{width:s.getActualWidth(I)})},onReady:f.noop}),K=function(a,b,c){c===!1&&l.selection.collapse(),F.setToolbarGroups(c?a.get():b.get()),l.setMode(c===!0?"readonly":"design"),l.fire(c===!0?z():A()),F.updateMode(c)},L=function(a,b){return l.on(a,b),{unbind:function(){l.off(a)}}};return l.on("init",function(){F.init({editor:{getFrame:function(){return j.fromDom(l.contentAreaContainer.querySelector("iframe"))},onDomChanged:function(){return{unbind:f.noop}},onToReading:function(a){return L(z(),a)},onToEditing:function(a){return L(A(),a)},onScrollToCursor:function(a){l.on("scrollIntoView",function(b){a(b)});var b=function(){l.off("scrollIntoView"),J.destroy()};return{unbind:b}},onTouchToolstrip:function(){c()},onTouchContent:function(){var a=j.fromDom(l.editorContainer.querySelector("."+r.resolve("toolbar")));H(a).each(b.emitExecute),F.restoreToolbar(),c()},onTapContent:function(b){var c=b.target();if("img"===k.name(c))l.selection.select(c.dom()),b.kill();else if("a"===k.name(c)){var d=F.system().getByDom(j.fromDom(l.editorContainer));d.each(function(b){a.isAlpha(b)&&n.openLink(c.dom())})}}},container:j.fromDom(l.editorContainer),socket:j.fromDom(l.contentAreaContainer),toolstrip:j.fromDom(l.editorContainer.querySelector("."+r.resolve("toolstrip"))),toolbar:j.fromDom(l.editorContainer.querySelector("."+r.resolve("toolbar"))),dropup:F.dropup(),alloy:F.system(),translate:f.noop,setReadOnly:function(a){K(w,v,a)}});var c=function(){F.dropup().disappear(function(){F.system().broadcastOn([p.dropupDismissed()],{})})};d.registerInspector("remove this",F.system());var g={label:"The first group",scrollable:!1,items:[u.forToolbar("back",function(){l.selection.collapse(),F.exit()},{})]},h={label:"Back to read only",scrollable:!1,items:[u.forToolbar("readonly-back",function(){K(w,v,!0)},{})]},i={label:"The read only mode group",scrollable:!0,items:[]},m=q.setup(F,l),o=q.detect(l.settings,m),s={label:"the action group",scrollable:!0,items:o},t={label:"The extra group",scrollable:!1,items:[]},v=e([h,s,t]),w=e([g,i,t]);x.init(F,l)}),{iframeContainer:F.socket().element().dom(),editorContainer:F.element().dom()}};return{getNotificationManagerImpl:function(){return{open:f.identity,close:f.noop,reposition:f.noop,getArgs:f.identity}},renderUI:B}}),function(){}}),d("0")()}(); \ No newline at end of file From 009388364fa8b38cc80efa63757e078125205483 Mon Sep 17 00:00:00 2001 From: Mr B Date: Wed, 18 Apr 2018 10:56:27 +0100 Subject: [PATCH 182/274] [F] iOS iframe Scrolling/jumping --- manager/frames/1.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/manager/frames/1.php b/manager/frames/1.php index b3a1bcb176..074139207f 100755 --- a/manager/frames/1.php +++ b/manager/frames/1.php @@ -421,11 +421,13 @@

      -
      - +
      +
      - +
      + +
      From 135e9b047dfd1c2d668d86bb21675d21f09f743b Mon Sep 17 00:00:00 2001 From: Mr B Date: Wed, 18 Apr 2018 11:00:20 +0100 Subject: [PATCH 183/274] Update modx.js --- manager/media/style/default/js/modx.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/media/style/default/js/modx.js b/manager/media/style/default/js/modx.js index 6c1d5dbfdc..f4ffbfd2e5 100755 --- a/manager/media/style/default/js/modx.js +++ b/manager/media/style/default/js/modx.js @@ -1543,8 +1543,8 @@ } this.page = d.createElement('div'); this.page.id = 'evo-tab-page-' + this.uid; - this.page.className = 'evo-tab-page show'; - this.page.innerHTML = ''; + this.page.className = 'evo-tab-page iframe-scroller show'; + this.page.innerHTML = ''; d.getElementById('main').appendChild(this.page); console.time('load-tab'); this.page.firstElementChild.onload = function(e) { From bdc53cbf2ff513cffe944609b397cca1704e1273 Mon Sep 17 00:00:00 2001 From: Mr B Date: Wed, 18 Apr 2018 11:08:05 +0100 Subject: [PATCH 184/274] Update modx.min.js --- manager/media/style/default/js/modx.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/media/style/default/js/modx.min.js b/manager/media/style/default/js/modx.min.js index 952bc3ffd5..315ef20989 100755 --- a/manager/media/style/default/js/modx.min.js +++ b/manager/media/style/default/js/modx.min.js @@ -1 +1 @@ -(function($,w,d,u){'use strict';modx.extended({frameset:'frameset',minWidth:840,isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),typesactions:{'16':1,'301':2,'78':3,'22':4,'102':5,'108':6,'3':7,'4':7,'6':7,'27':7,'61':7,'62':7,'63':7,'72':7},thememodes:['','lightness','light','dark','darkness'],tabsTimer:0,popupTimer:0,init:function(){if(!localStorage.getItem('MODX_widthSideBar')){localStorage.setItem('MODX_widthSideBar',this.config.tree_width)}this.mainmenu.init();if(w.location.hash){if(modx.getActionFromUrl(w.location.hash,2)){w.history.replaceState(null,d.title,modx.MODX_MANAGER_URL)}else if(modx.getActionFromUrl(w.location.hash)||modx.main.getQueryVariable('filemanager',w.location.hash)){var url=modx.main.getQueryVariable('filemanager',w.location.hash)?modx.MODX_MANAGER_URL+modx.main.getQueryVariable('filemanager',w.location.hash)+w.location.hash.replace('#?','?'):w.location.href.replace('#?','?');if(modx.config.global_tabs){modx.tabs({url:url,title:'blank'})}else if(w.main){w.main.frameElement.src=url}else{modx.openWindow(url)}}}this.resizer.init();this.search.init();if(this.config.session_timeout>0){w.setInterval(this.keepMeAlive,1000*60*this.config.session_timeout)}if(modx.config.mail_check_timeperiod>0&&modx.permission.messages){setTimeout('modx.updateMail(true)',1000)}d.addEventListener('click',this.hideDropDown,false);if(modx.config.global_tabs){d.addEventListener('click',this.tabs,false);this.tabs({url:'?a=2',reload:0})}},mainmenu:{id:'mainMenu',init:function(){var $mm=$('#mainMenu'),mm=d.getElementById('mainMenu'),timer;$mm.on('click','a',function(e){if($(this).hasClass('dropdown-toggle')){if($mm.hasClass('show')&&($(this).hasClass('selected')||!modx.isMobile&&$(this).parent().hasClass('hover'))){$(this).removeClass('selected');$mm.removeClass('show')}else{$('.nav > li > a:not(:hover)').removeClass('selected');$(this).addClass('selected');$mm.addClass('show')}e.stopPropagation();e.target.dataset.toggle='#mainMenu';modx.hideDropDown(e)}if($(this).closest('ul').hasClass('dropdown-menu')&&!$(this).parent('li').hasClass('dropdown-back')){$('.nav > .active').removeClass('active');$('.nav li.selected').removeClass('selected');$(this).closest('.nav > li').addClass('active');if(this.offsetParent.id){d.getElementById(this.offsetParent.id.substr(7)).classList.add('selected')}if((modx.isMobile||w.innerWidth li',function(){var els=mm.querySelectorAll('.nav > li.hover:not(:hover)');for(var i=0;i li li',function(e){var self=this,ul;var els=mm.querySelectorAll('.nav > li li.hover:not(:hover)');for(var i=0;i'+modx.lang.paging_prev+''+data}ul.id='parent_'+self.id;ul.innerHTML=data;var id=w.location.hash.substr(2).replace(/=/g,'_').replace(/&/g,'__');var el=d.getElementById(id);if(el){el.parentNode.classList.add('selected');d.getElementById(el.parentNode.parentNode.id.substr(7)).classList.add('selected')}for(var i=0;iitems.length-1){index=items.length-1}if(index>=0&&index2){s.timer=setTimeout(function(){s.loader.style.display='block';modx.get(modx.MODX_MANAGER_URL+'?a=71&ajax=1&submitok=Search&searchid='+s.input.value,function(data){s.loader.style.display='none';s.results=data.querySelector('.ajaxSearchResults');if(s.results&&s.results.innerHTML!==''){s.result.innerHTML=s.results.outerHTML;s.open();s.result.onclick=function(e){var t=e.target,p=t.parentNode;if(t.tagName==='I'){modx.openWindow({title:p.innerText,id:p.id,url:p.href});e.preventDefault();e.stopPropagation()}else{var a=t.tagName==='A'&&t||p.tagName==='A'&&p;if(a){var el=s.result.querySelector('.selected');if(el)el.className='';a.className='selected';if(modx.isMobile)s.close()}}}}else{s.empty()}},'document')},300)}else{s.empty()}};if(modx.isMobile){this.input.onblur=this.close}this.input.onfocus=this.open;this.input.onclick=this.open;this.input.onmouseenter=this.open;this.result.onmouseenter=this.open;this.result.onmouseleave=this.close;this.mask.onmouseenter=this.open;this.mask.onmouseleave=this.close},open:function(){if(modx.search.results){modx.search.result.classList.add('open')}},close:function(){modx.search.result.classList.remove('open')},empty:function(){modx.search.result.classList.remove('open');modx.search.result.innerHTML=''}},main:{id:'main',idFrame:'mainframe',as:null,onload:function(e){w.main=e.target.contentWindow||e.target.defaultView;modx.main.tabRow.init();modx.main.stopWork();modx.main.scrollWork();w.main.document.addEventListener('click',modx.hideDropDown,false);w.main.document.addEventListener('contextmenu',modx.main.oncontextmenu,false);if(modx.config.global_tabs){w.main.document.addEventListener('click',modx.tabs,false)}w.history.replaceState(null,d.title,modx.getActionFromUrl(w.main.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.main.location.search);setTimeout('modx.tree.restoreTree()',100)},oncontextmenu:function(e){if(e.ctrlKey)return;var el=e.target;if(modx.user.role===1&&/modxtv|modxplaceholder|modxattributevalue|modxchunk|modxsnippet|modxsnippetnocache/i.test(el.className)){var id=Date.now(),name=el.innerText.replace(/[\[|\]|{|}|\*||\#|\+|?|\!|&|=|`|:]/g,''),type=el.className.replace(/cm-modx/,''),n=!!name.replace(/^\d+$/,'');if(name&&n){e.preventDefault();modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',{a:'modxTagHelper',name:name,type:type},function(r){if(r){r=JSON.parse(r);for(var k in r){if(r.hasOwnProperty(k)&&r[k].url){r[k]['onclick']='if(event.shiftKey){modx.openWindow({url:\''+r[k].url+'\'})}else{modx.popup({url:\''+r[k].url+'\',title:\''+r.header.innerHTML+'\',width:\'95%\',height:\'95%\',margin:0,hide:0,hover:0,overlay:1,overlayclose:0,position:\'center elements\',animation:0,icon:\'none\'})}'}}r=JSON.stringify(r);el.id='node'+id;el.dataset.contextmenu=r;modx.tree.showPopup(e,id,name)}})}e.preventDefault()}},tabRow:{init:function(){var row=w.main.document.querySelector('.tab-pane > .tab-row');if(row)this.build(row)},build:function(row){var rowContainer=d.createElement('div'),sel=row.querySelector('.selected');rowContainer.className='tab-row-container';row.parentNode.insertBefore(rowContainer,row);rowContainer.appendChild(row);var p=d.createElement('i');p.className='fa fa-angle-left prev disable';p.onclick=function(e){e.stopPropagation();e.preventDefault();var sel=row.querySelector('.selected');if(sel.previousSibling){sel.previousSibling.click();modx.main.tabRow.scroll(row)}};rowContainer.appendChild(p);var n=d.createElement('i');n.className='fa fa-angle-right next disable';n.onclick=function(e){e.stopPropagation();e.preventDefault();var sel=row.querySelector('.selected');if(sel.nextSibling){sel.nextSibling.click();modx.main.tabRow.scroll(row)}};rowContainer.appendChild(n);setTimeout(function(){sel=row.querySelector('.selected');modx.main.tabRow.scroll(row,sel);w.main.addEventListener('resize',function(){modx.main.tabRow.scroll(row)},false);if(sel){if(sel.previousSibling)p.classList.remove('disable');if(sel.nextSibling)n.classList.remove('disable')}},100);row.onclick=function(e){var sel=e.target.tagName==='H2'?e.target:e.target.tagName==='SPAN'?e.target.parentNode:null;if(sel){if(sel.previousSibling){this.parentNode.querySelector('i.prev').classList.remove('disable')}else{this.parentNode.querySelector('i.prev').classList.add('disable')}if(sel.nextSibling){this.parentNode.querySelector('i.next').classList.remove('disable')}else{this.parentNode.querySelector('i.next').classList.add('disable')}modx.main.tabRow.scroll(this,sel)}}},scroll:function(row,sel,a){sel=sel||row.querySelector('.selected')||row.firstChild;a=a||100;var c=0,elms=row.childNodes;for(var i=0;isel.offsetLeft){$(row).animate({scrollLeft:sel.offsetLeft-(sel.previousSibling?30:1)},a)}if(sel.offsetLeft+sel.offsetWidth>row.offsetWidth+row.scrollLeft){$(row).animate({scrollLeft:sel.offsetLeft-row.offsetWidth+sel.offsetWidth+(sel.nextSibling?30:0)},a)}if(c>row.offsetWidth){this.drag(row)}},drag:function(row){row.onmousedown=function(e){if(e.button===0){e.preventDefault();var x=e.clientX,f=row.scrollLeft;row.ownerDocument.body.focus();row.onmousemove=row.ownerDocument.onmousemove=function(e){if(Math.abs(e.clientX-x)>5){e.stopPropagation();row.scrollLeft=f-(e.clientX-x);row.ownerDocument.body.classList.add('drag')}};row.onmouseup=row.ownerDocument.onmouseup=function(e){e.stopPropagation();row.onmousemove=null;row.ownerDocument.onmousemove=null;row.ownerDocument.body.classList.remove('drag')}}}}},work:function(){d.getElementById('mainloader').classList.add('show')},stopWork:function(){d.getElementById('mainloader').classList.remove('show')},scrollWork:function(){var a=w.main.frameElement.contentWindow,b=a.location.search.substring(1)||a.location.hash.substring(2),c=localStorage.getItem('page_y')||0,f=localStorage.getItem('page_url')||b;if(((modx.getActionFromUrl(f)===modx.getActionFromUrl(b))&&(modx.main.getQueryVariable('id',f)&&modx.main.getQueryVariable('id',f)===modx.main.getQueryVariable('id',b)))||(f===b)){a.scrollTo(0,c)}a.addEventListener('scroll',function(){if(this.pageYOffset>=0){localStorage.setItem('page_y',this.pageYOffset.toString());localStorage.setItem('page_url',b)}},false)},getQueryVariable:function(a,b){var f='';if(b||typeof b==='string'){b=b.split('?');b=b[1]||b[0];b=b.split('&');for(var i=0;iMath.abs(ay)&&this.swipe){if(ax<0&&this.sidebar){if(Math.abs(ax)>h)ax=-h;tree.style.transform='translate3d('+ax+'px, 0, 0)';tree.style.WebkitTransform='translate3d('+ax+'px, 0, 0)';modx.resizer.mask.style.opacity=(0.5-0.5/-h*ax).toFixed(2);if(Math.abs(ax)>h/3){this.swipe='left'}else{this.swipe='right'}}else if(ax>0&&!this.sidebar){if(Math.abs(ax)>h)ax=h;tree.style.transform='translate3d('+ -(h-ax)+'px, 0, 0)';tree.style.WebkitTransform='translate3d('+ -(h-ax)+'px, 0, 0)';modx.resizer.mask.style.opacity=(0.5/h*ax).toFixed(2);if(Math.abs(ax)>h/3){this.swipe='right'}else{this.swipe='left'}}}},false);w.addEventListener('touchend',function(){if(this.swipe==='left'){d.body.classList.add('sidebar-closed');modx.resizer.setWidth(0)}if(this.swipe==='right'){d.body.classList.remove('sidebar-closed');modx.resizer.setWidth(h)}tree.style.cssText='';modx.resizer.mask.style.cssText=''},false)}},onMouseDown:function(e){e=e||w.event;modx.resizer.dragElement=e.target!==null?e.target:e.srcElement;if((e.buttons===1||e.button===0)&&modx.resizer.dragElement.id===modx.resizer.id){modx.resizer.oldZIndex=modx.resizer.dragElement.style.zIndex;modx.resizer.dragElement.style.zIndex=modx.resizer.newZIndex;modx.resizer.dragElement.style.background=modx.resizer.background;localStorage.setItem('MODX_widthSideBar',modx.resizer.dragElement.offsetLeft>0?modx.resizer.dragElement.offsetLeft:0);d.body.appendChild(modx.resizer.mask);d.onmousemove=modx.resizer.onMouseMove;d.body.focus();d.body.classList.add('resizer_move');d.onselectstart=function(){return false};modx.resizer.dragElement.ondragstart=function(){return false};return false}},onMouseMove:function(e){e=e||w.event;if(e.clientX>0){modx.resizer.left=e.clientX}else{modx.resizer.left=0}modx.resizer.dragElement.style.left=modx.pxToRem(modx.resizer.left)+'rem';d.getElementById('tree').style.width=modx.pxToRem(modx.resizer.left)+'rem';d.getElementById('main').style.left=modx.pxToRem(modx.resizer.left)+'rem';if(e.clientX<-2||e.clientY<-2){modx.resizer.onMouseUp(e)}},onMouseUp:function(e){if(modx.resizer.dragElement!==null&&e.button===0&&modx.resizer.dragElement.id===modx.resizer.id){if(e.clientX>0){d.body.classList.remove('sidebar-closed');modx.resizer.left=e.clientX}else{d.body.classList.add('sidebar-closed');modx.resizer.left=0}d.cookie='MODX_widthSideBar='+modx.pxToRem(modx.resizer.left);modx.resizer.dragElement.style.zIndex=modx.resizer.oldZIndex;modx.resizer.dragElement.style.background='';modx.resizer.dragElement.ondragstart=null;modx.resizer.dragElement=null;d.body.classList.remove('resizer_move');d.body.removeChild(modx.resizer.mask);d.onmousemove=null;d.onselectstart=null}},toggle:function(){if(modx.isMobile||w.innerWidth<=modx.minWidth){if(d.body.classList.contains('sidebar-closed')){d.body.classList.remove('sidebar-closed');localStorage.setItem('MODX_widthSideBar',0);d.cookie='MODX_widthSideBar='+modx.pxToRem(parseInt(d.getElementById('tree').offsetWidth))}else{localStorage.setItem('MODX_widthSideBar',parseInt(d.getElementById('tree').offsetWidth));d.body.classList.add('sidebar-closed');d.cookie='MODX_widthSideBar=0'}}else{var p=d.getElementById('tree').offsetWidth!==0?0:parseInt(localStorage.getItem('MODX_widthSideBar'))?parseInt(localStorage.getItem('MODX_widthSideBar')):modx.config.tree_width;modx.resizer.setWidth(p)}},setWidth:function(a){if(a>0){localStorage.setItem('MODX_widthSideBar',0);d.body.classList.remove('sidebar-closed')}else{localStorage.setItem('MODX_widthSideBar',parseInt(d.getElementById('tree').offsetWidth));d.body.classList.add('sidebar-closed')}d.cookie='MODX_widthSideBar='+modx.pxToRem(a);d.getElementById('tree').style.width=modx.pxToRem(a)+'rem';d.getElementById('resizer').style.left=modx.pxToRem(a)+'rem';d.getElementById('main').style.left=modx.pxToRem(a)+'rem'},setDefaultWidth:function(){modx.resizer.setWidth(modx.remToPx(modx.config.tree_width))}},tree:{ctx:null,rpcNode:null,itemToChange:'',selectedObjectName:null,selectedObject:0,selectedObjectDeleted:0,selectedObjectUrl:'',drag:false,deleted:[],init:function(){this.restoreTree()},draggable:function(){if(modx.permission.dragndropdocintree){var els=d.querySelectorAll('#treeRoot a:not(.empty)');for(var i=0;i-1:true;modx.tree.itemToChange=this.dataset.id||this.parentNode.id.replace('node','');modx.tree.selectedObjectName=this.dataset.titleEsc;if(draggable){this.parentNode.draggable=true;this.parentNode.ondragstart=modx.tree.ondragstart}else{this.parentNode.draggable=false;this.parentNode.ondragstart=function(){return false}}}},ondragstart:function(e){e.dataTransfer.effectAllowed='all';e.dataTransfer.dropEffect='all';e.dataTransfer.setData('text',this.id.substr(4))},ondragenter:function(e){if(d.getElementById('node'+modx.tree.itemToChange)===(this.parentNode.closest('#node'+modx.tree.itemToChange)||this.parentNode)){this.parentNode.className='';e.dataTransfer.effectAllowed='none';e.dataTransfer.dropEffect='none';modx.tree.drag=false}else{this.parentNode.className='dragenter';e.dataTransfer.effectAllowed='copy';e.dataTransfer.dropEffect='copy';modx.tree.drag=true}e.preventDefault()},ondragover:function(e){if(modx.tree.drag){var a=e.clientY;var b=parseInt(this.getBoundingClientRect().top);var c=a-b;if(c>this.offsetHeight/1.51){this.parentNode.classList.add('dragafter');this.parentNode.classList.remove('dragbefore');this.parentNode.classList.remove('dragenter');e.dataTransfer.effectAllowed='link';e.dataTransfer.dropEffect='link'}else if(c
      '}if(this.nextSibling){if(this.nextSibling.innerHTML){this.nextSibling.appendChild(el)}else{el.parentNode.removeChild(el)}els=this.parentNode.lastChild.children;for(i=0;i
      '}this.parentNode.parentNode.insertBefore(el,this.parentNode.nextSibling);els=this.parentNode.parentNode.children;for(i=0;i'}this.parentNode.parentNode.insertBefore(el,this.parentNode);els=this.parentNode.parentNode.children;for(i=0;i-1:true)){alert(modx.lang.error_no_privileges);modx.tree.restoreTree();return}modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',{a:'movedocument',id:id,parent:parent,menuindex:menuindex},function(r){if(r.errors)alert(r.errors);modx.tree.restoreTree()},'json');var b=w.main.frameElement.contentWindow.location.search.substr(1);if(modx.getActionFromUrl(b,27)&&parseInt(modx.main.getQueryVariable('id',b))===parseInt(id)){var index=menuindex.indexOf(id),elMenuIndex=w.main.document.querySelector('#documentPane input[name=menuindex]'),elParent=w.main.document.querySelector('#documentPane input[name=parent]'),elParentName=w.main.document.querySelector('#documentPane #parentName');if(elMenuIndex&&index>=0)elMenuIndex.value=index;if(elParent&&elParentName){elParent.value=parent;elParentName.innerHTML=parent+' ('+d.querySelector('#node'+parent+' > a').dataset.titleEsc+')'}}},toggleTheme:function(){var a,b=1,myCodeMirrors=w.main.myCodeMirrors,key;if(typeof localStorage['MODX_themeMode']==='undefined'){localStorage['MODX_themeMode']=modx.config.theme_mode}if(modx.thememodes[parseInt(localStorage['MODX_themeMode'])+1]){b=parseInt(localStorage['MODX_themeMode'])+1}a=modx.thememodes[b];for(key in modx.thememodes){if(modx.thememodes[key]){d.body.classList.remove(modx.thememodes[key]);w.main.document.body.classList.remove(modx.thememodes[key])}}d.body.classList.add(a);w.main.document.body.classList.add(a);d.cookie='MODX_themeMode='+b;localStorage['MODX_themeMode']=b;if(typeof myCodeMirrors!=='undefined'){for(key in myCodeMirrors){if(myCodeMirrors.hasOwnProperty(key)){if(~a.indexOf('dark')){w.main.document.getElementsByName(key)[0].nextElementSibling.classList.add('cm-s-'+myCodeMirrors[key].options.darktheme);w.main.document.getElementsByName(key)[0].nextElementSibling.classList.remove('cm-s-'+myCodeMirrors[key].options.defaulttheme)}else{w.main.document.getElementsByName(key)[0].nextElementSibling.classList.remove('cm-s-'+myCodeMirrors[key].options.darktheme);w.main.document.getElementsByName(key)[0].nextElementSibling.classList.add('cm-s-'+myCodeMirrors[key].options.defaulttheme)}}}}},toggleNode:function(e,id){e=e||w.event;if(e.ctrlKey)return;e.stopPropagation();var el=d.getElementById('node'+id).firstChild;this.rpcNode=el.nextSibling;var toggle=el.querySelector('.toggle'),icon=el.querySelector('.icon');if(this.rpcNode.innerHTML===''){if(toggle)toggle.innerHTML=el.dataset.iconCollapsed;icon.innerHTML=el.dataset.iconFolderOpen;var rpcNodeText=this.rpcNode.innerHTML,loadText=modx.lang.loading_doc_tree;modx.openedArray[id]=1;if(rpcNodeText===''||rpcNodeText.indexOf(loadText)>0){var folderState=this.getFolderState();d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent='+el.dataset.indent+'&parent='+id+'&expandAll='+el.dataset.expandall+folderState,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})}this.saveFolderState()}else{if(toggle)toggle.innerHTML=el.dataset.iconExpanded;icon.innerHTML=el.dataset.iconFolderClose;delete modx.openedArray[id];this.rpcNode.style.overflow='hidden';$(this.rpcNode.firstChild).animate({marginTop:-this.rpcNode.offsetHeight+'px'},100,function(){this.parentNode.innerHTML=''});this.saveFolderState()}e.preventDefault()},rpcLoadData:function(a){if(this.rpcNode!==null){var el;this.rpcNode.innerHTML=typeof a==='object'?a.responseText:a;this.rpcNode.loaded=true;if(this.rpcNode.firstChild.tagName==='DIV'){if(this.rpcNode.id==='treeRoot'){el=d.getElementById('binFull');if(el){this.showBin(true)}else{this.showBin(false)}}else{this.rpcNode.style.overflow='hidden';this.rpcNode.firstElementChild.style.marginTop=-this.rpcNode.offsetHeight+'px';$(this.rpcNode.firstChild).animate({marginTop:0},100)}d.getElementById('treeloader').classList.remove('visible')}else{el=d.getElementById('loginfrm');if(el){this.rpcNode.parentNode.removeChild(this.rpcNode);w.location.href=modx.MODX_MANAGER_URL}}}},treeAction:function(e,id,title){if(e.ctrlKey)return;var el=d.getElementById('node'+id).firstChild,treepageclick=el.dataset.treepageclick,showchildren=parseInt(el.dataset.showchildren),openfolder=parseInt(el.dataset.openfolder);title=title||el.dataset&&el.dataset.titleEsc;if(tree.ca==='move'){try{this.setSelectedByContext(id);w.main.setMoveValue(id,title)}catch(oException){alert(modx.lang.unable_set_parent)}}if(tree.ca==='open'||tree.ca===''){if(id===0){href='?a=2'}else{var href='';if(!isNaN(treepageclick)&&isFinite(treepageclick)){href='?a='+treepageclick+'&r=1&id='+id+(openfolder===0?this.getFolderState():'')}else{href=treepageclick}if(openfolder===2){if(showchildren!==1){href=''}this.toggleNode(e,id)}}if(href){if(e.shiftKey){w.getSelection().removeAllRanges();modx.openWindow(href);this.restoreTree()}else{modx.tabs({url:modx.MODX_MANAGER_URL+href,title:title+'('+id+')'});if(modx.isMobile)modx.resizer.toggle()}}this.itemToChange=id;this.setSelected(id)}if(tree.ca==='parent'){try{this.setSelectedByContext(id);w.main.setParent(id,title)}catch(oException){alert(modx.lang.unable_set_parent)}}if(tree.ca==='link'){try{this.setSelectedByContext(id);w.main.setLink(id)}catch(oException){alert(modx.lang.unable_set_link)}}e.preventDefault()},showPopup:function(e,id,title){if(e.ctrlKey)return;e.preventDefault();var tree=d.getElementById('tree'),el=d.getElementById('node'+id)||e.target,x=0,y=0;if(el.firstChild&&el.firstChild.dataset&&el.firstChild.dataset.contextmenu){el=el.firstChild}if(el){if(el.dataset.contextmenu){e.target.dataset.toggle='#contextmenu';modx.hideDropDown(e);this.ctx=d.createElement('div');this.ctx.id='contextmenu';this.ctx.className='dropdown-menu';d.getElementById(modx.frameset).appendChild(this.ctx);this.setSelectedByContext(id);var dataJson=JSON.parse(el.dataset.contextmenu);for(var key in dataJson){if(dataJson.hasOwnProperty(key)){var item=d.createElement('div');for(var k in dataJson[key]){if(dataJson[key].hasOwnProperty(k)){if(k.substring(0,2)==='on'){var onEvent=dataJson[key][k];item[k]=function(onEvent){return function(event){eval(onEvent)}}(onEvent)}else{item[k]=dataJson[key][k]}}}if(key.indexOf('header')===0)item.className+=' menuHeader';if(key.indexOf('item')===0)item.className+=' menuLink';if(key.indexOf('seperator')===0||key.indexOf('separator')===0)item.className+=' seperator separator';this.ctx.appendChild(item)}}x=e.clientX>0?e.clientX:e.pageX;y=e.clientY>0?e.clientY:e.pageY;e.view.position=e.view.frameElement?e.view.frameElement.getBoundingClientRect():e.target.offsetParent.getBoundingClientRect();if(e.view.frameElement){x+=e.view.position.left;y+=e.view.frameElement.offsetParent.offsetTop}else{if(e.target.parentNode.parentNode.classList.contains('node')){x+=50}}if(x>e.view.position.width){x=e.view.position.width-this.ctx.offsetWidth}if(y+this.ctx.offsetHeight/2>e.view.position.height){y=e.view.position.height-this.ctx.offsetHeight-5}else if(y-this.ctx.offsetHeight/20?e.clientX:e.pageX;y=e.clientY>0?e.clientY:e.pageY;if(y+ctx.offsetHeight/2>bodyHeight){y=bodyHeight-ctx.offsetHeight-5}else if(y-ctx.offsetHeight/230){this.selectedObjectName=this.selectedObjectName.substr(0,30)+'...'}var f=d.getElementById('nameHolder');f.innerHTML=this.selectedObjectName;el.style.left=a+(modx.config.textdir?'-190':'')+'px';el.style.top=b+'px';el.classList.add('show')},menuHandler:function(a){switch(a){case 1:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=3&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 2:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=27&r=1&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 3:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=4&pid='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 4:if(this.selectedObjectDeleted){alert('"'+this.selectedObjectName+'" '+modx.lang.already_deleted)}else if(confirm('"'+this.selectedObjectName+'"\n\n'+modx.lang.confirm_delete_resource)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=6&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 5:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=51&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 6:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=72&pid='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 7:if(confirm(modx.lang.confirm_resource_duplicate)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=94&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 8:if(d.getElementById('node'+this.itemToChange).firstChild.dataset.deleted){if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_undelete)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=63&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}}else{alert('"'+this.selectedObjectName+'"'+modx.lang.not_deleted)}break;case 9:if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_publish)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=61&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 10:if(this.itemToChange!==modx.config.site_start){if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_unpublish)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=62&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}}else{alert('Document is linked to site_start variable and cannot be unpublished!')}break;case 11:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=56&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 12:w.open(d.getElementById('node'+this.itemToChange).firstChild.dataset.href,'previeWin');break;default:alert('Unknown operation command.')}},setSelected:function(a){var el=d.querySelector('#tree .current');if(el)el.classList.remove('current');if(a){if(typeof a==='object'){a.classList.add('current')}else{el=d.querySelector('#node'+a+'>.node')||d.getElementById('node'+a);if(el)el.classList.add('current')}}},setActiveFromContextMenu:function(a){var el=d.querySelector('#node'+a+'>.node');if(el)this.setSelected(el)},setSelectedByContext:function(a){var el=d.querySelector('#treeRoot .selected');if(el)el.classList.remove('selected');el=d.querySelector('#node'+a+'>.node');if(el)el.classList.add('selected')},setItemToChange:function(){var a=w.main.document&&(w.main.document.URL||w.main.document.location.search),b=modx.getActionFromUrl(a);if(a&&modx.typesactions[b]){this.itemToChange=(modx.typesactions[b]===7?'':modx.typesactions[b]+'_')+parseInt(modx.main.getQueryVariable('id',a))}else{this.itemToChange=''}this.setSelected(this.itemToChange)},restoreTree:function(){if(d.getElementById('treeRoot')){d.getElementById('treeloader').classList.add('visible');this.setItemToChange();this.rpcNode=d.getElementById('treeRoot');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=2&id='+this.itemToChange,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})}},expandTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=1&id='+this.itemToChange,function(r){modx.tree.rpcLoadData(r);modx.tree.saveFolderState();modx.tree.draggable()})},collapseTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=0&id='+this.itemToChange,function(r){modx.openedArray=[];modx.tree.saveFolderState();modx.tree.rpcLoadData(r);modx.tree.draggable()})},updateTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');var a=d.sortFrm;var b='a=1&f=nodes&indent=1&parent=0&expandAll=2&dt='+a.dt.value+'&tree_sortby='+a.sortby.value+'&tree_sortdir='+a.sortdir.value+'&tree_nodename='+a.nodename.value+'&id='+this.itemToChange+'&showonlyfolders='+a.showonlyfolders.value;modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',b,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})},getFolderState:function(){var a;if(modx.openedArray!==[0]){a='&opened=';for(var key in modx.openedArray){if(modx.openedArray[key]){a+=key+'|'}}}else{a='&opened='}return a},saveFolderState:function(){modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&savestateonly=1'+this.getFolderState())},showSorter:function(e){e=e||w.event;var el=d.getElementById('floater');e.target.dataset.toggle='#floater';el.classList.toggle('show');el.onclick=function(e){e.stopPropagation()}},emptyTrash:function(){if(confirm(modx.lang.confirm_empty_trash)===true){modx.get(modx.MODX_MANAGER_URL+'?a=64',function(){modx.tabsClose(modx.tree.deleted);modx.tree.deleted=[];modx.tree.restoreTree()})}},showBin:function(a){var el=d.getElementById('treeMenu_emptytrash');if(el){if(a){el.title=modx.lang.empty_recycle_bin;el.classList.remove('disabled');el.innerHTML=modx.style.empty_recycle_bin;el.onclick=function(){modx.tree.emptyTrash()};var els=d.getElementById('tree').querySelectorAll('.deleted');for(var i=0;i0){if(el){el.innerHTML=c[0];el.style.display='block'}}else{if(el)el.style.display='none'}if(c[1]>0){el=d.getElementById('newMail');if(el){el.innerHTML=''+modx.style.email+modx.lang.inbox+' ('+c[0]+' / '+c[1]+')';el.style.display='block'}}if(modx.config.mail_check_timeperiod>0)setTimeout('modx.updateMail(true)',1000*modx.config.mail_check_timeperiod)})}}catch(oException){setTimeout('modx.updateMail(true)',1000*modx.config.mail_check_timeperiod)}},openWindow:function(a){if(typeof a!=='object'){a={'url':a}}if(!a.width)a.width=parseInt(w.innerWidth*0.9)+'px';if(!a.height)a.height=parseInt(w.innerHeight*0.8)+'px';if(!a.left)a.left=parseInt(w.innerWidth*0.05)+'px';if(!a.top)a.top=parseInt(w.innerHeight*0.1)+'px';if(!a.title)a.title=Math.floor((Math.random()*999999)+1);if(a.url){if(this.plugins.EVOmodal===1){top.EVO.modal.show(a)}else{w.open(a.url,a.title,'width='+a.width+',height='+a.height+',top='+a.top+',left='+a.left+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no')}}},tabsClose:function(a){if(modx.config.global_tabs&&a){for(var k in a){if(a.hasOwnProperty(k)){var el=d.getElementById(a[k]);if(el){el.firstElementChild.contentWindow.documentDirty=false;el.close()}}}}},tabs:function(a){function Tabs(a){var s=this;this.url=a.url;this.title=a.title||'';this.name=a.name||'';this.timer=null;this.olduid='';this.closeactions=[6,61,62,63,94];this.reload=typeof a.reload!=='undefined'?a.reload:1;this.action=modx.getActionFromUrl(a.url);this.uid=modx.getActionFromUrl(a.url,2)?'home':modx.urlToUid(a.url);this.page=d.getElementById('evo-tab-page-'+this.uid);this.row=d.getElementsByClassName('evo-tab-row')[0].firstElementChild;this.tab=d.getElementById('evo-tab-'+this.uid);if(this.page){if(this.uid==='home'){if(this.reload){this.page.firstElementChild.src=this.url;this.show()}else{this.reload=1;if(this.tab.onclick===null){this.tab.onclick=function(e){s.select.call(s,e,this)}}this.tab.show=function(e){s.show.call(s,e)};modx.tabs.selected=this.tab}}else{this.show();if(~this.closeactions.indexOf(this.action)){this.setDocPublished();modx.get(this.url,function(){modx.tree.restoreTree()})}}}else if(~this.closeactions.indexOf(this.action)){modx.get(this.url,function(){modx.tree.restoreTree()})}else{this.create()}}Tabs.prototype={create:function(){var s=this;modx.main.work();modx.tabs.selected=this.row.querySelector('.selected');if(modx.tabs.selected){d.getElementById(modx.tabs.selected.id.replace('tab','tab-page')).classList.remove('show');modx.tabs.selected.classList.remove('selected')}this.page=d.createElement('div');this.page.id='evo-tab-page-'+this.uid;this.page.className='evo-tab-page show';this.page.innerHTML='';d.getElementById('main').appendChild(this.page);console.time('load-tab');this.page.firstElementChild.onload=function(e){s.onload.call(s,e);console.timeEnd('load-tab')};this.tab=d.createElement('h2');this.tab.id='evo-tab-'+this.uid;this.tab.className='tab selected';this.icon='';if(!/'}this.tab.innerHTML=''+this.icon+this.title+'×';this.row.appendChild(this.tab);this.tab.onclick=function(e){s.select.call(s,e,this)};this.tab.close=function(e){s.close.call(s,e)};this.tab.show=function(e){s.show.call(s,e)};this.page.close=function(e){s.close.call(s,e)}},onload:function(e){var s=this;w.main=e.target.contentWindow||e.target.defaultView;this.url=w.main.location.search||w.location.hash.substring(1);this.olduid=this.uid;this.uid=modx.urlToUid(this.url);if(!!w.main.__alertQuit){w.main.alert=function(a){};var message=w.main.document.body.innerHTML;w.main.document.body.innerHTML='';history.pushState(null,d.title,modx.getActionFromUrl(w.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.location.search);w.onpopstate=function(){history.go(1)};modx.popup({type:'warning',title:'MODX :: Alert',position:'top center alertQuit',content:message,wrap:'body'});modx.getLockedElements(modx.getActionFromUrl(this.url),modx.main.getQueryVariable('id',this.url),function(data){if(!!data){s.page.close();modx.tree.restoreTree()}else{w.main.location.href=modx.MODX_MANAGER_URL+s.url;w.history.replaceState(null,d.title,modx.getActionFromUrl(s.url,2)?modx.MODX_MANAGER_URL:'#'+s.url)}})}else{if(modx.getActionFromUrl(this.url,2)){this.close(e)}else if(this.olduid!==this.uid&&d.getElementById('evo-tab-'+this.uid)){this.close(e);d.getElementById('evo-tab-'+this.uid).show()}else{this.title=w.main.document.body.querySelectorAll('h1')[0]&&w.main.document.body.querySelectorAll('h1')[0].innerHTML||this.title;if(this.title&&this.uid!=='home'){this.tab.innerHTML=''+this.title+'×'}this.page.id='evo-tab-page-'+this.uid;this.tab.id='evo-tab-'+this.uid;this.tab.classList.remove('changed');this.show();modx.main.onload(e);w.main.document.addEventListener('click',function a(e){if(typeof e.view.documentDirty!=='undefined'&&e.view.documentDirty&&!s.tab.classList.contains('changed')){s.tab.classList.add('changed');this.removeEventListener(e.type,a,false)}},false);w.main.document.addEventListener('keyup',function a(e){if(typeof e.view.documentDirty!=='undefined'&&e.view.documentDirty&&!s.tab.classList.contains('changed')){s.tab.classList.add('changed');this.removeEventListener(e.type,a,false)}},false)}}},show:function(){var s=this;modx.tabs.selected=this.row.querySelector('.selected');if(modx.tabs.selected&&modx.tabs.selected!==this.tab){d.getElementById(modx.tabs.selected.id.replace('tab','tab-page')).classList.remove('show');modx.tabs.selected.classList.remove('selected')}this.page.classList.add('show');this.tab.classList.add('selected');modx.tabs.selected=this.tab;w.main=this.page.firstElementChild.contentWindow;w.history.replaceState(null,w.main.document.title,modx.getActionFromUrl(w.main.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.main.location.search);modx.tree.setItemToChange();modx.main.tabRow.scroll(this.row,this.tab,350)},close:function(e){var documentDirty=this.page.firstElementChild.contentWindow.documentDirty;var checkDirt=!!this.page.firstElementChild.contentWindow.checkDirt;if(documentDirty&&checkDirt&&confirm(this.page.firstElementChild.contentWindow.checkDirt(e))||!documentDirty){modx.tabs.selected=this.tab.classList.contains('selected')?this.tab.previousElementSibling:this.row.querySelector('.selected');this.page.parentNode.removeChild(this.page);this.row.removeChild(this.tab);modx.tabs.selected.show()}},select:function(e){if(e.target.className==='tab-close'){this.close(e)}else if(modx.tabs.selected===this.tab){var s=this;if(this.timer){clearTimeout(this.timer);this.timer=null;w.main.location.reload()}else{this.timer=setTimeout(function(){s.timer=null},250)}}else{this.show()}},setDocPublished:function(){var el=w.main.document.getElementsByName('publishedcheck')[0];if(el){el.checked=this.action===61;w.main.document.getElementsByName('published')[0].value=+el.checked}if(modx.getActionFromUrl(w.main.location.search,3)){w.main.location.reload()}}};if(modx.config.global_tabs){if(typeof a.currentTarget!=='undefined'){var e=a;if(e.button===0&&e.target&&(e.target.tagName==='A'&&e.target.target==='main'||(e.target.parentNode&&e.target.parentNode.tagName==='A'&&e.target.parentNode.target==='main'))){a=e.target.tagName==='A'&&e.target||e.target.parentNode.tagName==='A'&&e.target.parentNode;if(e.shiftKey){modx.openWindow({url:a.href})}else{modx.tabs({url:a.href,title:a.innerHTML})}e.preventDefault()}}else{return new Tabs(a)}}else if(a.url){if(w.main){w.main.frameElement.src=a.url}else{modx.openWindow(a.url)}}},popup:function(a){if(typeof a==='object'&&(a.url||a.content||a.text)){var o={addclass:'',animation:'fade',content:a.content||a.text||'',clickclose:0,closeall:0,data:'',dataType:'document',delay:5000,draggable:!1,event:null,height:'auto',hide:1,hover:1,icon:'',iframe:'iframe',margin:'.5rem',maxheight:'',method:'GET',overlay:0,overlayclose:0,position:'center',resize:!1,selector:'',showclose:1,target:'main',uid:'',type:'default',title:'',url:'',width:'20rem',wrap:w.main.document.body,zIndex:10500,w:null,show:function(){if(~o.position.indexOf('center')){if(o.event){o.el.style.left=o.event.clientX+o.mt+'px';o.el.style.bottom=o.w.innerHeight-o.el.offsetHeight-o.event.clientY+o.mt+'px'}else{o.el.style.left=/(%)/.test(o.width)?(100-parseInt(o.width))/2-o.mt/(o.w.innerWidth/100)+'%':(o.w.innerWidth-o.el.offsetWidth)/2-o.mt+'px';o.el.style.bottom=/(%)/.test(o.height)?(100-parseInt(o.height))/2-o.mt/(o.w.innerHeight/100)+'%':(o.w.innerHeight-o.el.offsetHeight-o.wrap.offsetTop)/2-o.mt+'px'}}if(~o.position.indexOf('left')){o.el.style.left=0}if(~o.position.indexOf('right')){o.el.style.right=0}else{o.el.style.right='auto'}if(~o.position.indexOf('top')){o.el.style.top=0;o.el.style.bottom=''}else{o.el.style.top='auto'}if(~o.position.indexOf('bottom')){o.el.style.bottom=0}o.calc();o.el.className+=' in';if(o.showclose){o.el.querySelector('.close').onclick=o.close}if(o.hide){o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);o.close()},o.delay)}if(o.hover){o.el.onmouseenter=function(){clearTimeout(o.el.timer)};o.el.onmouseleave=o.close}if(o.overlayclose&&o.o){o.o.onclick=o.close}if(o.clickclose){o.el.onclick=o.close}if(o.draggable){modx.dragging(o.el,{wrap:o.wrap,resize:o.resize})}},close:function(e){o.event=e||o.event||w.event;if(o.url&&o.iframe==='iframe'){var els=o.wrap.ownerDocument.querySelectorAll('.'+o.className+'.in');if(els){var documentDirty=o.el.lastElementChild.firstElementChild.contentWindow.documentDirty;if(documentDirty&&confirm(o.el.lastElementChild.firstElementChild.contentWindow.checkDirt(o.event))||!documentDirty){o.el.classList.remove('in');if(!o.animation){o.el.classList.remove('show')}o.calc(1);if(o.o&&o.o.parentNode){o.o.parentNode.removeChild(o.o);o.wrap.style.overflow=''}o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);if(o.el.parentNode){o.el.parentNode.removeChild(o.el)}},200)}}}else{o.el.classList.remove('in');if(!o.animation){o.el.classList.remove('show')}o.calc(1);if(o.o&&o.o.parentNode){o.o.parentNode.removeChild(o.o);o.wrap.style.overflow=''}o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);if(o.el.parentNode){o.el.parentNode.removeChild(o.el)}},200)}if(typeof o.onclose==='function'){o.onclose(e,o.el)}},calc:function(f){var els=o.wrap.ownerDocument.querySelectorAll('.'+o.className+'.in[data-position="'+o.el.dataset.position+'"]');if(els&&els.length){o.els=[];for(var i=0;i×'}if(o.title){o.header=document.createElement('div');if(o.icon!=='none'){o.header.innerHTML+=''}o.header.innerHTML+=o.title;o.header.className='evo-popup-header';o.el.appendChild(o.header)}o.el.innerHTML+='
      ';o.wrap.appendChild(o.el);o.mt=parseFloat(getComputedStyle(o.el).marginTop);if(o.maxheight){o.maxheight=/(%)/.test(o.maxheight)?(o.w.innerHeight-o.el.offsetHeight-o.mt)/100*parseInt(o.maxheight):o.maxheight;o.el.lastChild.style.overflowY='auto';o.el.lastChild.style.maxHeight=o.maxheight+'px'}if(o.url){o.draggable=1;if(o.iframe==='iframe'){o.resize=1;o.uid=modx.urlToUid(a.url);o.el.className+=' '+o.addclass+' '+o.className+'-iframe';o.el.id='evo-popup-'+o.uid;d.getElementById('mainloader').className='show';o.frame=d.createElement('iframe');o.frame.width='100%';o.frame.height='100%';o.frame.frameBorder='0';o.frame.src=o.url;o.frame.onload=function(e){e.target.contentWindow.opener=o.w;a.url=e.target.contentWindow.location.href;o.uid=modx.urlToUid(a.url);o.event=e;if(!!e.target.contentWindow.__alertQuit){modx.popup({type:'warning',title:'MODX :: Alert',position:'top center alertQuit',content:e.target.contentWindow.document.body.querySelector('p').innerHTML});e.target.contentWindow.document.body.innerHTML='';e.target.contentWindow.alert=function(){}}else{if(modx.getActionFromUrl(a.url,2)||o.wrap.querySelectorAll('#evo-popup-'+o.uid).length>1){o.el.close()}else{if(e.target.contentDocument.querySelectorAll('h1')[0]){a.title=e.target.contentDocument.querySelectorAll('h1')[0].innerHTML}else if(e.target.contentDocument.title){a.title=e.target.contentDocument.title}if(o.header){e.target.offsetParent.offsetParent.getElementsByClassName(o.header.className)[0].innerHTML=a.title}e.target.offsetParent.offsetParent.id='evo-popup-'+o.uid;e.target.offsetParent.offsetParent.classList.remove('changed')}}e.target.contentWindow.close=o.close;modx.main.stopWork()};o.el.lastChild.appendChild(o.frame);o.show()}else{var xhr=new XMLHttpRequest();xhr.open(o.method,o.url,true);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');xhr.setRequestHeader('X-REQUESTED-WITH','XMLHttpRequest');if(o.dataType){xhr.responseType=o.dataType}xhr.onload=function(){if(this.readyState===4){o.el.className+=' '+o.className+'-ajax';if(o.dataType==='document'){if(o.selector){var r=this.response.documentElement.querySelector(o.selector);if(r){o.el.lastChild.innerHTML+=r.innerHTML}}else{o.el.lastChild.innerHTML+=this.response.body.innerHTML}}else{o.el.lastChild.innerHTML+=this.response}o.show()}};xhr.send(o.data)}}else{o.el.lastChild.innerHTML+=o.content;o.show()}}return o}},getWindowDimension:function(){var a=0,b=0,c=d.documentElement,e=d.body;if(typeof(w.innerWidth)==='number'){a=w.innerWidth;b=w.innerHeight}else if(c&&(c.clientWidth||c.clientHeight)){a=c.clientWidth;b=c.clientHeight}else if(e&&(e.clientWidth||e.clientHeight)){a=e.clientWidth;b=e.clientHeight}return{'width':a,'height':b}},hideDropDown:function(e){e=e||w.event||w.main.event;if(tree.ca==='open'||tree.ca===''){modx.tree.setSelectedByContext()}if(modx.tree.ctx!==null){d.getElementById(modx.frameset).removeChild(modx.tree.ctx);modx.tree.ctx=null}if(!/dropdown\-item/.test(e.target.className)){var els=d.querySelectorAll('.dropdown.show'),n=null,t=e.target||e.target.parentNode,i;if(typeof t.dataset.toggle!=='undefined'){n=d.querySelector(t.dataset.toggle)}else if(t.classList.contains('dropdown-toggle')){n=t.offsetParent}for(i=0;i';if(this.classDrag)this.el.classList.add(this.classDrag);if(this.classResize)this.el.classList.add(this.classResize);this.el.insertBefore(this.borders,this.el.firstChild);if(this.handler&&this.el.getElementsByClassName(this.handler)[0]){this.handler=this.el.getElementsByClassName(this.handler)[0];this.handlerHeight=this.handler.offsetHeight}this.el.onmousedown=function(e){s.mousedown(e)};this.el.ontouchstart=function(e){s.mousedown(e.changedTouches[0])};this.wrap.addEventListener('mousemove',function(e){s.calc(e)},false);this.wrap.addEventListener('touchmove',function(e){s.calc(e.changedTouches[0])},false)};this.dragging.init.prototype={mousedown:function(e){if(e.target.classList.contains('close')){return}e=document.all?window.event:e;var s=this,x=document.all?window.event.clientX:e.clientX,y=document.all?window.event.clientY:e.clientY,style=w.getComputedStyle(this.el);this.elmX=(x-this.el.offsetLeft+parseInt(style.marginLeft));this.elmY=(y-this.el.offsetTop+parseInt(style.marginTop));this.el.position=this.el.getBoundingClientRect();this.el.style.position='fixed';this.el.style.transitionDuration='0s';this.el.style.webkitTransitionDuration='0s';this.el.style.left=this.el.offsetLeft-parseInt(style.marginLeft)+'px';this.el.style.top=this.el.offsetTop-parseInt(style.marginTop)+'px';this.el.style.right='auto';this.el.style.bottom='auto';this.el.style.width=this.el.position.width+'px';this.el.style.height=this.el.position.height+'px';if(e.target.parentNode===this.borders){this.isresize=this.resize;this.el.classList.add('is-resize')}else{if(!this.handler||(this.handler&&e.target===this.handler)){this.isdrag=true;this.el.classList.add('is-drag')}}if(typeof this.start==='function'){this.onstart(e,this.el)}if(e.preventDefault){e.preventDefault()}else{document.onselectstart=function(){return false}}this.wrap.onmousemove=function(e){s.mousemove(e)};this.wrap.ontouchmove=function(e){s.mousemove(e.changedTouches[0]);e.stopPropagation()};this.wrap.onmouseup=function(e){s.mouseup(e)};this.wrap.ontouchend=function(e){s.mouseup(e.changedTouches[0]);e.stopPropagation()}},mousemove:function(e){var x=document.all?window.event.clientX:e.clientX,y=document.all?window.event.clientY:e.clientY;if(this.isresize){if(this.onRight)this.el.style.width=Math.max(x-this.el.position.left+(this.el.position.width-this.x),this.minWidth)+'px';if(this.onBottom)this.el.style.height=Math.max(y-this.el.position.top+(this.el.position.height-this.y),this.minHeight)+'px';if(this.onLeft){this.width=Math.max(this.el.position.left-x+this.el.position.width+this.x,this.minWidth);if(this.width>this.minWidth){this.el.style.width=this.width+'px';this.el.style.left=x-this.elmX+'px'}}if(this.onTop){var currentHeight=Math.max(this.el.position.top-y+this.el.position.height+this.y,this.minHeight);if(currentHeight>this.minHeight){this.el.style.height=currentHeight+'px';this.el.style.top=y-this.elmY+'px'}}if(typeof this.onresize==='function'){this.onresize(e,this.el)}}else if(this.isdrag){this.el.style.opacity=this.opacity;this.el.style.left=x-this.elmX+'px';this.el.style.top=y-this.elmY+'px';if(typeof this.drag==='function'){this.ondrag(e,this.el)}}},mouseup:function(e){if(this.isdrag||this.isresize){this.el.classList.remove('is-resize');this.el.classList.remove('is-drag');this.el.style.opacity='';this.el.style.transitionDuration='';this.el.style.webkitTransitionDuration='';this.el.position=this.el.getBoundingClientRect();this.isdrag=false;this.isresize=false;this.wrap.onmousemove=null;this.wrap.onselectstart=null;if(typeof this.stop==='function'){this.onstop(e,this.el)}}},calc:function(e){if(this.isresize||this.isdrag){return}this.x=e.clientX-this.el.offsetLeft;this.y=e.clientY-this.el.offsetTop;if(this.resize){this.onTop=this.y=this.el.offsetWidth-this.border;this.onBottom=this.y>=this.el.offsetHeight-this.border;if(this.onRight&&this.onBottom||this.onLeft&&this.onTop){this.el.style.cursor='nwse-resize'}else if(this.onRight&&this.onTop||this.onBottom&&this.onLeft){this.el.style.cursor='nesw-resize'}else if(this.onRight||this.onLeft){this.el.style.cursor='ew-resize'}else if(this.onBottom||this.onTop){this.el.style.cursor='ns-resize'}else if(this.x>0&&this.y>0&&(this.x=this.border)){this.el.style.cursor='move'}else{this.el.style.cursor='default'}}else{if(this.x>0&&this.y>0&&(this.x=this.border)){this.el.style.cursor='move'}}}};return new this.dragging.init(a,b)},setTypeIcon:function(a){var b='';switch(this.typesactions[a]){case 1:b='fa fa-newspaper-o';break;case 2:b='fa fa-list-alt';break;case 3:b='fa fa-th-large';break;case 4:b='fa fa-code';break;case 5:b='fa fa-plug';break;case 6:b='fa fa-cube';break;case 7:b='fa fa-pencil-square-o';break;default:b='fa fa-circle'}return b}});w.mainMenu={};w.mainMenu.stopWork=function(){modx.main.stopWork()};w.mainMenu.work=function(){modx.main.work()};w.mainMenu.reloadtree=function(){if(modx.plugins.ElementsInTree){setTimeout('reloadElementsInTree()',50)}if(modx.config.global_tabs){setTimeout('modx.tree.restoreTree()',100)}};w.mainMenu.startrefresh=function(a){if(a===1){}if(a===2){}if(a===9){modx.tree.restoreTree()}if(a===10){w.location.href=modx.MODX_MANAGER_URL}};w.mainMenu.startmsgcount=function(a,b,c){modx.updateMail(c)};w.mainMenu.hideTreeFrame=function(){modx.resizer.setWidth(0)};w.mainMenu.defaultTreeFrame=function(){modx.resizer.setDefaultWidth()};w.tree={};w.tree.ca='open';w.tree.document=document;w.tree.saveFolderState=function(){};w.tree.updateTree=function(){modx.tree.updateTree()};w.tree.restoreTree=function(){modx.tree.restoreTree()};w.tree.resizeTree=function(){};w.onbeforeunload=function(){var a=w.main.frameElement.contentWindow;if(modx.getActionFromUrl(a.location.search,27)){modx.get(modx.MODX_MANAGER_URL+'?a=67&type=7&id='+modx.main.getQueryVariable('id',a.location.search.substring(1)))}};d.addEventListener('DOMContentLoaded',function(){modx.init()})})(typeof jQuery!=='undefined'?jQuery:'',window,document,undefined);(function(){if(!Element.prototype.closest){Element.prototype.closest=function(a){var b=this,c,d;['matches','webkitMatchesSelector','mozMatchesSelector','msMatchesSelector','oMatchesSelector'].some(function(fn){if(typeof document.body[fn]==='function'){c=fn;return true}return false});if(b&&c&&b[c](a))return b;while(b){d=b.parentElement;if(d&&c&&d[c](a))return d;b=d}return null}}})(); \ No newline at end of file +(function($,w,d,u){'use strict';modx.extended({frameset:'frameset',minWidth:840,isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),typesactions:{'16':1,'301':2,'78':3,'22':4,'102':5,'108':6,'3':7,'4':7,'6':7,'27':7,'61':7,'62':7,'63':7,'72':7},thememodes:['','lightness','light','dark','darkness'],tabsTimer:0,popupTimer:0,init:function(){if(!localStorage.getItem('MODX_widthSideBar')){localStorage.setItem('MODX_widthSideBar',this.config.tree_width)}this.mainmenu.init();if(w.location.hash){if(modx.getActionFromUrl(w.location.hash,2)){w.history.replaceState(null,d.title,modx.MODX_MANAGER_URL)}else if(modx.getActionFromUrl(w.location.hash)||modx.main.getQueryVariable('filemanager',w.location.hash)){var url=modx.main.getQueryVariable('filemanager',w.location.hash)?modx.MODX_MANAGER_URL+modx.main.getQueryVariable('filemanager',w.location.hash)+w.location.hash.replace('#?','?'):w.location.href.replace('#?','?');if(modx.config.global_tabs){modx.tabs({url:url,title:'blank'})}else if(w.main){w.main.frameElement.src=url}else{modx.openWindow(url)}}}this.resizer.init();this.search.init();if(this.config.session_timeout>0){w.setInterval(this.keepMeAlive,1000*60*this.config.session_timeout)}if(modx.config.mail_check_timeperiod>0&&modx.permission.messages){setTimeout('modx.updateMail(true)',1000)}d.addEventListener('click',this.hideDropDown,false);if(modx.config.global_tabs){d.addEventListener('click',this.tabs,false);this.tabs({url:'?a=2',reload:0})}},mainmenu:{id:'mainMenu',init:function(){var $mm=$('#mainMenu'),mm=d.getElementById('mainMenu'),timer;$mm.on('click','a',function(e){if($(this).hasClass('dropdown-toggle')){if($mm.hasClass('show')&&($(this).hasClass('selected')||!modx.isMobile&&$(this).parent().hasClass('hover'))){$(this).removeClass('selected');$mm.removeClass('show')}else{$('.nav > li > a:not(:hover)').removeClass('selected');$(this).addClass('selected');$mm.addClass('show')}e.stopPropagation();e.target.dataset.toggle='#mainMenu';modx.hideDropDown(e)}if($(this).closest('ul').hasClass('dropdown-menu')&&!$(this).parent('li').hasClass('dropdown-back')){$('.nav > .active').removeClass('active');$('.nav li.selected').removeClass('selected');$(this).closest('.nav > li').addClass('active');if(this.offsetParent.id){d.getElementById(this.offsetParent.id.substr(7)).classList.add('selected')}if((modx.isMobile||w.innerWidth li',function(){var els=mm.querySelectorAll('.nav > li.hover:not(:hover)');for(var i=0;i li li',function(e){var self=this,ul;var els=mm.querySelectorAll('.nav > li li.hover:not(:hover)');for(var i=0;i'+modx.lang.paging_prev+''+data}ul.id='parent_'+self.id;ul.innerHTML=data;var id=w.location.hash.substr(2).replace(/=/g,'_').replace(/&/g,'__');var el=d.getElementById(id);if(el){el.parentNode.classList.add('selected');d.getElementById(el.parentNode.parentNode.id.substr(7)).classList.add('selected')}for(var i=0;iitems.length-1){index=items.length-1}if(index>=0&&index2){s.timer=setTimeout(function(){s.loader.style.display='block';modx.get(modx.MODX_MANAGER_URL+'?a=71&ajax=1&submitok=Search&searchid='+s.input.value,function(data){s.loader.style.display='none';s.results=data.querySelector('.ajaxSearchResults');if(s.results&&s.results.innerHTML!==''){s.result.innerHTML=s.results.outerHTML;s.open();s.result.onclick=function(e){var t=e.target,p=t.parentNode;if(t.tagName==='I'){modx.openWindow({title:p.innerText,id:p.id,url:p.href});e.preventDefault();e.stopPropagation()}else{var a=t.tagName==='A'&&t||p.tagName==='A'&&p;if(a){var el=s.result.querySelector('.selected');if(el)el.className='';a.className='selected';if(modx.isMobile)s.close()}}}}else{s.empty()}},'document')},300)}else{s.empty()}};if(modx.isMobile){this.input.onblur=this.close}this.input.onfocus=this.open;this.input.onclick=this.open;this.input.onmouseenter=this.open;this.result.onmouseenter=this.open;this.result.onmouseleave=this.close;this.mask.onmouseenter=this.open;this.mask.onmouseleave=this.close},open:function(){if(modx.search.results){modx.search.result.classList.add('open')}},close:function(){modx.search.result.classList.remove('open')},empty:function(){modx.search.result.classList.remove('open');modx.search.result.innerHTML=''}},main:{id:'main',idFrame:'mainframe',as:null,onload:function(e){w.main=e.target.contentWindow||e.target.defaultView;modx.main.tabRow.init();modx.main.stopWork();modx.main.scrollWork();w.main.document.addEventListener('click',modx.hideDropDown,false);w.main.document.addEventListener('contextmenu',modx.main.oncontextmenu,false);if(modx.config.global_tabs){w.main.document.addEventListener('click',modx.tabs,false)}w.history.replaceState(null,d.title,modx.getActionFromUrl(w.main.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.main.location.search);setTimeout('modx.tree.restoreTree()',100)},oncontextmenu:function(e){if(e.ctrlKey)return;var el=e.target;if(modx.user.role===1&&/modxtv|modxplaceholder|modxattributevalue|modxchunk|modxsnippet|modxsnippetnocache/i.test(el.className)){var id=Date.now(),name=el.innerText.replace(/[\[|\]|{|}|\*||\#|\+|?|\!|&|=|`|:]/g,''),type=el.className.replace(/cm-modx/,''),n=!!name.replace(/^\d+$/,'');if(name&&n){e.preventDefault();modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',{a:'modxTagHelper',name:name,type:type},function(r){if(r){r=JSON.parse(r);for(var k in r){if(r.hasOwnProperty(k)&&r[k].url){r[k]['onclick']='if(event.shiftKey){modx.openWindow({url:\''+r[k].url+'\'})}else{modx.popup({url:\''+r[k].url+'\',title:\''+r.header.innerHTML+'\',width:\'95%\',height:\'95%\',margin:0,hide:0,hover:0,overlay:1,overlayclose:0,position:\'center elements\',animation:0,icon:\'none\'})}'}}r=JSON.stringify(r);el.id='node'+id;el.dataset.contextmenu=r;modx.tree.showPopup(e,id,name)}})}e.preventDefault()}},tabRow:{init:function(){var row=w.main.document.querySelector('.tab-pane > .tab-row');if(row)this.build(row)},build:function(row){var rowContainer=d.createElement('div'),sel=row.querySelector('.selected');rowContainer.className='tab-row-container';row.parentNode.insertBefore(rowContainer,row);rowContainer.appendChild(row);var p=d.createElement('i');p.className='fa fa-angle-left prev disable';p.onclick=function(e){e.stopPropagation();e.preventDefault();var sel=row.querySelector('.selected');if(sel.previousSibling){sel.previousSibling.click();modx.main.tabRow.scroll(row)}};rowContainer.appendChild(p);var n=d.createElement('i');n.className='fa fa-angle-right next disable';n.onclick=function(e){e.stopPropagation();e.preventDefault();var sel=row.querySelector('.selected');if(sel.nextSibling){sel.nextSibling.click();modx.main.tabRow.scroll(row)}};rowContainer.appendChild(n);setTimeout(function(){sel=row.querySelector('.selected');modx.main.tabRow.scroll(row,sel);w.main.addEventListener('resize',function(){modx.main.tabRow.scroll(row)},false);if(sel){if(sel.previousSibling)p.classList.remove('disable');if(sel.nextSibling)n.classList.remove('disable')}},100);row.onclick=function(e){var sel=e.target.tagName==='H2'?e.target:e.target.tagName==='SPAN'?e.target.parentNode:null;if(sel){if(sel.previousSibling){this.parentNode.querySelector('i.prev').classList.remove('disable')}else{this.parentNode.querySelector('i.prev').classList.add('disable')}if(sel.nextSibling){this.parentNode.querySelector('i.next').classList.remove('disable')}else{this.parentNode.querySelector('i.next').classList.add('disable')}modx.main.tabRow.scroll(this,sel)}}},scroll:function(row,sel,a){sel=sel||row.querySelector('.selected')||row.firstChild;a=a||100;var c=0,elms=row.childNodes;for(var i=0;isel.offsetLeft){$(row).animate({scrollLeft:sel.offsetLeft-(sel.previousSibling?30:1)},a)}if(sel.offsetLeft+sel.offsetWidth>row.offsetWidth+row.scrollLeft){$(row).animate({scrollLeft:sel.offsetLeft-row.offsetWidth+sel.offsetWidth+(sel.nextSibling?30:0)},a)}if(c>row.offsetWidth){this.drag(row)}},drag:function(row){row.onmousedown=function(e){if(e.button===0){e.preventDefault();var x=e.clientX,f=row.scrollLeft;row.ownerDocument.body.focus();row.onmousemove=row.ownerDocument.onmousemove=function(e){if(Math.abs(e.clientX-x)>5){e.stopPropagation();row.scrollLeft=f-(e.clientX-x);row.ownerDocument.body.classList.add('drag')}};row.onmouseup=row.ownerDocument.onmouseup=function(e){e.stopPropagation();row.onmousemove=null;row.ownerDocument.onmousemove=null;row.ownerDocument.body.classList.remove('drag')}}}}},work:function(){d.getElementById('mainloader').classList.add('show')},stopWork:function(){d.getElementById('mainloader').classList.remove('show')},scrollWork:function(){var a=w.main.frameElement.contentWindow,b=a.location.search.substring(1)||a.location.hash.substring(2),c=localStorage.getItem('page_y')||0,f=localStorage.getItem('page_url')||b;if(((modx.getActionFromUrl(f)===modx.getActionFromUrl(b))&&(modx.main.getQueryVariable('id',f)&&modx.main.getQueryVariable('id',f)===modx.main.getQueryVariable('id',b)))||(f===b)){a.scrollTo(0,c)}a.addEventListener('scroll',function(){if(this.pageYOffset>=0){localStorage.setItem('page_y',this.pageYOffset.toString());localStorage.setItem('page_url',b)}},false)},getQueryVariable:function(a,b){var f='';if(b||typeof b==='string'){b=b.split('?');b=b[1]||b[0];b=b.split('&');for(var i=0;iMath.abs(ay)&&this.swipe){if(ax<0&&this.sidebar){if(Math.abs(ax)>h)ax=-h;tree.style.transform='translate3d('+ax+'px, 0, 0)';tree.style.WebkitTransform='translate3d('+ax+'px, 0, 0)';modx.resizer.mask.style.opacity=(0.5-0.5/-h*ax).toFixed(2);if(Math.abs(ax)>h/3){this.swipe='left'}else{this.swipe='right'}}else if(ax>0&&!this.sidebar){if(Math.abs(ax)>h)ax=h;tree.style.transform='translate3d('+ -(h-ax)+'px, 0, 0)';tree.style.WebkitTransform='translate3d('+ -(h-ax)+'px, 0, 0)';modx.resizer.mask.style.opacity=(0.5/h*ax).toFixed(2);if(Math.abs(ax)>h/3){this.swipe='right'}else{this.swipe='left'}}}},false);w.addEventListener('touchend',function(){if(this.swipe==='left'){d.body.classList.add('sidebar-closed');modx.resizer.setWidth(0)}if(this.swipe==='right'){d.body.classList.remove('sidebar-closed');modx.resizer.setWidth(h)}tree.style.cssText='';modx.resizer.mask.style.cssText=''},false)}},onMouseDown:function(e){e=e||w.event;modx.resizer.dragElement=e.target!==null?e.target:e.srcElement;if((e.buttons===1||e.button===0)&&modx.resizer.dragElement.id===modx.resizer.id){modx.resizer.oldZIndex=modx.resizer.dragElement.style.zIndex;modx.resizer.dragElement.style.zIndex=modx.resizer.newZIndex;modx.resizer.dragElement.style.background=modx.resizer.background;localStorage.setItem('MODX_widthSideBar',modx.resizer.dragElement.offsetLeft>0?modx.resizer.dragElement.offsetLeft:0);d.body.appendChild(modx.resizer.mask);d.onmousemove=modx.resizer.onMouseMove;d.body.focus();d.body.classList.add('resizer_move');d.onselectstart=function(){return false};modx.resizer.dragElement.ondragstart=function(){return false};return false}},onMouseMove:function(e){e=e||w.event;if(e.clientX>0){modx.resizer.left=e.clientX}else{modx.resizer.left=0}modx.resizer.dragElement.style.left=modx.pxToRem(modx.resizer.left)+'rem';d.getElementById('tree').style.width=modx.pxToRem(modx.resizer.left)+'rem';d.getElementById('main').style.left=modx.pxToRem(modx.resizer.left)+'rem';if(e.clientX<-2||e.clientY<-2){modx.resizer.onMouseUp(e)}},onMouseUp:function(e){if(modx.resizer.dragElement!==null&&e.button===0&&modx.resizer.dragElement.id===modx.resizer.id){if(e.clientX>0){d.body.classList.remove('sidebar-closed');modx.resizer.left=e.clientX}else{d.body.classList.add('sidebar-closed');modx.resizer.left=0}d.cookie='MODX_widthSideBar='+modx.pxToRem(modx.resizer.left);modx.resizer.dragElement.style.zIndex=modx.resizer.oldZIndex;modx.resizer.dragElement.style.background='';modx.resizer.dragElement.ondragstart=null;modx.resizer.dragElement=null;d.body.classList.remove('resizer_move');d.body.removeChild(modx.resizer.mask);d.onmousemove=null;d.onselectstart=null}},toggle:function(){if(modx.isMobile||w.innerWidth<=modx.minWidth){if(d.body.classList.contains('sidebar-closed')){d.body.classList.remove('sidebar-closed');localStorage.setItem('MODX_widthSideBar',0);d.cookie='MODX_widthSideBar='+modx.pxToRem(parseInt(d.getElementById('tree').offsetWidth))}else{localStorage.setItem('MODX_widthSideBar',parseInt(d.getElementById('tree').offsetWidth));d.body.classList.add('sidebar-closed');d.cookie='MODX_widthSideBar=0'}}else{var p=d.getElementById('tree').offsetWidth!==0?0:parseInt(localStorage.getItem('MODX_widthSideBar'))?parseInt(localStorage.getItem('MODX_widthSideBar')):modx.config.tree_width;modx.resizer.setWidth(p)}},setWidth:function(a){if(a>0){localStorage.setItem('MODX_widthSideBar',0);d.body.classList.remove('sidebar-closed')}else{localStorage.setItem('MODX_widthSideBar',parseInt(d.getElementById('tree').offsetWidth));d.body.classList.add('sidebar-closed')}d.cookie='MODX_widthSideBar='+modx.pxToRem(a);d.getElementById('tree').style.width=modx.pxToRem(a)+'rem';d.getElementById('resizer').style.left=modx.pxToRem(a)+'rem';d.getElementById('main').style.left=modx.pxToRem(a)+'rem'},setDefaultWidth:function(){modx.resizer.setWidth(modx.remToPx(modx.config.tree_width))}},tree:{ctx:null,rpcNode:null,itemToChange:'',selectedObjectName:null,selectedObject:0,selectedObjectDeleted:0,selectedObjectUrl:'',drag:false,deleted:[],init:function(){this.restoreTree()},draggable:function(){if(modx.permission.dragndropdocintree){var els=d.querySelectorAll('#treeRoot a:not(.empty)');for(var i=0;i-1:true;modx.tree.itemToChange=this.dataset.id||this.parentNode.id.replace('node','');modx.tree.selectedObjectName=this.dataset.titleEsc;if(draggable){this.parentNode.draggable=true;this.parentNode.ondragstart=modx.tree.ondragstart}else{this.parentNode.draggable=false;this.parentNode.ondragstart=function(){return false}}}},ondragstart:function(e){e.dataTransfer.effectAllowed='all';e.dataTransfer.dropEffect='all';e.dataTransfer.setData('text',this.id.substr(4))},ondragenter:function(e){if(d.getElementById('node'+modx.tree.itemToChange)===(this.parentNode.closest('#node'+modx.tree.itemToChange)||this.parentNode)){this.parentNode.className='';e.dataTransfer.effectAllowed='none';e.dataTransfer.dropEffect='none';modx.tree.drag=false}else{this.parentNode.className='dragenter';e.dataTransfer.effectAllowed='copy';e.dataTransfer.dropEffect='copy';modx.tree.drag=true}e.preventDefault()},ondragover:function(e){if(modx.tree.drag){var a=e.clientY;var b=parseInt(this.getBoundingClientRect().top);var c=a-b;if(c>this.offsetHeight/1.51){this.parentNode.classList.add('dragafter');this.parentNode.classList.remove('dragbefore');this.parentNode.classList.remove('dragenter');e.dataTransfer.effectAllowed='link';e.dataTransfer.dropEffect='link'}else if(c'}if(this.nextSibling){if(this.nextSibling.innerHTML){this.nextSibling.appendChild(el)}else{el.parentNode.removeChild(el)}els=this.parentNode.lastChild.children;for(i=0;i'}this.parentNode.parentNode.insertBefore(el,this.parentNode.nextSibling);els=this.parentNode.parentNode.children;for(i=0;i'}this.parentNode.parentNode.insertBefore(el,this.parentNode);els=this.parentNode.parentNode.children;for(i=0;i-1:true)){alert(modx.lang.error_no_privileges);modx.tree.restoreTree();return}modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',{a:'movedocument',id:id,parent:parent,menuindex:menuindex},function(r){if(r.errors)alert(r.errors);modx.tree.restoreTree()},'json');var b=w.main.frameElement.contentWindow.location.search.substr(1);if(modx.getActionFromUrl(b,27)&&parseInt(modx.main.getQueryVariable('id',b))===parseInt(id)){var index=menuindex.indexOf(id),elMenuIndex=w.main.document.querySelector('#documentPane input[name=menuindex]'),elParent=w.main.document.querySelector('#documentPane input[name=parent]'),elParentName=w.main.document.querySelector('#documentPane #parentName');if(elMenuIndex&&index>=0)elMenuIndex.value=index;if(elParent&&elParentName){elParent.value=parent;elParentName.innerHTML=parent+' ('+d.querySelector('#node'+parent+' > a').dataset.titleEsc+')'}}},toggleTheme:function(){var a,b=1,myCodeMirrors=w.main.myCodeMirrors,key;if(typeof localStorage['MODX_themeMode']==='undefined'){localStorage['MODX_themeMode']=modx.config.theme_mode}if(modx.thememodes[parseInt(localStorage['MODX_themeMode'])+1]){b=parseInt(localStorage['MODX_themeMode'])+1}a=modx.thememodes[b];for(key in modx.thememodes){if(modx.thememodes[key]){d.body.classList.remove(modx.thememodes[key]);w.main.document.body.classList.remove(modx.thememodes[key])}}d.body.classList.add(a);w.main.document.body.classList.add(a);d.cookie='MODX_themeMode='+b;localStorage['MODX_themeMode']=b;if(typeof myCodeMirrors!=='undefined'){for(key in myCodeMirrors){if(myCodeMirrors.hasOwnProperty(key)){if(~a.indexOf('dark')){w.main.document.getElementsByName(key)[0].nextElementSibling.classList.add('cm-s-'+myCodeMirrors[key].options.darktheme);w.main.document.getElementsByName(key)[0].nextElementSibling.classList.remove('cm-s-'+myCodeMirrors[key].options.defaulttheme)}else{w.main.document.getElementsByName(key)[0].nextElementSibling.classList.remove('cm-s-'+myCodeMirrors[key].options.darktheme);w.main.document.getElementsByName(key)[0].nextElementSibling.classList.add('cm-s-'+myCodeMirrors[key].options.defaulttheme)}}}}},toggleNode:function(e,id){e=e||w.event;if(e.ctrlKey)return;e.stopPropagation();var el=d.getElementById('node'+id).firstChild;this.rpcNode=el.nextSibling;var toggle=el.querySelector('.toggle'),icon=el.querySelector('.icon');if(this.rpcNode.innerHTML===''){if(toggle)toggle.innerHTML=el.dataset.iconCollapsed;icon.innerHTML=el.dataset.iconFolderOpen;var rpcNodeText=this.rpcNode.innerHTML,loadText=modx.lang.loading_doc_tree;modx.openedArray[id]=1;if(rpcNodeText===''||rpcNodeText.indexOf(loadText)>0){var folderState=this.getFolderState();d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent='+el.dataset.indent+'&parent='+id+'&expandAll='+el.dataset.expandall+folderState,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})}this.saveFolderState()}else{if(toggle)toggle.innerHTML=el.dataset.iconExpanded;icon.innerHTML=el.dataset.iconFolderClose;delete modx.openedArray[id];this.rpcNode.style.overflow='hidden';$(this.rpcNode.firstChild).animate({marginTop:-this.rpcNode.offsetHeight+'px'},100,function(){this.parentNode.innerHTML=''});this.saveFolderState()}e.preventDefault()},rpcLoadData:function(a){if(this.rpcNode!==null){var el;this.rpcNode.innerHTML=typeof a==='object'?a.responseText:a;this.rpcNode.loaded=true;if(this.rpcNode.firstChild.tagName==='DIV'){if(this.rpcNode.id==='treeRoot'){el=d.getElementById('binFull');if(el){this.showBin(true)}else{this.showBin(false)}}else{this.rpcNode.style.overflow='hidden';this.rpcNode.firstElementChild.style.marginTop=-this.rpcNode.offsetHeight+'px';$(this.rpcNode.firstChild).animate({marginTop:0},100)}d.getElementById('treeloader').classList.remove('visible')}else{el=d.getElementById('loginfrm');if(el){this.rpcNode.parentNode.removeChild(this.rpcNode);w.location.href=modx.MODX_MANAGER_URL}}}},treeAction:function(e,id,title){if(e.ctrlKey)return;var el=d.getElementById('node'+id).firstChild,treepageclick=el.dataset.treepageclick,showchildren=parseInt(el.dataset.showchildren),openfolder=parseInt(el.dataset.openfolder);title=title||el.dataset&&el.dataset.titleEsc;if(tree.ca==='move'){try{this.setSelectedByContext(id);w.main.setMoveValue(id,title)}catch(oException){alert(modx.lang.unable_set_parent)}}if(tree.ca==='open'||tree.ca===''){if(id===0){href='?a=2'}else{var href='';if(!isNaN(treepageclick)&&isFinite(treepageclick)){href='?a='+treepageclick+'&r=1&id='+id+(openfolder===0?this.getFolderState():'')}else{href=treepageclick}if(openfolder===2){if(showchildren!==1){href=''}this.toggleNode(e,id)}}if(href){if(e.shiftKey){w.getSelection().removeAllRanges();modx.openWindow(href);this.restoreTree()}else{modx.tabs({url:modx.MODX_MANAGER_URL+href,title:title+'('+id+')'});if(modx.isMobile)modx.resizer.toggle()}}this.itemToChange=id;this.setSelected(id)}if(tree.ca==='parent'){try{this.setSelectedByContext(id);w.main.setParent(id,title)}catch(oException){alert(modx.lang.unable_set_parent)}}if(tree.ca==='link'){try{this.setSelectedByContext(id);w.main.setLink(id)}catch(oException){alert(modx.lang.unable_set_link)}}e.preventDefault()},showPopup:function(e,id,title){if(e.ctrlKey)return;e.preventDefault();var tree=d.getElementById('tree'),el=d.getElementById('node'+id)||e.target,x=0,y=0;if(el.firstChild&&el.firstChild.dataset&&el.firstChild.dataset.contextmenu){el=el.firstChild}if(el){if(el.dataset.contextmenu){e.target.dataset.toggle='#contextmenu';modx.hideDropDown(e);this.ctx=d.createElement('div');this.ctx.id='contextmenu';this.ctx.className='dropdown-menu';d.getElementById(modx.frameset).appendChild(this.ctx);this.setSelectedByContext(id);var dataJson=JSON.parse(el.dataset.contextmenu);for(var key in dataJson){if(dataJson.hasOwnProperty(key)){var item=d.createElement('div');for(var k in dataJson[key]){if(dataJson[key].hasOwnProperty(k)){if(k.substring(0,2)==='on'){var onEvent=dataJson[key][k];item[k]=function(onEvent){return function(event){eval(onEvent)}}(onEvent)}else{item[k]=dataJson[key][k]}}}if(key.indexOf('header')===0)item.className+=' menuHeader';if(key.indexOf('item')===0)item.className+=' menuLink';if(key.indexOf('seperator')===0||key.indexOf('separator')===0)item.className+=' seperator separator';this.ctx.appendChild(item)}}x=e.clientX>0?e.clientX:e.pageX;y=e.clientY>0?e.clientY:e.pageY;e.view.position=e.view.frameElement?e.view.frameElement.getBoundingClientRect():e.target.offsetParent.getBoundingClientRect();if(e.view.frameElement){x+=e.view.position.left;y+=e.view.frameElement.offsetParent.offsetTop}else{if(e.target.parentNode.parentNode.classList.contains('node')){x+=50}}if(x>e.view.position.width){x=e.view.position.width-this.ctx.offsetWidth}if(y+this.ctx.offsetHeight/2>e.view.position.height){y=e.view.position.height-this.ctx.offsetHeight-5}else if(y-this.ctx.offsetHeight/20?e.clientX:e.pageX;y=e.clientY>0?e.clientY:e.pageY;if(y+ctx.offsetHeight/2>bodyHeight){y=bodyHeight-ctx.offsetHeight-5}else if(y-ctx.offsetHeight/230){this.selectedObjectName=this.selectedObjectName.substr(0,30)+'...'}var f=d.getElementById('nameHolder');f.innerHTML=this.selectedObjectName;el.style.left=a+(modx.config.textdir?'-190':'')+'px';el.style.top=b+'px';el.classList.add('show')},menuHandler:function(a){switch(a){case 1:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=3&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 2:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=27&r=1&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 3:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=4&pid='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 4:if(this.selectedObjectDeleted){alert('"'+this.selectedObjectName+'" '+modx.lang.already_deleted)}else if(confirm('"'+this.selectedObjectName+'"\n\n'+modx.lang.confirm_delete_resource)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=6&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 5:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=51&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 6:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=72&pid='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 7:if(confirm(modx.lang.confirm_resource_duplicate)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=94&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 8:if(d.getElementById('node'+this.itemToChange).firstChild.dataset.deleted){if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_undelete)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=63&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}}else{alert('"'+this.selectedObjectName+'"'+modx.lang.not_deleted)}break;case 9:if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_publish)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=61&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 10:if(this.itemToChange!==modx.config.site_start){if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_unpublish)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=62&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}}else{alert('Document is linked to site_start variable and cannot be unpublished!')}break;case 11:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=56&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 12:w.open(d.getElementById('node'+this.itemToChange).firstChild.dataset.href,'previeWin');break;default:alert('Unknown operation command.')}},setSelected:function(a){var el=d.querySelector('#tree .current');if(el)el.classList.remove('current');if(a){if(typeof a==='object'){a.classList.add('current')}else{el=d.querySelector('#node'+a+'>.node')||d.getElementById('node'+a);if(el)el.classList.add('current')}}},setActiveFromContextMenu:function(a){var el=d.querySelector('#node'+a+'>.node');if(el)this.setSelected(el)},setSelectedByContext:function(a){var el=d.querySelector('#treeRoot .selected');if(el)el.classList.remove('selected');el=d.querySelector('#node'+a+'>.node');if(el)el.classList.add('selected')},setItemToChange:function(){var a=w.main.document&&(w.main.document.URL||w.main.document.location.search),b=modx.getActionFromUrl(a);if(a&&modx.typesactions[b]){this.itemToChange=(modx.typesactions[b]===7?'':modx.typesactions[b]+'_')+parseInt(modx.main.getQueryVariable('id',a))}else{this.itemToChange=''}this.setSelected(this.itemToChange)},restoreTree:function(){if(d.getElementById('treeRoot')){d.getElementById('treeloader').classList.add('visible');this.setItemToChange();this.rpcNode=d.getElementById('treeRoot');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=2&id='+this.itemToChange,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})}},expandTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=1&id='+this.itemToChange,function(r){modx.tree.rpcLoadData(r);modx.tree.saveFolderState();modx.tree.draggable()})},collapseTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=0&id='+this.itemToChange,function(r){modx.openedArray=[];modx.tree.saveFolderState();modx.tree.rpcLoadData(r);modx.tree.draggable()})},updateTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');var a=d.sortFrm;var b='a=1&f=nodes&indent=1&parent=0&expandAll=2&dt='+a.dt.value+'&tree_sortby='+a.sortby.value+'&tree_sortdir='+a.sortdir.value+'&tree_nodename='+a.nodename.value+'&id='+this.itemToChange+'&showonlyfolders='+a.showonlyfolders.value;modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',b,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})},getFolderState:function(){var a;if(modx.openedArray!==[0]){a='&opened=';for(var key in modx.openedArray){if(modx.openedArray[key]){a+=key+'|'}}}else{a='&opened='}return a},saveFolderState:function(){modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&savestateonly=1'+this.getFolderState())},showSorter:function(e){e=e||w.event;var el=d.getElementById('floater');e.target.dataset.toggle='#floater';el.classList.toggle('show');el.onclick=function(e){e.stopPropagation()}},emptyTrash:function(){if(confirm(modx.lang.confirm_empty_trash)===true){modx.get(modx.MODX_MANAGER_URL+'?a=64',function(){modx.tabsClose(modx.tree.deleted);modx.tree.deleted=[];modx.tree.restoreTree()})}},showBin:function(a){var el=d.getElementById('treeMenu_emptytrash');if(el){if(a){el.title=modx.lang.empty_recycle_bin;el.classList.remove('disabled');el.innerHTML=modx.style.empty_recycle_bin;el.onclick=function(){modx.tree.emptyTrash()};var els=d.getElementById('tree').querySelectorAll('.deleted');for(var i=0;i0){if(el){el.innerHTML=c[0];el.style.display='block'}}else{if(el)el.style.display='none'}if(c[1]>0){el=d.getElementById('newMail');if(el){el.innerHTML=''+modx.style.email+modx.lang.inbox+' ('+c[0]+' / '+c[1]+')';el.style.display='block'}}if(modx.config.mail_check_timeperiod>0)setTimeout('modx.updateMail(true)',1000*modx.config.mail_check_timeperiod)})}}catch(oException){setTimeout('modx.updateMail(true)',1000*modx.config.mail_check_timeperiod)}},openWindow:function(a){if(typeof a!=='object'){a={'url':a}}if(!a.width)a.width=parseInt(w.innerWidth*0.9)+'px';if(!a.height)a.height=parseInt(w.innerHeight*0.8)+'px';if(!a.left)a.left=parseInt(w.innerWidth*0.05)+'px';if(!a.top)a.top=parseInt(w.innerHeight*0.1)+'px';if(!a.title)a.title=Math.floor((Math.random()*999999)+1);if(a.url){if(this.plugins.EVOmodal===1){top.EVO.modal.show(a)}else{w.open(a.url,a.title,'width='+a.width+',height='+a.height+',top='+a.top+',left='+a.left+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no')}}},tabsClose:function(a){if(modx.config.global_tabs&&a){for(var k in a){if(a.hasOwnProperty(k)){var el=d.getElementById(a[k]);if(el){el.firstElementChild.contentWindow.documentDirty=false;el.close()}}}}},tabs:function(a){function Tabs(a){var s=this;this.url=a.url;this.title=a.title||'';this.name=a.name||'';this.timer=null;this.olduid='';this.closeactions=[6,61,62,63,94];this.reload=typeof a.reload!=='undefined'?a.reload:1;this.action=modx.getActionFromUrl(a.url);this.uid=modx.getActionFromUrl(a.url,2)?'home':modx.urlToUid(a.url);this.page=d.getElementById('evo-tab-page-'+this.uid);this.row=d.getElementsByClassName('evo-tab-row')[0].firstElementChild;this.tab=d.getElementById('evo-tab-'+this.uid);if(this.page){if(this.uid==='home'){if(this.reload){this.page.firstElementChild.src=this.url;this.show()}else{this.reload=1;if(this.tab.onclick===null){this.tab.onclick=function(e){s.select.call(s,e,this)}}this.tab.show=function(e){s.show.call(s,e)};modx.tabs.selected=this.tab}}else{this.show();if(~this.closeactions.indexOf(this.action)){this.setDocPublished();modx.get(this.url,function(){modx.tree.restoreTree()})}}}else if(~this.closeactions.indexOf(this.action)){modx.get(this.url,function(){modx.tree.restoreTree()})}else{this.create()}}Tabs.prototype={create:function(){var s=this;modx.main.work();modx.tabs.selected=this.row.querySelector('.selected');if(modx.tabs.selected){d.getElementById(modx.tabs.selected.id.replace('tab','tab-page')).classList.remove('show');modx.tabs.selected.classList.remove('selected')}this.page=d.createElement('div');this.page.id='evo-tab-page-'+this.uid;this.page.className='evo-tab-page iframe-scroller show';this.page.innerHTML='';d.getElementById('main').appendChild(this.page);console.time('load-tab');this.page.firstElementChild.onload=function(e){s.onload.call(s,e);console.timeEnd('load-tab')};this.tab=d.createElement('h2');this.tab.id='evo-tab-'+this.uid;this.tab.className='tab selected';this.icon='';if(!/'}this.tab.innerHTML=''+this.icon+this.title+'×';this.row.appendChild(this.tab);this.tab.onclick=function(e){s.select.call(s,e,this)};this.tab.close=function(e){s.close.call(s,e)};this.tab.show=function(e){s.show.call(s,e)};this.page.close=function(e){s.close.call(s,e)}},onload:function(e){var s=this;w.main=e.target.contentWindow||e.target.defaultView;this.url=w.main.location.search||w.location.hash.substring(1);this.olduid=this.uid;this.uid=modx.urlToUid(this.url);if(!!w.main.__alertQuit){w.main.alert=function(a){};var message=w.main.document.body.innerHTML;w.main.document.body.innerHTML='';history.pushState(null,d.title,modx.getActionFromUrl(w.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.location.search);w.onpopstate=function(){history.go(1)};modx.popup({type:'warning',title:'MODX :: Alert',position:'top center alertQuit',content:message,wrap:'body'});modx.getLockedElements(modx.getActionFromUrl(this.url),modx.main.getQueryVariable('id',this.url),function(data){if(!!data){s.page.close();modx.tree.restoreTree()}else{w.main.location.href=modx.MODX_MANAGER_URL+s.url;w.history.replaceState(null,d.title,modx.getActionFromUrl(s.url,2)?modx.MODX_MANAGER_URL:'#'+s.url)}})}else{if(modx.getActionFromUrl(this.url,2)){this.close(e)}else if(this.olduid!==this.uid&&d.getElementById('evo-tab-'+this.uid)){this.close(e);d.getElementById('evo-tab-'+this.uid).show()}else{this.title=w.main.document.body.querySelectorAll('h1')[0]&&w.main.document.body.querySelectorAll('h1')[0].innerHTML||this.title;if(this.title&&this.uid!=='home'){this.tab.innerHTML=''+this.title+'×'}this.page.id='evo-tab-page-'+this.uid;this.tab.id='evo-tab-'+this.uid;this.tab.classList.remove('changed');this.show();modx.main.onload(e);w.main.document.addEventListener('click',function a(e){if(typeof e.view.documentDirty!=='undefined'&&e.view.documentDirty&&!s.tab.classList.contains('changed')){s.tab.classList.add('changed');this.removeEventListener(e.type,a,false)}},false);w.main.document.addEventListener('keyup',function a(e){if(typeof e.view.documentDirty!=='undefined'&&e.view.documentDirty&&!s.tab.classList.contains('changed')){s.tab.classList.add('changed');this.removeEventListener(e.type,a,false)}},false)}}},show:function(){var s=this;modx.tabs.selected=this.row.querySelector('.selected');if(modx.tabs.selected&&modx.tabs.selected!==this.tab){d.getElementById(modx.tabs.selected.id.replace('tab','tab-page')).classList.remove('show');modx.tabs.selected.classList.remove('selected')}this.page.classList.add('show');this.tab.classList.add('selected');modx.tabs.selected=this.tab;w.main=this.page.firstElementChild.contentWindow;w.history.replaceState(null,w.main.document.title,modx.getActionFromUrl(w.main.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.main.location.search);modx.tree.setItemToChange();modx.main.tabRow.scroll(this.row,this.tab,350)},close:function(e){var documentDirty=this.page.firstElementChild.contentWindow.documentDirty;var checkDirt=!!this.page.firstElementChild.contentWindow.checkDirt;if(documentDirty&&checkDirt&&confirm(this.page.firstElementChild.contentWindow.checkDirt(e))||!documentDirty){modx.tabs.selected=this.tab.classList.contains('selected')?this.tab.previousElementSibling:this.row.querySelector('.selected');this.page.parentNode.removeChild(this.page);this.row.removeChild(this.tab);modx.tabs.selected.show()}},select:function(e){if(e.target.className==='tab-close'){this.close(e)}else if(modx.tabs.selected===this.tab){var s=this;if(this.timer){clearTimeout(this.timer);this.timer=null;w.main.location.reload()}else{this.timer=setTimeout(function(){s.timer=null},250)}}else{this.show()}},setDocPublished:function(){var el=w.main.document.getElementsByName('publishedcheck')[0];if(el){el.checked=this.action===61;w.main.document.getElementsByName('published')[0].value=+el.checked}if(modx.getActionFromUrl(w.main.location.search,3)){w.main.location.reload()}}};if(modx.config.global_tabs){if(typeof a.currentTarget!=='undefined'){var e=a;if(e.button===0&&e.target&&(e.target.tagName==='A'&&e.target.target==='main'||(e.target.parentNode&&e.target.parentNode.tagName==='A'&&e.target.parentNode.target==='main'))){a=e.target.tagName==='A'&&e.target||e.target.parentNode.tagName==='A'&&e.target.parentNode;if(e.shiftKey){modx.openWindow({url:a.href})}else{modx.tabs({url:a.href,title:a.innerHTML})}e.preventDefault()}}else{return new Tabs(a)}}else if(a.url){if(w.main){w.main.frameElement.src=a.url}else{modx.openWindow(a.url)}}},popup:function(a){if(typeof a==='object'&&(a.url||a.content||a.text)){var o={addclass:'',animation:'fade',content:a.content||a.text||'',clickclose:0,closeall:0,data:'',dataType:'document',delay:5000,draggable:!1,event:null,height:'auto',hide:1,hover:1,icon:'',iframe:'iframe',margin:'.5rem',maxheight:'',method:'GET',overlay:0,overlayclose:0,position:'center',resize:!1,selector:'',showclose:1,target:'main',uid:'',type:'default',title:'',url:'',width:'20rem',wrap:w.main.document.body,zIndex:10500,w:null,show:function(){if(~o.position.indexOf('center')){if(o.event){o.el.style.left=o.event.clientX+o.mt+'px';o.el.style.bottom=o.w.innerHeight-o.el.offsetHeight-o.event.clientY+o.mt+'px'}else{o.el.style.left=/(%)/.test(o.width)?(100-parseInt(o.width))/2-o.mt/(o.w.innerWidth/100)+'%':(o.w.innerWidth-o.el.offsetWidth)/2-o.mt+'px';o.el.style.bottom=/(%)/.test(o.height)?(100-parseInt(o.height))/2-o.mt/(o.w.innerHeight/100)+'%':(o.w.innerHeight-o.el.offsetHeight-o.wrap.offsetTop)/2-o.mt+'px'}}if(~o.position.indexOf('left')){o.el.style.left=0}if(~o.position.indexOf('right')){o.el.style.right=0}else{o.el.style.right='auto'}if(~o.position.indexOf('top')){o.el.style.top=0;o.el.style.bottom=''}else{o.el.style.top='auto'}if(~o.position.indexOf('bottom')){o.el.style.bottom=0}o.calc();o.el.className+=' in';if(o.showclose){o.el.querySelector('.close').onclick=o.close}if(o.hide){o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);o.close()},o.delay)}if(o.hover){o.el.onmouseenter=function(){clearTimeout(o.el.timer)};o.el.onmouseleave=o.close}if(o.overlayclose&&o.o){o.o.onclick=o.close}if(o.clickclose){o.el.onclick=o.close}if(o.draggable){modx.dragging(o.el,{wrap:o.wrap,resize:o.resize})}},close:function(e){o.event=e||o.event||w.event;if(o.url&&o.iframe==='iframe'){var els=o.wrap.ownerDocument.querySelectorAll('.'+o.className+'.in');if(els){var documentDirty=o.el.lastElementChild.firstElementChild.contentWindow.documentDirty;if(documentDirty&&confirm(o.el.lastElementChild.firstElementChild.contentWindow.checkDirt(o.event))||!documentDirty){o.el.classList.remove('in');if(!o.animation){o.el.classList.remove('show')}o.calc(1);if(o.o&&o.o.parentNode){o.o.parentNode.removeChild(o.o);o.wrap.style.overflow=''}o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);if(o.el.parentNode){o.el.parentNode.removeChild(o.el)}},200)}}}else{o.el.classList.remove('in');if(!o.animation){o.el.classList.remove('show')}o.calc(1);if(o.o&&o.o.parentNode){o.o.parentNode.removeChild(o.o);o.wrap.style.overflow=''}o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);if(o.el.parentNode){o.el.parentNode.removeChild(o.el)}},200)}if(typeof o.onclose==='function'){o.onclose(e,o.el)}},calc:function(f){var els=o.wrap.ownerDocument.querySelectorAll('.'+o.className+'.in[data-position="'+o.el.dataset.position+'"]');if(els&&els.length){o.els=[];for(var i=0;i×'}if(o.title){o.header=document.createElement('div');if(o.icon!=='none'){o.header.innerHTML+=''}o.header.innerHTML+=o.title;o.header.className='evo-popup-header';o.el.appendChild(o.header)}o.el.innerHTML+='
      ';o.wrap.appendChild(o.el);o.mt=parseFloat(getComputedStyle(o.el).marginTop);if(o.maxheight){o.maxheight=/(%)/.test(o.maxheight)?(o.w.innerHeight-o.el.offsetHeight-o.mt)/100*parseInt(o.maxheight):o.maxheight;o.el.lastChild.style.overflowY='auto';o.el.lastChild.style.maxHeight=o.maxheight+'px'}if(o.url){o.draggable=1;if(o.iframe==='iframe'){o.resize=1;o.uid=modx.urlToUid(a.url);o.el.className+=' '+o.addclass+' '+o.className+'-iframe';o.el.id='evo-popup-'+o.uid;d.getElementById('mainloader').className='show';o.frame=d.createElement('iframe');o.frame.width='100%';o.frame.height='100%';o.frame.frameBorder='0';o.frame.src=o.url;o.frame.onload=function(e){e.target.contentWindow.opener=o.w;a.url=e.target.contentWindow.location.href;o.uid=modx.urlToUid(a.url);o.event=e;if(!!e.target.contentWindow.__alertQuit){modx.popup({type:'warning',title:'MODX :: Alert',position:'top center alertQuit',content:e.target.contentWindow.document.body.querySelector('p').innerHTML});e.target.contentWindow.document.body.innerHTML='';e.target.contentWindow.alert=function(){}}else{if(modx.getActionFromUrl(a.url,2)||o.wrap.querySelectorAll('#evo-popup-'+o.uid).length>1){o.el.close()}else{if(e.target.contentDocument.querySelectorAll('h1')[0]){a.title=e.target.contentDocument.querySelectorAll('h1')[0].innerHTML}else if(e.target.contentDocument.title){a.title=e.target.contentDocument.title}if(o.header){e.target.offsetParent.offsetParent.getElementsByClassName(o.header.className)[0].innerHTML=a.title}e.target.offsetParent.offsetParent.id='evo-popup-'+o.uid;e.target.offsetParent.offsetParent.classList.remove('changed')}}e.target.contentWindow.close=o.close;modx.main.stopWork()};o.el.lastChild.appendChild(o.frame);o.show()}else{var xhr=new XMLHttpRequest();xhr.open(o.method,o.url,true);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');xhr.setRequestHeader('X-REQUESTED-WITH','XMLHttpRequest');if(o.dataType){xhr.responseType=o.dataType}xhr.onload=function(){if(this.readyState===4){o.el.className+=' '+o.className+'-ajax';if(o.dataType==='document'){if(o.selector){var r=this.response.documentElement.querySelector(o.selector);if(r){o.el.lastChild.innerHTML+=r.innerHTML}}else{o.el.lastChild.innerHTML+=this.response.body.innerHTML}}else{o.el.lastChild.innerHTML+=this.response}o.show()}};xhr.send(o.data)}}else{o.el.lastChild.innerHTML+=o.content;o.show()}}return o}},getWindowDimension:function(){var a=0,b=0,c=d.documentElement,e=d.body;if(typeof(w.innerWidth)==='number'){a=w.innerWidth;b=w.innerHeight}else if(c&&(c.clientWidth||c.clientHeight)){a=c.clientWidth;b=c.clientHeight}else if(e&&(e.clientWidth||e.clientHeight)){a=e.clientWidth;b=e.clientHeight}return{'width':a,'height':b}},hideDropDown:function(e){e=e||w.event||w.main.event;if(tree.ca==='open'||tree.ca===''){modx.tree.setSelectedByContext()}if(modx.tree.ctx!==null){d.getElementById(modx.frameset).removeChild(modx.tree.ctx);modx.tree.ctx=null}if(!/dropdown\-item/.test(e.target.className)){var els=d.querySelectorAll('.dropdown.show'),n=null,t=e.target||e.target.parentNode,i;if(typeof t.dataset.toggle!=='undefined'){n=d.querySelector(t.dataset.toggle)}else if(t.classList.contains('dropdown-toggle')){n=t.offsetParent}for(i=0;i';if(this.classDrag)this.el.classList.add(this.classDrag);if(this.classResize)this.el.classList.add(this.classResize);this.el.insertBefore(this.borders,this.el.firstChild);if(this.handler&&this.el.getElementsByClassName(this.handler)[0]){this.handler=this.el.getElementsByClassName(this.handler)[0];this.handlerHeight=this.handler.offsetHeight}this.el.onmousedown=function(e){s.mousedown(e)};this.el.ontouchstart=function(e){s.mousedown(e.changedTouches[0])};this.wrap.addEventListener('mousemove',function(e){s.calc(e)},false);this.wrap.addEventListener('touchmove',function(e){s.calc(e.changedTouches[0])},false)};this.dragging.init.prototype={mousedown:function(e){if(e.target.classList.contains('close')){return}e=document.all?window.event:e;var s=this,x=document.all?window.event.clientX:e.clientX,y=document.all?window.event.clientY:e.clientY,style=w.getComputedStyle(this.el);this.elmX=(x-this.el.offsetLeft+parseInt(style.marginLeft));this.elmY=(y-this.el.offsetTop+parseInt(style.marginTop));this.el.position=this.el.getBoundingClientRect();this.el.style.position='fixed';this.el.style.transitionDuration='0s';this.el.style.webkitTransitionDuration='0s';this.el.style.left=this.el.offsetLeft-parseInt(style.marginLeft)+'px';this.el.style.top=this.el.offsetTop-parseInt(style.marginTop)+'px';this.el.style.right='auto';this.el.style.bottom='auto';this.el.style.width=this.el.position.width+'px';this.el.style.height=this.el.position.height+'px';if(e.target.parentNode===this.borders){this.isresize=this.resize;this.el.classList.add('is-resize')}else{if(!this.handler||(this.handler&&e.target===this.handler)){this.isdrag=true;this.el.classList.add('is-drag')}}if(typeof this.start==='function'){this.onstart(e,this.el)}if(e.preventDefault){e.preventDefault()}else{document.onselectstart=function(){return false}}this.wrap.onmousemove=function(e){s.mousemove(e)};this.wrap.ontouchmove=function(e){s.mousemove(e.changedTouches[0]);e.stopPropagation()};this.wrap.onmouseup=function(e){s.mouseup(e)};this.wrap.ontouchend=function(e){s.mouseup(e.changedTouches[0]);e.stopPropagation()}},mousemove:function(e){var x=document.all?window.event.clientX:e.clientX,y=document.all?window.event.clientY:e.clientY;if(this.isresize){if(this.onRight)this.el.style.width=Math.max(x-this.el.position.left+(this.el.position.width-this.x),this.minWidth)+'px';if(this.onBottom)this.el.style.height=Math.max(y-this.el.position.top+(this.el.position.height-this.y),this.minHeight)+'px';if(this.onLeft){this.width=Math.max(this.el.position.left-x+this.el.position.width+this.x,this.minWidth);if(this.width>this.minWidth){this.el.style.width=this.width+'px';this.el.style.left=x-this.elmX+'px'}}if(this.onTop){var currentHeight=Math.max(this.el.position.top-y+this.el.position.height+this.y,this.minHeight);if(currentHeight>this.minHeight){this.el.style.height=currentHeight+'px';this.el.style.top=y-this.elmY+'px'}}if(typeof this.onresize==='function'){this.onresize(e,this.el)}}else if(this.isdrag){this.el.style.opacity=this.opacity;this.el.style.left=x-this.elmX+'px';this.el.style.top=y-this.elmY+'px';if(typeof this.drag==='function'){this.ondrag(e,this.el)}}},mouseup:function(e){if(this.isdrag||this.isresize){this.el.classList.remove('is-resize');this.el.classList.remove('is-drag');this.el.style.opacity='';this.el.style.transitionDuration='';this.el.style.webkitTransitionDuration='';this.el.position=this.el.getBoundingClientRect();this.isdrag=false;this.isresize=false;this.wrap.onmousemove=null;this.wrap.onselectstart=null;if(typeof this.stop==='function'){this.onstop(e,this.el)}}},calc:function(e){if(this.isresize||this.isdrag){return}this.x=e.clientX-this.el.offsetLeft;this.y=e.clientY-this.el.offsetTop;if(this.resize){this.onTop=this.y=this.el.offsetWidth-this.border;this.onBottom=this.y>=this.el.offsetHeight-this.border;if(this.onRight&&this.onBottom||this.onLeft&&this.onTop){this.el.style.cursor='nwse-resize'}else if(this.onRight&&this.onTop||this.onBottom&&this.onLeft){this.el.style.cursor='nesw-resize'}else if(this.onRight||this.onLeft){this.el.style.cursor='ew-resize'}else if(this.onBottom||this.onTop){this.el.style.cursor='ns-resize'}else if(this.x>0&&this.y>0&&(this.x=this.border)){this.el.style.cursor='move'}else{this.el.style.cursor='default'}}else{if(this.x>0&&this.y>0&&(this.x=this.border)){this.el.style.cursor='move'}}}};return new this.dragging.init(a,b)},setTypeIcon:function(a){var b='';switch(this.typesactions[a]){case 1:b='fa fa-newspaper-o';break;case 2:b='fa fa-list-alt';break;case 3:b='fa fa-th-large';break;case 4:b='fa fa-code';break;case 5:b='fa fa-plug';break;case 6:b='fa fa-cube';break;case 7:b='fa fa-pencil-square-o';break;default:b='fa fa-circle'}return b}});w.mainMenu={};w.mainMenu.stopWork=function(){modx.main.stopWork()};w.mainMenu.work=function(){modx.main.work()};w.mainMenu.reloadtree=function(){if(modx.plugins.ElementsInTree){setTimeout('reloadElementsInTree()',50)}if(modx.config.global_tabs){setTimeout('modx.tree.restoreTree()',100)}};w.mainMenu.startrefresh=function(a){if(a===1){}if(a===2){}if(a===9){modx.tree.restoreTree()}if(a===10){w.location.href=modx.MODX_MANAGER_URL}};w.mainMenu.startmsgcount=function(a,b,c){modx.updateMail(c)};w.mainMenu.hideTreeFrame=function(){modx.resizer.setWidth(0)};w.mainMenu.defaultTreeFrame=function(){modx.resizer.setDefaultWidth()};w.tree={};w.tree.ca='open';w.tree.document=document;w.tree.saveFolderState=function(){};w.tree.updateTree=function(){modx.tree.updateTree()};w.tree.restoreTree=function(){modx.tree.restoreTree()};w.tree.resizeTree=function(){};w.onbeforeunload=function(){var a=w.main.frameElement.contentWindow;if(modx.getActionFromUrl(a.location.search,27)){modx.get(modx.MODX_MANAGER_URL+'?a=67&type=7&id='+modx.main.getQueryVariable('id',a.location.search.substring(1)))}};d.addEventListener('DOMContentLoaded',function(){modx.init()})})(typeof jQuery!=='undefined'?jQuery:'',window,document,undefined);(function(){if(!Element.prototype.closest){Element.prototype.closest=function(a){var b=this,c,d;['matches','webkitMatchesSelector','mozMatchesSelector','msMatchesSelector','oMatchesSelector'].some(function(fn){if(typeof document.body[fn]==='function'){c=fn;return true}return false});if(b&&c&&b[c](a))return b;while(b){d=b.parentElement;if(d&&c&&d[c](a))return d;b=d}return null}}})(); From 454f4f975988a9c1e87c93237c9c8295ff65be54 Mon Sep 17 00:00:00 2001 From: Mr B Date: Wed, 18 Apr 2018 11:13:00 +0100 Subject: [PATCH 185/274] Update index.css --- manager/media/style/default/css/index.css | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/manager/media/style/default/css/index.css b/manager/media/style/default/css/index.css index 273b2a5f9c..4b893e5439 100755 --- a/manager/media/style/default/css/index.css +++ b/manager/media/style/default/css/index.css @@ -1,9 +1,12 @@ +html, body { height: 100%; overflow: auto; -webkit-overflow-scrolling: touch; /* ios iframe scroll jumping to top fix */ } #frameset { position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; } #mainMenu, #tree, #main { position: absolute; } #mainMenu { top: 0; left: 0; width: 100%; height: 2.2rem; z-index: 100; } #tree { left: 0; top: 2.2rem; bottom: 0; width: 25rem; max-width: 100%; overflow: hidden; z-index: 2; } #main { left: 25rem; top: 2.2rem; right: 0; bottom: 0; z-index: 1; } -#main #mainframe { display: block; position: absolute; width: 100%; height: 100%; overflow: auto; } +#main #mainframe, #main .tabframes { display: block; position: absolute; height: 100%; overflow: auto; min-width: 100%!important; width: 100px!important; *width: 100%!important; /* includes ios iframe scroll fix */ } +.iframe-scroller { -webkit-overflow-scrolling: touch; overflow: auto; width:100%; height:100%; /* ios iframe scroll fix */ } +.evo-tab-page.iframe-scroller { height:calc(100% - 2.3em) } /* floater */ #floater { position: fixed; z-index: 1000; opacity: 0; visibility: hidden; max-width: 20rem; padding: 1.5rem; top: 4rem; left: 2rem; border-radius: 0.25rem; background-color: #fff; -webkit-box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); transition-duration: 0.15s } #floater.show { opacity: 1; visibility: visible; } From 657088dc1f2d6f0408937d80542d565852b6b3e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=91=D0=BE?= =?UTF-8?q?=D1=80=D0=B8=D1=81=D0=BE=D0=B2?= Date: Sat, 21 Apr 2018 15:53:32 +0500 Subject: [PATCH 186/274] Update .htaccess --- vendor/.htaccess | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/.htaccess b/vendor/.htaccess index 83c6d382fb..ff2beb844b 100755 --- a/vendor/.htaccess +++ b/vendor/.htaccess @@ -1,2 +1,2 @@ order deny,allow -allow from all +deny from all From ffd97e6bf7e7d538cb23c34881236cd71c033891 Mon Sep 17 00:00:00 2001 From: Deesen Date: Sat, 21 Apr 2018 16:14:35 +0200 Subject: [PATCH 187/274] =?UTF-8?q?[F]=20#616=20Fix=20TinyMCE4=20custom-th?= =?UTF-8?q?eme=C2=B4s=20toolbars=20with=20global=20settings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/lib/class.modxRTEbridge.php | 4 ++-- assets/plugins/tinymce4/bridge.tinymce4.inc.php | 2 +- .../tinymce4/theme/theme.tinymce4.base.inc.php | 4 ++-- .../tinymce4/theme/theme.tinymce4.custom.inc.php | 15 ++++++++++++--- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/assets/lib/class.modxRTEbridge.php b/assets/lib/class.modxRTEbridge.php index 5b1abdcd68..448c5fa28b 100755 --- a/assets/lib/class.modxRTEbridge.php +++ b/assets/lib/class.modxRTEbridge.php @@ -84,7 +84,7 @@ public function __construct($editorKey = NULL, $bridgeConfig=array(), $tvOptions foreach($this->gSettingsRows as $param=>$row) { if(isset($row['defaultCheckbox']) && $row['defaultCheckbox']) { $useGlobalName = $editorKey . '_' . $param . '_useglobal'; - $this->modxParams[$param . '_useglobal'] = !empty($editorConfig[$useGlobalName]) || (isset($editorConfig[$useGlobalName]) && is_null($editorConfig[$useGlobalName])) ? '1' : '0'; + $this->modxParams[$param . '_useglobal'] = !isset($editorConfig[$useGlobalName]) || !empty($editorConfig[$useGlobalName]) || (isset($editorConfig[$useGlobalName]) && is_null($editorConfig[$useGlobalName])) ? '1' : '0'; } } @@ -94,7 +94,7 @@ public function __construct($editorKey = NULL, $bridgeConfig=array(), $tvOptions // Handle defaultCheckbox if(isset($row['defaultCheckbox']) && $row['defaultCheckbox']) { $useGlobalName = $editorKey . '_' . $param . '_useglobal'; - $this->modxParams[$param . '_useglobal'] = !empty($editorConfig[$useGlobalName]) || (isset($editorConfig[$useGlobalName]) && is_null($editorConfig[$useGlobalName])) ? '1' : '0'; + $this->modxParams[$param . '_useglobal'] = !isset($editorConfig[$useGlobalName]) || !empty($editorConfig[$useGlobalName]) || (isset($editorConfig[$useGlobalName]) && is_null($editorConfig[$useGlobalName])) ? '1' : '0'; } }; diff --git a/assets/plugins/tinymce4/bridge.tinymce4.inc.php b/assets/plugins/tinymce4/bridge.tinymce4.inc.php index b613530c89..6256abe6d9 100755 --- a/assets/plugins/tinymce4/bridge.tinymce4.inc.php +++ b/assets/plugins/tinymce4/bridge.tinymce4.inc.php @@ -50,7 +50,7 @@ public function __construct($tvOptions=array()) 'template_chunks' => '', 'custom_buttons3' => '', 'custom_buttons4' => '', - 'skin' => 'lightgray' + 'skin' => '' ) ); diff --git a/assets/plugins/tinymce4/theme/theme.tinymce4.base.inc.php b/assets/plugins/tinymce4/theme/theme.tinymce4.base.inc.php index 033eb95479..7eb64bb66c 100755 --- a/assets/plugins/tinymce4/theme/theme.tinymce4.base.inc.php +++ b/assets/plugins/tinymce4/theme/theme.tinymce4.base.inc.php @@ -81,8 +81,8 @@ // @todo: final base-setup like tinymce3 "default"-theme? $this->set('plugins', 'anchor visualblocks autolink autosave save advlist fullscreen paste modxlink media contextmenu table youtube image imagetools code textcolor', 'string'); // https://www.tinymce.com/docs/get-started/basic-setup/#pluginconfiguration -$this->set('toolbar1', 'undo redo | bold forecolor backcolor strikethrough formatselect fontsizeselect pastetext code | fullscreen help', 'string'); -$this->set('toolbar2', 'image media youtube link unlink anchor | alignleft aligncenter alignright | bullist numlist | blockquote outdent indent | table hr | visualblocks styleprops removeformat', 'string'); +$this->set('toolbar1', 'undo redo | bold forecolor backcolor strikethrough formatselect fontsizeselect pastetext code | fullscreen help', 'string', false); +$this->set('toolbar2', 'image media youtube link unlink anchor | alignleft aligncenter alignright | bullist numlist | blockquote outdent indent | table hr | visualblocks styleprops removeformat', 'string', true); // Bridge does not return NULL, and does not use this->set() itself, so these parameters must be set at least once.. // Params get translated by bridge because it does not return NULL, so the returned values will be used diff --git a/assets/plugins/tinymce4/theme/theme.tinymce4.custom.inc.php b/assets/plugins/tinymce4/theme/theme.tinymce4.custom.inc.php index e2e5c034ee..576f092971 100755 --- a/assets/plugins/tinymce4/theme/theme.tinymce4.custom.inc.php +++ b/assets/plugins/tinymce4/theme/theme.tinymce4.custom.inc.php @@ -23,7 +23,16 @@ $this->set('menubar', false, 'bool' ); // https://www.tinymce.com/docs/configure/editor-appearance/#menubar +// Take over global values for each of the 4 rows +if(!empty($this->modxParams['custom_buttons_useglobal'])) { + $i=1; + while($i<=4) { + $this->modxParams['custom_buttons'.$i] = $modx->configGlobal[$this->editorKey.'_custom_buttons'.$i]; + $i++; + } +} + $this->set('toolbar1', $this->modxParams['custom_buttons1'], 'string', false ); -$this->set('toolbar2', $this->modxParams['custom_buttons2'], 'string', false ); -$this->set('toolbar3', $this->modxParams['custom_buttons3'], 'string', false ); -$this->set('toolbar4', $this->modxParams['custom_buttons4'], 'string', false ); \ No newline at end of file +$this->set('toolbar2', $this->modxParams['custom_buttons2'], 'string', true ); +$this->set('toolbar3', $this->modxParams['custom_buttons3'], 'string', true ); +$this->set('toolbar4', $this->modxParams['custom_buttons4'], 'string', true ); \ No newline at end of file From a0198c2076734b843dd7fc542e31f53957cb58a2 Mon Sep 17 00:00:00 2001 From: Deesen Date: Thu, 26 Apr 2018 19:38:58 +0200 Subject: [PATCH 188/274] [F] #650 Display valid-hostnames after setting them --- .../actions/mutate_settings/tab5_security_settings.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/manager/actions/mutate_settings/tab5_security_settings.inc.php b/manager/actions/mutate_settings/tab5_security_settings.inc.php index bebb006549..c7ab412921 100755 --- a/manager/actions/mutate_settings/tab5_security_settings.inc.php +++ b/manager/actions/mutate_settings/tab5_security_settings.inc.php @@ -1,6 +1,10 @@
      From 631286ca96d5918d90de4e4e59a7f6bc6bf17f9b Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Fri, 27 Apr 2018 16:58:12 +0200 Subject: [PATCH 189/274] welcome and online widgets stacked stacked on smaller screens. col-sm-6 replaced by col-lg-6 --- manager/actions/welcome.static.php | 4 ++-- manager/media/style/default/css/custom.css | 11 +---------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/manager/actions/welcome.static.php b/manager/actions/welcome.static.php index fdd3de0e94..171968fc02 100755 --- a/manager/actions/welcome.static.php +++ b/manager/actions/welcome.static.php @@ -239,7 +239,7 @@ $widgets['welcome'] = array( 'menuindex' => '10', 'id' => 'welcome', - 'cols' => 'col-sm-6', + 'cols' => 'col-lg-6', 'icon' => 'fa-home', 'title' => '[%welcome_title%]', 'body' => ' @@ -325,7 +325,7 @@ $widgets['onlineinfo'] = array( 'menuindex' => '20', 'id' => 'onlineinfo', - 'cols' => 'col-sm-6', + 'cols' => 'col-lg-6', 'icon' => 'fa-user', 'title' => '[%onlineusers_title%]', 'body' => '
      [+OnlineInfo+]
      ', diff --git a/manager/media/style/default/css/custom.css b/manager/media/style/default/css/custom.css index 838ad6d52d..4a9dfab835 100755 --- a/manager/media/style/default/css/custom.css +++ b/manager/media/style/default/css/custom.css @@ -221,17 +221,8 @@ text-decoration: none; color: #646b7b; box-shadow: none; transition-duration: .5 .widgets #modxrecent_widget .table.data tbody tr:not(:hover) { background-color: #fff } .widgets #modxrecent_widget .table.data tbody tr:nth-child(4n+1):not(:hover) { background-color: #f6f8f8 } .widgets #modxrecent_widget .table.data tbody tr:nth-child(2n) { background-color: #fff } -@media (max-width: 1399px) { -.widgets #welcome .wm_button { max-width: 20%; flex: 0 0 20%; } -} -@media (max-width: 1199px) { -.widgets #welcome .wm_button { max-width: 25%; flex: 0 0 25%; } -} -@media (max-width: 991px) { -.widgets #welcome .wm_button { max-width: 33.3333%; flex: 0 0 33.3333%; } -} @media (max-width: 767px) { -.widgets #welcome .wm_button { max-width: 50%; flex: 0 0 50%; } +.widgets #welcome .wm_button { max-width: 33.3333%; flex: 0 0 33.3333%; } } /* [ DATEPICKER ] */ .dp_container { position: absolute; z-index: 500; } From 3658514a88896adfb5459f31d2ad08b7ea6e362b Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Sun, 29 Apr 2018 17:29:30 +0200 Subject: [PATCH 190/274] welcome widget change --- manager/actions/welcome.static.php | 74 +++++++++++++++---------- manager/media/style/default/welcome.php | 6 ++ 2 files changed, 52 insertions(+), 28 deletions(-) diff --git a/manager/actions/welcome.static.php b/manager/actions/welcome.static.php index 171968fc02..2bae186912 100755 --- a/manager/actions/welcome.static.php +++ b/manager/actions/welcome.static.php @@ -56,6 +56,28 @@ $icon = ' [%help%]'; $ph['HelpIcon'] = wrapIcon($icon, 9); } + +if($modx->hasPermission('new_document')) { + $icon = '[%add_resource%]'; + $ph['ResourceIcon'] = wrapIcon($icon, 4); + $icon = '[%add_weblink%]'; + $ph['WeblinkIcon'] = wrapIcon($icon, 72); +} +if($modx->hasPermission('assets_images')) { + $icon = '[%images_management%]'; + $ph['ImagesIcon'] = wrapIcon($icon, 72); +} +if($modx->hasPermission('assets_files')) { + $icon = '[%files_management%]'; + $ph['FilesIcon'] = wrapIcon($icon, 72); +} +if($modx->hasPermission('change_password')) { + $icon = '[%change_password%]'; + $ph['PasswordIcon'] = wrapIcon($icon, 28); +} +$icon = '[%logout%]'; +$ph['LogoutIcon'] = wrapIcon($icon, 8); + // do some config checks if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); @@ -244,54 +266,50 @@ 'title' => '[%welcome_title%]', 'body' => '
      diff --git a/manager/media/style/default/welcome.php b/manager/media/style/default/welcome.php index 5292d5b40e..75f7835046 100755 --- a/manager/media/style/default/welcome.php +++ b/manager/media/style/default/welcome.php @@ -19,3 +19,9 @@ $_style['icons_security_large'] = 'fa fa-user fa-fw fa-2x'; $_style['icons_webusers_large'] = 'fa fa-users fa-fw fa-2x'; $_style['icons_help_large'] = 'fa fa-question-circle fa-fw fa-2x'; +$_style['icons_resource_large'] = 'fa fa-file fa-fw fa-2x'; +$_style['icons_weblink_large'] = 'fa fa-link fa-fw fa-2x'; +$_style['icons_images_large'] = 'fa fa-camera fa-fw fa-2x'; +$_style['icons_files_large'] = 'fa fa-files-o fa-fw fa-2x'; +$_style['icons_password_large'] = 'fa fa-lock fa-fw fa-2x'; +$_style['icons_logout_large'] = 'fa fa-sign-out fa-fw fa-2x'; From cc0e2294c41472732870c1c2e92927f7fefb3a6e Mon Sep 17 00:00:00 2001 From: Mr B Date: Mon, 30 Apr 2018 11:37:02 +0100 Subject: [PATCH 191/274] [F] Fix manager restrict by day login --- manager/processors/login.processor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/processors/login.processor.php b/manager/processors/login.processor.php index 0fe6f946c1..27a8008734 100755 --- a/manager/processors/login.processor.php +++ b/manager/processors/login.processor.php @@ -147,7 +147,7 @@ if($allowed_days) { $date = getdate(); $day = $date['wday'] + 1; - if(strpos($allowed_days, $day) === false) { + if(!in_array($day,explode(',',$allowed_days))) { jsAlert($_lang['login_processor_date']); return; } From 816c645a0aa3119fbe9d8883fa95f57aa2af5c1f Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Tue, 1 May 2018 15:19:17 +0200 Subject: [PATCH 192/274] welcome widget fix --- manager/media/style/default/css/custom.css | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/manager/media/style/default/css/custom.css b/manager/media/style/default/css/custom.css index 4a9dfab835..05a3e676a7 100755 --- a/manager/media/style/default/css/custom.css +++ b/manager/media/style/default/css/custom.css @@ -212,7 +212,7 @@ line-height: 1.7; border: 1px solid #ddd; text-decoration: none; color: #333; } .widgets .table .actions a .fa { margin: 0 .05rem; } /* widgets custom */ .widgets #welcome .wm_buttons { display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; margin-bottom: 1rem; padding: 0; text-align: center; border-bottom: 1px solid rgba(0, 0, 0, .05); } -.widgets #welcome .wm_button { max-width: 16.666667%; flex: 0 0 16.666667%; } +.widgets #welcome .wm_button { max-width: 50%; flex: 0 0 50%; } .widgets #welcome .wm_button a { display: block; height: 100%; padding: 1rem 1rem .5rem; text-decoration: none; color: #646b7b; box-shadow: none; transition-duration: .5s } .widgets #welcome .wm_button a:hover { color: #373b46; background-color: rgba(93, 109, 202, 0.16) } @@ -221,9 +221,18 @@ text-decoration: none; color: #646b7b; box-shadow: none; transition-duration: .5 .widgets #modxrecent_widget .table.data tbody tr:not(:hover) { background-color: #fff } .widgets #modxrecent_widget .table.data tbody tr:nth-child(4n+1):not(:hover) { background-color: #f6f8f8 } .widgets #modxrecent_widget .table.data tbody tr:nth-child(2n) { background-color: #fff } -@media (max-width: 767px) { +@media (min-width: 568px) { .widgets #welcome .wm_button { max-width: 33.3333%; flex: 0 0 33.3333%; } } +@media (min-width: 768px) { +.widgets #welcome .wm_button { max-width: 16.666667%; flex: 0 0 16.666667%; } +} +@media (min-width: 992px) { +.widgets #welcome .wm_button { max-width: 33.3333%; flex: 0 0 33.3333%; } +} +@media (min-width: 1400px) { +.widgets #welcome .wm_button { max-width: 16.666667%; flex: 0 0 16.666667%; } +} /* [ DATEPICKER ] */ .dp_container { position: absolute; z-index: 500; } .dp_cal { overflow: hidden; width: 220px; margin: 0.25rem 0; background-color: #fff; -webkit-box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.3); box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.3); } From 10a9a62b0c8ab0a55a2cd008fd77faeac6b9ca77 Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Wed, 2 May 2018 11:24:19 +0300 Subject: [PATCH 193/274] add params for manager_menu_position --- .../tab1_site_settings.inc.php | 8 ++++++++ manager/includes/default_config.php | 2 ++ manager/includes/lang/english.inc.php | 4 ++++ manager/includes/lang/russian-UTF8.inc.php | 20 ++++++++++++++++++- 4 files changed, 33 insertions(+), 1 deletion(-) diff --git a/manager/actions/mutate_settings/tab1_site_settings.inc.php b/manager/actions/mutate_settings/tab1_site_settings.inc.php index b3eae06de7..9466d09fdb 100755 --- a/manager/actions/mutate_settings/tab1_site_settings.inc.php +++ b/manager/actions/mutate_settings/tab1_site_settings.inc.php @@ -371,6 +371,14 @@ function SetUrl(url, width, height, alt) { + + + + + diff --git a/manager/includes/default_config.php b/manager/includes/default_config.php index bcc59b8451..7db0da7823 100755 --- a/manager/includes/default_config.php +++ b/manager/includes/default_config.php @@ -108,4 +108,6 @@ $c['group_tvs'] = 0; $c['global_tabs'] = 1; $c['manager_theme_mode'] = '3'; +$c['login_form_position'] = 'left'; +$c['manager_menu_position'] = 'top'; diff --git a/manager/includes/lang/english.inc.php b/manager/includes/lang/english.inc.php index 3a9905c391..d7598363c9 100755 --- a/manager/includes/lang/english.inc.php +++ b/manager/includes/lang/english.inc.php @@ -1499,3 +1499,7 @@ $_lang['login_logo_message'] = 'Recomended login logo image width: 360px, type .png'; $_lang['login_bg_title'] = 'Login page background image'; $_lang['login_bg_message'] = 'Recomended login page background image width: 1920px '; + +$_lang['manager_menu_position_title'] = 'Main menu position'; +$_lang['manager_menu_position_top'] = 'top'; +$_lang['manager_menu_position_left'] = 'left'; \ No newline at end of file diff --git a/manager/includes/lang/russian-UTF8.inc.php b/manager/includes/lang/russian-UTF8.inc.php index eb2183e35a..e93602f7c7 100755 --- a/manager/includes/lang/russian-UTF8.inc.php +++ b/manager/includes/lang/russian-UTF8.inc.php @@ -1456,4 +1456,22 @@ $_lang["viewopts_radio_inline"] = 'Инлайн'; $_lang["viewopts_radio_flex"] = 'Флекс'; $_lang["viewopts_fontsize"] = 'Размер шрифта'; -$_lang["viewopts_cb_alltabs"] = 'Все табы'; \ No newline at end of file +$_lang["viewopts_cb_alltabs"] = 'Все табы'; + +$_lang['email_sender_method'] = 'The envelope sender of the message'; +$_lang['auto'] = 'Auto-detect'; +$_lang['use_emailsender'] = 'Use [(emailsender)] value'; +$_lang['email_sender_method_message'] = 'The envelope sender of the message. This will usually be turned into a Return-Path header by the receiver, and is the address that bounces will be sent to. Auto-detect will work in most cases.'; + +$_lang['login_form_position_title'] = 'Положение формы авторизации'; +$_lang['login_form_position_left'] = 'слева'; +$_lang['login_form_position_center'] = 'по центру'; +$_lang['login_form_position_right'] = 'справа'; +$_lang['login_logo_title'] = 'Логотип на страничке авторизации'; +$_lang['login_logo_message'] = 'Рекомендованный размер логотипа по ширине: 360px, тип .png'; +$_lang['login_bg_title'] = 'Фоновая картинка на страничке авторизации'; +$_lang['login_bg_message'] = 'Рекомендованный размер фоновой картинки по ширине: 1920px'; + +$_lang['manager_menu_position_title'] = 'Расположение основного меню'; +$_lang['manager_menu_position_top'] = 'вверху'; +$_lang['manager_menu_position_left'] = 'слева'; \ No newline at end of file From 8aed61699d9963294551750953320ad3b6d8bf46 Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Wed, 2 May 2018 11:31:54 +0300 Subject: [PATCH 194/274] update FormLister to 1.7.19 --- .../core/lang/italian/activate.inc.php | 17 ++++++++++++++++ .../core/lang/italian/content.inc.php | 20 +++++++++++++++++++ .../core/lang/italian/deleteContent.inc.php | 16 +++++++++++++++ .../core/lang/italian/deleteUser.inc.php | 13 ++++++++++++ .../FormLister/core/lang/italian/form.inc.php | 17 ++++++++++++++++ .../core/lang/italian/login.inc.php | 14 +++++++++++++ .../core/lang/italian/mailchimp.inc.php | 13 ++++++++++++ .../core/lang/italian/profile.inc.php | 14 +++++++++++++ .../core/lang/italian/register.inc.php | 14 +++++++++++++ .../core/lang/italian/reminder.inc.php | 17 ++++++++++++++++ .../FormLister/docs/en/110_Lexicons.md | 4 ++-- assets/snippets/FormLister/docs/history.md | 8 ++++++++ ...20\277\320\270\321\201\320\265\320\274.md" | 4 ++-- ...20\270\320\272\320\276\320\275\321\213.md" | 6 +++--- .../lib/captcha/reCaptcha/wrapper.php | 2 +- install/assets/plugins/userHelper.tpl | 2 +- install/assets/snippets/FormLister.tpl | 2 +- 17 files changed, 173 insertions(+), 10 deletions(-) create mode 100644 assets/snippets/FormLister/core/lang/italian/activate.inc.php create mode 100644 assets/snippets/FormLister/core/lang/italian/content.inc.php create mode 100644 assets/snippets/FormLister/core/lang/italian/deleteContent.inc.php create mode 100644 assets/snippets/FormLister/core/lang/italian/deleteUser.inc.php create mode 100644 assets/snippets/FormLister/core/lang/italian/form.inc.php create mode 100644 assets/snippets/FormLister/core/lang/italian/login.inc.php create mode 100644 assets/snippets/FormLister/core/lang/italian/mailchimp.inc.php create mode 100644 assets/snippets/FormLister/core/lang/italian/profile.inc.php create mode 100644 assets/snippets/FormLister/core/lang/italian/register.inc.php create mode 100644 assets/snippets/FormLister/core/lang/italian/reminder.inc.php mode change 100755 => 100644 assets/snippets/FormLister/docs/en/110_Lexicons.md mode change 100755 => 100644 assets/snippets/FormLister/docs/history.md mode change 100755 => 100644 "assets/snippets/FormLister/docs/ru/110_\320\233\320\265\320\272\321\201\320\270\320\272\320\276\320\275\321\213.md" mode change 100755 => 100644 assets/snippets/FormLister/lib/captcha/reCaptcha/wrapper.php mode change 100755 => 100644 install/assets/plugins/userHelper.tpl mode change 100755 => 100644 install/assets/snippets/FormLister.tpl diff --git a/assets/snippets/FormLister/core/lang/italian/activate.inc.php b/assets/snippets/FormLister/core/lang/italian/activate.inc.php new file mode 100644 index 0000000000..03bf144343 --- /dev/null +++ b/assets/snippets/FormLister/core/lang/italian/activate.inc.php @@ -0,0 +1,17 @@ +[+activate.url+]'; +$_lang['activate.no_activation'] = 'Questo account utente non ha bisogno di attivazione o non può essere attivato.'; +$_lang['activate.update_failed'] = 'Impossibile procedere.'; +$_lang['activate.default_successTpl'] = '@CODE:Il link per attivare il tuo account è stato inviato via mail.'; +$_lang['activate.default_resetSuccessTpl'] = '@CODE:Il tuo account è attivato.'; + +return $_lang; diff --git a/assets/snippets/FormLister/core/lang/italian/content.inc.php b/assets/snippets/FormLister/core/lang/italian/content.inc.php new file mode 100644 index 0000000000..d603ddde7a --- /dev/null +++ b/assets/snippets/FormLister/core/lang/italian/content.inc.php @@ -0,0 +1,20 @@ +[+reset.url+]'; +$_lang['reminder.users_only'] = 'Solo gli utenti registrati possono ripristinare le password.'; +$_lang['reminder.update_failed'] = 'Impossibile procedere.'; +$_lang['reminder.default_successTpl'] = '@CODE:Il link per ripristinare la password è stato inviato per posta.'; +$_lang['reminder.default_resetSuccessTpl'] = '@CODE:La nuova password è stata inviata via mail.'; + +return $_lang; diff --git a/assets/snippets/FormLister/docs/en/110_Lexicons.md b/assets/snippets/FormLister/docs/en/110_Lexicons.md old mode 100755 new mode 100644 index 30affe0cf2..254a30e29d --- a/assets/snippets/FormLister/docs/en/110_Lexicons.md +++ b/assets/snippets/FormLister/docs/en/110_Lexicons.md @@ -3,10 +3,10 @@ To use lexicons you should create a file named "lexicon name.inc.php" in a folder named as full language name (russian-UTF8, english etc.): ``` ``` Parameters to load lexicons are: diff --git a/assets/snippets/FormLister/docs/history.md b/assets/snippets/FormLister/docs/history.md old mode 100755 new mode 100644 index 1791a2f0d1..1981c3009f --- a/assets/snippets/FormLister/docs/history.md +++ b/assets/snippets/FormLister/docs/history.md @@ -1,4 +1,12 @@ ## History +### 1.7.19 +* [Refactor] Имя пользователя и E-mail не приводятся в нижний регистр (Login, Register, Profile). +* [Refactor] Не выводятся пустые обертки для сообщений формы (Core). +* [Enhancement] Вывод логов моделей MODxAPI при отладке (Content, Register, Profile). +* [Enhancement] Spanish, Italian lexicons. +* [Fix] Опечатка в методе renderMessages() (Core). +* [Fix] Неправильно задавался параметр size для ReCaptcha. + ### 1.7.18 * [Enhancement] Dutch, Polish, English-Britain, German lexicons. * [Refactor] Экранирование значений массива до преобразования массива в строку в методе fieldsToPlaceholders diff --git "a/assets/snippets/FormLister/docs/ru/050_\320\236\321\202\320\277\321\200\320\260\320\262\320\272\320\260_\320\277\320\270\321\201\320\265\320\274.md" "b/assets/snippets/FormLister/docs/ru/050_\320\236\321\202\320\277\321\200\320\260\320\262\320\272\320\260_\320\277\320\270\321\201\320\265\320\274.md" index fc31025e5a..258faf10d3 100644 --- "a/assets/snippets/FormLister/docs/ru/050_\320\236\321\202\320\277\321\200\320\260\320\262\320\272\320\260_\320\277\320\270\321\201\320\265\320\274.md" +++ "b/assets/snippets/FormLister/docs/ru/050_\320\236\321\202\320\277\321\200\320\260\320\262\320\272\320\260_\320\277\320\270\321\201\320\265\320\274.md" @@ -160,12 +160,12 @@ ### automessageTpl Шаблон дополнительного письма. -Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. +Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. Обязательный параметр, если задан параметр autosender. Значение по умолчанию - пусто. ### ccSenderTpl -Шаблон письма на заданный в поле формы адрес. +Шаблон письма на заданный в поле формы адрес. Обязательный параметр, если задан параметр ccSender. Возможные значения - имя шаблона, указанное по правилам задания шаблонов в DocLister. diff --git "a/assets/snippets/FormLister/docs/ru/110_\320\233\320\265\320\272\321\201\320\270\320\272\320\276\320\275\321\213.md" "b/assets/snippets/FormLister/docs/ru/110_\320\233\320\265\320\272\321\201\320\270\320\272\320\276\320\275\321\213.md" old mode 100755 new mode 100644 index c9edeba8bc..fbb6ee3e31 --- "a/assets/snippets/FormLister/docs/ru/110_\320\233\320\265\320\272\321\201\320\270\320\272\320\276\320\275\321\213.md" +++ "b/assets/snippets/FormLister/docs/ru/110_\320\233\320\265\320\272\321\201\320\270\320\272\320\276\320\275\321\213.md" @@ -3,10 +3,10 @@ Для использования лексиконов необходимо создать папку с полным названием языка (russian-UTF8, english и т.д.), в ней создать файл название_лексикона.inc.php: ``` ``` Для загрузки лексиконов при вызове сниппета следует указать параметры: @@ -29,4 +29,4 @@ return $lang; }` ``` -После этого в шаблонах можно использовать плейсхолдеры [%ключ%] для подстановки значений из загруженных языковых файлов. Кроме того поддерживаются лексиконы компонента EvoBabel. \ No newline at end of file +После этого в шаблонах можно использовать плейсхолдеры [%ключ%] для подстановки значений из загруженных языковых файлов. Кроме того поддерживаются лексиконы компонента EvoBabel. diff --git a/assets/snippets/FormLister/lib/captcha/reCaptcha/wrapper.php b/assets/snippets/FormLister/lib/captcha/reCaptcha/wrapper.php old mode 100755 new mode 100644 index e1b05b4be7..5e5845906d --- a/assets/snippets/FormLister/lib/captcha/reCaptcha/wrapper.php +++ b/assets/snippets/FormLister/lib/captcha/reCaptcha/wrapper.php @@ -44,7 +44,7 @@ public function getPlaceholder() { $siteKey = \APIhelpers::getkey($this->cfg, 'siteKey'); $type = \APIhelpers::getkey($this->cfg, 'type', 'image'); - $size = \APIhelpers::getkey($this->cfg, 'tabindex', 0); + $size = \APIhelpers::getkey($this->cfg, 'size', 'normal'); $tabindex = \APIhelpers::getkey($this->cfg, 'tabindex', 0); $theme = \APIhelpers::getkey($this->cfg, 'theme', 'light'); $id = \APIhelpers::getkey($this->cfg, 'id'); diff --git a/install/assets/plugins/userHelper.tpl b/install/assets/plugins/userHelper.tpl old mode 100755 new mode 100644 index 904c5aad64..e3f2e6fb52 --- a/install/assets/plugins/userHelper.tpl +++ b/install/assets/plugins/userHelper.tpl @@ -5,7 +5,7 @@ * addition to FormLister * * @category plugin - * @version 1.7.18 + * @version 1.7.19 * @internal @properties &logoutKey=Request key;text;logout &cookieName=Cookie Name;text;WebLoginPE &cookieLifetime=Cookie Lifetime, seconds;text;157680000 &maxFails=Max failed logins;text;3 &blockTime=Block for, seconds;text;3600 * @internal @events OnWebAuthentication,OnWebPageInit,OnPageNotFound,OnWebLogin * @internal @modx_category Content diff --git a/install/assets/snippets/FormLister.tpl b/install/assets/snippets/FormLister.tpl old mode 100755 new mode 100644 index 2f76299fa5..eb79cd901b --- a/install/assets/snippets/FormLister.tpl +++ b/install/assets/snippets/FormLister.tpl @@ -5,7 +5,7 @@ * Form processor * * @category snippet - * @version 1.7.18 + * @version 1.7.19 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) * @internal @modx_category Content * @internal @installset base, sample From 5c6d120ed23970e47ae9f6f658aebfd2c88fb634 Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Wed, 2 May 2018 11:35:24 +0300 Subject: [PATCH 195/274] update DocLister 2.3.15 --- .../js/easy-ui/themes/modx/images/loading.gif | Bin 0 -> 1737 bytes assets/lib/MODxAPI/modResource.php | 14 +++++-- .../DocLister/core/controller/onetable.php | 2 +- .../DocLister/core/controller/shopkeeper.php | 2 +- .../core/controller/site_content.php | 10 ++++- .../core/controller/site_content_menu.php | 5 ++- .../core/controller/site_content_tags.php | 2 +- .../extender/multicategories.extender.inc | 35 ++++++++++++++++++ .../DocLister/core/extender/tv.extender.inc | 2 +- assets/snippets/DocLister/snippet.DLMenu.php | 7 ++-- install/assets/snippets/DLMenu.tpl | 2 +- install/assets/snippets/DLSitemap.tpl | 2 +- install/assets/snippets/DocLister.tpl | 2 +- 13 files changed, 67 insertions(+), 18 deletions(-) create mode 100644 assets/js/easy-ui/themes/modx/images/loading.gif mode change 100755 => 100644 assets/snippets/DocLister/core/controller/shopkeeper.php create mode 100644 assets/snippets/DocLister/core/extender/multicategories.extender.inc mode change 100755 => 100644 install/assets/snippets/DLMenu.tpl mode change 100755 => 100644 install/assets/snippets/DLSitemap.tpl mode change 100755 => 100644 install/assets/snippets/DocLister.tpl diff --git a/assets/js/easy-ui/themes/modx/images/loading.gif b/assets/js/easy-ui/themes/modx/images/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..68f01d04813c1f622810864a3aaa04b4a17ac8f9 GIT binary patch literal 1737 zcmaKsX;2e)7>CzDa{xjjy99|1A!tC(kfocDi)<1$AxHpOQ4k^l!Vx1W6x7<&|FYXU zqO4jEiU-!VR1p+Xj1?4-iuI_J;!&?!+ghg|JJad3U)pMGzcKxNeCM6tJnuX+uPvX@ zZY|=AHdxt2Xr2y*)5|c6#FSEuyJ+Y3Z&l z2hJWo`9;lJ$6wzSoW60tqkB|d$oiO*d-^85^ojn{*NR{MP*%{@H*#gihZ8BKyB68E z-MIbjgNNV0y5khpJ^Jv`51aR%={<4jhaVq5e*9D5+*hL)XCHn4{^d%hPu@?KpKbc=eN!D=XUjDmH#n{YHNS zHCX6BV)yn2CuTNujhN~V+`RKpyXO6^ht92eqhIIlQLfz6eeCnH_C7`NPNrw9ks366 z4xX9(`s~z=+1uX^ocZ$2_fBs=JihPfWYufOIuD&AU-@`>>qn~cy$1)T7CU!5z2(U8 z)9Kt9)l`f6?NU41j6XbXfR{OHwm|T4}&24tIf+!C-g~6cQfY2^n$?AT&ZW zgqm`}3-jS2NS6n=k;sr5Hv(Q%%n)qW0X|neWVBd;Ko}d(=u%?{O0-a>kSI}shOd9n z5top}%gUCf=>?tg;*;#7!^HOL3k$fMxd=O-6Y4@%u8LS)C1D_a?27R6^vcC+6tttL z)GmTahbyJB!xmcHL#ya8ZXyfRl)a!N0BJE0y3BBfAV5;#=K&Z2VkaKZ)?9`1h5P_% znt*b}%j1|#j`b|aQDx@~wA#$PYRN2xE6UO;;vE(@$&xww-s8fZ5HmJ(eJ*rQrDbaawDbrfe_8F(wq{ge?)qQG`aXV;r(*6EM|ESje;52aFmrX!f=Pw^2oGQX$1|o4yts|b_5@w_kNwtl{wDP#JGMvIp#!SYX?Wq9S&`&_ZwkgGH5CLB7DEGJ6=R4J~p3Z4i^A}hs=-uZeD zs92l6u@**R$~L()G{5N8*7cE5-q$SCo`q4|NSVF*+A7&xZnypm$EdXgf)E%(VJHFD zSgi(H!D!(;9Zcc#GrCCJh=RlvXBQ-hv4Vodse`a32ZUFWgP5ZhM5LeV(#D^H8p@Lg ztra5R32z@1rQv{6u&RZL5%Z@Ye{q|t#6aM_1hIrpl@)oH6}os*cbAQywa{5<`ekzW O1il%9bk82&KlvLjD^%40 literal 0 HcmV?d00001 diff --git a/assets/lib/MODxAPI/modResource.php b/assets/lib/MODxAPI/modResource.php index 9142f36fa6..41b5334e86 100644 --- a/assets/lib/MODxAPI/modResource.php +++ b/assets/lib/MODxAPI/modResource.php @@ -310,6 +310,7 @@ public function get($key) $tvID = APIHelpers::getkey($this->tv, $key, 0); if (in_array($tvID, $tvTPL) && is_null($out)) { $out = APIHelpers::getkey($this->tvd, $key, null); + $out = $out['default']; } } @@ -468,13 +469,19 @@ public function edit($id) $this->close(); $this->markAllEncode(); $this->newDoc = false; - $result = $this->query("SELECT * from {$this->makeTable('site_content')} where `id`=" . (int)$id); $this->fromArray($this->modx->db->getRow($result)); $result = $this->query("SELECT * from {$this->makeTable('site_tmplvar_contentvalues')} where `contentid`=" . (int)$id); while ($row = $this->modx->db->getRow($result)) { $this->field[$this->tvid[$row['tmplvarid']]] = $row['value']; } + $fld = array(); + foreach ($this->tvd as $name => $tv) { + if ($this->belongsToTemplate($this->tv[$name])) { + $fld[$name] = $tv['default']; + } + }; + $this->store(array_merge($fld, $this->field)); if (empty($this->field['id'])) { $this->id = null; } else { @@ -482,10 +489,9 @@ public function edit($id) $this->set('editedby', null)->touch(); $this->decodeFields(); } - $this->store($this->toArray(null, null, null, false)); unset($this->field['id']); } - + return $this; } @@ -590,7 +596,7 @@ public function save($fire_events = false, $clearCache = false) foreach ($fld as $key => $value) { if (empty($this->tv[$key]) || !$this->isChanged($key) || !$this->belongsToTemplate($this->tv[$key])) { continue; - } elseif ($value === '') { + } elseif ($value === '' || is_null($value) || (isset($this->tvd[$key]) && $value == $this->tvd[$key]['default'])) { $_deleteTVs[] = $this->tv[$key]; } else { $_insertTVs[$this->tv[$key]] = $this->escape($value); diff --git a/assets/snippets/DocLister/core/controller/onetable.php b/assets/snippets/DocLister/core/controller/onetable.php index a05c8b3bbb..46848ac889 100644 --- a/assets/snippets/DocLister/core/controller/onetable.php +++ b/assets/snippets/DocLister/core/controller/onetable.php @@ -27,7 +27,7 @@ class onetableDocLister extends DocLister protected $parentField = 'parent'; /** - * @absctract + * @abstract */ public function getDocs($tvlist = '') { diff --git a/assets/snippets/DocLister/core/controller/shopkeeper.php b/assets/snippets/DocLister/core/controller/shopkeeper.php old mode 100755 new mode 100644 index 74ea9d2c5d..186639d5f5 --- a/assets/snippets/DocLister/core/controller/shopkeeper.php +++ b/assets/snippets/DocLister/core/controller/shopkeeper.php @@ -136,7 +136,7 @@ public function _render($tpl = '') } /** - * @absctract + * @abstract */ public function getChildrenCount() { diff --git a/assets/snippets/DocLister/core/controller/site_content.php b/assets/snippets/DocLister/core/controller/site_content.php index dc826dad18..5fb521c001 100644 --- a/assets/snippets/DocLister/core/controller/site_content.php +++ b/assets/snippets/DocLister/core/controller/site_content.php @@ -43,7 +43,7 @@ public function __construct($modx, $cfg = array(), $startTime = null) } /** - * @absctract + * @abstract */ public function getDocs($tvlist = '') { @@ -53,6 +53,14 @@ public function getDocs($tvlist = '') $this->extTV->getAllTV_Name(); + /** + * @var $multiCategories multicategories_DL_Extender + */ + $multiCategories = $this->getCFGDef('multiCategories', 0) ? $this->getExtender('multicategories', true) : null; + if ($multiCategories) { + $multiCategories->init($this); + } + /** * @var $extJotCount jotcount_DL_Extender */ diff --git a/assets/snippets/DocLister/core/controller/site_content_menu.php b/assets/snippets/DocLister/core/controller/site_content_menu.php index 479997b097..5b2637890c 100644 --- a/assets/snippets/DocLister/core/controller/site_content_menu.php +++ b/assets/snippets/DocLister/core/controller/site_content_menu.php @@ -94,7 +94,8 @@ public function _getChildren() } $this->config->setConfig(array('hideSubMenus' => 1)); } - $this->levels = $this->extCache->load('menudata'); + $key = 'menudata' . $maxDepth; + $this->levels = $this->extCache->load($key); if ($this->levels === false) { $this->levels = array(); $currentLevel = &$this->currentLevel; @@ -143,7 +144,7 @@ public function _getChildren() $this->IDs = array_keys($docs); $this->AddTable = array(); } - $this->extCache->save($this->levels, 'menudata'); + $this->extCache->save($this->levels, $key); } } diff --git a/assets/snippets/DocLister/core/controller/site_content_tags.php b/assets/snippets/DocLister/core/controller/site_content_tags.php index 8803171aa2..98c5e5bba5 100644 --- a/assets/snippets/DocLister/core/controller/site_content_tags.php +++ b/assets/snippets/DocLister/core/controller/site_content_tags.php @@ -33,7 +33,7 @@ public function __construct($modx, $cfg = array(), $startTime = null) } /** - * @absctract + * @abstract */ public function getUrl($id = 0) { diff --git a/assets/snippets/DocLister/core/extender/multicategories.extender.inc b/assets/snippets/DocLister/core/extender/multicategories.extender.inc new file mode 100644 index 0000000000..25d2ce74ff --- /dev/null +++ b/assets/snippets/DocLister/core/extender/multicategories.extender.inc @@ -0,0 +1,35 @@ + + */ +class multicategories_DL_Extender extends extDocLister +{ + + /** + * @return bool + */ + protected function run() + { + if ($this->DocLister->getCFGDef('idType', 'parents') == 'parents') { + $ids = $this->DocLister->getIDs(); + if ($ids) { + $ids = implode(',', $ids); + $q = $this->DocLister->dbQuery("SELECT `doc` FROM {$this->modx->getFullTableName('site_content_categories')} WHERE `category` IN ({$ids})"); + $docs = $this->modx->db->getColumn('doc', $q); + if ($docs) { + $docs = implode(',', $docs); + $documents = $this->DocLister->getCFGDef('documents', ''); + $this->DocLister->config->setConfig(array( + "documents" => $documents . ',' . $docs + )); + } + } + }; + + return true; + } +} diff --git a/assets/snippets/DocLister/core/extender/tv.extender.inc b/assets/snippets/DocLister/core/extender/tv.extender.inc index b3749c1c0f..89d166c4a0 100644 --- a/assets/snippets/DocLister/core/extender/tv.extender.inc +++ b/assets/snippets/DocLister/core/extender/tv.extender.inc @@ -140,7 +140,7 @@ class tv_DL_Extender extends extDocLister $TVkeys = array_keys($tvDef); foreach ($out as $itemid => $item) { foreach ($TVkeys as $name) { - if (!isset($out[$itemid][$name])) { + if (!isset($out[$itemid][$name]) || $out[$itemid][$name] === '' || is_null($out[$itemid][$name])) { $out[$itemid][$name] = $tvDef[$name]['default']; } if (in_array($name, $renderTV) || $renderTV == array("*")) { diff --git a/assets/snippets/DocLister/snippet.DLMenu.php b/assets/snippets/DocLister/snippet.DLMenu.php index c48d08a540..41d658e2b3 100644 --- a/assets/snippets/DocLister/snippet.DLMenu.php +++ b/assets/snippets/DocLister/snippet.DLMenu.php @@ -6,10 +6,9 @@ $params['addWhereList'] = 'c.hidemenu = 0'; } if (!isset($params['sortBy'])) { - if (isset($params['sortType']) && $params['sortType'] === 'doclist') { - $params['sortBy'] = 'c.id'; - } else { - $params['sortBy'] = 'c.menuindex'; + $params['sortBy'] = 'c.menuindex'; + if (isset($params['sortType1']) && $params['sortType1'] === 'doclist') { + $params['sortBy1'] = 'c.id'; } } if (!isset($params['sortDir'])) { diff --git a/install/assets/snippets/DLMenu.tpl b/install/assets/snippets/DLMenu.tpl old mode 100755 new mode 100644 index 55a9f9926c..ba2164a559 --- a/install/assets/snippets/DLMenu.tpl +++ b/install/assets/snippets/DLMenu.tpl @@ -5,7 +5,7 @@ * Snippet to build menu with DocLister * * @category snippet - * @version 1.3.0 + * @version 1.4.0 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) * @internal @properties * @internal @modx_category Navigation diff --git a/install/assets/snippets/DLSitemap.tpl b/install/assets/snippets/DLSitemap.tpl old mode 100755 new mode 100644 index 469142e56d..ff16aa4371 --- a/install/assets/snippets/DLSitemap.tpl +++ b/install/assets/snippets/DLSitemap.tpl @@ -5,7 +5,7 @@ * Snippet to build XML sitemap * * @category snippet - * @version 1.0.0 + * @version 1.0.1 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) * @internal @properties * @internal @modx_category Content diff --git a/install/assets/snippets/DocLister.tpl b/install/assets/snippets/DocLister.tpl old mode 100755 new mode 100644 index b0f966e75d..1d16f93786 --- a/install/assets/snippets/DocLister.tpl +++ b/install/assets/snippets/DocLister.tpl @@ -5,7 +5,7 @@ * Snippet to display the information of the tables by the description rules. The main goal - replacing Ditto and CatalogView * * @category snippet - * @version 2.3.14 + * @version 2.3.15 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) * @internal @properties * @internal @modx_category Content From f266be8b61b7739b7f174392ce746a45c6a8b0a3 Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Wed, 2 May 2018 11:39:53 +0300 Subject: [PATCH 196/274] FIX TinyMCE darcness theme by default - need set lightgray by default #613 --- manager/includes/default_config.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/manager/includes/default_config.php b/manager/includes/default_config.php index 7db0da7823..e002f11942 100755 --- a/manager/includes/default_config.php +++ b/manager/includes/default_config.php @@ -110,4 +110,7 @@ $c['manager_theme_mode'] = '3'; $c['login_form_position'] = 'left'; $c['manager_menu_position'] = 'top'; +$c['tinymce4_skin'] = 'lightgray'; + + From 86e582b4523480569aa8856dc91dbb20151fbf0c Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Wed, 2 May 2018 11:32:35 +0200 Subject: [PATCH 197/274] initial commit --- manager/frames/1.php | 4 + manager/frames/mainmenu.php | 10 +- .../style/default/css/color.switcher.css | 4 + manager/media/style/default/css/mainmenu.css | 270 ++++++++++++++++++ .../images/misc/logo-navbar-left-white.png | Bin 0 -> 24430 bytes .../default/images/misc/logo-navbar-left.png | Bin 0 -> 25427 bytes 6 files changed, 283 insertions(+), 5 deletions(-) create mode 100644 manager/media/style/default/images/misc/logo-navbar-left-white.png create mode 100644 manager/media/style/default/images/misc/logo-navbar-left.png diff --git a/manager/frames/1.php b/manager/frames/1.php index 074139207f..34e3b0662b 100755 --- a/manager/frames/1.php +++ b/manager/frames/1.php @@ -52,6 +52,10 @@ $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode']]; } +$navbar_position = $modx->config['manager_menu_position']; +if ($navbar_position == 'left') { + $body_class .= ' navbar-left navbar-left-icon-and-text'; +} if (isset($modx->pluginCache['ElementsInTree'])) { $body_class .= ' ElementsInTree'; diff --git a/manager/frames/mainmenu.php b/manager/frames/mainmenu.php index ad35b84840..19114ce183 100755 --- a/manager/frames/mainmenu.php +++ b/manager/frames/mainmenu.php @@ -21,7 +21,7 @@ $sitemenu['site'] = array( 'site', 'main', - '' . $_lang['home'], + '' . $_lang['home'] . '', 'index.php?a=2', $_lang['home'], '', @@ -36,7 +36,7 @@ $sitemenu['elements'] = array( 'elements', 'main', - '' . $_lang['elements'], + '' . $_lang['elements'] . '', 'javascript:;', $_lang['elements'], ' return false;', @@ -52,7 +52,7 @@ $sitemenu['modules'] = array( 'modules', 'main', - '' . $_lang['modules'], + '' . $_lang['modules'] . '', 'javascript:;', $_lang['modules'], ' return false;', @@ -68,7 +68,7 @@ $sitemenu['users'] = array( 'users', 'main', - '' . $_lang['users'], + '' . $_lang['users'] . '', 'javascript:;', $_lang['users'], ' return false;', @@ -84,7 +84,7 @@ $sitemenu['tools'] = array( 'tools', 'main', - '' . $_lang['tools'], + '' . $_lang['tools'] . '', 'javascript:;', $_lang['tools'], ' return false;', diff --git a/manager/media/style/default/css/color.switcher.css b/manager/media/style/default/css/color.switcher.css index 3405354bfd..7c1ef73a64 100755 --- a/manager/media/style/default/css/color.switcher.css +++ b/manager/media/style/default/css/color.switcher.css @@ -67,3 +67,7 @@ i.evocpicon:hover { -webkit-transform: rotate(30deg); -moz-transform: rotate(30d .sp-dd { margin-top: 4px; color: #666; } .dark .sp-dd { color: #bcbec0; } .sp-preview { height: 25px; width: 25px; max-height: 25px; max-width: 25px; overflow: hidden; cursor: pointer; border-radius: 50%; border: 0px solid #2f323a; } +/* navbar left */ +.navbar-left .evocp-box { + top: 0; +} \ No newline at end of file diff --git a/manager/media/style/default/css/mainmenu.css b/manager/media/style/default/css/mainmenu.css index 440c1c2f8e..36c1b664f1 100755 --- a/manager/media/style/default/css/mainmenu.css +++ b/manager/media/style/default/css/mainmenu.css @@ -156,3 +156,273 @@ border: none !important; border-left: 1px solid rgba(0, 0, 0, 0.05) !important; .darkness #searchresult .ajaxSearchResults b, .darkness #searchresult .ajaxSearchResults strong, .darkness #searchresult .ajaxSearchResults a { border-color: #282c34; color: #aaa; } .darkness #searchresult .ajaxSearchResults a:hover { background-color: #343942; } .darkness #searchresult .ajaxSearchResults .disabled a { color: #da4439; } +/* navbar left */ +@media (min-width: 768px) and (min-height: 568px) { + .navbar-left #tree, + .navbar-left #main { + top: 0; + } + .navbar-left #tree { + left: 3rem; + } + .navbar-left #main, + .navbar-left #resizer { + left: 23rem; + } + .navbar-left.sidebar-closed #main { + left: 3rem !important; + } + .navbar-left #mainMenu { + width: 3rem; + height: 100%; + } + .navbar-left #mainMenu > .container { + display: block; + padding-left: 0; + padding-right: 0; + } + .navbar-left #mainMenu > .container > .row { + display: block; + margin-left: 0; + margin-right: 0; + } + .navbar-left #mainMenu > .container > .row > .cell { + display: block; + } + .navbar-left #mainMenu #nav, + .navbar-left #mainMenu #settings { + float: none; + } + .navbar-left #mainMenu #settings { + margin-top: 0.5rem; + padding-top: 0.5rem; + border-top: 1px solid rgba(255,255,255,0.15); + } + .navbar-left #mainMenu .nav > li { + position: relative; + display: block; + text-align: center; + /*border-bottom: 1px solid rgba(255,255,255,0.05);*/ + } + .navbar-left #mainMenu .nav > li > a { + height: auto; + } + .navbar-left #mainMenu #nav > li > a, + .navbar-left #mainMenu #settings > li > a { + padding: 0; + } + .navbar-left #mainMenu #nav > li > a > .fa { + display: inline-block; + } + .navbar-left #mainMenu #nav > li > a > .fa, + .navbar-left #mainMenu #searchform .fa, + .navbar-left #mainMenu #preview .fa, + .navbar-left #mainMenu #nav > li > .fa, + .navbar-left #mainMenu #nav > li > a > .fa, + .navbar-left #mainMenu #system > a > .fa { + font-size: 0.875rem; + } + .navbar-left #mainMenu .nav > li > ul, + .navbar-left #mainMenu #settings.nav > li > ul { + top: 0; + left: 3rem !important; + right: auto; + border-radius: 0 0.25rem 0.25rem 0; + } + .navbar-left #mainMenu #nav.nav > #bars, + .navbar-left #mainMenu #settings.nav > #account, + .navbar-left #mainMenu #settings.nav > #system, + .navbar-left #mainMenu #settings.nav > #fullscreen { + position: absolute; + width: 3rem; + } + .navbar-left #mainMenu #settings.nav > #account { + bottom: 0.5rem; + } + .navbar-left #mainMenu #nav.nav > #bars { + top: 2.75rem; + } + .navbar-left #mainMenu #settings.nav > #system { + bottom: 2.75rem; + } + .navbar-left #mainMenu #settings.nav > #fullscreen { + bottom: 5rem; + } + .navbar-left #mainMenu #settings.nav > #account > ul, + .navbar-left #mainMenu #settings.nav > #system > ul { + top: auto; + bottom: 0; + } + .navbar-left #mainMenu .nav > li > .sub-menu { + left: 16rem !important; + border-radius: 0.25rem; + } + .navbar-left #mainMenu .menu-item-text, + .navbar-left #mainMenu .username { + display: none; + } + .navbar-left #mainMenu .icon, + .navbar-left #mainMenu .icon.photo, + .navbar-left #mainMenu .nav > li > a .icon { + margin-top: 0; + margin-left: 0; + } + .navbar-left #mainMenu #nav #bars { + width: 100%; + } + .navbar-left #mainMenu #nav #site { + padding-top: 5rem; + } + .navbar-left #mainMenu #nav #site a { + position: static; + padding: 0; + } + .navbar-left #mainMenu #nav #site a::before { + display: block; + content: ""; + position: absolute; + top: 0.5rem; + left: auto; + width: 100%; + height: 2.25rem; + margin-top: 0; + margin-bottom: 0; + background-color: transparent; + background-repeat: no-repeat; + background-position: 50% 50%; + background-size: 2.25rem; + background-image: url("../images/misc/logo-navbar-left.png"); + } + .navbar-left #mainMenu #searchform input, + .navbar-left #mainMenu #searchform .mask { + left: 0; + right: auto; + } + .navbar-left #mainMenu #searchform .mask { + display: none; + width: 15.75rem; + height: 2.6rem; + } + .navbar-left #searchresult { + top: 0; + } + /* theme modes */ + .navbar-left.lightness #mainMenu { + -webkit-box-shadow: 0 2px 0 1px rgba(0,0,0,0.15); + box-shadow: 0 2px 0 1px rgba(0,0,0,0.15); + } + .navbar-left.lightness #mainMenu .nav > li { + /*border-bottom-color: rgba(0,0,0,0.05);*/ + } + .navbar-left.light .treeframebody { + background-color: #f3f3f3; + } + .navbar-left.dark #mainMenu { + -webkit-box-shadow: 0 2px 0 1px rgba(0,0,0,0.4); + box-shadow: 0 2px 0 1px rgba(0,0,0,0.4); + background-color: #17191e; + } + .navbar-left.dark #mainMenu .nav > li > a, + .navbar-left.dark #mainMenu .nav .label_searchid { + color: #dcd9e3; + } + .navbar-left.darkness #mainMenu { + -webkit-box-shadow: 0 2px 0 1px rgba(255,255,255,0.2); + box-shadow: 0 2px 0 1px rgba(255,255,255,0.2); + background-color: #17191e; + } + .navbar-left.light #mainMenu #nav #site a::before, + .navbar-left.dark #mainMenu #nav #site a::before, + .navbar-left.darkness #mainMenu #nav #site a::before { + background-image: url("../images/misc/logo-navbar-left-white.png"); + } + .navbar-left.lightness #mainMenu #settings { + border-top: 1px solid rgba(0,0,0,0.1); + } +} +@media (min-width: 1200px) and (min-height: 720px) { + .navbar-left #tree { + left: 5rem; + } + .navbar-left #main, + .navbar-left #resizer { + left: 25rem; + } + .navbar-left.sidebar-closed #main { + left: 5rem !important; + } + .navbar-left #mainMenu { + width: 5rem; + } + .navbar-left #mainMenu #nav > li > a > .fa, + .navbar-left #mainMenu #searchform .fa, + .navbar-left #mainMenu #preview .fa, + .navbar-left #mainMenu #nav > li > .fa, + .navbar-left #mainMenu #nav > li > a > .fa, + .navbar-left #mainMenu #system > a > .fa { + font-size: 1.125rem; + } + .navbar-left #mainMenu .nav > li > ul, + .navbar-left #mainMenu #settings.nav > li > ul { + left: 5rem !important; + } + .navbar-left #mainMenu #nav.nav > #bars, + .navbar-left #mainMenu #settings.nav > #account, + .navbar-left #mainMenu #settings.nav > #system, + .navbar-left #mainMenu #settings.nav > #fullscreen { + width: 5rem; + } + .navbar-left #mainMenu #settings.nav > #account { + bottom: 1rem; + } + .navbar-left #mainMenu #settings.nav > #system { + bottom: 3.5rem; + } + .navbar-left #mainMenu #nav.nav > #bars { + top: 4rem; + } + .navbar-left #mainMenu #settings.nav > #fullscreen { + bottom: 6rem; + } + .navbar-left #mainMenu #nav #site { + padding-top: 6.75rem; + } + .navbar-left #mainMenu #nav #site a::before { + top: 1rem; + height: 3rem; + background-size: 3rem; + } + /* icons + text */ + .navbar-left-icon-and-text #mainMenu .menu-item-text { + display: block; + margin-top: 0.5rem; + font-size: 0.6875rem; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + padding: 0 0.3125rem; + } + .navbar-left-icon-and-text #mainMenu .nav > #site > a, + .navbar-left-icon-and-text #mainMenu .nav > #elements > a, + .navbar-left-icon-and-text #mainMenu .nav > #modules > a, + .navbar-left-icon-and-text #mainMenu .nav > #users > a, + .navbar-left-icon-and-text #mainMenu .nav > #tools > a, + .navbar-left-icon-and-text #mainMenu .nav > #site > a .fa, + .navbar-left-icon-and-text #mainMenu .nav > #elements > a .fa, + .navbar-left-icon-and-text #mainMenu .nav > #modules > a .fa, + .navbar-left-icon-and-text #mainMenu .nav > #users > a .fa, + .navbar-left-icon-and-text #mainMenu .nav > #tools > a .fa { + line-height: 1em; + } + .navbar-left-icon-and-text #mainMenu .nav > #site > a, + .navbar-left-icon-and-text #mainMenu .nav > #elements > a, + .navbar-left-icon-and-text #mainMenu .nav > #modules > a, + .navbar-left-icon-and-text #mainMenu .nav > #users > a, + .navbar-left-icon-and-text #mainMenu .nav > #tools > a { + padding-top: 0.75rem !important; + padding-bottom: 0.75rem !important; + } + .navbar-left #mainMenu .nav > li > .sub-menu { + left: 18rem !important; + } +} \ No newline at end of file diff --git a/manager/media/style/default/images/misc/logo-navbar-left-white.png b/manager/media/style/default/images/misc/logo-navbar-left-white.png new file mode 100644 index 0000000000000000000000000000000000000000..1ff7479b913d1c9b442e6e2b62953525ac218fcf GIT binary patch literal 24430 zcmaI71yozX*DnebE$&tBHxyUR=e_xtXB zZ>{&;tmNdJ$+p?EXXba#-U(Axmc@Ka_7)Bf4pUxEN*xXk9{TTtiVSP_Xc3CspG1nq$ptSV9#p$kA@Xu z?+D|DgA)>kIGUQ<0$r)ifL7KZVZdo?CxF`8LKvXUqr|S{C<**(E$873)bLQ&H21JI z=eGceickwd1YiQ}fv%?15PLh2ivUCz@E^GXu=9V-Yyj&2kht0k1OAs$I!db4k`B&5 zY93ZD7IStE4r*RrRt|0+US1AnYEE_zPBwPfo0o-yTY!gGfRm5MuGDTD>&Li^tmq<}8w z&eo2u)(#-*e-cg29Nb)m0WeGdR~PIZ|F>9>%YV5E<}fyhsUsT)EBn7L{WqbK(*K>* z-u{16ySS@ zbMy0Yad1d~l91+*;pdiN=i%g%km2Uw`)^(;2Xi-jAjtK$LKnodX2Yc%ObXmaqf3`*Pf0XxMycYknEmHp@FB{AlwtoZr{~GB3Zh}S6ztjI6 zwy=x;9r!>HEZUu6VLi+TM*s(>zbP*zt_fK@%0%%Z06q+6TUmk=?8wl5Afe`bqt>d1 zpPJE7lf=anEDG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D|J*T#|I6G=>!w+og)*2{PN?P>##1Z)tQgQEJAm_F!ghi5mXCRhEB0 z^_n^4ihx9(L|#uGT9$dOBuQ`cZ0|_95gEuTIFl=sQ)#78kXojeH7rr85~`SLuV5JO zR3*CuEHR2|wKySG239S$76syYy{WDjG6Opo=?c}oXQ^U=Qn#`)rzBOnEX-MMLmp(M zBo0_{tRxl3qUCg)6niQWlM50pjVmp>wKTS>Dvo~Vy17f~Nt4Kv$cKpPdG%GtM+2&V z23iC}=tBuI_IDQ35BBIixhiDTC7Hls;(T$Bn4;7oVv1rpGZI${$ZPVzb#x`oQyEA{E z*&xPH^2R1R+5LWCl3CbnCeMGKUuI|L<*xP|K{YT3-#V37I_}A2CmVT?0F&TKieOq z*FeZ)-XT9(v`c5G`qD;EG-advpiG=u%ZIk}chuUXSH<;av**8jZ|xUj^LY_^4TL<3 z67o}RJ=j!}5B!u3b;@4xUg3k=nM9ZJ-Dd;vnV*o}wuX;S72`$eH4ySxkdUA1vAzwp zz9)?~`m3GOdiyO6QrRb8{bbedw=MO)Fm(MLjor~@28!Mo^co0xEK0~vRk%-W;IDFO zfv83Ia{?MZP2m9Lwt+IoX&_li^4lUOGQRy`h@+e8jUr5W*mZ~ex{(Xyh z-b!0TR@$Q6YTvJyiD_BPOE+%Qk5;|!ZS_7Oo}Tc;9rwnnkF>4r8ZFgA(Q6>&5u1>o z&eQ#yuC_I&F3_M(MeA()xXu=}#@3`O<^R({yb~Cim~_};bJ&*Sw9OA`C}%=-r(8mQ zxwfJHWLnc<-0DWJfsn_N2>IEHb_3;e-c`9|a)soBq$a$=iCbP6UgA`%oI3TKE-wV2 zsBK}p!ew?f)IY<7WD}zKAe51WCnK8A{V~&V=y6A{fsh9P6qQE_0DzDO01)y3074!B rK*$3C2zdYiArAnAJOH4K{3E~s-Pnj~>*+2C00000NkvXXu0mjftxB`7 literal 0 HcmV?d00001 diff --git a/manager/media/style/default/images/misc/logo-navbar-left.png b/manager/media/style/default/images/misc/logo-navbar-left.png new file mode 100644 index 0000000000000000000000000000000000000000..fede6fc5aaa728e03049bd4efb917fa2a5d5f557 GIT binary patch literal 25427 zcmbTd1y>wh6D>TrySonV?h@Ps1cJM}4DK3S1`Qr0gx~~sCxc6Hx8M%J;hX2Z-~9u3 z*7TaSdi9ypUFTHQuDz>cKdLKWppv2j000anMOiHX0LJgX0~rx|#vjf=8~~sOD9K8H z^36M4_Y3?q|0sDm<$139LExWUm=yyWbpxuy5J6VEjugI@k%ME?xr$EJ>++NHQ?>D0 z6O-Q0CWjs!X}NC;WjZ)R6#4@>)(zP3xYPkWy!T=~lDH|>=T?~=i=ro7hn9>+e+=-Y_`-V7j<7|<`pfKELu#f6Cb4GS(v zlv4>NW#(~{B)>;Ok1TXy@_hrTsO%=>PW2PkB?p&7tR~WjYQSfik~54WjCr}XvDK=# z;N7b^K|$NL)wzcC@CL6-%|S72S-3vF>|Qt+E1qd2DF);tGb?YC9E4u4B{z1!3Jf69 zpNk$qAtlax99bm7waEQ(WUwh*j-t0CcJJSJ`G>b)FP9JRCd`u`mAb$9+nqHUA&X@8 z`kC$F{vHb@qIf?!uygye0+AwsG3@P34P`&Y&22FF;?(i>5CtO&+v=iepY**=KD;87 z7y&>8U;?CI6tz%r%i19UsBkh=G9_rQaZ1>*-D-_}AEyn37!qVGfaQAdFzL8;I0+MMzG;Yyi;`3wR=hYunJ~4_V~Z~Lp)_gKez7zMD&an!25vCy{76@a#T)d5=PRWXTN+fTL8>*CcFYzJB2t^*LE)1nm_jFd$ zsk)1uRfpV@0q;9D-R992?nmL!4An+0_#q^X36k#lqtNt+AM}M*lyCkkQp(?WNraGk zK>!6|3hm-qV9rVIe&(51Lq)yLUtUXM0QOoLGv7~*tORM6kxc?^g==HTY=xssCcu0nub8n@C*$kljaw z7|55ghxa?ev0M#TRuZ0zOsZz?ioQWW@|ne3WwStD_>(fFeII+ctiGxB>~b}U(1~pE zpYa;bqc-HF-@O)UNGwCX=5C+&)9NEH=9uPm5YU z$;bR&uBEggk40$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}Y0 z!H=5qufeR`>XkQJmTt!z?Kp)qEV#xp5jYegWS4XyE4LGjXzOlhhvtLo?2DDX1yzNJ zaDUVc-Gi5G5jiE0xDOpxTNPf?%L|Ov{9*6^o6yGA` QV;KM?d3Cuu8S^jy10Kv*ng9R* literal 0 HcmV?d00001 From dbd75f74f73337d4d519509a205134760a77f60e Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Wed, 2 May 2018 13:46:29 +0300 Subject: [PATCH 198/274] move login page and menu setting to tab 4 --- .../tab1_site_settings.inc.php | 85 -------------- .../tab4_manager_settings.inc.php | 105 ++++++++++++++++++ 2 files changed, 105 insertions(+), 85 deletions(-) diff --git a/manager/actions/mutate_settings/tab1_site_settings.inc.php b/manager/actions/mutate_settings/tab1_site_settings.inc.php index 9466d09fdb..e1535887b0 100755 --- a/manager/actions/mutate_settings/tab1_site_settings.inc.php +++ b/manager/actions/mutate_settings/tab1_site_settings.inc.php @@ -294,91 +294,6 @@
      - - - - - - - - - - - - - - - - - - - - diff --git a/manager/actions/mutate_settings/tab4_manager_settings.inc.php b/manager/actions/mutate_settings/tab4_manager_settings.inc.php index a8f6836ab7..4fac9f68b2 100755 --- a/manager/actions/mutate_settings/tab4_manager_settings.inc.php +++ b/manager/actions/mutate_settings/tab4_manager_settings.inc.php @@ -94,6 +94,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - @@ -161,5 +152,14 @@ + + +

      [(manager_menu_position)]
      +
      +
      +

      [(login_logo)]
      -
      - -
      - -

      [(login_bg)]
      -
      - -
      - -

      [(login_form_position)]
      -
      -
      - -

      [(manager_menu_position)]
      -
      -
      -
      +
      +

      [(login_logo)]
      +
      + +
      + +
      +
      +

      [(login_bg)]
      +
      + +
      + +
      +
      +

      [(login_form_position)]
      +
      +
      + +
      +
      +

      [(manager_menu_position)]
      +
      +
      +
      From 6a3760be62d0ee79fab9c010944595605a0af3b5 Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Wed, 2 May 2018 13:50:04 +0300 Subject: [PATCH 199/274] fix lang --- manager/includes/lang/russian-UTF8.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manager/includes/lang/russian-UTF8.inc.php b/manager/includes/lang/russian-UTF8.inc.php index e93602f7c7..6789971195 100755 --- a/manager/includes/lang/russian-UTF8.inc.php +++ b/manager/includes/lang/russian-UTF8.inc.php @@ -1467,10 +1467,10 @@ $_lang['login_form_position_left'] = 'слева'; $_lang['login_form_position_center'] = 'по центру'; $_lang['login_form_position_right'] = 'справа'; -$_lang['login_logo_title'] = 'Логотип на страничке авторизации'; +$_lang['login_logo_title'] = 'Логотип на странице авторизации'; $_lang['login_logo_message'] = 'Рекомендованный размер логотипа по ширине: 360px, тип .png'; -$_lang['login_bg_title'] = 'Фоновая картинка на страничке авторизации'; -$_lang['login_bg_message'] = 'Рекомендованный размер фоновой картинки по ширине: 1920px'; +$_lang['login_bg_title'] = 'Фоновое изображение на странице авторизации'; +$_lang['login_bg_message'] = 'Рекомендованный размер фонового изображения по ширине: 1920px'; $_lang['manager_menu_position_title'] = 'Расположение основного меню'; $_lang['manager_menu_position_top'] = 'вверху'; From 7acb549af06730464eca34a4514180b660761be5 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Wed, 2 May 2018 18:44:35 +0200 Subject: [PATCH 200/274] Polish translation --- manager/includes/lang/polish-utf8.inc.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/manager/includes/lang/polish-utf8.inc.php b/manager/includes/lang/polish-utf8.inc.php index 0aa42500dc..d502980f33 100755 --- a/manager/includes/lang/polish-utf8.inc.php +++ b/manager/includes/lang/polish-utf8.inc.php @@ -3,7 +3,7 @@ * EVO Manager language file * * @version 1.4.4 - * @date 2018/04/07 + * @date 2018/05/02 * @author The EVO Project Team * @author Piotr Matysiak (pmfx) * @@ -1206,6 +1206,8 @@ $_lang["webpwdreminder_title"] = 'E-mail przypomnienia Web'; $_lang["websignupemail_message"] = 'Tutaj możesz ustawić treść wiadomości wysyłanej użytkownikowi po utworzeniu dla niego nowego konta. Wiadomość będzie zawierać nazwę użytkownika i hasło.
      Uwaga: Poniższe znaczniki zostaną zamienione na tekst przy wysyłaniu wiadomości:

      [+sname+] - Nazwa Twojej strony,
      [+saddr+] - Adres e-mail,
      [+surl+] - URL Twojej strony,
      [+uid+] - Nazwa lub ID użytkownika,
      [+pwd+] - Hasło użytkownika,
      [+ufn+] - Pełna nazwa użytkownika.

      Pozostaw [+uid+] i [+pwd+] w treści wiadomości, ponieważ w przeciwnym razie użytkownik nie będzie w stanie zalogować się do serwisu!'; $_lang["websignupemail_title"] = 'E-mail rejestracyjny Web'; +$_lang["allow_multiple_emails_title"] = 'Pozwalaj użytkownikom mieć ten sam e-mail'; +$_lang["allow_multiple_emails_message"] = 'Allows Web Users to share the same email address for situations when a member may not have their own email address or there is just one family email address.
      Note: Any password reminder and registration logic will need to account for this option if set to yes.'; $_lang["wednesday"] = 'Środa'; $_lang["welcome_messages"] = 'Twoja skrzynka wiadomości zawiera %d wiadomość(-ci), z których %s jest nieprzeczytane.'; $_lang["welcome_title"] = 'Witaj w swoim systemie EVO'; @@ -1497,4 +1499,8 @@ $_lang['login_logo_title'] = 'Logo strony logowania'; $_lang['login_logo_message'] = 'Zalecana szerokość to 360px i typ pliku PNG'; $_lang['login_bg_title'] = 'Tło strony logowania'; -$_lang['login_bg_message'] = 'Zalecana szerokość to 1920px'; \ No newline at end of file +$_lang['login_bg_message'] = 'Zalecana szerokość to 1920px'; + +$_lang['manager_menu_position_title'] = 'Położenie głównej nawigacji'; +$_lang['manager_menu_position_top'] = 'Góra'; +$_lang['manager_menu_position_left'] = 'Lewa'; \ No newline at end of file From c84388af0041469a0212a8ac47dcf384c43cd83d Mon Sep 17 00:00:00 2001 From: Mr B Date: Wed, 2 May 2018 18:40:59 +0100 Subject: [PATCH 201/274] [I] Restrict menu tree auto hide to small mobile --- manager/media/style/default/js/modx.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/media/style/default/js/modx.js b/manager/media/style/default/js/modx.js index f4ffbfd2e5..522f244626 100755 --- a/manager/media/style/default/js/modx.js +++ b/manager/media/style/default/js/modx.js @@ -1029,7 +1029,7 @@ this.restoreTree(); } else { modx.tabs({url: modx.MODX_MANAGER_URL + href, title: title + '(' + id + ')'}); - if (modx.isMobile) modx.resizer.toggle(); + if (modx.isMobile && w.innerWidth < modx.minWidth) modx.resizer.toggle(); } } this.itemToChange = id; From c07af3d5f33262ab89cbf8bd326b5c393e253631 Mon Sep 17 00:00:00 2001 From: Mr B Date: Wed, 2 May 2018 18:42:41 +0100 Subject: [PATCH 202/274] Update modx.min.js --- manager/media/style/default/js/modx.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/media/style/default/js/modx.min.js b/manager/media/style/default/js/modx.min.js index 315ef20989..8eba0c3689 100755 --- a/manager/media/style/default/js/modx.min.js +++ b/manager/media/style/default/js/modx.min.js @@ -1 +1 @@ -(function($,w,d,u){'use strict';modx.extended({frameset:'frameset',minWidth:840,isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),typesactions:{'16':1,'301':2,'78':3,'22':4,'102':5,'108':6,'3':7,'4':7,'6':7,'27':7,'61':7,'62':7,'63':7,'72':7},thememodes:['','lightness','light','dark','darkness'],tabsTimer:0,popupTimer:0,init:function(){if(!localStorage.getItem('MODX_widthSideBar')){localStorage.setItem('MODX_widthSideBar',this.config.tree_width)}this.mainmenu.init();if(w.location.hash){if(modx.getActionFromUrl(w.location.hash,2)){w.history.replaceState(null,d.title,modx.MODX_MANAGER_URL)}else if(modx.getActionFromUrl(w.location.hash)||modx.main.getQueryVariable('filemanager',w.location.hash)){var url=modx.main.getQueryVariable('filemanager',w.location.hash)?modx.MODX_MANAGER_URL+modx.main.getQueryVariable('filemanager',w.location.hash)+w.location.hash.replace('#?','?'):w.location.href.replace('#?','?');if(modx.config.global_tabs){modx.tabs({url:url,title:'blank'})}else if(w.main){w.main.frameElement.src=url}else{modx.openWindow(url)}}}this.resizer.init();this.search.init();if(this.config.session_timeout>0){w.setInterval(this.keepMeAlive,1000*60*this.config.session_timeout)}if(modx.config.mail_check_timeperiod>0&&modx.permission.messages){setTimeout('modx.updateMail(true)',1000)}d.addEventListener('click',this.hideDropDown,false);if(modx.config.global_tabs){d.addEventListener('click',this.tabs,false);this.tabs({url:'?a=2',reload:0})}},mainmenu:{id:'mainMenu',init:function(){var $mm=$('#mainMenu'),mm=d.getElementById('mainMenu'),timer;$mm.on('click','a',function(e){if($(this).hasClass('dropdown-toggle')){if($mm.hasClass('show')&&($(this).hasClass('selected')||!modx.isMobile&&$(this).parent().hasClass('hover'))){$(this).removeClass('selected');$mm.removeClass('show')}else{$('.nav > li > a:not(:hover)').removeClass('selected');$(this).addClass('selected');$mm.addClass('show')}e.stopPropagation();e.target.dataset.toggle='#mainMenu';modx.hideDropDown(e)}if($(this).closest('ul').hasClass('dropdown-menu')&&!$(this).parent('li').hasClass('dropdown-back')){$('.nav > .active').removeClass('active');$('.nav li.selected').removeClass('selected');$(this).closest('.nav > li').addClass('active');if(this.offsetParent.id){d.getElementById(this.offsetParent.id.substr(7)).classList.add('selected')}if((modx.isMobile||w.innerWidth li',function(){var els=mm.querySelectorAll('.nav > li.hover:not(:hover)');for(var i=0;i li li',function(e){var self=this,ul;var els=mm.querySelectorAll('.nav > li li.hover:not(:hover)');for(var i=0;i'+modx.lang.paging_prev+''+data}ul.id='parent_'+self.id;ul.innerHTML=data;var id=w.location.hash.substr(2).replace(/=/g,'_').replace(/&/g,'__');var el=d.getElementById(id);if(el){el.parentNode.classList.add('selected');d.getElementById(el.parentNode.parentNode.id.substr(7)).classList.add('selected')}for(var i=0;iitems.length-1){index=items.length-1}if(index>=0&&index2){s.timer=setTimeout(function(){s.loader.style.display='block';modx.get(modx.MODX_MANAGER_URL+'?a=71&ajax=1&submitok=Search&searchid='+s.input.value,function(data){s.loader.style.display='none';s.results=data.querySelector('.ajaxSearchResults');if(s.results&&s.results.innerHTML!==''){s.result.innerHTML=s.results.outerHTML;s.open();s.result.onclick=function(e){var t=e.target,p=t.parentNode;if(t.tagName==='I'){modx.openWindow({title:p.innerText,id:p.id,url:p.href});e.preventDefault();e.stopPropagation()}else{var a=t.tagName==='A'&&t||p.tagName==='A'&&p;if(a){var el=s.result.querySelector('.selected');if(el)el.className='';a.className='selected';if(modx.isMobile)s.close()}}}}else{s.empty()}},'document')},300)}else{s.empty()}};if(modx.isMobile){this.input.onblur=this.close}this.input.onfocus=this.open;this.input.onclick=this.open;this.input.onmouseenter=this.open;this.result.onmouseenter=this.open;this.result.onmouseleave=this.close;this.mask.onmouseenter=this.open;this.mask.onmouseleave=this.close},open:function(){if(modx.search.results){modx.search.result.classList.add('open')}},close:function(){modx.search.result.classList.remove('open')},empty:function(){modx.search.result.classList.remove('open');modx.search.result.innerHTML=''}},main:{id:'main',idFrame:'mainframe',as:null,onload:function(e){w.main=e.target.contentWindow||e.target.defaultView;modx.main.tabRow.init();modx.main.stopWork();modx.main.scrollWork();w.main.document.addEventListener('click',modx.hideDropDown,false);w.main.document.addEventListener('contextmenu',modx.main.oncontextmenu,false);if(modx.config.global_tabs){w.main.document.addEventListener('click',modx.tabs,false)}w.history.replaceState(null,d.title,modx.getActionFromUrl(w.main.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.main.location.search);setTimeout('modx.tree.restoreTree()',100)},oncontextmenu:function(e){if(e.ctrlKey)return;var el=e.target;if(modx.user.role===1&&/modxtv|modxplaceholder|modxattributevalue|modxchunk|modxsnippet|modxsnippetnocache/i.test(el.className)){var id=Date.now(),name=el.innerText.replace(/[\[|\]|{|}|\*||\#|\+|?|\!|&|=|`|:]/g,''),type=el.className.replace(/cm-modx/,''),n=!!name.replace(/^\d+$/,'');if(name&&n){e.preventDefault();modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',{a:'modxTagHelper',name:name,type:type},function(r){if(r){r=JSON.parse(r);for(var k in r){if(r.hasOwnProperty(k)&&r[k].url){r[k]['onclick']='if(event.shiftKey){modx.openWindow({url:\''+r[k].url+'\'})}else{modx.popup({url:\''+r[k].url+'\',title:\''+r.header.innerHTML+'\',width:\'95%\',height:\'95%\',margin:0,hide:0,hover:0,overlay:1,overlayclose:0,position:\'center elements\',animation:0,icon:\'none\'})}'}}r=JSON.stringify(r);el.id='node'+id;el.dataset.contextmenu=r;modx.tree.showPopup(e,id,name)}})}e.preventDefault()}},tabRow:{init:function(){var row=w.main.document.querySelector('.tab-pane > .tab-row');if(row)this.build(row)},build:function(row){var rowContainer=d.createElement('div'),sel=row.querySelector('.selected');rowContainer.className='tab-row-container';row.parentNode.insertBefore(rowContainer,row);rowContainer.appendChild(row);var p=d.createElement('i');p.className='fa fa-angle-left prev disable';p.onclick=function(e){e.stopPropagation();e.preventDefault();var sel=row.querySelector('.selected');if(sel.previousSibling){sel.previousSibling.click();modx.main.tabRow.scroll(row)}};rowContainer.appendChild(p);var n=d.createElement('i');n.className='fa fa-angle-right next disable';n.onclick=function(e){e.stopPropagation();e.preventDefault();var sel=row.querySelector('.selected');if(sel.nextSibling){sel.nextSibling.click();modx.main.tabRow.scroll(row)}};rowContainer.appendChild(n);setTimeout(function(){sel=row.querySelector('.selected');modx.main.tabRow.scroll(row,sel);w.main.addEventListener('resize',function(){modx.main.tabRow.scroll(row)},false);if(sel){if(sel.previousSibling)p.classList.remove('disable');if(sel.nextSibling)n.classList.remove('disable')}},100);row.onclick=function(e){var sel=e.target.tagName==='H2'?e.target:e.target.tagName==='SPAN'?e.target.parentNode:null;if(sel){if(sel.previousSibling){this.parentNode.querySelector('i.prev').classList.remove('disable')}else{this.parentNode.querySelector('i.prev').classList.add('disable')}if(sel.nextSibling){this.parentNode.querySelector('i.next').classList.remove('disable')}else{this.parentNode.querySelector('i.next').classList.add('disable')}modx.main.tabRow.scroll(this,sel)}}},scroll:function(row,sel,a){sel=sel||row.querySelector('.selected')||row.firstChild;a=a||100;var c=0,elms=row.childNodes;for(var i=0;isel.offsetLeft){$(row).animate({scrollLeft:sel.offsetLeft-(sel.previousSibling?30:1)},a)}if(sel.offsetLeft+sel.offsetWidth>row.offsetWidth+row.scrollLeft){$(row).animate({scrollLeft:sel.offsetLeft-row.offsetWidth+sel.offsetWidth+(sel.nextSibling?30:0)},a)}if(c>row.offsetWidth){this.drag(row)}},drag:function(row){row.onmousedown=function(e){if(e.button===0){e.preventDefault();var x=e.clientX,f=row.scrollLeft;row.ownerDocument.body.focus();row.onmousemove=row.ownerDocument.onmousemove=function(e){if(Math.abs(e.clientX-x)>5){e.stopPropagation();row.scrollLeft=f-(e.clientX-x);row.ownerDocument.body.classList.add('drag')}};row.onmouseup=row.ownerDocument.onmouseup=function(e){e.stopPropagation();row.onmousemove=null;row.ownerDocument.onmousemove=null;row.ownerDocument.body.classList.remove('drag')}}}}},work:function(){d.getElementById('mainloader').classList.add('show')},stopWork:function(){d.getElementById('mainloader').classList.remove('show')},scrollWork:function(){var a=w.main.frameElement.contentWindow,b=a.location.search.substring(1)||a.location.hash.substring(2),c=localStorage.getItem('page_y')||0,f=localStorage.getItem('page_url')||b;if(((modx.getActionFromUrl(f)===modx.getActionFromUrl(b))&&(modx.main.getQueryVariable('id',f)&&modx.main.getQueryVariable('id',f)===modx.main.getQueryVariable('id',b)))||(f===b)){a.scrollTo(0,c)}a.addEventListener('scroll',function(){if(this.pageYOffset>=0){localStorage.setItem('page_y',this.pageYOffset.toString());localStorage.setItem('page_url',b)}},false)},getQueryVariable:function(a,b){var f='';if(b||typeof b==='string'){b=b.split('?');b=b[1]||b[0];b=b.split('&');for(var i=0;iMath.abs(ay)&&this.swipe){if(ax<0&&this.sidebar){if(Math.abs(ax)>h)ax=-h;tree.style.transform='translate3d('+ax+'px, 0, 0)';tree.style.WebkitTransform='translate3d('+ax+'px, 0, 0)';modx.resizer.mask.style.opacity=(0.5-0.5/-h*ax).toFixed(2);if(Math.abs(ax)>h/3){this.swipe='left'}else{this.swipe='right'}}else if(ax>0&&!this.sidebar){if(Math.abs(ax)>h)ax=h;tree.style.transform='translate3d('+ -(h-ax)+'px, 0, 0)';tree.style.WebkitTransform='translate3d('+ -(h-ax)+'px, 0, 0)';modx.resizer.mask.style.opacity=(0.5/h*ax).toFixed(2);if(Math.abs(ax)>h/3){this.swipe='right'}else{this.swipe='left'}}}},false);w.addEventListener('touchend',function(){if(this.swipe==='left'){d.body.classList.add('sidebar-closed');modx.resizer.setWidth(0)}if(this.swipe==='right'){d.body.classList.remove('sidebar-closed');modx.resizer.setWidth(h)}tree.style.cssText='';modx.resizer.mask.style.cssText=''},false)}},onMouseDown:function(e){e=e||w.event;modx.resizer.dragElement=e.target!==null?e.target:e.srcElement;if((e.buttons===1||e.button===0)&&modx.resizer.dragElement.id===modx.resizer.id){modx.resizer.oldZIndex=modx.resizer.dragElement.style.zIndex;modx.resizer.dragElement.style.zIndex=modx.resizer.newZIndex;modx.resizer.dragElement.style.background=modx.resizer.background;localStorage.setItem('MODX_widthSideBar',modx.resizer.dragElement.offsetLeft>0?modx.resizer.dragElement.offsetLeft:0);d.body.appendChild(modx.resizer.mask);d.onmousemove=modx.resizer.onMouseMove;d.body.focus();d.body.classList.add('resizer_move');d.onselectstart=function(){return false};modx.resizer.dragElement.ondragstart=function(){return false};return false}},onMouseMove:function(e){e=e||w.event;if(e.clientX>0){modx.resizer.left=e.clientX}else{modx.resizer.left=0}modx.resizer.dragElement.style.left=modx.pxToRem(modx.resizer.left)+'rem';d.getElementById('tree').style.width=modx.pxToRem(modx.resizer.left)+'rem';d.getElementById('main').style.left=modx.pxToRem(modx.resizer.left)+'rem';if(e.clientX<-2||e.clientY<-2){modx.resizer.onMouseUp(e)}},onMouseUp:function(e){if(modx.resizer.dragElement!==null&&e.button===0&&modx.resizer.dragElement.id===modx.resizer.id){if(e.clientX>0){d.body.classList.remove('sidebar-closed');modx.resizer.left=e.clientX}else{d.body.classList.add('sidebar-closed');modx.resizer.left=0}d.cookie='MODX_widthSideBar='+modx.pxToRem(modx.resizer.left);modx.resizer.dragElement.style.zIndex=modx.resizer.oldZIndex;modx.resizer.dragElement.style.background='';modx.resizer.dragElement.ondragstart=null;modx.resizer.dragElement=null;d.body.classList.remove('resizer_move');d.body.removeChild(modx.resizer.mask);d.onmousemove=null;d.onselectstart=null}},toggle:function(){if(modx.isMobile||w.innerWidth<=modx.minWidth){if(d.body.classList.contains('sidebar-closed')){d.body.classList.remove('sidebar-closed');localStorage.setItem('MODX_widthSideBar',0);d.cookie='MODX_widthSideBar='+modx.pxToRem(parseInt(d.getElementById('tree').offsetWidth))}else{localStorage.setItem('MODX_widthSideBar',parseInt(d.getElementById('tree').offsetWidth));d.body.classList.add('sidebar-closed');d.cookie='MODX_widthSideBar=0'}}else{var p=d.getElementById('tree').offsetWidth!==0?0:parseInt(localStorage.getItem('MODX_widthSideBar'))?parseInt(localStorage.getItem('MODX_widthSideBar')):modx.config.tree_width;modx.resizer.setWidth(p)}},setWidth:function(a){if(a>0){localStorage.setItem('MODX_widthSideBar',0);d.body.classList.remove('sidebar-closed')}else{localStorage.setItem('MODX_widthSideBar',parseInt(d.getElementById('tree').offsetWidth));d.body.classList.add('sidebar-closed')}d.cookie='MODX_widthSideBar='+modx.pxToRem(a);d.getElementById('tree').style.width=modx.pxToRem(a)+'rem';d.getElementById('resizer').style.left=modx.pxToRem(a)+'rem';d.getElementById('main').style.left=modx.pxToRem(a)+'rem'},setDefaultWidth:function(){modx.resizer.setWidth(modx.remToPx(modx.config.tree_width))}},tree:{ctx:null,rpcNode:null,itemToChange:'',selectedObjectName:null,selectedObject:0,selectedObjectDeleted:0,selectedObjectUrl:'',drag:false,deleted:[],init:function(){this.restoreTree()},draggable:function(){if(modx.permission.dragndropdocintree){var els=d.querySelectorAll('#treeRoot a:not(.empty)');for(var i=0;i-1:true;modx.tree.itemToChange=this.dataset.id||this.parentNode.id.replace('node','');modx.tree.selectedObjectName=this.dataset.titleEsc;if(draggable){this.parentNode.draggable=true;this.parentNode.ondragstart=modx.tree.ondragstart}else{this.parentNode.draggable=false;this.parentNode.ondragstart=function(){return false}}}},ondragstart:function(e){e.dataTransfer.effectAllowed='all';e.dataTransfer.dropEffect='all';e.dataTransfer.setData('text',this.id.substr(4))},ondragenter:function(e){if(d.getElementById('node'+modx.tree.itemToChange)===(this.parentNode.closest('#node'+modx.tree.itemToChange)||this.parentNode)){this.parentNode.className='';e.dataTransfer.effectAllowed='none';e.dataTransfer.dropEffect='none';modx.tree.drag=false}else{this.parentNode.className='dragenter';e.dataTransfer.effectAllowed='copy';e.dataTransfer.dropEffect='copy';modx.tree.drag=true}e.preventDefault()},ondragover:function(e){if(modx.tree.drag){var a=e.clientY;var b=parseInt(this.getBoundingClientRect().top);var c=a-b;if(c>this.offsetHeight/1.51){this.parentNode.classList.add('dragafter');this.parentNode.classList.remove('dragbefore');this.parentNode.classList.remove('dragenter');e.dataTransfer.effectAllowed='link';e.dataTransfer.dropEffect='link'}else if(c'}if(this.nextSibling){if(this.nextSibling.innerHTML){this.nextSibling.appendChild(el)}else{el.parentNode.removeChild(el)}els=this.parentNode.lastChild.children;for(i=0;i'}this.parentNode.parentNode.insertBefore(el,this.parentNode.nextSibling);els=this.parentNode.parentNode.children;for(i=0;i'}this.parentNode.parentNode.insertBefore(el,this.parentNode);els=this.parentNode.parentNode.children;for(i=0;i-1:true)){alert(modx.lang.error_no_privileges);modx.tree.restoreTree();return}modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',{a:'movedocument',id:id,parent:parent,menuindex:menuindex},function(r){if(r.errors)alert(r.errors);modx.tree.restoreTree()},'json');var b=w.main.frameElement.contentWindow.location.search.substr(1);if(modx.getActionFromUrl(b,27)&&parseInt(modx.main.getQueryVariable('id',b))===parseInt(id)){var index=menuindex.indexOf(id),elMenuIndex=w.main.document.querySelector('#documentPane input[name=menuindex]'),elParent=w.main.document.querySelector('#documentPane input[name=parent]'),elParentName=w.main.document.querySelector('#documentPane #parentName');if(elMenuIndex&&index>=0)elMenuIndex.value=index;if(elParent&&elParentName){elParent.value=parent;elParentName.innerHTML=parent+' ('+d.querySelector('#node'+parent+' > a').dataset.titleEsc+')'}}},toggleTheme:function(){var a,b=1,myCodeMirrors=w.main.myCodeMirrors,key;if(typeof localStorage['MODX_themeMode']==='undefined'){localStorage['MODX_themeMode']=modx.config.theme_mode}if(modx.thememodes[parseInt(localStorage['MODX_themeMode'])+1]){b=parseInt(localStorage['MODX_themeMode'])+1}a=modx.thememodes[b];for(key in modx.thememodes){if(modx.thememodes[key]){d.body.classList.remove(modx.thememodes[key]);w.main.document.body.classList.remove(modx.thememodes[key])}}d.body.classList.add(a);w.main.document.body.classList.add(a);d.cookie='MODX_themeMode='+b;localStorage['MODX_themeMode']=b;if(typeof myCodeMirrors!=='undefined'){for(key in myCodeMirrors){if(myCodeMirrors.hasOwnProperty(key)){if(~a.indexOf('dark')){w.main.document.getElementsByName(key)[0].nextElementSibling.classList.add('cm-s-'+myCodeMirrors[key].options.darktheme);w.main.document.getElementsByName(key)[0].nextElementSibling.classList.remove('cm-s-'+myCodeMirrors[key].options.defaulttheme)}else{w.main.document.getElementsByName(key)[0].nextElementSibling.classList.remove('cm-s-'+myCodeMirrors[key].options.darktheme);w.main.document.getElementsByName(key)[0].nextElementSibling.classList.add('cm-s-'+myCodeMirrors[key].options.defaulttheme)}}}}},toggleNode:function(e,id){e=e||w.event;if(e.ctrlKey)return;e.stopPropagation();var el=d.getElementById('node'+id).firstChild;this.rpcNode=el.nextSibling;var toggle=el.querySelector('.toggle'),icon=el.querySelector('.icon');if(this.rpcNode.innerHTML===''){if(toggle)toggle.innerHTML=el.dataset.iconCollapsed;icon.innerHTML=el.dataset.iconFolderOpen;var rpcNodeText=this.rpcNode.innerHTML,loadText=modx.lang.loading_doc_tree;modx.openedArray[id]=1;if(rpcNodeText===''||rpcNodeText.indexOf(loadText)>0){var folderState=this.getFolderState();d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent='+el.dataset.indent+'&parent='+id+'&expandAll='+el.dataset.expandall+folderState,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})}this.saveFolderState()}else{if(toggle)toggle.innerHTML=el.dataset.iconExpanded;icon.innerHTML=el.dataset.iconFolderClose;delete modx.openedArray[id];this.rpcNode.style.overflow='hidden';$(this.rpcNode.firstChild).animate({marginTop:-this.rpcNode.offsetHeight+'px'},100,function(){this.parentNode.innerHTML=''});this.saveFolderState()}e.preventDefault()},rpcLoadData:function(a){if(this.rpcNode!==null){var el;this.rpcNode.innerHTML=typeof a==='object'?a.responseText:a;this.rpcNode.loaded=true;if(this.rpcNode.firstChild.tagName==='DIV'){if(this.rpcNode.id==='treeRoot'){el=d.getElementById('binFull');if(el){this.showBin(true)}else{this.showBin(false)}}else{this.rpcNode.style.overflow='hidden';this.rpcNode.firstElementChild.style.marginTop=-this.rpcNode.offsetHeight+'px';$(this.rpcNode.firstChild).animate({marginTop:0},100)}d.getElementById('treeloader').classList.remove('visible')}else{el=d.getElementById('loginfrm');if(el){this.rpcNode.parentNode.removeChild(this.rpcNode);w.location.href=modx.MODX_MANAGER_URL}}}},treeAction:function(e,id,title){if(e.ctrlKey)return;var el=d.getElementById('node'+id).firstChild,treepageclick=el.dataset.treepageclick,showchildren=parseInt(el.dataset.showchildren),openfolder=parseInt(el.dataset.openfolder);title=title||el.dataset&&el.dataset.titleEsc;if(tree.ca==='move'){try{this.setSelectedByContext(id);w.main.setMoveValue(id,title)}catch(oException){alert(modx.lang.unable_set_parent)}}if(tree.ca==='open'||tree.ca===''){if(id===0){href='?a=2'}else{var href='';if(!isNaN(treepageclick)&&isFinite(treepageclick)){href='?a='+treepageclick+'&r=1&id='+id+(openfolder===0?this.getFolderState():'')}else{href=treepageclick}if(openfolder===2){if(showchildren!==1){href=''}this.toggleNode(e,id)}}if(href){if(e.shiftKey){w.getSelection().removeAllRanges();modx.openWindow(href);this.restoreTree()}else{modx.tabs({url:modx.MODX_MANAGER_URL+href,title:title+'('+id+')'});if(modx.isMobile)modx.resizer.toggle()}}this.itemToChange=id;this.setSelected(id)}if(tree.ca==='parent'){try{this.setSelectedByContext(id);w.main.setParent(id,title)}catch(oException){alert(modx.lang.unable_set_parent)}}if(tree.ca==='link'){try{this.setSelectedByContext(id);w.main.setLink(id)}catch(oException){alert(modx.lang.unable_set_link)}}e.preventDefault()},showPopup:function(e,id,title){if(e.ctrlKey)return;e.preventDefault();var tree=d.getElementById('tree'),el=d.getElementById('node'+id)||e.target,x=0,y=0;if(el.firstChild&&el.firstChild.dataset&&el.firstChild.dataset.contextmenu){el=el.firstChild}if(el){if(el.dataset.contextmenu){e.target.dataset.toggle='#contextmenu';modx.hideDropDown(e);this.ctx=d.createElement('div');this.ctx.id='contextmenu';this.ctx.className='dropdown-menu';d.getElementById(modx.frameset).appendChild(this.ctx);this.setSelectedByContext(id);var dataJson=JSON.parse(el.dataset.contextmenu);for(var key in dataJson){if(dataJson.hasOwnProperty(key)){var item=d.createElement('div');for(var k in dataJson[key]){if(dataJson[key].hasOwnProperty(k)){if(k.substring(0,2)==='on'){var onEvent=dataJson[key][k];item[k]=function(onEvent){return function(event){eval(onEvent)}}(onEvent)}else{item[k]=dataJson[key][k]}}}if(key.indexOf('header')===0)item.className+=' menuHeader';if(key.indexOf('item')===0)item.className+=' menuLink';if(key.indexOf('seperator')===0||key.indexOf('separator')===0)item.className+=' seperator separator';this.ctx.appendChild(item)}}x=e.clientX>0?e.clientX:e.pageX;y=e.clientY>0?e.clientY:e.pageY;e.view.position=e.view.frameElement?e.view.frameElement.getBoundingClientRect():e.target.offsetParent.getBoundingClientRect();if(e.view.frameElement){x+=e.view.position.left;y+=e.view.frameElement.offsetParent.offsetTop}else{if(e.target.parentNode.parentNode.classList.contains('node')){x+=50}}if(x>e.view.position.width){x=e.view.position.width-this.ctx.offsetWidth}if(y+this.ctx.offsetHeight/2>e.view.position.height){y=e.view.position.height-this.ctx.offsetHeight-5}else if(y-this.ctx.offsetHeight/20?e.clientX:e.pageX;y=e.clientY>0?e.clientY:e.pageY;if(y+ctx.offsetHeight/2>bodyHeight){y=bodyHeight-ctx.offsetHeight-5}else if(y-ctx.offsetHeight/230){this.selectedObjectName=this.selectedObjectName.substr(0,30)+'...'}var f=d.getElementById('nameHolder');f.innerHTML=this.selectedObjectName;el.style.left=a+(modx.config.textdir?'-190':'')+'px';el.style.top=b+'px';el.classList.add('show')},menuHandler:function(a){switch(a){case 1:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=3&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 2:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=27&r=1&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 3:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=4&pid='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 4:if(this.selectedObjectDeleted){alert('"'+this.selectedObjectName+'" '+modx.lang.already_deleted)}else if(confirm('"'+this.selectedObjectName+'"\n\n'+modx.lang.confirm_delete_resource)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=6&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 5:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=51&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 6:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=72&pid='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 7:if(confirm(modx.lang.confirm_resource_duplicate)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=94&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 8:if(d.getElementById('node'+this.itemToChange).firstChild.dataset.deleted){if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_undelete)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=63&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}}else{alert('"'+this.selectedObjectName+'"'+modx.lang.not_deleted)}break;case 9:if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_publish)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=61&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 10:if(this.itemToChange!==modx.config.site_start){if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_unpublish)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=62&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}}else{alert('Document is linked to site_start variable and cannot be unpublished!')}break;case 11:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=56&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 12:w.open(d.getElementById('node'+this.itemToChange).firstChild.dataset.href,'previeWin');break;default:alert('Unknown operation command.')}},setSelected:function(a){var el=d.querySelector('#tree .current');if(el)el.classList.remove('current');if(a){if(typeof a==='object'){a.classList.add('current')}else{el=d.querySelector('#node'+a+'>.node')||d.getElementById('node'+a);if(el)el.classList.add('current')}}},setActiveFromContextMenu:function(a){var el=d.querySelector('#node'+a+'>.node');if(el)this.setSelected(el)},setSelectedByContext:function(a){var el=d.querySelector('#treeRoot .selected');if(el)el.classList.remove('selected');el=d.querySelector('#node'+a+'>.node');if(el)el.classList.add('selected')},setItemToChange:function(){var a=w.main.document&&(w.main.document.URL||w.main.document.location.search),b=modx.getActionFromUrl(a);if(a&&modx.typesactions[b]){this.itemToChange=(modx.typesactions[b]===7?'':modx.typesactions[b]+'_')+parseInt(modx.main.getQueryVariable('id',a))}else{this.itemToChange=''}this.setSelected(this.itemToChange)},restoreTree:function(){if(d.getElementById('treeRoot')){d.getElementById('treeloader').classList.add('visible');this.setItemToChange();this.rpcNode=d.getElementById('treeRoot');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=2&id='+this.itemToChange,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})}},expandTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=1&id='+this.itemToChange,function(r){modx.tree.rpcLoadData(r);modx.tree.saveFolderState();modx.tree.draggable()})},collapseTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=0&id='+this.itemToChange,function(r){modx.openedArray=[];modx.tree.saveFolderState();modx.tree.rpcLoadData(r);modx.tree.draggable()})},updateTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');var a=d.sortFrm;var b='a=1&f=nodes&indent=1&parent=0&expandAll=2&dt='+a.dt.value+'&tree_sortby='+a.sortby.value+'&tree_sortdir='+a.sortdir.value+'&tree_nodename='+a.nodename.value+'&id='+this.itemToChange+'&showonlyfolders='+a.showonlyfolders.value;modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',b,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})},getFolderState:function(){var a;if(modx.openedArray!==[0]){a='&opened=';for(var key in modx.openedArray){if(modx.openedArray[key]){a+=key+'|'}}}else{a='&opened='}return a},saveFolderState:function(){modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&savestateonly=1'+this.getFolderState())},showSorter:function(e){e=e||w.event;var el=d.getElementById('floater');e.target.dataset.toggle='#floater';el.classList.toggle('show');el.onclick=function(e){e.stopPropagation()}},emptyTrash:function(){if(confirm(modx.lang.confirm_empty_trash)===true){modx.get(modx.MODX_MANAGER_URL+'?a=64',function(){modx.tabsClose(modx.tree.deleted);modx.tree.deleted=[];modx.tree.restoreTree()})}},showBin:function(a){var el=d.getElementById('treeMenu_emptytrash');if(el){if(a){el.title=modx.lang.empty_recycle_bin;el.classList.remove('disabled');el.innerHTML=modx.style.empty_recycle_bin;el.onclick=function(){modx.tree.emptyTrash()};var els=d.getElementById('tree').querySelectorAll('.deleted');for(var i=0;i0){if(el){el.innerHTML=c[0];el.style.display='block'}}else{if(el)el.style.display='none'}if(c[1]>0){el=d.getElementById('newMail');if(el){el.innerHTML=''+modx.style.email+modx.lang.inbox+' ('+c[0]+' / '+c[1]+')';el.style.display='block'}}if(modx.config.mail_check_timeperiod>0)setTimeout('modx.updateMail(true)',1000*modx.config.mail_check_timeperiod)})}}catch(oException){setTimeout('modx.updateMail(true)',1000*modx.config.mail_check_timeperiod)}},openWindow:function(a){if(typeof a!=='object'){a={'url':a}}if(!a.width)a.width=parseInt(w.innerWidth*0.9)+'px';if(!a.height)a.height=parseInt(w.innerHeight*0.8)+'px';if(!a.left)a.left=parseInt(w.innerWidth*0.05)+'px';if(!a.top)a.top=parseInt(w.innerHeight*0.1)+'px';if(!a.title)a.title=Math.floor((Math.random()*999999)+1);if(a.url){if(this.plugins.EVOmodal===1){top.EVO.modal.show(a)}else{w.open(a.url,a.title,'width='+a.width+',height='+a.height+',top='+a.top+',left='+a.left+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no')}}},tabsClose:function(a){if(modx.config.global_tabs&&a){for(var k in a){if(a.hasOwnProperty(k)){var el=d.getElementById(a[k]);if(el){el.firstElementChild.contentWindow.documentDirty=false;el.close()}}}}},tabs:function(a){function Tabs(a){var s=this;this.url=a.url;this.title=a.title||'';this.name=a.name||'';this.timer=null;this.olduid='';this.closeactions=[6,61,62,63,94];this.reload=typeof a.reload!=='undefined'?a.reload:1;this.action=modx.getActionFromUrl(a.url);this.uid=modx.getActionFromUrl(a.url,2)?'home':modx.urlToUid(a.url);this.page=d.getElementById('evo-tab-page-'+this.uid);this.row=d.getElementsByClassName('evo-tab-row')[0].firstElementChild;this.tab=d.getElementById('evo-tab-'+this.uid);if(this.page){if(this.uid==='home'){if(this.reload){this.page.firstElementChild.src=this.url;this.show()}else{this.reload=1;if(this.tab.onclick===null){this.tab.onclick=function(e){s.select.call(s,e,this)}}this.tab.show=function(e){s.show.call(s,e)};modx.tabs.selected=this.tab}}else{this.show();if(~this.closeactions.indexOf(this.action)){this.setDocPublished();modx.get(this.url,function(){modx.tree.restoreTree()})}}}else if(~this.closeactions.indexOf(this.action)){modx.get(this.url,function(){modx.tree.restoreTree()})}else{this.create()}}Tabs.prototype={create:function(){var s=this;modx.main.work();modx.tabs.selected=this.row.querySelector('.selected');if(modx.tabs.selected){d.getElementById(modx.tabs.selected.id.replace('tab','tab-page')).classList.remove('show');modx.tabs.selected.classList.remove('selected')}this.page=d.createElement('div');this.page.id='evo-tab-page-'+this.uid;this.page.className='evo-tab-page iframe-scroller show';this.page.innerHTML='';d.getElementById('main').appendChild(this.page);console.time('load-tab');this.page.firstElementChild.onload=function(e){s.onload.call(s,e);console.timeEnd('load-tab')};this.tab=d.createElement('h2');this.tab.id='evo-tab-'+this.uid;this.tab.className='tab selected';this.icon='';if(!/'}this.tab.innerHTML=''+this.icon+this.title+'×';this.row.appendChild(this.tab);this.tab.onclick=function(e){s.select.call(s,e,this)};this.tab.close=function(e){s.close.call(s,e)};this.tab.show=function(e){s.show.call(s,e)};this.page.close=function(e){s.close.call(s,e)}},onload:function(e){var s=this;w.main=e.target.contentWindow||e.target.defaultView;this.url=w.main.location.search||w.location.hash.substring(1);this.olduid=this.uid;this.uid=modx.urlToUid(this.url);if(!!w.main.__alertQuit){w.main.alert=function(a){};var message=w.main.document.body.innerHTML;w.main.document.body.innerHTML='';history.pushState(null,d.title,modx.getActionFromUrl(w.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.location.search);w.onpopstate=function(){history.go(1)};modx.popup({type:'warning',title:'MODX :: Alert',position:'top center alertQuit',content:message,wrap:'body'});modx.getLockedElements(modx.getActionFromUrl(this.url),modx.main.getQueryVariable('id',this.url),function(data){if(!!data){s.page.close();modx.tree.restoreTree()}else{w.main.location.href=modx.MODX_MANAGER_URL+s.url;w.history.replaceState(null,d.title,modx.getActionFromUrl(s.url,2)?modx.MODX_MANAGER_URL:'#'+s.url)}})}else{if(modx.getActionFromUrl(this.url,2)){this.close(e)}else if(this.olduid!==this.uid&&d.getElementById('evo-tab-'+this.uid)){this.close(e);d.getElementById('evo-tab-'+this.uid).show()}else{this.title=w.main.document.body.querySelectorAll('h1')[0]&&w.main.document.body.querySelectorAll('h1')[0].innerHTML||this.title;if(this.title&&this.uid!=='home'){this.tab.innerHTML=''+this.title+'×'}this.page.id='evo-tab-page-'+this.uid;this.tab.id='evo-tab-'+this.uid;this.tab.classList.remove('changed');this.show();modx.main.onload(e);w.main.document.addEventListener('click',function a(e){if(typeof e.view.documentDirty!=='undefined'&&e.view.documentDirty&&!s.tab.classList.contains('changed')){s.tab.classList.add('changed');this.removeEventListener(e.type,a,false)}},false);w.main.document.addEventListener('keyup',function a(e){if(typeof e.view.documentDirty!=='undefined'&&e.view.documentDirty&&!s.tab.classList.contains('changed')){s.tab.classList.add('changed');this.removeEventListener(e.type,a,false)}},false)}}},show:function(){var s=this;modx.tabs.selected=this.row.querySelector('.selected');if(modx.tabs.selected&&modx.tabs.selected!==this.tab){d.getElementById(modx.tabs.selected.id.replace('tab','tab-page')).classList.remove('show');modx.tabs.selected.classList.remove('selected')}this.page.classList.add('show');this.tab.classList.add('selected');modx.tabs.selected=this.tab;w.main=this.page.firstElementChild.contentWindow;w.history.replaceState(null,w.main.document.title,modx.getActionFromUrl(w.main.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.main.location.search);modx.tree.setItemToChange();modx.main.tabRow.scroll(this.row,this.tab,350)},close:function(e){var documentDirty=this.page.firstElementChild.contentWindow.documentDirty;var checkDirt=!!this.page.firstElementChild.contentWindow.checkDirt;if(documentDirty&&checkDirt&&confirm(this.page.firstElementChild.contentWindow.checkDirt(e))||!documentDirty){modx.tabs.selected=this.tab.classList.contains('selected')?this.tab.previousElementSibling:this.row.querySelector('.selected');this.page.parentNode.removeChild(this.page);this.row.removeChild(this.tab);modx.tabs.selected.show()}},select:function(e){if(e.target.className==='tab-close'){this.close(e)}else if(modx.tabs.selected===this.tab){var s=this;if(this.timer){clearTimeout(this.timer);this.timer=null;w.main.location.reload()}else{this.timer=setTimeout(function(){s.timer=null},250)}}else{this.show()}},setDocPublished:function(){var el=w.main.document.getElementsByName('publishedcheck')[0];if(el){el.checked=this.action===61;w.main.document.getElementsByName('published')[0].value=+el.checked}if(modx.getActionFromUrl(w.main.location.search,3)){w.main.location.reload()}}};if(modx.config.global_tabs){if(typeof a.currentTarget!=='undefined'){var e=a;if(e.button===0&&e.target&&(e.target.tagName==='A'&&e.target.target==='main'||(e.target.parentNode&&e.target.parentNode.tagName==='A'&&e.target.parentNode.target==='main'))){a=e.target.tagName==='A'&&e.target||e.target.parentNode.tagName==='A'&&e.target.parentNode;if(e.shiftKey){modx.openWindow({url:a.href})}else{modx.tabs({url:a.href,title:a.innerHTML})}e.preventDefault()}}else{return new Tabs(a)}}else if(a.url){if(w.main){w.main.frameElement.src=a.url}else{modx.openWindow(a.url)}}},popup:function(a){if(typeof a==='object'&&(a.url||a.content||a.text)){var o={addclass:'',animation:'fade',content:a.content||a.text||'',clickclose:0,closeall:0,data:'',dataType:'document',delay:5000,draggable:!1,event:null,height:'auto',hide:1,hover:1,icon:'',iframe:'iframe',margin:'.5rem',maxheight:'',method:'GET',overlay:0,overlayclose:0,position:'center',resize:!1,selector:'',showclose:1,target:'main',uid:'',type:'default',title:'',url:'',width:'20rem',wrap:w.main.document.body,zIndex:10500,w:null,show:function(){if(~o.position.indexOf('center')){if(o.event){o.el.style.left=o.event.clientX+o.mt+'px';o.el.style.bottom=o.w.innerHeight-o.el.offsetHeight-o.event.clientY+o.mt+'px'}else{o.el.style.left=/(%)/.test(o.width)?(100-parseInt(o.width))/2-o.mt/(o.w.innerWidth/100)+'%':(o.w.innerWidth-o.el.offsetWidth)/2-o.mt+'px';o.el.style.bottom=/(%)/.test(o.height)?(100-parseInt(o.height))/2-o.mt/(o.w.innerHeight/100)+'%':(o.w.innerHeight-o.el.offsetHeight-o.wrap.offsetTop)/2-o.mt+'px'}}if(~o.position.indexOf('left')){o.el.style.left=0}if(~o.position.indexOf('right')){o.el.style.right=0}else{o.el.style.right='auto'}if(~o.position.indexOf('top')){o.el.style.top=0;o.el.style.bottom=''}else{o.el.style.top='auto'}if(~o.position.indexOf('bottom')){o.el.style.bottom=0}o.calc();o.el.className+=' in';if(o.showclose){o.el.querySelector('.close').onclick=o.close}if(o.hide){o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);o.close()},o.delay)}if(o.hover){o.el.onmouseenter=function(){clearTimeout(o.el.timer)};o.el.onmouseleave=o.close}if(o.overlayclose&&o.o){o.o.onclick=o.close}if(o.clickclose){o.el.onclick=o.close}if(o.draggable){modx.dragging(o.el,{wrap:o.wrap,resize:o.resize})}},close:function(e){o.event=e||o.event||w.event;if(o.url&&o.iframe==='iframe'){var els=o.wrap.ownerDocument.querySelectorAll('.'+o.className+'.in');if(els){var documentDirty=o.el.lastElementChild.firstElementChild.contentWindow.documentDirty;if(documentDirty&&confirm(o.el.lastElementChild.firstElementChild.contentWindow.checkDirt(o.event))||!documentDirty){o.el.classList.remove('in');if(!o.animation){o.el.classList.remove('show')}o.calc(1);if(o.o&&o.o.parentNode){o.o.parentNode.removeChild(o.o);o.wrap.style.overflow=''}o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);if(o.el.parentNode){o.el.parentNode.removeChild(o.el)}},200)}}}else{o.el.classList.remove('in');if(!o.animation){o.el.classList.remove('show')}o.calc(1);if(o.o&&o.o.parentNode){o.o.parentNode.removeChild(o.o);o.wrap.style.overflow=''}o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);if(o.el.parentNode){o.el.parentNode.removeChild(o.el)}},200)}if(typeof o.onclose==='function'){o.onclose(e,o.el)}},calc:function(f){var els=o.wrap.ownerDocument.querySelectorAll('.'+o.className+'.in[data-position="'+o.el.dataset.position+'"]');if(els&&els.length){o.els=[];for(var i=0;i×'}if(o.title){o.header=document.createElement('div');if(o.icon!=='none'){o.header.innerHTML+=''}o.header.innerHTML+=o.title;o.header.className='evo-popup-header';o.el.appendChild(o.header)}o.el.innerHTML+='
      ';o.wrap.appendChild(o.el);o.mt=parseFloat(getComputedStyle(o.el).marginTop);if(o.maxheight){o.maxheight=/(%)/.test(o.maxheight)?(o.w.innerHeight-o.el.offsetHeight-o.mt)/100*parseInt(o.maxheight):o.maxheight;o.el.lastChild.style.overflowY='auto';o.el.lastChild.style.maxHeight=o.maxheight+'px'}if(o.url){o.draggable=1;if(o.iframe==='iframe'){o.resize=1;o.uid=modx.urlToUid(a.url);o.el.className+=' '+o.addclass+' '+o.className+'-iframe';o.el.id='evo-popup-'+o.uid;d.getElementById('mainloader').className='show';o.frame=d.createElement('iframe');o.frame.width='100%';o.frame.height='100%';o.frame.frameBorder='0';o.frame.src=o.url;o.frame.onload=function(e){e.target.contentWindow.opener=o.w;a.url=e.target.contentWindow.location.href;o.uid=modx.urlToUid(a.url);o.event=e;if(!!e.target.contentWindow.__alertQuit){modx.popup({type:'warning',title:'MODX :: Alert',position:'top center alertQuit',content:e.target.contentWindow.document.body.querySelector('p').innerHTML});e.target.contentWindow.document.body.innerHTML='';e.target.contentWindow.alert=function(){}}else{if(modx.getActionFromUrl(a.url,2)||o.wrap.querySelectorAll('#evo-popup-'+o.uid).length>1){o.el.close()}else{if(e.target.contentDocument.querySelectorAll('h1')[0]){a.title=e.target.contentDocument.querySelectorAll('h1')[0].innerHTML}else if(e.target.contentDocument.title){a.title=e.target.contentDocument.title}if(o.header){e.target.offsetParent.offsetParent.getElementsByClassName(o.header.className)[0].innerHTML=a.title}e.target.offsetParent.offsetParent.id='evo-popup-'+o.uid;e.target.offsetParent.offsetParent.classList.remove('changed')}}e.target.contentWindow.close=o.close;modx.main.stopWork()};o.el.lastChild.appendChild(o.frame);o.show()}else{var xhr=new XMLHttpRequest();xhr.open(o.method,o.url,true);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');xhr.setRequestHeader('X-REQUESTED-WITH','XMLHttpRequest');if(o.dataType){xhr.responseType=o.dataType}xhr.onload=function(){if(this.readyState===4){o.el.className+=' '+o.className+'-ajax';if(o.dataType==='document'){if(o.selector){var r=this.response.documentElement.querySelector(o.selector);if(r){o.el.lastChild.innerHTML+=r.innerHTML}}else{o.el.lastChild.innerHTML+=this.response.body.innerHTML}}else{o.el.lastChild.innerHTML+=this.response}o.show()}};xhr.send(o.data)}}else{o.el.lastChild.innerHTML+=o.content;o.show()}}return o}},getWindowDimension:function(){var a=0,b=0,c=d.documentElement,e=d.body;if(typeof(w.innerWidth)==='number'){a=w.innerWidth;b=w.innerHeight}else if(c&&(c.clientWidth||c.clientHeight)){a=c.clientWidth;b=c.clientHeight}else if(e&&(e.clientWidth||e.clientHeight)){a=e.clientWidth;b=e.clientHeight}return{'width':a,'height':b}},hideDropDown:function(e){e=e||w.event||w.main.event;if(tree.ca==='open'||tree.ca===''){modx.tree.setSelectedByContext()}if(modx.tree.ctx!==null){d.getElementById(modx.frameset).removeChild(modx.tree.ctx);modx.tree.ctx=null}if(!/dropdown\-item/.test(e.target.className)){var els=d.querySelectorAll('.dropdown.show'),n=null,t=e.target||e.target.parentNode,i;if(typeof t.dataset.toggle!=='undefined'){n=d.querySelector(t.dataset.toggle)}else if(t.classList.contains('dropdown-toggle')){n=t.offsetParent}for(i=0;i';if(this.classDrag)this.el.classList.add(this.classDrag);if(this.classResize)this.el.classList.add(this.classResize);this.el.insertBefore(this.borders,this.el.firstChild);if(this.handler&&this.el.getElementsByClassName(this.handler)[0]){this.handler=this.el.getElementsByClassName(this.handler)[0];this.handlerHeight=this.handler.offsetHeight}this.el.onmousedown=function(e){s.mousedown(e)};this.el.ontouchstart=function(e){s.mousedown(e.changedTouches[0])};this.wrap.addEventListener('mousemove',function(e){s.calc(e)},false);this.wrap.addEventListener('touchmove',function(e){s.calc(e.changedTouches[0])},false)};this.dragging.init.prototype={mousedown:function(e){if(e.target.classList.contains('close')){return}e=document.all?window.event:e;var s=this,x=document.all?window.event.clientX:e.clientX,y=document.all?window.event.clientY:e.clientY,style=w.getComputedStyle(this.el);this.elmX=(x-this.el.offsetLeft+parseInt(style.marginLeft));this.elmY=(y-this.el.offsetTop+parseInt(style.marginTop));this.el.position=this.el.getBoundingClientRect();this.el.style.position='fixed';this.el.style.transitionDuration='0s';this.el.style.webkitTransitionDuration='0s';this.el.style.left=this.el.offsetLeft-parseInt(style.marginLeft)+'px';this.el.style.top=this.el.offsetTop-parseInt(style.marginTop)+'px';this.el.style.right='auto';this.el.style.bottom='auto';this.el.style.width=this.el.position.width+'px';this.el.style.height=this.el.position.height+'px';if(e.target.parentNode===this.borders){this.isresize=this.resize;this.el.classList.add('is-resize')}else{if(!this.handler||(this.handler&&e.target===this.handler)){this.isdrag=true;this.el.classList.add('is-drag')}}if(typeof this.start==='function'){this.onstart(e,this.el)}if(e.preventDefault){e.preventDefault()}else{document.onselectstart=function(){return false}}this.wrap.onmousemove=function(e){s.mousemove(e)};this.wrap.ontouchmove=function(e){s.mousemove(e.changedTouches[0]);e.stopPropagation()};this.wrap.onmouseup=function(e){s.mouseup(e)};this.wrap.ontouchend=function(e){s.mouseup(e.changedTouches[0]);e.stopPropagation()}},mousemove:function(e){var x=document.all?window.event.clientX:e.clientX,y=document.all?window.event.clientY:e.clientY;if(this.isresize){if(this.onRight)this.el.style.width=Math.max(x-this.el.position.left+(this.el.position.width-this.x),this.minWidth)+'px';if(this.onBottom)this.el.style.height=Math.max(y-this.el.position.top+(this.el.position.height-this.y),this.minHeight)+'px';if(this.onLeft){this.width=Math.max(this.el.position.left-x+this.el.position.width+this.x,this.minWidth);if(this.width>this.minWidth){this.el.style.width=this.width+'px';this.el.style.left=x-this.elmX+'px'}}if(this.onTop){var currentHeight=Math.max(this.el.position.top-y+this.el.position.height+this.y,this.minHeight);if(currentHeight>this.minHeight){this.el.style.height=currentHeight+'px';this.el.style.top=y-this.elmY+'px'}}if(typeof this.onresize==='function'){this.onresize(e,this.el)}}else if(this.isdrag){this.el.style.opacity=this.opacity;this.el.style.left=x-this.elmX+'px';this.el.style.top=y-this.elmY+'px';if(typeof this.drag==='function'){this.ondrag(e,this.el)}}},mouseup:function(e){if(this.isdrag||this.isresize){this.el.classList.remove('is-resize');this.el.classList.remove('is-drag');this.el.style.opacity='';this.el.style.transitionDuration='';this.el.style.webkitTransitionDuration='';this.el.position=this.el.getBoundingClientRect();this.isdrag=false;this.isresize=false;this.wrap.onmousemove=null;this.wrap.onselectstart=null;if(typeof this.stop==='function'){this.onstop(e,this.el)}}},calc:function(e){if(this.isresize||this.isdrag){return}this.x=e.clientX-this.el.offsetLeft;this.y=e.clientY-this.el.offsetTop;if(this.resize){this.onTop=this.y=this.el.offsetWidth-this.border;this.onBottom=this.y>=this.el.offsetHeight-this.border;if(this.onRight&&this.onBottom||this.onLeft&&this.onTop){this.el.style.cursor='nwse-resize'}else if(this.onRight&&this.onTop||this.onBottom&&this.onLeft){this.el.style.cursor='nesw-resize'}else if(this.onRight||this.onLeft){this.el.style.cursor='ew-resize'}else if(this.onBottom||this.onTop){this.el.style.cursor='ns-resize'}else if(this.x>0&&this.y>0&&(this.x=this.border)){this.el.style.cursor='move'}else{this.el.style.cursor='default'}}else{if(this.x>0&&this.y>0&&(this.x=this.border)){this.el.style.cursor='move'}}}};return new this.dragging.init(a,b)},setTypeIcon:function(a){var b='';switch(this.typesactions[a]){case 1:b='fa fa-newspaper-o';break;case 2:b='fa fa-list-alt';break;case 3:b='fa fa-th-large';break;case 4:b='fa fa-code';break;case 5:b='fa fa-plug';break;case 6:b='fa fa-cube';break;case 7:b='fa fa-pencil-square-o';break;default:b='fa fa-circle'}return b}});w.mainMenu={};w.mainMenu.stopWork=function(){modx.main.stopWork()};w.mainMenu.work=function(){modx.main.work()};w.mainMenu.reloadtree=function(){if(modx.plugins.ElementsInTree){setTimeout('reloadElementsInTree()',50)}if(modx.config.global_tabs){setTimeout('modx.tree.restoreTree()',100)}};w.mainMenu.startrefresh=function(a){if(a===1){}if(a===2){}if(a===9){modx.tree.restoreTree()}if(a===10){w.location.href=modx.MODX_MANAGER_URL}};w.mainMenu.startmsgcount=function(a,b,c){modx.updateMail(c)};w.mainMenu.hideTreeFrame=function(){modx.resizer.setWidth(0)};w.mainMenu.defaultTreeFrame=function(){modx.resizer.setDefaultWidth()};w.tree={};w.tree.ca='open';w.tree.document=document;w.tree.saveFolderState=function(){};w.tree.updateTree=function(){modx.tree.updateTree()};w.tree.restoreTree=function(){modx.tree.restoreTree()};w.tree.resizeTree=function(){};w.onbeforeunload=function(){var a=w.main.frameElement.contentWindow;if(modx.getActionFromUrl(a.location.search,27)){modx.get(modx.MODX_MANAGER_URL+'?a=67&type=7&id='+modx.main.getQueryVariable('id',a.location.search.substring(1)))}};d.addEventListener('DOMContentLoaded',function(){modx.init()})})(typeof jQuery!=='undefined'?jQuery:'',window,document,undefined);(function(){if(!Element.prototype.closest){Element.prototype.closest=function(a){var b=this,c,d;['matches','webkitMatchesSelector','mozMatchesSelector','msMatchesSelector','oMatchesSelector'].some(function(fn){if(typeof document.body[fn]==='function'){c=fn;return true}return false});if(b&&c&&b[c](a))return b;while(b){d=b.parentElement;if(d&&c&&d[c](a))return d;b=d}return null}}})(); +(function($,w,d,u){'use strict';modx.extended({frameset:'frameset',minWidth:840,isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),typesactions:{'16':1,'301':2,'78':3,'22':4,'102':5,'108':6,'3':7,'4':7,'6':7,'27':7,'61':7,'62':7,'63':7,'72':7},thememodes:['','lightness','light','dark','darkness'],tabsTimer:0,popupTimer:0,init:function(){if(!localStorage.getItem('MODX_widthSideBar')){localStorage.setItem('MODX_widthSideBar',this.config.tree_width)}this.mainmenu.init();if(w.location.hash){if(modx.getActionFromUrl(w.location.hash,2)){w.history.replaceState(null,d.title,modx.MODX_MANAGER_URL)}else if(modx.getActionFromUrl(w.location.hash)||modx.main.getQueryVariable('filemanager',w.location.hash)){var url=modx.main.getQueryVariable('filemanager',w.location.hash)?modx.MODX_MANAGER_URL+modx.main.getQueryVariable('filemanager',w.location.hash)+w.location.hash.replace('#?','?'):w.location.href.replace('#?','?');if(modx.config.global_tabs){modx.tabs({url:url,title:'blank'})}else if(w.main){w.main.frameElement.src=url}else{modx.openWindow(url)}}}this.resizer.init();this.search.init();if(this.config.session_timeout>0){w.setInterval(this.keepMeAlive,1000*60*this.config.session_timeout)}if(modx.config.mail_check_timeperiod>0&&modx.permission.messages){setTimeout('modx.updateMail(true)',1000)}d.addEventListener('click',this.hideDropDown,false);if(modx.config.global_tabs){d.addEventListener('click',this.tabs,false);this.tabs({url:'?a=2',reload:0})}},mainmenu:{id:'mainMenu',init:function(){var $mm=$('#mainMenu'),mm=d.getElementById('mainMenu'),timer;$mm.on('click','a',function(e){if($(this).hasClass('dropdown-toggle')){if($mm.hasClass('show')&&($(this).hasClass('selected')||!modx.isMobile&&$(this).parent().hasClass('hover'))){$(this).removeClass('selected');$mm.removeClass('show')}else{$('.nav > li > a:not(:hover)').removeClass('selected');$(this).addClass('selected');$mm.addClass('show')}e.stopPropagation();e.target.dataset.toggle='#mainMenu';modx.hideDropDown(e)}if($(this).closest('ul').hasClass('dropdown-menu')&&!$(this).parent('li').hasClass('dropdown-back')){$('.nav > .active').removeClass('active');$('.nav li.selected').removeClass('selected');$(this).closest('.nav > li').addClass('active');if(this.offsetParent.id){d.getElementById(this.offsetParent.id.substr(7)).classList.add('selected')}if((modx.isMobile||w.innerWidth li',function(){var els=mm.querySelectorAll('.nav > li.hover:not(:hover)');for(var i=0;i li li',function(e){var self=this,ul;var els=mm.querySelectorAll('.nav > li li.hover:not(:hover)');for(var i=0;i'+modx.lang.paging_prev+''+data}ul.id='parent_'+self.id;ul.innerHTML=data;var id=w.location.hash.substr(2).replace(/=/g,'_').replace(/&/g,'__');var el=d.getElementById(id);if(el){el.parentNode.classList.add('selected');d.getElementById(el.parentNode.parentNode.id.substr(7)).classList.add('selected')}for(var i=0;iitems.length-1){index=items.length-1}if(index>=0&&index2){s.timer=setTimeout(function(){s.loader.style.display='block';modx.get(modx.MODX_MANAGER_URL+'?a=71&ajax=1&submitok=Search&searchid='+s.input.value,function(data){s.loader.style.display='none';s.results=data.querySelector('.ajaxSearchResults');if(s.results&&s.results.innerHTML!==''){s.result.innerHTML=s.results.outerHTML;s.open();s.result.onclick=function(e){var t=e.target,p=t.parentNode;if(t.tagName==='I'){modx.openWindow({title:p.innerText,id:p.id,url:p.href});e.preventDefault();e.stopPropagation()}else{var a=t.tagName==='A'&&t||p.tagName==='A'&&p;if(a){var el=s.result.querySelector('.selected');if(el)el.className='';a.className='selected';if(modx.isMobile)s.close()}}}}else{s.empty()}},'document')},300)}else{s.empty()}};if(modx.isMobile){this.input.onblur=this.close}this.input.onfocus=this.open;this.input.onclick=this.open;this.input.onmouseenter=this.open;this.result.onmouseenter=this.open;this.result.onmouseleave=this.close;this.mask.onmouseenter=this.open;this.mask.onmouseleave=this.close},open:function(){if(modx.search.results){modx.search.result.classList.add('open')}},close:function(){modx.search.result.classList.remove('open')},empty:function(){modx.search.result.classList.remove('open');modx.search.result.innerHTML=''}},main:{id:'main',idFrame:'mainframe',as:null,onload:function(e){w.main=e.target.contentWindow||e.target.defaultView;modx.main.tabRow.init();modx.main.stopWork();modx.main.scrollWork();w.main.document.addEventListener('click',modx.hideDropDown,false);w.main.document.addEventListener('contextmenu',modx.main.oncontextmenu,false);if(modx.config.global_tabs){w.main.document.addEventListener('click',modx.tabs,false)}w.history.replaceState(null,d.title,modx.getActionFromUrl(w.main.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.main.location.search);setTimeout('modx.tree.restoreTree()',100)},oncontextmenu:function(e){if(e.ctrlKey)return;var el=e.target;if(modx.user.role===1&&/modxtv|modxplaceholder|modxattributevalue|modxchunk|modxsnippet|modxsnippetnocache/i.test(el.className)){var id=Date.now(),name=el.innerText.replace(/[\[|\]|{|}|\*||\#|\+|?|\!|&|=|`|:]/g,''),type=el.className.replace(/cm-modx/,''),n=!!name.replace(/^\d+$/,'');if(name&&n){e.preventDefault();modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',{a:'modxTagHelper',name:name,type:type},function(r){if(r){r=JSON.parse(r);for(var k in r){if(r.hasOwnProperty(k)&&r[k].url){r[k]['onclick']='if(event.shiftKey){modx.openWindow({url:\''+r[k].url+'\'})}else{modx.popup({url:\''+r[k].url+'\',title:\''+r.header.innerHTML+'\',width:\'95%\',height:\'95%\',margin:0,hide:0,hover:0,overlay:1,overlayclose:0,position:\'center elements\',animation:0,icon:\'none\'})}'}}r=JSON.stringify(r);el.id='node'+id;el.dataset.contextmenu=r;modx.tree.showPopup(e,id,name)}})}e.preventDefault()}},tabRow:{init:function(){var row=w.main.document.querySelector('.tab-pane > .tab-row');if(row)this.build(row)},build:function(row){var rowContainer=d.createElement('div'),sel=row.querySelector('.selected');rowContainer.className='tab-row-container';row.parentNode.insertBefore(rowContainer,row);rowContainer.appendChild(row);var p=d.createElement('i');p.className='fa fa-angle-left prev disable';p.onclick=function(e){e.stopPropagation();e.preventDefault();var sel=row.querySelector('.selected');if(sel.previousSibling){sel.previousSibling.click();modx.main.tabRow.scroll(row)}};rowContainer.appendChild(p);var n=d.createElement('i');n.className='fa fa-angle-right next disable';n.onclick=function(e){e.stopPropagation();e.preventDefault();var sel=row.querySelector('.selected');if(sel.nextSibling){sel.nextSibling.click();modx.main.tabRow.scroll(row)}};rowContainer.appendChild(n);setTimeout(function(){sel=row.querySelector('.selected');modx.main.tabRow.scroll(row,sel);w.main.addEventListener('resize',function(){modx.main.tabRow.scroll(row)},false);if(sel){if(sel.previousSibling)p.classList.remove('disable');if(sel.nextSibling)n.classList.remove('disable')}},100);row.onclick=function(e){var sel=e.target.tagName==='H2'?e.target:e.target.tagName==='SPAN'?e.target.parentNode:null;if(sel){if(sel.previousSibling){this.parentNode.querySelector('i.prev').classList.remove('disable')}else{this.parentNode.querySelector('i.prev').classList.add('disable')}if(sel.nextSibling){this.parentNode.querySelector('i.next').classList.remove('disable')}else{this.parentNode.querySelector('i.next').classList.add('disable')}modx.main.tabRow.scroll(this,sel)}}},scroll:function(row,sel,a){sel=sel||row.querySelector('.selected')||row.firstChild;a=a||100;var c=0,elms=row.childNodes;for(var i=0;isel.offsetLeft){$(row).animate({scrollLeft:sel.offsetLeft-(sel.previousSibling?30:1)},a)}if(sel.offsetLeft+sel.offsetWidth>row.offsetWidth+row.scrollLeft){$(row).animate({scrollLeft:sel.offsetLeft-row.offsetWidth+sel.offsetWidth+(sel.nextSibling?30:0)},a)}if(c>row.offsetWidth){this.drag(row)}},drag:function(row){row.onmousedown=function(e){if(e.button===0){e.preventDefault();var x=e.clientX,f=row.scrollLeft;row.ownerDocument.body.focus();row.onmousemove=row.ownerDocument.onmousemove=function(e){if(Math.abs(e.clientX-x)>5){e.stopPropagation();row.scrollLeft=f-(e.clientX-x);row.ownerDocument.body.classList.add('drag')}};row.onmouseup=row.ownerDocument.onmouseup=function(e){e.stopPropagation();row.onmousemove=null;row.ownerDocument.onmousemove=null;row.ownerDocument.body.classList.remove('drag')}}}}},work:function(){d.getElementById('mainloader').classList.add('show')},stopWork:function(){d.getElementById('mainloader').classList.remove('show')},scrollWork:function(){var a=w.main.frameElement.contentWindow,b=a.location.search.substring(1)||a.location.hash.substring(2),c=localStorage.getItem('page_y')||0,f=localStorage.getItem('page_url')||b;if(((modx.getActionFromUrl(f)===modx.getActionFromUrl(b))&&(modx.main.getQueryVariable('id',f)&&modx.main.getQueryVariable('id',f)===modx.main.getQueryVariable('id',b)))||(f===b)){a.scrollTo(0,c)}a.addEventListener('scroll',function(){if(this.pageYOffset>=0){localStorage.setItem('page_y',this.pageYOffset.toString());localStorage.setItem('page_url',b)}},false)},getQueryVariable:function(a,b){var f='';if(b||typeof b==='string'){b=b.split('?');b=b[1]||b[0];b=b.split('&');for(var i=0;iMath.abs(ay)&&this.swipe){if(ax<0&&this.sidebar){if(Math.abs(ax)>h)ax=-h;tree.style.transform='translate3d('+ax+'px, 0, 0)';tree.style.WebkitTransform='translate3d('+ax+'px, 0, 0)';modx.resizer.mask.style.opacity=(0.5-0.5/-h*ax).toFixed(2);if(Math.abs(ax)>h/3){this.swipe='left'}else{this.swipe='right'}}else if(ax>0&&!this.sidebar){if(Math.abs(ax)>h)ax=h;tree.style.transform='translate3d('+ -(h-ax)+'px, 0, 0)';tree.style.WebkitTransform='translate3d('+ -(h-ax)+'px, 0, 0)';modx.resizer.mask.style.opacity=(0.5/h*ax).toFixed(2);if(Math.abs(ax)>h/3){this.swipe='right'}else{this.swipe='left'}}}},false);w.addEventListener('touchend',function(){if(this.swipe==='left'){d.body.classList.add('sidebar-closed');modx.resizer.setWidth(0)}if(this.swipe==='right'){d.body.classList.remove('sidebar-closed');modx.resizer.setWidth(h)}tree.style.cssText='';modx.resizer.mask.style.cssText=''},false)}},onMouseDown:function(e){e=e||w.event;modx.resizer.dragElement=e.target!==null?e.target:e.srcElement;if((e.buttons===1||e.button===0)&&modx.resizer.dragElement.id===modx.resizer.id){modx.resizer.oldZIndex=modx.resizer.dragElement.style.zIndex;modx.resizer.dragElement.style.zIndex=modx.resizer.newZIndex;modx.resizer.dragElement.style.background=modx.resizer.background;localStorage.setItem('MODX_widthSideBar',modx.resizer.dragElement.offsetLeft>0?modx.resizer.dragElement.offsetLeft:0);d.body.appendChild(modx.resizer.mask);d.onmousemove=modx.resizer.onMouseMove;d.body.focus();d.body.classList.add('resizer_move');d.onselectstart=function(){return false};modx.resizer.dragElement.ondragstart=function(){return false};return false}},onMouseMove:function(e){e=e||w.event;if(e.clientX>0){modx.resizer.left=e.clientX}else{modx.resizer.left=0}modx.resizer.dragElement.style.left=modx.pxToRem(modx.resizer.left)+'rem';d.getElementById('tree').style.width=modx.pxToRem(modx.resizer.left)+'rem';d.getElementById('main').style.left=modx.pxToRem(modx.resizer.left)+'rem';if(e.clientX<-2||e.clientY<-2){modx.resizer.onMouseUp(e)}},onMouseUp:function(e){if(modx.resizer.dragElement!==null&&e.button===0&&modx.resizer.dragElement.id===modx.resizer.id){if(e.clientX>0){d.body.classList.remove('sidebar-closed');modx.resizer.left=e.clientX}else{d.body.classList.add('sidebar-closed');modx.resizer.left=0}d.cookie='MODX_widthSideBar='+modx.pxToRem(modx.resizer.left);modx.resizer.dragElement.style.zIndex=modx.resizer.oldZIndex;modx.resizer.dragElement.style.background='';modx.resizer.dragElement.ondragstart=null;modx.resizer.dragElement=null;d.body.classList.remove('resizer_move');d.body.removeChild(modx.resizer.mask);d.onmousemove=null;d.onselectstart=null}},toggle:function(){if(modx.isMobile||w.innerWidth<=modx.minWidth){if(d.body.classList.contains('sidebar-closed')){d.body.classList.remove('sidebar-closed');localStorage.setItem('MODX_widthSideBar',0);d.cookie='MODX_widthSideBar='+modx.pxToRem(parseInt(d.getElementById('tree').offsetWidth))}else{localStorage.setItem('MODX_widthSideBar',parseInt(d.getElementById('tree').offsetWidth));d.body.classList.add('sidebar-closed');d.cookie='MODX_widthSideBar=0'}}else{var p=d.getElementById('tree').offsetWidth!==0?0:parseInt(localStorage.getItem('MODX_widthSideBar'))?parseInt(localStorage.getItem('MODX_widthSideBar')):modx.config.tree_width;modx.resizer.setWidth(p)}},setWidth:function(a){if(a>0){localStorage.setItem('MODX_widthSideBar',0);d.body.classList.remove('sidebar-closed')}else{localStorage.setItem('MODX_widthSideBar',parseInt(d.getElementById('tree').offsetWidth));d.body.classList.add('sidebar-closed')}d.cookie='MODX_widthSideBar='+modx.pxToRem(a);d.getElementById('tree').style.width=modx.pxToRem(a)+'rem';d.getElementById('resizer').style.left=modx.pxToRem(a)+'rem';d.getElementById('main').style.left=modx.pxToRem(a)+'rem'},setDefaultWidth:function(){modx.resizer.setWidth(modx.remToPx(modx.config.tree_width))}},tree:{ctx:null,rpcNode:null,itemToChange:'',selectedObjectName:null,selectedObject:0,selectedObjectDeleted:0,selectedObjectUrl:'',drag:false,deleted:[],init:function(){this.restoreTree()},draggable:function(){if(modx.permission.dragndropdocintree){var els=d.querySelectorAll('#treeRoot a:not(.empty)');for(var i=0;i-1:true;modx.tree.itemToChange=this.dataset.id||this.parentNode.id.replace('node','');modx.tree.selectedObjectName=this.dataset.titleEsc;if(draggable){this.parentNode.draggable=true;this.parentNode.ondragstart=modx.tree.ondragstart}else{this.parentNode.draggable=false;this.parentNode.ondragstart=function(){return false}}}},ondragstart:function(e){e.dataTransfer.effectAllowed='all';e.dataTransfer.dropEffect='all';e.dataTransfer.setData('text',this.id.substr(4))},ondragenter:function(e){if(d.getElementById('node'+modx.tree.itemToChange)===(this.parentNode.closest('#node'+modx.tree.itemToChange)||this.parentNode)){this.parentNode.className='';e.dataTransfer.effectAllowed='none';e.dataTransfer.dropEffect='none';modx.tree.drag=false}else{this.parentNode.className='dragenter';e.dataTransfer.effectAllowed='copy';e.dataTransfer.dropEffect='copy';modx.tree.drag=true}e.preventDefault()},ondragover:function(e){if(modx.tree.drag){var a=e.clientY;var b=parseInt(this.getBoundingClientRect().top);var c=a-b;if(c>this.offsetHeight/1.51){this.parentNode.classList.add('dragafter');this.parentNode.classList.remove('dragbefore');this.parentNode.classList.remove('dragenter');e.dataTransfer.effectAllowed='link';e.dataTransfer.dropEffect='link'}else if(c'}if(this.nextSibling){if(this.nextSibling.innerHTML){this.nextSibling.appendChild(el)}else{el.parentNode.removeChild(el)}els=this.parentNode.lastChild.children;for(i=0;i'}this.parentNode.parentNode.insertBefore(el,this.parentNode.nextSibling);els=this.parentNode.parentNode.children;for(i=0;i'}this.parentNode.parentNode.insertBefore(el,this.parentNode);els=this.parentNode.parentNode.children;for(i=0;i-1:true)){alert(modx.lang.error_no_privileges);modx.tree.restoreTree();return}modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',{a:'movedocument',id:id,parent:parent,menuindex:menuindex},function(r){if(r.errors)alert(r.errors);modx.tree.restoreTree()},'json');var b=w.main.frameElement.contentWindow.location.search.substr(1);if(modx.getActionFromUrl(b,27)&&parseInt(modx.main.getQueryVariable('id',b))===parseInt(id)){var index=menuindex.indexOf(id),elMenuIndex=w.main.document.querySelector('#documentPane input[name=menuindex]'),elParent=w.main.document.querySelector('#documentPane input[name=parent]'),elParentName=w.main.document.querySelector('#documentPane #parentName');if(elMenuIndex&&index>=0)elMenuIndex.value=index;if(elParent&&elParentName){elParent.value=parent;elParentName.innerHTML=parent+' ('+d.querySelector('#node'+parent+' > a').dataset.titleEsc+')'}}},toggleTheme:function(){var a,b=1,myCodeMirrors=w.main.myCodeMirrors,key;if(typeof localStorage['MODX_themeMode']==='undefined'){localStorage['MODX_themeMode']=modx.config.theme_mode}if(modx.thememodes[parseInt(localStorage['MODX_themeMode'])+1]){b=parseInt(localStorage['MODX_themeMode'])+1}a=modx.thememodes[b];for(key in modx.thememodes){if(modx.thememodes[key]){d.body.classList.remove(modx.thememodes[key]);w.main.document.body.classList.remove(modx.thememodes[key])}}d.body.classList.add(a);w.main.document.body.classList.add(a);d.cookie='MODX_themeMode='+b;localStorage['MODX_themeMode']=b;if(typeof myCodeMirrors!=='undefined'){for(key in myCodeMirrors){if(myCodeMirrors.hasOwnProperty(key)){if(~a.indexOf('dark')){w.main.document.getElementsByName(key)[0].nextElementSibling.classList.add('cm-s-'+myCodeMirrors[key].options.darktheme);w.main.document.getElementsByName(key)[0].nextElementSibling.classList.remove('cm-s-'+myCodeMirrors[key].options.defaulttheme)}else{w.main.document.getElementsByName(key)[0].nextElementSibling.classList.remove('cm-s-'+myCodeMirrors[key].options.darktheme);w.main.document.getElementsByName(key)[0].nextElementSibling.classList.add('cm-s-'+myCodeMirrors[key].options.defaulttheme)}}}}},toggleNode:function(e,id){e=e||w.event;if(e.ctrlKey)return;e.stopPropagation();var el=d.getElementById('node'+id).firstChild;this.rpcNode=el.nextSibling;var toggle=el.querySelector('.toggle'),icon=el.querySelector('.icon');if(this.rpcNode.innerHTML===''){if(toggle)toggle.innerHTML=el.dataset.iconCollapsed;icon.innerHTML=el.dataset.iconFolderOpen;var rpcNodeText=this.rpcNode.innerHTML,loadText=modx.lang.loading_doc_tree;modx.openedArray[id]=1;if(rpcNodeText===''||rpcNodeText.indexOf(loadText)>0){var folderState=this.getFolderState();d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent='+el.dataset.indent+'&parent='+id+'&expandAll='+el.dataset.expandall+folderState,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})}this.saveFolderState()}else{if(toggle)toggle.innerHTML=el.dataset.iconExpanded;icon.innerHTML=el.dataset.iconFolderClose;delete modx.openedArray[id];this.rpcNode.style.overflow='hidden';$(this.rpcNode.firstChild).animate({marginTop:-this.rpcNode.offsetHeight+'px'},100,function(){this.parentNode.innerHTML=''});this.saveFolderState()}e.preventDefault()},rpcLoadData:function(a){if(this.rpcNode!==null){var el;this.rpcNode.innerHTML=typeof a==='object'?a.responseText:a;this.rpcNode.loaded=true;if(this.rpcNode.firstChild.tagName==='DIV'){if(this.rpcNode.id==='treeRoot'){el=d.getElementById('binFull');if(el){this.showBin(true)}else{this.showBin(false)}}else{this.rpcNode.style.overflow='hidden';this.rpcNode.firstElementChild.style.marginTop=-this.rpcNode.offsetHeight+'px';$(this.rpcNode.firstChild).animate({marginTop:0},100)}d.getElementById('treeloader').classList.remove('visible')}else{el=d.getElementById('loginfrm');if(el){this.rpcNode.parentNode.removeChild(this.rpcNode);w.location.href=modx.MODX_MANAGER_URL}}}},treeAction:function(e,id,title){if(e.ctrlKey)return;var el=d.getElementById('node'+id).firstChild,treepageclick=el.dataset.treepageclick,showchildren=parseInt(el.dataset.showchildren),openfolder=parseInt(el.dataset.openfolder);title=title||el.dataset&&el.dataset.titleEsc;if(tree.ca==='move'){try{this.setSelectedByContext(id);w.main.setMoveValue(id,title)}catch(oException){alert(modx.lang.unable_set_parent)}}if(tree.ca==='open'||tree.ca===''){if(id===0){href='?a=2'}else{var href='';if(!isNaN(treepageclick)&&isFinite(treepageclick)){href='?a='+treepageclick+'&r=1&id='+id+(openfolder===0?this.getFolderState():'')}else{href=treepageclick}if(openfolder===2){if(showchildren!==1){href=''}this.toggleNode(e,id)}}if(href){if(e.shiftKey){w.getSelection().removeAllRanges();modx.openWindow(href);this.restoreTree()}else{modx.tabs({url:modx.MODX_MANAGER_URL+href,title:title+'('+id+')'});if(modx.isMobile&&w.innerWidth0?e.clientX:e.pageX;y=e.clientY>0?e.clientY:e.pageY;e.view.position=e.view.frameElement?e.view.frameElement.getBoundingClientRect():e.target.offsetParent.getBoundingClientRect();if(e.view.frameElement){x+=e.view.position.left;y+=e.view.frameElement.offsetParent.offsetTop}else{if(e.target.parentNode.parentNode.classList.contains('node')){x+=50}}if(x>e.view.position.width){x=e.view.position.width-this.ctx.offsetWidth}if(y+this.ctx.offsetHeight/2>e.view.position.height){y=e.view.position.height-this.ctx.offsetHeight-5}else if(y-this.ctx.offsetHeight/20?e.clientX:e.pageX;y=e.clientY>0?e.clientY:e.pageY;if(y+ctx.offsetHeight/2>bodyHeight){y=bodyHeight-ctx.offsetHeight-5}else if(y-ctx.offsetHeight/230){this.selectedObjectName=this.selectedObjectName.substr(0,30)+'...'}var f=d.getElementById('nameHolder');f.innerHTML=this.selectedObjectName;el.style.left=a+(modx.config.textdir?'-190':'')+'px';el.style.top=b+'px';el.classList.add('show')},menuHandler:function(a){switch(a){case 1:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=3&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 2:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=27&r=1&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 3:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=4&pid='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 4:if(this.selectedObjectDeleted){alert('"'+this.selectedObjectName+'" '+modx.lang.already_deleted)}else if(confirm('"'+this.selectedObjectName+'"\n\n'+modx.lang.confirm_delete_resource)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=6&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 5:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=51&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 6:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=72&pid='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 7:if(confirm(modx.lang.confirm_resource_duplicate)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=94&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 8:if(d.getElementById('node'+this.itemToChange).firstChild.dataset.deleted){if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_undelete)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=63&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}}else{alert('"'+this.selectedObjectName+'"'+modx.lang.not_deleted)}break;case 9:if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_publish)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=61&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 10:if(this.itemToChange!==modx.config.site_start){if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_unpublish)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=62&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}}else{alert('Document is linked to site_start variable and cannot be unpublished!')}break;case 11:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=56&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 12:w.open(d.getElementById('node'+this.itemToChange).firstChild.dataset.href,'previeWin');break;default:alert('Unknown operation command.')}},setSelected:function(a){var el=d.querySelector('#tree .current');if(el)el.classList.remove('current');if(a){if(typeof a==='object'){a.classList.add('current')}else{el=d.querySelector('#node'+a+'>.node')||d.getElementById('node'+a);if(el)el.classList.add('current')}}},setActiveFromContextMenu:function(a){var el=d.querySelector('#node'+a+'>.node');if(el)this.setSelected(el)},setSelectedByContext:function(a){var el=d.querySelector('#treeRoot .selected');if(el)el.classList.remove('selected');el=d.querySelector('#node'+a+'>.node');if(el)el.classList.add('selected')},setItemToChange:function(){var a=w.main.document&&(w.main.document.URL||w.main.document.location.search),b=modx.getActionFromUrl(a);if(a&&modx.typesactions[b]){this.itemToChange=(modx.typesactions[b]===7?'':modx.typesactions[b]+'_')+parseInt(modx.main.getQueryVariable('id',a))}else{this.itemToChange=''}this.setSelected(this.itemToChange)},restoreTree:function(){if(d.getElementById('treeRoot')){d.getElementById('treeloader').classList.add('visible');this.setItemToChange();this.rpcNode=d.getElementById('treeRoot');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=2&id='+this.itemToChange,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})}},expandTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=1&id='+this.itemToChange,function(r){modx.tree.rpcLoadData(r);modx.tree.saveFolderState();modx.tree.draggable()})},collapseTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=0&id='+this.itemToChange,function(r){modx.openedArray=[];modx.tree.saveFolderState();modx.tree.rpcLoadData(r);modx.tree.draggable()})},updateTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');var a=d.sortFrm;var b='a=1&f=nodes&indent=1&parent=0&expandAll=2&dt='+a.dt.value+'&tree_sortby='+a.sortby.value+'&tree_sortdir='+a.sortdir.value+'&tree_nodename='+a.nodename.value+'&id='+this.itemToChange+'&showonlyfolders='+a.showonlyfolders.value;modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',b,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})},getFolderState:function(){var a;if(modx.openedArray!==[0]){a='&opened=';for(var key in modx.openedArray){if(modx.openedArray[key]){a+=key+'|'}}}else{a='&opened='}return a},saveFolderState:function(){modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&savestateonly=1'+this.getFolderState())},showSorter:function(e){e=e||w.event;var el=d.getElementById('floater');e.target.dataset.toggle='#floater';el.classList.toggle('show');el.onclick=function(e){e.stopPropagation()}},emptyTrash:function(){if(confirm(modx.lang.confirm_empty_trash)===true){modx.get(modx.MODX_MANAGER_URL+'?a=64',function(){modx.tabsClose(modx.tree.deleted);modx.tree.deleted=[];modx.tree.restoreTree()})}},showBin:function(a){var el=d.getElementById('treeMenu_emptytrash');if(el){if(a){el.title=modx.lang.empty_recycle_bin;el.classList.remove('disabled');el.innerHTML=modx.style.empty_recycle_bin;el.onclick=function(){modx.tree.emptyTrash()};var els=d.getElementById('tree').querySelectorAll('.deleted');for(var i=0;i0){if(el){el.innerHTML=c[0];el.style.display='block'}}else{if(el)el.style.display='none'}if(c[1]>0){el=d.getElementById('newMail');if(el){el.innerHTML=''+modx.style.email+modx.lang.inbox+' ('+c[0]+' / '+c[1]+')';el.style.display='block'}}if(modx.config.mail_check_timeperiod>0)setTimeout('modx.updateMail(true)',1000*modx.config.mail_check_timeperiod)})}}catch(oException){setTimeout('modx.updateMail(true)',1000*modx.config.mail_check_timeperiod)}},openWindow:function(a){if(typeof a!=='object'){a={'url':a}}if(!a.width)a.width=parseInt(w.innerWidth*0.9)+'px';if(!a.height)a.height=parseInt(w.innerHeight*0.8)+'px';if(!a.left)a.left=parseInt(w.innerWidth*0.05)+'px';if(!a.top)a.top=parseInt(w.innerHeight*0.1)+'px';if(!a.title)a.title=Math.floor((Math.random()*999999)+1);if(a.url){if(this.plugins.EVOmodal===1){top.EVO.modal.show(a)}else{w.open(a.url,a.title,'width='+a.width+',height='+a.height+',top='+a.top+',left='+a.left+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no')}}},tabsClose:function(a){if(modx.config.global_tabs&&a){for(var k in a){if(a.hasOwnProperty(k)){var el=d.getElementById(a[k]);if(el){el.firstElementChild.contentWindow.documentDirty=false;el.close()}}}}},tabs:function(a){function Tabs(a){var s=this;this.url=a.url;this.title=a.title||'';this.name=a.name||'';this.timer=null;this.olduid='';this.closeactions=[6,61,62,63,94];this.reload=typeof a.reload!=='undefined'?a.reload:1;this.action=modx.getActionFromUrl(a.url);this.uid=modx.getActionFromUrl(a.url,2)?'home':modx.urlToUid(a.url);this.page=d.getElementById('evo-tab-page-'+this.uid);this.row=d.getElementsByClassName('evo-tab-row')[0].firstElementChild;this.tab=d.getElementById('evo-tab-'+this.uid);if(this.page){if(this.uid==='home'){if(this.reload){this.page.firstElementChild.src=this.url;this.show()}else{this.reload=1;if(this.tab.onclick===null){this.tab.onclick=function(e){s.select.call(s,e,this)}}this.tab.show=function(e){s.show.call(s,e)};modx.tabs.selected=this.tab}}else{this.show();if(~this.closeactions.indexOf(this.action)){this.setDocPublished();modx.get(this.url,function(){modx.tree.restoreTree()})}}}else if(~this.closeactions.indexOf(this.action)){modx.get(this.url,function(){modx.tree.restoreTree()})}else{this.create()}}Tabs.prototype={create:function(){var s=this;modx.main.work();modx.tabs.selected=this.row.querySelector('.selected');if(modx.tabs.selected){d.getElementById(modx.tabs.selected.id.replace('tab','tab-page')).classList.remove('show');modx.tabs.selected.classList.remove('selected')}this.page=d.createElement('div');this.page.id='evo-tab-page-'+this.uid;this.page.className='evo-tab-page iframe-scroller show';this.page.innerHTML='';d.getElementById('main').appendChild(this.page);console.time('load-tab');this.page.firstElementChild.onload=function(e){s.onload.call(s,e);console.timeEnd('load-tab')};this.tab=d.createElement('h2');this.tab.id='evo-tab-'+this.uid;this.tab.className='tab selected';this.icon='';if(!/'}this.tab.innerHTML=''+this.icon+this.title+'×';this.row.appendChild(this.tab);this.tab.onclick=function(e){s.select.call(s,e,this)};this.tab.close=function(e){s.close.call(s,e)};this.tab.show=function(e){s.show.call(s,e)};this.page.close=function(e){s.close.call(s,e)}},onload:function(e){var s=this;w.main=e.target.contentWindow||e.target.defaultView;this.url=w.main.location.search||w.location.hash.substring(1);this.olduid=this.uid;this.uid=modx.urlToUid(this.url);if(!!w.main.__alertQuit){w.main.alert=function(a){};var message=w.main.document.body.innerHTML;w.main.document.body.innerHTML='';history.pushState(null,d.title,modx.getActionFromUrl(w.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.location.search);w.onpopstate=function(){history.go(1)};modx.popup({type:'warning',title:'MODX :: Alert',position:'top center alertQuit',content:message,wrap:'body'});modx.getLockedElements(modx.getActionFromUrl(this.url),modx.main.getQueryVariable('id',this.url),function(data){if(!!data){s.page.close();modx.tree.restoreTree()}else{w.main.location.href=modx.MODX_MANAGER_URL+s.url;w.history.replaceState(null,d.title,modx.getActionFromUrl(s.url,2)?modx.MODX_MANAGER_URL:'#'+s.url)}})}else{if(modx.getActionFromUrl(this.url,2)){this.close(e)}else if(this.olduid!==this.uid&&d.getElementById('evo-tab-'+this.uid)){this.close(e);d.getElementById('evo-tab-'+this.uid).show()}else{this.title=w.main.document.body.querySelectorAll('h1')[0]&&w.main.document.body.querySelectorAll('h1')[0].innerHTML||this.title;if(this.title&&this.uid!=='home'){this.tab.innerHTML=''+this.title+'×'}this.page.id='evo-tab-page-'+this.uid;this.tab.id='evo-tab-'+this.uid;this.tab.classList.remove('changed');this.show();modx.main.onload(e);w.main.document.addEventListener('click',function a(e){if(typeof e.view.documentDirty!=='undefined'&&e.view.documentDirty&&!s.tab.classList.contains('changed')){s.tab.classList.add('changed');this.removeEventListener(e.type,a,false)}},false);w.main.document.addEventListener('keyup',function a(e){if(typeof e.view.documentDirty!=='undefined'&&e.view.documentDirty&&!s.tab.classList.contains('changed')){s.tab.classList.add('changed');this.removeEventListener(e.type,a,false)}},false)}}},show:function(){var s=this;modx.tabs.selected=this.row.querySelector('.selected');if(modx.tabs.selected&&modx.tabs.selected!==this.tab){d.getElementById(modx.tabs.selected.id.replace('tab','tab-page')).classList.remove('show');modx.tabs.selected.classList.remove('selected')}this.page.classList.add('show');this.tab.classList.add('selected');modx.tabs.selected=this.tab;w.main=this.page.firstElementChild.contentWindow;w.history.replaceState(null,w.main.document.title,modx.getActionFromUrl(w.main.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.main.location.search);modx.tree.setItemToChange();modx.main.tabRow.scroll(this.row,this.tab,350)},close:function(e){var documentDirty=this.page.firstElementChild.contentWindow.documentDirty;var checkDirt=!!this.page.firstElementChild.contentWindow.checkDirt;if(documentDirty&&checkDirt&&confirm(this.page.firstElementChild.contentWindow.checkDirt(e))||!documentDirty){modx.tabs.selected=this.tab.classList.contains('selected')?this.tab.previousElementSibling:this.row.querySelector('.selected');this.page.parentNode.removeChild(this.page);this.row.removeChild(this.tab);modx.tabs.selected.show()}},select:function(e){if(e.target.className==='tab-close'){this.close(e)}else if(modx.tabs.selected===this.tab){var s=this;if(this.timer){clearTimeout(this.timer);this.timer=null;w.main.location.reload()}else{this.timer=setTimeout(function(){s.timer=null},250)}}else{this.show()}},setDocPublished:function(){var el=w.main.document.getElementsByName('publishedcheck')[0];if(el){el.checked=this.action===61;w.main.document.getElementsByName('published')[0].value=+el.checked}if(modx.getActionFromUrl(w.main.location.search,3)){w.main.location.reload()}}};if(modx.config.global_tabs){if(typeof a.currentTarget!=='undefined'){var e=a;if(e.button===0&&e.target&&(e.target.tagName==='A'&&e.target.target==='main'||(e.target.parentNode&&e.target.parentNode.tagName==='A'&&e.target.parentNode.target==='main'))){a=e.target.tagName==='A'&&e.target||e.target.parentNode.tagName==='A'&&e.target.parentNode;if(e.shiftKey){modx.openWindow({url:a.href})}else{modx.tabs({url:a.href,title:a.innerHTML})}e.preventDefault()}}else{return new Tabs(a)}}else if(a.url){if(w.main){w.main.frameElement.src=a.url}else{modx.openWindow(a.url)}}},popup:function(a){if(typeof a==='object'&&(a.url||a.content||a.text)){var o={addclass:'',animation:'fade',content:a.content||a.text||'',clickclose:0,closeall:0,data:'',dataType:'document',delay:5000,draggable:!1,event:null,height:'auto',hide:1,hover:1,icon:'',iframe:'iframe',margin:'.5rem',maxheight:'',method:'GET',overlay:0,overlayclose:0,position:'center',resize:!1,selector:'',showclose:1,target:'main',uid:'',type:'default',title:'',url:'',width:'20rem',wrap:w.main.document.body,zIndex:10500,w:null,show:function(){if(~o.position.indexOf('center')){if(o.event){o.el.style.left=o.event.clientX+o.mt+'px';o.el.style.bottom=o.w.innerHeight-o.el.offsetHeight-o.event.clientY+o.mt+'px'}else{o.el.style.left=/(%)/.test(o.width)?(100-parseInt(o.width))/2-o.mt/(o.w.innerWidth/100)+'%':(o.w.innerWidth-o.el.offsetWidth)/2-o.mt+'px';o.el.style.bottom=/(%)/.test(o.height)?(100-parseInt(o.height))/2-o.mt/(o.w.innerHeight/100)+'%':(o.w.innerHeight-o.el.offsetHeight-o.wrap.offsetTop)/2-o.mt+'px'}}if(~o.position.indexOf('left')){o.el.style.left=0}if(~o.position.indexOf('right')){o.el.style.right=0}else{o.el.style.right='auto'}if(~o.position.indexOf('top')){o.el.style.top=0;o.el.style.bottom=''}else{o.el.style.top='auto'}if(~o.position.indexOf('bottom')){o.el.style.bottom=0}o.calc();o.el.className+=' in';if(o.showclose){o.el.querySelector('.close').onclick=o.close}if(o.hide){o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);o.close()},o.delay)}if(o.hover){o.el.onmouseenter=function(){clearTimeout(o.el.timer)};o.el.onmouseleave=o.close}if(o.overlayclose&&o.o){o.o.onclick=o.close}if(o.clickclose){o.el.onclick=o.close}if(o.draggable){modx.dragging(o.el,{wrap:o.wrap,resize:o.resize})}},close:function(e){o.event=e||o.event||w.event;if(o.url&&o.iframe==='iframe'){var els=o.wrap.ownerDocument.querySelectorAll('.'+o.className+'.in');if(els){var documentDirty=o.el.lastElementChild.firstElementChild.contentWindow.documentDirty;if(documentDirty&&confirm(o.el.lastElementChild.firstElementChild.contentWindow.checkDirt(o.event))||!documentDirty){o.el.classList.remove('in');if(!o.animation){o.el.classList.remove('show')}o.calc(1);if(o.o&&o.o.parentNode){o.o.parentNode.removeChild(o.o);o.wrap.style.overflow=''}o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);if(o.el.parentNode){o.el.parentNode.removeChild(o.el)}},200)}}}else{o.el.classList.remove('in');if(!o.animation){o.el.classList.remove('show')}o.calc(1);if(o.o&&o.o.parentNode){o.o.parentNode.removeChild(o.o);o.wrap.style.overflow=''}o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);if(o.el.parentNode){o.el.parentNode.removeChild(o.el)}},200)}if(typeof o.onclose==='function'){o.onclose(e,o.el)}},calc:function(f){var els=o.wrap.ownerDocument.querySelectorAll('.'+o.className+'.in[data-position="'+o.el.dataset.position+'"]');if(els&&els.length){o.els=[];for(var i=0;i×'}if(o.title){o.header=document.createElement('div');if(o.icon!=='none'){o.header.innerHTML+=''}o.header.innerHTML+=o.title;o.header.className='evo-popup-header';o.el.appendChild(o.header)}o.el.innerHTML+='
      ';o.wrap.appendChild(o.el);o.mt=parseFloat(getComputedStyle(o.el).marginTop);if(o.maxheight){o.maxheight=/(%)/.test(o.maxheight)?(o.w.innerHeight-o.el.offsetHeight-o.mt)/100*parseInt(o.maxheight):o.maxheight;o.el.lastChild.style.overflowY='auto';o.el.lastChild.style.maxHeight=o.maxheight+'px'}if(o.url){o.draggable=1;if(o.iframe==='iframe'){o.resize=1;o.uid=modx.urlToUid(a.url);o.el.className+=' '+o.addclass+' '+o.className+'-iframe';o.el.id='evo-popup-'+o.uid;d.getElementById('mainloader').className='show';o.frame=d.createElement('iframe');o.frame.width='100%';o.frame.height='100%';o.frame.frameBorder='0';o.frame.src=o.url;o.frame.onload=function(e){e.target.contentWindow.opener=o.w;a.url=e.target.contentWindow.location.href;o.uid=modx.urlToUid(a.url);o.event=e;if(!!e.target.contentWindow.__alertQuit){modx.popup({type:'warning',title:'MODX :: Alert',position:'top center alertQuit',content:e.target.contentWindow.document.body.querySelector('p').innerHTML});e.target.contentWindow.document.body.innerHTML='';e.target.contentWindow.alert=function(){}}else{if(modx.getActionFromUrl(a.url,2)||o.wrap.querySelectorAll('#evo-popup-'+o.uid).length>1){o.el.close()}else{if(e.target.contentDocument.querySelectorAll('h1')[0]){a.title=e.target.contentDocument.querySelectorAll('h1')[0].innerHTML}else if(e.target.contentDocument.title){a.title=e.target.contentDocument.title}if(o.header){e.target.offsetParent.offsetParent.getElementsByClassName(o.header.className)[0].innerHTML=a.title}e.target.offsetParent.offsetParent.id='evo-popup-'+o.uid;e.target.offsetParent.offsetParent.classList.remove('changed')}}e.target.contentWindow.close=o.close;modx.main.stopWork()};o.el.lastChild.appendChild(o.frame);o.show()}else{var xhr=new XMLHttpRequest();xhr.open(o.method,o.url,true);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');xhr.setRequestHeader('X-REQUESTED-WITH','XMLHttpRequest');if(o.dataType){xhr.responseType=o.dataType}xhr.onload=function(){if(this.readyState===4){o.el.className+=' '+o.className+'-ajax';if(o.dataType==='document'){if(o.selector){var r=this.response.documentElement.querySelector(o.selector);if(r){o.el.lastChild.innerHTML+=r.innerHTML}}else{o.el.lastChild.innerHTML+=this.response.body.innerHTML}}else{o.el.lastChild.innerHTML+=this.response}o.show()}};xhr.send(o.data)}}else{o.el.lastChild.innerHTML+=o.content;o.show()}}return o}},getWindowDimension:function(){var a=0,b=0,c=d.documentElement,e=d.body;if(typeof(w.innerWidth)==='number'){a=w.innerWidth;b=w.innerHeight}else if(c&&(c.clientWidth||c.clientHeight)){a=c.clientWidth;b=c.clientHeight}else if(e&&(e.clientWidth||e.clientHeight)){a=e.clientWidth;b=e.clientHeight}return{'width':a,'height':b}},hideDropDown:function(e){e=e||w.event||w.main.event;if(tree.ca==='open'||tree.ca===''){modx.tree.setSelectedByContext()}if(modx.tree.ctx!==null){d.getElementById(modx.frameset).removeChild(modx.tree.ctx);modx.tree.ctx=null}if(!/dropdown\-item/.test(e.target.className)){var els=d.querySelectorAll('.dropdown.show'),n=null,t=e.target||e.target.parentNode,i;if(typeof t.dataset.toggle!=='undefined'){n=d.querySelector(t.dataset.toggle)}else if(t.classList.contains('dropdown-toggle')){n=t.offsetParent}for(i=0;i';if(this.classDrag)this.el.classList.add(this.classDrag);if(this.classResize)this.el.classList.add(this.classResize);this.el.insertBefore(this.borders,this.el.firstChild);if(this.handler&&this.el.getElementsByClassName(this.handler)[0]){this.handler=this.el.getElementsByClassName(this.handler)[0];this.handlerHeight=this.handler.offsetHeight}this.el.onmousedown=function(e){s.mousedown(e)};this.el.ontouchstart=function(e){s.mousedown(e.changedTouches[0])};this.wrap.addEventListener('mousemove',function(e){s.calc(e)},false);this.wrap.addEventListener('touchmove',function(e){s.calc(e.changedTouches[0])},false)};this.dragging.init.prototype={mousedown:function(e){if(e.target.classList.contains('close')){return}e=document.all?window.event:e;var s=this,x=document.all?window.event.clientX:e.clientX,y=document.all?window.event.clientY:e.clientY,style=w.getComputedStyle(this.el);this.elmX=(x-this.el.offsetLeft+parseInt(style.marginLeft));this.elmY=(y-this.el.offsetTop+parseInt(style.marginTop));this.el.position=this.el.getBoundingClientRect();this.el.style.position='fixed';this.el.style.transitionDuration='0s';this.el.style.webkitTransitionDuration='0s';this.el.style.left=this.el.offsetLeft-parseInt(style.marginLeft)+'px';this.el.style.top=this.el.offsetTop-parseInt(style.marginTop)+'px';this.el.style.right='auto';this.el.style.bottom='auto';this.el.style.width=this.el.position.width+'px';this.el.style.height=this.el.position.height+'px';if(e.target.parentNode===this.borders){this.isresize=this.resize;this.el.classList.add('is-resize')}else{if(!this.handler||(this.handler&&e.target===this.handler)){this.isdrag=true;this.el.classList.add('is-drag')}}if(typeof this.start==='function'){this.onstart(e,this.el)}if(e.preventDefault){e.preventDefault()}else{document.onselectstart=function(){return false}}this.wrap.onmousemove=function(e){s.mousemove(e)};this.wrap.ontouchmove=function(e){s.mousemove(e.changedTouches[0]);e.stopPropagation()};this.wrap.onmouseup=function(e){s.mouseup(e)};this.wrap.ontouchend=function(e){s.mouseup(e.changedTouches[0]);e.stopPropagation()}},mousemove:function(e){var x=document.all?window.event.clientX:e.clientX,y=document.all?window.event.clientY:e.clientY;if(this.isresize){if(this.onRight)this.el.style.width=Math.max(x-this.el.position.left+(this.el.position.width-this.x),this.minWidth)+'px';if(this.onBottom)this.el.style.height=Math.max(y-this.el.position.top+(this.el.position.height-this.y),this.minHeight)+'px';if(this.onLeft){this.width=Math.max(this.el.position.left-x+this.el.position.width+this.x,this.minWidth);if(this.width>this.minWidth){this.el.style.width=this.width+'px';this.el.style.left=x-this.elmX+'px'}}if(this.onTop){var currentHeight=Math.max(this.el.position.top-y+this.el.position.height+this.y,this.minHeight);if(currentHeight>this.minHeight){this.el.style.height=currentHeight+'px';this.el.style.top=y-this.elmY+'px'}}if(typeof this.onresize==='function'){this.onresize(e,this.el)}}else if(this.isdrag){this.el.style.opacity=this.opacity;this.el.style.left=x-this.elmX+'px';this.el.style.top=y-this.elmY+'px';if(typeof this.drag==='function'){this.ondrag(e,this.el)}}},mouseup:function(e){if(this.isdrag||this.isresize){this.el.classList.remove('is-resize');this.el.classList.remove('is-drag');this.el.style.opacity='';this.el.style.transitionDuration='';this.el.style.webkitTransitionDuration='';this.el.position=this.el.getBoundingClientRect();this.isdrag=false;this.isresize=false;this.wrap.onmousemove=null;this.wrap.onselectstart=null;if(typeof this.stop==='function'){this.onstop(e,this.el)}}},calc:function(e){if(this.isresize||this.isdrag){return}this.x=e.clientX-this.el.offsetLeft;this.y=e.clientY-this.el.offsetTop;if(this.resize){this.onTop=this.y=this.el.offsetWidth-this.border;this.onBottom=this.y>=this.el.offsetHeight-this.border;if(this.onRight&&this.onBottom||this.onLeft&&this.onTop){this.el.style.cursor='nwse-resize'}else if(this.onRight&&this.onTop||this.onBottom&&this.onLeft){this.el.style.cursor='nesw-resize'}else if(this.onRight||this.onLeft){this.el.style.cursor='ew-resize'}else if(this.onBottom||this.onTop){this.el.style.cursor='ns-resize'}else if(this.x>0&&this.y>0&&(this.x=this.border)){this.el.style.cursor='move'}else{this.el.style.cursor='default'}}else{if(this.x>0&&this.y>0&&(this.x=this.border)){this.el.style.cursor='move'}}}};return new this.dragging.init(a,b)},setTypeIcon:function(a){var b='';switch(this.typesactions[a]){case 1:b='fa fa-newspaper-o';break;case 2:b='fa fa-list-alt';break;case 3:b='fa fa-th-large';break;case 4:b='fa fa-code';break;case 5:b='fa fa-plug';break;case 6:b='fa fa-cube';break;case 7:b='fa fa-pencil-square-o';break;default:b='fa fa-circle'}return b}});w.mainMenu={};w.mainMenu.stopWork=function(){modx.main.stopWork()};w.mainMenu.work=function(){modx.main.work()};w.mainMenu.reloadtree=function(){if(modx.plugins.ElementsInTree){setTimeout('reloadElementsInTree()',50)}if(modx.config.global_tabs){setTimeout('modx.tree.restoreTree()',100)}};w.mainMenu.startrefresh=function(a){if(a===1){}if(a===2){}if(a===9){modx.tree.restoreTree()}if(a===10){w.location.href=modx.MODX_MANAGER_URL}};w.mainMenu.startmsgcount=function(a,b,c){modx.updateMail(c)};w.mainMenu.hideTreeFrame=function(){modx.resizer.setWidth(0)};w.mainMenu.defaultTreeFrame=function(){modx.resizer.setDefaultWidth()};w.tree={};w.tree.ca='open';w.tree.document=document;w.tree.saveFolderState=function(){};w.tree.updateTree=function(){modx.tree.updateTree()};w.tree.restoreTree=function(){modx.tree.restoreTree()};w.tree.resizeTree=function(){};w.onbeforeunload=function(){var a=w.main.frameElement.contentWindow;if(modx.getActionFromUrl(a.location.search,27)){modx.get(modx.MODX_MANAGER_URL+'?a=67&type=7&id='+modx.main.getQueryVariable('id',a.location.search.substring(1)))}};d.addEventListener('DOMContentLoaded',function(){modx.init()})})(typeof jQuery!=='undefined'?jQuery:'',window,document,undefined);(function(){if(!Element.prototype.closest){Element.prototype.closest=function(a){var b=this,c,d;['matches','webkitMatchesSelector','mozMatchesSelector','msMatchesSelector','oMatchesSelector'].some(function(fn){if(typeof document.body[fn]==='function'){c=fn;return true}return false});if(b&&c&&b[c](a))return b;while(b){d=b.parentElement;if(d&&c&&d[c](a))return d;b=d}return null}}})(); From 4db2355606ef89d334e6b9d3380ed5e0b6bac092 Mon Sep 17 00:00:00 2001 From: Mr B Date: Wed, 2 May 2018 22:00:37 +0100 Subject: [PATCH 203/274] [F] fix for module iframe scrolling ref: https://github.com/evolution-cms/evolution/pull/647 --- manager/processors/execute_module.processor.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manager/processors/execute_module.processor.php b/manager/processors/execute_module.processor.php index 3af867ca01..4e68d008ff 100755 --- a/manager/processors/execute_module.processor.php +++ b/manager/processors/execute_module.processor.php @@ -59,6 +59,8 @@ // Set the item name for logger $_SESSION['itemname'] = $content['name']; +echo ""; // for iframe scroller + $output = evalModule($content["modulecode"],$parameter); echo $output; include MODX_MANAGER_PATH."includes/sysalert.display.inc.php"; From 84617f23beb04fc08e9bc684110e89c4cfcf7328 Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Thu, 3 May 2018 18:01:39 +0200 Subject: [PATCH 204/274] Stacked table cells on small screens --- manager/media/style/default/css/main.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manager/media/style/default/css/main.css b/manager/media/style/default/css/main.css index c4176a3dbd..1e68b03f5b 100755 --- a/manager/media/style/default/css/main.css +++ b/manager/media/style/default/css/main.css @@ -104,6 +104,10 @@ code { font-size: inherit; font-family: Consolas, 'Courier New', 'Courier', mono table th { font-weight: 500; } .table--edit th { width: 200px; color: #555; font-size: inherit; } .table--edit input[type="text"], .table--edit input[type="password"], .table--edit input[type="number"], .table--edit textarea, .table--edit select, .settings input[type="text"], .settings input[type="password"], .settings input[type="number"], .settings textarea, .settings select { width: 300px; } +/* stacked table cells on small screens */ +@media (max-width: 567px) { +#documentPane #tabGeneral > table > tbody > tr > td, #documentPane #tabGeneral .tmplvars > table > tbody > tr > td, #documentPane #tabSettings > table > tbody > tr > td {display: block !important;width: 100% !important;} +} /* * MODxRE2 styles * css above is original MODxRE From 97179a3bd9c7006991df16b0277e7d60ae337aef Mon Sep 17 00:00:00 2001 From: Piotr Matysiak Date: Sat, 5 May 2018 16:32:18 +0200 Subject: [PATCH 205/274] Stacked table cells for system configuration --- manager/media/style/default/css/main.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manager/media/style/default/css/main.css b/manager/media/style/default/css/main.css index 1e68b03f5b..73fd2f30d9 100755 --- a/manager/media/style/default/css/main.css +++ b/manager/media/style/default/css/main.css @@ -106,7 +106,8 @@ table th { font-weight: 500; } .table--edit input[type="text"], .table--edit input[type="password"], .table--edit input[type="number"], .table--edit textarea, .table--edit select, .settings input[type="text"], .settings input[type="password"], .settings input[type="number"], .settings textarea, .settings select { width: 300px; } /* stacked table cells on small screens */ @media (max-width: 567px) { -#documentPane #tabGeneral > table > tbody > tr > td, #documentPane #tabGeneral .tmplvars > table > tbody > tr > td, #documentPane #tabSettings > table > tbody > tr > td {display: block !important;width: 100% !important;} +#documentPane #tabGeneral > table > tbody > tr > td, #documentPane #tabGeneral .tmplvars > table > tbody > tr > td, #documentPane #tabSettings > table > tbody > tr > td, #settingsPane > .tab-page > table > tbody > tr > td, #settingsPane > .tab-page > table > tbody > tr > th {display: block !important;width: 100% !important;} +#settingsPane > .tab-page > table > tbody > tr > th {border-bottom-width: 0;} } /* * MODxRE2 styles From e100bef004f71d73cb68f2cebee55c074ea78d32 Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Wed, 9 May 2018 20:57:06 +0300 Subject: [PATCH 206/274] iframe scroller for for Module if no need fix add to GET &api=1 --- manager/processors/execute_module.processor.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manager/processors/execute_module.processor.php b/manager/processors/execute_module.processor.php index 4e68d008ff..07ebd77e45 100755 --- a/manager/processors/execute_module.processor.php +++ b/manager/processors/execute_module.processor.php @@ -59,9 +59,11 @@ // Set the item name for logger $_SESSION['itemname'] = $content['name']; -echo ""; // for iframe scroller $output = evalModule($content["modulecode"],$parameter); +if ( (int)$_GET['api'] != 1){ + echo ""; // for iframe scroller +} echo $output; include MODX_MANAGER_PATH."includes/sysalert.display.inc.php"; From ccb4ac7a6b9a6e64b731ace3c240074dd6f9bf94 Mon Sep 17 00:00:00 2001 From: Mr B Date: Thu, 10 May 2018 09:05:23 +0100 Subject: [PATCH 207/274] [I] Change html check for scroller --- manager/processors/execute_module.processor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/processors/execute_module.processor.php b/manager/processors/execute_module.processor.php index 07ebd77e45..2306851455 100755 --- a/manager/processors/execute_module.processor.php +++ b/manager/processors/execute_module.processor.php @@ -61,7 +61,7 @@ $output = evalModule($content["modulecode"],$parameter); -if ( (int)$_GET['api'] != 1){ +if (strpos(trim($output),'<')===0) { echo ""; // for iframe scroller } echo $output; From 12c151b13861ef5a181b156929a4f9fabf738453 Mon Sep 17 00:00:00 2001 From: Mr B Date: Thu, 10 May 2018 13:46:07 +0100 Subject: [PATCH 208/274] [I] Make store fit iframe width --- assets/modules/store/css/style.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/assets/modules/store/css/style.css b/assets/modules/store/css/style.css index 600d861dd8..b7c2438088 100644 --- a/assets/modules/store/css/style.css +++ b/assets/modules/store/css/style.css @@ -17,8 +17,7 @@ body { } .pagetitle { - position: relative; - left: 10px + margin-left: 10px; } .github { From d287e2b85d9bd41f470675f5ba6ffabdaa38a3a9 Mon Sep 17 00:00:00 2001 From: Mr B Date: Fri, 11 May 2018 08:33:19 +0100 Subject: [PATCH 209/274] Update execute_module.processor.php add exception for xml files --- manager/processors/execute_module.processor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/processors/execute_module.processor.php b/manager/processors/execute_module.processor.php index 2306851455..cb335626e1 100755 --- a/manager/processors/execute_module.processor.php +++ b/manager/processors/execute_module.processor.php @@ -61,7 +61,7 @@ $output = evalModule($content["modulecode"],$parameter); -if (strpos(trim($output),'<')===0) { +if (strpos(trim($output),'<')===0 && strpos(trim($output),'body,html {overflow:auto!important;height:100%!important}"; // for iframe scroller } echo $output; From 2905e58c7064090380217cdfd3a1f2ae679f7aa0 Mon Sep 17 00:00:00 2001 From: Mr B Date: Sat, 12 May 2018 19:07:37 +0100 Subject: [PATCH 210/274] [I] Give custom QM buttons a title --- assets/plugins/qm/qm.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/plugins/qm/qm.inc.php b/assets/plugins/qm/qm.inc.php index b8fcd2b56f..d6b28604a0 100755 --- a/assets/plugins/qm/qm.inc.php +++ b/assets/plugins/qm/qm.inc.php @@ -429,7 +429,7 @@ function Run() { case 'new': $customButton = '
    • - '.$buttonTitle.' + '.$buttonTitle.'
    • '; break; @@ -437,7 +437,7 @@ function Run() { case 'link': $customButton = '
    • - '.$buttonTitle.' + '.$buttonTitle.'
    • '; break; @@ -445,7 +445,7 @@ function Run() { case 'modal': $customButton = '
    • - '.$buttonTitle.' + '.$buttonTitle.'
    • '; break; From bd7237579bc0e351065567c8d1489ee2b1b827b3 Mon Sep 17 00:00:00 2001 From: Mr B Date: Sat, 12 May 2018 19:23:34 +0100 Subject: [PATCH 211/274] Update qm.inc.php --- assets/plugins/qm/qm.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/plugins/qm/qm.inc.php b/assets/plugins/qm/qm.inc.php index d6b28604a0..f9f7bc14e2 100755 --- a/assets/plugins/qm/qm.inc.php +++ b/assets/plugins/qm/qm.inc.php @@ -355,7 +355,7 @@ function Run() { $editButton = '
    • - '.$_lang['edit_resource'].' + '.$_lang['edit_resource'].'
    • '; From 99edc5fb524ebe7017a9299b394599a0307a5b4d Mon Sep 17 00:00:00 2001 From: Mr B Date: Mon, 14 May 2018 13:57:24 +0100 Subject: [PATCH 212/274] [F] Fix ios iframe scroll so only applied to ios --- manager/frames/1.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/manager/frames/1.php b/manager/frames/1.php index 34e3b0662b..a34aa16e55 100755 --- a/manager/frames/1.php +++ b/manager/frames/1.php @@ -426,13 +426,19 @@

      - +
      - +
      +
      From b5db4eff883a87565be60dc4975ad839389fd49d Mon Sep 17 00:00:00 2001 From: Mr B Date: Mon, 14 May 2018 14:00:06 +0100 Subject: [PATCH 213/274] Update modx.js --- manager/media/style/default/js/modx.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/media/style/default/js/modx.js b/manager/media/style/default/js/modx.js index 522f244626..5a14685675 100755 --- a/manager/media/style/default/js/modx.js +++ b/manager/media/style/default/js/modx.js @@ -1544,7 +1544,7 @@ this.page = d.createElement('div'); this.page.id = 'evo-tab-page-' + this.uid; this.page.className = 'evo-tab-page iframe-scroller show'; - this.page.innerHTML = ''; + this.page.innerHTML = ''; d.getElementById('main').appendChild(this.page); console.time('load-tab'); this.page.firstElementChild.onload = function(e) { From 80e5cf5a636ed79bc80d97f316e74788242e50e0 Mon Sep 17 00:00:00 2001 From: Mr B Date: Mon, 14 May 2018 14:00:46 +0100 Subject: [PATCH 214/274] Update modx.min.js --- manager/media/style/default/js/modx.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/media/style/default/js/modx.min.js b/manager/media/style/default/js/modx.min.js index 8eba0c3689..0da10ed91a 100755 --- a/manager/media/style/default/js/modx.min.js +++ b/manager/media/style/default/js/modx.min.js @@ -1 +1 @@ -(function($,w,d,u){'use strict';modx.extended({frameset:'frameset',minWidth:840,isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),typesactions:{'16':1,'301':2,'78':3,'22':4,'102':5,'108':6,'3':7,'4':7,'6':7,'27':7,'61':7,'62':7,'63':7,'72':7},thememodes:['','lightness','light','dark','darkness'],tabsTimer:0,popupTimer:0,init:function(){if(!localStorage.getItem('MODX_widthSideBar')){localStorage.setItem('MODX_widthSideBar',this.config.tree_width)}this.mainmenu.init();if(w.location.hash){if(modx.getActionFromUrl(w.location.hash,2)){w.history.replaceState(null,d.title,modx.MODX_MANAGER_URL)}else if(modx.getActionFromUrl(w.location.hash)||modx.main.getQueryVariable('filemanager',w.location.hash)){var url=modx.main.getQueryVariable('filemanager',w.location.hash)?modx.MODX_MANAGER_URL+modx.main.getQueryVariable('filemanager',w.location.hash)+w.location.hash.replace('#?','?'):w.location.href.replace('#?','?');if(modx.config.global_tabs){modx.tabs({url:url,title:'blank'})}else if(w.main){w.main.frameElement.src=url}else{modx.openWindow(url)}}}this.resizer.init();this.search.init();if(this.config.session_timeout>0){w.setInterval(this.keepMeAlive,1000*60*this.config.session_timeout)}if(modx.config.mail_check_timeperiod>0&&modx.permission.messages){setTimeout('modx.updateMail(true)',1000)}d.addEventListener('click',this.hideDropDown,false);if(modx.config.global_tabs){d.addEventListener('click',this.tabs,false);this.tabs({url:'?a=2',reload:0})}},mainmenu:{id:'mainMenu',init:function(){var $mm=$('#mainMenu'),mm=d.getElementById('mainMenu'),timer;$mm.on('click','a',function(e){if($(this).hasClass('dropdown-toggle')){if($mm.hasClass('show')&&($(this).hasClass('selected')||!modx.isMobile&&$(this).parent().hasClass('hover'))){$(this).removeClass('selected');$mm.removeClass('show')}else{$('.nav > li > a:not(:hover)').removeClass('selected');$(this).addClass('selected');$mm.addClass('show')}e.stopPropagation();e.target.dataset.toggle='#mainMenu';modx.hideDropDown(e)}if($(this).closest('ul').hasClass('dropdown-menu')&&!$(this).parent('li').hasClass('dropdown-back')){$('.nav > .active').removeClass('active');$('.nav li.selected').removeClass('selected');$(this).closest('.nav > li').addClass('active');if(this.offsetParent.id){d.getElementById(this.offsetParent.id.substr(7)).classList.add('selected')}if((modx.isMobile||w.innerWidth li',function(){var els=mm.querySelectorAll('.nav > li.hover:not(:hover)');for(var i=0;i li li',function(e){var self=this,ul;var els=mm.querySelectorAll('.nav > li li.hover:not(:hover)');for(var i=0;i'+modx.lang.paging_prev+''+data}ul.id='parent_'+self.id;ul.innerHTML=data;var id=w.location.hash.substr(2).replace(/=/g,'_').replace(/&/g,'__');var el=d.getElementById(id);if(el){el.parentNode.classList.add('selected');d.getElementById(el.parentNode.parentNode.id.substr(7)).classList.add('selected')}for(var i=0;iitems.length-1){index=items.length-1}if(index>=0&&index2){s.timer=setTimeout(function(){s.loader.style.display='block';modx.get(modx.MODX_MANAGER_URL+'?a=71&ajax=1&submitok=Search&searchid='+s.input.value,function(data){s.loader.style.display='none';s.results=data.querySelector('.ajaxSearchResults');if(s.results&&s.results.innerHTML!==''){s.result.innerHTML=s.results.outerHTML;s.open();s.result.onclick=function(e){var t=e.target,p=t.parentNode;if(t.tagName==='I'){modx.openWindow({title:p.innerText,id:p.id,url:p.href});e.preventDefault();e.stopPropagation()}else{var a=t.tagName==='A'&&t||p.tagName==='A'&&p;if(a){var el=s.result.querySelector('.selected');if(el)el.className='';a.className='selected';if(modx.isMobile)s.close()}}}}else{s.empty()}},'document')},300)}else{s.empty()}};if(modx.isMobile){this.input.onblur=this.close}this.input.onfocus=this.open;this.input.onclick=this.open;this.input.onmouseenter=this.open;this.result.onmouseenter=this.open;this.result.onmouseleave=this.close;this.mask.onmouseenter=this.open;this.mask.onmouseleave=this.close},open:function(){if(modx.search.results){modx.search.result.classList.add('open')}},close:function(){modx.search.result.classList.remove('open')},empty:function(){modx.search.result.classList.remove('open');modx.search.result.innerHTML=''}},main:{id:'main',idFrame:'mainframe',as:null,onload:function(e){w.main=e.target.contentWindow||e.target.defaultView;modx.main.tabRow.init();modx.main.stopWork();modx.main.scrollWork();w.main.document.addEventListener('click',modx.hideDropDown,false);w.main.document.addEventListener('contextmenu',modx.main.oncontextmenu,false);if(modx.config.global_tabs){w.main.document.addEventListener('click',modx.tabs,false)}w.history.replaceState(null,d.title,modx.getActionFromUrl(w.main.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.main.location.search);setTimeout('modx.tree.restoreTree()',100)},oncontextmenu:function(e){if(e.ctrlKey)return;var el=e.target;if(modx.user.role===1&&/modxtv|modxplaceholder|modxattributevalue|modxchunk|modxsnippet|modxsnippetnocache/i.test(el.className)){var id=Date.now(),name=el.innerText.replace(/[\[|\]|{|}|\*||\#|\+|?|\!|&|=|`|:]/g,''),type=el.className.replace(/cm-modx/,''),n=!!name.replace(/^\d+$/,'');if(name&&n){e.preventDefault();modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',{a:'modxTagHelper',name:name,type:type},function(r){if(r){r=JSON.parse(r);for(var k in r){if(r.hasOwnProperty(k)&&r[k].url){r[k]['onclick']='if(event.shiftKey){modx.openWindow({url:\''+r[k].url+'\'})}else{modx.popup({url:\''+r[k].url+'\',title:\''+r.header.innerHTML+'\',width:\'95%\',height:\'95%\',margin:0,hide:0,hover:0,overlay:1,overlayclose:0,position:\'center elements\',animation:0,icon:\'none\'})}'}}r=JSON.stringify(r);el.id='node'+id;el.dataset.contextmenu=r;modx.tree.showPopup(e,id,name)}})}e.preventDefault()}},tabRow:{init:function(){var row=w.main.document.querySelector('.tab-pane > .tab-row');if(row)this.build(row)},build:function(row){var rowContainer=d.createElement('div'),sel=row.querySelector('.selected');rowContainer.className='tab-row-container';row.parentNode.insertBefore(rowContainer,row);rowContainer.appendChild(row);var p=d.createElement('i');p.className='fa fa-angle-left prev disable';p.onclick=function(e){e.stopPropagation();e.preventDefault();var sel=row.querySelector('.selected');if(sel.previousSibling){sel.previousSibling.click();modx.main.tabRow.scroll(row)}};rowContainer.appendChild(p);var n=d.createElement('i');n.className='fa fa-angle-right next disable';n.onclick=function(e){e.stopPropagation();e.preventDefault();var sel=row.querySelector('.selected');if(sel.nextSibling){sel.nextSibling.click();modx.main.tabRow.scroll(row)}};rowContainer.appendChild(n);setTimeout(function(){sel=row.querySelector('.selected');modx.main.tabRow.scroll(row,sel);w.main.addEventListener('resize',function(){modx.main.tabRow.scroll(row)},false);if(sel){if(sel.previousSibling)p.classList.remove('disable');if(sel.nextSibling)n.classList.remove('disable')}},100);row.onclick=function(e){var sel=e.target.tagName==='H2'?e.target:e.target.tagName==='SPAN'?e.target.parentNode:null;if(sel){if(sel.previousSibling){this.parentNode.querySelector('i.prev').classList.remove('disable')}else{this.parentNode.querySelector('i.prev').classList.add('disable')}if(sel.nextSibling){this.parentNode.querySelector('i.next').classList.remove('disable')}else{this.parentNode.querySelector('i.next').classList.add('disable')}modx.main.tabRow.scroll(this,sel)}}},scroll:function(row,sel,a){sel=sel||row.querySelector('.selected')||row.firstChild;a=a||100;var c=0,elms=row.childNodes;for(var i=0;isel.offsetLeft){$(row).animate({scrollLeft:sel.offsetLeft-(sel.previousSibling?30:1)},a)}if(sel.offsetLeft+sel.offsetWidth>row.offsetWidth+row.scrollLeft){$(row).animate({scrollLeft:sel.offsetLeft-row.offsetWidth+sel.offsetWidth+(sel.nextSibling?30:0)},a)}if(c>row.offsetWidth){this.drag(row)}},drag:function(row){row.onmousedown=function(e){if(e.button===0){e.preventDefault();var x=e.clientX,f=row.scrollLeft;row.ownerDocument.body.focus();row.onmousemove=row.ownerDocument.onmousemove=function(e){if(Math.abs(e.clientX-x)>5){e.stopPropagation();row.scrollLeft=f-(e.clientX-x);row.ownerDocument.body.classList.add('drag')}};row.onmouseup=row.ownerDocument.onmouseup=function(e){e.stopPropagation();row.onmousemove=null;row.ownerDocument.onmousemove=null;row.ownerDocument.body.classList.remove('drag')}}}}},work:function(){d.getElementById('mainloader').classList.add('show')},stopWork:function(){d.getElementById('mainloader').classList.remove('show')},scrollWork:function(){var a=w.main.frameElement.contentWindow,b=a.location.search.substring(1)||a.location.hash.substring(2),c=localStorage.getItem('page_y')||0,f=localStorage.getItem('page_url')||b;if(((modx.getActionFromUrl(f)===modx.getActionFromUrl(b))&&(modx.main.getQueryVariable('id',f)&&modx.main.getQueryVariable('id',f)===modx.main.getQueryVariable('id',b)))||(f===b)){a.scrollTo(0,c)}a.addEventListener('scroll',function(){if(this.pageYOffset>=0){localStorage.setItem('page_y',this.pageYOffset.toString());localStorage.setItem('page_url',b)}},false)},getQueryVariable:function(a,b){var f='';if(b||typeof b==='string'){b=b.split('?');b=b[1]||b[0];b=b.split('&');for(var i=0;iMath.abs(ay)&&this.swipe){if(ax<0&&this.sidebar){if(Math.abs(ax)>h)ax=-h;tree.style.transform='translate3d('+ax+'px, 0, 0)';tree.style.WebkitTransform='translate3d('+ax+'px, 0, 0)';modx.resizer.mask.style.opacity=(0.5-0.5/-h*ax).toFixed(2);if(Math.abs(ax)>h/3){this.swipe='left'}else{this.swipe='right'}}else if(ax>0&&!this.sidebar){if(Math.abs(ax)>h)ax=h;tree.style.transform='translate3d('+ -(h-ax)+'px, 0, 0)';tree.style.WebkitTransform='translate3d('+ -(h-ax)+'px, 0, 0)';modx.resizer.mask.style.opacity=(0.5/h*ax).toFixed(2);if(Math.abs(ax)>h/3){this.swipe='right'}else{this.swipe='left'}}}},false);w.addEventListener('touchend',function(){if(this.swipe==='left'){d.body.classList.add('sidebar-closed');modx.resizer.setWidth(0)}if(this.swipe==='right'){d.body.classList.remove('sidebar-closed');modx.resizer.setWidth(h)}tree.style.cssText='';modx.resizer.mask.style.cssText=''},false)}},onMouseDown:function(e){e=e||w.event;modx.resizer.dragElement=e.target!==null?e.target:e.srcElement;if((e.buttons===1||e.button===0)&&modx.resizer.dragElement.id===modx.resizer.id){modx.resizer.oldZIndex=modx.resizer.dragElement.style.zIndex;modx.resizer.dragElement.style.zIndex=modx.resizer.newZIndex;modx.resizer.dragElement.style.background=modx.resizer.background;localStorage.setItem('MODX_widthSideBar',modx.resizer.dragElement.offsetLeft>0?modx.resizer.dragElement.offsetLeft:0);d.body.appendChild(modx.resizer.mask);d.onmousemove=modx.resizer.onMouseMove;d.body.focus();d.body.classList.add('resizer_move');d.onselectstart=function(){return false};modx.resizer.dragElement.ondragstart=function(){return false};return false}},onMouseMove:function(e){e=e||w.event;if(e.clientX>0){modx.resizer.left=e.clientX}else{modx.resizer.left=0}modx.resizer.dragElement.style.left=modx.pxToRem(modx.resizer.left)+'rem';d.getElementById('tree').style.width=modx.pxToRem(modx.resizer.left)+'rem';d.getElementById('main').style.left=modx.pxToRem(modx.resizer.left)+'rem';if(e.clientX<-2||e.clientY<-2){modx.resizer.onMouseUp(e)}},onMouseUp:function(e){if(modx.resizer.dragElement!==null&&e.button===0&&modx.resizer.dragElement.id===modx.resizer.id){if(e.clientX>0){d.body.classList.remove('sidebar-closed');modx.resizer.left=e.clientX}else{d.body.classList.add('sidebar-closed');modx.resizer.left=0}d.cookie='MODX_widthSideBar='+modx.pxToRem(modx.resizer.left);modx.resizer.dragElement.style.zIndex=modx.resizer.oldZIndex;modx.resizer.dragElement.style.background='';modx.resizer.dragElement.ondragstart=null;modx.resizer.dragElement=null;d.body.classList.remove('resizer_move');d.body.removeChild(modx.resizer.mask);d.onmousemove=null;d.onselectstart=null}},toggle:function(){if(modx.isMobile||w.innerWidth<=modx.minWidth){if(d.body.classList.contains('sidebar-closed')){d.body.classList.remove('sidebar-closed');localStorage.setItem('MODX_widthSideBar',0);d.cookie='MODX_widthSideBar='+modx.pxToRem(parseInt(d.getElementById('tree').offsetWidth))}else{localStorage.setItem('MODX_widthSideBar',parseInt(d.getElementById('tree').offsetWidth));d.body.classList.add('sidebar-closed');d.cookie='MODX_widthSideBar=0'}}else{var p=d.getElementById('tree').offsetWidth!==0?0:parseInt(localStorage.getItem('MODX_widthSideBar'))?parseInt(localStorage.getItem('MODX_widthSideBar')):modx.config.tree_width;modx.resizer.setWidth(p)}},setWidth:function(a){if(a>0){localStorage.setItem('MODX_widthSideBar',0);d.body.classList.remove('sidebar-closed')}else{localStorage.setItem('MODX_widthSideBar',parseInt(d.getElementById('tree').offsetWidth));d.body.classList.add('sidebar-closed')}d.cookie='MODX_widthSideBar='+modx.pxToRem(a);d.getElementById('tree').style.width=modx.pxToRem(a)+'rem';d.getElementById('resizer').style.left=modx.pxToRem(a)+'rem';d.getElementById('main').style.left=modx.pxToRem(a)+'rem'},setDefaultWidth:function(){modx.resizer.setWidth(modx.remToPx(modx.config.tree_width))}},tree:{ctx:null,rpcNode:null,itemToChange:'',selectedObjectName:null,selectedObject:0,selectedObjectDeleted:0,selectedObjectUrl:'',drag:false,deleted:[],init:function(){this.restoreTree()},draggable:function(){if(modx.permission.dragndropdocintree){var els=d.querySelectorAll('#treeRoot a:not(.empty)');for(var i=0;i-1:true;modx.tree.itemToChange=this.dataset.id||this.parentNode.id.replace('node','');modx.tree.selectedObjectName=this.dataset.titleEsc;if(draggable){this.parentNode.draggable=true;this.parentNode.ondragstart=modx.tree.ondragstart}else{this.parentNode.draggable=false;this.parentNode.ondragstart=function(){return false}}}},ondragstart:function(e){e.dataTransfer.effectAllowed='all';e.dataTransfer.dropEffect='all';e.dataTransfer.setData('text',this.id.substr(4))},ondragenter:function(e){if(d.getElementById('node'+modx.tree.itemToChange)===(this.parentNode.closest('#node'+modx.tree.itemToChange)||this.parentNode)){this.parentNode.className='';e.dataTransfer.effectAllowed='none';e.dataTransfer.dropEffect='none';modx.tree.drag=false}else{this.parentNode.className='dragenter';e.dataTransfer.effectAllowed='copy';e.dataTransfer.dropEffect='copy';modx.tree.drag=true}e.preventDefault()},ondragover:function(e){if(modx.tree.drag){var a=e.clientY;var b=parseInt(this.getBoundingClientRect().top);var c=a-b;if(c>this.offsetHeight/1.51){this.parentNode.classList.add('dragafter');this.parentNode.classList.remove('dragbefore');this.parentNode.classList.remove('dragenter');e.dataTransfer.effectAllowed='link';e.dataTransfer.dropEffect='link'}else if(c'}if(this.nextSibling){if(this.nextSibling.innerHTML){this.nextSibling.appendChild(el)}else{el.parentNode.removeChild(el)}els=this.parentNode.lastChild.children;for(i=0;i'}this.parentNode.parentNode.insertBefore(el,this.parentNode.nextSibling);els=this.parentNode.parentNode.children;for(i=0;i'}this.parentNode.parentNode.insertBefore(el,this.parentNode);els=this.parentNode.parentNode.children;for(i=0;i-1:true)){alert(modx.lang.error_no_privileges);modx.tree.restoreTree();return}modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',{a:'movedocument',id:id,parent:parent,menuindex:menuindex},function(r){if(r.errors)alert(r.errors);modx.tree.restoreTree()},'json');var b=w.main.frameElement.contentWindow.location.search.substr(1);if(modx.getActionFromUrl(b,27)&&parseInt(modx.main.getQueryVariable('id',b))===parseInt(id)){var index=menuindex.indexOf(id),elMenuIndex=w.main.document.querySelector('#documentPane input[name=menuindex]'),elParent=w.main.document.querySelector('#documentPane input[name=parent]'),elParentName=w.main.document.querySelector('#documentPane #parentName');if(elMenuIndex&&index>=0)elMenuIndex.value=index;if(elParent&&elParentName){elParent.value=parent;elParentName.innerHTML=parent+' ('+d.querySelector('#node'+parent+' > a').dataset.titleEsc+')'}}},toggleTheme:function(){var a,b=1,myCodeMirrors=w.main.myCodeMirrors,key;if(typeof localStorage['MODX_themeMode']==='undefined'){localStorage['MODX_themeMode']=modx.config.theme_mode}if(modx.thememodes[parseInt(localStorage['MODX_themeMode'])+1]){b=parseInt(localStorage['MODX_themeMode'])+1}a=modx.thememodes[b];for(key in modx.thememodes){if(modx.thememodes[key]){d.body.classList.remove(modx.thememodes[key]);w.main.document.body.classList.remove(modx.thememodes[key])}}d.body.classList.add(a);w.main.document.body.classList.add(a);d.cookie='MODX_themeMode='+b;localStorage['MODX_themeMode']=b;if(typeof myCodeMirrors!=='undefined'){for(key in myCodeMirrors){if(myCodeMirrors.hasOwnProperty(key)){if(~a.indexOf('dark')){w.main.document.getElementsByName(key)[0].nextElementSibling.classList.add('cm-s-'+myCodeMirrors[key].options.darktheme);w.main.document.getElementsByName(key)[0].nextElementSibling.classList.remove('cm-s-'+myCodeMirrors[key].options.defaulttheme)}else{w.main.document.getElementsByName(key)[0].nextElementSibling.classList.remove('cm-s-'+myCodeMirrors[key].options.darktheme);w.main.document.getElementsByName(key)[0].nextElementSibling.classList.add('cm-s-'+myCodeMirrors[key].options.defaulttheme)}}}}},toggleNode:function(e,id){e=e||w.event;if(e.ctrlKey)return;e.stopPropagation();var el=d.getElementById('node'+id).firstChild;this.rpcNode=el.nextSibling;var toggle=el.querySelector('.toggle'),icon=el.querySelector('.icon');if(this.rpcNode.innerHTML===''){if(toggle)toggle.innerHTML=el.dataset.iconCollapsed;icon.innerHTML=el.dataset.iconFolderOpen;var rpcNodeText=this.rpcNode.innerHTML,loadText=modx.lang.loading_doc_tree;modx.openedArray[id]=1;if(rpcNodeText===''||rpcNodeText.indexOf(loadText)>0){var folderState=this.getFolderState();d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent='+el.dataset.indent+'&parent='+id+'&expandAll='+el.dataset.expandall+folderState,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})}this.saveFolderState()}else{if(toggle)toggle.innerHTML=el.dataset.iconExpanded;icon.innerHTML=el.dataset.iconFolderClose;delete modx.openedArray[id];this.rpcNode.style.overflow='hidden';$(this.rpcNode.firstChild).animate({marginTop:-this.rpcNode.offsetHeight+'px'},100,function(){this.parentNode.innerHTML=''});this.saveFolderState()}e.preventDefault()},rpcLoadData:function(a){if(this.rpcNode!==null){var el;this.rpcNode.innerHTML=typeof a==='object'?a.responseText:a;this.rpcNode.loaded=true;if(this.rpcNode.firstChild.tagName==='DIV'){if(this.rpcNode.id==='treeRoot'){el=d.getElementById('binFull');if(el){this.showBin(true)}else{this.showBin(false)}}else{this.rpcNode.style.overflow='hidden';this.rpcNode.firstElementChild.style.marginTop=-this.rpcNode.offsetHeight+'px';$(this.rpcNode.firstChild).animate({marginTop:0},100)}d.getElementById('treeloader').classList.remove('visible')}else{el=d.getElementById('loginfrm');if(el){this.rpcNode.parentNode.removeChild(this.rpcNode);w.location.href=modx.MODX_MANAGER_URL}}}},treeAction:function(e,id,title){if(e.ctrlKey)return;var el=d.getElementById('node'+id).firstChild,treepageclick=el.dataset.treepageclick,showchildren=parseInt(el.dataset.showchildren),openfolder=parseInt(el.dataset.openfolder);title=title||el.dataset&&el.dataset.titleEsc;if(tree.ca==='move'){try{this.setSelectedByContext(id);w.main.setMoveValue(id,title)}catch(oException){alert(modx.lang.unable_set_parent)}}if(tree.ca==='open'||tree.ca===''){if(id===0){href='?a=2'}else{var href='';if(!isNaN(treepageclick)&&isFinite(treepageclick)){href='?a='+treepageclick+'&r=1&id='+id+(openfolder===0?this.getFolderState():'')}else{href=treepageclick}if(openfolder===2){if(showchildren!==1){href=''}this.toggleNode(e,id)}}if(href){if(e.shiftKey){w.getSelection().removeAllRanges();modx.openWindow(href);this.restoreTree()}else{modx.tabs({url:modx.MODX_MANAGER_URL+href,title:title+'('+id+')'});if(modx.isMobile&&w.innerWidth0?e.clientX:e.pageX;y=e.clientY>0?e.clientY:e.pageY;e.view.position=e.view.frameElement?e.view.frameElement.getBoundingClientRect():e.target.offsetParent.getBoundingClientRect();if(e.view.frameElement){x+=e.view.position.left;y+=e.view.frameElement.offsetParent.offsetTop}else{if(e.target.parentNode.parentNode.classList.contains('node')){x+=50}}if(x>e.view.position.width){x=e.view.position.width-this.ctx.offsetWidth}if(y+this.ctx.offsetHeight/2>e.view.position.height){y=e.view.position.height-this.ctx.offsetHeight-5}else if(y-this.ctx.offsetHeight/20?e.clientX:e.pageX;y=e.clientY>0?e.clientY:e.pageY;if(y+ctx.offsetHeight/2>bodyHeight){y=bodyHeight-ctx.offsetHeight-5}else if(y-ctx.offsetHeight/230){this.selectedObjectName=this.selectedObjectName.substr(0,30)+'...'}var f=d.getElementById('nameHolder');f.innerHTML=this.selectedObjectName;el.style.left=a+(modx.config.textdir?'-190':'')+'px';el.style.top=b+'px';el.classList.add('show')},menuHandler:function(a){switch(a){case 1:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=3&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 2:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=27&r=1&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 3:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=4&pid='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 4:if(this.selectedObjectDeleted){alert('"'+this.selectedObjectName+'" '+modx.lang.already_deleted)}else if(confirm('"'+this.selectedObjectName+'"\n\n'+modx.lang.confirm_delete_resource)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=6&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 5:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=51&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 6:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=72&pid='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 7:if(confirm(modx.lang.confirm_resource_duplicate)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=94&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 8:if(d.getElementById('node'+this.itemToChange).firstChild.dataset.deleted){if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_undelete)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=63&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}}else{alert('"'+this.selectedObjectName+'"'+modx.lang.not_deleted)}break;case 9:if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_publish)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=61&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 10:if(this.itemToChange!==modx.config.site_start){if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_unpublish)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=62&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}}else{alert('Document is linked to site_start variable and cannot be unpublished!')}break;case 11:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=56&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 12:w.open(d.getElementById('node'+this.itemToChange).firstChild.dataset.href,'previeWin');break;default:alert('Unknown operation command.')}},setSelected:function(a){var el=d.querySelector('#tree .current');if(el)el.classList.remove('current');if(a){if(typeof a==='object'){a.classList.add('current')}else{el=d.querySelector('#node'+a+'>.node')||d.getElementById('node'+a);if(el)el.classList.add('current')}}},setActiveFromContextMenu:function(a){var el=d.querySelector('#node'+a+'>.node');if(el)this.setSelected(el)},setSelectedByContext:function(a){var el=d.querySelector('#treeRoot .selected');if(el)el.classList.remove('selected');el=d.querySelector('#node'+a+'>.node');if(el)el.classList.add('selected')},setItemToChange:function(){var a=w.main.document&&(w.main.document.URL||w.main.document.location.search),b=modx.getActionFromUrl(a);if(a&&modx.typesactions[b]){this.itemToChange=(modx.typesactions[b]===7?'':modx.typesactions[b]+'_')+parseInt(modx.main.getQueryVariable('id',a))}else{this.itemToChange=''}this.setSelected(this.itemToChange)},restoreTree:function(){if(d.getElementById('treeRoot')){d.getElementById('treeloader').classList.add('visible');this.setItemToChange();this.rpcNode=d.getElementById('treeRoot');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=2&id='+this.itemToChange,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})}},expandTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=1&id='+this.itemToChange,function(r){modx.tree.rpcLoadData(r);modx.tree.saveFolderState();modx.tree.draggable()})},collapseTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=0&id='+this.itemToChange,function(r){modx.openedArray=[];modx.tree.saveFolderState();modx.tree.rpcLoadData(r);modx.tree.draggable()})},updateTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');var a=d.sortFrm;var b='a=1&f=nodes&indent=1&parent=0&expandAll=2&dt='+a.dt.value+'&tree_sortby='+a.sortby.value+'&tree_sortdir='+a.sortdir.value+'&tree_nodename='+a.nodename.value+'&id='+this.itemToChange+'&showonlyfolders='+a.showonlyfolders.value;modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',b,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})},getFolderState:function(){var a;if(modx.openedArray!==[0]){a='&opened=';for(var key in modx.openedArray){if(modx.openedArray[key]){a+=key+'|'}}}else{a='&opened='}return a},saveFolderState:function(){modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&savestateonly=1'+this.getFolderState())},showSorter:function(e){e=e||w.event;var el=d.getElementById('floater');e.target.dataset.toggle='#floater';el.classList.toggle('show');el.onclick=function(e){e.stopPropagation()}},emptyTrash:function(){if(confirm(modx.lang.confirm_empty_trash)===true){modx.get(modx.MODX_MANAGER_URL+'?a=64',function(){modx.tabsClose(modx.tree.deleted);modx.tree.deleted=[];modx.tree.restoreTree()})}},showBin:function(a){var el=d.getElementById('treeMenu_emptytrash');if(el){if(a){el.title=modx.lang.empty_recycle_bin;el.classList.remove('disabled');el.innerHTML=modx.style.empty_recycle_bin;el.onclick=function(){modx.tree.emptyTrash()};var els=d.getElementById('tree').querySelectorAll('.deleted');for(var i=0;i0){if(el){el.innerHTML=c[0];el.style.display='block'}}else{if(el)el.style.display='none'}if(c[1]>0){el=d.getElementById('newMail');if(el){el.innerHTML=''+modx.style.email+modx.lang.inbox+' ('+c[0]+' / '+c[1]+')';el.style.display='block'}}if(modx.config.mail_check_timeperiod>0)setTimeout('modx.updateMail(true)',1000*modx.config.mail_check_timeperiod)})}}catch(oException){setTimeout('modx.updateMail(true)',1000*modx.config.mail_check_timeperiod)}},openWindow:function(a){if(typeof a!=='object'){a={'url':a}}if(!a.width)a.width=parseInt(w.innerWidth*0.9)+'px';if(!a.height)a.height=parseInt(w.innerHeight*0.8)+'px';if(!a.left)a.left=parseInt(w.innerWidth*0.05)+'px';if(!a.top)a.top=parseInt(w.innerHeight*0.1)+'px';if(!a.title)a.title=Math.floor((Math.random()*999999)+1);if(a.url){if(this.plugins.EVOmodal===1){top.EVO.modal.show(a)}else{w.open(a.url,a.title,'width='+a.width+',height='+a.height+',top='+a.top+',left='+a.left+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no')}}},tabsClose:function(a){if(modx.config.global_tabs&&a){for(var k in a){if(a.hasOwnProperty(k)){var el=d.getElementById(a[k]);if(el){el.firstElementChild.contentWindow.documentDirty=false;el.close()}}}}},tabs:function(a){function Tabs(a){var s=this;this.url=a.url;this.title=a.title||'';this.name=a.name||'';this.timer=null;this.olduid='';this.closeactions=[6,61,62,63,94];this.reload=typeof a.reload!=='undefined'?a.reload:1;this.action=modx.getActionFromUrl(a.url);this.uid=modx.getActionFromUrl(a.url,2)?'home':modx.urlToUid(a.url);this.page=d.getElementById('evo-tab-page-'+this.uid);this.row=d.getElementsByClassName('evo-tab-row')[0].firstElementChild;this.tab=d.getElementById('evo-tab-'+this.uid);if(this.page){if(this.uid==='home'){if(this.reload){this.page.firstElementChild.src=this.url;this.show()}else{this.reload=1;if(this.tab.onclick===null){this.tab.onclick=function(e){s.select.call(s,e,this)}}this.tab.show=function(e){s.show.call(s,e)};modx.tabs.selected=this.tab}}else{this.show();if(~this.closeactions.indexOf(this.action)){this.setDocPublished();modx.get(this.url,function(){modx.tree.restoreTree()})}}}else if(~this.closeactions.indexOf(this.action)){modx.get(this.url,function(){modx.tree.restoreTree()})}else{this.create()}}Tabs.prototype={create:function(){var s=this;modx.main.work();modx.tabs.selected=this.row.querySelector('.selected');if(modx.tabs.selected){d.getElementById(modx.tabs.selected.id.replace('tab','tab-page')).classList.remove('show');modx.tabs.selected.classList.remove('selected')}this.page=d.createElement('div');this.page.id='evo-tab-page-'+this.uid;this.page.className='evo-tab-page iframe-scroller show';this.page.innerHTML='';d.getElementById('main').appendChild(this.page);console.time('load-tab');this.page.firstElementChild.onload=function(e){s.onload.call(s,e);console.timeEnd('load-tab')};this.tab=d.createElement('h2');this.tab.id='evo-tab-'+this.uid;this.tab.className='tab selected';this.icon='';if(!/'}this.tab.innerHTML=''+this.icon+this.title+'×';this.row.appendChild(this.tab);this.tab.onclick=function(e){s.select.call(s,e,this)};this.tab.close=function(e){s.close.call(s,e)};this.tab.show=function(e){s.show.call(s,e)};this.page.close=function(e){s.close.call(s,e)}},onload:function(e){var s=this;w.main=e.target.contentWindow||e.target.defaultView;this.url=w.main.location.search||w.location.hash.substring(1);this.olduid=this.uid;this.uid=modx.urlToUid(this.url);if(!!w.main.__alertQuit){w.main.alert=function(a){};var message=w.main.document.body.innerHTML;w.main.document.body.innerHTML='';history.pushState(null,d.title,modx.getActionFromUrl(w.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.location.search);w.onpopstate=function(){history.go(1)};modx.popup({type:'warning',title:'MODX :: Alert',position:'top center alertQuit',content:message,wrap:'body'});modx.getLockedElements(modx.getActionFromUrl(this.url),modx.main.getQueryVariable('id',this.url),function(data){if(!!data){s.page.close();modx.tree.restoreTree()}else{w.main.location.href=modx.MODX_MANAGER_URL+s.url;w.history.replaceState(null,d.title,modx.getActionFromUrl(s.url,2)?modx.MODX_MANAGER_URL:'#'+s.url)}})}else{if(modx.getActionFromUrl(this.url,2)){this.close(e)}else if(this.olduid!==this.uid&&d.getElementById('evo-tab-'+this.uid)){this.close(e);d.getElementById('evo-tab-'+this.uid).show()}else{this.title=w.main.document.body.querySelectorAll('h1')[0]&&w.main.document.body.querySelectorAll('h1')[0].innerHTML||this.title;if(this.title&&this.uid!=='home'){this.tab.innerHTML=''+this.title+'×'}this.page.id='evo-tab-page-'+this.uid;this.tab.id='evo-tab-'+this.uid;this.tab.classList.remove('changed');this.show();modx.main.onload(e);w.main.document.addEventListener('click',function a(e){if(typeof e.view.documentDirty!=='undefined'&&e.view.documentDirty&&!s.tab.classList.contains('changed')){s.tab.classList.add('changed');this.removeEventListener(e.type,a,false)}},false);w.main.document.addEventListener('keyup',function a(e){if(typeof e.view.documentDirty!=='undefined'&&e.view.documentDirty&&!s.tab.classList.contains('changed')){s.tab.classList.add('changed');this.removeEventListener(e.type,a,false)}},false)}}},show:function(){var s=this;modx.tabs.selected=this.row.querySelector('.selected');if(modx.tabs.selected&&modx.tabs.selected!==this.tab){d.getElementById(modx.tabs.selected.id.replace('tab','tab-page')).classList.remove('show');modx.tabs.selected.classList.remove('selected')}this.page.classList.add('show');this.tab.classList.add('selected');modx.tabs.selected=this.tab;w.main=this.page.firstElementChild.contentWindow;w.history.replaceState(null,w.main.document.title,modx.getActionFromUrl(w.main.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.main.location.search);modx.tree.setItemToChange();modx.main.tabRow.scroll(this.row,this.tab,350)},close:function(e){var documentDirty=this.page.firstElementChild.contentWindow.documentDirty;var checkDirt=!!this.page.firstElementChild.contentWindow.checkDirt;if(documentDirty&&checkDirt&&confirm(this.page.firstElementChild.contentWindow.checkDirt(e))||!documentDirty){modx.tabs.selected=this.tab.classList.contains('selected')?this.tab.previousElementSibling:this.row.querySelector('.selected');this.page.parentNode.removeChild(this.page);this.row.removeChild(this.tab);modx.tabs.selected.show()}},select:function(e){if(e.target.className==='tab-close'){this.close(e)}else if(modx.tabs.selected===this.tab){var s=this;if(this.timer){clearTimeout(this.timer);this.timer=null;w.main.location.reload()}else{this.timer=setTimeout(function(){s.timer=null},250)}}else{this.show()}},setDocPublished:function(){var el=w.main.document.getElementsByName('publishedcheck')[0];if(el){el.checked=this.action===61;w.main.document.getElementsByName('published')[0].value=+el.checked}if(modx.getActionFromUrl(w.main.location.search,3)){w.main.location.reload()}}};if(modx.config.global_tabs){if(typeof a.currentTarget!=='undefined'){var e=a;if(e.button===0&&e.target&&(e.target.tagName==='A'&&e.target.target==='main'||(e.target.parentNode&&e.target.parentNode.tagName==='A'&&e.target.parentNode.target==='main'))){a=e.target.tagName==='A'&&e.target||e.target.parentNode.tagName==='A'&&e.target.parentNode;if(e.shiftKey){modx.openWindow({url:a.href})}else{modx.tabs({url:a.href,title:a.innerHTML})}e.preventDefault()}}else{return new Tabs(a)}}else if(a.url){if(w.main){w.main.frameElement.src=a.url}else{modx.openWindow(a.url)}}},popup:function(a){if(typeof a==='object'&&(a.url||a.content||a.text)){var o={addclass:'',animation:'fade',content:a.content||a.text||'',clickclose:0,closeall:0,data:'',dataType:'document',delay:5000,draggable:!1,event:null,height:'auto',hide:1,hover:1,icon:'',iframe:'iframe',margin:'.5rem',maxheight:'',method:'GET',overlay:0,overlayclose:0,position:'center',resize:!1,selector:'',showclose:1,target:'main',uid:'',type:'default',title:'',url:'',width:'20rem',wrap:w.main.document.body,zIndex:10500,w:null,show:function(){if(~o.position.indexOf('center')){if(o.event){o.el.style.left=o.event.clientX+o.mt+'px';o.el.style.bottom=o.w.innerHeight-o.el.offsetHeight-o.event.clientY+o.mt+'px'}else{o.el.style.left=/(%)/.test(o.width)?(100-parseInt(o.width))/2-o.mt/(o.w.innerWidth/100)+'%':(o.w.innerWidth-o.el.offsetWidth)/2-o.mt+'px';o.el.style.bottom=/(%)/.test(o.height)?(100-parseInt(o.height))/2-o.mt/(o.w.innerHeight/100)+'%':(o.w.innerHeight-o.el.offsetHeight-o.wrap.offsetTop)/2-o.mt+'px'}}if(~o.position.indexOf('left')){o.el.style.left=0}if(~o.position.indexOf('right')){o.el.style.right=0}else{o.el.style.right='auto'}if(~o.position.indexOf('top')){o.el.style.top=0;o.el.style.bottom=''}else{o.el.style.top='auto'}if(~o.position.indexOf('bottom')){o.el.style.bottom=0}o.calc();o.el.className+=' in';if(o.showclose){o.el.querySelector('.close').onclick=o.close}if(o.hide){o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);o.close()},o.delay)}if(o.hover){o.el.onmouseenter=function(){clearTimeout(o.el.timer)};o.el.onmouseleave=o.close}if(o.overlayclose&&o.o){o.o.onclick=o.close}if(o.clickclose){o.el.onclick=o.close}if(o.draggable){modx.dragging(o.el,{wrap:o.wrap,resize:o.resize})}},close:function(e){o.event=e||o.event||w.event;if(o.url&&o.iframe==='iframe'){var els=o.wrap.ownerDocument.querySelectorAll('.'+o.className+'.in');if(els){var documentDirty=o.el.lastElementChild.firstElementChild.contentWindow.documentDirty;if(documentDirty&&confirm(o.el.lastElementChild.firstElementChild.contentWindow.checkDirt(o.event))||!documentDirty){o.el.classList.remove('in');if(!o.animation){o.el.classList.remove('show')}o.calc(1);if(o.o&&o.o.parentNode){o.o.parentNode.removeChild(o.o);o.wrap.style.overflow=''}o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);if(o.el.parentNode){o.el.parentNode.removeChild(o.el)}},200)}}}else{o.el.classList.remove('in');if(!o.animation){o.el.classList.remove('show')}o.calc(1);if(o.o&&o.o.parentNode){o.o.parentNode.removeChild(o.o);o.wrap.style.overflow=''}o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);if(o.el.parentNode){o.el.parentNode.removeChild(o.el)}},200)}if(typeof o.onclose==='function'){o.onclose(e,o.el)}},calc:function(f){var els=o.wrap.ownerDocument.querySelectorAll('.'+o.className+'.in[data-position="'+o.el.dataset.position+'"]');if(els&&els.length){o.els=[];for(var i=0;i×'}if(o.title){o.header=document.createElement('div');if(o.icon!=='none'){o.header.innerHTML+=''}o.header.innerHTML+=o.title;o.header.className='evo-popup-header';o.el.appendChild(o.header)}o.el.innerHTML+='
      ';o.wrap.appendChild(o.el);o.mt=parseFloat(getComputedStyle(o.el).marginTop);if(o.maxheight){o.maxheight=/(%)/.test(o.maxheight)?(o.w.innerHeight-o.el.offsetHeight-o.mt)/100*parseInt(o.maxheight):o.maxheight;o.el.lastChild.style.overflowY='auto';o.el.lastChild.style.maxHeight=o.maxheight+'px'}if(o.url){o.draggable=1;if(o.iframe==='iframe'){o.resize=1;o.uid=modx.urlToUid(a.url);o.el.className+=' '+o.addclass+' '+o.className+'-iframe';o.el.id='evo-popup-'+o.uid;d.getElementById('mainloader').className='show';o.frame=d.createElement('iframe');o.frame.width='100%';o.frame.height='100%';o.frame.frameBorder='0';o.frame.src=o.url;o.frame.onload=function(e){e.target.contentWindow.opener=o.w;a.url=e.target.contentWindow.location.href;o.uid=modx.urlToUid(a.url);o.event=e;if(!!e.target.contentWindow.__alertQuit){modx.popup({type:'warning',title:'MODX :: Alert',position:'top center alertQuit',content:e.target.contentWindow.document.body.querySelector('p').innerHTML});e.target.contentWindow.document.body.innerHTML='';e.target.contentWindow.alert=function(){}}else{if(modx.getActionFromUrl(a.url,2)||o.wrap.querySelectorAll('#evo-popup-'+o.uid).length>1){o.el.close()}else{if(e.target.contentDocument.querySelectorAll('h1')[0]){a.title=e.target.contentDocument.querySelectorAll('h1')[0].innerHTML}else if(e.target.contentDocument.title){a.title=e.target.contentDocument.title}if(o.header){e.target.offsetParent.offsetParent.getElementsByClassName(o.header.className)[0].innerHTML=a.title}e.target.offsetParent.offsetParent.id='evo-popup-'+o.uid;e.target.offsetParent.offsetParent.classList.remove('changed')}}e.target.contentWindow.close=o.close;modx.main.stopWork()};o.el.lastChild.appendChild(o.frame);o.show()}else{var xhr=new XMLHttpRequest();xhr.open(o.method,o.url,true);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');xhr.setRequestHeader('X-REQUESTED-WITH','XMLHttpRequest');if(o.dataType){xhr.responseType=o.dataType}xhr.onload=function(){if(this.readyState===4){o.el.className+=' '+o.className+'-ajax';if(o.dataType==='document'){if(o.selector){var r=this.response.documentElement.querySelector(o.selector);if(r){o.el.lastChild.innerHTML+=r.innerHTML}}else{o.el.lastChild.innerHTML+=this.response.body.innerHTML}}else{o.el.lastChild.innerHTML+=this.response}o.show()}};xhr.send(o.data)}}else{o.el.lastChild.innerHTML+=o.content;o.show()}}return o}},getWindowDimension:function(){var a=0,b=0,c=d.documentElement,e=d.body;if(typeof(w.innerWidth)==='number'){a=w.innerWidth;b=w.innerHeight}else if(c&&(c.clientWidth||c.clientHeight)){a=c.clientWidth;b=c.clientHeight}else if(e&&(e.clientWidth||e.clientHeight)){a=e.clientWidth;b=e.clientHeight}return{'width':a,'height':b}},hideDropDown:function(e){e=e||w.event||w.main.event;if(tree.ca==='open'||tree.ca===''){modx.tree.setSelectedByContext()}if(modx.tree.ctx!==null){d.getElementById(modx.frameset).removeChild(modx.tree.ctx);modx.tree.ctx=null}if(!/dropdown\-item/.test(e.target.className)){var els=d.querySelectorAll('.dropdown.show'),n=null,t=e.target||e.target.parentNode,i;if(typeof t.dataset.toggle!=='undefined'){n=d.querySelector(t.dataset.toggle)}else if(t.classList.contains('dropdown-toggle')){n=t.offsetParent}for(i=0;i';if(this.classDrag)this.el.classList.add(this.classDrag);if(this.classResize)this.el.classList.add(this.classResize);this.el.insertBefore(this.borders,this.el.firstChild);if(this.handler&&this.el.getElementsByClassName(this.handler)[0]){this.handler=this.el.getElementsByClassName(this.handler)[0];this.handlerHeight=this.handler.offsetHeight}this.el.onmousedown=function(e){s.mousedown(e)};this.el.ontouchstart=function(e){s.mousedown(e.changedTouches[0])};this.wrap.addEventListener('mousemove',function(e){s.calc(e)},false);this.wrap.addEventListener('touchmove',function(e){s.calc(e.changedTouches[0])},false)};this.dragging.init.prototype={mousedown:function(e){if(e.target.classList.contains('close')){return}e=document.all?window.event:e;var s=this,x=document.all?window.event.clientX:e.clientX,y=document.all?window.event.clientY:e.clientY,style=w.getComputedStyle(this.el);this.elmX=(x-this.el.offsetLeft+parseInt(style.marginLeft));this.elmY=(y-this.el.offsetTop+parseInt(style.marginTop));this.el.position=this.el.getBoundingClientRect();this.el.style.position='fixed';this.el.style.transitionDuration='0s';this.el.style.webkitTransitionDuration='0s';this.el.style.left=this.el.offsetLeft-parseInt(style.marginLeft)+'px';this.el.style.top=this.el.offsetTop-parseInt(style.marginTop)+'px';this.el.style.right='auto';this.el.style.bottom='auto';this.el.style.width=this.el.position.width+'px';this.el.style.height=this.el.position.height+'px';if(e.target.parentNode===this.borders){this.isresize=this.resize;this.el.classList.add('is-resize')}else{if(!this.handler||(this.handler&&e.target===this.handler)){this.isdrag=true;this.el.classList.add('is-drag')}}if(typeof this.start==='function'){this.onstart(e,this.el)}if(e.preventDefault){e.preventDefault()}else{document.onselectstart=function(){return false}}this.wrap.onmousemove=function(e){s.mousemove(e)};this.wrap.ontouchmove=function(e){s.mousemove(e.changedTouches[0]);e.stopPropagation()};this.wrap.onmouseup=function(e){s.mouseup(e)};this.wrap.ontouchend=function(e){s.mouseup(e.changedTouches[0]);e.stopPropagation()}},mousemove:function(e){var x=document.all?window.event.clientX:e.clientX,y=document.all?window.event.clientY:e.clientY;if(this.isresize){if(this.onRight)this.el.style.width=Math.max(x-this.el.position.left+(this.el.position.width-this.x),this.minWidth)+'px';if(this.onBottom)this.el.style.height=Math.max(y-this.el.position.top+(this.el.position.height-this.y),this.minHeight)+'px';if(this.onLeft){this.width=Math.max(this.el.position.left-x+this.el.position.width+this.x,this.minWidth);if(this.width>this.minWidth){this.el.style.width=this.width+'px';this.el.style.left=x-this.elmX+'px'}}if(this.onTop){var currentHeight=Math.max(this.el.position.top-y+this.el.position.height+this.y,this.minHeight);if(currentHeight>this.minHeight){this.el.style.height=currentHeight+'px';this.el.style.top=y-this.elmY+'px'}}if(typeof this.onresize==='function'){this.onresize(e,this.el)}}else if(this.isdrag){this.el.style.opacity=this.opacity;this.el.style.left=x-this.elmX+'px';this.el.style.top=y-this.elmY+'px';if(typeof this.drag==='function'){this.ondrag(e,this.el)}}},mouseup:function(e){if(this.isdrag||this.isresize){this.el.classList.remove('is-resize');this.el.classList.remove('is-drag');this.el.style.opacity='';this.el.style.transitionDuration='';this.el.style.webkitTransitionDuration='';this.el.position=this.el.getBoundingClientRect();this.isdrag=false;this.isresize=false;this.wrap.onmousemove=null;this.wrap.onselectstart=null;if(typeof this.stop==='function'){this.onstop(e,this.el)}}},calc:function(e){if(this.isresize||this.isdrag){return}this.x=e.clientX-this.el.offsetLeft;this.y=e.clientY-this.el.offsetTop;if(this.resize){this.onTop=this.y=this.el.offsetWidth-this.border;this.onBottom=this.y>=this.el.offsetHeight-this.border;if(this.onRight&&this.onBottom||this.onLeft&&this.onTop){this.el.style.cursor='nwse-resize'}else if(this.onRight&&this.onTop||this.onBottom&&this.onLeft){this.el.style.cursor='nesw-resize'}else if(this.onRight||this.onLeft){this.el.style.cursor='ew-resize'}else if(this.onBottom||this.onTop){this.el.style.cursor='ns-resize'}else if(this.x>0&&this.y>0&&(this.x=this.border)){this.el.style.cursor='move'}else{this.el.style.cursor='default'}}else{if(this.x>0&&this.y>0&&(this.x=this.border)){this.el.style.cursor='move'}}}};return new this.dragging.init(a,b)},setTypeIcon:function(a){var b='';switch(this.typesactions[a]){case 1:b='fa fa-newspaper-o';break;case 2:b='fa fa-list-alt';break;case 3:b='fa fa-th-large';break;case 4:b='fa fa-code';break;case 5:b='fa fa-plug';break;case 6:b='fa fa-cube';break;case 7:b='fa fa-pencil-square-o';break;default:b='fa fa-circle'}return b}});w.mainMenu={};w.mainMenu.stopWork=function(){modx.main.stopWork()};w.mainMenu.work=function(){modx.main.work()};w.mainMenu.reloadtree=function(){if(modx.plugins.ElementsInTree){setTimeout('reloadElementsInTree()',50)}if(modx.config.global_tabs){setTimeout('modx.tree.restoreTree()',100)}};w.mainMenu.startrefresh=function(a){if(a===1){}if(a===2){}if(a===9){modx.tree.restoreTree()}if(a===10){w.location.href=modx.MODX_MANAGER_URL}};w.mainMenu.startmsgcount=function(a,b,c){modx.updateMail(c)};w.mainMenu.hideTreeFrame=function(){modx.resizer.setWidth(0)};w.mainMenu.defaultTreeFrame=function(){modx.resizer.setDefaultWidth()};w.tree={};w.tree.ca='open';w.tree.document=document;w.tree.saveFolderState=function(){};w.tree.updateTree=function(){modx.tree.updateTree()};w.tree.restoreTree=function(){modx.tree.restoreTree()};w.tree.resizeTree=function(){};w.onbeforeunload=function(){var a=w.main.frameElement.contentWindow;if(modx.getActionFromUrl(a.location.search,27)){modx.get(modx.MODX_MANAGER_URL+'?a=67&type=7&id='+modx.main.getQueryVariable('id',a.location.search.substring(1)))}};d.addEventListener('DOMContentLoaded',function(){modx.init()})})(typeof jQuery!=='undefined'?jQuery:'',window,document,undefined);(function(){if(!Element.prototype.closest){Element.prototype.closest=function(a){var b=this,c,d;['matches','webkitMatchesSelector','mozMatchesSelector','msMatchesSelector','oMatchesSelector'].some(function(fn){if(typeof document.body[fn]==='function'){c=fn;return true}return false});if(b&&c&&b[c](a))return b;while(b){d=b.parentElement;if(d&&c&&d[c](a))return d;b=d}return null}}})(); +(function($,w,d,u){'use strict';modx.extended({frameset:'frameset',minWidth:840,isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),typesactions:{'16':1,'301':2,'78':3,'22':4,'102':5,'108':6,'3':7,'4':7,'6':7,'27':7,'61':7,'62':7,'63':7,'72':7},thememodes:['','lightness','light','dark','darkness'],tabsTimer:0,popupTimer:0,init:function(){if(!localStorage.getItem('MODX_widthSideBar')){localStorage.setItem('MODX_widthSideBar',this.config.tree_width)}this.mainmenu.init();if(w.location.hash){if(modx.getActionFromUrl(w.location.hash,2)){w.history.replaceState(null,d.title,modx.MODX_MANAGER_URL)}else if(modx.getActionFromUrl(w.location.hash)||modx.main.getQueryVariable('filemanager',w.location.hash)){var url=modx.main.getQueryVariable('filemanager',w.location.hash)?modx.MODX_MANAGER_URL+modx.main.getQueryVariable('filemanager',w.location.hash)+w.location.hash.replace('#?','?'):w.location.href.replace('#?','?');if(modx.config.global_tabs){modx.tabs({url:url,title:'blank'})}else if(w.main){w.main.frameElement.src=url}else{modx.openWindow(url)}}}this.resizer.init();this.search.init();if(this.config.session_timeout>0){w.setInterval(this.keepMeAlive,1000*60*this.config.session_timeout)}if(modx.config.mail_check_timeperiod>0&&modx.permission.messages){setTimeout('modx.updateMail(true)',1000)}d.addEventListener('click',this.hideDropDown,false);if(modx.config.global_tabs){d.addEventListener('click',this.tabs,false);this.tabs({url:'?a=2',reload:0})}},mainmenu:{id:'mainMenu',init:function(){var $mm=$('#mainMenu'),mm=d.getElementById('mainMenu'),timer;$mm.on('click','a',function(e){if($(this).hasClass('dropdown-toggle')){if($mm.hasClass('show')&&($(this).hasClass('selected')||!modx.isMobile&&$(this).parent().hasClass('hover'))){$(this).removeClass('selected');$mm.removeClass('show')}else{$('.nav > li > a:not(:hover)').removeClass('selected');$(this).addClass('selected');$mm.addClass('show')}e.stopPropagation();e.target.dataset.toggle='#mainMenu';modx.hideDropDown(e)}if($(this).closest('ul').hasClass('dropdown-menu')&&!$(this).parent('li').hasClass('dropdown-back')){$('.nav > .active').removeClass('active');$('.nav li.selected').removeClass('selected');$(this).closest('.nav > li').addClass('active');if(this.offsetParent.id){d.getElementById(this.offsetParent.id.substr(7)).classList.add('selected')}if((modx.isMobile||w.innerWidth li',function(){var els=mm.querySelectorAll('.nav > li.hover:not(:hover)');for(var i=0;i li li',function(e){var self=this,ul;var els=mm.querySelectorAll('.nav > li li.hover:not(:hover)');for(var i=0;i'+modx.lang.paging_prev+''+data}ul.id='parent_'+self.id;ul.innerHTML=data;var id=w.location.hash.substr(2).replace(/=/g,'_').replace(/&/g,'__');var el=d.getElementById(id);if(el){el.parentNode.classList.add('selected');d.getElementById(el.parentNode.parentNode.id.substr(7)).classList.add('selected')}for(var i=0;iitems.length-1){index=items.length-1}if(index>=0&&index2){s.timer=setTimeout(function(){s.loader.style.display='block';modx.get(modx.MODX_MANAGER_URL+'?a=71&ajax=1&submitok=Search&searchid='+s.input.value,function(data){s.loader.style.display='none';s.results=data.querySelector('.ajaxSearchResults');if(s.results&&s.results.innerHTML!==''){s.result.innerHTML=s.results.outerHTML;s.open();s.result.onclick=function(e){var t=e.target,p=t.parentNode;if(t.tagName==='I'){modx.openWindow({title:p.innerText,id:p.id,url:p.href});e.preventDefault();e.stopPropagation()}else{var a=t.tagName==='A'&&t||p.tagName==='A'&&p;if(a){var el=s.result.querySelector('.selected');if(el)el.className='';a.className='selected';if(modx.isMobile)s.close()}}}}else{s.empty()}},'document')},300)}else{s.empty()}};if(modx.isMobile){this.input.onblur=this.close}this.input.onfocus=this.open;this.input.onclick=this.open;this.input.onmouseenter=this.open;this.result.onmouseenter=this.open;this.result.onmouseleave=this.close;this.mask.onmouseenter=this.open;this.mask.onmouseleave=this.close},open:function(){if(modx.search.results){modx.search.result.classList.add('open')}},close:function(){modx.search.result.classList.remove('open')},empty:function(){modx.search.result.classList.remove('open');modx.search.result.innerHTML=''}},main:{id:'main',idFrame:'mainframe',as:null,onload:function(e){w.main=e.target.contentWindow||e.target.defaultView;modx.main.tabRow.init();modx.main.stopWork();modx.main.scrollWork();w.main.document.addEventListener('click',modx.hideDropDown,false);w.main.document.addEventListener('contextmenu',modx.main.oncontextmenu,false);if(modx.config.global_tabs){w.main.document.addEventListener('click',modx.tabs,false)}w.history.replaceState(null,d.title,modx.getActionFromUrl(w.main.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.main.location.search);setTimeout('modx.tree.restoreTree()',100)},oncontextmenu:function(e){if(e.ctrlKey)return;var el=e.target;if(modx.user.role===1&&/modxtv|modxplaceholder|modxattributevalue|modxchunk|modxsnippet|modxsnippetnocache/i.test(el.className)){var id=Date.now(),name=el.innerText.replace(/[\[|\]|{|}|\*||\#|\+|?|\!|&|=|`|:]/g,''),type=el.className.replace(/cm-modx/,''),n=!!name.replace(/^\d+$/,'');if(name&&n){e.preventDefault();modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',{a:'modxTagHelper',name:name,type:type},function(r){if(r){r=JSON.parse(r);for(var k in r){if(r.hasOwnProperty(k)&&r[k].url){r[k]['onclick']='if(event.shiftKey){modx.openWindow({url:\''+r[k].url+'\'})}else{modx.popup({url:\''+r[k].url+'\',title:\''+r.header.innerHTML+'\',width:\'95%\',height:\'95%\',margin:0,hide:0,hover:0,overlay:1,overlayclose:0,position:\'center elements\',animation:0,icon:\'none\'})}'}}r=JSON.stringify(r);el.id='node'+id;el.dataset.contextmenu=r;modx.tree.showPopup(e,id,name)}})}e.preventDefault()}},tabRow:{init:function(){var row=w.main.document.querySelector('.tab-pane > .tab-row');if(row)this.build(row)},build:function(row){var rowContainer=d.createElement('div'),sel=row.querySelector('.selected');rowContainer.className='tab-row-container';row.parentNode.insertBefore(rowContainer,row);rowContainer.appendChild(row);var p=d.createElement('i');p.className='fa fa-angle-left prev disable';p.onclick=function(e){e.stopPropagation();e.preventDefault();var sel=row.querySelector('.selected');if(sel.previousSibling){sel.previousSibling.click();modx.main.tabRow.scroll(row)}};rowContainer.appendChild(p);var n=d.createElement('i');n.className='fa fa-angle-right next disable';n.onclick=function(e){e.stopPropagation();e.preventDefault();var sel=row.querySelector('.selected');if(sel.nextSibling){sel.nextSibling.click();modx.main.tabRow.scroll(row)}};rowContainer.appendChild(n);setTimeout(function(){sel=row.querySelector('.selected');modx.main.tabRow.scroll(row,sel);w.main.addEventListener('resize',function(){modx.main.tabRow.scroll(row)},false);if(sel){if(sel.previousSibling)p.classList.remove('disable');if(sel.nextSibling)n.classList.remove('disable')}},100);row.onclick=function(e){var sel=e.target.tagName==='H2'?e.target:e.target.tagName==='SPAN'?e.target.parentNode:null;if(sel){if(sel.previousSibling){this.parentNode.querySelector('i.prev').classList.remove('disable')}else{this.parentNode.querySelector('i.prev').classList.add('disable')}if(sel.nextSibling){this.parentNode.querySelector('i.next').classList.remove('disable')}else{this.parentNode.querySelector('i.next').classList.add('disable')}modx.main.tabRow.scroll(this,sel)}}},scroll:function(row,sel,a){sel=sel||row.querySelector('.selected')||row.firstChild;a=a||100;var c=0,elms=row.childNodes;for(var i=0;isel.offsetLeft){$(row).animate({scrollLeft:sel.offsetLeft-(sel.previousSibling?30:1)},a)}if(sel.offsetLeft+sel.offsetWidth>row.offsetWidth+row.scrollLeft){$(row).animate({scrollLeft:sel.offsetLeft-row.offsetWidth+sel.offsetWidth+(sel.nextSibling?30:0)},a)}if(c>row.offsetWidth){this.drag(row)}},drag:function(row){row.onmousedown=function(e){if(e.button===0){e.preventDefault();var x=e.clientX,f=row.scrollLeft;row.ownerDocument.body.focus();row.onmousemove=row.ownerDocument.onmousemove=function(e){if(Math.abs(e.clientX-x)>5){e.stopPropagation();row.scrollLeft=f-(e.clientX-x);row.ownerDocument.body.classList.add('drag')}};row.onmouseup=row.ownerDocument.onmouseup=function(e){e.stopPropagation();row.onmousemove=null;row.ownerDocument.onmousemove=null;row.ownerDocument.body.classList.remove('drag')}}}}},work:function(){d.getElementById('mainloader').classList.add('show')},stopWork:function(){d.getElementById('mainloader').classList.remove('show')},scrollWork:function(){var a=w.main.frameElement.contentWindow,b=a.location.search.substring(1)||a.location.hash.substring(2),c=localStorage.getItem('page_y')||0,f=localStorage.getItem('page_url')||b;if(((modx.getActionFromUrl(f)===modx.getActionFromUrl(b))&&(modx.main.getQueryVariable('id',f)&&modx.main.getQueryVariable('id',f)===modx.main.getQueryVariable('id',b)))||(f===b)){a.scrollTo(0,c)}a.addEventListener('scroll',function(){if(this.pageYOffset>=0){localStorage.setItem('page_y',this.pageYOffset.toString());localStorage.setItem('page_url',b)}},false)},getQueryVariable:function(a,b){var f='';if(b||typeof b==='string'){b=b.split('?');b=b[1]||b[0];b=b.split('&');for(var i=0;iMath.abs(ay)&&this.swipe){if(ax<0&&this.sidebar){if(Math.abs(ax)>h)ax=-h;tree.style.transform='translate3d('+ax+'px, 0, 0)';tree.style.WebkitTransform='translate3d('+ax+'px, 0, 0)';modx.resizer.mask.style.opacity=(0.5-0.5/-h*ax).toFixed(2);if(Math.abs(ax)>h/3){this.swipe='left'}else{this.swipe='right'}}else if(ax>0&&!this.sidebar){if(Math.abs(ax)>h)ax=h;tree.style.transform='translate3d('+ -(h-ax)+'px, 0, 0)';tree.style.WebkitTransform='translate3d('+ -(h-ax)+'px, 0, 0)';modx.resizer.mask.style.opacity=(0.5/h*ax).toFixed(2);if(Math.abs(ax)>h/3){this.swipe='right'}else{this.swipe='left'}}}},false);w.addEventListener('touchend',function(){if(this.swipe==='left'){d.body.classList.add('sidebar-closed');modx.resizer.setWidth(0)}if(this.swipe==='right'){d.body.classList.remove('sidebar-closed');modx.resizer.setWidth(h)}tree.style.cssText='';modx.resizer.mask.style.cssText=''},false)}},onMouseDown:function(e){e=e||w.event;modx.resizer.dragElement=e.target!==null?e.target:e.srcElement;if((e.buttons===1||e.button===0)&&modx.resizer.dragElement.id===modx.resizer.id){modx.resizer.oldZIndex=modx.resizer.dragElement.style.zIndex;modx.resizer.dragElement.style.zIndex=modx.resizer.newZIndex;modx.resizer.dragElement.style.background=modx.resizer.background;localStorage.setItem('MODX_widthSideBar',modx.resizer.dragElement.offsetLeft>0?modx.resizer.dragElement.offsetLeft:0);d.body.appendChild(modx.resizer.mask);d.onmousemove=modx.resizer.onMouseMove;d.body.focus();d.body.classList.add('resizer_move');d.onselectstart=function(){return false};modx.resizer.dragElement.ondragstart=function(){return false};return false}},onMouseMove:function(e){e=e||w.event;if(e.clientX>0){modx.resizer.left=e.clientX}else{modx.resizer.left=0}modx.resizer.dragElement.style.left=modx.pxToRem(modx.resizer.left)+'rem';d.getElementById('tree').style.width=modx.pxToRem(modx.resizer.left)+'rem';d.getElementById('main').style.left=modx.pxToRem(modx.resizer.left)+'rem';if(e.clientX<-2||e.clientY<-2){modx.resizer.onMouseUp(e)}},onMouseUp:function(e){if(modx.resizer.dragElement!==null&&e.button===0&&modx.resizer.dragElement.id===modx.resizer.id){if(e.clientX>0){d.body.classList.remove('sidebar-closed');modx.resizer.left=e.clientX}else{d.body.classList.add('sidebar-closed');modx.resizer.left=0}d.cookie='MODX_widthSideBar='+modx.pxToRem(modx.resizer.left);modx.resizer.dragElement.style.zIndex=modx.resizer.oldZIndex;modx.resizer.dragElement.style.background='';modx.resizer.dragElement.ondragstart=null;modx.resizer.dragElement=null;d.body.classList.remove('resizer_move');d.body.removeChild(modx.resizer.mask);d.onmousemove=null;d.onselectstart=null}},toggle:function(){if(modx.isMobile||w.innerWidth<=modx.minWidth){if(d.body.classList.contains('sidebar-closed')){d.body.classList.remove('sidebar-closed');localStorage.setItem('MODX_widthSideBar',0);d.cookie='MODX_widthSideBar='+modx.pxToRem(parseInt(d.getElementById('tree').offsetWidth))}else{localStorage.setItem('MODX_widthSideBar',parseInt(d.getElementById('tree').offsetWidth));d.body.classList.add('sidebar-closed');d.cookie='MODX_widthSideBar=0'}}else{var p=d.getElementById('tree').offsetWidth!==0?0:parseInt(localStorage.getItem('MODX_widthSideBar'))?parseInt(localStorage.getItem('MODX_widthSideBar')):modx.config.tree_width;modx.resizer.setWidth(p)}},setWidth:function(a){if(a>0){localStorage.setItem('MODX_widthSideBar',0);d.body.classList.remove('sidebar-closed')}else{localStorage.setItem('MODX_widthSideBar',parseInt(d.getElementById('tree').offsetWidth));d.body.classList.add('sidebar-closed')}d.cookie='MODX_widthSideBar='+modx.pxToRem(a);d.getElementById('tree').style.width=modx.pxToRem(a)+'rem';d.getElementById('resizer').style.left=modx.pxToRem(a)+'rem';d.getElementById('main').style.left=modx.pxToRem(a)+'rem'},setDefaultWidth:function(){modx.resizer.setWidth(modx.remToPx(modx.config.tree_width))}},tree:{ctx:null,rpcNode:null,itemToChange:'',selectedObjectName:null,selectedObject:0,selectedObjectDeleted:0,selectedObjectUrl:'',drag:false,deleted:[],init:function(){this.restoreTree()},draggable:function(){if(modx.permission.dragndropdocintree){var els=d.querySelectorAll('#treeRoot a:not(.empty)');for(var i=0;i-1:true;modx.tree.itemToChange=this.dataset.id||this.parentNode.id.replace('node','');modx.tree.selectedObjectName=this.dataset.titleEsc;if(draggable){this.parentNode.draggable=true;this.parentNode.ondragstart=modx.tree.ondragstart}else{this.parentNode.draggable=false;this.parentNode.ondragstart=function(){return false}}}},ondragstart:function(e){e.dataTransfer.effectAllowed='all';e.dataTransfer.dropEffect='all';e.dataTransfer.setData('text',this.id.substr(4))},ondragenter:function(e){if(d.getElementById('node'+modx.tree.itemToChange)===(this.parentNode.closest('#node'+modx.tree.itemToChange)||this.parentNode)){this.parentNode.className='';e.dataTransfer.effectAllowed='none';e.dataTransfer.dropEffect='none';modx.tree.drag=false}else{this.parentNode.className='dragenter';e.dataTransfer.effectAllowed='copy';e.dataTransfer.dropEffect='copy';modx.tree.drag=true}e.preventDefault()},ondragover:function(e){if(modx.tree.drag){var a=e.clientY;var b=parseInt(this.getBoundingClientRect().top);var c=a-b;if(c>this.offsetHeight/1.51){this.parentNode.classList.add('dragafter');this.parentNode.classList.remove('dragbefore');this.parentNode.classList.remove('dragenter');e.dataTransfer.effectAllowed='link';e.dataTransfer.dropEffect='link'}else if(c'}if(this.nextSibling){if(this.nextSibling.innerHTML){this.nextSibling.appendChild(el)}else{el.parentNode.removeChild(el)}els=this.parentNode.lastChild.children;for(i=0;i'}this.parentNode.parentNode.insertBefore(el,this.parentNode.nextSibling);els=this.parentNode.parentNode.children;for(i=0;i'}this.parentNode.parentNode.insertBefore(el,this.parentNode);els=this.parentNode.parentNode.children;for(i=0;i-1:true)){alert(modx.lang.error_no_privileges);modx.tree.restoreTree();return}modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',{a:'movedocument',id:id,parent:parent,menuindex:menuindex},function(r){if(r.errors)alert(r.errors);modx.tree.restoreTree()},'json');var b=w.main.frameElement.contentWindow.location.search.substr(1);if(modx.getActionFromUrl(b,27)&&parseInt(modx.main.getQueryVariable('id',b))===parseInt(id)){var index=menuindex.indexOf(id),elMenuIndex=w.main.document.querySelector('#documentPane input[name=menuindex]'),elParent=w.main.document.querySelector('#documentPane input[name=parent]'),elParentName=w.main.document.querySelector('#documentPane #parentName');if(elMenuIndex&&index>=0)elMenuIndex.value=index;if(elParent&&elParentName){elParent.value=parent;elParentName.innerHTML=parent+' ('+d.querySelector('#node'+parent+' > a').dataset.titleEsc+')'}}},toggleTheme:function(){var a,b=1,myCodeMirrors=w.main.myCodeMirrors,key;if(typeof localStorage['MODX_themeMode']==='undefined'){localStorage['MODX_themeMode']=modx.config.theme_mode}if(modx.thememodes[parseInt(localStorage['MODX_themeMode'])+1]){b=parseInt(localStorage['MODX_themeMode'])+1}a=modx.thememodes[b];for(key in modx.thememodes){if(modx.thememodes[key]){d.body.classList.remove(modx.thememodes[key]);w.main.document.body.classList.remove(modx.thememodes[key])}}d.body.classList.add(a);w.main.document.body.classList.add(a);d.cookie='MODX_themeMode='+b;localStorage['MODX_themeMode']=b;if(typeof myCodeMirrors!=='undefined'){for(key in myCodeMirrors){if(myCodeMirrors.hasOwnProperty(key)){if(~a.indexOf('dark')){w.main.document.getElementsByName(key)[0].nextElementSibling.classList.add('cm-s-'+myCodeMirrors[key].options.darktheme);w.main.document.getElementsByName(key)[0].nextElementSibling.classList.remove('cm-s-'+myCodeMirrors[key].options.defaulttheme)}else{w.main.document.getElementsByName(key)[0].nextElementSibling.classList.remove('cm-s-'+myCodeMirrors[key].options.darktheme);w.main.document.getElementsByName(key)[0].nextElementSibling.classList.add('cm-s-'+myCodeMirrors[key].options.defaulttheme)}}}}},toggleNode:function(e,id){e=e||w.event;if(e.ctrlKey)return;e.stopPropagation();var el=d.getElementById('node'+id).firstChild;this.rpcNode=el.nextSibling;var toggle=el.querySelector('.toggle'),icon=el.querySelector('.icon');if(this.rpcNode.innerHTML===''){if(toggle)toggle.innerHTML=el.dataset.iconCollapsed;icon.innerHTML=el.dataset.iconFolderOpen;var rpcNodeText=this.rpcNode.innerHTML,loadText=modx.lang.loading_doc_tree;modx.openedArray[id]=1;if(rpcNodeText===''||rpcNodeText.indexOf(loadText)>0){var folderState=this.getFolderState();d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent='+el.dataset.indent+'&parent='+id+'&expandAll='+el.dataset.expandall+folderState,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})}this.saveFolderState()}else{if(toggle)toggle.innerHTML=el.dataset.iconExpanded;icon.innerHTML=el.dataset.iconFolderClose;delete modx.openedArray[id];this.rpcNode.style.overflow='hidden';$(this.rpcNode.firstChild).animate({marginTop:-this.rpcNode.offsetHeight+'px'},100,function(){this.parentNode.innerHTML=''});this.saveFolderState()}e.preventDefault()},rpcLoadData:function(a){if(this.rpcNode!==null){var el;this.rpcNode.innerHTML=typeof a==='object'?a.responseText:a;this.rpcNode.loaded=true;if(this.rpcNode.firstChild.tagName==='DIV'){if(this.rpcNode.id==='treeRoot'){el=d.getElementById('binFull');if(el){this.showBin(true)}else{this.showBin(false)}}else{this.rpcNode.style.overflow='hidden';this.rpcNode.firstElementChild.style.marginTop=-this.rpcNode.offsetHeight+'px';$(this.rpcNode.firstChild).animate({marginTop:0},100)}d.getElementById('treeloader').classList.remove('visible')}else{el=d.getElementById('loginfrm');if(el){this.rpcNode.parentNode.removeChild(this.rpcNode);w.location.href=modx.MODX_MANAGER_URL}}}},treeAction:function(e,id,title){if(e.ctrlKey)return;var el=d.getElementById('node'+id).firstChild,treepageclick=el.dataset.treepageclick,showchildren=parseInt(el.dataset.showchildren),openfolder=parseInt(el.dataset.openfolder);title=title||el.dataset&&el.dataset.titleEsc;if(tree.ca==='move'){try{this.setSelectedByContext(id);w.main.setMoveValue(id,title)}catch(oException){alert(modx.lang.unable_set_parent)}}if(tree.ca==='open'||tree.ca===''){if(id===0){href='?a=2'}else{var href='';if(!isNaN(treepageclick)&&isFinite(treepageclick)){href='?a='+treepageclick+'&r=1&id='+id+(openfolder===0?this.getFolderState():'')}else{href=treepageclick}if(openfolder===2){if(showchildren!==1){href=''}this.toggleNode(e,id)}}if(href){if(e.shiftKey){w.getSelection().removeAllRanges();modx.openWindow(href);this.restoreTree()}else{modx.tabs({url:modx.MODX_MANAGER_URL+href,title:title+'('+id+')'});if(modx.isMobile&&w.innerWidth0?e.clientX:e.pageX;y=e.clientY>0?e.clientY:e.pageY;e.view.position=e.view.frameElement?e.view.frameElement.getBoundingClientRect():e.target.offsetParent.getBoundingClientRect();if(e.view.frameElement){x+=e.view.position.left;y+=e.view.frameElement.offsetParent.offsetTop}else{if(e.target.parentNode.parentNode.classList.contains('node')){x+=50}}if(x>e.view.position.width){x=e.view.position.width-this.ctx.offsetWidth}if(y+this.ctx.offsetHeight/2>e.view.position.height){y=e.view.position.height-this.ctx.offsetHeight-5}else if(y-this.ctx.offsetHeight/20?e.clientX:e.pageX;y=e.clientY>0?e.clientY:e.pageY;if(y+ctx.offsetHeight/2>bodyHeight){y=bodyHeight-ctx.offsetHeight-5}else if(y-ctx.offsetHeight/230){this.selectedObjectName=this.selectedObjectName.substr(0,30)+'...'}var f=d.getElementById('nameHolder');f.innerHTML=this.selectedObjectName;el.style.left=a+(modx.config.textdir?'-190':'')+'px';el.style.top=b+'px';el.classList.add('show')},menuHandler:function(a){switch(a){case 1:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=3&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 2:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=27&r=1&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 3:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=4&pid='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 4:if(this.selectedObjectDeleted){alert('"'+this.selectedObjectName+'" '+modx.lang.already_deleted)}else if(confirm('"'+this.selectedObjectName+'"\n\n'+modx.lang.confirm_delete_resource)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=6&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 5:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=51&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 6:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=72&pid='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 7:if(confirm(modx.lang.confirm_resource_duplicate)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=94&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 8:if(d.getElementById('node'+this.itemToChange).firstChild.dataset.deleted){if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_undelete)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=63&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}}else{alert('"'+this.selectedObjectName+'"'+modx.lang.not_deleted)}break;case 9:if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_publish)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=61&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 10:if(this.itemToChange!==modx.config.site_start){if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_unpublish)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=62&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}}else{alert('Document is linked to site_start variable and cannot be unpublished!')}break;case 11:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=56&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 12:w.open(d.getElementById('node'+this.itemToChange).firstChild.dataset.href,'previeWin');break;default:alert('Unknown operation command.')}},setSelected:function(a){var el=d.querySelector('#tree .current');if(el)el.classList.remove('current');if(a){if(typeof a==='object'){a.classList.add('current')}else{el=d.querySelector('#node'+a+'>.node')||d.getElementById('node'+a);if(el)el.classList.add('current')}}},setActiveFromContextMenu:function(a){var el=d.querySelector('#node'+a+'>.node');if(el)this.setSelected(el)},setSelectedByContext:function(a){var el=d.querySelector('#treeRoot .selected');if(el)el.classList.remove('selected');el=d.querySelector('#node'+a+'>.node');if(el)el.classList.add('selected')},setItemToChange:function(){var a=w.main.document&&(w.main.document.URL||w.main.document.location.search),b=modx.getActionFromUrl(a);if(a&&modx.typesactions[b]){this.itemToChange=(modx.typesactions[b]===7?'':modx.typesactions[b]+'_')+parseInt(modx.main.getQueryVariable('id',a))}else{this.itemToChange=''}this.setSelected(this.itemToChange)},restoreTree:function(){if(d.getElementById('treeRoot')){d.getElementById('treeloader').classList.add('visible');this.setItemToChange();this.rpcNode=d.getElementById('treeRoot');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=2&id='+this.itemToChange,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})}},expandTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=1&id='+this.itemToChange,function(r){modx.tree.rpcLoadData(r);modx.tree.saveFolderState();modx.tree.draggable()})},collapseTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=0&id='+this.itemToChange,function(r){modx.openedArray=[];modx.tree.saveFolderState();modx.tree.rpcLoadData(r);modx.tree.draggable()})},updateTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');var a=d.sortFrm;var b='a=1&f=nodes&indent=1&parent=0&expandAll=2&dt='+a.dt.value+'&tree_sortby='+a.sortby.value+'&tree_sortdir='+a.sortdir.value+'&tree_nodename='+a.nodename.value+'&id='+this.itemToChange+'&showonlyfolders='+a.showonlyfolders.value;modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',b,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})},getFolderState:function(){var a;if(modx.openedArray!==[0]){a='&opened=';for(var key in modx.openedArray){if(modx.openedArray[key]){a+=key+'|'}}}else{a='&opened='}return a},saveFolderState:function(){modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&savestateonly=1'+this.getFolderState())},showSorter:function(e){e=e||w.event;var el=d.getElementById('floater');e.target.dataset.toggle='#floater';el.classList.toggle('show');el.onclick=function(e){e.stopPropagation()}},emptyTrash:function(){if(confirm(modx.lang.confirm_empty_trash)===true){modx.get(modx.MODX_MANAGER_URL+'?a=64',function(){modx.tabsClose(modx.tree.deleted);modx.tree.deleted=[];modx.tree.restoreTree()})}},showBin:function(a){var el=d.getElementById('treeMenu_emptytrash');if(el){if(a){el.title=modx.lang.empty_recycle_bin;el.classList.remove('disabled');el.innerHTML=modx.style.empty_recycle_bin;el.onclick=function(){modx.tree.emptyTrash()};var els=d.getElementById('tree').querySelectorAll('.deleted');for(var i=0;i0){if(el){el.innerHTML=c[0];el.style.display='block'}}else{if(el)el.style.display='none'}if(c[1]>0){el=d.getElementById('newMail');if(el){el.innerHTML=''+modx.style.email+modx.lang.inbox+' ('+c[0]+' / '+c[1]+')';el.style.display='block'}}if(modx.config.mail_check_timeperiod>0)setTimeout('modx.updateMail(true)',1000*modx.config.mail_check_timeperiod)})}}catch(oException){setTimeout('modx.updateMail(true)',1000*modx.config.mail_check_timeperiod)}},openWindow:function(a){if(typeof a!=='object'){a={'url':a}}if(!a.width)a.width=parseInt(w.innerWidth*0.9)+'px';if(!a.height)a.height=parseInt(w.innerHeight*0.8)+'px';if(!a.left)a.left=parseInt(w.innerWidth*0.05)+'px';if(!a.top)a.top=parseInt(w.innerHeight*0.1)+'px';if(!a.title)a.title=Math.floor((Math.random()*999999)+1);if(a.url){if(this.plugins.EVOmodal===1){top.EVO.modal.show(a)}else{w.open(a.url,a.title,'width='+a.width+',height='+a.height+',top='+a.top+',left='+a.left+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no')}}},tabsClose:function(a){if(modx.config.global_tabs&&a){for(var k in a){if(a.hasOwnProperty(k)){var el=d.getElementById(a[k]);if(el){el.firstElementChild.contentWindow.documentDirty=false;el.close()}}}}},tabs:function(a){function Tabs(a){var s=this;this.url=a.url;this.title=a.title||'';this.name=a.name||'';this.timer=null;this.olduid='';this.closeactions=[6,61,62,63,94];this.reload=typeof a.reload!=='undefined'?a.reload:1;this.action=modx.getActionFromUrl(a.url);this.uid=modx.getActionFromUrl(a.url,2)?'home':modx.urlToUid(a.url);this.page=d.getElementById('evo-tab-page-'+this.uid);this.row=d.getElementsByClassName('evo-tab-row')[0].firstElementChild;this.tab=d.getElementById('evo-tab-'+this.uid);if(this.page){if(this.uid==='home'){if(this.reload){this.page.firstElementChild.src=this.url;this.show()}else{this.reload=1;if(this.tab.onclick===null){this.tab.onclick=function(e){s.select.call(s,e,this)}}this.tab.show=function(e){s.show.call(s,e)};modx.tabs.selected=this.tab}}else{this.show();if(~this.closeactions.indexOf(this.action)){this.setDocPublished();modx.get(this.url,function(){modx.tree.restoreTree()})}}}else if(~this.closeactions.indexOf(this.action)){modx.get(this.url,function(){modx.tree.restoreTree()})}else{this.create()}}Tabs.prototype={create:function(){var s=this;modx.main.work();modx.tabs.selected=this.row.querySelector('.selected');if(modx.tabs.selected){d.getElementById(modx.tabs.selected.id.replace('tab','tab-page')).classList.remove('show');modx.tabs.selected.classList.remove('selected')}this.page=d.createElement('div');this.page.id='evo-tab-page-'+this.uid;this.page.className='evo-tab-page iframe-scroller show';this.page.innerHTML='';d.getElementById('main').appendChild(this.page);console.time('load-tab');this.page.firstElementChild.onload=function(e){s.onload.call(s,e);console.timeEnd('load-tab')};this.tab=d.createElement('h2');this.tab.id='evo-tab-'+this.uid;this.tab.className='tab selected';this.icon='';if(!/'}this.tab.innerHTML=''+this.icon+this.title+'×';this.row.appendChild(this.tab);this.tab.onclick=function(e){s.select.call(s,e,this)};this.tab.close=function(e){s.close.call(s,e)};this.tab.show=function(e){s.show.call(s,e)};this.page.close=function(e){s.close.call(s,e)}},onload:function(e){var s=this;w.main=e.target.contentWindow||e.target.defaultView;this.url=w.main.location.search||w.location.hash.substring(1);this.olduid=this.uid;this.uid=modx.urlToUid(this.url);if(!!w.main.__alertQuit){w.main.alert=function(a){};var message=w.main.document.body.innerHTML;w.main.document.body.innerHTML='';history.pushState(null,d.title,modx.getActionFromUrl(w.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.location.search);w.onpopstate=function(){history.go(1)};modx.popup({type:'warning',title:'MODX :: Alert',position:'top center alertQuit',content:message,wrap:'body'});modx.getLockedElements(modx.getActionFromUrl(this.url),modx.main.getQueryVariable('id',this.url),function(data){if(!!data){s.page.close();modx.tree.restoreTree()}else{w.main.location.href=modx.MODX_MANAGER_URL+s.url;w.history.replaceState(null,d.title,modx.getActionFromUrl(s.url,2)?modx.MODX_MANAGER_URL:'#'+s.url)}})}else{if(modx.getActionFromUrl(this.url,2)){this.close(e)}else if(this.olduid!==this.uid&&d.getElementById('evo-tab-'+this.uid)){this.close(e);d.getElementById('evo-tab-'+this.uid).show()}else{this.title=w.main.document.body.querySelectorAll('h1')[0]&&w.main.document.body.querySelectorAll('h1')[0].innerHTML||this.title;if(this.title&&this.uid!=='home'){this.tab.innerHTML=''+this.title+'×'}this.page.id='evo-tab-page-'+this.uid;this.tab.id='evo-tab-'+this.uid;this.tab.classList.remove('changed');this.show();modx.main.onload(e);w.main.document.addEventListener('click',function a(e){if(typeof e.view.documentDirty!=='undefined'&&e.view.documentDirty&&!s.tab.classList.contains('changed')){s.tab.classList.add('changed');this.removeEventListener(e.type,a,false)}},false);w.main.document.addEventListener('keyup',function a(e){if(typeof e.view.documentDirty!=='undefined'&&e.view.documentDirty&&!s.tab.classList.contains('changed')){s.tab.classList.add('changed');this.removeEventListener(e.type,a,false)}},false)}}},show:function(){var s=this;modx.tabs.selected=this.row.querySelector('.selected');if(modx.tabs.selected&&modx.tabs.selected!==this.tab){d.getElementById(modx.tabs.selected.id.replace('tab','tab-page')).classList.remove('show');modx.tabs.selected.classList.remove('selected')}this.page.classList.add('show');this.tab.classList.add('selected');modx.tabs.selected=this.tab;w.main=this.page.firstElementChild.contentWindow;w.history.replaceState(null,w.main.document.title,modx.getActionFromUrl(w.main.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.main.location.search);modx.tree.setItemToChange();modx.main.tabRow.scroll(this.row,this.tab,350)},close:function(e){var documentDirty=this.page.firstElementChild.contentWindow.documentDirty;var checkDirt=!!this.page.firstElementChild.contentWindow.checkDirt;if(documentDirty&&checkDirt&&confirm(this.page.firstElementChild.contentWindow.checkDirt(e))||!documentDirty){modx.tabs.selected=this.tab.classList.contains('selected')?this.tab.previousElementSibling:this.row.querySelector('.selected');this.page.parentNode.removeChild(this.page);this.row.removeChild(this.tab);modx.tabs.selected.show()}},select:function(e){if(e.target.className==='tab-close'){this.close(e)}else if(modx.tabs.selected===this.tab){var s=this;if(this.timer){clearTimeout(this.timer);this.timer=null;w.main.location.reload()}else{this.timer=setTimeout(function(){s.timer=null},250)}}else{this.show()}},setDocPublished:function(){var el=w.main.document.getElementsByName('publishedcheck')[0];if(el){el.checked=this.action===61;w.main.document.getElementsByName('published')[0].value=+el.checked}if(modx.getActionFromUrl(w.main.location.search,3)){w.main.location.reload()}}};if(modx.config.global_tabs){if(typeof a.currentTarget!=='undefined'){var e=a;if(e.button===0&&e.target&&(e.target.tagName==='A'&&e.target.target==='main'||(e.target.parentNode&&e.target.parentNode.tagName==='A'&&e.target.parentNode.target==='main'))){a=e.target.tagName==='A'&&e.target||e.target.parentNode.tagName==='A'&&e.target.parentNode;if(e.shiftKey){modx.openWindow({url:a.href})}else{modx.tabs({url:a.href,title:a.innerHTML})}e.preventDefault()}}else{return new Tabs(a)}}else if(a.url){if(w.main){w.main.frameElement.src=a.url}else{modx.openWindow(a.url)}}},popup:function(a){if(typeof a==='object'&&(a.url||a.content||a.text)){var o={addclass:'',animation:'fade',content:a.content||a.text||'',clickclose:0,closeall:0,data:'',dataType:'document',delay:5000,draggable:!1,event:null,height:'auto',hide:1,hover:1,icon:'',iframe:'iframe',margin:'.5rem',maxheight:'',method:'GET',overlay:0,overlayclose:0,position:'center',resize:!1,selector:'',showclose:1,target:'main',uid:'',type:'default',title:'',url:'',width:'20rem',wrap:w.main.document.body,zIndex:10500,w:null,show:function(){if(~o.position.indexOf('center')){if(o.event){o.el.style.left=o.event.clientX+o.mt+'px';o.el.style.bottom=o.w.innerHeight-o.el.offsetHeight-o.event.clientY+o.mt+'px'}else{o.el.style.left=/(%)/.test(o.width)?(100-parseInt(o.width))/2-o.mt/(o.w.innerWidth/100)+'%':(o.w.innerWidth-o.el.offsetWidth)/2-o.mt+'px';o.el.style.bottom=/(%)/.test(o.height)?(100-parseInt(o.height))/2-o.mt/(o.w.innerHeight/100)+'%':(o.w.innerHeight-o.el.offsetHeight-o.wrap.offsetTop)/2-o.mt+'px'}}if(~o.position.indexOf('left')){o.el.style.left=0}if(~o.position.indexOf('right')){o.el.style.right=0}else{o.el.style.right='auto'}if(~o.position.indexOf('top')){o.el.style.top=0;o.el.style.bottom=''}else{o.el.style.top='auto'}if(~o.position.indexOf('bottom')){o.el.style.bottom=0}o.calc();o.el.className+=' in';if(o.showclose){o.el.querySelector('.close').onclick=o.close}if(o.hide){o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);o.close()},o.delay)}if(o.hover){o.el.onmouseenter=function(){clearTimeout(o.el.timer)};o.el.onmouseleave=o.close}if(o.overlayclose&&o.o){o.o.onclick=o.close}if(o.clickclose){o.el.onclick=o.close}if(o.draggable){modx.dragging(o.el,{wrap:o.wrap,resize:o.resize})}},close:function(e){o.event=e||o.event||w.event;if(o.url&&o.iframe==='iframe'){var els=o.wrap.ownerDocument.querySelectorAll('.'+o.className+'.in');if(els){var documentDirty=o.el.lastElementChild.firstElementChild.contentWindow.documentDirty;if(documentDirty&&confirm(o.el.lastElementChild.firstElementChild.contentWindow.checkDirt(o.event))||!documentDirty){o.el.classList.remove('in');if(!o.animation){o.el.classList.remove('show')}o.calc(1);if(o.o&&o.o.parentNode){o.o.parentNode.removeChild(o.o);o.wrap.style.overflow=''}o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);if(o.el.parentNode){o.el.parentNode.removeChild(o.el)}},200)}}}else{o.el.classList.remove('in');if(!o.animation){o.el.classList.remove('show')}o.calc(1);if(o.o&&o.o.parentNode){o.o.parentNode.removeChild(o.o);o.wrap.style.overflow=''}o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);if(o.el.parentNode){o.el.parentNode.removeChild(o.el)}},200)}if(typeof o.onclose==='function'){o.onclose(e,o.el)}},calc:function(f){var els=o.wrap.ownerDocument.querySelectorAll('.'+o.className+'.in[data-position="'+o.el.dataset.position+'"]');if(els&&els.length){o.els=[];for(var i=0;i×'}if(o.title){o.header=document.createElement('div');if(o.icon!=='none'){o.header.innerHTML+=''}o.header.innerHTML+=o.title;o.header.className='evo-popup-header';o.el.appendChild(o.header)}o.el.innerHTML+='
      ';o.wrap.appendChild(o.el);o.mt=parseFloat(getComputedStyle(o.el).marginTop);if(o.maxheight){o.maxheight=/(%)/.test(o.maxheight)?(o.w.innerHeight-o.el.offsetHeight-o.mt)/100*parseInt(o.maxheight):o.maxheight;o.el.lastChild.style.overflowY='auto';o.el.lastChild.style.maxHeight=o.maxheight+'px'}if(o.url){o.draggable=1;if(o.iframe==='iframe'){o.resize=1;o.uid=modx.urlToUid(a.url);o.el.className+=' '+o.addclass+' '+o.className+'-iframe';o.el.id='evo-popup-'+o.uid;d.getElementById('mainloader').className='show';o.frame=d.createElement('iframe');o.frame.width='100%';o.frame.height='100%';o.frame.frameBorder='0';o.frame.src=o.url;o.frame.onload=function(e){e.target.contentWindow.opener=o.w;a.url=e.target.contentWindow.location.href;o.uid=modx.urlToUid(a.url);o.event=e;if(!!e.target.contentWindow.__alertQuit){modx.popup({type:'warning',title:'MODX :: Alert',position:'top center alertQuit',content:e.target.contentWindow.document.body.querySelector('p').innerHTML});e.target.contentWindow.document.body.innerHTML='';e.target.contentWindow.alert=function(){}}else{if(modx.getActionFromUrl(a.url,2)||o.wrap.querySelectorAll('#evo-popup-'+o.uid).length>1){o.el.close()}else{if(e.target.contentDocument.querySelectorAll('h1')[0]){a.title=e.target.contentDocument.querySelectorAll('h1')[0].innerHTML}else if(e.target.contentDocument.title){a.title=e.target.contentDocument.title}if(o.header){e.target.offsetParent.offsetParent.getElementsByClassName(o.header.className)[0].innerHTML=a.title}e.target.offsetParent.offsetParent.id='evo-popup-'+o.uid;e.target.offsetParent.offsetParent.classList.remove('changed')}}e.target.contentWindow.close=o.close;modx.main.stopWork()};o.el.lastChild.appendChild(o.frame);o.show()}else{var xhr=new XMLHttpRequest();xhr.open(o.method,o.url,true);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');xhr.setRequestHeader('X-REQUESTED-WITH','XMLHttpRequest');if(o.dataType){xhr.responseType=o.dataType}xhr.onload=function(){if(this.readyState===4){o.el.className+=' '+o.className+'-ajax';if(o.dataType==='document'){if(o.selector){var r=this.response.documentElement.querySelector(o.selector);if(r){o.el.lastChild.innerHTML+=r.innerHTML}}else{o.el.lastChild.innerHTML+=this.response.body.innerHTML}}else{o.el.lastChild.innerHTML+=this.response}o.show()}};xhr.send(o.data)}}else{o.el.lastChild.innerHTML+=o.content;o.show()}}return o}},getWindowDimension:function(){var a=0,b=0,c=d.documentElement,e=d.body;if(typeof(w.innerWidth)==='number'){a=w.innerWidth;b=w.innerHeight}else if(c&&(c.clientWidth||c.clientHeight)){a=c.clientWidth;b=c.clientHeight}else if(e&&(e.clientWidth||e.clientHeight)){a=e.clientWidth;b=e.clientHeight}return{'width':a,'height':b}},hideDropDown:function(e){e=e||w.event||w.main.event;if(tree.ca==='open'||tree.ca===''){modx.tree.setSelectedByContext()}if(modx.tree.ctx!==null){d.getElementById(modx.frameset).removeChild(modx.tree.ctx);modx.tree.ctx=null}if(!/dropdown\-item/.test(e.target.className)){var els=d.querySelectorAll('.dropdown.show'),n=null,t=e.target||e.target.parentNode,i;if(typeof t.dataset.toggle!=='undefined'){n=d.querySelector(t.dataset.toggle)}else if(t.classList.contains('dropdown-toggle')){n=t.offsetParent}for(i=0;i';if(this.classDrag)this.el.classList.add(this.classDrag);if(this.classResize)this.el.classList.add(this.classResize);this.el.insertBefore(this.borders,this.el.firstChild);if(this.handler&&this.el.getElementsByClassName(this.handler)[0]){this.handler=this.el.getElementsByClassName(this.handler)[0];this.handlerHeight=this.handler.offsetHeight}this.el.onmousedown=function(e){s.mousedown(e)};this.el.ontouchstart=function(e){s.mousedown(e.changedTouches[0])};this.wrap.addEventListener('mousemove',function(e){s.calc(e)},false);this.wrap.addEventListener('touchmove',function(e){s.calc(e.changedTouches[0])},false)};this.dragging.init.prototype={mousedown:function(e){if(e.target.classList.contains('close')){return}e=document.all?window.event:e;var s=this,x=document.all?window.event.clientX:e.clientX,y=document.all?window.event.clientY:e.clientY,style=w.getComputedStyle(this.el);this.elmX=(x-this.el.offsetLeft+parseInt(style.marginLeft));this.elmY=(y-this.el.offsetTop+parseInt(style.marginTop));this.el.position=this.el.getBoundingClientRect();this.el.style.position='fixed';this.el.style.transitionDuration='0s';this.el.style.webkitTransitionDuration='0s';this.el.style.left=this.el.offsetLeft-parseInt(style.marginLeft)+'px';this.el.style.top=this.el.offsetTop-parseInt(style.marginTop)+'px';this.el.style.right='auto';this.el.style.bottom='auto';this.el.style.width=this.el.position.width+'px';this.el.style.height=this.el.position.height+'px';if(e.target.parentNode===this.borders){this.isresize=this.resize;this.el.classList.add('is-resize')}else{if(!this.handler||(this.handler&&e.target===this.handler)){this.isdrag=true;this.el.classList.add('is-drag')}}if(typeof this.start==='function'){this.onstart(e,this.el)}if(e.preventDefault){e.preventDefault()}else{document.onselectstart=function(){return false}}this.wrap.onmousemove=function(e){s.mousemove(e)};this.wrap.ontouchmove=function(e){s.mousemove(e.changedTouches[0]);e.stopPropagation()};this.wrap.onmouseup=function(e){s.mouseup(e)};this.wrap.ontouchend=function(e){s.mouseup(e.changedTouches[0]);e.stopPropagation()}},mousemove:function(e){var x=document.all?window.event.clientX:e.clientX,y=document.all?window.event.clientY:e.clientY;if(this.isresize){if(this.onRight)this.el.style.width=Math.max(x-this.el.position.left+(this.el.position.width-this.x),this.minWidth)+'px';if(this.onBottom)this.el.style.height=Math.max(y-this.el.position.top+(this.el.position.height-this.y),this.minHeight)+'px';if(this.onLeft){this.width=Math.max(this.el.position.left-x+this.el.position.width+this.x,this.minWidth);if(this.width>this.minWidth){this.el.style.width=this.width+'px';this.el.style.left=x-this.elmX+'px'}}if(this.onTop){var currentHeight=Math.max(this.el.position.top-y+this.el.position.height+this.y,this.minHeight);if(currentHeight>this.minHeight){this.el.style.height=currentHeight+'px';this.el.style.top=y-this.elmY+'px'}}if(typeof this.onresize==='function'){this.onresize(e,this.el)}}else if(this.isdrag){this.el.style.opacity=this.opacity;this.el.style.left=x-this.elmX+'px';this.el.style.top=y-this.elmY+'px';if(typeof this.drag==='function'){this.ondrag(e,this.el)}}},mouseup:function(e){if(this.isdrag||this.isresize){this.el.classList.remove('is-resize');this.el.classList.remove('is-drag');this.el.style.opacity='';this.el.style.transitionDuration='';this.el.style.webkitTransitionDuration='';this.el.position=this.el.getBoundingClientRect();this.isdrag=false;this.isresize=false;this.wrap.onmousemove=null;this.wrap.onselectstart=null;if(typeof this.stop==='function'){this.onstop(e,this.el)}}},calc:function(e){if(this.isresize||this.isdrag){return}this.x=e.clientX-this.el.offsetLeft;this.y=e.clientY-this.el.offsetTop;if(this.resize){this.onTop=this.y=this.el.offsetWidth-this.border;this.onBottom=this.y>=this.el.offsetHeight-this.border;if(this.onRight&&this.onBottom||this.onLeft&&this.onTop){this.el.style.cursor='nwse-resize'}else if(this.onRight&&this.onTop||this.onBottom&&this.onLeft){this.el.style.cursor='nesw-resize'}else if(this.onRight||this.onLeft){this.el.style.cursor='ew-resize'}else if(this.onBottom||this.onTop){this.el.style.cursor='ns-resize'}else if(this.x>0&&this.y>0&&(this.x=this.border)){this.el.style.cursor='move'}else{this.el.style.cursor='default'}}else{if(this.x>0&&this.y>0&&(this.x=this.border)){this.el.style.cursor='move'}}}};return new this.dragging.init(a,b)},setTypeIcon:function(a){var b='';switch(this.typesactions[a]){case 1:b='fa fa-newspaper-o';break;case 2:b='fa fa-list-alt';break;case 3:b='fa fa-th-large';break;case 4:b='fa fa-code';break;case 5:b='fa fa-plug';break;case 6:b='fa fa-cube';break;case 7:b='fa fa-pencil-square-o';break;default:b='fa fa-circle'}return b}});w.mainMenu={};w.mainMenu.stopWork=function(){modx.main.stopWork()};w.mainMenu.work=function(){modx.main.work()};w.mainMenu.reloadtree=function(){if(modx.plugins.ElementsInTree){setTimeout('reloadElementsInTree()',50)}if(modx.config.global_tabs){setTimeout('modx.tree.restoreTree()',100)}};w.mainMenu.startrefresh=function(a){if(a===1){}if(a===2){}if(a===9){modx.tree.restoreTree()}if(a===10){w.location.href=modx.MODX_MANAGER_URL}};w.mainMenu.startmsgcount=function(a,b,c){modx.updateMail(c)};w.mainMenu.hideTreeFrame=function(){modx.resizer.setWidth(0)};w.mainMenu.defaultTreeFrame=function(){modx.resizer.setDefaultWidth()};w.tree={};w.tree.ca='open';w.tree.document=document;w.tree.saveFolderState=function(){};w.tree.updateTree=function(){modx.tree.updateTree()};w.tree.restoreTree=function(){modx.tree.restoreTree()};w.tree.resizeTree=function(){};w.onbeforeunload=function(){var a=w.main.frameElement.contentWindow;if(modx.getActionFromUrl(a.location.search,27)){modx.get(modx.MODX_MANAGER_URL+'?a=67&type=7&id='+modx.main.getQueryVariable('id',a.location.search.substring(1)))}};d.addEventListener('DOMContentLoaded',function(){modx.init()})})(typeof jQuery!=='undefined'?jQuery:'',window,document,undefined);(function(){if(!Element.prototype.closest){Element.prototype.closest=function(a){var b=this,c,d;['matches','webkitMatchesSelector','mozMatchesSelector','msMatchesSelector','oMatchesSelector'].some(function(fn){if(typeof document.body[fn]==='function'){c=fn;return true}return false});if(b&&c&&b[c](a))return b;while(b){d=b.parentElement;if(d&&c&&d[c](a))return d;b=d}return null}}})(); From 06164f0054eb42867104924b17bca1ebcf84e641 Mon Sep 17 00:00:00 2001 From: Mr B Date: Mon, 14 May 2018 14:01:32 +0100 Subject: [PATCH 215/274] Update index.css --- manager/media/style/default/css/index.css | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/manager/media/style/default/css/index.css b/manager/media/style/default/css/index.css index 4b893e5439..ce4ddf94fc 100755 --- a/manager/media/style/default/css/index.css +++ b/manager/media/style/default/css/index.css @@ -1,12 +1,17 @@ -html, body { height: 100%; overflow: auto; -webkit-overflow-scrolling: touch; /* ios iframe scroll jumping to top fix */ } +@supports (-webkit-overflow-scrolling: touch) { +html, body { height: 100%; overflow: auto; -webkit-overflow-scrolling: touch; /* ios iframe scroll jumping to top fix */ } +} #frameset { position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; } #mainMenu, #tree, #main { position: absolute; } #mainMenu { top: 0; left: 0; width: 100%; height: 2.2rem; z-index: 100; } #tree { left: 0; top: 2.2rem; bottom: 0; width: 25rem; max-width: 100%; overflow: hidden; z-index: 2; } #main { left: 25rem; top: 2.2rem; right: 0; bottom: 0; z-index: 1; } -#main #mainframe, #main .tabframes { display: block; position: absolute; height: 100%; overflow: auto; min-width: 100%!important; width: 100px!important; *width: 100%!important; /* includes ios iframe scroll fix */ } -.iframe-scroller { -webkit-overflow-scrolling: touch; overflow: auto; width:100%; height:100%; /* ios iframe scroll fix */ } -.evo-tab-page.iframe-scroller { height:calc(100% - 2.3em) } +#main #mainframe { display: block; position: absolute; width: 100%; height: 100%; overflow: auto;} + +.ios #main #mainframe, .ios #main .tabframes { overflow: hidden !important; min-width: 100%!important; width: 100px!important; *width: 100%!important; } +.ios .iframe-scroller { -webkit-overflow-scrolling: touch; overflow: auto; width:100%; height:100%; } +.ios .evo-tab-page.iframe-scroller { height:calc(100% - 2.3em) } + /* floater */ #floater { position: fixed; z-index: 1000; opacity: 0; visibility: hidden; max-width: 20rem; padding: 1.5rem; top: 4rem; left: 2rem; border-radius: 0.25rem; background-color: #fff; -webkit-box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3); transition-duration: 0.15s } #floater.show { opacity: 1; visibility: visible; } From e187b82b488a91c951104f92d060adcb80c24b20 Mon Sep 17 00:00:00 2001 From: Mr B Date: Mon, 14 May 2018 14:49:12 +0100 Subject: [PATCH 216/274] Update modx.js --- manager/media/style/default/js/modx.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/manager/media/style/default/js/modx.js b/manager/media/style/default/js/modx.js index 5a14685675..a7c95b31d7 100755 --- a/manager/media/style/default/js/modx.js +++ b/manager/media/style/default/js/modx.js @@ -1544,7 +1544,11 @@ this.page = d.createElement('div'); this.page.id = 'evo-tab-page-' + this.uid; this.page.className = 'evo-tab-page iframe-scroller show'; - this.page.innerHTML = ''; + if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) { + this.page.innerHTML=''; + } else { + this.page.innerHTML='' + }; d.getElementById('main').appendChild(this.page); console.time('load-tab'); this.page.firstElementChild.onload = function(e) { From 4ec898d8cbe031950e65d2f93acae95e4f6ff239 Mon Sep 17 00:00:00 2001 From: Mr B Date: Mon, 14 May 2018 14:55:08 +0100 Subject: [PATCH 217/274] Update modx.min.js --- manager/media/style/default/js/modx.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/media/style/default/js/modx.min.js b/manager/media/style/default/js/modx.min.js index 0da10ed91a..c395b1d38f 100755 --- a/manager/media/style/default/js/modx.min.js +++ b/manager/media/style/default/js/modx.min.js @@ -1 +1 @@ -(function($,w,d,u){'use strict';modx.extended({frameset:'frameset',minWidth:840,isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),typesactions:{'16':1,'301':2,'78':3,'22':4,'102':5,'108':6,'3':7,'4':7,'6':7,'27':7,'61':7,'62':7,'63':7,'72':7},thememodes:['','lightness','light','dark','darkness'],tabsTimer:0,popupTimer:0,init:function(){if(!localStorage.getItem('MODX_widthSideBar')){localStorage.setItem('MODX_widthSideBar',this.config.tree_width)}this.mainmenu.init();if(w.location.hash){if(modx.getActionFromUrl(w.location.hash,2)){w.history.replaceState(null,d.title,modx.MODX_MANAGER_URL)}else if(modx.getActionFromUrl(w.location.hash)||modx.main.getQueryVariable('filemanager',w.location.hash)){var url=modx.main.getQueryVariable('filemanager',w.location.hash)?modx.MODX_MANAGER_URL+modx.main.getQueryVariable('filemanager',w.location.hash)+w.location.hash.replace('#?','?'):w.location.href.replace('#?','?');if(modx.config.global_tabs){modx.tabs({url:url,title:'blank'})}else if(w.main){w.main.frameElement.src=url}else{modx.openWindow(url)}}}this.resizer.init();this.search.init();if(this.config.session_timeout>0){w.setInterval(this.keepMeAlive,1000*60*this.config.session_timeout)}if(modx.config.mail_check_timeperiod>0&&modx.permission.messages){setTimeout('modx.updateMail(true)',1000)}d.addEventListener('click',this.hideDropDown,false);if(modx.config.global_tabs){d.addEventListener('click',this.tabs,false);this.tabs({url:'?a=2',reload:0})}},mainmenu:{id:'mainMenu',init:function(){var $mm=$('#mainMenu'),mm=d.getElementById('mainMenu'),timer;$mm.on('click','a',function(e){if($(this).hasClass('dropdown-toggle')){if($mm.hasClass('show')&&($(this).hasClass('selected')||!modx.isMobile&&$(this).parent().hasClass('hover'))){$(this).removeClass('selected');$mm.removeClass('show')}else{$('.nav > li > a:not(:hover)').removeClass('selected');$(this).addClass('selected');$mm.addClass('show')}e.stopPropagation();e.target.dataset.toggle='#mainMenu';modx.hideDropDown(e)}if($(this).closest('ul').hasClass('dropdown-menu')&&!$(this).parent('li').hasClass('dropdown-back')){$('.nav > .active').removeClass('active');$('.nav li.selected').removeClass('selected');$(this).closest('.nav > li').addClass('active');if(this.offsetParent.id){d.getElementById(this.offsetParent.id.substr(7)).classList.add('selected')}if((modx.isMobile||w.innerWidth li',function(){var els=mm.querySelectorAll('.nav > li.hover:not(:hover)');for(var i=0;i li li',function(e){var self=this,ul;var els=mm.querySelectorAll('.nav > li li.hover:not(:hover)');for(var i=0;i'+modx.lang.paging_prev+''+data}ul.id='parent_'+self.id;ul.innerHTML=data;var id=w.location.hash.substr(2).replace(/=/g,'_').replace(/&/g,'__');var el=d.getElementById(id);if(el){el.parentNode.classList.add('selected');d.getElementById(el.parentNode.parentNode.id.substr(7)).classList.add('selected')}for(var i=0;iitems.length-1){index=items.length-1}if(index>=0&&index2){s.timer=setTimeout(function(){s.loader.style.display='block';modx.get(modx.MODX_MANAGER_URL+'?a=71&ajax=1&submitok=Search&searchid='+s.input.value,function(data){s.loader.style.display='none';s.results=data.querySelector('.ajaxSearchResults');if(s.results&&s.results.innerHTML!==''){s.result.innerHTML=s.results.outerHTML;s.open();s.result.onclick=function(e){var t=e.target,p=t.parentNode;if(t.tagName==='I'){modx.openWindow({title:p.innerText,id:p.id,url:p.href});e.preventDefault();e.stopPropagation()}else{var a=t.tagName==='A'&&t||p.tagName==='A'&&p;if(a){var el=s.result.querySelector('.selected');if(el)el.className='';a.className='selected';if(modx.isMobile)s.close()}}}}else{s.empty()}},'document')},300)}else{s.empty()}};if(modx.isMobile){this.input.onblur=this.close}this.input.onfocus=this.open;this.input.onclick=this.open;this.input.onmouseenter=this.open;this.result.onmouseenter=this.open;this.result.onmouseleave=this.close;this.mask.onmouseenter=this.open;this.mask.onmouseleave=this.close},open:function(){if(modx.search.results){modx.search.result.classList.add('open')}},close:function(){modx.search.result.classList.remove('open')},empty:function(){modx.search.result.classList.remove('open');modx.search.result.innerHTML=''}},main:{id:'main',idFrame:'mainframe',as:null,onload:function(e){w.main=e.target.contentWindow||e.target.defaultView;modx.main.tabRow.init();modx.main.stopWork();modx.main.scrollWork();w.main.document.addEventListener('click',modx.hideDropDown,false);w.main.document.addEventListener('contextmenu',modx.main.oncontextmenu,false);if(modx.config.global_tabs){w.main.document.addEventListener('click',modx.tabs,false)}w.history.replaceState(null,d.title,modx.getActionFromUrl(w.main.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.main.location.search);setTimeout('modx.tree.restoreTree()',100)},oncontextmenu:function(e){if(e.ctrlKey)return;var el=e.target;if(modx.user.role===1&&/modxtv|modxplaceholder|modxattributevalue|modxchunk|modxsnippet|modxsnippetnocache/i.test(el.className)){var id=Date.now(),name=el.innerText.replace(/[\[|\]|{|}|\*||\#|\+|?|\!|&|=|`|:]/g,''),type=el.className.replace(/cm-modx/,''),n=!!name.replace(/^\d+$/,'');if(name&&n){e.preventDefault();modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',{a:'modxTagHelper',name:name,type:type},function(r){if(r){r=JSON.parse(r);for(var k in r){if(r.hasOwnProperty(k)&&r[k].url){r[k]['onclick']='if(event.shiftKey){modx.openWindow({url:\''+r[k].url+'\'})}else{modx.popup({url:\''+r[k].url+'\',title:\''+r.header.innerHTML+'\',width:\'95%\',height:\'95%\',margin:0,hide:0,hover:0,overlay:1,overlayclose:0,position:\'center elements\',animation:0,icon:\'none\'})}'}}r=JSON.stringify(r);el.id='node'+id;el.dataset.contextmenu=r;modx.tree.showPopup(e,id,name)}})}e.preventDefault()}},tabRow:{init:function(){var row=w.main.document.querySelector('.tab-pane > .tab-row');if(row)this.build(row)},build:function(row){var rowContainer=d.createElement('div'),sel=row.querySelector('.selected');rowContainer.className='tab-row-container';row.parentNode.insertBefore(rowContainer,row);rowContainer.appendChild(row);var p=d.createElement('i');p.className='fa fa-angle-left prev disable';p.onclick=function(e){e.stopPropagation();e.preventDefault();var sel=row.querySelector('.selected');if(sel.previousSibling){sel.previousSibling.click();modx.main.tabRow.scroll(row)}};rowContainer.appendChild(p);var n=d.createElement('i');n.className='fa fa-angle-right next disable';n.onclick=function(e){e.stopPropagation();e.preventDefault();var sel=row.querySelector('.selected');if(sel.nextSibling){sel.nextSibling.click();modx.main.tabRow.scroll(row)}};rowContainer.appendChild(n);setTimeout(function(){sel=row.querySelector('.selected');modx.main.tabRow.scroll(row,sel);w.main.addEventListener('resize',function(){modx.main.tabRow.scroll(row)},false);if(sel){if(sel.previousSibling)p.classList.remove('disable');if(sel.nextSibling)n.classList.remove('disable')}},100);row.onclick=function(e){var sel=e.target.tagName==='H2'?e.target:e.target.tagName==='SPAN'?e.target.parentNode:null;if(sel){if(sel.previousSibling){this.parentNode.querySelector('i.prev').classList.remove('disable')}else{this.parentNode.querySelector('i.prev').classList.add('disable')}if(sel.nextSibling){this.parentNode.querySelector('i.next').classList.remove('disable')}else{this.parentNode.querySelector('i.next').classList.add('disable')}modx.main.tabRow.scroll(this,sel)}}},scroll:function(row,sel,a){sel=sel||row.querySelector('.selected')||row.firstChild;a=a||100;var c=0,elms=row.childNodes;for(var i=0;isel.offsetLeft){$(row).animate({scrollLeft:sel.offsetLeft-(sel.previousSibling?30:1)},a)}if(sel.offsetLeft+sel.offsetWidth>row.offsetWidth+row.scrollLeft){$(row).animate({scrollLeft:sel.offsetLeft-row.offsetWidth+sel.offsetWidth+(sel.nextSibling?30:0)},a)}if(c>row.offsetWidth){this.drag(row)}},drag:function(row){row.onmousedown=function(e){if(e.button===0){e.preventDefault();var x=e.clientX,f=row.scrollLeft;row.ownerDocument.body.focus();row.onmousemove=row.ownerDocument.onmousemove=function(e){if(Math.abs(e.clientX-x)>5){e.stopPropagation();row.scrollLeft=f-(e.clientX-x);row.ownerDocument.body.classList.add('drag')}};row.onmouseup=row.ownerDocument.onmouseup=function(e){e.stopPropagation();row.onmousemove=null;row.ownerDocument.onmousemove=null;row.ownerDocument.body.classList.remove('drag')}}}}},work:function(){d.getElementById('mainloader').classList.add('show')},stopWork:function(){d.getElementById('mainloader').classList.remove('show')},scrollWork:function(){var a=w.main.frameElement.contentWindow,b=a.location.search.substring(1)||a.location.hash.substring(2),c=localStorage.getItem('page_y')||0,f=localStorage.getItem('page_url')||b;if(((modx.getActionFromUrl(f)===modx.getActionFromUrl(b))&&(modx.main.getQueryVariable('id',f)&&modx.main.getQueryVariable('id',f)===modx.main.getQueryVariable('id',b)))||(f===b)){a.scrollTo(0,c)}a.addEventListener('scroll',function(){if(this.pageYOffset>=0){localStorage.setItem('page_y',this.pageYOffset.toString());localStorage.setItem('page_url',b)}},false)},getQueryVariable:function(a,b){var f='';if(b||typeof b==='string'){b=b.split('?');b=b[1]||b[0];b=b.split('&');for(var i=0;iMath.abs(ay)&&this.swipe){if(ax<0&&this.sidebar){if(Math.abs(ax)>h)ax=-h;tree.style.transform='translate3d('+ax+'px, 0, 0)';tree.style.WebkitTransform='translate3d('+ax+'px, 0, 0)';modx.resizer.mask.style.opacity=(0.5-0.5/-h*ax).toFixed(2);if(Math.abs(ax)>h/3){this.swipe='left'}else{this.swipe='right'}}else if(ax>0&&!this.sidebar){if(Math.abs(ax)>h)ax=h;tree.style.transform='translate3d('+ -(h-ax)+'px, 0, 0)';tree.style.WebkitTransform='translate3d('+ -(h-ax)+'px, 0, 0)';modx.resizer.mask.style.opacity=(0.5/h*ax).toFixed(2);if(Math.abs(ax)>h/3){this.swipe='right'}else{this.swipe='left'}}}},false);w.addEventListener('touchend',function(){if(this.swipe==='left'){d.body.classList.add('sidebar-closed');modx.resizer.setWidth(0)}if(this.swipe==='right'){d.body.classList.remove('sidebar-closed');modx.resizer.setWidth(h)}tree.style.cssText='';modx.resizer.mask.style.cssText=''},false)}},onMouseDown:function(e){e=e||w.event;modx.resizer.dragElement=e.target!==null?e.target:e.srcElement;if((e.buttons===1||e.button===0)&&modx.resizer.dragElement.id===modx.resizer.id){modx.resizer.oldZIndex=modx.resizer.dragElement.style.zIndex;modx.resizer.dragElement.style.zIndex=modx.resizer.newZIndex;modx.resizer.dragElement.style.background=modx.resizer.background;localStorage.setItem('MODX_widthSideBar',modx.resizer.dragElement.offsetLeft>0?modx.resizer.dragElement.offsetLeft:0);d.body.appendChild(modx.resizer.mask);d.onmousemove=modx.resizer.onMouseMove;d.body.focus();d.body.classList.add('resizer_move');d.onselectstart=function(){return false};modx.resizer.dragElement.ondragstart=function(){return false};return false}},onMouseMove:function(e){e=e||w.event;if(e.clientX>0){modx.resizer.left=e.clientX}else{modx.resizer.left=0}modx.resizer.dragElement.style.left=modx.pxToRem(modx.resizer.left)+'rem';d.getElementById('tree').style.width=modx.pxToRem(modx.resizer.left)+'rem';d.getElementById('main').style.left=modx.pxToRem(modx.resizer.left)+'rem';if(e.clientX<-2||e.clientY<-2){modx.resizer.onMouseUp(e)}},onMouseUp:function(e){if(modx.resizer.dragElement!==null&&e.button===0&&modx.resizer.dragElement.id===modx.resizer.id){if(e.clientX>0){d.body.classList.remove('sidebar-closed');modx.resizer.left=e.clientX}else{d.body.classList.add('sidebar-closed');modx.resizer.left=0}d.cookie='MODX_widthSideBar='+modx.pxToRem(modx.resizer.left);modx.resizer.dragElement.style.zIndex=modx.resizer.oldZIndex;modx.resizer.dragElement.style.background='';modx.resizer.dragElement.ondragstart=null;modx.resizer.dragElement=null;d.body.classList.remove('resizer_move');d.body.removeChild(modx.resizer.mask);d.onmousemove=null;d.onselectstart=null}},toggle:function(){if(modx.isMobile||w.innerWidth<=modx.minWidth){if(d.body.classList.contains('sidebar-closed')){d.body.classList.remove('sidebar-closed');localStorage.setItem('MODX_widthSideBar',0);d.cookie='MODX_widthSideBar='+modx.pxToRem(parseInt(d.getElementById('tree').offsetWidth))}else{localStorage.setItem('MODX_widthSideBar',parseInt(d.getElementById('tree').offsetWidth));d.body.classList.add('sidebar-closed');d.cookie='MODX_widthSideBar=0'}}else{var p=d.getElementById('tree').offsetWidth!==0?0:parseInt(localStorage.getItem('MODX_widthSideBar'))?parseInt(localStorage.getItem('MODX_widthSideBar')):modx.config.tree_width;modx.resizer.setWidth(p)}},setWidth:function(a){if(a>0){localStorage.setItem('MODX_widthSideBar',0);d.body.classList.remove('sidebar-closed')}else{localStorage.setItem('MODX_widthSideBar',parseInt(d.getElementById('tree').offsetWidth));d.body.classList.add('sidebar-closed')}d.cookie='MODX_widthSideBar='+modx.pxToRem(a);d.getElementById('tree').style.width=modx.pxToRem(a)+'rem';d.getElementById('resizer').style.left=modx.pxToRem(a)+'rem';d.getElementById('main').style.left=modx.pxToRem(a)+'rem'},setDefaultWidth:function(){modx.resizer.setWidth(modx.remToPx(modx.config.tree_width))}},tree:{ctx:null,rpcNode:null,itemToChange:'',selectedObjectName:null,selectedObject:0,selectedObjectDeleted:0,selectedObjectUrl:'',drag:false,deleted:[],init:function(){this.restoreTree()},draggable:function(){if(modx.permission.dragndropdocintree){var els=d.querySelectorAll('#treeRoot a:not(.empty)');for(var i=0;i-1:true;modx.tree.itemToChange=this.dataset.id||this.parentNode.id.replace('node','');modx.tree.selectedObjectName=this.dataset.titleEsc;if(draggable){this.parentNode.draggable=true;this.parentNode.ondragstart=modx.tree.ondragstart}else{this.parentNode.draggable=false;this.parentNode.ondragstart=function(){return false}}}},ondragstart:function(e){e.dataTransfer.effectAllowed='all';e.dataTransfer.dropEffect='all';e.dataTransfer.setData('text',this.id.substr(4))},ondragenter:function(e){if(d.getElementById('node'+modx.tree.itemToChange)===(this.parentNode.closest('#node'+modx.tree.itemToChange)||this.parentNode)){this.parentNode.className='';e.dataTransfer.effectAllowed='none';e.dataTransfer.dropEffect='none';modx.tree.drag=false}else{this.parentNode.className='dragenter';e.dataTransfer.effectAllowed='copy';e.dataTransfer.dropEffect='copy';modx.tree.drag=true}e.preventDefault()},ondragover:function(e){if(modx.tree.drag){var a=e.clientY;var b=parseInt(this.getBoundingClientRect().top);var c=a-b;if(c>this.offsetHeight/1.51){this.parentNode.classList.add('dragafter');this.parentNode.classList.remove('dragbefore');this.parentNode.classList.remove('dragenter');e.dataTransfer.effectAllowed='link';e.dataTransfer.dropEffect='link'}else if(c'}if(this.nextSibling){if(this.nextSibling.innerHTML){this.nextSibling.appendChild(el)}else{el.parentNode.removeChild(el)}els=this.parentNode.lastChild.children;for(i=0;i'}this.parentNode.parentNode.insertBefore(el,this.parentNode.nextSibling);els=this.parentNode.parentNode.children;for(i=0;i'}this.parentNode.parentNode.insertBefore(el,this.parentNode);els=this.parentNode.parentNode.children;for(i=0;i-1:true)){alert(modx.lang.error_no_privileges);modx.tree.restoreTree();return}modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',{a:'movedocument',id:id,parent:parent,menuindex:menuindex},function(r){if(r.errors)alert(r.errors);modx.tree.restoreTree()},'json');var b=w.main.frameElement.contentWindow.location.search.substr(1);if(modx.getActionFromUrl(b,27)&&parseInt(modx.main.getQueryVariable('id',b))===parseInt(id)){var index=menuindex.indexOf(id),elMenuIndex=w.main.document.querySelector('#documentPane input[name=menuindex]'),elParent=w.main.document.querySelector('#documentPane input[name=parent]'),elParentName=w.main.document.querySelector('#documentPane #parentName');if(elMenuIndex&&index>=0)elMenuIndex.value=index;if(elParent&&elParentName){elParent.value=parent;elParentName.innerHTML=parent+' ('+d.querySelector('#node'+parent+' > a').dataset.titleEsc+')'}}},toggleTheme:function(){var a,b=1,myCodeMirrors=w.main.myCodeMirrors,key;if(typeof localStorage['MODX_themeMode']==='undefined'){localStorage['MODX_themeMode']=modx.config.theme_mode}if(modx.thememodes[parseInt(localStorage['MODX_themeMode'])+1]){b=parseInt(localStorage['MODX_themeMode'])+1}a=modx.thememodes[b];for(key in modx.thememodes){if(modx.thememodes[key]){d.body.classList.remove(modx.thememodes[key]);w.main.document.body.classList.remove(modx.thememodes[key])}}d.body.classList.add(a);w.main.document.body.classList.add(a);d.cookie='MODX_themeMode='+b;localStorage['MODX_themeMode']=b;if(typeof myCodeMirrors!=='undefined'){for(key in myCodeMirrors){if(myCodeMirrors.hasOwnProperty(key)){if(~a.indexOf('dark')){w.main.document.getElementsByName(key)[0].nextElementSibling.classList.add('cm-s-'+myCodeMirrors[key].options.darktheme);w.main.document.getElementsByName(key)[0].nextElementSibling.classList.remove('cm-s-'+myCodeMirrors[key].options.defaulttheme)}else{w.main.document.getElementsByName(key)[0].nextElementSibling.classList.remove('cm-s-'+myCodeMirrors[key].options.darktheme);w.main.document.getElementsByName(key)[0].nextElementSibling.classList.add('cm-s-'+myCodeMirrors[key].options.defaulttheme)}}}}},toggleNode:function(e,id){e=e||w.event;if(e.ctrlKey)return;e.stopPropagation();var el=d.getElementById('node'+id).firstChild;this.rpcNode=el.nextSibling;var toggle=el.querySelector('.toggle'),icon=el.querySelector('.icon');if(this.rpcNode.innerHTML===''){if(toggle)toggle.innerHTML=el.dataset.iconCollapsed;icon.innerHTML=el.dataset.iconFolderOpen;var rpcNodeText=this.rpcNode.innerHTML,loadText=modx.lang.loading_doc_tree;modx.openedArray[id]=1;if(rpcNodeText===''||rpcNodeText.indexOf(loadText)>0){var folderState=this.getFolderState();d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent='+el.dataset.indent+'&parent='+id+'&expandAll='+el.dataset.expandall+folderState,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})}this.saveFolderState()}else{if(toggle)toggle.innerHTML=el.dataset.iconExpanded;icon.innerHTML=el.dataset.iconFolderClose;delete modx.openedArray[id];this.rpcNode.style.overflow='hidden';$(this.rpcNode.firstChild).animate({marginTop:-this.rpcNode.offsetHeight+'px'},100,function(){this.parentNode.innerHTML=''});this.saveFolderState()}e.preventDefault()},rpcLoadData:function(a){if(this.rpcNode!==null){var el;this.rpcNode.innerHTML=typeof a==='object'?a.responseText:a;this.rpcNode.loaded=true;if(this.rpcNode.firstChild.tagName==='DIV'){if(this.rpcNode.id==='treeRoot'){el=d.getElementById('binFull');if(el){this.showBin(true)}else{this.showBin(false)}}else{this.rpcNode.style.overflow='hidden';this.rpcNode.firstElementChild.style.marginTop=-this.rpcNode.offsetHeight+'px';$(this.rpcNode.firstChild).animate({marginTop:0},100)}d.getElementById('treeloader').classList.remove('visible')}else{el=d.getElementById('loginfrm');if(el){this.rpcNode.parentNode.removeChild(this.rpcNode);w.location.href=modx.MODX_MANAGER_URL}}}},treeAction:function(e,id,title){if(e.ctrlKey)return;var el=d.getElementById('node'+id).firstChild,treepageclick=el.dataset.treepageclick,showchildren=parseInt(el.dataset.showchildren),openfolder=parseInt(el.dataset.openfolder);title=title||el.dataset&&el.dataset.titleEsc;if(tree.ca==='move'){try{this.setSelectedByContext(id);w.main.setMoveValue(id,title)}catch(oException){alert(modx.lang.unable_set_parent)}}if(tree.ca==='open'||tree.ca===''){if(id===0){href='?a=2'}else{var href='';if(!isNaN(treepageclick)&&isFinite(treepageclick)){href='?a='+treepageclick+'&r=1&id='+id+(openfolder===0?this.getFolderState():'')}else{href=treepageclick}if(openfolder===2){if(showchildren!==1){href=''}this.toggleNode(e,id)}}if(href){if(e.shiftKey){w.getSelection().removeAllRanges();modx.openWindow(href);this.restoreTree()}else{modx.tabs({url:modx.MODX_MANAGER_URL+href,title:title+'('+id+')'});if(modx.isMobile&&w.innerWidth0?e.clientX:e.pageX;y=e.clientY>0?e.clientY:e.pageY;e.view.position=e.view.frameElement?e.view.frameElement.getBoundingClientRect():e.target.offsetParent.getBoundingClientRect();if(e.view.frameElement){x+=e.view.position.left;y+=e.view.frameElement.offsetParent.offsetTop}else{if(e.target.parentNode.parentNode.classList.contains('node')){x+=50}}if(x>e.view.position.width){x=e.view.position.width-this.ctx.offsetWidth}if(y+this.ctx.offsetHeight/2>e.view.position.height){y=e.view.position.height-this.ctx.offsetHeight-5}else if(y-this.ctx.offsetHeight/20?e.clientX:e.pageX;y=e.clientY>0?e.clientY:e.pageY;if(y+ctx.offsetHeight/2>bodyHeight){y=bodyHeight-ctx.offsetHeight-5}else if(y-ctx.offsetHeight/230){this.selectedObjectName=this.selectedObjectName.substr(0,30)+'...'}var f=d.getElementById('nameHolder');f.innerHTML=this.selectedObjectName;el.style.left=a+(modx.config.textdir?'-190':'')+'px';el.style.top=b+'px';el.classList.add('show')},menuHandler:function(a){switch(a){case 1:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=3&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 2:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=27&r=1&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 3:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=4&pid='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 4:if(this.selectedObjectDeleted){alert('"'+this.selectedObjectName+'" '+modx.lang.already_deleted)}else if(confirm('"'+this.selectedObjectName+'"\n\n'+modx.lang.confirm_delete_resource)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=6&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 5:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=51&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 6:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=72&pid='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 7:if(confirm(modx.lang.confirm_resource_duplicate)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=94&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 8:if(d.getElementById('node'+this.itemToChange).firstChild.dataset.deleted){if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_undelete)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=63&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}}else{alert('"'+this.selectedObjectName+'"'+modx.lang.not_deleted)}break;case 9:if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_publish)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=61&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 10:if(this.itemToChange!==modx.config.site_start){if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_unpublish)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=62&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}}else{alert('Document is linked to site_start variable and cannot be unpublished!')}break;case 11:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=56&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 12:w.open(d.getElementById('node'+this.itemToChange).firstChild.dataset.href,'previeWin');break;default:alert('Unknown operation command.')}},setSelected:function(a){var el=d.querySelector('#tree .current');if(el)el.classList.remove('current');if(a){if(typeof a==='object'){a.classList.add('current')}else{el=d.querySelector('#node'+a+'>.node')||d.getElementById('node'+a);if(el)el.classList.add('current')}}},setActiveFromContextMenu:function(a){var el=d.querySelector('#node'+a+'>.node');if(el)this.setSelected(el)},setSelectedByContext:function(a){var el=d.querySelector('#treeRoot .selected');if(el)el.classList.remove('selected');el=d.querySelector('#node'+a+'>.node');if(el)el.classList.add('selected')},setItemToChange:function(){var a=w.main.document&&(w.main.document.URL||w.main.document.location.search),b=modx.getActionFromUrl(a);if(a&&modx.typesactions[b]){this.itemToChange=(modx.typesactions[b]===7?'':modx.typesactions[b]+'_')+parseInt(modx.main.getQueryVariable('id',a))}else{this.itemToChange=''}this.setSelected(this.itemToChange)},restoreTree:function(){if(d.getElementById('treeRoot')){d.getElementById('treeloader').classList.add('visible');this.setItemToChange();this.rpcNode=d.getElementById('treeRoot');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=2&id='+this.itemToChange,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})}},expandTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=1&id='+this.itemToChange,function(r){modx.tree.rpcLoadData(r);modx.tree.saveFolderState();modx.tree.draggable()})},collapseTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=0&id='+this.itemToChange,function(r){modx.openedArray=[];modx.tree.saveFolderState();modx.tree.rpcLoadData(r);modx.tree.draggable()})},updateTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');var a=d.sortFrm;var b='a=1&f=nodes&indent=1&parent=0&expandAll=2&dt='+a.dt.value+'&tree_sortby='+a.sortby.value+'&tree_sortdir='+a.sortdir.value+'&tree_nodename='+a.nodename.value+'&id='+this.itemToChange+'&showonlyfolders='+a.showonlyfolders.value;modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',b,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})},getFolderState:function(){var a;if(modx.openedArray!==[0]){a='&opened=';for(var key in modx.openedArray){if(modx.openedArray[key]){a+=key+'|'}}}else{a='&opened='}return a},saveFolderState:function(){modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&savestateonly=1'+this.getFolderState())},showSorter:function(e){e=e||w.event;var el=d.getElementById('floater');e.target.dataset.toggle='#floater';el.classList.toggle('show');el.onclick=function(e){e.stopPropagation()}},emptyTrash:function(){if(confirm(modx.lang.confirm_empty_trash)===true){modx.get(modx.MODX_MANAGER_URL+'?a=64',function(){modx.tabsClose(modx.tree.deleted);modx.tree.deleted=[];modx.tree.restoreTree()})}},showBin:function(a){var el=d.getElementById('treeMenu_emptytrash');if(el){if(a){el.title=modx.lang.empty_recycle_bin;el.classList.remove('disabled');el.innerHTML=modx.style.empty_recycle_bin;el.onclick=function(){modx.tree.emptyTrash()};var els=d.getElementById('tree').querySelectorAll('.deleted');for(var i=0;i0){if(el){el.innerHTML=c[0];el.style.display='block'}}else{if(el)el.style.display='none'}if(c[1]>0){el=d.getElementById('newMail');if(el){el.innerHTML=''+modx.style.email+modx.lang.inbox+' ('+c[0]+' / '+c[1]+')';el.style.display='block'}}if(modx.config.mail_check_timeperiod>0)setTimeout('modx.updateMail(true)',1000*modx.config.mail_check_timeperiod)})}}catch(oException){setTimeout('modx.updateMail(true)',1000*modx.config.mail_check_timeperiod)}},openWindow:function(a){if(typeof a!=='object'){a={'url':a}}if(!a.width)a.width=parseInt(w.innerWidth*0.9)+'px';if(!a.height)a.height=parseInt(w.innerHeight*0.8)+'px';if(!a.left)a.left=parseInt(w.innerWidth*0.05)+'px';if(!a.top)a.top=parseInt(w.innerHeight*0.1)+'px';if(!a.title)a.title=Math.floor((Math.random()*999999)+1);if(a.url){if(this.plugins.EVOmodal===1){top.EVO.modal.show(a)}else{w.open(a.url,a.title,'width='+a.width+',height='+a.height+',top='+a.top+',left='+a.left+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no')}}},tabsClose:function(a){if(modx.config.global_tabs&&a){for(var k in a){if(a.hasOwnProperty(k)){var el=d.getElementById(a[k]);if(el){el.firstElementChild.contentWindow.documentDirty=false;el.close()}}}}},tabs:function(a){function Tabs(a){var s=this;this.url=a.url;this.title=a.title||'';this.name=a.name||'';this.timer=null;this.olduid='';this.closeactions=[6,61,62,63,94];this.reload=typeof a.reload!=='undefined'?a.reload:1;this.action=modx.getActionFromUrl(a.url);this.uid=modx.getActionFromUrl(a.url,2)?'home':modx.urlToUid(a.url);this.page=d.getElementById('evo-tab-page-'+this.uid);this.row=d.getElementsByClassName('evo-tab-row')[0].firstElementChild;this.tab=d.getElementById('evo-tab-'+this.uid);if(this.page){if(this.uid==='home'){if(this.reload){this.page.firstElementChild.src=this.url;this.show()}else{this.reload=1;if(this.tab.onclick===null){this.tab.onclick=function(e){s.select.call(s,e,this)}}this.tab.show=function(e){s.show.call(s,e)};modx.tabs.selected=this.tab}}else{this.show();if(~this.closeactions.indexOf(this.action)){this.setDocPublished();modx.get(this.url,function(){modx.tree.restoreTree()})}}}else if(~this.closeactions.indexOf(this.action)){modx.get(this.url,function(){modx.tree.restoreTree()})}else{this.create()}}Tabs.prototype={create:function(){var s=this;modx.main.work();modx.tabs.selected=this.row.querySelector('.selected');if(modx.tabs.selected){d.getElementById(modx.tabs.selected.id.replace('tab','tab-page')).classList.remove('show');modx.tabs.selected.classList.remove('selected')}this.page=d.createElement('div');this.page.id='evo-tab-page-'+this.uid;this.page.className='evo-tab-page iframe-scroller show';this.page.innerHTML='';d.getElementById('main').appendChild(this.page);console.time('load-tab');this.page.firstElementChild.onload=function(e){s.onload.call(s,e);console.timeEnd('load-tab')};this.tab=d.createElement('h2');this.tab.id='evo-tab-'+this.uid;this.tab.className='tab selected';this.icon='';if(!/'}this.tab.innerHTML=''+this.icon+this.title+'×';this.row.appendChild(this.tab);this.tab.onclick=function(e){s.select.call(s,e,this)};this.tab.close=function(e){s.close.call(s,e)};this.tab.show=function(e){s.show.call(s,e)};this.page.close=function(e){s.close.call(s,e)}},onload:function(e){var s=this;w.main=e.target.contentWindow||e.target.defaultView;this.url=w.main.location.search||w.location.hash.substring(1);this.olduid=this.uid;this.uid=modx.urlToUid(this.url);if(!!w.main.__alertQuit){w.main.alert=function(a){};var message=w.main.document.body.innerHTML;w.main.document.body.innerHTML='';history.pushState(null,d.title,modx.getActionFromUrl(w.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.location.search);w.onpopstate=function(){history.go(1)};modx.popup({type:'warning',title:'MODX :: Alert',position:'top center alertQuit',content:message,wrap:'body'});modx.getLockedElements(modx.getActionFromUrl(this.url),modx.main.getQueryVariable('id',this.url),function(data){if(!!data){s.page.close();modx.tree.restoreTree()}else{w.main.location.href=modx.MODX_MANAGER_URL+s.url;w.history.replaceState(null,d.title,modx.getActionFromUrl(s.url,2)?modx.MODX_MANAGER_URL:'#'+s.url)}})}else{if(modx.getActionFromUrl(this.url,2)){this.close(e)}else if(this.olduid!==this.uid&&d.getElementById('evo-tab-'+this.uid)){this.close(e);d.getElementById('evo-tab-'+this.uid).show()}else{this.title=w.main.document.body.querySelectorAll('h1')[0]&&w.main.document.body.querySelectorAll('h1')[0].innerHTML||this.title;if(this.title&&this.uid!=='home'){this.tab.innerHTML=''+this.title+'×'}this.page.id='evo-tab-page-'+this.uid;this.tab.id='evo-tab-'+this.uid;this.tab.classList.remove('changed');this.show();modx.main.onload(e);w.main.document.addEventListener('click',function a(e){if(typeof e.view.documentDirty!=='undefined'&&e.view.documentDirty&&!s.tab.classList.contains('changed')){s.tab.classList.add('changed');this.removeEventListener(e.type,a,false)}},false);w.main.document.addEventListener('keyup',function a(e){if(typeof e.view.documentDirty!=='undefined'&&e.view.documentDirty&&!s.tab.classList.contains('changed')){s.tab.classList.add('changed');this.removeEventListener(e.type,a,false)}},false)}}},show:function(){var s=this;modx.tabs.selected=this.row.querySelector('.selected');if(modx.tabs.selected&&modx.tabs.selected!==this.tab){d.getElementById(modx.tabs.selected.id.replace('tab','tab-page')).classList.remove('show');modx.tabs.selected.classList.remove('selected')}this.page.classList.add('show');this.tab.classList.add('selected');modx.tabs.selected=this.tab;w.main=this.page.firstElementChild.contentWindow;w.history.replaceState(null,w.main.document.title,modx.getActionFromUrl(w.main.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.main.location.search);modx.tree.setItemToChange();modx.main.tabRow.scroll(this.row,this.tab,350)},close:function(e){var documentDirty=this.page.firstElementChild.contentWindow.documentDirty;var checkDirt=!!this.page.firstElementChild.contentWindow.checkDirt;if(documentDirty&&checkDirt&&confirm(this.page.firstElementChild.contentWindow.checkDirt(e))||!documentDirty){modx.tabs.selected=this.tab.classList.contains('selected')?this.tab.previousElementSibling:this.row.querySelector('.selected');this.page.parentNode.removeChild(this.page);this.row.removeChild(this.tab);modx.tabs.selected.show()}},select:function(e){if(e.target.className==='tab-close'){this.close(e)}else if(modx.tabs.selected===this.tab){var s=this;if(this.timer){clearTimeout(this.timer);this.timer=null;w.main.location.reload()}else{this.timer=setTimeout(function(){s.timer=null},250)}}else{this.show()}},setDocPublished:function(){var el=w.main.document.getElementsByName('publishedcheck')[0];if(el){el.checked=this.action===61;w.main.document.getElementsByName('published')[0].value=+el.checked}if(modx.getActionFromUrl(w.main.location.search,3)){w.main.location.reload()}}};if(modx.config.global_tabs){if(typeof a.currentTarget!=='undefined'){var e=a;if(e.button===0&&e.target&&(e.target.tagName==='A'&&e.target.target==='main'||(e.target.parentNode&&e.target.parentNode.tagName==='A'&&e.target.parentNode.target==='main'))){a=e.target.tagName==='A'&&e.target||e.target.parentNode.tagName==='A'&&e.target.parentNode;if(e.shiftKey){modx.openWindow({url:a.href})}else{modx.tabs({url:a.href,title:a.innerHTML})}e.preventDefault()}}else{return new Tabs(a)}}else if(a.url){if(w.main){w.main.frameElement.src=a.url}else{modx.openWindow(a.url)}}},popup:function(a){if(typeof a==='object'&&(a.url||a.content||a.text)){var o={addclass:'',animation:'fade',content:a.content||a.text||'',clickclose:0,closeall:0,data:'',dataType:'document',delay:5000,draggable:!1,event:null,height:'auto',hide:1,hover:1,icon:'',iframe:'iframe',margin:'.5rem',maxheight:'',method:'GET',overlay:0,overlayclose:0,position:'center',resize:!1,selector:'',showclose:1,target:'main',uid:'',type:'default',title:'',url:'',width:'20rem',wrap:w.main.document.body,zIndex:10500,w:null,show:function(){if(~o.position.indexOf('center')){if(o.event){o.el.style.left=o.event.clientX+o.mt+'px';o.el.style.bottom=o.w.innerHeight-o.el.offsetHeight-o.event.clientY+o.mt+'px'}else{o.el.style.left=/(%)/.test(o.width)?(100-parseInt(o.width))/2-o.mt/(o.w.innerWidth/100)+'%':(o.w.innerWidth-o.el.offsetWidth)/2-o.mt+'px';o.el.style.bottom=/(%)/.test(o.height)?(100-parseInt(o.height))/2-o.mt/(o.w.innerHeight/100)+'%':(o.w.innerHeight-o.el.offsetHeight-o.wrap.offsetTop)/2-o.mt+'px'}}if(~o.position.indexOf('left')){o.el.style.left=0}if(~o.position.indexOf('right')){o.el.style.right=0}else{o.el.style.right='auto'}if(~o.position.indexOf('top')){o.el.style.top=0;o.el.style.bottom=''}else{o.el.style.top='auto'}if(~o.position.indexOf('bottom')){o.el.style.bottom=0}o.calc();o.el.className+=' in';if(o.showclose){o.el.querySelector('.close').onclick=o.close}if(o.hide){o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);o.close()},o.delay)}if(o.hover){o.el.onmouseenter=function(){clearTimeout(o.el.timer)};o.el.onmouseleave=o.close}if(o.overlayclose&&o.o){o.o.onclick=o.close}if(o.clickclose){o.el.onclick=o.close}if(o.draggable){modx.dragging(o.el,{wrap:o.wrap,resize:o.resize})}},close:function(e){o.event=e||o.event||w.event;if(o.url&&o.iframe==='iframe'){var els=o.wrap.ownerDocument.querySelectorAll('.'+o.className+'.in');if(els){var documentDirty=o.el.lastElementChild.firstElementChild.contentWindow.documentDirty;if(documentDirty&&confirm(o.el.lastElementChild.firstElementChild.contentWindow.checkDirt(o.event))||!documentDirty){o.el.classList.remove('in');if(!o.animation){o.el.classList.remove('show')}o.calc(1);if(o.o&&o.o.parentNode){o.o.parentNode.removeChild(o.o);o.wrap.style.overflow=''}o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);if(o.el.parentNode){o.el.parentNode.removeChild(o.el)}},200)}}}else{o.el.classList.remove('in');if(!o.animation){o.el.classList.remove('show')}o.calc(1);if(o.o&&o.o.parentNode){o.o.parentNode.removeChild(o.o);o.wrap.style.overflow=''}o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);if(o.el.parentNode){o.el.parentNode.removeChild(o.el)}},200)}if(typeof o.onclose==='function'){o.onclose(e,o.el)}},calc:function(f){var els=o.wrap.ownerDocument.querySelectorAll('.'+o.className+'.in[data-position="'+o.el.dataset.position+'"]');if(els&&els.length){o.els=[];for(var i=0;i×'}if(o.title){o.header=document.createElement('div');if(o.icon!=='none'){o.header.innerHTML+=''}o.header.innerHTML+=o.title;o.header.className='evo-popup-header';o.el.appendChild(o.header)}o.el.innerHTML+='
      ';o.wrap.appendChild(o.el);o.mt=parseFloat(getComputedStyle(o.el).marginTop);if(o.maxheight){o.maxheight=/(%)/.test(o.maxheight)?(o.w.innerHeight-o.el.offsetHeight-o.mt)/100*parseInt(o.maxheight):o.maxheight;o.el.lastChild.style.overflowY='auto';o.el.lastChild.style.maxHeight=o.maxheight+'px'}if(o.url){o.draggable=1;if(o.iframe==='iframe'){o.resize=1;o.uid=modx.urlToUid(a.url);o.el.className+=' '+o.addclass+' '+o.className+'-iframe';o.el.id='evo-popup-'+o.uid;d.getElementById('mainloader').className='show';o.frame=d.createElement('iframe');o.frame.width='100%';o.frame.height='100%';o.frame.frameBorder='0';o.frame.src=o.url;o.frame.onload=function(e){e.target.contentWindow.opener=o.w;a.url=e.target.contentWindow.location.href;o.uid=modx.urlToUid(a.url);o.event=e;if(!!e.target.contentWindow.__alertQuit){modx.popup({type:'warning',title:'MODX :: Alert',position:'top center alertQuit',content:e.target.contentWindow.document.body.querySelector('p').innerHTML});e.target.contentWindow.document.body.innerHTML='';e.target.contentWindow.alert=function(){}}else{if(modx.getActionFromUrl(a.url,2)||o.wrap.querySelectorAll('#evo-popup-'+o.uid).length>1){o.el.close()}else{if(e.target.contentDocument.querySelectorAll('h1')[0]){a.title=e.target.contentDocument.querySelectorAll('h1')[0].innerHTML}else if(e.target.contentDocument.title){a.title=e.target.contentDocument.title}if(o.header){e.target.offsetParent.offsetParent.getElementsByClassName(o.header.className)[0].innerHTML=a.title}e.target.offsetParent.offsetParent.id='evo-popup-'+o.uid;e.target.offsetParent.offsetParent.classList.remove('changed')}}e.target.contentWindow.close=o.close;modx.main.stopWork()};o.el.lastChild.appendChild(o.frame);o.show()}else{var xhr=new XMLHttpRequest();xhr.open(o.method,o.url,true);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');xhr.setRequestHeader('X-REQUESTED-WITH','XMLHttpRequest');if(o.dataType){xhr.responseType=o.dataType}xhr.onload=function(){if(this.readyState===4){o.el.className+=' '+o.className+'-ajax';if(o.dataType==='document'){if(o.selector){var r=this.response.documentElement.querySelector(o.selector);if(r){o.el.lastChild.innerHTML+=r.innerHTML}}else{o.el.lastChild.innerHTML+=this.response.body.innerHTML}}else{o.el.lastChild.innerHTML+=this.response}o.show()}};xhr.send(o.data)}}else{o.el.lastChild.innerHTML+=o.content;o.show()}}return o}},getWindowDimension:function(){var a=0,b=0,c=d.documentElement,e=d.body;if(typeof(w.innerWidth)==='number'){a=w.innerWidth;b=w.innerHeight}else if(c&&(c.clientWidth||c.clientHeight)){a=c.clientWidth;b=c.clientHeight}else if(e&&(e.clientWidth||e.clientHeight)){a=e.clientWidth;b=e.clientHeight}return{'width':a,'height':b}},hideDropDown:function(e){e=e||w.event||w.main.event;if(tree.ca==='open'||tree.ca===''){modx.tree.setSelectedByContext()}if(modx.tree.ctx!==null){d.getElementById(modx.frameset).removeChild(modx.tree.ctx);modx.tree.ctx=null}if(!/dropdown\-item/.test(e.target.className)){var els=d.querySelectorAll('.dropdown.show'),n=null,t=e.target||e.target.parentNode,i;if(typeof t.dataset.toggle!=='undefined'){n=d.querySelector(t.dataset.toggle)}else if(t.classList.contains('dropdown-toggle')){n=t.offsetParent}for(i=0;i';if(this.classDrag)this.el.classList.add(this.classDrag);if(this.classResize)this.el.classList.add(this.classResize);this.el.insertBefore(this.borders,this.el.firstChild);if(this.handler&&this.el.getElementsByClassName(this.handler)[0]){this.handler=this.el.getElementsByClassName(this.handler)[0];this.handlerHeight=this.handler.offsetHeight}this.el.onmousedown=function(e){s.mousedown(e)};this.el.ontouchstart=function(e){s.mousedown(e.changedTouches[0])};this.wrap.addEventListener('mousemove',function(e){s.calc(e)},false);this.wrap.addEventListener('touchmove',function(e){s.calc(e.changedTouches[0])},false)};this.dragging.init.prototype={mousedown:function(e){if(e.target.classList.contains('close')){return}e=document.all?window.event:e;var s=this,x=document.all?window.event.clientX:e.clientX,y=document.all?window.event.clientY:e.clientY,style=w.getComputedStyle(this.el);this.elmX=(x-this.el.offsetLeft+parseInt(style.marginLeft));this.elmY=(y-this.el.offsetTop+parseInt(style.marginTop));this.el.position=this.el.getBoundingClientRect();this.el.style.position='fixed';this.el.style.transitionDuration='0s';this.el.style.webkitTransitionDuration='0s';this.el.style.left=this.el.offsetLeft-parseInt(style.marginLeft)+'px';this.el.style.top=this.el.offsetTop-parseInt(style.marginTop)+'px';this.el.style.right='auto';this.el.style.bottom='auto';this.el.style.width=this.el.position.width+'px';this.el.style.height=this.el.position.height+'px';if(e.target.parentNode===this.borders){this.isresize=this.resize;this.el.classList.add('is-resize')}else{if(!this.handler||(this.handler&&e.target===this.handler)){this.isdrag=true;this.el.classList.add('is-drag')}}if(typeof this.start==='function'){this.onstart(e,this.el)}if(e.preventDefault){e.preventDefault()}else{document.onselectstart=function(){return false}}this.wrap.onmousemove=function(e){s.mousemove(e)};this.wrap.ontouchmove=function(e){s.mousemove(e.changedTouches[0]);e.stopPropagation()};this.wrap.onmouseup=function(e){s.mouseup(e)};this.wrap.ontouchend=function(e){s.mouseup(e.changedTouches[0]);e.stopPropagation()}},mousemove:function(e){var x=document.all?window.event.clientX:e.clientX,y=document.all?window.event.clientY:e.clientY;if(this.isresize){if(this.onRight)this.el.style.width=Math.max(x-this.el.position.left+(this.el.position.width-this.x),this.minWidth)+'px';if(this.onBottom)this.el.style.height=Math.max(y-this.el.position.top+(this.el.position.height-this.y),this.minHeight)+'px';if(this.onLeft){this.width=Math.max(this.el.position.left-x+this.el.position.width+this.x,this.minWidth);if(this.width>this.minWidth){this.el.style.width=this.width+'px';this.el.style.left=x-this.elmX+'px'}}if(this.onTop){var currentHeight=Math.max(this.el.position.top-y+this.el.position.height+this.y,this.minHeight);if(currentHeight>this.minHeight){this.el.style.height=currentHeight+'px';this.el.style.top=y-this.elmY+'px'}}if(typeof this.onresize==='function'){this.onresize(e,this.el)}}else if(this.isdrag){this.el.style.opacity=this.opacity;this.el.style.left=x-this.elmX+'px';this.el.style.top=y-this.elmY+'px';if(typeof this.drag==='function'){this.ondrag(e,this.el)}}},mouseup:function(e){if(this.isdrag||this.isresize){this.el.classList.remove('is-resize');this.el.classList.remove('is-drag');this.el.style.opacity='';this.el.style.transitionDuration='';this.el.style.webkitTransitionDuration='';this.el.position=this.el.getBoundingClientRect();this.isdrag=false;this.isresize=false;this.wrap.onmousemove=null;this.wrap.onselectstart=null;if(typeof this.stop==='function'){this.onstop(e,this.el)}}},calc:function(e){if(this.isresize||this.isdrag){return}this.x=e.clientX-this.el.offsetLeft;this.y=e.clientY-this.el.offsetTop;if(this.resize){this.onTop=this.y=this.el.offsetWidth-this.border;this.onBottom=this.y>=this.el.offsetHeight-this.border;if(this.onRight&&this.onBottom||this.onLeft&&this.onTop){this.el.style.cursor='nwse-resize'}else if(this.onRight&&this.onTop||this.onBottom&&this.onLeft){this.el.style.cursor='nesw-resize'}else if(this.onRight||this.onLeft){this.el.style.cursor='ew-resize'}else if(this.onBottom||this.onTop){this.el.style.cursor='ns-resize'}else if(this.x>0&&this.y>0&&(this.x=this.border)){this.el.style.cursor='move'}else{this.el.style.cursor='default'}}else{if(this.x>0&&this.y>0&&(this.x=this.border)){this.el.style.cursor='move'}}}};return new this.dragging.init(a,b)},setTypeIcon:function(a){var b='';switch(this.typesactions[a]){case 1:b='fa fa-newspaper-o';break;case 2:b='fa fa-list-alt';break;case 3:b='fa fa-th-large';break;case 4:b='fa fa-code';break;case 5:b='fa fa-plug';break;case 6:b='fa fa-cube';break;case 7:b='fa fa-pencil-square-o';break;default:b='fa fa-circle'}return b}});w.mainMenu={};w.mainMenu.stopWork=function(){modx.main.stopWork()};w.mainMenu.work=function(){modx.main.work()};w.mainMenu.reloadtree=function(){if(modx.plugins.ElementsInTree){setTimeout('reloadElementsInTree()',50)}if(modx.config.global_tabs){setTimeout('modx.tree.restoreTree()',100)}};w.mainMenu.startrefresh=function(a){if(a===1){}if(a===2){}if(a===9){modx.tree.restoreTree()}if(a===10){w.location.href=modx.MODX_MANAGER_URL}};w.mainMenu.startmsgcount=function(a,b,c){modx.updateMail(c)};w.mainMenu.hideTreeFrame=function(){modx.resizer.setWidth(0)};w.mainMenu.defaultTreeFrame=function(){modx.resizer.setDefaultWidth()};w.tree={};w.tree.ca='open';w.tree.document=document;w.tree.saveFolderState=function(){};w.tree.updateTree=function(){modx.tree.updateTree()};w.tree.restoreTree=function(){modx.tree.restoreTree()};w.tree.resizeTree=function(){};w.onbeforeunload=function(){var a=w.main.frameElement.contentWindow;if(modx.getActionFromUrl(a.location.search,27)){modx.get(modx.MODX_MANAGER_URL+'?a=67&type=7&id='+modx.main.getQueryVariable('id',a.location.search.substring(1)))}};d.addEventListener('DOMContentLoaded',function(){modx.init()})})(typeof jQuery!=='undefined'?jQuery:'',window,document,undefined);(function(){if(!Element.prototype.closest){Element.prototype.closest=function(a){var b=this,c,d;['matches','webkitMatchesSelector','mozMatchesSelector','msMatchesSelector','oMatchesSelector'].some(function(fn){if(typeof document.body[fn]==='function'){c=fn;return true}return false});if(b&&c&&b[c](a))return b;while(b){d=b.parentElement;if(d&&c&&d[c](a))return d;b=d}return null}}})(); +(function($,w,d,u){'use strict';modx.extended({frameset:'frameset',minWidth:840,isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),typesactions:{'16':1,'301':2,'78':3,'22':4,'102':5,'108':6,'3':7,'4':7,'6':7,'27':7,'61':7,'62':7,'63':7,'72':7},thememodes:['','lightness','light','dark','darkness'],tabsTimer:0,popupTimer:0,init:function(){if(!localStorage.getItem('MODX_widthSideBar')){localStorage.setItem('MODX_widthSideBar',this.config.tree_width)}this.mainmenu.init();if(w.location.hash){if(modx.getActionFromUrl(w.location.hash,2)){w.history.replaceState(null,d.title,modx.MODX_MANAGER_URL)}else if(modx.getActionFromUrl(w.location.hash)||modx.main.getQueryVariable('filemanager',w.location.hash)){var url=modx.main.getQueryVariable('filemanager',w.location.hash)?modx.MODX_MANAGER_URL+modx.main.getQueryVariable('filemanager',w.location.hash)+w.location.hash.replace('#?','?'):w.location.href.replace('#?','?');if(modx.config.global_tabs){modx.tabs({url:url,title:'blank'})}else if(w.main){w.main.frameElement.src=url}else{modx.openWindow(url)}}}this.resizer.init();this.search.init();if(this.config.session_timeout>0){w.setInterval(this.keepMeAlive,1000*60*this.config.session_timeout)}if(modx.config.mail_check_timeperiod>0&&modx.permission.messages){setTimeout('modx.updateMail(true)',1000)}d.addEventListener('click',this.hideDropDown,false);if(modx.config.global_tabs){d.addEventListener('click',this.tabs,false);this.tabs({url:'?a=2',reload:0})}},mainmenu:{id:'mainMenu',init:function(){var $mm=$('#mainMenu'),mm=d.getElementById('mainMenu'),timer;$mm.on('click','a',function(e){if($(this).hasClass('dropdown-toggle')){if($mm.hasClass('show')&&($(this).hasClass('selected')||!modx.isMobile&&$(this).parent().hasClass('hover'))){$(this).removeClass('selected');$mm.removeClass('show')}else{$('.nav > li > a:not(:hover)').removeClass('selected');$(this).addClass('selected');$mm.addClass('show')}e.stopPropagation();e.target.dataset.toggle='#mainMenu';modx.hideDropDown(e)}if($(this).closest('ul').hasClass('dropdown-menu')&&!$(this).parent('li').hasClass('dropdown-back')){$('.nav > .active').removeClass('active');$('.nav li.selected').removeClass('selected');$(this).closest('.nav > li').addClass('active');if(this.offsetParent.id){d.getElementById(this.offsetParent.id.substr(7)).classList.add('selected')}if((modx.isMobile||w.innerWidth li',function(){var els=mm.querySelectorAll('.nav > li.hover:not(:hover)');for(var i=0;i li li',function(e){var self=this,ul;var els=mm.querySelectorAll('.nav > li li.hover:not(:hover)');for(var i=0;i'+modx.lang.paging_prev+''+data}ul.id='parent_'+self.id;ul.innerHTML=data;var id=w.location.hash.substr(2).replace(/=/g,'_').replace(/&/g,'__');var el=d.getElementById(id);if(el){el.parentNode.classList.add('selected');d.getElementById(el.parentNode.parentNode.id.substr(7)).classList.add('selected')}for(var i=0;iitems.length-1){index=items.length-1}if(index>=0&&index2){s.timer=setTimeout(function(){s.loader.style.display='block';modx.get(modx.MODX_MANAGER_URL+'?a=71&ajax=1&submitok=Search&searchid='+s.input.value,function(data){s.loader.style.display='none';s.results=data.querySelector('.ajaxSearchResults');if(s.results&&s.results.innerHTML!==''){s.result.innerHTML=s.results.outerHTML;s.open();s.result.onclick=function(e){var t=e.target,p=t.parentNode;if(t.tagName==='I'){modx.openWindow({title:p.innerText,id:p.id,url:p.href});e.preventDefault();e.stopPropagation()}else{var a=t.tagName==='A'&&t||p.tagName==='A'&&p;if(a){var el=s.result.querySelector('.selected');if(el)el.className='';a.className='selected';if(modx.isMobile)s.close()}}}}else{s.empty()}},'document')},300)}else{s.empty()}};if(modx.isMobile){this.input.onblur=this.close}this.input.onfocus=this.open;this.input.onclick=this.open;this.input.onmouseenter=this.open;this.result.onmouseenter=this.open;this.result.onmouseleave=this.close;this.mask.onmouseenter=this.open;this.mask.onmouseleave=this.close},open:function(){if(modx.search.results){modx.search.result.classList.add('open')}},close:function(){modx.search.result.classList.remove('open')},empty:function(){modx.search.result.classList.remove('open');modx.search.result.innerHTML=''}},main:{id:'main',idFrame:'mainframe',as:null,onload:function(e){w.main=e.target.contentWindow||e.target.defaultView;modx.main.tabRow.init();modx.main.stopWork();modx.main.scrollWork();w.main.document.addEventListener('click',modx.hideDropDown,false);w.main.document.addEventListener('contextmenu',modx.main.oncontextmenu,false);if(modx.config.global_tabs){w.main.document.addEventListener('click',modx.tabs,false)}w.history.replaceState(null,d.title,modx.getActionFromUrl(w.main.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.main.location.search);setTimeout('modx.tree.restoreTree()',100)},oncontextmenu:function(e){if(e.ctrlKey)return;var el=e.target;if(modx.user.role===1&&/modxtv|modxplaceholder|modxattributevalue|modxchunk|modxsnippet|modxsnippetnocache/i.test(el.className)){var id=Date.now(),name=el.innerText.replace(/[\[|\]|{|}|\*||\#|\+|?|\!|&|=|`|:]/g,''),type=el.className.replace(/cm-modx/,''),n=!!name.replace(/^\d+$/,'');if(name&&n){e.preventDefault();modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',{a:'modxTagHelper',name:name,type:type},function(r){if(r){r=JSON.parse(r);for(var k in r){if(r.hasOwnProperty(k)&&r[k].url){r[k]['onclick']='if(event.shiftKey){modx.openWindow({url:\''+r[k].url+'\'})}else{modx.popup({url:\''+r[k].url+'\',title:\''+r.header.innerHTML+'\',width:\'95%\',height:\'95%\',margin:0,hide:0,hover:0,overlay:1,overlayclose:0,position:\'center elements\',animation:0,icon:\'none\'})}'}}r=JSON.stringify(r);el.id='node'+id;el.dataset.contextmenu=r;modx.tree.showPopup(e,id,name)}})}e.preventDefault()}},tabRow:{init:function(){var row=w.main.document.querySelector('.tab-pane > .tab-row');if(row)this.build(row)},build:function(row){var rowContainer=d.createElement('div'),sel=row.querySelector('.selected');rowContainer.className='tab-row-container';row.parentNode.insertBefore(rowContainer,row);rowContainer.appendChild(row);var p=d.createElement('i');p.className='fa fa-angle-left prev disable';p.onclick=function(e){e.stopPropagation();e.preventDefault();var sel=row.querySelector('.selected');if(sel.previousSibling){sel.previousSibling.click();modx.main.tabRow.scroll(row)}};rowContainer.appendChild(p);var n=d.createElement('i');n.className='fa fa-angle-right next disable';n.onclick=function(e){e.stopPropagation();e.preventDefault();var sel=row.querySelector('.selected');if(sel.nextSibling){sel.nextSibling.click();modx.main.tabRow.scroll(row)}};rowContainer.appendChild(n);setTimeout(function(){sel=row.querySelector('.selected');modx.main.tabRow.scroll(row,sel);w.main.addEventListener('resize',function(){modx.main.tabRow.scroll(row)},false);if(sel){if(sel.previousSibling)p.classList.remove('disable');if(sel.nextSibling)n.classList.remove('disable')}},100);row.onclick=function(e){var sel=e.target.tagName==='H2'?e.target:e.target.tagName==='SPAN'?e.target.parentNode:null;if(sel){if(sel.previousSibling){this.parentNode.querySelector('i.prev').classList.remove('disable')}else{this.parentNode.querySelector('i.prev').classList.add('disable')}if(sel.nextSibling){this.parentNode.querySelector('i.next').classList.remove('disable')}else{this.parentNode.querySelector('i.next').classList.add('disable')}modx.main.tabRow.scroll(this,sel)}}},scroll:function(row,sel,a){sel=sel||row.querySelector('.selected')||row.firstChild;a=a||100;var c=0,elms=row.childNodes;for(var i=0;isel.offsetLeft){$(row).animate({scrollLeft:sel.offsetLeft-(sel.previousSibling?30:1)},a)}if(sel.offsetLeft+sel.offsetWidth>row.offsetWidth+row.scrollLeft){$(row).animate({scrollLeft:sel.offsetLeft-row.offsetWidth+sel.offsetWidth+(sel.nextSibling?30:0)},a)}if(c>row.offsetWidth){this.drag(row)}},drag:function(row){row.onmousedown=function(e){if(e.button===0){e.preventDefault();var x=e.clientX,f=row.scrollLeft;row.ownerDocument.body.focus();row.onmousemove=row.ownerDocument.onmousemove=function(e){if(Math.abs(e.clientX-x)>5){e.stopPropagation();row.scrollLeft=f-(e.clientX-x);row.ownerDocument.body.classList.add('drag')}};row.onmouseup=row.ownerDocument.onmouseup=function(e){e.stopPropagation();row.onmousemove=null;row.ownerDocument.onmousemove=null;row.ownerDocument.body.classList.remove('drag')}}}}},work:function(){d.getElementById('mainloader').classList.add('show')},stopWork:function(){d.getElementById('mainloader').classList.remove('show')},scrollWork:function(){var a=w.main.frameElement.contentWindow,b=a.location.search.substring(1)||a.location.hash.substring(2),c=localStorage.getItem('page_y')||0,f=localStorage.getItem('page_url')||b;if(((modx.getActionFromUrl(f)===modx.getActionFromUrl(b))&&(modx.main.getQueryVariable('id',f)&&modx.main.getQueryVariable('id',f)===modx.main.getQueryVariable('id',b)))||(f===b)){a.scrollTo(0,c)}a.addEventListener('scroll',function(){if(this.pageYOffset>=0){localStorage.setItem('page_y',this.pageYOffset.toString());localStorage.setItem('page_url',b)}},false)},getQueryVariable:function(a,b){var f='';if(b||typeof b==='string'){b=b.split('?');b=b[1]||b[0];b=b.split('&');for(var i=0;iMath.abs(ay)&&this.swipe){if(ax<0&&this.sidebar){if(Math.abs(ax)>h)ax=-h;tree.style.transform='translate3d('+ax+'px, 0, 0)';tree.style.WebkitTransform='translate3d('+ax+'px, 0, 0)';modx.resizer.mask.style.opacity=(0.5-0.5/-h*ax).toFixed(2);if(Math.abs(ax)>h/3){this.swipe='left'}else{this.swipe='right'}}else if(ax>0&&!this.sidebar){if(Math.abs(ax)>h)ax=h;tree.style.transform='translate3d('+ -(h-ax)+'px, 0, 0)';tree.style.WebkitTransform='translate3d('+ -(h-ax)+'px, 0, 0)';modx.resizer.mask.style.opacity=(0.5/h*ax).toFixed(2);if(Math.abs(ax)>h/3){this.swipe='right'}else{this.swipe='left'}}}},false);w.addEventListener('touchend',function(){if(this.swipe==='left'){d.body.classList.add('sidebar-closed');modx.resizer.setWidth(0)}if(this.swipe==='right'){d.body.classList.remove('sidebar-closed');modx.resizer.setWidth(h)}tree.style.cssText='';modx.resizer.mask.style.cssText=''},false)}},onMouseDown:function(e){e=e||w.event;modx.resizer.dragElement=e.target!==null?e.target:e.srcElement;if((e.buttons===1||e.button===0)&&modx.resizer.dragElement.id===modx.resizer.id){modx.resizer.oldZIndex=modx.resizer.dragElement.style.zIndex;modx.resizer.dragElement.style.zIndex=modx.resizer.newZIndex;modx.resizer.dragElement.style.background=modx.resizer.background;localStorage.setItem('MODX_widthSideBar',modx.resizer.dragElement.offsetLeft>0?modx.resizer.dragElement.offsetLeft:0);d.body.appendChild(modx.resizer.mask);d.onmousemove=modx.resizer.onMouseMove;d.body.focus();d.body.classList.add('resizer_move');d.onselectstart=function(){return false};modx.resizer.dragElement.ondragstart=function(){return false};return false}},onMouseMove:function(e){e=e||w.event;if(e.clientX>0){modx.resizer.left=e.clientX}else{modx.resizer.left=0}modx.resizer.dragElement.style.left=modx.pxToRem(modx.resizer.left)+'rem';d.getElementById('tree').style.width=modx.pxToRem(modx.resizer.left)+'rem';d.getElementById('main').style.left=modx.pxToRem(modx.resizer.left)+'rem';if(e.clientX<-2||e.clientY<-2){modx.resizer.onMouseUp(e)}},onMouseUp:function(e){if(modx.resizer.dragElement!==null&&e.button===0&&modx.resizer.dragElement.id===modx.resizer.id){if(e.clientX>0){d.body.classList.remove('sidebar-closed');modx.resizer.left=e.clientX}else{d.body.classList.add('sidebar-closed');modx.resizer.left=0}d.cookie='MODX_widthSideBar='+modx.pxToRem(modx.resizer.left);modx.resizer.dragElement.style.zIndex=modx.resizer.oldZIndex;modx.resizer.dragElement.style.background='';modx.resizer.dragElement.ondragstart=null;modx.resizer.dragElement=null;d.body.classList.remove('resizer_move');d.body.removeChild(modx.resizer.mask);d.onmousemove=null;d.onselectstart=null}},toggle:function(){if(modx.isMobile||w.innerWidth<=modx.minWidth){if(d.body.classList.contains('sidebar-closed')){d.body.classList.remove('sidebar-closed');localStorage.setItem('MODX_widthSideBar',0);d.cookie='MODX_widthSideBar='+modx.pxToRem(parseInt(d.getElementById('tree').offsetWidth))}else{localStorage.setItem('MODX_widthSideBar',parseInt(d.getElementById('tree').offsetWidth));d.body.classList.add('sidebar-closed');d.cookie='MODX_widthSideBar=0'}}else{var p=d.getElementById('tree').offsetWidth!==0?0:parseInt(localStorage.getItem('MODX_widthSideBar'))?parseInt(localStorage.getItem('MODX_widthSideBar')):modx.config.tree_width;modx.resizer.setWidth(p)}},setWidth:function(a){if(a>0){localStorage.setItem('MODX_widthSideBar',0);d.body.classList.remove('sidebar-closed')}else{localStorage.setItem('MODX_widthSideBar',parseInt(d.getElementById('tree').offsetWidth));d.body.classList.add('sidebar-closed')}d.cookie='MODX_widthSideBar='+modx.pxToRem(a);d.getElementById('tree').style.width=modx.pxToRem(a)+'rem';d.getElementById('resizer').style.left=modx.pxToRem(a)+'rem';d.getElementById('main').style.left=modx.pxToRem(a)+'rem'},setDefaultWidth:function(){modx.resizer.setWidth(modx.remToPx(modx.config.tree_width))}},tree:{ctx:null,rpcNode:null,itemToChange:'',selectedObjectName:null,selectedObject:0,selectedObjectDeleted:0,selectedObjectUrl:'',drag:false,deleted:[],init:function(){this.restoreTree()},draggable:function(){if(modx.permission.dragndropdocintree){var els=d.querySelectorAll('#treeRoot a:not(.empty)');for(var i=0;i-1:true;modx.tree.itemToChange=this.dataset.id||this.parentNode.id.replace('node','');modx.tree.selectedObjectName=this.dataset.titleEsc;if(draggable){this.parentNode.draggable=true;this.parentNode.ondragstart=modx.tree.ondragstart}else{this.parentNode.draggable=false;this.parentNode.ondragstart=function(){return false}}}},ondragstart:function(e){e.dataTransfer.effectAllowed='all';e.dataTransfer.dropEffect='all';e.dataTransfer.setData('text',this.id.substr(4))},ondragenter:function(e){if(d.getElementById('node'+modx.tree.itemToChange)===(this.parentNode.closest('#node'+modx.tree.itemToChange)||this.parentNode)){this.parentNode.className='';e.dataTransfer.effectAllowed='none';e.dataTransfer.dropEffect='none';modx.tree.drag=false}else{this.parentNode.className='dragenter';e.dataTransfer.effectAllowed='copy';e.dataTransfer.dropEffect='copy';modx.tree.drag=true}e.preventDefault()},ondragover:function(e){if(modx.tree.drag){var a=e.clientY;var b=parseInt(this.getBoundingClientRect().top);var c=a-b;if(c>this.offsetHeight/1.51){this.parentNode.classList.add('dragafter');this.parentNode.classList.remove('dragbefore');this.parentNode.classList.remove('dragenter');e.dataTransfer.effectAllowed='link';e.dataTransfer.dropEffect='link'}else if(c'}if(this.nextSibling){if(this.nextSibling.innerHTML){this.nextSibling.appendChild(el)}else{el.parentNode.removeChild(el)}els=this.parentNode.lastChild.children;for(i=0;i'}this.parentNode.parentNode.insertBefore(el,this.parentNode.nextSibling);els=this.parentNode.parentNode.children;for(i=0;i'}this.parentNode.parentNode.insertBefore(el,this.parentNode);els=this.parentNode.parentNode.children;for(i=0;i-1:true)){alert(modx.lang.error_no_privileges);modx.tree.restoreTree();return}modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',{a:'movedocument',id:id,parent:parent,menuindex:menuindex},function(r){if(r.errors)alert(r.errors);modx.tree.restoreTree()},'json');var b=w.main.frameElement.contentWindow.location.search.substr(1);if(modx.getActionFromUrl(b,27)&&parseInt(modx.main.getQueryVariable('id',b))===parseInt(id)){var index=menuindex.indexOf(id),elMenuIndex=w.main.document.querySelector('#documentPane input[name=menuindex]'),elParent=w.main.document.querySelector('#documentPane input[name=parent]'),elParentName=w.main.document.querySelector('#documentPane #parentName');if(elMenuIndex&&index>=0)elMenuIndex.value=index;if(elParent&&elParentName){elParent.value=parent;elParentName.innerHTML=parent+' ('+d.querySelector('#node'+parent+' > a').dataset.titleEsc+')'}}},toggleTheme:function(){var a,b=1,myCodeMirrors=w.main.myCodeMirrors,key;if(typeof localStorage['MODX_themeMode']==='undefined'){localStorage['MODX_themeMode']=modx.config.theme_mode}if(modx.thememodes[parseInt(localStorage['MODX_themeMode'])+1]){b=parseInt(localStorage['MODX_themeMode'])+1}a=modx.thememodes[b];for(key in modx.thememodes){if(modx.thememodes[key]){d.body.classList.remove(modx.thememodes[key]);w.main.document.body.classList.remove(modx.thememodes[key])}}d.body.classList.add(a);w.main.document.body.classList.add(a);d.cookie='MODX_themeMode='+b;localStorage['MODX_themeMode']=b;if(typeof myCodeMirrors!=='undefined'){for(key in myCodeMirrors){if(myCodeMirrors.hasOwnProperty(key)){if(~a.indexOf('dark')){w.main.document.getElementsByName(key)[0].nextElementSibling.classList.add('cm-s-'+myCodeMirrors[key].options.darktheme);w.main.document.getElementsByName(key)[0].nextElementSibling.classList.remove('cm-s-'+myCodeMirrors[key].options.defaulttheme)}else{w.main.document.getElementsByName(key)[0].nextElementSibling.classList.remove('cm-s-'+myCodeMirrors[key].options.darktheme);w.main.document.getElementsByName(key)[0].nextElementSibling.classList.add('cm-s-'+myCodeMirrors[key].options.defaulttheme)}}}}},toggleNode:function(e,id){e=e||w.event;if(e.ctrlKey)return;e.stopPropagation();var el=d.getElementById('node'+id).firstChild;this.rpcNode=el.nextSibling;var toggle=el.querySelector('.toggle'),icon=el.querySelector('.icon');if(this.rpcNode.innerHTML===''){if(toggle)toggle.innerHTML=el.dataset.iconCollapsed;icon.innerHTML=el.dataset.iconFolderOpen;var rpcNodeText=this.rpcNode.innerHTML,loadText=modx.lang.loading_doc_tree;modx.openedArray[id]=1;if(rpcNodeText===''||rpcNodeText.indexOf(loadText)>0){var folderState=this.getFolderState();d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent='+el.dataset.indent+'&parent='+id+'&expandAll='+el.dataset.expandall+folderState,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})}this.saveFolderState()}else{if(toggle)toggle.innerHTML=el.dataset.iconExpanded;icon.innerHTML=el.dataset.iconFolderClose;delete modx.openedArray[id];this.rpcNode.style.overflow='hidden';$(this.rpcNode.firstChild).animate({marginTop:-this.rpcNode.offsetHeight+'px'},100,function(){this.parentNode.innerHTML=''});this.saveFolderState()}e.preventDefault()},rpcLoadData:function(a){if(this.rpcNode!==null){var el;this.rpcNode.innerHTML=typeof a==='object'?a.responseText:a;this.rpcNode.loaded=true;if(this.rpcNode.firstChild.tagName==='DIV'){if(this.rpcNode.id==='treeRoot'){el=d.getElementById('binFull');if(el){this.showBin(true)}else{this.showBin(false)}}else{this.rpcNode.style.overflow='hidden';this.rpcNode.firstElementChild.style.marginTop=-this.rpcNode.offsetHeight+'px';$(this.rpcNode.firstChild).animate({marginTop:0},100)}d.getElementById('treeloader').classList.remove('visible')}else{el=d.getElementById('loginfrm');if(el){this.rpcNode.parentNode.removeChild(this.rpcNode);w.location.href=modx.MODX_MANAGER_URL}}}},treeAction:function(e,id,title){if(e.ctrlKey)return;var el=d.getElementById('node'+id).firstChild,treepageclick=el.dataset.treepageclick,showchildren=parseInt(el.dataset.showchildren),openfolder=parseInt(el.dataset.openfolder);title=title||el.dataset&&el.dataset.titleEsc;if(tree.ca==='move'){try{this.setSelectedByContext(id);w.main.setMoveValue(id,title)}catch(oException){alert(modx.lang.unable_set_parent)}}if(tree.ca==='open'||tree.ca===''){if(id===0){href='?a=2'}else{var href='';if(!isNaN(treepageclick)&&isFinite(treepageclick)){href='?a='+treepageclick+'&r=1&id='+id+(openfolder===0?this.getFolderState():'')}else{href=treepageclick}if(openfolder===2){if(showchildren!==1){href=''}this.toggleNode(e,id)}}if(href){if(e.shiftKey){w.getSelection().removeAllRanges();modx.openWindow(href);this.restoreTree()}else{modx.tabs({url:modx.MODX_MANAGER_URL+href,title:title+'('+id+')'});if(modx.isMobile&&w.innerWidth0?e.clientX:e.pageX;y=e.clientY>0?e.clientY:e.pageY;e.view.position=e.view.frameElement?e.view.frameElement.getBoundingClientRect():e.target.offsetParent.getBoundingClientRect();if(e.view.frameElement){x+=e.view.position.left;y+=e.view.frameElement.offsetParent.offsetTop}else{if(e.target.parentNode.parentNode.classList.contains('node')){x+=50}}if(x>e.view.position.width){x=e.view.position.width-this.ctx.offsetWidth}if(y+this.ctx.offsetHeight/2>e.view.position.height){y=e.view.position.height-this.ctx.offsetHeight-5}else if(y-this.ctx.offsetHeight/20?e.clientX:e.pageX;y=e.clientY>0?e.clientY:e.pageY;if(y+ctx.offsetHeight/2>bodyHeight){y=bodyHeight-ctx.offsetHeight-5}else if(y-ctx.offsetHeight/230){this.selectedObjectName=this.selectedObjectName.substr(0,30)+'...'}var f=d.getElementById('nameHolder');f.innerHTML=this.selectedObjectName;el.style.left=a+(modx.config.textdir?'-190':'')+'px';el.style.top=b+'px';el.classList.add('show')},menuHandler:function(a){switch(a){case 1:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=3&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 2:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=27&r=1&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 3:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=4&pid='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 4:if(this.selectedObjectDeleted){alert('"'+this.selectedObjectName+'" '+modx.lang.already_deleted)}else if(confirm('"'+this.selectedObjectName+'"\n\n'+modx.lang.confirm_delete_resource)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=6&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 5:this.setActiveFromContextMenu(this.itemToChange);modx.tabs({url:modx.MODX_MANAGER_URL+'?a=51&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 6:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=72&pid='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 7:if(confirm(modx.lang.confirm_resource_duplicate)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=94&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 8:if(d.getElementById('node'+this.itemToChange).firstChild.dataset.deleted){if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_undelete)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=63&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}}else{alert('"'+this.selectedObjectName+'"'+modx.lang.not_deleted)}break;case 9:if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_publish)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=61&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}break;case 10:if(this.itemToChange!==modx.config.site_start){if(confirm('"'+this.selectedObjectName+'" '+modx.lang.confirm_unpublish)===true){modx.tabs({url:modx.MODX_MANAGER_URL+'?a=62&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'})}}else{alert('Document is linked to site_start variable and cannot be unpublished!')}break;case 11:modx.tabs({url:modx.MODX_MANAGER_URL+'?a=56&id='+this.itemToChange,title:this.selectedObjectName+'('+this.itemToChange+')'});break;case 12:w.open(d.getElementById('node'+this.itemToChange).firstChild.dataset.href,'previeWin');break;default:alert('Unknown operation command.')}},setSelected:function(a){var el=d.querySelector('#tree .current');if(el)el.classList.remove('current');if(a){if(typeof a==='object'){a.classList.add('current')}else{el=d.querySelector('#node'+a+'>.node')||d.getElementById('node'+a);if(el)el.classList.add('current')}}},setActiveFromContextMenu:function(a){var el=d.querySelector('#node'+a+'>.node');if(el)this.setSelected(el)},setSelectedByContext:function(a){var el=d.querySelector('#treeRoot .selected');if(el)el.classList.remove('selected');el=d.querySelector('#node'+a+'>.node');if(el)el.classList.add('selected')},setItemToChange:function(){var a=w.main.document&&(w.main.document.URL||w.main.document.location.search),b=modx.getActionFromUrl(a);if(a&&modx.typesactions[b]){this.itemToChange=(modx.typesactions[b]===7?'':modx.typesactions[b]+'_')+parseInt(modx.main.getQueryVariable('id',a))}else{this.itemToChange=''}this.setSelected(this.itemToChange)},restoreTree:function(){if(d.getElementById('treeRoot')){d.getElementById('treeloader').classList.add('visible');this.setItemToChange();this.rpcNode=d.getElementById('treeRoot');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=2&id='+this.itemToChange,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})}},expandTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=1&id='+this.itemToChange,function(r){modx.tree.rpcLoadData(r);modx.tree.saveFolderState();modx.tree.draggable()})},collapseTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&indent=1&parent=0&expandAll=0&id='+this.itemToChange,function(r){modx.openedArray=[];modx.tree.saveFolderState();modx.tree.rpcLoadData(r);modx.tree.draggable()})},updateTree:function(){this.rpcNode=d.getElementById('treeRoot');d.getElementById('treeloader').classList.add('visible');var a=d.sortFrm;var b='a=1&f=nodes&indent=1&parent=0&expandAll=2&dt='+a.dt.value+'&tree_sortby='+a.sortby.value+'&tree_sortdir='+a.sortdir.value+'&tree_nodename='+a.nodename.value+'&id='+this.itemToChange+'&showonlyfolders='+a.showonlyfolders.value;modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php',b,function(r){modx.tree.rpcLoadData(r);modx.tree.draggable()})},getFolderState:function(){var a;if(modx.openedArray!==[0]){a='&opened=';for(var key in modx.openedArray){if(modx.openedArray[key]){a+=key+'|'}}}else{a='&opened='}return a},saveFolderState:function(){modx.post(modx.MODX_MANAGER_URL+'media/style/'+modx.config.theme+'/ajax.php','a=1&f=nodes&savestateonly=1'+this.getFolderState())},showSorter:function(e){e=e||w.event;var el=d.getElementById('floater');e.target.dataset.toggle='#floater';el.classList.toggle('show');el.onclick=function(e){e.stopPropagation()}},emptyTrash:function(){if(confirm(modx.lang.confirm_empty_trash)===true){modx.get(modx.MODX_MANAGER_URL+'?a=64',function(){modx.tabsClose(modx.tree.deleted);modx.tree.deleted=[];modx.tree.restoreTree()})}},showBin:function(a){var el=d.getElementById('treeMenu_emptytrash');if(el){if(a){el.title=modx.lang.empty_recycle_bin;el.classList.remove('disabled');el.innerHTML=modx.style.empty_recycle_bin;el.onclick=function(){modx.tree.emptyTrash()};var els=d.getElementById('tree').querySelectorAll('.deleted');for(var i=0;i0){if(el){el.innerHTML=c[0];el.style.display='block'}}else{if(el)el.style.display='none'}if(c[1]>0){el=d.getElementById('newMail');if(el){el.innerHTML=''+modx.style.email+modx.lang.inbox+' ('+c[0]+' / '+c[1]+')';el.style.display='block'}}if(modx.config.mail_check_timeperiod>0)setTimeout('modx.updateMail(true)',1000*modx.config.mail_check_timeperiod)})}}catch(oException){setTimeout('modx.updateMail(true)',1000*modx.config.mail_check_timeperiod)}},openWindow:function(a){if(typeof a!=='object'){a={'url':a}}if(!a.width)a.width=parseInt(w.innerWidth*0.9)+'px';if(!a.height)a.height=parseInt(w.innerHeight*0.8)+'px';if(!a.left)a.left=parseInt(w.innerWidth*0.05)+'px';if(!a.top)a.top=parseInt(w.innerHeight*0.1)+'px';if(!a.title)a.title=Math.floor((Math.random()*999999)+1);if(a.url){if(this.plugins.EVOmodal===1){top.EVO.modal.show(a)}else{w.open(a.url,a.title,'width='+a.width+',height='+a.height+',top='+a.top+',left='+a.left+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no')}}},tabsClose:function(a){if(modx.config.global_tabs&&a){for(var k in a){if(a.hasOwnProperty(k)){var el=d.getElementById(a[k]);if(el){el.firstElementChild.contentWindow.documentDirty=false;el.close()}}}}},tabs:function(a){function Tabs(a){var s=this;this.url=a.url;this.title=a.title||'';this.name=a.name||'';this.timer=null;this.olduid='';this.closeactions=[6,61,62,63,94];this.reload=typeof a.reload!=='undefined'?a.reload:1;this.action=modx.getActionFromUrl(a.url);this.uid=modx.getActionFromUrl(a.url,2)?'home':modx.urlToUid(a.url);this.page=d.getElementById('evo-tab-page-'+this.uid);this.row=d.getElementsByClassName('evo-tab-row')[0].firstElementChild;this.tab=d.getElementById('evo-tab-'+this.uid);if(this.page){if(this.uid==='home'){if(this.reload){this.page.firstElementChild.src=this.url;this.show()}else{this.reload=1;if(this.tab.onclick===null){this.tab.onclick=function(e){s.select.call(s,e,this)}}this.tab.show=function(e){s.show.call(s,e)};modx.tabs.selected=this.tab}}else{this.show();if(~this.closeactions.indexOf(this.action)){this.setDocPublished();modx.get(this.url,function(){modx.tree.restoreTree()})}}}else if(~this.closeactions.indexOf(this.action)){modx.get(this.url,function(){modx.tree.restoreTree()})}else{this.create()}}Tabs.prototype={create:function(){var s=this;modx.main.work();modx.tabs.selected=this.row.querySelector('.selected');if(modx.tabs.selected){d.getElementById(modx.tabs.selected.id.replace('tab','tab-page')).classList.remove('show');modx.tabs.selected.classList.remove('selected')}this.page=d.createElement('div');this.page.id='evo-tab-page-'+this.uid;this.page.className='evo-tab-page iframe-scroller show';if(/iPhone|iPad|iPod/i.test(navigator.userAgent)){this.page.innerHTML='';}else{this.page.innerHTML=''};d.getElementById('main').appendChild(this.page);console.time('load-tab');this.page.firstElementChild.onload=function(e){s.onload.call(s,e);console.timeEnd('load-tab')};this.tab=d.createElement('h2');this.tab.id='evo-tab-'+this.uid;this.tab.className='tab selected';this.icon='';if(!/'}this.tab.innerHTML=''+this.icon+this.title+'×';this.row.appendChild(this.tab);this.tab.onclick=function(e){s.select.call(s,e,this)};this.tab.close=function(e){s.close.call(s,e)};this.tab.show=function(e){s.show.call(s,e)};this.page.close=function(e){s.close.call(s,e)}},onload:function(e){var s=this;w.main=e.target.contentWindow||e.target.defaultView;this.url=w.main.location.search||w.location.hash.substring(1);this.olduid=this.uid;this.uid=modx.urlToUid(this.url);if(!!w.main.__alertQuit){w.main.alert=function(a){};var message=w.main.document.body.innerHTML;w.main.document.body.innerHTML='';history.pushState(null,d.title,modx.getActionFromUrl(w.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.location.search);w.onpopstate=function(){history.go(1)};modx.popup({type:'warning',title:'MODX :: Alert',position:'top center alertQuit',content:message,wrap:'body'});modx.getLockedElements(modx.getActionFromUrl(this.url),modx.main.getQueryVariable('id',this.url),function(data){if(!!data){s.page.close();modx.tree.restoreTree()}else{w.main.location.href=modx.MODX_MANAGER_URL+s.url;w.history.replaceState(null,d.title,modx.getActionFromUrl(s.url,2)?modx.MODX_MANAGER_URL:'#'+s.url)}})}else{if(modx.getActionFromUrl(this.url,2)){this.close(e)}else if(this.olduid!==this.uid&&d.getElementById('evo-tab-'+this.uid)){this.close(e);d.getElementById('evo-tab-'+this.uid).show()}else{this.title=w.main.document.body.querySelectorAll('h1')[0]&&w.main.document.body.querySelectorAll('h1')[0].innerHTML||this.title;if(this.title&&this.uid!=='home'){this.tab.innerHTML=''+this.title+'×'}this.page.id='evo-tab-page-'+this.uid;this.tab.id='evo-tab-'+this.uid;this.tab.classList.remove('changed');this.show();modx.main.onload(e);w.main.document.addEventListener('click',function a(e){if(typeof e.view.documentDirty!=='undefined'&&e.view.documentDirty&&!s.tab.classList.contains('changed')){s.tab.classList.add('changed');this.removeEventListener(e.type,a,false)}},false);w.main.document.addEventListener('keyup',function a(e){if(typeof e.view.documentDirty!=='undefined'&&e.view.documentDirty&&!s.tab.classList.contains('changed')){s.tab.classList.add('changed');this.removeEventListener(e.type,a,false)}},false)}}},show:function(){var s=this;modx.tabs.selected=this.row.querySelector('.selected');if(modx.tabs.selected&&modx.tabs.selected!==this.tab){d.getElementById(modx.tabs.selected.id.replace('tab','tab-page')).classList.remove('show');modx.tabs.selected.classList.remove('selected')}this.page.classList.add('show');this.tab.classList.add('selected');modx.tabs.selected=this.tab;w.main=this.page.firstElementChild.contentWindow;w.history.replaceState(null,w.main.document.title,modx.getActionFromUrl(w.main.location.search,2)?modx.MODX_MANAGER_URL:'#'+w.main.location.search);modx.tree.setItemToChange();modx.main.tabRow.scroll(this.row,this.tab,350)},close:function(e){var documentDirty=this.page.firstElementChild.contentWindow.documentDirty;var checkDirt=!!this.page.firstElementChild.contentWindow.checkDirt;if(documentDirty&&checkDirt&&confirm(this.page.firstElementChild.contentWindow.checkDirt(e))||!documentDirty){modx.tabs.selected=this.tab.classList.contains('selected')?this.tab.previousElementSibling:this.row.querySelector('.selected');this.page.parentNode.removeChild(this.page);this.row.removeChild(this.tab);modx.tabs.selected.show()}},select:function(e){if(e.target.className==='tab-close'){this.close(e)}else if(modx.tabs.selected===this.tab){var s=this;if(this.timer){clearTimeout(this.timer);this.timer=null;w.main.location.reload()}else{this.timer=setTimeout(function(){s.timer=null},250)}}else{this.show()}},setDocPublished:function(){var el=w.main.document.getElementsByName('publishedcheck')[0];if(el){el.checked=this.action===61;w.main.document.getElementsByName('published')[0].value=+el.checked}if(modx.getActionFromUrl(w.main.location.search,3)){w.main.location.reload()}}};if(modx.config.global_tabs){if(typeof a.currentTarget!=='undefined'){var e=a;if(e.button===0&&e.target&&(e.target.tagName==='A'&&e.target.target==='main'||(e.target.parentNode&&e.target.parentNode.tagName==='A'&&e.target.parentNode.target==='main'))){a=e.target.tagName==='A'&&e.target||e.target.parentNode.tagName==='A'&&e.target.parentNode;if(e.shiftKey){modx.openWindow({url:a.href})}else{modx.tabs({url:a.href,title:a.innerHTML})}e.preventDefault()}}else{return new Tabs(a)}}else if(a.url){if(w.main){w.main.frameElement.src=a.url}else{modx.openWindow(a.url)}}},popup:function(a){if(typeof a==='object'&&(a.url||a.content||a.text)){var o={addclass:'',animation:'fade',content:a.content||a.text||'',clickclose:0,closeall:0,data:'',dataType:'document',delay:5000,draggable:!1,event:null,height:'auto',hide:1,hover:1,icon:'',iframe:'iframe',margin:'.5rem',maxheight:'',method:'GET',overlay:0,overlayclose:0,position:'center',resize:!1,selector:'',showclose:1,target:'main',uid:'',type:'default',title:'',url:'',width:'20rem',wrap:w.main.document.body,zIndex:10500,w:null,show:function(){if(~o.position.indexOf('center')){if(o.event){o.el.style.left=o.event.clientX+o.mt+'px';o.el.style.bottom=o.w.innerHeight-o.el.offsetHeight-o.event.clientY+o.mt+'px'}else{o.el.style.left=/(%)/.test(o.width)?(100-parseInt(o.width))/2-o.mt/(o.w.innerWidth/100)+'%':(o.w.innerWidth-o.el.offsetWidth)/2-o.mt+'px';o.el.style.bottom=/(%)/.test(o.height)?(100-parseInt(o.height))/2-o.mt/(o.w.innerHeight/100)+'%':(o.w.innerHeight-o.el.offsetHeight-o.wrap.offsetTop)/2-o.mt+'px'}}if(~o.position.indexOf('left')){o.el.style.left=0}if(~o.position.indexOf('right')){o.el.style.right=0}else{o.el.style.right='auto'}if(~o.position.indexOf('top')){o.el.style.top=0;o.el.style.bottom=''}else{o.el.style.top='auto'}if(~o.position.indexOf('bottom')){o.el.style.bottom=0}o.calc();o.el.className+=' in';if(o.showclose){o.el.querySelector('.close').onclick=o.close}if(o.hide){o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);o.close()},o.delay)}if(o.hover){o.el.onmouseenter=function(){clearTimeout(o.el.timer)};o.el.onmouseleave=o.close}if(o.overlayclose&&o.o){o.o.onclick=o.close}if(o.clickclose){o.el.onclick=o.close}if(o.draggable){modx.dragging(o.el,{wrap:o.wrap,resize:o.resize})}},close:function(e){o.event=e||o.event||w.event;if(o.url&&o.iframe==='iframe'){var els=o.wrap.ownerDocument.querySelectorAll('.'+o.className+'.in');if(els){var documentDirty=o.el.lastElementChild.firstElementChild.contentWindow.documentDirty;if(documentDirty&&confirm(o.el.lastElementChild.firstElementChild.contentWindow.checkDirt(o.event))||!documentDirty){o.el.classList.remove('in');if(!o.animation){o.el.classList.remove('show')}o.calc(1);if(o.o&&o.o.parentNode){o.o.parentNode.removeChild(o.o);o.wrap.style.overflow=''}o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);if(o.el.parentNode){o.el.parentNode.removeChild(o.el)}},200)}}}else{o.el.classList.remove('in');if(!o.animation){o.el.classList.remove('show')}o.calc(1);if(o.o&&o.o.parentNode){o.o.parentNode.removeChild(o.o);o.wrap.style.overflow=''}o.el.timer=setTimeout(function(){clearTimeout(o.el.timer);if(o.el.parentNode){o.el.parentNode.removeChild(o.el)}},200)}if(typeof o.onclose==='function'){o.onclose(e,o.el)}},calc:function(f){var els=o.wrap.ownerDocument.querySelectorAll('.'+o.className+'.in[data-position="'+o.el.dataset.position+'"]');if(els&&els.length){o.els=[];for(var i=0;i×'}if(o.title){o.header=document.createElement('div');if(o.icon!=='none'){o.header.innerHTML+=''}o.header.innerHTML+=o.title;o.header.className='evo-popup-header';o.el.appendChild(o.header)}o.el.innerHTML+='
      ';o.wrap.appendChild(o.el);o.mt=parseFloat(getComputedStyle(o.el).marginTop);if(o.maxheight){o.maxheight=/(%)/.test(o.maxheight)?(o.w.innerHeight-o.el.offsetHeight-o.mt)/100*parseInt(o.maxheight):o.maxheight;o.el.lastChild.style.overflowY='auto';o.el.lastChild.style.maxHeight=o.maxheight+'px'}if(o.url){o.draggable=1;if(o.iframe==='iframe'){o.resize=1;o.uid=modx.urlToUid(a.url);o.el.className+=' '+o.addclass+' '+o.className+'-iframe';o.el.id='evo-popup-'+o.uid;d.getElementById('mainloader').className='show';o.frame=d.createElement('iframe');o.frame.width='100%';o.frame.height='100%';o.frame.frameBorder='0';o.frame.src=o.url;o.frame.onload=function(e){e.target.contentWindow.opener=o.w;a.url=e.target.contentWindow.location.href;o.uid=modx.urlToUid(a.url);o.event=e;if(!!e.target.contentWindow.__alertQuit){modx.popup({type:'warning',title:'MODX :: Alert',position:'top center alertQuit',content:e.target.contentWindow.document.body.querySelector('p').innerHTML});e.target.contentWindow.document.body.innerHTML='';e.target.contentWindow.alert=function(){}}else{if(modx.getActionFromUrl(a.url,2)||o.wrap.querySelectorAll('#evo-popup-'+o.uid).length>1){o.el.close()}else{if(e.target.contentDocument.querySelectorAll('h1')[0]){a.title=e.target.contentDocument.querySelectorAll('h1')[0].innerHTML}else if(e.target.contentDocument.title){a.title=e.target.contentDocument.title}if(o.header){e.target.offsetParent.offsetParent.getElementsByClassName(o.header.className)[0].innerHTML=a.title}e.target.offsetParent.offsetParent.id='evo-popup-'+o.uid;e.target.offsetParent.offsetParent.classList.remove('changed')}}e.target.contentWindow.close=o.close;modx.main.stopWork()};o.el.lastChild.appendChild(o.frame);o.show()}else{var xhr=new XMLHttpRequest();xhr.open(o.method,o.url,true);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');xhr.setRequestHeader('X-REQUESTED-WITH','XMLHttpRequest');if(o.dataType){xhr.responseType=o.dataType}xhr.onload=function(){if(this.readyState===4){o.el.className+=' '+o.className+'-ajax';if(o.dataType==='document'){if(o.selector){var r=this.response.documentElement.querySelector(o.selector);if(r){o.el.lastChild.innerHTML+=r.innerHTML}}else{o.el.lastChild.innerHTML+=this.response.body.innerHTML}}else{o.el.lastChild.innerHTML+=this.response}o.show()}};xhr.send(o.data)}}else{o.el.lastChild.innerHTML+=o.content;o.show()}}return o}},getWindowDimension:function(){var a=0,b=0,c=d.documentElement,e=d.body;if(typeof(w.innerWidth)==='number'){a=w.innerWidth;b=w.innerHeight}else if(c&&(c.clientWidth||c.clientHeight)){a=c.clientWidth;b=c.clientHeight}else if(e&&(e.clientWidth||e.clientHeight)){a=e.clientWidth;b=e.clientHeight}return{'width':a,'height':b}},hideDropDown:function(e){e=e||w.event||w.main.event;if(tree.ca==='open'||tree.ca===''){modx.tree.setSelectedByContext()}if(modx.tree.ctx!==null){d.getElementById(modx.frameset).removeChild(modx.tree.ctx);modx.tree.ctx=null}if(!/dropdown\-item/.test(e.target.className)){var els=d.querySelectorAll('.dropdown.show'),n=null,t=e.target||e.target.parentNode,i;if(typeof t.dataset.toggle!=='undefined'){n=d.querySelector(t.dataset.toggle)}else if(t.classList.contains('dropdown-toggle')){n=t.offsetParent}for(i=0;i';if(this.classDrag)this.el.classList.add(this.classDrag);if(this.classResize)this.el.classList.add(this.classResize);this.el.insertBefore(this.borders,this.el.firstChild);if(this.handler&&this.el.getElementsByClassName(this.handler)[0]){this.handler=this.el.getElementsByClassName(this.handler)[0];this.handlerHeight=this.handler.offsetHeight}this.el.onmousedown=function(e){s.mousedown(e)};this.el.ontouchstart=function(e){s.mousedown(e.changedTouches[0])};this.wrap.addEventListener('mousemove',function(e){s.calc(e)},false);this.wrap.addEventListener('touchmove',function(e){s.calc(e.changedTouches[0])},false)};this.dragging.init.prototype={mousedown:function(e){if(e.target.classList.contains('close')){return}e=document.all?window.event:e;var s=this,x=document.all?window.event.clientX:e.clientX,y=document.all?window.event.clientY:e.clientY,style=w.getComputedStyle(this.el);this.elmX=(x-this.el.offsetLeft+parseInt(style.marginLeft));this.elmY=(y-this.el.offsetTop+parseInt(style.marginTop));this.el.position=this.el.getBoundingClientRect();this.el.style.position='fixed';this.el.style.transitionDuration='0s';this.el.style.webkitTransitionDuration='0s';this.el.style.left=this.el.offsetLeft-parseInt(style.marginLeft)+'px';this.el.style.top=this.el.offsetTop-parseInt(style.marginTop)+'px';this.el.style.right='auto';this.el.style.bottom='auto';this.el.style.width=this.el.position.width+'px';this.el.style.height=this.el.position.height+'px';if(e.target.parentNode===this.borders){this.isresize=this.resize;this.el.classList.add('is-resize')}else{if(!this.handler||(this.handler&&e.target===this.handler)){this.isdrag=true;this.el.classList.add('is-drag')}}if(typeof this.start==='function'){this.onstart(e,this.el)}if(e.preventDefault){e.preventDefault()}else{document.onselectstart=function(){return false}}this.wrap.onmousemove=function(e){s.mousemove(e)};this.wrap.ontouchmove=function(e){s.mousemove(e.changedTouches[0]);e.stopPropagation()};this.wrap.onmouseup=function(e){s.mouseup(e)};this.wrap.ontouchend=function(e){s.mouseup(e.changedTouches[0]);e.stopPropagation()}},mousemove:function(e){var x=document.all?window.event.clientX:e.clientX,y=document.all?window.event.clientY:e.clientY;if(this.isresize){if(this.onRight)this.el.style.width=Math.max(x-this.el.position.left+(this.el.position.width-this.x),this.minWidth)+'px';if(this.onBottom)this.el.style.height=Math.max(y-this.el.position.top+(this.el.position.height-this.y),this.minHeight)+'px';if(this.onLeft){this.width=Math.max(this.el.position.left-x+this.el.position.width+this.x,this.minWidth);if(this.width>this.minWidth){this.el.style.width=this.width+'px';this.el.style.left=x-this.elmX+'px'}}if(this.onTop){var currentHeight=Math.max(this.el.position.top-y+this.el.position.height+this.y,this.minHeight);if(currentHeight>this.minHeight){this.el.style.height=currentHeight+'px';this.el.style.top=y-this.elmY+'px'}}if(typeof this.onresize==='function'){this.onresize(e,this.el)}}else if(this.isdrag){this.el.style.opacity=this.opacity;this.el.style.left=x-this.elmX+'px';this.el.style.top=y-this.elmY+'px';if(typeof this.drag==='function'){this.ondrag(e,this.el)}}},mouseup:function(e){if(this.isdrag||this.isresize){this.el.classList.remove('is-resize');this.el.classList.remove('is-drag');this.el.style.opacity='';this.el.style.transitionDuration='';this.el.style.webkitTransitionDuration='';this.el.position=this.el.getBoundingClientRect();this.isdrag=false;this.isresize=false;this.wrap.onmousemove=null;this.wrap.onselectstart=null;if(typeof this.stop==='function'){this.onstop(e,this.el)}}},calc:function(e){if(this.isresize||this.isdrag){return}this.x=e.clientX-this.el.offsetLeft;this.y=e.clientY-this.el.offsetTop;if(this.resize){this.onTop=this.y=this.el.offsetWidth-this.border;this.onBottom=this.y>=this.el.offsetHeight-this.border;if(this.onRight&&this.onBottom||this.onLeft&&this.onTop){this.el.style.cursor='nwse-resize'}else if(this.onRight&&this.onTop||this.onBottom&&this.onLeft){this.el.style.cursor='nesw-resize'}else if(this.onRight||this.onLeft){this.el.style.cursor='ew-resize'}else if(this.onBottom||this.onTop){this.el.style.cursor='ns-resize'}else if(this.x>0&&this.y>0&&(this.x=this.border)){this.el.style.cursor='move'}else{this.el.style.cursor='default'}}else{if(this.x>0&&this.y>0&&(this.x=this.border)){this.el.style.cursor='move'}}}};return new this.dragging.init(a,b)},setTypeIcon:function(a){var b='';switch(this.typesactions[a]){case 1:b='fa fa-newspaper-o';break;case 2:b='fa fa-list-alt';break;case 3:b='fa fa-th-large';break;case 4:b='fa fa-code';break;case 5:b='fa fa-plug';break;case 6:b='fa fa-cube';break;case 7:b='fa fa-pencil-square-o';break;default:b='fa fa-circle'}return b}});w.mainMenu={};w.mainMenu.stopWork=function(){modx.main.stopWork()};w.mainMenu.work=function(){modx.main.work()};w.mainMenu.reloadtree=function(){if(modx.plugins.ElementsInTree){setTimeout('reloadElementsInTree()',50)}if(modx.config.global_tabs){setTimeout('modx.tree.restoreTree()',100)}};w.mainMenu.startrefresh=function(a){if(a===1){}if(a===2){}if(a===9){modx.tree.restoreTree()}if(a===10){w.location.href=modx.MODX_MANAGER_URL}};w.mainMenu.startmsgcount=function(a,b,c){modx.updateMail(c)};w.mainMenu.hideTreeFrame=function(){modx.resizer.setWidth(0)};w.mainMenu.defaultTreeFrame=function(){modx.resizer.setDefaultWidth()};w.tree={};w.tree.ca='open';w.tree.document=document;w.tree.saveFolderState=function(){};w.tree.updateTree=function(){modx.tree.updateTree()};w.tree.restoreTree=function(){modx.tree.restoreTree()};w.tree.resizeTree=function(){};w.onbeforeunload=function(){var a=w.main.frameElement.contentWindow;if(modx.getActionFromUrl(a.location.search,27)){modx.get(modx.MODX_MANAGER_URL+'?a=67&type=7&id='+modx.main.getQueryVariable('id',a.location.search.substring(1)))}};d.addEventListener('DOMContentLoaded',function(){modx.init()})})(typeof jQuery!=='undefined'?jQuery:'',window,document,undefined);(function(){if(!Element.prototype.closest){Element.prototype.closest=function(a){var b=this,c,d;['matches','webkitMatchesSelector','mozMatchesSelector','msMatchesSelector','oMatchesSelector'].some(function(fn){if(typeof document.body[fn]==='function'){c=fn;return true}return false});if(b&&c&&b[c](a))return b;while(b){d=b.parentElement;if(d&&c&&d[c](a))return d;b=d}return null}}})(); From b3aea30e0830ac19d22bbd48621116802fea710f Mon Sep 17 00:00:00 2001 From: Mr B Date: Tue, 15 May 2018 08:14:29 +0100 Subject: [PATCH 218/274] Update execute_module.processor.php restrict this to ios --- manager/processors/execute_module.processor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/processors/execute_module.processor.php b/manager/processors/execute_module.processor.php index cb335626e1..54ed31292e 100755 --- a/manager/processors/execute_module.processor.php +++ b/manager/processors/execute_module.processor.php @@ -62,7 +62,7 @@ $output = evalModule($content["modulecode"],$parameter); if (strpos(trim($output),'<')===0 && strpos(trim($output),'body,html {overflow:auto!important;height:100%!important}"; // for iframe scroller + echo ""; // for iframe scroller } echo $output; include MODX_MANAGER_PATH."includes/sysalert.display.inc.php"; From 4c5a44233ea0ff354d00e305655b5e390e6d7428 Mon Sep 17 00:00:00 2001 From: Ser1ous Date: Tue, 15 May 2018 14:43:27 +0300 Subject: [PATCH 219/274] Add event pub/unpub documents --- manager/includes/document.parser.class.inc.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index d23608bde9..c5be6fc9f3 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -1085,12 +1085,28 @@ public function updatePubStatus() // now, check for documents that need publishing $field = array('published' => 1, 'publishedon' => $timeNow); $where = "pub_date <= {$timeNow} AND pub_date!=0 AND published=0"; + $result_pub = $this->db->select( 'id', '[+prefix+]site_content', $where); $this->db->update($field, '[+prefix+]site_content', $where); + if( $this->db->getRecordCount( $result_pub ) >= 1 ) { //Event Published doc + while ($row_unpub = $this->db->getRow($result_pub)) { + $this->invokeEvent("OnDocPublished", array ( + "docid" => $row_unpub['id'] + )); + } + } // now, check for documents that need un-publishing $field = array('published' => 0, 'publishedon' => 0); $where = "unpub_date <= {$timeNow} AND unpub_date!=0 AND published=1"; + $result_unpub = $this->db->select( 'id', '[+prefix+]site_content', $where); $this->db->update($field, '[+prefix+]site_content', $where); + if( $this->db->getRecordCount( $result_unpub ) >= 1 ) { //Event unPublished doc + while ($row_unpub = $this->db->getRow($result_unpub)) { + $this->invokeEvent("OnDocUnPublished", array ( + "docid" => $row_unpub['id'] + )); + } + } $this->recentUpdate = $timeNow; From bb174a09d50347c30352e86d2d0e14aa75083ac8 Mon Sep 17 00:00:00 2001 From: Ser1ous Date: Tue, 15 May 2018 15:04:29 +0300 Subject: [PATCH 220/274] Ctr+Alt+L on PhpStorm --- .../includes/document.parser.class.inc.php | 164 ++++++++++-------- 1 file changed, 88 insertions(+), 76 deletions(-) diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index c5be6fc9f3..9efb80ae60 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -346,7 +346,7 @@ public function sendRedirect($url, $count_attempts = 0, $type = '', $responseCod header($responseCode); } - if(!empty($header)) { + if (!empty($header)) { header($header); } @@ -745,22 +745,23 @@ public function getHashFile($key) * @param $id * @return array|mixed|null|string */ - public function makePageCacheKey($id){ + public function makePageCacheKey($id) + { $hash = $id; $tmp = null; $params = array(); - if(!empty($this->systemCacheKey)){ + if (!empty($this->systemCacheKey)) { $hash = $this->systemCacheKey; - }else { + } else { if (!empty($_GET)) { // Sort GET parameters so that the order of parameters on the HTTP request don't affect the generated cache ID. $params = $_GET; ksort($params); - $hash .= '_'.md5(http_build_query($params)); + $hash .= '_' . md5(http_build_query($params)); } } - $evtOut = $this->invokeEvent("OnMakePageCacheKey", array ("hash" => $hash, "id" => $id, 'params' => $params)); - if (is_array($evtOut) && count($evtOut) > 0){ + $evtOut = $this->invokeEvent("OnMakePageCacheKey", array("hash" => $hash, "id" => $id, 'params' => $params)); + if (is_array($evtOut) && count($evtOut) > 0) { $tmp = array_pop($evtOut); } return empty($tmp) ? $hash : $tmp; @@ -1085,11 +1086,11 @@ public function updatePubStatus() // now, check for documents that need publishing $field = array('published' => 1, 'publishedon' => $timeNow); $where = "pub_date <= {$timeNow} AND pub_date!=0 AND published=0"; - $result_pub = $this->db->select( 'id', '[+prefix+]site_content', $where); + $result_pub = $this->db->select('id', '[+prefix+]site_content', $where); $this->db->update($field, '[+prefix+]site_content', $where); - if( $this->db->getRecordCount( $result_pub ) >= 1 ) { //Event Published doc + if ($this->db->getRecordCount($result_pub) >= 1) { //Event Published doc while ($row_unpub = $this->db->getRow($result_pub)) { - $this->invokeEvent("OnDocPublished", array ( + $this->invokeEvent("OnDocPublished", array( "docid" => $row_unpub['id'] )); } @@ -1098,11 +1099,11 @@ public function updatePubStatus() // now, check for documents that need un-publishing $field = array('published' => 0, 'publishedon' => 0); $where = "unpub_date <= {$timeNow} AND unpub_date!=0 AND published=1"; - $result_unpub = $this->db->select( 'id', '[+prefix+]site_content', $where); + $result_unpub = $this->db->select('id', '[+prefix+]site_content', $where); $this->db->update($field, '[+prefix+]site_content', $where); - if( $this->db->getRecordCount( $result_unpub ) >= 1 ) { //Event unPublished doc + if ($this->db->getRecordCount($result_unpub) >= 1) { //Event unPublished doc while ($row_unpub = $this->db->getRow($result_unpub)) { - $this->invokeEvent("OnDocUnPublished", array ( + $this->invokeEvent("OnDocUnPublished", array( "docid" => $row_unpub['id'] )); } @@ -1187,10 +1188,10 @@ public function _getTagsFromContent($content, $left = '[+', $right = '+]') return array(); } $spacer = md5('<<>>'); - if($left==='{{' && strpos($content,';}}')!==false) $content = str_replace(';}}', sprintf(';}%s}', $spacer),$content); - if($left==='{{' && strpos($content,'{{}}')!==false) $content = str_replace('{{}}',sprintf('{%$1s{}%$1s}',$spacer),$content); - if($left==='[[' && strpos($content,']]]]')!==false) $content = str_replace(']]]]',sprintf(']]%s]]', $spacer),$content); - if($left==='[[' && strpos($content,']]]')!==false) $content = str_replace(']]]', sprintf(']%s]]', $spacer),$content); + if ($left === '{{' && strpos($content, ';}}') !== false) $content = str_replace(';}}', sprintf(';}%s}', $spacer), $content); + if ($left === '{{' && strpos($content, '{{}}') !== false) $content = str_replace('{{}}', sprintf('{%$1s{}%$1s}', $spacer), $content); + if ($left === '[[' && strpos($content, ']]]]') !== false) $content = str_replace(']]]]', sprintf(']]%s]]', $spacer), $content); + if ($left === '[[' && strpos($content, ']]]') !== false) $content = str_replace(']]]', sprintf(']%s]]', $spacer), $content); $pos[''] = strpos($content, ']]>'); @@ -1260,8 +1261,8 @@ public function _getTagsFromContent($content, $left = '[+', $right = '+]') } } } - foreach($tags as $i=>$tag) { - if(strpos($tag,$spacer)!==false) $tags[$i] = str_replace($spacer, '', $tag); + foreach ($tags as $i => $tag) { + if (strpos($tag, $spacer) !== false) $tags[$i] = str_replace($spacer, '', $tag); } return $tags; } @@ -1301,7 +1302,7 @@ public function mergeDocumentContent($content, $ph = false) } foreach ($matches[1] as $i => $key) { - if(strpos($key,'[+')!==false) continue; // Allow chunk {{chunk?¶m=`xxx`}} with [*tv_name_[+param+]*] as content + if (strpos($key, '[+') !== false) continue; // Allow chunk {{chunk?¶m=`xxx`}} with [*tv_name_[+param+]*] as content if (substr($key, 0, 1) == '#') { $key = substr($key, 1); } // remove # for QuickEdit format @@ -1333,7 +1334,7 @@ public function mergeDocumentContent($content, $ph = false) if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif($this->debug) { + } elseif ($this->debug) { $this->addLog('mergeDocumentContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -1501,7 +1502,7 @@ public function mergeSettingsContent($content, $ph = false) $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif($this->debug) { + } elseif ($this->debug) { $this->addLog('mergeSettingsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -1570,7 +1571,7 @@ public function mergeChunkContent($content, $ph = false) $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif($this->debug) { + } elseif ($this->debug) { $this->addLog('mergeChunkContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -1629,7 +1630,7 @@ public function mergePlaceholderContent($content, $ph = false) $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif($this->debug) { + } elseif ($this->debug) { $this->addLog('mergePlaceholderContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -1840,7 +1841,7 @@ public function escapeLiteralTagsContent($content, $left = '<@LITERAL>', $right $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $v, $content); - } elseif($this->debug) { + } elseif ($this->debug) { $this->addLog('ignoreCommentedTagsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -1997,7 +1998,7 @@ public function evalSnippets($content) } if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif($this->debug) { + } elseif ($this->debug) { $this->addLog('evalSnippetsSGVar parse error', $_SERVER['REQUEST_URI'] . $s, 2); } continue; @@ -2009,7 +2010,7 @@ public function evalSnippets($content) if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif($this->debug) { + } elseif ($this->debug) { $this->addLog('evalSnippets parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -2715,7 +2716,7 @@ public function parseDocumentSource($source) */ public function executeParser() { - if(MODX_CLI) { + if (MODX_CLI) { throw new RuntimeException('Call DocumentParser::executeParser on CLI mode'); } @@ -3629,7 +3630,7 @@ public function isBackend() */ public function isFrontend() { - return ! $this->isBackend(); + return !$this->isBackend(); } /** @@ -4349,7 +4350,7 @@ public function parseText($tpl = '', $ph = array(), $left = '[+', $right = '+]', } if (strpos($tpl, $s) !== false) { $tpl = str_replace($s, $value, $tpl); - } elseif($this->debug) { + } elseif ($this->debug) { $this->addLog('parseText parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -4706,7 +4707,7 @@ public function getTemplateVars($idnames = array(), $fields = '*', $docid = '', return $this->tmpCache[__FUNCTION__][$cacheKey]; } - if (($idnames != '*' && !is_array($idnames)) || empty($idnames) ) { + if (($idnames != '*' && !is_array($idnames)) || empty($idnames)) { return false; } else { @@ -4740,7 +4741,7 @@ public function getTemplateVars($idnames = array(), $fields = '*', $docid = '', $result = $this->db->makeArray($rs); // get default/built-in template variables - if(is_array($docRow)){ + if (is_array($docRow)) { ksort($docRow); foreach ($docRow as $key => $value) { @@ -4778,7 +4779,7 @@ public function getTemplateVars($idnames = array(), $fields = '*', $docid = '', */ public function getTemplateVarOutput($idnames = array(), $docid = '', $published = 1, $sep = '') { - if (is_array($idnames) && empty($idnames) ) { + if (is_array($idnames) && empty($idnames)) { return false; } else { $output = array(); @@ -4954,14 +4955,16 @@ public function getLoginUserID($context = '') } } else { switch (true) { - case ($this->isFrontend() && isset ($_SESSION['webValidated'])): { - $out = $_SESSION['webInternalKey']; - break; - } - case ($this->isBackend() && isset ($_SESSION['mgrValidated'])): { - $out = $_SESSION['mgrInternalKey']; - break; - } + case ($this->isFrontend() && isset ($_SESSION['webValidated'])): + { + $out = $_SESSION['webInternalKey']; + break; + } + case ($this->isBackend() && isset ($_SESSION['mgrValidated'])): + { + $out = $_SESSION['mgrInternalKey']; + break; + } } } return $out; @@ -4983,14 +4986,16 @@ public function getLoginUserName($context = '') } } else { switch (true) { - case ($this->isFrontend() && isset ($_SESSION['webValidated'])): { - $out = $_SESSION['webShortname']; - break; - } - case ($this->isBackend() && isset ($_SESSION['mgrValidated'])): { - $out = $_SESSION['mgrShortname']; - break; - } + case ($this->isFrontend() && isset ($_SESSION['webValidated'])): + { + $out = $_SESSION['webShortname']; + break; + } + case ($this->isBackend() && isset ($_SESSION['mgrValidated'])): + { + $out = $_SESSION['mgrShortname']; + break; + } } } return $out; @@ -6348,33 +6353,40 @@ public function get_backtrace($backtrace) $args = preg_replace_callback('/\$var/', function () use ($modx, &$tmp, $val) { $arg = $val['args'][$tmp - 1]; switch (true) { - case is_null($arg): { - $out = 'NULL'; - break; - } - case is_numeric($arg): { - $out = $arg; - break; - } - case is_scalar($arg): { - $out = strlen($arg) > 20 ? 'string $var' . $tmp : ("'" . $this->htmlspecialchars(str_replace("'", "\\'", $arg)) . "'"); - break; - } - case is_bool($arg): { - $out = $arg ? 'TRUE' : 'FALSE'; - break; - } - case is_array($arg): { - $out = 'array $var' . $tmp; - break; - } - case is_object($arg): { - $out = get_class($arg) . ' $var' . $tmp; - break; - } - default: { - $out = '$var' . $tmp; - } + case is_null($arg): + { + $out = 'NULL'; + break; + } + case is_numeric($arg): + { + $out = $arg; + break; + } + case is_scalar($arg): + { + $out = strlen($arg) > 20 ? 'string $var' . $tmp : ("'" . $this->htmlspecialchars(str_replace("'", "\\'", $arg)) . "'"); + break; + } + case is_bool($arg): + { + $out = $arg ? 'TRUE' : 'FALSE'; + break; + } + case is_array($arg): + { + $out = 'array $var' . $tmp; + break; + } + case is_object($arg): + { + $out = get_class($arg) . ' $var' . $tmp; + break; + } + default: + { + $out = '$var' . $tmp; + } } $tmp++; return $out; From 946f7f5de0de16fd6683de0decea23ff808d79df Mon Sep 17 00:00:00 2001 From: Ser1ous Date: Thu, 17 May 2018 22:13:54 +0300 Subject: [PATCH 221/274] fix code format --- .../includes/document.parser.class.inc.php | 166 ++++++++---------- 1 file changed, 77 insertions(+), 89 deletions(-) diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index 9efb80ae60..ddcbe774c8 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -346,7 +346,7 @@ public function sendRedirect($url, $count_attempts = 0, $type = '', $responseCod header($responseCode); } - if (!empty($header)) { + if(!empty($header)) { header($header); } @@ -745,23 +745,22 @@ public function getHashFile($key) * @param $id * @return array|mixed|null|string */ - public function makePageCacheKey($id) - { + public function makePageCacheKey($id){ $hash = $id; $tmp = null; $params = array(); - if (!empty($this->systemCacheKey)) { + if(!empty($this->systemCacheKey)){ $hash = $this->systemCacheKey; - } else { + }else { if (!empty($_GET)) { // Sort GET parameters so that the order of parameters on the HTTP request don't affect the generated cache ID. $params = $_GET; ksort($params); - $hash .= '_' . md5(http_build_query($params)); + $hash .= '_'.md5(http_build_query($params)); } } - $evtOut = $this->invokeEvent("OnMakePageCacheKey", array("hash" => $hash, "id" => $id, 'params' => $params)); - if (is_array($evtOut) && count($evtOut) > 0) { + $evtOut = $this->invokeEvent("OnMakePageCacheKey", array ("hash" => $hash, "id" => $id, 'params' => $params)); + if (is_array($evtOut) && count($evtOut) > 0){ $tmp = array_pop($evtOut); } return empty($tmp) ? $hash : $tmp; @@ -1086,12 +1085,12 @@ public function updatePubStatus() // now, check for documents that need publishing $field = array('published' => 1, 'publishedon' => $timeNow); $where = "pub_date <= {$timeNow} AND pub_date!=0 AND published=0"; - $result_pub = $this->db->select('id', '[+prefix+]site_content', $where); + $result_pub = $this->db->select( 'id', '[+prefix+]site_content', $where); $this->db->update($field, '[+prefix+]site_content', $where); - if ($this->db->getRecordCount($result_pub) >= 1) { //Event Published doc - while ($row_unpub = $this->db->getRow($result_pub)) { - $this->invokeEvent("OnDocPublished", array( - "docid" => $row_unpub['id'] + if ($this->db->getRecordCount($result_pub) >= 1) { //Event unPublished doc + while ($row_pub = $this->db->getRow($result_pub)) { + $this->invokeEvent("OnDocUnPublished", array( + "docid" => $row_pub['id'] )); } } @@ -1099,7 +1098,7 @@ public function updatePubStatus() // now, check for documents that need un-publishing $field = array('published' => 0, 'publishedon' => 0); $where = "unpub_date <= {$timeNow} AND unpub_date!=0 AND published=1"; - $result_unpub = $this->db->select('id', '[+prefix+]site_content', $where); + $result_unpub = $this->db->select( 'id', '[+prefix+]site_content', $where); $this->db->update($field, '[+prefix+]site_content', $where); if ($this->db->getRecordCount($result_unpub) >= 1) { //Event unPublished doc while ($row_unpub = $this->db->getRow($result_unpub)) { @@ -1188,10 +1187,10 @@ public function _getTagsFromContent($content, $left = '[+', $right = '+]') return array(); } $spacer = md5('<<>>'); - if ($left === '{{' && strpos($content, ';}}') !== false) $content = str_replace(';}}', sprintf(';}%s}', $spacer), $content); - if ($left === '{{' && strpos($content, '{{}}') !== false) $content = str_replace('{{}}', sprintf('{%$1s{}%$1s}', $spacer), $content); - if ($left === '[[' && strpos($content, ']]]]') !== false) $content = str_replace(']]]]', sprintf(']]%s]]', $spacer), $content); - if ($left === '[[' && strpos($content, ']]]') !== false) $content = str_replace(']]]', sprintf(']%s]]', $spacer), $content); + if($left==='{{' && strpos($content,';}}')!==false) $content = str_replace(';}}', sprintf(';}%s}', $spacer),$content); + if($left==='{{' && strpos($content,'{{}}')!==false) $content = str_replace('{{}}',sprintf('{%$1s{}%$1s}',$spacer),$content); + if($left==='[[' && strpos($content,']]]]')!==false) $content = str_replace(']]]]',sprintf(']]%s]]', $spacer),$content); + if($left==='[[' && strpos($content,']]]')!==false) $content = str_replace(']]]', sprintf(']%s]]', $spacer),$content); $pos[''] = strpos($content, ']]>'); @@ -1261,8 +1260,8 @@ public function _getTagsFromContent($content, $left = '[+', $right = '+]') } } } - foreach ($tags as $i => $tag) { - if (strpos($tag, $spacer) !== false) $tags[$i] = str_replace($spacer, '', $tag); + foreach($tags as $i=>$tag) { + if(strpos($tag,$spacer)!==false) $tags[$i] = str_replace($spacer, '', $tag); } return $tags; } @@ -1302,7 +1301,7 @@ public function mergeDocumentContent($content, $ph = false) } foreach ($matches[1] as $i => $key) { - if (strpos($key, '[+') !== false) continue; // Allow chunk {{chunk?¶m=`xxx`}} with [*tv_name_[+param+]*] as content + if(strpos($key,'[+')!==false) continue; // Allow chunk {{chunk?¶m=`xxx`}} with [*tv_name_[+param+]*] as content if (substr($key, 0, 1) == '#') { $key = substr($key, 1); } // remove # for QuickEdit format @@ -1334,7 +1333,7 @@ public function mergeDocumentContent($content, $ph = false) if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('mergeDocumentContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -1502,7 +1501,7 @@ public function mergeSettingsContent($content, $ph = false) $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('mergeSettingsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -1571,7 +1570,7 @@ public function mergeChunkContent($content, $ph = false) $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('mergeChunkContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -1630,7 +1629,7 @@ public function mergePlaceholderContent($content, $ph = false) $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('mergePlaceholderContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -1841,7 +1840,7 @@ public function escapeLiteralTagsContent($content, $left = '<@LITERAL>', $right $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $v, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('ignoreCommentedTagsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -1998,7 +1997,7 @@ public function evalSnippets($content) } if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('evalSnippetsSGVar parse error', $_SERVER['REQUEST_URI'] . $s, 2); } continue; @@ -2010,7 +2009,7 @@ public function evalSnippets($content) if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('evalSnippets parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -2716,7 +2715,7 @@ public function parseDocumentSource($source) */ public function executeParser() { - if (MODX_CLI) { + if(MODX_CLI) { throw new RuntimeException('Call DocumentParser::executeParser on CLI mode'); } @@ -3630,7 +3629,7 @@ public function isBackend() */ public function isFrontend() { - return !$this->isBackend(); + return ! $this->isBackend(); } /** @@ -4350,7 +4349,7 @@ public function parseText($tpl = '', $ph = array(), $left = '[+', $right = '+]', } if (strpos($tpl, $s) !== false) { $tpl = str_replace($s, $value, $tpl); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('parseText parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -4707,7 +4706,7 @@ public function getTemplateVars($idnames = array(), $fields = '*', $docid = '', return $this->tmpCache[__FUNCTION__][$cacheKey]; } - if (($idnames != '*' && !is_array($idnames)) || empty($idnames)) { + if (($idnames != '*' && !is_array($idnames)) || empty($idnames) ) { return false; } else { @@ -4741,7 +4740,7 @@ public function getTemplateVars($idnames = array(), $fields = '*', $docid = '', $result = $this->db->makeArray($rs); // get default/built-in template variables - if (is_array($docRow)) { + if(is_array($docRow)){ ksort($docRow); foreach ($docRow as $key => $value) { @@ -4779,7 +4778,7 @@ public function getTemplateVars($idnames = array(), $fields = '*', $docid = '', */ public function getTemplateVarOutput($idnames = array(), $docid = '', $published = 1, $sep = '') { - if (is_array($idnames) && empty($idnames)) { + if (is_array($idnames) && empty($idnames) ) { return false; } else { $output = array(); @@ -4955,16 +4954,14 @@ public function getLoginUserID($context = '') } } else { switch (true) { - case ($this->isFrontend() && isset ($_SESSION['webValidated'])): - { - $out = $_SESSION['webInternalKey']; - break; - } - case ($this->isBackend() && isset ($_SESSION['mgrValidated'])): - { - $out = $_SESSION['mgrInternalKey']; - break; - } + case ($this->isFrontend() && isset ($_SESSION['webValidated'])): { + $out = $_SESSION['webInternalKey']; + break; + } + case ($this->isBackend() && isset ($_SESSION['mgrValidated'])): { + $out = $_SESSION['mgrInternalKey']; + break; + } } } return $out; @@ -4986,16 +4983,14 @@ public function getLoginUserName($context = '') } } else { switch (true) { - case ($this->isFrontend() && isset ($_SESSION['webValidated'])): - { - $out = $_SESSION['webShortname']; - break; - } - case ($this->isBackend() && isset ($_SESSION['mgrValidated'])): - { - $out = $_SESSION['mgrShortname']; - break; - } + case ($this->isFrontend() && isset ($_SESSION['webValidated'])): { + $out = $_SESSION['webShortname']; + break; + } + case ($this->isBackend() && isset ($_SESSION['mgrValidated'])): { + $out = $_SESSION['mgrShortname']; + break; + } } } return $out; @@ -6353,40 +6348,33 @@ public function get_backtrace($backtrace) $args = preg_replace_callback('/\$var/', function () use ($modx, &$tmp, $val) { $arg = $val['args'][$tmp - 1]; switch (true) { - case is_null($arg): - { - $out = 'NULL'; - break; - } - case is_numeric($arg): - { - $out = $arg; - break; - } - case is_scalar($arg): - { - $out = strlen($arg) > 20 ? 'string $var' . $tmp : ("'" . $this->htmlspecialchars(str_replace("'", "\\'", $arg)) . "'"); - break; - } - case is_bool($arg): - { - $out = $arg ? 'TRUE' : 'FALSE'; - break; - } - case is_array($arg): - { - $out = 'array $var' . $tmp; - break; - } - case is_object($arg): - { - $out = get_class($arg) . ' $var' . $tmp; - break; - } - default: - { - $out = '$var' . $tmp; - } + case is_null($arg): { + $out = 'NULL'; + break; + } + case is_numeric($arg): { + $out = $arg; + break; + } + case is_scalar($arg): { + $out = strlen($arg) > 20 ? 'string $var' . $tmp : ("'" . $this->htmlspecialchars(str_replace("'", "\\'", $arg)) . "'"); + break; + } + case is_bool($arg): { + $out = $arg ? 'TRUE' : 'FALSE'; + break; + } + case is_array($arg): { + $out = 'array $var' . $tmp; + break; + } + case is_object($arg): { + $out = get_class($arg) . ' $var' . $tmp; + break; + } + default: { + $out = '$var' . $tmp; + } } $tmp++; return $out; @@ -6760,4 +6748,4 @@ public function _resetEventObject() $this->_propagate = true; $this->activated = false; } -} +} \ No newline at end of file From 569a1533cb4e2737789a39d9c98d624c4467f9d6 Mon Sep 17 00:00:00 2001 From: Pathologic Date: Fri, 18 May 2018 01:08:01 +0300 Subject: [PATCH 222/274] singleton --- .../includes/document.parser.class.inc.php | 739 ++++++------------ 1 file changed, 246 insertions(+), 493 deletions(-) diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index 52f74ef69d..e5efb1d19d 100644 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -180,11 +180,10 @@ class DocumentParser /** * Document constructor - * PUBLIC access for backward compatibility !!!! * * @return DocumentParser */ - final public function __construct() + public function __construct() { if ($this->isLoggedIn()) { ini_set('display_errors', 1); @@ -208,7 +207,6 @@ final public function __construct() final private function __clone() { } - /** * @return DocumentParser */ @@ -217,7 +215,6 @@ public static function getInstance() if (self::$instance === null) { self::$instance = new DocumentParser(); } - return self::$instance; } @@ -270,7 +267,6 @@ public function checkSQLconnect($connector = 'db') if (is_scalar($connector) && !empty($connector) && isset($this->{$connector}) && $this->{$connector} instanceof DBAPI) { $flag = (bool)$this->{$connector}->conn; } - return $flag; } @@ -302,7 +298,6 @@ public function loadExtension($extname, $reload = true) if ($out && !in_array($extname, $this->extensions)) { $this->extensions[] = $extname; } - return $out; } @@ -314,7 +309,6 @@ public function loadExtension($extname, $reload = true) public function getMicroTime() { list ($usec, $sec) = explode(' ', microtime()); - return ((float)$usec + (float)$sec); } @@ -372,7 +366,7 @@ public function sendRedirect($url, $count_attempts = 0, $type = '', $responseCod header($responseCode); } - if (!empty($header)) { + if(!empty($header)) { header($header); } @@ -464,8 +458,7 @@ public function getSettings() $this->config['site_manager_url'] = MODX_MANAGER_URL; $this->config['site_manager_path'] = MODX_MANAGER_PATH; $this->error_reporting = $this->config['error_reporting']; - $this->config['filemanager_path'] = str_replace('[(base_path)]', MODX_BASE_PATH, - $this->config['filemanager_path']); + $this->config['filemanager_path'] = str_replace('[(base_path)]', MODX_BASE_PATH, $this->config['filemanager_path']); $this->config['rb_base_dir'] = str_replace('[(base_path)]', MODX_BASE_PATH, $this->config['rb_base_dir']); if (!isset($this->config['enable_at_syntax'])) { @@ -589,8 +582,7 @@ public function getUserSettings() } $this->config = array_merge($this->config, $usrSettings); - $this->config['filemanager_path'] = str_replace('[(base_path)]', MODX_BASE_PATH, - $this->config['filemanager_path']); + $this->config['filemanager_path'] = str_replace('[(base_path)]', MODX_BASE_PATH, $this->config['filemanager_path']); $this->config['rb_base_dir'] = str_replace('[(base_path)]', MODX_BASE_PATH, $this->config['rb_base_dir']); return $usrSettings; @@ -729,24 +721,18 @@ public function cleanDocumentIdentifier($qOrig) $this->virtualDir = ''; } - if (preg_match('@^[1-9][0-9]*$@', - $q) && !isset($this->documentListing[$q])) { /* we got an ID returned, check to make sure it's not an alias */ + if (preg_match('@^[1-9][0-9]*$@', $q) && !isset($this->documentListing[$q])) { /* we got an ID returned, check to make sure it's not an alias */ /* FS#476 and FS#308: check that id is valid in terms of virtualDir structure */ if ($this->config['use_alias_path'] == 1) { - if (($this->virtualDir != '' && !isset($this->documentListing[$this->virtualDir . '/' . $q]) || ($this->virtualDir == '' && !isset($this->documentListing[$q]))) && (($this->virtualDir != '' && isset($this->documentListing[$this->virtualDir]) && in_array($q, - $this->getChildIds($this->documentListing[$this->virtualDir], - 1))) || ($this->virtualDir == '' && in_array($q, $this->getChildIds(0, 1))))) { + if (($this->virtualDir != '' && !isset($this->documentListing[$this->virtualDir . '/' . $q]) || ($this->virtualDir == '' && !isset($this->documentListing[$q]))) && (($this->virtualDir != '' && isset($this->documentListing[$this->virtualDir]) && in_array($q, $this->getChildIds($this->documentListing[$this->virtualDir], 1))) || ($this->virtualDir == '' && in_array($q, $this->getChildIds(0, 1))))) { $this->documentMethod = 'id'; - return $q; } else { /* not a valid id in terms of virtualDir, treat as alias */ $this->documentMethod = 'alias'; - return $q; } } else { $this->documentMethod = 'id'; - return $q; } } else { /* we didn't get an ID back, so instead we assume it's an alias */ @@ -754,7 +740,6 @@ public function cleanDocumentIdentifier($qOrig) $q = $qOrig; } $this->documentMethod = 'alias'; - return $q; } } @@ -780,26 +765,24 @@ public function getHashFile($key) * @param $id * @return array|mixed|null|string */ - public function makePageCacheKey($id) - { + public function makePageCacheKey($id){ $hash = $id; $tmp = null; $params = array(); - if (!empty($this->systemCacheKey)) { + if(!empty($this->systemCacheKey)){ $hash = $this->systemCacheKey; - } else { + }else { if (!empty($_GET)) { // Sort GET parameters so that the order of parameters on the HTTP request don't affect the generated cache ID. $params = $_GET; ksort($params); - $hash .= '_' . md5(http_build_query($params)); + $hash .= '_'.md5(http_build_query($params)); } } - $evtOut = $this->invokeEvent("OnMakePageCacheKey", array("hash" => $hash, "id" => $id, 'params' => $params)); - if (is_array($evtOut) && count($evtOut) > 0) { + $evtOut = $this->invokeEvent("OnMakePageCacheKey", array ("hash" => $hash, "id" => $id, 'params' => $params)); + if (is_array($evtOut) && count($evtOut) > 0){ $tmp = array_pop($evtOut); } - return empty($tmp) ? $hash : $tmp; } @@ -831,7 +814,6 @@ public function getDocumentObjectFromCache($id, $loading = false) if (!is_file($cache_path)) { $this->documentGenerated = 1; - return ''; } $content = file_get_contents($cache_path, false); @@ -898,7 +880,6 @@ public function getDocumentObjectFromCache($id, $loading = false) // invoke OnLoadWebPageCache event $this->documentContent = $result; $this->invokeEvent('OnLoadWebPageCache'); - return $result; } @@ -1022,8 +1003,7 @@ public function outputContent($noEvent = false) $sc .= sprintf("%s. %s (%s)
      ", $s, $sname, sprintf("%2.2f ms", $t)); // currentSnippet $tt += $t; } - echo "
      Snippets (" . count($this->snippetsTime) . " / " . sprintf("%2.2f ms", - $tt) . "){$sc}

      "; + echo "
      Snippets (" . count($this->snippetsTime) . " / " . sprintf("%2.2f ms", $tt) . "){$sc}

      "; echo $this->snippetsCode; } if ($this->dumpPlugins) { @@ -1033,8 +1013,7 @@ public function outputContent($noEvent = false) $ps .= "$s (" . sprintf("%2.2f ms", $t * 1000) . ")
      "; $tt += $t; } - echo "
      Plugins (" . count($this->pluginsTime) . " / " . sprintf("%2.2f ms", - $tt * 1000) . "){$ps}

      "; + echo "
      Plugins (" . count($this->pluginsTime) . " / " . sprintf("%2.2f ms", $tt * 1000) . "){$ps}

      "; echo $this->pluginsCode; } @@ -1048,7 +1027,6 @@ public function outputContent($noEvent = false) public function RecoveryEscapedTags($contents) { list($sTags, $rTags) = $this->getTagsForEscape(); - return str_replace($rTags, $sTags, $contents); } @@ -1063,7 +1041,6 @@ public function getTagsForEscape($tags = '{{,}},[[,]],[!,!],[*,*],[(,)],[+,+],[~ foreach ($srcTags as $tag) { $repTags[] = '\\' . $tag[0] . '\\' . $tag[1]; } - return array($srcTags, $repTags); } @@ -1128,12 +1105,28 @@ public function updatePubStatus() // now, check for documents that need publishing $field = array('published' => 1, 'publishedon' => $timeNow); $where = "pub_date <= {$timeNow} AND pub_date!=0 AND published=0"; + $result_pub = $this->db->select( 'id', '[+prefix+]site_content', $where); $this->db->update($field, '[+prefix+]site_content', $where); + if( $this->db->getRecordCount( $result_pub ) >= 1 ) { //Event Published doc + while ($row_unpub = $this->db->getRow($result_pub)) { + $this->invokeEvent("OnDocPublished", array ( + "docid" => $row_unpub['id'] + )); + } + } // now, check for documents that need un-publishing $field = array('published' => 0, 'publishedon' => 0); $where = "unpub_date <= {$timeNow} AND unpub_date!=0 AND published=1"; + $result_unpub = $this->db->select( 'id', '[+prefix+]site_content', $where); $this->db->update($field, '[+prefix+]site_content', $where); + if( $this->db->getRecordCount( $result_unpub ) >= 1 ) { //Event unPublished doc + while ($row_unpub = $this->db->getRow($result_unpub)) { + $this->invokeEvent("OnDocUnPublished", array ( + "docid" => $row_unpub['id'] + )); + } + } $this->recentUpdate = $timeNow; @@ -1199,7 +1192,6 @@ public function getTagsFromContent($content, $left = '[+', $right = '+]') $tags[0][] = "{$left}{$v}{$right}"; $tags[1][] = $v; } - return $tags; } @@ -1215,18 +1207,10 @@ public function _getTagsFromContent($content, $left = '[+', $right = '+]') return array(); } $spacer = md5('<<>>'); - if ($left === '{{' && strpos($content, ';}}') !== false) { - $content = str_replace(';}}', sprintf(';}%s}', $spacer), $content); - } - if ($left === '{{' && strpos($content, '{{}}') !== false) { - $content = str_replace('{{}}', sprintf('{%$1s{}%$1s}', $spacer), $content); - } - if ($left === '[[' && strpos($content, ']]]]') !== false) { - $content = str_replace(']]]]', sprintf(']]%s]]', $spacer), $content); - } - if ($left === '[[' && strpos($content, ']]]') !== false) { - $content = str_replace(']]]', sprintf(']%s]]', $spacer), $content); - } + if($left==='{{' && strpos($content,';}}')!==false) $content = str_replace(';}}', sprintf(';}%s}', $spacer),$content); + if($left==='{{' && strpos($content,'{{}}')!==false) $content = str_replace('{{}}',sprintf('{%$1s{}%$1s}',$spacer),$content); + if($left==='[[' && strpos($content,']]]]')!==false) $content = str_replace(']]]]',sprintf(']]%s]]', $spacer),$content); + if($left==='[[' && strpos($content,']]]')!==false) $content = str_replace(']]]', sprintf(']%s]]', $spacer),$content); $pos[''] = strpos($content, ']]>'); @@ -1296,12 +1280,9 @@ public function _getTagsFromContent($content, $left = '[+', $right = '+]') } } } - foreach ($tags as $i => $tag) { - if (strpos($tag, $spacer) !== false) { - $tags[$i] = str_replace($spacer, '', $tag); - } + foreach($tags as $i=>$tag) { + if(strpos($tag,$spacer)!==false) $tags[$i] = str_replace($spacer, '', $tag); } - return $tags; } @@ -1340,9 +1321,7 @@ public function mergeDocumentContent($content, $ph = false) } foreach ($matches[1] as $i => $key) { - if (strpos($key, '[+') !== false) { - continue; - } // Allow chunk {{chunk?¶m=`xxx`}} with [*tv_name_[+param+]*] as content + if(strpos($key,'[+')!==false) continue; // Allow chunk {{chunk?¶m=`xxx`}} with [*tv_name_[+param+]*] as content if (substr($key, 0, 1) == '#') { $key = substr($key, 1); } // remove # for QuickEdit format @@ -1374,7 +1353,7 @@ public function mergeDocumentContent($content, $ph = false) if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('mergeDocumentContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -1496,7 +1475,6 @@ public function _contextValue($key, $parent = false) } else { $value = ''; } - return $value; } @@ -1543,11 +1521,10 @@ public function mergeSettingsContent($content, $ph = false) $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('mergeSettingsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } - return $content; } @@ -1613,11 +1590,10 @@ public function mergeChunkContent($content, $ph = false) $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('mergeChunkContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } - return $content; } @@ -1673,11 +1649,10 @@ public function mergePlaceholderContent($content, $ph = false) $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('mergePlaceholderContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } - return $content; } @@ -1689,13 +1664,8 @@ public function mergePlaceholderContent($content, $ph = false) * @param string $endiftag * @return mixed|string */ - public function mergeConditionalTagsContent( - $content, - $iftag = '<@IF:', - $elseiftag = '<@ELSEIF:', - $elsetag = '<@ELSE>', - $endiftag = '<@ENDIF>' - ) { + public function mergeConditionalTagsContent($content, $iftag = '<@IF:', $elseiftag = '<@ELSEIF:', $elsetag = '<@ELSE>', $endiftag = '<@ENDIF>') + { if (strpos($content, '@IF') !== false) { $content = $this->_prepareCTag($content, $iftag, $elseiftag, $elsetag, $endiftag); } @@ -1705,8 +1675,7 @@ public function mergeConditionalTagsContent( } $sp = '#' . md5('ConditionalTags' . $_SERVER['REQUEST_TIME']) . '#'; - $content = str_replace(array(''), array("{$sp}b", "{$sp}p", "{$sp}s", "{$sp}e"), - $content); + $content = str_replace(array(''), array("{$sp}b", "{$sp}p", "{$sp}s", "{$sp}e"), $content); $pieces = explode('<@IF:', $content); foreach ($pieces as $i => $split) { @@ -1735,8 +1704,7 @@ public function mergeConditionalTagsContent( ob_start(); $content = eval('?>' . $content); $content = ob_get_clean(); - $content = str_replace(array("{$sp}b", "{$sp}p", "{$sp}s", "{$sp}e"), array(''), - $content); + $content = str_replace(array("{$sp}b", "{$sp}p", "{$sp}s", "{$sp}e"), array(''), $content); return $content; } @@ -1749,13 +1717,8 @@ public function mergeConditionalTagsContent( * @param string $endiftag * @return mixed */ - private function _prepareCTag( - $content, - $iftag = '<@IF:', - $elseiftag = '<@ELSEIF:', - $elsetag = '<@ELSE>', - $endiftag = '<@ENDIF>' - ) { + private function _prepareCTag($content, $iftag = '<@IF:', $elseiftag = '<@ELSEIF:', $elsetag = '<@ELSE>', $endiftag = '<@ENDIF>') + { if (strpos($content, '' $content = str_replace($matches[0], '', $content); } } - return $content; } @@ -1899,11 +1860,10 @@ public function escapeLiteralTagsContent($content, $left = '<@LITERAL>', $right $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $v, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('ignoreCommentedTagsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } - return $content; } @@ -1924,7 +1884,6 @@ public function detectError($error) } elseif ($this->config['error_reporting'] == 1 && ($error & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT)) { $detected = true; } - return $detected; } @@ -1964,8 +1923,7 @@ public function evalPlugin($pluginCode, $params) $error_info = error_get_last(); if ($this->detectError($error_info['type'])) { $msg = ($msg === false) ? 'ob_get_contents() error' : $msg; - $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Plugin', - $error_info['message'], $error_info['line'], $msg); + $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Plugin', $error_info['message'], $error_info['line'], $msg); if ($this->isBackend()) { $this->event->alert('An error occurred while loading. Please see the event log for more information.

      ' . $msg . '

      '); } @@ -2011,8 +1969,7 @@ public function evalSnippet($phpcode, $params) $error_info = error_get_last(); if ($this->detectError($error_info['type'])) { $echo = ($echo === false) ? 'ob_get_contents() error' : $echo; - $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Snippet', - $error_info['message'], $error_info['line'], $echo); + $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Snippet', $error_info['message'], $error_info['line'], $echo); if ($this->isBackend()) { $this->event->alert('An error occurred while loading. Please see the event log for more information

      ' . $echo . $return . '

      '); } @@ -2047,8 +2004,7 @@ public function evalSnippets($content) $this->snipLapCount++; if ($this->dumpSnippets) { - $this->snippetsCode .= sprintf('
      PARSE PASS %s

      The following snippets (if any) were parsed during this pass.

      ', - $this->snipLapCount); + $this->snippetsCode .= sprintf('
      PARSE PASS %s

      The following snippets (if any) were parsed during this pass.

      ', $this->snipLapCount); } foreach ($matches[1] as $i => $call) { @@ -2061,7 +2017,7 @@ public function evalSnippets($content) } if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('evalSnippetsSGVar parse error', $_SERVER['REQUEST_URI'] . $s, 2); } continue; @@ -2073,7 +2029,7 @@ public function evalSnippets($content) if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('evalSnippets parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -2118,7 +2074,6 @@ public function _getSGVar($value) if ($modifiers !== false) { $value = $this->applyFilter($value, $modifiers, $key); } - return $value; } @@ -2166,13 +2121,10 @@ private function _get_snip_result($piece) $eventtime = sprintf('%2.2f ms', $eventtime * 1000); $code = str_replace("\t", ' ', $this->htmlspecialchars($value)); $piece = str_replace("\t", ' ', $this->htmlspecialchars($piece)); - $print_r_params = str_replace("\t", ' ', - $this->htmlspecialchars('$modx->event->params = ' . print_r($params, true))); - $this->snippetsCode .= sprintf('
      %s(%s)
      [[%s]]
      %s
      %s
      ', - $snippetObject['name'], $eventtime, $piece, $print_r_params, $code); + $print_r_params = str_replace("\t", ' ', $this->htmlspecialchars('$modx->event->params = ' . print_r($params, true))); + $this->snippetsCode .= sprintf('
      %s(%s)
      [[%s]]
      %s
      %s
      ', $snippetObject['name'], $eventtime, $piece, $print_r_params, $code); $this->snippetsTime[] = array('sname' => $key, 'time' => $eventtime); } - return $value; } @@ -2299,7 +2251,6 @@ public function getParamsFromString($string = '') $params[$k] = current($p); } } - return $params; } @@ -2357,7 +2308,6 @@ public function _getSplitPosition($str) break; } } - return $pos; } @@ -2408,8 +2358,7 @@ private function _getSnippetObject($snip_name) } } elseif (substr($snip_name, 0, 1) === '@' && isset($this->pluginEvent[trim($snip_name, '@')])) { $snippetObject['name'] = trim($snip_name, '@'); - $snippetObject['content'] = sprintf('$rs=$this->invokeEvent("%s",$params);echo trim(implode("",$rs));', - trim($snip_name, '@')); + $snippetObject['content'] = sprintf('$rs=$this->invokeEvent("%s",$params);echo trim(implode("",$rs));', trim($snip_name, '@')); $snippetObject['properties'] = ''; } else { $where = sprintf("name='%s' AND disabled=0", $this->db->escape($snip_name)); @@ -2432,7 +2381,6 @@ private function _getSnippetObject($snip_name) $this->snippetCache[$snip_name] = $snip_content; $this->snippetCache["{$snip_name}Props"] = $snip_prop; } - return $snippetObject; } @@ -2443,16 +2391,7 @@ private function _getSnippetObject($snip_name) public function toAlias($text) { $suff = $this->config['friendly_url_suffix']; - - return str_replace(array( - '.xml' . $suff, - '.rss' . $suff, - '.js' . $suff, - '.css' . $suff, - '.txt' . $suff, - '.json' . $suff, - '.pdf' . $suff - ), array('.xml', '.rss', '.js', '.css', '.txt', '.json', '.pdf'), $text); + return str_replace(array('.xml' . $suff, '.rss' . $suff, '.js' . $suff, '.css' . $suff, '.txt' . $suff, '.json' . $suff, '.pdf' . $suff), array('.xml', '.rss', '.js', '.css', '.txt', '.json', '.pdf'), $text); } /** @@ -2488,7 +2427,7 @@ public function makeFriendlyURL($pre, $suff, $alias, $isfolder = 0, $id = 0) } $evtOut = $this->invokeEvent('OnMakeDocUrl', array( - 'id' => $id, + 'id' => $id, 'url' => $url )); @@ -2521,8 +2460,7 @@ public function rewriteUrls($documentSource) preg_match_all('!\[\~([0-9]+)\~\]!ise', $documentSource, $match); $ids = implode(',', array_unique($match['1'])); if ($ids) { - $res = $this->db->select("id,alias,isfolder,parent,alias_visible", - $this->getFullTableName('site_content'), "id IN (" . $ids . ") AND isfolder = '0'"); + $res = $this->db->select("id,alias,isfolder,parent,alias_visible", $this->getFullTableName('site_content'), "id IN (" . $ids . ") AND isfolder = '0'"); while ($row = $this->db->getRow($res)) { if ($this->config['use_alias_path'] == '1' && $row['parent'] != 0) { $parent = $row['parent']; @@ -2545,23 +2483,19 @@ public function rewriteUrls($documentSource) $isfriendly = ($this->config['friendly_alias_urls'] == 1 ? 1 : 0); $pref = $this->config['friendly_url_prefix']; $suff = $this->config['friendly_url_suffix']; - $documentSource = preg_replace_callback($in, - function ($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff) { - $modx = evolutionCMS(); - $thealias = $aliases[$m[1]]; - $thefolder = $isfolder[$m[1]]; - if ($isfriendly && isset($thealias)) { - //found friendly url - $out = ($modx->config['seostrict'] == '1' ? $modx->toAlias($modx->makeFriendlyURL($pref, $suff, - $thealias, $thefolder, $m[1])) : $modx->makeFriendlyURL($pref, $suff, $thealias, $thefolder, - $m[1])); - } else { - //not found friendly url - $out = $modx->makeFriendlyURL($pref, $suff, $m[1]); - } - - return $out; - }, $documentSource); + $documentSource = preg_replace_callback($in, function ($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff) { + global $modx; + $thealias = $aliases[$m[1]]; + $thefolder = $isfolder[$m[1]]; + if ($isfriendly && isset($thealias)) { + //found friendly url + $out = ($modx->config['seostrict'] == '1' ? $modx->toAlias($modx->makeFriendlyURL($pref, $suff, $thealias, $thefolder, $m[1])) : $modx->makeFriendlyURL($pref, $suff, $thealias, $thefolder, $m[1])); + } else { + //not found friendly url + $out = $modx->makeFriendlyURL($pref, $suff, $m[1]); + } + return $out; + }, $documentSource); } else { $in = '!\[\~([0-9]+)\~\]!is'; @@ -2601,13 +2535,14 @@ public function sendStrictURI() $requestedURL = "{$scheme}://{$http_host}" . '/' . $q; //LANG $site_url = $this->config['site_url']; + $url_query_string = explode('?', $_SERVER['REQUEST_URI']); + // Strip conflicting id/q from query string + $qstring = !empty($url_query_string[1]) ? preg_replace("#(^|&)(q|id)=[^&]+#", '', $url_query_string[1]) : ''; if ($this->documentIdentifier == $this->config['site_start']) { if ($requestedURL != $this->config['site_url']) { // Force redirect of site start // $this->sendErrorPage(); - $qstring = isset($url_query_string) ? preg_replace("#(^|&)(q|id)=[^&]+#", '', - $url_query_string) : ''; // Strip conflicting id/q from query string if ($qstring) { $url = "{$site_url}?{$qstring}"; } else { @@ -2625,10 +2560,6 @@ public function sendStrictURI() } elseif ($url_path != $strictURL && $this->documentIdentifier != $this->config['error_page']) { // Force page redirect //$strictURL = ltrim($strictURL,'/'); - - if (!empty($url_query_string)) { - $qstring = preg_replace("#(^|&)(q|id)=[^&]+#", '', $url_query_string); - } // Strip conflicting id/q from query string if (!empty($qstring)) { $url = "{$site_url}{$strictURL}?{$qstring}"; } else { @@ -2637,7 +2568,6 @@ public function sendStrictURI() $this->sendRedirect($url, 0, 'REDIRECT_HEADER', 'HTTP/1.0 301 Moved Permanently'); exit(0); } - return; } @@ -2665,8 +2595,7 @@ public function getDocumentObject($method, $identifier, $isPrepareResponse = fal $identifier = $this->cleanDocumentIdentifier($identifier); $method = $this->documentMethod; } - if ($method == 'alias' && $this->config['use_alias_path'] && array_key_exists($identifier, - $this->documentListing)) { + if ($method == 'alias' && $this->config['use_alias_path'] && array_key_exists($identifier, $this->documentListing)) { $method = 'id'; $identifier = $this->documentListing[$identifier]; } @@ -2688,8 +2617,7 @@ public function getDocumentObject($method, $identifier, $isPrepareResponse = fal if ($this->config['unauthorized_page']) { // method may still be alias, while identifier is not full path alias, e.g. id not found above if ($method === 'alias') { - $secrs = $this->db->select('count(dg.id)', "{$tbldg} as dg, {$tblsc} as sc", - "dg.document = sc.id AND sc.alias = '{$identifier}'", '', 1); + $secrs = $this->db->select('count(dg.id)', "{$tbldg} as dg, {$tblsc} as sc", "dg.document = sc.id AND sc.alias = '{$identifier}'", '', 1); } else { $secrs = $this->db->select('count(id)', $tbldg, "document = '{$identifier}'", '', 1); } @@ -2717,11 +2645,9 @@ public function getDocumentObject($method, $identifier, $isPrepareResponse = fal } if ($documentObject['template']) { // load TVs and merge with document - Orig by Apodigm - Docvars - $rs = $this->db->select("tv.*, IF(tvc.value!='',tvc.value,tv.default_text) as value", - $this->getFullTableName("site_tmplvars") . " tv + $rs = $this->db->select("tv.*, IF(tvc.value!='',tvc.value,tv.default_text) as value", $this->getFullTableName("site_tmplvars") . " tv INNER JOIN " . $this->getFullTableName("site_tmplvar_templates") . " tvtpl ON tvtpl.tmplvarid = tv.id - LEFT JOIN " . $this->getFullTableName("site_tmplvar_contentvalues") . " tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$documentObject['id']}'", - "tvtpl.templateid = '{$documentObject['template']}'"); + LEFT JOIN " . $this->getFullTableName("site_tmplvar_contentvalues") . " tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$documentObject['id']}'", "tvtpl.templateid = '{$documentObject['template']}'"); $tmplvars = array(); while ($row = $this->db->getRow($rs)) { $tmplvars[$row['name']] = array( @@ -2796,7 +2722,6 @@ public function parseDocumentSource($source) } // if content change then increase passes because } // we have not yet reached maxParserPasses } - return $source; } @@ -2869,8 +2794,7 @@ public function executeParser() $docAlias = $this->db->escape($this->documentIdentifier); - $rs = $this->db->select('id', $tbl_site_content, - "deleted=0 and parent='{$parentId}' and alias='{$docAlias}'"); + $rs = $this->db->select('id', $tbl_site_content, "deleted=0 and parent='{$parentId}' and alias='{$docAlias}'"); if ($this->db->getRecordCount($rs) == 0) { $this->sendErrorPage(); } @@ -2917,8 +2841,7 @@ public function executeParser() $this->documentIdentifier = $this->documentListing[$this->documentIdentifier]; } else { $docAlias = $this->db->escape($this->documentIdentifier); - $rs = $this->db->select('id', $this->getFullTableName('site_content'), - "deleted=0 and alias='{$docAlias}'"); + $rs = $this->db->select('id', $this->getFullTableName('site_content'), "deleted=0 and alias='{$docAlias}'"); $this->documentIdentifier = (int)$this->db->getValue($rs); } } @@ -2928,6 +2851,10 @@ public function executeParser() //$this->_fixURI(); // invoke OnWebPageInit event $this->invokeEvent("OnWebPageInit"); + // invoke OnLogPageView event + if ($this->config['track_visitors'] == 1) { + $this->invokeEvent("OnLogPageHit"); + } if ($this->config['seostrict'] === '1') { $this->sendStrictURI(); } @@ -2942,7 +2869,6 @@ public function executeParser() public function mb_basename($path, $suffix = null) { $exp = explode('/', $path); - return str_replace($suffix, '', end($exp)); } @@ -2975,7 +2901,6 @@ public function _IIS_furl_fix() } $_SERVER['PHP_SELF'] = $this->config['base_url'] . $qp['path']; $this->q = $qp['path']; - return $qp['path']; } @@ -3004,8 +2929,7 @@ public function prepareResponse() if ($this->documentContent == '') { // get document object from DB - $this->documentObject = $this->getDocumentObject($this->documentMethod, $this->documentIdentifier, - 'prepareResponse'); + $this->documentObject = $this->getDocumentObject($this->documentMethod, $this->documentIdentifier, 'prepareResponse'); // write the documentName to the object $this->documentName = &$this->documentObject['pagetitle']; @@ -3135,7 +3059,6 @@ public function getParentIds($id, $height = 10) } $parents[$thisid] = $id; } - return $parents; } @@ -3154,7 +3077,6 @@ public function getUltimateParentId($id, $top = 0) $id = $this->aliasListing[$id]['parent']; $i++; } - return $id; } @@ -3176,8 +3098,7 @@ public function getChildIds($id, $depth = 10, $children = array()) if ($this->config['aliaslistingfolder'] == 1) { - $res = $this->db->select("id,alias,isfolder,parent", $this->getFullTableName('site_content'), - "parent IN (" . $id . ") AND deleted = '0'"); + $res = $this->db->select("id,alias,isfolder,parent", $this->getFullTableName('site_content'), "parent IN (" . $id . ") AND deleted = '0'"); $idx = array(); while ($row = $this->db->getRow($res)) { $pAlias = ''; @@ -3198,7 +3119,6 @@ public function getChildIds($id, $depth = 10, $children = array()) } } $this->tmpCache[__FUNCTION__][$cacheKey] = $children; - return $children; } else { @@ -3230,7 +3150,6 @@ public function getChildIds($id, $depth = 10, $children = array()) } } $this->tmpCache[__FUNCTION__][$cacheKey] = $children; - return $children; } @@ -3281,7 +3200,6 @@ public function hasPermission($pm) if ($pms) { $state = ((bool)$pms[$pm] === true); } - return (int)$state; } @@ -3334,9 +3252,9 @@ public function getLockedElements($type = 0, $minimumDetails = false) foreach ($this->lockedElements as $elType => $elements) { foreach ($elements as $elId => $el) { $lockedElements[$elType][$elId] = array( - 'username' => $el['username'], + 'username' => $el['username'], 'lasthit_df' => $el['lasthit_df'], - 'state' => $this->determineLockState($el['internalKey']) + 'state' => $this->determineLockState($el['internalKey']) ); } } @@ -3363,19 +3281,18 @@ public function buildLockedElementsCache() $this->lockedElements = array(); $this->cleanupExpiredLocks(); - $rs = $this->db->select('sid,internalKey,elementType,elementId,lasthit,username', - $this->getFullTableName('active_user_locks') . " ul + $rs = $this->db->select('sid,internalKey,elementType,elementId,lasthit,username', $this->getFullTableName('active_user_locks') . " ul LEFT JOIN {$this->getFullTableName('manager_users')} mu on ul.internalKey = mu.id"); while ($row = $this->db->getRow($rs)) { $this->lockedElements[$row['elementType']][$row['elementId']] = array( - 'sid' => $row['sid'], + 'sid' => $row['sid'], 'internalKey' => $row['internalKey'], - 'username' => $row['username'], + 'username' => $row['username'], 'elementType' => $row['elementType'], - 'elementId' => $row['elementId'], - 'lasthit' => $row['lasthit'], - 'lasthit_df' => $this->toDateFormat($row['lasthit']), - 'state' => $this->determineLockState($row['sid']) + 'elementId' => $row['elementId'], + 'lasthit' => $row['lasthit'], + 'lasthit_df' => $this->toDateFormat($row['lasthit']), + 'state' => $this->determineLockState($row['sid']) ); } } @@ -3426,8 +3343,7 @@ public function cleanupMultipleActiveUsers() } } - $rs = $this->db->select("sid,internalKey,lasthit", "{$this->getFullTableName('active_users')}", "", - "lasthit DESC"); + $rs = $this->db->select("sid,internalKey,lasthit", "{$this->getFullTableName('active_users')}", "", "lasthit DESC"); if ($this->db->getRecordCount($rs)) { $rs = $this->db->makeArray($rs); $internalKeyCount = array(); @@ -3438,8 +3354,7 @@ public function cleanupMultipleActiveUsers() } $internalKeyCount[$row['internalKey']]++; - if ($internalKeyCount[$row['internalKey']] > 1 && !in_array($row['sid'], - $activeUserSids) && $row['lasthit'] < $validSessionTimeLimit) { + if ($internalKeyCount[$row['internalKey']] > 1 && !in_array($row['sid'], $activeUserSids) && $row['lasthit'] < $validSessionTimeLimit) { $deleteSids .= $deleteSids == '' ? '' : ' OR '; $deleteSids .= "sid='{$row['sid']}'"; }; @@ -3473,7 +3388,6 @@ public function determineLockState($sid) } } } - return $state; } @@ -3494,8 +3408,7 @@ public function lockElement($type, $id) } $sql = sprintf('REPLACE INTO %s (internalKey, elementType, elementId, lasthit, sid) - VALUES (%d, %d, %d, %d, \'%s\')', $this->getFullTableName('active_user_locks'), $userId, $type, $id, - $this->time, $this->sid); + VALUES (%d, %d, %d, %d, \'%s\')', $this->getFullTableName('active_user_locks'), $userId, $type, $id, $this->time, $this->sid); $this->db->query($sql); } @@ -3517,11 +3430,9 @@ public function unlockElement($type, $id, $includeAllUsers = false) } if (!$includeAllUsers) { - $sql = sprintf('DELETE FROM %s WHERE internalKey = %d AND elementType = %d AND elementId = %d;', - $this->getFullTableName('active_user_locks'), $userId, $type, $id); + $sql = sprintf('DELETE FROM %s WHERE internalKey = %d AND elementType = %d AND elementId = %d;', $this->getFullTableName('active_user_locks'), $userId, $type, $id); } else { - $sql = sprintf('DELETE FROM %s WHERE elementType = %d AND elementId = %d;', - $this->getFullTableName('active_user_locks'), $type, $id); + $sql = sprintf('DELETE FROM %s WHERE elementType = %d AND elementId = %d;', $this->getFullTableName('active_user_locks'), $type, $id); } $this->db->query($sql); } @@ -3551,8 +3462,7 @@ public function updateValidatedUserSession() $_SESSION['ip'] = $ip; $sql = sprintf('REPLACE INTO %s (internalKey, lasthit, ip, sid) - VALUES (%d, %d, \'%s\', \'%s\')', $this->getFullTableName('active_user_sessions'), $userId, $this->time, - $ip, $this->sid); + VALUES (%d, %d, \'%s\', \'%s\')', $this->getFullTableName('active_user_sessions'), $userId, $this->time, $ip, $this->sid); $this->db->query($sql); } @@ -3592,21 +3502,21 @@ public function logEvent($evtid, $type, $msg, $source = 'Parser') } $this->db->insert(array( - 'eventid' => $evtid, - 'type' => $type, - 'createdon' => $_SERVER['REQUEST_TIME'] + $this->config['server_offset_time'], - 'source' => $esc_source, + 'eventid' => $evtid, + 'type' => $type, + 'createdon' => $_SERVER['REQUEST_TIME'] + $this->config['server_offset_time'], + 'source' => $esc_source, 'description' => $msg, - 'user' => $LoginUserID, - 'usertype' => $usertype + 'user' => $LoginUserID, + 'usertype' => $usertype ), $this->getFullTableName("event_log")); if (isset($this->config['send_errormail']) && $this->config['send_errormail'] !== '0') { if ($this->config['send_errormail'] <= $type) { $this->sendmail(array( 'subject' => 'MODX System Error on ' . $this->config['site_name'], - 'body' => 'Source: ' . $source . ' - The details of the error could be seen in the MODX system events log.', - 'type' => 'text' + 'body' => 'Source: ' . $source . ' - The details of the error could be seen in the MODX system events log.', + 'type' => 'text' )); } } @@ -3698,7 +3608,6 @@ public function sendmail($params = array(), $msg = '', $files = array()) } } $rs = $this->mail->send(); - return $rs; } @@ -3740,7 +3649,7 @@ public function isBackend() */ public function isFrontend() { - return !$this->isBackend(); + return ! $this->isBackend(); } /** @@ -3754,12 +3663,8 @@ public function isFrontend() * @param string $fields Default: id, pagetitle, description, parent, alias, menutitle * @return array */ - public function getAllChildren( - $id = 0, - $sort = 'menuindex', - $dir = 'ASC', - $fields = 'id, pagetitle, description, parent, alias, menutitle' - ) { + public function getAllChildren($id = 0, $sort = 'menuindex', $dir = 'ASC', $fields = 'id, pagetitle, description, parent, alias, menutitle') + { $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { @@ -3778,11 +3683,9 @@ public function getAllChildren( // build query $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc - LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$id}' AND ({$access}) GROUP BY sc.id", - "{$sort} {$dir}"); + LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$id}' AND ({$access}) GROUP BY sc.id", "{$sort} {$dir}"); $resourceArray = $this->db->makeArray($result); $this->tmpCache[__FUNCTION__][$cacheKey] = $resourceArray; - return $resourceArray; } @@ -3797,12 +3700,8 @@ public function getAllChildren( * @param string $fields Default: id, pagetitle, description, parent, alias, menutitle * @return array */ - public function getActiveChildren( - $id = 0, - $sort = 'menuindex', - $dir = 'ASC', - $fields = 'id, pagetitle, description, parent, alias, menutitle' - ) { + public function getActiveChildren($id = 0, $sort = 'menuindex', $dir = 'ASC', $fields = 'id, pagetitle, description, parent, alias, menutitle') + { $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { return $this->tmpCache[__FUNCTION__][$cacheKey]; @@ -3821,8 +3720,7 @@ public function getActiveChildren( // build query $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc - LEFT JOIN {$tbldg} dg on dg.document = sc.id", - "sc.parent = '{$id}' AND sc.published=1 AND sc.deleted=0 AND ({$access}) GROUP BY sc.id", "{$sort} {$dir}"); + LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$id}' AND sc.published=1 AND sc.deleted=0 AND ({$access}) GROUP BY sc.id", "{$sort} {$dir}"); $resourceArray = $this->db->makeArray($result); $this->tmpCache[__FUNCTION__][$cacheKey] = $resourceArray; @@ -3847,16 +3745,8 @@ public function getActiveChildren( * * @return {array; false} - Result array, or false. */ - public function getDocumentChildren( - $parentid = 0, - $published = 1, - $deleted = 0, - $fields = '*', - $where = '', - $sort = 'menuindex', - $dir = 'ASC', - $limit = '' - ) { + public function getDocumentChildren($parentid = 0, $published = 1, $deleted = 0, $fields = '*', $where = '', $sort = 'menuindex', $dir = 'ASC', $limit = '') + { $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { @@ -3886,9 +3776,7 @@ public function getDocumentChildren( $tbldg = $this->getFullTableName('document_groups'); $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc - LEFT JOIN {$tbldg} dg on dg.document = sc.id", - "sc.parent = '{$parentid}' {$published} {$deleted} {$where} AND ({$access}) GROUP BY sc.id", - ($sort ? "{$sort} {$dir}" : ""), $limit); + LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$parentid}' {$published} {$deleted} {$where} AND ({$access}) GROUP BY sc.id", ($sort ? "{$sort} {$dir}" : ""), $limit); $resourceArray = $this->db->makeArray($result); @@ -3914,16 +3802,8 @@ public function getDocumentChildren( * * @return {array; false} - Result array with documents, or false. */ - public function getDocuments( - $ids = array(), - $published = 1, - $deleted = 0, - $fields = '*', - $where = '', - $sort = 'menuindex', - $dir = 'ASC', - $limit = '' - ) { + public function getDocuments($ids = array(), $published = 1, $deleted = 0, $fields = '*', $where = '', $sort = 'menuindex', $dir = 'ASC', $limit = '') + { $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { @@ -3939,7 +3819,6 @@ public function getDocuments( } if (count($ids) == 0) { $this->tmpCache[__FUNCTION__][$cacheKey] = false; - return false; } else { // modify field names to use sc. table reference @@ -3963,9 +3842,7 @@ public function getDocuments( $tbldg = $this->getFullTableName('document_groups'); $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc - LEFT JOIN {$tbldg} dg on dg.document = sc.id", "(sc.id IN (" . implode(',', - $ids) . ") {$published} {$deleted} {$where}) AND ({$access}) GROUP BY sc.id", - ($sort ? "{$sort} {$dir}" : ""), $limit); + LEFT JOIN {$tbldg} dg on dg.document = sc.id", "(sc.id IN (" . implode(',', $ids) . ") {$published} {$deleted} {$where}) AND ({$access}) GROUP BY sc.id", ($sort ? "{$sort} {$dir}" : ""), $limit); $resourceArray = $this->db->makeArray($result); @@ -4076,8 +3953,7 @@ public function getPageInfo($pageid = -1, $active = 1, $fields = 'id, pagetitle, $docgrp = implode(",", $docgrp); } $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); - $result = $this->db->select($fields, "{$tblsc} sc LEFT JOIN {$tbldg} dg on dg.document = sc.id", - "(sc.id='{$pageid}' {$activeSql}) AND ({$access})", "", 1); + $result = $this->db->select($fields, "{$tblsc} sc LEFT JOIN {$tbldg} dg on dg.document = sc.id", "(sc.id='{$pageid}' {$activeSql}) AND ({$access})", "", 1); $pageInfo = $this->db->getRow($result); $this->tmpCache[__FUNCTION__][$cacheKey] = $pageInfo; @@ -4102,19 +3978,15 @@ public function getParent($pid = -1, $active = 1, $fields = 'id, pagetitle, desc { if ($pid == -1) { $pid = $this->documentObject['parent']; - return ($pid == 0) ? false : $this->getPageInfo($pid, $active, $fields); + } else if ($pid == 0) { + return false; } else { - if ($pid == 0) { - return false; - } else { - // first get the child document - $child = $this->getPageInfo($pid, $active, "parent"); - // now return the child's parent - $pid = ($child['parent']) ? $child['parent'] : 0; - - return ($pid == 0) ? false : $this->getPageInfo($pid, $active, $fields); - } + // first get the child document + $child = $this->getPageInfo($pid, $active, "parent"); + // now return the child's parent + $pid = ($child['parent']) ? $child['parent'] : 0; + return ($pid == 0) ? false : $this->getPageInfo($pid, $active, $fields); } } @@ -4132,7 +4004,6 @@ public function getSnippetId() return $snippetId; } } - return 0; } @@ -4290,7 +4161,7 @@ public function makeUrl($id, $alias = '', $args = '', $scheme = '') } $evtOut = $this->invokeEvent('OnMakeDocUrl', array( - 'id' => $id, + 'id' => $id, 'url' => $url )); @@ -4314,9 +4185,9 @@ public function getAliasListing($id) if ($this->db->getRecordCount($q) == '1') { $q = $this->db->getRow($q); $this->aliasListing[$id] = array( - 'id' => (int)$q['id'], - 'alias' => $q['alias'] == '' ? $q['id'] : $q['alias'], - 'parent' => (int)$q['parent'], + 'id' => (int)$q['id'], + 'alias' => $q['alias'] == '' ? $q['id'] : $q['alias'], + 'parent' => (int)$q['parent'], 'isfolder' => (int)$q['isfolder'], ); if ($this->aliasListing[$id]['parent'] > 0) { @@ -4333,7 +4204,6 @@ public function getAliasListing($id) $out = $this->aliasListing[$id]; } } - return $out; } @@ -4374,7 +4244,6 @@ public function getVersionData($data = null) $this->version['full_appname'] = isset($modx_full_appname) ? $modx_full_appname : ''; $this->version['new_version'] = isset($this->config['newversiontext']) ? $this->config['newversiontext'] : ''; } - return (!is_null($data) && is_array($this->version) && isset($this->version[$data])) ? $this->version[$data] : $this->version; } @@ -4396,8 +4265,7 @@ public function runSnippet($snippetName, $params = array()) if ($this->db->getRecordCount($result) == 1) { $row = $this->db->getRow($result); $snippet = $this->snippetCache[$snippetName] = $row['snippet']; - $mergedProperties = array_merge($this->parseProperties($row['properties']), - $this->parseProperties($row['sharedproperties'])); + $mergedProperties = array_merge($this->parseProperties($row['properties']), $this->parseProperties($row['sharedproperties'])); $properties = $this->snippetCache[$snippetName . "Props"] = json_encode($mergedProperties); } else { $snippet = $this->snippetCache[$snippetName] = "return false;"; @@ -4426,21 +4294,18 @@ public function getChunk($chunkName) } if (isset ($this->chunkCache[$chunkName])) { $out = $this->chunkCache[$chunkName]; + } else if (stripos($chunkName, '@FILE') === 0) { + $out = $this->chunkCache[$chunkName] = $this->atBindFileContent($chunkName); } else { - if (stripos($chunkName, '@FILE') === 0) { - $out = $this->chunkCache[$chunkName] = $this->atBindFileContent($chunkName); + $where = sprintf("`name`='%s' AND disabled=0", $this->db->escape($chunkName)); + $rs = $this->db->select('snippet', '[+prefix+]site_htmlsnippets', $where); + if ($this->db->getRecordCount($rs) == 1) { + $row = $this->db->getRow($rs); + $out = $this->chunkCache[$chunkName] = $row['snippet']; } else { - $where = sprintf("`name`='%s' AND disabled=0", $this->db->escape($chunkName)); - $rs = $this->db->select('snippet', '[+prefix+]site_htmlsnippets', $where); - if ($this->db->getRecordCount($rs) == 1) { - $row = $this->db->getRow($rs); - $out = $this->chunkCache[$chunkName] = $row['snippet']; - } else { - $out = $this->chunkCache[$chunkName] = null; - } + $out = $this->chunkCache[$chunkName] = null; } } - return $out; } @@ -4504,7 +4369,7 @@ public function parseText($tpl = '', $ph = array(), $left = '[+', $right = '+]', } if (strpos($tpl, $s) !== false) { $tpl = str_replace($s, $value, $tpl); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('parseText parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -4546,7 +4411,7 @@ public function parseChunk($chunkName, $chunkArr, $prefix = '{', $suffix = '}') public function getTpl($tpl) { $template = $tpl; - if (preg_match("~^@([^:\s]+)[:\s]+(.+)$~", $tpl, $match)) { + if (preg_match("/^@([^:\s]+)[:\s]+(.+)$/s", trim($tpl), $match)) { $command = strtoupper($match[1]); $template = $match[2]; } @@ -4571,7 +4436,6 @@ public function getTpl($tpl) $template = $tpl; } } - return $template; } @@ -4614,7 +4478,6 @@ public function toDateFormat($timestamp = 0, $mode = '') } elseif ($mode == 'formatOnly') { $strTime = $dateFormat; } - return $strTime; } @@ -4664,7 +4527,6 @@ public function toTimeStamp($str) } $timeStamp = mktime($H, $M, $S, $m, $d, $Y); $timeStamp = (int)$timeStamp; - return $timeStamp; } @@ -4692,16 +4554,8 @@ public function toTimeStamp($str) * Default: ASC * @return array|bool */ - public function getDocumentChildrenTVars( - $parentid = 0, - $tvidnames = array(), - $published = 1, - $docsort = "menuindex", - $docsortdir = "ASC", - $tvfields = "*", - $tvsort = "rank", - $tvsortdir = "ASC" - ) { + public function getDocumentChildrenTVars($parentid = 0, $tvidnames = array(), $published = 1, $docsort = "menuindex", $docsortdir = "ASC", $tvfields = "*", $tvsort = "rank", $tvsortdir = "ASC") + { $docs = $this->getDocumentChildren($parentid, $published, 0, '*', '', $docsort, $docsortdir); if (!$docs) { return false; @@ -4728,8 +4582,7 @@ public function getDocumentChildrenTVars( if ($tvidnames == "*") { $query = "tv.id<>0"; } else { - $query = (is_numeric($tvidnames[0]) ? "tv.id" : "tv.name") . " IN ('" . implode("','", - $tvidnames) . "')"; + $query = (is_numeric($tvidnames[0]) ? "tv.id" : "tv.name") . " IN ('" . implode("','", $tvidnames) . "')"; } $this->getUserDocGroups(); @@ -4740,8 +4593,7 @@ public function getDocumentChildrenTVars( $rs = $this->db->select("{$fields}, IF(tvc.value!='',tvc.value,tv.default_text) as value ", "[+prefix+]site_tmplvars tv INNER JOIN [+prefix+]site_tmplvar_templates tvtpl ON tvtpl.tmplvarid = tv.id - LEFT JOIN [+prefix+]site_tmplvar_contentvalues tvc ON tvc.tmplvarid=tv.id AND tvc.contentid='{$docid}'", - "{$query} AND tvtpl.templateid = '{$doc['template']}'", ($tvsort ? "{$tvsort} {$tvsortdir}" : "")); + LEFT JOIN [+prefix+]site_tmplvar_contentvalues tvc ON tvc.tmplvarid=tv.id AND tvc.contentid='{$docid}'", "{$query} AND tvtpl.templateid = '{$doc['template']}'", ($tvsort ? "{$tvsort} {$tvsortdir}" : "")); $tvs = $this->db->makeArray($rs); // get default/built-in template variables @@ -4755,7 +4607,6 @@ public function getDocumentChildrenTVars( $result[] = $tvs; } } - return $result; } } @@ -4783,15 +4634,8 @@ public function getDocumentChildrenTVars( * @return array {array; false} - Result array, or false. * - Result array, or false. */ - public function getDocumentChildrenTVarOutput( - $parentid = 0, - $tvidnames = array(), - $published = 1, - $sortBy = 'menuindex', - $sortDir = 'ASC', - $where = '', - $resultKey = 'id' - ) { + public function getDocumentChildrenTVarOutput($parentid = 0, $tvidnames = array(), $published = 1, $sortBy = 'menuindex', $sortDir = 'ASC', $where = '', $resultKey = 'id') + { $docs = $this->getDocumentChildren($parentid, $published, 0, 'id', $where, $sortBy, $sortDir); if (!$docs) { @@ -4807,11 +4651,9 @@ public function getDocumentChildrenTVarOutput( $tvidnames[] = $resultKey; $unsetResultKey = true; } - } else { - if ($tvidnames != '*' && $tvidnames != $resultKey) { - $tvidnames = array($tvidnames, $resultKey); - $unsetResultKey = true; - } + } else if ($tvidnames != '*' && $tvidnames != $resultKey) { + $tvidnames = array($tvidnames, $resultKey); + $unsetResultKey = true; } } @@ -4855,9 +4697,7 @@ public function getTemplateVar($idname = "", $fields = "*", $docid = "", $publis if ($idname == "") { return false; } else { - $result = $this->getTemplateVars(array($idname), $fields, $docid, $published, "", - ""); //remove sorting for speed - + $result = $this->getTemplateVars(array($idname), $fields, $docid, $published, "", ""); //remove sorting for speed return ($result != false) ? $result[0] : false; } } @@ -4879,20 +4719,14 @@ public function getTemplateVar($idname = "", $fields = "*", $docid = "", $publis * * @return {array; false} - Result array, or false. */ - public function getTemplateVars( - $idnames = array(), - $fields = '*', - $docid = '', - $published = 1, - $sort = 'rank', - $dir = 'ASC' - ) { + public function getTemplateVars($idnames = array(), $fields = '*', $docid = '', $published = 1, $sort = 'rank', $dir = 'ASC') + { $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { return $this->tmpCache[__FUNCTION__][$cacheKey]; } - if (($idnames != '*' && !is_array($idnames)) || empty($idnames)) { + if (($idnames != '*' && !is_array($idnames)) || empty($idnames) ) { return false; } else { @@ -4905,14 +4739,12 @@ public function getTemplateVars( if (!$docRow) { $this->tmpCache[__FUNCTION__][$cacheKey] = false; - return false; } } // get user defined template variables - $fields = ($fields == '') ? 'tv.*' : 'tv.' . implode(',tv.', - array_filter(array_map('trim', explode(',', $fields)))); + $fields = ($fields == '') ? 'tv.*' : 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $fields)))); $sort = ($sort == '') ? '' : 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $sort)))); if ($idnames == '*') { @@ -4921,22 +4753,20 @@ public function getTemplateVars( $query = (is_numeric($idnames[0]) ? 'tv.id' : 'tv.name') . " IN ('" . implode("','", $idnames) . "')"; } - $rs = $this->db->select("{$fields}, IF(tvc.value != '', tvc.value, tv.default_text) as value", - $this->getFullTableName('site_tmplvars') . " tv + $rs = $this->db->select("{$fields}, IF(tvc.value != '', tvc.value, tv.default_text) as value", $this->getFullTableName('site_tmplvars') . " tv INNER JOIN " . $this->getFullTableName('site_tmplvar_templates') . " tvtpl ON tvtpl.tmplvarid = tv.id - LEFT JOIN " . $this->getFullTableName('site_tmplvar_contentvalues') . " tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$docid}'", - "{$query} AND tvtpl.templateid = '{$docRow['template']}'", ($sort ? "{$sort} {$dir}" : "")); + LEFT JOIN " . $this->getFullTableName('site_tmplvar_contentvalues') . " tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$docid}'", "{$query} AND tvtpl.templateid = '{$docRow['template']}'", ($sort ? "{$sort} {$dir}" : "")); $result = $this->db->makeArray($rs); // get default/built-in template variables - if (is_array($docRow)) { + if(is_array($docRow)){ ksort($docRow); foreach ($docRow as $key => $value) { if ($idnames == '*' || in_array($key, $idnames)) { array_push($result, array( - 'name' => $key, + 'name' => $key, 'value' => $value )); } @@ -4968,7 +4798,7 @@ public function getTemplateVars( */ public function getTemplateVarOutput($idnames = array(), $docid = '', $published = 1, $sep = '') { - if (is_array($idnames) && empty($idnames)) { + if (is_array($idnames) && empty($idnames) ) { return false; } else { $output = array(); @@ -4991,8 +4821,7 @@ public function getTemplateVarOutput($idnames = array(), $docid = '', $published if (!isset($row['id']) or !$row['id']) { $output[$row['name']] = $row['value']; } else { - $output[$row['name']] = getTVDisplayFormat($row['name'], $row['value'], $row['display'], - $row['display_params'], $row['type'], $docid, $sep); + $output[$row['name']] = getTVDisplayFormat($row['name'], $row['value'], $row['display'], $row['display_params'], $row['type'], $docid, $sep); } } @@ -5089,7 +4918,6 @@ public function getCachePath() { global $base_url; $pth = $base_url . $this->getCacheFolder(); - return $pth; } @@ -5119,13 +4947,13 @@ public function sendAlert($type, $to, $from, $subject, $msg, $private = 0) } // insert a new message into user_messages $this->db->insert(array( - 'type' => $type, - 'subject' => $subject, - 'message' => $msg, - 'sender' => $from, - 'recipient' => $to, - 'private' => $private, - 'postdate' => $_SERVER['REQUEST_TIME'] + $this->config['server_offset_time'], + 'type' => $type, + 'subject' => $subject, + 'message' => $msg, + 'sender' => $from, + 'recipient' => $to, + 'private' => $private, + 'postdate' => $_SERVER['REQUEST_TIME'] + $this->config['server_offset_time'], 'messageread' => 0, ), $this->getFullTableName('user_messages')); } @@ -5156,7 +4984,6 @@ public function getLoginUserID($context = '') } } } - return $out; } @@ -5186,7 +5013,6 @@ public function getLoginUserName($context = '') } } } - return $out; } @@ -5245,13 +5071,11 @@ public function getUserInfo($uid) public function getWebUserInfo($uid) { $rs = $this->db->select('wu.username, wu.password, wua.*', $this->getFullTableName("web_users") . " wu - INNER JOIN " . $this->getFullTableName("web_user_attributes") . " wua ON wua.internalkey=wu.id", - "wu.id='{$uid}'"); + INNER JOIN " . $this->getFullTableName("web_user_attributes") . " wua ON wua.internalkey=wu.id", "wu.id='{$uid}'"); if ($row = $this->db->getRow($rs)) { if (!isset($row['usertype']) or !$row["usertype"]) { $row["usertype"] = "web"; } - return $row; } } @@ -5270,38 +5094,30 @@ public function getUserDocGroups($resolveIds = false) if ($this->isFrontend() && isset($_SESSION['webDocgroups']) && isset($_SESSION['webValidated'])) { $dg = $_SESSION['webDocgroups']; $dgn = isset($_SESSION['webDocgrpNames']) ? $_SESSION['webDocgrpNames'] : false; + } else if ($this->isBackend() && isset($_SESSION['mgrDocgroups']) && isset($_SESSION['mgrValidated'])) { + $dg = $_SESSION['mgrDocgroups']; + $dgn = isset($_SESSION['mgrDocgrpNames']) ? $_SESSION['mgrDocgrpNames'] : false; } else { - if ($this->isBackend() && isset($_SESSION['mgrDocgroups']) && isset($_SESSION['mgrValidated'])) { - $dg = $_SESSION['mgrDocgroups']; - $dgn = isset($_SESSION['mgrDocgrpNames']) ? $_SESSION['mgrDocgrpNames'] : false; - } else { - $dg = ''; - } + $dg = ''; } if (!$resolveIds) { return $dg; - } else { - if (is_array($dgn)) { - return $dgn; + } else if (is_array($dgn)) { + return $dgn; + } else if (is_array($dg)) { + // resolve ids to names + $dgn = array(); + $ds = $this->db->select('name', $this->getFullTableName("documentgroup_names"), "id IN (" . implode(",", $dg) . ")"); + while ($row = $this->db->getRow($ds)) { + $dgn[] = $row['name']; + } + // cache docgroup names to session + if ($this->isFrontend()) { + $_SESSION['webDocgrpNames'] = $dgn; } else { - if (is_array($dg)) { - // resolve ids to names - $dgn = array(); - $ds = $this->db->select('name', $this->getFullTableName("documentgroup_names"), - "id IN (" . implode(",", $dg) . ")"); - while ($row = $this->db->getRow($ds)) { - $dgn[] = $row['name']; - } - // cache docgroup names to session - if ($this->isFrontend()) { - $_SESSION['webDocgrpNames'] = $dgn; - } else { - $_SESSION['mgrDocgrpNames'] = $dgn; - } - - return $dgn; - } + $_SESSION['mgrDocgrpNames'] = $dgn; } + return $dgn; } } @@ -5332,11 +5148,10 @@ public function changeWebUserPassword($oldPwd, $newPwd) ), $tbl, "id='" . $this->getLoginUserID() . "'"); // invoke OnWebChangePassword event $this->invokeEvent("OnWebChangePassword", array( - "userid" => $row["id"], - "username" => $row["username"], + "userid" => $row["id"], + "username" => $row["username"], "userpassword" => $newPwd )); - return true; } } else { @@ -5344,7 +5159,6 @@ public function changeWebUserPassword($oldPwd, $newPwd) } } } - return $rt; } @@ -5373,7 +5187,6 @@ public function isMemberOfWebGroup($groupNames = array()) return true; } } - return false; } @@ -5420,11 +5233,8 @@ public function regClientStartupScript($src, $options = array('name' => '', 'ver * @param boolean $startup Default: false * @return string */ - public function regClientScript( - $src, - $options = array('name' => '', 'version' => '0', 'plaintext' => false), - $startup = false - ) { + public function regClientScript($src, $options = array('name' => '', 'version' => '0', 'plaintext' => false), $startup = false) + { if (empty($src)) { return ''; } // nothing to register @@ -5491,7 +5301,6 @@ public function regClientScript( $this->loadedjscripts[$key]['version'] = $version; $this->loadedjscripts[$key]['startup'] = $startup; $this->loadedjscripts[$key]['pos'] = $pos; - return ''; } @@ -5531,7 +5340,6 @@ public function stripTags($html, $allowed = "") $t = preg_replace('~\[\((.*?)\)\]~', "", $t); //settings $t = preg_replace('~\[\+(.*?)\+\]~', "", $t); //placeholders $t = preg_replace('~{{(.*?)}}~', "", $t); //chunks - return $t; } @@ -5550,7 +5358,6 @@ public function addEventListener($evtName, $pluginName) if (!array_key_exists($evtName, $this->pluginEvent)) { $this->pluginEvent[$evtName] = array(); } - return array_push($this->pluginEvent[$evtName], $pluginName); // return array count } @@ -5627,8 +5434,7 @@ public function invokeEvent($evtName, $extParams = array()) if ($this->dumpPlugins) { $eventtime = $this->getMicroTime() - $eventtime; - $this->pluginsCode .= sprintf('
      %s / %s (%2.2f ms)', $evtName, - $pluginName, $eventtime * 1000); + $this->pluginsCode .= sprintf('
      %s / %s (%2.2f ms)', $evtName, $pluginName, $eventtime * 1000); foreach ($parameter as $k => $v) { $this->pluginsCode .= "{$k} => " . print_r($v, true) . '
      '; } @@ -5644,7 +5450,6 @@ public function invokeEvent($evtName, $extParams = array()) } $e->activePlugin = ''; - return $results; } @@ -5662,8 +5467,7 @@ public function getPluginCode($pluginName) $pluginProperties = isset($this->pluginCache[$pluginName . "Props"]) ? $this->pluginCache[$pluginName . "Props"] : ''; } else { $pluginName = $this->db->escape($pluginName); - $result = $this->db->select('name, plugincode, properties', $this->getFullTableName("site_plugins"), - "name='{$pluginName}' AND disabled=0"); + $result = $this->db->select('name, plugincode, properties', $this->getFullTableName("site_plugins"), "name='{$pluginName}' AND disabled=0"); if ($row = $this->db->getRow($result)) { $pluginCode = $this->pluginCache[$row['name']] = $row['plugincode']; $pluginProperties = $this->pluginCache[$row['name'] . "Props"] = $row['properties']; @@ -5730,20 +5534,18 @@ public function parseProperties($propertyString, $elementName = null, $elementTy } } // new json-format - } else { - if (!empty($jsonFormat)) { - foreach ($jsonFormat as $key => $row) { - if (!empty($key)) { - if (is_array($row)) { - if (isset($row[0]['value'])) { - $value = $row[0]['value']; - } - } else { - $value = $row; - } - if (isset($value) && $value !== '') { - $property[$key] = $value; + } else if (!empty($jsonFormat)) { + foreach ($jsonFormat as $key => $row) { + if (!empty($key)) { + if (is_array($row)) { + if (isset($row[0]['value'])) { + $value = $row[0]['value']; } + } else { + $value = $row; + } + if (isset($value) && $value !== '') { + $property[$key] = $value; } } } @@ -5751,8 +5553,8 @@ public function parseProperties($propertyString, $elementName = null, $elementTy if (!empty($elementName) && !empty($elementType)) { $out = $this->invokeEvent('OnParseProperties', array( 'element' => $elementName, - 'type' => $elementType, - 'args' => $property + 'type' => $elementType, + 'args' => $property )); if (is_array($out)) { $out = array_pop($out); @@ -5761,7 +5563,6 @@ public function parseProperties($propertyString, $elementName = null, $elementTy $property = $out; } } - return $property; } @@ -5789,8 +5590,7 @@ public function parseDocBlockFromFile($element_dir, $filename, $escapeValues = f while (!feof($tpl)) { $line = fgets($tpl); - $r = $this->parseDocBlockLine($line, $docblock_start_found, $name_found, $description_found, - $docblock_end_found); + $r = $this->parseDocBlockLine($line, $docblock_start_found, $name_found, $description_found, $docblock_end_found); $docblock_start_found = $r['docblock_start_found']; $name_found = $r['name_found']; $description_found = $r['description_found']; @@ -5817,7 +5617,6 @@ public function parseDocBlockFromFile($element_dir, $filename, $escapeValues = f @fclose($tpl); } } - return $params; } @@ -5841,8 +5640,7 @@ public function parseDocBlockFromString($string, $escapeValues = false) $arrayParams = array('author', 'documentation', 'reportissues', 'link'); foreach ($exp as $line) { - $r = $this->parseDocBlockLine($line, $docblock_start_found, $name_found, $description_found, - $docblock_end_found); + $r = $this->parseDocBlockLine($line, $docblock_start_found, $name_found, $description_found, $docblock_end_found); $docblock_start_found = $r['docblock_start_found']; $name_found = $r['name_found']; $description_found = $r['description_found']; @@ -5867,7 +5665,6 @@ public function parseDocBlockFromString($string, $escapeValues = false) } } } - return $params; } @@ -5882,13 +5679,8 @@ public function parseDocBlockFromString($string, $escapeValues = false) * @param boolean $docblock_end_found * @return array Associative array in the form property name => property value */ - public function parseDocBlockLine( - $line, - $docblock_start_found, - $name_found, - $description_found, - $docblock_end_found - ) { + public function parseDocBlockLine($line, $docblock_start_found, $name_found, $description_found, $docblock_end_found) + { $param = ''; $val = ''; $ma = null; @@ -5928,14 +5720,13 @@ public function parseDocBlockLine( $docblock_end_found = true; } } - return array( 'docblock_start_found' => $docblock_start_found, - 'name_found' => $name_found, - 'description_found' => $description_found, - 'docblock_end_found' => $docblock_end_found, - 'param' => $param, - 'val' => $val + 'name_found' => $name_found, + 'description_found' => $description_found, + 'docblock_end_found' => $docblock_end_found, + 'param' => $param, + 'val' => $val ); } @@ -5960,8 +5751,7 @@ public function convertDocBlockIntoList($parsed) foreach ($val as $key2 => $val2) { $val2 = $this->parseText($val2, $ph); if (preg_match($regexUrl, $val2, $url)) { - $val2 = preg_replace($regexUrl, "{$url[0]} ", - $val2); + $val2 = preg_replace($regexUrl, "{$url[0]} ", $val2); } if (preg_match($regexEmail, $val2, $url)) { $val2 = preg_replace($regexEmail, '\\1', $val2); @@ -5982,14 +5772,13 @@ public function convertDocBlockIntoList($parsed) $arrayParams = array( 'documentation' => $_lang['documentation'], - 'reportissues' => $_lang['report_issues'], - 'link' => $_lang['further_info'], - 'author' => $_lang['author_infos'] + 'reportissues' => $_lang['report_issues'], + 'link' => $_lang['further_info'], + 'author' => $_lang['author_infos'] ); $nl = "\n"; - $list = isset($parsed['logo']) ? '' . $nl : ''; + $list = isset($parsed['logo']) ? '' . $nl : ''; $list .= '

      ' . $nl; $list .= isset($parsed['name']) ? '' . $parsed['name'] . '
      ' . $nl : ''; $list .= isset($parsed['description']) ? $parsed['description'] . $nl : ''; @@ -6069,7 +5858,6 @@ public function cleanUpMODXTags($content = '') } } $this->config['enable_filter'] = $enable_filter; - return $content; } @@ -6082,7 +5870,6 @@ public function strip_tags($str = '', $allowable_tags = '') { $str = strip_tags($str, $allowable_tags); modx_sanitize_gpc($str); - return $str; } @@ -6140,7 +5927,6 @@ public function safeEval($phpcode = '', $evalmode = '', $safe_functions = '') $msg = $phpcode . "\n" . $this->currentSnippet . "\n" . print_r($_SERVER, true); $title = sprintf('Unknown eval was executed (%s)', $this->htmlspecialchars(substr(trim($phpcode), 0, 50))); $this->messageQuit($title, '', true, '', '', 'Parser', $msg); - return; } @@ -6154,7 +5940,6 @@ public function safeEval($phpcode = '', $evalmode = '', $safe_functions = '') $output = $echo . $return; modx_sanitize_gpc($output); - return $this->htmlspecialchars($output); // Maybe, all html tags are dangerous } @@ -6198,7 +5983,6 @@ public function isSafeCode($phpcode = '', $safe_functions = '') return false; } } - return true; } @@ -6209,13 +5993,7 @@ public function isSafeCode($phpcode = '', $safe_functions = '') public function atBindFileContent($str = '') { - $search_path = array( - 'assets/tvs/', - 'assets/chunks/', - 'assets/templates/', - $this->config['rb_base_url'] . 'files/', - '' - ); + $search_path = array('assets/tvs/', 'assets/chunks/', 'assets/templates/', $this->config['rb_base_url'] . 'files/', ''); if (stripos($str, '@FILE') !== 0) { return $str; @@ -6344,17 +6122,8 @@ public function phpError($nr, $text, $file, $line) * @param string $output * @return bool */ - public function messageQuit( - $msg = 'unspecified error', - $query = '', - $is_error = true, - $nr = '', - $file = '', - $source = '', - $text = '', - $line = '', - $output = '' - ) { + public function messageQuit($msg = 'unspecified error', $query = '', $is_error = true, $nr = '', $file = '', $source = '', $text = '', $line = '', $output = '') + { if (0 < $this->messageQuitCount) { return; @@ -6393,21 +6162,21 @@ public function messageQuit( } $errortype = array( - E_ERROR => "ERROR", - E_WARNING => "WARNING", - E_PARSE => "PARSING ERROR", - E_NOTICE => "NOTICE", - E_CORE_ERROR => "CORE ERROR", - E_CORE_WARNING => "CORE WARNING", - E_COMPILE_ERROR => "COMPILE ERROR", - E_COMPILE_WARNING => "COMPILE WARNING", - E_USER_ERROR => "USER ERROR", - E_USER_WARNING => "USER WARNING", - E_USER_NOTICE => "USER NOTICE", - E_STRICT => "STRICT NOTICE", + E_ERROR => "ERROR", + E_WARNING => "WARNING", + E_PARSE => "PARSING ERROR", + E_NOTICE => "NOTICE", + E_CORE_ERROR => "CORE ERROR", + E_CORE_WARNING => "CORE WARNING", + E_COMPILE_ERROR => "COMPILE ERROR", + E_COMPILE_WARNING => "COMPILE WARNING", + E_USER_ERROR => "USER ERROR", + E_USER_WARNING => "USER WARNING", + E_USER_NOTICE => "USER NOTICE", + E_STRICT => "STRICT NOTICE", E_RECOVERABLE_ERROR => "RECOVERABLE ERROR", - E_DEPRECATED => "DEPRECATED", - E_USER_DEPRECATED => "USER DEPRECATED" + E_DEPRECATED => "DEPRECATED", + E_USER_DEPRECATED => "USER DEPRECATED" ); if (!empty($nr) || !empty($file)) { @@ -6458,18 +6227,12 @@ public function messageQuit( if (preg_match('@^[0-9]+@', $this->documentIdentifier)) { $resource = $this->getDocumentObject('id', $this->documentIdentifier); $url = $this->makeUrl($this->documentIdentifier, '', '', 'full'); - $table[] = array( - 'Resource', - '[' . $this->documentIdentifier . '] ' . $resource['pagetitle'] . '' - ); + $table[] = array('Resource', '[' . $this->documentIdentifier . '] ' . $resource['pagetitle'] . ''); } $table[] = array('Referer', $referer); $table[] = array('User Agent', $ua); $table[] = array('IP', $_SERVER['REMOTE_ADDR']); - $table[] = array( - 'Current time', - date("Y-m-d H:i:s", $_SERVER['REQUEST_TIME'] + $this->config['server_offset_time']) - ); + $table[] = array('Current time', date("Y-m-d H:i:s", $_SERVER['REQUEST_TIME'] + $this->config['server_offset_time'])); $str .= $MakeTable->create($table, array('Basic info', '')); $str .= "
      "; @@ -6614,8 +6377,7 @@ public function get_backtrace($backtrace) break; } case is_scalar($arg): { - $out = strlen($arg) > 20 ? 'string $var' . $tmp : ("'" . $this->htmlspecialchars(str_replace("'", - "\\'", $arg)) . "'"); + $out = strlen($arg) > 20 ? 'string $var' . $tmp : ("'" . $this->htmlspecialchars(str_replace("'", "\\'", $arg)) . "'"); break; } case is_bool($arg): { @@ -6635,7 +6397,6 @@ public function get_backtrace($backtrace) } } $tmp++; - return $out; }, $args); $line = array( @@ -6644,7 +6405,6 @@ public function get_backtrace($backtrace) ); $table[] = array(implode("
      ", $line)); } - return $MakeTable->create($table, array('Backtrace')); } @@ -6684,7 +6444,6 @@ public function stripAlias($alias) $alias = preg_replace('/\s+/', '-', $alias); // convert white-space to dash $alias = preg_replace('/-+/', '-', $alias); // convert multiple dashes to one $alias = trim($alias, '-'); // trim excess - return $alias; } } @@ -6703,7 +6462,6 @@ public function nicesize($size) } $precisions--; } - return '0 b'; } @@ -6779,7 +6537,6 @@ public function getIdFromAlias($alias) $id = false; } } - return $id; } @@ -6827,7 +6584,6 @@ public function atBindInclude($str = '') if (!$content && $result) { $content = $result; } - return $content; } @@ -6842,7 +6598,6 @@ public function atBindInclude($str = '') public function htmlspecialchars($str, $flags = ENT_COMPAT, $encode = '') { $this->loadExtension('PHPCOMPAT'); - return $this->phpcompat->htmlspecialchars($str, $flags, $encode); } @@ -6854,7 +6609,6 @@ public function htmlspecialchars($str, $flags = ENT_COMPAT, $encode = '') public function isJson($string, $returnData = false) { $data = json_decode($string, true); - return (json_last_error() == JSON_ERROR_NONE) ? ($returnData ? $data : true) : false; } @@ -6894,7 +6648,6 @@ public function applyFilter($value = '', $modifiers = false, $key = '') } $this->loadExtension('MODIFIERS'); - return $this->filter->phxFilter($key, $value, $modifiers); } @@ -7015,4 +6768,4 @@ public function _resetEventObject() $this->_propagate = true; $this->activated = false; } -} +} \ No newline at end of file From 67117ab6b8f430b8836e764907c12c5907af356d Mon Sep 17 00:00:00 2001 From: Pathologic Date: Mon, 21 May 2018 17:36:48 +0300 Subject: [PATCH 223/274] fix error log in phpmailer --- manager/includes/extenders/modxmailer.class.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/manager/includes/extenders/modxmailer.class.inc.php b/manager/includes/extenders/modxmailer.class.inc.php index c5baef0e01..ba6b8b06ec 100755 --- a/manager/includes/extenders/modxmailer.class.inc.php +++ b/manager/includes/extenders/modxmailer.class.inc.php @@ -270,9 +270,10 @@ public function mbMailSend($header, $body) */ public function SetError($msg) { - $msg .= '

      ' . print_r(call_user_func('get_object_vars', $this), true) . '
      '; + $classDump = call_user_func('get_object_vars', $this); + unset($classDump['modx']); $this->modx->config['send_errormail'] = '0'; - $this->modx->logEvent(0, 3, $msg, 'phpmailer'); + $this->modx->logEvent(0, 3, $msg . '
      ' . print_r($classDump, true) . '
      ', 'phpmailer'); return parent::SetError($msg); } From e32d25e19fac819d982163d819dffa73f77d13a4 Mon Sep 17 00:00:00 2001 From: Ser1ous Date: Thu, 24 May 2018 13:43:55 +0300 Subject: [PATCH 224/274] Fix strict mode bug on get tv list --- manager/media/style/default/ajax.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/media/style/default/ajax.php b/manager/media/style/default/ajax.php index ff354f56a8..32df2fb08b 100755 --- a/manager/media/style/default/ajax.php +++ b/manager/media/style/default/ajax.php @@ -79,7 +79,7 @@ case 'element_tplvars': $a = 301; - $sql = $modx->db->query('SELECT t1.*, IF(t2.templateid,0,1) AS disabled + $sql = $modx->db->query('SELECT t1.id,t1.name, IF(MIN(t2.tmplvarid),0,1) AS disabled FROM ' . $modx->getFullTableName('site_tmplvars') . ' AS t1 LEFT JOIN ' . $modx->getFullTableName('site_tmplvar_templates') . ' AS t2 ON t1.id=t2.tmplvarid ' . $sqlLike . ' From 7b3692125ca8b7b0362e426514ed1385e8f16238 Mon Sep 17 00:00:00 2001 From: Ser1ous Date: Thu, 24 May 2018 14:09:41 +0300 Subject: [PATCH 225/274] fix locked --- manager/media/style/default/ajax.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/media/style/default/ajax.php b/manager/media/style/default/ajax.php index 32df2fb08b..7cd012963f 100755 --- a/manager/media/style/default/ajax.php +++ b/manager/media/style/default/ajax.php @@ -79,7 +79,7 @@ case 'element_tplvars': $a = 301; - $sql = $modx->db->query('SELECT t1.id,t1.name, IF(MIN(t2.tmplvarid),0,1) AS disabled + $sql = $modx->db->query('SELECT t1.id,t1.name,t1.locked, IF(MIN(t2.tmplvarid),0,1) AS disabled FROM ' . $modx->getFullTableName('site_tmplvars') . ' AS t1 LEFT JOIN ' . $modx->getFullTableName('site_tmplvar_templates') . ' AS t2 ON t1.id=t2.tmplvarid ' . $sqlLike . ' From 6fa23c6a7b3c71106881d53b78b22bec42ad7ed2 Mon Sep 17 00:00:00 2001 From: Mr B Date: Thu, 24 May 2018 20:39:13 +0100 Subject: [PATCH 226/274] [I] Show element icon Suggest adding the icon back in. Older modx version it had the icon and appended the element type to the title. Without either it takes a second look to confirm the element type you are editing. --- manager/media/style/default/css/fonts.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/media/style/default/css/fonts.css b/manager/media/style/default/css/fonts.css index 596ddb2854..0b6dd0686d 100755 --- a/manager/media/style/default/css/fonts.css +++ b/manager/media/style/default/css/fonts.css @@ -41,7 +41,7 @@ margin-bottom: .5rem; font-family: inherit; font-weight: 500; line-height: 1.1; .h4, h4 { font-size: 1rem } .h5, h5 { font-size: 0.8125rem } .h6, h6 { font-size: 0.7rem } -h1 .fa:first-child { display: none; } +h1 .fa:first-child { color:#444; margin-right: 0.5em } a { color: #3481bc; text-decoration: none } .text-primary { color: #3481bc !important; } a:focus, a:hover { color: #014c8c; text-decoration: underline } From aff400f72144d3c37864838e790de318759c41ad Mon Sep 17 00:00:00 2001 From: Mr B Date: Fri, 25 May 2018 08:02:53 +0100 Subject: [PATCH 227/274] [F] Correct message urls correct path so works for sub directory installs + reference correct tab. --- manager/includes/lang/english.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manager/includes/lang/english.inc.php b/manager/includes/lang/english.inc.php index d7598363c9..bfd0e29f89 100755 --- a/manager/includes/lang/english.inc.php +++ b/manager/includes/lang/english.inc.php @@ -126,7 +126,7 @@ $_lang["configcheck_errorpage_unavailable_msg"] = 'This means that your Error page is not accessible to normal web surfers or does not exist. This can lead to a recursive looping condition and many errors in your site logs. Make sure there are no Webuser Groups assigned to the page.'; $_lang["configcheck_errorpage_unpublished"] = 'Your site\'s Error page is not published or does not exist.'; $_lang["configcheck_errorpage_unpublished_msg"] = 'This means that your Error page is inaccessible to the general public. Publish the page or make sure it is assigned to an existing Resource in your Site Tree in the Tools > Configuration menu.'; -$_lang["configcheck_filemanager_path"] = 'The currently set File Manager path seems incorrect.'; +$_lang["configcheck_filemanager_path"] = 'The currently set File Manager path seems incorrect.'; $_lang["configcheck_filemanager_path_msg"] = 'This can happen for example by moving your installation to a different directory or server. Please check and update your Evo system configuration.'; $_lang["configcheck_hide_warning"] = 'Don\'t show this again.'; $_lang["configcheck_images"] = 'Images directory not writable'; @@ -139,7 +139,7 @@ $_lang["configcheck_ok"] = 'Check passed OK - no warnings to report.'; $_lang["configcheck_php_gdzip"] = 'GD and/or Zip PHP extensions not found'; $_lang["configcheck_php_gdzip_msg"] = 'EVO needs the GD and Zip extension enabled for PHP. While EVO will work without them, you will not be able to take full advantage of the built-in File Manager, Image Editor or Captcha for logins.'; -$_lang["configcheck_rb_base_dir"] = 'The currently set File base path seems incorrect.'; +$_lang["configcheck_rb_base_dir"] = 'The currently set File base path seems incorrect.'; $_lang["configcheck_rb_base_dir_msg"] = 'This can happen for example by moving your installation to a different directory or server. Please check and update your Evo system configuration.'; $_lang["configcheck_register_globals"] = 'register_globals is set to ON in your php.ini configuration file'; $_lang["configcheck_register_globals_msg"] = 'This configuration makes your site much more susceptible to Cross Site Scripting (XSS) attacks. You should speak to your host about what you can do to disable this setting.'; @@ -1502,4 +1502,4 @@ $_lang['manager_menu_position_title'] = 'Main menu position'; $_lang['manager_menu_position_top'] = 'top'; -$_lang['manager_menu_position_left'] = 'left'; \ No newline at end of file +$_lang['manager_menu_position_left'] = 'left'; From 8d1a0ebac49025e4c0e85dc602559fda2aa8ac30 Mon Sep 17 00:00:00 2001 From: Mr B Date: Fri, 25 May 2018 09:02:09 +0100 Subject: [PATCH 228/274] [F] revert tab change Realised I had a custom configuration plugin installed that adds tabs! Change to path stands. --- manager/includes/lang/english.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/includes/lang/english.inc.php b/manager/includes/lang/english.inc.php index bfd0e29f89..69432a70ad 100755 --- a/manager/includes/lang/english.inc.php +++ b/manager/includes/lang/english.inc.php @@ -126,7 +126,7 @@ $_lang["configcheck_errorpage_unavailable_msg"] = 'This means that your Error page is not accessible to normal web surfers or does not exist. This can lead to a recursive looping condition and many errors in your site logs. Make sure there are no Webuser Groups assigned to the page.'; $_lang["configcheck_errorpage_unpublished"] = 'Your site\'s Error page is not published or does not exist.'; $_lang["configcheck_errorpage_unpublished_msg"] = 'This means that your Error page is inaccessible to the general public. Publish the page or make sure it is assigned to an existing Resource in your Site Tree in the Tools > Configuration menu.'; -$_lang["configcheck_filemanager_path"] = 'The currently set File Manager path seems incorrect.'; +$_lang["configcheck_filemanager_path"] = 'The currently set File Manager path seems incorrect.'; $_lang["configcheck_filemanager_path_msg"] = 'This can happen for example by moving your installation to a different directory or server. Please check and update your Evo system configuration.'; $_lang["configcheck_hide_warning"] = 'Don\'t show this again.'; $_lang["configcheck_images"] = 'Images directory not writable'; @@ -139,7 +139,7 @@ $_lang["configcheck_ok"] = 'Check passed OK - no warnings to report.'; $_lang["configcheck_php_gdzip"] = 'GD and/or Zip PHP extensions not found'; $_lang["configcheck_php_gdzip_msg"] = 'EVO needs the GD and Zip extension enabled for PHP. While EVO will work without them, you will not be able to take full advantage of the built-in File Manager, Image Editor or Captcha for logins.'; -$_lang["configcheck_rb_base_dir"] = 'The currently set File base path seems incorrect.'; +$_lang["configcheck_rb_base_dir"] = 'The currently set File base path seems incorrect.'; $_lang["configcheck_rb_base_dir_msg"] = 'This can happen for example by moving your installation to a different directory or server. Please check and update your Evo system configuration.'; $_lang["configcheck_register_globals"] = 'register_globals is set to ON in your php.ini configuration file'; $_lang["configcheck_register_globals_msg"] = 'This configuration makes your site much more susceptible to Cross Site Scripting (XSS) attacks. You should speak to your host about what you can do to disable this setting.'; From 323e9cdc9b0ec0cabeaff66b2d2cb76e631e940f Mon Sep 17 00:00:00 2001 From: Mr B Date: Fri, 25 May 2018 09:18:48 +0100 Subject: [PATCH 229/274] [F] tab3 invokeEvent to last tr --- .../mutate_settings/tab3_user_settings.inc.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/manager/actions/mutate_settings/tab3_user_settings.inc.php b/manager/actions/mutate_settings/tab3_user_settings.inc.php index 449b38a8da..c190b78fb6 100755 --- a/manager/actions/mutate_settings/tab3_user_settings.inc.php +++ b/manager/actions/mutate_settings/tab3_user_settings.inc.php @@ -138,15 +138,6 @@
       
      - invokeEvent('OnUserSettingsRender'); - if(is_array($evtOut)) echo implode("",$evtOut); - ?> -
       
      + invokeEvent('OnUserSettingsRender'); + if(is_array($evtOut)) echo implode("",$evtOut); + ?> +
      From 0c2fa0ddde06c404ace167bbbb3c461d9ece6ed3 Mon Sep 17 00:00:00 2001 From: Mr B Date: Fri, 25 May 2018 10:02:22 +0100 Subject: [PATCH 230/274] [I] Add missing events for System Settings tabs --- install/setup.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install/setup.sql b/install/setup.sql index 0a390d36ac..18533f722d 100755 --- a/install/setup.sql +++ b/install/setup.sql @@ -1061,6 +1061,8 @@ REPLACE INTO `{PREFIX}system_eventnames` ('83','OnFriendlyURLSettingsRender','1','System Settings'), ('84','OnUserSettingsRender','1','System Settings'), ('85','OnInterfaceSettingsRender','1','System Settings'), +('109','OnSecuritySettingsRender','1','System Settings'), +('110','OnFileManagerSettingsRender','1','System Settings'), ('86','OnMiscSettingsRender','1','System Settings'), ('87','OnRichTextEditorRegister','1','RichText Editor'), ('88','OnRichTextEditorInit','1','RichText Editor'), From 3608ab90fc9637ff5da4a85596bb9683704fd562 Mon Sep 17 00:00:00 2001 From: Mr B Date: Fri, 25 May 2018 10:04:13 +0100 Subject: [PATCH 231/274] Update tab5_security_settings.inc.php --- .../mutate_settings/tab5_security_settings.inc.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/manager/actions/mutate_settings/tab5_security_settings.inc.php b/manager/actions/mutate_settings/tab5_security_settings.inc.php index c7ab412921..78c039a8a3 100755 --- a/manager/actions/mutate_settings/tab5_security_settings.inc.php +++ b/manager/actions/mutate_settings/tab5_security_settings.inc.php @@ -221,5 +221,14 @@ >
      + + + invokeEvent('OnSecuritySettingsRender'); + if(is_array($evtOut)) echo implode("",$evtOut); + ?> + +
      From 8c873d61aa6b181b9056902e4ca6f1121168309d Mon Sep 17 00:00:00 2001 From: Mr B Date: Fri, 25 May 2018 10:05:27 +0100 Subject: [PATCH 232/274] Update tab6_filemanager_settings.inc.php --- .../mutate_settings/tab6_filemanager_settings.inc.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/manager/actions/mutate_settings/tab6_filemanager_settings.inc.php b/manager/actions/mutate_settings/tab6_filemanager_settings.inc.php index e6f269bcac..67a5059a2c 100755 --- a/manager/actions/mutate_settings/tab6_filemanager_settings.inc.php +++ b/manager/actions/mutate_settings/tab6_filemanager_settings.inc.php @@ -107,8 +107,14 @@
      + + invokeEvent('OnFileManagerSettingsRender'); + if(is_array($evtOut)) echo implode("",$evtOut); + ?> From ef95a606aba38332b74c608e53a0fa818234c44d Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Fri, 25 May 2018 19:47:13 +0300 Subject: [PATCH 233/274] update DocLister and FormLister --- assets/lib/APIHelpers.class.php | 33 ++++++++++ assets/lib/MODxAPI/MODx.php | 21 +------ assets/lib/MODxAPI/modResource.php | 2 +- assets/lib/MODxAPI/modUsers.php | 61 ++++++++++++++++--- .../DocLister/core/DocLister.abstract.php | 4 +- .../DocLister/core/controller/onetable.php | 10 ++- .../core/lang/english/paginate.inc.php | 2 - .../DocLister/lib/DLTemplate.class.php | 4 +- assets/snippets/DocLister/lib/DLphx.class.php | 1 - .../FormLister/core/controller/Profile.php | 12 ++-- ...20\277\320\270\321\201\320\265\320\274.md" | 4 +- .../snippets/FormLister/lib/FileValidator.php | 50 +++++++-------- assets/snippets/FormLister/lib/Validator.php | 61 ++++++++++--------- 13 files changed, 166 insertions(+), 99 deletions(-) mode change 100755 => 100644 assets/snippets/DocLister/core/lang/english/paginate.inc.php mode change 100755 => 100644 assets/snippets/FormLister/lib/FileValidator.php mode change 100755 => 100644 assets/snippets/FormLister/lib/Validator.php diff --git a/assets/lib/APIHelpers.class.php b/assets/lib/APIHelpers.class.php index d4256ead99..f03d058373 100644 --- a/assets/lib/APIHelpers.class.php +++ b/assets/lib/APIHelpers.class.php @@ -381,6 +381,39 @@ public static function checkString($value, $minLen = 1, $alph = array(), $mixArr return $flag; } + /** + * @param $IDs + * @param string $sep + * @param integer[] $ignore + * @return array + * @throws Exception + */ + public static function cleanIDs($IDs, $sep = ',', $ignore = array()) + { + $out = array(); + if (!is_array($IDs)) { + if (is_scalar($IDs)) { + $IDs = explode($sep, $IDs); + } else { + $IDs = array(); + throw new Exception('Invalid IDs list
      ' . print_r($IDs, 1) . '
      '); + } + } + foreach ($IDs as $item) { + $item = trim($item); + if (is_scalar($item) && (int)$item >= 0) { //Fix 0xfffffffff + if (!empty($ignore) && in_array((int)$item, $ignore, true)) { + $this->log[] = 'Ignore id ' . (int)$item; + } else { + $out[] = (int)$item; + } + } + } + $out = array_unique($out); + + return $out; + } + /** * Переменовывание элементов массива * diff --git a/assets/lib/MODxAPI/MODx.php b/assets/lib/MODxAPI/MODx.php index 207de94fc9..3d5bf6a436 100644 --- a/assets/lib/MODxAPI/MODx.php +++ b/assets/lib/MODxAPI/MODx.php @@ -559,26 +559,7 @@ public function isChanged($key) */ final public function cleanIDs($IDs, $sep = ',', $ignore = array()) { - $out = array(); - if (!is_array($IDs)) { - if (is_scalar($IDs)) { - $IDs = explode($sep, $IDs); - } else { - $IDs = array(); - throw new Exception('Invalid IDs list
      ' . print_r($IDs, 1) . '
      '); - } - } - foreach ($IDs as $item) { - $item = trim($item); - if (is_scalar($item) && (int)$item >= 0) { //Fix 0xfffffffff - if (!empty($ignore) && in_array((int)$item, $ignore, true)) { - $this->log[] = 'Ignore id ' . (int)$item; - } else { - $out[] = (int)$item; - } - } - } - $out = array_unique($out); + $out = APIhelpers::cleanIDs($IDs, $sep, $ignore); return $out; } diff --git a/assets/lib/MODxAPI/modResource.php b/assets/lib/MODxAPI/modResource.php index 41b5334e86..d671a87d50 100644 --- a/assets/lib/MODxAPI/modResource.php +++ b/assets/lib/MODxAPI/modResource.php @@ -800,7 +800,7 @@ protected function checkAlias($alias) */ public function issetField($key) { - return (array_key_exists($key, $this->default_field) || array_key_exists($key, $this->tv)); + return (array_key_exists($key, $this->default_field) || (array_key_exists($key, $this->tv) && $this->belongsToTemplate($this->tv[$key]))); } /** diff --git a/assets/lib/MODxAPI/modUsers.php b/assets/lib/MODxAPI/modUsers.php index 708fb2667b..fe3f76ea28 100644 --- a/assets/lib/MODxAPI/modUsers.php +++ b/assets/lib/MODxAPI/modUsers.php @@ -52,6 +52,11 @@ class modUsers extends MODxAPI */ protected $givenPassword = ''; protected $groupIds = array(); + protected $userIdCache = array( + 'attribute.internalKey' => '', + 'attribute.email' => '', + 'user.username' => '' + ); /** * @var integer @@ -135,6 +140,34 @@ public function create($data = array()) return $this; } + /** + * + */ + public function close() + { + parent::close(); + $this->userIdCache = array( + 'attribute.internalKey' => '', + 'attribute.email' => '', + 'user.username' => '' + ); + } + + /** + * @param $id + * @return mixed + */ + protected function getUserId($id) { + $find = $this->findUser($id); + if ($find && !empty($this->userIdCache[$find])) { + $id = $this->userIdCache[$find]; + } else { + $id = null; + } + + return $id; + } + /** * @param $id * @return $this @@ -142,7 +175,7 @@ public function create($data = array()) public function edit($id) { $id = is_scalar($id) ? trim($id) : ''; - if ($this->getID() != $id) { + if ($this->getUserId($id) != $id) { $this->close(); $this->newDoc = false; @@ -152,6 +185,9 @@ public function edit($id) $this->set('editedon', time()); $this->editQuery($find, $id); $this->id = empty($this->field['internalKey']) ? null : $this->get('internalKey'); + $this->userIdCache['attribute.internalKey'] = $this->getID(); + $this->userIdCache['attribute.email'] = $this->get('email'); + $this->userIdCache['user.username'] = $this->get('username'); $this->store($this->toArray()); unset($this->field['id']); unset($this->field['internalKey']); @@ -233,7 +269,7 @@ public function save($fire_events = false, $clearCache = false) return false; } - if (!$this->checkUnique('web_users', 'username')) { + if ($this->isChanged('username') && !$this->checkUnique('web_users', 'username')) { $this->log['UniqueUsername'] = 'username not unique
      ' . print_r(
                       $this->get('username'),
                       true
      @@ -242,7 +278,7 @@ public function save($fire_events = false, $clearCache = false)
                   return false;
               }
       
      -        if (!$this->checkUnique('web_user_attributes', 'email', 'internalKey')) {
      +        if ($this->isChanged('username') && !$this->checkUnique('web_user_attributes', 'email', 'internalKey')) {
                   $this->log['UniqueEmail'] = 'Email not unique 
      ' . print_r($this->get('email'), true) . '
      '; return false; @@ -372,6 +408,9 @@ public function delete($ids, $fire_events = false) return $flag; } + /** + * @return mixed + */ protected function deleteQuery() { return $this->query(" @@ -415,8 +454,12 @@ public function authUser($id = 0, $fulltime = true, $cookieName = 'WebLoginPE', */ public function checkBlock($id = 0) { - $tmp = clone $this; - if ($id && $tmp->getID() != $id) { + if ($this->getID()) { + $tmp = clone $this; + } else { + $tmp = $this; + } + if ($id && $tmp->getUserId($id) != $id) { $tmp->edit($id); } $now = time(); @@ -439,8 +482,12 @@ public function checkBlock($id = 0) */ public function testAuth($id, $password, $blocker, $fire_events = false) { - $tmp = clone $this; - if ($id && $tmp->getID() != $id) { + if ($this->getID()) { + $tmp = clone $this; + } else { + $tmp = $this; + } + if ($id && $tmp->getUserId($id) != $id) { $tmp->edit($id); } diff --git a/assets/snippets/DocLister/core/DocLister.abstract.php b/assets/snippets/DocLister/core/DocLister.abstract.php index 5929f92c81..2d0aa0459d 100644 --- a/assets/snippets/DocLister/core/DocLister.abstract.php +++ b/assets/snippets/DocLister/core/DocLister.abstract.php @@ -964,8 +964,8 @@ public function parseChunk($name, $data = array(), $parseDocumentSource = false) 2, array('html', null) ); - - $out = $this->DLTemplate->parseChunk($name, $data, $parseDocumentSource); + $disablePHx = $this->getCFGDef('disablePHx', 0); + $out = $this->DLTemplate->parseChunk($name, $data, $parseDocumentSource, (bool)$disablePHx); $out = $this->parseLang($out); if (empty($out)) { $this->debug->debug("Empty chunk: " . $this->debug->dumpData($name), '', 2); diff --git a/assets/snippets/DocLister/core/controller/onetable.php b/assets/snippets/DocLister/core/controller/onetable.php index 46848ac889..c69754ae0e 100644 --- a/assets/snippets/DocLister/core/controller/onetable.php +++ b/assets/snippets/DocLister/core/controller/onetable.php @@ -26,13 +26,19 @@ class onetableDocLister extends DocLister */ protected $parentField = 'parent'; + /** + * Экземпляр экстендера пагинации + * @var null|paginate_DL_Extender + */ + protected $extPaginate = null; + /** * @abstract */ public function getDocs($tvlist = '') { - if ($this->checkExtender('paginate')) { - $this->extender['paginate']->init($this); + if ($this->extPaginate = $this->getExtender('paginate')) { + $this->extPaginate->init($this); } $type = $this->getCFGDef('idType', 'parents'); $this->_docs = ($type == 'parents') ? $this->getChildrenList() : $this->getDocList(); diff --git a/assets/snippets/DocLister/core/lang/english/paginate.inc.php b/assets/snippets/DocLister/core/lang/english/paginate.inc.php old mode 100755 new mode 100644 index b07423d7f8..d504bae553 --- a/assets/snippets/DocLister/core/lang/english/paginate.inc.php +++ b/assets/snippets/DocLister/core/lang/english/paginate.inc.php @@ -3,8 +3,6 @@ die('What are you doing? Get out of here!'); } -setlocale(LC_ALL, 'ru_RU.UTF-8'); - $_lang = array(); $_lang['next'] = 'Next'; $_lang['prev'] = 'Prev'; diff --git a/assets/snippets/DocLister/lib/DLTemplate.class.php b/assets/snippets/DocLister/lib/DLTemplate.class.php index c8bb66ebf4..dfc3565181 100644 --- a/assets/snippets/DocLister/lib/DLTemplate.class.php +++ b/assets/snippets/DocLister/lib/DLTemplate.class.php @@ -328,7 +328,7 @@ public function getTemplate($id) * @param bool $parseDocumentSource render html template via DocumentParser::parseDocumentSource() * @return string html template with data without placeholders */ - public function parseChunk($name, $data = array(), $parseDocumentSource = false) + public function parseChunk($name, $data = array(), $parseDocumentSource = false, $disablePHx = false) { $out = $this->getChunk($name); if ($this->twigEnabled && ($out != '') && ($twig = $this->getTwig($name, $out))) { @@ -342,7 +342,7 @@ public function parseChunk($name, $data = array(), $parseDocumentSource = false) $item = $this->renameKeyArr($data, '[', ']', '+'); $out = str_replace(array_keys($item), array_values($item), $out); } - if (preg_match("/:([^:=]+)(?:=`(.*?)`(?=:[^:=]+|$))?/is", $out)) { + if (!$disablePHx && preg_match("/:([^:=]+)(?:=`(.*?)`(?=:[^:=]+|$))?/is", $out)) { if (is_null($this->phx) || !($this->phx instanceof DLphx)) { $this->phx = $this->createPHx(0, 1000); } diff --git a/assets/snippets/DocLister/lib/DLphx.class.php b/assets/snippets/DocLister/lib/DLphx.class.php index 71a1a36996..cc9099dcfb 100644 --- a/assets/snippets/DocLister/lib/DLphx.class.php +++ b/assets/snippets/DocLister/lib/DLphx.class.php @@ -127,7 +127,6 @@ public function ParseValues($template = '') $st = md5($template); $this->LogPass(); - // MODX Chunks if (preg_match_all('~(?Log('MODX Chunks -> Merging all chunk tags'); diff --git a/assets/snippets/FormLister/core/controller/Profile.php b/assets/snippets/FormLister/core/controller/Profile.php index 1142e67245..30ed90b50f 100644 --- a/assets/snippets/FormLister/core/controller/Profile.php +++ b/assets/snippets/FormLister/core/controller/Profile.php @@ -92,8 +92,9 @@ public static function uniqueEmail($fl, $value) { $result = true; if (is_scalar($value) && !is_null($fl->user) && ($fl->user->get("email") !== $value)) { - $fl->user->set('email', $value); - $result = $fl->user->checkUnique('web_user_attributes', 'email', 'internalKey'); + $user = clone($fl->user); + $user->set('email', $value); + $result = $user->checkUnique('web_user_attributes', 'email', 'internalKey'); } return $result; @@ -108,8 +109,9 @@ public static function uniqueUsername($fl, $value) { $result = true; if (is_scalar($value) && !is_null($fl->user) && ($fl->user->get("email") !== $value)) { - $fl->user->set('username', $value); - $result = $fl->user->checkUnique('web_users', 'username'); + $user = clone($fl->user); + $user->set('username', $value); + $result = $user->checkUnique('web_users', 'username'); } return $result; @@ -147,7 +149,7 @@ public function process() $fields['username'] = is_scalar($fields['username']) ? $fields['username'] : ''; } if (isset($fields['email'])) { - $fields['email'] = is_scalar($fields['username']) ? $fields['email'] : ''; + $fields['email'] = is_scalar($fields['email']) ? $fields['email'] : ''; } $result = $this->user->fromArray($fields)->save(true); $this->log('Update profile', array('data' => $fields, 'result' => $result, 'log' => $this->user->getLog())); diff --git "a/assets/snippets/FormLister/docs/ru/050_\320\236\321\202\320\277\321\200\320\260\320\262\320\272\320\260_\320\277\320\270\321\201\320\265\320\274.md" "b/assets/snippets/FormLister/docs/ru/050_\320\236\321\202\320\277\321\200\320\260\320\262\320\272\320\260_\320\277\320\270\321\201\320\265\320\274.md" index 258faf10d3..99b5a33802 100644 --- "a/assets/snippets/FormLister/docs/ru/050_\320\236\321\202\320\277\321\200\320\260\320\262\320\272\320\260_\320\277\320\270\321\201\320\265\320\274.md" +++ "b/assets/snippets/FormLister/docs/ru/050_\320\236\321\202\320\277\321\200\320\260\320\262\320\272\320\260_\320\277\320\270\321\201\320\265\320\274.md" @@ -120,14 +120,14 @@ Значение по умолчанию - не указано. -## ccMailConfig +### ccMailConfig Позволяет переопределить параметры отправки для писем, отправляемых по адресу из формы (isHtml, from, fromName, subject, replyTo, cc, bcc, noemail). Возможные значения - json или php массив. Значение по умолчанию - не указано. -## autoMailConfig +### autoMailConfig Позволяет переопределить параметры отправки для дополнительно отправляемых писем (isHtml, from, fromName, subject, replyTo, cc, bcc, noemail). Возможные значения - json или php массив. diff --git a/assets/snippets/FormLister/lib/FileValidator.php b/assets/snippets/FormLister/lib/FileValidator.php old mode 100755 new mode 100644 index 9be57b5088..993c5d6bb5 --- a/assets/snippets/FormLister/lib/FileValidator.php +++ b/assets/snippets/FormLister/lib/FileValidator.php @@ -11,9 +11,9 @@ class FileValidator * @param $value * @return bool */ - public function required($value) + public static function required($value) { - if (!$this->isArray($value)) { + if (!self::isArray($value)) { $value = array($value); } $flag = false; @@ -31,9 +31,9 @@ public function required($value) * @param $value * @return bool */ - public function optional($value) + public static function optional($value) { - if (!$this->isArray($value)) { + if (!self::isArray($value)) { $value = array($value); } $flag = false; @@ -56,9 +56,9 @@ public function optional($value) * @param $allowed * @return bool */ - public function allowed($value, $allowed) + public static function allowed($value, $allowed) { - if (!$this->isArray($value)) { + if (!self::isArray($value)) { $value = array($value); } $flag = false; @@ -81,9 +81,9 @@ public function allowed($value, $allowed) * @param $value * @return bool */ - public function images($value) + public statuc function images($value) { - return $this->allowed($value, array("jpg", "jpeg", "png", "gif", "bmp")); + return self::allowed($value, array("jpg", "jpeg", "png", "gif", "bmp")); } /** @@ -91,9 +91,9 @@ public function images($value) * @param $max * @return bool */ - public function maxSize($value, $max) + public static function maxSize($value, $max) { - if (!$this->isArray($value)) { + if (!self::isArray($value)) { $value = array($value); } $flag = false; @@ -113,9 +113,9 @@ public function maxSize($value, $max) * @param $min * @return bool */ - public function minSize($value, $min) + public static function minSize($value, $min) { - if (!$this->isArray($value)) { + if (!self::isArray($value)) { $value = array($value); } $flag = false; @@ -140,9 +140,9 @@ public function minSize($value, $min) * @param $max * @return bool */ - public function sizeBetween($value, $min, $max) + public static function sizeBetween($value, $min, $max) { - if (!$this->isArray($value)) { + if (!self::isArray($value)) { $value = array($value); } $flag = false; @@ -166,13 +166,13 @@ public function sizeBetween($value, $min, $max) * @param $max * @return bool */ - public function maxCount($value, $max) + public static function maxCount($value, $max) { - if (!$this->isArray($value)) { + if (!self::isArray($value)) { $value = array($value); } - return $this->getCount($value) < $max; + return self::getCount($value) < $max; } /** @@ -180,13 +180,13 @@ public function maxCount($value, $max) * @param $min * @return bool */ - public function minCount($value, $min) + public static function minCount($value, $min) { - if (!$this->isArray($value)) { + if (!self::isArray($value)) { $value = array($value); } - return $this->getCount($value) > $min; + return self::getCount($value) > $min; } /** @@ -195,20 +195,20 @@ public function minCount($value, $min) * @param $max * @return bool */ - public function countBetween($value, $min, $max) + public static function countBetween($value, $min, $max) { - if (!$this->isArray($value)) { + if (!self::isArray($value)) { $value = array($value); } - return $this->getCount($value) > $min && $this->getCount($value) < $max; + return self::getCount($value) > $min && self::getCount($value) < $max; } /** * @param $value * @return bool */ - protected function isArray($value) + protected static function isArray($value) { return isset($value[0]); } @@ -217,7 +217,7 @@ protected function isArray($value) * @param $value * @return int */ - protected function getCount($value) + protected static function getCount($value) { $out = 0; foreach ($value as $file) { diff --git a/assets/snippets/FormLister/lib/Validator.php b/assets/snippets/FormLister/lib/Validator.php old mode 100755 new mode 100644 index 2009423939..f865b6feb0 --- a/assets/snippets/FormLister/lib/Validator.php +++ b/assets/snippets/FormLister/lib/Validator.php @@ -10,7 +10,7 @@ class Validator * @param $value * @return bool */ - public function required($value) { + public static function required($value) { return !in_array($value, array(null, ''), true); } @@ -19,7 +19,7 @@ public function required($value) { * @param $format * @return bool */ - public function date($value, $format) { + public static function date($value, $format) { if (!is_scalar($value)) { return false; } @@ -32,7 +32,7 @@ public function date($value, $format) { * @param $min * @return bool */ - public function min($value, $min) + public static function min($value, $min) { return is_scalar($value) && $value >= $min; } @@ -42,7 +42,7 @@ public function min($value, $min) * @param $max * @return bool */ - public function max($value, $max) + public static function max($value, $max) { return is_scalar($value) && $value <= $max; } @@ -52,7 +52,7 @@ public function max($value, $max) * @param $min * @return bool */ - public function greater($value, $min) + public static function greater($value, $min) { return is_scalar($value) && $value > $min; } @@ -62,7 +62,7 @@ public function greater($value, $min) * @param $max * @return bool */ - public function less($value, $max) + public static function less($value, $max) { return is_scalar($value) && $value < $max; } @@ -73,7 +73,7 @@ public function less($value, $max) * @param $max * @return bool */ - public function between($value, $min, $max) + public static function between($value, $min, $max) { return (is_scalar($value) && $value >= $min && $value <= $max); } @@ -83,7 +83,7 @@ public function between($value, $min, $max) * @param $allowed * @return bool */ - public function equals($value, $allowed) + public static function equals($value, $allowed) { return is_scalar($value) && $value === $allowed; } @@ -93,7 +93,7 @@ public function equals($value, $allowed) * @param array $allowed * @return bool */ - public function in($value, $allowed) + public static function in($value, $allowed) { return is_scalar($value) && in_array($value, $allowed, true); } @@ -102,7 +102,7 @@ public function in($value, $allowed) * @param $value * @return bool */ - public function alpha($value) + public static function alpha($value) { return (bool) is_scalar($value) && preg_match('/^\pL++$/uD', $value); } @@ -111,8 +111,9 @@ public function alpha($value) * @param $value * @return bool */ - public function numeric($value) + public static function numeric($value) { + var_dump($value); return (bool) is_scalar($value) && preg_match('#^[0-9]*$#',$value); } @@ -120,7 +121,7 @@ public function numeric($value) * @param $value * @return bool */ - public function alphaNumeric($value) + public static function alphaNumeric($value) { return (bool) is_scalar($value) && preg_match('/^[\pL\pN]++$/uD', $value); } @@ -129,7 +130,7 @@ public function alphaNumeric($value) * @param $value * @return bool */ - public function slug($value) + public static function slug($value) { return (bool) is_scalar($value) && preg_match('/^[\pL\pN\-\_]++$/uD', $value); } @@ -138,7 +139,7 @@ public function slug($value) * @param $value * @return bool */ - public function decimal($value) + public static function decimal($value) { return (bool) is_scalar($value) && preg_match('/^[0-9]+(?:\.[0-9]+)?$/D', $value); } @@ -148,7 +149,7 @@ public function decimal($value) * @param $value * @return bool */ - public function phone($value) + public static function phone($value) { return (bool) is_scalar($value) && preg_match('#^[0-9\(\)\+ \-]*$#',$value); } @@ -158,7 +159,7 @@ public function phone($value) * @param $regexp * @return bool */ - public function matches($value,$regexp) + public static function matches($value,$regexp) { return (bool) is_scalar($value) && preg_match($regexp,$value); } @@ -167,7 +168,7 @@ public function matches($value,$regexp) * @param $value * @return bool */ - public function url($value) + public static function url($value) { return (bool) is_scalar($value) && preg_match( '~^ @@ -184,7 +185,7 @@ public function url($value) * @param $value * @return bool */ - public function email($value) + public static function email($value) { return (bool) is_scalar($value) && preg_match( '/^ @@ -203,9 +204,9 @@ public function email($value) * @param $length * @return bool */ - public function length($value, $length) + public static function length($value, $length) { - return $this->getLength($value) === $length; + return self::getLength($value) === $length; } /** @@ -213,9 +214,9 @@ public function length($value, $length) * @param $minLength * @return bool */ - public function minLength($value, $minLength) + public static function minLength($value, $minLength) { - return $this->getLength($value) >= $minLength; + return self::getLength($value) >= $minLength; } /** @@ -223,9 +224,9 @@ public function minLength($value, $minLength) * @param $maxLength * @return bool */ - public function maxLength($value, $maxLength) + public static function maxLength($value, $maxLength) { - return $this->getLength($value) <= $maxLength; + return self::getLength($value) <= $maxLength; } /** @@ -234,12 +235,12 @@ public function maxLength($value, $maxLength) * @param $maxLength * @return bool */ - public function lengthBetween($value, $minLength, $maxLength) + public static function lengthBetween($value, $minLength, $maxLength) { if (!is_scalar($value)) { return false; } - $length = $this->getLength($value); + $length = self::getLength($value); return ($length >= $minLength && $length <= $maxLength); } @@ -249,7 +250,7 @@ public function lengthBetween($value, $minLength, $maxLength) * @param $minSize * @return bool */ - public function minCount($value, $minSize) { + public static function minCount($value, $minSize) { return is_array($value) && count($value) >= $minSize; } @@ -258,7 +259,7 @@ public function minCount($value, $minSize) { * @param $maxSize * @return bool */ - public function maxCount($value, $maxSize) { + public static function maxCount($value, $maxSize) { return is_array($value) && count($value) <= $maxSize; } @@ -268,7 +269,7 @@ public function maxCount($value, $maxSize) { * @param $maxSize * @return bool */ - public function countBetween($value, $minSize, $maxSize) { + public static function countBetween($value, $minSize, $maxSize) { return (is_array($value) && count($value) >= $minSize && count($value) <= $maxSize); } @@ -276,7 +277,7 @@ public function countBetween($value, $minSize, $maxSize) { * @param $string * @return int */ - protected function getLength($string) + protected static function getLength($string) { return strlen(utf8_decode($string)); } From f399f2ea8e5a42aecca6a06395e3ef5f7c7c924e Mon Sep 17 00:00:00 2001 From: Pathologic Date: Fri, 25 May 2018 20:46:01 +0300 Subject: [PATCH 234/274] fix broken OnParseProperties event --- .../includes/document.parser.class.inc.php | 92 +++++++++---------- 1 file changed, 44 insertions(+), 48 deletions(-) diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index b6a2423d14..a47a066509 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -5495,59 +5495,54 @@ public function parseProperties($propertyString, $elementName = null, $elementTy $propertyString = trim($propertyString); $propertyString = str_replace('{}', '', $propertyString); $propertyString = str_replace('} {', ',', $propertyString); - if (empty($propertyString)) { - return array(); - } - if ($propertyString == '{}') { - return array(); - } - - $jsonFormat = $this->isJson($propertyString, true); $property = array(); - // old format - if ($jsonFormat === false) { - $props = explode('&', $propertyString); - foreach ($props as $prop) { - - if (empty($prop)) { - continue; - } elseif (strpos($prop, '=') === false) { - $property[trim($prop)] = ''; - continue; - } + if (!empty($propertyString) && $propertyString == '{}') { + $jsonFormat = $this->isJson($propertyString, true); + // old format + if ($jsonFormat === false) { + $props = explode('&', $propertyString); + foreach ($props as $prop) { + + if (empty($prop)) { + continue; + } elseif (strpos($prop, '=') === false) { + $property[trim($prop)] = ''; + continue; + } - $_ = explode('=', $prop, 2); - $key = trim($_[0]); - $p = explode(';', trim($_[1])); - switch ($p[1]) { - case 'list': - case 'list-multi': - case 'checkbox': - case 'radio': - $value = !isset($p[3]) ? '' : $p[3]; - break; - default: - $value = !isset($p[2]) ? '' : $p[2]; - } - if (!empty($key)) { - $property[$key] = $value; - } - } - // new json-format - } else if (!empty($jsonFormat)) { - foreach ($jsonFormat as $key => $row) { - if (!empty($key)) { - if (is_array($row)) { - if (isset($row[0]['value'])) { - $value = $row[0]['value']; - } - } else { - $value = $row; + $_ = explode('=', $prop, 2); + $key = trim($_[0]); + $p = explode(';', trim($_[1])); + switch ($p[1]) { + case 'list': + case 'list-multi': + case 'checkbox': + case 'radio': + $value = !isset($p[3]) ? '' : $p[3]; + break; + default: + $value = !isset($p[2]) ? '' : $p[2]; } - if (isset($value) && $value !== '') { + if (!empty($key)) { $property[$key] = $value; } } + // new json-format + } else if (!empty($jsonFormat)) { + foreach ($jsonFormat as $key => $row) { + if (!empty($key)) { + if (is_array($row)) { + if (isset($row[0]['value'])) { + $value = $row[0]['value']; + } + } else { + $value = $row; + } + if (isset($value) && $value !== '') { + $property[$key] = $value; + } + } + } } } if (!empty($elementName) && !empty($elementType)) { @@ -5563,6 +5558,7 @@ public function parseProperties($propertyString, $elementName = null, $elementTy $property = $out; } } + return $property; } @@ -6768,4 +6764,4 @@ public function _resetEventObject() $this->_propagate = true; $this->activated = false; } -} \ No newline at end of file +} From d22661d8edd3ad340ea3b8cb1ad3da00ca6d3570 Mon Sep 17 00:00:00 2001 From: Pathologic Date: Fri, 25 May 2018 20:54:55 +0300 Subject: [PATCH 235/274] fix --- manager/includes/document.parser.class.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index a47a066509..41d9175705 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -5496,7 +5496,7 @@ public function parseProperties($propertyString, $elementName = null, $elementTy $propertyString = str_replace('{}', '', $propertyString); $propertyString = str_replace('} {', ',', $propertyString); $property = array(); - if (!empty($propertyString) && $propertyString == '{}') { + if (!empty($propertyString) && $propertyString != '{}') { $jsonFormat = $this->isJson($propertyString, true); // old format if ($jsonFormat === false) { From ebed40c60f18ea5b154938f61cb88ee2e8a39eed Mon Sep 17 00:00:00 2001 From: Serg <64j@mail.ru> Date: Fri, 25 May 2018 21:05:23 +0300 Subject: [PATCH 236/274] fix undeclared variable --- manager/includes/document.parser.class.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index 41d9175705..20f88fa6c4 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -2263,6 +2263,7 @@ public function _getSplitPosition($str) $closeOpt = false; $maybePos = false; $inFilter = false; + $pos = false; $total = strlen($str); for ($i = 0; $i < $total; $i++) { $c = substr($str, $i, 1); @@ -5558,7 +5559,7 @@ public function parseProperties($propertyString, $elementName = null, $elementTy $property = $out; } } - + return $property; } From 2950b760d717ed400453c3edf71a03a3dbaf4f07 Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Tue, 29 May 2018 20:41:52 +0300 Subject: [PATCH 237/274] fix correct install finish --- install/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/install/index.php b/install/index.php index dbdb283f0f..a08bd54b66 100755 --- a/install/index.php +++ b/install/index.php @@ -25,6 +25,7 @@ require_once("lang.php"); require_once('../'.MGR_DIR.'/includes/version.inc.php'); +include_once('../'.MGR_DIR.'/includes/preload.functions.inc.php'); // start session session_start(); From 5edac57c83d277857e038cee25ee9046d04289d3 Mon Sep 17 00:00:00 2001 From: Serg <64j@mail.ru> Date: Wed, 30 May 2018 00:16:41 +0300 Subject: [PATCH 238/274] Moving tv parameters without a category to the General tab --- manager/actions/mutate_content.dynamic.php | 142 ++++++++++++--------- 1 file changed, 82 insertions(+), 60 deletions(-) diff --git a/manager/actions/mutate_content.dynamic.php b/manager/actions/mutate_content.dynamic.php index e29cff31ab..55c2714d57 100755 --- a/manager/actions/mutate_content.dynamic.php +++ b/manager/actions/mutate_content.dynamic.php @@ -953,54 +953,28 @@ function SetUrl(url, width, height, alt) { $where = vsprintf("tvtpl.templateid='%s' AND (1='%s' OR ISNULL(tva.documentgroup) %s)", $vs); $rs = $modx->db->select($field, $from, $where, $sort); if ($modx->db->getRecordCount($rs)) { - $templateVariables .= ' - ' . "\n"; - if (!$group_tvs) { - $templateVariables .= ' -
      ' . $_lang['settings_templvars'] . '
      -
      - '; - } else if ($group_tvs == 2) { - $templateVariables .= ' -
      -
      ' . $_lang['settings_templvars'] . '
      -
      - '; - } else if ($group_tvs == 3) { - $templateVariables .= ' -
      -

      ' . $_lang['settings_templvars'] . '

      - '; - } else if ($group_tvs == 4) { - $templateVariables .= ' -
      -

      ' . $_lang['settings_templvars'] . '

      - - -
      - '; - } - $tvsArray = $modx->db->makeArray($rs, 'name'); require_once(MODX_MANAGER_PATH . 'includes/tmplvars.inc.php'); require_once(MODX_MANAGER_PATH . 'includes/tmplvars.commands.inc.php'); - $i = 0; + + $templateVariablesOutput = ''; + $templateVariablesGeneral = ''; + + $i = $ii = 0; $tab = ''; foreach ($tvsArray as $row) { - if ($tab !== $row['category_id']) { - if ($group_tvs == 1 || $group_tvs == 3) { - if ($i === 0) { - $templateVariables .= ' + if ($group_tvs && $row['category_id'] != 0) { + $ii = 0; + if ($tab !== $row['category_id']) { + if ($group_tvs == 1 || $group_tvs == 3) { + if ($i === 0) { + $templateVariablesOutput .= '
      ' . $row['category'] . '
      ' . "\n"; - } else { - $templateVariables .= ' + } else { + $templateVariablesOutput .= '
      @@ -1009,18 +983,18 @@ function SetUrl(url, width, height, alt) {
      ' . $row['category'] . '
      '; - } - } else if ($group_tvs == 2 || $group_tvs == 4) { - if ($i === 0) { - $templateVariables .= ' + } + } else if ($group_tvs == 2 || $group_tvs == 4) { + if ($i === 0) { + $templateVariablesOutput .= '

      ' . $row['category'] . '

      '; - } else { - $templateVariables .= ' + } else { + $templateVariablesOutput .= '
      @@ -1031,16 +1005,16 @@ function SetUrl(url, width, height, alt) {
      '; - } - } else if ($group_tvs == 5) { - if ($i === 0) { - $templateVariables .= ' + } + } else if ($group_tvs == 5) { + if ($i === 0) { + $templateVariablesOutput .= '

      ' . $row['category'] . '

      '; - } else { - $templateVariables .= ' + } else { + $templateVariablesOutput .= '
      @@ -1049,12 +1023,14 @@ function SetUrl(url, width, height, alt) { '; + } } + $split = 0; + } else { + $split = 1; } - $split = 0; - } else { - $split = 1; } + // Go through and display all Template Variables if ($row['type'] == 'richtext' || $row['type'] == 'htmlarea') { // determine TV-options @@ -1067,14 +1043,17 @@ function SetUrl(url, width, height, alt) { $richtexteditorIds[$editor][] = "tv" . $row['id']; $richtexteditorOptions[$editor]["tv" . $row['id']] = $tvOptions; } + + $templateVariablesTmp = ''; + // splitter if ($group_tvs) { - if ($split && $i) { - $templateVariables .= ' + if (($split && $i) || $ii) { + $templateVariablesTmp .= ' ' . "\n"; } } else if ($i) { - $templateVariables .= ' + $templateVariablesTmp .= ' ' . "\n"; } @@ -1093,15 +1072,58 @@ function SetUrl(url, width, height, alt) { $tvInherited = (substr($tvPBV, 0, 8) == '@INHERIT') ? '
      (' . $_lang['tmplvars_inherited'] . ')' : ''; $tvName = $modx->hasPermission('edit_template') ? '
      [*' . $row['name'] . '*]' : ''; - $templateVariables .= ' + $templateVariablesTmp .= ' '; - $tab = $row['category_id']; - $i++; + if ($group_tvs && $row['category_id'] == 0) { + $templateVariablesGeneral .= $templateVariablesTmp; + $ii++; + } else { + $templateVariablesOutput .= $templateVariablesTmp; + $tab = $row['category_id']; + $i++; + } + } + + if ($templateVariablesGeneral) { + echo '
      ' . $row['caption'] . $tvName . '' . $tvDescription . $tvInherited . '
      ' . renderFormElement($row['type'], $row['id'], $row['default_text'], $row['elements'], $tvPBV, '', $row, $tvsArray) . '
      ' . $templateVariablesGeneral . '
      '; + } + + $templateVariables .= ' + ' . "\n"; + if (!$group_tvs) { + $templateVariables .= ' +
      ' . $_lang['settings_templvars'] . '
      +
      + '; + } else if ($group_tvs == 2) { + $templateVariables .= ' +
      +
      ' . $_lang['settings_templvars'] . '
      +
      + '; + } else if ($group_tvs == 3) { + $templateVariables .= ' +
      +

      ' . $_lang['settings_templvars'] . '

      + '; + } else if ($group_tvs == 4) { + $templateVariables .= ' +
      +

      ' . $_lang['settings_templvars'] . '

      + + +
      + '; } + $templateVariables .= $templateVariablesOutput; $templateVariables .= '
      ' . "\n"; From ddb47a7d03473be4e55e1529c395ae9613ab56ff Mon Sep 17 00:00:00 2001 From: Serg <64j@mail.ru> Date: Wed, 30 May 2018 01:12:35 +0300 Subject: [PATCH 239/274] Fix buttons transition and focus background-color --- manager/media/style/default/css/forms.css | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/manager/media/style/default/css/forms.css b/manager/media/style/default/css/forms.css index c361076a4e..8fd4ac9907 100755 --- a/manager/media/style/default/css/forms.css +++ b/manager/media/style/default/css/forms.css @@ -16,7 +16,7 @@ button, input, optgroup, select, textarea { position: relative; font-family: san .form-control, input[type=text]:not(.form-control), input[type=password], input[type=number], input[type=email], input[type=date], input[type=url], input[type=search], select, textarea { display: inline-block; width: 100%; max-width: 100%; padding: 0.46153846em .5em; line-height: 1.23076923; vertical-align: inherit; font-size: 0.8125rem; color: #464a4c; background-color: #fff; -webkit-background-clip: padding-box; background-clip: padding-box; border: 1px solid #d4d4d4; border-radius: .1em; -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; } .form-control:focus, input:not([type=radio]):not([type=checkbox]):focus, select:focus, textarea:focus, .btn.focus, .btn:focus { z-index: 3; outline-offset: -1px; outline: rgba(77, 142, 249, 0.5) solid 2px; border-color: #66afe9; } input:not([type=button]):not([type=submit]):hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: #bbb; transition: border-color 0s, background-position .1s; } -.btn, button:not(.btn), input[type=button]:not(.btn), input[type=submit]:not(.btn) { display: inline-block; padding: 0.46153846em 1em; line-height: 1.23076923; vertical-align: inherit; text-align: center; text-decoration: none !important; font-size: 0.8125rem; font-weight: 400; white-space: nowrap; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: pointer; background-color: #fff; border: 1px solid #d4d4d4; border-radius: .1em; -webkit-transition: all .2s ease-in-out; -o-transition: all .2s ease-in-out; transition: all .2s ease-in-out } +.btn, button:not(.btn), input[type=button]:not(.btn), input[type=submit]:not(.btn) { display: inline-block; padding: 0.46153846em 1em; line-height: 1.23076923; vertical-align: inherit; text-align: center; text-decoration: none !important; font-size: 0.8125rem; font-weight: 400; white-space: nowrap; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: pointer; background-color: #fff; border: 1px solid #d4d4d4; border-radius: .1em; -webkit-transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out; -o-transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out; transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out } select:not([size]):not([multiple]), select.form-control:not([size]):not([multiple]), select[size="1"]:not([multiple]) { height: 2.3076923em; line-height: 1.38461538 } .form-control-sm, .input-group-sm > .form-control, .input-group-sm > .input-group-addon, .input-group-sm > .input-group-btn > .btn, input.form-control-sm, .btn-group-sm > .btn, .btn-sm, .input-group-addon.form-control-sm, .input-group-sm > .input-group-addon, .input-group-sm > .input-group-btn > .input-group-addon.btn { padding: 0.46153846em .5rem; font-size: .6772rem; border-radius: .1rem; } .form-control-lg, .input-group-lg > .form-control, .input-group-lg > .input-group-addon, .input-group-lg > .input-group-btn > .btn, input.form-control-lg, .btn-group-lg > .btn, .btn-lg, .input-group-addon.form-control-lg, .input-group-lg > .input-group-addon, .input-group-lg > .input-group-btn > .input-group-addon.btn { padding: 0.46153846em .5rem; font-size: 1.15rem; border-radius: .1rem; } @@ -28,12 +28,16 @@ select:not([size]):not([multiple]), select.form-control:not([size]):not([multipl .btn-secondary:hover { color: #292b2c; background-color: #e6e6e6; border-color: #adadad } .btn-success { color: #fff; background-color: #5cb85c; border-color: #56ac56 } .btn-success:hover { color: #fff; background-color: #449d44; border-color: #419641 } +.btn-success:focus, .btn-success:focus:active { color: #fff; background-color: #398439; border-color: #2d672d } .btn-danger { color: #fff; background-color: #d9534f; border-color: #d9534f } .btn-danger:hover { color: #fff; background-color: #c9302c; border-color: #c12e2a } +.btn-danger:focus, .btn-danger:focus:active { color: #fff; background-color: #ac2925; border-color: #8b211e } .btn-warning { color: #fff; background-color: #f0ad4e; border-color: #f0ad4e; } .btn-warning:hover { color: #fff; background-color: #ec971f; border-color: #eb9316; } +.btn-warning:focus, .btn-warning:focus:active { color: #fff; background-color: #d58512; border-color: #b06d0f; } .btn-info { color: #fff; background-color: #5bc0de; border-color: #5bc0de; } .btn-info:hover { color: #fff; background-color: #31b0d5; border-color: #2aabd2; } +.btn-info:focus, .btn-info:focus:active { color: #fff; background-color: #269abc; border-color: #1f7e9a; } .btn-default { color: #bbb; background-color: #202329; border-color: #202329 } .btn-default:hover { color: #fff; background-color: #1a1c21; border-color: #1a1c21 } textarea, textarea.form-control { width: 100%; line-height: 1.5; overflow: auto; resize: vertical } From 769270b96ed2b97ca41a6fffb347d619b96409bd Mon Sep 17 00:00:00 2001 From: Agel_Nash Date: Wed, 30 May 2018 21:56:16 +0500 Subject: [PATCH 240/274] Cross-Site Scripting https://www.exploit-db.com/exploits/44775/ Site name field XSS fix: https://github.com/nathunandwani/ClipperCMS/commit/f286fbfa81dc3728dbbf6d9d817c8848edcad0b2 --- manager/processors/save_settings.processor.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/manager/processors/save_settings.processor.php b/manager/processors/save_settings.processor.php index 01894cfd42..ebe7c6f654 100755 --- a/manager/processors/save_settings.processor.php +++ b/manager/processors/save_settings.processor.php @@ -69,6 +69,9 @@ $data['mail_check_timeperiod'] = (int)$data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute foreach ($data as $k => $v) { switch ($k) { + case 'site_name': + $v = htmlspecialchars($v); + break; case 'settings_version':{ if($modx->getVersionData('version')!=$data['settings_version']){ $modx->logEvent(17,2,'
      '.var_export($data['settings_version'],true).'
      ','fake settings_version'); From d568f89d2847574442951ab39cdb4091ac5730e0 Mon Sep 17 00:00:00 2001 From: Agel_Nash Date: Thu, 31 May 2018 00:25:25 +0500 Subject: [PATCH 241/274] Code style --- .gitignore | 2 ++ .php_cs.dist | 27 +++++++++++++++++++++++++++ composer.json | 12 ++++++++++++ phpcs.xml | 37 +++++++++++++++++++++++++++++++++++++ phpmd.xml | 24 ++++++++++++++++++++++++ 5 files changed, 102 insertions(+) create mode 100644 .php_cs.dist create mode 100644 phpcs.xml create mode 100644 phpmd.xml diff --git a/.gitignore b/.gitignore index adf28e291b..49b1103bb9 100644 --- a/.gitignore +++ b/.gitignore @@ -69,6 +69,8 @@ Desktop.ini .idea .vagrant .rocketeer +.php_cs +.php_cs.cache # except do not ignore .gitignore !.gitignore diff --git a/.php_cs.dist b/.php_cs.dist new file mode 100644 index 0000000000..eac63b1805 --- /dev/null +++ b/.php_cs.dist @@ -0,0 +1,27 @@ +append(array( + 'index.php' + ))->exclude(array( + 'manager/actions/help/', + 'manager/includes/lang/' + ))->in(__DIR__ . '/manager/') + ->notName('*.phtml'); + +return PhpCsFixer\Config::create() + ->setRules([ + '@PSR2' => true, + '@Symfony:risky' => false, + 'concat_space' => array('spacing' => 'one'), + 'array_syntax' => array('syntax' => 'long'), + 'method_argument_space' => true, + 'no_unused_imports' => true, + 'protected_to_private' => false, + ]) + ->setIndent(" ") + ->setLineEnding("\r\n") + ->setFinder($finder); diff --git a/composer.json b/composer.json index 390daaf71c..a67e256663 100644 --- a/composer.json +++ b/composer.json @@ -16,6 +16,12 @@ "email": "dmi3yy@gmail.com", "homepage": "http://dmi3yy.com", "role": "Developer" + }, + { + "name": "Evgeniy Borisov", + "email": "modx@agel-nash.ru", + "homepage": "https://agel-nash.ru", + "role": "Web security expert" } ], "support": { @@ -31,6 +37,12 @@ "require": { "php": ">=5.6" }, + "require-dev": { + "roave/security-advisories": "dev-master", + "phpmd/phpmd": "~2.0", + "friendsofphp/php-cs-fixer": "~2.11", + "squizlabs/php_codesniffer": "~3.0" + }, "minimum-stability": "dev", "prefer-stable": true } diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000000..98b945ebce --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,37 @@ + + + The Evolution coding standard. + + + + + + + + manager/ + + */lang/* + + + + + + + + + + + + + + + + + + + + + + + diff --git a/phpmd.xml b/phpmd.xml new file mode 100644 index 0000000000..5fb6440f05 --- /dev/null +++ b/phpmd.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + From c061fce27de3ffa84bd064af533a45a54c8f55ae Mon Sep 17 00:00:00 2001 From: Agel_Nash Date: Thu, 31 May 2018 02:43:50 +0500 Subject: [PATCH 242/274] vendor/bin/php-cs-fixer fix --- index.php | 112 +- .../actions/access_permissions.dynamic.php | 181 ++- manager/actions/bkmanager.static.php | 65 +- .../inc/Module_Categories_Manager.php | 1 - .../category_mgr/inc/request_trigger.inc.php | 142 +- manager/actions/document_data.static.php | 338 ++-- manager/actions/eventlog.dynamic.php | 74 +- manager/actions/eventlog_details.dynamic.php | 32 +- manager/actions/export_site.static.php | 24 +- manager/actions/files.dynamic.php | 34 +- manager/actions/help.static.php | 63 +- manager/actions/import_site.static.php | 690 +++++---- manager/actions/logging.static.php | 167 +- manager/actions/messages.static.php | 67 +- manager/actions/modules.static.php | 4 +- manager/actions/move_document.dynamic.php | 2 +- manager/actions/mutate_categories.dynamic.php | 48 +- manager/actions/mutate_content.dynamic.php | 1197 +++++++------- .../actions/mutate_htmlsnippet.dynamic.php | 4 +- .../actions/mutate_menuindex_sort.dynamic.php | 4 +- manager/actions/mutate_module.dynamic.php | 207 +-- .../mutate_module_resources.dynamic.php | 184 +-- manager/actions/mutate_password.dynamic.php | 8 +- manager/actions/mutate_plugin.dynamic.php | 2 +- .../mutate_plugin_priority.dynamic.php | 4 +- manager/actions/mutate_role.dynamic.php | 264 ++-- manager/actions/mutate_settings.dynamic.php | 56 +- .../mutate_settings/snippet_smtp.inc.php | 12 +- .../tab1_site_settings.inc.php | 122 +- .../tab2_furl_settings.inc.php | 36 +- .../tab3_user_settings.inc.php | 14 +- .../tab4_manager_settings.inc.php | 4 +- .../tab5_security_settings.inc.php | 58 +- .../tab6_filemanager_settings.inc.php | 4 +- .../tab7_filebrowser_settings.inc.php | 6 +- manager/actions/mutate_snippet.dynamic.php | 4 +- .../mutate_template_tv_rank.dynamic.php | 4 +- manager/actions/mutate_templates.dynamic.php | 263 ++-- manager/actions/mutate_tmplvars.dynamic.php | 262 ++-- manager/actions/mutate_tv_rank.dynamic.php | 4 +- manager/actions/mutate_user.dynamic.php | 799 ---------- manager/actions/mutate_web_user.dynamic.php | 209 +-- manager/actions/phpinfo.static.php | 2 +- manager/actions/refresh_site.dynamic.php | 20 +- manager/actions/resource_selector.static.php | 2 +- manager/actions/resources.static.php | 132 +- manager/actions/resources/functions.inc.php | 352 +++-- .../actions/resources/mgrResources.class.php | 226 +-- .../actions/resources/tab1_templates.inc.php | 8 +- .../resources/tab2_templatevars.inc.php | 8 +- manager/actions/resources/tab3_chunks.inc.php | 8 +- .../actions/resources/tab4_snippets.inc.php | 8 +- .../actions/resources/tab5_plugins.inc.php | 23 +- .../resources/tab6_categoryview.inc.php | 2 +- manager/actions/role_management.static.php | 38 +- manager/actions/search.static.php | 105 +- manager/actions/site_schedule.static.php | 77 +- manager/actions/sysinfo.static.php | 33 +- manager/actions/user_management.static.php | 114 +- .../web_access_permissions.dynamic.php | 179 +-- .../actions/web_user_management.static.php | 64 +- manager/actions/welcome.static.php | 550 +++---- manager/frames/1.php | 134 +- manager/frames/mainmenu.php | 702 ++++----- manager/frames/nodes.functions.inc.php | 16 +- manager/frames/tree.php | 70 +- manager/includes/accesscontrol.inc.php | 11 +- manager/includes/actionlist.inc.php | 265 ++-- manager/includes/active_user_locks.inc.php | 4 +- manager/includes/charsets.php | 48 +- manager/includes/config_check.inc.php | 140 +- manager/includes/controls/contextmenu.php | 94 +- manager/includes/controls/datagrid.class.php | 475 +++--- .../includes/controls/datasetpager.class.php | 344 ++-- manager/includes/controls/phpmailer/OAuth.php | 2 +- .../includes/controls/phpmailer/PHPMailer.php | 182 +-- manager/includes/controls/phpmailer/POP3.php | 6 +- manager/includes/controls/phpmailer/SMTP.php | 44 +- manager/includes/debug.inc.php | 15 +- manager/includes/default_config.php | 3 - .../includes/document.parser.class.inc.php | 226 ++- manager/includes/error.class.inc.php | 1 - .../extenders/dbapi.mysql.class.inc.php | 20 +- .../extenders/dbapi.mysqli.class.inc.php | 37 +- .../extenders/deprecated.functions.inc.php | 6 +- manager/includes/extenders/ex_dbapi.inc.php | 8 +- .../includes/extenders/export.class.inc.php | 7 +- .../includes/extenders/maketable.class.php | 8 +- .../extenders/manager.api.class.inc.php | 1 - .../includes/extenders/message.quit.inc.php | 77 +- .../extenders/modifiers.class.inc.php | 1089 ++++++++----- .../extenders/modifiers/mdf_addbreak.inc.php | 17 +- .../extenders/modifiers/mdf_getimage.inc.php | 23 +- .../extenders/modifiers/mdf_memberof.inc.php | 25 +- .../extenders/modifiers/mdf_moduser.inc.php | 7 +- .../extenders/modifiers/mdf_summary.inc.php | 57 +- .../extenders/modifiers/mdf_wordwrap.inc.php | 4 +- manager/includes/footer.inc.php | 30 +- manager/includes/header.inc.php | 12 +- manager/includes/log.class.inc.php | 10 +- manager/includes/manager.lockout.inc.php | 99 +- manager/includes/menu.class.inc.php | 3 +- manager/includes/preload.functions.inc.php | 16 +- manager/includes/protect.inc.php | 4 +- manager/includes/sysalert.display.inc.php | 45 +- .../includes/template.parser.class.inc.php | 285 ++-- manager/includes/tmplvars.commands.inc.php | 97 +- manager/includes/tmplvars.format.inc.php | 661 ++++---- manager/includes/tmplvars.inc.php | 504 +++--- manager/includes/user_settings.inc.php | 2 +- manager/includes/veriword.php | 61 +- manager/index.php | 1377 +++++++++-------- manager/media/browser/mcpuk/browse.php | 17 +- manager/media/browser/mcpuk/browser.php | 18 +- manager/media/browser/mcpuk/config.php | 22 +- manager/media/browser/mcpuk/core/autoload.php | 44 +- manager/media/browser/mcpuk/core/browser.php | 611 +++++--- .../browser/mcpuk/core/types/type_img.php | 11 +- .../browser/mcpuk/core/types/type_mime.php | 20 +- manager/media/browser/mcpuk/core/uploader.php | 474 +++--- manager/media/browser/mcpuk/css.php | 6 +- .../media/browser/mcpuk/js/browser/joiner.php | 6 +- manager/media/browser/mcpuk/js_localize.php | 10 +- manager/media/browser/mcpuk/lang/af.php | 2 - manager/media/browser/mcpuk/lang/bg.php | 2 - manager/media/browser/mcpuk/lang/ca.php | 2 - manager/media/browser/mcpuk/lang/cs.php | 2 - manager/media/browser/mcpuk/lang/da.php | 4 +- manager/media/browser/mcpuk/lang/de.php | 2 - manager/media/browser/mcpuk/lang/el.php | 2 - manager/media/browser/mcpuk/lang/en.php | 2 - manager/media/browser/mcpuk/lang/es.php | 2 - manager/media/browser/mcpuk/lang/et.php | 2 - manager/media/browser/mcpuk/lang/fa.php | 2 - manager/media/browser/mcpuk/lang/fi.php | 2 - manager/media/browser/mcpuk/lang/fr.php | 2 - manager/media/browser/mcpuk/lang/he.php | 2 - manager/media/browser/mcpuk/lang/hu.php | 2 - manager/media/browser/mcpuk/lang/id.php | 2 - manager/media/browser/mcpuk/lang/it.php | 2 - manager/media/browser/mcpuk/lang/ja.php | 2 - manager/media/browser/mcpuk/lang/lt.php | 2 - manager/media/browser/mcpuk/lang/nl.php | 2 - manager/media/browser/mcpuk/lang/no.php | 2 - manager/media/browser/mcpuk/lang/pl.php | 2 - manager/media/browser/mcpuk/lang/pt-br.php | 2 - manager/media/browser/mcpuk/lang/pt.php | 2 - manager/media/browser/mcpuk/lang/ro.php | 2 - manager/media/browser/mcpuk/lang/ru.php | 2 - manager/media/browser/mcpuk/lang/sk.php | 2 - manager/media/browser/mcpuk/lang/sv.php | 2 - manager/media/browser/mcpuk/lang/tr.php | 2 - manager/media/browser/mcpuk/lang/uk.php | 6 +- manager/media/browser/mcpuk/lang/vi.php | 2 - manager/media/browser/mcpuk/lang/zh-cn.php | 2 - .../browser/mcpuk/lib/class_fastImage.php | 426 +++-- manager/media/browser/mcpuk/lib/class_gd.php | 353 +++-- .../media/browser/mcpuk/lib/class_image.php | 270 ++-- .../browser/mcpuk/lib/class_image_gd.php | 197 ++- .../browser/mcpuk/lib/class_image_gmagick.php | 112 +- .../browser/mcpuk/lib/class_image_imagick.php | 112 +- .../media/browser/mcpuk/lib/class_input.php | 23 +- .../browser/mcpuk/lib/class_zipFolder.php | 20 +- .../media/browser/mcpuk/lib/helper_dir.php | 106 +- .../media/browser/mcpuk/lib/helper_file.php | 112 +- .../browser/mcpuk/lib/helper_httpCache.php | 86 +- .../media/browser/mcpuk/lib/helper_path.php | 100 +- .../media/browser/mcpuk/lib/helper_text.php | 45 +- .../media/browser/mcpuk/tpl/tpl_browser.php | 4 +- manager/media/browser/mcpuk/tpl/tpl_css.php | 2 +- .../browser/mcpuk/tpl/tpl_javascript.php | 24 +- manager/media/calendar/datepicker.inc.php | 20 +- .../script/air-datepicker/datepicker.inc.php | 30 +- .../common/moo-datepicker/datepicker.inc.php | 16 +- manager/media/style/default/ajax.php | 19 +- manager/media/style/default/style.php | 242 +-- manager/media/style/default/welcome.php | 14 +- .../processors/access_groups.processor.php | 196 +-- .../processors/cache_sync.class.processor.php | 19 +- .../processors/delete_category.processor.php | 4 +- .../processors/delete_content.processor.php | 48 +- .../processors/delete_eventlog.processor.php | 18 +- .../delete_htmlsnippet.processor.php | 22 +- .../processors/delete_message.processor.php | 2 +- .../processors/delete_module.processor.php | 22 +- .../processors/delete_plugin.processor.php | 22 +- manager/processors/delete_role.processor.php | 18 +- .../processors/delete_snippet.processor.php | 22 +- .../processors/delete_template.processor.php | 40 +- .../processors/delete_tmplvars.processor.php | 40 +- manager/processors/delete_user.processor.php | 34 +- .../processors/delete_web_user.processor.php | 30 +- .../duplicate_content.processor.php | 225 +-- .../duplicate_htmlsnippet.processor.php | 31 +- .../processors/duplicate_module.processor.php | 86 +- .../processors/duplicate_plugin.processor.php | 49 +- .../duplicate_snippet.processor.php | 33 +- .../duplicate_template.processor.php | 43 +- .../duplicate_tmplvars.processor.php | 65 +- manager/processors/empty_table.processor.php | 6 +- .../processors/execute_module.processor.php | 141 +- manager/processors/export_site.processor.php | 32 +- manager/processors/login.processor.php | 418 ++--- manager/processors/logout.processor.php | 18 +- .../processors/move_document.processor.php | 157 +- .../processors/optimize_table.processor.php | 36 +- .../processors/publish_content.processor.php | 44 +- manager/processors/purge_plugin.processor.php | 17 +- .../processors/remove_content.processor.php | 40 +- .../processors/remove_installer.processor.php | 42 +- manager/processors/remove_locks.processor.php | 38 +- manager/processors/save_content.processor.php | 110 +- .../processors/save_htmlsnippet.processor.php | 2 +- manager/processors/save_module.processor.php | 2 +- .../processors/save_password.processor.php | 36 +- manager/processors/save_plugin.processor.php | 23 +- manager/processors/save_role.processor.php | 220 +-- .../processors/save_settings.processor.php | 233 ++- manager/processors/save_snippet.processor.php | 2 +- .../processors/save_template.processor.php | 2 +- .../processors/save_tmplvars.processor.php | 7 +- manager/processors/save_user.processor.php | 764 ++++----- .../processors/save_web_user.processor.php | 597 +++---- manager/processors/send_message.processor.php | 104 +- .../processors/undelete_content.processor.php | 78 +- .../unpublish_content.processor.php | 44 +- .../user_documents_permissions.class.php | 1 - .../web_access_groups.processor.php | 196 +-- 228 files changed, 11722 insertions(+), 11499 deletions(-) diff --git a/index.php b/index.php index 5322472776..3d2e2beef2 100644 --- a/index.php +++ b/index.php @@ -1,42 +1,42 @@ stopOnNotice = false; // Don't show PHP errors to the public -if(!isset($_SESSION['mgrValidated']) || !$_SESSION['mgrValidated']) { - @ini_set("display_errors","0"); +if (!isset($_SESSION['mgrValidated']) || !$_SESSION['mgrValidated']) { + @ini_set("display_errors", "0"); } -if(MODX_CLI){ +if (MODX_CLI) { @set_time_limit(0); - @ini_set('max_execution_time',0); + @ini_set('max_execution_time', 0); } // execute the parser if index.php was not included diff --git a/manager/actions/access_permissions.dynamic.php b/manager/actions/access_permissions.dynamic.php index 0450f6ad9a..a354a2e9fc 100755 --- a/manager/actions/access_permissions.dynamic.php +++ b/manager/actions/access_permissions.dynamic.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR


      Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('access_permissions')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('access_permissions')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // Get table names (alphabetical) @@ -17,25 +17,25 @@ // find all document groups, for the select :) $rs = $modx->db->select('*', $tbl_documentgroup_names, '', 'name'); -if($modx->db->getRecordCount($rs) < 1) { - $docgroupselector = '[no groups to add]'; +if ($modx->db->getRecordCount($rs) < 1) { + $docgroupselector = '[no groups to add]'; } else { - $docgroupselector = '\n"; + $docgroupselector = '\n"; } $rs = $modx->db->select('*', $tbl_membergroup_names, '', 'name'); -if($modx->db->getRecordCount($rs) < 1) { - $usrgroupselector = '[no user groups]'; +if ($modx->db->getRecordCount($rs) < 1) { + $usrgroupselector = '[no user groups]'; } else { - $usrgroupselector = '\n"; + $usrgroupselector = '\n"; } ?> @@ -96,24 +96,23 @@ function deletegroup(groupid, type) { db->select('groupnames.*, users.id AS user_id, users.username user_name', $tbl_membergroup_names . ' AS groupnames + $rs = $modx->db->select('groupnames.*, users.id AS user_id, users.username user_name', $tbl_membergroup_names . ' AS groupnames LEFT JOIN ' . $tbl_member_groups . ' AS groups ON groups.user_group = groupnames.id LEFT JOIN ' . $tbl_manager_users . ' AS users ON users.id = groups.member', '', 'groupnames.name, user_name'); - if($modx->db->getRecordCount($rs) < 1) { - ?> + if ($modx->db->getRecordCount($rs) < 1) { + ?>
      + } else { + ?>
      db->getRow($rs)) { - if($pid != $row['id']) { - if($pid != '') { - echo '
      '; - } - ?> + $pid = ''; + while ($row = $modx->db->getRow($rs)) { + if ($pid != $row['id']) { + if ($pid != '') { + echo '
      '; + } ?>
      @@ -128,21 +127,20 @@ function deletegroup(groupid, type) {
      + } + if (!$row['user_id']) { + ?> + $pid = $row['id']; + continue; + } ?> + $pid = $row['id']; + } + } + ?>
      @@ -167,24 +165,23 @@ function deletegroup(groupid, type) { db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $tbl_documentgroup_names . ' AS dgnames + $rs = $modx->db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $tbl_documentgroup_names . ' AS dgnames LEFT JOIN ' . $tbl_document_groups . ' AS dg ON dg.document_group = dgnames.id LEFT JOIN ' . $tbl_site_content . ' AS sc ON sc.id = dg.document', '', 'dgnames.name, sc.id'); - if($modx->db->getRecordCount($rs) < 1) { - ?> + if ($modx->db->getRecordCount($rs) < 1) { + ?>
      + } else { + ?>
      db->getRow($rs)) { - if($pid != $row['id']) { - if($pid != '') { - echo '
      '; - } - ?> + $pid = ''; + while ($row = $modx->db->getRow($rs)) { + if ($pid != $row['id']) { + if ($pid != '') { + echo '
      '; + } ?>
      @@ -199,21 +196,20 @@ function deletegroup(groupid, type) {
      + } + if (!$row['doc_id']) { + ?> + $pid = $row['id']; + continue; + } ?> + $pid = $row['id']; + } + } + ?>
      @@ -225,16 +221,16 @@ function deletegroup(groupid, type) {

      db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $tbl_membergroup_names . ' AS groupnames + // User/Document Group Links + $rs = $modx->db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $tbl_membergroup_names . ' AS groupnames LEFT JOIN ' . $tbl_membergroup_access . ' AS groupacc ON groupacc.membergroup = groupnames.id LEFT JOIN ' . $tbl_documentgroup_names . ' AS dgnames ON dgnames.id = groupacc.documentgroup', '', 'name, dg_name'); - if($modx->db->getRecordCount($rs) < 1) { - ?> + if ($modx->db->getRecordCount($rs) < 1) { + ?>
      + } else { + ?>
      @@ -250,38 +246,35 @@ function deletegroup(groupid, type) {
        db->getRow($rs)) { - if($row['id'] != $pid) { - if($pid != '') { - echo '
      '; - } // close previous one - ?> + $pid = ''; + while ($row = $modx->db->getRow($rs)) { + if ($row['id'] != $pid) { + if ($pid != '') { + echo '

    '; + } // close previous one ?>
  • ' . $_lang['no_groups_found'] . ''; - $pid = ''; - continue; - } else { - echo '
      '; - } - } - if(!$row['dg_id']) { - continue; - } - ?> + if (!$row['dg_id']) { + echo '' . $_lang['no_groups_found'] . ''; + $pid = ''; + continue; + } else { + echo '
        '; + } + } + if (!$row['dg_id']) { + continue; + } ?>
      • ()
      • + $pid = $row['id']; + } ?>
      + } + ?> diff --git a/manager/actions/bkmanager.static.php b/manager/actions/bkmanager.static.php index 6927c17d53..64b910ac50 100755 --- a/manager/actions/bkmanager.static.php +++ b/manager/actions/bkmanager.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR


      Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('bk_manager')) { @@ -274,10 +274,12 @@ function showhide(a) - 0) { ?> + 0) { + ?>

      - + @@ -423,34 +425,33 @@ function checked($cond) nicesize(filesize($file)); - - $file = fopen($file, "r"); - $count = 0; - $details = array(); - while ($count < 11) { - $line = fgets($file); - foreach ($detailFields as $label) { - $fileLabel = '# ' . $label; - if (strpos($line, $fileLabel) !== false) { - $details[$label] = htmlentities(trim(str_replace(array( + while ($file = array_shift($files)) { + $filename = substr($file, strrpos($file, '/') + 1); + $filesize = $modx->nicesize(filesize($file)); + + $file = fopen($file, "r"); + $count = 0; + $details = array(); + while ($count < 11) { + $line = fgets($file); + foreach ($detailFields as $label) { + $fileLabel = '# ' . $label; + if (strpos($line, $fileLabel) !== false) { + $details[$label] = htmlentities(trim(str_replace(array( $fileLabel, ':', '`' ), '', $line)), ENT_QUOTES, $modx_manager_charset); - } - } - $count++; - }; - fclose($file); - - $tooltip = "Generation Time: " . $details["Generation Time"] . "\n"; - $tooltip .= "Server version: " . $details["Server version"] . "\n"; - $tooltip .= "PHP Version: " . $details["PHP Version"] . "\n"; - $tooltip .= "Host: " . $details["Host"] . "\n"; - ?> + } + } + $count++; + }; + fclose($file); + + $tooltip = "Generation Time: " . $details["Generation Time"] . "\n"; + $tooltip .= "Server version: " . $details["Server version"] . "\n"; + $tooltip .= "PHP Version: " . $details["PHP Version"] . "\n"; + $tooltip .= "Host: " . $details["Host"] . "\n"; ?> @@ -461,8 +462,7 @@ function checked($cond) + } ?> @@ -623,7 +623,9 @@ public function createDump($callBack) $insertdump = $lf; $insertdump .= "INSERT INTO `{$tblval}` VALUES ("; $arr = $this->object2Array($row); - if( ! is_array($arr)) $arr = array(); + if (! is_array($arr)) { + $arr = array(); + } foreach ($arr as $key => $value) { if (is_null($value)) { $value = 'NULL'; @@ -734,7 +736,8 @@ public function object2Array($obj) */ function import_sql($source, $result_code = 'import_ok') { - $modx = evolutionCMS(); global $e; + $modx = evolutionCMS(); + global $e; $rs = null; if ($modx->getLockedElements() !== array()) { diff --git a/manager/actions/category_mgr/inc/Module_Categories_Manager.php b/manager/actions/category_mgr/inc/Module_Categories_Manager.php index ef43029465..e5a5e7628b 100755 --- a/manager/actions/category_mgr/inc/Module_Categories_Manager.php +++ b/manager/actions/category_mgr/inc/Module_Categories_Manager.php @@ -118,7 +118,6 @@ public function renderView($view_name, $data = array()) */ public function updateElement($element, $element_id, $category_id) { - $_update = array( 'id' => (int)$element_id, 'category' => (int)$category_id diff --git a/manager/actions/category_mgr/inc/request_trigger.inc.php b/manager/actions/category_mgr/inc/request_trigger.inc.php index d95f86fd55..d8bda1eb62 100755 --- a/manager/actions/category_mgr/inc/request_trigger.inc.php +++ b/manager/actions/category_mgr/inc/request_trigger.inc.php @@ -2,36 +2,32 @@ /** * Ajax Requests */ -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { die("INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); } -if( isset( $_REQUEST[$cm->get('request_key')]['ajax'] ) ) -{ +if (isset($_REQUEST[$cm->get('request_key')]['ajax'])) { $_data = $_REQUEST[$cm->get('request_key')]; $output = ''; $task = $_data['task']; - switch( $task ) - { + switch ($task) { /** * get categories */ case 'categorize_load_elements': $elements = $_data['elements']; - if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) ) - { - $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements); + if ($uncategorized_elements = $cm->getAssignedElements(0, $_data['elements'])) { + $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements); } - foreach( $cm->getCategories() as $category ) - { - $category['elements'] = $cm->getAssignedElements( $category['id'], $_data['elements'] ); + foreach ($cm->getCategories() as $category) { + $category['elements'] = $cm->getAssignedElements($category['id'], $_data['elements']); $output .= $cm->renderView('chunks/categorize/category', $category); } break; } - exit( $output ); + exit($output); } /** * Categorize elements @@ -41,8 +37,7 @@ * @see http://modxcms.com/forums/index.php/topic,40430.msg251476.html#msg251476 * */ -if( isset( $_POST[$cm->get('request_key')]['categorize']['submit'] ) ) -{ +if (isset($_POST[$cm->get('request_key')]['categorize']['submit'])) { $_data = $_POST[$cm->get('request_key')]['categorize']; $_changes = 0; @@ -54,16 +49,13 @@ 'categorize' ); - if( !isset( $_data['elements'] ) ) - { - $cm->addMessage( $cm->txt('cm_unknown_error'), 'categorize' ); + if (!isset($_data['elements'])) { + $cm->addMessage($cm->txt('cm_unknown_error'), 'categorize'); return; } - foreach( $_data['elements'] as $element_id => $data ) - { - if( $cm->updateElement( $_data['elementsgroup'], $element_id, $data['category_id'] ) ) - { + foreach ($_data['elements'] as $element_id => $data) { + if ($cm->updateElement($_data['elementsgroup'], $element_id, $data['category_id'])) { $cm->addMessage( sprintf( $cm->txt('cm_x_assigned_to_category_y'), @@ -78,13 +70,10 @@ } } - if( $_changes === 0 ) - { - $cm->addMessage( $cm->txt('cm_no_categorization'), 'categorize' ); + if ($_changes === 0) { + $cm->addMessage($cm->txt('cm_no_categorization'), 'categorize'); return; - } - else - { + } else { $cm->addMessage( sprintf( $cm->txt('cm_x_changes_made'), @@ -98,58 +87,49 @@ /** * Add a new category */ -if( isset( $_POST[$cm->get('request_key')]['add']['submit'] ) ) -{ +if (isset($_POST[$cm->get('request_key')]['add']['submit'])) { $_data = $_POST[$cm->get('request_key')]['add']['data']; - $category = trim( html_entity_decode($_data['name']) ); + $category = trim(html_entity_decode($_data['name'])); $rank = (int) $_data['rank']; - if( empty( $category ) ) - { - $cm->addMessage( $cm->txt('cm_enter_name_for_category'), 'add' ); - return; + if (empty($category)) { + $cm->addMessage($cm->txt('cm_enter_name_for_category'), 'add'); + return; } - if( $cm->isCategoryExists( $category ) ) - { - $cm->addMessage( sprintf( $cm->txt('cm_category_x_exists'), $category ), 'add' ); - return; + if ($cm->isCategoryExists($category)) { + $cm->addMessage(sprintf($cm->txt('cm_category_x_exists'), $category), 'add'); + return; } - if( $cm->addCategory( $category, $rank ) !== 0 ) - { + if ($cm->addCategory($category, $rank) !== 0) { $cm->addMessage( sprintf( - $cm->txt( 'cm_category_x_saved_at_position_y' ), + $cm->txt('cm_category_x_saved_at_position_y'), $category, $rank ), 'add' ); - } - else - { - $cm->addMessage( $cm->txt('cm_unknown_error'), 'add' ); + } else { + $cm->addMessage($cm->txt('cm_unknown_error'), 'add'); } } /** * Sort categories */ -if( isset( $_POST[$cm->get('request_key')]['sort']['submit'] ) ) -{ +if (isset($_POST[$cm->get('request_key')]['sort']['submit'])) { $categories = $_POST[$cm->get('request_key')]['sort']['data']; $_changes = 0; - foreach( $categories as $category_id => $_data ) - { + foreach ($categories as $category_id => $_data) { $data = array( - 'category' => urldecode( $_data['category'] ), + 'category' => urldecode($_data['category']), 'rank' => $_data['rank'] ); - if( $cm->updateCategory( $category_id, $data ) ) - { + if ($cm->updateCategory($category_id, $data)) { $cm->addMessage( sprintf( $cm->txt('cm_category_x_moved_to_position_y'), @@ -162,12 +142,9 @@ } } - if( $_changes === 0 ) - { - $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'sort'); - } - else - { + if ($_changes === 0) { + $cm->addMessage($cm->txt('cm_no_changes'), 'sort'); + } else { $cm->addMessage( sprintf( $cm->txt('cm_x_changes_made'), @@ -181,21 +158,17 @@ /** * Edit categories */ -if( isset( $_POST[$cm->get('request_key')]['edit']['submit'] ) ) -{ +if (isset($_POST[$cm->get('request_key')]['edit']['submit'])) { $categories = $_POST[$cm->get('request_key')]['edit']['data']; $_changes = 0; - foreach( $categories as $category_id => $_data ) - { - if( isset( $_data['delete'] ) ) - { - if( $cm->deleteCategory( $category_id ) ) - { + foreach ($categories as $category_id => $_data) { + if (isset($_data['delete'])) { + if ($cm->deleteCategory($category_id)) { $cm->addMessage( sprintf( $cm->txt('cm_category_x_deleted'), - urldecode( $_data['origin'] ) + urldecode($_data['origin']) ), 'edit' ); @@ -205,16 +178,15 @@ } $data = array( - 'category' => trim( html_entity_decode( $_data['category'] ) ), + 'category' => trim(html_entity_decode($_data['category'])), 'rank' => $_data['rank'] ); - if( $cm->updateCategory( $category_id, $data ) ) - { + if ($cm->updateCategory($category_id, $data)) { $cm->addMessage( sprintf( $cm->txt('cm_category_x_renamed_to_y'), - urldecode( $_data['origin'] ), + urldecode($_data['origin']), $data['category'] ), 'edit' @@ -223,26 +195,23 @@ } } - if( $_changes === 0 ) - { - $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'edit'); + if ($_changes === 0) { + $cm->addMessage($cm->txt('cm_no_changes'), 'edit'); } } /** * Delete singel category by $_GET */ -if( isset( $_GET[$cm->get('request_key')]['delete'] ) - && !empty( $_GET[$cm->get('request_key')]['delete'] ) ) -{ +if (isset($_GET[$cm->get('request_key')]['delete']) + && !empty($_GET[$cm->get('request_key')]['delete'])) { $category_id = (int)$_GET[$cm->get('request_key')]['delete']; - if( $cm->deleteCategory( $category_id ) ) - { + if ($cm->deleteCategory($category_id)) { $cm->addMessage( sprintf( $cm->txt('cm_category_x_deleted'), - urldecode( $_GET[$cm->get('request_key')]['category'] ) + urldecode($_GET[$cm->get('request_key')]['category']) ), 'edit' ); @@ -251,16 +220,13 @@ /** * Translate phrases */ -if( isset( $_POST[$cm->get('request_key')]['translate']['submit'] ) ) -{ +if (isset($_POST[$cm->get('request_key')]['translate']['submit'])) { $translations = $_POST[$cm->get('request_key')]['translate']['data']; - foreach( $translations as $native_phrase => $translation ) - { - $native_phrase = urldecode( $native_phrase ); + foreach ($translations as $native_phrase => $translation) { + $native_phrase = urldecode($native_phrase); - if( empty( $translation ) ) - { + if (empty($translation)) { $translation = $native_phrase; $cm->addMessage( @@ -272,7 +238,7 @@ ); } - $cm->c('Translator')->addTranslation( $native_phrase, $translation, 'phrase' ); + $cm->c('Translator')->addTranslation($native_phrase, $translation, 'phrase'); $cm->addMessage( sprintf( diff --git a/manager/actions/document_data.static.php b/manager/actions/document_data.static.php index 84b7e291ee..c11565e2ab 100755 --- a/manager/actions/document_data.static.php +++ b/manager/actions/document_data.static.php @@ -1,16 +1,16 @@ INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); } -if(isset($_REQUEST['id'])) { - $id = (int) $_REQUEST['id']; +if (isset($_REQUEST['id'])) { + $id = (int) $_REQUEST['id']; } else { - $id = 0; + $id = 0; } -if(isset($_GET['opened'])) { - $_SESSION['openedArray'] = $_GET['opened']; +if (isset($_GET['opened'])) { + $_SESSION['openedArray'] = $_GET['opened']; } $url = $modx->config['site_url']; @@ -22,26 +22,26 @@ $tbl_site_templates = $modx->getFullTableName('site_templates'); // Get access permissions -if($_SESSION['mgrDocgroups']) { - $docgrp = implode(",", $_SESSION['mgrDocgroups']); +if ($_SESSION['mgrDocgroups']) { + $docgrp = implode(",", $_SESSION['mgrDocgroups']); } $access = "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0" . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); // -if($_SESSION['tree_show_only_folders']) { - $parent = $id ? ($modx->db->getValue("SELECT parent FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1")) : 0; - $isfolder = $modx->db->getValue("SELECT isfolder FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1"); - if(!$isfolder && $parent != 0) { - $id = $_REQUEST['id'] = $parent; - } +if ($_SESSION['tree_show_only_folders']) { + $parent = $id ? ($modx->db->getValue("SELECT parent FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1")) : 0; + $isfolder = $modx->db->getValue("SELECT isfolder FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1"); + if (!$isfolder && $parent != 0) { + $id = $_REQUEST['id'] = $parent; + } } // Get the document content $rs = $modx->db->select('DISTINCT sc.*', "{$tbl_site_content} AS sc LEFT JOIN {$tbl_document_groups} AS dg ON dg.document = sc.id", "sc.id ='{$id}' AND ({$access})"); $content = $modx->db->getRow($rs); -if(!$content) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); +if (!$content) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); } /** @@ -84,135 +84,134 @@ ); $filter_sort = ''; $filter_dir = ''; -if($numRecords > 0) { - $filter_sort = ''; - $filter_dir = ''; - $resource = $modx->db->makeArray($rs); - - // CSS style for table - // $tableClass = 'grid'; - // $rowHeaderClass = 'gridHeader'; - // $rowRegularClass = 'gridItem'; - // $rowAlternateClass = 'gridAltItem'; - $tableClass = 'table data nowrap'; - $columnHeaderClass = array( - 'text-center', - 'text-left', - 'text-center', - 'text-center', - 'text-center', - 'text-center' - ); - - - $modx->table->setTableClass($tableClass); - $modx->table->setColumnHeaderClass($columnHeaderClass); - // $modx->table->setRowHeaderClass($rowHeaderClass); - // $modx->table->setRowRegularClass($rowRegularClass); - // $modx->table->setRowAlternateClass($rowAlternateClass); - - // Table header - $listTableHeader = array( - 'docid' => $_lang['id'], - 'title' => $_lang['resource_title'], - 'createdon' => $_lang['createdon'], - 'pub_date' => $_lang['page_data_publishdate'], - 'status' => $_lang['page_data_status'], - 'edit' => $_lang['mgrlog_action'], - ); - $tbWidth = array( - '1%', - '', - '1%', - '1%', - '1%', - '1%' - ); - $modx->table->setColumnWidths($tbWidth); - - $sd = isset($_REQUEST['dir']) ? '&dir=' . $_REQUEST['dir'] : '&dir=DESC'; - $sb = isset($_REQUEST['sort']) ? '&sort=' . $_REQUEST['sort'] : '&sort=createdon'; - $pg = isset($_REQUEST['page']) ? '&page=' . (int) $_REQUEST['page'] : ''; - $add_path = $sd . $sb . $pg; - - $icons = array( - 'text/html' => $_style['tree_page_html'], - 'text/plain' => $_style['tree_page'], - 'text/xml' => $_style['tree_page_xml'], - 'text/css' => $_style['tree_page_css'], - 'text/javascript' => $_style['tree_page_js'], - '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'], - 'image/gif' => $_style['tree_page_gif'], - 'image/jpg' => $_style['tree_page_jpg'], - 'image/png' => $_style['tree_page_png'] - ); - - $listDocs = array(); - foreach($resource as $k => $children) { - - switch($children['id']) { - case $modx->config['site_start'] : - $icon = $_style['tree_page_home']; - break; - case $modx->config['error_page'] : - $icon = $_style['tree_page_404']; - break; - case $modx->config['site_unavailable_page'] : - $icon = $_style['tree_page_hourglass']; - break; - case $modx->config['unauthorized_page'] : - $icon = $_style['tree_page_info']; - break; - default: - if($children['isfolder']) { - $icon = $_style['tree_folder_new']; - } else { - if(isset($icons[$children['contentType']])) { - $icon = $icons[$children['contentType']]; - } else { - $icon = $_style['tree_page']; - } - } - } - - $private = ($children['privateweb'] || $children['privatemgr'] ? ' private' : ''); - - // дописываем в заголовок класс для неопубликованных плюс по всем ссылкам обратный путь - // для сохранения сортировки - $class = ($children['deleted'] ? 'text-danger text-decoration-through' : (!$children['published'] ? ' font-italic text-muted' : ' publish')); - //$class .= ($children['hidemenu'] ? ' text-muted' : ' text-primary'); - //$class .= ($children['isfolder'] ? ' font-weight-bold' : ''); - if($modx->hasPermission('edit_document')) { - $title = '' . $icon . '' . '' . $children['pagetitle'] . ''; - } else { - $title = '' . $icon . '' . $children['pagetitle'] . ''; - } - - $icon_pub_unpub = (!$children['published']) ? '' : ''; - - $icon_del_undel = (!$children['deleted']) ? '' : ''; - - $listDocs[] = array( - 'docid' => '
      ' . $children['id'] . '
      ', - 'title' => $title, - 'createdon' => '
      ' . ($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')) . '
      ', - 'pub_date' => '
      ' . ($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '') . '
      ', - 'status' => '
      ' . ($children['published'] == 0 ? '' . $_lang['page_data_unpublished'] . '' : '' . $_lang['page_data_published'] . '') . '
      ', - 'edit' => '
      ' . ($modx->hasPermission('edit_document') ? ' 0) { + $filter_sort = ''; + $filter_dir = ''; + $resource = $modx->db->makeArray($rs); + + // CSS style for table + // $tableClass = 'grid'; + // $rowHeaderClass = 'gridHeader'; + // $rowRegularClass = 'gridItem'; + // $rowAlternateClass = 'gridAltItem'; + $tableClass = 'table data nowrap'; + $columnHeaderClass = array( + 'text-center', + 'text-left', + 'text-center', + 'text-center', + 'text-center', + 'text-center' + ); + + + $modx->table->setTableClass($tableClass); + $modx->table->setColumnHeaderClass($columnHeaderClass); + // $modx->table->setRowHeaderClass($rowHeaderClass); + // $modx->table->setRowRegularClass($rowRegularClass); + // $modx->table->setRowAlternateClass($rowAlternateClass); + + // Table header + $listTableHeader = array( + 'docid' => $_lang['id'], + 'title' => $_lang['resource_title'], + 'createdon' => $_lang['createdon'], + 'pub_date' => $_lang['page_data_publishdate'], + 'status' => $_lang['page_data_status'], + 'edit' => $_lang['mgrlog_action'], + ); + $tbWidth = array( + '1%', + '', + '1%', + '1%', + '1%', + '1%' + ); + $modx->table->setColumnWidths($tbWidth); + + $sd = isset($_REQUEST['dir']) ? '&dir=' . $_REQUEST['dir'] : '&dir=DESC'; + $sb = isset($_REQUEST['sort']) ? '&sort=' . $_REQUEST['sort'] : '&sort=createdon'; + $pg = isset($_REQUEST['page']) ? '&page=' . (int) $_REQUEST['page'] : ''; + $add_path = $sd . $sb . $pg; + + $icons = array( + 'text/html' => $_style['tree_page_html'], + 'text/plain' => $_style['tree_page'], + 'text/xml' => $_style['tree_page_xml'], + 'text/css' => $_style['tree_page_css'], + 'text/javascript' => $_style['tree_page_js'], + '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'], + 'image/gif' => $_style['tree_page_gif'], + 'image/jpg' => $_style['tree_page_jpg'], + 'image/png' => $_style['tree_page_png'] + ); + + $listDocs = array(); + foreach ($resource as $k => $children) { + switch ($children['id']) { + case $modx->config['site_start']: + $icon = $_style['tree_page_home']; + break; + case $modx->config['error_page']: + $icon = $_style['tree_page_404']; + break; + case $modx->config['site_unavailable_page']: + $icon = $_style['tree_page_hourglass']; + break; + case $modx->config['unauthorized_page']: + $icon = $_style['tree_page_info']; + break; + default: + if ($children['isfolder']) { + $icon = $_style['tree_folder_new']; + } else { + if (isset($icons[$children['contentType']])) { + $icon = $icons[$children['contentType']]; + } else { + $icon = $_style['tree_page']; + } + } + } + + $private = ($children['privateweb'] || $children['privatemgr'] ? ' private' : ''); + + // дописываем в заголовок класс для неопубликованных плюс по всем ссылкам обратный путь + // для сохранения сортировки + $class = ($children['deleted'] ? 'text-danger text-decoration-through' : (!$children['published'] ? ' font-italic text-muted' : ' publish')); + //$class .= ($children['hidemenu'] ? ' text-muted' : ' text-primary'); + //$class .= ($children['isfolder'] ? ' font-weight-bold' : ''); + if ($modx->hasPermission('edit_document')) { + $title = '' . $icon . '' . '' . $children['pagetitle'] . ''; + } else { + $title = '' . $icon . '' . $children['pagetitle'] . ''; + } + + $icon_pub_unpub = (!$children['published']) ? '' : ''; + + $icon_del_undel = (!$children['deleted']) ? '' : ''; + + $listDocs[] = array( + 'docid' => '
      ' . $children['id'] . '
      ', + 'title' => $title, + 'createdon' => '
      ' . ($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')) . '
      ', + 'pub_date' => '
      ' . ($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '') . '
      ', + 'status' => '
      ' . ($children['published'] == 0 ? '' . $_lang['page_data_unpublished'] . '' : '' . $_lang['page_data_published'] . '') . '
      ', + 'edit' => '
      ' . ($modx->hasPermission('edit_document') ? '' . $icon_pub_unpub : '') . ($modx->hasPermission('delete_document') ? $icon_del_undel : '') . '
      ' - ); - } + ); + } - $modx->table->createPagingNavigation($numRecords, 'a=3&id=' . $content['id'] . '&dir=' . $dir . '&sort=' . $sort); - $children_output = $modx->table->create($listDocs, $listTableHeader, 'index.php?a=3&id=' . $content['id']); + $modx->table->createPagingNavigation($numRecords, 'a=3&id=' . $content['id'] . '&dir=' . $dir . '&sort=' . $sort); + $children_output = $modx->table->create($listDocs, $listTableHeader, 'index.php?a=3&id=' . $content['id']); } else { - // No Child documents - $children_output = '

      ' . $_lang['resources_in_container_no'] . '

      '; + // No Child documents + $children_output = '

      ' . $_lang['resources_in_container_no'] . '

      '; } ?>
      - 0) : ?> + 0) : ?>
      ()
      @@ -407,40 +408,43 @@ class="' . $_style["icons_move_document"] . '">
      ' . $icon_pub_unpub : '')
      - config['cache_type'] != 2) { ?> + config['cache_type'] != 2) { + ?>

      config['base_path'] . "assets/cache/docid_" . $id . ".pageCache.php"; - $handle = @fopen($filename, "r"); - if(!$handle) { - $buffer = '
      ' . $_lang['page_data_notcached'] . '
      '; - } else { - while(!feof($handle)) { - $buffer .= fgets($handle, 4096); - } - fclose($handle); - $buffer = '
      \n"; - } - echo $buffer; - ?> + $buffer = ""; + $filename = $modx->config['base_path'] . "assets/cache/docid_" . $id . ".pageCache.php"; + $handle = @fopen($filename, "r"); + if (!$handle) { + $buffer = '
      ' . $_lang['page_data_notcached'] . '
      '; + } else { + while (!feof($handle)) { + $buffer .= fgets($handle, 4096); + } + fclose($handle); + $buffer = '
      \n"; + } + echo $buffer; ?>
      - +
      docSettings.setSelectedIndex( ' . $_GET['tab'] . ' );'; -} +if (isset($_GET['tab']) && is_numeric($_GET['tab'])) { + echo ''; + } ?> - +
      -INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('view_eventlog')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('view_eventlog')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // Get table Names (alphabetical) @@ -15,15 +15,15 @@ $modx->manager->initPageViewState(); // get and save search string -if($_REQUEST['op'] == 'reset') { - $sqlQuery = $query = ''; - $_PAGE['vs']['search'] = ''; +if ($_REQUEST['op'] == 'reset') { + $sqlQuery = $query = ''; + $_PAGE['vs']['search'] = ''; } else { - $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; - if(!is_numeric($sqlQuery)) { - $sqlQuery = $modx->db->escape($query); - } - $_PAGE['vs']['search'] = $query; + $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; + if (!is_numeric($sqlQuery)) { + $sqlQuery = $modx->db->escape($query); + } + $_PAGE['vs']['search'] = $query; } // get & save listmode @@ -125,33 +125,33 @@ function menuAction(a) {
      db->select("el.id, ELT(el.type , 'text-info {$_style['actions_info']}' , 'text-warning {$_style['actions_triangle']}' , 'text-danger {$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el + $ds = $modx->db->select("el.id, ELT(el.type , 'text-info {$_style['actions_info']}' , 'text-warning {$_style['actions_triangle']}' , 'text-danger {$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el LEFT JOIN {$tbl_manager_users} AS mu ON mu.id=el.user AND el.usertype=0 LEFT JOIN {$tbl_web_users} AS wu ON wu.id=el.user AND el.usertype=1", ($sqlQuery ? "" . (is_numeric($sqlQuery) ? "(eventid='{$sqlQuery}') OR " : '') . "(source LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "createdon DESC"); - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items - $grd->pagerClass = ''; - $grd->pageClass = 'page-item'; - $grd->selPageClass = 'page-item active'; - $grd->noRecordMsg = $_lang['no_records_found']; - $grd->cssClass = "table data nowrap"; - $grd->columnHeaderClass = "tableHeader"; - $grd->itemClass = "tableItem"; - $grd->altItemClass = "tableAltItem"; - $grd->fields = "type,source,createdon,eventid,username"; - $grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid']; - $grd->colWidths = "1%,,1%,1%,1%"; - $grd->colAligns = "center,,,center,center"; - $grd->colTypes = "template:||template:[+source+]||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p'; - if($listmode == '1') { - $grd->pageSize = 0; - } - if($_REQUEST['op'] == 'reset') { - $grd->pageNumber = 1; - } - // render grid - echo $grd->render(); - ?> + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items + $grd->pagerClass = ''; + $grd->pageClass = 'page-item'; + $grd->selPageClass = 'page-item active'; + $grd->noRecordMsg = $_lang['no_records_found']; + $grd->cssClass = "table data nowrap"; + $grd->columnHeaderClass = "tableHeader"; + $grd->itemClass = "tableItem"; + $grd->altItemClass = "tableAltItem"; + $grd->fields = "type,source,createdon,eventid,username"; + $grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid']; + $grd->colWidths = "1%,,1%,1%,1%"; + $grd->colAligns = "center,,,center,center"; + $grd->colTypes = "template:||template:[+source+]||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p'; + if ($listmode == '1') { + $grd->pageSize = 0; + } + if ($_REQUEST['op'] == 'reset') { + $grd->pageNumber = 1; + } + // render grid + echo $grd->render(); + ?>
      diff --git a/manager/actions/eventlog_details.dynamic.php b/manager/actions/eventlog_details.dynamic.php index d72e0c394c..7270f330ab 100755 --- a/manager/actions/eventlog_details.dynamic.php +++ b/manager/actions/eventlog_details.dynamic.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('view_eventlog')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('view_eventlog')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // get id @@ -41,18 +41,18 @@
      toDateFormat($content["createdon"]); - if($content["type"] == 1) { - $icon = $_style['actions_info'] . ' text-info'; - $msgtype = $_lang["information"]; - } else if($content["type"] == 2) { - $icon = $_style['actions_triangle'] . ' text-warning'; - $msgtype = $_lang["warning"]; - } else if($content["type"] == 3) { - $icon = $_style['actions_error'] . ' text-danger'; - $msgtype = $_lang["error"]; - } - ?> + $date = $modx->toDateFormat($content["createdon"]); + if ($content["type"] == 1) { + $icon = $_style['actions_info'] . ' text-info'; + $msgtype = $_lang["information"]; + } elseif ($content["type"] == 2) { + $icon = $_style['actions_triangle'] . ' text-warning'; + $msgtype = $_lang["warning"]; + } elseif ($content["type"] == 3) { + $icon = $_style['actions_error'] . ' text-danger'; + $msgtype = $_lang["error"]; + } + ?>

      diff --git a/manager/actions/export_site.static.php b/manager/actions/export_site.static.php index 878cad704f..cbb83cb9f2 100755 --- a/manager/actions/export_site.static.php +++ b/manager/actions/export_site.static.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('export_static')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('export_static')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // figure out the base of the server, so we know where to get the documents in order to export them @@ -35,11 +35,11 @@

      + if (isset($_POST['export'])) { + $rs = include_once(MODX_MANAGER_PATH . 'processors/export_site.processor.php'); + echo $rs; + } else { + ?>
      @@ -76,13 +76,13 @@ ">
      + } + ?>
      diff --git a/manager/actions/files.dynamic.php b/manager/actions/files.dynamic.php index 0b9bae5166..3d6cd1c866 100755 --- a/manager/actions/files.dynamic.php +++ b/manager/actions/files.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('file_manager')) { @@ -407,7 +407,7 @@ function renameFile (file) if (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newDirname) !== 0) { echo $_lang['files.dynamic.php3']; - } else if (!rename($dirname, $_REQUEST['path'] . '/' . $newDirname)) { + } elseif (!rename($dirname, $_REQUEST['path'] . '/' . $newDirname)) { echo '', $_lang['file_folder_not_created'], '

      '; } umask($old_umask); @@ -482,8 +482,7 @@ function renameFile (file) + @ini_set("upload_max_filesize", $upload_maxsize); // modified by raymond ?>
      @@ -491,8 +490,8 @@ function renameFile (file) + echo $information; + } ?>
      @@ -517,13 +516,12 @@ function renameFile (file) webAlertAndQuit("Error opening file for reading."); - } - ?> + $buffer = file_get_contents($filename); + // Log the change + logFileChange('view', $filename); + if ($buffer === false) { + $modx->webAlertAndQuit("Error opening file for reading."); + } ?> @@ -566,7 +564,6 @@ function renameFile (file) if (is_array($evtOut)) { echo implode('', $evtOut); } - } /** @@ -849,7 +846,7 @@ function unzip($file, $path) $complete_name = $path . str_replace('\\', '/', $zip_entry_name); if (!file_exists($complete_path)) { $tmp = ''; - foreach (explode('/', $complete_path) AS $k) { + foreach (explode('/', $complete_path) as $k) { $tmp .= $k . '/'; if (!is_dir($tmp)) { mkdir($tmp, 0777); @@ -890,10 +887,13 @@ function rrmdir($dir) */ function fileupload() { - $modx = evolutionCMS(); global $_lang, $startpath, $filemanager_path, $uploadablefiles, $new_file_permissions; + $modx = evolutionCMS(); + global $_lang, $startpath, $filemanager_path, $uploadablefiles, $new_file_permissions; $msg = ''; foreach ($_FILES['userfile']['name'] as $i => $name) { - if (empty($_FILES['userfile']['tmp_name'][$i])) continue; + if (empty($_FILES['userfile']['tmp_name'][$i])) { + continue; + } $userfile= array(); $userfile['tmp_name'] = $_FILES['userfile']['tmp_name'][$i]; diff --git a/manager/actions/help.static.php b/manager/actions/help.static.php index 1978dc5f54..c46668939a 100755 --- a/manager/actions/help.static.php +++ b/manager/actions/help.static.php @@ -1,6 +1,6 @@ INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); } $helpBasePath = "actions/help/"; ?> @@ -16,36 +16,35 @@ $v) { - - $helpname = substr($v, 0, strrpos($v, '.')); - - $prefix = substr($helpname, 0, 2); - if(is_numeric($prefix)) { - $helpname = substr($helpname, 2, strlen($helpname) - 1); - } - - $hnLower = strtolower($helpname); - $helpname = isset($_lang[$hnLower]) ? $_lang[$hnLower] : str_replace('_', ' ', $helpname); - - echo '
      '; - echo '

      ' . $helpname . '

      '; - echo ''; - include_once($helpBasePath . "{$v}"); - echo '
      '; - } - ?> + if ($handle = opendir('actions/help')) { + while (false !== ($file = readdir($handle))) { + if ($file != "." && $file != ".." && $file != ".svn" && $file != 'index.html' && !is_dir($helpBasePath . $file)) { + $help[] = $file; + } + } + closedir($handle); + } + + natcasesort($help); + + foreach ($help as $k => $v) { + $helpname = substr($v, 0, strrpos($v, '.')); + + $prefix = substr($helpname, 0, 2); + if (is_numeric($prefix)) { + $helpname = substr($helpname, 2, strlen($helpname) - 1); + } + + $hnLower = strtolower($helpname); + $helpname = isset($_lang[$hnLower]) ? $_lang[$hnLower] : str_replace('_', ' ', $helpname); + + echo '
      '; + echo '

      ' . $helpname . '

      '; + echo ''; + include_once($helpBasePath . "{$v}"); + echo '
      '; + } + ?>
      + } + ?> @@ -104,65 +102,67 @@ function setParent(pId, pName) { /** * @return string */ -function run() { - $modx = evolutionCMS(); global $_lang; +function run() +{ + $modx = evolutionCMS(); + global $_lang; - $tbl_site_content = $modx->getFullTableName('site_content'); - $output = ''; - $maxtime = $_POST['maxtime']; + $tbl_site_content = $modx->getFullTableName('site_content'); + $output = ''; + $maxtime = $_POST['maxtime']; - if(!is_numeric($maxtime)) { - $maxtime = 30; - } + if (!is_numeric($maxtime)) { + $maxtime = 30; + } - @set_time_limit($maxtime); + @set_time_limit($maxtime); - $mtime = microtime(); - $mtime = explode(' ', $mtime); - $mtime = $mtime[1] + $mtime[0]; - $importstart = $mtime; + $mtime = microtime(); + $mtime = explode(' ', $mtime); + $mtime = $mtime[1] + $mtime[0]; + $importstart = $mtime; - if($_POST['reset'] == 'on') { - $modx->db->truncate($tbl_site_content); - $modx->db->query("ALTER TABLE {$tbl_site_content} AUTO_INCREMENT = 1"); - } + if ($_POST['reset'] == 'on') { + $modx->db->truncate($tbl_site_content); + $modx->db->query("ALTER TABLE {$tbl_site_content} AUTO_INCREMENT = 1"); + } - $parent = (int)$_POST['parent']; + $parent = (int)$_POST['parent']; - if(is_dir(MODX_BASE_PATH . 'temp/import')) { - $filedir = MODX_BASE_PATH . 'temp/import/'; - } elseif(is_dir(MODX_BASE_PATH . 'assets/import')) { - $filedir = MODX_BASE_PATH . 'assets/import/'; - } else { + if (is_dir(MODX_BASE_PATH . 'temp/import')) { + $filedir = MODX_BASE_PATH . 'temp/import/'; + } elseif (is_dir(MODX_BASE_PATH . 'assets/import')) { + $filedir = MODX_BASE_PATH . 'assets/import/'; + } else { $filedir = ''; } - $filesfound = 0; + $filesfound = 0; - $files = getFiles($filedir); - $files = pop_index($files); + $files = getFiles($filedir); + $files = pop_index($files); - // no. of files to import - $output .= sprintf('

      ' . $_lang['import_files_found'] . '

      ', $filesfound); + // no. of files to import + $output .= sprintf('

      ' . $_lang['import_files_found'] . '

      ', $filesfound); - // import files - if(0 < count($files)) { - $modx->db->update(array('isfolder' => 1), $tbl_site_content, "id='{$parent}'"); - importFiles($parent, $filedir, $files, 'root'); - } + // import files + if (0 < count($files)) { + $modx->db->update(array('isfolder' => 1), $tbl_site_content, "id='{$parent}'"); + importFiles($parent, $filedir, $files, 'root'); + } - $mtime = microtime(); - $mtime = explode(' ', $mtime); - $mtime = $mtime[1] + $mtime[0]; - $importend = $mtime; - $totaltime = ($importend - $importstart); - $output .= sprintf('

      ' . $_lang['import_site_time'] . '

      ', round($totaltime, 3)); + $mtime = microtime(); + $mtime = explode(' ', $mtime); + $mtime = $mtime[1] + $mtime[0]; + $importend = $mtime; + $totaltime = ($importend - $importstart); + $output .= sprintf('

      ' . $_lang['import_site_time'] . '

      ', round($totaltime, 3)); - if($_POST['convert_link'] == 'on') { - convertLink(); - } + if ($_POST['convert_link'] == 'on') { + convertLink(); + } - return $output; + return $output; } /** @@ -171,145 +171,146 @@ function run() { * @param array $files * @param string $mode */ -function importFiles($parent, $filedir, $files, $mode) { - $modx = evolutionCMS(); - global $_lang, $allowedfiles; - global $search_default, $cache_default, $publish_default; - - $tbl_site_content = $modx->getFullTableName('site_content'); - $tbl_system_settings = $modx->getFullTableName('system_settings'); - - $createdby = $modx->getLoginUserID(); - if(!is_array($files)) { - return; - } - if($_POST['object'] === 'all') { - $modx->config['default_template'] = '0'; - $richtext = '0'; - } else { - $richtext = '1'; - } - - foreach($files as $id => $value) { - if(is_array($value)) { - // create folder - $alias = $id; - printf('' . $_lang['import_site_importing_document'] . '', $alias); - $field = array(); - $field['type'] = 'document'; - $field['contentType'] = 'text/html'; - $field['published'] = $publish_default; - $field['parent'] = $parent; - $field['alias'] = $modx->stripAlias($alias); - $field['richtext'] = $richtext; - $field['template'] = $modx->config['default_template']; - $field['searchable'] = $search_default; - $field['cacheable'] = $cache_default; - $field['createdby'] = $createdby; - $field['isfolder'] = 1; - $field['menuindex'] = 1; - $find = false; - foreach(array( - 'index.html', - 'index.htm' - ) as $filename) { - $filepath = $filedir . $alias . '/' . $filename; - if($find === false && file_exists($filepath)) { - $file = getFileContent($filepath); - list($pagetitle, $content, $description) = treatContent($file, $filename, $alias); - - $date = filemtime($filepath); - $field['pagetitle'] = $pagetitle; - $field['longtitle'] = $pagetitle; - $field['description'] = $description; - $field['content'] = $modx->db->escape($content); - $field['createdon'] = $date; - $field['editedon'] = $date; - $newid = $modx->db->insert($field, $tbl_site_content); - if($newid) { - $find = true; - echo ' - ' . $_lang['import_site_success'] . '
      ' . "\n"; - importFiles($newid, $filedir . $alias . '/', $value, 'sub'); - } else { - echo '' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError(); - exit; - } - } - } - if($find === false) { - $date = time(); - $field['pagetitle'] = '---'; - $field['content'] = ''; - $field['createdon'] = $date; - $field['editedon'] = $date; - $field['hidemenu'] = '1'; - $newid = $modx->db->insert($field, $tbl_site_content); - if($newid) { - $find = true; - echo ' - ' . $_lang['import_site_success'] . '
      ' . "\n"; - importFiles($newid, $filedir . $alias . '/', $value, 'sub'); - } else { - echo '' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError(); - exit; - } - } - } else { - // create document - if($mode == 'sub' && $value == 'index.html') { - continue; - } - $filename = $value; - $fparts = explode('.', $value); - $alias = $fparts[0]; - $ext = (count($fparts) > 1) ? $fparts[count($fparts) - 1] : ""; - printf("" . $_lang['import_site_importing_document'] . "", $filename); - - if(!in_array($ext, $allowedfiles)) { - echo ' - ' . $_lang["import_site_skip"] . '
      ' . "\n"; - } else { - $filepath = $filedir . $filename; - $file = getFileContent($filepath); - list($pagetitle, $content, $description) = treatContent($file, $filename, $alias); - - $date = filemtime($filepath); - $field = array(); - $field['type'] = 'document'; - $field['contentType'] = 'text/html'; - $field['pagetitle'] = $pagetitle; - $field['longtitle'] = $pagetitle; - $field['description'] = $description; - $field['alias'] = $modx->stripAlias($alias); - $field['published'] = $publish_default; - $field['parent'] = $parent; - $field['content'] = $modx->db->escape($content); - $field['richtext'] = $richtext; - $field['template'] = $modx->config['default_template']; - $field['searchable'] = $search_default; - $field['cacheable'] = $cache_default; - $field['createdby'] = $createdby; - $field['createdon'] = $date; - $field['editedon'] = $date; - $field['isfolder'] = 0; - $field['menuindex'] = ($alias == 'index') ? 0 : 2; - $newid = $modx->db->insert($field, $tbl_site_content); - if($newid) { - echo ' - ' . $_lang['import_site_success'] . '
      ' . "\n"; - } else { - echo '' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError(); - exit; - } - - $is_site_start = false; - if($filename == 'index.html') { - $is_site_start = true; - } - if($is_site_start == true && $_POST['reset'] == 'on') { - $modx->db->update(array('setting_value' => $newid), $tbl_system_settings, "setting_name='site_start'"); - $modx->db->update(array('menuindex' => 0), $tbl_site_content, "id='{$newid}'"); - } - } - } - } +function importFiles($parent, $filedir, $files, $mode) +{ + $modx = evolutionCMS(); + global $_lang, $allowedfiles; + global $search_default, $cache_default, $publish_default; + + $tbl_site_content = $modx->getFullTableName('site_content'); + $tbl_system_settings = $modx->getFullTableName('system_settings'); + + $createdby = $modx->getLoginUserID(); + if (!is_array($files)) { + return; + } + if ($_POST['object'] === 'all') { + $modx->config['default_template'] = '0'; + $richtext = '0'; + } else { + $richtext = '1'; + } + + foreach ($files as $id => $value) { + if (is_array($value)) { + // create folder + $alias = $id; + printf('' . $_lang['import_site_importing_document'] . '', $alias); + $field = array(); + $field['type'] = 'document'; + $field['contentType'] = 'text/html'; + $field['published'] = $publish_default; + $field['parent'] = $parent; + $field['alias'] = $modx->stripAlias($alias); + $field['richtext'] = $richtext; + $field['template'] = $modx->config['default_template']; + $field['searchable'] = $search_default; + $field['cacheable'] = $cache_default; + $field['createdby'] = $createdby; + $field['isfolder'] = 1; + $field['menuindex'] = 1; + $find = false; + foreach (array( + 'index.html', + 'index.htm' + ) as $filename) { + $filepath = $filedir . $alias . '/' . $filename; + if ($find === false && file_exists($filepath)) { + $file = getFileContent($filepath); + list($pagetitle, $content, $description) = treatContent($file, $filename, $alias); + + $date = filemtime($filepath); + $field['pagetitle'] = $pagetitle; + $field['longtitle'] = $pagetitle; + $field['description'] = $description; + $field['content'] = $modx->db->escape($content); + $field['createdon'] = $date; + $field['editedon'] = $date; + $newid = $modx->db->insert($field, $tbl_site_content); + if ($newid) { + $find = true; + echo ' - ' . $_lang['import_site_success'] . '
      ' . "\n"; + importFiles($newid, $filedir . $alias . '/', $value, 'sub'); + } else { + echo '' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError(); + exit; + } + } + } + if ($find === false) { + $date = time(); + $field['pagetitle'] = '---'; + $field['content'] = ''; + $field['createdon'] = $date; + $field['editedon'] = $date; + $field['hidemenu'] = '1'; + $newid = $modx->db->insert($field, $tbl_site_content); + if ($newid) { + $find = true; + echo ' - ' . $_lang['import_site_success'] . '
      ' . "\n"; + importFiles($newid, $filedir . $alias . '/', $value, 'sub'); + } else { + echo '' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError(); + exit; + } + } + } else { + // create document + if ($mode == 'sub' && $value == 'index.html') { + continue; + } + $filename = $value; + $fparts = explode('.', $value); + $alias = $fparts[0]; + $ext = (count($fparts) > 1) ? $fparts[count($fparts) - 1] : ""; + printf("" . $_lang['import_site_importing_document'] . "", $filename); + + if (!in_array($ext, $allowedfiles)) { + echo ' - ' . $_lang["import_site_skip"] . '
      ' . "\n"; + } else { + $filepath = $filedir . $filename; + $file = getFileContent($filepath); + list($pagetitle, $content, $description) = treatContent($file, $filename, $alias); + + $date = filemtime($filepath); + $field = array(); + $field['type'] = 'document'; + $field['contentType'] = 'text/html'; + $field['pagetitle'] = $pagetitle; + $field['longtitle'] = $pagetitle; + $field['description'] = $description; + $field['alias'] = $modx->stripAlias($alias); + $field['published'] = $publish_default; + $field['parent'] = $parent; + $field['content'] = $modx->db->escape($content); + $field['richtext'] = $richtext; + $field['template'] = $modx->config['default_template']; + $field['searchable'] = $search_default; + $field['cacheable'] = $cache_default; + $field['createdby'] = $createdby; + $field['createdon'] = $date; + $field['editedon'] = $date; + $field['isfolder'] = 0; + $field['menuindex'] = ($alias == 'index') ? 0 : 2; + $newid = $modx->db->insert($field, $tbl_site_content); + if ($newid) { + echo ' - ' . $_lang['import_site_success'] . '
      ' . "\n"; + } else { + echo '' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError(); + exit; + } + + $is_site_start = false; + if ($filename == 'index.html') { + $is_site_start = true; + } + if ($is_site_start == true && $_POST['reset'] == 'on') { + $modx->db->update(array('setting_value' => $newid), $tbl_system_settings, "setting_name='site_start'"); + $modx->db->update(array('menuindex' => 0), $tbl_site_content, "id='{$newid}'"); + } + } + } + } } /** @@ -318,63 +319,66 @@ function importFiles($parent, $filedir, $files, $mode) { * @param int $count * @return array */ -function getFiles($directory, $listing = array(), $count = 0) { - global $_lang; - global $filesfound; - $dummy = $count; - if( ! empty($directory) && $files = scandir($directory)) { - foreach($files as $file) { - if($file == '.' || $file == '..') { - continue; - } elseif($h = @opendir($directory . $file . "/")) { - closedir($h); - $count = -1; - $listing[$file] = getFiles($directory . $file . "/", array(), $count + 1); - } elseif(strpos($file, '.htm') !== false) { - $listing[$dummy] = $file; - $dummy = $dummy + 1; - $filesfound++; - } - } - } else { - echo '

      ' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_no_open_dir"] . $directory . ".

      "; - } - return ($listing); +function getFiles($directory, $listing = array(), $count = 0) +{ + global $_lang; + global $filesfound; + $dummy = $count; + if (! empty($directory) && $files = scandir($directory)) { + foreach ($files as $file) { + if ($file == '.' || $file == '..') { + continue; + } elseif ($h = @opendir($directory . $file . "/")) { + closedir($h); + $count = -1; + $listing[$file] = getFiles($directory . $file . "/", array(), $count + 1); + } elseif (strpos($file, '.htm') !== false) { + $listing[$dummy] = $file; + $dummy = $dummy + 1; + $filesfound++; + } + } + } else { + echo '

      ' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_no_open_dir"] . $directory . ".

      "; + } + return ($listing); } /** * @param string $filepath * @return bool|string */ -function getFileContent($filepath) { - global $_lang; - // get the file - if(!$buffer = file_get_contents($filepath)) { - echo '

      ' . $_lang['import_site_failed'] . " " . $_lang["import_site_failed_no_retrieve_file"] . $filepath . ".

      "; - } else { - return $buffer; - } +function getFileContent($filepath) +{ + global $_lang; + // get the file + if (!$buffer = file_get_contents($filepath)) { + echo '

      ' . $_lang['import_site_failed'] . " " . $_lang["import_site_failed_no_retrieve_file"] . $filepath . ".

      "; + } else { + return $buffer; + } } /** * @param array $array * @return array */ -function pop_index($array) { - $new_array = array(); - foreach($array as $k => $v) { - if($v !== 'index.html' && $v !== 'index.htm') { - $new_array[$k] = $v; - } else { - array_unshift($new_array, $v); - } - } - foreach($array as $k => $v) { - if(is_array($v)) { - $new_array[$k] = $v; - } - } - return $new_array; +function pop_index($array) +{ + $new_array = array(); + foreach ($array as $k => $v) { + if ($v !== 'index.html' && $v !== 'index.htm') { + $new_array[$k] = $v; + } else { + array_unshift($new_array, $v); + } + } + foreach ($array as $k => $v) { + if (is_array($v)) { + $new_array[$k] = $v; + } + } + return $new_array; } /** @@ -383,109 +387,111 @@ function pop_index($array) { * @param string $alias * @return array */ -function treatContent($src, $filename, $alias) { - $modx = evolutionCMS(); - - $src = mb_convert_encoding($src, $modx->config['modx_charset'], 'UTF-8,SJIS-win,eucJP-win,SJIS,EUC-JP,ASCII'); - - if(preg_match("@(.*)@i", $src, $matches)) { - $pagetitle = ($matches[1] !== '') ? $matches[1] : $filename; - $pagetitle = str_replace('[*pagetitle*]', '', $pagetitle); - } else { - $pagetitle = $alias; - } - if(!$pagetitle) { - $pagetitle = $alias; - } - - if(preg_match('@]+"description"[^>]+content=[\'"](.*)[\'"].+>@i', $src, $matches)) { - $description = ($matches[1] !== '') ? $matches[1] : $filename; - $description = str_replace('[*description*]', '', $description); - } else { - $description = ''; - } - - if((preg_match("@]*>(.*)[^<]+@is", $src, $matches)) && $_POST['object'] == 'body') { - $content = $matches[1]; - } else { - $content = $src; - $s = '/(]+charset\s*=)[^>"\'=]+(.+>)/i'; - $r = '$1' . $modx->config['modx_charset'] . '$2'; - $content = preg_replace($s, $r, $content); - $content = preg_replace('@.*@i', "[*pagetitle*]", $content); - } - $content = str_replace('[*content*]', '[ *content* ]', $content); - $content = trim($content); - $pagetitle = $modx->db->escape($pagetitle); - return array( - $pagetitle, - $content, - $description - ); +function treatContent($src, $filename, $alias) +{ + $modx = evolutionCMS(); + + $src = mb_convert_encoding($src, $modx->config['modx_charset'], 'UTF-8,SJIS-win,eucJP-win,SJIS,EUC-JP,ASCII'); + + if (preg_match("@(.*)@i", $src, $matches)) { + $pagetitle = ($matches[1] !== '') ? $matches[1] : $filename; + $pagetitle = str_replace('[*pagetitle*]', '', $pagetitle); + } else { + $pagetitle = $alias; + } + if (!$pagetitle) { + $pagetitle = $alias; + } + + if (preg_match('@]+"description"[^>]+content=[\'"](.*)[\'"].+>@i', $src, $matches)) { + $description = ($matches[1] !== '') ? $matches[1] : $filename; + $description = str_replace('[*description*]', '', $description); + } else { + $description = ''; + } + + if ((preg_match("@]*>(.*)[^<]+@is", $src, $matches)) && $_POST['object'] == 'body') { + $content = $matches[1]; + } else { + $content = $src; + $s = '/(]+charset\s*=)[^>"\'=]+(.+>)/i'; + $r = '$1' . $modx->config['modx_charset'] . '$2'; + $content = preg_replace($s, $r, $content); + $content = preg_replace('@.*@i', "[*pagetitle*]", $content); + } + $content = str_replace('[*content*]', '[ *content* ]', $content); + $content = trim($content); + $pagetitle = $modx->db->escape($pagetitle); + return array( + $pagetitle, + $content, + $description + ); } /** * @return void */ -function convertLink() { - $modx = evolutionCMS(); - $tbl_site_content = $modx->getFullTableName('site_content'); +function convertLink() +{ + $modx = evolutionCMS(); + $tbl_site_content = $modx->getFullTableName('site_content'); - $rs = $modx->db->select('id,content', $tbl_site_content); - $p = array(); + $rs = $modx->db->select('id,content', $tbl_site_content); + $p = array(); $target = array(); - $dir = ''; - while($row = $modx->db->getRow($rs)) { - $id = $row['id']; - $array = explode('config['site_url']) !== false) { - $_ = $modx->config['base_url'] . str_replace($modx->config['site_url'], '', $_); - } - if($_[0] === '/') { - $_ = substr($_, 1); - } - $_ = str_replace('/index.html', '.html', $_); - $level = substr_count($_, '../'); - if(1 < $level) { - if(!isset($p[$id])) { - $p[$id] = $modx->getParentIds($id); - } - $k = array_keys($p[$id]); - while(0 < $level) { - $dir = array_shift($k); - $level--; - } - if($dir != '') { - $dir .= '/'; - } - } else { - $dir = ''; - } - - $_ = trim($_, './'); - if(strpos($_, '/') !== false) { - $_ = substr($_, strrpos($_, '/')); - } - $_ = $dir . str_replace('.html', '', $_); - if(!isset($target[$_])) { - $target[$_] = $modx->getIdFromAlias($_); - } - $target[$_] = trim($target[$_]); - if(!empty($target[$_])) { - $href = '[~' . $target[$_] . '~]'; - } - $array[$c] = 'db->escape($content); - $modx->db->update($f, $tbl_site_content, "id='{$id}'"); - } + $dir = ''; + while ($row = $modx->db->getRow($rs)) { + $id = $row['id']; + $array = explode('config['site_url']) !== false) { + $_ = $modx->config['base_url'] . str_replace($modx->config['site_url'], '', $_); + } + if ($_[0] === '/') { + $_ = substr($_, 1); + } + $_ = str_replace('/index.html', '.html', $_); + $level = substr_count($_, '../'); + if (1 < $level) { + if (!isset($p[$id])) { + $p[$id] = $modx->getParentIds($id); + } + $k = array_keys($p[$id]); + while (0 < $level) { + $dir = array_shift($k); + $level--; + } + if ($dir != '') { + $dir .= '/'; + } + } else { + $dir = ''; + } + + $_ = trim($_, './'); + if (strpos($_, '/') !== false) { + $_ = substr($_, strrpos($_, '/')); + } + $_ = $dir . str_replace('.html', '', $_); + if (!isset($target[$_])) { + $target[$_] = $modx->getIdFromAlias($_); + } + $target[$_] = trim($target[$_]); + if (!empty($target[$_])) { + $href = '[~' . $target[$_] . '~]'; + } + $array[$c] = 'db->escape($content); + $modx->db->update($f, $tbl_site_content, "id='{$id}'"); + } } diff --git a/manager/actions/logging.static.php b/manager/actions/logging.static.php index 26f678b7ad..e763c659e7 100755 --- a/manager/actions/logging.static.php +++ b/manager/actions/logging.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('logs')) { @@ -183,83 +183,83 @@ function record_sort($array, $key) db->escape($_REQUEST['itemname']) . "'"; - } - if ($_REQUEST['message'] != "") { - $sqladd[] = "message LIKE '%" . $modx->db->escape($_REQUEST['message']) . "%'"; - } - // date stuff - if ($_REQUEST['datefrom'] != "") { - $sqladd[] = "timestamp>" . $modx->toTimeStamp($_REQUEST['datefrom']); - } - if ($_REQUEST['dateto'] != "") { - $sqladd[] = "timestamp<" . $modx->toTimeStamp($_REQUEST['dateto']); - } + // get the selections the user made. + $sqladd = array(); + if ($_REQUEST['searchuser'] != 0) { + $sqladd[] = "internalKey='" . (int)$_REQUEST['searchuser'] . "'"; + } + if ($_REQUEST['action'] != 0) { + $sqladd[] = "action=" . (int)$_REQUEST['action']; + } + if ($_REQUEST['itemid'] != 0 || $_REQUEST['itemid'] == "-") { + $sqladd[] = "itemid='" . $_REQUEST['itemid'] . "'"; + } + if ($_REQUEST['itemname'] != '0') { + $sqladd[] = "itemname='" . $modx->db->escape($_REQUEST['itemname']) . "'"; + } + if ($_REQUEST['message'] != "") { + $sqladd[] = "message LIKE '%" . $modx->db->escape($_REQUEST['message']) . "%'"; + } + // date stuff + if ($_REQUEST['datefrom'] != "") { + $sqladd[] = "timestamp>" . $modx->toTimeStamp($_REQUEST['datefrom']); + } + if ($_REQUEST['dateto'] != "") { + $sqladd[] = "timestamp<" . $modx->toTimeStamp($_REQUEST['dateto']); + } - // If current position is not set, set it to zero - if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) { - $int_cur_position = 0; - } else { - $int_cur_position = $_REQUEST['int_cur_position']; - } + // If current position is not set, set it to zero + if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) { + $int_cur_position = 0; + } else { + $int_cur_position = $_REQUEST['int_cur_position']; + } - // Number of result to display on the page, will be in the LIMIT of the sql query also - $int_num_result = is_numeric($_REQUEST['nrresults']) ? $_REQUEST['nrresults'] : $number_of_logs; + // Number of result to display on the page, will be in the LIMIT of the sql query also + $int_num_result = is_numeric($_REQUEST['nrresults']) ? $_REQUEST['nrresults'] : $number_of_logs; - $extargv = "&a=13&searchuser=" . $_REQUEST['searchuser'] . "&action=" . $_REQUEST['action'] . "&itemid=" . $_REQUEST['itemid'] . "&itemname=" . $_REQUEST['itemname'] . "&message=" . $_REQUEST['message'] . "&dateto=" . $_REQUEST['dateto'] . "&datefrom=" . $_REQUEST['datefrom'] . "&nrresults=" . $int_num_result . "&log_submit=" . $_REQUEST['log_submit']; // extra argv here (could be anything depending on your page) + $extargv = "&a=13&searchuser=" . $_REQUEST['searchuser'] . "&action=" . $_REQUEST['action'] . "&itemid=" . $_REQUEST['itemid'] . "&itemname=" . $_REQUEST['itemname'] . "&message=" . $_REQUEST['message'] . "&dateto=" . $_REQUEST['dateto'] . "&datefrom=" . $_REQUEST['datefrom'] . "&nrresults=" . $int_num_result . "&log_submit=" . $_REQUEST['log_submit']; // extra argv here (could be anything depending on your page) - // build the sql - $limit = $num_rows = $modx->db->getValue($modx->db->select('COUNT(*)', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''))); + // build the sql + $limit = $num_rows = $modx->db->getValue($modx->db->select('COUNT(*)', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''))); - $rs = $modx->db->select('*', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''), 'timestamp DESC, id DESC', "{$int_cur_position}, {$int_num_result}"); + $rs = $modx->db->select('*', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''), 'timestamp DESC, id DESC', "{$int_cur_position}, {$int_num_result}"); -if ($limit < 1) { - echo '

      ' . $_lang["mgrlog_emptysrch"] . '

      '; -} else { - echo '

      ' . $_lang["mgrlog_sortinst"] . '

      '; + if ($limit < 1) { + echo '

      ' . $_lang["mgrlog_emptysrch"] . '

      '; + } else { + echo '

      ' . $_lang["mgrlog_sortinst"] . '

      '; - include_once "paginate.inc.php"; - // New instance of the Paging class, you can modify the color and the width of the html table - $p = new Paging($num_rows, $int_cur_position, $int_num_result, $extargv); + include_once "paginate.inc.php"; + // New instance of the Paging class, you can modify the color and the width of the html table + $p = new Paging($num_rows, $int_cur_position, $int_num_result, $extargv); - // Load up the 2 array in order to display result - $array_paging = $p->getPagingArray(); - $array_row_paging = $p->getPagingRowArray(); - $current_row = $int_cur_position / $int_num_result; + // Load up the 2 array in order to display result + $array_paging = $p->getPagingArray(); + $array_row_paging = $p->getPagingRowArray(); + $current_row = $int_cur_position / $int_num_result; - // Display the result as you like... - print "

      " . $_lang["paging_showing"] . " " . $array_paging['lower']; - print " " . $_lang["paging_to"] . " " . $array_paging['upper']; - print " (" . $array_paging['total'] . " " . $_lang["paging_total"] . ")
      "; - $paging = $array_paging['first_link'] . $_lang["paging_first"] . (isset($array_paging['first_link']) ? "
      " : " "); - $paging .= $array_paging['previous_link'] . $_lang["paging_prev"] . (isset($array_paging['previous_link']) ? " " : " "); - $pagesfound = sizeof($array_row_paging); - if ($pagesfound > 6) { - $paging .= $array_row_paging[$current_row - 2]; // ." "; + // Display the result as you like... + print "

      " . $_lang["paging_showing"] . " " . $array_paging['lower']; + print " " . $_lang["paging_to"] . " " . $array_paging['upper']; + print " (" . $array_paging['total'] . " " . $_lang["paging_total"] . ")
      "; + $paging = $array_paging['first_link'] . $_lang["paging_first"] . (isset($array_paging['first_link']) ? " " : " "); + $paging .= $array_paging['previous_link'] . $_lang["paging_prev"] . (isset($array_paging['previous_link']) ? " " : " "); + $pagesfound = sizeof($array_row_paging); + if ($pagesfound > 6) { + $paging .= $array_row_paging[$current_row - 2]; // ." "; $paging .= $array_row_paging[$current_row - 1]; // ." "; $paging .= $array_row_paging[$current_row]; // ." "; $paging .= $array_row_paging[$current_row + 1]; // ." "; $paging .= $array_row_paging[$current_row + 2]; // ." "; - } else { - for ($i = 0; $i < $pagesfound; $i++) { - $paging .= $array_row_paging[$i] . " "; - } - } - $paging .= $array_paging['next_link'] . $_lang["paging_next"] . (isset($array_paging['next_link']) ? " " : " ") . " "; - $paging .= $array_paging['last_link'] . $_lang["paging_last"] . (isset($array_paging['last_link']) ? " " : " ") . " "; - // The above exemple print somethings like: + } else { + for ($i = 0; $i < $pagesfound; $i++) { + $paging .= $array_row_paging[$i] . " "; + } + } + $paging .= $array_paging['next_link'] . $_lang["paging_next"] . (isset($array_paging['next_link']) ? " " : " ") . " "; + $paging .= $array_paging['last_link'] . $_lang["paging_last"] . (isset($array_paging['last_link']) ? " " : " ") . " "; + // The above exemple print somethings like: // Results 1 to 20 of 597 <<< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 >>> // Of course you can now play with array_row_paging in order to print // only the results you would like... @@ -289,18 +289,17 @@ function record_sort($array, $key) db->getRow($rs)) { - if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) { - $item = '

      -
      '; - } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) { - $item = '' . $logentry['itemname'] . ''; - } else { - $item = $logentry['itemname']; - } - //index.php?a=13&searchuser=' . $logentry['internalKey'] . '&action=' . $logentry['action'] . '&itemname=' . $logentry['itemname'] . '&log_submit=true' - $user_drill = 'index.php?a=13&searchuser=' . $logentry['internalKey'] . '&itemname=0&log_submit=true'; - ?> + $i = 0; + while ($logentry = $modx->db->getRow($rs)) { + if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) { + $item = '
      -
      '; + } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) { + $item = '' . $logentry['itemname'] . ''; + } else { + $item = $logentry['itemname']; + } + //index.php?a=13&searchuser=' . $logentry['internalKey'] . '&action=' . $logentry['action'] . '&itemname=' . $logentry['itemname'] . '&log_submit=true' + $user_drill = 'index.php?a=13&searchuser=' . $logentry['internalKey'] . '&itemname=0&log_submit=true'; ?> ' . $logentry['username'] . '' ?> @@ -312,8 +311,7 @@ function record_sort($array, $key) + } ?> @@ -323,15 +321,14 @@ function record_sort($array, $key) + } ?> INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('messages')) { @@ -11,29 +11,29 @@ - +
      db->select('*', $modx->getFullTableName('user_messages'), "id='" . (int)$_REQUEST['id'] . "'"); - $message = $modx->db->getRow($rs); - if (!$message) { - echo "Wrong number of messages returned!"; + $message = $modx->db->getRow($rs); + if (!$message) { + echo "Wrong number of messages returned!"; + } else { + if ($message['recipient'] != $modx->getLoginUserID()) { + echo $_lang['messages_not_allowed_to_read']; + } else { + // output message! + // get the name of the sender + $sender = $message['sender']; + if ($sender == 0) { + $sendername = $_lang['messages_system_user']; } else { - if ($message['recipient'] != $modx->getLoginUserID()) { - echo $_lang['messages_not_allowed_to_read']; - } else { - // output message! - // get the name of the sender - $sender = $message['sender']; - if ($sender == 0) { - $sendername = $_lang['messages_system_user']; - } else { - $rs2 = $modx->db->select('username', $modx->getFullTableName('manager_users'), "id='{$sender}'"); - $sendername = $modx->db->getValue($rs2); - } - ?> + $rs2 = $modx->db->select('username', $modx->getFullTableName('manager_users'), "id='{$sender}'"); + $sendername = $modx->db->getValue($rs2); + } ?>
      @@ -63,24 +63,23 @@ ', $message['message']); - $dashcount = substr_count($message, '-----'); - $message = str_replace('-----', '', $message); - for ($i = 0; $i < $dashcount; $i++) { - $message .= ''; - } - ?> + $dashcount = substr_count($message, '-----'); + $message = str_replace('-----', '', $message); + for ($i = 0; $i < $dashcount; $i++) { + $message .= ''; + } ?>
      db->update(array('messageread' => 1), $modx->getFullTableName('user_messages'), "id='{$_REQUEST['id']}'"); - } - } - ?> + } + } ?>

      - +
      @@ -136,8 +135,7 @@ if ($limit < 1) { echo $_lang['messages_no_messages']; } else { - $dotablestuff = 1; - ?> + $dotablestuff = 1; ?>
      @@ -162,8 +160,7 @@ $rs2 = $modx->db->select('username', $modx->getFullTableName('manager_users'), "id='{$sender}'"); $sendername = $modx->db->getValue($rs2); } - $messagestyle = $message['messageread'] == 0 ? "text-primary" : ""; - ?> + $messagestyle = $message['messageread'] == 0 ? "text-primary" : ""; ?> ' : "" ?> @@ -172,13 +169,13 @@ toDateFormat($message['postdate'] + $server_offset_time) ?> + } ?>
      - +
      diff --git a/manager/actions/modules.static.php b/manager/actions/modules.static.php index a5257e8cfc..829941e32d 100755 --- a/manager/actions/modules.static.php +++ b/manager/actions/modules.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); } if (!($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('exec_module'))) { @@ -116,7 +116,7 @@ function menuAction(a) ORDER BY sm.name'); if ($modx->hasPermission('edit_module')) { $title = "[+value+]"; - } else if ($modx->hasPermission('exec_module')) { + } elseif ($modx->hasPermission('exec_module')) { $title = "[+value+]"; } else { $title = '[+value+]'; diff --git a/manager/actions/move_document.dynamic.php b/manager/actions/move_document.dynamic.php index 435f7b2625..5f9b6c0002 100755 --- a/manager/actions/move_document.dynamic.php +++ b/manager/actions/move_document.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_document')) { diff --git a/manager/actions/mutate_categories.dynamic.php b/manager/actions/mutate_categories.dynamic.php index f58cede882..f98e83a47c 100755 --- a/manager/actions/mutate_categories.dynamic.php +++ b/manager/actions/mutate_categories.dynamic.php @@ -1,46 +1,44 @@ INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('category_manager')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('category_manager')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $_module_params = array( - 'module_version' => '1.0.0', - 'module_params' => '', - 'module_id' => $_GET['id'], - 'package_name' => 'Module_Categories_Manager', - 'native_language' => 'de', - 'name' => 'Categories Manager', - 'dirname' => $site_manager_url, - 'url' => 'index.php?a=120&id=' . $_GET['id'], - 'path' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR, - 'inc_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR, - 'languages_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR, - 'views_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'skin' . DIRECTORY_SEPARATOR, - 'request_key' => 'module_categories_manager', - 'messages' => array() + 'module_version' => '1.0.0', + 'module_params' => '', + 'module_id' => $_GET['id'], + 'package_name' => 'Module_Categories_Manager', + 'native_language' => 'de', + 'name' => 'Categories Manager', + 'dirname' => $site_manager_url, + 'url' => 'index.php?a=120&id=' . $_GET['id'], + 'path' => realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR, + 'inc_dir' => realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR, + 'languages_dir' => realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR, + 'views_dir' => realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'skin' . DIRECTORY_SEPARATOR, + 'request_key' => 'module_categories_manager', + 'messages' => array() ); require_once $_module_params['inc_dir'] . 'Module_Categories_Manager.php'; $cm = new Module_Categories_Manager(); // assign module_params to internal params -foreach( $_module_params as $param => $value ) -{ - $cm->set( $param, $value ); +foreach ($_module_params as $param => $value) { + $cm->set($param, $value); } // catch the request actions include_once $cm->get('inc_dir') . 'request_trigger.inc.php'; -if( !$categories = $cm->getCategories() ) -{ - setcookie('webfxtab_manage-categories-pane', 0 ); - $cm->addMessage( $cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global' ); +if (!$categories = $cm->getCategories()) { + setcookie('webfxtab_manage-categories-pane', 0); + $cm->addMessage($cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global'); } -$cm->renderView('main', $categories ); +$cm->renderView('main', $categories); return; diff --git a/manager/actions/mutate_content.dynamic.php b/manager/actions/mutate_content.dynamic.php index 55c2714d57..8d9b770d32 100755 --- a/manager/actions/mutate_content.dynamic.php +++ b/manager/actions/mutate_content.dynamic.php @@ -1,6 +1,6 @@ INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

      Please use the EVO Content Manager instead of accessing this file directly."); } /********************/ @@ -11,31 +11,31 @@ /*******************/ // check permissions -switch($modx->manager->action) { - case 27: - if(!$modx->hasPermission('edit_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 85: - case 72: - case 4: - if(!$modx->hasPermission('new_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } elseif(isset($_REQUEST['pid']) && $_REQUEST['pid'] != '0') { - // check user has permissions for parent - include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php'); - $udperms = new udperms(); - $udperms->user = $modx->getLoginUserID(); - $udperms->document = empty($_REQUEST['pid']) ? 0 : $_REQUEST['pid']; - $udperms->role = $_SESSION['mgrRole']; - if(!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); - } - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +switch ($modx->manager->action) { + case 27: + if (!$modx->hasPermission('edit_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 85: + case 72: + case 4: + if (!$modx->hasPermission('new_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '0') { + // check user has permissions for parent + include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php'); + $udperms = new udperms(); + $udperms->user = $modx->getLoginUserID(); + $udperms->document = empty($_REQUEST['pid']) ? 0 : $_REQUEST['pid']; + $udperms->role = $_SESSION['mgrRole']; + if (!$udperms->checkPermissions()) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); + } + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; @@ -53,23 +53,23 @@ $tbl_site_tmplvar_templates = $modx->getFullTableName('site_tmplvar_templates'); $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); -if($modx->manager->action == 27) { - //editing an existing document - // check permissions on the document - include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php'); - $udperms = new udperms(); - $udperms->user = $modx->getLoginUserID(); - $udperms->document = $id; - $udperms->role = $_SESSION['mgrRole']; - - if(!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); - } +if ($modx->manager->action == 27) { + //editing an existing document + // check permissions on the document + include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php'); + $udperms = new udperms(); + $udperms->user = $modx->getLoginUserID(); + $udperms->document = $id; + $udperms->role = $_SESSION['mgrRole']; + + if (!$udperms->checkPermissions()) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); + } } // check to see if resource isn't locked -if($lockedEl = $modx->elementIsLocked(7, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['resource'])); +if ($lockedEl = $modx->elementIsLocked(7, $id)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['resource'])); } // end check for lock @@ -77,75 +77,75 @@ $modx->lockElement(7, $id); // get document groups for current user -if($_SESSION['mgrDocgroups']) { - $docgrp = implode(',', $_SESSION['mgrDocgroups']); +if ($_SESSION['mgrDocgroups']) { + $docgrp = implode(',', $_SESSION['mgrDocgroups']); } -if(!empty ($id)) { - $access = sprintf("1='%s' OR sc.privatemgr=0", $_SESSION['mgrRole']); - if($docgrp) { - $access .= " OR dg.document_group IN ({$docgrp})"; - } - $rs = $modx->db->select('sc.*', "{$tbl_site_content} AS sc LEFT JOIN {$tbl_document_groups} AS dg ON dg.document=sc.id", "sc.id='{$id}' AND ({$access})"); - $content = array(); - $content = $modx->db->getRow($rs); - $modx->documentObject = &$content; - if(!$content) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); - } - $_SESSION['itemname'] = $content['pagetitle']; +if (!empty($id)) { + $access = sprintf("1='%s' OR sc.privatemgr=0", $_SESSION['mgrRole']); + if ($docgrp) { + $access .= " OR dg.document_group IN ({$docgrp})"; + } + $rs = $modx->db->select('sc.*', "{$tbl_site_content} AS sc LEFT JOIN {$tbl_document_groups} AS dg ON dg.document=sc.id", "sc.id='{$id}' AND ({$access})"); + $content = array(); + $content = $modx->db->getRow($rs); + $modx->documentObject = &$content; + if (!$content) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); + } + $_SESSION['itemname'] = $content['pagetitle']; } else { - $content = array(); + $content = array(); - if(isset($_REQUEST['newtemplate'])) { - $content['template'] = $_REQUEST['newtemplate']; - } else { - $content['template'] = getDefaultTemplate(); - } + if (isset($_REQUEST['newtemplate'])) { + $content['template'] = $_REQUEST['newtemplate']; + } else { + $content['template'] = getDefaultTemplate(); + } - $_SESSION['itemname'] = $_lang["new_resource"]; + $_SESSION['itemname'] = $_lang["new_resource"]; } // restore saved form $formRestored = $modx->manager->loadFormValues(); -if(isset($_REQUEST['newtemplate'])) { - $formRestored = true; +if (isset($_REQUEST['newtemplate'])) { + $formRestored = true; } // retain form values if template was changed // edited to convert pub_date and unpub_date // sottwell 02-09-2006 -if($formRestored == true) { - $content = array_merge($content, $_POST); - $content['content'] = $_POST['ta']; - if(empty ($content['pub_date'])) { - unset ($content['pub_date']); - } else { - $content['pub_date'] = $modx->toTimeStamp($content['pub_date']); - } - if(empty ($content['unpub_date'])) { - unset ($content['unpub_date']); - } else { - $content['unpub_date'] = $modx->toTimeStamp($content['unpub_date']); - } +if ($formRestored == true) { + $content = array_merge($content, $_POST); + $content['content'] = $_POST['ta']; + if (empty($content['pub_date'])) { + unset($content['pub_date']); + } else { + $content['pub_date'] = $modx->toTimeStamp($content['pub_date']); + } + if (empty($content['unpub_date'])) { + unset($content['unpub_date']); + } else { + $content['unpub_date'] = $modx->toTimeStamp($content['unpub_date']); + } } // increase menu index if this is a new document -if(!isset ($_REQUEST['id'])) { - if(!isset ($modx->config['auto_menuindex'])) { - $modx->config['auto_menuindex'] = 1; - } - if($modx->config['auto_menuindex']) { - $pid = (int)$_REQUEST['pid']; - $rs = $modx->db->select('count(*)', $tbl_site_content, "parent='{$pid}'"); - $content['menuindex'] = $modx->db->getValue($rs); - } else { - $content['menuindex'] = 0; - } +if (!isset($_REQUEST['id'])) { + if (!isset($modx->config['auto_menuindex'])) { + $modx->config['auto_menuindex'] = 1; + } + if ($modx->config['auto_menuindex']) { + $pid = (int)$_REQUEST['pid']; + $rs = $modx->db->select('count(*)', $tbl_site_content, "parent='{$pid}'"); + $content['menuindex'] = $modx->db->getValue($rs); + } else { + $content['menuindex'] = 0; + } } -if(isset ($_POST['which_editor'])) { - $modx->config['which_editor'] = $_POST['which_editor']; +if (isset($_POST['which_editor'])) { + $modx->config['which_editor'] = $_POST['which_editor']; } // Add lock-element JS-Script @@ -478,7 +478,7 @@ function decode(s) { return s; } - manager->action == '72') { // Web Link specific ?> + manager->action == '72') { // Web Link specific?> var lastImageCtrl; var lastFileCtrl; @@ -539,29 +539,30 @@ function SetUrl(url, width, height, alt) { } } - + /* ]]> */ invokeEvent('OnDocFormPrerender', array( - 'id' => $id, - 'template' => $content['template'] - )); - - if(is_array($evtOut)) { - echo implode('', $evtOut); - } - - /*************************/ - $dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : ''; - $sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : 'createdon'; - $page = isset($_REQUEST['page']) ? (int) $_REQUEST['page'] : ''; - /*************************/ - - ?> + // invoke OnDocFormPrerender event + $evtOut = $modx->invokeEvent('OnDocFormPrerender', array( + 'id' => $id, + 'template' => $content['template'] + )); + + if (is_array($evtOut)) { + echo implode('', $evtOut); + } + + /*************************/ + $dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : ''; + $sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : 'createdon'; + $page = isset($_REQUEST['page']) ? (int) $_REQUEST['page'] : ''; + /*************************/ + + ?> @@ -575,55 +576,55 @@ function SetUrl(url, width, height, alt) {

      - config['modx_charset']) . (iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '') . '(' . $_REQUEST['id'] . ')'; - } else { - if ($modx->manager->action == '4') { - echo $_lang['add_resource']; - } else if ($modx->manager->action == '72') { - echo $_lang['add_weblink']; - } else { - echo $_lang['create_resource_title']; - } - } ?> + config['modx_charset']) . (iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '') . '(' . $_REQUEST['id'] . ')'; + } else { + if ($modx->manager->action == '4') { + echo $_lang['add_resource']; + } elseif ($modx->manager->action == '72') { + echo $_lang['add_weblink']; + } else { + echo $_lang['create_resource_title']; + } + } ?>

      config['use_breadcrumbs']) { - $temp = array(); - $title = isset($content['pagetitle']) ? $content['pagetitle'] : $_lang['create_resource_title']; - - if(isset($_REQUEST['id']) && $content['parent'] != 0) { - $bID = (int) $_REQUEST['id']; - $temp = $modx->getParentIds($bID); - } else if(isset($_REQUEST['pid'])) { - $bID = (int) $_REQUEST['pid']; - $temp = $modx->getParentIds($bID); - array_unshift($temp, $bID); - } - - if($temp) { - $parents = implode(',', $temp); - - if(!empty($parents)) { - $where = "FIND_IN_SET(id,'{$parents}') DESC"; - $rs = $modx->db->select('id, pagetitle', $tbl_site_content, "id IN ({$parents})", $where); - while($row = $modx->db->getRow($rs)) { - $out .= ''; - } - } - } + } + } + } - $out .= ''; - echo ''; - } - ?> + $out .= ''; + echo ''; + } + ?>
      @@ -635,13 +636,13 @@ function SetUrl(url, width, height, alt) { invokeEvent('OnDocFormTemplateRender', array( - 'id' => $id - )); - if(is_array($evtOut)) { - echo implode('', $evtOut); - } else { - ?> + $evtOut = $modx->invokeEvent('OnDocFormTemplateRender', array( + 'id' => $id + )); + if (is_array($evtOut)) { + echo implode('', $evtOut); + } else { + ?>

      @@ -694,7 +695,7 @@ function SetUrl(url, width, height, alt) { - manager->action == '72') { // Web Link specific ?> + manager->action == '72') { // Web Link specific?> @@ -706,7 +707,8 @@ function SetUrl(url, width, height, alt) { - + @@ -726,36 +728,35 @@ function SetUrl(url, width, height, alt) { @@ -795,37 +796,36 @@ function SetUrl(url, width, height, alt) { db->select('pagetitle', $tbl_site_content, "id='{$parentlookup}'"); - $parentname = $modx->db->getValue($rs); - if(!$parentname) { - $modx->webAlertAndQuit($_lang["error_no_parent"]); - } - } - ?> + $parentlookup = false; + if (isset($_REQUEST['id'])) { + if ($content['parent'] == 0) { + $parentname = $site_name; + } else { + $parentlookup = $content['parent']; + } + } elseif (isset($_REQUEST['pid'])) { + if ($_REQUEST['pid'] == 0) { + $parentname = $site_name; + } else { + $parentlookup = $_REQUEST['pid']; + } + } elseif (isset($_POST['parent'])) { + if ($_POST['parent'] == 0) { + $parentname = $site_name; + } else { + $parentlookup = $_POST['parent']; + } + } else { + $parentname = $site_name; + $content['parent'] = 0; + } + if ($parentlookup !== false && is_numeric($parentlookup)) { + $rs = $modx->db->select('pagetitle', $tbl_site_content, "id='{$parentlookup}'"); + $parentname = $modx->db->getValue($rs); + if (!$parentname) { + $modx->webAlertAndQuit($_lang["error_no_parent"]); + } + } ?> " onclick="enableParentSelection(!allowParentSelection);"> () @@ -833,37 +833,38 @@ function SetUrl(url, width, height, alt) { manager->action == '72') { - ?> - - -
      - - - - - - - - - - - - manager->action == '4') { ?> + /* + if($content['type'] == 'reference' || $modx->manager->action == '72') { + ?> + + +
      + + + + + + + + + + + + manager->action == '4') { + ?>
      @@ -874,107 +875,105 @@ function SetUrl(url, width, height, alt) {
      manager->action == '4') && $use_editor == 1) { - $htmlContent = $content['content']; - ?> + if (($content['richtext'] == 1 || $modx->manager->action == '4') && $use_editor == 1) { + $htmlContent = $content['content']; ?>
      config['which_editor']][] = 'ta'; - $richtexteditorOptions[$modx->config['which_editor']]['ta'] = ''; - } else { - echo "\t" . '
      ' . "\n"; - } - ?> + // Richtext-[*content*] + $richtexteditorIds = array(); + $richtexteditorOptions = array(); + $richtexteditorIds[$modx->config['which_editor']][] = 'ta'; + $richtexteditorOptions[$modx->config['which_editor']]['ta'] = ''; + } else { + echo "\t" . '
      ' . "\n"; + } ?>
      - + manager->action == '4') || ($content['type'] == 'reference' || $modx->manager->action == 72)) { - $template = $default_template; - $group_tvs = empty($modx->config['group_tvs']) ? 0 : (int)$modx->config['group_tvs']; - if (isset ($_REQUEST['newtemplate'])) { - $template = $_REQUEST['newtemplate']; - } else { - if (isset ($content['template'])) { - $template = $content['template']; - } + if (($content['type'] == 'document' || $modx->manager->action == '4') || ($content['type'] == 'reference' || $modx->manager->action == 72)) { + $template = $default_template; + $group_tvs = empty($modx->config['group_tvs']) ? 0 : (int)$modx->config['group_tvs']; + if (isset($_REQUEST['newtemplate'])) { + $template = $_REQUEST['newtemplate']; + } else { + if (isset($content['template'])) { + $template = $content['template']; } + } - $field = "DISTINCT tv.*, IF(tvc.value!='',tvc.value,tv.default_text) as value, tvtpl.rank as tvrank"; - $vs = array( + $field = "DISTINCT tv.*, IF(tvc.value!='',tvc.value,tv.default_text) as value, tvtpl.rank as tvrank"; + $vs = array( $tbl_site_tmplvars, $tbl_site_tmplvar_templates, $tbl_site_tmplvar_contentvalues, $id, $tbl_site_tmplvar_access ); - $from = vsprintf("%s AS tv INNER JOIN %s AS tvtpl ON tvtpl.tmplvarid = tv.id + $from = vsprintf("%s AS tv INNER JOIN %s AS tvtpl ON tvtpl.tmplvarid = tv.id LEFT JOIN %s AS tvc ON tvc.tmplvarid=tv.id AND tvc.contentid='%s' LEFT JOIN %s AS tva ON tva.tmplvarid=tv.id", $vs); - $dgs = $docgrp ? " OR tva.documentgroup IN ({$docgrp})" : ''; - $vs = array( + $dgs = $docgrp ? " OR tva.documentgroup IN ({$docgrp})" : ''; + $vs = array( $template, $_SESSION['mgrRole'], $dgs ); - $sort = 'tvtpl.rank,tv.rank, tv.id'; - if ($group_tvs) { - $field .= ', IFNULL(tv.category,0) as category_id, IFNULL(cat.category,"' . $_lang['no_category'] . '") AS category, IFNULL(cat.rank,0) AS category_rank'; - $from .= ' + $sort = 'tvtpl.rank,tv.rank, tv.id'; + if ($group_tvs) { + $field .= ', IFNULL(tv.category,0) as category_id, IFNULL(cat.category,"' . $_lang['no_category'] . '") AS category, IFNULL(cat.rank,0) AS category_rank'; + $from .= ' LEFT JOIN ' . $tbl_categories . ' AS cat ON cat.id=tv.category'; - $sort = 'cat.rank,cat.id,' . $sort; - } - $where = vsprintf("tvtpl.templateid='%s' AND (1='%s' OR ISNULL(tva.documentgroup) %s)", $vs); - $rs = $modx->db->select($field, $from, $where, $sort); - if ($modx->db->getRecordCount($rs)) { - $tvsArray = $modx->db->makeArray($rs, 'name'); - require_once(MODX_MANAGER_PATH . 'includes/tmplvars.inc.php'); - require_once(MODX_MANAGER_PATH . 'includes/tmplvars.commands.inc.php'); - - $templateVariablesOutput = ''; - $templateVariablesGeneral = ''; - - $i = $ii = 0; - $tab = ''; - foreach ($tvsArray as $row) { - if ($group_tvs && $row['category_id'] != 0) { - $ii = 0; - if ($tab !== $row['category_id']) { - if ($group_tvs == 1 || $group_tvs == 3) { - if ($i === 0) { - $templateVariablesOutput .= ' + $sort = 'cat.rank,cat.id,' . $sort; + } + $where = vsprintf("tvtpl.templateid='%s' AND (1='%s' OR ISNULL(tva.documentgroup) %s)", $vs); + $rs = $modx->db->select($field, $from, $where, $sort); + if ($modx->db->getRecordCount($rs)) { + $tvsArray = $modx->db->makeArray($rs, 'name'); + require_once(MODX_MANAGER_PATH . 'includes/tmplvars.inc.php'); + require_once(MODX_MANAGER_PATH . 'includes/tmplvars.commands.inc.php'); + + $templateVariablesOutput = ''; + $templateVariablesGeneral = ''; + + $i = $ii = 0; + $tab = ''; + foreach ($tvsArray as $row) { + if ($group_tvs && $row['category_id'] != 0) { + $ii = 0; + if ($tab !== $row['category_id']) { + if ($group_tvs == 1 || $group_tvs == 3) { + if ($i === 0) { + $templateVariablesOutput .= '
      ' . $row['category'] . '
      ' . "\n"; - } else { - $templateVariablesOutput .= ' + } else { + $templateVariablesOutput .= '
      @@ -983,18 +982,18 @@ function SetUrl(url, width, height, alt) {
      ' . $row['category'] . '
      '; - } - } else if ($group_tvs == 2 || $group_tvs == 4) { - if ($i === 0) { - $templateVariablesOutput .= ' + } + } elseif ($group_tvs == 2 || $group_tvs == 4) { + if ($i === 0) { + $templateVariablesOutput .= '

      ' . $row['category'] . '

      '; - } else { - $templateVariablesOutput .= ' + } else { + $templateVariablesOutput .= '
      @@ -1005,16 +1004,16 @@ function SetUrl(url, width, height, alt) {
      '; - } - } else if ($group_tvs == 5) { - if ($i === 0) { - $templateVariablesOutput .= ' + } + } elseif ($group_tvs == 5) { + if ($i === 0) { + $templateVariablesOutput .= '

      ' . $row['category'] . '

      '; - } else { - $templateVariablesOutput .= ' + } else { + $templateVariablesOutput .= '
      @@ -1023,97 +1022,97 @@ function SetUrl(url, width, height, alt) { '; - } } - $split = 0; - } else { - $split = 1; } + $split = 0; + } else { + $split = 1; } + } - // Go through and display all Template Variables - if ($row['type'] == 'richtext' || $row['type'] == 'htmlarea') { - // determine TV-options - $tvOptions = $modx->parseProperties($row['elements']); - if (!empty($tvOptions)) { - // Allow different Editor with TV-option {"editor":"CKEditor4"} or &editor=Editor;text;CKEditor4 - $editor = isset($tvOptions['editor']) ? $tvOptions['editor'] : $modx->config['which_editor']; - }; - // Add richtext editor to the list - $richtexteditorIds[$editor][] = "tv" . $row['id']; - $richtexteditorOptions[$editor]["tv" . $row['id']] = $tvOptions; - } + // Go through and display all Template Variables + if ($row['type'] == 'richtext' || $row['type'] == 'htmlarea') { + // determine TV-options + $tvOptions = $modx->parseProperties($row['elements']); + if (!empty($tvOptions)) { + // Allow different Editor with TV-option {"editor":"CKEditor4"} or &editor=Editor;text;CKEditor4 + $editor = isset($tvOptions['editor']) ? $tvOptions['editor'] : $modx->config['which_editor']; + }; + // Add richtext editor to the list + $richtexteditorIds[$editor][] = "tv" . $row['id']; + $richtexteditorOptions[$editor]["tv" . $row['id']] = $tvOptions; + } - $templateVariablesTmp = ''; + $templateVariablesTmp = ''; - // splitter - if ($group_tvs) { - if (($split && $i) || $ii) { - $templateVariablesTmp .= ' - ' . "\n"; - } - } else if ($i) { + // splitter + if ($group_tvs) { + if (($split && $i) || $ii) { $templateVariablesTmp .= ' - ' . "\n"; + ' . "\n"; } + } elseif ($i) { + $templateVariablesTmp .= ' + ' . "\n"; + } - // post back value - if (array_key_exists('tv' . $row['id'], $_POST)) { - if (is_array($_POST['tv' . $row['id']])) { - $tvPBV = implode('||', $_POST['tv' . $row['id']]); - } else { - $tvPBV = $_POST['tv' . $row['id']]; - } + // post back value + if (array_key_exists('tv' . $row['id'], $_POST)) { + if (is_array($_POST['tv' . $row['id']])) { + $tvPBV = implode('||', $_POST['tv' . $row['id']]); } else { - $tvPBV = $row['value']; + $tvPBV = $_POST['tv' . $row['id']]; } + } else { + $tvPBV = $row['value']; + } - $tvDescription = (!empty($row['description'])) ? '
      ' . $row['description'] . '' : ''; - $tvInherited = (substr($tvPBV, 0, 8) == '@INHERIT') ? '
      (' . $_lang['tmplvars_inherited'] . ')' : ''; - $tvName = $modx->hasPermission('edit_template') ? '
      [*' . $row['name'] . '*]' : ''; + $tvDescription = (!empty($row['description'])) ? '
      ' . $row['description'] . '' : ''; + $tvInherited = (substr($tvPBV, 0, 8) == '@INHERIT') ? '
      (' . $_lang['tmplvars_inherited'] . ')' : ''; + $tvName = $modx->hasPermission('edit_template') ? '
      [*' . $row['name'] . '*]' : ''; - $templateVariablesTmp .= ' + $templateVariablesTmp .= ' '; - if ($group_tvs && $row['category_id'] == 0) { - $templateVariablesGeneral .= $templateVariablesTmp; - $ii++; - } else { - $templateVariablesOutput .= $templateVariablesTmp; - $tab = $row['category_id']; - $i++; - } + if ($group_tvs && $row['category_id'] == 0) { + $templateVariablesGeneral .= $templateVariablesTmp; + $ii++; + } else { + $templateVariablesOutput .= $templateVariablesTmp; + $tab = $row['category_id']; + $i++; } + } - if ($templateVariablesGeneral) { - echo '
      ' . $row['caption'] . $tvName . '' . $tvDescription . $tvInherited . '
      ' . renderFormElement($row['type'], $row['id'], $row['default_text'], $row['elements'], $tvPBV, '', $row, $tvsArray) . '
      ' . $templateVariablesGeneral . '
      '; - } + if ($templateVariablesGeneral) { + echo '' . $templateVariablesGeneral . '
      '; + } - $templateVariables .= ' + $templateVariables .= ' ' . "\n"; - if (!$group_tvs) { - $templateVariables .= ' + if (!$group_tvs) { + $templateVariables .= '
      ' . $_lang['settings_templvars'] . '
      '; - } else if ($group_tvs == 2) { - $templateVariables .= ' + } elseif ($group_tvs == 2) { + $templateVariables .= '
      ' . $_lang['settings_templvars'] . '
      '; - } else if ($group_tvs == 3) { - $templateVariables .= ' + } elseif ($group_tvs == 3) { + $templateVariables .= '

      ' . $_lang['settings_templvars'] . '

      '; - } else if ($group_tvs == 4) { - $templateVariables .= ' + } elseif ($group_tvs == 4) { + $templateVariables .= '

      ' . $_lang['settings_templvars'] . '

      @@ -1122,34 +1121,33 @@ function SetUrl(url, width, height, alt) { '; - } - $templateVariables .= $templateVariablesOutput; - $templateVariables .= ' + } + $templateVariables .= $templateVariablesOutput; + $templateVariables .= '
      ' . "\n"; - if ($group_tvs == 1) { - $templateVariables .= ' + if ($group_tvs == 1) { + $templateVariables .= ' ' . "\n"; - } else if ($group_tvs == 2 || $group_tvs == 4) { - $templateVariables .= ' + } elseif ($group_tvs == 2 || $group_tvs == 4) { + $templateVariables .= ' ' . "\n"; - } else if ($group_tvs == 3) { - $templateVariables .= ' + } elseif ($group_tvs == 3) { + $templateVariables .= ' ' . "\n"; - } - $templateVariables .= ' - ' . "\n"; } + $templateVariables .= ' + ' . "\n"; } + } - // Template Variables - if ($modx->config['group_tvs'] < 3) { - echo $templateVariables; - } - ?> + // Template Variables + if ($modx->config['group_tvs'] < 3) { + echo $templateVariables; + } ?> @@ -1212,8 +1210,8 @@ function SetUrl(url, width, height, alt) { manager->action != '27' || $_SESSION['mgrInternalKey'] == $content['createdby'] || $modx->hasPermission('change_resourcetype')) { - ?> + if ($_SESSION['mgrRole'] == 1 || $modx->manager->action != '27' || $_SESSION['mgrInternalKey'] == $content['createdby'] || $modx->hasPermission('change_resourcetype')) { + ?> @@ -1235,15 +1233,14 @@ function SetUrl(url, width, height, alt) { @@ -1266,23 +1263,23 @@ function SetUrl(url, width, height, alt) { manager->action != '72') { - // non-admin managers creating or editing a document resource - ?> + } else { + if ($content['type'] != 'reference' && $modx->manager->action != '72') { + // non-admin managers creating or editing a document resource + ?> " /> + } else { + // non-admin managers creating or editing a reference (weblink) resource + ?> + } + }//if mgrRole + ?> @@ -1355,7 +1352,8 @@ function SetUrl(url, width, height, alt) { - + manager->action == '27' ? $id : (!empty($_REQUEST['pid']) ? $_REQUEST['pid'] : $content['parent'])); - if($documentId > 0) { - // Load up, the permissions from the parent (if new document) or existing document - $rs = $modx->db->select('id, document_group', $tbl_document_groups, "document='{$documentId}'"); - while($currentgroup = $modx->db->getRow($rs)) $groupsarray[] = $currentgroup['document_group'] . ',' . $currentgroup['id']; - - // Load up the current permissions and names - $vs = array( - $tbl_document_group_names, - $tbl_document_groups, - $documentId - ); - $from = vsprintf("%s AS dgn LEFT JOIN %s AS groups ON groups.document_group=dgn.id AND groups.document='%s'", $vs); - $rs = $modx->db->select('dgn.*, groups.id AS link_id', $from, '', 'name'); - } else { - // Just load up the names, we're starting clean - $rs = $modx->db->select('*, NULL AS link_id', $tbl_document_group_names, '', 'name'); - } + /******************************* + * Document Access Permissions */ + if ($use_udperms == 1) { + $groupsarray = array(); + $sql = ''; + + $documentId = ($modx->manager->action == '27' ? $id : (!empty($_REQUEST['pid']) ? $_REQUEST['pid'] : $content['parent'])); + if ($documentId > 0) { + // Load up, the permissions from the parent (if new document) or existing document + $rs = $modx->db->select('id, document_group', $tbl_document_groups, "document='{$documentId}'"); + while ($currentgroup = $modx->db->getRow($rs)) { + $groupsarray[] = $currentgroup['document_group'] . ',' . $currentgroup['id']; + } - // retain selected doc groups between post - if(isset($_POST['docgroups'])) { - $groupsarray = array_merge($groupsarray, $_POST['docgroups']); - } + // Load up the current permissions and names + $vs = array( + $tbl_document_group_names, + $tbl_document_groups, + $documentId + ); + $from = vsprintf("%s AS dgn LEFT JOIN %s AS groups ON groups.document_group=dgn.id AND groups.document='%s'", $vs); + $rs = $modx->db->select('dgn.*, groups.id AS link_id', $from, '', 'name'); + } else { + // Just load up the names, we're starting clean + $rs = $modx->db->select('*, NULL AS link_id', $tbl_document_group_names, '', 'name'); + } + + // retain selected doc groups between post + if (isset($_POST['docgroups'])) { + $groupsarray = array_merge($groupsarray, $_POST['docgroups']); + } + + $isManager = $modx->hasPermission('access_permissions'); + $isWeb = $modx->hasPermission('web_access_permissions'); + + // Setup Basic attributes for each Input box + $inputAttributes = array( + 'type' => 'checkbox', + 'class' => 'checkbox', + 'name' => 'docgroups[]', + 'onclick' => 'makePublic(false);', + ); + $permissions = array(); // New Permissions array list (this contains the HTML) + $permissions_yes = 0; // count permissions the current mgr user has + $permissions_no = 0; // count permissions the current mgr user doesn't have + + // Loop through the permissions list + while ($row = $modx->db->getRow($rs)) { + + // Create an inputValue pair (group ID and group link (if it exists)) + $inputValue = $row['id'] . ',' . ($row['link_id'] ? $row['link_id'] : 'new'); + $inputId = 'group-' . $row['id']; + + $checked = in_array($inputValue, $groupsarray); + if ($checked) { + $notPublic = true; + } // Mark as private access (either web or manager) + + // Skip the access permission if the user doesn't have access... + if ((!$isManager && $row['private_memgroup'] == '1') || (!$isWeb && $row['private_webgroup'] == '1')) { + continue; + } - $isManager = $modx->hasPermission('access_permissions'); - $isWeb = $modx->hasPermission('web_access_permissions'); - - // Setup Basic attributes for each Input box - $inputAttributes = array( - 'type' => 'checkbox', - 'class' => 'checkbox', - 'name' => 'docgroups[]', - 'onclick' => 'makePublic(false);', - ); - $permissions = array(); // New Permissions array list (this contains the HTML) - $permissions_yes = 0; // count permissions the current mgr user has - $permissions_no = 0; // count permissions the current mgr user doesn't have - - // Loop through the permissions list - while($row = $modx->db->getRow($rs)) { - - // Create an inputValue pair (group ID and group link (if it exists)) - $inputValue = $row['id'] . ',' . ($row['link_id'] ? $row['link_id'] : 'new'); - $inputId = 'group-' . $row['id']; - - $checked = in_array($inputValue, $groupsarray); - if($checked) { - $notPublic = true; - } // Mark as private access (either web or manager) - - // Skip the access permission if the user doesn't have access... - if((!$isManager && $row['private_memgroup'] == '1') || (!$isWeb && $row['private_webgroup'] == '1')) { - continue; - } - - // Setup attributes for this Input box - $inputAttributes['id'] = $inputId; - $inputAttributes['value'] = $inputValue; - if($checked) { - $inputAttributes['checked'] = 'checked'; - } else { - unset($inputAttributes['checked']); - } - - // Create attribute string list - $inputString = array(); - foreach($inputAttributes as $k => $v) $inputString[] = $k . '="' . $v . '"'; - - // Make the HTML - $inputHTML = ''; - - // does user have this permission? - $from = "{$tbl_membergroup_access} AS mga, {$tbl_member_groups} AS mg"; - $vs = array( - $row['id'], - $_SESSION['mgrInternalKey'] - ); - $where = vsprintf("mga.membergroup=mg.user_group AND mga.documentgroup=%s AND mg.member=%s", $vs); - $rsp = $modx->db->select('COUNT(mg.id)', $from, $where); - $count = $modx->db->getValue($rsp); - if($count > 0) { - ++$permissions_yes; - } else { - ++$permissions_no; - } - $permissions[] = "\t\t" . '
    • ' . $inputHTML . '
    • '; - } - // if mgr user doesn't have access to any of the displayable permissions, forget about them and make doc public - if($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0)) { - $permissions = array(); - } + // Setup attributes for this Input box + $inputAttributes['id'] = $inputId; + $inputAttributes['value'] = $inputValue; + if ($checked) { + $inputAttributes['checked'] = 'checked'; + } else { + unset($inputAttributes['checked']); + } - // See if the Access Permissions section is worth displaying... - if(!empty($permissions)) { - // Add the "All Document Groups" item if we have rights in both contexts - if($isManager && $isWeb) { - array_unshift($permissions, "\t\t" . '
    • '); - } - // Output the permissions list... - ?> + // Create attribute string list + $inputString = array(); + foreach ($inputAttributes as $k => $v) { + $inputString[] = $k . '="' . $v . '"'; + } + + // Make the HTML + $inputHTML = ''; + + // does user have this permission? + $from = "{$tbl_membergroup_access} AS mga, {$tbl_member_groups} AS mg"; + $vs = array( + $row['id'], + $_SESSION['mgrInternalKey'] + ); + $where = vsprintf("mga.membergroup=mg.user_group AND mga.documentgroup=%s AND mg.member=%s", $vs); + $rsp = $modx->db->select('COUNT(mg.id)', $from, $where); + $count = $modx->db->getValue($rsp); + if ($count > 0) { + ++$permissions_yes; + } else { + ++$permissions_no; + } + $permissions[] = "\t\t" . '
    • ' . $inputHTML . '
    • '; + } + // if mgr user doesn't have access to any of the displayable permissions, forget about them and make doc public + if ($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0)) { + $permissions = array(); + } + + // See if the Access Permissions section is worth displaying... + if (!empty($permissions)) { + // Add the "All Document Groups" item if we have rights in both contexts + if ($isManager && $isWeb) { + array_unshift($permissions, "\t\t" . '
    • '); + } + // Output the permissions list... + ?>

      @@ -1504,31 +1506,30 @@ function makePublic(b) {
    0) && ($_SESSION['mgrPermissions']['access_permissions'] == 1 || $_SESSION['mgrPermissions']['web_access_permissions'] == 1)) { - ?> + } // !empty($permissions) + elseif ($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0) && ($_SESSION['mgrPermissions']['access_permissions'] == 1 || $_SESSION['mgrPermissions']['web_access_permissions'] == 1)) { + ?>

    + } + } + /* End Document Access Permissions * + ***********************************/ + ?> invokeEvent('OnDocFormRender', array( - 'id' => $id, - 'template' => $content['template'] - )); + // invoke OnDocFormRender event + $evtOut = $modx->invokeEvent('OnDocFormRender', array( + 'id' => $id, + 'template' => $content['template'] + )); - if(is_array($evtOut)) { - echo implode('', $evtOut); - } - ?> + if (is_array($evtOut)) { + echo implode('', $evtOut); + } + ?> @@ -1538,64 +1539,66 @@ function makePublic(b) { storeCurTemplate(); manager->action == '4' || $modx->manager->action == '72') && $use_editor == 1) { - if(is_array($richtexteditorIds)) { - foreach($richtexteditorIds as $editor => $elements) { - // invoke OnRichTextEditorInit event - $evtOut = $modx->invokeEvent('OnRichTextEditorInit', array( - 'editor' => $editor, - 'elements' => $elements, - 'options' => $richtexteditorOptions[$editor] - )); - if(is_array($evtOut)) { - echo implode('', $evtOut); - } - } - } -} +if (($content['richtext'] == 1 || $modx->manager->action == '4' || $modx->manager->action == '72') && $use_editor == 1) { + if (is_array($richtexteditorIds)) { + foreach ($richtexteditorIds as $editor => $elements) { + // invoke OnRichTextEditorInit event + $evtOut = $modx->invokeEvent('OnRichTextEditorInit', array( + 'editor' => $editor, + 'elements' => $elements, + 'options' => $richtexteditorOptions[$editor] + )); + if (is_array($evtOut)) { + echo implode('', $evtOut); + } + } + } + } /** * @return string */ -function getDefaultTemplate() { - $modx = evolutionCMS(); +function getDefaultTemplate() +{ + $modx = evolutionCMS(); $default_template = ''; - switch($modx->config['auto_template_logic']) { - case 'sibling': - if(!isset($_GET['pid']) || empty($_GET['pid'])) { - $site_start = $modx->config['site_start']; - $where = "sc.isfolder=0 AND sc.id!='{$site_start}'"; - $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 1, 0, 'template', $where, 'menuindex', 'ASC', 1); - if(isset($sibl[0]['template']) && $sibl[0]['template'] !== '') { - $default_template = $sibl[0]['template']; - } - } else { - $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 1, 0, 'template', 'isfolder=0', 'menuindex', 'ASC', 1); - if(isset($sibl[0]['template']) && $sibl[0]['template'] !== '') { - $default_template = $sibl[0]['template']; - } else { - $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 0, 0, 'template', 'isfolder=0', 'menuindex', 'ASC', 1); - if(isset($sibl[0]['template']) && $sibl[0]['template'] !== '') { - $default_template = $sibl[0]['template']; - } - } - } - if(isset($default_template)) { - break; - } // If $default_template could not be determined, fall back / through to "parent"-mode - case 'parent': - if(isset($_REQUEST['pid']) && !empty($_REQUEST['pid'])) { - $parent = $modx->getPageInfo($_REQUEST['pid'], 0, 'template'); - if(isset($parent['template'])) { - $default_template = $parent['template']; - } - } - break; - case 'system': - default: // default_template is already set - $default_template = $modx->config['default_template']; - } - - return empty($default_template) ? $modx->config['default_template'] : $default_template; + switch ($modx->config['auto_template_logic']) { + case 'sibling': + if (!isset($_GET['pid']) || empty($_GET['pid'])) { + $site_start = $modx->config['site_start']; + $where = "sc.isfolder=0 AND sc.id!='{$site_start}'"; + $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 1, 0, 'template', $where, 'menuindex', 'ASC', 1); + if (isset($sibl[0]['template']) && $sibl[0]['template'] !== '') { + $default_template = $sibl[0]['template']; + } + } else { + $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 1, 0, 'template', 'isfolder=0', 'menuindex', 'ASC', 1); + if (isset($sibl[0]['template']) && $sibl[0]['template'] !== '') { + $default_template = $sibl[0]['template']; + } else { + $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 0, 0, 'template', 'isfolder=0', 'menuindex', 'ASC', 1); + if (isset($sibl[0]['template']) && $sibl[0]['template'] !== '') { + $default_template = $sibl[0]['template']; + } + } + } + if (isset($default_template)) { + break; + } // If $default_template could not be determined, fall back / through to "parent"-mode + // no break + case 'parent': + if (isset($_REQUEST['pid']) && !empty($_REQUEST['pid'])) { + $parent = $modx->getPageInfo($_REQUEST['pid'], 0, 'template'); + if (isset($parent['template'])) { + $default_template = $parent['template']; + } + } + break; + case 'system': + default: // default_template is already set + $default_template = $modx->config['default_template']; + } + + return empty($default_template) ? $modx->config['default_template'] : $default_template; } diff --git a/manager/actions/mutate_htmlsnippet.dynamic.php b/manager/actions/mutate_htmlsnippet.dynamic.php index 9305315b5c..25e1ebcc28 100755 --- a/manager/actions/mutate_htmlsnippet.dynamic.php +++ b/manager/actions/mutate_htmlsnippet.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } @@ -43,7 +43,7 @@ if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } -} else if (isset($_REQUEST['itemname'])) { +} elseif (isset($_REQUEST['itemname'])) { $content['name'] = $_REQUEST['itemname']; } else { $_SESSION['itemname'] = $_lang["new_htmlsnippet"]; diff --git a/manager/actions/mutate_menuindex_sort.dynamic.php b/manager/actions/mutate_menuindex_sort.dynamic.php index 989eedeada..64f823e562 100755 --- a/manager/actions/mutate_menuindex_sort.dynamic.php +++ b/manager/actions/mutate_menuindex_sort.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('edit_document') || !$modx->hasPermission('save_document')) { @@ -49,7 +49,7 @@ $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; $docgrp_cond = $docgrp ? "OR dg.document_group IN ({$docgrp})" : ''; - $mgrRole = (isset ($_SESSION['mgrRole']) && (string)$_SESSION['mgrRole'] === '1') ? '1' : '0'; + $mgrRole = (isset($_SESSION['mgrRole']) && (string)$_SESSION['mgrRole'] === '1') ? '1' : '0'; $access = " AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); $rs = $modx->db->select('sc.id, sc.pagetitle, sc.parent, sc.menuindex, sc.published, sc.hidemenu, sc.deleted, sc.isfolder', $tblsc . 'AS sc LEFT JOIN ' . $tbldg . ' dg ON dg.document=sc.id', 'sc.parent=' . $id . $access . ' GROUP BY sc.id', 'menuindex ASC'); diff --git a/manager/actions/mutate_module.dynamic.php b/manager/actions/mutate_module.dynamic.php index 38694b9403..a4f6ab0d40 100755 --- a/manager/actions/mutate_module.dynamic.php +++ b/manager/actions/mutate_module.dynamic.php @@ -1,20 +1,20 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -switch($modx->manager->action) { - case 107: - if(!$modx->hasPermission('new_module')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 108: - if(!$modx->hasPermission('edit_module')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +switch ($modx->manager->action) { + case 107: + if (!$modx->hasPermission('new_module')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 108: + if (!$modx->hasPermission('edit_module')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; // Get table names (alphabetical) @@ -33,40 +33,41 @@ * * @return string */ -function createGUID() { - srand((double) microtime() * 1000000); - $r = rand(); - $u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1); - $m = md5($u); - return $m; +function createGUID() +{ + srand((double) microtime() * 1000000); + $r = rand(); + $u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1); + $m = md5($u); + return $m; } // check to see the module editor isn't locked -if($lockedEl = $modx->elementIsLocked(6, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); +if ($lockedEl = $modx->elementIsLocked(6, $id)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); } // end check for lock // Lock snippet for other users to edit $modx->lockElement(6, $id); -if(isset($_GET['id'])) { - $rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'"); - $content = $modx->db->getRow($rs); - if(!$content) { - $modx->webAlertAndQuit("Module not found for id '{$id}'."); - } - $content['properties'] = str_replace("&", "&", $content['properties']); - $_SESSION['itemname'] = $content['name']; - if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } +if (isset($_GET['id'])) { + $rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'"); + $content = $modx->db->getRow($rs); + if (!$content) { + $modx->webAlertAndQuit("Module not found for id '{$id}'."); + } + $content['properties'] = str_replace("&", "&", $content['properties']); + $_SESSION['itemname'] = $content['name']; + if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } } else { - $_SESSION['itemname'] = $_lang["new_module"]; - $content['wrap'] = '1'; + $_SESSION['itemname'] = $_lang["new_module"]; + $content['wrap'] = '1'; } -if($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); +if ($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); } // Add lock-element JS-Script @@ -437,18 +438,18 @@ function SetUrl(url, width, height, alt) { invokeEvent('OnModFormPrerender', array('id' => $id)); - if(is_array($evtOut)) { - echo implode('', $evtOut); - } - - // Prepare internal params & info-tab via parseDocBlock - $modulecode = isset($content['modulecode']) ? $modx->db->escape($content['modulecode']) : ''; - $docBlock = $modx->parseDocBlockFromString($modulecode); - $docBlockList = $modx->convertDocBlockIntoList($docBlock); - $internal = array(); - ?> + // invoke OnModFormPrerender event + $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id)); + if (is_array($evtOut)) { + echo implode('', $evtOut); + } + + // Prepare internal params & info-tab via parseDocBlock + $modulecode = isset($content['modulecode']) ? $modx->db->escape($content['modulecode']) : ''; + $docBlock = $modx->parseDocBlockFromString($modulecode); + $docBlockList = $modx->convertDocBlockIntoList($docBlock); + $internal = array(); + ?> @@ -478,7 +479,7 @@ function SetUrl(url, width, height, alt) {
    - hasPermission('save_role')): ?> + hasPermission('save_role')): ?>
    @@ -600,7 +601,7 @@ function SetUrl(url, width, height, alt) { - manager->action == '108'): ?> + manager->action == '108'): ?>

    @@ -612,7 +613,7 @@ function SetUrl(url, width, height, alt) { ">
    db->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, + $ds = $modx->db->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, CASE smd.type WHEN 10 THEN 'Chunk' WHEN 20 THEN 'Document' @@ -628,17 +629,17 @@ function SetUrl(url, width, height, alt) { LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = 50 LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = 60", "smd.module='{$id}'", 'smd.type,name'); - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items - $grd->noRecordMsg = $_lang['no_records_found']; - $grd->cssClass = 'grid'; - $grd->columnHeaderClass = 'gridHeader'; - $grd->itemClass = 'gridItem'; - $grd->altItemClass = 'gridAltItem'; - $grd->columns = $_lang['element_name'] . " ," . $_lang['type']; - $grd->fields = "name,type"; - echo $grd->render(); - ?> + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items + $grd->noRecordMsg = $_lang['no_records_found']; + $grd->cssClass = 'grid'; + $grd->columnHeaderClass = 'gridHeader'; + $grd->itemClass = 'gridItem'; + $grd->altItemClass = 'gridAltItem'; + $grd->columns = $_lang['element_name'] . " ," . $_lang['type']; + $grd->fields = "name,type"; + echo $grd->render(); + ?> @@ -648,14 +649,14 @@ function SetUrl(url, width, height, alt) {

    - + db->select('usergroup', $tbl_site_module_access, "module='{$id}'"); - $groupsarray = $modx->db->getColumn('usergroup', $rs); + // fetch user access permissions for the module + $rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'"); + $groupsarray = $modx->db->getColumn('usergroup', $rs); - if($modx->hasPermission('access_permissions')) { - ?> + if ($modx->hasPermission('access_permissions')) { + ?>

    db->select('name, id', $tbl_membergroup_names, '', 'name'); - while($row = $modx->db->getRow($rs)) { - $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); - $checked = in_array($row['id'], $groupsarray); - if($modx->hasPermission('access_permissions')) { - if($checked) { - $notPublic = true; - } - $chks .= '
    \n"; - } else { - if($checked) { - $chks = '' . "\n" . $chks; - } - } - } - if($modx->hasPermission('access_permissions')) { - $chks = '
    ' . "\n" . $chks; - } - echo $chks; - ?> + } + $chk = ''; + $rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name'); + while ($row = $modx->db->getRow($rs)) { + $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); + $checked = in_array($row['id'], $groupsarray); + if ($modx->hasPermission('access_permissions')) { + if ($checked) { + $notPublic = true; + } + $chks .= '
    \n"; + } else { + if ($checked) { + $chks = '' . "\n" . $chks; + } + } + } + if ($modx->hasPermission('access_permissions')) { + $chks = '
    ' . "\n" . $chks; + } + echo $chks; + ?>
    @@ -716,11 +717,11 @@ function makePublic(b) { invokeEvent('OnModFormRender', array('id' => $id)); - if(is_array($evtOut)) { - echo implode('', $evtOut); - } - ?> + // invoke OnModFormRender event + $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id)); + if (is_array($evtOut)) { + echo implode('', $evtOut); + } + ?> diff --git a/manager/actions/mutate_module_resources.dynamic.php b/manager/actions/mutate_module_resources.dynamic.php index c7afe8e1ac..61ffcbb973 100755 --- a/manager/actions/mutate_module_resources.dynamic.php +++ b/manager/actions/mutate_module_resources.dynamic.php @@ -1,10 +1,10 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('edit_module')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('edit_module')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; @@ -25,92 +25,92 @@ // check to see the editor isn't locked $rs = $modx->db->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='" . $modx->getLoginUserID() . "'"); -if($username = $modx->db->getValue($rs)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $username, 'module')); +if ($username = $modx->db->getValue($rs)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $username, 'module')); } // end check for lock // take action -switch($_REQUEST['op']) { - case 'add': - // convert ids to numbers - $opids = array_filter(array_map('intval', explode(',', $_REQUEST['newids']))); - - if(count($opids) > 0) { - // 1-snips, 2-tpls, 3-tvs, 4-chunks, 5-plugins, 6-docs - $rt = strtolower($_REQUEST["rt"]); - if($rt == 'chunk') { - $type = 10; - } - if($rt == 'doc') { - $type = 20; - } - if($rt == 'plug') { - $type = 30; - } - if($rt == 'snip') { - $type = 40; - } - if($rt == 'tpl') { - $type = 50; - } - if($rt == 'tv') { - $type = 60; - } - $modx->db->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'"); - foreach($opids as $opid) { - $modx->db->insert(array( - 'module' => $id, - 'resource' => $opid, - 'type' => $type, - ), $tbl_site_module_depobj); - } - } - break; - case 'del': - // convert ids to numbers - $opids = array_filter(array_map('intval', $_REQUEST['depid'])); - - // get resources that needs to be removed - $ds = $modx->db->select('*', $tbl_site_module_depobj, "id IN (" . implode(",", $opids) . ")"); - // loop through resources and look for plugins and snippets - $plids = array(); - $snid = array(); - while($row = $modx->db->getRow($ds)) { - if($row['type'] == '30') { - $plids[$i] = $row['resource']; - } - if($row['type'] == '40') { - $snids[$i] = $row['resource']; - } - } - // get guid - $ds = $modx->db->select('guid', $tbl_site_modules, "id='{$id}'"); - $guid = $modx->db->getValue($ds); - // reset moduleguid for deleted resources - if(($cp = count($plids)) || ($cs = count($snids))) { - if($cp) { - $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $plids) . ") AND moduleguid='{$guid}'"); - } - if($cs) { - $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'"); - } - // reset cache - $modx->clearCache('full'); - } - $modx->db->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")"); - break; +switch ($_REQUEST['op']) { + case 'add': + // convert ids to numbers + $opids = array_filter(array_map('intval', explode(',', $_REQUEST['newids']))); + + if (count($opids) > 0) { + // 1-snips, 2-tpls, 3-tvs, 4-chunks, 5-plugins, 6-docs + $rt = strtolower($_REQUEST["rt"]); + if ($rt == 'chunk') { + $type = 10; + } + if ($rt == 'doc') { + $type = 20; + } + if ($rt == 'plug') { + $type = 30; + } + if ($rt == 'snip') { + $type = 40; + } + if ($rt == 'tpl') { + $type = 50; + } + if ($rt == 'tv') { + $type = 60; + } + $modx->db->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'"); + foreach ($opids as $opid) { + $modx->db->insert(array( + 'module' => $id, + 'resource' => $opid, + 'type' => $type, + ), $tbl_site_module_depobj); + } + } + break; + case 'del': + // convert ids to numbers + $opids = array_filter(array_map('intval', $_REQUEST['depid'])); + + // get resources that needs to be removed + $ds = $modx->db->select('*', $tbl_site_module_depobj, "id IN (" . implode(",", $opids) . ")"); + // loop through resources and look for plugins and snippets + $plids = array(); + $snid = array(); + while ($row = $modx->db->getRow($ds)) { + if ($row['type'] == '30') { + $plids[$i] = $row['resource']; + } + if ($row['type'] == '40') { + $snids[$i] = $row['resource']; + } + } + // get guid + $ds = $modx->db->select('guid', $tbl_site_modules, "id='{$id}'"); + $guid = $modx->db->getValue($ds); + // reset moduleguid for deleted resources + if (($cp = count($plids)) || ($cs = count($snids))) { + if ($cp) { + $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $plids) . ") AND moduleguid='{$guid}'"); + } + if ($cs) { + $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'"); + } + // reset cache + $modx->clearCache('full'); + } + $modx->db->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")"); + break; } // load record $rs = $modx->db->select('*', $tbl_site_modules, "id = '{$id}'"); $content = $modx->db->getRow($rs); -if(!$content) { - $modx->webAlertAndQuit("Module not found for id '{$id}'."); +if (!$content) { + $modx->webAlertAndQuit("Module not found for id '{$id}'."); } $_SESSION['itemname'] = $content['name']; -if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } ?> @@ -203,7 +203,7 @@ function openSelector(resource, mode, callback, w, h) { db->select("smd.id,COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) as name, + $ds = $modx->db->select("smd.id,COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) as name, CASE smd.type WHEN 10 THEN 'Chunk' WHEN 20 THEN 'Document' @@ -218,18 +218,18 @@ function openSelector(resource, mode, callback, w, h) { LEFT JOIN {$tbl_site_snippets} AS ss ON ss.id = smd.resource AND smd.type = '40' LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = '50' LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = '60'", "smd.module={$id}", "smd.type,name"); - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items - $grd->noRecordMsg = $_lang["no_records_found"]; - $grd->cssClass = "grid"; - $grd->columnHeaderClass = "gridHeader"; - $grd->itemClass = "gridItem"; - $grd->altItemClass = "gridAltItem"; - $grd->columns = $_lang["element_name"] . " ," . $_lang["type"]; - $grd->colTypes = "template: [+value+]"; - $grd->fields = "name,type"; - echo $grd->render(); - ?> + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items + $grd->noRecordMsg = $_lang["no_records_found"]; + $grd->cssClass = "grid"; + $grd->columnHeaderClass = "gridHeader"; + $grd->itemClass = "gridItem"; + $grd->altItemClass = "gridAltItem"; + $grd->columns = $_lang["element_name"] . " ," . $_lang["type"]; + $grd->colTypes = "template: [+value+]"; + $grd->fields = "name,type"; + echo $grd->render(); + ?> "> diff --git a/manager/actions/mutate_password.dynamic.php b/manager/actions/mutate_password.dynamic.php index 44ed413422..f2483a4ddb 100755 --- a/manager/actions/mutate_password.dynamic.php +++ b/manager/actions/mutate_password.dynamic.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('change_password')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('change_password')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } ?> diff --git a/manager/actions/mutate_plugin.dynamic.php b/manager/actions/mutate_plugin.dynamic.php index 84c6b357b5..3fd35f4b3c 100755 --- a/manager/actions/mutate_plugin.dynamic.php +++ b/manager/actions/mutate_plugin.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } diff --git a/manager/actions/mutate_plugin_priority.dynamic.php b/manager/actions/mutate_plugin_priority.dynamic.php index 0811873b13..91756906a9 100755 --- a/manager/actions/mutate_plugin_priority.dynamic.php +++ b/manager/actions/mutate_plugin_priority.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_plugin')) { @@ -103,7 +103,7 @@ + ?> INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -switch((int) $modx->manager->action) { - case 35: - if(!$modx->hasPermission('edit_role')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 38: - if(!$modx->hasPermission('new_role')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +switch ((int) $modx->manager->action) { + case 35: + if (!$modx->hasPermission('edit_role')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 38: + if (!$modx->hasPermission('new_role')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $role = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; @@ -23,24 +23,24 @@ $tbl_user_roles = $modx->getFullTableName('user_roles'); // check to see the snippet editor isn't locked -if($lockedEl = $modx->elementIsLocked(8, $role)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['role'])); +if ($lockedEl = $modx->elementIsLocked(8, $role)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['role'])); } // end check for lock // Lock snippet for other users to edit $modx->lockElement(8, $role); -if($modx->manager->action == '35') { - $rs = $modx->db->select('*', $tbl_user_roles, "id='{$role}'"); - $roledata = $modx->db->getRow($rs); - if(!$roledata) { - $modx->webAlertAndQuit("No role returned!"); - } - $_SESSION['itemname'] = $roledata['name']; +if ($modx->manager->action == '35') { + $rs = $modx->db->select('*', $tbl_user_roles, "id='{$role}'"); + $roledata = $modx->db->getRow($rs); + if (!$roledata) { + $modx->webAlertAndQuit("No role returned!"); + } + $_SESSION['itemname'] = $roledata['name']; } else { - $roledata = 0; - $_SESSION['itemname'] = $_lang["new_role"]; + $roledata = 0; + $_SESSION['itemname'] = $_lang["new_role"]; } // Add lock-element JS-Script @@ -107,63 +107,63 @@ function changestate(element) {

    + echo render_form('frames', $_lang['role_frames'], 'disabled'); + echo render_form('home', $_lang['role_home'], 'disabled'); + echo render_form('messages', $_lang['role_messages']); + echo render_form('logout', $_lang['role_logout'], 'disabled'); + echo render_form('help', $_lang['role_help']); + echo render_form('action_ok', $_lang['role_actionok'], 'disabled'); + echo render_form('error_dialog', $_lang['role_errors'], 'disabled'); + echo render_form('about', $_lang['role_about'], 'disabled'); + echo render_form('credits', $_lang['role_credits'], 'disabled'); + echo render_form('change_password', $_lang['role_change_password']); + echo render_form('save_password', $_lang['role_save_password']); + ?>

    + echo render_form('view_document', $_lang['role_view_docdata'], 'disabled'); + echo render_form('new_document', $_lang['role_create_doc']); + echo render_form('edit_document', $_lang['role_edit_doc']); + echo render_form('change_resourcetype', $_lang['role_change_resourcetype']); + echo render_form('save_document', $_lang['role_save_doc']); + echo render_form('publish_document', $_lang['role_publish_doc']); + echo render_form('delete_document', $_lang['role_delete_doc']); + echo render_form('empty_trash', $_lang['role_empty_trash']); + echo render_form('empty_cache', $_lang['role_cache_refresh']); + echo render_form('view_unpublished', $_lang['role_view_unpublished']); + ?>

    + echo render_form('file_manager', $_lang['role_file_manager']); + echo render_form('assets_files', $_lang['role_assets_files']); + echo render_form('assets_images', $_lang['role_assets_images']); + ?>

    + echo render_form('category_manager', $_lang['role_category_manager']); + ?>

    + echo render_form('new_module', $_lang['role_new_module']); + echo render_form('edit_module', $_lang['role_edit_module']); + echo render_form('save_module', $_lang['role_save_module']); + echo render_form('delete_module', $_lang['role_delete_module']); + echo render_form('exec_module', $_lang['role_run_module']); + ?>
    @@ -173,44 +173,44 @@ function changestate(element) {

    + echo render_form('new_template', $_lang['role_create_template']); + echo render_form('edit_template', $_lang['role_edit_template']); + echo render_form('save_template', $_lang['role_save_template']); + echo render_form('delete_template', $_lang['role_delete_template']); + ?>

    + echo render_form('new_snippet', $_lang['role_create_snippet']); + echo render_form('edit_snippet', $_lang['role_edit_snippet']); + echo render_form('save_snippet', $_lang['role_save_snippet']); + echo render_form('delete_snippet', $_lang['role_delete_snippet']); + ?>

    + echo render_form('new_chunk', $_lang['role_create_chunk']); + echo render_form('edit_chunk', $_lang['role_edit_chunk']); + echo render_form('save_chunk', $_lang['role_save_chunk']); + echo render_form('delete_chunk', $_lang['role_delete_chunk']); + ?>

    + echo render_form('new_plugin', $_lang['role_create_plugin']); + echo render_form('edit_plugin', $_lang['role_edit_plugin']); + echo render_form('save_plugin', $_lang['role_save_plugin']); + echo render_form('delete_plugin', $_lang['role_delete_plugin']); + ?>
    @@ -220,42 +220,42 @@ function changestate(element) {

    + echo render_form('new_user', $_lang['role_new_user']); + echo render_form('edit_user', $_lang['role_edit_user']); + echo render_form('save_user', $_lang['role_save_user']); + echo render_form('delete_user', $_lang['role_delete_user']); + ?>

    + echo render_form('new_web_user', $_lang['role_new_web_user']); + echo render_form('edit_web_user', $_lang['role_edit_web_user']); + echo render_form('save_web_user', $_lang['role_save_web_user']); + echo render_form('delete_web_user', $_lang['role_delete_web_user']); + ?>

    + echo render_form('access_permissions', $_lang['role_access_persmissions']); + echo render_form('web_access_permissions', $_lang['role_web_access_persmissions']); + ?>

    + echo render_form('new_role', $_lang['role_new_role']); + echo render_form('edit_role', $_lang['role_edit_role']); + echo render_form('save_role', $_lang['role_save_role']); + echo render_form('delete_role', $_lang['role_delete_role']); + ?>
    @@ -265,23 +265,23 @@ function changestate(element) {

    + echo render_form('view_eventlog', $_lang['role_view_eventlog']); + echo render_form('delete_eventlog', $_lang['role_delete_eventlog']); + ?>

    + echo render_form('logs', $_lang['role_view_logs']); + echo render_form('settings', $_lang['role_edit_settings']); + echo render_form('bk_manager', $_lang['role_bk_manager']); + echo render_form('import_static', $_lang['role_import_static']); + echo render_form('export_static', $_lang['role_export_static']); + echo render_form('remove_locks', $_lang['role_remove_locks']); + echo render_form('display_locks', $_lang['role_display_locks']); + ?>
    @@ -299,33 +299,35 @@ function changestate(element) { * @param string $status * @return string */ -function render_form($name, $label, $status = '') { - $modx = evolutionCMS(); global $roledata; +function render_form($name, $label, $status = '') +{ + $modx = evolutionCMS(); + global $roledata; - $tpl = '
    - +
    @@ -124,9 +124,15 @@
    [(auto_template_logic)]

    -
    -
    -
    +
    +
    +
    @@ -135,16 +141,17 @@ db->getRecordCount( - $modx->db->select('id', '[+prefix+]site_plugins', + $modx->db->select('id', '[+prefix+]site_plugins', "plugincode LIKE '%phx.parser.class.inc.php%OnParseDocument();%' AND disabled != 1") ); - if($count) { + if ($count) { $disabledFilters = 1; - echo ''.$_lang['enable_filter_phx_warning'].'
    '; + echo '' . $_lang['enable_filter_phx_warning'] . '
    '; + } else { + $disabledFilters = false; } - else $disabledFilters = false; ?> -
    +
    @@ -152,7 +159,7 @@
    [(enable_at_syntax)] -
    +
    @@ -167,8 +174,8 @@
    [(publish_default)] -
    - +
    +
    @@ -176,24 +183,24 @@
    [(cache_default)] -
    - +
    +

    [(search_default)] -
    - +
    +

    [(auto_menuindex)] -
    - +
    +
    @@ -203,9 +210,9 @@ @@ -242,14 +249,14 @@ @@ -259,10 +266,9 @@ @@ -288,8 +294,8 @@ @@ -301,7 +307,9 @@ invokeEvent('OnSiteSettingsRender'); - if(is_array($evtOut)) echo implode("",$evtOut); + if (is_array($evtOut)) { + echo implode("", $evtOut); + } ?> diff --git a/manager/actions/mutate_settings/tab2_furl_settings.inc.php b/manager/actions/mutate_settings/tab2_furl_settings.inc.php index 2269244e37..526bc44333 100755 --- a/manager/actions/mutate_settings/tab2_furl_settings.inc.php +++ b/manager/actions/mutate_settings/tab2_furl_settings.inc.php @@ -6,7 +6,7 @@ @@ -20,7 +20,7 @@ @@ -56,8 +56,8 @@ > > @@ -71,8 +71,8 @@ > > @@ -86,8 +86,8 @@ > > @@ -101,8 +101,8 @@ > > @@ -115,8 +115,8 @@ > > @@ -129,8 +129,8 @@ > > @@ -143,8 +143,8 @@ > > @@ -159,7 +159,9 @@ invokeEvent('OnFriendlyURLSettingsRender'); - if(is_array($evtOut)) echo implode("",$evtOut); + if (is_array($evtOut)) { + echo implode("", $evtOut); + } ?> diff --git a/manager/actions/mutate_settings/tab3_user_settings.inc.php b/manager/actions/mutate_settings/tab3_user_settings.inc.php index c190b78fb6..201b087a32 100755 --- a/manager/actions/mutate_settings/tab3_user_settings.inc.php +++ b/manager/actions/mutate_settings/tab3_user_settings.inc.php @@ -6,7 +6,7 @@ @@ -55,8 +55,8 @@ @@ -157,7 +157,9 @@ invokeEvent('OnUserSettingsRender'); - if(is_array($evtOut)) echo implode("",$evtOut); + if (is_array($evtOut)) { + echo implode("", $evtOut); + } ?> diff --git a/manager/actions/mutate_settings/tab4_manager_settings.inc.php b/manager/actions/mutate_settings/tab4_manager_settings.inc.php index 4fac9f68b2..190c709708 100755 --- a/manager/actions/mutate_settings/tab4_manager_settings.inc.php +++ b/manager/actions/mutate_settings/tab4_manager_settings.inc.php @@ -180,7 +180,7 @@ function SetUrl(url, width, height, alt) { @@ -194,7 +194,7 @@ function SetUrl(url, width, height, alt) { diff --git a/manager/actions/mutate_settings/tab5_security_settings.inc.php b/manager/actions/mutate_settings/tab5_security_settings.inc.php index 78c039a8a3..97d5143f15 100755 --- a/manager/actions/mutate_settings/tab5_security_settings.inc.php +++ b/manager/actions/mutate_settings/tab5_security_settings.inc.php @@ -1,6 +1,6 @@ @@ -89,10 +89,10 @@ @@ -103,11 +103,11 @@ +
    +
    +
    +
    +$modx->config['emailsender']));?> @@ -115,8 +115,8 @@ @@ -157,7 +157,9 @@ @@ -186,7 +188,9 @@ ?> @@ -226,7 +230,9 @@ invokeEvent('OnSecuritySettingsRender'); - if(is_array($evtOut)) echo implode("",$evtOut); + if (is_array($evtOut)) { + echo implode("", $evtOut); + } ?> diff --git a/manager/actions/mutate_settings/tab6_filemanager_settings.inc.php b/manager/actions/mutate_settings/tab6_filemanager_settings.inc.php index 67a5059a2c..e38e020fb8 100755 --- a/manager/actions/mutate_settings/tab6_filemanager_settings.inc.php +++ b/manager/actions/mutate_settings/tab6_filemanager_settings.inc.php @@ -113,7 +113,9 @@ invokeEvent('OnFileManagerSettingsRender'); - if(is_array($evtOut)) echo implode("",$evtOut); + if (is_array($evtOut)) { + echo implode("", $evtOut); + } ?> diff --git a/manager/actions/mutate_settings/tab7_filebrowser_settings.inc.php b/manager/actions/mutate_settings/tab7_filebrowser_settings.inc.php index 2534a2de5d..198f385bad 100755 --- a/manager/actions/mutate_settings/tab7_filebrowser_settings.inc.php +++ b/manager/actions/mutate_settings/tab7_filebrowser_settings.inc.php @@ -6,7 +6,7 @@ @@ -235,7 +235,9 @@ invokeEvent('OnMiscSettingsRender'); - if(is_array($evtOut)) echo implode("",$evtOut); + if (is_array($evtOut)) { + echo implode("", $evtOut); + } ?> diff --git a/manager/actions/mutate_snippet.dynamic.php b/manager/actions/mutate_snippet.dynamic.php index 75bd9b9c88..70bf425c41 100755 --- a/manager/actions/mutate_snippet.dynamic.php +++ b/manager/actions/mutate_snippet.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } @@ -46,7 +46,7 @@ $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $content['properties'] = str_replace("&", "&", $content['properties']); -} else if (isset($_REQUEST['itemname'])) { +} elseif (isset($_REQUEST['itemname'])) { $content['name'] = $_REQUEST['itemname']; } else { $_SESSION['itemname'] = $_lang["new_snippet"]; diff --git a/manager/actions/mutate_template_tv_rank.dynamic.php b/manager/actions/mutate_template_tv_rank.dynamic.php index 70518f964d..d0933b3a01 100755 --- a/manager/actions/mutate_template_tv_rank.dynamic.php +++ b/manager/actions/mutate_template_tv_rank.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_template')) { @@ -137,7 +137,7 @@ function resetSortOrder()
    + ?>

    diff --git a/manager/actions/mutate_templates.dynamic.php b/manager/actions/mutate_templates.dynamic.php index 4b46fa9ac0..8dc46bb62e 100755 --- a/manager/actions/mutate_templates.dynamic.php +++ b/manager/actions/mutate_templates.dynamic.php @@ -1,21 +1,21 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -switch($modx->manager->action) { - case 16: - if(!$modx->hasPermission('edit_template')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 19: - if(!$modx->hasPermission('new_template')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +switch ($modx->manager->action) { + case 16: + if (!$modx->hasPermission('edit_template')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 19: + if (!$modx->hasPermission('new_template')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; @@ -23,8 +23,8 @@ $tbl_site_templates = $modx->getFullTableName('site_templates'); // check to see the snippet editor isn't locked -if($lockedEl = $modx->elementIsLocked(1, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['template'])); +if ($lockedEl = $modx->elementIsLocked(1, $id)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['template'])); } // end check for lock @@ -32,24 +32,24 @@ $modx->lockElement(1, $id); $content = array(); -if(!empty($id)) { - $rs = $modx->db->select('*', $tbl_site_templates, "id='{$id}'"); - $content = $modx->db->getRow($rs); - if(!$content) { - $modx->webAlertAndQuit("No database record has been found for this template."); - } - - $_SESSION['itemname'] = $content['templatename']; - if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } +if (!empty($id)) { + $rs = $modx->db->select('*', $tbl_site_templates, "id='{$id}'"); + $content = $modx->db->getRow($rs); + if (!$content) { + $modx->webAlertAndQuit("No database record has been found for this template."); + } + + $_SESSION['itemname'] = $content['templatename']; + if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } } else { - $_SESSION['itemname'] = $_lang["new_template"]; - $content['category'] = (int)$_REQUEST['catid']; + $_SESSION['itemname'] = $_lang["new_template"]; + $content['category'] = (int)$_REQUEST['catid']; } -if($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); +if ($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); } $content = array_merge($content, $_POST); @@ -98,12 +98,12 @@
    invokeEvent("OnTempFormPrerender", array("id" => $id)); - if(is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> + // invoke OnTempFormPrerender event + $evtOut = $modx->invokeEvent("OnTempFormPrerender", array("id" => $id)); + if (is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> @@ -132,14 +132,14 @@

    - hasPermission('save_role')): ?> + hasPermission('save_role')): ?>
    @@ -177,7 +177,7 @@
    - hasPermission('save_role')): ?> + hasPermission('save_role')): ?>
    @@ -197,38 +197,38 @@ db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category", $_lang['no_category']), sprintf("%s tv + $selectedTvs = array(); + if (!isset($_POST['assignedTv'])) { + $rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category", $_lang['no_category']), sprintf("%s tv LEFT JOIN %s tr ON tv.id=tr.tmplvarid LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "templateid='{$id}'", "tr.rank DESC, tv.rank DESC, tvcaption DESC, tvid DESC" // workaround for correct sort of none-existing ranks - ); - while($row = $modx->db->getRow($rs)) { - $selectedTvs[$row['tvid']] = $row; - } - $selectedTvs = array_reverse($selectedTvs, true); // reverse ORDERBY DESC - } - - $unselectedTvs = array(); - $rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category, cat.id as catid", $_lang['no_category']), sprintf("%s tv + ); + while ($row = $modx->db->getRow($rs)) { + $selectedTvs[$row['tvid']] = $row; + } + $selectedTvs = array_reverse($selectedTvs, true); // reverse ORDERBY DESC + } + + $unselectedTvs = array(); + $rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category, cat.id as catid", $_lang['no_category']), sprintf("%s tv LEFT JOIN %s tr ON tv.id=tr.tmplvarid LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "", "category, tvcaption"); - while($row = $modx->db->getRow($rs)) { - $unselectedTvs[$row['tvid']] = $row; - } - - // Catch checkboxes if form not validated - if(isset($_POST['assignedTv'])) { - $selectedTvs = array(); - foreach($_POST['assignedTv'] as $tvid) { - if(isset($unselectedTvs[$tvid])) { - $selectedTvs[$tvid] = $unselectedTvs[$tvid]; - } - }; - } - - $total = count($selectedTvs); - ?> + while ($row = $modx->db->getRow($rs)) { + $unselectedTvs[$row['tvid']] = $row; + } + + // Catch checkboxes if form not validated + if (isset($_POST['assignedTv'])) { + $selectedTvs = array(); + foreach ($_POST['assignedTv'] as $tvid) { + if (isset($unselectedTvs[$tvid])) { + $selectedTvs[$tvid] = $unselectedTvs[$tvid]; + } + }; + } + + $total = count($selectedTvs); + ?>
    @@ -238,65 +238,64 @@
    0) { - echo '

    ' . $_lang['template_tv_msg'] . '

    '; - } - if($modx->hasPermission('save_template') && $total > 1 && $id) { - echo sprintf('', $id, $_lang['template_tv_edit']); - } - - // Selected TVs - $tvList = ''; - if($total > 0) { - $tvList .= '
      '; - foreach($selectedTvs as $row) { - $desc = !empty($row['tvdescription']) ? '  (' . $row['tvdescription'] . ')' : ''; - $locked = $row['tvlocked'] ? ' (' . $_lang['locked'] . ')' : ""; - $tvList .= sprintf('
    • %s %s
    • ', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); - } - $tvList .= '
    '; - - } else { - echo $_lang['template_no_tv']; - } - echo $tvList; - - // Unselected TVs - $tvList = '

    ' . $_lang['template_notassigned_tv'] . '

      '; - $preCat = ''; - $insideUl = 0; - while($row = array_shift($unselectedTvs)) { - if(isset($selectedTvs[$row['tvid']])) { - continue; - } // Skip selected - $row['category'] = stripslashes($row['category']); //pixelchutes - if($preCat !== $row['category']) { - $tvList .= $insideUl ? '
    ' : ''; - $tvList .= '
  • ' . $row['category'] . ($row['catid'] != '' ? ' (' . $row['catid'] . ')' : '') . '
      '; - $insideUl = 1; - } - - $desc = !empty($row['tvdescription']) ? '  (' . $row['tvdescription'] . ')' : ''; - $locked = $row['tvlocked'] ? ' (' . $_lang['locked'] . ')' : ""; - $tvList .= sprintf('
    • %s %s
    • ', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); - $tvList .= ''; - - $preCat = $row['category']; - } - $tvList .= $insideUl ? '
    ' : ''; - $tvList .= ''; - echo $tvList; - - ?> + if ($total > 0) { + echo '

    ' . $_lang['template_tv_msg'] . '

    '; + } + if ($modx->hasPermission('save_template') && $total > 1 && $id) { + echo sprintf('', $id, $_lang['template_tv_edit']); + } + + // Selected TVs + $tvList = ''; + if ($total > 0) { + $tvList .= '
      '; + foreach ($selectedTvs as $row) { + $desc = !empty($row['tvdescription']) ? '  (' . $row['tvdescription'] . ')' : ''; + $locked = $row['tvlocked'] ? ' (' . $_lang['locked'] . ')' : ""; + $tvList .= sprintf('
    • %s %s
    • ', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); + } + $tvList .= '
    '; + } else { + echo $_lang['template_no_tv']; + } + echo $tvList; + + // Unselected TVs + $tvList = '

    ' . $_lang['template_notassigned_tv'] . '

      '; + $preCat = ''; + $insideUl = 0; + while ($row = array_shift($unselectedTvs)) { + if (isset($selectedTvs[$row['tvid']])) { + continue; + } // Skip selected + $row['category'] = stripslashes($row['category']); //pixelchutes + if ($preCat !== $row['category']) { + $tvList .= $insideUl ? '
    ' : ''; + $tvList .= '
  • ' . $row['category'] . ($row['catid'] != '' ? ' (' . $row['catid'] . ')' : '') . '
      '; + $insideUl = 1; + } + + $desc = !empty($row['tvdescription']) ? '  (' . $row['tvdescription'] . ')' : ''; + $locked = $row['tvlocked'] ? ' (' . $_lang['locked'] . ')' : ""; + $tvList .= sprintf('
    • %s %s
    • ', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); + $tvList .= ''; + + $preCat = $row['category']; + } + $tvList .= $insideUl ? '
    ' : ''; + $tvList .= ''; + echo $tvList; + + ?>
  • invokeEvent("OnTempFormRender", array("id" => $id)); - if(is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> + // invoke OnTempFormRender event + $evtOut = $modx->invokeEvent("OnTempFormRender", array("id" => $id)); + if (is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> diff --git a/manager/actions/mutate_tmplvars.dynamic.php b/manager/actions/mutate_tmplvars.dynamic.php index 895b0e125a..bc780011c8 100755 --- a/manager/actions/mutate_tmplvars.dynamic.php +++ b/manager/actions/mutate_tmplvars.dynamic.php @@ -1,17 +1,17 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('edit_template') && $modx->manager->action == '301') { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('edit_template') && $modx->manager->action == '301') { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } -if(!$modx->hasPermission('new_template') && $modx->manager->action == '300') { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('new_template') && $modx->manager->action == '300') { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; $origin = isset($_REQUEST['or']) ? (int)$_REQUEST['or'] : 76; -$originId = isset($_REQUEST['oid']) ? (int)$_REQUEST['oid'] : NULL; +$originId = isset($_REQUEST['oid']) ? (int)$_REQUEST['oid'] : null; $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); $tbl_site_templates = $modx->getFullTableName('site_templates'); @@ -19,8 +19,8 @@ $tbl_documentgroup_names = $modx->getFullTableName('documentgroup_names'); // check to see the snippet editor isn't locked -if($lockedEl = $modx->elementIsLocked(2, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar'])); +if ($lockedEl = $modx->elementIsLocked(2, $id)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar'])); } // end check for lock @@ -29,26 +29,26 @@ global $content; $content = array(); -if(isset($_GET['id'])) { - $rs = $modx->db->select('*', $tbl_site_tmplvars, "id='{$id}'"); - $content = $modx->db->getRow($rs); - if(!$content) { - header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}"); - } - - $_SESSION['itemname'] = $content['caption']; - if($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } -} else if(isset($_REQUEST['itemname'])) { - $content['name'] = $_REQUEST['itemname']; +if (isset($_GET['id'])) { + $rs = $modx->db->select('*', $tbl_site_tmplvars, "id='{$id}'"); + $content = $modx->db->getRow($rs); + if (!$content) { + header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}"); + } + + $_SESSION['itemname'] = $content['caption']; + if ($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } +} elseif (isset($_REQUEST['itemname'])) { + $content['name'] = $_REQUEST['itemname']; } else { - $_SESSION['itemname'] = $_lang["new_tmplvars"]; - $content['category'] = (int)$_REQUEST['catid']; + $_SESSION['itemname'] = $_lang["new_tmplvars"]; + $content['category'] = (int)$_REQUEST['catid']; } -if($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); +if ($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); } $content = array_merge($content, $_POST); @@ -61,8 +61,8 @@ // get available RichText Editors $RTEditors = ''; $evtOut = $modx->invokeEvent('OnRichTextEditorRegister', array('forfrontend' => 1)); -if(is_array($evtOut)) { - $RTEditors = implode(',', $evtOut); +if (is_array($evtOut)) { + $RTEditors = implode(',', $evtOut); } ?> @@ -277,12 +277,12 @@ function decode(s) { invokeEvent('OnTVFormPrerender', array('id' => $id)); - if(is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> + // invoke OnTVFormPrerender event + $evtOut = $modx->invokeEvent('OnTVFormPrerender', array('id' => $id)); + if (is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> @@ -314,7 +314,7 @@ function decode(s) {
    - hasPermission('save_role')): ?> + hasPermission('save_role')): ?>
    @@ -383,14 +383,14 @@ function decode(s) { ' . $ctv . ''; - } - } - ?> + $custom_tvs = scandir(MODX_BASE_PATH . 'assets/tvs'); + foreach ($custom_tvs as $ctv) { + if (strpos($ctv, '.') !== 0 && $ctv != 'index.html') { + $selected = ($content['type'] == 'custom_tv:' . $ctv ? "selected='selected'" : ""); + echo ''; + } + } + ?> @@ -455,64 +455,63 @@ function decode(s) { db->select(sprintf("tpl.id AS id, templatename, tpl.description AS tpldescription, tpl.locked AS tpllocked, tpl.selectable AS selectable, tmplvarid, if(isnull(cat.category),'%s',cat.category) AS category, cat.id AS catid", $_lang['no_category']), sprintf("%s as tpl + $rs = $modx->db->select(sprintf("tpl.id AS id, templatename, tpl.description AS tpldescription, tpl.locked AS tpllocked, tpl.selectable AS selectable, tmplvarid, if(isnull(cat.category),'%s',cat.category) AS category, cat.id AS catid", $_lang['no_category']), sprintf("%s as tpl LEFT JOIN %s as stt ON stt.templateid=tpl.id AND stt.tmplvarid='%s' LEFT JOIN %s as cat ON tpl.category=cat.id", $modx->getFullTableName('site_templates'), $modx->getFullTableName('site_tmplvar_templates'), $id, $modx->getFullTableName('categories')), '', "category, templatename"); - $tplList = '
      '; - $preCat = ''; - $insideUl = 0; - while($row = $modx->db->getRow($rs)) { - $row['category'] = stripslashes($row['category']); //pixelchutes - if($preCat !== $row['category']) { - $tplList .= $insideUl ? '
    ' : ''; - $tplList .= '
  • ' . $row['category'] . ($row['catid'] != '' ? ' (' . $row['catid'] . ')' : '') . '
      '; - $insideUl = 1; - } - - if($modx->manager->action == '300' && $modx->config['default_template'] == $row['id']) { - $checked = true; - } elseif(isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) { - $checked = true; - } elseif($id == 0 && is_array($_POST['template'])) { - $checked = in_array($row['id'], $_POST['template']); - } else { - $checked = $row['tmplvarid']; - } - $selectable = !$row['selectable'] ? ' class="disabled"' : ''; - $checked = $checked ? ' checked="checked"' : ''; - $tplId = ' (' . $row['id'] . ')'; - $desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : ''; - - $tplInfo = array(); - if($row['tpllocked']) { - $tplInfo[] = $_lang['locked']; - } - if($row['id'] == $modx->config['default_template']) { - $tplInfo[] = $_lang['defaulttemplate_title']; - } - $tplInfo = !empty($tplInfo) ? ' (' . implode(', ', $tplInfo) . ')' : ''; - - $tplList .= sprintf('
    • %s%s%s%s
    • ', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo); - $tplList .= ''; - - $preCat = $row['category']; - } - $tplList .= $insideUl ? '
    ' : ''; - $tplList .= ''; - echo $tplList; - - ?> + $tplList = '
      '; + $preCat = ''; + $insideUl = 0; + while ($row = $modx->db->getRow($rs)) { + $row['category'] = stripslashes($row['category']); //pixelchutes + if ($preCat !== $row['category']) { + $tplList .= $insideUl ? '
    ' : ''; + $tplList .= '
  • ' . $row['category'] . ($row['catid'] != '' ? ' (' . $row['catid'] . ')' : '') . '
      '; + $insideUl = 1; + } + + if ($modx->manager->action == '300' && $modx->config['default_template'] == $row['id']) { + $checked = true; + } elseif (isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) { + $checked = true; + } elseif ($id == 0 && is_array($_POST['template'])) { + $checked = in_array($row['id'], $_POST['template']); + } else { + $checked = $row['tmplvarid']; + } + $selectable = !$row['selectable'] ? ' class="disabled"' : ''; + $checked = $checked ? ' checked="checked"' : ''; + $tplId = ' (' . $row['id'] . ')'; + $desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : ''; + + $tplInfo = array(); + if ($row['tpllocked']) { + $tplInfo[] = $_lang['locked']; + } + if ($row['id'] == $modx->config['default_template']) { + $tplInfo[] = $_lang['defaulttemplate_title']; + } + $tplInfo = !empty($tplInfo) ? ' (' . implode(', ', $tplInfo) . ')' : ''; + + $tplList .= sprintf('
    • %s%s%s%s
    • ', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo); + $tplList .= ''; + + $preCat = $row['category']; + } + $tplList .= $insideUl ? '
    ' : ''; + $tplList .= ''; + echo $tplList; + + ?> db->select('documentgroup', $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); - $groupsarray = $modx->db->getColumn('documentgroup', $rs); - - ?> - hasPermission('access_permissions')) { ?> + if ($use_udperms == 1) { + // fetch permissions for the variable + $rs = $modx->db->select('documentgroup', $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); + $groupsarray = $modx->db->getColumn('documentgroup', $rs); ?> + hasPermission('access_permissions')) { + ?> diff --git a/manager/actions/mutate_tv_rank.dynamic.php b/manager/actions/mutate_tv_rank.dynamic.php index 46dd598245..ce8500f81d 100755 --- a/manager/actions/mutate_tv_rank.dynamic.php +++ b/manager/actions/mutate_tv_rank.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_template')) { @@ -130,7 +130,7 @@ function resetSortOrder()
    + ?>

    diff --git a/manager/actions/mutate_user.dynamic.php b/manager/actions/mutate_user.dynamic.php index 6c0631d076..e69de29bb2 100755 --- a/manager/actions/mutate_user.dynamic.php +++ b/manager/actions/mutate_user.dynamic.php @@ -1,799 +0,0 @@ -INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); -} - -switch($modx->manager->action) { - case 12: - if(!$modx->hasPermission('edit_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 11: - if(!$modx->hasPermission('new_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); -} - -$user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; - -// check to see the snippet editor isn't locked -$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); -if($username = $modx->db->getValue($rs)) { - $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user")); -} -// end check for lock - -if($modx->manager->action == '12') { - // get user attribute - $rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'"); - $userdata = $modx->db->getRow($rs); - if(!$userdata) { - $modx->webAlertAndQuit("No user returned!"); - } - - - // get user settings - $rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'"); - $usersettings = array(); - while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; - // manually extract so that user display settings are not overwritten - foreach($usersettings as $k => $v) { - if($k != 'manager_language' && $k != 'manager_theme') { - ${$k} = $v; - } - } - - // get user name - $rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'"); - $usernamedata = $modx->db->getRow($rs); - if(!$usernamedata) { - $modx->webAlertAndQuit("No user returned while getting username!"); - } - $_SESSION['itemname'] = $usernamedata['username']; -} else { - $userdata = array(); - $usersettings = array(); - $usernamedata = array(); - $_SESSION['itemname'] = $_lang["new_user"]; -} - -// avoid doubling htmlspecialchars (already encoded in DB) -foreach($userdata as $key => $val) { - $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); -}; -$usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); - -// restore saved form -$formRestored = false; -if($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); - // restore post values - $userdata = array_merge($userdata, $_POST); - $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); - $usernamedata['username'] = $userdata['newusername']; - $usernamedata['oldusername'] = $_POST['oldusername']; - $usersettings = array_merge($usersettings, $userdata); - $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; - extract($usersettings, EXTR_OVERWRITE); -} - -// include the country list language file -$_country_lang = array(); -include_once "lang/country/english_country.inc.php"; -if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { - include_once "lang/country/" . $manager_language . "_country.inc.php"; -} -asort($_country_lang); - -$displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; -if($which_browser == 'default') { - $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser']; -} -?> - - - - invokeEvent("OnUserFormPrerender", array( - "id" => $user - )); - if(is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> - - - " /> - -

    - (' . $usernamedata['id'] . ')' : $_lang['user_title']) ?> -

    - - - - -
    - -
    - -
    -

    - -
  • @@ -233,7 +240,7 @@

    [(enable_cache)]
    -
    +


    [(cache_type)]
    -
    +

    [(minifyphp_incache)]
    -
    +

    [(server_offset_time)]

    [(server_protocol)]
    -
    +

    [(track_visitors)]
    -
    - +
    +

    [(friendly_urls)]
    -
    +

    [(xhtml_urls)]
    -
    +

    [(make_folders)]
    -
    - +
    +

    [(seostrict)]
    -
    - +
    +

    [(aliaslistingfolder)]
    -
    - +
    +

    [(friendly_alias_urls)]
    -
    - +
    +

    [(use_alias_path)]
    -
    - +
    +

    [(allow_duplicate_alias)]
    -
    - +
    +

    [(automatic_alias)]
    -
    - +
    +

    [(use_udperms)]
    -
    +

    [(email_method)]
    -
    - +
    +
    >
    @@ -144,8 +144,8 @@

    [(allow_multiple_emails)]
    -
    - +
    +

    [(login_form_position)]
    -
    +


    [(manager_menu_position)]
    -
    +


    [(allow_eval)]
    -
    -
    -
    - +
    +
    +
    +
    @@ -53,7 +53,7 @@

    [(validate_referer)]
    -
    +

    [(error_reporting)]
    -
    -
    -
    - +
    +
    +
    +

    [(send_errormail)]
    -
    -
    -
    -
    -$modx->config['emailsender']));?>

    [(enable_bindings)]
    -
    - +
    +

    [(pwd_hash_algo)]
    manager->checkHashAlgorithm('BLOWFISH_Y') ? 0:1; $phm['e']['BLOWFISH_A'] = $modx->manager->checkHashAlgorithm('BLOWFISH_A') ? 0:1; $phm['e']['SHA512'] = $modx->manager->checkHashAlgorithm('SHA512') ? 0:1; @@ -165,12 +167,12 @@ $phm['e']['MD5'] = $modx->manager->checkHashAlgorithm('MD5') ? 0:1; $phm['e']['UNCRYPT'] = $modx->manager->checkHashAlgorithm('UNCRYPT') ? 0:1; ?> -
    -
    -
    -
    -
    - +
    +
    +
    +
    +
    +

    [(use_captcha)]

    [(use_browser)]
    -
    +
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - manager->action == '12') { ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?> - - - -
    "> htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?> - - -
    : 
    manager->action == '11' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?> manager->action == "11" ? " checked disabled" : ""; ?>> - " onChange="documentDirty=true;" /> -
    - " id="passwordBlock"> -
    - - /> - -
    - > - -
    -
    - - -
    - - -
    -
    -
    -
    -
    - - /> - -
    - /> - -
    -
    : 
    :  -
    : db->select('name, id', '[+prefix+]user_roles', ($modx->hasPermission('save_role')) ? '' : 'id != 1'); - ?> -
    : 
    : 
    : 
    : 
    : 
    : 
    : 
    : 
    : " onBlur='documentDirty=true;'> - " data-tooltip="">
    : 
    : 
    : 
    : toDateFormat($userdata['lastlogin'] + $server_offset_time) ?>
    :  -    []
    :  time() && $userdata['blockeduntil'] != 0)) ? " checked" : ""; ?>> -
    : " onBlur='documentDirty=true;' readonly> - " data-tooltip="">
    : " onBlur='documentDirty=true;' readonly> - " data-tooltip="">
    - getLoginUserID()) { ?> -

    - -
    - - -
    -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     
     
    /> - -
    - /> -
     
     
    -
    - -
    - -
    - -
    - -
    - -
    - -
     
    -
     

    - [(manager_theme_mode)] -
    - -
    - - -
    - -
    - -
    - -
     
    ">
     
    "> -    - /> - -
     
    "> -    - /> - -
     
    "> -    - /> - -
     
    "> -    - /> - -
     
    ">
     
     
    " />
     
    " />
     
    " />
     
    - invokeEvent("OnInterfaceSettingsRender"); - if(is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> -
    - - -
    -

    - - - - - - - - - - - - - - -
    -
     
    -
    - manager->action == '12') { // only do this bit if the user is being edited - $rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'"); - $groupsarray = $modx->db->getColumn('user_group', $rs); - } - // retain selected doc groups between post - if(is_array($_POST['user_groups'])) { - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; - } - ?> -
    -

    - -

    - db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name'); - while($row = $modx->db->getRow($rs)) { - echo "
    "; - } - } - ?> -
    - - - - invokeEvent("OnUserFormRender", array( - "id" => $user - )); - if(is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> - diff --git a/manager/actions/mutate_web_user.dynamic.php b/manager/actions/mutate_web_user.dynamic.php index c070b64b76..1c2dc7103e 100755 --- a/manager/actions/mutate_web_user.dynamic.php +++ b/manager/actions/mutate_web_user.dynamic.php @@ -1,21 +1,21 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -switch($modx->manager->action) { - case 88: - if(!$modx->hasPermission('edit_web_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 87: - if(!$modx->hasPermission('new_web_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +switch ($modx->manager->action) { + case 88: + if (!$modx->hasPermission('edit_web_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 87: + if (!$modx->hasPermission('new_web_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; @@ -23,65 +23,67 @@ // check to see the snippet editor isn't locked $rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); -if($username = $modx->db->getValue($rs)) { - $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user")); +if ($username = $modx->db->getValue($rs)) { + $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user")); } // end check for lock -if($modx->manager->action == '88') { - // get user attributes - $rs = $modx->db->select('*', $modx->getFullTableName('web_user_attributes'), "internalKey = '{$user}'"); - $userdata = $modx->db->getRow($rs); - if(!$userdata) { - $modx->webAlertAndQuit("No user returned!"); - } - - // get user settings - $rs = $modx->db->select('*', $modx->getFullTableName('web_user_settings'), "webuser = '{$user}'"); - $usersettings = array(); - while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; - extract($usersettings, EXTR_OVERWRITE); - - // get user name - $rs = $modx->db->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'"); - $usernamedata = $modx->db->getRow($rs); - if(!$usernamedata) { - $modx->webAlertAndQuit("No user returned while getting username!"); - } - $_SESSION['itemname'] = $usernamedata['username']; +if ($modx->manager->action == '88') { + // get user attributes + $rs = $modx->db->select('*', $modx->getFullTableName('web_user_attributes'), "internalKey = '{$user}'"); + $userdata = $modx->db->getRow($rs); + if (!$userdata) { + $modx->webAlertAndQuit("No user returned!"); + } + + // get user settings + $rs = $modx->db->select('*', $modx->getFullTableName('web_user_settings'), "webuser = '{$user}'"); + $usersettings = array(); + while ($row = $modx->db->getRow($rs)) { + $usersettings[$row['setting_name']] = $row['setting_value']; + } + extract($usersettings, EXTR_OVERWRITE); + + // get user name + $rs = $modx->db->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'"); + $usernamedata = $modx->db->getRow($rs); + if (!$usernamedata) { + $modx->webAlertAndQuit("No user returned while getting username!"); + } + $_SESSION['itemname'] = $usernamedata['username']; } else { - $userdata = array(); - $usersettings = array(); - $usernamedata = array(); - $_SESSION['itemname'] = $_lang["new_web_user"]; + $userdata = array(); + $usersettings = array(); + $usernamedata = array(); + $_SESSION['itemname'] = $_lang["new_web_user"]; } // avoid doubling htmlspecialchars (already encoded in DB) -foreach($userdata as $key => $val) { - $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); +foreach ($userdata as $key => $val) { + $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); }; $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); // restore saved form $formRestored = false; -if($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); - // restore post values - $userdata = array_merge($userdata, $_POST); - $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); - $usernamedata['username'] = $userdata['newusername']; - $usernamedata['oldusername'] = $_POST['oldusername']; - $usersettings = array_merge($usersettings, $userdata); - $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; - extract($usersettings, EXTR_OVERWRITE); +if ($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); + // restore post values + $userdata = array_merge($userdata, $_POST); + $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); + $usernamedata['username'] = $userdata['newusername']; + $usernamedata['oldusername'] = $_POST['oldusername']; + $usersettings = array_merge($usersettings, $userdata); + $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; + extract($usersettings, EXTR_OVERWRITE); } // include the country list language file $_country_lang = array(); -if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { - include_once "lang/country/" . $manager_language . "_country.inc.php"; +if ($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { + include_once "lang/country/" . $manager_language . "_country.inc.php"; } else { - include_once "lang/country/english_country.inc.php"; + include_once "lang/country/english_country.inc.php"; } asort($_country_lang); @@ -189,12 +191,12 @@ function showHide(what, onoff) {
    invokeEvent("OnWUsrFormPrerender", array("id" => $user)); - if(is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> + // invoke OnWUsrFormPrerender event + $evtOut = $modx->invokeEvent("OnWUsrFormPrerender", array("id" => $user)); + if (is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> " /> @@ -218,19 +220,23 @@ function showHide(what, onoff) { - + - + @@ -324,10 +330,10 @@ function showHide(what, onoff) { $country) { - echo ""; - } - ?> + foreach ($_country_lang as $key => $country) { + echo ""; + } + ?> @@ -351,7 +357,8 @@ function showHide(what, onoff) { - manager->action == '88') { ?> + manager->action == '88') { + ?> @@ -387,8 +394,8 @@ function showHide(what, onoff) { " data-tooltip=""> + } + ?>
    - time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) { ?> + time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) { + ?> - +
    "> htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?> -
    :  
     
    :  
    @@ -496,40 +503,40 @@ function SetUrl(url, width, height, alt) { manager->action == '88') { // only do this bit if the user is being edited - $rs = $modx->db->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'"); - $groupsarray = $modx->db->getColumn('webgroup', $rs); - } - // retain selected user groups between post - if(is_array($_POST['user_groups'])) { - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; - } - ?> + if ($use_udperms == 1) { + $groupsarray = array(); + + if ($modx->manager->action == '88') { // only do this bit if the user is being edited + $rs = $modx->db->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'"); + $groupsarray = $modx->db->getColumn('webgroup', $rs); + } + // retain selected user groups between post + if (is_array($_POST['user_groups'])) { + foreach ($_POST['user_groups'] as $n => $v) { + $groupsarray[] = $v; + } + } ?>

    db->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name'); - while($row = $modx->db->getRow($rs)) { - echo '
    '; - } - } - ?> + $rs = $modx->db->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name'); + while ($row = $modx->db->getRow($rs)) { + echo '
    '; + } + } + ?>
    invokeEvent("OnWUsrFormRender", array( - "id" => $user - )); - if(is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> + // invoke OnWUsrFormRender event + $evtOut = $modx->invokeEvent("OnWUsrFormRender", array( + "id" => $user + )); + if (is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> diff --git a/manager/actions/phpinfo.static.php b/manager/actions/phpinfo.static.php index 5729512f85..1bc0356c99 100755 --- a/manager/actions/phpinfo.static.php +++ b/manager/actions/phpinfo.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } ?> diff --git a/manager/actions/refresh_site.dynamic.php b/manager/actions/refresh_site.dynamic.php index a73ea46e2b..0ec740137f 100755 --- a/manager/actions/refresh_site.dynamic.php +++ b/manager/actions/refresh_site.dynamic.php @@ -1,6 +1,6 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } // (un)publishing of documents, version 2! @@ -29,12 +29,16 @@
    - ' . $_lang["refresh_published"] . '

    ', $num_rows_pub) ?> - ' . $_lang["refresh_unpublished"] . '

    ', $num_rows_unpub) ?> + ' . $_lang["refresh_published"] . '

    ', $num_rows_pub); +} ?> + ' . $_lang["refresh_unpublished"] . '

    ', $num_rows_unpub); +} ?> clearCache('full', true); - // invoke OnSiteRefresh event - $modx->invokeEvent("OnSiteRefresh"); - ?> + $modx->clearCache('full', true); + // invoke OnSiteRefresh event + $modx->invokeEvent("OnSiteRefresh"); + ?>
    diff --git a/manager/actions/resource_selector.static.php b/manager/actions/resource_selector.static.php index 065cb0666e..068bb21295 100755 --- a/manager/actions/resource_selector.static.php +++ b/manager/actions/resource_selector.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('edit_module')) { diff --git a/manager/actions/resources.static.php b/manager/actions/resources.static.php index 7899784644..18e1491e82 100755 --- a/manager/actions/resources.static.php +++ b/manager/actions/resources.static.php @@ -1,50 +1,54 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/functions.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/functions.inc.php'); +if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/functions.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/functions.inc.php'); } else { - include_once(MODX_MANAGER_PATH . 'actions/resources/functions.inc.php'); + include_once(MODX_MANAGER_PATH . 'actions/resources/functions.inc.php'); } -if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/mgrResources.class.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/mgrResources.class.php'); +if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/mgrResources.class.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/mgrResources.class.php'); } else { - include_once(MODX_MANAGER_PATH . 'actions/resources/mgrResources.class.php'); + include_once(MODX_MANAGER_PATH . 'actions/resources/mgrResources.class.php'); } $resources = new mgrResources(); // Prepare lang-strings for "Lock Elements" $unlockTranslations = array( - 'msg' => $_lang["unlock_element_id_warning"], - 'type1' => $_lang["lock_element_type_1"], - 'type2' => $_lang["lock_element_type_2"], - 'type3' => $_lang["lock_element_type_3"], - 'type4' => $_lang["lock_element_type_4"], - 'type5' => $_lang["lock_element_type_5"], - 'type6' => $_lang["lock_element_type_6"], - 'type7' => $_lang["lock_element_type_7"], - 'type8' => $_lang["lock_element_type_8"] + 'msg' => $_lang["unlock_element_id_warning"], + 'type1' => $_lang["lock_element_type_1"], + 'type2' => $_lang["lock_element_type_2"], + 'type3' => $_lang["lock_element_type_3"], + 'type4' => $_lang["lock_element_type_4"], + 'type5' => $_lang["lock_element_type_5"], + 'type6' => $_lang["lock_element_type_6"], + 'type7' => $_lang["lock_element_type_7"], + 'type8' => $_lang["lock_element_type_8"] ); -foreach($unlockTranslations as $key => $value) $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); +foreach ($unlockTranslations as $key => $value) { + $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); +} // Prepare lang-strings for mgrResAction() $mraTranslations = array( - 'create_new' => $_lang["create_new"], - 'edit' => $_lang["edit"], - 'duplicate' => $_lang["duplicate"], - 'remove' => $_lang["remove"], - 'confirm_duplicate_record' => $_lang["confirm_duplicate_record"], - 'confirm_delete_template' => $_lang["confirm_delete_template"], - 'confirm_delete_tmplvars' => $_lang["confirm_delete_tmplvars"], - 'confirm_delete_htmlsnippet' => $_lang["confirm_delete_htmlsnippet"], - 'confirm_delete_snippet' => $_lang["confirm_delete_htmlsnippet"], - 'confirm_delete_plugin' => $_lang["confirm_delete_plugin"], - 'confirm_delete_module' => $_lang["confirm_delete_module"], + 'create_new' => $_lang["create_new"], + 'edit' => $_lang["edit"], + 'duplicate' => $_lang["duplicate"], + 'remove' => $_lang["remove"], + 'confirm_duplicate_record' => $_lang["confirm_duplicate_record"], + 'confirm_delete_template' => $_lang["confirm_delete_template"], + 'confirm_delete_tmplvars' => $_lang["confirm_delete_tmplvars"], + 'confirm_delete_htmlsnippet' => $_lang["confirm_delete_htmlsnippet"], + 'confirm_delete_snippet' => $_lang["confirm_delete_htmlsnippet"], + 'confirm_delete_plugin' => $_lang["confirm_delete_plugin"], + 'confirm_delete_module' => $_lang["confirm_delete_module"], ); -foreach($mraTranslations as $key => $value) $mraTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); +foreach ($mraTranslations as $key => $value) { + $mraTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); +} ?> @@ -65,46 +69,46 @@ config['manager_theme'] . '/actions/resources/tab1_templates.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab1_templates.inc.php'); - } else { - include_once(MODX_MANAGER_PATH . '/actions/resources/tab1_templates.inc.php'); - } + if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab1_templates.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab1_templates.inc.php'); + } else { + include_once(MODX_MANAGER_PATH . '/actions/resources/tab1_templates.inc.php'); + } - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab2_templatevars.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab2_templatevars.inc.php'); - } else { - include_once(MODX_MANAGER_PATH . '/actions/resources/tab2_templatevars.inc.php'); - } + if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab2_templatevars.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab2_templatevars.inc.php'); + } else { + include_once(MODX_MANAGER_PATH . '/actions/resources/tab2_templatevars.inc.php'); + } - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab3_chunks.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab3_chunks.inc.php'); - } else { - include_once(MODX_MANAGER_PATH . '/actions/resources/tab3_chunks.inc.php'); - } + if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab3_chunks.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab3_chunks.inc.php'); + } else { + include_once(MODX_MANAGER_PATH . '/actions/resources/tab3_chunks.inc.php'); + } - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab4_snippets.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab4_snippets.inc.php'); - } else { - include_once(MODX_MANAGER_PATH . '/actions/resources/tab4_snippets.inc.php'); - } + if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab4_snippets.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab4_snippets.inc.php'); + } else { + include_once(MODX_MANAGER_PATH . '/actions/resources/tab4_snippets.inc.php'); + } - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab5_plugins.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab5_plugins.inc.php'); - } else { - include_once(MODX_MANAGER_PATH . '/actions/resources/tab5_plugins.inc.php'); - } + if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab5_plugins.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab5_plugins.inc.php'); + } else { + include_once(MODX_MANAGER_PATH . '/actions/resources/tab5_plugins.inc.php'); + } - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab6_categoryview.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab6_categoryview.inc.php'); - } else { - include_once(MODX_MANAGER_PATH . '/actions/resources/tab6_categoryview.inc.php'); - } + if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab6_categoryview.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab6_categoryview.inc.php'); + } else { + include_once(MODX_MANAGER_PATH . '/actions/resources/tab6_categoryview.inc.php'); + } - if(is_numeric($_GET['tab'])) { - echo ''; - } - ?> + if (is_numeric($_GET['tab'])) { + echo ''; + } + ?> diff --git a/manager/actions/resources/functions.inc.php b/manager/actions/resources/functions.inc.php index 0c52eaa27f..680e0e3236 100755 --- a/manager/actions/resources/functions.inc.php +++ b/manager/actions/resources/functions.inc.php @@ -1,14 +1,14 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } $tpl = array( - 'viewForm' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_viewForm.tpl'), - 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), - 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), - 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), - 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl') + 'viewForm' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_viewForm.tpl'), + 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), + 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), + 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), + 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl') ); /** @@ -16,22 +16,26 @@ * @param array $ph * @return string */ -function parsePh($tpl, $ph) { - $modx = evolutionCMS(); global $_lang; - $tpl = $modx->parseText($tpl, $_lang, '[%', '%]'); - return $modx->parseText($tpl, $ph); +function parsePh($tpl, $ph) +{ + $modx = evolutionCMS(); + global $_lang; + $tpl = $modx->parseText($tpl, $_lang, '[%', '%]'); + return $modx->parseText($tpl, $ph); } /** * @param string|int $cssId * @return string */ -function renderViewSwitchButtons($cssId) { - $modx = evolutionCMS(); global $_lang, $tpl; +function renderViewSwitchButtons($cssId) +{ + $modx = evolutionCMS(); + global $_lang, $tpl; - return parsePh($tpl['viewForm'], array( - 'cssId' => $cssId - )); + return parsePh($tpl['viewForm'], array( + 'cssId' => $cssId + )); } /** @@ -39,108 +43,112 @@ function renderViewSwitchButtons($cssId) { * @param mgrResources $resources * @return string */ -function createResourceList($resourceTable, $resources) { - $modx = evolutionCMS(); global $_lang, $_style, $modx_textdir, $tpl; +function createResourceList($resourceTable, $resources) +{ + $modx = evolutionCMS(); + global $_lang, $_style, $modx_textdir, $tpl; - $items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false; + $items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false; - if( ! is_array($items) || empty($items)) { - return $_lang['no_results']; - } + if (! is_array($items) || empty($items)) { + return $_lang['no_results']; + } - // Prepare elements- and categories-list - $elements = array(); - $categories = array(); - foreach($items as $row) { - $catid = $row['catid'] ? $row['catid'] : 0; - $categories[$catid] = array('name' => stripslashes($row['category'])); - $elements[$catid][] = prepareElementRowPh($row, $resourceTable, $resources); - } + // Prepare elements- and categories-list + $elements = array(); + $categories = array(); + foreach ($items as $row) { + $catid = $row['catid'] ? $row['catid'] : 0; + $categories[$catid] = array('name' => stripslashes($row['category'])); + $elements[$catid][] = prepareElementRowPh($row, $resourceTable, $resources); + } - // Now render categories / panel-collapse - $panelGroup = ''; - foreach($elements as $catid => $elList) { - // Add panel-heading / category-collapse to output - $panelGroup .= parsePh($tpl['panelHeading'], array( - 'tab' => $resourceTable, - 'category' => $categories[$catid]['name'], - 'categoryid' => $catid != '' ? ' (' . $catid . ')' : '', - 'catid' => $catid, - )); + // Now render categories / panel-collapse + $panelGroup = ''; + foreach ($elements as $catid => $elList) { + // Add panel-heading / category-collapse to output + $panelGroup .= parsePh($tpl['panelHeading'], array( + 'tab' => $resourceTable, + 'category' => $categories[$catid]['name'], + 'categoryid' => $catid != '' ? ' (' . $catid . ')' : '', + 'catid' => $catid, + )); - // Prepare content for panel-collapse - $panelCollapse = ''; - foreach($elList as $el) { - $panelCollapse .= parsePh($tpl['elementsRow'], $el); - } + // Prepare content for panel-collapse + $panelCollapse = ''; + foreach ($elList as $el) { + $panelCollapse .= parsePh($tpl['elementsRow'], $el); + } - // Add panel-collapse with elements to output - $panelGroup .= parsePh($tpl['panelCollapse'], array( - 'tab' => $resourceTable, - 'catid' => $catid, - 'wrapper' => $panelCollapse, - )); - } + // Add panel-collapse with elements to output + $panelGroup .= parsePh($tpl['panelCollapse'], array( + 'tab' => $resourceTable, + 'catid' => $catid, + 'wrapper' => $panelCollapse, + )); + } - return parsePh($tpl['panelGroup'], array( - 'resourceTable' => $resourceTable, - 'wrapper' => $panelGroup - )); + return parsePh($tpl['panelGroup'], array( + 'resourceTable' => $resourceTable, + 'wrapper' => $panelGroup + )); } /** * @param mgrResources $resources * @return string */ -function createCombinedView($resources) { - $modx = evolutionCMS(); global $_lang, $_style, $modx_textdir; +function createCombinedView($resources) +{ + $modx = evolutionCMS(); + global $_lang, $_style, $modx_textdir; - $itemsPerCategory = isset($resources->itemsPerCategory) ? $resources->itemsPerCategory : false; - $types = isset($resources->types) ? $resources->types : false; - $categories = isset($resources->categories) ? $resources->categories : false; + $itemsPerCategory = isset($resources->itemsPerCategory) ? $resources->itemsPerCategory : false; + $types = isset($resources->types) ? $resources->types : false; + $categories = isset($resources->categories) ? $resources->categories : false; - if(!$itemsPerCategory) { - return $_lang['no_results']; - } + if (!$itemsPerCategory) { + return $_lang['no_results']; + } - $tpl = array( - 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), - 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), - 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), - 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl'), - ); + $tpl = array( + 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), + 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), + 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), + 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl'), + ); - // Easily loop through $itemsPerCategory-Array - $panelGroup = ''; - foreach($categories as $catid => $category) { - // Prepare collapse content / elements-list - $panelCollapse = ''; - foreach($itemsPerCategory[$catid] as $el) { - $resourceTable = $el['type']; - $ph = prepareElementRowPh($el, $resourceTable, $resources); - $panelCollapse .= parsePh($tpl['elementsRow'], $ph); - } + // Easily loop through $itemsPerCategory-Array + $panelGroup = ''; + foreach ($categories as $catid => $category) { + // Prepare collapse content / elements-list + $panelCollapse = ''; + foreach ($itemsPerCategory[$catid] as $el) { + $resourceTable = $el['type']; + $ph = prepareElementRowPh($el, $resourceTable, $resources); + $panelCollapse .= parsePh($tpl['elementsRow'], $ph); + } - // Add panel-heading / button - $panelGroup .= parsePh($tpl['panelHeading'], array( - 'tab' => 'categories_list', - 'category' => $categories[$catid], - 'categoryid' => $catid != '' ? ' (' . $catid . ')' : '', - 'catid' => $catid, - )); + // Add panel-heading / button + $panelGroup .= parsePh($tpl['panelHeading'], array( + 'tab' => 'categories_list', + 'category' => $categories[$catid], + 'categoryid' => $catid != '' ? ' (' . $catid . ')' : '', + 'catid' => $catid, + )); - // Add panel - $panelGroup .= parsePh($tpl['panelCollapse'], array( - 'tab' => 'categories_list', - 'catid' => $catid, - 'wrapper' => $panelCollapse, - )); - } + // Add panel + $panelGroup .= parsePh($tpl['panelCollapse'], array( + 'tab' => 'categories_list', + 'catid' => $catid, + 'wrapper' => $panelCollapse, + )); + } - return parsePh($tpl['panelGroup'], array( - 'resourceTable' => 'categories_list', - 'wrapper' => $panelGroup - )); + return parsePh($tpl['panelGroup'], array( + 'resourceTable' => 'categories_list', + 'wrapper' => $panelGroup + )); } /** @@ -149,14 +157,16 @@ function createCombinedView($resources) { * @param mgrResources $resources * @return array */ -function prepareElementRowPh($row, $resourceTable, $resources) { - $modx = evolutionCMS(); global $modx_textdir, $_style, $_lang; +function prepareElementRowPh($row, $resourceTable, $resources) +{ + $modx = evolutionCMS(); + global $modx_textdir, $_style, $_lang; - $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false; + $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false; - $_lang["confirm_delete"] = $_lang["delete"]; + $_lang["confirm_delete"] = $_lang["delete"]; - switch($resourceTable){ + switch ($resourceTable) { case 'site_templates': $class = $row['selectable'] ? '' : 'disabledPlugin'; $lockElementType = 1; @@ -190,77 +200,77 @@ function prepareElementRowPh($row, $resourceTable, $resources) { return array(); } - // Prepare displaying user-locks - $lockedByUser = ''; - $rowLock = $modx->elementIsLocked($lockElementType, $row['id'], true); - if($rowLock && $modx->hasPermission('display_locks')) { - if($rowLock['sid'] == $modx->sid) { - $title = $modx->parseText($_lang["lock_element_editing"], array( - 'element_type' => $_lang["lock_element_type_" . $lockElementType], - 'lasthit_df' => $rowLock['lasthit_df'] - )); - $lockedByUser = '' . $_style['tree_preview_resource'] . ' '; - } else { - $title = $modx->parseText($_lang["lock_element_locked_by"], array( - 'element_type' => $_lang["lock_element_type_" . $lockElementType], - 'username' => $rowLock['username'], - 'lasthit_df' => $rowLock['lasthit_df'] - )); - if($modx->hasPermission('remove_locks')) { - $lockedByUser = ''; - } else { - $lockedByUser = ''; - } - } - } - if($lockedByUser) { - $lockedByUser = '
    ' . $lockedByUser . '
    '; - } + // Prepare displaying user-locks + $lockedByUser = ''; + $rowLock = $modx->elementIsLocked($lockElementType, $row['id'], true); + if ($rowLock && $modx->hasPermission('display_locks')) { + if ($rowLock['sid'] == $modx->sid) { + $title = $modx->parseText($_lang["lock_element_editing"], array( + 'element_type' => $_lang["lock_element_type_" . $lockElementType], + 'lasthit_df' => $rowLock['lasthit_df'] + )); + $lockedByUser = '' . $_style['tree_preview_resource'] . ' '; + } else { + $title = $modx->parseText($_lang["lock_element_locked_by"], array( + 'element_type' => $_lang["lock_element_type_" . $lockElementType], + 'username' => $rowLock['username'], + 'lasthit_df' => $rowLock['lasthit_df'] + )); + if ($modx->hasPermission('remove_locks')) { + $lockedByUser = ''; + } else { + $lockedByUser = ''; + } + } + } + if ($lockedByUser) { + $lockedByUser = '
    ' . $lockedByUser . '
    '; + } - // Caption - if($resourceTable == 'site_tmplvars') { - $caption = !empty($row['description']) ? ' ' . $row['caption'] . '   (' . $row['description'] . ')' : ' ' . $row['caption']; - } else { - $caption = !empty($row['description']) ? ' ' . $row['description'] : ''; - } + // Caption + if ($resourceTable == 'site_tmplvars') { + $caption = !empty($row['description']) ? ' ' . $row['caption'] . '   (' . $row['description'] . ')' : ' ' . $row['caption']; + } else { + $caption = !empty($row['description']) ? ' ' . $row['description'] : ''; + } - // Special marks - $tplInfo = array(); - if($row['locked']) { - $tplInfo[] = $_lang['locked']; - } - if($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') { - $tplInfo[] = $_lang['defaulttemplate_title']; - } - $marks = !empty($tplInfo) ? ' (' . implode(', ', $tplInfo) . ')' : ''; + // Special marks + $tplInfo = array(); + if ($row['locked']) { + $tplInfo[] = $_lang['locked']; + } + if ($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') { + $tplInfo[] = $_lang['defaulttemplate_title']; + } + $marks = !empty($tplInfo) ? ' (' . implode(', ', $tplInfo) . ')' : ''; - /* row buttons */ - $buttons = ''; - if($modx->hasPermission($types['actions']['edit'][1])) { - $buttons .= '
  • '; - } - if($modx->hasPermission($types['actions']['duplicate'][1])) { - $buttons .= '
  • '; - } - if($modx->hasPermission($types['actions']['remove'][1])) { - $buttons .= '
  • '; - } - $buttons = $buttons ? '
      ' . $buttons . '
    ' : ''; + /* row buttons */ + $buttons = ''; + if ($modx->hasPermission($types['actions']['edit'][1])) { + $buttons .= '
  • '; + } + if ($modx->hasPermission($types['actions']['duplicate'][1])) { + $buttons .= '
  • '; + } + if ($modx->hasPermission($types['actions']['remove'][1])) { + $buttons .= '
  • '; + } + $buttons = $buttons ? '
      ' . $buttons . '
    ' : ''; - $catid = $row['catid'] ? $row['catid'] : 0; + $catid = $row['catid'] ? $row['catid'] : 0; - // Placeholders for elements-row - return array( - 'class' => $class ? ' class="' . $class . '"' : '', - 'lockedByUser' => $lockedByUser, - 'name' => $row['name'], - 'caption' => $caption, - 'buttons' => $buttons, - 'marks' => $marks, - 'id' => $row['id'], - 'resourceTable' => $resourceTable, - 'actionEdit' => $types['actions']['edit'][0], - 'catid' => $catid, - 'textdir' => $modx_textdir ? '‏' : '', - ); + // Placeholders for elements-row + return array( + 'class' => $class ? ' class="' . $class . '"' : '', + 'lockedByUser' => $lockedByUser, + 'name' => $row['name'], + 'caption' => $caption, + 'buttons' => $buttons, + 'marks' => $marks, + 'id' => $row['id'], + 'resourceTable' => $resourceTable, + 'actionEdit' => $types['actions']['edit'][0], + 'catid' => $catid, + 'textdir' => $modx_textdir ? '‏' : '', + ); } diff --git a/manager/actions/resources/mgrResources.class.php b/manager/actions/resources/mgrResources.class.php index 2b34adb3c3..54b7473345 100755 --- a/manager/actions/resources/mgrResources.class.php +++ b/manager/actions/resources/mgrResources.class.php @@ -1,13 +1,14 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -class mgrResources { +class mgrResources +{ /** * @var array */ - public $types = array(); + public $types = array(); /** * @var array */ @@ -24,82 +25,91 @@ class mgrResources { /** * mgrResources constructor. */ - public function __construct() { - $this->setTypes(); - $this->queryItemsFromDB(); - $this->prepareCategoryArrays(); - } + public function __construct() + { + $this->setTypes(); + $this->queryItemsFromDB(); + $this->prepareCategoryArrays(); + } /** * @return void */ - public function setTypes() { - global $_lang; - $this->types['site_templates'] = array( - 'title'=>$_lang["manage_templates"], - 'actions'=>array( 'edit'=>array(16,'edit_template'), 'duplicate'=>array(96,'new_template'), 'remove'=>array(21,'delete_template') ), - 'permissions'=>array('new_template','edit_template'), - 'name'=>'templatename' - ); - $this->types['site_tmplvars'] = array( - 'title'=>$_lang["tmplvars"], - 'actions'=>array('edit'=>array(301,'edit_template'), 'duplicate'=>array(304,'edit_template'), 'remove'=>array(303,'edit_template')), - 'permissions'=>array('new_template','edit_template'), - ); - $this->types['site_htmlsnippets'] = array( - 'title'=>$_lang["manage_htmlsnippets"], - 'actions'=>array('edit'=>array(78,'edit_chunk'), 'duplicate'=>array(97,'new_chunk'), 'remove'=>array(80,'delete_chunk')), - 'permissions'=>array('new_chunk','edit_chunk'), - ); - $this->types['site_snippets'] = array( - 'title'=>$_lang["manage_snippets"], - 'actions'=>array('edit'=>array(22,'edit_snippet'), 'duplicate'=>array(98,'new_snippet'), 'remove'=>array(25,'delete_snippet')), - 'permissions'=>array('new_snippet','edit_snippet'), - ); - $this->types['site_plugins'] = array( - 'title'=>$_lang["manage_plugins"], - 'actions'=>array('edit'=>array(102,'edit_plugin'), 'duplicate'=>array(105,'new_plugin'), 'remove'=>array(104,'delete_plugin')), - 'permissions'=>array('new_plugin','edit_plugin'), - ); - $this->types['site_modules'] = array( - 'title'=>$_lang["manage_modules"], - 'actions'=>array('edit'=>array(108,'edit_module'), 'duplicate'=>array(111,'new_module'), 'remove'=>array(110,'delete_module')), - 'permissions'=>array('new_module','edit_module'), - ); - } + public function setTypes() + { + global $_lang; + $this->types['site_templates'] = array( + 'title'=>$_lang["manage_templates"], + 'actions'=>array( 'edit'=>array(16,'edit_template'), 'duplicate'=>array(96,'new_template'), 'remove'=>array(21,'delete_template') ), + 'permissions'=>array('new_template','edit_template'), + 'name'=>'templatename' + ); + $this->types['site_tmplvars'] = array( + 'title'=>$_lang["tmplvars"], + 'actions'=>array('edit'=>array(301,'edit_template'), 'duplicate'=>array(304,'edit_template'), 'remove'=>array(303,'edit_template')), + 'permissions'=>array('new_template','edit_template'), + ); + $this->types['site_htmlsnippets'] = array( + 'title'=>$_lang["manage_htmlsnippets"], + 'actions'=>array('edit'=>array(78,'edit_chunk'), 'duplicate'=>array(97,'new_chunk'), 'remove'=>array(80,'delete_chunk')), + 'permissions'=>array('new_chunk','edit_chunk'), + ); + $this->types['site_snippets'] = array( + 'title'=>$_lang["manage_snippets"], + 'actions'=>array('edit'=>array(22,'edit_snippet'), 'duplicate'=>array(98,'new_snippet'), 'remove'=>array(25,'delete_snippet')), + 'permissions'=>array('new_snippet','edit_snippet'), + ); + $this->types['site_plugins'] = array( + 'title'=>$_lang["manage_plugins"], + 'actions'=>array('edit'=>array(102,'edit_plugin'), 'duplicate'=>array(105,'new_plugin'), 'remove'=>array(104,'delete_plugin')), + 'permissions'=>array('new_plugin','edit_plugin'), + ); + $this->types['site_modules'] = array( + 'title'=>$_lang["manage_modules"], + 'actions'=>array('edit'=>array(108,'edit_module'), 'duplicate'=>array(111,'new_module'), 'remove'=>array(110,'delete_module')), + 'permissions'=>array('new_module','edit_module'), + ); + } /** * @return void */ - public function queryItemsFromDB() { - foreach($this->types as $resourceTable=>$type) { - if($this->hasAnyPermissions($type['permissions'])) { - $nameField = isset($type['name']) ? $type['name'] : 'name'; - $this->items[$resourceTable] = $this->queryResources($resourceTable, $nameField); - } - } - } + public function queryItemsFromDB() + { + foreach ($this->types as $resourceTable=>$type) { + if ($this->hasAnyPermissions($type['permissions'])) { + $nameField = isset($type['name']) ? $type['name'] : 'name'; + $this->items[$resourceTable] = $this->queryResources($resourceTable, $nameField); + } + } + } /** * @param array $permissions * @return bool */ - public function hasAnyPermissions($permissions) { - $modx = evolutionCMS(); + public function hasAnyPermissions($permissions) + { + $modx = evolutionCMS(); - foreach($permissions as $p) - if($modx->hasPermission($p)) return true; + foreach ($permissions as $p) { + if ($modx->hasPermission($p)) { + return true; + } + } - return false; - } + return false; + } /** * @param string $resourceTable * @param string $nameField * @return array|bool */ - public function queryResources($resourceTable, $nameField = 'name') { - $modx = evolutionCMS(); global $_lang; + public function queryResources($resourceTable, $nameField = 'name') + { + $modx = evolutionCMS(); + global $_lang; $allowed = array( 'site_htmlsnippets', @@ -107,59 +117,63 @@ public function queryResources($resourceTable, $nameField = 'name') { 'site_plugins', 'site_modules' ); - $pluginsql = !empty($resourceTable) && in_array($resourceTable, $allowed) ? $resourceTable . '.disabled, ' : ''; - - $tvsql = ''; - $tvjoin = ''; - if ($resourceTable === 'site_tmplvars') { - $tvsql = 'site_tmplvars.caption, '; - $tvjoin = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl', $modx->getFullTableName('site_tmplvar_templates')); - $sttfield = 'IF(stt.templateid,1,0) AS reltpl,'; - } - else $sttfield = ''; - - $selectableTemplates = $resourceTable === 'site_templates' ? "{$resourceTable}.selectable, " : ""; - - $rs = $modx->db->select( - "{$sttfield} {$pluginsql} {$tvsql} {$resourceTable}.{$nameField} as name, {$resourceTable}.id, {$resourceTable}.description, {$resourceTable}.locked, {$selectableTemplates}IF(isnull(categories.category),'{$_lang['no_category']}',categories.category) as category, categories.id as catid", - $modx->getFullTableName($resourceTable) . " AS {$resourceTable} + $pluginsql = !empty($resourceTable) && in_array($resourceTable, $allowed) ? $resourceTable . '.disabled, ' : ''; + + $tvsql = ''; + $tvjoin = ''; + if ($resourceTable === 'site_tmplvars') { + $tvsql = 'site_tmplvars.caption, '; + $tvjoin = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl', $modx->getFullTableName('site_tmplvar_templates')); + $sttfield = 'IF(stt.templateid,1,0) AS reltpl,'; + } else { + $sttfield = ''; + } + + $selectableTemplates = $resourceTable === 'site_templates' ? "{$resourceTable}.selectable, " : ""; + + $rs = $modx->db->select( + "{$sttfield} {$pluginsql} {$tvsql} {$resourceTable}.{$nameField} as name, {$resourceTable}.id, {$resourceTable}.description, {$resourceTable}.locked, {$selectableTemplates}IF(isnull(categories.category),'{$_lang['no_category']}',categories.category) as category, categories.id as catid", + $modx->getFullTableName($resourceTable) . " AS {$resourceTable} LEFT JOIN " . $modx->getFullTableName('categories') . " AS categories ON {$resourceTable}.category = categories.id {$tvjoin}", - "", - "category,name" - ); - $limit = $modx->db->getRecordCount($rs); + "", + "category,name" + ); + $limit = $modx->db->getRecordCount($rs); - if($limit < 1) return false; + if ($limit < 1) { + return false; + } - $result = array(); - while ($row = $modx->db->getRow($rs)) { - $result[] = $row; - } - return $result; - } + $result = array(); + while ($row = $modx->db->getRow($rs)) { + $result[] = $row; + } + return $result; + } /** * @return void */ - public function prepareCategoryArrays() { - foreach($this->items as $type=>$items) { - foreach((array)$items as $item) { - $catid = $item['catid'] ? $item['catid'] : 0; - $this->categories[$catid] = $item['category']; - - $item['type'] = $type; - $this->itemsPerCategory[$catid][] = $item; - } - } - - // Sort categories by name - natcasesort($this->categories); - - // Now sort by name - foreach($this->itemsPerCategory as $catid=>$items) { - usort($this->itemsPerCategory[$catid], function ($a, $b) { - return strcasecmp($a['name'], $b['name']); - }); - } - } + public function prepareCategoryArrays() + { + foreach ($this->items as $type=>$items) { + foreach ((array)$items as $item) { + $catid = $item['catid'] ? $item['catid'] : 0; + $this->categories[$catid] = $item['category']; + + $item['type'] = $type; + $this->itemsPerCategory[$catid][] = $item; + } + } + + // Sort categories by name + natcasesort($this->categories); + + // Now sort by name + foreach ($this->itemsPerCategory as $catid=>$items) { + usort($this->itemsPerCategory[$catid], function ($a, $b) { + return strcasecmp($a['name'], $b['name']); + }); + } + } } diff --git a/manager/actions/resources/tab1_templates.inc.php b/manager/actions/resources/tab1_templates.inc.php index 23b0758e87..59a41c2a2f 100755 --- a/manager/actions/resources/tab1_templates.inc.php +++ b/manager/actions/resources/tab1_templates.inc.php @@ -1,10 +1,11 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (isset($resources->items['site_templates'])) { ?> +if (isset($resources->items['site_templates'])) { + ?>

    @@ -35,4 +36,5 @@ initViews('tmp', 'template', 'site_templates')
    - + diff --git a/manager/actions/resources/tab2_templatevars.inc.php b/manager/actions/resources/tab2_templatevars.inc.php index 72d8f8d4e7..667d3542ce 100755 --- a/manager/actions/resources/tab2_templatevars.inc.php +++ b/manager/actions/resources/tab2_templatevars.inc.php @@ -1,10 +1,11 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (isset($resources->items['site_tmplvars'])) { ?> +if (isset($resources->items['site_tmplvars'])) { + ?>

    @@ -40,4 +41,5 @@ initViews('tv', 'tv', 'site_tmplvars')
    - + diff --git a/manager/actions/resources/tab3_chunks.inc.php b/manager/actions/resources/tab3_chunks.inc.php index 6183b1afb9..fda510755b 100755 --- a/manager/actions/resources/tab3_chunks.inc.php +++ b/manager/actions/resources/tab3_chunks.inc.php @@ -1,10 +1,11 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (isset($resources->items['site_htmlsnippets'])) { ?> +if (isset($resources->items['site_htmlsnippets'])) { + ?>

    @@ -36,4 +37,5 @@ initViews('ch', 'chunks', 'site_htmlsnippets')
    - + diff --git a/manager/actions/resources/tab4_snippets.inc.php b/manager/actions/resources/tab4_snippets.inc.php index 921b4e4089..68190d5948 100755 --- a/manager/actions/resources/tab4_snippets.inc.php +++ b/manager/actions/resources/tab4_snippets.inc.php @@ -1,10 +1,11 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (isset($resources->items['site_snippets'])) { ?> +if (isset($resources->items['site_snippets'])) { + ?>

    @@ -36,4 +37,5 @@ initViews('sn', 'snippets', 'site_snippets')
    - + diff --git a/manager/actions/resources/tab5_plugins.inc.php b/manager/actions/resources/tab5_plugins.inc.php index b07db5ab55..198deb4aac 100755 --- a/manager/actions/resources/tab5_plugins.inc.php +++ b/manager/actions/resources/tab5_plugins.inc.php @@ -1,10 +1,11 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (isset($resources->items['site_plugins'])) { ?> +if (isset($resources->items['site_plugins'])) { + ?>

    @@ -19,16 +20,21 @@
    - hasPermission('new_plugin')) { ?> + hasPermission('new_plugin')) { + ?> "> - - hasPermission('save_plugin')) { ?> + + hasPermission('save_plugin')) { + ?> "> - + hasPermission('delete_plugin') && $_SESSION['mgrRole'] == 1) { $tbl_site_plugins = $modx->getFullTableName('site_plugins'); - if ($modx->db->getRecordCount($modx->db->query("SELECT id FROM {$tbl_site_plugins} t1 WHERE disabled = 1 AND name IN (SELECT name FROM {$tbl_site_plugins} t2 WHERE t1.name = t2.name AND t1.id != t2.id)"))) { ?> + if ($modx->db->getRecordCount($modx->db->query("SELECT id FROM {$tbl_site_plugins} t1 WHERE disabled = 1 AND name IN (SELECT name FROM {$tbl_site_plugins} t2 WHERE t1.name = t2.name AND t1.id != t2.id)"))) { + ?>
    - + diff --git a/manager/actions/resources/tab6_categoryview.inc.php b/manager/actions/resources/tab6_categoryview.inc.php index 2f118d79d9..9c7263ad9f 100755 --- a/manager/actions/resources/tab6_categoryview.inc.php +++ b/manager/actions/resources/tab6_categoryview.inc.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } ?> diff --git a/manager/actions/role_management.static.php b/manager/actions/role_management.static.php index bd6adb1dce..41504d52a6 100755 --- a/manager/actions/role_management.static.php +++ b/manager/actions/role_management.static.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('edit_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('edit_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } ?> @@ -18,14 +18,14 @@
    db->select('name, id, description', $modx->getFullTableName('user_roles'), '', 'name'); - $limit = $modx->db->getRecordCount($rs); - if($limit < 1) { - ?> + $rs = $modx->db->select('name, id, description', $modx->getFullTableName('user_roles'), '', 'name'); + $limit = $modx->db->getRecordCount($rs); + if ($limit < 1) { + ?>

    + } else { + ?>
    @@ -37,29 +37,29 @@ db->getRow($rs)) { - if($row['id'] == 1) { - ?> + while ($row = $modx->db->getRow($rs)) { + if ($row['id'] == 1) { + ?> + } else { + ?> + } + } ?>
    - +
    diff --git a/manager/actions/search.static.php b/manager/actions/search.static.php index 86f76bafcd..e640556c4d 100755 --- a/manager/actions/search.static.php +++ b/manager/actions/search.static.php @@ -1,5 +1,5 @@ getFullTableName('site_tmplvar_contentvalues'); - $articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'"; - $articul_result = $modx->db->query($articul_query); - $articul_id_array = $modx->db->makeArray($articul_result); - if(count($articul_id_array)>0){ - $articul_id = ''; - $i = 1; - foreach( $articul_id_array as $articul ) { - $articul_id.=$articul['contentid']; - if($i !== count($articul_id_array)){ - $articul_id.=','; - } - $i++; - } - $articul_id_query = " OR sc.id IN ({$articul_id})"; - }else{ - $articul_id_query = ''; - } - /*end search by TV*/ + /*start search by TV. Added Rising13*/ + $tbl_site_tmplvar_contentvalues = $modx->getFullTableName('site_tmplvar_contentvalues'); + $articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'"; + $articul_result = $modx->db->query($articul_query); + $articul_id_array = $modx->db->makeArray($articul_result); + if (count($articul_id_array)>0) { + $articul_id = ''; + $i = 1; + foreach ($articul_id_array as $articul) { + $articul_id.=$articul['contentid']; + if ($i !== count($articul_id_array)) { + $articul_id.=','; + } + $i++; + } + $articul_id_query = " OR sc.id IN ({$articul_id})"; + } else { + $articul_id_query = ''; + } + /*end search by TV*/ if (ctype_digit($searchfields)) { $sqladd .= "sc.id='{$searchfields}'"; if (strlen($searchfields) > 3) { - $sqladd .= $articul_id_query;//search by TV + $sqladd .= $articul_id_query;//search by TV $sqladd .= " OR sc.pagetitle LIKE '%{$searchfields}%'"; } } if ($idFromAlias) { $sqladd .= $sqladd != '' ? ' OR ' : ''; $sqladd .= "sc.id='{$idFromAlias}'"; - } $sqladd = $sqladd ? "({$sqladd})" : $sqladd; @@ -160,7 +159,7 @@ $sqladd .= $articul_id_query;//search by TV $sqladd .= ")"; } - } else if ($idFromAlias) { + } elseif ($idFromAlias) { $sqladd .= " sc.id='{$idFromAlias}'"; } @@ -179,7 +178,7 @@ // get document groups for current user if (!empty($modx->config['use_udperms']) && $sqladd) { $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; - $mgrRole = (isset ($_SESSION['mgrRole']) && $_SESSION['mgrRole'] == 1) ? 1 : 0; + $mgrRole = (isset($_SESSION['mgrRole']) && $_SESSION['mgrRole'] == 1) ? 1 : 0; $docgrp_cond = $docgrp ? " OR dg.document_group IN ({$docgrp})" : ''; $fields .= ', MAX(IF(1=' . $mgrRole . ' OR sc.privatemgr=0' . $docgrp_cond . ',1,0)) AS hasAccess'; $sqladd = '(' . $sqladd . ") AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); @@ -196,9 +195,7 @@ $limit = $modx->db->getRecordCount($rs); } else { $limit = 0; - } - - ?> + } ?> @@ -207,12 +204,10 @@
    ' . $_lang['search_results_returned_msg'] . '

    ', $limit); - ?> + printf('

    ' . $_lang['search_results_returned_msg'] . '

    ', $limit); ?> @@ -242,25 +237,24 @@ 'image/png' => $_style["tree_page_png"] ); - while ($row = $modx->db->getRow($rs)) { - // figure out the icon for the document... - $icon = ""; - if ($row['type'] == 'reference') { - $icon .= $_style["tree_linkgo"]; - } elseif ($row['isfolder'] == 0) { - $icon .= isset($icons[$row['contenttype']]) ? $icons[$row['contenttype']] : $_style["tree_page_html"]; - } else { - $icon .= $_style['tree_folder_new']; - } - - $tdClass = ""; - if ($row['published'] == 0) { - $tdClass .= ' class="unpublishedNode"'; - } - if ($row['deleted'] == 1) { - $tdClass .= ' class="deletedNode"'; - } - ?> + while ($row = $modx->db->getRow($rs)) { + // figure out the icon for the document... + $icon = ""; + if ($row['type'] == 'reference') { + $icon .= $_style["tree_linkgo"]; + } elseif ($row['isfolder'] == 0) { + $icon .= isset($icons[$row['contenttype']]) ? $icons[$row['contenttype']] : $_style["tree_page_html"]; + } else { + $icon .= $_style['tree_folder_new']; + } + + $tdClass = ""; + if ($row['published'] == 0) { + $tdClass .= ' class="unpublishedNode"'; + } + if ($row['deleted'] == 1) { + $tdClass .= ' class="deletedNode"'; + } ?> > 35 ? substr($row['description'], 0, 35) . '...' : $row['description'] ?> + } ?> + } ?>
    @@ -280,16 +274,13 @@ > 20 ? substr($row['pagetitle'], 0, 20) . '...' : $row['pagetitle'] ?>
      ' . $output . '
    ' : '1'; - } - - ?> + } ?> INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('view_eventlog')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('view_eventlog')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } ?> @@ -17,14 +17,14 @@
    db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC'); - $limit = $modx->db->getRecordCount($rs); - if($limit < 1) { - ?> + $rs = $modx->db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC'); + $limit = $modx->db->getRecordCount($rs); + if ($limit < 1) { + ?>

    + } else { + ?>
    @@ -36,34 +36,33 @@ db->getRow($rs)) { - ?> + while ($row = $modx->db->getRow($rs)) { + ?> + } ?>
    toDateFormat($row['pub_date'] + $server_offset_time) ?>
    + } + ?>
    db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC'); - $limit = $modx->db->getRecordCount($rs); - if($limit < 1) { - ?> + $rs = $modx->db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC'); + $limit = $modx->db->getRecordCount($rs); + if ($limit < 1) { + ?>

    + } else { + ?>
    @@ -75,34 +74,33 @@ db->getRow($rs)) { - ?> + while ($row = $modx->db->getRow($rs)) { + ?> + } ?>
    toDateFormat($row['unpub_date'] + $server_offset_time) ?>
    + } + ?>
    db->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC"); - $limit = $modx->db->getRecordCount($rs); - if($limit < 1) { - ?> + $rs = $modx->db->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC"); + $limit = $modx->db->getRecordCount($rs); + if ($limit < 1) { + ?>

    + } else { + ?>
    @@ -115,8 +113,8 @@ db->getRow($rs)) { - ?> + while ($row = $modx->db->getRow($rs)) { + ?> @@ -124,14 +122,13 @@ + } ?>
    toDateFormat($row['unpub_date'] + $server_offset_time) ?>
    + } + ?>
    diff --git a/manager/actions/sysinfo.static.php b/manager/actions/sysinfo.static.php index 6ac4cab6fd..a12908da6d 100755 --- a/manager/actions/sysinfo.static.php +++ b/manager/actions/sysinfo.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('logs')) { @@ -110,20 +110,19 @@ function viewPHPInfo() $modx->db->config['table_prefix'] . 'event_log', $modx->db->config['table_prefix'] . 'manager_log', ); - if ($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) { - echo ""; - echo "" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . ""; - echo ""; - } else { - echo "" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . ""; - } + if ($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) { + echo ""; + echo "" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . ""; + echo ""; + } else { + echo "" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . ""; + } - if ($modx->hasPermission('settings')) { - echo "" . ($log_status['Data_free'] > 0 ? "" . $modx->nicesize($log_status['Data_free']) . "" : "-") . ""; - } else { - echo "" . ($log_status['Data_free'] > 0 ? $modx->nicesize($log_status['Data_free']) : "-") . ""; - } - ?> + if ($modx->hasPermission('settings')) { + echo "" . ($log_status['Data_free'] > 0 ? "" . $modx->nicesize($log_status['Data_free']) . "" : "-") . ""; + } else { + echo "" . ($log_status['Data_free'] > 0 ? $modx->nicesize($log_status['Data_free']) : "-") . ""; + } ?> nicesize($log_status['Data_length'] - $log_status['Data_free']) ?> nicesize($log_status['Index_length']) ?> nicesize($log_status['Index_length'] + $log_status['Data_length'] + $log_status['Data_free']) ?> @@ -144,9 +143,11 @@ function viewPHPInfo() - 0) { ?> + 0) { + ?>

    - + diff --git a/manager/actions/user_management.static.php b/manager/actions/user_management.static.php index 8402d14429..4e26c6b077 100755 --- a/manager/actions/user_management.static.php +++ b/manager/actions/user_management.static.php @@ -1,22 +1,22 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('edit_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('edit_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // initialize page view state - the $_PAGE object $modx->manager->initPageViewState(); // get and save search string -if($_REQUEST['op'] == 'reset') { - $query = ''; - $_PAGE['vs']['search'] = ''; +if ($_REQUEST['op'] == 'reset') { + $query = ''; + $_PAGE['vs']['search'] = ''; } else { - $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; - $sqlQuery = $modx->db->escape($query); - $_PAGE['vs']['search'] = $query; + $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; + $sqlQuery = $modx->db->escape($query); + $_PAGE['vs']['search'] = $query; } // get & save listmode @@ -120,55 +120,55 @@ function menuAction(a) {
    hasPermission('save_role')) { - $where .= (empty($where) ? "" : " AND ") . "mua.role != 1"; - } - if(!empty($sqlQuery)) { - $where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))"; - } - $ds = $modx->db->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, ELT(mua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin", $modx->getFullTableName('manager_users') . " AS mu + $where = ""; + if (!$modx->hasPermission('save_role')) { + $where .= (empty($where) ? "" : " AND ") . "mua.role != 1"; + } + if (!empty($sqlQuery)) { + $where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))"; + } + $ds = $modx->db->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, ELT(mua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin", $modx->getFullTableName('manager_users') . " AS mu INNER JOIN " . $modx->getFullTableName('user_attributes') . " AS mua ON mua.internalKey=mu.id LEFT JOIN " . $modx->getFullTableName('user_roles') . " AS rname ON mua.role=rname.id", $where, 'mua.blocked ASC, mua.thislogin DESC'); - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items - $grd->noRecordMsg = $_lang["no_records_found"]; - $grd->cssClass = "table data"; - $grd->columnHeaderClass = "tableHeader"; - $grd->itemClass = "tableItem"; - $grd->altItemClass = "tableAltItem"; - $grd->fields = "id,username,fullname,role,email,gender,blocked,thislogin"; - $grd->columns = implode(',', array( - $_lang["icon"], - $_lang["name"], - $_lang["user_full_name"], - $_lang['role'], - $_lang["email"], - $_lang["user_gender"], - $_lang["user_block"], - $_lang["login_button"] - )); - $grd->colWidths = "1%,,,,,,1%,1%"; - $grd->colAligns = "center,,,,,center,center,right' nowrap='nowrap"; - $grd->colTypes = implode('||', array( - 'template:', - 'template:[+value+]', - 'template:[+fullname+]', - 'template:[+role+]', - 'template:[+email+]', - 'template:[+gender+]', - 'template:[+blocked+]', - 'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M' - )); - if($listmode == '1') { - $grd->pageSize = 0; - } - if($_REQUEST['op'] == 'reset') { - $grd->pageNumber = 1; - } - // render grid - echo $grd->render(); - ?> + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items + $grd->noRecordMsg = $_lang["no_records_found"]; + $grd->cssClass = "table data"; + $grd->columnHeaderClass = "tableHeader"; + $grd->itemClass = "tableItem"; + $grd->altItemClass = "tableAltItem"; + $grd->fields = "id,username,fullname,role,email,gender,blocked,thislogin"; + $grd->columns = implode(',', array( + $_lang["icon"], + $_lang["name"], + $_lang["user_full_name"], + $_lang['role'], + $_lang["email"], + $_lang["user_gender"], + $_lang["user_block"], + $_lang["login_button"] + )); + $grd->colWidths = "1%,,,,,,1%,1%"; + $grd->colAligns = "center,,,,,center,center,right' nowrap='nowrap"; + $grd->colTypes = implode('||', array( + 'template:', + 'template:[+value+]', + 'template:[+fullname+]', + 'template:[+role+]', + 'template:[+email+]', + 'template:[+gender+]', + 'template:[+blocked+]', + 'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M' + )); + if ($listmode == '1') { + $grd->pageSize = 0; + } + if ($_REQUEST['op'] == 'reset') { + $grd->pageNumber = 1; + } + // render grid + echo $grd->render(); + ?>
    diff --git a/manager/actions/web_access_permissions.dynamic.php b/manager/actions/web_access_permissions.dynamic.php index 38e71fd698..4c0659b4f7 100755 --- a/manager/actions/web_access_permissions.dynamic.php +++ b/manager/actions/web_access_permissions.dynamic.php @@ -1,32 +1,32 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('web_access_permissions')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('web_access_permissions')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // find all document groups, for the select :) $rs = $modx->db->select('*', $modx->getFullTableName('documentgroup_names'), '', 'name'); -if($modx->db->getRecordCount($rs) < 1) { - $docgroupselector = "[no groups to add]"; +if ($modx->db->getRecordCount($rs) < 1) { + $docgroupselector = "[no groups to add]"; } else { - $docgroupselector = '\n"; + $docgroupselector = '\n"; } $rs = $modx->db->select('*', $modx->getFullTableName('webgroup_names'), '', 'name'); -if($modx->db->getRecordCount($rs) < 1) { - $usrgroupselector = '[no user groups]'; +if ($modx->db->getRecordCount($rs) < 1) { + $usrgroupselector = '[no user groups]'; } else { - $usrgroupselector = '\n"; + $usrgroupselector = '\n"; } ?> @@ -88,24 +88,23 @@ function deletegroup(groupid, type) {
    db->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getFullTableName('webgroup_names') . " AS groupnames + $rs = $modx->db->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getFullTableName('webgroup_names') . " AS groupnames LEFT JOIN " . $modx->getFullTableName('web_groups') . " AS groups ON groups.webgroup = groupnames.id LEFT JOIN " . $modx->getFullTableName('web_users') . " AS users ON users.id = groups.webuser", '', 'groupnames.name, user_name'); - if($modx->db->getRecordCount($rs) < 1) { - ?> + if ($modx->db->getRecordCount($rs) < 1) { + ?>
    + } else { + ?>
    db->getRow($rs)) { - if($pid != $row['id']) { - if($pid != '') { - echo '
    '; - } - ?> + $pid = ''; + while ($row = $modx->db->getRow($rs)) { + if ($pid != $row['id']) { + if ($pid != '') { + echo '
    '; + } ?>
    @@ -120,21 +119,20 @@ function deletegroup(groupid, type) {
    + } + if (!$row['user_id']) { + ?> + $pid = $row['id']; + continue; + } ?> + $pid = $row['id']; + } + } + ?>
    @@ -159,24 +157,23 @@ function deletegroup(groupid, type) { db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getFullTableName('documentgroup_names') . " AS dgnames + $rs = $modx->db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getFullTableName('documentgroup_names') . " AS dgnames LEFT JOIN " . $modx->getFullTableName('document_groups') . " AS dg ON dg.document_group = dgnames.id LEFT JOIN " . $modx->getFullTableName('site_content') . " AS sc ON sc.id = dg.document", '', 'dgnames.name, sc.id'); - if($modx->db->getRecordCount($rs) < 1) { - ?> + if ($modx->db->getRecordCount($rs) < 1) { + ?>
    + } else { + ?>
    db->getRow($rs)) { - if($pid != $row['id']) { - if($pid != '') { - echo '
    '; - } - ?> + $pid = ''; + while ($row = $modx->db->getRow($rs)) { + if ($pid != $row['id']) { + if ($pid != '') { + echo '
    '; + } ?>
    @@ -191,21 +188,20 @@ function deletegroup(groupid, type) {
    + } + if (!$row['doc_id']) { + ?> + $pid = $row['id']; + continue; + } ?> + $pid = $row['id']; + } + } + ?>
    @@ -217,15 +213,15 @@ function deletegroup(groupid, type) {

    db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getFullTableName('webgroup_names') . " AS groupnames + $rs = $modx->db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getFullTableName('webgroup_names') . " AS groupnames LEFT JOIN " . $modx->getFullTableName('webgroup_access') . " AS groupacc ON groupacc.webgroup = groupnames.id LEFT JOIN " . $modx->getFullTableName('documentgroup_names') . " AS dgnames ON dgnames.id = groupacc.documentgroup", '', 'name, dg_name'); - if($modx->db->getRecordCount($rs) < 1) { - ?> + if ($modx->db->getRecordCount($rs) < 1) { + ?>
    + } else { + ?>
    @@ -241,38 +237,35 @@ function deletegroup(groupid, type) {
      db->getRow($rs)) { - if($row['id'] != $pid) { - if($pid != '') { - echo '
    '; - } // close previous one - ?> + $pid = ''; + while ($row = $modx->db->getRow($rs)) { + if ($row['id'] != $pid) { + if ($pid != '') { + echo ''; + } // close previous one ?>
  • ' . $_lang['no_groups_found'] . ''; - $pid = ''; - continue; - } else { - echo '
      '; - } - } - if(!$row['dg_id']) { - continue; - } - ?> + if (!$row['dg_id']) { + echo '' . $_lang['no_groups_found'] . ''; + $pid = ''; + continue; + } else { + echo '
        '; + } + } + if (!$row['dg_id']) { + continue; + } ?>
      • ()
      • + $pid = $row['id']; + } ?>
      + } + ?>
    diff --git a/manager/actions/web_user_management.static.php b/manager/actions/web_user_management.static.php index 013a88a38d..9eba4565b5 100755 --- a/manager/actions/web_user_management.static.php +++ b/manager/actions/web_user_management.static.php @@ -1,22 +1,22 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('edit_web_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('edit_web_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // initialize page view state - the $_PAGE object $modx->manager->initPageViewState(); // get and save search string -if($_REQUEST['op'] == 'reset') { - $query = ''; - $_PAGE['vs']['search'] = ''; +if ($_REQUEST['op'] == 'reset') { + $query = ''; + $_PAGE['vs']['search'] = ''; } else { - $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; - $sqlQuery = $modx->db->escape($query); - $_PAGE['vs']['search'] = $query; + $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; + $sqlQuery = $modx->db->escape($query); + $_PAGE['vs']['search'] = $query; } // get & save listmode @@ -120,29 +120,29 @@ function menuAction(a) {
    db->select("wu.id, wu.username, wua.fullname, wua.email, ELT(wua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu + $ds = $modx->db->select("wu.id, wu.username, wua.fullname, wua.email, ELT(wua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu INNER JOIN " . $modx->getFullTableName("web_user_attributes") . " wua ON wua.internalKey=wu.id", ($sqlQuery ? "(wu.username LIKE '{$sqlQuery}%') OR (wua.fullname LIKE '%{$sqlQuery}%') OR (wua.email LIKE '%{$sqlQuery}%')" : ""), 'username'); - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items - $grd->noRecordMsg = $_lang["no_records_found"]; - $grd->cssClass = "table data"; - $grd->columnHeaderClass = "tableHeader"; - $grd->itemClass = "tableItem"; - $grd->altItemClass = "tableAltItem"; - $grd->fields = "id,username,fullname,email,gender,blocked"; - $grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["user_full_name"] . " ," . $_lang["email"] . " ," . $_lang["user_gender"] . " ," . $_lang["user_block"]; - $grd->colWidths = "1%,,,,1%,1%"; - $grd->colAligns = "center,,,,center,right' nowrap='nowrap"; - $grd->colTypes = "template:||template:[+value+]"; - if($listmode == '1') { - $grd->pageSize = 0; - } - if($_REQUEST['op'] == 'reset') { - $grd->pageNumber = 1; - } - // render grid - echo $grd->render(); - ?> + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items + $grd->noRecordMsg = $_lang["no_records_found"]; + $grd->cssClass = "table data"; + $grd->columnHeaderClass = "tableHeader"; + $grd->itemClass = "tableItem"; + $grd->altItemClass = "tableAltItem"; + $grd->fields = "id,username,fullname,email,gender,blocked"; + $grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["user_full_name"] . " ," . $_lang["email"] . " ," . $_lang["user_gender"] . " ," . $_lang["user_block"]; + $grd->colWidths = "1%,,,,1%,1%"; + $grd->colAligns = "center,,,,center,right' nowrap='nowrap"; + $grd->colTypes = "template:||template:[+value+]"; + if ($listmode == '1') { + $grd->pageSize = 0; + } + if ($_REQUEST['op'] == 'reset') { + $grd->pageNumber = 1; + } + // render grid + echo $grd->render(); + ?>
    diff --git a/manager/actions/welcome.static.php b/manager/actions/welcome.static.php index f36d7f58c2..4c657f8c59 100755 --- a/manager/actions/welcome.static.php +++ b/manager/actions/welcome.static.php @@ -1,13 +1,13 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly.'); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die('INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly.'); } unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes -if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) { - // seems to be a new install - send the user to the configuration page - exit(''); +if ($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) { + // seems to be a new install - send the user to the configuration page + exit(''); } // set placeholders @@ -16,93 +16,93 @@ $_SESSION['nrnewmessages'] = 0; // setup message info -if($modx->hasPermission('messages')) { - include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); - $_SESSION['nrtotalmessages'] = $nrtotalmessages; - $_SESSION['nrnewmessages'] = $nrnewmessages; - - $msg = array(); - $msg[] = sprintf('', $_style['icons_mail_large']); - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (' . $_SESSION['nrnewmessages'] . ')' : ''; - $msg[] = sprintf(' [%%inbox%%]%s
    ', $nrnewmessages); - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '' . $_SESSION['nrnewmessages'] . '' : '0'; - $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); - $msg[] = sprintf('%s', $welcome_messages); - $ph['MessageInfo'] = implode("\n", $msg); +if ($modx->hasPermission('messages')) { + include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); + $_SESSION['nrtotalmessages'] = $nrtotalmessages; + $_SESSION['nrnewmessages'] = $nrnewmessages; + + $msg = array(); + $msg[] = sprintf('', $_style['icons_mail_large']); + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (' . $_SESSION['nrnewmessages'] . ')' : ''; + $msg[] = sprintf(' [%%inbox%%]%s
    ', $nrnewmessages); + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '' . $_SESSION['nrnewmessages'] . '' : '0'; + $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); + $msg[] = sprintf('%s', $welcome_messages); + $ph['MessageInfo'] = implode("\n", $msg); } // setup icons -if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { - $icon = ' [%user_management_title%]'; - $ph['SecurityIcon'] = wrapIcon($icon, 75); +if ($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { + $icon = ' [%user_management_title%]'; + $ph['SecurityIcon'] = wrapIcon($icon, 75); } -if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { - $icon = ' [%web_user_management_title%]'; - $ph['WebUserIcon'] = wrapIcon($icon, 99); +if ($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { + $icon = ' [%web_user_management_title%]'; + $ph['WebUserIcon'] = wrapIcon($icon, 99); } -if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { - $icon = ' [%modules%]'; - $ph['ModulesIcon'] = wrapIcon($icon, 106); +if ($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { + $icon = ' [%modules%]'; + $ph['ModulesIcon'] = wrapIcon($icon, 106); } -if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) { - $icon = ' [%elements%]'; - $ph['ResourcesIcon'] = wrapIcon($icon, 76); +if ($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) { + $icon = ' [%elements%]'; + $ph['ResourcesIcon'] = wrapIcon($icon, 76); } -if($modx->hasPermission('bk_manager')) { - $icon = ' [%backup%]'; - $ph['BackupIcon'] = wrapIcon($icon, 93); +if ($modx->hasPermission('bk_manager')) { + $icon = ' [%backup%]'; + $ph['BackupIcon'] = wrapIcon($icon, 93); } -if($modx->hasPermission('help')) { - $icon = ' [%help%]'; - $ph['HelpIcon'] = wrapIcon($icon, 9); +if ($modx->hasPermission('help')) { + $icon = ' [%help%]'; + $ph['HelpIcon'] = wrapIcon($icon, 9); } -if($modx->hasPermission('new_document')) { - $icon = '[%add_resource%]'; - $ph['ResourceIcon'] = wrapIcon($icon, 4); - $icon = '[%add_weblink%]'; - $ph['WeblinkIcon'] = wrapIcon($icon, 72); +if ($modx->hasPermission('new_document')) { + $icon = '[%add_resource%]'; + $ph['ResourceIcon'] = wrapIcon($icon, 4); + $icon = '[%add_weblink%]'; + $ph['WeblinkIcon'] = wrapIcon($icon, 72); } -if($modx->hasPermission('assets_images')) { - $icon = '[%images_management%]'; - $ph['ImagesIcon'] = wrapIcon($icon, 72); +if ($modx->hasPermission('assets_images')) { + $icon = '[%images_management%]'; + $ph['ImagesIcon'] = wrapIcon($icon, 72); } -if($modx->hasPermission('assets_files')) { - $icon = '[%files_management%]'; - $ph['FilesIcon'] = wrapIcon($icon, 72); +if ($modx->hasPermission('assets_files')) { + $icon = '[%files_management%]'; + $ph['FilesIcon'] = wrapIcon($icon, 72); } -if($modx->hasPermission('change_password')) { - $icon = '[%change_password%]'; - $ph['PasswordIcon'] = wrapIcon($icon, 28); +if ($modx->hasPermission('change_password')) { + $icon = '[%change_password%]'; + $ph['PasswordIcon'] = wrapIcon($icon, 28); } $icon = '[%logout%]'; $ph['LogoutIcon'] = wrapIcon($icon, 8); // do some config checks -if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { - include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); - if($config_check_results != $_lang['configcheck_ok']) { - $ph['config_check_results'] = $config_check_results; - $ph['config_display'] = 'block'; - } else { - $ph['config_display'] = 'none'; - } +if (($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { + include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); + if ($config_check_results != $_lang['configcheck_ok']) { + $ph['config_check_results'] = $config_check_results; + $ph['config_display'] = 'block'; + } else { + $ph['config_display'] = 'none'; + } } else { - $ph['config_display'] = 'none'; + $ph['config_display'] = 'none'; } // Check logout-reminder -if(isset($_SESSION['show_logout_reminder'])) { - switch($_SESSION['show_logout_reminder']['type']) { - case 'logout_reminder': - $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); - $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']); - break; - } - $ph['show_logout_reminder'] = 'block'; - unset($_SESSION['show_logout_reminder']); +if (isset($_SESSION['show_logout_reminder'])) { + switch ($_SESSION['show_logout_reminder']['type']) { + case 'logout_reminder': + $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); + $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']); + break; + } + $ph['show_logout_reminder'] = 'block'; + unset($_SESSION['show_logout_reminder']); } else { - $ph['show_logout_reminder'] = 'none'; + $ph['show_logout_reminder'] = 'none'; } // Check multiple sessions @@ -111,13 +111,13 @@ //$count = $modx->db->getValue($rs); /* if($count > 1) { - $ph['multiple_sessions_msg'] = $modx->parseText($_lang['multiple_sessions_msg'], array( - 'username' => $_SESSION['mgrShortname'], - 'total' => $count - )); - $ph['show_multiple_sessions'] = 'block'; + $ph['multiple_sessions_msg'] = $modx->parseText($_lang['multiple_sessions_msg'], array( + 'username' => $_SESSION['mgrShortname'], + 'total' => $count + )); + $ph['show_multiple_sessions'] = 'block'; } else { - $ph['show_multiple_sessions'] = 'none'; + $ph['show_multiple_sessions'] = 'none'; }*/ $ph['show_multiple_sessions'] = 'none'; @@ -150,11 +150,11 @@ $nrnewmessages = '' . $_SESSION['nrnewmessages'] . ''; $ph['UserInfo'] = $modx->parseText($tpl, array( - 'username' => $modx->getLoginUserName(), - 'role' => $_SESSION['mgrPermissions']['name'], - 'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time), - 'logincount' => $_SESSION['mgrLogincount'] + 1, - 'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages) + 'username' => $modx->getLoginUserName(), + 'role' => $_SESSION['mgrPermissions']['name'], + 'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time), + 'logincount' => $_SESSION['mgrLogincount'] + 1, + 'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages) )); $from = array(); @@ -162,14 +162,14 @@ $from[] = " us LEFT JOIN [+prefix+]active_users au ON au.sid=us.sid WHERE au.action <> '8'"; $rs = $modx->db->select('*', $from, '', 'username ASC, au.sid ASC'); -if($modx->db->getRecordCount($rs) < 1) { - $html = '

    [%no_active_users_found%]

    '; +if ($modx->db->getRecordCount($rs) < 1) { + $html = '

    [%no_active_users_found%]

    '; } else { - include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); - $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; - $ph['now'] = strftime('%H:%M:%S', $now); - $timetocheck = ($now - (60 * 20)); //+$server_offset_time; - $html = ' + include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); + $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; + $ph['now'] = strftime('%H:%M:%S', $now); + $timetocheck = ($now - (60 * 20)); //+$server_offset_time; + $html = '
    [%onlineusers_message%] [+now+]): @@ -187,33 +187,33 @@ '; - $userList = array(); - $userCount = array(); - // Create userlist with session-count first before output - while($activeusers = $modx->db->getRow($rs)) { - $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; - - $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; - $webicon = $activeusers['internalKey'] < 0 ? 'Web user ' : ''; - $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip']; - $currentaction = getAction($activeusers['action'], $activeusers['id']); - $userList[] = array( - $idle, - '', - $activeusers['username'], - $webicon, - abs($activeusers['internalKey']), - $ip, - strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time), - $currentaction - ); - } - foreach($userList as $params) { - $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; - $html .= "\n\t\t" . vsprintf('%s%s%s%s%s%s', $params); - } - - $html .= ' + $userList = array(); + $userCount = array(); + // Create userlist with session-count first before output + while ($activeusers = $modx->db->getRow($rs)) { + $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; + + $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; + $webicon = $activeusers['internalKey'] < 0 ? 'Web user ' : ''; + $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip']; + $currentaction = getAction($activeusers['action'], $activeusers['id']); + $userList[] = array( + $idle, + '', + $activeusers['username'], + $webicon, + abs($activeusers['internalKey']), + $ip, + strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time), + $currentaction + ); + } + foreach ($userList as $params) { + $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; + $html .= "\n\t\t" . vsprintf('%s%s%s%s%s%s', $params); + } + + $html .= '
    @@ -253,18 +253,18 @@ // invoke event OnManagerWelcomePrerender $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender'); -if(is_array($evtOut)) { - $output = implode('', $evtOut); - $ph['OnManagerWelcomePrerender'] = $output; +if (is_array($evtOut)) { + $output = implode('', $evtOut); + $ph['OnManagerWelcomePrerender'] = $output; } $widgets['welcome'] = array( - 'menuindex' => '10', - 'id' => 'welcome', - 'cols' => 'col-lg-6', - 'icon' => 'fa-home', - 'title' => '[%welcome_title%]', - 'body' => ' + 'menuindex' => '10', + 'id' => 'welcome', + 'cols' => 'col-lg-6', + 'icon' => 'fa-home', + 'title' => '[%welcome_title%]', + 'body' => '
    @@ -338,25 +338,25 @@
    ', - 'hide'=>'0' + 'hide'=>'0' ); $widgets['onlineinfo'] = array( - 'menuindex' => '20', - 'id' => 'onlineinfo', - 'cols' => 'col-lg-6', - 'icon' => 'fa-user', - 'title' => '[%onlineusers_title%]', - 'body' => '
    [+OnlineInfo+]
    ', - 'hide'=>'0' + 'menuindex' => '20', + 'id' => 'onlineinfo', + 'cols' => 'col-lg-6', + 'icon' => 'fa-user', + 'title' => '[%onlineusers_title%]', + 'body' => '
    [+OnlineInfo+]
    ', + 'hide'=>'0' ); $widgets['recentinfo'] = array( - 'menuindex' => '30', - 'id' => 'modxrecent_widget', - 'cols' => 'col-sm-12', - 'icon' => 'fa-pencil-square-o', - 'title' => '[%activity_title%]', - 'body' => '
    [+RecentInfo+]
    ', - 'hide'=>'0' + 'menuindex' => '30', + 'id' => 'modxrecent_widget', + 'cols' => 'col-sm-12', + 'icon' => 'fa-pencil-square-o', + 'title' => '[%activity_title%]', + 'body' => '
    [+RecentInfo+]
    ', + 'hide'=>'0' ); if ($modx->config['rss_url_news']) { $widgets['news'] = array( @@ -383,75 +383,75 @@ // invoke OnManagerWelcomeHome event $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets)); -if(is_array($sitewidgets)) { - $newwidgets = array(); - foreach($sitewidgets as $widget){ +if (is_array($sitewidgets)) { + $newwidgets = array(); + foreach ($sitewidgets as $widget) { $newwidgets = array_merge($newwidgets, unserialize($widget)); } $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets; } usort($widgets, function ($a, $b) { - return $a['menuindex'] - $b['menuindex']; + return $a['menuindex'] - $b['menuindex']; }); $tpl = getTplWidget(); $output = ''; -foreach($widgets as $widget) { - if ($widget['hide'] != '1'){ - $output .= $modx->parseText($tpl, $widget); - } +foreach ($widgets as $widget) { + if ($widget['hide'] != '1') { + $output .= $modx->parseText($tpl, $widget); + } } $ph['widgets'] = $output; // load template -if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { - $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; +if (!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { + $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; } $target = $modx->config['manager_welcome_tpl']; $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target); $target = $modx->mergeSettingsContent($target); -if(substr($target, 0, 1) === '@') { - if(substr($target, 0, 6) === '@CHUNK') { - $content = $modx->getChunk(trim(substr($target, 7))); - } elseif(substr($target, 0, 5) === '@FILE') { - $content = file_get_contents(trim(substr($target, 6))); - } else { - $content = ''; - } +if (substr($target, 0, 1) === '@') { + if (substr($target, 0, 6) === '@CHUNK') { + $content = $modx->getChunk(trim(substr($target, 7))); + } elseif (substr($target, 0, 5) === '@FILE') { + $content = file_get_contents(trim(substr($target, 6))); + } else { + $content = ''; + } } else { - $chunk = $modx->getChunk($target); - if($chunk !== false && !empty($chunk)) { - $content = $chunk; - } elseif(is_file(MODX_BASE_PATH . $target)) { - $content = file_get_contents(MODX_BASE_PATH . $target); - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible - { - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); - } else { - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); - } + $chunk = $modx->getChunk($target); + if ($chunk !== false && !empty($chunk)) { + $content = $chunk; + } elseif (is_file(MODX_BASE_PATH . $target)) { + $content = file_get_contents(MODX_BASE_PATH . $target); + } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); + } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) { // ClipperCMS compatible + + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); + } else { + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); + } } // merge placeholders $content = $modx->mergeConditionalTagsContent($content); $content = $modx->mergeSettingsContent($content); $content = $modx->parseText($content, $ph); -if(strpos($content, '[+') !== false) { - $modx->toPlaceholders($ph); - $content = $modx->mergePlaceholderContent($content); +if (strpos($content, '[+') !== false) { + $modx->toPlaceholders($ph); + $content = $modx->mergePlaceholderContent($content); } $content = $modx->parseDocumentSource($content); $content = $modx->parseText($content, $_lang, '[%', '%]'); $content = $modx->parseText($content, $_style, '[&', '&]'); $content = $modx->cleanUpMODXTags($content); //cleanup -if($js = $modx->getRegisteredClientScripts()) { - $content .= $js; +if ($js = $modx->getRegisteredClientScripts()) { + $content .= $js; } echo $content; @@ -460,8 +460,9 @@ // // // -function getTplWidget() { // recent document info - return ' +function getTplWidget() +{ // recent document info + return '
    [+title+]
    @@ -471,12 +472,13 @@ function getTplWidget() { // recent document info '; } -function getRecentInfo() { // recent document info - $modx = evolutionCMS(); +function getRecentInfo() +{ // recent document info + $modx = evolutionCMS(); - $modx->addSnippet('recentInfoList', 'getRecentInfoList'); + $modx->addSnippet('recentInfoList', 'getRecentInfoList'); - $html = ' + $html = '
    @@ -494,96 +496,98 @@ function getRecentInfo() { // recent document info
    '; - return $html; + return $html; } -function getRecentInfoList() { - $modx = evolutionCMS(); - - $rs = $modx->db->select('*', '[+prefix+]site_content', '', 'editedon DESC', 10); - - if($modx->db->getRecordCount($rs) < 1) { - return '[%no_activity_message%]'; - } - - $tpl = getRecentInfoRowTpl(); - - $btntpl['edit'] = ' '; - $btntpl['preview_btn'] = ' '; - - $output = array(); - while($ph = $modx->db->getRow($rs)) { - $docid = $ph['id']; - $_ = $modx->getUserInfo($ph['editedby']); - $ph['username'] = $_['username']; - - if($ph['deleted'] == 1) { - $ph['status'] = 'deleted text-danger'; - } elseif($ph['published'] == 0) { - $ph['status'] = 'unpublished font-italic text-muted'; - } else { - $ph['status'] = 'published'; - } - - if($modx->hasPermission('edit_document')) { - $ph['edit_btn'] = str_replace('[+id+]', $docid, $btntpl['edit']); - } else { - $ph['edit_btn'] = ''; - } - - $preview_disabled = ($ph['deleted'] == 1) ? 'disabled' : ''; - $ph['preview_btn'] = str_replace(array( - '[+id+]', - '[+preview_disabled+]' - ), array( - $docid, - $preview_disabled - ), $btntpl['preview_btn']); - - if($modx->hasPermission('delete_document')) { - if($ph['deleted'] == 0) { - $delete_btn = ' '; - } else { - $delete_btn = ' '; - } - $ph['delete_btn'] = str_replace('[+id+]', $docid, $delete_btn); - } else { - $ph['delete_btn'] = ''; - } - - if($ph['deleted'] == 1 && $ph['published'] == 0) { - $publish_btn = ' '; - } elseif($ph['deleted'] == 1 && $ph['published'] == 1) { - $publish_btn = ' '; - } elseif($ph['deleted'] == 0 && $ph['published'] == 0) { - $publish_btn = ' '; - } else { - $publish_btn = ' '; - } - $ph['publish_btn'] = str_replace('[+id+]', $docid, $publish_btn); - - $ph['info_btn'] = str_replace('[+id+]', $docid, ''); - - if($ph['longtitle'] == '') { - $ph['longtitle'] = '([%not_set%])'; - } - if($ph['description'] == '') { - $ph['description'] = '([%not_set%])'; - } - if($ph['introtext'] == '') { - $ph['introtext'] = '([%not_set%])'; - } - if($ph['alias'] == '') { - $ph['alias'] = '([%not_set%])'; - } - - $output[] = $modx->parseText($tpl, $ph); - } - return implode("\n", $output); +function getRecentInfoList() +{ + $modx = evolutionCMS(); + + $rs = $modx->db->select('*', '[+prefix+]site_content', '', 'editedon DESC', 10); + + if ($modx->db->getRecordCount($rs) < 1) { + return '[%no_activity_message%]'; + } + + $tpl = getRecentInfoRowTpl(); + + $btntpl['edit'] = ' '; + $btntpl['preview_btn'] = ' '; + + $output = array(); + while ($ph = $modx->db->getRow($rs)) { + $docid = $ph['id']; + $_ = $modx->getUserInfo($ph['editedby']); + $ph['username'] = $_['username']; + + if ($ph['deleted'] == 1) { + $ph['status'] = 'deleted text-danger'; + } elseif ($ph['published'] == 0) { + $ph['status'] = 'unpublished font-italic text-muted'; + } else { + $ph['status'] = 'published'; + } + + if ($modx->hasPermission('edit_document')) { + $ph['edit_btn'] = str_replace('[+id+]', $docid, $btntpl['edit']); + } else { + $ph['edit_btn'] = ''; + } + + $preview_disabled = ($ph['deleted'] == 1) ? 'disabled' : ''; + $ph['preview_btn'] = str_replace(array( + '[+id+]', + '[+preview_disabled+]' + ), array( + $docid, + $preview_disabled + ), $btntpl['preview_btn']); + + if ($modx->hasPermission('delete_document')) { + if ($ph['deleted'] == 0) { + $delete_btn = ' '; + } else { + $delete_btn = ' '; + } + $ph['delete_btn'] = str_replace('[+id+]', $docid, $delete_btn); + } else { + $ph['delete_btn'] = ''; + } + + if ($ph['deleted'] == 1 && $ph['published'] == 0) { + $publish_btn = ' '; + } elseif ($ph['deleted'] == 1 && $ph['published'] == 1) { + $publish_btn = ' '; + } elseif ($ph['deleted'] == 0 && $ph['published'] == 0) { + $publish_btn = ' '; + } else { + $publish_btn = ' '; + } + $ph['publish_btn'] = str_replace('[+id+]', $docid, $publish_btn); + + $ph['info_btn'] = str_replace('[+id+]', $docid, ''); + + if ($ph['longtitle'] == '') { + $ph['longtitle'] = '([%not_set%])'; + } + if ($ph['description'] == '') { + $ph['description'] = '([%not_set%])'; + } + if ($ph['introtext'] == '') { + $ph['introtext'] = '([%not_set%])'; + } + if ($ph['alias'] == '') { + $ph['alias'] = '([%not_set%])'; + } + + $output[] = $modx->parseText($tpl, $ph); + } + return implode("\n", $output); } -function getRecentInfoRowTpl() { - $tpl = ' +function getRecentInfoRowTpl() +{ + $tpl = ' [+id+] [+pagetitle+] @@ -607,16 +611,18 @@ function getRecentInfoRowTpl() {
    '; - return $tpl; + return $tpl; } // setup icons -function wrapIcon($i, $action) { - return sprintf('%s', $action, $i); +function wrapIcon($i, $action) +{ + return sprintf('%s', $action, $i); } -function getStartUpScript() { - $script = ' +function getStartUpScript() +{ + $script = ' '; - return $script; + return $script; } diff --git a/manager/frames/1.php b/manager/frames/1.php index a34aa16e55..5a6015b09e 100755 --- a/manager/frames/1.php +++ b/manager/frames/1.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } header("X-XSS-Protection: 0"); @@ -119,10 +119,12 @@ - config['show_picker'] != "0") { ?> + config['show_picker'] != "0") { + ?> - + + $mtime = microtime(); + $mtime = explode(" ", $mtime); + $mtime = $mtime[1] + $mtime[0]; + $tend = $mtime; + $totaltime = ($tend - $tstart); ?>
    @@ -44,7 +47,7 @@ function removeDebugDiv() { - +
    Time taken
    diff --git a/manager/includes/default_config.php b/manager/includes/default_config.php index e002f11942..72b9fabc18 100755 --- a/manager/includes/default_config.php +++ b/manager/includes/default_config.php @@ -111,6 +111,3 @@ $c['login_form_position'] = 'left'; $c['manager_menu_position'] = 'top'; $c['tinymce4_skin'] = 'lightgray'; - - - diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index 20f88fa6c4..bd30b7e28f 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -223,7 +223,7 @@ public static function getInstance() * @param $arguments * @return mixed */ - function __call($method_name, $arguments) + public function __call($method_name, $arguments) { include_once(MODX_MANAGER_PATH . 'includes/extenders/deprecated.functions.inc.php'); if (method_exists($this->old, $method_name)) { @@ -308,7 +308,7 @@ public function loadExtension($extname, $reload = true) */ public function getMicroTime() { - list ($usec, $sec) = explode(' ', microtime()); + list($usec, $sec) = explode(' ', microtime()); return ((float)$usec + (float)$sec); } @@ -326,12 +326,12 @@ public function getMicroTime() public function sendRedirect($url, $count_attempts = 0, $type = '', $responseCode = '') { $header = ''; - if (empty ($url)) { + if (empty($url)) { return false; } if ($count_attempts == 1) { // append the redirect count string to the url - $currentNumberOfRedirects = isset ($_REQUEST['err']) ? $_REQUEST['err'] : 0; + $currentNumberOfRedirects = isset($_REQUEST['err']) ? $_REQUEST['err'] : 0; if ($currentNumberOfRedirects > 3) { $this->messageQuit('Redirection attempt failed - please ensure the document you\'re trying to redirect to exists.

    Redirection URL: ' . $url . '

    '); } else { @@ -349,7 +349,7 @@ public function sendRedirect($url, $count_attempts = 0, $type = '', $responseCod $header = ''; echo $header; exit; - } elseif ($type == 'REDIRECT_HEADER' || empty ($type)) { + } elseif ($type == 'REDIRECT_HEADER' || empty($type)) { // check if url has /$base_url global $base_url, $site_url; if (substr($url, 0, strlen($base_url)) == $base_url) { @@ -366,7 +366,7 @@ public function sendRedirect($url, $count_attempts = 0, $type = '', $responseCod header($responseCode); } - if(!empty($header)) { + if (!empty($header)) { header($header); } @@ -524,7 +524,7 @@ public function getUserSettings() $usrSettings = array(); if ($id = $this->getLoginUserID()) { $usrType = $this->getLoginUserType(); - if (isset ($usrType) && $usrType == 'manager') { + if (isset($usrType) && $usrType == 'manager') { $usrType = 'mgr'; } @@ -533,7 +533,7 @@ public function getUserSettings() $this->invokeEvent("OnBeforeManagerPageInit"); } - if (isset ($_SESSION[$usrType . 'UsrConfigSet'])) { + if (isset($_SESSION[$usrType . 'UsrConfigSet'])) { $usrSettings = &$_SESSION[$usrType . 'UsrConfigSet']; } else { if ($usrType == 'web') { @@ -553,14 +553,14 @@ public function getUserSettings() } $usrSettings[$row['setting_name']] = $row['setting_value']; } - if (isset ($usrType)) { + if (isset($usrType)) { $_SESSION[$usrType . 'UsrConfigSet'] = $usrSettings; } // store user settings in session } } if ($this->isFrontend() && $mgrid = $this->getLoginUserID('mgr')) { $musrSettings = array(); - if (isset ($_SESSION['mgrUsrConfigSet'])) { + if (isset($_SESSION['mgrUsrConfigSet'])) { $musrSettings = &$_SESSION['mgrUsrConfigSet']; } else { if ($result = $this->db->select('setting_name, setting_value', $tbl_user_settings, "user='{$mgrid}'")) { @@ -570,7 +570,7 @@ public function getUserSettings() $_SESSION['mgrUsrConfigSet'] = $musrSettings; // store user settings in session } } - if (!empty ($musrSettings)) { + if (!empty($musrSettings)) { $usrSettings = array_merge($musrSettings, $usrSettings); } } @@ -654,7 +654,7 @@ public function checkSession() public function checkPreview() { if ($this->isLoggedIn() == true) { - if (isset ($_REQUEST['z']) && $_REQUEST['z'] == 'manprev') { + if (isset($_REQUEST['z']) && $_REQUEST['z'] == 'manprev') { return true; } else { return false; @@ -765,22 +765,23 @@ public function getHashFile($key) * @param $id * @return array|mixed|null|string */ - public function makePageCacheKey($id){ + public function makePageCacheKey($id) + { $hash = $id; $tmp = null; $params = array(); - if(!empty($this->systemCacheKey)){ + if (!empty($this->systemCacheKey)) { $hash = $this->systemCacheKey; - }else { + } else { if (!empty($_GET)) { // Sort GET parameters so that the order of parameters on the HTTP request don't affect the generated cache ID. $params = $_GET; ksort($params); - $hash .= '_'.md5(http_build_query($params)); + $hash .= '_' . md5(http_build_query($params)); } } - $evtOut = $this->invokeEvent("OnMakePageCacheKey", array ("hash" => $hash, "id" => $id, 'params' => $params)); - if (is_array($evtOut) && count($evtOut) > 0){ + $evtOut = $this->invokeEvent("OnMakePageCacheKey", array("hash" => $hash, "id" => $id, 'params' => $params)); + if (is_array($evtOut) && count($evtOut) > 0) { $tmp = array_pop($evtOut); } return empty($tmp) ? $hash : $tmp; @@ -827,7 +828,7 @@ public function getDocumentObjectFromCache($id, $loading = false) else { $docObj = unserialize($a[0]); // rebuild document object // check page security - if ($docObj['privateweb'] && isset ($docObj['__MODxDocGroups__'])) { + if ($docObj['privateweb'] && isset($docObj['__MODxDocGroups__'])) { $pass = false; $usrGrps = $this->getUserDocGroups(); $docGrps = explode(',', $docObj['__MODxDocGroups__']); @@ -937,7 +938,7 @@ public function outputContent($noEvent = false) // send out content-type and content-disposition headers if (IN_PARSER_MODE == "true") { - $type = !empty ($this->contentTypes[$this->documentIdentifier]) ? $this->contentTypes[$this->documentIdentifier] : "text/html"; + $type = !empty($this->contentTypes[$this->documentIdentifier]) ? $this->contentTypes[$this->documentIdentifier] : "text/html"; header('Content-Type: ' . $type . '; charset=' . $this->config['modx_charset']); // if (($this->documentIdentifier == $this->config['error_page']) || $redirect_error) // header('HTTP/1.0 404 Not Found'); @@ -1060,7 +1061,7 @@ public function getTimerStats($tstart) $stats['totalTime'] = sprintf("%2.4f s", $stats['totalTime']); $stats['phpTime'] = sprintf("%2.4f s", $stats['phpTime']); $stats['source'] = $this->documentGenerated == 1 ? "database" : "cache"; - $stats['queries'] = isset ($this->executedQueries) ? $this->executedQueries : 0; + $stats['queries'] = isset($this->executedQueries) ? $this->executedQueries : 0; $stats['phpMemory'] = (memory_get_peak_usage(true) / 1024 / 1024) . " mb"; return $stats; @@ -1105,7 +1106,7 @@ public function updatePubStatus() // now, check for documents that need publishing $field = array('published' => 1, 'publishedon' => $timeNow); $where = "pub_date <= {$timeNow} AND pub_date!=0 AND published=0"; - $result_pub = $this->db->select( 'id', '[+prefix+]site_content', $where); + $result_pub = $this->db->select('id', '[+prefix+]site_content', $where); $this->db->update($field, '[+prefix+]site_content', $where); if ($this->db->getRecordCount($result_pub) >= 1) { //Event unPublished doc while ($row_pub = $this->db->getRow($result_pub)) { @@ -1118,7 +1119,7 @@ public function updatePubStatus() // now, check for documents that need un-publishing $field = array('published' => 0, 'publishedon' => 0); $where = "unpub_date <= {$timeNow} AND unpub_date!=0 AND published=1"; - $result_unpub = $this->db->select( 'id', '[+prefix+]site_content', $where); + $result_unpub = $this->db->select('id', '[+prefix+]site_content', $where); $this->db->update($field, '[+prefix+]site_content', $where); if ($this->db->getRecordCount($result_unpub) >= 1) { //Event unPublished doc while ($row_unpub = $this->db->getRow($result_unpub)) { @@ -1207,10 +1208,18 @@ public function _getTagsFromContent($content, $left = '[+', $right = '+]') return array(); } $spacer = md5('<<>>'); - if($left==='{{' && strpos($content,';}}')!==false) $content = str_replace(';}}', sprintf(';}%s}', $spacer),$content); - if($left==='{{' && strpos($content,'{{}}')!==false) $content = str_replace('{{}}',sprintf('{%$1s{}%$1s}',$spacer),$content); - if($left==='[[' && strpos($content,']]]]')!==false) $content = str_replace(']]]]',sprintf(']]%s]]', $spacer),$content); - if($left==='[[' && strpos($content,']]]')!==false) $content = str_replace(']]]', sprintf(']%s]]', $spacer),$content); + if ($left==='{{' && strpos($content, ';}}')!==false) { + $content = str_replace(';}}', sprintf(';}%s}', $spacer), $content); + } + if ($left==='{{' && strpos($content, '{{}}')!==false) { + $content = str_replace('{{}}', sprintf('{%$1s{}%$1s}', $spacer), $content); + } + if ($left==='[[' && strpos($content, ']]]]')!==false) { + $content = str_replace(']]]]', sprintf(']]%s]]', $spacer), $content); + } + if ($left==='[[' && strpos($content, ']]]')!==false) { + $content = str_replace(']]]', sprintf(']%s]]', $spacer), $content); + } $pos[''] = strpos($content, ']]>'); @@ -1280,8 +1289,10 @@ public function _getTagsFromContent($content, $left = '[+', $right = '+]') } } } - foreach($tags as $i=>$tag) { - if(strpos($tag,$spacer)!==false) $tags[$i] = str_replace($spacer, '', $tag); + foreach ($tags as $i=>$tag) { + if (strpos($tag, $spacer)!==false) { + $tags[$i] = str_replace($spacer, '', $tag); + } } return $tags; } @@ -1321,7 +1332,9 @@ public function mergeDocumentContent($content, $ph = false) } foreach ($matches[1] as $i => $key) { - if(strpos($key,'[+')!==false) continue; // Allow chunk {{chunk?¶m=`xxx`}} with [*tv_name_[+param+]*] as content + if (strpos($key, '[+')!==false) { + continue; + } // Allow chunk {{chunk?¶m=`xxx`}} with [*tv_name_[+param+]*] as content if (substr($key, 0, 1) == '#') { $key = substr($key, 1); } // remove # for QuickEdit format @@ -1353,7 +1366,7 @@ public function mergeDocumentContent($content, $ph = false) if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif($this->debug) { + } elseif ($this->debug) { $this->addLog('mergeDocumentContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -1521,7 +1534,7 @@ public function mergeSettingsContent($content, $ph = false) $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif($this->debug) { + } elseif ($this->debug) { $this->addLog('mergeSettingsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -1590,7 +1603,7 @@ public function mergeChunkContent($content, $ph = false) $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif($this->debug) { + } elseif ($this->debug) { $this->addLog('mergeChunkContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -1606,7 +1619,6 @@ public function mergeChunkContent($content, $ph = false) */ public function mergePlaceholderContent($content, $ph = false) { - if ($this->config['enable_at_syntax']) { if (stripos($content, '<@LITERAL>') !== false) { $content = $this->escapeLiteralTagsContent($content); @@ -1631,7 +1643,6 @@ public function mergePlaceholderContent($content, $ph = false) return $content; } foreach ($matches[1] as $i => $key) { - list($key, $modifiers) = $this->splitKeyAndFilter($key); if (isset($ph[$key])) { @@ -1649,7 +1660,7 @@ public function mergePlaceholderContent($content, $ph = false) $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif($this->debug) { + } elseif ($this->debug) { $this->addLog('mergePlaceholderContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -1818,7 +1829,7 @@ private function _parseCTagCMD($cmd) * @param string $right * @return mixed */ - function ignoreCommentedTagsContent($content, $left = '') + public function ignoreCommentedTagsContent($content, $left = '') { if (strpos($content, $left) === false) { return $content; @@ -1860,7 +1871,7 @@ public function escapeLiteralTagsContent($content, $left = '<@LITERAL>', $right $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $v, $content); - } elseif($this->debug) { + } elseif ($this->debug) { $this->addLog('ignoreCommentedTagsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -2017,7 +2028,7 @@ public function evalSnippets($content) } if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif($this->debug) { + } elseif ($this->debug) { $this->addLog('evalSnippetsSGVar parse error', $_SERVER['REQUEST_URI'] . $s, 2); } continue; @@ -2029,7 +2040,7 @@ public function evalSnippets($content) if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif($this->debug) { + } elseif ($this->debug) { $this->addLog('evalSnippets parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -2497,7 +2508,6 @@ public function rewriteUrls($documentSource) } return $out; }, $documentSource); - } else { $in = '!\[\~([0-9]+)\~\]!is'; $out = "index.php?id=" . '\1'; @@ -2582,7 +2592,6 @@ public function sendStrictURI() */ public function getDocumentObject($method, $identifier, $isPrepareResponse = false) { - $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { return $this->tmpCache[__FUNCTION__][$cacheKey]; @@ -2685,8 +2694,8 @@ public function getDocumentObject($method, $identifier, $isPrepareResponse = fal public function parseDocumentSource($source) { // set the number of times we are to parse the document source - $this->minParserPasses = empty ($this->minParserPasses) ? 2 : $this->minParserPasses; - $this->maxParserPasses = empty ($this->maxParserPasses) ? 10 : $this->maxParserPasses; + $this->minParserPasses = empty($this->minParserPasses) ? 2 : $this->minParserPasses; + $this->maxParserPasses = empty($this->maxParserPasses) ? 10 : $this->maxParserPasses; $passes = $this->minParserPasses; for ($i = 0; $i < $passes; $i++) { // get source length if this is the final pass @@ -2736,7 +2745,7 @@ public function parseDocumentSource($source) */ public function executeParser() { - if(MODX_CLI) { + if (MODX_CLI) { throw new RuntimeException('Call DocumentParser::executeParser on CLI mode'); } @@ -2748,7 +2757,7 @@ public function executeParser() $this->db->connect(); // get the settings - if (empty ($this->config)) { + if (empty($this->config)) { $this->getSettings(); } @@ -2890,11 +2899,11 @@ public function _IIS_furl_fix() } $k = array_keys($_GET); - unset ($_GET[$k[0]]); - unset ($_REQUEST[$k[0]]); // remove 404,405 entry + unset($_GET[$k[0]]); + unset($_REQUEST[$k[0]]); // remove 404,405 entry $qp = parse_url(str_replace($this->config['site_url'], '', substr($url, 4))); $_SERVER['QUERY_STRING'] = $qp['query']; - if (!empty ($qp['query'])) { + if (!empty($qp['query'])) { parse_str($qp['query'], $qv); foreach ($qv as $n => $v) { $_REQUEST[$n] = $_GET[$n] = $v; @@ -3091,14 +3100,12 @@ public function getUltimateParentId($id, $top = 0) */ public function getChildIds($id, $depth = 10, $children = array()) { - $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { return $this->tmpCache[__FUNCTION__][$cacheKey]; } if ($this->config['aliaslistingfolder'] == 1) { - $res = $this->db->select("id,alias,isfolder,parent", $this->getFullTableName('site_content'), "parent IN (" . $id . ") AND deleted = '0'"); $idx = array(); while ($row = $this->db->getRow($res)) { @@ -3121,7 +3128,6 @@ public function getChildIds($id, $depth = 10, $children = array()) } $this->tmpCache[__FUNCTION__][$cacheKey] = $children; return $children; - } else { // Initialise a static array to index parents->children @@ -3152,7 +3158,6 @@ public function getChildIds($id, $depth = 10, $children = array()) } $this->tmpCache[__FUNCTION__][$cacheKey] = $children; return $children; - } } @@ -3323,7 +3328,6 @@ public function cleanupExpiredLocks() } else { $this->db->delete($this->getFullTableName('active_user_locks')); } - } /** @@ -3359,13 +3363,11 @@ public function cleanupMultipleActiveUsers() $deleteSids .= $deleteSids == '' ? '' : ' OR '; $deleteSids .= "sid='{$row['sid']}'"; }; - } if ($deleteSids) { $this->db->delete($this->getFullTableName('active_users'), $deleteSids); } } - } /** @@ -3666,7 +3668,6 @@ public function isFrontend() */ public function getAllChildren($id = 0, $sort = 'menuindex', $dir = 'ASC', $fields = 'id, pagetitle, description, parent, alias, menutitle') { - $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { return $this->tmpCache[__FUNCTION__][$cacheKey]; @@ -3748,7 +3749,6 @@ public function getActiveChildren($id = 0, $sort = 'menuindex', $dir = 'ASC', $f */ public function getDocumentChildren($parentid = 0, $published = 1, $deleted = 0, $fields = '*', $where = '', $sort = 'menuindex', $dir = 'ASC', $limit = '') { - $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { return $this->tmpCache[__FUNCTION__][$cacheKey]; @@ -3805,7 +3805,6 @@ public function getDocumentChildren($parentid = 0, $published = 1, $deleted = 0, */ public function getDocuments($ids = array(), $published = 1, $deleted = 0, $fields = '*', $where = '', $sort = 'menuindex', $dir = 'ASC', $limit = '') { - $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { return $this->tmpCache[__FUNCTION__][$cacheKey]; @@ -3935,7 +3934,6 @@ public function getField($field = 'content', $docid = '') */ public function getPageInfo($pageid = -1, $active = 1, $fields = 'id, pagetitle, description, alias') { - $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { return $this->tmpCache[__FUNCTION__][$cacheKey]; @@ -3980,7 +3978,7 @@ public function getParent($pid = -1, $active = 1, $fields = 'id, pagetitle, desc if ($pid == -1) { $pid = $this->documentObject['parent']; return ($pid == 0) ? false : $this->getPageInfo($pid, $active, $fields); - } else if ($pid == 0) { + } elseif ($pid == 0) { return false; } else { // first get the child document @@ -4109,7 +4107,6 @@ public function makeUrl($id, $alias = '', $args = '', $scheme = '') $alPath = ''; if ($this->config['friendly_alias_urls'] == 1) { - if ($this->config['aliaslistingfolder'] == 1) { $al = $this->getAliasListing($id); } else { @@ -4120,12 +4117,11 @@ public function makeUrl($id, $alias = '', $args = '', $scheme = '') $f_url_suffix = '/'; } - $alPath = !empty ($al['path']) ? $al['path'] . '/' : ''; + $alPath = !empty($al['path']) ? $al['path'] . '/' : ''; if ($al && $al['alias']) { $alias = $al['alias']; } - } $alias = $alPath . $f_url_prefix . $alias . $f_url_suffix; @@ -4218,7 +4214,7 @@ public function getAliasListing($id) */ public function getConfig($name = '') { - if (!empty ($this->config[$name])) { + if (!empty($this->config[$name])) { return $this->config[$name]; } else { return false; @@ -4257,7 +4253,7 @@ public function getVersionData($data = null) */ public function runSnippet($snippetName, $params = array()) { - if (isset ($this->snippetCache[$snippetName])) { + if (isset($this->snippetCache[$snippetName])) { $snippet = $this->snippetCache[$snippetName]; $properties = !empty($this->snippetCache[$snippetName . "Props"]) ? $this->snippetCache[$snippetName . "Props"] : ''; } else { // not in cache so let's check the db @@ -4293,9 +4289,9 @@ public function getChunk($chunkName) if (empty($chunkName)) { return $out; } - if (isset ($this->chunkCache[$chunkName])) { + if (isset($this->chunkCache[$chunkName])) { $out = $this->chunkCache[$chunkName]; - } else if (stripos($chunkName, '@FILE') === 0) { + } elseif (stripos($chunkName, '@FILE') === 0) { $out = $this->chunkCache[$chunkName] = $this->atBindFileContent($chunkName); } else { $where = sprintf("`name`='%s' AND disabled=0", $this->db->escape($chunkName)); @@ -4347,7 +4343,6 @@ public function parseText($tpl = '', $ph = array(), $left = '[+', $right = '+]', } foreach ($matches[1] as $i => $key) { - if (strpos($key, ':') !== false && $execModifier) { list($key, $modifiers) = $this->splitKeyAndFilter($key); } else { @@ -4370,7 +4365,7 @@ public function parseText($tpl = '', $ph = array(), $left = '[+', $right = '+]', } if (strpos($tpl, $s) !== false) { $tpl = str_replace($s, $value, $tpl); - } elseif($this->debug) { + } elseif ($this->debug) { $this->addLog('parseText parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -4500,19 +4495,19 @@ public function toTimeStamp($str) if (!preg_match('/^[0-9]{4}\/[0-9]{2}\/[0-9]{2}[0-9 :]*$/', $str)) { return ''; } - list ($Y, $m, $d, $H, $M, $S) = sscanf($str, '%4d/%2d/%2d %2d:%2d:%2d'); + list($Y, $m, $d, $H, $M, $S) = sscanf($str, '%4d/%2d/%2d %2d:%2d:%2d'); break; case 'dd-mm-YYYY': if (!preg_match('/^[0-9]{2}-[0-9]{2}-[0-9]{4}[0-9 :]*$/', $str)) { return ''; } - list ($d, $m, $Y, $H, $M, $S) = sscanf($str, '%2d-%2d-%4d %2d:%2d:%2d'); + list($d, $m, $Y, $H, $M, $S) = sscanf($str, '%2d-%2d-%4d %2d:%2d:%2d'); break; case 'mm/dd/YYYY': if (!preg_match('/^[0-9]{2}\/[0-9]{2}\/[0-9]{4}[0-9 :]*$/', $str)) { return ''; } - list ($m, $d, $Y, $H, $M, $S) = sscanf($str, '%2d/%2d/%4d %2d:%2d:%2d'); + list($m, $d, $Y, $H, $M, $S) = sscanf($str, '%2d/%2d/%4d %2d:%2d:%2d'); break; /* case 'dd-mmm-YYYY': @@ -4589,7 +4584,6 @@ public function getDocumentChildrenTVars($parentid = 0, $tvidnames = array(), $p $this->getUserDocGroups(); foreach ($docs as $doc) { - $docid = $doc['id']; $rs = $this->db->select("{$fields}, IF(tvc.value!='',tvc.value,tv.default_text) as value ", "[+prefix+]site_tmplvars tv @@ -4652,7 +4646,7 @@ public function getDocumentChildrenTVarOutput($parentid = 0, $tvidnames = array( $tvidnames[] = $resultKey; $unsetResultKey = true; } - } else if ($tvidnames != '*' && $tvidnames != $resultKey) { + } elseif ($tvidnames != '*' && $tvidnames != $resultKey) { $tvidnames = array($tvidnames, $resultKey); $unsetResultKey = true; } @@ -4727,7 +4721,7 @@ public function getTemplateVars($idnames = array(), $fields = '*', $docid = '', return $this->tmpCache[__FUNCTION__][$cacheKey]; } - if (($idnames != '*' && !is_array($idnames)) || empty($idnames) ) { + if (($idnames != '*' && !is_array($idnames)) || empty($idnames)) { return false; } else { @@ -4761,7 +4755,7 @@ public function getTemplateVars($idnames = array(), $fields = '*', $docid = '', $result = $this->db->makeArray($rs); // get default/built-in template variables - if(is_array($docRow)){ + if (is_array($docRow)) { ksort($docRow); foreach ($docRow as $key => $value) { @@ -4799,7 +4793,7 @@ public function getTemplateVars($idnames = array(), $fields = '*', $docid = '', */ public function getTemplateVarOutput($idnames = array(), $docid = '', $published = 1, $sep = '') { - if (is_array($idnames) && empty($idnames) ) { + if (is_array($idnames) && empty($idnames)) { return false; } else { $output = array(); @@ -4975,11 +4969,11 @@ public function getLoginUserID($context = '') } } else { switch (true) { - case ($this->isFrontend() && isset ($_SESSION['webValidated'])): { + case ($this->isFrontend() && isset($_SESSION['webValidated'])): { $out = $_SESSION['webInternalKey']; break; } - case ($this->isBackend() && isset ($_SESSION['mgrValidated'])): { + case ($this->isBackend() && isset($_SESSION['mgrValidated'])): { $out = $_SESSION['mgrInternalKey']; break; } @@ -5004,11 +4998,11 @@ public function getLoginUserName($context = '') } } else { switch (true) { - case ($this->isFrontend() && isset ($_SESSION['webValidated'])): { + case ($this->isFrontend() && isset($_SESSION['webValidated'])): { $out = $_SESSION['webShortname']; break; } - case ($this->isBackend() && isset ($_SESSION['mgrValidated'])): { + case ($this->isBackend() && isset($_SESSION['mgrValidated'])): { $out = $_SESSION['mgrShortname']; break; } @@ -5024,9 +5018,9 @@ public function getLoginUserName($context = '') */ public function getLoginUserType() { - if ($this->isFrontend() && isset ($_SESSION['webValidated'])) { + if ($this->isFrontend() && isset($_SESSION['webValidated'])) { return 'web'; - } elseif ($this->isBackend() && isset ($_SESSION['mgrValidated'])) { + } elseif ($this->isBackend() && isset($_SESSION['mgrValidated'])) { return 'manager'; } else { return ''; @@ -5095,7 +5089,7 @@ public function getUserDocGroups($resolveIds = false) if ($this->isFrontend() && isset($_SESSION['webDocgroups']) && isset($_SESSION['webValidated'])) { $dg = $_SESSION['webDocgroups']; $dgn = isset($_SESSION['webDocgrpNames']) ? $_SESSION['webDocgrpNames'] : false; - } else if ($this->isBackend() && isset($_SESSION['mgrDocgroups']) && isset($_SESSION['mgrValidated'])) { + } elseif ($this->isBackend() && isset($_SESSION['mgrDocgroups']) && isset($_SESSION['mgrValidated'])) { $dg = $_SESSION['mgrDocgroups']; $dgn = isset($_SESSION['mgrDocgrpNames']) ? $_SESSION['mgrDocgrpNames'] : false; } else { @@ -5103,9 +5097,9 @@ public function getUserDocGroups($resolveIds = false) } if (!$resolveIds) { return $dg; - } else if (is_array($dgn)) { + } elseif (is_array($dgn)) { return $dgn; - } else if (is_array($dg)) { + } elseif (is_array($dg)) { // resolve ids to names $dgn = array(); $ds = $this->db->select('name', $this->getFullTableName("documentgroup_names"), "id IN (" . implode(",", $dg) . ")"); @@ -5175,7 +5169,7 @@ public function isMemberOfWebGroup($groupNames = array()) return false; } // check cache - $grpNames = isset ($_SESSION['webUserGroupNames']) ? $_SESSION['webUserGroupNames'] : false; + $grpNames = isset($_SESSION['webUserGroupNames']) ? $_SESSION['webUserGroupNames'] : false; if (!is_array($grpNames)) { $rs = $this->db->select('wgn.name', $this->getFullTableName("webgroup_names") . " wgn INNER JOIN " . $this->getFullTableName("web_groups") . " wg ON wg.webgroup=wgn.id AND wg.webuser='" . $this->getLoginUserID() . "'"); @@ -5201,7 +5195,7 @@ public function isMemberOfWebGroup($groupNames = array()) */ public function regClientCSS($src, $media = '') { - if (empty($src) || isset ($this->loadedjscripts[$src])) { + if (empty($src) || isset($this->loadedjscripts[$src])) { return ''; } $nextpos = max(array_merge(array(0), array_keys($this->sjscripts))) + 1; @@ -5240,11 +5234,11 @@ public function regClientScript($src, $options = array('name' => '', 'version' = return ''; } // nothing to register if (!is_array($options)) { - if (is_bool($options)) // backward compatibility with old plaintext parameter - { + if (is_bool($options)) { // backward compatibility with old plaintext parameter + $options = array('plaintext' => $options); - } elseif (is_string($options)) // Also allow script name as 2nd param - { + } elseif (is_string($options)) { // Also allow script name as 2nd param + $options = array('name' => $options); } else { $options = array(); @@ -5373,7 +5367,7 @@ public function removeEventListener($evtName) if (!$evtName) { return false; } - unset ($this->pluginEvent[$evtName]); + unset($this->pluginEvent[$evtName]); } /** @@ -5381,7 +5375,7 @@ public function removeEventListener($evtName) */ public function removeAllEventListener() { - unset ($this->pluginEvent); + unset($this->pluginEvent); $this->pluginEvent = array(); } @@ -5397,7 +5391,7 @@ public function invokeEvent($evtName, $extParams = array()) if (!$evtName) { return false; } - if (!isset ($this->pluginEvent[$evtName])) { + if (!isset($this->pluginEvent[$evtName])) { return false; } @@ -5463,7 +5457,7 @@ public function invokeEvent($evtName, $extParams = array()) public function getPluginCode($pluginName) { $plugin = array(); - if (isset ($this->pluginCache[$pluginName])) { + if (isset($this->pluginCache[$pluginName])) { $pluginCode = $this->pluginCache[$pluginName]; $pluginProperties = isset($this->pluginCache[$pluginName . "Props"]) ? $this->pluginCache[$pluginName . "Props"] : ''; } else { @@ -5503,7 +5497,6 @@ public function parseProperties($propertyString, $elementName = null, $elementTy if ($jsonFormat === false) { $props = explode('&', $propertyString); foreach ($props as $prop) { - if (empty($prop)) { continue; } elseif (strpos($prop, '=') === false) { @@ -5529,7 +5522,7 @@ public function parseProperties($propertyString, $elementName = null, $elementTy } } // new json-format - } else if (!empty($jsonFormat)) { + } elseif (!empty($jsonFormat)) { foreach ($jsonFormat as $key => $row) { if (!empty($key)) { if (is_array($row)) { @@ -5906,17 +5899,17 @@ public function safeEval($phpcode = '', $evalmode = '', $safe_functions = '') modx_sanitize_gpc($phpcode); switch ($evalmode) { - case 'with_scan' : + case 'with_scan': $isSafe = $this->isSafeCode($phpcode, $safe_functions); break; - case 'with_scan_at_post' : + case 'with_scan_at_post': $isSafe = $_POST ? $this->isSafeCode($phpcode, $safe_functions) : true; break; - case 'everytime_eval' : + case 'everytime_eval': $isSafe = true; break; // Should debug only - case 'dont_eval' : - default : + case 'dont_eval': + default: return $phpcode; } @@ -5989,7 +5982,6 @@ public function isSafeCode($phpcode = '', $safe_functions = '') */ public function atBindFileContent($str = '') { - $search_path = array('assets/tvs/', 'assets/chunks/', 'assets/templates/', $this->config['rb_base_url'] . 'files/', ''); if (stripos($str, '@FILE') !== 0) { @@ -6121,7 +6113,6 @@ public function phpError($nr, $text, $file, $line) */ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = true, $nr = '', $file = '', $source = '', $text = '', $line = '', $output = '') { - if (0 < $this->messageQuitCount) { return; } @@ -6138,8 +6129,8 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = $table = array(); - $version = isset ($GLOBALS['modx_version']) ? $GLOBALS['modx_version'] : ''; - $release_date = isset ($GLOBALS['release_date']) ? $GLOBALS['release_date'] : ''; + $version = isset($GLOBALS['modx_version']) ? $GLOBALS['modx_version'] : ''; + $release_date = isset($GLOBALS['release_date']) ? $GLOBALS['release_date'] : ''; $request_uri = "http://" . $_SERVER['HTTP_HOST'] . ($_SERVER["SERVER_PORT"] == 80 ? "" : (":" . $_SERVER["SERVER_PORT"])) . $_SERVER['REQUEST_URI']; $request_uri = $this->htmlspecialchars($request_uri, ENT_QUOTES, $this->config['modx_charset']); $ua = $this->htmlspecialchars($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, $this->config['modx_charset']); @@ -6154,7 +6145,7 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = $str .= '

    ' . $msg . '

    '; } - if (!empty ($query)) { + if (!empty($query)) { $str .= '
    SQL > ' . $query . '
    '; } @@ -6192,7 +6183,6 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = if ($line) { $table[] = array('Line', $line); } - } if ($source != '') { @@ -6249,7 +6239,7 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = $queryTime = $this->queryTime; $phpTime = $totalTime - $queryTime; - $queries = isset ($this->executedQueries) ? $this->executedQueries : 0; + $queries = isset($this->executedQueries) ? $this->executedQueries : 0; $queryTime = sprintf("%2.4f s", $queryTime); $totalTime = sprintf("%2.4f s", $totalTime); $phpTime = sprintf("%2.4f s", $phpTime); @@ -6283,11 +6273,11 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = $source .= $actionName; } switch ($nr) { - case E_DEPRECATED : - case E_USER_DEPRECATED : - case E_STRICT : - case E_NOTICE : - case E_USER_NOTICE : + case E_DEPRECATED: + case E_USER_DEPRECATED: + case E_STRICT: + case E_NOTICE: + case E_USER_NOTICE: $error_level = 2; break; default: @@ -6315,7 +6305,6 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = ' . $str . ''; - } else { echo 'Error'; } @@ -6694,7 +6683,6 @@ public function addLog($title = 'no title', $msg = '', $type = 1) } $this->logEvent(0, $type, $msg, $title); } - } /** @@ -6759,7 +6747,7 @@ public function stopPropagation() public function _resetEventObject() { - unset ($this->returnedValues); + unset($this->returnedValues); $this->name = ""; $this->_output = ""; $this->_propagate = true; diff --git a/manager/includes/error.class.inc.php b/manager/includes/error.class.inc.php index f82cd17d1a..42dd3abc3c 100755 --- a/manager/includes/error.class.inc.php +++ b/manager/includes/error.class.inc.php @@ -22,7 +22,6 @@ class errorHandler */ public function __construct() { - $_lang = $this->include_lang('errormsg'); $this->errors = array( diff --git a/manager/includes/extenders/dbapi.mysql.class.inc.php b/manager/includes/extenders/dbapi.mysql.class.inc.php index 6f5b60b78a..5172d7f252 100755 --- a/manager/includes/extenders/dbapi.mysql.class.inc.php +++ b/manager/includes/extenders/dbapi.mysql.class.inc.php @@ -7,7 +7,6 @@ class DBAPI { - public $conn; public $config; public $lastQuery; @@ -172,13 +171,12 @@ public function disconnect() public function escape($s, $safecount = 0) { - $safecount++; if (1000 < $safecount) { exit("Too many loops '{$safecount}'"); } - if (empty ($this->conn) || !is_resource($this->conn)) { + if (empty($this->conn) || !is_resource($this->conn)) { $this->connect(); } @@ -205,7 +203,7 @@ public function escape($s, $safecount = 0) public function query($sql, $watchError = true) { $modx = evolutionCMS(); - if (empty ($this->conn) || !is_resource($this->conn)) { + if (empty($this->conn) || !is_resource($this->conn)) { $this->connect(); } $tstart = $modx->getMicroTime(); @@ -416,7 +414,6 @@ public function insert($fields, $intotable, $fromfields = "*", $fromtable = "", public function save($fields, $table, $where = '') { - if ($where === '') { $mode = 'insert'; } elseif ($this->getRecordCount($this->select('*', $table, $where)) == 0) { @@ -617,7 +614,7 @@ public function getValue($dsq) public function getTableMetaData($table) { $metadata = false; - if (!empty ($table)) { + if (!empty($table)) { $sql = "SHOW FIELDS FROM $table"; if ($ds = $this->query($sql)) { while ($row = $this->getRow($ds)) { @@ -643,16 +640,16 @@ public function prepareDate($timestamp, $fieldType = 'DATETIME') $date = ''; if (!$timestamp === false && $timestamp > 0) { switch ($fieldType) { - case 'DATE' : + case 'DATE': $date = date('Y-m-d', $timestamp); break; - case 'TIME' : + case 'TIME': $date = date('H:i:s', $timestamp); break; - case 'YEAR' : + case 'YEAR': $date = date('Y', $timestamp); break; - default : + default: $date = date('Y-m-d H:i:s', $timestamp); break; } @@ -705,7 +702,6 @@ public function getVersion() */ public function replaceFullTableName($str, $force = null) { - $str = trim($str); $dbase = trim($this->config['dbase'], '`'); $prefix = $this->config['table_prefix']; @@ -744,7 +740,6 @@ public function dataSeek($result, $row_number) public function _getFieldsStringFromArray($fields = array()) { - if (empty($fields)) { return '*'; } @@ -771,4 +766,3 @@ public function _getFromStringFromArray($tables = array()) return implode(' ', $_); } } - diff --git a/manager/includes/extenders/dbapi.mysqli.class.inc.php b/manager/includes/extenders/dbapi.mysqli.class.inc.php index 8596b6f091..b9a9b0136a 100755 --- a/manager/includes/extenders/dbapi.mysqli.class.inc.php +++ b/manager/includes/extenders/dbapi.mysqli.class.inc.php @@ -119,7 +119,7 @@ public function escape($s, $safeCount = 0) if (1000 < $safeCount) { exit("Too many loops '{$safeCount}'"); } - if ( ! ($this->conn instanceof mysqli)) { + if (! ($this->conn instanceof mysqli)) { $this->connect(); } if (is_array($s)) { @@ -145,7 +145,7 @@ public function escape($s, $safeCount = 0) public function query($sql, $watchError = true) { $modx = evolutionCMS(); - if ( ! ($this->conn instanceof mysqli)) { + if (! ($this->conn instanceof mysqli)) { $this->connect(); } $tStart = $modx->getMicroTime(); @@ -295,7 +295,7 @@ public function update($fields, $table, $where = "") $modx = evolutionCMS(); $out = false; if (!$table) { - $modx->messageQuit('Empty '.$table.' parameter in DBAPI::update().'); + $modx->messageQuit('Empty ' . $table . ' parameter in DBAPI::update().'); } else { $table = $this->replaceFullTableName($table); if (is_array($fields)) { @@ -311,10 +311,10 @@ public function update($fields, $table, $where = "") } $where = trim($where); if ($where !== '' && stripos($where, 'WHERE') !== 0) { - $where = 'WHERE '.$where; + $where = 'WHERE ' . $where; } - return $this->query('UPDATE '.$table.' SET '.$fields.' '.$where); + return $this->query('UPDATE ' . $table . ' SET ' . $fields . ' ' . $where); } return $out; } @@ -490,7 +490,7 @@ public function getRow($ds, $mode = 'assoc') { $out = false; if ($ds instanceof mysqli_result) { - switch($mode){ + switch ($mode) { case 'assoc': $out = $ds->fetch_assoc(); break; @@ -520,7 +520,7 @@ public function getRow($ds, $mode = 'assoc') public function getColumn($name, $dsq) { $col = array(); - if ( ! ($dsq instanceof mysqli_result)) { + if (! ($dsq instanceof mysqli_result)) { $dsq = $this->query($dsq); } if ($dsq) { @@ -539,7 +539,7 @@ public function getColumn($name, $dsq) public function getColumnNames($dsq) { $names = array(); - if ( ! ($dsq instanceof mysqli_result)) { + if (! ($dsq instanceof mysqli_result)) { $dsq = $this->query($dsq); } if ($dsq) { @@ -559,7 +559,7 @@ public function getColumnNames($dsq) public function getValue($dsq) { $out = false; - if ( ! ($dsq instanceof mysqli_result)) { + if (! ($dsq instanceof mysqli_result)) { $dsq = $this->query($dsq); } if ($dsq) { @@ -578,7 +578,7 @@ public function getTableMetaData($table) { $metadata = array(); if (!empty($table) && is_scalar($table)) { - $sql = 'SHOW FIELDS FROM '.$table; + $sql = 'SHOW FIELDS FROM ' . $table; if ($ds = $this->query($sql)) { while ($row = $this->getRow($ds)) { $fieldName = $row['Field']; @@ -600,16 +600,16 @@ public function prepareDate($timestamp, $fieldType = 'DATETIME') $date = false; if (!$timestamp === false && $timestamp > 0) { switch ($fieldType) { - case 'DATE' : + case 'DATE': $date = date('Y-m-d', $timestamp); break; - case 'TIME' : + case 'TIME': $date = date('H:i:s', $timestamp); break; - case 'YEAR' : + case 'YEAR': $date = date('Y', $timestamp); break; - default : + default: $date = date('Y-m-d H:i:s', $timestamp); break; } @@ -674,9 +674,9 @@ public function replaceFullTableName($tableName, $force = false) */ public function optimize($table_name) { - $rs = $this->query('OPTIMIZE TABLE '.$table_name); + $rs = $this->query('OPTIMIZE TABLE ' . $table_name); if ($rs) { - $rs = $this->query('ALTER TABLE '.$table_name); + $rs = $this->query('ALTER TABLE ' . $table_name); } return $rs; @@ -688,7 +688,7 @@ public function optimize($table_name) */ public function truncate($table_name) { - return $this->query('TRUNCATE '.$table_name); + return $this->query('TRUNCATE ' . $table_name); } /** @@ -707,7 +707,6 @@ public function dataSeek($result, $row_number) */ public function _getFieldsStringFromArray($fields = array()) { - if (empty($fields)) { return '*'; } @@ -715,7 +714,7 @@ public function _getFieldsStringFromArray($fields = array()) $_ = array(); foreach ($fields as $k => $v) { if ($k !== $v) { - $_[] = $v.' as '.$k; + $_[] = $v . ' as ' . $k; } else { $_[] = $v; } diff --git a/manager/includes/extenders/deprecated.functions.inc.php b/manager/includes/extenders/deprecated.functions.inc.php index 42b91290f2..5e8c8d138e 100755 --- a/manager/includes/extenders/deprecated.functions.inc.php +++ b/manager/includes/extenders/deprecated.functions.inc.php @@ -109,7 +109,7 @@ public function makeList($array, $ulroot = 'root', $ulprefix = 'sub_', $type = ' if (!is_array($array)) { return "
    • Bad list
    "; } - if (!empty ($type)) { + if (!empty($type)) { $typestr = " style='list-style-type: $type'"; } else { $typestr = ""; @@ -218,7 +218,7 @@ public function userLoggedIn() { $modx = evolutionCMS(); $userdetails = array(); - if ($modx->isFrontend() && isset ($_SESSION['webValidated'])) { + if ($modx->isFrontend() && isset($_SESSION['webValidated'])) { // web user $userdetails['loggedIn'] = true; $userdetails['id'] = $_SESSION['webInternalKey']; @@ -227,7 +227,7 @@ public function userLoggedIn() return $userdetails; } else { - if ($modx->isBackend() && isset ($_SESSION['mgrValidated'])) { + if ($modx->isBackend() && isset($_SESSION['mgrValidated'])) { // manager user $userdetails['loggedIn'] = true; $userdetails['id'] = $_SESSION['mgrInternalKey']; diff --git a/manager/includes/extenders/ex_dbapi.inc.php b/manager/includes/extenders/ex_dbapi.inc.php index 949109de89..bebeda3af1 100755 --- a/manager/includes/extenders/ex_dbapi.inc.php +++ b/manager/includes/extenders/ex_dbapi.inc.php @@ -7,15 +7,17 @@ global $database_type; -if (empty($database_type)) $database_type = 'mysql'; +if (empty($database_type)) { + $database_type = 'mysql'; +} $out = false; $class = 'DBAPI'; -if( ! class_exists($class)){ +if (! class_exists($class)) { include_once MODX_MANAGER_PATH . 'includes/extenders/dbapi.' . $database_type . '.class.inc.php'; } -if(class_exists($class)){ +if (class_exists($class)) { $this->db= new $class; $out = true; } diff --git a/manager/includes/extenders/export.class.inc.php b/manager/includes/extenders/export.class.inc.php index 42e7b98850..adc689163e 100755 --- a/manager/includes/extenders/export.class.inc.php +++ b/manager/includes/extenders/export.class.inc.php @@ -172,7 +172,8 @@ public function removeDirectoryAll($directory = '') */ public function makeFile($docid, $filepath) { - $modx = evolutionCMS(); global $_lang; + $modx = evolutionCMS(); + global $_lang; $file_permission = octdec($modx->config['new_file_permissions']); if ($this->generate_mode === 'direct') { $back_lang = $_lang; @@ -286,7 +287,7 @@ public function run($parent = 0) if ($row['published'] === '1') { $status = $this->makeFile($row['id'], $filename); switch ($status) { - case 'failed_no_write' : + case 'failed_no_write': $row['status'] = $msg_failed_no_write; break; case 'failed_no_retrieve': @@ -319,7 +320,6 @@ public function run($parent = 0) } mkdir($dir_path); @chmod($dir_path, $folder_permission); - } @@ -370,5 +370,4 @@ public function parsePlaceholder($tpl, $ph = array()) return $tpl; } - } diff --git a/manager/includes/extenders/maketable.class.php b/manager/includes/extenders/maketable.class.php index ccd716197b..2a9f4034b8 100755 --- a/manager/includes/extenders/maketable.class.php +++ b/manager/includes/extenders/maketable.class.php @@ -332,10 +332,10 @@ public function getColumnWidth($columnPosition) public function determineRowClass($position) { switch ($this->rowAlternatingScheme) { - case 'ODD' : + case 'ODD': $modRemainder = 1; break; - case 'EVEN' : + case 'EVEN': default: $modRemainder = 0; break; @@ -441,7 +441,7 @@ public function create($fieldsArray, $fieldHeadersArray = array(), $linkpage = " $table .= $this->createCellText($currentActionFieldValue, $value); $table .= "\n"; if ($i == 0) { - if (empty ($header) && $this->formElementType) { + if (empty($header) && $this->formElementType) { $header .= "\t\tthClass ? 'class="' . $this->thClass . '"' : '') . ">" . ($this->allOption ? 'all' : '') . "\n"; } $headerText = array_key_exists($key, $fieldHeadersArray) ? $fieldHeadersArray[$key] : $key; @@ -471,7 +471,6 @@ public function create($fieldsArray, $fieldHeadersArray = array(), $linkpage = " */ $table .= ''; //$table .= ''; - } if ($this->allOption) { $table .= ' @@ -644,5 +643,4 @@ public function prepareOrderByLink($key, $text, $qs = '') return '' . $text . ''; } - } diff --git a/manager/includes/extenders/manager.api.class.inc.php b/manager/includes/extenders/manager.api.class.inc.php index b1643f1605..323e2a0d5a 100755 --- a/manager/includes/extenders/manager.api.class.inc.php +++ b/manager/includes/extenders/manager.api.class.inc.php @@ -86,7 +86,6 @@ public function saveFormValues($id = 0) */ public function loadFormValues() { - if (!$this->hasFormValues()) { return false; } diff --git a/manager/includes/extenders/message.quit.inc.php b/manager/includes/extenders/message.quit.inc.php index e076ce04c2..3830fa14c4 100755 --- a/manager/includes/extenders/message.quit.inc.php +++ b/manager/includes/extenders/message.quit.inc.php @@ -3,7 +3,7 @@ * Message Quit Template * */ -if(( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) && IN_PARSER_MODE!="true") { +if ((! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) && IN_PARSER_MODE!="true") { die("INCLUDE ACCESS ERROR

    Direct access to this file prohibited."); } @@ -20,61 +20,60 @@ function copyToClip() "; -if($is_error) { - $parsedMessageString .= "

     MODX Parse Error

    +if ($is_error) { + $parsedMessageString .= "

     MODX Parse Error

    "; } else { - $parsedMessageString .= "

     MODX Debug/ stop message

    + $parsedMessageString .= "

     MODX Debug/ stop message

    MODX encountered the following error while attempting to parse the requested resource:
    « $msg »
    "; } -if(!empty($query)) { - $parsedMessageString .= ""; } -if($text!='') { +if ($text!='') { + $errortype = array( + E_ERROR => "Error", + E_WARNING => "Warning", + E_PARSE => "Parsing Error", + E_NOTICE => "Notice", + E_CORE_ERROR => "Core Error", + E_CORE_WARNING => "Core Warning", + E_COMPILE_ERROR => "Compile Error", + E_COMPILE_WARNING => "Compile Warning", + E_USER_ERROR => "User Error", + E_USER_WARNING => "User Warning", + E_USER_NOTICE => "User Notice", + ); - $errortype = array ( - E_ERROR => "Error", - E_WARNING => "Warning", - E_PARSE => "Parsing Error", - E_NOTICE => "Notice", - E_CORE_ERROR => "Core Error", - E_CORE_WARNING => "Core Warning", - E_COMPILE_ERROR => "Compile Error", - E_COMPILE_WARNING => "Compile Warning", - E_USER_ERROR => "User Error", - E_USER_WARNING => "User Warning", - E_USER_NOTICE => "User Notice", - ); + $parsedMessageString .= ""; - $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; - - $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; - if($source!='') { - $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; - } + $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; + if ($source!='') { + $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; + } } $parsedMessageString .= ""; diff --git a/manager/includes/extenders/modifiers.class.inc.php b/manager/includes/extenders/modifiers.class.inc.php index da6e862edd..082f34e90e 100755 --- a/manager/includes/extenders/modifiers.class.inc.php +++ b/manager/includes/extenders/modifiers.class.inc.php @@ -1,8 +1,11 @@ config['modx_charset']); + if (function_exists('mb_internal_encoding')) { + mb_internal_encoding($modx->config['modx_charset']); + } $this->condModifiers = '=,is,eq,equals,ne,neq,notequals,isnot,isnt,not,%,isempty,isnotempty,isntempty,>=,gte,eg,gte,greaterthan,>,gt,isgreaterthan,isgt,lowerthan,<,lt,<=,lte,islte,islowerthan,islt,el,find,in,inarray,in_array,fnmatch,wcard,wcard_match,wildcard,wildcard_match,is_file,is_dir,file_exists,is_readable,is_writable,is_image,regex,preg,preg_match,memberof,mo,isinrole,ir'; } @@ -70,13 +75,15 @@ public function __construct() * @param string $modifiers * @return bool|mixed|string */ - public function phxFilter($key,$value,$modifiers) + public function phxFilter($key, $value, $modifiers) { $modx = evolutionCMS(); - if(substr($modifiers,0,3)!=='id(') $value = $this->parseDocumentSource($value); + if (substr($modifiers, 0, 3)!=='id(') { + $value = $this->parseDocumentSource($value); + } $this->srcValue = $value; $modifiers = trim($modifiers); - $modifiers = ':'.trim($modifiers,':'); + $modifiers = ':' . trim($modifiers, ':'); $modifiers = str_replace(array("\r\n","\r"), "\n", $modifiers); $modifiers = $this->splitEachModifiers($modifiers); @@ -86,7 +93,7 @@ public function phxFilter($key,$value,$modifiers) $this->condition = array(); $this->vars = array(); $this->vars['name'] = & $key; - $value = $this->parsePhx($key,$value,$modifiers); + $value = $this->parsePhx($key, $value, $modifiers); $this->vars = array(); return $value; } @@ -96,13 +103,18 @@ public function phxFilter($key,$value,$modifiers) * @param string $modifiers * @return bool|string */ - public function _getDelim($mode,$modifiers) { - $c = substr($modifiers,0,1); - if(!in_array($c, array('"', "'", '`')) ) return false; + public function _getDelim($mode, $modifiers) + { + $c = substr($modifiers, 0, 1); + if (!in_array($c, array('"', "'", '`'))) { + return false; + } - $modifiers = substr($modifiers,1); + $modifiers = substr($modifiers, 1); $closure = $mode=='(' ? "{$c})" : $c; - if(strpos($modifiers, $closure)===false) return false; + if (strpos($modifiers, $closure)===false) { + return false; + } return $c; } @@ -113,142 +125,157 @@ public function _getDelim($mode,$modifiers) { * @param string $modifiers * @return bool|string */ - public function _getOpt($mode,$delim,$modifiers) { - if($delim) { - if($mode=='(') return substr($modifiers,1,strpos($modifiers, $delim . ')' )-1); + public function _getOpt($mode, $delim, $modifiers) + { + if ($delim) { + if ($mode=='(') { + return substr($modifiers, 1, strpos($modifiers, $delim . ')')-1); + } - return substr($modifiers,1,strpos($modifiers,$delim,1)-1); - } - else { - if($mode=='(') return substr($modifiers,0,strpos($modifiers, ')') ); + return substr($modifiers, 1, strpos($modifiers, $delim, 1)-1); + } else { + if ($mode=='(') { + return substr($modifiers, 0, strpos($modifiers, ')')); + } $chars = str_split($modifiers); $opt=''; - foreach($chars as $c) { - if($c==':' || $c==')') break; + foreach ($chars as $c) { + if ($c==':' || $c==')') { + break; + } $opt .=$c; } return $opt; } } - public function _getRemainModifiers($mode,$delim,$modifiers) { - if($delim) { - if($mode=='(') + public function _getRemainModifiers($mode, $delim, $modifiers) + { + if ($delim) { + if ($mode=='(') { return $this->_fetchContent($modifiers, $delim . ')'); - else { + } else { $modifiers = trim($modifiers); - $modifiers = substr($modifiers,1); + $modifiers = substr($modifiers, 1); return $this->_fetchContent($modifiers, $delim); } - } - else { - if($mode=='(') return $this->_fetchContent($modifiers, ')'); + } else { + if ($mode=='(') { + return $this->_fetchContent($modifiers, ')'); + } $chars = str_split($modifiers); - foreach($chars as $c) { - if($c==':') return $modifiers; - else $modifiers = substr($modifiers,1); + foreach ($chars as $c) { + if ($c==':') { + return $modifiers; + } else { + $modifiers = substr($modifiers, 1); + } } return $modifiers; } } - public function _fetchContent($string,$delim) { + public function _fetchContent($string, $delim) + { $len = strlen($delim); $string = $this->parseDocumentSource($string); - return substr($string,strpos($string, $delim)+$len); + return substr($string, strpos($string, $delim)+$len); } - public function splitEachModifiers($modifiers) { + public function splitEachModifiers($modifiers) + { $modx = evolutionCMS(); $cmd = ''; $bt = ''; $result = array(); - while($bt!==$modifiers) { + while ($bt!==$modifiers) { $bt = $modifiers; - $c = substr($modifiers,0,1); - $modifiers = substr($modifiers,1); + $c = substr($modifiers, 0, 1); + $modifiers = substr($modifiers, 1); - if($c===':' && preg_match('@^(!?[<>=]{1,2})@', $modifiers, $match)) { // :=, :!=, :<=, :>=, :!<=, :!>= - $c = substr($modifiers,strlen($match[1]),1); + if ($c===':' && preg_match('@^(!?[<>=]{1,2})@', $modifiers, $match)) { // :=, :!=, :<=, :>=, :!<=, :!>= + $c = substr($modifiers, strlen($match[1]), 1); $debuginfo = "#i=0 #c=[{$c}] #m=[{$modifiers}]"; - if($c==='(') $modifiers = substr($modifiers,strlen($match[1])+1); - else $modifiers = substr($modifiers,strlen($match[1])); + if ($c==='(') { + $modifiers = substr($modifiers, strlen($match[1])+1); + } else { + $modifiers = substr($modifiers, strlen($match[1])); + } - $delim = $this->_getDelim($c,$modifiers); - $opt = $this->_getOpt($c,$delim,$modifiers); - $modifiers = trim($this->_getRemainModifiers($c,$delim,$modifiers)); + $delim = $this->_getDelim($c, $modifiers); + $opt = $this->_getOpt($c, $delim, $modifiers); + $modifiers = trim($this->_getRemainModifiers($c, $delim, $modifiers)); $result[]=array('cmd'=>trim($match[1]),'opt'=>$opt,'debuginfo'=>$debuginfo); $cmd = ''; - } - elseif(in_array($c,array('+','-','*','/')) && preg_match('@^[0-9]+@', $modifiers, $match)) { // :+3, :-3, :*3 ... - $modifiers = substr($modifiers,strlen($match[0])); - $result[]=array('cmd'=>'math','opt'=>'%s'.$c.$match[0]); + } elseif (in_array($c, array('+','-','*','/')) && preg_match('@^[0-9]+@', $modifiers, $match)) { // :+3, :-3, :*3 ... + $modifiers = substr($modifiers, strlen($match[0])); + $result[]=array('cmd'=>'math','opt'=>'%s' . $c . $match[0]); $cmd = ''; - } - elseif($c==='(' || $c==='=') { + } elseif ($c==='(' || $c==='=') { $modifiers = $m1 = trim($modifiers); - $delim = $this->_getDelim($c,$modifiers); - $opt = $this->_getOpt($c,$delim,$modifiers); - $modifiers = trim($this->_getRemainModifiers($c,$delim,$modifiers)); + $delim = $this->_getDelim($c, $modifiers); + $opt = $this->_getOpt($c, $delim, $modifiers); + $modifiers = trim($this->_getRemainModifiers($c, $delim, $modifiers)); $debuginfo = "#i=1 #c=[{$c}] #delim=[{$delim}] #m1=[{$m1}] remainMdf=[{$modifiers}]"; $result[]=array('cmd'=>trim($cmd),'opt'=>$opt,'debuginfo'=>$debuginfo); $cmd = ''; - } - elseif($c==':') { + } elseif ($c==':') { $debuginfo = "#i=2 #c=[{$c}] #m=[{$modifiers}]"; - if($cmd!=='') $result[]=array('cmd'=>trim($cmd),'opt'=>'','debuginfo'=>$debuginfo); + if ($cmd!=='') { + $result[]=array('cmd'=>trim($cmd),'opt'=>'','debuginfo'=>$debuginfo); + } $cmd = ''; - } - elseif(trim($modifiers)=='' && trim($cmd)!=='') { + } elseif (trim($modifiers)=='' && trim($cmd)!=='') { $debuginfo = "#i=3 #c=[{$c}] #m=[{$modifiers}]"; $cmd .= $c; $result[]=array('cmd'=>trim($cmd),'opt'=>'','debuginfo'=>$debuginfo); break; - } - else { + } else { $cmd .= $c; } } - if(empty($result)) return array(); + if (empty($result)) { + return array(); + } - foreach($result as $i=>$a) - { + foreach ($result as $i=>$a) { $a['opt'] = $this->parseDocumentSource($a['opt']); - $result[$i]['opt'] = $modx->mergePlaceholderContent($a['opt'],$this->placeholders); + $result[$i]['opt'] = $modx->mergePlaceholderContent($a['opt'], $this->placeholders); } return $result; } - public function parsePhx($key,$value,$modifiers) + public function parsePhx($key, $value, $modifiers) { $modx = evolutionCMS(); $lastKey = ''; - $cacheKey = md5(sprintf('parsePhx#%s#%s#%s',$key,$value,print_r($modifiers,true))); - if(isset($this->tmpCache[$cacheKey])) return $this->tmpCache[$cacheKey]; - if(empty($modifiers)) return ''; + $cacheKey = md5(sprintf('parsePhx#%s#%s#%s', $key, $value, print_r($modifiers, true))); + if (isset($this->tmpCache[$cacheKey])) { + return $this->tmpCache[$cacheKey]; + } + if (empty($modifiers)) { + return ''; + } - foreach($modifiers as $m) - { + foreach ($modifiers as $m) { $lastKey = strtolower($m['cmd']); } - $_ = explode(',',$this->condModifiers); - if(in_array($lastKey,$_)) - { + $_ = explode(',', $this->condModifiers); + if (in_array($lastKey, $_)) { $modifiers[] = array('cmd'=>'then','opt'=>'1'); $modifiers[] = array('cmd'=>'else','opt'=>'0'); } - foreach($modifiers as $i=>$a) - { - $value = $this->Filter($key,$value, $a['cmd'], $a['opt']); + foreach ($modifiers as $i=>$a) { + $value = $this->Filter($key, $value, $a['cmd'], $a['opt']); } $this->tmpCache[$cacheKey] = $value; return $value; @@ -259,56 +286,71 @@ public function Filter($key, $value, $cmd, $opt='') { $modx = evolutionCMS(); - if($key==='documentObject') $value = $modx->documentIdentifier; + if ($key==='documentObject') { + $value = $modx->documentIdentifier; + } $cmd = $this->parseDocumentSource($cmd); - if(preg_match('@^[1-9][/0-9]*$@',$cmd)) - { - if(strpos($cmd,'/')!==false) - $cmd = $this->substr($cmd,strrpos($cmd,'/')+1); + if (preg_match('@^[1-9][/0-9]*$@', $cmd)) { + if (strpos($cmd, '/')!==false) { + $cmd = $this->substr($cmd, strrpos($cmd, '/')+1); + } $opt = $cmd; $cmd = 'id'; } - if(isset($modx->snippetCache["phx:{$cmd}"])) $this->elmName = "phx:{$cmd}"; - elseif(isset($modx->chunkCache["phx:{$cmd}"])) $this->elmName = "phx:{$cmd}"; - else $this->elmName = ''; + if (isset($modx->snippetCache["phx:{$cmd}"])) { + $this->elmName = "phx:{$cmd}"; + } elseif (isset($modx->chunkCache["phx:{$cmd}"])) { + $this->elmName = "phx:{$cmd}"; + } else { + $this->elmName = ''; + } $cmd = strtolower($cmd); - if($this->elmName!=='') + if ($this->elmName!=='') { $value = $this->getValueFromElement($key, $value, $cmd, $opt); - else + } else { $value = $this->getValueFromPreset($key, $value, $cmd, $opt); + } $value = str_replace('[+key+]', $key, $value); return $value; } - public function isEmpty($cmd,$value) + public function isEmpty($cmd, $value) { - if($value!=='') return false; + if ($value!=='') { + return false; + } $_ = explode(',', $this->condModifiers . ',_default,default,if,input,or,and,show,this,select,switch,then,else,id,ifempty,smart_desc,smart_description,summary'); - if(in_array($cmd,$_)) return false; - else return true; + if (in_array($cmd, $_)) { + return false; + } else { + return true; + } } public function getValueFromPreset($key, $value, $cmd, $opt) { $modx = evolutionCMS(); - if($this->isEmpty($cmd,$value)) return ''; + if ($this->isEmpty($cmd, $value)) { + return ''; + } $this->key = $key; $this->value = $value; $this->opt = $opt; - switch ($cmd) - { + switch ($cmd) { ##### Conditional Modifiers case 'input': case 'if': - if(!$opt) return $value; + if (!$opt) { + return $value; + } return $opt; case '=': case 'eq': @@ -369,22 +411,35 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'file_exists': case 'is_readable': case 'is_writable': - if(!$opt) $path = $value; - else $path = $opt; - if(strpos($path,MODX_MANAGER_PATH)!==false) exit('Can not read core path'); - if(strpos($path,$modx->config['base_path'])===false) $path = ltrim($path,'/'); + if (!$opt) { + $path = $value; + } else { + $path = $opt; + } + if (strpos($path, MODX_MANAGER_PATH)!==false) { + exit('Can not read core path'); + } + if (strpos($path, $modx->config['base_path'])===false) { + $path = ltrim($path, '/'); + } $this->condition[] = (int)($cmd($path)!==false);break; case 'is_image': - if(!$opt) $path = $value; - else $path = $opt; - if(!is_file($path)) {$this->condition[]='0';break;} + if (!$opt) { + $path = $value; + } else { + $path = $opt; + } + if (!is_file($path)) { + $this->condition[]='0'; + break; + } $_ = getimagesize($path); $this->condition[] = (int)($_[0]);break; case 'regex': case 'preg': case 'preg_match': case 'isinrole': - $this->condition[] = (int)(preg_match($opt,$value));break; + $this->condition[] = (int)(preg_match($opt, $value));break; case 'ir': case 'memberof': case 'mo': @@ -397,45 +452,55 @@ public function getValueFromPreset($key, $value, $cmd, $opt) $this->condition[] = '&&';break; case 'show': case 'this': - $conditional = implode(' ',$this->condition); + $conditional = implode(' ', $this->condition); $isvalid = (int)(eval("return ({$conditional});")); - if ($isvalid) return $this->srcValue; - return NULL; + if ($isvalid) { + return $this->srcValue; + } + return null; case 'then': - $conditional = implode(' ',$this->condition); + $conditional = implode(' ', $this->condition); $isvalid = (int)eval("return ({$conditional});"); - if ($isvalid) return $opt; + if ($isvalid) { + return $opt; + } return null; case 'else': - $conditional = implode(' ',$this->condition); + $conditional = implode(' ', $this->condition); $isvalid = (int)eval("return ({$conditional});"); - if (!$isvalid) return $opt; + if (!$isvalid) { + return $opt; + } break; case 'select': case 'switch': - $raw = explode('&',$opt); + $raw = explode('&', $opt); $map = array(); $c = count($raw); - for($m=0; $m<$c; $m++) { - $mi = explode('=',$raw[$m],2); + for ($m=0; $m<$c; $m++) { + $mi = explode('=', $raw[$m], 2); $map[$mi[0]] = $mi[1]; } - if(isset($map[$value])) return $map[$value]; - else return ''; + if (isset($map[$value])) { + return $map[$value]; + } else { + return ''; + } ##### End of Conditional Modifiers ##### Encode / Decode / Hash / Escape + // no break case 'htmlent': case 'htmlentities': - return htmlentities($value,ENT_QUOTES,$modx->config['modx_charset']); + return htmlentities($value, ENT_QUOTES, $modx->config['modx_charset']); case 'html_entity_decode': case 'decode_html': case 'html_decode': - return html_entity_decode($value,ENT_QUOTES,$modx->config['modx_charset']); + return html_entity_decode($value, ENT_QUOTES, $modx->config['modx_charset']); case 'esc': case 'escape': $value = preg_replace('/&(#[0-9]+|[a-z]+);/i', '&$1;', htmlspecialchars($value, ENT_QUOTES, $modx->config['modx_charset'])); - return str_replace(array('[', ']', '`'),array('[', ']', '`'),$value); + return str_replace(array('[', ']', '`'), array('[', ']', '`'), $value); case 'sql_escape': case 'encode_js': return $modx->db->escape($value); @@ -445,40 +510,45 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'html_encode': return preg_replace('/&(#[0-9]+|[a-z]+);/i', '&$1;', htmlspecialchars($value, ENT_QUOTES, $modx->config['modx_charset'])); case 'spam_protect': - return str_replace(array('@','.'),array('@','.'),$value); + return str_replace(array('@','.'), array('@','.'), $value); case 'strip': - if($opt==='') $opt = ' '; + if ($opt==='') { + $opt = ' '; + } return preg_replace('/[\n\r\t\s]+/', $opt, $value); case 'strip_linefeeds': return str_replace(array("\n","\r"), '', $value); case 'notags': case 'strip_tags': case 'remove_html': - if($opt!=='') - { + if ($opt!=='') { $param = array(); - foreach(explode(',',$opt) as $v) - { - $v = trim($v,' '); + foreach (explode(',', $opt) as $v) { + $v = trim($v, ' '); $param[] = "<{$v}>"; } - $params = implode(',',$param); + $params = implode(',', $param); + } else { + $params = ''; } - else $params = ''; - if(!strpos($params,'
    ')===false) { - $value = preg_replace('@()\n@','$1',$value); - $value = preg_replace('@@',"\n",$value); + if (!strpos($params, '
    ')===false) { + $value = preg_replace('@()\n@', '$1', $value); + $value = preg_replace('@@', "\n", $value); } - return $this->strip_tags($value,$params); + return $this->strip_tags($value, $params); case 'urlencode': case 'url_encode': case 'encode_url': return urlencode($value); case 'base64_decode': - if($opt!=='false') $opt = true; - else $opt = false; - return base64_decode($value,$opt); + if ($opt!=='false') { + $opt = true; + } else { + $opt = false; + } + return base64_decode($value, $opt); case 'encode_sha1': $cmd = 'sha1'; + // no break case 'addslashes': case 'urldecode': case 'url_decode': @@ -501,18 +571,21 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'upper_case': return $this->strtoupper($value); case 'capitalize': - $_ = explode(' ',$value); - foreach($_ as $i=>$v) - { + $_ = explode(' ', $value); + foreach ($_ as $i=>$v) { $_[$i] = ucfirst($v); } - return implode(' ',$_); + return implode(' ', $_); case 'zenhan': - if(empty($opt)) $opt='VKas'; - return mb_convert_kana($value,$opt,$modx->config['modx_charset']); + if (empty($opt)) { + $opt='VKas'; + } + return mb_convert_kana($value, $opt, $modx->config['modx_charset']); case 'hanzen': - if(empty($opt)) $opt='VKAS'; - return mb_convert_kana($value,$opt,$modx->config['modx_charset']); + if (empty($opt)) { + $opt='VKAS'; + } + return mb_convert_kana($value, $opt, $modx->config['modx_charset']); case 'str_shuffle': case 'shuffle': return $this->str_shuffle($value); @@ -526,7 +599,7 @@ public function getValueFromPreset($key, $value, $cmd, $opt) return $this->strlen($value); case 'count_words': $value = trim($value); - return count(preg_split('/\s+/',$value)); + return count(preg_split('/\s+/', $value)); case 'str_word_count': case 'word_count': case 'wordcount': @@ -534,55 +607,69 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'count_paragraphs': $value = trim($value); $value = preg_replace('/\r/', '', $value); - return count(preg_split('/\n+/',$value)); + return count(preg_split('/\n+/', $value)); case 'strpos': - if($opt!=0&&empty($opt)) return $value; - return $this->strpos($value,$opt); + if ($opt!=0&&empty($opt)) { + return $value; + } + return $this->strpos($value, $opt); case 'wordwrap': // default: 70 $wrapat = (int)$opt > 0 ? (int)$opt : 70; - if (version_compare(PHP_VERSION, '5.3.0') >= 0) return $this->includeMdfFile('wordwrap'); - else return preg_replace("@(\b\w+\b)@e","wordwrap('\\1',\$wrapat,' ',1)",$value); + if (version_compare(PHP_VERSION, '5.3.0') >= 0) { + return $this->includeMdfFile('wordwrap'); + } else { + return preg_replace("@(\b\w+\b)@e", "wordwrap('\\1',\$wrapat,' ',1)", $value); + } + // no break case 'wrap_text': - $width = preg_match('/^[1-9][0-9]*$/',$opt) ? $opt : 70; - if($modx->config['manager_language']==='japanese-utf8') { + $width = preg_match('/^[1-9][0-9]*$/', $opt) ? $opt : 70; + if ($modx->config['manager_language']==='japanese-utf8') { $chunk = array(); $bt=''; - while($bt!=$value) { + while ($bt!=$value) { $bt = $value; - if($this->strlen($value)<$width) { + if ($this->strlen($value)<$width) { $chunk[] = $value; break; } - $chunk[] = $this->substr($value,0,$width); - $value = $this->substr($value,$width); + $chunk[] = $this->substr($value, 0, $width); + $value = $this->substr($value, $width); } - return implode("\n",$chunk); + return implode("\n", $chunk); + } else { + return wordwrap($value, $width, "\n", true); } - else - return wordwrap($value,$width,"\n",true); + // no break case 'substr': - if(empty($opt)) break; - if(strpos($opt,',')!==false) { - list($b,$e) = explode(',',$opt,2); - return $this->substr($value,$b,(int)$e); + if (empty($opt)) { + break; } - else return $this->substr($value,$opt); + if (strpos($opt, ',')!==false) { + list($b, $e) = explode(',', $opt, 2); + return $this->substr($value, $b, (int)$e); + } else { + return $this->substr($value, $opt); + } + // no break case 'limit': case 'trim_to': // http://www.movabletype.jp/documentation/appendices/modifiers/trim_to.html - if(strpos($opt,'+')!==false) - list($len,$str) = explode('+',$opt,2); - else { + if (strpos($opt, '+')!==false) { + list($len, $str) = explode('+', $opt, 2); + } else { $len = $opt; $str = ''; } - if($len==='') $len = 100; - if(abs($len) > $this->strlen($value)) $str =''; - if(preg_match('/^[1-9][0-9]*$/',$len)) { - return $this->substr($value,0,$len) . $str; + if ($len==='') { + $len = 100; + } + if (abs($len) > $this->strlen($value)) { + $str =''; } - elseif(preg_match('/^\-[1-9][0-9]*$/',$len)) { - return $str . $this->substr($value,$len); + if (preg_match('/^[1-9][0-9]*$/', $len)) { + return $this->substr($value, 0, $len) . $str; + } elseif (preg_match('/^\-[1-9][0-9]*$/', $len)) { + return $str . $this->substr($value, $len); } break; case 'summary': @@ -591,82 +678,119 @@ public function getValueFromPreset($key, $value, $cmd, $opt) return $this->includeMdfFile('summary'); case 'replace': case 'str_replace': - if(empty($opt) || strpos($opt,',')===false) break; - if (substr_count($opt, ',') ==1) $delim = ','; - elseif(substr_count($opt, '|') ==1) $delim = '|'; - elseif(substr_count($opt, '=>')==1) $delim = '=>'; - elseif(substr_count($opt, '/') ==1) $delim = '/'; - else break; - list($s,$r) = explode($delim,$opt); - if($value!=='') return str_replace($s,$r,$value); + if (empty($opt) || strpos($opt, ',')===false) { + break; + } + if (substr_count($opt, ',') ==1) { + $delim = ','; + } elseif (substr_count($opt, '|') ==1) { + $delim = '|'; + } elseif (substr_count($opt, '=>')==1) { + $delim = '=>'; + } elseif (substr_count($opt, '/') ==1) { + $delim = '/'; + } else { + break; + } + list($s, $r) = explode($delim, $opt); + if ($value!=='') { + return str_replace($s, $r, $value); + } break; case 'replace_to': case 'tpl': - if($value!=='') return str_replace(array('[+value+]','[+output+]','{value}','%s'),$value,$opt); + if ($value!=='') { + return str_replace(array('[+value+]','[+output+]','{value}','%s'), $value, $opt); + } break; case 'eachtpl': - $value = explode('||',$value); + $value = explode('||', $value); $_ = array(); - foreach($value as $v) { - $_[] = str_replace(array('[+value+]','[+output+]','{value}','%s'),$v,$opt); + foreach ($value as $v) { + $_[] = str_replace(array('[+value+]','[+output+]','{value}','%s'), $v, $opt); } return implode("\n", $_); case 'array_pop': case 'array_shift': - if(strpos($value,'||')!==false) $delim = '||'; - else $delim = ','; - return $cmd(explode($delim,$value)); + if (strpos($value, '||')!==false) { + $delim = '||'; + } else { + $delim = ','; + } + return $cmd(explode($delim, $value)); case 'preg_replace': case 'regex_replace': - if(empty($opt) || strpos($opt,',')===false) break; - list($s,$r) = explode(',',$opt,2); - if($value!=='') return preg_replace($s,$r,$value); + if (empty($opt) || strpos($opt, ',')===false) { + break; + } + list($s, $r) = explode(',', $opt, 2); + if ($value!=='') { + return preg_replace($s, $r, $value); + } break; case 'cat': case 'concatenate': case '.': - if($value!=='') return $value . $opt; + if ($value!=='') { + return $value . $opt; + } break; case 'sprintf': case 'string_format': - if($value!=='') return sprintf($opt,$value); + if ($value!=='') { + return sprintf($opt, $value); + } break; case 'number_format': - if($opt=='') $opt = 0; - return number_format($value,$opt); + if ($opt=='') { + $opt = 0; + } + return number_format($value, $opt); case 'money_format': - setlocale(LC_MONETARY,setlocale(LC_TIME,0)); - if($value!=='') return money_format($opt,(double)$value); + setlocale(LC_MONETARY, setlocale(LC_TIME, 0)); + if ($value!=='') { + return money_format($opt, (double)$value); + } break; case 'tobool': return boolval($value); case 'nl2lf': - if($value!=='') return str_replace(array("\r\n","\n", "\r"), '\n', $value); + if ($value!=='') { + return str_replace(array("\r\n","\n", "\r"), '\n', $value); + } break; case 'br2nl': return preg_replace('@@i', "\n", $value); case 'nl2br': - if (version_compare(PHP_VERSION, '5.3.0', '<')) + if (version_compare(PHP_VERSION, '5.3.0', '<')) { return nl2br($value); - if($opt!=='') - { + } + if ($opt!=='') { $opt = trim($opt); $opt = strtolower($opt); - if($opt==='false') $opt = false; - elseif($opt==='0') $opt = false; - else $opt = true; - } - elseif(isset($modx->config['mce_element_format'])&&$modx->config['mce_element_format']==='html') - $opt = false; - else $opt = true; - return nl2br($value,$opt); + if ($opt==='false') { + $opt = false; + } elseif ($opt==='0') { + $opt = false; + } else { + $opt = true; + } + } elseif (isset($modx->config['mce_element_format'])&&$modx->config['mce_element_format']==='html') { + $opt = false; + } else { + $opt = true; + } + return nl2br($value, $opt); case 'ltrim': case 'rtrim': case 'trim': // ref http://mblo.info/modifiers/custom-modifiers/rtrim_opt.html - if($opt==='') + if ($opt==='') { return $cmd($value); - else return $cmd($value,$opt); + } else { + return $cmd($value, $opt); + } // These are all straight wrappers for PHP functions + // no break case 'ucfirst': case 'lcfirst': case 'ucwords': @@ -676,16 +800,26 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'strftime': case 'date': case 'dateformat': - if(empty($opt)) $opt = $modx->toDateFormat(null, 'formatOnly'); - if(!preg_match('@^[0-9]+$@',$value)) $value = strtotime($value); - if(strpos($opt,'%')!==false) - return strftime($opt,0+$value); - else - return date($opt,0+$value); + if (empty($opt)) { + $opt = $modx->toDateFormat(null, 'formatOnly'); + } + if (!preg_match('@^[0-9]+$@', $value)) { + $value = strtotime($value); + } + if (strpos($opt, '%')!==false) { + return strftime($opt, 0+$value); + } else { + return date($opt, 0+$value); + } + // no break case 'time': - if(empty($opt)) $opt = '%H:%M'; - if(!preg_match('@^[0-9]+$@',$value)) $value = strtotime($value); - return strftime($opt,0+$value); + if (empty($opt)) { + $opt = '%H:%M'; + } + if (!preg_match('@^[0-9]+$@', $value)) { + $value = strtotime($value); + } + return strftime($opt, 0+$value); case 'strtotime': return strtotime($value); ##### mathematical function @@ -694,11 +828,13 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'tofloat': return floatval($value); case 'round': - if(!$opt) $opt = 0; - return $cmd($value,$opt); + if (!$opt) { + $opt = 0; + } + return $cmd($value, $opt); case 'max': case 'min': - return $cmd(explode(',',$value)); + return $cmd(explode(',', $value)); case 'floor': case 'ceil': case 'abs': @@ -706,28 +842,42 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'math': case 'calc': $value = (int)$value; - if(empty($value)) $value = '0'; - $filter = str_replace(array('[+value+]','[+output+]','{value}','%s'),'?',$opt); - $filter = preg_replace('@([a-zA-Z\n\r\t\s])@','',$filter); - if(strpos($filter,'?')===false) $filter = "?{$filter}"; - $filter = str_replace('?',$value,$filter); + if (empty($value)) { + $value = '0'; + } + $filter = str_replace(array('[+value+]','[+output+]','{value}','%s'), '?', $opt); + $filter = preg_replace('@([a-zA-Z\n\r\t\s])@', '', $filter); + if (strpos($filter, '?')===false) { + $filter = "?{$filter}"; + } + $filter = str_replace('?', $value, $filter); return eval("return {$filter};"); case 'count': - if($value=='') return 0; - $value = explode(',',$value); + if ($value=='') { + return 0; + } + $value = explode(',', $value); return count($value); case 'sort': case 'rsort': - if(strpos($value,"\n")!==false) $delim="\n"; - else $delim = ','; - $swap = explode($delim,$value); - if(!$opt) $opt = SORT_REGULAR; - else $opt = constant($opt); - $cmd($swap,$opt); - return implode($delim,$swap); + if (strpos($value, "\n")!==false) { + $delim="\n"; + } else { + $delim = ','; + } + $swap = explode($delim, $value); + if (!$opt) { + $opt = SORT_REGULAR; + } else { + $opt = constant($opt); + } + $cmd($swap, $opt); + return implode($delim, $swap); ##### Resource fields case 'id': - if($opt) return $this->getDocumentObject($opt,$key); + if ($opt) { + return $this->getDocumentObject($opt, $key); + } break; case 'type': case 'contenttype': @@ -764,36 +914,44 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'privatemgr': case 'content_dispo': case 'hidemenu': - if($cmd==='contenttype') $cmd = 'contentType'; - return $this->getDocumentObject($value,$cmd); + if ($cmd==='contenttype') { + $cmd = 'contentType'; + } + return $this->getDocumentObject($value, $cmd); case 'title': - $pagetitle = $this->getDocumentObject($value,'pagetitle'); - $longtitle = $this->getDocumentObject($value,'longtitle'); + $pagetitle = $this->getDocumentObject($value, 'pagetitle'); + $longtitle = $this->getDocumentObject($value, 'longtitle'); return $longtitle ? $longtitle : $pagetitle; case 'shorttitle': - $pagetitle = $this->getDocumentObject($value,'pagetitle'); - $menutitle = $this->getDocumentObject($value,'menutitle'); + $pagetitle = $this->getDocumentObject($value, 'pagetitle'); + $menutitle = $this->getDocumentObject($value, 'menutitle'); return $menutitle ? $menutitle : $pagetitle; case 'templatename': - $rs = $modx->db->select('templatename','[+prefix+]site_templates',"id='{$value}'"); + $rs = $modx->db->select('templatename', '[+prefix+]site_templates', "id='{$value}'"); $templateName = $modx->db->getValue($rs); return !$templateName ? '(blank)' : $templateName; case 'getfield': - if(!$opt) $opt = 'content'; - return $modx->getField($opt,$value); + if (!$opt) { + $opt = 'content'; + } + return $modx->getField($opt, $value); case 'children': case 'childids': - if($value=='') $value = 0; // 値がない場合はルートと見なす + if ($value=='') { + $value = 0; + } // 値がない場合はルートと見なす $published = 1; - if($opt=='') $opt = 'page'; - $_ = explode(',',$opt); + if ($opt=='') { + $opt = 'page'; + } + $_ = explode(',', $opt); $where = array(); - foreach($_ as $opt) { - switch(trim($opt)) { - case 'page'; case '!folder'; case '!isfolder': $where[] = 'sc.isfolder=0'; break; - case 'folder'; case 'isfolder': $where[] = 'sc.isfolder=1'; break; - case 'menu'; case 'show_menu': $where[] = 'sc.hidemenu=0'; break; - case '!menu'; case '!show_menu': $where[] = 'sc.hidemenu=1'; break; + foreach ($_ as $opt) { + switch (trim($opt)) { + case 'page': case '!folder': case '!isfolder': $where[] = 'sc.isfolder=0'; break; + case 'folder': case 'isfolder': $where[] = 'sc.isfolder=1'; break; + case 'menu': case 'show_menu': $where[] = 'sc.hidemenu=0'; break; + case '!menu': case '!show_menu': $where[] = 'sc.hidemenu=1'; break; case 'published': $published = 1; break; case '!published': $published = 0; break; } @@ -801,75 +959,105 @@ public function getValueFromPreset($key, $value, $cmd, $opt) $where = implode(' AND ', $where); $children = $modx->getDocumentChildren($value, $published, '0', 'id', $where); $result = array(); - foreach((array)$children as $child){ + foreach ((array)$children as $child) { $result[] = $child['id']; } return implode(',', $result); case 'fullurl': - if(!is_numeric($value)) return $value; + if (!is_numeric($value)) { + return $value; + } return $modx->makeUrl($value); case 'makeurl': - if(!is_numeric($value)) return $value; - if(!$opt) $opt = 'full'; - return $modx->makeUrl($value,'','',$opt); + if (!is_numeric($value)) { + return $value; + } + if (!$opt) { + $opt = 'full'; + } + return $modx->makeUrl($value, '', '', $opt); ##### File system case 'getimageinfo': case 'imageinfo': - if(!is_file($value)) return ''; + if (!is_file($value)) { + return ''; + } $_ = getimagesize($value); - if(!$_[0]) return ''; + if (!$_[0]) { + return ''; + } $info['width'] = $_[0]; $info['height'] = $_[1]; - if ($_[0] > $_[1]) $info['aspect'] = 'landscape'; - elseif($_[0] < $_[1]) $info['aspect'] = 'portrait'; - else $info['aspect'] = 'square'; - switch($_[2]) { - case IMAGETYPE_GIF : $info['type'] = 'gif'; break; - case IMAGETYPE_JPEG : $info['type'] = 'jpg'; break; - case IMAGETYPE_PNG : $info['type'] = 'png'; break; - default : $info['type'] = 'unknown'; + if ($_[0] > $_[1]) { + $info['aspect'] = 'landscape'; + } elseif ($_[0] < $_[1]) { + $info['aspect'] = 'portrait'; + } else { + $info['aspect'] = 'square'; + } + switch ($_[2]) { + case IMAGETYPE_GIF: $info['type'] = 'gif'; break; + case IMAGETYPE_JPEG: $info['type'] = 'jpg'; break; + case IMAGETYPE_PNG: $info['type'] = 'png'; break; + default: $info['type'] = 'unknown'; } $info['attrib'] = $_[3]; - switch($opt) { - case 'width' : return $info['width']; + switch ($opt) { + case 'width': return $info['width']; case 'height': return $info['height']; case 'aspect': return $info['aspect']; - case 'type' : return $info['type']; + case 'type': return $info['type']; case 'attrib': return $info['attrib']; - default : return print_r($info,true); + default: return print_r($info, true); } + // no break case 'file_get_contents': case 'readfile': - if(!is_file($value)) return $value; + if (!is_file($value)) { + return $value; + } $value = realpath($value); - if(strpos($value,MODX_MANAGER_PATH)!==false) exit('Can not read core file'); - $ext = strtolower(substr($value,-4)); - if($ext==='.php') exit('Can not read php file'); - if($ext==='.cgi') exit('Can not read cgi file'); + if (strpos($value, MODX_MANAGER_PATH)!==false) { + exit('Can not read core file'); + } + $ext = strtolower(substr($value, -4)); + if ($ext==='.php') { + exit('Can not read php file'); + } + if ($ext==='.cgi') { + exit('Can not read cgi file'); + } return file_get_contents($value); case 'filesize': - if($value == '') return ''; + if ($value == '') { + return ''; + } $filename = $value; $site_url = $modx->config['site_url']; - if(strpos($filename,$site_url) === 0) - $filename = substr($filename,0,strlen($site_url)); - $filename = trim($filename,'/'); + if (strpos($filename, $site_url) === 0) { + $filename = substr($filename, 0, strlen($site_url)); + } + $filename = trim($filename, '/'); - $opt = trim($opt,'/'); - if($opt!=='') $opt .= '/'; + $opt = trim($opt, '/'); + if ($opt!=='') { + $opt .= '/'; + } - $filename = MODX_BASE_PATH.$opt.$filename; + $filename = MODX_BASE_PATH . $opt . $filename; - if(is_file($filename)){ + if (is_file($filename)) { clearstatcache(); $size = filesize($filename); return $size; + } else { + return ''; } - else return ''; ##### User info + // no break case 'username': case 'fullname': case 'role': @@ -896,41 +1084,56 @@ public function getValueFromPreset($key, $value, $cmd, $opt) $this->opt = $cmd; return $this->includeMdfFile('moduser'); case 'userinfo': - if(empty($opt)) $this->opt = 'username'; + if (empty($opt)) { + $this->opt = 'username'; + } return $this->includeMdfFile('moduser'); case 'webuserinfo': - if(empty($opt)) $this->opt = 'username'; + if (empty($opt)) { + $this->opt = 'username'; + } $this->value = -$value; return $this->includeMdfFile('moduser'); ##### Special functions case 'ifempty': case '_default': case 'default': - if (empty($value)) return $opt; break; + if (empty($value)) { + return $opt; + } break; case 'ifnotempty': - if (!empty($value)) return $opt; break; + if (!empty($value)) { + return $opt; + } break; case 'datagrid': include_once(MODX_CORE_PATH . 'controls/datagrid.class.php'); $grd = new DataGrid(null, trim($value)); $grd->itemStyle = ''; $grd->altItemStyle = ''; - $pos = strpos($value,"\n"); - if($pos) $_ = substr($value,0,$pos); - else $_ = $pos; - $grd->cdelim = strpos($_,"\t")!==false ? 'tab' : ','; + $pos = strpos($value, "\n"); + if ($pos) { + $_ = substr($value, 0, $pos); + } else { + $_ = $pos; + } + $grd->cdelim = strpos($_, "\t")!==false ? 'tab' : ','; return $grd->render(); case 'rotate': case 'evenodd': - if(strpos($opt,',')===false) $opt = 'odd,even'; + if (strpos($opt, ',')===false) { + $opt = 'odd,even'; + } $_ = explode(',', $opt); $c = count($_); $i = $value + $c; $i = $i % $c; return $_[$i]; case 'takeval': - $arr = explode(",",$opt); + $arr = explode(",", $opt); $idx = $value; - if(!is_numeric($idx)) return $value; + if (!is_numeric($idx)) { + return $value; + } return $arr[$idx]; case 'getimage': return $this->includeMdfFile('getimage'); @@ -938,17 +1141,21 @@ public function getValueFromPreset($key, $value, $cmd, $opt) return $modx->nicesize($value); case 'googlemap': case 'googlemaps': - if(empty($opt)) $opt = 'border:none;width:500px;height:350px;'; + if (empty($opt)) { + $opt = 'border:none;width:500px;height:350px;'; + } $tpl = ''; $ph['style'] = $opt; $ph['value'] = $value; - return $modx->parseText($tpl,$ph); + return $modx->parseText($tpl, $ph); case 'youtube': case 'youtube16x9': - if(empty($opt)) $opt = 560; + if (empty($opt)) { + $opt = 560; + } $h = round($opt*0.5625); $tpl = ''; - return sprintf($tpl,$opt,$h,$value); + return sprintf($tpl, $opt, $h, $value); //case 'youtube4x3':%s*0.75+25 case 'setvar': $modx->placeholders[$opt] = $value; @@ -978,66 +1185,77 @@ public function getValueFromPreset($key, $value, $cmd, $opt) return $value; } - public function includeMdfFile($cmd) { + public function includeMdfFile($cmd) + { $modx = evolutionCMS(); $key = $this->key; $value = $this->value; $opt = $this->opt; - return include(MODX_CORE_PATH."extenders/modifiers/mdf_{$cmd}.inc.php"); + return include(MODX_CORE_PATH . "extenders/modifiers/mdf_{$cmd}.inc.php"); } public function getValueFromElement($key, $value, $cmd, $opt) { $modx = evolutionCMS(); - if( isset($modx->snippetCache[$this->elmName]) ) - { + if (isset($modx->snippetCache[$this->elmName])) { $php = $modx->snippetCache[$this->elmName]; - } - else - { + } else { $esc_elmName = $modx->db->escape($this->elmName); - $result = $modx->db->select('snippet','[+prefix+]site_snippets',"name='{$esc_elmName}'"); + $result = $modx->db->select('snippet', '[+prefix+]site_snippets', "name='{$esc_elmName}'"); $total = $modx->db->getRecordCount($result); - if($total == 1) - { + if ($total == 1) { $row = $modx->db->getRow($result); $php = $row['snippet']; - } - elseif($total == 0) - { - $assets_path = MODX_BASE_PATH.'assets/'; - if(is_file($assets_path."modifiers/mdf_{$cmd}.inc.php")) - $modifiers_path = $assets_path."modifiers/mdf_{$cmd}.inc.php"; - elseif(is_file($assets_path."plugins/phx/modifiers/{$cmd}.phx.php")) - $modifiers_path = $assets_path."plugins/phx/modifiers/{$cmd}.phx.php"; - elseif(is_file(MODX_CORE_PATH."extenders/modifiers/mdf_{$cmd}.inc.php")) - $modifiers_path = MODX_CORE_PATH."extenders/modifiers/mdf_{$cmd}.inc.php"; - else $modifiers_path = false; - - if($modifiers_path !== false) { + } elseif ($total == 0) { + $assets_path = MODX_BASE_PATH . 'assets/'; + if (is_file($assets_path . "modifiers/mdf_{$cmd}.inc.php")) { + $modifiers_path = $assets_path . "modifiers/mdf_{$cmd}.inc.php"; + } elseif (is_file($assets_path . "plugins/phx/modifiers/{$cmd}.phx.php")) { + $modifiers_path = $assets_path . "plugins/phx/modifiers/{$cmd}.phx.php"; + } elseif (is_file(MODX_CORE_PATH . "extenders/modifiers/mdf_{$cmd}.inc.php")) { + $modifiers_path = MODX_CORE_PATH . "extenders/modifiers/mdf_{$cmd}.inc.php"; + } else { + $modifiers_path = false; + } + + if ($modifiers_path !== false) { $php = @file_get_contents($modifiers_path); $php = trim($php); - if(substr($php,0,5)==='') $php = substr($php,0,-2); - if($this->elmName!=='') - $modx->snippetCache[$this->elmName.'Props'] = ''; - } - else + if (substr($php, 0, 5)==='') { + $php = substr($php, 0, -2); + } + if ($this->elmName!=='') { + $modx->snippetCache[$this->elmName . 'Props'] = ''; + } + } else { $php = false; + } + } else { + $php = false; } - else $php = false; - if($this->elmName!=='') $modx->snippetCache[$this->elmName]= $php; + if ($this->elmName!=='') { + $modx->snippetCache[$this->elmName]= $php; + } + } + if ($php==='') { + $php=false; } - if($php==='') $php=false; - if($php===false) $html = $modx->getChunk($this->elmName); - else $html = false; + if ($php===false) { + $html = $modx->getChunk($this->elmName); + } else { + $html = false; + } $self = '[+output+]'; - if($php !== false) - { + if ($php !== false) { ob_start(); $options = $opt; $output = $value; @@ -1049,20 +1267,20 @@ public function getValueFromElement($key, $value, $cmd, $opt) $this->vars['options'] = & $opt; $custom = eval($php); $msg = ob_get_contents(); - if($value===$this->bt) $value = $msg . $custom; + if ($value===$this->bt) { + $value = $msg . $custom; + } ob_end_clean(); - } - elseif($html!==false && isset($value) && $value!=='') - { + } elseif ($html!==false && isset($value) && $value!=='') { $html = str_replace(array($self,'[+value+]'), $value, $html); $value = str_replace(array('[+options+]','[+param+]'), $opt, $html); + } else { + return false; } - else return false; - if($php===false && $html===false && $value!=='' - && (strpos($cmd,'[+value+]')!==false || strpos($cmd,$self)!==false)) - { - $value = str_replace(array('[+value+]',$self),$value,$cmd); + if ($php===false && $html===false && $value!=='' + && (strpos($cmd, '[+value+]')!==false || strpos($cmd, $self)!==false)) { + $value = str_replace(array('[+value+]',$self), $value, $cmd); } return $value; } @@ -1071,139 +1289,190 @@ public function parseDocumentSource($content='') { $modx = evolutionCMS(); - if(strpos($content,'[')===false && strpos($content,'{')===false) return $content; + if (strpos($content, '[')===false && strpos($content, '{')===false) { + return $content; + } - if(!$modx->maxParserPasses) $modx->maxParserPasses = 10; + if (!$modx->maxParserPasses) { + $modx->maxParserPasses = 10; + } $bt=''; $i=0; - while($bt!==$content) - { + while ($bt!==$content) { $bt = $content; - if(strpos($content,'[*')!==false && $modx->documentIdentifier) - $content = $modx->mergeDocumentContent($content); - if(strpos($content,'[(')!==false) $content = $modx->mergeSettingsContent($content); - if(strpos($content,'{{')!==false) $content = $modx->mergeChunkContent($content); - if(strpos($content,'[!')!==false) $content = str_replace(array('[!','!]'),array('[[',']]'),$content); - if(strpos($content,'[[')!==false) $content = $modx->evalSnippets($content); - - if($content===$bt) break; - if($modx->maxParserPasses < $i) break; + if (strpos($content, '[*')!==false && $modx->documentIdentifier) { + $content = $modx->mergeDocumentContent($content); + } + if (strpos($content, '[(')!==false) { + $content = $modx->mergeSettingsContent($content); + } + if (strpos($content, '{{')!==false) { + $content = $modx->mergeChunkContent($content); + } + if (strpos($content, '[!')!==false) { + $content = str_replace(array('[!','!]'), array('[[',']]'), $content); + } + if (strpos($content, '[[')!==false) { + $content = $modx->evalSnippets($content); + } + + if ($content===$bt) { + break; + } + if ($modx->maxParserPasses < $i) { + break; + } $i++; } return $content; } - public function getDocumentObject($target='',$field='pagetitle') + public function getDocumentObject($target='', $field='pagetitle') { $modx = evolutionCMS(); $target = trim($target); - if(empty($target)) $target = $modx->config['site_start']; - if(preg_match('@^[1-9][0-9]*$@',$target)) $method='id'; - else $method = 'alias'; + if (empty($target)) { + $target = $modx->config['site_start']; + } + if (preg_match('@^[1-9][0-9]*$@', $target)) { + $method='id'; + } else { + $method = 'alias'; + } - if(!isset($this->documentObject[$target])) - { - $this->documentObject[$target] = $modx->getDocumentObject($method,$target,'direct'); + if (!isset($this->documentObject[$target])) { + $this->documentObject[$target] = $modx->getDocumentObject($method, $target, 'direct'); } - if($this->documentObject[$target]['publishedon']==='0') + if ($this->documentObject[$target]['publishedon']==='0') { return ''; - elseif(isset($this->documentObject[$target][$field])) - { - if(is_array($this->documentObject[$target][$field])) - { - $a = $modx->getTemplateVarOutput($field,$target); + } elseif (isset($this->documentObject[$target][$field])) { + if (is_array($this->documentObject[$target][$field])) { + $a = $modx->getTemplateVarOutput($field, $target); $this->documentObject[$target][$field] = $a[$field]; } + } else { + $this->documentObject[$target][$field] = false; } - else $this->documentObject[$target][$field] = false; return $this->documentObject[$target][$field]; } - public function setPlaceholders($value = '', $key = '', $path = '') { - if($path!=='') $key = "{$path}.{$key}"; + public function setPlaceholders($value = '', $key = '', $path = '') + { + if ($path!=='') { + $key = "{$path}.{$key}"; + } if (is_array($value)) { foreach ($value as $subkey => $subval) { $this->setPlaceholders($subval, $subkey, $key); } + } else { + $this->setModifiersVariable($key, $value); } - else $this->setModifiersVariable($key, $value); } // Sets a placeholder variable which can only be access by Modifiers - public function setModifiersVariable($key, $value) { - if ($key != 'phx' && $key != 'dummy') $this->placeholders[$key] = $value; + public function setModifiersVariable($key, $value) + { + if ($key != 'phx' && $key != 'dummy') { + $this->placeholders[$key] = $value; + } } //mbstring - public function substr($str, $s, $l = null) { + public function substr($str, $s, $l = null) + { $modx = evolutionCMS(); - if(is_null($l)) $l = $this->strlen($str); - if (function_exists('mb_substr')) - { - if(strpos($str,"\r")!==false) + if (is_null($l)) { + $l = $this->strlen($str); + } + if (function_exists('mb_substr')) { + if (strpos($str, "\r")!==false) { $str = str_replace(array("\r\n","\r"), "\n", $str); + } return mb_substr($str, $s, $l, $modx->config['modx_charset']); } return substr($str, $s, $l); } - public function strpos($haystack,$needle,$offset=0) { + public function strpos($haystack, $needle, $offset=0) + { $modx = evolutionCMS(); - if (function_exists('mb_strpos')) return mb_strpos($haystack,$needle,$offset,$modx->config['modx_charset']); - return strpos($haystack,$needle,$offset); + if (function_exists('mb_strpos')) { + return mb_strpos($haystack, $needle, $offset, $modx->config['modx_charset']); + } + return strpos($haystack, $needle, $offset); } - public function strlen($str) { + public function strlen($str) + { $modx = evolutionCMS(); - if (function_exists('mb_strlen')) return mb_strlen(str_replace("\r\n", "\n", $str),$modx->config['modx_charset']); + if (function_exists('mb_strlen')) { + return mb_strlen(str_replace("\r\n", "\n", $str), $modx->config['modx_charset']); + } return strlen($str); } - public function strtolower($str) { - if (function_exists('mb_strtolower')) return mb_strtolower($str); + public function strtolower($str) + { + if (function_exists('mb_strtolower')) { + return mb_strtolower($str); + } return strtolower($str); } - public function strtoupper($str) { - if (function_exists('mb_strtoupper')) return mb_strtoupper($str); + public function strtoupper($str) + { + if (function_exists('mb_strtoupper')) { + return mb_strtoupper($str); + } return strtoupper($str); } - public function ucfirst($str) { - if (function_exists('mb_strtoupper')) - return mb_strtoupper($this->substr($str, 0, 1)).$this->substr($str, 1, $this->strlen($str)); + public function ucfirst($str) + { + if (function_exists('mb_strtoupper')) { + return mb_strtoupper($this->substr($str, 0, 1)) . $this->substr($str, 1, $this->strlen($str)); + } return ucfirst($str); } - public function lcfirst($str) { - if (function_exists('mb_strtolower')) - return mb_strtolower($this->substr($str, 0, 1)).$this->substr($str, 1, $this->strlen($str)); + public function lcfirst($str) + { + if (function_exists('mb_strtolower')) { + return mb_strtolower($this->substr($str, 0, 1)) . $this->substr($str, 1, $this->strlen($str)); + } return lcfirst($str); } - public function ucwords($str) { - if (function_exists('mb_convert_case')) + public function ucwords($str) + { + if (function_exists('mb_convert_case')) { return mb_convert_case($str, MB_CASE_TITLE); + } return ucwords($str); } - public function strrev($str) { + public function strrev($str) + { preg_match_all('/./us', $str, $ar); return implode(array_reverse($ar[0])); } - public function str_shuffle($str) { + public function str_shuffle($str) + { preg_match_all('/./us', $str, $ar); shuffle($ar[0]); return implode($ar[0]); } - public function str_word_count($str) { - return count(preg_split('~[^\p{L}\p{N}\']+~u',$str)); + public function str_word_count($str) + { + return count(preg_split('~[^\p{L}\p{N}\']+~u', $str)); } - public function strip_tags($value,$params='') { + public function strip_tags($value, $params='') + { $modx = evolutionCMS(); - if(stripos($params,'style')===false && stripos($value,'')!==false) { + if (stripos($params, 'style')===false && stripos($value, '')!==false) { $value = preg_replace('@.*?@is', '', $value); } - if(stripos($params,'script')===false && stripos($value,'')!==false) { + if (stripos($params, 'script')===false && stripos($value, '')!==false) { $value = preg_replace('@.*?@is', '', $value); } - return trim(strip_tags($value,$params)); + return trim(strip_tags($value, $params)); } } diff --git a/manager/includes/extenders/modifiers/mdf_addbreak.inc.php b/manager/includes/extenders/modifiers/mdf_addbreak.inc.php index 03c3a1abff..8568eb5f9a 100755 --- a/manager/includes/extenders/modifiers/mdf_addbreak.inc.php +++ b/manager/includes/extenders/modifiers/mdf_addbreak.inc.php @@ -1,22 +1,23 @@ filter->parseDocumentSource($value); -$text = str_replace(array("\r\n","\r"),"\n",$text); +$text = str_replace(array("\r\n","\r"), "\n", $text); $blockElms = 'br,table,tbody,tr,td,th,thead,tfoot,caption,colgroup,div'; $blockElms .= ',dl,dd,dt,ul,ol,li,pre,select,option,form,map,area,blockquote'; $blockElms .= ',address,math,style,input,p,h1,h2,h3,h4,h5,h6,hr,object,param,embed'; $blockElms .= ',noframes,noscript,section,article,aside,hgroup,footer,address,code'; $blockElms = explode(',', $blockElms); -$lines = explode("\n",$text); +$lines = explode("\n", $text); $c = count($lines); -foreach($lines as $i=>$line) -{ +foreach ($lines as $i=>$line) { $line = rtrim($line); - if($i===$c-1) break; - foreach($blockElms as $block) - { - if(preg_match("@]*>$@',$line)) + if ($i===$c-1) { + break; + } + foreach ($blockElms as $block) { + if (preg_match("@]*>$@', $line)) { continue 2; + } } $lines[$i] = "{$line}
    "; } diff --git a/manager/includes/extenders/modifiers/mdf_getimage.inc.php b/manager/includes/extenders/modifiers/mdf_getimage.inc.php index 9f68f3ce0b..dce110774c 100755 --- a/manager/includes/extenders/modifiers/mdf_getimage.inc.php +++ b/manager/includes/extenders/modifiers/mdf_getimage.inc.php @@ -1,16 +1,17 @@ ]+>/i'; -preg_match_all($pattern , $value , $images); -if($opt==='') -{ - if($images[1][0]) return $images[1][0]; - else return ''; -} -else -{ - foreach($images[0] as $i=>$image) - { - if(strpos($image,$opt)!==false) return $images[1][$i]; +preg_match_all($pattern, $value, $images); +if ($opt==='') { + if ($images[1][0]) { + return $images[1][0]; + } else { + return ''; + } +} else { + foreach ($images[0] as $i=>$image) { + if (strpos($image, $opt)!==false) { + return $images[1][$i]; + } } } diff --git a/manager/includes/extenders/modifiers/mdf_memberof.inc.php b/manager/includes/extenders/modifiers/mdf_memberof.inc.php index 011b882534..c2105bd668 100755 --- a/manager/includes/extenders/modifiers/mdf_memberof.inc.php +++ b/manager/includes/extenders/modifiers/mdf_memberof.inc.php @@ -1,23 +1,28 @@ getLoginUserID('web')); -$modx->qs_hash = md5($modx->qs_hash."^{$userID}^"); +$modx->qs_hash = md5($modx->qs_hash . "^{$userID}^"); -$groupNames = ($this->strlen($opt) > 0 ) ? explode(',',$opt) : array(); +$groupNames = ($this->strlen($opt) > 0) ? explode(',', $opt) : array(); // if $groupNames is not an array return false -if(!is_array($groupNames)) return 0; +if (!is_array($groupNames)) { + return 0; +} // Creates an array with all webgroups the user id is in -if (isset($modx->filter->cache['mo'][$userID])) $grpNames = $modx->filter->cache['mo'][$userID]; -else { - $from = sprintf("[+prefix+]webgroup_names wgn INNER JOIN [+prefix+]web_groups wg ON wg.webgroup=wgn.id AND wg.webuser='%s'",$userID); - $rs = $modx->db->select('wgn.name',$from); - $modx->filter->cache['mo'][$userID] = $grpNames = $modx->db->getColumn('name',$rs); +if (isset($modx->filter->cache['mo'][$userID])) { + $grpNames = $modx->filter->cache['mo'][$userID]; +} else { + $from = sprintf("[+prefix+]webgroup_names wgn INNER JOIN [+prefix+]web_groups wg ON wg.webgroup=wgn.id AND wg.webuser='%s'", $userID); + $rs = $modx->db->select('wgn.name', $from); + $modx->filter->cache['mo'][$userID] = $grpNames = $modx->db->getColumn('name', $rs); } // Check if a supplied group matches a webgroup from the array we just created -foreach($groupNames as $k=>$v) { - if(in_array(trim($v),$grpNames)) return 1; +foreach ($groupNames as $k=>$v) { + if (in_array(trim($v), $grpNames)) { + return 1; + } } // If we get here the above logic did not find a match, so return false diff --git a/manager/includes/extenders/modifiers/mdf_moduser.inc.php b/manager/includes/extenders/modifiers/mdf_moduser.inc.php index 1349964cef..3cb23bbb44 100755 --- a/manager/includes/extenders/modifiers/mdf_moduser.inc.php +++ b/manager/includes/extenders/modifiers/mdf_moduser.inc.php @@ -1,8 +1,11 @@ filter->cache['ui'][$userid])) { - if ($userid < 0) $user = $modx->getWebUserInfo(abs($userid)); - else $user = $modx->getUserInfo($userid); + if ($userid < 0) { + $user = $modx->getWebUserInfo(abs($userid)); + } else { + $user = $modx->getUserInfo($userid); + } $modx->filter->cache['ui'][$userid] = $user; } else { $user = $modx->filter->cache['ui'][$userid]; diff --git a/manager/includes/extenders/modifiers/mdf_summary.inc.php b/manager/includes/extenders/modifiers/mdf_summary.inc.php index 4cb0dd703b..f40a7c57cb 100755 --- a/manager/includes/extenders/modifiers/mdf_summary.inc.php +++ b/manager/includes/extenders/modifiers/mdf_summary.inc.php @@ -1,43 +1,64 @@ config['manager_language']==='japanese-utf8' ? '。' : '.'; +if ($delim==='') { + $delim = $modx->config['manager_language']==='japanese-utf8' ? '。' : '.'; +} $limit = (int)$limit; $content = $modx->filter->parseDocumentSource($value); $content = strip_tags($content); -$content = str_replace(array("\r\n","\r","\n","\t",' '),' ',$content); -if(preg_match('/\s+/',$content)) - $content = preg_replace('/\s+/',' ',$content); +$content = str_replace(array("\r\n","\r","\n","\t",' '), ' ', $content); +if (preg_match('/\s+/', $content)) { + $content = preg_replace('/\s+/', ' ', $content); +} $content = trim($content); $pos = $modx->filter->strpos($content, $delim); -if($pos!==false && $pos<$limit) { +if ($pos!==false && $pos<$limit) { $_ = explode($delim, $content); $text = ''; - foreach($_ as $v) { - if($limit <= $modx->filter->strlen($text.$v.$delim)) break; - $text .= $v.$delim; + foreach ($_ as $v) { + if ($limit <= $modx->filter->strlen($text . $v . $delim)) { + break; + } + $text .= $v . $delim; + } + if ($text) { + $content = $text; } - if($text) $content = $text; } -if($limit<$modx->filter->strlen($content) && strpos($content,' ')!==false) { +if ($limit<$modx->filter->strlen($content) && strpos($content, ' ')!==false) { $_ = explode(' ', $content); $text = ''; - foreach($_ as $v) { - if($limit <= $modx->filter->strlen($text.$v.' ')) break; + foreach ($_ as $v) { + if ($limit <= $modx->filter->strlen($text . $v . ' ')) { + break; + } $text .= $v . ' '; } - if($text!=='') $content = $text; + if ($text!=='') { + $content = $text; + } } -if($limit < $modx->filter->strlen($content)) $content = $modx->filter->substr($content, 0, $limit); -if($modx->filter->substr($content,-1)==$delim) $content = rtrim($content,$delim) . $delim; +if ($limit < $modx->filter->strlen($content)) { + $content = $modx->filter->substr($content, 0, $limit); +} +if ($modx->filter->substr($content, -1)==$delim) { + $content = rtrim($content, $delim) . $delim; +} return $content; diff --git a/manager/includes/extenders/modifiers/mdf_wordwrap.inc.php b/manager/includes/extenders/modifiers/mdf_wordwrap.inc.php index 2613e8094b..5afbd2a85a 100755 --- a/manager/includes/extenders/modifiers/mdf_wordwrap.inc.php +++ b/manager/includes/extenders/modifiers/mdf_wordwrap.inc.php @@ -1,2 +1,4 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } global $SystemAlertMsgQueque; // display system alert window if messages are available -if(count($SystemAlertMsgQueque) > 0) { - include "sysalert.display.inc.php"; +if (count($SystemAlertMsgQueque) > 0) { + include "sysalert.display.inc.php"; } ?> manager->action, array( - 85, - 27, - 4, - 72, - 13, - 11, - 12, - 87, - 88 +if (in_array($modx->manager->action, array( + 85, + 27, + 4, + 72, + 13, + 11, + 12, + 87, + 88 ))) { - echo $modx->manager->loadDatePicker($modx->config['mgr_date_picker_path']); + echo $modx->manager->loadDatePicker($modx->config['mgr_date_picker_path']); } ?> diff --git a/manager/includes/header.inc.php b/manager/includes/header.inc.php index 147c0f6e04..a3b92dfb05 100755 --- a/manager/includes/header.inc.php +++ b/manager/includes/header.inc.php @@ -66,16 +66,20 @@ ' . "\n", $modx->config['mgr_jquery_path']) ?> - config['show_picker'] != "0") { ?> + config['show_picker'] != "0") { + ?> - + + if (!in_array($_REQUEST['a'], $aArr)) { + ?> - + diff --git a/manager/includes/log.class.inc.php b/manager/includes/log.class.inc.php index c6855d14c3..42cd407691 100755 --- a/manager/includes/log.class.inc.php +++ b/manager/includes/log.class.inc.php @@ -106,16 +106,16 @@ public function writeToLog() } } - private function getUserIP() { - if( array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER) && !empty($_SERVER['HTTP_X_FORWARDED_FOR']) ) { + private function getUserIP() + { + if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER) && !empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',')>0) { - $addr = explode(",",$_SERVER['HTTP_X_FORWARDED_FOR']); + $addr = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']); return trim($addr[0]); } else { return $_SERVER['HTTP_X_FORWARDED_FOR']; } - } - else { + } else { return $_SERVER['REMOTE_ADDR']; } } diff --git a/manager/includes/manager.lockout.inc.php b/manager/includes/manager.lockout.inc.php index 400371a225..02e179df9e 100755 --- a/manager/includes/manager.lockout.inc.php +++ b/manager/includes/manager.lockout.inc.php @@ -1,75 +1,68 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if($modx->manager->action!='8' && isset($_SESSION['mgrValidated'])){ - +if ($modx->manager->action!='8' && isset($_SESSION['mgrValidated'])) { $homeurl = $modx->makeUrl($manager_login_startup>0 ? $manager_login_startup:$site_start); - $logouturl = MODX_MANAGER_URL.'index.php?a=8'; + $logouturl = MODX_MANAGER_URL . 'index.php?a=8'; - $modx->setPlaceholder('modx_charset',$modx_manager_charset); - $modx->setPlaceholder('theme',$manager_theme); + $modx->setPlaceholder('modx_charset', $modx_manager_charset); + $modx->setPlaceholder('theme', $manager_theme); - $modx->setPlaceholder('site_name',$site_name); - $modx->setPlaceholder('logo_slogan',$_lang["logo_slogan"]); - $modx->setPlaceholder('manager_lockout_message',$_lang["manager_lockout_message"]); + $modx->setPlaceholder('site_name', $site_name); + $modx->setPlaceholder('logo_slogan', $_lang["logo_slogan"]); + $modx->setPlaceholder('manager_lockout_message', $_lang["manager_lockout_message"]); - $modx->setPlaceholder('home',$_lang["home"]); - $modx->setPlaceholder('homeurl',$homeurl); - $modx->setPlaceholder('logout',$_lang["logout"]); - $modx->setPlaceholder('logouturl',$logouturl); - $modx->setPlaceholder('manager_theme_url',MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/'); - $modx->setPlaceholder('year',date('Y')); + $modx->setPlaceholder('home', $_lang["home"]); + $modx->setPlaceholder('homeurl', $homeurl); + $modx->setPlaceholder('logout', $_lang["logout"]); + $modx->setPlaceholder('logouturl', $logouturl); + $modx->setPlaceholder('manager_theme_url', MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/'); + $modx->setPlaceholder('year', date('Y')); // load template - if(!isset($modx->config['manager_lockout_tpl']) || empty($modx->config['manager_lockout_tpl'])) { - $modx->config['manager_lockout_tpl'] = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; + if (!isset($modx->config['manager_lockout_tpl']) || empty($modx->config['manager_lockout_tpl'])) { + $modx->config['manager_lockout_tpl'] = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; } $target = $modx->config['manager_lockout_tpl']; $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target); $target = $modx->mergeSettingsContent($target); - if(substr($target,0,1)==='@') { - if(substr($target,0,6)==='@CHUNK') { - $target = trim(substr($target,7)); - $lockout_tpl = $modx->getChunk($target); - } - elseif(substr($target,0,5)==='@FILE') { - $target = trim(substr($target,6)); - $lockout_tpl = file_get_contents($target); - } - } else { - $chunk = $modx->getChunk($target); - if($chunk!==false && !empty($chunk)) { - $lockout_tpl = $chunk; - } - elseif(is_file(MODX_BASE_PATH . $target)) { - $target = MODX_BASE_PATH . $target; - $lockout_tpl = file_get_contents($target); - } - elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl')) { - $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl'; - $lockout_tpl = file_get_contents($target); - } - elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl')) { - $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl'; - $login_tpl = file_get_contents($target); - } - elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html')) { // ClipperCMS compatible - $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html'; - $lockout_tpl = file_get_contents($target); - } - else { - $target = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; - $lockout_tpl = file_get_contents($target); - } - } + if (substr($target, 0, 1)==='@') { + if (substr($target, 0, 6)==='@CHUNK') { + $target = trim(substr($target, 7)); + $lockout_tpl = $modx->getChunk($target); + } elseif (substr($target, 0, 5)==='@FILE') { + $target = trim(substr($target, 6)); + $lockout_tpl = file_get_contents($target); + } + } else { + $chunk = $modx->getChunk($target); + if ($chunk!==false && !empty($chunk)) { + $lockout_tpl = $chunk; + } elseif (is_file(MODX_BASE_PATH . $target)) { + $target = MODX_BASE_PATH . $target; + $lockout_tpl = file_get_contents($target); + } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl')) { + $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl'; + $lockout_tpl = file_get_contents($target); + } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl')) { + $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl'; + $login_tpl = file_get_contents($target); + } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html')) { // ClipperCMS compatible + $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html'; + $lockout_tpl = file_get_contents($target); + } else { + $target = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; + $lockout_tpl = file_get_contents($target); + } + } // merge placeholders $lockout_tpl = $modx->mergePlaceholderContent($lockout_tpl); - $regx = strpos($lockout_tpl,'[[+')!==false ? '~\[\[\+(.*?)\]\]~' : '~\[\+(.*?)\+\]~'; // little tweak for newer parsers + $regx = strpos($lockout_tpl, '[[+')!==false ? '~\[\[\+(.*?)\]\]~' : '~\[\+(.*?)\+\]~'; // little tweak for newer parsers $lockout_tpl = preg_replace($regx, '', $lockout_tpl); //cleanup echo $lockout_tpl; diff --git a/manager/includes/menu.class.inc.php b/manager/includes/menu.class.inc.php index d131fc79f7..438d6bedbe 100755 --- a/manager/includes/menu.class.inc.php +++ b/manager/includes/menu.class.inc.php @@ -68,7 +68,6 @@ public function DrawSub($parentid, $level) $output = ''; if (isset($this->menu[$parentid])) { - $ph = array(); $countChild = 0; $itemTpl = ' @@ -102,7 +101,7 @@ public function DrawSub($parentid, $level) $level++; $ph['DrawSub'] = $this->DrawSub($id, $level); $level--; - // Optional buttons + // Optional buttons } else { if (isset($value[11]) && !empty($value[11])) { $optionalButton = ''; diff --git a/manager/includes/preload.functions.inc.php b/manager/includes/preload.functions.inc.php index e348415912..a2494134af 100755 --- a/manager/includes/preload.functions.inc.php +++ b/manager/includes/preload.functions.inc.php @@ -4,14 +4,14 @@ $site_sessionname = genEvoSessionName(); // For legacy extras not using startCMSSession -if( ! function_exists('evolutionCMS')) { +if (! function_exists('evolutionCMS')) { /** * @return DocumentParser */ function evolutionCMS() { - if( ! defined('MODX_CLASS')) { - if( ! class_exists('DocumentParser')) { + if (! defined('MODX_CLASS')) { + if (! class_exists('DocumentParser')) { throw new RuntimeException('MODX_CLASS not defined and DocumentParser class not exists'); } define('MODX_CLASS', 'DocumentParser'); @@ -38,12 +38,14 @@ function genEvoSessionName() function startCMSSession() { global $site_sessionname, $https_port, $session_cookie_path, $session_cookie_domain; - if(MODX_CLI) return; + if (MODX_CLI) { + return; + } session_name($site_sessionname); removeInvalidCmsSessionIds($site_sessionname); $cookieExpiration = 0; - $secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port); + $secure = ((isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port); $cookiePath = !empty($session_cookie_path) ? $session_cookie_path : MODX_BASE_URL; $cookieDomain = !empty($session_cookie_domain) ? $session_cookie_domain : ''; session_set_cookie_params($cookieExpiration, $cookiePath, $cookieDomain, $secure, true); @@ -79,7 +81,9 @@ function removeInvalidCmsSessionFromStorage(&$storage, $session_name) */ function removeInvalidCmsSessionIds($session_name) { - if(MODX_CLI) return; + if (MODX_CLI) { + return; + } // session ids is invalid iff it is empty string // storage priorioty can see in PHP source ext/session/session.c removeInvalidCmsSessionFromStorage($_COOKIE, $session_name); diff --git a/manager/includes/protect.inc.php b/manager/includes/protect.inc.php index f868ed98b8..968e76eff1 100755 --- a/manager/includes/protect.inc.php +++ b/manager/includes/protect.inc.php @@ -77,8 +77,8 @@ function getSanitizedValue($value = '') modx_sanitize_gpc($_REQUEST); foreach (array('PHP_SELF', 'HTTP_USER_AGENT', 'HTTP_REFERER', 'QUERY_STRING') as $key) { - $_SERVER[$key] = isset ($_SERVER[$key]) ? htmlspecialchars($_SERVER[$key], ENT_QUOTES) : null; + $_SERVER[$key] = isset($_SERVER[$key]) ? htmlspecialchars($_SERVER[$key], ENT_QUOTES) : null; } // Unset vars -unset ($key, $value); +unset($key, $value); diff --git a/manager/includes/sysalert.display.inc.php b/manager/includes/sysalert.display.inc.php index 0b97e73b96..8300f08e49 100755 --- a/manager/includes/sysalert.display.inc.php +++ b/manager/includes/sysalert.display.inc.php @@ -1,38 +1,37 @@ "; - } - // reset message queque - unset($_SESSION['SystemAlertMsgQueque']); - $_SESSION['SystemAlertMsgQueque'] = array(); - $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque']; + $sysMsgs = ""; + $limit = count($SystemAlertMsgQueque); + for ($i=0;$i<$limit;$i++) { + $sysMsgs .= $SystemAlertMsgQueque[$i] . "
    "; + } + // reset message queque + unset($_SESSION['SystemAlertMsgQueque']); + $_SESSION['SystemAlertMsgQueque'] = array(); + $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque']; - if($sysMsgs!="") { -?> + if ($sysMsgs!="") { + ?> '; -?> + echo ''; ?> \ No newline at end of file diff --git a/manager/includes/template.parser.class.inc.php b/manager/includes/template.parser.class.inc.php index cc999700ad..8cf3029481 100755 --- a/manager/includes/template.parser.class.inc.php +++ b/manager/includes/template.parser.class.inc.php @@ -7,182 +7,185 @@ * */ -Class TemplateParser { +class TemplateParser +{ /** - * @param array $config [action, tabs, toArray] - * @param array $data - * @return string - */ - public function output($config = array(), $data = array()) { + * @param array $config [action, tabs, toArray] + * @param array $data + * @return string + */ + public function output($config = array(), $data = array()) + { $modx = evolutionCMS(); - $output = ''; - $action = !empty($config['action']) ? $config['action'] : (!empty($_REQUEST['a']) ? $_REQUEST['a'] : ''); - $tab = isset($config['tab']) ? ' AND tab IN(' . $config['tab'] . ')' : ''; + $output = ''; + $action = !empty($config['action']) ? $config['action'] : (!empty($_REQUEST['a']) ? $_REQUEST['a'] : ''); + $tab = isset($config['tab']) ? ' AND tab IN(' . $config['tab'] . ')' : ''; - if($action) { - $sql = $modx->db->query('SELECT t1.*, IF(t1.alias=\'\',t1.name,t1.alias) AS alias, t2.category AS category_name + if ($action) { + $sql = $modx->db->query('SELECT t1.*, IF(t1.alias=\'\',t1.name,t1.alias) AS alias, t2.category AS category_name FROM ' . $modx->getFullTableName('system_templates') . ' AS t1 INNER JOIN ' . $modx->getFullTableName('categories') . ' AS t2 ON t2.id=t1.category WHERE t1.action IN(' . $action . ') ' . $tab . ' ORDER BY t1.tab ASC, t1.rank ASC'); - if($modx->db->getRecordCount($sql)) { - $tabs = array(); - while($row = $modx->db->getRow($sql)) { - if(!$row['value'] && !empty($data[$row['name']])) { - $row['value'] = $data[$row['name']]; - } - $tabs[$row['tab']]['category_name'] = $row['category_name']; - $tabs[$row['tab']][$row['name']] = TemplateParser::render($row); - } - - if(!empty($config['toArray'])) { - $output = $tabs; - } else { - $output .= '
    '; - $output .= ' + if ($modx->db->getRecordCount($sql)) { + $tabs = array(); + while ($row = $modx->db->getRow($sql)) { + if (!$row['value'] && !empty($data[$row['name']])) { + $row['value'] = $data[$row['name']]; + } + $tabs[$row['tab']]['category_name'] = $row['category_name']; + $tabs[$row['tab']][$row['name']] = TemplateParser::render($row); + } + + if (!empty($config['toArray'])) { + $output = $tabs; + } else { + $output .= '
    '; + $output .= ' '; - foreach($tabs as $idTab => $tab) { - $output .= '
    '; - $output .= ' + foreach ($tabs as $idTab => $tab) { + $output .= '
    '; + $output .= '

    ' . (!empty($config['tabs'][$idTab]) ? $config['tabs'][$idTab] : $tab['category_name']) . '

    '; - unset($tab['category_name']); - foreach($tab as $item) { - $output .= $item; - } - $output .= '
    '; - } - $output .= '
    '; - } - } - } - - return $output; - } + unset($tab['category_name']); + foreach ($tab as $item) { + $output .= $item; + } + $output .= '
    '; + } + $output .= '
    '; + } + } + } + + return $output; + } /** * @param array $data * @return string */ - private function render($data) { - $modx = evolutionCMS(); global $_lang, $_country_lang; + private function render($data) + { + $modx = evolutionCMS(); + global $_lang, $_country_lang; - $data['lang.name'] = (isset($_lang[$data['alias']]) ? $_lang[$data['alias']] : $data['alias']); - $data['value'] = (isset($_POST[$data['name']][$data['value']]) ? $_POST[$data['name']][$data['value']] : (isset($data['value']) ? $modx->htmlspecialchars($data['value']) : '')); - $data['readonly'] = ($data['readonly'] ? ' readonly' : ''); + $data['lang.name'] = (isset($_lang[$data['alias']]) ? $_lang[$data['alias']] : $data['alias']); + $data['value'] = (isset($_POST[$data['name']][$data['value']]) ? $_POST[$data['name']][$data['value']] : (isset($data['value']) ? $modx->htmlspecialchars($data['value']) : '')); + $data['readonly'] = ($data['readonly'] ? ' readonly' : ''); - $output = ''; - $output .= '
    '; + $output = ''; + $output .= '
    '; - switch($data['type']) { + switch ($data['type']) { - case 'text': - $output .= ' + case 'text': + $output .= '
    '; - $output .= $data['content']; - $output .= '
    '; + $output .= $data['content']; + $output .= '
    '; - break; + break; - case 'textarea': - $output .= ' + case 'textarea': + $output .= '
    '; - $output .= $data['content']; - $output .= '
    '; + $output .= $data['content']; + $output .= '
    '; - break; + break; - case 'date': - $data['value'] = (isset($_POST[$data['name']][$data['value']]) ? $modx->toDateFormat($_POST[$data['name']][$data['value']]) : (isset($data['value']) ? $modx->toDateFormat($data['value']) : '')); - $output .= ' + case 'date': + $data['value'] = (isset($_POST[$data['name']][$data['value']]) ? $modx->toDateFormat($_POST[$data['name']][$data['value']]) : (isset($data['value']) ? $modx->toDateFormat($data['value']) : '')); + $output .= '
    '; - $output .= $data['content']; - $output .= '
    '; - - break; - - case 'select': - $output .= ''; - $output .= '
    '; - $output .= ''; - $output .= $data['content']; - $output .= '
    '; - - break; - - case 'checkbox': - $output .= ''; - $output .= '
    '; - $output .= ''; - if($data['elements']) { - $elements = explode('||', $data['elements']); - foreach($elements as $key => $value) { - $value = explode('==', $value); - $output .= '
    ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); - } - } - $output .= $data['content']; - $output .= '
    '; - - break; - - case 'radio': - $output .= ''; - $output .= '
    '; - $output .= ''; - if($data['elements']) { - $elements = explode('||', $data['elements']); - foreach($elements as $key => $value) { - $value = explode('==', $value); - $output .= '
    ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); - } - } - $output .= $data['content']; - $output .= '
    '; - - break; - - case 'custom': - $output .= ''; - $output .= '
    '; - $output .= $data['content']; - $output .= '
    '; - - break; - } - - $output .= ''; - - $output = $modx->parseText($output, $data); - - return $output; - } - + $output .= $data['content']; + $output .= ''; + + break; + + case 'select': + $output .= ''; + $output .= '
    '; + $output .= ''; + $output .= $data['content']; + $output .= '
    '; + + break; + + case 'checkbox': + $output .= ''; + $output .= '
    '; + $output .= ''; + if ($data['elements']) { + $elements = explode('||', $data['elements']); + foreach ($elements as $key => $value) { + $value = explode('==', $value); + $output .= '
    ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); + } + } + $output .= $data['content']; + $output .= '
    '; + + break; + + case 'radio': + $output .= ''; + $output .= '
    '; + $output .= ''; + if ($data['elements']) { + $elements = explode('||', $data['elements']); + foreach ($elements as $key => $value) { + $value = explode('==', $value); + $output .= '
    ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); + } + } + $output .= $data['content']; + $output .= '
    '; + + break; + + case 'custom': + $output .= ''; + $output .= '
    '; + $output .= $data['content']; + $output .= '
    '; + + break; + } + + $output .= ''; + + $output = $modx->parseText($output, $data); + + return $output; + } } ?> diff --git a/manager/includes/tmplvars.commands.inc.php b/manager/includes/tmplvars.commands.inc.php index 8137692b9d..dd49967362 100755 --- a/manager/includes/tmplvars.commands.inc.php +++ b/manager/includes/tmplvars.commands.inc.php @@ -4,7 +4,7 @@ * Created by Raymond Irving Feb, 2005 */ global $BINDINGS; // Array of supported bindings. must be upper case -$BINDINGS = array ( +$BINDINGS = array( 'FILE', 'CHUNK', 'DOCUMENT', @@ -22,40 +22,41 @@ * @param array $tvsArray * @return string */ -function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsArray = array()) { +function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsArray = array()) +{ $modx = evolutionCMS(); $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier; $nvalue = trim($value); - if (substr($nvalue, 0, 1) != '@') + if (substr($nvalue, 0, 1) != '@') { return $value; - elseif(isset($modx->config['enable_bindings']) && $modx->config['enable_bindings']!=1 && $src==='docform') { + } elseif (isset($modx->config['enable_bindings']) && $modx->config['enable_bindings']!=1 && $src==='docform') { return '@Bindings is disabled.'; - } - else { - list ($cmd, $param) = ParseCommand($nvalue); + } else { + list($cmd, $param) = ParseCommand($nvalue); $cmd = trim($cmd); $param = parseTvValues($param, $tvsArray); switch ($cmd) { - case "FILE" : + case "FILE": $output = $modx->atBindFileContent($nvalue); break; - case "CHUNK" : // retrieve a chunk and process it's content + case "CHUNK": // retrieve a chunk and process it's content $chunk = $modx->getChunk(trim($param)); $output = $chunk; break; - case "DOCUMENT" : // retrieve a document and process it's content + case "DOCUMENT": // retrieve a document and process it's content $rs = $modx->getDocument($param); - if (is_array($rs)) + if (is_array($rs)) { $output = $rs['content']; - else + } else { $output = "Unable to locate document $param"; + } break; - case "SELECT" : // selects a record from the cms database - $rt = array (); - $replacementVars = array ( + case "SELECT": // selects a record from the cms database + $rt = array(); + $replacementVars = array( 'DBASE' => $modx->db->config['dbase'], 'PREFIX' => $modx->db->config['table_prefix'] ); @@ -67,11 +68,11 @@ function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsA $output = $rs; break; - case "EVAL" : // evaluates text as php codes return the results - $output = eval ($param); + case "EVAL": // evaluates text as php codes return the results + $output = eval($param); break; - case "INHERIT" : + case "INHERIT": $output = $param; // Default to param value if no content from parents $doc = $modx->getPageInfo($docid, 0, 'id,parent'); @@ -80,8 +81,9 @@ function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsA // Grab document regardless of publish status $doc = $modx->getPageInfo($parent_id, 0, 'id,parent,published'); - if ($doc['parent'] != 0 && !$doc['published']) - continue; // hide unpublished docs if we're not at the top + if ($doc['parent'] != 0 && !$doc['published']) { + continue; + } // hide unpublished docs if we're not at the top $tv = $modx->getTemplateVar($name, '*', $doc['id'], $doc['published']); @@ -95,8 +97,8 @@ function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsA } break; - case 'DIRECTORY' : - $files = array (); + case 'DIRECTORY': + $files = array(); $path = $modx->config['base_path'] . $param; if (substr($path, -1, 1) != '/') { $path .= '/'; @@ -115,7 +117,7 @@ function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsA $output = implode('||', $files); break; - default : + default: $output = $value; break; @@ -129,10 +131,13 @@ function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsA * @param $file * @return string */ -function ProcessFile($file) { +function ProcessFile($file) +{ // get the file - $buffer = @file_get_contents($file); - if ($buffer === false) $buffer = " Could not retrieve document '$file'."; + $buffer = @file_get_contents($file); + if ($buffer === false) { + $buffer = " Could not retrieve document '$file'."; + } return $buffer; } @@ -146,11 +151,9 @@ function ParseCommand($binding_string) { global $BINDINGS; $binding_array = array(); - foreach($BINDINGS as $cmd) - { - if(strpos($binding_string,'@'.$cmd)===0) - { - $code = substr($binding_string,strlen($cmd)+1); + foreach ($BINDINGS as $cmd) { + if (strpos($binding_string, '@' . $cmd)===0) { + $code = substr($binding_string, strlen($cmd)+1); $binding_array = array($cmd,trim($code)); break; } @@ -168,20 +171,20 @@ function ParseCommand($binding_string) function parseTvValues($param, $tvsArray) { $modx = evolutionCMS(); - $tvsArray = is_array($modx->documentObject) ? array_merge($tvsArray, $modx->documentObject) : $tvsArray; - if (strpos($param, '[*') !== false) { - $matches = $modx->getTagsFromContent($param, '[*', '*]'); - foreach ($matches[0] as $i=>$match) { - if(isset($tvsArray[ $matches[1][$i] ])) { - if(is_array($tvsArray[ $matches[1][$i] ])) { - $value = $tvsArray[$matches[1][$i]]['value']; - $value = $value === '' ? $tvsArray[$matches[1][$i]]['default_text'] : $value; - } else { - $value = $tvsArray[ $matches[1][$i] ]; - } - $param = str_replace($match, $value, $param); - } - } - } - return $param; + $tvsArray = is_array($modx->documentObject) ? array_merge($tvsArray, $modx->documentObject) : $tvsArray; + if (strpos($param, '[*') !== false) { + $matches = $modx->getTagsFromContent($param, '[*', '*]'); + foreach ($matches[0] as $i=>$match) { + if (isset($tvsArray[ $matches[1][$i] ])) { + if (is_array($tvsArray[ $matches[1][$i] ])) { + $value = $tvsArray[$matches[1][$i]]['value']; + $value = $value === '' ? $tvsArray[$matches[1][$i]]['default_text'] : $value; + } else { + $value = $tvsArray[ $matches[1][$i] ]; + } + $param = str_replace($match, $value, $param); + } + } + } + return $param; } diff --git a/manager/includes/tmplvars.format.inc.php b/manager/includes/tmplvars.format.inc.php index edd050bd85..141c2a6a5b 100755 --- a/manager/includes/tmplvars.format.inc.php +++ b/manager/includes/tmplvars.format.inc.php @@ -15,335 +15,342 @@ * @param string $sep * @return mixed|string */ -function getTVDisplayFormat($name, $value, $format, $paramstring = "", $tvtype = "", $docid = "", $sep = '') { - +function getTVDisplayFormat($name, $value, $format, $paramstring = "", $tvtype = "", $docid = "", $sep = '') +{ $modx = evolutionCMS(); $o = ''; // process any TV commands in value - $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier; - $value = ProcessTVCommand($value, $name, $docid); + $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier; + $value = ProcessTVCommand($value, $name, $docid); - $params = array(); - if($paramstring) { - $cp = explode("&", $paramstring); - foreach($cp as $p => $v) { - $v = trim($v); // trim - $ar = explode("=", $v); - if(is_array($ar) && count($ar) == 2) { - $params[$ar[0]] = decodeParamValue($ar[1]); - } - } - } + $params = array(); + if ($paramstring) { + $cp = explode("&", $paramstring); + foreach ($cp as $p => $v) { + $v = trim($v); // trim + $ar = explode("=", $v); + if (is_array($ar) && count($ar) == 2) { + $params[$ar[0]] = decodeParamValue($ar[1]); + } + } + } - $id = "tv$name"; - switch($format) { - case 'image': - $images = parseInput($value, '||', 'array'); - foreach($images as $image) { - if(!is_array($image)) { - $image = explode('==', $image); - } - $src = $image[0]; + $id = "tv$name"; + switch ($format) { + case 'image': + $images = parseInput($value, '||', 'array'); + foreach ($images as $image) { + if (!is_array($image)) { + $image = explode('==', $image); + } + $src = $image[0]; - if($src) { - // We have a valid source - $attributes = ''; - $attr = array( - 'class' => $params['class'], - 'src' => $src, - 'id' => ($params['id'] ? $params['id'] : ''), - 'alt' => $modx->htmlspecialchars($params['alttext']), - 'style' => $params['style'] - ); - if(isset($params['align']) && $params['align'] != 'none') { - $attr['align'] = $params['align']; - } - foreach($attr as $k => $v) $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); - $attributes .= ' ' . $params['attrib']; + if ($src) { + // We have a valid source + $attributes = ''; + $attr = array( + 'class' => $params['class'], + 'src' => $src, + 'id' => ($params['id'] ? $params['id'] : ''), + 'alt' => $modx->htmlspecialchars($params['alttext']), + 'style' => $params['style'] + ); + if (isset($params['align']) && $params['align'] != 'none') { + $attr['align'] = $params['align']; + } + foreach ($attr as $k => $v) { + $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); + } + $attributes .= ' ' . $params['attrib']; - // Output the image with attributes - $o .= ''; - } - } - break; + // Output the image with attributes + $o .= ''; + } + } + break; - case "delim": // display as delimitted list - $value = parseInput($value, "||"); - $p = $params['format'] ? $params['format'] : " "; - if($p == "\\n") { - $p = "\n"; - } - $o = str_replace("||", $p, $value); - break; + case "delim": // display as delimitted list + $value = parseInput($value, "||"); + $p = $params['format'] ? $params['format'] : " "; + if ($p == "\\n") { + $p = "\n"; + } + $o = str_replace("||", $p, $value); + break; - case "string": - $value = parseInput($value); - $format = strtolower($params['format']); - if($format == 'upper case') { - $o = strtoupper($value); - } else if($format == 'lower case') { - $o = strtolower($value); - } else if($format == 'sentence case') { - $o = ucfirst($value); - } else if($format == 'capitalize') { - $o = ucwords($value); - } else { - $o = $value; - } - break; + case "string": + $value = parseInput($value); + $format = strtolower($params['format']); + if ($format == 'upper case') { + $o = strtoupper($value); + } elseif ($format == 'lower case') { + $o = strtolower($value); + } elseif ($format == 'sentence case') { + $o = ucfirst($value); + } elseif ($format == 'capitalize') { + $o = ucwords($value); + } else { + $o = $value; + } + break; - case "date": - if($value != '' || $params['default'] == 'Yes') { - if(empty($value)) { - $value = 'now'; - } - $timestamp = getUnixtimeFromDateString($value); - $p = $params['format'] ? $params['format'] : "%A %d, %B %Y"; - $o = strftime($p, $timestamp); - } else { - $value = ''; - } - break; + case "date": + if ($value != '' || $params['default'] == 'Yes') { + if (empty($value)) { + $value = 'now'; + } + $timestamp = getUnixtimeFromDateString($value); + $p = $params['format'] ? $params['format'] : "%A %d, %B %Y"; + $o = strftime($p, $timestamp); + } else { + $value = ''; + } + break; - case "hyperlink": - $value = parseInput($value, "||", "array"); - $o = ''; - $countValue = count($value); - for($i = 0; $i < $countValue; $i++) { - list($name, $url) = is_array($value[$i]) ? $value[$i] : explode("==", $value[$i]); - if(!$url) { - $url = $name; - } - if($url) { - if($o) { - $o .= '
    '; - } - $attributes = ''; - // setup the link attributes - $attr = array( - 'href' => $url, - 'title' => $params['title'] ? $modx->htmlspecialchars($params['title']) : $name, - 'class' => $params['class'], - 'style' => $params['style'], - 'target' => $params['target'], - ); - foreach($attr as $k => $v) $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); - $attributes .= ' ' . $params['attrib']; // add extra + case "hyperlink": + $value = parseInput($value, "||", "array"); + $o = ''; + $countValue = count($value); + for ($i = 0; $i < $countValue; $i++) { + list($name, $url) = is_array($value[$i]) ? $value[$i] : explode("==", $value[$i]); + if (!$url) { + $url = $name; + } + if ($url) { + if ($o) { + $o .= '
    '; + } + $attributes = ''; + // setup the link attributes + $attr = array( + 'href' => $url, + 'title' => $params['title'] ? $modx->htmlspecialchars($params['title']) : $name, + 'class' => $params['class'], + 'style' => $params['style'], + 'target' => $params['target'], + ); + foreach ($attr as $k => $v) { + $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); + } + $attributes .= ' ' . $params['attrib']; // add extra - // Output the link - $o .= '' . ($params['text'] ? $modx->htmlspecialchars($params['text']) : $name) . ''; - } - } - break; + // Output the link + $o .= '' . ($params['text'] ? $modx->htmlspecialchars($params['text']) : $name) . ''; + } + } + break; - case "htmltag": - $value = parseInput($value, "||", "array"); - $tagid = $params['tagid']; - $tagname = ($params['tagname']) ? $params['tagname'] : 'div'; - $o = ''; - // Loop through a list of tags + case "htmltag": + $value = parseInput($value, "||", "array"); + $tagid = $params['tagid']; + $tagname = ($params['tagname']) ? $params['tagname'] : 'div'; + $o = ''; + // Loop through a list of tags $countValue = count($value); - for($i = 0; $i < $countValue; $i++) { - $tagvalue = is_array($value[$i]) ? implode(' ', $value[$i]) : $value[$i]; - if(!$tagvalue) { - continue; - } + for ($i = 0; $i < $countValue; $i++) { + $tagvalue = is_array($value[$i]) ? implode(' ', $value[$i]) : $value[$i]; + if (!$tagvalue) { + continue; + } - $attributes = ''; - $attr = array( - 'id' => ($tagid ? $tagid : $id), - // 'tv' already added to id - 'class' => $params['class'], - 'style' => $params['style'], - ); - foreach($attr as $k => $v) $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); - $attributes .= ' ' . $params['attrib']; // add extra + $attributes = ''; + $attr = array( + 'id' => ($tagid ? $tagid : $id), + // 'tv' already added to id + 'class' => $params['class'], + 'style' => $params['style'], + ); + foreach ($attr as $k => $v) { + $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); + } + $attributes .= ' ' . $params['attrib']; // add extra - // Output the HTML Tag - $o .= '<' . $tagname . rtrim($attributes) . '>' . $tagvalue . ''; - } - break; + // Output the HTML Tag + $o .= '<' . $tagname . rtrim($attributes) . '>' . $tagvalue . ''; + } + break; - case "richtext": - $value = parseInput($value); - $w = $params['w'] ? $params['w'] : '100%'; - $h = $params['h'] ? $params['h'] : '400px'; - $richtexteditor = $params['edt'] ? $params['edt'] : ""; - $o = '
    '; - $replace_richtext = array($id); - // setup editors - if(!empty($replace_richtext) && !empty($richtexteditor)) { - // invoke OnRichTextEditorInit event - $evtOut = $modx->invokeEvent("OnRichTextEditorInit", array( - 'editor' => $richtexteditor, - 'elements' => $replace_richtext, - 'forfrontend' => 1, - 'width' => $w, - 'height' => $h - )); - if(is_array($evtOut)) { - $o .= implode("", $evtOut); - } - } - break; + case "richtext": + $value = parseInput($value); + $w = $params['w'] ? $params['w'] : '100%'; + $h = $params['h'] ? $params['h'] : '400px'; + $richtexteditor = $params['edt'] ? $params['edt'] : ""; + $o = '
    '; + $replace_richtext = array($id); + // setup editors + if (!empty($replace_richtext) && !empty($richtexteditor)) { + // invoke OnRichTextEditorInit event + $evtOut = $modx->invokeEvent("OnRichTextEditorInit", array( + 'editor' => $richtexteditor, + 'elements' => $replace_richtext, + 'forfrontend' => 1, + 'width' => $w, + 'height' => $h + )); + if (is_array($evtOut)) { + $o .= implode("", $evtOut); + } + } + break; - case "unixtime": - $value = parseInput($value); - $o = getUnixtimeFromDateString($value); - break; + case "unixtime": + $value = parseInput($value); + $o = getUnixtimeFromDateString($value); + break; - case "viewport": - $value = parseInput($value); - $id = '_' . time(); - if(!$params['vpid']) { - $params['vpid'] = $id; - } - $sTag = "regClientStartupScript(MODX_MANAGER_URL . "media/script/bin/viewport.js", array( - 'name' => 'viewport', - 'version' => '0', - 'plaintext' => false - )); - $o = $sTag . " id='" . $params['vpid'] . "' name='" . $params['vpid'] . "' "; - if($params['class']) { - $o .= " class='" . $params['class'] . "' "; - } - if($params['style']) { - $o .= " style='" . $params['style'] . "' "; - } - if($params['attrib']) { - $o .= $params['attrib'] . " "; - } - $o .= "scrolling='" . ($params['sbar'] == 'No' ? "no" : ($params['sbar'] == 'Yes' ? "yes" : "auto")) . "' "; - $o .= "src='" . $value . "' frameborder='" . $params['borsize'] . "' "; - $o .= "onload=\"window.setTimeout('ResizeViewPort(\\'" . $params['vpid'] . "\\'," . $autoMode . ")',100);\" width='" . $w . "' height='" . $h . "' "; - $o .= ">"; - $o .= $eTag; - break; + $modx->regClientStartupScript(MODX_MANAGER_URL . "media/script/bin/viewport.js", array( + 'name' => 'viewport', + 'version' => '0', + 'plaintext' => false + )); + $o = $sTag . " id='" . $params['vpid'] . "' name='" . $params['vpid'] . "' "; + if ($params['class']) { + $o .= " class='" . $params['class'] . "' "; + } + if ($params['style']) { + $o .= " style='" . $params['style'] . "' "; + } + if ($params['attrib']) { + $o .= $params['attrib'] . " "; + } + $o .= "scrolling='" . ($params['sbar'] == 'No' ? "no" : ($params['sbar'] == 'Yes' ? "yes" : "auto")) . "' "; + $o .= "src='" . $value . "' frameborder='" . $params['borsize'] . "' "; + $o .= "onload=\"window.setTimeout('ResizeViewPort(\\'" . $params['vpid'] . "\\'," . $autoMode . ")',100);\" width='" . $w . "' height='" . $h . "' "; + $o .= ">"; + $o .= $eTag; + break; - case "datagrid": - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $value); + case "datagrid": + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $value); - $grd->noRecordMsg = $params['egmsg']; + $grd->noRecordMsg = $params['egmsg']; - $grd->columnHeaderClass = $params['chdrc']; - $grd->cssClass = $params['tblc']; - $grd->itemClass = $params['itmc']; - $grd->altItemClass = $params['aitmc']; + $grd->columnHeaderClass = $params['chdrc']; + $grd->cssClass = $params['tblc']; + $grd->itemClass = $params['itmc']; + $grd->altItemClass = $params['aitmc']; - $grd->columnHeaderStyle = $params['chdrs']; - $grd->cssStyle = $params['tbls']; - $grd->itemStyle = $params['itms']; - $grd->altItemStyle = $params['aitms']; + $grd->columnHeaderStyle = $params['chdrs']; + $grd->cssStyle = $params['tbls']; + $grd->itemStyle = $params['itms']; + $grd->altItemStyle = $params['aitms']; - $grd->columns = $params['cols']; - $grd->fields = $params['flds']; - $grd->colWidths = $params['cwidth']; - $grd->colAligns = $params['calign']; - $grd->colColors = $params['ccolor']; - $grd->colTypes = $params['ctype']; + $grd->columns = $params['cols']; + $grd->fields = $params['flds']; + $grd->colWidths = $params['cwidth']; + $grd->colAligns = $params['calign']; + $grd->colColors = $params['ccolor']; + $grd->colTypes = $params['ctype']; - $grd->cellPadding = $params['cpad']; - $grd->cellSpacing = $params['cspace']; - $grd->header = $params['head']; - $grd->footer = $params['foot']; - $grd->pageSize = $params['psize']; - $grd->pagerLocation = $params['ploc']; - $grd->pagerClass = $params['pclass']; - $grd->pagerStyle = $params['pstyle']; - $o = $grd->render(); - break; + $grd->cellPadding = $params['cpad']; + $grd->cellSpacing = $params['cspace']; + $grd->header = $params['head']; + $grd->footer = $params['foot']; + $grd->pageSize = $params['psize']; + $grd->pagerLocation = $params['ploc']; + $grd->pagerClass = $params['pclass']; + $grd->pagerStyle = $params['pstyle']; + $o = $grd->render(); + break; - case 'htmlentities': - $value = parseInput($value); - if($tvtype == 'checkbox' || $tvtype == 'listbox-multiple') { - // remove delimiter from checkbox and listbox-multiple TVs - $value = str_replace('||', '', $value); - } - $o = htmlentities($value, ENT_NOQUOTES, $modx->config['modx_charset']); - break; + case 'htmlentities': + $value = parseInput($value); + if ($tvtype == 'checkbox' || $tvtype == 'listbox-multiple') { + // remove delimiter from checkbox and listbox-multiple TVs + $value = str_replace('||', '', $value); + } + $o = htmlentities($value, ENT_NOQUOTES, $modx->config['modx_charset']); + break; - case 'custom_widget': - $widget_output = ''; - $o = ''; - /* If we are loading a file */ - if(substr($params['output'], 0, 5) == "@FILE") { - $file_name = MODX_BASE_PATH . trim(substr($params['output'], 6)); - if(!file_exists($file_name)) { - $widget_output = $file_name . ' does not exist'; - } else { - $widget_output = file_get_contents($file_name); - } - } elseif(substr($params['output'], 0, 8) == '@INCLUDE') { - $file_name = MODX_BASE_PATH . trim(substr($params['output'], 9)); - if(!file_exists($file_name)) { - $widget_output = $file_name . ' does not exist'; - } else { - /* The included file needs to set $widget_output. Can be string, array, object */ - include $file_name; - } - } elseif(substr($params['output'], 0, 6) == '@CHUNK' && $value !== '') { - $chunk_name = trim(substr($params['output'], 7)); - $widget_output = $modx->getChunk($chunk_name); - } elseif(substr($params['output'], 0, 5) == '@EVAL' && $value !== '') { - $eval_str = trim(substr($params['output'], 6)); - $widget_output = eval($eval_str); - } elseif($value !== '') { - $widget_output = $params['output']; - } else { - $widget_output = ''; - } - if(is_string($widget_output)) { - $_ = $modx->config['enable_filter']; - $modx->config['enable_filter'] = 1; - $widget_output = $modx->parseText($widget_output, array('value' => $value)); - $modx->config['enable_filter'] = $_; - $o = $modx->parseDocumentSource($widget_output); - } else { - $o = $widget_output; - } - break; + case 'custom_widget': + $widget_output = ''; + $o = ''; + /* If we are loading a file */ + if (substr($params['output'], 0, 5) == "@FILE") { + $file_name = MODX_BASE_PATH . trim(substr($params['output'], 6)); + if (!file_exists($file_name)) { + $widget_output = $file_name . ' does not exist'; + } else { + $widget_output = file_get_contents($file_name); + } + } elseif (substr($params['output'], 0, 8) == '@INCLUDE') { + $file_name = MODX_BASE_PATH . trim(substr($params['output'], 9)); + if (!file_exists($file_name)) { + $widget_output = $file_name . ' does not exist'; + } else { + /* The included file needs to set $widget_output. Can be string, array, object */ + include $file_name; + } + } elseif (substr($params['output'], 0, 6) == '@CHUNK' && $value !== '') { + $chunk_name = trim(substr($params['output'], 7)); + $widget_output = $modx->getChunk($chunk_name); + } elseif (substr($params['output'], 0, 5) == '@EVAL' && $value !== '') { + $eval_str = trim(substr($params['output'], 6)); + $widget_output = eval($eval_str); + } elseif ($value !== '') { + $widget_output = $params['output']; + } else { + $widget_output = ''; + } + if (is_string($widget_output)) { + $_ = $modx->config['enable_filter']; + $modx->config['enable_filter'] = 1; + $widget_output = $modx->parseText($widget_output, array('value' => $value)); + $modx->config['enable_filter'] = $_; + $o = $modx->parseDocumentSource($widget_output); + } else { + $o = $widget_output; + } + break; - default: - $value = parseInput($value); - if($tvtype == 'checkbox' || $tvtype == 'listbox-multiple') { - // add separator - $value = explode('||', $value); - $value = implode($sep, $value); - } - $o = $value; - break; - } - return $o; + default: + $value = parseInput($value); + if ($tvtype == 'checkbox' || $tvtype == 'listbox-multiple') { + // add separator + $value = explode('||', $value); + $value = implode($sep, $value); + } + $o = $value; + break; + } + return $o; } /** * @param string $s * @return string */ -function decodeParamValue($s) { - $s = str_replace("%3D", '=', $s); // = - return str_replace("%26", '&', $s); // & +function decodeParamValue($s) +{ + $s = str_replace("%3D", '=', $s); // = + return str_replace("%26", '&', $s); // & } /** @@ -355,43 +362,47 @@ function decodeParamValue($s) { * @param bool $columns * @return array|string */ -function parseInput($src, $delim = "||", $type = "string", $columns = true) { // type can be: string, array +function parseInput($src, $delim = "||", $type = "string", $columns = true) +{ // type can be: string, array $modx = evolutionCMS(); - if($modx->db->isResult($src)) { - // must be a recordset - $rows = array(); - while($cols = $modx->db->getRow($src, 'num')) $rows[] = ($columns) ? $cols : implode(" ", $cols); - return ($type == "array") ? $rows : implode($delim, $rows); - } else { - // must be a text - if($type == "array") { - return explode($delim, $src); - } else { - return $src; - } - } + if ($modx->db->isResult($src)) { + // must be a recordset + $rows = array(); + while ($cols = $modx->db->getRow($src, 'num')) { + $rows[] = ($columns) ? $cols : implode(" ", $cols); + } + return ($type == "array") ? $rows : implode($delim, $rows); + } else { + // must be a text + if ($type == "array") { + return explode($delim, $src); + } else { + return $src; + } + } } /** * @param string $value * @return bool|false|int */ -function getUnixtimeFromDateString($value) { - $timestamp = false; - // Check for MySQL or legacy style date - $date_match_1 = '/^([0-9]{2})-([0-9]{2})-([0-9]{4})\ ([0-9]{2}):([0-9]{2}):([0-9]{2})$/'; - $date_match_2 = '/^([0-9]{4})-([0-9]{2})-([0-9]{2})\ ([0-9]{2}):([0-9]{2}):([0-9]{2})$/'; - $matches = array(); - if(strpos($value, '-') !== false) { - if(preg_match($date_match_1, $value, $matches)) { - $timestamp = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[1], $matches[3]); - } elseif(preg_match($date_match_2, $value, $matches)) { - $timestamp = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]); - } - } - // If those didn't work, use strtotime to figure out the date - if($timestamp === false || $timestamp === -1) { - $timestamp = strtotime($value); - } - return $timestamp; +function getUnixtimeFromDateString($value) +{ + $timestamp = false; + // Check for MySQL or legacy style date + $date_match_1 = '/^([0-9]{2})-([0-9]{2})-([0-9]{4})\ ([0-9]{2}):([0-9]{2}):([0-9]{2})$/'; + $date_match_2 = '/^([0-9]{4})-([0-9]{2})-([0-9]{2})\ ([0-9]{2}):([0-9]{2}):([0-9]{2})$/'; + $matches = array(); + if (strpos($value, '-') !== false) { + if (preg_match($date_match_1, $value, $matches)) { + $timestamp = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[1], $matches[3]); + } elseif (preg_match($date_match_2, $value, $matches)) { + $timestamp = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]); + } + } + // If those didn't work, use strtotime to figure out the date + if ($timestamp === false || $timestamp === -1) { + $timestamp = strtotime($value); + } + return $timestamp; } diff --git a/manager/includes/tmplvars.inc.php b/manager/includes/tmplvars.inc.php index 98dad01b12..725d66def2 100755 --- a/manager/includes/tmplvars.inc.php +++ b/manager/includes/tmplvars.inc.php @@ -12,160 +12,161 @@ * @param array $tvsArray * @return string */ -function renderFormElement($field_type, $field_id, $default_text = '', $field_elements = '', $field_value = '', $field_style = '', $row = array(), $tvsArray = array()) { +function renderFormElement($field_type, $field_id, $default_text = '', $field_elements = '', $field_value = '', $field_style = '', $row = array(), $tvsArray = array()) +{ $modx = evolutionCMS(); - global $_style; - global $_lang; - global $content; - global $which_browser; + global $_style; + global $_lang; + global $content; + global $which_browser; - if(substr($default_text, 0, 6) === '@@EVAL' && $field_value === $default_text) { - $eval_str = trim(substr($default_text, 7)); - $default_text = eval($eval_str); - $field_value = $default_text; - } + if (substr($default_text, 0, 6) === '@@EVAL' && $field_value === $default_text) { + $eval_str = trim(substr($default_text, 7)); + $default_text = eval($eval_str); + $field_value = $default_text; + } - $field_html = ''; - $cimode = strpos($field_type, ':'); - if($cimode === false) { - switch($field_type) { + $field_html = ''; + $cimode = strpos($field_type, ':'); + if ($cimode === false) { + switch ($field_type) { - case "text": // handler for regular text boxes - case "rawtext"; // non-htmlentity converted text boxes - $field_html .= ''; - break; - case "email": // handles email input fields - $field_html .= ''; - break; - case "number": // handles the input of numbers - $field_html .= ''; - break; - case "textareamini": // handler for textarea mini boxes - $field_html .= ''; - break; - case "textarea": // handler for textarea boxes - case "rawtextarea": // non-htmlentity convertex textarea boxes - case "htmlarea": // handler for textarea boxes (deprecated) - case "richtext": // handler for textarea boxes - $field_html .= ''; - break; - case "date": - $field_id = str_replace(array( - '-', - '.' - ), '_', urldecode($field_id)); - if($field_value == '') { - $field_value = 0; - } - $field_html .= ''; - $field_html .= ' '; + case "text": // handler for regular text boxes + case "rawtext": // non-htmlentity converted text boxes + $field_html .= ''; + break; + case "email": // handles email input fields + $field_html .= ''; + break; + case "number": // handles the input of numbers + $field_html .= ''; + break; + case "textareamini": // handler for textarea mini boxes + $field_html .= ''; + break; + case "textarea": // handler for textarea boxes + case "rawtextarea": // non-htmlentity convertex textarea boxes + case "htmlarea": // handler for textarea boxes (deprecated) + case "richtext": // handler for textarea boxes + $field_html .= ''; + break; + case "date": + $field_id = str_replace(array( + '-', + '.' + ), '_', urldecode($field_id)); + if ($field_value == '') { + $field_value = 0; + } + $field_html .= ''; + $field_html .= ' '; - break; - case "dropdown": // handler for select boxes - $field_html .= '"; - break; - case "listbox": // handler for select boxes - $field_html .= '"; - break; - case "listbox-multiple": // handler for select boxes where you can choose multiple items - $field_value = explode("||", $field_value); - $field_html .= '"; - break; - case "url": // handles url input fields - $urls = array( - '' => '--', - 'http://' => 'http://', - 'https://' => 'https://', - 'ftp://' => 'ftp://', - 'mailto:' => 'mailto:' - ); - $field_html = '
    The MODX parser recieved the following debug/ stop message:
    « $msg »

          SQL: $query
    +if (!empty($query)) { + $parsedMessageString .= "

          SQL: $query
          [Copy SQL to ClipBoard]
     
    PHP error debug
     
    PHP error debug
      Error: $text 
      Error: $text 
      Error type/ Nr.: " . $errortype[$nr] . " - $nr 
      Error type/ Nr.: ".$errortype[$nr]." - $nr 
      File: $file 
      File: $file 
      Line: $line 
      Line $line source: $source 
      Line: $line 
      Line $line source: $source 
     
    Parser timing
    '; - $field_html .= '
    '; - break; - case 'checkbox': // handles check boxes - $values = !is_array($field_value) ? explode('||', $field_value) : $field_value; - $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); - $tpl = '
    '; - static $i = 0; - $_ = array(); - foreach($index_list as $c => $item) { - if(is_array($item)) { - $name = trim($item[0]); - $value = isset($item[1]) ? $item[1] : $name; - } else { - $item = trim($item); - list($name, $value) = (strpos($item, '==') !== false) ? explode('==', $item, 2) : array( - $item, - $item - ); - } - $checked = in_array($value, $values) ? ' checked="checked"' : ''; - $param = array( - $modx->htmlspecialchars($value), - $i, - $field_id, - $checked, - $name - ); - $_[] = vsprintf($tpl, $param); - $i++; - } - $field_html = implode("\n", $_); - break; - case "option": // handles radio buttons - $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); - static $i = 0; - while(list($item, $itemvalue) = each($index_list)) { - list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue); - if(strlen($itemvalue) == 0) { - $itemvalue = $item; - } - $field_html .= '
    '; - $i++; - } - break; - case "image": // handles image fields using htmlarea image manager - global $_lang; - global $ResourceManagerLoaded; - global $content, $use_editor, $which_editor; - if(!$ResourceManagerLoaded && !(($content['richtext'] == 1 || $modx->manager->action == 4) && $use_editor == 1 && $which_editor == 3)) { - $field_html .= " + break; + case "dropdown": // handler for select boxes + $field_html .= '"; + break; + case "listbox": // handler for select boxes + $field_html .= '"; + break; + case "listbox-multiple": // handler for select boxes where you can choose multiple items + $field_value = explode("||", $field_value); + $field_html .= '"; + break; + case "url": // handles url input fields + $urls = array( + '' => '--', + 'http://' => 'http://', + 'https://' => 'https://', + 'ftp://' => 'ftp://', + 'mailto:' => 'mailto:' + ); + $field_html = '
    '; + $field_html .= '
    '; + break; + case 'checkbox': // handles check boxes + $values = !is_array($field_value) ? explode('||', $field_value) : $field_value; + $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); + $tpl = '
    '; + static $i = 0; + $_ = array(); + foreach ($index_list as $c => $item) { + if (is_array($item)) { + $name = trim($item[0]); + $value = isset($item[1]) ? $item[1] : $name; + } else { + $item = trim($item); + list($name, $value) = (strpos($item, '==') !== false) ? explode('==', $item, 2) : array( + $item, + $item + ); + } + $checked = in_array($value, $values) ? ' checked="checked"' : ''; + $param = array( + $modx->htmlspecialchars($value), + $i, + $field_id, + $checked, + $name + ); + $_[] = vsprintf($tpl, $param); + $i++; + } + $field_html = implode("\n", $_); + break; + case "option": // handles radio buttons + $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); + static $i = 0; + while (list($item, $itemvalue) = each($index_list)) { + list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue); + if (strlen($itemvalue) == 0) { + $itemvalue = $item; + } + $field_html .= '
    '; + $i++; + } + break; + case "image": // handles image fields using htmlarea image manager + global $_lang; + global $ResourceManagerLoaded; + global $content, $use_editor, $which_editor; + if (!$ResourceManagerLoaded && !(($content['richtext'] == 1 || $modx->manager->action == 4) && $use_editor == 1 && $which_editor == 3)) { + $field_html .= " "; - $ResourceManagerLoaded = true; - } - $field_html .= ''; - break; - case "file": // handles the input of file uploads - /* Modified by Timon for use with resource browser */ - global $_lang; - global $ResourceManagerLoaded; - global $content, $use_editor, $which_editor; - if(!$ResourceManagerLoaded && !(($content['richtext'] == 1 || $modx->manager->action == 4) && $use_editor == 1 && $which_editor == 3)) { - /* I didn't understand the meaning of the condition above, so I left it untouched ;-) */ - $field_html .= " + $ResourceManagerLoaded = true; + } + $field_html .= ''; + break; + case "file": // handles the input of file uploads + /* Modified by Timon for use with resource browser */ + global $_lang; + global $ResourceManagerLoaded; + global $content, $use_editor, $which_editor; + if (!$ResourceManagerLoaded && !(($content['richtext'] == 1 || $modx->manager->action == 4) && $use_editor == 1 && $which_editor == 3)) { + /* I didn't understand the meaning of the condition above, so I left it untouched ;-) */ + $field_html .= " "; - $ResourceManagerLoaded = true; - } - $field_html .= ''; + $ResourceManagerLoaded = true; + } + $field_html .= ''; - break; + break; - case 'custom_tv': - $custom_output = ''; - /* If we are loading a file */ - if(substr($field_elements, 0, 5) == "@FILE") { - $file_name = MODX_BASE_PATH . trim(substr($field_elements, 6)); - if(!file_exists($file_name)) { - $custom_output = $file_name . ' does not exist'; - } else { - $custom_output = file_get_contents($file_name); - } - } elseif(substr($field_elements, 0, 8) == '@INCLUDE') { - $file_name = MODX_BASE_PATH . trim(substr($field_elements, 9)); - if(!file_exists($file_name)) { - $custom_output = $file_name . ' does not exist'; - } else { - ob_start(); - include $file_name; - $custom_output = ob_get_contents(); - ob_end_clean(); - } - } elseif(substr($field_elements, 0, 6) == "@CHUNK") { - $chunk_name = trim(substr($field_elements, 7)); - $chunk_body = $modx->getChunk($chunk_name); - if($chunk_body == false) { - $custom_output = $_lang['chunk_no_exist'] . '(' . $_lang['htmlsnippet_name'] . ':' . $chunk_name . ')'; - } else { - $custom_output = $chunk_body; - } - } elseif(substr($field_elements, 0, 5) == "@EVAL") { - $eval_str = trim(substr($field_elements, 6)); - $custom_output = eval($eval_str); - } else { - $custom_output = $field_elements; - } - $replacements = array( - '[+field_type+]' => $field_type, - '[+field_id+]' => $field_id, - '[+default_text+]' => $default_text, - '[+field_value+]' => $modx->htmlspecialchars($field_value), - '[+field_style+]' => $field_style, - ); - $custom_output = str_replace(array_keys($replacements), $replacements, $custom_output); - $modx->documentObject = $content; - $modx->documentIdentifier = $content['id']; - $custom_output = $modx->parseDocumentSource($custom_output); - $field_html .= $custom_output; - break; + case 'custom_tv': + $custom_output = ''; + /* If we are loading a file */ + if (substr($field_elements, 0, 5) == "@FILE") { + $file_name = MODX_BASE_PATH . trim(substr($field_elements, 6)); + if (!file_exists($file_name)) { + $custom_output = $file_name . ' does not exist'; + } else { + $custom_output = file_get_contents($file_name); + } + } elseif (substr($field_elements, 0, 8) == '@INCLUDE') { + $file_name = MODX_BASE_PATH . trim(substr($field_elements, 9)); + if (!file_exists($file_name)) { + $custom_output = $file_name . ' does not exist'; + } else { + ob_start(); + include $file_name; + $custom_output = ob_get_contents(); + ob_end_clean(); + } + } elseif (substr($field_elements, 0, 6) == "@CHUNK") { + $chunk_name = trim(substr($field_elements, 7)); + $chunk_body = $modx->getChunk($chunk_name); + if ($chunk_body == false) { + $custom_output = $_lang['chunk_no_exist'] . '(' . $_lang['htmlsnippet_name'] . ':' . $chunk_name . ')'; + } else { + $custom_output = $chunk_body; + } + } elseif (substr($field_elements, 0, 5) == "@EVAL") { + $eval_str = trim(substr($field_elements, 6)); + $custom_output = eval($eval_str); + } else { + $custom_output = $field_elements; + } + $replacements = array( + '[+field_type+]' => $field_type, + '[+field_id+]' => $field_id, + '[+default_text+]' => $default_text, + '[+field_value+]' => $modx->htmlspecialchars($field_value), + '[+field_style+]' => $field_style, + ); + $custom_output = str_replace(array_keys($replacements), $replacements, $custom_output); + $modx->documentObject = $content; + $modx->documentIdentifier = $content['id']; + $custom_output = $modx->parseDocumentSource($custom_output); + $field_html .= $custom_output; + break; - default: // the default handler -- for errors, mostly - $field_html .= ''; + default: // the default handler -- for errors, mostly + $field_html .= ''; - } // end switch statement - } else { - $custom = explode(":", $field_type); - $custom_output = ''; - $file_name = MODX_BASE_PATH . 'assets/tvs/' . $custom['1'] . '/' . $custom['1'] . '.customtv.php'; - if(!file_exists($file_name)) { - $custom_output = $file_name . ' does not exist'; - } else { - ob_start(); - include $file_name; - $custom_output = ob_get_contents(); - ob_end_clean(); - } - $replacements = array( - '[+field_type+]' => $field_type, - '[+field_id+]' => $field_id, - '[+default_text+]' => $default_text, - '[+field_value+]' => $modx->htmlspecialchars($field_value), - '[+field_style+]' => $field_style, - ); - $custom_output = str_replace(array_keys($replacements), $replacements, $custom_output); - $modx->documentObject = $content; - $custom_output = $modx->parseDocumentSource($custom_output); - $field_html .= $custom_output; - } + } // end switch statement + } else { + $custom = explode(":", $field_type); + $custom_output = ''; + $file_name = MODX_BASE_PATH . 'assets/tvs/' . $custom['1'] . '/' . $custom['1'] . '.customtv.php'; + if (!file_exists($file_name)) { + $custom_output = $file_name . ' does not exist'; + } else { + ob_start(); + include $file_name; + $custom_output = ob_get_contents(); + ob_end_clean(); + } + $replacements = array( + '[+field_type+]' => $field_type, + '[+field_id+]' => $field_id, + '[+default_text+]' => $default_text, + '[+field_value+]' => $modx->htmlspecialchars($field_value), + '[+field_style+]' => $field_style, + ); + $custom_output = str_replace(array_keys($replacements), $replacements, $custom_output); + $modx->documentObject = $content; + $custom_output = $modx->parseDocumentSource($custom_output); + $field_html .= $custom_output; + } - return $field_html; + return $field_html; } // end renderFormElement function /** * @param string|array|mysqli_result $v * @return array */ -function ParseIntputOptions($v) { +function ParseIntputOptions($v) +{ $modx = evolutionCMS(); - $a = array(); - if(is_array($v)) { - return $v; - } else if($modx->db->isResult($v)) { - while($cols = $modx->db->getRow($v, 'num')) $a[] = $cols; - } else { - $a = explode("||", $v); - } - return $a; + $a = array(); + if (is_array($v)) { + return $v; + } elseif ($modx->db->isResult($v)) { + while ($cols = $modx->db->getRow($v, 'num')) { + $a[] = $cols; + } + } else { + $a = explode("||", $v); + } + return $a; } diff --git a/manager/includes/user_settings.inc.php b/manager/includes/user_settings.inc.php index 81ae5c37c6..78848257fc 100755 --- a/manager/includes/user_settings.inc.php +++ b/manager/includes/user_settings.inc.php @@ -4,7 +4,7 @@ } // START HACK -if (isset ($modx)) { +if (isset($modx)) { $user_id = $modx->getLoginUserID(); } else { $user_id = $_SESSION['mgrInternalKey']; diff --git a/manager/includes/veriword.php b/manager/includes/veriword.php index c33556b14f..4c438bada0 100755 --- a/manager/includes/veriword.php +++ b/manager/includes/veriword.php @@ -5,7 +5,7 @@ $modx->getSettings(); $modx->invokeEvent('OnWebPageInit'); -$vword = new VeriWord(148,60); +$vword = new VeriWord(148, 60); $vword->output_image(); $vword->destroy_image(); @@ -41,7 +41,8 @@ ## see sample.php for test and usage ## sample URL: http://www.program-ruti.org/veriword/ #### -class VeriWord { +class VeriWord +{ /* path to font directory*/ public $dir_font = "ttf/"; @@ -52,7 +53,8 @@ class VeriWord { public $im_height = 0; public $im; - public function __construct($w=200, $h=80) { + public function __construct($w=200, $h=80) + { /* create session to set word for verification */ $this->set_veriword(); $this->dir_font = dirname(__FILE__) . '/' . $this->dir_font; @@ -60,21 +62,24 @@ public function __construct($w=200, $h=80) { $this->im_height = $h; } - public function set_veriword() { + public function set_veriword() + { /* create session variable for verification, you may change the session variable name */ $this->word = $this->pick_word(); $_SESSION['veriword'] = $this->word; } - public function output_image() { + public function output_image() + { /* output the image as jpeg */ $this->draw_image(); header("Content-type: image/jpeg"); imagejpeg($this->im); } - public function pick_word() { + public function pick_word() + { $modx = evolutionCMS(); // set default words $words="MODX,Access,Better,BitCode,Chunk,Cache,Desc,Design,Excell,Enjoy,URLs,TechView,Gerald,Griff,Humphrey,Holiday,Intel,Integration,Joystick,Join(),Oscope,Genetic,Light,Likeness,Marit,Maaike,Niche,Netherlands,Ordinance,Oscillo,Parser,Phusion,Query,Question,Regalia,Righteous,Snippet,Sentinel,Template,Thespian,Unity,Enterprise,Verily,Veri,Website,WideWeb,Yap,Yellow,Zebra,Zygote"; @@ -82,26 +87,27 @@ public function pick_word() { $arr_words = array_filter(array_map('trim', explode(',', $words))); /* pick one randomly for text verification */ - return (string) $arr_words[array_rand($arr_words)].rand(10,999); + return (string) $arr_words[array_rand($arr_words)] . rand(10, 999); } - public function draw_text() { + public function draw_text() + { $dir = dir($this->dir_font); $fontstmp = array(); while (false !== ($file = $dir->read())) { - if(substr($file, -4) == '.ttf') { - $fontstmp[] = $this->dir_font.$file; + if (substr($file, -4) == '.ttf') { + $fontstmp[] = $this->dir_font . $file; } } $dir->close(); $text_font = (string) $fontstmp[array_rand($fontstmp)]; /* angle for text inclination */ - $text_angle = rand(-9,9); + $text_angle = rand(-9, 9); /* initial text size */ $text_size = 30; /* calculate text width and height */ - $box = imagettfbbox ( $text_size, $text_angle, $text_font, $this->word); + $box = imagettfbbox($text_size, $text_angle, $text_font, $this->word); $text_width = $box[2]-$box[0]; //text width $text_height= $box[5]-$box[3]; //text height @@ -109,7 +115,7 @@ public function draw_text() { $text_size = round((20 * $this->im_width)/$text_width); /* recalculate text width and height */ - $box = imagettfbbox ( $text_size, $text_angle, $text_font, $this->word); + $box = imagettfbbox($text_size, $text_angle, $text_font, $this->word); $text_width = $box[2]-$box[0]; //text width $text_height= $box[5]-$box[3]; //text height @@ -118,14 +124,14 @@ public function draw_text() { $text_y = ($this->im_height - $text_height)/2; /* create canvas for text drawing */ - $im_text = imagecreate ($this->im_width, $this->im_height); - $bg_color = imagecolorallocate ($im_text, 255, 255, 255); + $im_text = imagecreate($this->im_width, $this->im_height); + $bg_color = imagecolorallocate($im_text, 255, 255, 255); /* pick color for text */ - $text_color = imagecolorallocate ($im_text, 0, 51, 153); + $text_color = imagecolorallocate($im_text, 0, 51, 153); /* draw text into canvas */ - imagettftext ( $im_text, + imagettftext($im_text, $text_size, $text_angle, $text_x, @@ -140,19 +146,20 @@ public function draw_text() { } - public function draw_image() { + public function draw_image() + { /* pick one background image randomly from image directory */ - $img_file = $this->dir_noise."noise".rand(1,4).".jpg"; + $img_file = $this->dir_noise . "noise" . rand(1, 4) . ".jpg"; /* create "noise" background image from your image stock*/ - $noise_img = @imagecreatefromjpeg ($img_file); + $noise_img = @imagecreatefromjpeg($img_file); $noise_width = imagesx($noise_img); $noise_height = imagesy($noise_img); /* resize the background image to fit the size of image output */ - $this->im = imagecreatetruecolor($this->im_width,$this->im_height); - imagecopyresampled ($this->im, + $this->im = imagecreatetruecolor($this->im_width, $this->im_height); + imagecopyresampled($this->im, $noise_img, 0, 0, 0, 0, $this->im_width, @@ -161,20 +168,18 @@ public function draw_image() { $noise_height); /* put text image into background image */ - imagecopymerge ( $this->im, + imagecopymerge($this->im, $this->draw_text(), 0, 0, 0, 0, $this->im_width, $this->im_height, - 70 ); + 70); return $this->im; } - public function destroy_image() { - + public function destroy_image() + { imagedestroy($this->im); - } - } diff --git a/manager/index.php b/manager/index.php index 2d134aefe9..921bbf7f22 100755 --- a/manager/index.php +++ b/manager/index.php @@ -1,42 +1,42 @@ Unable to load configuration settings"; - echo "Please run the EVO install utility"; - exit; + echo "

    Unable to load configuration settings

    "; + echo "Please run the EVO install utility"; + exit; } // include the database configuration file @@ -139,11 +149,11 @@ // initiate the content manager class if (isset($coreClass) && class_exists($coreClass)) { - $modx = new $coreClass; + $modx = new $coreClass; } if (!isset($modx) || !($modx instanceof DocumentParser)) { - include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php'); - $modx = evolutionCMS(); + include_once(MODX_MANAGER_PATH . 'includes/document.parser.class.inc.php'); + $modx = evolutionCMS(); } $modx->loadExtension("ManagerAPI"); @@ -165,30 +175,31 @@ extract($modx->config, EXTR_OVERWRITE); // now include_once different language file as english -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. +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. } // $length_eng_lang = count($_lang); // Not used for now, required for difference-check with other languages than english (i.e. inside installer) -if($manager_language!="english" && file_exists(MODX_MANAGER_PATH."includes/lang/".$manager_language.".inc.php")) { - include_once "lang/".$manager_language.".inc.php"; +if ($manager_language!="english" && file_exists(MODX_MANAGER_PATH . "includes/lang/" . $manager_language . ".inc.php")) { + include_once "lang/" . $manager_language . ".inc.php"; } // allow custom language overrides not altered by future EVO-updates -if(file_exists(MODX_MANAGER_PATH."includes/lang/override/".$manager_language.".inc.php")) { - include_once "lang/override/".$manager_language.".inc.php"; +if (file_exists(MODX_MANAGER_PATH . "includes/lang/override/" . $manager_language . ".inc.php")) { + include_once "lang/override/" . $manager_language . ".inc.php"; } $s = array('[+MGR_DIR+]'); $r = array(MGR_DIR); -foreach($_lang as $k=>$v) -{ - if(strpos($v,'[+')!==false) $_lang[$k] = str_replace($s, $r, $v); +foreach ($_lang as $k=>$v) { + if (strpos($v, '[+')!==false) { + $_lang[$k] = str_replace($s, $r, $v); + } } // send the charset header -header('Content-Type: text/html; charset='.$modx_manager_charset); +header('Content-Type: text/html; charset=' . $modx_manager_charset); /* * include_once "version.inc.php"; //include version info. Use $modx->getVersionData() @@ -198,46 +209,53 @@ include_once "accesscontrol.inc.php"; // double check the session -if(!isset($_SESSION['mgrValidated'])){ - echo "Not Logged In!"; - exit; +if (!isset($_SESSION['mgrValidated'])) { + echo "Not Logged In!"; + exit; } // include_once the style variables file -if(isset($manager_theme) && !isset($_style)) { - $_style = array(); - include_once "media/style/".$manager_theme."/style.php"; +if (isset($manager_theme) && !isset($_style)) { + $_style = array(); + include_once "media/style/" . $manager_theme . "/style.php"; } // check if user is allowed to access manager interface -if(isset($allow_manager_access) && $allow_manager_access==0) { - include_once "manager.lockout.inc.php"; +if (isset($allow_manager_access) && $allow_manager_access==0) { + include_once "manager.lockout.inc.php"; } // Initialize System Alert Message Queque -if (!isset($_SESSION['SystemAlertMsgQueque'])) $_SESSION['SystemAlertMsgQueque'] = array(); +if (!isset($_SESSION['SystemAlertMsgQueque'])) { + $_SESSION['SystemAlertMsgQueque'] = array(); +} $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque']; // first we check to see if this is a frameset request -if(!isset($_POST['a']) && !isset($_GET['a']) && !isset($_POST['updateMsgCount'])) { - // this looks to be a top-level frameset request, so let's serve up a frameset - if(is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/frames/1.php")) { - include_once "media/style/".$manager_theme."/frames/1.php"; - }else{ - include_once "frames/1.php"; - } - exit; +if (!isset($_POST['a']) && !isset($_GET['a']) && !isset($_POST['updateMsgCount'])) { + // this looks to be a top-level frameset request, so let's serve up a frameset + if (is_file(MODX_MANAGER_PATH . "media/style/" . $manager_theme . "/frames/1.php")) { + include_once "media/style/" . $manager_theme . "/frames/1.php"; + } else { + include_once "frames/1.php"; + } + exit; } // OK, let's retrieve the action directive from the request $option = array('min_range'=>1,'max_range'=>2000); -if(isset($_GET['a']) && isset($_POST['a'])) $modx->webAlertAndQuit($_lang['error_double_action']); -elseif(isset($_GET['a'])) $action = filter_input(INPUT_GET, 'a',FILTER_VALIDATE_INT,$option); -elseif(isset($_POST['a'])) $action = filter_input(INPUT_POST,'a',FILTER_VALIDATE_INT,$option); -else $action = null; +if (isset($_GET['a']) && isset($_POST['a'])) { + $modx->webAlertAndQuit($_lang['error_double_action']); +} elseif (isset($_GET['a'])) { + $action = filter_input(INPUT_GET, 'a', FILTER_VALIDATE_INT, $option); +} elseif (isset($_POST['a'])) { + $action = filter_input(INPUT_POST, 'a', FILTER_VALIDATE_INT, $option); +} else { + $action = null; +} if (isset($_POST['updateMsgCount']) && $modx->hasPermission('messages')) { - include_once 'messageCount.inc.php'; + include_once 'messageCount.inc.php'; } // save page to manager object @@ -245,33 +263,34 @@ // attempt to foil some simple types of CSRF attacks if (isset($modx->config['validate_referer']) && (int)$modx->config['validate_referer']) { - if (isset($_SERVER['HTTP_REFERER'])) { - $referer = $_SERVER['HTTP_REFERER']; - - if (!empty($referer)) { - if (!preg_match('/^'.preg_quote(MODX_SITE_URL, '/').'/i', $referer)) { - $modx->webAlertAndQuit("A possible CSRF attempt was detected from referer: {$referer}.", "index.php"); - } - } else { - $modx->webAlertAndQuit("A possible CSRF attempt was detected. No referer was provided by the client.", "index.php"); - } - } else { - $modx->webAlertAndQuit("A possible CSRF attempt was detected. No referer was provided by the server.", "index.php"); - } + if (isset($_SERVER['HTTP_REFERER'])) { + $referer = $_SERVER['HTTP_REFERER']; + + if (!empty($referer)) { + if (!preg_match('/^' . preg_quote(MODX_SITE_URL, '/') . '/i', $referer)) { + $modx->webAlertAndQuit("A possible CSRF attempt was detected from referer: {$referer}.", "index.php"); + } + } else { + $modx->webAlertAndQuit("A possible CSRF attempt was detected. No referer was provided by the client.", "index.php"); + } + } else { + $modx->webAlertAndQuit("A possible CSRF attempt was detected. No referer was provided by the server.", "index.php"); + } } // invoke OnManagerPageInit event $modx->invokeEvent("OnManagerPageInit", array("action" => $action)); // return element filepath -function includeFileProcessor ($filepath,$manager_theme) { - $element = ""; - if(is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath)) { - $element = MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath; - }else{ - $element = $filepath; - } - return $element; +function includeFileProcessor($filepath, $manager_theme) +{ + $element = ""; + if (is_file(MODX_MANAGER_PATH . "media/style/" . $manager_theme . "/" . $filepath)) { + $element = MODX_MANAGER_PATH . "media/style/" . $manager_theme . "/" . $filepath; + } else { + $element = $filepath; + } + return $element; } // Now we decide what to do according to the action request. This is a BIG list :) @@ -279,714 +298,714 @@ function includeFileProcessor ($filepath,$manager_theme) { /********************************************************************/ /* frame management - show the requested frame */ /********************************************************************/ - case 1 : - // get the requested frame - $frame = preg_replace('/[^a-z0-9]/i','',$_REQUEST['f']); - if($frame>9) { - $enable_debug=false; // this is to stop the debug thingy being attached to the framesets - } - include_once(includeFileProcessor("frames/".$frame.".php",$manager_theme)); - break; + case 1: + // get the requested frame + $frame = preg_replace('/[^a-z0-9]/i', '', $_REQUEST['f']); + if ($frame>9) { + $enable_debug=false; // this is to stop the debug thingy being attached to the framesets + } + include_once(includeFileProcessor("frames/" . $frame . ".php", $manager_theme)); + break; /********************************************************************/ /* show the homepage */ /********************************************************************/ - case 2: - // get the home page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/welcome.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 2: + // get the home page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/welcome.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* document data */ /********************************************************************/ - case 3: - // get the page to show document's data - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/document_data.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 3: + // get the page to show document's data + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/document_data.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* content management */ /********************************************************************/ - case 85: - // get the mutate page for adding a folder - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 27: - // get the mutate page for changing content - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 4: - // get the mutate page for adding content - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 5: - // get the save processor - include_once(includeFileProcessor("processors/save_content.processor.php",$manager_theme)); - break; - case 6: - // get the delete processor - include_once(includeFileProcessor("processors/delete_content.processor.php",$manager_theme)); - break; - case 63: - // get the undelete processor - include_once(includeFileProcessor("processors/undelete_content.processor.php",$manager_theme)); - break; - case 51: - // get the move action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/move_document.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 52: - // get the move document processor - include_once(includeFileProcessor("processors/move_document.processor.php",$manager_theme)); - break; - case 61: - // get the processor for publishing content - include_once(includeFileProcessor("processors/publish_content.processor.php",$manager_theme)); - break; - case 62: - // get the processor for publishing content - include_once(includeFileProcessor("processors/unpublish_content.processor.php",$manager_theme)); - break; - case 56: - // get the sort menuindex action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_menuindex_sort.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 85: + // get the mutate page for adding a folder + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_content.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 27: + // get the mutate page for changing content + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_content.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 4: + // get the mutate page for adding content + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_content.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 5: + // get the save processor + include_once(includeFileProcessor("processors/save_content.processor.php", $manager_theme)); + break; + case 6: + // get the delete processor + include_once(includeFileProcessor("processors/delete_content.processor.php", $manager_theme)); + break; + case 63: + // get the undelete processor + include_once(includeFileProcessor("processors/undelete_content.processor.php", $manager_theme)); + break; + case 51: + // get the move action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/move_document.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 52: + // get the move document processor + include_once(includeFileProcessor("processors/move_document.processor.php", $manager_theme)); + break; + case 61: + // get the processor for publishing content + include_once(includeFileProcessor("processors/publish_content.processor.php", $manager_theme)); + break; + case 62: + // get the processor for publishing content + include_once(includeFileProcessor("processors/unpublish_content.processor.php", $manager_theme)); + break; + case 56: + // get the sort menuindex action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_menuindex_sort.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* show the wait page - gives the tree time to refresh (hopefully) */ /********************************************************************/ - case 7: - // get the wait page (so the tree can reload) - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/wait.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 7: + // get the wait page (so the tree can reload) + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/wait.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* let the user log out */ /********************************************************************/ - case 8: - // get the logout processor - include_once(includeFileProcessor("processors/logout.processor.php",$manager_theme)); - break; + case 8: + // get the logout processor + include_once(includeFileProcessor("processors/logout.processor.php", $manager_theme)); + break; /********************************************************************/ /* user management */ /********************************************************************/ - case 87: - // get the new web user page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 88: - // get the edit web user page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 89: - // get the save web user processor - include_once(includeFileProcessor("processors/save_web_user.processor.php",$manager_theme)); - break; - case 90: - // get the delete web user page - include_once(includeFileProcessor("processors/delete_web_user.processor.php",$manager_theme)); - break; - case 11: - // get the new user page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_user.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 12: - // get the edit user page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_user.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 32: - // get the save user processor - include_once(includeFileProcessor("processors/save_user.processor.php",$manager_theme)); - break; - case 28: - // get the change password page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_password.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 34: - // get the save new password page - include_once(includeFileProcessor("processors/save_password.processor.php",$manager_theme)); - break; - case 33: - // get the delete user page - include_once(includeFileProcessor("processors/delete_user.processor.php",$manager_theme)); - break; + case 87: + // get the new web user page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 88: + // get the edit web user page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 89: + // get the save web user processor + include_once(includeFileProcessor("processors/save_web_user.processor.php", $manager_theme)); + break; + case 90: + // get the delete web user page + include_once(includeFileProcessor("processors/delete_web_user.processor.php", $manager_theme)); + break; + case 11: + // get the new user page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_user.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 12: + // get the edit user page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_user.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 32: + // get the save user processor + include_once(includeFileProcessor("processors/save_user.processor.php", $manager_theme)); + break; + case 28: + // get the change password page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_password.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 34: + // get the save new password page + include_once(includeFileProcessor("processors/save_password.processor.php", $manager_theme)); + break; + case 33: + // get the delete user page + include_once(includeFileProcessor("processors/delete_user.processor.php", $manager_theme)); + break; /********************************************************************/ /* role management */ /********************************************************************/ - case 38: - // get the new role page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_role.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 35: - // get the edit role page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_role.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 36: - // get the save role page - include_once(includeFileProcessor("processors/save_role.processor.php",$manager_theme)); - break; - case 37: - // get the delete role page - include_once(includeFileProcessor("processors/delete_role.processor.php",$manager_theme)); - break; + case 38: + // get the new role page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_role.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 35: + // get the edit role page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_role.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 36: + // get the save role page + include_once(includeFileProcessor("processors/save_role.processor.php", $manager_theme)); + break; + case 37: + // get the delete role page + include_once(includeFileProcessor("processors/delete_role.processor.php", $manager_theme)); + break; /********************************************************************/ /* category management */ /********************************************************************/ - case 120: - // get the edit category page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_categories.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 121: - // for ajax-requests - include_once(includeFileProcessor("actions/mutate_categories.dynamic.php",$manager_theme)); - break; + case 120: + // get the edit category page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_categories.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 121: + // for ajax-requests + include_once(includeFileProcessor("actions/mutate_categories.dynamic.php", $manager_theme)); + break; /********************************************************************/ /* template management */ /********************************************************************/ - case 16: - // get the edit template action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_templates.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 19: - // get the new template action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_templates.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 20: - // get the save processor - include_once(includeFileProcessor("processors/save_template.processor.php",$manager_theme)); - break; - case 21: - // get the delete processor - include_once(includeFileProcessor("processors/delete_template.processor.php",$manager_theme)); - break; - case 96: - // get the duplicate template processor - include_once(includeFileProcessor("processors/duplicate_template.processor.php",$manager_theme)); - break; - case 117: - // change the tv rank for selected template - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_template_tv_rank.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 16: + // get the edit template action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_templates.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 19: + // get the new template action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_templates.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 20: + // get the save processor + include_once(includeFileProcessor("processors/save_template.processor.php", $manager_theme)); + break; + case 21: + // get the delete processor + include_once(includeFileProcessor("processors/delete_template.processor.php", $manager_theme)); + break; + case 96: + // get the duplicate template processor + include_once(includeFileProcessor("processors/duplicate_template.processor.php", $manager_theme)); + break; + case 117: + // change the tv rank for selected template + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_template_tv_rank.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* snippet management */ /********************************************************************/ - case 22: - // get the edit snippet action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 23: - // get the new snippet action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 24: - // get the save processor - include_once(includeFileProcessor("processors/save_snippet.processor.php",$manager_theme)); - break; - case 25: - // get the delete processor - include_once(includeFileProcessor("processors/delete_snippet.processor.php",$manager_theme)); - break; - case 98: - // get the duplicate processor - include_once(includeFileProcessor("processors/duplicate_snippet.processor.php",$manager_theme)); - break; + case 22: + // get the edit snippet action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 23: + // get the new snippet action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 24: + // get the save processor + include_once(includeFileProcessor("processors/save_snippet.processor.php", $manager_theme)); + break; + case 25: + // get the delete processor + include_once(includeFileProcessor("processors/delete_snippet.processor.php", $manager_theme)); + break; + case 98: + // get the duplicate processor + include_once(includeFileProcessor("processors/duplicate_snippet.processor.php", $manager_theme)); + break; /********************************************************************/ /* htmlsnippet management */ /********************************************************************/ - case 78: - // get the edit snippet action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 77: - // get the new snippet action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 79: - // get the save processor - include_once(includeFileProcessor("processors/save_htmlsnippet.processor.php",$manager_theme)); - break; - case 80: - // get the delete processor - include_once(includeFileProcessor("processors/delete_htmlsnippet.processor.php",$manager_theme)); - break; - case 97: - // get the duplicate processor - include_once(includeFileProcessor("processors/duplicate_htmlsnippet.processor.php",$manager_theme)); - break; + case 78: + // get the edit snippet action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 77: + // get the new snippet action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 79: + // get the save processor + include_once(includeFileProcessor("processors/save_htmlsnippet.processor.php", $manager_theme)); + break; + case 80: + // get the delete processor + include_once(includeFileProcessor("processors/delete_htmlsnippet.processor.php", $manager_theme)); + break; + case 97: + // get the duplicate processor + include_once(includeFileProcessor("processors/duplicate_htmlsnippet.processor.php", $manager_theme)); + break; /********************************************************************/ /* show the credits page */ /********************************************************************/ - case 18: - // get the credits page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/credits.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 18: + // get the credits page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/credits.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* empty cache & synchronisation */ /********************************************************************/ - case 26: - // get the cache emptying processor - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/refresh_site.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 26: + // get the cache emptying processor + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/refresh_site.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* Module management */ /********************************************************************/ - case 106: - // get module management - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/modules.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 107: - // get the new module action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_module.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 108: - // get the edit module action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_module.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 109: - // get the save processor - include_once(includeFileProcessor("processors/save_module.processor.php",$manager_theme)); - break; - case 110: - // get the delete processor - include_once(includeFileProcessor("processors/delete_module.processor.php",$manager_theme)); - break; - case 111: - // get the duplicate processor - include_once(includeFileProcessor("processors/duplicate_module.processor.php",$manager_theme)); - break; - case 112: - // execute/run the module - //include_once "header.inc.php"; - include_once(includeFileProcessor("processors/execute_module.processor.php",$manager_theme)); - //include_once "footer.inc.php"; - break; - case 113: - // get the module resources (dependencies) action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_module_resources.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 106: + // get module management + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/modules.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 107: + // get the new module action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_module.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 108: + // get the edit module action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_module.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 109: + // get the save processor + include_once(includeFileProcessor("processors/save_module.processor.php", $manager_theme)); + break; + case 110: + // get the delete processor + include_once(includeFileProcessor("processors/delete_module.processor.php", $manager_theme)); + break; + case 111: + // get the duplicate processor + include_once(includeFileProcessor("processors/duplicate_module.processor.php", $manager_theme)); + break; + case 112: + // execute/run the module + //include_once "header.inc.php"; + include_once(includeFileProcessor("processors/execute_module.processor.php", $manager_theme)); + //include_once "footer.inc.php"; + break; + case 113: + // get the module resources (dependencies) action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_module_resources.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* plugin management */ /********************************************************************/ - case 100: - // change the plugin priority - //include_once "header.inc.php"; - in action file - include_once(includeFileProcessor("actions/mutate_plugin_priority.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 101: - // get the new plugin action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 102: - // get the edit plugin action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 103: - // get the save processor - include_once(includeFileProcessor("processors/save_plugin.processor.php",$manager_theme)); - break; - case 104: - // get the delete processor - include_once(includeFileProcessor("processors/delete_plugin.processor.php",$manager_theme)); - break; - case 105: - // get the duplicate processor - include_once(includeFileProcessor("processors/duplicate_plugin.processor.php",$manager_theme)); - break; - case 119: - // get the purge processor - include_once(includeFileProcessor("processors/purge_plugin.processor.php",$manager_theme)); - break; + case 100: + // change the plugin priority + //include_once "header.inc.php"; - in action file + include_once(includeFileProcessor("actions/mutate_plugin_priority.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 101: + // get the new plugin action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 102: + // get the edit plugin action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 103: + // get the save processor + include_once(includeFileProcessor("processors/save_plugin.processor.php", $manager_theme)); + break; + case 104: + // get the delete processor + include_once(includeFileProcessor("processors/delete_plugin.processor.php", $manager_theme)); + break; + case 105: + // get the duplicate processor + include_once(includeFileProcessor("processors/duplicate_plugin.processor.php", $manager_theme)); + break; + case 119: + // get the purge processor + include_once(includeFileProcessor("processors/purge_plugin.processor.php", $manager_theme)); + break; /********************************************************************/ /* view phpinfo */ /********************************************************************/ - case 200: - // show phpInfo - if($modx->hasPermission('logs')) { - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/phpinfo.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - } - break; + case 200: + // show phpInfo + if ($modx->hasPermission('logs')) { + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/phpinfo.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + } + break; /********************************************************************/ /* errorpage */ /********************************************************************/ - case 29: - // get the error page - include_once(includeFileProcessor("actions/error_dialog.static.php",$manager_theme)); - break; + case 29: + // get the error page + include_once(includeFileProcessor("actions/error_dialog.static.php", $manager_theme)); + break; /********************************************************************/ /* file manager */ /********************************************************************/ - case 31: - // get the page to manage files - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/files.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 31: + // get the page to manage files + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/files.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* access permissions */ /********************************************************************/ - case 40: - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/access_permissions.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 91: - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/web_access_permissions.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 40: + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/access_permissions.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 91: + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/web_access_permissions.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* access groups processor */ /********************************************************************/ - case 41: - include_once(includeFileProcessor("processors/access_groups.processor.php",$manager_theme)); - break; - case 92: - include_once(includeFileProcessor("processors/web_access_groups.processor.php",$manager_theme)); - break; + case 41: + include_once(includeFileProcessor("processors/access_groups.processor.php", $manager_theme)); + break; + case 92: + include_once(includeFileProcessor("processors/web_access_groups.processor.php", $manager_theme)); + break; /********************************************************************/ /* settings editor */ /********************************************************************/ - case 17: - // get the settings editor - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_settings.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 118: - // call settings ajax include - ob_clean(); - include_once(includeFileProcessor("includes/mutate_settings.ajax.php",$manager_theme)); - break; + case 17: + // get the settings editor + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_settings.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 118: + // call settings ajax include + ob_clean(); + include_once(includeFileProcessor("includes/mutate_settings.ajax.php", $manager_theme)); + break; /********************************************************************/ /* save settings */ /********************************************************************/ - case 30: - // get the save settings processor - include_once(includeFileProcessor("processors/save_settings.processor.php",$manager_theme)); - break; + case 30: + // get the save settings processor + include_once(includeFileProcessor("processors/save_settings.processor.php", $manager_theme)); + break; /********************************************************************/ /* system information */ /********************************************************************/ - case 53: - // get the settings editor - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/sysinfo.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 53: + // get the settings editor + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/sysinfo.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* optimise table */ /********************************************************************/ - case 54: - // get the table optimizer/truncate processor - include_once(includeFileProcessor("processors/optimize_table.processor.php",$manager_theme)); - break; + case 54: + // get the table optimizer/truncate processor + include_once(includeFileProcessor("processors/optimize_table.processor.php", $manager_theme)); + break; /********************************************************************/ /* view logging */ /********************************************************************/ - case 13: - // view logging - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/logging.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 13: + // view logging + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/logging.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* empty logs */ /********************************************************************/ - case 55: - // get the settings editor - include_once(includeFileProcessor("processors/empty_table.processor.php",$manager_theme)); - break; + case 55: + // get the settings editor + include_once(includeFileProcessor("processors/empty_table.processor.php", $manager_theme)); + break; /********************************************************************/ /* calls test page */ /********************************************************************/ - case 999: - // get the test page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("test_page.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 999: + // get the test page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("test_page.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* Empty recycle bin */ /********************************************************************/ - case 64: - // get the Recycle bin emptier - include_once(includeFileProcessor("processors/remove_content.processor.php",$manager_theme)); - break; + case 64: + // get the Recycle bin emptier + include_once(includeFileProcessor("processors/remove_content.processor.php", $manager_theme)); + break; /********************************************************************/ /* Messages */ /********************************************************************/ - case 10: - // get the messages page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/messages.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 10: + // get the messages page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/messages.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* Delete a message */ /********************************************************************/ - case 65: - // get the message deleter - include_once(includeFileProcessor("processors/delete_message.processor.php",$manager_theme)); - break; + case 65: + // get the message deleter + include_once(includeFileProcessor("processors/delete_message.processor.php", $manager_theme)); + break; /********************************************************************/ /* Send a message */ /********************************************************************/ - case 66: - // get the message deleter - include_once(includeFileProcessor("processors/send_message.processor.php",$manager_theme)); - break; + case 66: + // get the message deleter + include_once(includeFileProcessor("processors/send_message.processor.php", $manager_theme)); + break; /********************************************************************/ /* Remove locks */ /********************************************************************/ - case 67: - // get the lock remover - include_once(includeFileProcessor("processors/remove_locks.processor.php",$manager_theme)); - break; + case 67: + // get the lock remover + include_once(includeFileProcessor("processors/remove_locks.processor.php", $manager_theme)); + break; /********************************************************************/ /* Site schedule */ /********************************************************************/ - case 70: - // get the schedule page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/site_schedule.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 70: + // get the schedule page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/site_schedule.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* Search */ /********************************************************************/ - case 71: - // get the search page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/search.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 71: + // get the search page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/search.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* About */ /********************************************************************/ - case 59: - // get the about page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/about.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 59: + // get the about page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/about.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* Add weblink */ /********************************************************************/ - case 72: - // get the weblink page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 72: + // get the weblink page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_content.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* User management */ /********************************************************************/ - case 75: - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/user_management.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 99: - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/web_user_management.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 86: - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/role_management.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 75: + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/user_management.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 99: + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/web_user_management.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 86: + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/role_management.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* template/ snippet management */ /********************************************************************/ - case 76: - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/resources.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 76: + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/resources.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* Export to file */ /********************************************************************/ - case 83: - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/export_site.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 83: + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/export_site.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* Resource Selector */ /********************************************************************/ - case 84: - include_once(includeFileProcessor("actions/resource_selector.static.php",$manager_theme)); - break; + case 84: + include_once(includeFileProcessor("actions/resource_selector.static.php", $manager_theme)); + break; /********************************************************************/ /* Backup Manager */ /********************************************************************/ - case 93: - # header and footer will be handled interally - include_once(includeFileProcessor("actions/bkmanager.static.php",$manager_theme)); - break; + case 93: + # header and footer will be handled interally + include_once(includeFileProcessor("actions/bkmanager.static.php", $manager_theme)); + break; /********************************************************************/ /* Duplicate Document */ /********************************************************************/ - case 94: - // get the duplicate processor - include_once(includeFileProcessor("processors/duplicate_content.processor.php",$manager_theme)); - break; + case 94: + // get the duplicate processor + include_once(includeFileProcessor("processors/duplicate_content.processor.php", $manager_theme)); + break; /********************************************************************/ /* Import Document from file */ /********************************************************************/ - case 95: - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/import_site.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 95: + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/import_site.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* Help */ /********************************************************************/ - case 9: - // get the help page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/help.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 9: + // get the help page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/help.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* Template Variables - Based on Apodigm's Docvars */ /********************************************************************/ - case 300: - // get the new document variable action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 301: - // get the edit document variable action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 302: - // get the save processor - include_once(includeFileProcessor("processors/save_tmplvars.processor.php",$manager_theme)); - break; - case 303: - // get the delete processor - include_once(includeFileProcessor("processors/delete_tmplvars.processor.php",$manager_theme)); - break; - case 304: - // get the duplicate processor - include_once(includeFileProcessor("processors/duplicate_tmplvars.processor.php",$manager_theme)); - break; - case 305: - // get the tv-rank action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_tv_rank.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 300: + // get the new document variable action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 301: + // get the edit document variable action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 302: + // get the save processor + include_once(includeFileProcessor("processors/save_tmplvars.processor.php", $manager_theme)); + break; + case 303: + // get the delete processor + include_once(includeFileProcessor("processors/delete_tmplvars.processor.php", $manager_theme)); + break; + case 304: + // get the duplicate processor + include_once(includeFileProcessor("processors/duplicate_tmplvars.processor.php", $manager_theme)); + break; + case 305: + // get the tv-rank action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_tv_rank.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* Event viewer: show event message log */ /********************************************************************/ - case 114: - // get event logs - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/eventlog.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 115: - // get event log details viewer - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/eventlog_details.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 116: - // get the event log delete processor - include_once(includeFileProcessor("processors/delete_eventlog.processor.php",$manager_theme)); - break; - - case 501: - //delete category - include_once(includeFileProcessor("processors/delete_category.processor.php",$manager_theme)); - break; + case 114: + // get event logs + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/eventlog.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 115: + // get event log details viewer + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/eventlog_details.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 116: + // get the event log delete processor + include_once(includeFileProcessor("processors/delete_eventlog.processor.php", $manager_theme)); + break; + + case 501: + //delete category + include_once(includeFileProcessor("processors/delete_category.processor.php", $manager_theme)); + break; /********************************************************************/ /* default action: show not implemented message */ /********************************************************************/ - default : - // say that what was requested doesn't do anything yet - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - echo " -
    ".$_lang['functionnotimpl']."
    + default: + // say that what was requested doesn't do anything yet + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + echo " +
    " . $_lang['functionnotimpl'] . "
    -

    ".$_lang['functionnotimpl_message']."

    +

    " . $_lang['functionnotimpl_message'] . "

    "; - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); } /********************************************************************/ // log action, unless it's a frame request -if($action!=1 && $action!=7 && $action!=2) { - include_once "log.class.inc.php"; - $log = new logHandler; - $log->initAndWriteLog(); +if ($action!=1 && $action!=7 && $action!=2) { + include_once "log.class.inc.php"; + $log = new logHandler; + $log->initAndWriteLog(); } /********************************************************************/ // show debug diff --git a/manager/media/browser/mcpuk/browse.php b/manager/media/browser/mcpuk/browse.php index 0f0e308919..a89e141a4e 100755 --- a/manager/media/browser/mcpuk/browse.php +++ b/manager/media/browser/mcpuk/browse.php @@ -14,14 +14,19 @@ require "core/autoload.php"; // Init MODX -function returnNoPermissionsMessage($role) { - global $_lang; - echo sprintf($_lang['files_management_no_permission'], $role); - exit; +function returnNoPermissionsMessage($role) +{ + global $_lang; + echo sprintf($_lang['files_management_no_permission'], $role); + exit; } -if( $_GET['type'] == 'images' && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_images')) returnNoPermissionsMessage('assets_images'); -if( $_GET['type'] == 'files' && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_files')) returnNoPermissionsMessage('assets_files'); +if ($_GET['type'] == 'images' && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_images')) { + returnNoPermissionsMessage('assets_images'); +} +if ($_GET['type'] == 'files' && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_files')) { + returnNoPermissionsMessage('assets_files'); +} $browser = new browser($modx); $browser->action(); diff --git a/manager/media/browser/mcpuk/browser.php b/manager/media/browser/mcpuk/browser.php index 7ed522bbbf..0e76c21c27 100755 --- a/manager/media/browser/mcpuk/browser.php +++ b/manager/media/browser/mcpuk/browser.php @@ -10,14 +10,20 @@ } }; window.location.href = "browse.php?"; diff --git a/manager/media/browser/mcpuk/config.php b/manager/media/browser/mcpuk/config.php index 6bb2648559..eff680bb65 100755 --- a/manager/media/browser/mcpuk/config.php +++ b/manager/media/browser/mcpuk/config.php @@ -26,12 +26,12 @@ 'theme' => "evo", - 'uploadURL' => rtrim($modx->config['rb_base_url'],'/'), - 'uploadDir' => rtrim($modx->config['rb_base_dir'],'/'), + 'uploadURL' => rtrim($modx->config['rb_base_url'], '/'), + 'uploadDir' => rtrim($modx->config['rb_base_dir'], '/'), 'siteURL' => $modx->config['site_url'], - 'assetsURL' => rtrim($modx->config['rb_base_url'],'/'), - 'dirPerms' => intval($modx->config['new_folder_permissions'],8), - 'filePerms' => intval($modx->config['new_file_permissions'],8), + 'assetsURL' => rtrim($modx->config['rb_base_url'], '/'), + 'dirPerms' => intval($modx->config['new_folder_permissions'], 8), + 'filePerms' => intval($modx->config['new_file_permissions'], 8), 'maxfilesize' => $settings['upload_maxsize'], 'denyUpdateCheck' => true, @@ -58,14 +58,14 @@ 'types' => array( // CKEditor & FCKEditor types - 'files' => str_replace(',',' ',$modx->config['upload_files']), - 'flash' => str_replace(',',' ',$modx->config['upload_flash']), - 'images' => str_replace(',',' ',$modx->config['upload_images']), + 'files' => str_replace(',', ' ', $modx->config['upload_files']), + 'flash' => str_replace(',', ' ', $modx->config['upload_flash']), + 'images' => str_replace(',', ' ', $modx->config['upload_images']), // TinyMCE types - 'file' => str_replace(',',' ',$modx->config['upload_files']), - 'media' => str_replace(',',' ',$modx->config['upload_media']), - 'image' => str_replace(',',' ',$modx->config['upload_images']), + 'file' => str_replace(',', ' ', $modx->config['upload_files']), + 'media' => str_replace(',', ' ', $modx->config['upload_media']), + 'image' => str_replace(',', ' ', $modx->config['upload_images']), ), 'dirnameChangeChars' => array( ' ' => "_", diff --git a/manager/media/browser/mcpuk/core/autoload.php b/manager/media/browser/mcpuk/core/autoload.php index 8f910cad63..bcb37f83c2 100755 --- a/manager/media/browser/mcpuk/core/autoload.php +++ b/manager/media/browser/mcpuk/core/autoload.php @@ -19,39 +19,42 @@ * here, they can be accessed in config.php via $GLOBALS array. * It's recommended to use constants instead. */ -include_once(dirname(__FILE__)."/../../../../../assets/cache/siteManager.php"); +include_once(dirname(__FILE__) . "/../../../../../assets/cache/siteManager.php"); require_once('../../../includes/protect.inc.php'); include_once('../../../includes/config.inc.php'); include_once('../../../includes/document.parser.class.inc.php'); $modx = evolutionCMS(); $modx->db->connect(); startCMSSession(); -if(!isset($_SESSION['mgrValidated'])) { - die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (!isset($_SESSION['mgrValidated'])) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } define('IN_MANAGER_MODE', true); $modx->getSettings(); $manager_language = $modx->config['manager_language']; // Pass language code from MODX to KCFinder -if(!file_exists("../../../includes/lang/".$manager_language.".inc.php")) { +if (!file_exists("../../../includes/lang/" . $manager_language . ".inc.php")) { $manager_language = "english"; // if not set, get the english language file. } -include_once "../../../includes/lang/".$manager_language.".inc.php"; +include_once "../../../includes/lang/" . $manager_language . ".inc.php"; $_GET['langCode'] = $modx_lang_attribute; // PHP VERSION CHECK -if (substr(PHP_VERSION, 0, strpos(PHP_VERSION, '.')) < 5) +if (substr(PHP_VERSION, 0, strpos(PHP_VERSION, '.')) < 5) { die("You are using PHP " . PHP_VERSION . " when KCFinder require at least version 5! Some systems has an option to change the active PHP version. Please refer to your hosting provider or upgrade your PHP distribution."); +} // SAFE MODE CHECK -if (ini_get("safe_mode")) +if (ini_get("safe_mode")) { die("The \"safe_mode\" PHP ini setting is turned on! You cannot run KCFinder in safe mode."); +} // MAGIC AUTOLOAD CLASSES FUNCTION -function autoloadda9d06472ccb71b84928677ce2a6ca89($class) { +function autoloadda9d06472ccb71b84928677ce2a6ca89($class) +{ static $classes = null; if ($classes === null) { $classes = array( @@ -83,8 +86,8 @@ function autoloadda9d06472ccb71b84928677ce2a6ca89($class) { // json_encode() IMPLEMENTATION IF JSON EXTENSION IS MISSING if (!function_exists("json_encode")) { - - function kcfinder_json_string_encode($string) { + function kcfinder_json_string_encode($string) + { return '"' . str_replace('/', "\\/", str_replace("\t", "\\t", @@ -95,37 +98,42 @@ function kcfinder_json_string_encode($string) { $string)))))) . '"'; } - function json_encode($data) { - + function json_encode($data) + { if (is_array($data)) { $ret = array(); // OBJECT if (array_keys($data) !== range(0, count($data) - 1)) { - foreach ($data as $key => $val) + foreach ($data as $key => $val) { $ret[] = kcfinder_json_string_encode($key) . ':' . json_encode($val); + } return "{" . implode(",", $ret) . "}"; // ARRAY } else { - foreach ($data as $val) + foreach ($data as $val) { $ret[] = json_encode($val); + } return "[" . implode(",", $ret) . "]"; } - // BOOLEAN OR NULL - } elseif (is_bool($data) || ($data === null)) + // BOOLEAN OR NULL + } elseif (is_bool($data) || ($data === null)) { return ($data === null) ? "null" : ($data ? "true" : "false"); + } // FLOAT - elseif (is_float($data)) + elseif (is_float($data)) { return rtrim(rtrim(number_format($data, 14, ".", ""), "0"), "."); + } // INTEGER - elseif (is_int($data)) + elseif (is_int($data)) { return $data; + } // STRING return kcfinder_json_string_encode($data); diff --git a/manager/media/browser/mcpuk/core/browser.php b/manager/media/browser/mcpuk/core/browser.php index a978b321b1..79d61b8f07 100755 --- a/manager/media/browser/mcpuk/core/browser.php +++ b/manager/media/browser/mcpuk/core/browser.php @@ -12,23 +12,29 @@ * @link http://kcfinder.sunhater.com */ -class browser extends uploader { +class browser extends uploader +{ protected $action; protected $thumbsDir; protected $thumbsTypeDir; - public function __construct($modx) { + public function __construct($modx) + { parent::__construct($modx); if (isset($this->post['dir'])) { $dir = $this->checkInputDir($this->post['dir'], true, false); - if ($dir === false) unset($this->post['dir']); + if ($dir === false) { + unset($this->post['dir']); + } $this->post['dir'] = $dir; } if (isset($this->get['dir'])) { $dir = $this->checkInputDir($this->get['dir'], true, false); - if ($dir === false) unset($this->get['dir']); + if ($dir === false) { + unset($this->get['dir']); + } $this->get['dir'] = $dir; } @@ -44,8 +50,9 @@ public function __construct($modx) { !is_dir("$thumbsDir/{$this->type}") && !@mkdir("$thumbsDir/{$this->type}", $this->config['dirPerms']) ) - ) + ) { $this->errorMsg("Cannot access or create thumbnails folder."); + } $this->thumbsDir = $thumbsDir; $this->thumbsTypeDir = "$thumbsDir/{$this->type}"; @@ -58,23 +65,30 @@ public function __construct($modx) { if (is_array($files) && count($files)) { $time = time(); - foreach ($files as $file) - if (is_file($file) && ($time - filemtime($file) > 3600)) + foreach ($files as $file) { + if (is_file($file) && ($time - filemtime($file) > 3600)) { unlink($file); + } + } } if (isset($this->get['theme']) && ($this->get['theme'] == basename($this->get['theme'])) && is_dir("themes/{$this->get['theme']}") - ) + ) { $this->config['theme'] = $this->get['theme']; + } } - public function action() { + public function action() + { $act = isset($this->get['act']) ? $this->get['act'] : "browser"; - if(!preg_match('@^[0-9a-zA-Z_]+$@', $act)) $this->errorMsg("Unknown error."); - if (!method_exists($this, "act_$act")) + if (!preg_match('@^[0-9a-zA-Z_]+$@', $act)) { + $this->errorMsg("Unknown error."); + } + if (!method_exists($this, "act_$act")) { $act = "browser"; + } $this->action = $act; $method = "act_$act"; @@ -82,21 +96,22 @@ public function action() { $message = $this->label("You don't have permissions to browse server."); if (in_array($act, array("browser", "upload")) || (substr($act, 0, 8) == "download") - ) + ) { $this->backMsg($message); - else { + } else { header("Content-Type: text/plain; charset={$this->charset}"); die(json_encode(array('error' => $message))); } } - if (!isset($this->session['dir'])) + if (!isset($this->session['dir'])) { $this->session['dir'] = $this->type; - else { + } else { $type = $this->getTypeFromPath($this->session['dir']); $dir = $this->config['uploadDir'] . "/" . $this->session['dir']; - if (($type != $this->type) || !is_dir($dir) || !is_readable($dir)) + if (($type != $this->type) || !is_dir($dir) || !is_readable($dir)) { $this->session['dir'] = $this->type; + } } $this->session['dir'] = path::normalize($this->session['dir']); @@ -106,8 +121,9 @@ public function action() { } elseif ( (substr($act, 0, 8) != "download") && !in_array($act, array("thumb", "upload")) - ) + ) { header("Content-Type: text/plain; charset={$this->charset}"); + } $return = $this->$method(); echo ($return === true) @@ -115,21 +131,25 @@ public function action() { : $return; } - protected function act_browser() { + protected function act_browser() + { if (isset($this->get['dir']) && is_dir("{$this->typeDir}/{$this->get['dir']}") && is_readable("{$this->typeDir}/{$this->get['dir']}") - ) + ) { $this->session['dir'] = path::normalize("{$this->type}/{$this->get['dir']}"); + } return $this->output(); } - protected function act_init() { + protected function act_init() + { $tree = $this->getDirInfo($this->typeDir); $tree['dirs'] = $this->getTree($this->session['dir']); - if (!is_array($tree['dirs']) || !count($tree['dirs'])) + if (!is_array($tree['dirs']) || !count($tree['dirs'])) { unset($tree['dirs']); + } $files = $this->getFiles($this->session['dir']); $dirWritable = dir::isWritable("{$this->config['uploadDir']}/{$this->session['dir']}"); $data = array( @@ -140,21 +160,26 @@ protected function act_init() { return json_encode($data); } - protected function act_thumb() { + protected function act_thumb() + { $this->getDir($this->get['dir'], true); - if (!isset($this->get['file']) || !isset($this->get['dir'])) + if (!isset($this->get['file']) || !isset($this->get['dir'])) { $this->sendDefaultThumb(); + } $file = $this->get['file']; - if (basename($file) != $file) + if (basename($file) != $file) { $this->sendDefaultThumb(); + } $file = "{$this->thumbsDir}/{$this->type}/{$this->get['dir']}/$file"; if (!is_file($file) || !is_readable($file)) { $file = "{$this->config['uploadDir']}/{$this->type}/{$this->get['dir']}/" . basename($file); - if (!is_file($file) || !is_readable($file)) + if (!is_file($file) || !is_readable($file)) { $this->sendDefaultThumb($file); + } $image = image::factory($this->imageDriver, $file); - if ($image->initError) + if ($image->initError) { $this->sendDefaultThumb($file); + } list($tmp, $tmp, $type) = getimagesize($file); if (in_array($type, array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG)) && ($image->width <= $this->config['thumbWidth']) && @@ -165,17 +190,20 @@ protected function act_thumb() { ($type == IMAGETYPE_PNG) ? "png" : "jpeg"); $mime = "image/$mime"; httpCache::file($file, $mime); - } else + } else { $this->sendDefaultThumb($file); + } } httpCache::file($file, "image/jpeg"); } - protected function act_expand() { + protected function act_expand() + { return json_encode(array('dirs' => $this->getDirs($this->postDir()))); } - protected function act_chDir() { + protected function act_chDir() + { $this->postDir(); // Just for existing check $this->session['dir'] = $this->type . "/" . $this->post['dir']; $dirWritable = dir::isWritable("{$this->config['uploadDir']}/{$this->session['dir']}"); @@ -185,81 +213,104 @@ protected function act_chDir() { )); } - protected function act_newDir() { + protected function act_newDir() + { if (!$this->config['access']['dirs']['create'] || !isset($this->post['dir']) || !isset($this->post['newDir']) - ) + ) { $this->errorMsg("Unknown error."); + } $dir = $this->postDir(); $newDir = $this->normalizeDirname(trim($this->post['newDir'])); - if (!strlen($newDir)) + if (!strlen($newDir)) { $this->errorMsg("Please enter new folder name."); - if (preg_match('/[\/\\\\]/s', $newDir)) + } + if (preg_match('/[\/\\\\]/s', $newDir)) { $this->errorMsg("Unallowable characters in folder name."); - if (substr($newDir, 0, 1) == ".") + } + if (substr($newDir, 0, 1) == ".") { $this->errorMsg("Folder name shouldn't begins with '.'"); - if (file_exists("$dir/$newDir")) + } + if (file_exists("$dir/$newDir")) { $this->errorMsg("A file or folder with that name already exists."); - if (!@mkdir("$dir/$newDir", $this->config['dirPerms'])) + } + if (!@mkdir("$dir/$newDir", $this->config['dirPerms'])) { $this->errorMsg("Cannot create {dir} folder.", array('dir' => $newDir)); + } return true; } - protected function act_renameDir() { + protected function act_renameDir() + { if (!$this->config['access']['dirs']['rename'] || !isset($this->post['dir']) || !isset($this->post['newName']) - ) + ) { $this->errorMsg("Unknown error."); + } $dir = $this->postDir(); $newName = $this->normalizeDirname(trim($this->post['newName'])); - if (!strlen($newName)) + if (!strlen($newName)) { $this->errorMsg("Please enter new folder name."); - if (preg_match('/[\/\\\\]/s', $newName)) + } + if (preg_match('/[\/\\\\]/s', $newName)) { $this->errorMsg("Unallowable characters in folder name."); - if (substr($newName, 0, 1) == ".") + } + if (substr($newName, 0, 1) == ".") { $this->errorMsg("Folder name shouldn't begins with '.'"); - if (!@rename($dir, dirname($dir) . "/$newName")) + } + if (!@rename($dir, dirname($dir) . "/$newName")) { $this->errorMsg("Cannot rename the folder."); + } $thumbDir = "$this->thumbsTypeDir/{$this->post['dir']}"; - if (is_dir($thumbDir)) + if (is_dir($thumbDir)) { @rename($thumbDir, dirname($thumbDir) . "/$newName"); + } return json_encode(array('name' => $newName)); } - protected function act_deleteDir() { + protected function act_deleteDir() + { if (!$this->config['access']['dirs']['delete'] || !isset($this->post['dir']) || !strlen(trim($this->post['dir'])) - ) + ) { $this->errorMsg("Unknown error."); + } $dir = $this->postDir(); - if (!dir::isWritable($dir)) + if (!dir::isWritable($dir)) { $this->errorMsg("Cannot delete the folder."); + } $result = !dir::prune($dir, false); - if (is_array($result) && count($result)) + if (is_array($result) && count($result)) { $this->errorMsg("Failed to delete {count} files/folders.", array('count' => count($result))); + } $thumbDir = "$this->thumbsTypeDir/{$this->post['dir']}"; - if (is_dir($thumbDir)) dir::prune($thumbDir); + if (is_dir($thumbDir)) { + dir::prune($thumbDir); + } return true; } - protected function act_upload() { + protected function act_upload() + { if (!$this->config['access']['files']['upload'] || !isset($this->post['dir']) - ) + ) { $this->errorMsg("Unknown error."); + } $dir = $this->postDir(); - if (!dir::isWritable($dir)) + if (!dir::isWritable($dir)) { $this->errorMsg("Cannot access or write to upload folder."); + } if (is_array($this->file['name'])) { $return = array(); @@ -271,19 +322,22 @@ protected function act_upload() { ), $dir); } return implode("\n", $return); - } else + } else { return $this->moveUploadFile($this->file, $dir); + } } - protected function act_download() { + protected function act_download() + { $dir = $this->postDir(); if (!isset($this->post['dir']) || !isset($this->post['file']) || - strpos($this->post['file'],'../')!==false || + strpos($this->post['file'], '../')!==false || (false === ($file = "$dir/{$this->post['file']}")) || !file_exists($file) || !is_readable($file) - ) + ) { $this->errorMsg("Unknown error."); + } header("Pragma: public"); header("Expires: 0"); @@ -297,205 +351,248 @@ protected function act_download() { die; } - protected function act_rename() { + protected function act_rename() + { $dir = $this->postDir(); if (!$this->config['access']['files']['rename'] || !isset($this->post['dir']) || !isset($this->post['file']) || - strpos($this->post['file'],'../')!==false || + strpos($this->post['file'], '../')!==false || !isset($this->post['newName']) || (false === ($file = "$dir/{$this->post['file']}")) || !file_exists($file) || !is_readable($file) || !file::isWritable($file) - ) + ) { $this->errorMsg("Unknown error."); + } if (isset($this->config['denyExtensionRename']) && $this->config['denyExtensionRename'] && (file::getExtension($this->post['file'], true) !== file::getExtension($this->post['newName'], true) ) - ) + ) { $this->errorMsg("You cannot rename the extension of files!"); + } $newName = $this->normalizeFilename(trim($this->post['newName'])); - if (!strlen($newName)) + if (!strlen($newName)) { $this->errorMsg("Please enter new file name."); - if (preg_match('/[\/\\\\]/s', $newName)) + } + if (preg_match('/[\/\\\\]/s', $newName)) { $this->errorMsg("Unallowable characters in file name."); - if (substr($newName, 0, 1) == ".") + } + if (substr($newName, 0, 1) == ".") { $this->errorMsg("File name shouldn't begins with '.'"); + } $newName = "$dir/$newName"; - if (file_exists($newName)) + if (file_exists($newName)) { $this->errorMsg("A file or folder with that name already exists."); + } $ext = file::getExtension($newName); - if (!$this->validateExtension($ext, $this->type)) + if (!$this->validateExtension($ext, $this->type)) { $this->errorMsg("Denied file extension."); - if (!@rename($file, $newName)) + } + if (!@rename($file, $newName)) { $this->errorMsg("Unknown error."); + } $thumbDir = "{$this->thumbsTypeDir}/{$this->post['dir']}"; $thumbFile = "$thumbDir/{$this->post['file']}"; - if (file_exists($thumbFile)) + if (file_exists($thumbFile)) { @rename($thumbFile, "$thumbDir/" . basename($newName)); + } return true; } - protected function act_delete() { + protected function act_delete() + { $dir = $this->postDir(); if (!$this->config['access']['files']['delete'] || !isset($this->post['dir']) || !isset($this->post['file']) || - strpos($this->post['file'],'../')!==false || + strpos($this->post['file'], '../')!==false || (false === ($file = "$dir/{$this->post['file']}")) || !file_exists($file) || !is_readable($file) || !file::isWritable($file) || !@unlink($file) - ) + ) { $this->errorMsg("Unknown error."); + } $thumb = "{$this->thumbsTypeDir}/{$this->post['dir']}/{$this->post['file']}"; - if (file_exists($thumb)) @unlink($thumb); + if (file_exists($thumb)) { + @unlink($thumb); + } return true; } - protected function act_cp_cbd() { + protected function act_cp_cbd() + { $dir = $this->postDir(); if (!$this->config['access']['files']['copy'] || !isset($this->post['dir']) || !is_dir($dir) || !is_readable($dir) || !dir::isWritable($dir) || !isset($this->post['files']) || !is_array($this->post['files']) || !count($this->post['files']) - ) + ) { $this->errorMsg("Unknown error."); + } $error = array(); - foreach($this->post['files'] as $file) { + foreach ($this->post['files'] as $file) { $file = path::normalize($file); - if (substr($file, 0, 1) == ".") continue; + if (substr($file, 0, 1) == ".") { + continue; + } $type = explode("/", $file); $type = $type[0]; - if ($type != $this->type) continue; + if ($type != $this->type) { + continue; + } $path = "{$this->config['uploadDir']}/$file"; $base = basename($file); $replace = array('file' => $base); $ext = file::getExtension($base); - if (!file_exists($path)) + if (!file_exists($path)) { $error[] = $this->label("The file '{file}' does not exist.", $replace); - elseif (substr($base, 0, 1) == ".") + } elseif (substr($base, 0, 1) == ".") { $error[] = "$base: " . $this->label("File name shouldn't begins with '.'"); - elseif (!$this->validateExtension($ext, $type)) + } elseif (!$this->validateExtension($ext, $type)) { $error[] = "$base: " . $this->label("Denied file extension."); - elseif (file_exists("$dir/$base")) + } elseif (file_exists("$dir/$base")) { $error[] = "$base: " . $this->label("A file or folder with that name already exists."); - elseif (!is_readable($path) || !is_file($path)) + } elseif (!is_readable($path) || !is_file($path)) { $error[] = $this->label("Cannot read '{file}'.", $replace); - elseif (!@copy($path, "$dir/$base")) + } elseif (!@copy($path, "$dir/$base")) { $error[] = $this->label("Cannot copy '{file}'.", $replace); - else { - if (function_exists("chmod")) + } else { + if (function_exists("chmod")) { @chmod("$dir/$base", $this->config['filePerms']); + } $fromThumb = "{$this->thumbsDir}/$file"; if (is_file($fromThumb) && is_readable($fromThumb)) { $toThumb = "{$this->thumbsTypeDir}/{$this->post['dir']}"; - if (!is_dir($toThumb)) + if (!is_dir($toThumb)) { @mkdir($toThumb, $this->config['dirPerms'], true); + } $toThumb .= "/$base"; @copy($fromThumb, $toThumb); } } } - if (count($error)) + if (count($error)) { return json_encode(array('error' => $error)); + } return true; } - protected function act_mv_cbd() { + protected function act_mv_cbd() + { $dir = $this->postDir(); if (!$this->config['access']['files']['move'] || !isset($this->post['dir']) || !is_dir($dir) || !is_readable($dir) || !dir::isWritable($dir) || !isset($this->post['files']) || !is_array($this->post['files']) || !count($this->post['files']) - ) + ) { $this->errorMsg("Unknown error."); + } $error = array(); - foreach($this->post['files'] as $file) { + foreach ($this->post['files'] as $file) { $file = path::normalize($file); - if (substr($file, 0, 1) == ".") continue; + if (substr($file, 0, 1) == ".") { + continue; + } $type = explode("/", $file); $type = $type[0]; - if ($type != $this->type) continue; + if ($type != $this->type) { + continue; + } $path = "{$this->config['uploadDir']}/$file"; $base = basename($file); $replace = array('file' => $base); $ext = file::getExtension($base); - if (!file_exists($path)) + if (!file_exists($path)) { $error[] = $this->label("The file '{file}' does not exist.", $replace); - elseif (substr($base, 0, 1) == ".") + } elseif (substr($base, 0, 1) == ".") { $error[] = "$base: " . $this->label("File name shouldn't begins with '.'"); - elseif (!$this->validateExtension($ext, $type)) + } elseif (!$this->validateExtension($ext, $type)) { $error[] = "$base: " . $this->label("Denied file extension."); - elseif (file_exists("$dir/$base")) + } elseif (file_exists("$dir/$base")) { $error[] = "$base: " . $this->label("A file or folder with that name already exists."); - elseif (!is_readable($path) || !is_file($path)) + } elseif (!is_readable($path) || !is_file($path)) { $error[] = $this->label("Cannot read '{file}'.", $replace); - elseif (!file::isWritable($path) || !@rename($path, "$dir/$base")) + } elseif (!file::isWritable($path) || !@rename($path, "$dir/$base")) { $error[] = $this->label("Cannot move '{file}'.", $replace); - else { - if (function_exists("chmod")) + } else { + if (function_exists("chmod")) { @chmod("$dir/$base", $this->config['filePerms']); + } $fromThumb = "{$this->thumbsDir}/$file"; if (is_file($fromThumb) && is_readable($fromThumb)) { $toThumb = "{$this->thumbsTypeDir}/{$this->post['dir']}"; - if (!is_dir($toThumb)) + if (!is_dir($toThumb)) { @mkdir($toThumb, $this->config['dirPerms'], true); + } $toThumb .= "/$base"; @rename($fromThumb, $toThumb); } } } - if (count($error)) + if (count($error)) { return json_encode(array('error' => $error)); + } return true; } - protected function act_rm_cbd() { + protected function act_rm_cbd() + { if (!$this->config['access']['files']['delete'] || !isset($this->post['files']) || !is_array($this->post['files']) || !count($this->post['files']) - ) + ) { $this->errorMsg("Unknown error."); + } $error = array(); - foreach($this->post['files'] as $file) { + foreach ($this->post['files'] as $file) { $file = path::normalize($file); - if (substr($file, 0, 1) == ".") continue; + if (substr($file, 0, 1) == ".") { + continue; + } $type = explode("/", $file); $type = $type[0]; - if ($type != $this->type) continue; + if ($type != $this->type) { + continue; + } $path = "{$this->config['uploadDir']}/$file"; $base = basename($file); $replace = array('file' => $base); - if (!is_file($path)) + if (!is_file($path)) { $error[] = $this->label("The file '{file}' does not exist.", $replace); - elseif (!@unlink($path)) + } elseif (!@unlink($path)) { $error[] = $this->label("Cannot delete '{file}'.", $replace); - else { + } else { $thumb = "{$this->thumbsDir}/$file"; - if (is_file($thumb)) @unlink($thumb); + if (is_file($thumb)) { + @unlink($thumb); + } } } - if (count($error)) + if (count($error)) { return json_encode(array('error' => $error)); + } return true; } - protected function act_downloadDir() { + protected function act_downloadDir() + { $dir = $this->postDir(); - if (!isset($this->post['dir']) || $this->config['denyZipDownload']) + if (!isset($this->post['dir']) || $this->config['denyZipDownload']) { $this->errorMsg("Unknown error."); + } $filename = basename($dir) . ".zip"; do { $file = md5(time() . session_id()); @@ -510,23 +607,27 @@ protected function act_downloadDir() { die; } - protected function act_downloadSelected() { + protected function act_downloadSelected() + { $dir = $this->postDir(); if (!isset($this->post['dir']) || !isset($this->post['files']) || !is_array($this->post['files']) || $this->config['denyZipDownload'] - ) + ) { $this->errorMsg("Unknown error."); + } $zipFiles = array(); foreach ($this->post['files'] as $file) { $file = path::normalize($file); - if ((substr($file, 0, 1) == ".") || (strpos($file, '/') !== false)) + if ((substr($file, 0, 1) == ".") || (strpos($file, '/') !== false)) { continue; + } $file = "$dir/$file"; - if (!is_file($file) || !is_readable($file)) + if (!is_file($file) || !is_readable($file)) { continue; + } $zipFiles[] = $file; } @@ -537,9 +638,10 @@ protected function act_downloadSelected() { $zip = new ZipArchive(); $res = $zip->open($file, ZipArchive::CREATE); - if ($res === TRUE) { - foreach ($zipFiles as $cfile) + if ($res === true) { + foreach ($zipFiles as $cfile) { $zip->addFile($cfile, basename($cfile)); + } $zip->close(); } header("Content-Type: application/x-zip"); @@ -550,25 +652,30 @@ protected function act_downloadSelected() { die; } - protected function act_downloadClipboard() { + protected function act_downloadClipboard() + { if (!isset($this->post['files']) || !is_array($this->post['files']) || $this->config['denyZipDownload'] - ) + ) { $this->errorMsg("Unknown error."); + } $zipFiles = array(); foreach ($this->post['files'] as $file) { $file = path::normalize($file); - if ((substr($file, 0, 1) == ".")) + if ((substr($file, 0, 1) == ".")) { continue; + } $type = explode("/", $file); $type = $type[0]; - if ($type != $this->type) + if ($type != $this->type) { continue; + } $file = $this->config['uploadDir'] . "/$file"; - if (!is_file($file) || !is_readable($file)) + if (!is_file($file) || !is_readable($file)) { continue; + } $zipFiles[] = $file; } @@ -579,9 +686,10 @@ protected function act_downloadClipboard() { $zip = new ZipArchive(); $res = $zip->open($file, ZipArchive::CREATE); - if ($res === TRUE) { - foreach ($zipFiles as $cfile) + if ($res === true) { + foreach ($zipFiles as $cfile) { $zip->addFile($cfile, basename($cfile)); + } $zip->close(); } header("Content-Type: application/x-zip"); @@ -592,16 +700,19 @@ protected function act_downloadClipboard() { die; } - protected function act_check4Update() { - if ($this->config['denyUpdateCheck']) + protected function act_check4Update() + { + if ($this->config['denyUpdateCheck']) { return json_encode(array('version' => false)); + } // Caching HTTP request for 6 hours if (isset($this->session['checkVersion']) && isset($this->session['checkVersionTime']) && ((time() - $this->session['checkVersionTime']) < 21600) - ) + ) { return json_encode(array('version' => $this->session['checkVersion'])); + } $protocol = "http"; $host = "kcfinder.sunhater.com"; @@ -618,7 +729,8 @@ protected function act_check4Update() { preg_match($pattern, $ver) // HTTP extension - ) {} elseif ( + ) { + } elseif ( function_exists("http_get") && (false !== ($ver = @http_get($url))) && ( @@ -630,48 +742,55 @@ function_exists("http_get") && preg_match($pattern, $ver) // Curl extension - ) {} elseif ( + ) { + } elseif ( function_exists("curl_init") && - (false !== ( $curl = @curl_init($url) )) && - ( @ob_start() || (@curl_close($curl) && false)) && - ( @curl_exec($curl) || (@curl_close($curl) && false)) && - ((false !== ( $ver = @ob_get_clean() )) || (@curl_close($curl) && false)) && - ( @curl_close($curl) || true ) && + (false !== ($curl = @curl_init($url))) && + (@ob_start() || (@curl_close($curl) && false)) && + (@curl_exec($curl) || (@curl_close($curl) && false)) && + ((false !== ($ver = @ob_get_clean())) || (@curl_close($curl) && false)) && + (@curl_close($curl) || true) && preg_match($pattern, $ver) // Socket extension - ) {} elseif (function_exists('socket_create')) { + ) { + } elseif (function_exists('socket_create')) { $cmd = "GET $path " . strtoupper($protocol) . "/1.1\r\n" . "Host: $host\r\n" . "Connection: Close\r\n\r\n"; - if ((false !== ( $socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP) )) && - (false !== @socket_connect($socket, $host, $port) ) && - (false !== @socket_write($socket, $cmd, strlen($cmd)) ) && - (false !== ( $ver = @socket_read($socket, 2048) )) && + if ((false !== ($socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) && + (false !== @socket_connect($socket, $host, $port)) && + (false !== @socket_write($socket, $cmd, strlen($cmd))) && + (false !== ($ver = @socket_read($socket, 2048))) && preg_match($responsePattern, $ver, $match) - ) + ) { $ver = $match[2]; + } - if (isset($socket) && is_resource($socket)) + if (isset($socket) && is_resource($socket)) { @socket_close($socket); + } } if (isset($ver) && preg_match($pattern, $ver)) { $this->session['checkVersion'] = $ver; $this->session['checkVersionTime'] = time(); return json_encode(array('version' => $ver)); - } else + } else { return json_encode(array('version' => false)); + } } - protected function moveUploadFile($file, $dir) { + protected function moveUploadFile($file, $dir) + { $message = $this->checkUploadedFile($file); if ($message !== true) { - if (isset($file['tmp_name'])) + if (isset($file['tmp_name'])) { @unlink($file['tmp_name']); + } return "{$file['name']}: $message"; } @@ -684,12 +803,13 @@ protected function moveUploadFile($file, $dir) { ) { @unlink($file['tmp_name']); return "{$file['name']}: " . $this->label("Cannot move uploaded file to target folder."); - } elseif (function_exists('chmod')) + } elseif (function_exists('chmod')) { chmod($target, $this->config['filePerms']); + } - $this->modx->invokeEvent('OnFileBrowserUpload',array( + $this->modx->invokeEvent('OnFileBrowserUpload', array( 'filepath'=>realpath($dir), - 'filename'=>str_replace("/","",str_replace($dir,"",realpath($target))) + 'filename'=>str_replace("/", "", str_replace($dir, "", realpath($target))) )); $this->makeThumb($target); @@ -697,82 +817,95 @@ protected function moveUploadFile($file, $dir) { return "/" . basename($target); } - protected function sendDefaultThumb($file=null) { + protected function sendDefaultThumb($file=null) + { if ($file !== null) { $ext = file::getExtension($file); $thumb = "themes/{$this->config['theme']}/img/files/big/$ext.png"; } - if (!isset($thumb) || !file_exists($thumb)) + if (!isset($thumb) || !file_exists($thumb)) { $thumb = "themes/{$this->config['theme']}/img/files/big/..png"; + } header("Content-Type: image/png"); readfile($thumb); die; } - protected function getFiles($dir) { - $thumbDir = "{$this->config['uploadDir']}/{$this->config['thumbsDir']}/$dir"; - $dir = "{$this->config['uploadDir']}/$dir"; - $return = array(); - $files = dir::content($dir, array('types' => "file")); - if ($files === false) - return $return; - - foreach ($files as $file) { - $ext = file::getExtension($file); - $smallThumb = false; - if (in_array(strtolower($ext), array('png', 'jpg', 'gif', 'jpeg' )) ) { - $size = @getimagesize($file); - if (is_array($size) && count($size)) { - $thumb_file = "$thumbDir/" . basename($file); - if (!is_file($thumb_file) || filemtime($file) > filemtime($thumb_file)) - $this->makeThumb($file); - $smallThumb = - ($size[0] <= $this->config['thumbWidth']) && - ($size[1] <= $this->config['thumbHeight']) && - in_array($size[2], array(IMAGETYPE_GIF, IMAGETYPE_PNG, IMAGETYPE_JPEG)); - } - } - $stat = stat($file); - if ($stat === false) continue; - $name = basename($file); - $types = $this->config['types']; - $types = explode(' ',$types['images'].' '.$types['image']); - if (substr($name,0,1) == '.' && !$this->config['showHiddenFiles']) continue; - if ($this->type == 'images' && !in_array(strtolower($ext),$types)) continue; - $bigIcon = file_exists("themes/{$this->config['theme']}/img/files/big/$ext.png"); - $smallIcon = file_exists("themes/{$this->config['theme']}/img/files/small/$ext.png"); - $thumb = file_exists("$thumbDir/$name"); - $return[] = array( - 'name' => stripcslashes($name), - 'size' => $stat['size'], - 'mtime' => $stat['mtime'], - 'date' => @strftime($this->dateTimeSmall, $stat['mtime']), - 'readable' => is_readable($file), - 'writable' => file::isWritable($file), - 'bigIcon' => $bigIcon, - 'smallIcon' => $smallIcon, - 'thumb' => $thumb, - 'smallThumb' => $smallThumb - ); - } - return $return; - } - - protected function getTree($dir, $index=0) { + protected function getFiles($dir) + { + $thumbDir = "{$this->config['uploadDir']}/{$this->config['thumbsDir']}/$dir"; + $dir = "{$this->config['uploadDir']}/$dir"; + $return = array(); + $files = dir::content($dir, array('types' => "file")); + if ($files === false) { + return $return; + } + + foreach ($files as $file) { + $ext = file::getExtension($file); + $smallThumb = false; + if (in_array(strtolower($ext), array('png', 'jpg', 'gif', 'jpeg' ))) { + $size = @getimagesize($file); + if (is_array($size) && count($size)) { + $thumb_file = "$thumbDir/" . basename($file); + if (!is_file($thumb_file) || filemtime($file) > filemtime($thumb_file)) { + $this->makeThumb($file); + } + $smallThumb = + ($size[0] <= $this->config['thumbWidth']) && + ($size[1] <= $this->config['thumbHeight']) && + in_array($size[2], array(IMAGETYPE_GIF, IMAGETYPE_PNG, IMAGETYPE_JPEG)); + } + } + $stat = stat($file); + if ($stat === false) { + continue; + } + $name = basename($file); + $types = $this->config['types']; + $types = explode(' ', $types['images'] . ' ' . $types['image']); + if (substr($name, 0, 1) == '.' && !$this->config['showHiddenFiles']) { + continue; + } + if ($this->type == 'images' && !in_array(strtolower($ext), $types)) { + continue; + } + $bigIcon = file_exists("themes/{$this->config['theme']}/img/files/big/$ext.png"); + $smallIcon = file_exists("themes/{$this->config['theme']}/img/files/small/$ext.png"); + $thumb = file_exists("$thumbDir/$name"); + $return[] = array( + 'name' => stripcslashes($name), + 'size' => $stat['size'], + 'mtime' => $stat['mtime'], + 'date' => @strftime($this->dateTimeSmall, $stat['mtime']), + 'readable' => is_readable($file), + 'writable' => file::isWritable($file), + 'bigIcon' => $bigIcon, + 'smallIcon' => $smallIcon, + 'thumb' => $thumb, + 'smallThumb' => $smallThumb + ); + } + return $return; + } + + protected function getTree($dir, $index=0) + { $path = explode("/", $dir); $pdir = ""; - for ($i = 0; ($i <= $index && $i < count($path)); $i++) + for ($i = 0; ($i <= $index && $i < count($path)); $i++) { $pdir .= "/{$path[$i]}"; - if (strlen($pdir)) + } + if (strlen($pdir)) { $pdir = substr($pdir, 1); + } $fdir = "{$this->config['uploadDir']}/$pdir"; $dirs = $this->getDirs($fdir); if (is_array($dirs) && count($dirs) && ($index <= count($path) - 1)) { - foreach ($dirs as $i => $cdir) { if ($cdir['hasDirs'] && ( @@ -787,38 +920,48 @@ protected function getTree($dir, $index=0) { } } } - } else + } else { return false; + } return $dirs; } - protected function postDir($existent=true) { + protected function postDir($existent=true) + { $dir = $this->typeDir; - if (isset($this->post['dir'])) + if (isset($this->post['dir'])) { $dir .= "/" . $this->post['dir']; - if ($existent && (!is_dir($dir) || !is_readable($dir))) + } + if ($existent && (!is_dir($dir) || !is_readable($dir))) { $this->errorMsg("Inexistant or inaccessible folder."); + } return $dir; } - protected function getDir($existent=true) { + protected function getDir($existent=true) + { $dir = $this->typeDir; - if (isset($this->get['dir'])) + if (isset($this->get['dir'])) { $dir .= "/" . $this->get['dir']; - if ($existent && (!is_dir($dir) || !is_readable($dir))) + } + if ($existent && (!is_dir($dir) || !is_readable($dir))) { $this->errorMsg("Inexistant or inaccessible folder."); + } return $dir; } - protected function getDirs($dir) { + protected function getDirs($dir) + { $dirs = dir::content($dir, array('types' => "dir")); $return = array(); if (is_array($dirs)) { $writable = dir::isWritable($dir); foreach ($dirs as $cdir) { $info = $this->getDirInfo($cdir); - if ($info === false) continue; + if ($info === false) { + continue; + } $info['removable'] = $writable && $info['writable']; $return[] = $info; } @@ -826,17 +969,22 @@ protected function getDirs($dir) { return $return; } - protected function getDirInfo($dir, $removable=false) { - if ((substr(basename($dir), 0, 1) == ".") || !is_dir($dir) || !is_readable($dir)) + protected function getDirInfo($dir, $removable=false) + { + if ((substr(basename($dir), 0, 1) == ".") || !is_dir($dir) || !is_readable($dir)) { return false; + } $dirs = dir::content($dir, array('types' => "dir")); if (is_array($dirs)) { - foreach ($dirs as $key => $cdir) - if (substr(basename($cdir), 0, 1) == ".") + foreach ($dirs as $key => $cdir) { + if (substr(basename($cdir), 0, 1) == ".") { unset($dirs[$key]); + } + } $hasDirs = count($dirs) ? true : false; - } else + } else { $hasDirs = false; + } $writable = dir::isWritable($dir); $info = array( @@ -847,24 +995,31 @@ protected function getDirInfo($dir, $removable=false) { 'hasDirs' => $hasDirs ); - if ($dir == "{$this->config['uploadDir']}/{$this->session['dir']}") + if ($dir == "{$this->config['uploadDir']}/{$this->session['dir']}") { $info['current'] = true; + } return $info; } - protected function output($data=null, $template=null) { - if (!is_array($data)) $data = array(); - if ($template === null) + protected function output($data=null, $template=null) + { + if (!is_array($data)) { + $data = array(); + } + if ($template === null) { $template = $this->action; + } if (file_exists("tpl/tpl_$template.php")) { ob_start(); $eval = "unset(\$data);unset(\$template);unset(\$eval);"; $_ = $data; - foreach (array_keys($data) as $key) - if (preg_match('/^[a-z\d_]+$/i', $key)) + foreach (array_keys($data) as $key) { + if (preg_match('/^[a-z\d_]+$/i', $key)) { $eval .= "\$$key=\$_['$key'];"; + } + } $eval .= "unset(\$_);require \"tpl/tpl_$template.php\";"; eval($eval); return ob_get_clean(); @@ -873,12 +1028,14 @@ protected function output($data=null, $template=null) { return ""; } - protected function errorMsg($message, array $data=null) { - if (in_array($this->action, array("thumb", "upload", "download", "downloadDir"))) + protected function errorMsg($message, array $data=null) + { + if (in_array($this->action, array("thumb", "upload", "download", "downloadDir"))) { die($this->label($message, $data)); - if (($this->action === null) || ($this->action == "browser")) + } + if (($this->action === null) || ($this->action == "browser")) { $this->backMsg($message, $data); - else { + } else { $message = $this->label($message, $data); die(json_encode(array('error' => $message))); } diff --git a/manager/media/browser/mcpuk/core/types/type_img.php b/manager/media/browser/mcpuk/core/types/type_img.php index 158e81b21a..15a7feda94 100755 --- a/manager/media/browser/mcpuk/core/types/type_img.php +++ b/manager/media/browser/mcpuk/core/types/type_img.php @@ -12,17 +12,18 @@ * @link http://kcfinder.sunhater.com */ -class type_img { - - public function checkFile($file, array $config) { - +class type_img +{ + public function checkFile($file, array $config) + { $driver = isset($config['imageDriversPriority']) ? image::getDriver(explode(" ", $config['imageDriversPriority'])) : "gd"; $img = image::factory($driver, $file); - if ($img->initError) + if ($img->initError) { return "Unknown image format/encoding."; + } return true; } diff --git a/manager/media/browser/mcpuk/core/types/type_mime.php b/manager/media/browser/mcpuk/core/types/type_mime.php index ec4a2eaa5c..b11f826ded 100755 --- a/manager/media/browser/mcpuk/core/types/type_mime.php +++ b/manager/media/browser/mcpuk/core/types/type_mime.php @@ -12,20 +12,24 @@ * @link http://kcfinder.sunhater.com */ -class type_mime { - - public function checkFile($file, array $config) { - if (!class_exists("finfo")) +class type_mime +{ + public function checkFile($file, array $config) + { + if (!class_exists("finfo")) { return "Fileinfo PECL extension is missing."; + } - if (!isset($config['params'])) + if (!isset($config['params'])) { return "Undefined MIME types."; + } $finfo = strlen($config['mime_magic']) ? new finfo(FILEINFO_MIME, $config['mime_magic']) : new finfo(FILEINFO_MIME); - if (!$finfo) + if (!$finfo) { return "Opening fileinfo database failed."; + } $type = $finfo->file($file); $type = substr($type, 0, strrpos($type, ";")); @@ -33,12 +37,12 @@ public function checkFile($file, array $config) { $mimes = $config['params']; if (substr($mimes, 0, 1) == "!") { $mimes = trim(substr($mimes, 1)); - return in_array($type , explode(" ", $mimes)) + return in_array($type, explode(" ", $mimes)) ? "You can't upload such files." : true; } - return !in_array($type , explode(" ", $mimes)) + return !in_array($type, explode(" ", $mimes)) ? "You can't upload such files." : true; } diff --git a/manager/media/browser/mcpuk/core/uploader.php b/manager/media/browser/mcpuk/core/uploader.php index 5db404e622..6e13c7b3e6 100755 --- a/manager/media/browser/mcpuk/core/uploader.php +++ b/manager/media/browser/mcpuk/core/uploader.php @@ -12,109 +12,114 @@ * @link http://kcfinder.sunhater.com */ -class uploader { +class uploader +{ /** Release version */ const VERSION = "2.54"; -/** Config session-overrided settings - * @var array */ + /** Config session-overrided settings + * @var array */ protected $config = array(); -/** Default image driver - * @var string */ + /** Default image driver + * @var string */ protected $imageDriver = "gd"; -/** Opener applocation properties - * $opener['name'] Got from $_GET['opener']; - * $opener['CKEditor']['funcNum'] CKEditor function number (got from $_GET) - * $opener['TinyMCE'] Boolean - * @var array */ + /** Opener applocation properties + * $opener['name'] Got from $_GET['opener']; + * $opener['CKEditor']['funcNum'] CKEditor function number (got from $_GET) + * $opener['TinyMCE'] Boolean + * @var array */ protected $opener = array(); -/** Got from $_GET['type'] or first one $config['types'] array key, if inexistant - * @var string */ + /** Got from $_GET['type'] or first one $config['types'] array key, if inexistant + * @var string */ protected $type; -/** Helper property. Local filesystem path to the Type Directory - * Equivalent: $config['uploadDir'] . "/" . $type - * @var string */ + /** Helper property. Local filesystem path to the Type Directory + * Equivalent: $config['uploadDir'] . "/" . $type + * @var string */ protected $typeDir; -/** Helper property. Web URL to the Type Directory - * Equivalent: $config['uploadURL'] . "/" . $type - * @var string */ + /** Helper property. Web URL to the Type Directory + * Equivalent: $config['uploadURL'] . "/" . $type + * @var string */ protected $typeURL; -/** Linked to $config['types'] - * @var array */ + /** Linked to $config['types'] + * @var array */ protected $types = array(); -/** Settings which can override default settings if exists as keys in $config['types'][$type] array - * @var array */ + /** Settings which can override default settings if exists as keys in $config['types'][$type] array + * @var array */ protected $typeSettings = array('disabled', 'theme', 'dirPerms', 'filePerms', 'denyZipDownload', 'maxImageWidth', 'maxImageHeight', 'thumbWidth', 'thumbHeight', 'jpegQuality', 'access', 'filenameChangeChars', 'dirnameChangeChars', 'denyExtensionRename', 'deniedExts', 'watermark'); -/** Got from language file - * @var string */ + /** Got from language file + * @var string */ protected $charset; -/** The language got from $_GET['lng'] or $_GET['lang'] or... Please see next property - * @var string */ + /** The language got from $_GET['lng'] or $_GET['lang'] or... Please see next property + * @var string */ protected $lang = 'en'; -/** Possible language $_GET keys - * @var array */ + /** Possible language $_GET keys + * @var array */ protected $langInputNames = array('lang', 'langCode', 'lng', 'language', 'lang_code'); -/** Uploaded file(s) info. Linked to first $_FILES element - * @var array */ + /** Uploaded file(s) info. Linked to first $_FILES element + * @var array */ protected $file; -/** Next three properties are got from the current language file - * @var string */ + /** Next three properties are got from the current language file + * @var string */ protected $dateTimeFull; // Currently not used protected $dateTimeMid; // Currently not used protected $dateTimeSmall; -/** Contain Specified language labels - * @var array */ + /** Contain Specified language labels + * @var array */ protected $labels = array(); -/** Contain unprocessed $_GET array. Please use this instead of $_GET - * @var array */ + /** Contain unprocessed $_GET array. Please use this instead of $_GET + * @var array */ protected $get; -/** Contain unprocessed $_POST array. Please use this instead of $_POST - * @var array */ + /** Contain unprocessed $_POST array. Please use this instead of $_POST + * @var array */ protected $post; -/** Contain unprocessed $_COOKIE array. Please use this instead of $_COOKIE - * @var array */ + /** Contain unprocessed $_COOKIE array. Please use this instead of $_COOKIE + * @var array */ protected $cookie; -/** Session array. Please use this property instead of $_SESSION - * @var array */ + /** Session array. Please use this property instead of $_SESSION + * @var array */ protected $session; -/** CMS integration attribute (got from $_GET['cms']) - * @var string */ + /** CMS integration attribute (got from $_GET['cms']) + * @var string */ protected $cms = ""; protected $modx = null; -/** Magic method which allows read-only access to protected or private class properties - * @param string $property - * @return mixed */ - public function __get($property) { + /** Magic method which allows read-only access to protected or private class properties + * @param string $property + * @return mixed */ + public function __get($property) + { return property_exists($this, $property) ? $this->$property : null; } - public function __construct($modx) { + public function __construct($modx) + { //MODX try { if ($modx instanceof DocumentParser) { $this->modx = $modx; - } else throw new Exception('MODX should be instance of DocumentParser'); + } else { + throw new Exception('MODX should be instance of DocumentParser'); + } } catch (Exception $e) { die($e->getMessage()); } @@ -129,26 +134,33 @@ public function __construct($modx) { // SET CMS INTEGRATION ATTRIBUTE if (isset($this->get['cms']) && in_array($this->get['cms'], array("drupal")) - ) + ) { $this->cms = $this->get['cms']; + } - // LINKING UPLOADED FILE - if (count($_FILES)) + // LINKING UPLOADED FILE + if (count($_FILES)) { $this->file = &$_FILES[key($_FILES)]; + } // LOAD DEFAULT CONFIGURATION require "config.php"; // SETTING UP SESSION - if (isset($_CONFIG['_sessionLifetime'])) + if (isset($_CONFIG['_sessionLifetime'])) { ini_set('session.gc_maxlifetime', $_CONFIG['_sessionLifetime'] * 60); - if (isset($_CONFIG['_sessionDir'])) + } + if (isset($_CONFIG['_sessionDir'])) { ini_set('session.save_path', $_CONFIG['_sessionDir']); - if (isset($_CONFIG['_sessionDomain'])) + } + if (isset($_CONFIG['_sessionDomain'])) { ini_set('session.cookie_domain', $_CONFIG['_sessionDomain']); + } switch ($this->cms) { case "drupal": break; - default: if (!session_id()) session_start(); break; + default: if (!session_id()) { + session_start(); + } break; } // RELOAD DEFAULT CONFIGURATION @@ -159,31 +171,38 @@ public function __construct($modx) { if (isset($_CONFIG['_sessionVar']) && is_array($_CONFIG['_sessionVar']) ) { - foreach ($_CONFIG['_sessionVar'] as $key => $val) - if ((substr($key, 0, 1) != "_") && isset($_CONFIG[$key])) + foreach ($_CONFIG['_sessionVar'] as $key => $val) { + if ((substr($key, 0, 1) != "_") && isset($_CONFIG[$key])) { $this->config[$key] = $val; - if (!isset($this->config['_sessionVar']['self'])) + } + } + if (!isset($this->config['_sessionVar']['self'])) { $this->config['_sessionVar']['self'] = array(); + } $this->session = &$this->config['_sessionVar']['self']; - } else + } else { $this->session = &$_SESSION; + } // IMAGE DRIVER INIT if (isset($this->config['imageDriversPriority'])) { $this->config['imageDriversPriority'] = text::clearWhitespaces($this->config['imageDriversPriority']); $driver = image::getDriver(explode(' ', $this->config['imageDriversPriority'])); - if ($driver !== false) + if ($driver !== false) { $this->imageDriver = $driver; + } } if ((!isset($driver) || ($driver === false)) && (image::getDriver(array($this->imageDriver)) === false) - ) + ) { die("Cannot find any of the supported PHP image extensions!"); + } // WATERMARK INIT - if (isset($this->config['watermark']) && is_string($this->config['watermark'])) + if (isset($this->config['watermark']) && is_string($this->config['watermark'])) { $this->config['watermark'] = array('file' => $this->config['watermark']); + } // GET TYPE DIRECTORY $this->types = &$this->config['types']; @@ -197,9 +216,11 @@ public function __construct($modx) { // LOAD TYPE DIRECTORY SPECIFIC CONFIGURATION IF EXISTS if (is_array($this->types[$this->type])) { - foreach ($this->types[$this->type] as $key => $val) - if (in_array($key, $this->typeSettings)) + foreach ($this->types[$this->type] as $key => $val) { + if (in_array($key, $this->typeSettings)) { $this->config[$key] = $val; + } + } $this->types[$this->type] = isset($this->types[$this->type]['type']) ? $this->types[$this->type]['type'] : ""; } @@ -209,12 +230,14 @@ public function __construct($modx) { $ip = '/^' . implode('\.', array($ip, $ip, $ip, $ip)) . '$/'; if (preg_match($ip, $_SERVER['HTTP_HOST']) || preg_match('/^[^\.]+$/', $_SERVER['HTTP_HOST']) - ) + ) { $this->config['cookieDomain'] = ""; - elseif (!strlen($this->config['cookieDomain'])) + } elseif (!strlen($this->config['cookieDomain'])) { $this->config['cookieDomain'] = $_SERVER['HTTP_HOST']; - if (!strlen($this->config['cookiePath'])) + } + if (!strlen($this->config['cookiePath'])) { $this->config['cookiePath'] = "/"; + } // UPLOAD FOLDER INIT @@ -228,8 +251,8 @@ public function __construct($modx) { $this->config['uploadDir'] = strlen($this->config['uploadDir']) ? path::normalize($this->config['uploadDir']) : path::url2fullPath("/$path"); - $this->typeDir = "{$this->config['uploadDir']}/{$this->type}"; - $this->typeURL = "{$this->config['siteURL']}/{$this->config['uploadURL']}/{$this->type}"; + $this->typeDir = "{$this->config['uploadDir']}/{$this->type}"; + $this->typeURL = "{$this->config['siteURL']}/{$this->config['uploadURL']}/{$this->type}"; // SITE ROOT } elseif ($this->config['uploadURL'] == "/") { @@ -250,21 +273,24 @@ public function __construct($modx) { $this->typeDir = "{$this->config['uploadDir']}/{$this->type}"; $this->typeURL = "{$this->config['uploadURL']}/{$this->type}"; } - if (!is_dir($this->config['uploadDir'])) + if (!is_dir($this->config['uploadDir'])) { @mkdir($this->config['uploadDir'], $this->config['dirPerms']); + } // HOST APPLICATIONS INIT - if (isset($this->get['CKEditorFuncNum'])) + if (isset($this->get['CKEditorFuncNum'])) { $this->opener['CKEditor']['funcNum'] = $this->get['CKEditorFuncNum']; + } if (isset($this->get['opener']) && (strtolower($this->get['opener']) == "tinymce") && isset($this->config['_tinyMCEPath']) && strlen($this->config['_tinyMCEPath']) - ) + ) { $this->opener['TinyMCE'] = true; + } // LOCALIZATION - foreach ($this->langInputNames as $key) + foreach ($this->langInputNames as $key) { if (isset($this->get[$key]) && preg_match('/^[a-z][a-z\._\-]*$/i', $this->get[$key]) && file_exists("lang/" . strtolower($this->get[$key]) . ".php") @@ -272,6 +298,7 @@ public function __construct($modx) { $this->lang = $this->get[$key]; break; } + } $this->localize($this->lang); // CHECK & MAKE DEFAULT .htaccess @@ -280,33 +307,40 @@ public function __construct($modx) { ) { $htaccess = "{$this->config['uploadDir']}/.htaccess"; if (!file_exists($htaccess)) { - if (!@file_put_contents($htaccess, $this->get_htaccess())) + if (!@file_put_contents($htaccess, $this->get_htaccess())) { $this->backMsg("Cannot write to upload folder. {$this->config['uploadDir']}"); + } } else { - if (false === ($data = @file_get_contents($htaccess))) + if (false === ($data = @file_get_contents($htaccess))) { $this->backMsg("Cannot read .htaccess"); - if (($data != $this->get_htaccess()) && !@file_put_contents($htaccess, $data)) + } + if (($data != $this->get_htaccess()) && !@file_put_contents($htaccess, $data)) { $this->backMsg("Incorrect .htaccess file. Cannot rewrite it!"); + } } } // CHECK & CREATE UPLOAD FOLDER if (!is_dir($this->typeDir)) { - if (!mkdir($this->typeDir, $this->config['dirPerms'])) + if (!mkdir($this->typeDir, $this->config['dirPerms'])) { $this->backMsg("Cannot create {dir} folder.", array('dir' => $this->type)); - } elseif (!is_readable($this->typeDir)) + } + } elseif (!is_readable($this->typeDir)) { $this->backMsg("Cannot read upload folder."); + } } - public function upload() { + public function upload() + { $config = &$this->config; $file = &$this->file; $url = $message = ""; if ($config['disabled'] || !$config['access']['files']['upload']) { - if (isset($file['tmp_name'])) @unlink($file['tmp_name']); + if (isset($file['tmp_name'])) { + @unlink($file['tmp_name']); + } $message = $this->label("You don't have permissions to upload files."); - } elseif (true === ($message = $this->checkUploadedFile())) { $message = ""; @@ -315,9 +349,9 @@ public function upload() { (false !== ($gdir = $this->checkInputDir($this->get['dir']))) ) { $udir = path::normalize("$dir$gdir"); - if (substr($udir, 0, strlen($dir)) !== $dir) + if (substr($udir, 0, strlen($dir)) !== $dir) { $message = $this->label("Unknown error."); - else { + } else { $l = strlen($dir); $dir = "$udir/"; $udir = substr($udir, $l); @@ -325,8 +359,9 @@ public function upload() { } if (!strlen($message)) { - if (!is_dir(path::normalize($dir))) + if (!is_dir(path::normalize($dir))) { @mkdir(path::normalize($dir), $this->config['dirPerms'], true); + } $filename = $this->normalizeFilename($file['name']); $target = file::getInexistantFilename($dir . $filename); @@ -334,21 +369,25 @@ public function upload() { if (!@move_uploaded_file($file['tmp_name'], $target) && !@rename($file['tmp_name'], $target) && !@copy($file['tmp_name'], $target) - ) + ) { $message = $this->label("Cannot move uploaded file to target folder."); - else { - if (function_exists('chmod')) + } else { + if (function_exists('chmod')) { @chmod($target, $this->config['filePerms']); + } $this->makeThumb($target); $url = $this->typeURL; - if (isset($udir)) $url .= "/$udir"; + if (isset($udir)) { + $url .= "/$udir"; + } $url .= "/" . basename($target); if (preg_match('/^([a-z]+)\:\/\/([^\/^\:]+)(\:(\d+))?\/(.+)$/', $url, $patt)) { list($unused, $protocol, $domain, $unused, $port, $path) = $patt; $base = "$protocol://$domain" . (strlen($port) ? ":$port" : "") . "/"; $url = $base . path::urlPathEncode($path); - } else + } else { $url = path::urlPathEncode($url); + } } } } @@ -356,54 +395,61 @@ public function upload() { if (strlen($message) && isset($this->file['tmp_name']) && file_exists($this->file['tmp_name']) - ) + ) { @unlink($this->file['tmp_name']); + } - if (strlen($message) && method_exists($this, 'errorMsg')) + if (strlen($message) && method_exists($this, 'errorMsg')) { $this->errorMsg($message); + } $this->callBack($url, $message); } - protected function getTransaliasSettings() { - $modx = evolutionCMS(); - - // Cleaning uploaded filename? - $setting = $modx->db->select('count(*)', $modx->getFullTableName('system_settings'), 'setting_name="clean_uploaded_filename" AND setting_value=1'); - if ($modx->db->getValue($setting)>0) { - // Transalias plugin active? - $res = $modx->db->select('properties', $modx->getFullTableName('site_plugins'), 'name="TransAlias" AND disabled=0'); - if ($properties = $modx->db->getValue($res)) { - $properties = $modx->parseProperties($properties, 'TransAlias', 'plugin'); - } else { - $properties = NULL; - } - } else { - $properties = NULL; - } - return $properties; - } - - - protected function normalizeFilename($filename) { - if ($this->getTransaliasSettings()) { - $format = strrchr($filename, "."); - $filename = str_replace($format, "", $filename); - $filename = $this->modx->stripAlias($filename).$format; - } - return $filename; - } - - protected function normalizeDirname($dirname) { + protected function getTransaliasSettings() + { + $modx = evolutionCMS(); + + // Cleaning uploaded filename? + $setting = $modx->db->select('count(*)', $modx->getFullTableName('system_settings'), 'setting_name="clean_uploaded_filename" AND setting_value=1'); + if ($modx->db->getValue($setting)>0) { + // Transalias plugin active? + $res = $modx->db->select('properties', $modx->getFullTableName('site_plugins'), 'name="TransAlias" AND disabled=0'); + if ($properties = $modx->db->getValue($res)) { + $properties = $modx->parseProperties($properties, 'TransAlias', 'plugin'); + } else { + $properties = null; + } + } else { + $properties = null; + } + return $properties; + } + + + protected function normalizeFilename($filename) + { + if ($this->getTransaliasSettings()) { + $format = strrchr($filename, "."); + $filename = str_replace($format, "", $filename); + $filename = $this->modx->stripAlias($filename) . $format; + } + return $filename; + } + + protected function normalizeDirname($dirname) + { return $this->modx->stripAlias($dirname); } - protected function checkUploadedFile(array $aFile=null) { + protected function checkUploadedFile(array $aFile=null) + { $config = &$this->config; $file = ($aFile === null) ? $this->file : $aFile; - if (!is_array($file) || !isset($file['name'])) + if (!is_array($file) || !isset($file['name'])) { return $this->label("Unknown error"); + } if (is_array($file['name'])) { foreach ($file['name'] as $i => $name) { @@ -412,8 +458,9 @@ protected function checkUploadedFile(array $aFile=null) { 'tmp_name' => $file['tmp_name'][$i], 'error' => $file['error'][$i] )); - if ($return !== true) + if ($return !== true) { return "$name: $return"; + } } return true; } @@ -422,7 +469,7 @@ protected function checkUploadedFile(array $aFile=null) { $typePatt = strtolower(text::clearWhitespaces($this->types[$this->type])); // CHECK FOR UPLOAD ERRORS - if ($file['error']) + if ($file['error']) { return ($file['error'] == UPLOAD_ERR_INI_SIZE) ? $this->label("The uploaded file exceeds {size} bytes.", @@ -440,14 +487,17 @@ protected function checkUploadedFile(array $aFile=null) { $this->label("Failed to write file.") : $this->label("Unknown error.") ))))); + } // HIDDEN FILENAMES CHECK - elseif (substr($file['name'], 0, 1) == ".") + elseif (substr($file['name'], 0, 1) == ".") { return $this->label("File name shouldn't begins with '.'"); + } // EXTENSION CHECK - elseif (!$this->validateExtension($extension, $this->type)) + elseif (!$this->validateExtension($extension, $this->type)) { return $this->label("Denied file extension."); + } // SPECIAL DIRECTORY TYPES CHECK (e.g. *img) elseif (preg_match('/^\*([^ ]+)(.*)?$/s', $typePatt, $patt)) { @@ -457,70 +507,84 @@ protected function checkUploadedFile(array $aFile=null) { $type = new $class(); $cfg = $config; $cfg['filename'] = $file['name']; - if (strlen($params)) + if (strlen($params)) { $cfg['params'] = trim($params); + } $response = $type->checkFile($file['tmp_name'], $cfg); - if ($response !== true) + if ($response !== true) { return $this->label($response); - } else + } + } else { return $this->label("Non-existing directory type."); + } } // IMAGE RESIZE $img = image::factory($this->imageDriver, $file['tmp_name']); - if (!$img->initError && !$this->imageResize($img, $file['tmp_name'])) + if (!$img->initError && !$this->imageResize($img, $file['tmp_name'])) { return $this->label("The image is too big and/or cannot be resized."); + } - // CHECK FOR MODX MAX FILE SIZE - $actualfilesize=filesize($file['tmp_name']); - if (isset($this->config['maxfilesize']) && $actualfilesize > $this->config['maxfilesize']) - return $this->label("File is too big: ".$actualfilesize." Bytes. (max ".$this->config['maxfilesize']." Bytes)"); + // CHECK FOR MODX MAX FILE SIZE + $actualfilesize=filesize($file['tmp_name']); + if (isset($this->config['maxfilesize']) && $actualfilesize > $this->config['maxfilesize']) { + return $this->label("File is too big: " . $actualfilesize . " Bytes. (max " . $this->config['maxfilesize'] . " Bytes)"); + } return true; } - protected function checkInputDir($dir, $inclType=true, $existing=true) { + protected function checkInputDir($dir, $inclType=true, $existing=true) + { $dir = path::normalize($dir); - if (substr($dir, 0, 1) == "/") + if (substr($dir, 0, 1) == "/") { $dir = substr($dir, 1); + } - if ((substr($dir, 0, 1) == ".") || (substr(basename($dir), 0, 1) == ".")) + if ((substr($dir, 0, 1) == ".") || (substr(basename($dir), 0, 1) == ".")) { return false; + } if ($inclType) { $first = explode("/", $dir); $first = $first[0]; - if ($first != $this->type) + if ($first != $this->type) { return false; + } $return = $this->removeTypeFromPath($dir); } else { $return = $dir; $dir = "{$this->type}/$dir"; } - if (!$existing) + if (!$existing) { return $return; + } $path = "{$this->config['uploadDir']}/$dir"; return (is_dir($path) && is_readable($path)) ? $return : false; } - protected function validateExtension($ext, $type) { + protected function validateExtension($ext, $type) + { $ext = trim(strtolower($ext)); - if (!isset($this->types[$type])) + if (!isset($this->types[$type])) { return false; + } $exts = strtolower(text::clearWhitespaces($this->config['deniedExts'])); if (strlen($exts)) { $exts = explode(" ", $exts); - if (in_array($ext, $exts)) + if (in_array($ext, $exts)) { return false; + } } $exts = trim($this->types[$type]); - if (!strlen($exts) || substr($exts, 0, 1) == "*") + if (!strlen($exts) || substr($exts, 0, 1) == "*") { return true; + } if (substr($exts, 0, 1) == "!") { $exts = explode(" ", trim(strtolower(substr($exts, 1)))); @@ -531,26 +595,31 @@ protected function validateExtension($ext, $type) { return in_array($ext, $exts); } - protected function getTypeFromPath($path) { + protected function getTypeFromPath($path) + { return preg_match('/^([^\/]*)\/.*$/', $path, $patt) ? $patt[1] : $path; } - protected function removeTypeFromPath($path) { + protected function removeTypeFromPath($path) + { return preg_match('/^[^\/]*\/(.*)$/', $path, $patt) ? $patt[1] : ""; } - protected function imageResize($image, $file=null) { - + protected function imageResize($image, $file=null) + { if (!($image instanceof image)) { $img = image::factory($this->imageDriver, $image); - if ($img->initError) return false; + if ($img->initError) { + return false; + } $file = $image; - } elseif ($file === null) + } elseif ($file === null) { return false; - else + } else { $img = $image; + } $orientation = 1; if (function_exists("exif_read_data")) { @@ -572,19 +641,18 @@ protected function imageResize($image, $file=null) { ) ) && ($orientation == 1) - ) + ) { return true; + } // PROPORTIONAL RESIZE if ((!$this->config['maxImageWidth'] || !$this->config['maxImageHeight'])) { - if ($this->config['maxImageWidth'] && ($this->config['maxImageWidth'] < $img->width) ) { $width = $this->config['maxImageWidth']; $height = $img->getPropHeight($width); - } elseif ( $this->config['maxImageHeight'] && ($this->config['maxImageHeight'] < $img->height) @@ -593,15 +661,17 @@ protected function imageResize($image, $file=null) { $width = $img->getPropWidth($height); } - if (isset($width) && isset($height) && !$img->resize($width, $height)) + if (isset($width) && isset($height) && !$img->resize($width, $height)) { return false; + } - // RESIZE TO FIT + // RESIZE TO FIT } elseif ( $this->config['maxImageWidth'] && $this->config['maxImageHeight'] && !$img->resizeFit($this->config['maxImageWidth'], $this->config['maxImageHeight']) - ) + ) { return false; + } // AUTO FLIP AND ROTATE FROM EXIF if ((($orientation == 2) && !$img->flipHorizontal()) || @@ -611,12 +681,15 @@ protected function imageResize($image, $file=null) { (($orientation == 6) && !$img->rotate(90)) || (($orientation == 7) && (!$img->flipHorizontal() || !$img->rotate(90))) || (($orientation == 8) && !$img->rotate(270)) - ) + ) { return false; - if (($orientation >= 2) && ($orientation <= 8) && ($this->imageDriver == "imagick")) + } + if (($orientation >= 2) && ($orientation <= 8) && ($this->imageDriver == "imagick")) { try { $img->image->setImageProperty('exif:Orientation', "1"); - } catch (Exception $e) {} + } catch (Exception $e) { + } + } // WATERMARK if (isset($this->config['watermark']['file']) && @@ -627,41 +700,44 @@ protected function imageResize($image, $file=null) { $top = isset($this->config['watermark']['top']) ? $this->config['watermark']['top'] : false; $img->watermark($this->config['watermark']['file'], $left, $top); - } + } $options = array( 'file' => $file ); - $type = exif_imagetype( $file ); + $type = exif_imagetype($file); - switch ( $type ) { + switch ($type) { case IMAGETYPE_GIF: - return $img->output( 'gif', $options ); + return $img->output('gif', $options); case IMAGETYPE_PNG: - return $img->output( 'png', $options ); + return $img->output('png', $options); default: - return $img->output( 'jpeg', array_merge( $options, array( 'quality' => $this->config['jpegQuality'] ) ) ); + return $img->output('jpeg', array_merge($options, array( 'quality' => $this->config['jpegQuality'] ))); } - } - protected function makeThumb($file, $overwrite=true) { + protected function makeThumb($file, $overwrite=true) + { $img = image::factory($this->imageDriver, $file); // Drop files which are not images - if ($img->initError) + if ($img->initError) { return true; + } $thumb = substr($file, strlen($this->config['uploadDir'])); $thumb = $this->config['uploadDir'] . "/" . $this->config['thumbsDir'] . "/" . $thumb; $thumb = path::normalize($thumb); $thumbDir = dirname($thumb); - if (!is_dir($thumbDir) && !@mkdir($thumbDir, $this->config['dirPerms'], true)) + if (!is_dir($thumbDir) && !@mkdir($thumbDir, $this->config['dirPerms'], true)) { return false; + } - if (!$overwrite && is_file($thumb)) + if (!$overwrite && is_file($thumb)) { return true; + } // Images with smaller resolutions than thumbnails /*if (($img->width <= $this->config['thumbWidth']) && @@ -674,18 +750,19 @@ protected function makeThumb($file, $overwrite=true) { // Resize image } else */ - if (!$img->resizeFit($this->config['thumbWidth'], $this->config['thumbHeight'])) + if (!$img->resizeFit($this->config['thumbWidth'], $this->config['thumbHeight'])) { return false; + } - if ( $this->imageDriver == 'gd' ) { - $width = imagesx( $img->image ); - $height = imagesy( $img->image ); - $back = image::factory( $this->imageDriver, array( $width, $height ) ); - $tile = image::factory( $this->imageDriver, __DIR__ . '/../themes/' . $this->config['theme'] . '/img/bg_transparent.png' ); + if ($this->imageDriver == 'gd') { + $width = imagesx($img->image); + $height = imagesy($img->image); + $back = image::factory($this->imageDriver, array( $width, $height )); + $tile = image::factory($this->imageDriver, __DIR__ . '/../themes/' . $this->config['theme'] . '/img/bg_transparent.png'); - imagesettile( $back->image, $tile->image ); - imagefilledrectangle( $back->image, 0, 0, $width, $height, IMG_COLOR_TILED ); - imagecopy( $back->image, $img->image, 0, 0, 0, 0, $width, $height ); + imagesettile($back->image, $tile->image); + imagefilledrectangle($back->image, 0, 0, $width, $height, IMG_COLOR_TILED); + imagecopy($back->image, $img->image, 0, 0, 0, 0, $width, $height); $img = $back; } @@ -697,7 +774,8 @@ protected function makeThumb($file, $overwrite=true) { )); } - protected function localize($langCode) { + protected function localize($langCode) + { require "lang/{$langCode}.php"; setlocale(LC_ALL, $lang['_locale']); $this->charset = $lang['_charset']; @@ -712,30 +790,36 @@ protected function localize($langCode) { $this->labels = $lang; } - protected function label($string, array $data=null) { + protected function label($string, array $data=null) + { $return = isset($this->labels[$string]) ? $this->labels[$string] : $string; - if (is_array($data)) - foreach ($data as $key => $val) + if (is_array($data)) { + foreach ($data as $key => $val) { $return = str_replace("{{$key}}", $val, $return); + } + } return $return; } - protected function backMsg($message, array $data=null) { + protected function backMsg($message, array $data=null) + { $message = $this->label($message, $data); - if (isset($this->file['tmp_name']) && file_exists($this->file['tmp_name'])) + if (isset($this->file['tmp_name']) && file_exists($this->file['tmp_name'])) { @unlink($this->file['tmp_name']); + } $this->callBack("", $message); die; } - protected function callBack($url, $message="") { + protected function callBack($url, $message="") + { $message = text::jsValue($message); $CKfuncNum = isset($this->opener['CKEditor']['funcNum']) ? $this->opener['CKEditor']['funcNum'] : 0; - if (!$CKfuncNum) $CKfuncNum = 0; - header("Content-Type: text/html; charset={$this->charset}"); - -?> + if (!$CKfuncNum) { + $CKfuncNum = 0; + } + header("Content-Type: text/html; charset={$this->charset}"); ?> php_value engine off diff --git a/manager/media/browser/mcpuk/css.php b/manager/media/browser/mcpuk/css.php index 225f918e48..6e441b0eee 100755 --- a/manager/media/browser/mcpuk/css.php +++ b/manager/media/browser/mcpuk/css.php @@ -14,7 +14,9 @@ require "core/autoload.php"; $mtime = @filemtime(__FILE__); -if ($mtime) httpCache::checkMTime($mtime); +if ($mtime) { + httpCache::checkMTime($mtime); +} $browser = new browser($modx); $config = $browser->config; ob_start(); @@ -254,4 +256,4 @@ } $mtime)) + if (!isset($mtime) || ($fmtime > $mtime)) { $mtime = $fmtime; + } } httpCache::checkMTime($mtime); header("Content-Type: text/javascript"); -foreach ($files as $file) +foreach ($files as $file) { require $file; +} diff --git a/manager/media/browser/mcpuk/js_localize.php b/manager/media/browser/mcpuk/js_localize.php index 1fb386cd96..5aff27a157 100755 --- a/manager/media/browser/mcpuk/js_localize.php +++ b/manager/media/browser/mcpuk/js_localize.php @@ -28,9 +28,13 @@ die; } $mtime = @filemtime($file); -if ($mtime) httpCache::checkMTime($mtime); +if ($mtime) { + httpCache::checkMTime($mtime); +} require $file; header("Content-Type: text/javascript; charset={$lang['_charset']}"); -foreach ($lang as $english => $native) - if (substr($english, 0, 1) != "_") +foreach ($lang as $english => $native) { + if (substr($english, 0, 1) != "_") { echo "browser.labels['" . text::jsValue($english) . "']=\"" . text::jsValue($native) . "\";"; + } +} diff --git a/manager/media/browser/mcpuk/lang/af.php b/manager/media/browser/mcpuk/lang/af.php index 1eccc0add2..a5e5823887 100755 --- a/manager/media/browser/mcpuk/lang/af.php +++ b/manager/media/browser/mcpuk/lang/af.php @@ -241,5 +241,3 @@ "Select Thumbnails" => "Kies duimnaels", "Download files" => "Laai lêers af", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/bg.php b/manager/media/browser/mcpuk/lang/bg.php index c1a3ee387d..ba72a1d852 100755 --- a/manager/media/browser/mcpuk/lang/bg.php +++ b/manager/media/browser/mcpuk/lang/bg.php @@ -258,5 +258,3 @@ "Failed to upload {filename}!" => "Несполучливо качване на {filename}!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/ca.php b/manager/media/browser/mcpuk/lang/ca.php index 9e9c6c2f56..bdc414fc74 100755 --- a/manager/media/browser/mcpuk/lang/ca.php +++ b/manager/media/browser/mcpuk/lang/ca.php @@ -124,5 +124,3 @@ "Uploading file {number} of {count}... {progress}" => "Carregant arxiu {number} de {count}... {progress}", "Failed to upload {filename}!" => "Error al carregar {filename}", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/cs.php b/manager/media/browser/mcpuk/lang/cs.php index 8cd858cbe6..5167dfe041 100755 --- a/manager/media/browser/mcpuk/lang/cs.php +++ b/manager/media/browser/mcpuk/lang/cs.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "Nahrávám soubor {number} z {count}... {progress}", "Failed to upload {filename}!" => "Nepodařilo se nahrát soubor {filename}!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/da.php b/manager/media/browser/mcpuk/lang/da.php index c9ad9e5c9b..843bde90a3 100755 --- a/manager/media/browser/mcpuk/lang/da.php +++ b/manager/media/browser/mcpuk/lang/da.php @@ -12,7 +12,7 @@ '_dateTimeMid' => "%a %e %b %Y %H:%M", '_dateTimeSmall' => "%d/%m/%Y %H:%M", - "You don't have permissions to upload files." => + "You don't have permissions to upload files." => "Du har ikke tilladelser til at uploade filer.", "You don't have permissions to browse server." => @@ -238,5 +238,3 @@ "Select Thumbnails" => "V�lg Miniaturer", "Download files" => "Download filer", ); - -?> diff --git a/manager/media/browser/mcpuk/lang/de.php b/manager/media/browser/mcpuk/lang/de.php index 7318de10a2..2b6952e298 100755 --- a/manager/media/browser/mcpuk/lang/de.php +++ b/manager/media/browser/mcpuk/lang/de.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "Lade Datei {number} von {count} hinauf ... {progress}", "Failed to upload {filename}!" => "Upload von {filename} fehlgeschlagen!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/el.php b/manager/media/browser/mcpuk/lang/el.php index c8eb9ab6ae..375b48a1f8 100755 --- a/manager/media/browser/mcpuk/lang/el.php +++ b/manager/media/browser/mcpuk/lang/el.php @@ -249,5 +249,3 @@ "Yes" => "Ναι", "No" => "Όχι", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/en.php b/manager/media/browser/mcpuk/lang/en.php index ba12dcf369..e6c1dedfb2 100755 --- a/manager/media/browser/mcpuk/lang/en.php +++ b/manager/media/browser/mcpuk/lang/en.php @@ -21,5 +21,3 @@ '_dateTimeMid' => "%a %b %e %Y %I:%M %p", '_dateTimeSmall' => "%m/%d/%Y %I:%M %p", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/es.php b/manager/media/browser/mcpuk/lang/es.php index a86f22efc3..311c4a6cf4 100755 --- a/manager/media/browser/mcpuk/lang/es.php +++ b/manager/media/browser/mcpuk/lang/es.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "Cargando archivo {number} de {count}... {progress}", "Failed to upload {filename}!" => "¡No se pudo cargar el archivo {filename}!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/et.php b/manager/media/browser/mcpuk/lang/et.php index 3553b16b7e..59e450c9f1 100755 --- a/manager/media/browser/mcpuk/lang/et.php +++ b/manager/media/browser/mcpuk/lang/et.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "Laen üles faili {number} {count}-st... {progress}", "Failed to upload {filename}!" => "{filename} üleslaadimine ebaõnnestus!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/fa.php b/manager/media/browser/mcpuk/lang/fa.php index 09481e590b..6b39dddad5 100755 --- a/manager/media/browser/mcpuk/lang/fa.php +++ b/manager/media/browser/mcpuk/lang/fa.php @@ -263,5 +263,3 @@ "Failed to upload {filename}!" => "! {filename} خطا در ارسال" ); - -?> diff --git a/manager/media/browser/mcpuk/lang/fi.php b/manager/media/browser/mcpuk/lang/fi.php index ab17048a50..48907be9b7 100755 --- a/manager/media/browser/mcpuk/lang/fi.php +++ b/manager/media/browser/mcpuk/lang/fi.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "Siirretään tiedostoa {number}/{count} ... {progress}", "Failed to upload {filename}!" => "Siirto epäonnistui {filename}!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/fr.php b/manager/media/browser/mcpuk/lang/fr.php index ac33d22d14..56104ad5f8 100755 --- a/manager/media/browser/mcpuk/lang/fr.php +++ b/manager/media/browser/mcpuk/lang/fr.php @@ -124,5 +124,3 @@ "Uploading file {number} of {count}... {progress}" => "Envoi du fichier {number} sur {count}... {progress}", "Failed to upload {filename}!" => "Échec du téléchargement du fichier {filename} !", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/he.php b/manager/media/browser/mcpuk/lang/he.php index 56b31a23d0..7f680ac5b8 100755 --- a/manager/media/browser/mcpuk/lang/he.php +++ b/manager/media/browser/mcpuk/lang/he.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "מעלה קובץ {number} מתוך {count}... {progress}", "Failed to upload {filename}!" => "העלאת הקובץ נכשלה!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/hu.php b/manager/media/browser/mcpuk/lang/hu.php index 3539f4a5b4..e90afe939b 100755 --- a/manager/media/browser/mcpuk/lang/hu.php +++ b/manager/media/browser/mcpuk/lang/hu.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "A(z) {number}. fájl feltöltése (összesen {count}) ... {progress}", "Failed to upload {filename}!" => "Nem sikerült feltölteni a '{filename}' fájlt.", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/id.php b/manager/media/browser/mcpuk/lang/id.php index 2eebd4726d..cc54698900 100755 --- a/manager/media/browser/mcpuk/lang/id.php +++ b/manager/media/browser/mcpuk/lang/id.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "Mengunggah file {nomor} of {jumlah}... {progress)", "Failed to upload {filename}!" => "Gagal untuk mengunggah {nama file}", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/it.php b/manager/media/browser/mcpuk/lang/it.php index 557e5b9d02..bb7bd2090d 100755 --- a/manager/media/browser/mcpuk/lang/it.php +++ b/manager/media/browser/mcpuk/lang/it.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "Caricmento del file {number} di {count}... {progress}", "Failed to upload {filename}!" => "Il caricamento del file {filename} è fallito ", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/ja.php b/manager/media/browser/mcpuk/lang/ja.php index 19b7d79535..4ec58a2f88 100755 --- a/manager/media/browser/mcpuk/lang/ja.php +++ b/manager/media/browser/mcpuk/lang/ja.php @@ -128,5 +128,3 @@ "Uploading file {number} of {count}... {progress}" => "ファイルをアップロード中({number}/{count})... {progress}", "Failed to upload {filename}!" => "{filename}のアップロードに失敗しました!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/lt.php b/manager/media/browser/mcpuk/lang/lt.php index 22174d27a4..0a2cad029d 100755 --- a/manager/media/browser/mcpuk/lang/lt.php +++ b/manager/media/browser/mcpuk/lang/lt.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "Įkeliamas {number} failas iš {count}... {progress}", "Failed to upload {filename}!" => "Nepavyko įkelti {filename}!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/nl.php b/manager/media/browser/mcpuk/lang/nl.php index 37d2f0854d..de72b571b8 100755 --- a/manager/media/browser/mcpuk/lang/nl.php +++ b/manager/media/browser/mcpuk/lang/nl.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "Bestand {number} van de {count} aan het uploaden... {progress}", "Failed to upload {filename}!" => "Uploaden van {filename} mislukt!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/no.php b/manager/media/browser/mcpuk/lang/no.php index 80aaf6a6ee..ae785334d6 100755 --- a/manager/media/browser/mcpuk/lang/no.php +++ b/manager/media/browser/mcpuk/lang/no.php @@ -238,5 +238,3 @@ "Select Thumbnails" => "Velg miniatyrbilde", "Download files" => "Last ned filer", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/pl.php b/manager/media/browser/mcpuk/lang/pl.php index 413b5f92c6..ed6b70a346 100755 --- a/manager/media/browser/mcpuk/lang/pl.php +++ b/manager/media/browser/mcpuk/lang/pl.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "Wysyłanie pliku nr {number} spośród {count} ... {progress}", "Failed to upload {filename}!" => "Wysyłanie pliku {filename} nie powiodło się!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/pt-br.php b/manager/media/browser/mcpuk/lang/pt-br.php index 8d6095353e..4ba0636816 100755 --- a/manager/media/browser/mcpuk/lang/pt-br.php +++ b/manager/media/browser/mcpuk/lang/pt-br.php @@ -126,5 +126,3 @@ "Uploading file {number} of {count}... {progress}" => "Enviando arquivo {number} de {count}... {progress}", "Failed to upload {filename}!" => "Falha no envio do arquivo {filename}!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/pt.php b/manager/media/browser/mcpuk/lang/pt.php index dfcd2dd677..6b35ea926d 100755 --- a/manager/media/browser/mcpuk/lang/pt.php +++ b/manager/media/browser/mcpuk/lang/pt.php @@ -239,5 +239,3 @@ "Select Thumbnails" => "Seleccionar miniaturas", "Download files" => "Sacar ficheiros", ); - -?> diff --git a/manager/media/browser/mcpuk/lang/ro.php b/manager/media/browser/mcpuk/lang/ro.php index ecbe6ac2a0..248b01263c 100755 --- a/manager/media/browser/mcpuk/lang/ro.php +++ b/manager/media/browser/mcpuk/lang/ro.php @@ -122,5 +122,3 @@ "Uploading file {number} of {count}... {progress}" => "Încărcare fișier {number} din {count}... {progress}", "Failed to upload {filename}!" => "Încărcare {filename} eșuată!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/ru.php b/manager/media/browser/mcpuk/lang/ru.php index 13c6a55865..59e4683aaf 100755 --- a/manager/media/browser/mcpuk/lang/ru.php +++ b/manager/media/browser/mcpuk/lang/ru.php @@ -124,5 +124,3 @@ "Uploading file {number} of {count}... {progress}" => "Загрузка {number} файла из {count}... {progress}", "Failed to upload {filename}!" => "Неудачная попытка загрузки {filename}!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/sk.php b/manager/media/browser/mcpuk/lang/sk.php index 330fb7fc35..85fa04103f 100755 --- a/manager/media/browser/mcpuk/lang/sk.php +++ b/manager/media/browser/mcpuk/lang/sk.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "Nahrávam súbor {number} z {count}... {progress}", "Failed to upload {filename}!" => "Nepodarilo sa nahrať súbor {filename}!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/sv.php b/manager/media/browser/mcpuk/lang/sv.php index 7a5f806a0d..7d82f9e1d9 100755 --- a/manager/media/browser/mcpuk/lang/sv.php +++ b/manager/media/browser/mcpuk/lang/sv.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "Ladda upp fil {number} av {count} ... {progress}", "Failed to upload {filename}!" => "Uppladdning misslyckad {filename}!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/tr.php b/manager/media/browser/mcpuk/lang/tr.php index b36345d6a7..e228013a14 100755 --- a/manager/media/browser/mcpuk/lang/tr.php +++ b/manager/media/browser/mcpuk/lang/tr.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "{number} / {count} dosya yükleniyor... {progress}", "Failed to upload {filename}!" => "{filename} dosyası yüklenemedi!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/uk.php b/manager/media/browser/mcpuk/lang/uk.php index 5caa120c6e..ea0c0a8242 100755 --- a/manager/media/browser/mcpuk/lang/uk.php +++ b/manager/media/browser/mcpuk/lang/uk.php @@ -1,8 +1,8 @@ "Завантаження файлу {number} з {count}... {progress}", "Failed to upload {filename}!" => "Помилка завантаження {filename}!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/vi.php b/manager/media/browser/mcpuk/lang/vi.php index 0119121cf5..30fa3e8b62 100755 --- a/manager/media/browser/mcpuk/lang/vi.php +++ b/manager/media/browser/mcpuk/lang/vi.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "Đang tải tập tin thứ {number} của {count}... {progress}", "Failed to upload {filename}!" => "Tải lên thất bại {filename}!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/zh-cn.php b/manager/media/browser/mcpuk/lang/zh-cn.php index ac68e2ea13..9aa0dc0c85 100755 --- a/manager/media/browser/mcpuk/lang/zh-cn.php +++ b/manager/media/browser/mcpuk/lang/zh-cn.php @@ -126,5 +126,3 @@ "Uploading file {number} of {count}... {progress}" => "正在上传文件{number} / {count}... {progress}", "Failed to upload {filename}!" => "上传失败{filename}!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lib/class_fastImage.php b/manager/media/browser/mcpuk/lib/class_fastImage.php index ec12ef40cc..08cf2af557 100755 --- a/manager/media/browser/mcpuk/lib/class_fastImage.php +++ b/manager/media/browser/mcpuk/lib/class_fastImage.php @@ -13,227 +13,217 @@ class fastImage { - private $strpos = 0; - private $str; - private $uri; - private $type; - private $handle; + private $strpos = 0; + private $str; + private $uri; + private $type; + private $handle; + + public function __construct($uri = null) + { + if ($uri) { + $this->load($uri); + } + } - public function __construct($uri = null) - { - if ($uri) $this->load($uri); - } + public function load($uri) + { + if ($this->handle) { + $this->close(); + } + + $this->uri = $uri; + $this->handle = fopen($uri, 'r'); + } + + + public function close() + { + if (is_resource($this->handle)) { + fclose($this->handle); + } + } + + + public function getSize() + { + $this->strpos = 0; + if ($this->getType()) { + return array_values($this->parseSize()); + } + + return false; + } + + + public function getType() + { + $this->strpos = 0; + + if (!$this->type) { + switch ($this->getChars(2)) { + case "BM": + return $this->type = 'bmp'; + case "GI": + return $this->type = 'gif'; + case chr(0xFF) . chr(0xd8): + return $this->type = 'jpeg'; + case chr(0x89) . 'P': + return $this->type = 'png'; + default: + return false; + } + } + + return $this->type; + } + + + private function parseSize() + { + $this->strpos = 0; + + switch ($this->type) { + case 'png': + return $this->parseSizeForPNG(); + case 'gif': + return $this->parseSizeForGIF(); + case 'bmp': + return $this->parseSizeForBMP(); + case 'jpeg': + return $this->parseSizeForJPEG(); + } + + return null; + } + + + private function parseSizeForPNG() + { + $chars = $this->getChars(25); + + return unpack("N*", substr($chars, 16, 8)); + } + + + private function parseSizeForGIF() + { + $chars = $this->getChars(11); + + return unpack("S*", substr($chars, 6, 4)); + } + + + private function parseSizeForBMP() + { + $chars = $this->getChars(29); + $chars = substr($chars, 14, 14); + $type = unpack('C', $chars); + + return (reset($type) == 40) ? unpack('L*', substr($chars, 4)) : unpack('L*', substr($chars, 4, 8)); + } - public function load($uri) - { - if ($this->handle) $this->close(); - - $this->uri = $uri; - $this->handle = fopen($uri, 'r'); - } - - - public function close() - { - if (is_resource($this->handle)) fclose($this->handle); - } + private function parseSizeForJPEG() + { + $state = null; + + while (true) { + switch ($state) { + default: + $this->getChars(2); + $state = 'started'; + break; - public function getSize() - { - $this->strpos = 0; - if ($this->getType()) - { - return array_values($this->parseSize()); - } - - return false; - } - - - public function getType() - { - $this->strpos = 0; - - if (!$this->type) - { - switch ($this->getChars(2)) - { - case "BM": - return $this->type = 'bmp'; - case "GI": - return $this->type = 'gif'; - case chr(0xFF).chr(0xd8): - return $this->type = 'jpeg'; - case chr(0x89).'P': - return $this->type = 'png'; - default: - return false; - } - } - - return $this->type; - } - - - private function parseSize() - { - $this->strpos = 0; - - switch ($this->type) - { - case 'png': - return $this->parseSizeForPNG(); - case 'gif': - return $this->parseSizeForGIF(); - case 'bmp': - return $this->parseSizeForBMP(); - case 'jpeg': - return $this->parseSizeForJPEG(); - } - - return null; - } - - - private function parseSizeForPNG() - { - $chars = $this->getChars(25); - - return unpack("N*", substr($chars, 16, 8)); - } - - - private function parseSizeForGIF() - { - $chars = $this->getChars(11); - - return unpack("S*", substr($chars, 6, 4)); - } - - - private function parseSizeForBMP() - { - $chars = $this->getChars(29); - $chars = substr($chars, 14, 14); - $type = unpack('C', $chars); - - return (reset($type) == 40) ? unpack('L*', substr($chars, 4)) : unpack('L*', substr($chars, 4, 8)); - } - - - private function parseSizeForJPEG() - { - $state = null; - - while (true) - { - switch ($state) - { - default: - $this->getChars(2); - $state = 'started'; - break; - - case 'started': - $b = $this->getByte(); - if ($b === false) return false; - - $state = $b == 0xFF ? 'sof' : 'started'; - break; - - case 'sof': - $b = $this->getByte(); - if (in_array($b, range(0xe0, 0xef))) - { - $state = 'skipframe'; - } - elseif (in_array($b, array_merge(range(0xC0,0xC3), range(0xC5,0xC7), range(0xC9,0xCB), range(0xCD,0xCF)))) - { - $state = 'readsize'; - } - elseif ($b == 0xFF) - { - $state = 'sof'; - } - else - { - $state = 'skipframe'; - } - break; - - case 'skipframe': - $skip = $this->readInt($this->getChars(2)) - 2; - $state = 'doskip'; - break; - - case 'doskip': - $this->getChars($skip); - $state = 'started'; - break; - - case 'readsize': - $c = $this->getChars(7); - - return array($this->readInt(substr($c, 5, 2)), $this->readInt(substr($c, 3, 2))); - } - } - } - - - private function getChars($n) - { - $response = null; - - // do we need more data? - if ($this->strpos + $n -1 >= strlen($this->str)) - { - $end = ($this->strpos + $n); - - while (strlen($this->str) < $end && $response !== false) - { - // read more from the file handle - $need = $end - ftell($this->handle); - - if ($response = fread($this->handle, $need)) - { - $this->str .= $response; - } - else - { - return false; - } - } - } - - $result = substr($this->str, $this->strpos, $n); - $this->strpos += $n; - - // we are dealing with bytes here, so force the encoding - return mb_convert_encoding($result, "8BIT"); - } - - - private function getByte() - { - $c = $this->getChars(1); - $b = unpack("C", $c); - - return reset($b); - } - - - private function readInt($str) - { - $size = unpack("C*", $str); - - return ($size[1] << 8) + $size[2]; - } - - - public function __destruct() - { - $this->close(); - } + case 'started': + $b = $this->getByte(); + if ($b === false) { + return false; + } + + $state = $b == 0xFF ? 'sof' : 'started'; + break; + + case 'sof': + $b = $this->getByte(); + if (in_array($b, range(0xe0, 0xef))) { + $state = 'skipframe'; + } elseif (in_array($b, array_merge(range(0xC0, 0xC3), range(0xC5, 0xC7), range(0xC9, 0xCB), range(0xCD, 0xCF)))) { + $state = 'readsize'; + } elseif ($b == 0xFF) { + $state = 'sof'; + } else { + $state = 'skipframe'; + } + break; + + case 'skipframe': + $skip = $this->readInt($this->getChars(2)) - 2; + $state = 'doskip'; + break; + + case 'doskip': + $this->getChars($skip); + $state = 'started'; + break; + + case 'readsize': + $c = $this->getChars(7); + + return array($this->readInt(substr($c, 5, 2)), $this->readInt(substr($c, 3, 2))); + } + } + } + + + private function getChars($n) + { + $response = null; + + // do we need more data? + if ($this->strpos + $n -1 >= strlen($this->str)) { + $end = ($this->strpos + $n); + + while (strlen($this->str) < $end && $response !== false) { + // read more from the file handle + $need = $end - ftell($this->handle); + + if ($response = fread($this->handle, $need)) { + $this->str .= $response; + } else { + return false; + } + } + } + + $result = substr($this->str, $this->strpos, $n); + $this->strpos += $n; + + // we are dealing with bytes here, so force the encoding + return mb_convert_encoding($result, "8BIT"); + } + + + private function getByte() + { + $c = $this->getChars(1); + $b = unpack("C", $c); + + return reset($b); + } + + + private function readInt($str) + { + $size = unpack("C*", $str); + + return ($size[1] << 8) + $size[2]; + } + + + public function __destruct() + { + $this->close(); + } } diff --git a/manager/media/browser/mcpuk/lib/class_gd.php b/manager/media/browser/mcpuk/lib/class_gd.php index c9ed6f04af..0b7df86033 100755 --- a/manager/media/browser/mcpuk/lib/class_gd.php +++ b/manager/media/browser/mcpuk/lib/class_gd.php @@ -12,50 +12,48 @@ * @link http://kcfinder.sunhater.com */ -class gd { +class gd +{ /** GD resource * @var resource */ protected $image; - /** Image width - * @var integer */ + /** Image width + * @var integer */ protected $width; - /** Image height - * @var integer */ + /** Image height + * @var integer */ protected $height; - /** Init error - * @var bool */ + /** Init error + * @var bool */ public $init_error = false; - /** Last builded image type constant (IMAGETYPE_XXX) - * @var integer */ + /** Last builded image type constant (IMAGETYPE_XXX) + * @var integer */ public $type; - /** Returns an array. Element 0 - GD resource. Element 1 - width. Element 2 - height. - * Returns FALSE on failure. The only one parameter $image can be an instance of this class, - * a GD resource, an array(width, height) or path to image file. - * @param mixed $image - * @return array */ - - protected function build_image($image) { + /** Returns an array. Element 0 - GD resource. Element 1 - width. Element 2 - height. + * Returns FALSE on failure. The only one parameter $image can be an instance of this class, + * a GD resource, an array(width, height) or path to image file. + * @param mixed $image + * @return array */ + protected function build_image($image) + { if ($image instanceof gd) { $width = $image->get_width(); $height = $image->get_height(); $image = $image->get_image(); - } elseif (is_resource($image) && (get_resource_type($image) == "gd")) { $width = @imagesx($image); $height = @imagesy($image); - } elseif (is_array($image)) { list($key, $width) = each($image); list($key, $height) = each($image); $image = imagecreatetruecolor($width, $height); - } elseif (false !== (list($width, $height, $type) = @getimagesize($image))) { $image = ($type == IMAGETYPE_GIF) ? @imagecreatefromgif($image) : ( @@ -66,8 +64,9 @@ protected function build_image($image) { ($type == IMAGETYPE_XBM) ? @imagecreatefromxbm($image) : false ))))); - if ($type == IMAGETYPE_PNG) + if ($type == IMAGETYPE_PNG) { imagealphablending($image, false); + } } $return = ( @@ -81,32 +80,35 @@ protected function build_image($image) { ? array($image, $width, $height) : false; - if (($return !== false) && isset($type)) + if (($return !== false) && isset($type)) { $this->type = $type; + } return $return; } - /** Parameter $image can be: - * 1. An instance of this class (copy instance). - * 2. A GD resource. - * 3. An array with two elements. First - width, second - height. Create a blank image. - * 4. A filename string. Get image form file. - * The non-required parameter $bigger_size is the bigger dimension (width or height) the image - * will be resized to. The other dimension (height or width) will be calculated autamaticaly - * @param mixed $image - * @param integer $bigger_size - * @return gd */ - - public function __construct($image, $bigger_size=null) { + /** Parameter $image can be: + * 1. An instance of this class (copy instance). + * 2. A GD resource. + * 3. An array with two elements. First - width, second - height. Create a blank image. + * 4. A filename string. Get image form file. + * The non-required parameter $bigger_size is the bigger dimension (width or height) the image + * will be resized to. The other dimension (height or width) will be calculated autamaticaly + * @param mixed $image + * @param integer $bigger_size + * @return gd */ + + public function __construct($image, $bigger_size=null) + { $this->image = $this->width = $this->height = null; $image_details = $this->build_image($image); - if ($image_details !== false) + if ($image_details !== false) { list($this->image, $this->width, $this->height) = $image_details; - else + } else { $this->init_error = true; + } if (!is_null($this->image) && !is_null($bigger_size) && @@ -115,85 +117,98 @@ public function __construct($image, $bigger_size=null) { $image = $this->image; list($width, $height) = $this->get_prop_size($bigger_size); $this->image = imagecreatetruecolor($width, $height); - imagealphablending($this->image, false); - imagesavealpha($this->image, true); + imagealphablending($this->image, false); + imagesavealpha($this->image, true); $this->width = $width; $this->height = $height; $this->imagecopyresampled($image); } } - /** Returns the GD resource - * @return resource */ + /** Returns the GD resource + * @return resource */ - public function get_image() { + public function get_image() + { return $this->image; } - /** Returns the image width - * @return integer */ + /** Returns the image width + * @return integer */ - public function get_width() { + public function get_width() + { return $this->width; } - /** Returns the image height - * @return integer */ + /** Returns the image height + * @return integer */ - public function get_height() { + public function get_height() + { return $this->height; } - /** Returns calculated proportional width from the given height - * @param integer $resized_height - * @return integer */ + /** Returns calculated proportional width from the given height + * @param integer $resized_height + * @return integer */ - public function get_prop_width($resized_height) { + public function get_prop_width($resized_height) + { $width = intval(($this->width * $resized_height) / $this->height); - if (!$width) $width = 1; + if (!$width) { + $width = 1; + } return $width; } - /** Returns calculated proportional height from the given width - * @param integer $resized_width - * @return integer */ + /** Returns calculated proportional height from the given width + * @param integer $resized_width + * @return integer */ - public function get_prop_height($resized_width) { + public function get_prop_height($resized_width) + { $height = intval(($this->height * $resized_width) / $this->width); - if (!$height) $height = 1; + if (!$height) { + $height = 1; + } return $height; } - /** Returns an array with calculated proportional width & height. - * The parameter $bigger_size is the bigger dimension (width or height) of calculated sizes. - * The other dimension (height or width) will be calculated autamaticaly - * @param integer $bigger_size - * @return array */ - - public function get_prop_size($bigger_size) { + /** Returns an array with calculated proportional width & height. + * The parameter $bigger_size is the bigger dimension (width or height) of calculated sizes. + * The other dimension (height or width) will be calculated autamaticaly + * @param integer $bigger_size + * @return array */ + public function get_prop_size($bigger_size) + { if ($this->width > $this->height) { $width = $bigger_size; $height = $this->get_prop_height($width); - } elseif ($this->height > $this->width) { $height = $bigger_size; $width = $this->get_prop_width($height); - - } else + } else { $width = $height = $bigger_size; + } return array($width, $height); } - /** Resize image. Returns TRUE on success or FALSE on failure - * @param integer $width - * @param integer $height - * @return bool */ + /** Resize image. Returns TRUE on success or FALSE on failure + * @param integer $width + * @param integer $height + * @return bool */ - public function resize($width, $height) { - if (!$width) $width = 1; - if (!$height) $height = 1; + public function resize($width, $height) + { + if (!$width) { + $width = 1; + } + if (!$height) { + $height = 1; + } return ( (false !== ($img = new gd(array($width, $height)))) && $img->imagecopyresampled($this) && @@ -203,12 +218,13 @@ public function resize($width, $height) { ); } - /** Resize the given image source (GD, gd object or image file path) to fit in the own image. - * The outside ares will be cropped out. Returns TRUE on success or FALSE on failure - * @param mixed $src - * @return bool */ + /** Resize the given image source (GD, gd object or image file path) to fit in the own image. + * The outside ares will be cropped out. Returns TRUE on success or FALSE on failure + * @param mixed $src + * @return bool */ - public function resize_crop($src) { + public function resize_crop($src) + { $image_details = $this->build_image($src); if ($image_details !== false) { @@ -219,7 +235,6 @@ public function resize_crop($src) { $src_h = $src_height; $src_x = intval(($src_width - $src_w) / 2); $src_y = 0; - } else { $src_w = $src_width; $src_h = $this->get_prop_height($src_width); @@ -228,37 +243,44 @@ public function resize_crop($src) { } return imagecopyresampled($this->image, $src, 0, 0, $src_x, $src_y, $this->width, $this->height, $src_w, $src_h); - - } else + } else { return false; + } } - /** Resize image to fit in given resolution. Returns TRUE on success or FALSE on failure - * @param integer $width - * @param integer $height - * @return bool */ + /** Resize image to fit in given resolution. Returns TRUE on success or FALSE on failure + * @param integer $width + * @param integer $height + * @return bool */ - public function resize_fit($width, $height) { - if ((!$width && !$height) || (($width == $this->width) && ($height == $this->height))) + public function resize_fit($width, $height) + { + if ((!$width && !$height) || (($width == $this->width) && ($height == $this->height))) { return true; - if (!$width || (($height / $width) < ($this->height / $this->width))) + } + if (!$width || (($height / $width) < ($this->height / $this->width))) { $width = intval(($this->width * $height) / $this->height); - elseif (!$height || (($width / $height) < ($this->width / $this->height))) + } elseif (!$height || (($width / $height) < ($this->width / $this->height))) { $height = intval(($this->height * $width) / $this->width); - if (!$width) $width = 1; - if (!$height) $height = 1; + } + if (!$width) { + $width = 1; + } + if (!$height) { + $height = 1; + } return $this->resize($width, $height); } - /** Neka si predstavim vyobrazhaem pravoygylnik s razmeri $width i $height. - * Izobrazhenieto shte se preorazmeri taka che to shte izliza ot tozi pravoygylnik, - * no samo po edno (x ili y) izmerenie - * @param integer $width - * @param integer $height - * @return bool */ - - public function resize_overflow($width, $height) { + /** Neka si predstavim vyobrazhaem pravoygylnik s razmeri $width i $height. + * Izobrazhenieto shte se preorazmeri taka che to shte izliza ot tozi pravoygylnik, + * no samo po edno (x ili y) izmerenie + * @param integer $width + * @param integer $height + * @return bool */ + public function resize_overflow($width, $height) + { $big = (($this->width / $this->height) > ($width / $height)) ? ($this->width * $height) / $this->height : ($this->height * $width) / $this->width; @@ -275,7 +297,8 @@ public function resize_overflow($width, $height) { return $return; } - public function gd_color() { + public function gd_color() + { $args = func_get_args(); $expr_rgb = '/^rgb\(\s*(\d{1,3})\s*\,\s*(\d{1,3})\s*\,\s*(\d{1,3})\s*\)$/i'; @@ -283,46 +306,44 @@ public function gd_color() { $expr_hex2 = '/^\#?([0-9a-f])([0-9a-f])([0-9a-f])$/i'; $expr_byte = '/^([01]?\d?\d|2[0-4]\d|25[0-5])$/'; - if (!isset($args[0])) + if (!isset($args[0])) { return false; + } if (count($args[0]) == 3) { list($r, $g, $b) = $args[0]; - } elseif (preg_match($expr_rgb, $args[0])) { list($r, $g, $b) = explode(" ", preg_replace($expr_rgb, "$1 $2 $3", $args[0])); - } elseif (preg_match($expr_hex1, $args[0])) { list($r, $g, $b) = explode(" ", preg_replace($expr_hex1, "$1 $2 $3", $args[0])); $r = hexdec($r); $g = hexdec($g); $b = hexdec($b); - } elseif (preg_match($expr_hex2, $args[0])) { list($r, $g, $b) = explode(" ", preg_replace($expr_hex2, "$1$1 $2$2 $3$3", $args[0])); $r = hexdec($r); $g = hexdec($g); $b = hexdec($b); - } elseif ((count($args) == 3) && preg_match($expr_byte, $args[0]) && preg_match($expr_byte, $args[1]) && preg_match($expr_byte, $args[2]) ) { list($r, $g, $b) = $args; - - } else + } else { return false; + } return imagecolorallocate($this->image, $r, $g, $b); } - public function fill_color($color) { + public function fill_color($color) + { return $this->imagefilledrectangle(0, 0, $this->width - 1, $this->height - 1, $color); } -/* G D M E T H O D S */ + /* G D M E T H O D S */ public function imagecopy( $src, @@ -336,14 +357,22 @@ public function imagecopy( if ($image_details !== false) { list($src, $src_width, $src_height) = $image_details; - if (is_null($dst_w)) $dst_w = $this->width - $dst_x; - if (is_null($dst_h)) $dst_h = $this->height - $dst_y; - if (is_null($src_w)) $src_w = $src_width - $src_x; - if (is_null($src_h)) $src_h = $src_height - $src_y; + if (is_null($dst_w)) { + $dst_w = $this->width - $dst_x; + } + if (is_null($dst_h)) { + $dst_h = $this->height - $dst_y; + } + if (is_null($src_w)) { + $src_w = $src_width - $src_x; + } + if (is_null($src_h)) { + $src_h = $src_height - $src_y; + } return imagecopy($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h); - - } else + } else { return false; + } } public function imagecopyresampled( @@ -358,68 +387,88 @@ public function imagecopyresampled( if ($image_details !== false) { list($src, $src_width, $src_height) = $image_details; - if (is_null($dst_w)) $dst_w = $this->width - $dst_x; - if (is_null($dst_h)) $dst_h = $this->height - $dst_y; - if (is_null($src_w)) $src_w = $src_width - $src_x; - if (is_null($src_h)) $src_h = $src_height - $src_y; + if (is_null($dst_w)) { + $dst_w = $this->width - $dst_x; + } + if (is_null($dst_h)) { + $dst_h = $this->height - $dst_y; + } + if (is_null($src_w)) { + $src_w = $src_width - $src_x; + } + if (is_null($src_h)) { + $src_h = $src_height - $src_y; + } imagealphablending($this->image, false); - imagesavealpha($this->image,true); - + imagesavealpha($this->image, true); - /*** gif transparent fix - 1.10.2013 ***/ - $transindex = imagecolortransparent($src); - $palletsize = imagecolorstotal($src); - if($transindex >= 0 && $transindex < $palletsize) { - $transcol = imagecolorsforindex($src, $transindex); + /*** gif transparent fix - 1.10.2013 ***/ - /*** end gif transparent fix ***/ + $transindex = imagecolortransparent($src); + $palletsize = imagecolorstotal($src); + if ($transindex >= 0 && $transindex < $palletsize) { + $transcol = imagecolorsforindex($src, $transindex); - $transindex = imagecolorallocatealpha($this->image, $transcol['red'], $transcol['green'], $transcol['blue'], 127); - imagefilledrectangle($this->image, 0, 0, $dst_w, $dst_h, $transindex); - imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); - imagecolortransparent($this->image, $transindex); - for($y=0; $y<$dst_h; ++$y) - for($x=0; $x<$dst_w; ++$x) - if(((imagecolorat($this->image, $x, $y)>>24) & 0x7F) >= 100) imagesetpixel($this->image, $x, $y, $transindex); - imagetruecolortopalette($this->image, true, 255); - } - else { - $transparent = imagecolorallocatealpha($this->image, 255, 255, 255, 127); - imagefilledrectangle($this->image, 0, 0, $dst_w, $dst_h, $transparent); - imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); - } - return $this->image; + /*** end gif transparent fix ***/ - } else + $transindex = imagecolorallocatealpha($this->image, $transcol['red'], $transcol['green'], $transcol['blue'], 127); + imagefilledrectangle($this->image, 0, 0, $dst_w, $dst_h, $transindex); + imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); + imagecolortransparent($this->image, $transindex); + for ($y=0; $y<$dst_h; ++$y) { + for ($x=0; $x<$dst_w; ++$x) { + if (((imagecolorat($this->image, $x, $y)>>24) & 0x7F) >= 100) { + imagesetpixel($this->image, $x, $y, $transindex); + } + } + } + imagetruecolortopalette($this->image, true, 255); + } else { + $transparent = imagecolorallocatealpha($this->image, 255, 255, 255, 127); + imagefilledrectangle($this->image, 0, 0, $dst_w, $dst_h, $transparent); + imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); + } + return $this->image; + } else { return false; + } } - public function imagefilledrectangle($x1, $y1, $x2, $y2, $color) { + public function imagefilledrectangle($x1, $y1, $x2, $y2, $color) + { $color = $this->gd_color($color); - if ($color === false) return false; + if ($color === false) { + return false; + } return imagefilledrectangle($this->image, $x1, $y1, $x2, $y2, $color); } - public function imagepng($filename=null, $quality=null, $filters=null) { - if (is_null($filename) && !headers_sent()) + public function imagepng($filename=null, $quality=null, $filters=null) + { + if (is_null($filename) && !headers_sent()) { header("Content-Type: image/png"); + } @imagesavealpha($this->image, true); return imagepng($this->image, $filename, $quality, $filters); } - public function imagejpeg($filename=null, $quality=75) { - if (is_null($filename) && !headers_sent()) + public function imagejpeg($filename=null, $quality=75) + { + if (is_null($filename) && !headers_sent()) { header("Content-Type: image/jpeg"); + } return imagejpeg($this->image, $filename, $quality); } - public function imagegif($filename=null) { - if (is_null($filename) && !headers_sent()) + public function imagegif($filename=null) + { + if (is_null($filename) && !headers_sent()) { header("Content-Type: image/gif"); - @imagesavealpha($this->image, true); + } + @imagesavealpha($this->image, true); return imagegif($this->image, $filename); } } diff --git a/manager/media/browser/mcpuk/lib/class_image.php b/manager/media/browser/mcpuk/lib/class_image.php index 79918a49b2..09985d7f27 100755 --- a/manager/media/browser/mcpuk/lib/class_image.php +++ b/manager/media/browser/mcpuk/lib/class_image.php @@ -12,114 +12,123 @@ * @link http://kcfinder.sunhater.com */ -abstract class image { +abstract class image +{ const DEFAULT_JPEG_QUALITY = 75; -/** Image resource or object - * @var mixed */ + /** Image resource or object + * @var mixed */ protected $image; -/** Image width in pixels - * @var integer */ + /** Image width in pixels + * @var integer */ protected $width; -/** Image height in pixels - * @var integer */ + /** Image height in pixels + * @var integer */ protected $height; -/** Init error - * @var bool */ + /** Init error + * @var bool */ protected $initError = false; -/** Driver specific options - * @var array */ + /** Driver specific options + * @var array */ protected $options = array(); -/** Magic method which allows read-only access to all protected or private - * class properties - * @param string $property - * @return mixed */ + /** Magic method which allows read-only access to all protected or private + * class properties + * @param string $property + * @return mixed */ - final public function __get($property) { + final public function __get($property) + { return property_exists($this, $property) ? $this->$property : null; } -/** Constructor. Parameter $image should be: - * 1. An instance of image driver class (copy instance). - * 2. An image represented by the type of the $image property - * (resource or object). - * 3. An array with two elements. First - width, second - height. - * Creates a blank image. - * 4. A filename string. Get image form file. - * Second paramaeter is used by pass some specific image driver options - * @param mixed $image - * @param array $options */ + /** Constructor. Parameter $image should be: + * 1. An instance of image driver class (copy instance). + * 2. An image represented by the type of the $image property + * (resource or object). + * 3. An array with two elements. First - width, second - height. + * Creates a blank image. + * 4. A filename string. Get image form file. + * Second paramaeter is used by pass some specific image driver options + * @param mixed $image + * @param array $options */ - public function __construct($image, array $options=array()) { + public function __construct($image, array $options=array()) + { $this->image = $this->width = $this->height = null; $imageDetails = $this->buildImage($image); - if ($imageDetails !== false) + if ($imageDetails !== false) { list($this->image, $this->width, $this->height) = $imageDetails; - else + } else { $this->initError = true; + } $this->options = $options; } -/** Factory pattern to load selected driver. $image and $options are passed - * to the constructor of the image driver - * @param string $driver - * @param mixed $image - * @return object */ + /** Factory pattern to load selected driver. $image and $options are passed + * to the constructor of the image driver + * @param string $driver + * @param mixed $image + * @return object */ - final static function factory($driver, $image, array $options=array()) { + final public static function factory($driver, $image, array $options=array()) + { $class = "image_$driver"; return new $class($image, $options); } -/** Checks if the drivers in the array parameter could be used. Returns first - * found one - * @param array $drivers - * @return string */ + /** Checks if the drivers in the array parameter could be used. Returns first + * found one + * @param array $drivers + * @return string */ - final static function getDriver(array $drivers=array('gd')) { + final public static function getDriver(array $drivers=array('gd')) + { foreach ($drivers as $driver) { - if (!preg_match('/^[a-z0-9\_]+$/i', $driver)) + if (!preg_match('/^[a-z0-9\_]+$/i', $driver)) { continue; + } $class = "image_$driver"; if (class_exists($class) && method_exists($class, "available")) { eval("\$avail = $class::available();"); - if ($avail) return $driver; + if ($avail) { + return $driver; + } } } return false; } -/** Returns an array. Element 0 - image resource. Element 1 - width. Element 2 - height. - * Returns FALSE on failure. - * @param mixed $image - * @return array */ + /** Returns an array. Element 0 - image resource. Element 1 - width. Element 2 - height. + * Returns FALSE on failure. + * @param mixed $image + * @return array */ - final protected function buildImage($image) { + final protected function buildImage($image) + { $class = get_class($this); if ($image instanceof $class) { $width = $image->width; $height = $image->height; $img = $image->image; - } elseif (is_array($image)) { list($key, $width) = each($image); list($key, $height) = each($image); $img = $this->getBlankImage($width, $height); - - } else + } else { $img = $this->getImage($image, $width, $height); + } return ($img !== false) ? array($img, $width, $height) @@ -127,113 +136,124 @@ final protected function buildImage($image) { } -/** Returns calculated proportional width from the given height - * @param integer $resizedHeight - * @return integer */ + /** Returns calculated proportional width from the given height + * @param integer $resizedHeight + * @return integer */ - final public function getPropWidth($resizedHeight) { + final public function getPropWidth($resizedHeight) + { $width = round(($this->width * $resizedHeight) / $this->height); - if (!$width) $width = 1; + if (!$width) { + $width = 1; + } return $width; } -/** Returns calculated proportional height from the given width - * @param integer $resizedWidth - * @return integer */ + /** Returns calculated proportional height from the given width + * @param integer $resizedWidth + * @return integer */ - final public function getPropHeight($resizedWidth) { + final public function getPropHeight($resizedWidth) + { $height = round(($this->height * $resizedWidth) / $this->width); - if (!$height) $height = 1; + if (!$height) { + $height = 1; + } return $height; } -/** Checks if PHP needs some extra extensions to use the image driver. This - * static method should be implemented into driver classes like abstract - * methods - * @return bool */ - static function available() { return false; } + /** Checks if PHP needs some extra extensions to use the image driver. This + * static method should be implemented into driver classes like abstract + * methods + * @return bool */ + public static function available() + { + return false; + } -/** Checks if file is an image. This static method should be implemented into - * driver classes like abstract methods - * @param string $file - * @return bool */ - static function checkImage($file) { return false; } + /** Checks if file is an image. This static method should be implemented into + * driver classes like abstract methods + * @param string $file + * @return bool */ + public static function checkImage($file) + { + return false; + } -/** Resize image. Should return TRUE on success or FALSE on failure - * @param integer $width - * @param integer $height - * @return bool */ + /** Resize image. Should return TRUE on success or FALSE on failure + * @param integer $width + * @param integer $height + * @return bool */ abstract public function resize($width, $height); -/** Resize image to fit in given resolution. Should returns TRUE on success - * or FALSE on failure. If $background is set, the image size will be - * $width x $height and the empty spaces (if any) will be filled with defined - * color. Background color examples: "#5f5", "#ff67ca", array(255, 255, 255) - * @param integer $width - * @param integer $height - * @param mixed $background - * @return bool */ + /** Resize image to fit in given resolution. Should returns TRUE on success + * or FALSE on failure. If $background is set, the image size will be + * $width x $height and the empty spaces (if any) will be filled with defined + * color. Background color examples: "#5f5", "#ff67ca", array(255, 255, 255) + * @param integer $width + * @param integer $height + * @param mixed $background + * @return bool */ abstract public function resizeFit($width, $height, $background=false); -/** Resize and crop the image to fit in given resolution. Returns TRUE on - * success or FALSE on failure - * @param mixed $src - * @param integer $offset - * @return bool */ + /** Resize and crop the image to fit in given resolution. Returns TRUE on + * success or FALSE on failure + * @param mixed $src + * @param integer $offset + * @return bool */ abstract public function resizeCrop($width, $height, $offset=false); -/** Rotate image - * @param integer $angle - * @param string $background - * @return bool */ + /** Rotate image + * @param integer $angle + * @param string $background + * @return bool */ abstract public function rotate($angle, $background="#000000"); abstract public function flipHorizontal(); abstract public function flipVertical(); -/** Apply a PNG or GIF watermark to the image. $top and $left parameters sets - * the offset of the watermark in pixels. Boolean and NULL values are possible - * too. In default case (FALSE, FALSE) the watermark should be applyed to - * the bottom right corner. NULL values means center aligning. If the - * watermark is bigger than the image or it's partialy or fully outside the - * image, it shoudn't be applied - * @param string $file - * @param mixed $top - * @param mixed $left - * @return bool */ + /** Apply a PNG or GIF watermark to the image. $top and $left parameters sets + * the offset of the watermark in pixels. Boolean and NULL values are possible + * too. In default case (FALSE, FALSE) the watermark should be applyed to + * the bottom right corner. NULL values means center aligning. If the + * watermark is bigger than the image or it's partialy or fully outside the + * image, it shoudn't be applied + * @param string $file + * @param mixed $top + * @param mixed $left + * @return bool */ abstract public function watermark($file, $left=false, $top=false); -/** Should output the image. Second parameter is used to pass some options like - * 'file' - if is set, the output will be written to a file - * 'quality' - compression quality - * It's possible to use extra specific options required by image type ($type) - * @param string $type - * @param array $options - * @return bool */ + /** Should output the image. Second parameter is used to pass some options like + * 'file' - if is set, the output will be written to a file + * 'quality' - compression quality + * It's possible to use extra specific options required by image type ($type) + * @param string $type + * @param array $options + * @return bool */ abstract public function output($type='jpeg', array $options=array()); -/** This method should create a blank image with selected size. Should returns - * resource or object related to the created image, which will be passed to - * $image property - * @param integer $width - * @param integer $height - * @return mixed */ + /** This method should create a blank image with selected size. Should returns + * resource or object related to the created image, which will be passed to + * $image property + * @param integer $width + * @param integer $height + * @return mixed */ abstract protected function getBlankImage($width, $height); -/** This method should create an image from source image. Only first parameter - * ($image) is input. Its type should be filename string or a type of the - * $image property. See the constructor reference for details. The - * parametters $width and $height are output only. Should returns resource or - * object related to the created image, which will be passed to $image - * property - * @param mixed $image - * @param integer $width - * @param integer $height - * @return mixed */ + /** This method should create an image from source image. Only first parameter + * ($image) is input. Its type should be filename string or a type of the + * $image property. See the constructor reference for details. The + * parametters $width and $height are output only. Should returns resource or + * object related to the created image, which will be passed to $image + * property + * @param mixed $image + * @param integer $width + * @param integer $height + * @return mixed */ abstract protected function getImage($image, &$width, &$height); - } diff --git a/manager/media/browser/mcpuk/lib/class_image_gd.php b/manager/media/browser/mcpuk/lib/class_image_gd.php index c564ce8e43..55426518ea 100755 --- a/manager/media/browser/mcpuk/lib/class_image_gd.php +++ b/manager/media/browser/mcpuk/lib/class_image_gd.php @@ -12,14 +12,20 @@ * @link http://kcfinder.sunhater.com */ -class image_gd extends image { +class image_gd extends image +{ // ABSTRACT PUBLIC METHODS - public function resize($width, $height) { - if (!$width) $width = 1; - if (!$height) $height = 1; + public function resize($width, $height) + { + if (!$width) { + $width = 1; + } + if (!$height) { + $height = 1; + } return ( (false !== ($img = new image_gd(array($width, $height)))) && $img->imageCopyResampled($this) && @@ -29,9 +35,11 @@ public function resize($width, $height) { ); } - public function resizeFit($width, $height, $background=false) { - if ((!$width && !$height) || (($width == $this->width) && ($height == $this->height))) + public function resizeFit($width, $height, $background=false) + { + if ((!$width && !$height) || (($width == $this->width) && ($height == $this->height))) { return true; + } if (!$width || (($height / $width) < ($this->height / $this->width))) { $h = $height; $w = round(($this->width * $h) / $this->height); @@ -42,13 +50,16 @@ public function resizeFit($width, $height, $background=false) { $w = $width; $h = $height; } - if (!$w) $w = 1; - if (!$h) $h = 1; + if (!$w) { + $w = 1; + } + if (!$h) { + $h = 1; + } - if ($background === false) + if ($background === false) { return $this->resize($w, $h); - - else { + } else { $img = new image_gd(array($width, $height)); $x = round(($width - $w) / 2); $y = round(($height - $h) / 2); @@ -56,8 +67,9 @@ public function resizeFit($width, $height, $background=false) { if ((false === $this->resize($w, $h)) || (false === $img->imageFilledRectangle(0, 0, $width, $height, $background)) || (false === $img->imageCopyResampled($this->image, $x, $y, 0, 0, $w, $h)) - ) + ) { return false; + } $this->image = $img->image; $this->width = $width; @@ -67,41 +79,50 @@ public function resizeFit($width, $height, $background=false) { } } - public function resizeCrop($width, $height, $offset=false) { - + public function resizeCrop($width, $height, $offset=false) + { if (($this->width / $this->height) > ($width / $height)) { $h = $height; $w = ($this->width * $h) / $this->height; $y = 0; if ($offset !== false) { - if ($offset > 0) + if ($offset > 0) { $offset = -$offset; - if (($w + $offset) <= $width) + } + if (($w + $offset) <= $width) { $offset = $width - $w; + } $x = $offset; - } else + } else { $x = ($width - $w) / 2; - + } } else { $w = $width; $h = ($this->height * $w) / $this->width; $x = 0; if ($offset !== false) { - if ($offset > 0) + if ($offset > 0) { $offset = -$offset; - if (($h + $offset) <= $height) + } + if (($h + $offset) <= $height) { $offset = $height - $h; + } $y = $offset; - } else + } else { $y = ($height - $h) / 2; + } } $x = round($x); $y = round($y); $w = round($w); $h = round($h); - if (!$w) $w = 1; - if (!$h) $h = 1; + if (!$w) { + $w = 1; + } + if (!$h) { + $h = 1; + } $return = ( (false !== ($img = new image_gd(array($width, $height))))) && @@ -117,50 +138,59 @@ public function resizeCrop($width, $height, $offset=false) { return $return; } - public function rotate($angle, $background="#000000") { + public function rotate($angle, $background="#000000") + { $angle = -$angle; $img = @imagerotate($this->image, $angle, $this->gdColor($background)); - if ($img === false) + if ($img === false) { return false; + } $this->width = imagesx($img); $this->height = imagesy($img); $this->image = $img; return true; } - public function flipHorizontal() { + public function flipHorizontal() + { $img = imagecreatetruecolor($this->width, $this->height); - imagealphablending($img, false); - imagesavealpha($img, true); - if (imagecopyresampled($img, $this->image, 0, 0, ($this->width - 1), 0, $this->width, $this->height, -$this->width, $this->height)) + imagealphablending($img, false); + imagesavealpha($img, true); + if (imagecopyresampled($img, $this->image, 0, 0, ($this->width - 1), 0, $this->width, $this->height, -$this->width, $this->height)) { $this->image = $img; - else + } else { return false; + } return true; } - public function flipVertical() { + public function flipVertical() + { $img = imagecreatetruecolor($this->width, $this->height); - imagealphablending($img, false); - imagesavealpha($img, true); - if (imagecopyresampled($img, $this->image, 0, 0, 0, ($this->height - 1), $this->width, $this->height, $this->width, -$this->height)) + imagealphablending($img, false); + imagesavealpha($img, true); + if (imagecopyresampled($img, $this->image, 0, 0, 0, ($this->height - 1), $this->width, $this->height, $this->width, -$this->height)) { $this->image = $img; - else + } else { return false; + } return true; } - public function watermark($file, $left=false, $top=false) { + public function watermark($file, $left=false, $top=false) + { $info = getimagesize($file); list($w, $h, $t) = $info; - if (!in_array($t, array(IMAGETYPE_PNG, IMAGETYPE_GIF))) + if (!in_array($t, array(IMAGETYPE_PNG, IMAGETYPE_GIF))) { return false; + } $imagecreate = ($t == IMAGETYPE_PNG) ? "imagecreatefrompng" : "imagecreatefromgif"; if (!@imagealphablending($this->image, true) || (false === ($wm = @$imagecreate($file))) - ) + ) { return false; + } $w = imagesx($wm); $h = imagesy($wm); @@ -176,28 +206,33 @@ public function watermark($file, $left=false, $top=false) { if ((($x + $w) > $this->width) || (($y + $h) > $this->height) || ($x < 0) || ($y < 0) - ) + ) { return false; + } - if (($wm === false) || !@imagecopy($this->image, $wm, $x, $y, 0, 0, $w, $h)) + if (($wm === false) || !@imagecopy($this->image, $wm, $x, $y, 0, 0, $w, $h)) { return false; + } @imagealphablending($this->image, false); @imagesavealpha($this->image, true); return true; } - public function output($type='jpeg', array $options=array()) { + public function output($type='jpeg', array $options=array()) + { $method = "output_$type"; - if (!method_exists($this, $method)) + if (!method_exists($this, $method)) { return false; + } return $this->$method($options); } // ABSTRACT PROTECTED METHODS - protected function getBlankImage($width, $height) { + protected function getBlankImage($width, $height) + { $img = @imagecreatetruecolor($width, $height); // imagealphablending($img, false); // imagesavealpha($img, true); @@ -207,13 +242,12 @@ protected function getBlankImage($width, $height) { return $img; } - protected function getImage($image, &$width, &$height) { - + protected function getImage($image, &$width, &$height) + { if (is_resource($image) && (get_resource_type($image) == "gd")) { $width = @imagesx($image); $height = @imagesy($image); return $image; - } elseif (is_string($image) && (false !== (list($width, $height, $t) = @getimagesize($image))) ) { @@ -226,23 +260,26 @@ protected function getImage($image, &$width, &$height) { )))); return $image; - - } else + } else { return false; + } } // PSEUDO-ABSTRACT STATIC METHODS - static function available() { + public static function available() + { return function_exists("imagecreatefromjpeg"); } - static function checkImage($file) { + public static function checkImage($file) + { if (!is_string($file) || ((false === (list($width, $height, $t) = @getimagesize($file)))) - ) + ) { return false; + } $img = ($t == IMAGETYPE_GIF) ? @imagecreatefromgif($file) : ( @@ -258,34 +295,41 @@ static function checkImage($file) { // OWN METHODS - protected function output_png(array $options=array()) { + protected function output_png(array $options=array()) + { $file = isset($options['file']) ? $options['file'] : null; $quality = isset($options['quality']) ? $options['quality'] : null; $filters = isset($options['filters']) ? $options['filters'] : null; - if (($file === null) && !headers_sent()) + if (($file === null) && !headers_sent()) { header("Content-Type: image/png"); + } @imagesavealpha($this->image, true); return imagepng($this->image, $file, $quality, $filters); } - protected function output_jpeg(array $options=array()) { + protected function output_jpeg(array $options=array()) + { $file = isset($options['file']) ? $options['file'] : null; $quality = isset($options['quality']) ? $options['quality'] : self::DEFAULT_JPEG_QUALITY; - if (($file === null) && !headers_sent()) + if (($file === null) && !headers_sent()) { header("Content-Type: image/jpeg"); + } return imagejpeg($this->image, $file, $quality); } - protected function output_gif(array $options=array()) { + protected function output_gif(array $options=array()) + { $file = isset($options['file']) ? $options['file'] : null; - if (isset($options['file']) && !headers_sent()) + if (isset($options['file']) && !headers_sent()) { header("Content-Type: image/gif"); + } return imagegif($this->image, $file); } - protected function gdColor() { + protected function gdColor() + { $args = func_get_args(); $exprRGB = '/^rgb\(\s*(\d{1,3})\s*\,\s*(\d{1,3})\s*\,\s*(\d{1,3})\s*\)$/i'; @@ -293,43 +337,43 @@ protected function gdColor() { $exprHex2 = '/^\#?([0-9a-f])([0-9a-f])([0-9a-f])$/i'; $exprByte = '/^([01]?\d?\d|2[0-4]\d|25[0-5])$/'; - if (!isset($args[0])) + if (!isset($args[0])) { return false; + } if (count($args[0]) == 3) { list($r, $g, $b) = $args[0]; - } elseif (preg_match($exprRGB, $args[0], $match)) { list($tmp, $r, $g, $b) = $match; - } elseif (preg_match($exprHex1, $args[0], $match)) { list($tmp, $r, $g, $b) = $match; $r = hexdec($r); $g = hexdec($g); $b = hexdec($b); - } elseif (preg_match($exprHex2, $args[0], $match)) { list($tmp, $r, $g, $b) = $match; $r = hexdec("$r$r"); $g = hexdec("$g$g"); $b = hexdec("$b$b"); - } elseif ((count($args) == 3) && preg_match($exprByte, $args[0]) && preg_match($exprByte, $args[1]) && preg_match($exprByte, $args[2]) ) { list($r, $g, $b) = $args; - - } else + } else { return false; + } return imagecolorallocate($this->image, $r, $g, $b); } - protected function imageFilledRectangle($x1, $y1, $x2, $y2, $color) { + protected function imageFilledRectangle($x1, $y1, $x2, $y2, $color) + { $color = $this->gdColor($color); - if ($color === false) return false; + if ($color === false) { + return false; + } return imageFilledRectangle($this->image, $x1, $y1, $x2, $y2, $color); } @@ -338,15 +382,24 @@ protected function imageCopyResampled( ) { $imageDetails = $this->buildImage($src); - if ($imageDetails === false) + if ($imageDetails === false) { return false; + } list($src, $srcWidth, $srcHeight) = $imageDetails; - if (is_null($dstW)) $dstW = $this->width - $dstW; - if (is_null($dstH)) $dstH = $this->height - $dstY; - if (is_null($srcW)) $srcW = $srcWidth - $srcX; - if (is_null($srcH)) $srcH = $srcHeight - $srcY; + if (is_null($dstW)) { + $dstW = $this->width - $dstW; + } + if (is_null($dstH)) { + $dstH = $this->height - $dstY; + } + if (is_null($srcW)) { + $srcW = $srcWidth - $srcX; + } + if (is_null($srcH)) { + $srcH = $srcHeight - $srcY; + } return imageCopyResampled($this->image, $src, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH); } } diff --git a/manager/media/browser/mcpuk/lib/class_image_gmagick.php b/manager/media/browser/mcpuk/lib/class_image_gmagick.php index f67691f99b..c2cb3726f0 100755 --- a/manager/media/browser/mcpuk/lib/class_image_gmagick.php +++ b/manager/media/browser/mcpuk/lib/class_image_gmagick.php @@ -12,18 +12,23 @@ * @link http://kcfinder.sunhater.com */ -class image_gmagick extends image { - - static $MIMES = array( +class image_gmagick extends image +{ + public static $MIMES = array( //'tif' => "image/tiff" ); // ABSTRACT PUBLIC METHODS - public function resize($width, $height) {// - if (!$width) $width = 1; - if (!$height) $height = 1; + public function resize($width, $height) + {// + if (!$width) { + $width = 1; + } + if (!$height) { + $height = 1; + } try { $this->image->scaleImage($width, $height); } catch (Exception $e) { @@ -34,9 +39,14 @@ public function resize($width, $height) {// return true; } - public function resizeFit($width, $height, $background=false) {// - if (!$width) $width = 1; - if (!$height) $height = 1; + public function resizeFit($width, $height, $background=false) + {// + if (!$width) { + $width = 1; + } + if (!$height) { + $height = 1; + } try { $this->image->scaleImage($width, $height, true); @@ -50,7 +60,6 @@ public function resizeFit($width, $height, $background=false) {// $this->width = $w; $this->height = $h; return true; - } else { try { $this->image->setImageBackgroundColor($background); @@ -69,43 +78,57 @@ public function resizeFit($width, $height, $background=false) {// } } - public function resizeCrop($width, $height, $offset=false) { - if (!$width) $width = 1; - if (!$height) $height = 1; + public function resizeCrop($width, $height, $offset=false) + { + if (!$width) { + $width = 1; + } + if (!$height) { + $height = 1; + } if (($this->width / $this->height) > ($width / $height)) { $h = $height; $w = ($this->width * $h) / $this->height; $y = 0; if ($offset !== false) { - if ($offset > 0) + if ($offset > 0) { $offset = -$offset; - if (($w + $offset) <= $width) + } + if (($w + $offset) <= $width) { $offset = $width - $w; + } $x = $offset; - } else + } else { $x = ($width - $w) / 2; - + } } else { $w = $width; $h = ($this->height * $w) / $this->width; $x = 0; if ($offset !== false) { - if ($offset > 0) + if ($offset > 0) { $offset = -$offset; - if (($h + $offset) <= $height) + } + if (($h + $offset) <= $height) { $offset = $height - $h; + } $y = $offset; - } else + } else { $y = ($height - $h) / 2; + } } $x = round($x); $y = round($y); $w = round($w); $h = round($h); - if (!$w) $w = 1; - if (!$h) $h = 1; + if (!$w) { + $w = 1; + } + if (!$h) { + $h = 1; + } try { $this->image->scaleImage($w, $h); @@ -119,7 +142,8 @@ public function resizeCrop($width, $height, $offset=false) { return true; } - public function rotate($angle, $background="#000000") { + public function rotate($angle, $background="#000000") + { try { $this->image->rotateImage($background, $angle); $w = $this->image->getImageWidth(); @@ -132,7 +156,8 @@ public function rotate($angle, $background="#000000") { return true; } - public function flipHorizontal() { + public function flipHorizontal() + { try { $this->image->flopImage(); } catch (Exception $e) { @@ -141,7 +166,8 @@ public function flipHorizontal() { return true; } - public function flipVertical() { + public function flipVertical() + { try { $this->image->flipImage(); } catch (Exception $e) { @@ -150,7 +176,8 @@ public function flipVertical() { return true; } - public function watermark($file, $left=false, $top=false) { + public function watermark($file, $left=false, $top=false) + { try { $wm = new Gmagick($file); $w = $wm->getImageWidth(); @@ -171,8 +198,9 @@ public function watermark($file, $left=false, $top=false) { if ((($x + $w) > $this->width) || (($y + $h) > $this->height) || ($x < 0) || ($y < 0) - ) + ) { return false; + } try { $this->image->compositeImage($wm, 1, $x, $y); @@ -185,7 +213,8 @@ public function watermark($file, $left=false, $top=false) { // ABSTRACT PROTECTED METHODS - protected function getBlankImage($width, $height) { + protected function getBlankImage($width, $height) + { try { $img = new Gmagick(); $img->newImage($width, $height, "none"); @@ -195,13 +224,12 @@ protected function getBlankImage($width, $height) { return $img; } - protected function getImage($image, &$width, &$height) { - + protected function getImage($image, &$width, &$height) + { if (is_object($image) && ($image instanceof image_gmagick)) { $width = $image->width; $height = $image->height; return $image->image; - } elseif (is_object($image) && ($image instanceof Gmagick)) { try { $w = $image->getImageWidth(); @@ -212,7 +240,6 @@ protected function getImage($image, &$width, &$height) { $width = $w; $height = $h; return $image; - } elseif (is_string($image)) { try { $image = new Gmagick($image); @@ -224,19 +251,21 @@ protected function getImage($image, &$width, &$height) { $width = $w; $height = $h; return $image; - - } else + } else { return false; + } } // PSEUDO-ABSTRACT STATIC METHODS - static function available() { + public static function available() + { return class_exists("Gmagick"); } - static function checkImage($file) { + public static function checkImage($file) + { try { new Gmagick($file); } catch (Exception $e) { @@ -248,7 +277,8 @@ static function checkImage($file) { // INHERIT METHODS - public function output($type="jpeg", array $options=array()) { + public function output($type="jpeg", array $options=array()) + { $type = strtolower($type); try { $this->image->setImageFormat($type); @@ -256,8 +286,9 @@ public function output($type="jpeg", array $options=array()) { return false; } $method = "optimize_$type"; - if (method_exists($this, $method) && !$this->$method($options)) + if (method_exists($this, $method) && !$this->$method($options)) { return false; + } if (!isset($options['file'])) { if (!headers_sent()) { @@ -265,7 +296,6 @@ public function output($type="jpeg", array $options=array()) { header("Content-Type: $mime"); } echo $this->image; - } else { $file = $options['file'] . ".$type"; try { @@ -287,7 +317,8 @@ public function output($type="jpeg", array $options=array()) { // OWN METHODS - protected function optimize_jpeg(array $options=array()) { + protected function optimize_jpeg(array $options=array()) + { $quality = isset($options['quality']) ? $options['quality'] : self::DEFAULT_JPEG_QUALITY; try { $this->image->setCompressionQuality($quality); @@ -296,5 +327,4 @@ protected function optimize_jpeg(array $options=array()) { } return true; } - } diff --git a/manager/media/browser/mcpuk/lib/class_image_imagick.php b/manager/media/browser/mcpuk/lib/class_image_imagick.php index 0d576fa345..a64863f52c 100755 --- a/manager/media/browser/mcpuk/lib/class_image_imagick.php +++ b/manager/media/browser/mcpuk/lib/class_image_imagick.php @@ -12,18 +12,23 @@ * @link http://kcfinder.sunhater.com */ -class image_imagick extends image { - - static $MIMES = array( +class image_imagick extends image +{ + public static $MIMES = array( //'tif' => "image/tiff" ); // ABSTRACT PUBLIC METHODS - public function resize($width, $height) {// - if (!$width) $width = 1; - if (!$height) $height = 1; + public function resize($width, $height) + {// + if (!$width) { + $width = 1; + } + if (!$height) { + $height = 1; + } try { $this->image->scaleImage($width, $height); } catch (Exception $e) { @@ -34,9 +39,14 @@ public function resize($width, $height) {// return true; } - public function resizeFit($width, $height, $background=false) {// - if (!$width) $width = 1; - if (!$height) $height = 1; + public function resizeFit($width, $height, $background=false) + {// + if (!$width) { + $width = 1; + } + if (!$height) { + $height = 1; + } try { $this->image->scaleImage($width, $height, true); @@ -49,7 +59,6 @@ public function resizeFit($width, $height, $background=false) {// $this->width = $size['width']; $this->height = $size['height']; return true; - } else { try { $this->image->setImageBackgroundColor($background); @@ -65,43 +74,57 @@ public function resizeFit($width, $height, $background=false) {// } } - public function resizeCrop($width, $height, $offset=false) { - if (!$width) $width = 1; - if (!$height) $height = 1; + public function resizeCrop($width, $height, $offset=false) + { + if (!$width) { + $width = 1; + } + if (!$height) { + $height = 1; + } if (($this->width / $this->height) > ($width / $height)) { $h = $height; $w = ($this->width * $h) / $this->height; $y = 0; if ($offset !== false) { - if ($offset > 0) + if ($offset > 0) { $offset = -$offset; - if (($w + $offset) <= $width) + } + if (($w + $offset) <= $width) { $offset = $width - $w; + } $x = $offset; - } else + } else { $x = ($width - $w) / 2; - + } } else { $w = $width; $h = ($this->height * $w) / $this->width; $x = 0; if ($offset !== false) { - if ($offset > 0) + if ($offset > 0) { $offset = -$offset; - if (($h + $offset) <= $height) + } + if (($h + $offset) <= $height) { $offset = $height - $h; + } $y = $offset; - } else + } else { $y = ($height - $h) / 2; + } } $x = round($x); $y = round($y); $w = round($w); $h = round($h); - if (!$w) $w = 1; - if (!$h) $h = 1; + if (!$w) { + $w = 1; + } + if (!$h) { + $h = 1; + } try { $this->image->scaleImage($w, $h); @@ -115,7 +138,8 @@ public function resizeCrop($width, $height, $offset=false) { return true; } - public function rotate($angle, $background="#000000") { + public function rotate($angle, $background="#000000") + { try { $this->image->rotateImage(new ImagickPixel($background), $angle); $size = $this->image->getImageGeometry(); @@ -127,7 +151,8 @@ public function rotate($angle, $background="#000000") { return true; } - public function flipHorizontal() { + public function flipHorizontal() + { try { $this->image->flopImage(); } catch (Exception $e) { @@ -136,7 +161,8 @@ public function flipHorizontal() { return true; } - public function flipVertical() { + public function flipVertical() + { try { $this->image->flipImage(); } catch (Exception $e) { @@ -145,7 +171,8 @@ public function flipVertical() { return true; } - public function watermark($file, $left=false, $top=false) { + public function watermark($file, $left=false, $top=false) + { try { $wm = new Imagick($file); $size = $wm->getImageGeometry(); @@ -167,8 +194,9 @@ public function watermark($file, $left=false, $top=false) { if ((($x + $w) > $this->width) || (($y + $h) > $this->height) || ($x < 0) || ($y < 0) - ) + ) { return false; + } try { $this->image->compositeImage($wm, Imagick::COMPOSITE_DEFAULT, $x, $y); @@ -181,7 +209,8 @@ public function watermark($file, $left=false, $top=false) { // ABSTRACT PROTECTED METHODS - protected function getBlankImage($width, $height) { + protected function getBlankImage($width, $height) + { try { $img = new Imagick(); $img->newImage($width, $height, "none"); @@ -192,8 +221,8 @@ protected function getBlankImage($width, $height) { return $img; } - protected function getImage($image, &$width, &$height) { - + protected function getImage($image, &$width, &$height) + { if (is_object($image) && ($image instanceof image_imagick)) { try { $image->image->setImageCompressionQuality(100); @@ -203,7 +232,6 @@ protected function getImage($image, &$width, &$height) { $width = $image->width; $height = $image->height; return $image->image; - } elseif (is_object($image) && ($image instanceof Imagick)) { try { $image->setImageCompressionQuality(100); @@ -214,7 +242,6 @@ protected function getImage($image, &$width, &$height) { $width = $size['width']; $height = $size['height']; return $image; - } elseif (is_string($image)) { try { $image = new Imagick($image); @@ -226,19 +253,21 @@ protected function getImage($image, &$width, &$height) { $width = $size['width']; $height = $size['height']; return $image; - - } else + } else { return false; + } } // PSEUDO-ABSTRACT STATIC METHODS - static function available() { + public static function available() + { return class_exists("Imagick"); } - static function checkImage($file) { + public static function checkImage($file) + { try { new Imagick($file); } catch (Exception $e) { @@ -250,7 +279,8 @@ static function checkImage($file) { // INHERIT METHODS - public function output($type="jpeg", array $options=array()) { + public function output($type="jpeg", array $options=array()) + { $type = strtolower($type); try { $this->image->setImageFormat($type); @@ -258,8 +288,9 @@ public function output($type="jpeg", array $options=array()) { return false; } $method = "optimize_$type"; - if (method_exists($this, $method) && !$this->$method($options)) + if (method_exists($this, $method) && !$this->$method($options)) { return false; + } if (!isset($options['file'])) { if (!headers_sent()) { @@ -267,7 +298,6 @@ public function output($type="jpeg", array $options=array()) { header("Content-Type: $mime"); } echo $this->image; - } else { $file = $options['file'] . ".$type"; try { @@ -289,7 +319,8 @@ public function output($type="jpeg", array $options=array()) { // OWN METHODS - protected function optimize_jpeg(array $options=array()) { + protected function optimize_jpeg(array $options=array()) + { $quality = isset($options['quality']) ? $options['quality'] : self::DEFAULT_JPEG_QUALITY; try { $this->image->setImageCompression(Imagick::COMPRESSION_JPEG); @@ -299,5 +330,4 @@ protected function optimize_jpeg(array $options=array()) { } return true; } - } diff --git a/manager/media/browser/mcpuk/lib/class_input.php b/manager/media/browser/mcpuk/lib/class_input.php index 36917217ad..84f20b0721 100755 --- a/manager/media/browser/mcpuk/lib/class_input.php +++ b/manager/media/browser/mcpuk/lib/class_input.php @@ -12,31 +12,34 @@ * @link http://kcfinder.sunhater.com */ -class input { +class input +{ /** Filtered $_GET array * @var array */ public $get; - /** Filtered $_POST array - * @var array */ + /** Filtered $_POST array + * @var array */ public $post; - /** Filtered $_COOKIE array - * @var array */ + /** Filtered $_COOKIE array + * @var array */ public $cookie; - public function __construct() { + public function __construct() + { $this->get = &$_GET; $this->post = &$_POST; $this->cookie = &$_COOKIE; } - /** Magic method to get non-public properties like public. - * @param string $property - * @return mixed */ + /** Magic method to get non-public properties like public. + * @param string $property + * @return mixed */ - public function __get($property) { + public function __get($property) + { return property_exists($this, $property) ? $this->$property : null; } } diff --git a/manager/media/browser/mcpuk/lib/class_zipFolder.php b/manager/media/browser/mcpuk/lib/class_zipFolder.php index a5d469f7ab..87f17f3b0a 100755 --- a/manager/media/browser/mcpuk/lib/class_zipFolder.php +++ b/manager/media/browser/mcpuk/lib/class_zipFolder.php @@ -13,20 +13,23 @@ * @link http://kcfinder.sunhater.com */ -class zipFolder { +class zipFolder +{ protected $zip; protected $root; protected $ignored; - function __construct($file, $folder, $ignored=null) { + public function __construct($file, $folder, $ignored=null) + { $this->zip = new ZipArchive(); $this->ignored = is_array($ignored) ? $ignored : ($ignored ? array($ignored) : array()); - if ($this->zip->open($file, ZIPARCHIVE::CREATE) !== TRUE) + if ($this->zip->open($file, ZIPARCHIVE::CREATE) !== true) { throw new Exception("cannot open <$file>\n"); + } $folder = rtrim($folder, '/'); @@ -39,20 +42,23 @@ function __construct($file, $folder, $ignored=null) { $this->zip->close(); } - function zip($folder, $parent=null) { + public function zip($folder, $parent=null) + { $full_path = "{$this->root}$parent$folder"; $zip_path = "$parent$folder"; $this->zip->addEmptyDir($zip_path); $dir = new DirectoryIterator($full_path); - foreach ($dir as $file) + foreach ($dir as $file) { if (!$file->isDot()) { $filename = $file->getFilename(); if (!in_array($filename, $this->ignored)) { - if ($file->isDir()) + if ($file->isDir()) { $this->zip($filename, "$zip_path/"); - else + } else { $this->zip->addFile("$full_path/$filename", "$zip_path/$filename"); + } } } + } } } diff --git a/manager/media/browser/mcpuk/lib/helper_dir.php b/manager/media/browser/mcpuk/lib/helper_dir.php index 2f61f2ebe8..800535f990 100755 --- a/manager/media/browser/mcpuk/lib/helper_dir.php +++ b/manager/media/browser/mcpuk/lib/helper_dir.php @@ -12,44 +12,52 @@ * @link http://kcfinder.sunhater.com */ -class dir { +class dir +{ /** Checks if the given directory is really writable. The standard PHP * function is_writable() does not work properly on Windows servers * @param string $dir * @return bool */ - static function isWritable($dir) { + public static function isWritable($dir) + { $dir = path::normalize($dir); - if (!is_dir($dir)) + if (!is_dir($dir)) { return false; + } $i = 0; do { $file = "$dir/is_writable_" . md5($i++); } while (file_exists($file)); - if (!@touch($file)) + if (!@touch($file)) { return false; + } unlink($file); return true; } - /** Recursively delete the given directory. Returns TRUE on success. - * If $firstFailExit parameter is true (default), the method returns the - * path to the first failed file or directory which cannot be deleted. - * If $firstFailExit is false, the method returns an array with failed - * files and directories which cannot be deleted. The third parameter - * $failed is used for internal use only. - * @param string $dir - * @param bool $firstFailExit - * @param array $failed - * @return mixed */ - - static function prune($dir, $firstFailExit=true, array $failed=null) { - if ($failed === null) $failed = array(); + /** Recursively delete the given directory. Returns TRUE on success. + * If $firstFailExit parameter is true (default), the method returns the + * path to the first failed file or directory which cannot be deleted. + * If $firstFailExit is false, the method returns an array with failed + * files and directories which cannot be deleted. The third parameter + * $failed is used for internal use only. + * @param string $dir + * @param bool $firstFailExit + * @param array $failed + * @return mixed */ + + public static function prune($dir, $firstFailExit=true, array $failed=null) + { + if ($failed === null) { + $failed = array(); + } $files = self::content($dir); if ($files === false) { - if ($firstFailExit) + if ($firstFailExit) { return $dir; + } $failed[] = $dir; return $failed; } @@ -58,37 +66,41 @@ static function prune($dir, $firstFailExit=true, array $failed=null) { if (is_dir($file)) { $failed_in = self::prune($file, $firstFailExit, $failed); if ($failed_in !== true) { - if ($firstFailExit) + if ($firstFailExit) { return $failed_in; - if (is_array($failed_in)) + } + if (is_array($failed_in)) { $failed = array_merge($failed, $failed_in); - else + } else { $failed[] = $failed_in; + } } } elseif (!@unlink($file)) { - if ($firstFailExit) + if ($firstFailExit) { return $file; + } $failed[] = $file; } } if (!@rmdir($dir)) { - if ($firstFailExit) + if ($firstFailExit) { return $dir; + } $failed[] = $dir; } return count($failed) ? $failed : true; } - /** Get the content of the given directory. Returns an array with filenames - * or FALSE on failure - * @param string $dir - * @param array $options - * @return mixed */ - - static function content($dir, array $options=null) { + /** Get the content of the given directory. Returns an array with filenames + * or FALSE on failure + * @param string $dir + * @param array $options + * @return mixed */ + public static function content($dir, array $options=null) + { $defaultOptions = array( 'types' => "all", // Allowed: "all" or possible return values // of filetype(), or an array with them @@ -97,23 +109,29 @@ static function content($dir, array $options=null) { 'followLinks' => true ); - if (!is_dir($dir) || !is_readable($dir)) + if (!is_dir($dir) || !is_readable($dir)) { return false; + } - if (strtoupper(substr(PHP_OS, 0, 3)) == "WIN") + if (strtoupper(substr(PHP_OS, 0, 3)) == "WIN") { $dir = str_replace("\\", "/", $dir); + } $dir = rtrim($dir, "/"); $dh = @opendir($dir); - if ($dh === false) + if ($dh === false) { return false; + } - if ($options === null) + if ($options === null) { $options = $defaultOptions; + } - foreach ($defaultOptions as $key => $val) - if (!isset($options[$key])) + foreach ($defaultOptions as $key => $val) { + if (!isset($options[$key])) { $options[$key] = $val; + } + } $files = array(); while (($file = @readdir($dh)) !== false) { @@ -124,28 +142,32 @@ static function content($dir, array $options=null) { do { $ldir = dirname($lfile); $lfile = @readlink($lfile); - if (substr($lfile, 0, 1) != "/") + if (substr($lfile, 0, 1) != "/") { $lfile = "$ldir/$lfile"; + } $type = filetype($lfile); } while ($type == "link"); } if ((($type === "dir") && (($file == ".") || ($file == ".."))) || !preg_match($options['pattern'], $file) - ) + ) { continue; + } if (($options['types'] === "all") || ($type === $options['types']) || ((is_array($options['types'])) && in_array($type, $options['types'])) - ) + ) { $files[] = $options['addPath'] ? "$dir/$file" : $file; + } } closedir($dh); usort($files, array("dir", "fileSort")); return $files; } - static function fileSort($a, $b) { + public static function fileSort($a, $b) + { if (function_exists("mb_strtolower")) { $a = mb_strtolower($a); $b = mb_strtolower($b); @@ -153,7 +175,9 @@ static function fileSort($a, $b) { $a = strtolower($a); $b = strtolower($b); } - if ($a == $b) return 0; + if ($a == $b) { + return 0; + } return ($a < $b) ? -1 : 1; } } diff --git a/manager/media/browser/mcpuk/lib/helper_file.php b/manager/media/browser/mcpuk/lib/helper_file.php index 1f0200bcd7..73ef8b5fb0 100755 --- a/manager/media/browser/mcpuk/lib/helper_file.php +++ b/manager/media/browser/mcpuk/lib/helper_file.php @@ -12,9 +12,9 @@ * @link http://kcfinder.sunhater.com */ -class file { - - static $MIME = array( +class file +{ + public static $MIME = array( 'ai' => 'application/postscript', 'aif' => 'audio/x-aiff', 'aifc' => 'audio/x-aiff', @@ -100,41 +100,45 @@ class file { 'zip' => 'application/x-zip' ); - /** Checks if the given file is really writable. The standard PHP function - * is_writable() does not work properly on Windows servers. - * @param string $dir - * @return bool */ + /** Checks if the given file is really writable. The standard PHP function + * is_writable() does not work properly on Windows servers. + * @param string $dir + * @return bool */ - static function isWritable($filename) { + public static function isWritable($filename) + { $filename = path::normalize($filename); - if (!is_file($filename) || (false === ($fp = @fopen($filename, 'a+')))) + if (!is_file($filename) || (false === ($fp = @fopen($filename, 'a+')))) { return false; + } fclose($fp); return true; } - /** Get the extension from filename - * @param string $file - * @param bool $toLower - * @return string */ + /** Get the extension from filename + * @param string $file + * @param bool $toLower + * @return string */ - static function getExtension($filename, $toLower=true) { + public static function getExtension($filename, $toLower=true) + { return preg_match('/^.*\.([^\.]*)$/s', $filename, $patt) ? ($toLower ? strtolower($patt[1]) : $patt[1]) : ""; } - /** Get MIME type of the given filename. If Fileinfo PHP extension is - * available the MIME type will be fetched by the file's content. The - * second parameter is optional and defines the magic file path. If you - * skip it, the default one will be loaded. - * If Fileinfo PHP extension is not available the MIME type will be fetched - * by filename extension regarding $MIME property. If the file extension - * does not exist there, returned type will be application/octet-stream - * @param string $filename - * @param string $magic - * @return string */ + /** Get MIME type of the given filename. If Fileinfo PHP extension is + * available the MIME type will be fetched by the file's content. The + * second parameter is optional and defines the magic file path. If you + * skip it, the default one will be loaded. + * If Fileinfo PHP extension is not available the MIME type will be fetched + * by filename extension regarding $MIME property. If the file extension + * does not exist there, returned type will be application/octet-stream + * @param string $filename + * @param string $magic + * @return string */ - static function getMimeType($filename, $magic=null) { + public static function getMimeType($filename, $magic=null) + { if (class_exists("finfo")) { $finfo = ($magic === null) ? new finfo(FILEINFO_MIME) @@ -149,33 +153,36 @@ static function getMimeType($filename, $magic=null) { return isset(self::$MIME[$ext]) ? self::$MIME[$ext] : "application/octet-stream"; } - /** Get inexistant filename based on the given filename. If you skip $dir - * parameter the directory will be fetched from $filename and returned - * value will be full filename path. The third parameter is optional and - * defines the template, the filename will be renamed to. Default template - * is {name}({sufix}){ext}. Examples: - * - * file::getInexistantFilename("/my/directory/myfile.txt"); - * If myfile.txt does not exist - returns the same path to the file - * otherwise returns "/my/directory/myfile(1).txt" - * - * file::getInexistantFilename("myfile.txt", "/my/directory"); - * returns "myfile.txt" or "myfile(1).txt" or "myfile(2).txt" etc... - * - * file::getInexistantFilename("myfile.txt", "/dir", "{name}[{sufix}]{ext}"); - * returns "myfile.txt" or "myfile[1].txt" or "myfile[2].txt" etc... - * - * @param string $filename - * @param string $dir - * @param string $tpl - * @return string */ + /** Get inexistant filename based on the given filename. If you skip $dir + * parameter the directory will be fetched from $filename and returned + * value will be full filename path. The third parameter is optional and + * defines the template, the filename will be renamed to. Default template + * is {name}({sufix}){ext}. Examples: + * + * file::getInexistantFilename("/my/directory/myfile.txt"); + * If myfile.txt does not exist - returns the same path to the file + * otherwise returns "/my/directory/myfile(1).txt" + * + * file::getInexistantFilename("myfile.txt", "/my/directory"); + * returns "myfile.txt" or "myfile(1).txt" or "myfile(2).txt" etc... + * + * file::getInexistantFilename("myfile.txt", "/dir", "{name}[{sufix}]{ext}"); + * returns "myfile.txt" or "myfile[1].txt" or "myfile[2].txt" etc... + * + * @param string $filename + * @param string $dir + * @param string $tpl + * @return string */ - static function getInexistantFilename($filename, $dir=null, $tpl=null) { - if ($tpl === null) $tpl = "{name}({sufix}){ext}"; + public static function getInexistantFilename($filename, $dir=null, $tpl=null) + { + if ($tpl === null) { + $tpl = "{name}({sufix}){ext}"; + } $fullPath = ($dir === null); - if ($fullPath) + if ($fullPath) { $dir = path::normalize(dirname($filename)); - else { + } else { $fdir = dirname($filename); $dir = strlen($fdir) ? path::normalize("$dir/$fdir") @@ -186,9 +193,11 @@ static function getInexistantFilename($filename, $dir=null, $tpl=null) { $name = strlen($ext) ? substr($filename, 0, -strlen($ext) - 1) : $filename; $tpl = str_replace('{name}', $name, $tpl); $tpl = str_replace('{ext}', (strlen($ext) ? ".$ext" : ""), $tpl); - $i = 1; $file = "$dir/$filename"; - while (file_exists($file)) + $i = 1; + $file = "$dir/$filename"; + while (file_exists($file)) { $file = "$dir/" . str_replace('{sufix}', $i++, $tpl); + } return $fullPath ? $file @@ -196,5 +205,4 @@ static function getInexistantFilename($filename, $dir=null, $tpl=null) { ? "$fdir/" . basename($file) : basename($file)); } - } diff --git a/manager/media/browser/mcpuk/lib/helper_httpCache.php b/manager/media/browser/mcpuk/lib/helper_httpCache.php index 2dd660c6d0..fcb864451a 100755 --- a/manager/media/browser/mcpuk/lib/helper_httpCache.php +++ b/manager/media/browser/mcpuk/lib/helper_httpCache.php @@ -12,45 +12,58 @@ * @link http://kcfinder.sunhater.com */ -class httpCache { +class httpCache +{ const DEFAULT_TYPE = "text/html"; const DEFAULT_EXPIRE = 604800; // in seconds - /** Cache a file. The $type parameter might define the MIME type of the file - * or path to magic file to autodetect the MIME type. If you skip $type - * parameter the method will try with the default magic file. Autodetection - * of MIME type requires Fileinfo PHP extension used in file::getMimeType() - * @param string $file - * @param string $type - * @param integer $expire - * @param array $headers */ + /** Cache a file. The $type parameter might define the MIME type of the file + * or path to magic file to autodetect the MIME type. If you skip $type + * parameter the method will try with the default magic file. Autodetection + * of MIME type requires Fileinfo PHP extension used in file::getMimeType() + * @param string $file + * @param string $type + * @param integer $expire + * @param array $headers */ - static function file($file, $type=null, $expire=null, array $headers=null) { + public static function file($file, $type=null, $expire=null, array $headers=null) + { $mtime = @filemtime($file); - if ($mtime !== false) self::checkMTime($mtime); + if ($mtime !== false) { + self::checkMTime($mtime); + } if ($type === null) { $magic = ((substr($type, 0, 1) == "/") || preg_match('/^[a-z]\:/i', $type)) ? $type : null; $type = file::getMimeType($file, $magic); - if (!$type) $type = null; + if (!$type) { + $type = null; + } } self::content(@file_get_contents($file), $mtime, $type, $expire, $headers, false); } - /** Cache the given $content with $mtime modification time. - * @param binary $content - * @param integer $mtime - * @param string $type - * @param integer $expire - * @param array $headers - * @param bool $checkMTime */ + /** Cache the given $content with $mtime modification time. + * @param binary $content + * @param integer $mtime + * @param string $type + * @param integer $expire + * @param array $headers + * @param bool $checkMTime */ - static function content($content, $mtime, $type=null, $expire=null, array $headers=null, $checkMTime=true) { - if ($checkMTime) self::checkMTime($mtime); - if ($type === null) $type = self::DEFAULT_TYPE; - if ($expire === null) $expire = self::DEFAULT_EXPIRE; + public static function content($content, $mtime, $type=null, $expire=null, array $headers=null, $checkMTime=true) + { + if ($checkMTime) { + self::checkMTime($mtime); + } + if ($type === null) { + $type = self::DEFAULT_TYPE; + } + if ($expire === null) { + $expire = self::DEFAULT_EXPIRE; + } $size = strlen($content); $expires = gmdate("D, d M Y H:i:s", time() + $expire) . " GMT"; header("Content-Type: $type"); @@ -58,17 +71,22 @@ static function content($content, $mtime, $type=null, $expire=null, array $heade header("Cache-Control: max-age=$expire"); header("Pragma: !invalid"); header("Content-Length: $size"); - if ($headers !== null) foreach ($headers as $header) header($header); + if ($headers !== null) { + foreach ($headers as $header) { + header($header); + } + } echo $content; } - /** Check if given modification time is newer than client-side one. If not, - * the method will tell the client to get the content from its own cache. - * Afterwards the script process will be terminated. This feature requires - * the PHP to be configured as Apache module. - * @param integer $mtime */ + /** Check if given modification time is newer than client-side one. If not, + * the method will tell the client to get the content from its own cache. + * Afterwards the script process will be terminated. This feature requires + * the PHP to be configured as Apache module. + * @param integer $mtime */ - static function checkMTime($mtime, $sendHeaders=null) { + public static function checkMTime($mtime, $sendHeaders=null) + { header("Last-Modified: " . gmdate("D, d M Y H:i:s", $mtime) . " GMT"); $headers = function_exists("getallheaders") @@ -82,11 +100,13 @@ static function checkMTime($mtime, $sendHeaders=null) { $client_mtime = @strtotime($client_mtime[0]); if ($client_mtime >= $mtime) { header('HTTP/1.1 304 Not Modified'); - if (is_array($sendHeaders) && count($sendHeaders)) - foreach ($sendHeaders as $header) + if (is_array($sendHeaders) && count($sendHeaders)) { + foreach ($sendHeaders as $header) { header($header); - elseif ($sendHeaders !== null) + } + } elseif ($sendHeaders !== null) { header($sendHeaders); + } die; diff --git a/manager/media/browser/mcpuk/lib/helper_path.php b/manager/media/browser/mcpuk/lib/helper_path.php index 04e9de087b..7e5078f5bd 100755 --- a/manager/media/browser/mcpuk/lib/helper_path.php +++ b/manager/media/browser/mcpuk/lib/helper_path.php @@ -12,39 +12,47 @@ * @link http://kcfinder.sunhater.com */ -class path { +class path +{ /** Get the absolute URL path of the given one. Returns FALSE if the URL * is not valid or the current directory cannot be resolved (getcwd()) * @param string $path * @return string */ - static function rel2abs_url($path) { - if (substr($path, 0, 1) == "/") return $path; + public static function rel2abs_url($path) + { + if (substr($path, 0, 1) == "/") { + return $path; + } $dir = @getcwd(); - if (!isset($_SERVER['DOCUMENT_ROOT']) || ($dir === false)) + if (!isset($_SERVER['DOCUMENT_ROOT']) || ($dir === false)) { return false; + } $dir = self::normalize($dir); $doc_root = self::normalize($_SERVER['DOCUMENT_ROOT']); - if (substr($dir, 0, strlen($doc_root)) != $doc_root) + if (substr($dir, 0, strlen($doc_root)) != $doc_root) { return false; + } $return = self::normalize(substr($dir, strlen($doc_root)) . "/$path"); - if (substr($return, 0, 1) !== "/") + if (substr($return, 0, 1) !== "/") { $return = "/$return"; + } return $return; } - /** Resolve full filesystem path of given URL. Returns FALSE if the URL - * cannot be resolved - * @param string $url - * @return string */ + /** Resolve full filesystem path of given URL. Returns FALSE if the URL + * cannot be resolved + * @param string $url + * @return string */ - static function url2fullPath($url) { + public static function url2fullPath($url) + { $url = self::normalize($url); $uri = isset($_SERVER['SCRIPT_NAME']) @@ -55,15 +63,18 @@ static function url2fullPath($url) { $uri = self::normalize($uri); if (substr($url, 0, 1) !== "/") { - if ($uri === false) return false; + if ($uri === false) { + return false; + } $url = dirname($uri) . "/$url"; } if (isset($_SERVER['DOCUMENT_ROOT'])) { return self::normalize($_SERVER['DOCUMENT_ROOT'] . "/$url"); - } else { - if ($uri === false) return false; + if ($uri === false) { + return false; + } if (isset($_SERVER['SCRIPT_FILENAME'])) { $scr_filename = self::normalize($_SERVER['SCRIPT_FILENAME']); @@ -71,71 +82,84 @@ static function url2fullPath($url) { } $count = count(explode('/', $uri)) - 1; - for ($i = 0, $chdir = ""; $i < $count; $i++) + for ($i = 0, $chdir = ""; $i < $count; $i++) { $chdir .= "../"; + } $chdir = self::normalize($chdir); $dir = getcwd(); - if (($dir === false) || !@chdir($chdir)) + if (($dir === false) || !@chdir($chdir)) { return false; + } $rdir = getcwd(); chdir($dir); return ($rdir !== false) ? self::normalize($rdir . "/$url") : false; } } - /** Normalize the given path. On Windows servers backslash will be replaced - * with slash. Remobes unnecessary doble slashes and double dots. Removes - * last slash if it exists. Examples: - * path::normalize("C:\\any\\path\\") returns "C:/any/path" - * path::normalize("/your/path/..//home/") returns "/your/home" - * @param string $path - * @return string */ + /** Normalize the given path. On Windows servers backslash will be replaced + * with slash. Remobes unnecessary doble slashes and double dots. Removes + * last slash if it exists. Examples: + * path::normalize("C:\\any\\path\\") returns "C:/any/path" + * path::normalize("/your/path/..//home/") returns "/your/home" + * @param string $path + * @return string */ - static function normalize($path) { + public static function normalize($path) + { if (strtoupper(substr(PHP_OS, 0, 3)) == "WIN") { $path = preg_replace('/([^\\\])\\\([^\\\])/', "$1/$2", $path); - if (substr($path, -1) == "\\") $path = substr($path, 0, -1); - if (substr($path, 0, 1) == "\\") $path = "/" . substr($path, 1); + if (substr($path, -1) == "\\") { + $path = substr($path, 0, -1); + } + if (substr($path, 0, 1) == "\\") { + $path = "/" . substr($path, 1); + } } $path = preg_replace('/\/+/s', "/", $path); $path = "/$path"; - if (substr($path, -1) != "/") + if (substr($path, -1) != "/") { $path .= "/"; + } $expr = '/\/([^\/]{1}|[^\.\/]{2}|[^\/]{3,})\/\.\.\//s'; - while (preg_match($expr, $path)) + while (preg_match($expr, $path)) { $path = preg_replace($expr, "/", $path); + } $path = substr($path, 0, -1); $path = substr($path, 1); return $path; } - /** Encode URL Path - * @param string $path - * @return string */ + /** Encode URL Path + * @param string $path + * @return string */ - static function urlPathEncode($path) { + public static function urlPathEncode($path) + { $path = self::normalize($path); $encoded = ""; - foreach (explode("/", $path) as $dir) + foreach (explode("/", $path) as $dir) { $encoded .= rawurlencode($dir) . "/"; + } $encoded = substr($encoded, 0, -1); return $encoded; } - /** Decode URL Path - * @param string $path - * @return string */ + /** Decode URL Path + * @param string $path + * @return string */ - static function urlPathDecode($path) { + public static function urlPathDecode($path) + { $path = self::normalize($path); $decoded = ""; - foreach (explode("/", $path) as $dir) + foreach (explode("/", $path) as $dir) { $decoded .= rawurldecode($dir) . "/"; + } $decoded = substr($decoded, 0, -1); return $decoded; } diff --git a/manager/media/browser/mcpuk/lib/helper_text.php b/manager/media/browser/mcpuk/lib/helper_text.php index 8cecc353d1..0d03082554 100755 --- a/manager/media/browser/mcpuk/lib/helper_text.php +++ b/manager/media/browser/mcpuk/lib/helper_text.php @@ -12,21 +12,24 @@ * @link http://kcfinder.sunhater.com */ -class text { +class text +{ /** Replace repeated white spaces to single space * @param string $string * @return string */ - static function clearWhitespaces($string) { + public static function clearWhitespaces($string) + { return trim(preg_replace('/\s+/s', " ", $string)); } - /** Normalize the string for HTML attribute value - * @param string $string - * @return string */ + /** Normalize the string for HTML attribute value + * @param string $string + * @return string */ - static function htmlValue($string) { + public static function htmlValue($string) + { return str_replace('"', """, str_replace("'", ''', @@ -35,11 +38,12 @@ static function htmlValue($string) { $string)))); } - /** Normalize the string for JavaScript string value - * @param string $string - * @return string */ + /** Normalize the string for JavaScript string value + * @param string $string + * @return string */ - static function jsValue($string) { + public static function jsValue($string) + { return preg_replace('/\r?\n/', "\\n", str_replace('"', "\\\"", @@ -48,22 +52,25 @@ static function jsValue($string) { $string)))); } - /** Normalize the string for XML tag content data - * @param string $string - * @param bool $cdata */ + /** Normalize the string for XML tag content data + * @param string $string + * @param bool $cdata */ - static function xmlData($string, $cdata=false) { + public static function xmlData($string, $cdata=false) + { $string = str_replace("]]>", "]]]]>", $string); - if (!$cdata) + if (!$cdata) { $string = ""; + } return $string; } - /** Returns compressed content of given CSS code - * @param string $code - * @return string */ + /** Returns compressed content of given CSS code + * @param string $code + * @return string */ - static function compressCSS($code) { + public static function compressCSS($code) + { $code = self::clearWhitespaces($code); $code = preg_replace('/ ?\{ ?/', "{", $code); $code = preg_replace('/ ?\} ?/', "}", $code); diff --git a/manager/media/browser/mcpuk/tpl/tpl_browser.php b/manager/media/browser/mcpuk/tpl/tpl_browser.php index e16bcfb396..caa1560b53 100755 --- a/manager/media/browser/mcpuk/tpl/tpl_browser.php +++ b/manager/media/browser/mcpuk/tpl/tpl_browser.php @@ -4,8 +4,8 @@ KCFinder: / <?php echo $this->session['dir'] ?> - - + + diff --git a/manager/media/browser/mcpuk/tpl/tpl_css.php b/manager/media/browser/mcpuk/tpl/tpl_css.php index dbf5d58e97..baf4171682 100755 --- a/manager/media/browser/mcpuk/tpl/tpl_css.php +++ b/manager/media/browser/mcpuk/tpl/tpl_css.php @@ -1,2 +1,2 @@ -cms}" : "" ) ?>" rel="stylesheet" type="text/css" /> +cms}" : "") ?>" rel="stylesheet" type="text/css" /> diff --git a/manager/media/browser/mcpuk/tpl/tpl_javascript.php b/manager/media/browser/mcpuk/tpl/tpl_javascript.php index d43aa8f8b7..b90a26b1c9 100755 --- a/manager/media/browser/mcpuk/tpl/tpl_javascript.php +++ b/manager/media/browser/mcpuk/tpl/tpl_javascript.php @@ -4,12 +4,12 @@ -opener['TinyMCE']) && $this->opener['TinyMCE']): ?> +opener['TinyMCE']) && $this->opener['TinyMCE']): ?> - -config['theme']}/init.js")): ?> + +config['theme']}/init.js")): ?> - + "; - } else { - echo $msg . "\n"; - } +function jsAlert($msg) +{ + $modx = evolutionCMS(); + if ($_POST['ajax'] != 1) { + echo ""; + } else { + echo $msg . "\n"; + } } /** @@ -311,9 +312,10 @@ function jsAlert($msg) { * @param string $dbasePassword * @return bool */ -function login($username, $givenPassword, $dbasePassword) { - $modx = evolutionCMS(); - return $modx->phpass->CheckPassword($givenPassword, $dbasePassword); +function login($username, $givenPassword, $dbasePassword) +{ + $modx = evolutionCMS(); + return $modx->phpass->CheckPassword($givenPassword, $dbasePassword); } /** @@ -323,27 +325,28 @@ function login($username, $givenPassword, $dbasePassword) { * @param string $username * @return bool */ -function loginV1($internalKey, $givenPassword, $dbasePassword, $username) { - $modx = evolutionCMS(); +function loginV1($internalKey, $givenPassword, $dbasePassword, $username) +{ + $modx = evolutionCMS(); - $user_algo = $modx->manager->getV1UserHashAlgorithm($internalKey); + $user_algo = $modx->manager->getV1UserHashAlgorithm($internalKey); - if(!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) { - $modx->config['pwd_hash_algo'] = 'UNCRYPT'; - } + if (!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) { + $modx->config['pwd_hash_algo'] = 'UNCRYPT'; + } - if($user_algo !== $modx->config['pwd_hash_algo']) { - $bk_pwd_hash_algo = $modx->config['pwd_hash_algo']; - $modx->config['pwd_hash_algo'] = $user_algo; - } + if ($user_algo !== $modx->config['pwd_hash_algo']) { + $bk_pwd_hash_algo = $modx->config['pwd_hash_algo']; + $modx->config['pwd_hash_algo'] = $user_algo; + } - if($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) { - return false; - } + if ($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) { + return false; + } - updateNewHash($username, $givenPassword); + updateNewHash($username, $givenPassword); - return true; + return true; } /** @@ -353,26 +356,28 @@ function loginV1($internalKey, $givenPassword, $dbasePassword, $username) { * @param string $username * @return bool */ -function loginMD5($internalKey, $givenPassword, $dbasePassword, $username) { - $modx = evolutionCMS(); - - if($dbasePassword != md5($givenPassword)) { - return false; - } - updateNewHash($username, $givenPassword); - return true; +function loginMD5($internalKey, $givenPassword, $dbasePassword, $username) +{ + $modx = evolutionCMS(); + + if ($dbasePassword != md5($givenPassword)) { + return false; + } + updateNewHash($username, $givenPassword); + return true; } /** * @param string $username * @param string $password */ -function updateNewHash($username, $password) { - $modx = evolutionCMS(); +function updateNewHash($username, $password) +{ + $modx = evolutionCMS(); - $field = array(); - $field['password'] = $modx->phpass->HashPassword($password); - $modx->db->update($field, '[+prefix+]manager_users', "username='{$username}'"); + $field = array(); + $field['password'] = $modx->phpass->HashPassword($password); + $modx->db->update($field, '[+prefix+]manager_users', "username='{$username}'"); } /** @@ -381,28 +386,29 @@ function updateNewHash($username, $password) { * @param int $failed_allowed * @param int $blocked_minutes */ -function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes) { - $modx = evolutionCMS(); - - $failedlogins += 1; - - $fields = array('failedlogincount' => $failedlogins); - if($failedlogins >= $failed_allowed) //block user for too many fail attempts - { - $fields['blockeduntil'] = time() + ($blocked_minutes * 60); - } - - $modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'"); - - if($failedlogins < $failed_allowed) { - //sleep to help prevent brute force attacks - $sleep = (int) $failedlogins / 2; - if($sleep > 5) { - $sleep = 5; - } - sleep($sleep); - } - @session_destroy(); - session_unset(); - return; +function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes) +{ + $modx = evolutionCMS(); + + $failedlogins += 1; + + $fields = array('failedlogincount' => $failedlogins); + if ($failedlogins >= $failed_allowed) { //block user for too many fail attempts + + $fields['blockeduntil'] = time() + ($blocked_minutes * 60); + } + + $modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'"); + + if ($failedlogins < $failed_allowed) { + //sleep to help prevent brute force attacks + $sleep = (int) $failedlogins / 2; + if ($sleep > 5) { + $sleep = 5; + } + sleep($sleep); + } + @session_destroy(); + session_unset(); + return; } diff --git a/manager/processors/logout.processor.php b/manager/processors/logout.processor.php index 7af6ff4518..d69b6d6900 100755 --- a/manager/processors/logout.processor.php +++ b/manager/processors/logout.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } @@ -9,10 +9,10 @@ // invoke OnBeforeManagerLogout event $modx->invokeEvent("OnBeforeManagerLogout", - array( - "userid" => $internalKey, - "username" => $username - )); + array( + "userid" => $internalKey, + "username" => $username + )); //// Unset all of the session variables. //$_SESSION = array(); @@ -35,10 +35,10 @@ // invoke OnManagerLogout event $modx->invokeEvent("OnManagerLogout", - array( - "userid" => $internalKey, - "username" => $username - )); + array( + "userid" => $internalKey, + "username" => $username + )); // show login screen header('Location: ' . MODX_MANAGER_URL); diff --git a/manager/processors/move_document.processor.php b/manager/processors/move_document.processor.php index c0a8c390fd..d7fb93b55e 100755 --- a/manager/processors/move_document.processor.php +++ b/manager/processors/move_document.processor.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('edit_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('edit_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $newParentID = isset($_REQUEST['new_parent']) ? (int)$_REQUEST['new_parent'] : 0; @@ -12,12 +12,20 @@ // ok, two things to check. // first, document cannot be moved to itself // second, new parent must be a folder. If not, set it to folder. -if($documentID==$newParentID) $modx->webAlertAndQuit($_lang["error_movedocument1"]); -if($documentID <= 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]); -if($newParentID < 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]); +if ($documentID==$newParentID) { + $modx->webAlertAndQuit($_lang["error_movedocument1"]); +} +if ($documentID <= 0) { + $modx->webAlertAndQuit($_lang["error_movedocument2"]); +} +if ($newParentID < 0) { + $modx->webAlertAndQuit($_lang["error_movedocument2"]); +} $parents = $modx->getParentIds($newParentID); -if (in_array($documentID, $parents)) $modx->webAlertAndQuit($_lang["error_movedocument2"]); +if (in_array($documentID, $parents)) { + $modx->webAlertAndQuit($_lang["error_movedocument2"]); +} $rs = $modx->db->select('parent', $modx->getFullTableName('site_content'), "id='{$documentID}'"); $oldparent = $modx->db->getValue($rs); @@ -25,85 +33,86 @@ // check user has permission to move document to chosen location if ($use_udperms == 1) { - if ($oldparent != $newParentID) { - include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php"; - $udperms = new udperms(); - $udperms->user = $modx->getLoginUserID(); - $udperms->document = $newParentID; - $udperms->role = $_SESSION['mgrRole']; - - if (!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_parent_denied"]); - } - } + if ($oldparent != $newParentID) { + include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php"; + $udperms = new udperms(); + $udperms->user = $modx->getLoginUserID(); + $udperms->document = $newParentID; + $udperms->role = $_SESSION['mgrRole']; + + if (!$udperms->checkPermissions()) { + $modx->webAlertAndQuit($_lang["access_permission_parent_denied"]); + } + } } /** * @param int $currDocID * @return array */ -function allChildren($currDocID) { - $modx = evolutionCMS(); - $children= array(); - $currDocID = $modx->db->escape($currDocID); - $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent = '{$currDocID}'"); - while ($child= $modx->db->getRow($rs)) { - $children[]= $child['id']; - $children= array_merge($children, allChildren($child['id'])); - } - return $children; +function allChildren($currDocID) +{ + $modx = evolutionCMS(); + $children= array(); + $currDocID = $modx->db->escape($currDocID); + $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent = '{$currDocID}'"); + while ($child= $modx->db->getRow($rs)) { + $children[]= $child['id']; + $children= array_merge($children, allChildren($child['id'])); + } + return $children; } -$evtOut = $modx->invokeEvent("onBeforeMoveDocument", array ( - "id_document" => $documentID, - "old_parent" => $oldparent, - "new_parent" => $newParentID +$evtOut = $modx->invokeEvent("onBeforeMoveDocument", array( + "id_document" => $documentID, + "old_parent" => $oldparent, + "new_parent" => $newParentID )); -if (is_array($evtOut) && count($evtOut) > 0){ - $newParent = array_pop($evtOut); - if($newParent == $oldparent) { - $modx->webAlertAndQuit($_lang["error_movedocument2"]); - }else{ - $newParentID = $newParent; - } +if (is_array($evtOut) && count($evtOut) > 0) { + $newParent = array_pop($evtOut); + if ($newParent == $oldparent) { + $modx->webAlertAndQuit($_lang["error_movedocument2"]); + } else { + $newParentID = $newParent; + } } $children = allChildren($documentID); if (!array_search($newParentID, $children)) { - $modx->db->update(array( - 'isfolder' => 1, - ), $modx->getFullTableName('site_content'), "id='{$newParentID}'"); - - $modx->db->update(array( - 'parent' => $newParentID, - 'editedby' => $modx->getLoginUserID(), - 'editedon' => time(), - ), $modx->getFullTableName('site_content'), "id='{$documentID}'"); - - // finished moving the document, now check to see if the old_parent should no longer be a folder. - $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('site_content'), "parent='{$oldparent}'"); - $limit = $modx->db->getValue($rs); - - if(!$limit>0) { - $modx->db->update(array( - 'isfolder' => 0, - ), $modx->getFullTableName('site_content'), "id='{$oldparent}'"); - } - // Set the item name for logger - $pagetitle = $modx->db->getValue($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "id='{$documentID}'")); - $_SESSION['itemname'] = $pagetitle; - - $modx->invokeEvent("onAfterMoveDocument", array ( - "id_document" => $documentID, - "old_parent" => $oldparent, - "new_parent" => $newParentID - )); - - // empty cache & sync site - $modx->clearCache('full'); - - $header="Location: index.php?a=3&id={$documentID}&r=9"; - header($header); + $modx->db->update(array( + 'isfolder' => 1, + ), $modx->getFullTableName('site_content'), "id='{$newParentID}'"); + + $modx->db->update(array( + 'parent' => $newParentID, + 'editedby' => $modx->getLoginUserID(), + 'editedon' => time(), + ), $modx->getFullTableName('site_content'), "id='{$documentID}'"); + + // finished moving the document, now check to see if the old_parent should no longer be a folder. + $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('site_content'), "parent='{$oldparent}'"); + $limit = $modx->db->getValue($rs); + + if (!$limit>0) { + $modx->db->update(array( + 'isfolder' => 0, + ), $modx->getFullTableName('site_content'), "id='{$oldparent}'"); + } + // Set the item name for logger + $pagetitle = $modx->db->getValue($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "id='{$documentID}'")); + $_SESSION['itemname'] = $pagetitle; + + $modx->invokeEvent("onAfterMoveDocument", array( + "id_document" => $documentID, + "old_parent" => $oldparent, + "new_parent" => $newParentID + )); + + // empty cache & sync site + $modx->clearCache('full'); + + $header="Location: index.php?a=3&id={$documentID}&r=9"; + header($header); } else { - $modx->webAlertAndQuit("You cannot move a document to a child document!"); + $modx->webAlertAndQuit("You cannot move a document to a child document!"); } diff --git a/manager/processors/optimize_table.processor.php b/manager/processors/optimize_table.processor.php index 4a971a7e4a..ddcc8755ea 100755 --- a/manager/processors/optimize_table.processor.php +++ b/manager/processors/optimize_table.processor.php @@ -1,35 +1,31 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!($modx->hasPermission('settings') && ($modx->hasPermission('logs')||$modx->hasPermission('bk_manager')))) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!($modx->hasPermission('settings') && ($modx->hasPermission('logs')||$modx->hasPermission('bk_manager')))) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } if (isset($_REQUEST['t'])) { + if (empty($_REQUEST['t'])) { + $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]); + } - if (empty($_REQUEST['t'])) { - $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]); - } - - // Set the item name for logger - $_SESSION['itemname'] = $_REQUEST['t']; - - $modx->db->optimize($_REQUEST['t']); + // Set the item name for logger + $_SESSION['itemname'] = $_REQUEST['t']; + $modx->db->optimize($_REQUEST['t']); } elseif (isset($_REQUEST['u'])) { + if (empty($_REQUEST['u'])) { + $modx->webAlertAndQuit($_lang["error_no_truncate_tablename"]); + } - if (empty($_REQUEST['u'])) { - $modx->webAlertAndQuit($_lang["error_no_truncate_tablename"]); - } - - // Set the item name for logger - $_SESSION['itemname'] = $_REQUEST['u']; - - $modx->db->truncate($_REQUEST['u']); + // Set the item name for logger + $_SESSION['itemname'] = $_REQUEST['u']; + $modx->db->truncate($_REQUEST['u']); } else { - $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]); + $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]); } $mode = (int)$_REQUEST['mode']; diff --git a/manager/processors/publish_content.processor.php b/manager/processors/publish_content.processor.php index 87e66c07f7..235d39e791 100755 --- a/manager/processors/publish_content.processor.php +++ b/manager/processors/publish_content.processor.php @@ -1,14 +1,14 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('save_document')||!$modx->hasPermission('publish_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('save_document')||!$modx->hasPermission('publish_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id'])? (int)$_REQUEST['id'] : 0; -if($id==0) { - $modx->webAlertAndQuit($_lang["error_no_id"]); +if ($id==0) { + $modx->webAlertAndQuit($_lang["error_no_id"]); } /************webber ********/ @@ -16,10 +16,10 @@ $pid=($content['parent']==0?$id:$content['parent']); /************** webber *************/ -$sd=isset($_REQUEST['dir'])?'&dir='.$_REQUEST['dir']:'&dir=DESC'; -$sb=isset($_REQUEST['sort'])?'&sort='.$_REQUEST['sort']:'&sort=createdon'; -$pg=isset($_REQUEST['page'])?'&page='.(int)$_REQUEST['page']:''; -$add_path=$sd.$sb.$pg; +$sd=isset($_REQUEST['dir'])?'&dir=' . $_REQUEST['dir']:'&dir=DESC'; +$sb=isset($_REQUEST['sort'])?'&sort=' . $_REQUEST['sort']:'&sort=createdon'; +$pg=isset($_REQUEST['page'])?'&page=' . (int)$_REQUEST['page']:''; +$add_path=$sd . $sb . $pg; /***********************************/ @@ -32,24 +32,24 @@ $udperms->document = $id; $udperms->role = $_SESSION['mgrRole']; -if(!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); +if (!$udperms->checkPermissions()) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); } // update the document $modx->db->update( - array( - 'published' => 1, - 'pub_date' => 0, - 'unpub_date' => 0, - 'editedby' => $modx->getLoginUserID(), - 'editedon' => time(), - 'publishedby' => $modx->getLoginUserID(), - 'publishedon' => time(), - ), $modx->getFullTableName('site_content'), "id='{$id}'"); + array( + 'published' => 1, + 'pub_date' => 0, + 'unpub_date' => 0, + 'editedby' => $modx->getLoginUserID(), + 'editedon' => time(), + 'publishedby' => $modx->getLoginUserID(), + 'publishedon' => time(), + ), $modx->getFullTableName('site_content'), "id='{$id}'"); // invoke OnDocPublished event -$modx->invokeEvent("OnDocPublished",array("docid"=>$id)); +$modx->invokeEvent("OnDocPublished", array("docid"=>$id)); // Set the item name for logger $_SESSION['itemname'] = $content['pagetitle']; @@ -57,6 +57,6 @@ // empty cache $modx->clearCache('full'); -$header="Location: index.php?a=3&id=$pid&r=1".$add_path; +$header="Location: index.php?a=3&id=$pid&r=1" . $add_path; header($header); diff --git a/manager/processors/purge_plugin.processor.php b/manager/processors/purge_plugin.processor.php index 2e31e0092a..7df736a632 100755 --- a/manager/processors/purge_plugin.processor.php +++ b/manager/processors/purge_plugin.processor.php @@ -1,11 +1,11 @@ hasPermission('delete_plugin')) { - $e->setError(3); - $e->dumpError(); +if (!$modx->hasPermission('delete_plugin')) { + $e->setError(3); + $e->dumpError(); } $tbl_site_plugins = $modx->getFullTablename('site_plugins'); @@ -14,18 +14,19 @@ // Get unique list of latest added plugins by highest sql-id $rs = $modx->db->query("SELECT t1.id FROM {$tbl_site_plugins} t1 LEFT JOIN {$tbl_site_plugins} t2 ON (t1.name = t2.name AND t1.id < t2.id) WHERE t2.id IS NULL;"); $latestIds = array(); -while($row = $modx->db->getRow($rs)) { +while ($row = $modx->db->getRow($rs)) { $latestIds[] = $row['id']; } // Get list of plugins with disabled and enabled versions $rs = $modx->db->query("SELECT id FROM {$tbl_site_plugins} t1 WHERE disabled = 1 AND name IN (SELECT name FROM {$tbl_site_plugins} t2 WHERE t1.name = t2.name AND t1.id != t2.id)"); -while($row = $modx->db->getRow($rs)) { - +while ($row = $modx->db->getRow($rs)) { $id = $row['id']; - if(in_array($id,$latestIds)) continue; // Keep latest version of disabled plugins + if (in_array($id, $latestIds)) { + continue; + } // Keep latest version of disabled plugins // invoke OnBeforePluginFormDelete event $modx->invokeEvent('OnBeforePluginFormDelete', array('id'=> $id)); diff --git a/manager/processors/remove_content.processor.php b/manager/processors/remove_content.processor.php index d55584c60f..495568b41d 100755 --- a/manager/processors/remove_content.processor.php +++ b/manager/processors/remove_content.processor.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('delete_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('delete_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "deleted=1"); @@ -11,36 +11,36 @@ // invoke OnBeforeEmptyTrash event $modx->invokeEvent("OnBeforeEmptyTrash", - array( - "ids"=>$ids - )); + array( + "ids"=>$ids + )); // remove the document groups link. $sql = "DELETE document_groups - FROM ".$modx->getFullTableName('document_groups')." AS document_groups - INNER JOIN ".$modx->getFullTableName('site_content')." AS site_content ON site_content.id = document_groups.document + FROM " . $modx->getFullTableName('document_groups') . " AS document_groups + INNER JOIN " . $modx->getFullTableName('site_content') . " AS site_content ON site_content.id = document_groups.document WHERE site_content.deleted=1"; $modx->db->query($sql); // remove the TV content values. $sql = "DELETE site_tmplvar_contentvalues - FROM ".$modx->getFullTableName('site_tmplvar_contentvalues')." AS site_tmplvar_contentvalues - INNER JOIN ".$modx->getFullTableName('site_content')." AS site_content ON site_content.id = site_tmplvar_contentvalues.contentid + FROM " . $modx->getFullTableName('site_tmplvar_contentvalues') . " AS site_tmplvar_contentvalues + INNER JOIN " . $modx->getFullTableName('site_content') . " AS site_content ON site_content.id = site_tmplvar_contentvalues.contentid WHERE site_content.deleted=1"; $modx->db->query($sql); //'undelete' the document. $modx->db->delete($modx->getFullTableName('site_content'), "deleted=1"); - // invoke OnEmptyTrash event - $modx->invokeEvent("OnEmptyTrash", - array( - "ids"=>$ids - )); + // invoke OnEmptyTrash event + $modx->invokeEvent("OnEmptyTrash", + array( + "ids"=>$ids + )); - // empty cache - $modx->clearCache('full'); + // empty cache + $modx->clearCache('full'); - // finished emptying cache - redirect - $header="Location: index.php?a=2&r=1"; - header($header); + // finished emptying cache - redirect + $header="Location: index.php?a=2&r=1"; + header($header); diff --git a/manager/processors/remove_installer.processor.php b/manager/processors/remove_installer.processor.php index c2d758d84d..519f8f7958 100755 --- a/manager/processors/remove_installer.processor.php +++ b/manager/processors/remove_installer.processor.php @@ -13,14 +13,18 @@ */ $msg =''; -$pth = dirname(dirname(dirname(__FILE__)))."/install/"; -$pth = str_replace("\\","/",$pth); -if(isset($_GET["rminstall"])) { - if(is_dir($pth)) { - if(!rmdirRecursive($pth)) $msg="An error occured while attempting to remove the install folder"; - } +$pth = dirname(dirname(dirname(__FILE__))) . "/install/"; +$pth = str_replace("\\", "/", $pth); +if (isset($_GET["rminstall"])) { + if (is_dir($pth)) { + if (!rmdirRecursive($pth)) { + $msg="An error occured while attempting to remove the install folder"; + } + } +} +if ($msg) { + echo ""; } -if($msg) echo ""; echo ""; /** @@ -30,16 +34,16 @@ * @param bool $followLinks * @return bool */ -function rmdirRecursive($path, $followLinks=false) { - $dir = opendir($path) ; - while ($entry = readdir($dir)) { - if (is_file("$path/$entry") || ((!$followLinks) && is_link("$path/$entry"))) { - @unlink( "$path/$entry" ); - } - elseif (is_dir("$path/$entry") && $entry!='.' && $entry!='..') { - rmdirRecursive("$path/$entry"); // recursive - } - } - closedir($dir); - return @rmdir($path); +function rmdirRecursive($path, $followLinks=false) +{ + $dir = opendir($path) ; + while ($entry = readdir($dir)) { + if (is_file("$path/$entry") || ((!$followLinks) && is_link("$path/$entry"))) { + @unlink("$path/$entry"); + } elseif (is_dir("$path/$entry") && $entry!='.' && $entry!='..') { + rmdirRecursive("$path/$entry"); // recursive + } + } + closedir($dir); + return @rmdir($path); } diff --git a/manager/processors/remove_locks.processor.php b/manager/processors/remove_locks.processor.php index 5808378f9e..0b4d3218ea 100755 --- a/manager/processors/remove_locks.processor.php +++ b/manager/processors/remove_locks.processor.php @@ -1,26 +1,28 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!isset($_GET['id'])) { - if(!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!isset($_GET['id'])) { + if (!$modx->hasPermission('remove_locks')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } - // Remove all locks - $modx->db->truncate($modx->getFullTableName('active_user_locks')); + // Remove all locks + $modx->db->truncate($modx->getFullTableName('active_user_locks')); - $header = "Location: index.php?a=2"; - header($header); + $header = "Location: index.php?a=2"; + header($header); } else { - // Remove single locks via AJAX / window.onbeforeunload - $type = (int)$_GET['type']; - $id = (int)$_GET['id']; - $includeAllUsers = $modx->hasPermission('remove_locks'); // Enables usage of "unlock"-ajax-button - if($type && $id) { - $modx->unlockElement($type, $id, $includeAllUsers); - echo '1'; - exit; - } else { - echo 'No type or id sent with request.'; - } + // Remove single locks via AJAX / window.onbeforeunload + $type = (int)$_GET['type']; + $id = (int)$_GET['id']; + $includeAllUsers = $modx->hasPermission('remove_locks'); // Enables usage of "unlock"-ajax-button + if ($type && $id) { + $modx->unlockElement($type, $id, $includeAllUsers); + echo '1'; + exit; + } else { + echo 'No type or id sent with request.'; + } } diff --git a/manager/processors/save_content.processor.php b/manager/processors/save_content.processor.php index 942e2dbc18..e311e6505d 100755 --- a/manager/processors/save_content.processor.php +++ b/manager/processors/save_content.processor.php @@ -36,10 +36,10 @@ $aliasvisible = $_POST['alias_visible']; /************* webber ********/ -$sd = isset($_POST['dir']) ? '&dir='.$_POST['dir'] : '&dir=DESC'; -$sb = isset($_POST['sort']) ? '&sort='.$_POST['sort'] : '&sort=pub_date'; -$pg = isset($_POST['page']) ? '&page='.(int) $_POST['page'] : ''; -$add_path = $sd.$sb.$pg; +$sd = isset($_POST['dir']) ? '&dir=' . $_POST['dir'] : '&dir=DESC'; +$sb = isset($_POST['sort']) ? '&sort=' . $_POST['sort'] : '&sort=pub_date'; +$pg = isset($_POST['page']) ? '&page=' . (int) $_POST['page'] : ''; +$add_path = $sd . $sb . $pg; @@ -134,28 +134,26 @@ } //end webber } -} -elseif ($alias) { +} elseif ($alias) { $alias = $modx->stripAlias($alias); } // determine published status $currentdate = $_SERVER['REQUEST_TIME'] + $modx->config['server_offset_time']; -if (empty ($pub_date)) { +if (empty($pub_date)) { $pub_date = 0; } else { $pub_date = $modx->toTimeStamp($pub_date); if ($pub_date < $currentdate) { $published = 1; - } - elseif ($pub_date > $currentdate) { + } elseif ($pub_date > $currentdate) { $published = 0; } } -if (empty ($unpub_date)) { +if (empty($unpub_date)) { $unpub_date = 0; } else { $unpub_date = $modx->toTimeStamp($unpub_date); @@ -195,15 +193,15 @@ INNER JOIN {$tbl_site_tmplvar_templates} AS tvtpl ON tvtpl.tmplvarid = tv.id LEFT JOIN {$tbl_site_tmplvar_contentvalues} AS tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$id}' LEFT JOIN {$tbl_site_tmplvar_access} AS tva ON tva.tmplvarid=tv.id", - "tvtpl.templateid = '{$template}' AND (1='{$_SESSION['mgrRole']}' OR ISNULL(tva.documentgroup)".((!$docgrp) ? "" : " OR tva.documentgroup IN ($docgrp)").")", + "tvtpl.templateid = '{$template}' AND (1='{$_SESSION['mgrRole']}' OR ISNULL(tva.documentgroup)" . ((!$docgrp) ? "" : " OR tva.documentgroup IN ($docgrp)") . ")", "tv.rank" ); while ($row = $modx->db->getRow($rs)) { $tmplvar = ''; switch ($row['type']) { case 'url': - $tmplvar = $_POST["tv".$row['id']]; - if ($_POST["tv".$row['id'].'_prefix'] != '--') { + $tmplvar = $_POST["tv" . $row['id']]; + if ($_POST["tv" . $row['id'] . '_prefix'] != '--') { $tmplvar = str_replace(array( "feed://", "ftp://", @@ -211,23 +209,23 @@ "https://", "mailto:" ), "", $tmplvar); - $tmplvar = $_POST["tv".$row['id'].'_prefix'].$tmplvar; + $tmplvar = $_POST["tv" . $row['id'] . '_prefix'] . $tmplvar; } break; case 'file': - $tmplvar = $_POST["tv".$row['id']]; + $tmplvar = $_POST["tv" . $row['id']]; break; default: - if (is_array($_POST["tv".$row['id']])) { + if (is_array($_POST["tv" . $row['id']])) { // handles checkboxes & multiple selects elements $feature_insert = array(); - $lst = $_POST["tv".$row['id']]; - while (list ($featureValue, $feature_item) = each($lst)) { + $lst = $_POST["tv" . $row['id']]; + while (list($featureValue, $feature_item) = each($lst)) { $feature_insert[count($feature_insert)] = $feature_item; } $tmplvar = implode("||", $feature_insert); } else { - $tmplvar = $_POST["tv".$row['id']]; + $tmplvar = $_POST["tv" . $row['id']]; } break; } @@ -250,13 +248,12 @@ if (!$existingDocument) { $modx->webAlertAndQuit($_lang["error_no_results"]); } - } // check to see if the user is allowed to save the document in the place he wants to save it in if ($use_udperms == 1) { if ($existingDocument['parent'] != $parent) { - include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php"; + include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php"; $udperms = new udperms(); $udperms->user = $modx->getLoginUserID(); $udperms->document = $parent; @@ -275,11 +272,10 @@ } switch ($actionToTake) { - case 'new' : + case 'new': // invoke OnBeforeDocFormSave event - switch($modx->config['docid_incrmnt_method']) - { + switch ($modx->config['docid_incrmnt_method']) { case '1': $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id"; $where = "T1.id IS NULL"; @@ -347,8 +343,9 @@ "alias_visible" => $aliasvisible ); - if ($id != '') + if ($id != '') { $dbInsert["id"] = $id; + } $key = $modx->db->insert($dbInsert, $tbl_site_content); @@ -372,11 +369,11 @@ foreach ($document_groups as $value_pair) { // first, split the pair (this is a new document, so ignore the second value list($group) = explode(',', $value_pair); // @see actions/mutate_content.dynamic.php @ line 1138 (permissions list) - $new_groups[] = '('.(int) $group.','.$key.')'; + $new_groups[] = '(' . (int) $group . ',' . $key . ')'; } $saved = true; if (!empty($new_groups)) { - $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES ".implode(',', $new_groups)); + $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES " . implode(',', $new_groups)); } } else { $isManager = $modx->hasPermission('access_permissions'); @@ -406,11 +403,11 @@ )); // secure web documents - flag as private - include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php"; + include MODX_MANAGER_PATH . "includes/secure_web_documents.inc.php"; secureWebDocument($key); // secure manager documents - flag as private - include MODX_MANAGER_PATH."includes/secure_mgr_documents.inc.php"; + include MODX_MANAGER_PATH . "includes/secure_mgr_documents.inc.php"; secureMgrDocument($key); // Set the item name for logger @@ -424,12 +421,14 @@ // redirect/stay options if ($_POST['stay'] != '') { // weblink - if ($_POST['mode'] == "72") + if ($_POST['mode'] == "72") { $a = ($_POST['stay'] == '2') ? "27&id=$key" : "72&pid=$parent"; + } // document - if ($_POST['mode'] == "4") + if ($_POST['mode'] == "4") { $a = ($_POST['stay'] == '2') ? "27&id=$key" : "4&pid=$parent"; - $header = "Location: index.php?a=".$a."&r=1&stay=".$_POST['stay']; + } + $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay']; } else { $header = "Location: index.php?a=3&id=$key&r=1"; } @@ -443,7 +442,7 @@ break; - case 'edit' : + case 'edit': // get the document's current parent $oldparent = $existingDocument['parent']; @@ -489,10 +488,10 @@ if (!$was_published && $published) { $publishedon = $currentdate; $publishedby = $modx->getLoginUserID(); - }elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { + } elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { $publishedon = $pub_date; $publishedby = $modx->getLoginUserID(); - }elseif ($was_published && !$published) { + } elseif ($was_published && !$published) { $publishedon = 0; $publishedby = 0; } else { @@ -501,7 +500,7 @@ } // invoke OnBeforeDocFormSave event - $modx->invokeEvent("OnBeforeDocFormSave", array ( + $modx->invokeEvent("OnBeforeDocFormSave", array( "mode" => "upd", "id" => $id )); @@ -535,12 +534,11 @@ . "donthit={$donthit}, " . "menutitle='{$menutitle}', " . "hidemenu={$hidemenu}, " - . "alias_visible={$aliasvisible}" - , $tbl_site_content, "id='{$id}'"); + . "alias_visible={$aliasvisible}", $tbl_site_content, "id='{$id}'"); // update template variables $rs = $modx->db->select('id, tmplvarid', $tbl_site_tmplvar_contentvalues, "contentid='{$id}'"); - $tvIds = array (); + $tvIds = array(); while ($row = $modx->db->getRow($rs)) { $tvIds[$row['tmplvarid']] = $row['id']; } @@ -548,7 +546,9 @@ $tvChanges = array(); foreach ($tmplvars as $field => $value) { if (!is_array($value)) { - if (isset($tvIds[$value])) $tvDeletions[] = $tvIds[$value]; + if (isset($tvIds[$value])) { + $tvDeletions[] = $tvIds[$value]; + } } else { $tvId = $value[0]; $tvVal = $value[1]; @@ -562,7 +562,7 @@ } if (!empty($tvDeletions)) { - $modx->db->delete($tbl_site_tmplvar_contentvalues, 'id IN('.implode(',', $tvDeletions).')'); + $modx->db->delete($tbl_site_tmplvar_contentvalues, 'id IN(' . implode(',', $tvDeletions) . ')'); } if (!empty($tvAdded)) { @@ -593,10 +593,12 @@ 'groups.id, groups.document_group', "{$tbl_document_groups} AS groups LEFT JOIN {$tbl_documentgroup_names} AS dgn ON dgn.id = groups.document_group", - "((1=".(int)$isManager." AND dgn.private_memgroup) OR (1=".(int)$isWeb." AND dgn.private_webgroup)) AND groups.document = '{$id}'" + "((1=" . (int)$isManager . " AND dgn.private_memgroup) OR (1=" . (int)$isWeb . " AND dgn.private_webgroup)) AND groups.document = '{$id}'" ); $old_groups = array(); - while ($row = $modx->db->getRow($rs)) $old_groups[$row['document_group']] = $row['id']; + while ($row = $modx->db->getRow($rs)) { + $old_groups[$row['document_group']] = $row['id']; + } // update the permissions in the database $insertions = $deletions = array(); @@ -605,14 +607,14 @@ unset($old_groups[$group]); continue; } elseif ($link_id == 'new') { - $insertions[] = '('.(int)$group.','.$id.')'; + $insertions[] = '(' . (int)$group . ',' . $id . ')'; } } if (!empty($insertions)) { - $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES ".implode(',', $insertions)); + $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES " . implode(',', $insertions)); } if (!empty($old_groups)) { - $modx->db->delete($tbl_document_groups, "id IN (".implode(',', $old_groups).")"); + $modx->db->delete($tbl_document_groups, "id IN (" . implode(',', $old_groups) . ")"); } // necessary to remove all permissions as document is public if ((isset($_POST['chkalldocs']) && $_POST['chkalldocs'] == 'on')) { @@ -637,7 +639,7 @@ // invoke OnDocFormSave event - $modx->invokeEvent("OnDocFormSave", array ( + $modx->invokeEvent("OnDocFormSave", array( "mode" => "upd", "id" => $id )); @@ -658,9 +660,9 @@ $modx->clearCache('full'); } - if ($_POST['refresh_preview'] == '1') - $header = "Location: ".MODX_SITE_URL."index.php?id=$id&z=manprev"; - else { + if ($_POST['refresh_preview'] == '1') { + $header = "Location: " . MODX_SITE_URL . "index.php?id=$id&z=manprev"; + } else { if ($_POST['stay'] != '2' && $id > 0) { $modx->unlockElement(7, $id); } @@ -673,18 +675,18 @@ // document $a = ($_POST['stay'] == '2') ? "27&id=$id" : "4&pid=$parent"; } - $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay'].$add_path; + $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay'] . $add_path; } else { - $header = "Location: index.php?a=3&id=$id&r=1".$add_path; + $header = "Location: index.php?a=3&id=$id&r=1" . $add_path; } } if (headers_sent()) { - $header = str_replace('Location: ','',$header); + $header = str_replace('Location: ', '', $header); echo "\n"; } else { header($header); } break; - default : + default: $modx->webAlertAndQuit("No operation set in request."); } diff --git a/manager/processors/save_htmlsnippet.processor.php b/manager/processors/save_htmlsnippet.processor.php index f23421ba90..ff40879a34 100755 --- a/manager/processors/save_htmlsnippet.processor.php +++ b/manager/processors/save_htmlsnippet.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_chunk')) { diff --git a/manager/processors/save_module.processor.php b/manager/processors/save_module.processor.php index ada5f818de..1e12674098 100755 --- a/manager/processors/save_module.processor.php +++ b/manager/processors/save_module.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_module')) { diff --git a/manager/processors/save_password.processor.php b/manager/processors/save_password.processor.php index c9db342473..a99d264c83 100755 --- a/manager/processors/save_password.processor.php +++ b/manager/processors/save_password.processor.php @@ -1,36 +1,36 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('save_password')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('save_password')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = $_POST['id']; $pass1 = $_POST['pass1']; $pass2 = $_POST['pass2']; -if($pass1!=$pass2){ - $modx->webAlertAndQuit("Passwords don't match!"); +if ($pass1!=$pass2) { + $modx->webAlertAndQuit("Passwords don't match!"); } -if(strlen($pass1)<6){ - $modx->webAlertAndQuit("Password is too short. Please specify a password of at least 6 characters."); +if (strlen($pass1)<6) { + $modx->webAlertAndQuit("Password is too short. Please specify a password of at least 6 characters."); } $pass1 = $modx->htmlspecialchars($pass1, ENT_NOQUOTES); - $tbl_manager_users = $modx->getFullTableName('manager_users'); - $uid = $modx->getLoginUserID(); - $modx->loadExtension('phpass'); - $f['password'] = $modx->phpass->HashPassword($pass1); - $modx->db->update($f,$tbl_manager_users,"id='{$uid}'"); + $tbl_manager_users = $modx->getFullTableName('manager_users'); + $uid = $modx->getLoginUserID(); + $modx->loadExtension('phpass'); + $f['password'] = $modx->phpass->HashPassword($pass1); + $modx->db->update($f, $tbl_manager_users, "id='{$uid}'"); - // invoke OnManagerChangePassword event - $modx->invokeEvent('OnManagerChangePassword', array ( - 'userid' => $uid, - 'username' => $_SESSION['mgrShortname'], - 'userpassword' => $pass1 - )); + // invoke OnManagerChangePassword event + $modx->invokeEvent('OnManagerChangePassword', array( + 'userid' => $uid, + 'username' => $_SESSION['mgrShortname'], + 'userpassword' => $pass1 + )); $header="Location: index.php?a=2"; header($header); diff --git a/manager/processors/save_plugin.processor.php b/manager/processors/save_plugin.processor.php index 1d25a72b8e..e0edf20e1b 100755 --- a/manager/processors/save_plugin.processor.php +++ b/manager/processors/save_plugin.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly.'); } if (!$modx->hasPermission('save_plugin')) { @@ -177,7 +177,9 @@ function saveEventListeners($id, $sysevents, $mode) // save selected system events $formEventList = array(); foreach ($sysevents as $evtId) { - if(!preg_match('@^[1-9][0-9]*$@',$evtId)) $evtId = getEventIdByName($evtId); + if (!preg_match('@^[1-9][0-9]*$@', $evtId)) { + $evtId = getEventIdByName($evtId); + } if ($mode == '101') { $rs = $modx->db->select('max(priority) as priority', '[+prefix+]site_plugin_events', "evtid='{$evtId}'"); } else { @@ -202,13 +204,17 @@ function saveEventListeners($id, $sysevents, $mode) $rs = $modx->db->select('*', '[+prefix+]site_plugin_events', sprintf("pluginid='%s'", $id)); $dbEventList = array(); $del = array(); - while($row = $modx->db->getRow($rs)) { - if(!in_array($row['evtid'], $evtids)) $del[] = $row['evtid']; + while ($row = $modx->db->getRow($rs)) { + if (!in_array($row['evtid'], $evtids)) { + $del[] = $row['evtid']; + } } - if(empty($del)) return; + if (empty($del)) { + return; + } - foreach($del as $delid) { + foreach ($del as $delid) { $modx->db->delete('[+prefix+]site_plugin_events', sprintf("evtid='%s' AND pluginid='%s'", $delid, $id)); } } @@ -222,7 +228,9 @@ function getEventIdByName($name) $modx = evolutionCMS(); static $eventIds=array(); - if(isset($eventIds[$name])) return $eventIds[$name]; + if (isset($eventIds[$name])) { + return $eventIds[$name]; + } $rs = $modx->db->select('id, name', '[+prefix+]system_eventnames'); while ($row = $modx->db->getRow($rs)) { @@ -231,4 +239,3 @@ function getEventIdByName($name) return $eventIds[$name]; } - diff --git a/manager/processors/save_role.processor.php b/manager/processors/save_role.processor.php index 1d4f55c83a..45c6398b35 100755 --- a/manager/processors/save_role.processor.php +++ b/manager/processors/save_role.processor.php @@ -1,135 +1,135 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('save_role')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('save_role')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } extract($_POST); -if($name == '' || !isset ($name)) { - $modx->webAlertAndQuit("Please enter a name for this role!", "index.php?a={$mode}" . ($mode = 35 ? "&id={$id}" : "")); +if ($name == '' || !isset($name)) { + $modx->webAlertAndQuit("Please enter a name for this role!", "index.php?a={$mode}" . ($mode = 35 ? "&id={$id}" : "")); } // setup fields $fields = array( - 'name' => $name, - 'description' => $description, - 'frames' => $frames, - 'home' => $home, - 'view_document' => $view_document, - 'new_document' => $new_document, - 'save_document' => $save_document, - 'publish_document' => $publish_document, - 'delete_document' => $delete_document, - 'empty_trash' => $empty_trash, - 'action_ok' => $action_ok, - 'logout' => $logout, - 'help' => $help, - 'messages' => $messages, - 'new_user' => $new_user, - 'edit_user' => $edit_user, - 'logs' => $logs, - 'edit_parser' => (isset ($edit_parser)) ? $edit_parser : '0', - 'save_parser' => (isset ($save_parser)) ? $save_parser : '0', - 'edit_template' => $edit_template, - 'settings' => $settings, - 'credits' => $credits, - 'new_template' => $new_template, - 'save_template' => $save_template, - 'delete_template' => $delete_template, - 'edit_snippet' => $edit_snippet, - 'new_snippet' => $new_snippet, - 'save_snippet' => $save_snippet, - 'delete_snippet' => $delete_snippet, - 'edit_chunk' => $edit_chunk, - 'new_chunk' => $new_chunk, - 'save_chunk' => $save_chunk, - 'delete_chunk' => $delete_chunk, - 'empty_cache' => $empty_cache, - 'edit_document' => $edit_document, - 'change_password' => $change_password, - 'error_dialog' => $error_dialog, - 'about' => $about, - 'file_manager' => $file_manager, - 'assets_files' => $assets_files, - 'assets_images' => $assets_images, - 'save_user' => $save_user, - 'delete_user' => $delete_user, - 'save_password' => $save_password, - 'edit_role' => $edit_role, - 'save_role' => $save_role, - 'delete_role' => $delete_role, - 'new_role' => $new_role, - 'access_permissions' => $access_permissions, - 'bk_manager' => $bk_manager, - 'new_plugin' => $new_plugin, - 'edit_plugin' => $edit_plugin, - 'save_plugin' => $save_plugin, - 'delete_plugin' => $delete_plugin, - 'new_module' => $new_module, - 'edit_module' => $edit_module, - 'save_module' => $save_module, - 'delete_module' => $delete_module, - 'exec_module' => $exec_module, - 'view_eventlog' => $view_eventlog, - 'delete_eventlog' => $delete_eventlog, - 'new_web_user' => $new_web_user, - 'edit_web_user' => $edit_web_user, - 'save_web_user' => $save_web_user, - 'delete_web_user' => $delete_web_user, - 'web_access_permissions' => $web_access_permissions, - 'view_unpublished' => $view_unpublished, - 'import_static' => $import_static, - 'export_static' => $export_static, - 'remove_locks' => $remove_locks, - 'display_locks' => $display_locks, - 'change_resourcetype' => $change_resourcetype, - 'category_manager' => $category_manager + 'name' => $name, + 'description' => $description, + 'frames' => $frames, + 'home' => $home, + 'view_document' => $view_document, + 'new_document' => $new_document, + 'save_document' => $save_document, + 'publish_document' => $publish_document, + 'delete_document' => $delete_document, + 'empty_trash' => $empty_trash, + 'action_ok' => $action_ok, + 'logout' => $logout, + 'help' => $help, + 'messages' => $messages, + 'new_user' => $new_user, + 'edit_user' => $edit_user, + 'logs' => $logs, + 'edit_parser' => (isset($edit_parser)) ? $edit_parser : '0', + 'save_parser' => (isset($save_parser)) ? $save_parser : '0', + 'edit_template' => $edit_template, + 'settings' => $settings, + 'credits' => $credits, + 'new_template' => $new_template, + 'save_template' => $save_template, + 'delete_template' => $delete_template, + 'edit_snippet' => $edit_snippet, + 'new_snippet' => $new_snippet, + 'save_snippet' => $save_snippet, + 'delete_snippet' => $delete_snippet, + 'edit_chunk' => $edit_chunk, + 'new_chunk' => $new_chunk, + 'save_chunk' => $save_chunk, + 'delete_chunk' => $delete_chunk, + 'empty_cache' => $empty_cache, + 'edit_document' => $edit_document, + 'change_password' => $change_password, + 'error_dialog' => $error_dialog, + 'about' => $about, + 'file_manager' => $file_manager, + 'assets_files' => $assets_files, + 'assets_images' => $assets_images, + 'save_user' => $save_user, + 'delete_user' => $delete_user, + 'save_password' => $save_password, + 'edit_role' => $edit_role, + 'save_role' => $save_role, + 'delete_role' => $delete_role, + 'new_role' => $new_role, + 'access_permissions' => $access_permissions, + 'bk_manager' => $bk_manager, + 'new_plugin' => $new_plugin, + 'edit_plugin' => $edit_plugin, + 'save_plugin' => $save_plugin, + 'delete_plugin' => $delete_plugin, + 'new_module' => $new_module, + 'edit_module' => $edit_module, + 'save_module' => $save_module, + 'delete_module' => $delete_module, + 'exec_module' => $exec_module, + 'view_eventlog' => $view_eventlog, + 'delete_eventlog' => $delete_eventlog, + 'new_web_user' => $new_web_user, + 'edit_web_user' => $edit_web_user, + 'save_web_user' => $save_web_user, + 'delete_web_user' => $delete_web_user, + 'web_access_permissions' => $web_access_permissions, + 'view_unpublished' => $view_unpublished, + 'import_static' => $import_static, + 'export_static' => $export_static, + 'remove_locks' => $remove_locks, + 'display_locks' => $display_locks, + 'change_resourcetype' => $change_resourcetype, + 'category_manager' => $category_manager ); $fields = $modx->db->escape($fields); -switch($_POST['mode']) { - case '38' : - $tbl = $modx->getFullTableName("user_roles"); +switch ($_POST['mode']) { + case '38': + $tbl = $modx->getFullTableName("user_roles"); - // disallow duplicate names for role - $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}'"); - if($modx->db->getValue($rs) > 0) { - $modx->manager->saveFormValues(38); - $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=38"); - } + // disallow duplicate names for role + $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}'"); + if ($modx->db->getValue($rs) > 0) { + $modx->manager->saveFormValues(38); + $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=38"); + } - $modx->db->insert($fields, $tbl); + $modx->db->insert($fields, $tbl); - // Set the item name for logger - $_SESSION['itemname'] = $_POST['name']; + // Set the item name for logger + $_SESSION['itemname'] = $_POST['name']; - $header = "Location: index.php?a=86&r=2"; - header($header); - break; - case '35' : - $tbl = $modx->getFullTableName("user_roles"); + $header = "Location: index.php?a=86&r=2"; + header($header); + break; + case '35': + $tbl = $modx->getFullTableName("user_roles"); - // disallow duplicate names for role - $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}' AND id!='{$id}'"); - if($modx->db->getValue($rs) > 0) { - $modx->manager->saveFormValues(35); - $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=35&id={$id}"); - } + // disallow duplicate names for role + $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}' AND id!='{$id}'"); + if ($modx->db->getValue($rs) > 0) { + $modx->manager->saveFormValues(35); + $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=35&id={$id}"); + } - $modx->db->update($fields, $tbl, "id='{$id}'"); + $modx->db->update($fields, $tbl, "id='{$id}'"); - // Set the item name for logger - $_SESSION['itemname'] = $_POST['name']; + // Set the item name for logger + $_SESSION['itemname'] = $_POST['name']; - $header = "Location: index.php?a=86&r=2"; - header($header); - break; - default : - $modx->webAlertAndQuit("No operation set in request."); + $header = "Location: index.php?a=86&r=2"; + header($header); + break; + default: + $modx->webAlertAndQuit("No operation set in request."); } $modx->unlockElement(8, $id); diff --git a/manager/processors/save_settings.processor.php b/manager/processors/save_settings.processor.php index ebe7c6f654..ee4316e82f 100755 --- a/manager/processors/save_settings.processor.php +++ b/manager/processors/save_settings.processor.php @@ -1,159 +1,152 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('settings')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('settings')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $data = $_POST; // lose the POST now, gets rid of quirky issue with Safari 3 - see FS#972 unset($_POST); -if($data['friendly_urls']==='1' && strpos($_SERVER['SERVER_SOFTWARE'],'IIS')===false) -{ - $htaccess = $modx->config['base_path'] . '.htaccess'; - $sample_htaccess = $modx->config['base_path'] . 'ht.access'; - $dir = '/' . trim($modx->config['base_url'],'/'); - if(is_file($htaccess)) - { - $_ = file_get_contents($htaccess); - if(strpos($_,'RewriteBase')===false) - { - $warnings[] = $_lang["settings_friendlyurls_alert2"]; - } - elseif(is_writable($htaccess)) - { - $_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_); - if(!@file_put_contents($htaccess,$_)) - { - $warnings[] = $_lang["settings_friendlyurls_alert2"]; - } - } - } - elseif(is_file($sample_htaccess)) - { - if(!@rename($sample_htaccess,$htaccess)) - { - $warnings[] = $_lang["settings_friendlyurls_alert"]; - } - elseif($modx->config['base_url']!=='/') - { - $_ = file_get_contents($htaccess); - $_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_); - if(!@file_put_contents($htaccess,$_)) - { - $warnings[] = $_lang["settings_friendlyurls_alert2"]; - } - } - } +if ($data['friendly_urls']==='1' && strpos($_SERVER['SERVER_SOFTWARE'], 'IIS')===false) { + $htaccess = $modx->config['base_path'] . '.htaccess'; + $sample_htaccess = $modx->config['base_path'] . 'ht.access'; + $dir = '/' . trim($modx->config['base_url'], '/'); + if (is_file($htaccess)) { + $_ = file_get_contents($htaccess); + if (strpos($_, 'RewriteBase')===false) { + $warnings[] = $_lang["settings_friendlyurls_alert2"]; + } elseif (is_writable($htaccess)) { + $_ = preg_replace('@RewriteBase.+@', "RewriteBase {$dir}", $_); + if (!@file_put_contents($htaccess, $_)) { + $warnings[] = $_lang["settings_friendlyurls_alert2"]; + } + } + } elseif (is_file($sample_htaccess)) { + if (!@rename($sample_htaccess, $htaccess)) { + $warnings[] = $_lang["settings_friendlyurls_alert"]; + } elseif ($modx->config['base_url']!=='/') { + $_ = file_get_contents($htaccess); + $_ = preg_replace('@RewriteBase.+@', "RewriteBase {$dir}", $_); + if (!@file_put_contents($htaccess, $_)) { + $warnings[] = $_lang["settings_friendlyurls_alert2"]; + } + } + } } if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { unlink(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css'); } -$data['filemanager_path'] = str_replace('[(base_path)]',MODX_BASE_PATH,$data['filemanager_path']); -$data['rb_base_dir'] = str_replace('[(base_path)]',MODX_BASE_PATH,$data['rb_base_dir']); +$data['filemanager_path'] = str_replace('[(base_path)]', MODX_BASE_PATH, $data['filemanager_path']); +$data['rb_base_dir'] = str_replace('[(base_path)]', MODX_BASE_PATH, $data['rb_base_dir']); if (isset($data) && count($data) > 0) { - if(isset($data['manager_language'])) { - $lang_path = MODX_MANAGER_PATH . 'includes/lang/' . $data['manager_language'] . '.inc.php'; - if(is_file($lang_path)) { - include($lang_path); + if (isset($data['manager_language'])) { + $lang_path = MODX_MANAGER_PATH . 'includes/lang/' . $data['manager_language'] . '.inc.php'; + if (is_file($lang_path)) { + include($lang_path); global $modx_lang_attribute; $data['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute; - } - } - $savethese = array(); - $data['sys_files_checksum'] = $modx->manager->getSystemChecksum($data['check_files_onlogin']); - $data['mail_check_timeperiod'] = (int)$data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute - foreach ($data as $k => $v) { - switch ($k) { - case 'site_name': - $v = htmlspecialchars($v); - break; + } + } + $savethese = array(); + $data['sys_files_checksum'] = $modx->manager->getSystemChecksum($data['check_files_onlogin']); + $data['mail_check_timeperiod'] = (int)$data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute + foreach ($data as $k => $v) { + switch ($k) { + case 'site_name': + $v = htmlspecialchars($v); + break; case 'settings_version':{ - if($modx->getVersionData('version')!=$data['settings_version']){ - $modx->logEvent(17,2,'
    '.var_export($data['settings_version'],true).'
    ','fake settings_version'); + if ($modx->getVersionData('version')!=$data['settings_version']) { + $modx->logEvent(17, 2, '
    ' . var_export($data['settings_version'], true) . '
    ', 'fake settings_version'); $v = $modx->getVersionData('version'); } break; } - case 'error_page': - case 'unauthorized_page': - if (trim($v) == '' || !is_numeric($v)) { - $v = $data['site_start']; - } - break; + case 'error_page': + case 'unauthorized_page': + if (trim($v) == '' || !is_numeric($v)) { + $v = $data['site_start']; + } + break; - case 'lst_custom_contenttype': - case 'txt_custom_contenttype': - // Skip these - $k = ''; - break; - case 'rb_base_dir': - case 'rb_base_url': - case 'filemanager_path': - $v = trim($v); - $v = rtrim($v,'/') . '/'; - break; + case 'lst_custom_contenttype': + case 'txt_custom_contenttype': + // Skip these + $k = ''; + break; + case 'rb_base_dir': + case 'rb_base_url': + case 'filemanager_path': + $v = trim($v); + $v = rtrim($v, '/') . '/'; + break; case 'manager_language': $langDir = realpath(MODX_MANAGER_PATH . 'includes/lang'); $langFile = realpath(MODX_MANAGER_PATH . 'includes/lang/' . $v . '.inc.php'); $langFileDir = dirname($langFile); - if($langDir !== $langFileDir || !file_exists($langFile)) { + if ($langDir !== $langFileDir || !file_exists($langFile)) { $v = 'english'; } - break; - case 'smtppw': - if ($v !== '********************' && $v !== '') { - $v = trim($v); - $v = base64_encode($v) . substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7); - $v = str_replace('=','%',$v); - } elseif ($v === '********************') { - $k = ''; - } - break; + break; + case 'smtppw': + if ($v !== '********************' && $v !== '') { + $v = trim($v); + $v = base64_encode($v) . substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7); + $v = str_replace('=', '%', $v); + } elseif ($v === '********************') { + $k = ''; + } + break; case 'valid_hostnames': - $v = str_replace(array(' ,', ', '), ',', $v); - if ($v !== ',') { - $v = ($v != 'MODX_SITE_HOSTNAMES') ? $v : ''; - $configString = 'config[$k] = $v; + $modx->config[$k] = $v; - if(!empty($k)) $savethese[] = '(\''.$modx->db->escape($k).'\', \''.$modx->db->escape($v).'\')'; - } + if (!empty($k)) { + $savethese[] = '(\'' . $modx->db->escape($k) . '\', \'' . $modx->db->escape($v) . '\')'; + } + } - // Run a single query to save all the values - $sql = "REPLACE INTO ".$modx->getFullTableName("system_settings")." (setting_name, setting_value) - VALUES ".implode(', ', $savethese); - $modx->db->query($sql); + // Run a single query to save all the values + $sql = "REPLACE INTO " . $modx->getFullTableName("system_settings") . " (setting_name, setting_value) + VALUES " . implode(', ', $savethese); + $modx->db->query($sql); - // Reset Template Pages - if (isset($data['reset_template'])) { - $newtemplate = (int)$data['default_template']; - $oldtemplate = (int)$data['old_template']; - $tbl = $modx->getFullTableName('site_content'); - $reset = $data['reset_template']; - if($reset==1) $modx->db->update(array('template' => $newtemplate), $tbl, "type='document'"); - else if($reset==2) $modx->db->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'"); - } + // Reset Template Pages + if (isset($data['reset_template'])) { + $newtemplate = (int)$data['default_template']; + $oldtemplate = (int)$data['old_template']; + $tbl = $modx->getFullTableName('site_content'); + $reset = $data['reset_template']; + if ($reset==1) { + $modx->db->update(array('template' => $newtemplate), $tbl, "type='document'"); + } elseif ($reset==2) { + $modx->db->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'"); + } + } - // empty cache - $modx->clearCache('full'); + // empty cache + $modx->clearCache('full'); } $header="Location: index.php?a=7&r=10"; header($header); diff --git a/manager/processors/save_snippet.processor.php b/manager/processors/save_snippet.processor.php index 28bdfe12a0..e681e48f40 100755 --- a/manager/processors/save_snippet.processor.php +++ b/manager/processors/save_snippet.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_snippet')) { diff --git a/manager/processors/save_template.processor.php b/manager/processors/save_template.processor.php index ed4dca716c..0a6d6cc6ef 100755 --- a/manager/processors/save_template.processor.php +++ b/manager/processors/save_template.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_template')) { diff --git a/manager/processors/save_tmplvars.processor.php b/manager/processors/save_tmplvars.processor.php index 8d05b975e0..74c365afa2 100755 --- a/manager/processors/save_tmplvars.processor.php +++ b/manager/processors/save_tmplvars.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_template')) { @@ -13,7 +13,7 @@ $type = $modx->db->escape($_POST['type']); $elements = $modx->db->escape($_POST['elements']); $default_text = $modx->db->escape($_POST['default_text']); -$rank = isset ($_POST['rank']) ? $modx->db->escape($_POST['rank']) : 0; +$rank = isset($_POST['rank']) ? $modx->db->escape($_POST['rank']) : 0; $display = $modx->db->escape($_POST['display']); $params = $modx->db->escape($_POST['params']); $locked = $_POST['locked'] == 'on' ? 1 : 0; @@ -213,7 +213,8 @@ function saveTemplateVarAccess() function saveDocumentAccessPermissons() { global $id, $newid; - $modx = evolutionCMS(); global $use_udperms; + $modx = evolutionCMS(); + global $use_udperms; $tbl_site_tmplvar_templates = $modx->getFullTableName('site_tmplvar_access'); diff --git a/manager/processors/save_user.processor.php b/manager/processors/save_user.processor.php index b853ee0b06..daf650acee 100755 --- a/manager/processors/save_user.processor.php +++ b/manager/processors/save_user.processor.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('save_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('save_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $modx->loadExtension('phpass'); @@ -16,7 +16,7 @@ $id = (int)$input['id']; $oldusername = $input['oldusername']; -$newusername = !empty ($input['newusername']) ? trim($input['newusername']) : "New User"; +$newusername = !empty($input['newusername']) ? trim($input['newusername']) : "New User"; $fullname = $input['fullname']; $genpassword = $input['newpassword']; $passwordgenmethod = $input['passwordgenmethod']; @@ -27,7 +27,7 @@ $phone = $input['phone']; $mobilephone = $input['mobilephone']; $fax = $input['fax']; -$dob = !empty ($input['dob']) ? $modx->toTimeStamp($input['dob']) : 0; +$dob = !empty($input['dob']) ? $modx->toTimeStamp($input['dob']) : 0; $country = $input['country']; $street = $input['street']; $city = $input['city']; @@ -44,135 +44,133 @@ $user_groups = $input['user_groups']; // verify password -if($passwordgenmethod == "spec" && $input['specifiedpassword'] != $input['confirmpassword']) { - webAlertAndQuit("Password typed is mismatched"); +if ($passwordgenmethod == "spec" && $input['specifiedpassword'] != $input['confirmpassword']) { + webAlertAndQuit("Password typed is mismatched"); } // verify email -if($email == '' || !preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,24}$/i", $email)) { - webAlertAndQuit("E-mail address doesn't seem to be valid!"); +if ($email == '' || !preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,24}$/i", $email)) { + webAlertAndQuit("E-mail address doesn't seem to be valid!"); } // verify admin security -if($_SESSION['mgrRole'] != 1) { - // Check to see if user tried to spoof a "1" (admin) role - if(!$modx->hasPermission('save_role')) { - webAlertAndQuit("Illegal attempt to create/modify administrator by non-administrator!"); - } - // Verify that the user being edited wasn't an admin and the user ID got spoofed - $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, "internalKey='{$id}' AND role=1"); - $limit = $modx->db->getValue($rs); - if($limit > 0) { - webAlertAndQuit("You cannot alter an administrative user."); - } - +if ($_SESSION['mgrRole'] != 1) { + // Check to see if user tried to spoof a "1" (admin) role + if (!$modx->hasPermission('save_role')) { + webAlertAndQuit("Illegal attempt to create/modify administrator by non-administrator!"); + } + // Verify that the user being edited wasn't an admin and the user ID got spoofed + $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, "internalKey='{$id}' AND role=1"); + $limit = $modx->db->getValue($rs); + if ($limit > 0) { + webAlertAndQuit("You cannot alter an administrative user."); + } } -switch($input['mode']) { - case '11' : // new user - // check if this user name already exist - $rs = $modx->db->select('count(id)', $tbl_manager_users, sprintf("username='%s'", $modx->db->escape($newusername))); - $limit = $modx->db->getValue($rs); - if($limit > 0) { - webAlertAndQuit("User name is already in use!"); - } - - // check if the email address already exist - $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, sprintf("email='%s' AND id!='%s'", $modx->db->escape($email), $id)); - $limit = $modx->db->getValue($rs); - if($limit > 0) { - webAlertAndQuit("Email is already in use!"); - } - - // generate a new password for this user - if($specifiedpassword != "" && $passwordgenmethod == "spec") { - if(strlen($specifiedpassword) < 6) { - webAlertAndQuit("Password is too short!"); - } else { - $newpassword = $specifiedpassword; - } - } elseif($specifiedpassword == "" && $passwordgenmethod == "spec") { - webAlertAndQuit("You didn't specify a password for this user!"); - } elseif($passwordgenmethod == 'g') { - $newpassword = generate_password(8); - } else { - webAlertAndQuit("No password generation method specified!"); - } - - // invoke OnBeforeUserFormSave event - $modx->invokeEvent("OnBeforeUserFormSave", array( - "mode" => "new", - )); - - // create the user account - $internalKey = $modx->db->insert(array('username' => $modx->db->escape($newusername)), $tbl_manager_users); - - $field = array(); - $field['password'] = $modx->phpass->HashPassword($newpassword); - $modx->db->update($field, $tbl_manager_users, "id='{$internalKey}'"); - - $field = compact('internalKey', 'fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'blocked', 'blockeduntil', 'blockedafter'); - $field = $modx->db->escape($field); - $modx->db->insert($field, $tbl_user_attributes); - - // Save user settings - saveUserSettings($internalKey); - - // invoke OnManagerSaveUser event - $modx->invokeEvent("OnManagerSaveUser", array( - "mode" => "new", - "userid" => $internalKey, - "username" => $newusername, - "userpassword" => $newpassword, - "useremail" => $email, - "userfullname" => $fullname, - "userroleid" => $role - )); - - // invoke OnUserFormSave event - $modx->invokeEvent("OnUserFormSave", array( - "mode" => "new", - "id" => $internalKey - )); - - // Set the item name for logger - $_SESSION['itemname'] = $newusername; - - /*******************************************************************************/ - // put the user in the user_groups he/ she should be in - // first, check that up_perms are switched on! - if($use_udperms == 1) { - if(!empty($user_groups)) { - for($i = 0; $i < count($user_groups); $i++) { - $f = array(); - $f['user_group'] = (int)$user_groups[$i]; - $f['member'] = $internalKey; - $modx->db->insert($f, $tbl_member_groups); - } - } - } - // end of user_groups stuff! - - if($passwordnotifymethod == 'e') { - sendMailMessage($email, $newusername, $newpassword, $fullname); - if($input['stay'] != '') { - $a = ($input['stay'] == '2') ? "12&id={$internalKey}" : "11"; - $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay']; - header($header); - } else { - $header = "Location: index.php?a=75&r=2"; - header($header); - } - } else { - if($input['stay'] != '') { - $a = ($input['stay'] == '2') ? "12&id={$internalKey}" : "11"; - $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; - } else { - $stayUrl = "index.php?a=75&r=2"; - } - - include_once "header.inc.php"; - ?> +switch ($input['mode']) { + case '11': // new user + // check if this user name already exist + $rs = $modx->db->select('count(id)', $tbl_manager_users, sprintf("username='%s'", $modx->db->escape($newusername))); + $limit = $modx->db->getValue($rs); + if ($limit > 0) { + webAlertAndQuit("User name is already in use!"); + } + + // check if the email address already exist + $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, sprintf("email='%s' AND id!='%s'", $modx->db->escape($email), $id)); + $limit = $modx->db->getValue($rs); + if ($limit > 0) { + webAlertAndQuit("Email is already in use!"); + } + + // generate a new password for this user + if ($specifiedpassword != "" && $passwordgenmethod == "spec") { + if (strlen($specifiedpassword) < 6) { + webAlertAndQuit("Password is too short!"); + } else { + $newpassword = $specifiedpassword; + } + } elseif ($specifiedpassword == "" && $passwordgenmethod == "spec") { + webAlertAndQuit("You didn't specify a password for this user!"); + } elseif ($passwordgenmethod == 'g') { + $newpassword = generate_password(8); + } else { + webAlertAndQuit("No password generation method specified!"); + } + + // invoke OnBeforeUserFormSave event + $modx->invokeEvent("OnBeforeUserFormSave", array( + "mode" => "new", + )); + + // create the user account + $internalKey = $modx->db->insert(array('username' => $modx->db->escape($newusername)), $tbl_manager_users); + + $field = array(); + $field['password'] = $modx->phpass->HashPassword($newpassword); + $modx->db->update($field, $tbl_manager_users, "id='{$internalKey}'"); + + $field = compact('internalKey', 'fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'blocked', 'blockeduntil', 'blockedafter'); + $field = $modx->db->escape($field); + $modx->db->insert($field, $tbl_user_attributes); + + // Save user settings + saveUserSettings($internalKey); + + // invoke OnManagerSaveUser event + $modx->invokeEvent("OnManagerSaveUser", array( + "mode" => "new", + "userid" => $internalKey, + "username" => $newusername, + "userpassword" => $newpassword, + "useremail" => $email, + "userfullname" => $fullname, + "userroleid" => $role + )); + + // invoke OnUserFormSave event + $modx->invokeEvent("OnUserFormSave", array( + "mode" => "new", + "id" => $internalKey + )); + + // Set the item name for logger + $_SESSION['itemname'] = $newusername; + + /*******************************************************************************/ + // put the user in the user_groups he/ she should be in + // first, check that up_perms are switched on! + if ($use_udperms == 1) { + if (!empty($user_groups)) { + for ($i = 0; $i < count($user_groups); $i++) { + $f = array(); + $f['user_group'] = (int)$user_groups[$i]; + $f['member'] = $internalKey; + $modx->db->insert($f, $tbl_member_groups); + } + } + } + // end of user_groups stuff! + + if ($passwordnotifymethod == 'e') { + sendMailMessage($email, $newusername, $newpassword, $fullname); + if ($input['stay'] != '') { + $a = ($input['stay'] == '2') ? "12&id={$internalKey}" : "11"; + $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay']; + header($header); + } else { + $header = "Location: index.php?a=75&r=2"; + header($header); + } + } else { + if ($input['stay'] != '') { + $a = ($input['stay'] == '2') ? "12&id={$internalKey}" : "11"; + $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; + } else { + $stayUrl = "index.php?a=75&r=2"; + } + + include_once "header.inc.php"; ?>

    @@ -194,125 +192,124 @@
    db->select('count(id)', $tbl_manager_users, sprintf("username='%s' AND id!='%s'", $modx->db->escape($newusername), $id)); - $limit = $modx->db->getValue($rs); - if($limit > 0) { - webAlertAndQuit("User name is already in use!"); - } - - // check if the email address already exists - $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, sprintf("email='%s' AND internalKey!='%s'", $modx->db->escape($email), $id)); - $limit = $modx->db->getValue($rs); - if($limit > 0) { - webAlertAndQuit("Email is already in use!"); - } - - // invoke OnBeforeUserFormSave event - $modx->invokeEvent("OnBeforeUserFormSave", array( - "mode" => "upd", - "id" => $id - )); - - // update user name and password - $field = array(); - $field['username'] = $modx->db->escape($newusername); - if($genpassword == 1) { - $field['password'] = $modx->phpass->HashPassword($newpassword); - } - $modx->db->update($field, $tbl_manager_users, "id='{$id}'"); - $field = compact('fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'failedlogincount', 'blocked', 'blockeduntil', 'blockedafter'); - $field = $modx->db->escape($field); - $modx->db->update($field, $tbl_user_attributes, "internalKey='{$id}'"); - - // Save user settings - saveUserSettings($id); - - // Set the item name for logger - $_SESSION['itemname'] = $newusername; - - // invoke OnManagerSaveUser event - $modx->invokeEvent("OnManagerSaveUser", array( - "mode" => "upd", - "userid" => $id, - "username" => $newusername, - "userpassword" => $newpassword, - "useremail" => $email, - "userfullname" => $fullname, - "userroleid" => $role, - "oldusername" => (($oldusername != $newusername) ? $oldusername : ""), - "olduseremail" => (($oldemail != $email) ? $oldemail : "") - )); - - // invoke OnManagerChangePassword event - if($genpassword == 1) { - $modx->invokeEvent("OnManagerChangePassword", array( - "userid" => $id, - "username" => $newusername, - "userpassword" => $newpassword - )); - } - - // invoke OnUserFormSave event - $modx->invokeEvent("OnUserFormSave", array( - "mode" => "upd", - "id" => $id - )); - - /*******************************************************************************/ - // put the user in the user_groups he/ she should be in - // first, check that up_perms are switched on! - if($use_udperms == 1) { - // as this is an existing user, delete his/ her entries in the groups before saving the new groups - $modx->db->delete($tbl_member_groups, "member='{$id}'"); - if(!empty($user_groups)) { - for($i = 0; $i < count($user_groups); $i++) { - $field = array(); - $field['user_group'] = (int)$user_groups[$i]; - $field['member'] = $id; - $modx->db->insert($field, $tbl_member_groups); - } - } - } - // end of user_groups stuff! - /*******************************************************************************/ - if($id == $modx->getLoginUserID() && ($genpassword !== 1 && $passwordnotifymethod != 's')) { - $modx->webAlertAndQuit($_lang["user_changeddata"], 'javascript:top.location.href="index.php?a=8";'); - } - if($genpassword == 1 && $passwordnotifymethod == 's') { - if($input['stay'] != '') { - $a = ($input['stay'] == '2') ? "12&id={$id}" : "11"; - $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; - } else { - $stayUrl = "index.php?a=75&r=2"; - } - - include_once "header.inc.php"; - ?> + include_once "footer.inc.php"; + } + break; + case '12': // edit user + // generate a new password for this user + if ($genpassword == 1) { + if ($specifiedpassword != "" && $passwordgenmethod == "spec") { + if (strlen($specifiedpassword) < 6) { + webAlertAndQuit("Password is too short!"); + } else { + $newpassword = $specifiedpassword; + } + } elseif ($specifiedpassword == "" && $passwordgenmethod == "spec") { + webAlertAndQuit("You didn't specify a password for this user!"); + } elseif ($passwordgenmethod == 'g') { + $newpassword = generate_password(8); + } else { + webAlertAndQuit("No password generation method specified!"); + } + } + if ($passwordnotifymethod == 'e') { + sendMailMessage($email, $newusername, $newpassword, $fullname); + } + + // check if the username already exist + $rs = $modx->db->select('count(id)', $tbl_manager_users, sprintf("username='%s' AND id!='%s'", $modx->db->escape($newusername), $id)); + $limit = $modx->db->getValue($rs); + if ($limit > 0) { + webAlertAndQuit("User name is already in use!"); + } + + // check if the email address already exists + $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, sprintf("email='%s' AND internalKey!='%s'", $modx->db->escape($email), $id)); + $limit = $modx->db->getValue($rs); + if ($limit > 0) { + webAlertAndQuit("Email is already in use!"); + } + + // invoke OnBeforeUserFormSave event + $modx->invokeEvent("OnBeforeUserFormSave", array( + "mode" => "upd", + "id" => $id + )); + + // update user name and password + $field = array(); + $field['username'] = $modx->db->escape($newusername); + if ($genpassword == 1) { + $field['password'] = $modx->phpass->HashPassword($newpassword); + } + $modx->db->update($field, $tbl_manager_users, "id='{$id}'"); + $field = compact('fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'failedlogincount', 'blocked', 'blockeduntil', 'blockedafter'); + $field = $modx->db->escape($field); + $modx->db->update($field, $tbl_user_attributes, "internalKey='{$id}'"); + + // Save user settings + saveUserSettings($id); + + // Set the item name for logger + $_SESSION['itemname'] = $newusername; + + // invoke OnManagerSaveUser event + $modx->invokeEvent("OnManagerSaveUser", array( + "mode" => "upd", + "userid" => $id, + "username" => $newusername, + "userpassword" => $newpassword, + "useremail" => $email, + "userfullname" => $fullname, + "userroleid" => $role, + "oldusername" => (($oldusername != $newusername) ? $oldusername : ""), + "olduseremail" => (($oldemail != $email) ? $oldemail : "") + )); + + // invoke OnManagerChangePassword event + if ($genpassword == 1) { + $modx->invokeEvent("OnManagerChangePassword", array( + "userid" => $id, + "username" => $newusername, + "userpassword" => $newpassword + )); + } + + // invoke OnUserFormSave event + $modx->invokeEvent("OnUserFormSave", array( + "mode" => "upd", + "id" => $id + )); + + /*******************************************************************************/ + // put the user in the user_groups he/ she should be in + // first, check that up_perms are switched on! + if ($use_udperms == 1) { + // as this is an existing user, delete his/ her entries in the groups before saving the new groups + $modx->db->delete($tbl_member_groups, "member='{$id}'"); + if (!empty($user_groups)) { + for ($i = 0; $i < count($user_groups); $i++) { + $field = array(); + $field['user_group'] = (int)$user_groups[$i]; + $field['member'] = $id; + $modx->db->insert($field, $tbl_member_groups); + } + } + } + // end of user_groups stuff! + /*******************************************************************************/ + if ($id == $modx->getLoginUserID() && ($genpassword !== 1 && $passwordnotifymethod != 's')) { + $modx->webAlertAndQuit($_lang["user_changeddata"], 'javascript:top.location.href="index.php?a=8";'); + } + if ($genpassword == 1 && $passwordnotifymethod == 's') { + if ($input['stay'] != '') { + $a = ($input['stay'] == '2') ? "12&id={$id}" : "11"; + $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; + } else { + $stayUrl = "index.php?a=75&r=2"; + } + + include_once "header.inc.php"; ?>

    @@ -332,20 +329,20 @@ "; - $param['subject'] = $emailsubject; - $param['body'] = $message; - $param['to'] = $email; - $param['type'] = 'text'; - $rs = $modx->sendmail($param); - if(!$rs) { - $modx->manager->saveFormValues(); - $modx->messageQuit("{$email} - {$_lang['error_sending_email']}"); - } +function sendMailMessage($email, $uid, $pwd, $ufn) +{ + $modx = evolutionCMS(); + global $_lang, $signupemail_message; + global $emailsubject, $emailsender; + global $site_name; + $manager_url = MODX_MANAGER_URL; + $message = sprintf($signupemail_message, $uid, $pwd); // use old method + // replace placeholders + $message = str_replace("[+uid+]", $uid, $message); + $message = str_replace("[+pwd+]", $pwd, $message); + $message = str_replace("[+ufn+]", $ufn, $message); + $message = str_replace("[+sname+]", $site_name, $message); + $message = str_replace("[+saddr+]", $emailsender, $message); + $message = str_replace("[+semail+]", $emailsender, $message); + $message = str_replace("[+surl+]", $manager_url, $message); + + $param = array(); + $param['from'] = "{$site_name}<{$emailsender}>"; + $param['subject'] = $emailsubject; + $param['body'] = $message; + $param['to'] = $email; + $param['type'] = 'text'; + $rs = $modx->sendmail($param); + if (!$rs) { + $modx->manager->saveFormValues(); + $modx->messageQuit("{$email} - {$_lang['error_sending_email']}"); + } } /** @@ -389,87 +388,88 @@ function sendMailMessage($email, $uid, $pwd, $ufn) { * * @param int $id */ -function saveUserSettings($id) { - $modx = evolutionCMS(); - $tbl_user_settings = $modx->getFullTableName('user_settings'); - - $ignore = array( - 'id', - 'oldusername', - 'oldemail', - 'newusername', - 'fullname', - 'newpassword', - 'newpasswordcheck', - 'passwordgenmethod', - 'passwordnotifymethod', - 'specifiedpassword', - 'confirmpassword', - 'email', - 'phone', - 'mobilephone', - 'fax', - 'dob', - 'country', - 'street', - 'city', - 'state', - 'zip', - 'gender', - 'photo', - 'comment', - 'role', - 'failedlogincount', - 'blocked', - 'blockeduntil', - 'blockedafter', - 'user_groups', - 'mode', - 'blockedmode', - 'stay', - 'save', - 'theme_refresher' - ); - - // determine which settings can be saved blank (based on 'default_{settingname}' POST checkbox values) - $defaults = array( - 'upload_images', - 'upload_media', - 'upload_flash', - 'upload_files' - ); - - // get user setting field names - $settings = array(); - foreach($_POST as $n => $v) { - if(in_array($n, $ignore) || (!in_array($n, $defaults) && is_scalar($v) && trim($v) == '') || (!in_array($n, $defaults) && is_array($v) && empty($v))) { - continue; - } // ignore blacklist and empties - $settings[$n] = $v; // this value should be saved - } - - foreach($defaults as $k) { - if(isset($settings['default_' . $k]) && $settings['default_' . $k] == '1') { - unset($settings[$k]); - } - unset($settings['default_' . $k]); - } - - $modx->db->delete($tbl_user_settings, "user='{$id}'"); - - foreach($settings as $n => $vl) { - if(is_array($vl)) { - $vl = implode(",", $vl); - } - if($vl != '') { - $f = array(); - $f['user'] = $id; - $f['setting_name'] = $n; - $f['setting_value'] = $vl; - $f = $modx->db->escape($f); - $modx->db->insert($f, $tbl_user_settings); - } - } +function saveUserSettings($id) +{ + $modx = evolutionCMS(); + $tbl_user_settings = $modx->getFullTableName('user_settings'); + + $ignore = array( + 'id', + 'oldusername', + 'oldemail', + 'newusername', + 'fullname', + 'newpassword', + 'newpasswordcheck', + 'passwordgenmethod', + 'passwordnotifymethod', + 'specifiedpassword', + 'confirmpassword', + 'email', + 'phone', + 'mobilephone', + 'fax', + 'dob', + 'country', + 'street', + 'city', + 'state', + 'zip', + 'gender', + 'photo', + 'comment', + 'role', + 'failedlogincount', + 'blocked', + 'blockeduntil', + 'blockedafter', + 'user_groups', + 'mode', + 'blockedmode', + 'stay', + 'save', + 'theme_refresher' + ); + + // determine which settings can be saved blank (based on 'default_{settingname}' POST checkbox values) + $defaults = array( + 'upload_images', + 'upload_media', + 'upload_flash', + 'upload_files' + ); + + // get user setting field names + $settings = array(); + foreach ($_POST as $n => $v) { + if (in_array($n, $ignore) || (!in_array($n, $defaults) && is_scalar($v) && trim($v) == '') || (!in_array($n, $defaults) && is_array($v) && empty($v))) { + continue; + } // ignore blacklist and empties + $settings[$n] = $v; // this value should be saved + } + + foreach ($defaults as $k) { + if (isset($settings['default_' . $k]) && $settings['default_' . $k] == '1') { + unset($settings[$k]); + } + unset($settings['default_' . $k]); + } + + $modx->db->delete($tbl_user_settings, "user='{$id}'"); + + foreach ($settings as $n => $vl) { + if (is_array($vl)) { + $vl = implode(",", $vl); + } + if ($vl != '') { + $f = array(); + $f['user'] = $id; + $f['setting_name'] = $n; + $f['setting_value'] = $vl; + $f = $modx->db->escape($f); + $modx->db->insert($f, $tbl_user_settings); + } + } } /** @@ -477,11 +477,12 @@ function saveUserSettings($id) { * * @param $msg */ -function webAlertAndQuit($msg) { - global $id, $modx; - $mode = $_POST['mode']; - $modx->manager->saveFormValues($mode); - $modx->webAlertAndQuit($msg, "index.php?a={$mode}" . ($mode == '12' ? "&id={$id}" : '')); +function webAlertAndQuit($msg) +{ + global $id, $modx; + $mode = $_POST['mode']; + $modx->manager->saveFormValues($mode); + $modx->webAlertAndQuit($msg, "index.php?a={$mode}" . ($mode == '12' ? "&id={$id}" : '')); } /** @@ -490,13 +491,14 @@ function webAlertAndQuit($msg) { * @param int $length * @return string */ -function generate_password($length = 10) { - $allowable_characters = "abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"; - $ps_len = strlen($allowable_characters); - mt_srand((double) microtime() * 1000000); - $pass = ""; - for($i = 0; $i < $length; $i++) { - $pass .= $allowable_characters[mt_rand(0, $ps_len - 1)]; - } - return $pass; +function generate_password($length = 10) +{ + $allowable_characters = "abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"; + $ps_len = strlen($allowable_characters); + mt_srand((double) microtime() * 1000000); + $pass = ""; + for ($i = 0; $i < $length; $i++) { + $pass .= $allowable_characters[mt_rand(0, $ps_len - 1)]; + } + return $pass; } diff --git a/manager/processors/save_web_user.processor.php b/manager/processors/save_web_user.processor.php index f1d1e7a98e..9414759856 100755 --- a/manager/processors/save_web_user.processor.php +++ b/manager/processors/save_web_user.processor.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('save_web_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('save_web_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $tbl_web_users = $modx->getFullTableName('web_users'); @@ -11,16 +11,16 @@ $tbl_web_groups = $modx->getFullTableName('web_groups'); $input = $_POST; -foreach($input as $k => $v) { - if($k !== 'comment') { - $v = sanitize($v); - } - $input[$k] = $v; +foreach ($input as $k => $v) { + if ($k !== 'comment') { + $v = sanitize($v); + } + $input[$k] = $v; } $id = (int)$input['id']; $oldusername = $input['oldusername']; -$newusername = !empty ($input['newusername']) ? trim($input['newusername']) : "New User"; +$newusername = !empty($input['newusername']) ? trim($input['newusername']) : "New User"; $esc_newusername = $modx->db->escape($newusername); $fullname = $input['fullname']; $genpassword = $input['newpassword']; @@ -33,7 +33,7 @@ $phone = $input['phone']; $mobilephone = $input['mobilephone']; $fax = $input['fax']; -$dob = !empty ($input['dob']) ? $modx->toTimeStamp($input['dob']) : 0; +$dob = !empty($input['dob']) ? $modx->toTimeStamp($input['dob']) : 0; $country = $input['country']; $street = $input['street']; $city = $input['city']; @@ -50,83 +50,83 @@ $user_groups = $input['user_groups']; // verify password -if($passwordgenmethod == "spec" && $input['specifiedpassword'] != $input['confirmpassword']) { - webAlertAndQuit("Password typed is mismatched"); +if ($passwordgenmethod == "spec" && $input['specifiedpassword'] != $input['confirmpassword']) { + webAlertAndQuit("Password typed is mismatched"); } // verify email -if($email == '' || !preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,24}$/i", $email)) { - webAlertAndQuit("E-mail address doesn't seem to be valid!"); +if ($email == '' || !preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,24}$/i", $email)) { + webAlertAndQuit("E-mail address doesn't seem to be valid!"); } -switch($input['mode']) { - case '87' : // new user - // check if this user name already exist - $rs = $modx->db->select('count(id)', $tbl_web_users, "username='{$esc_newusername}'"); - $limit = $modx->db->getValue($rs); - if($limit > 0) { - webAlertAndQuit("User name is already in use!"); - } - - // check if the email address already exist - if ($modx->config['allow_multiple_emails'] != 1) { - $rs = $modx->db->select('count(id)', $tbl_web_user_attributes, "email='{$esc_email}' AND id!='{$id}'"); - $limit = $modx->db->getValue($rs); - if($limit > 0) { - webAlertAndQuit("Email is already in use!"); - } - } - - // generate a new password for this user - if($specifiedpassword != "" && $passwordgenmethod == "spec") { - if(strlen($specifiedpassword) < 6) { - webAlertAndQuit("Password is too short!"); - } else { - $newpassword = $specifiedpassword; - } - } elseif($specifiedpassword == "" && $passwordgenmethod == "spec") { - webAlertAndQuit("You didn't specify a password for this user!"); - } elseif($passwordgenmethod == 'g') { - $newpassword = generate_password(8); - } else { - webAlertAndQuit("No password generation method specified!"); - } - - // invoke OnBeforeWUsrFormSave event - $modx->invokeEvent("OnBeforeWUsrFormSave", array( - "mode" => "new", - )); - - // create the user account - $field = array(); - $field['username'] = $esc_newusername; - $field['password'] = md5($newpassword); - $internalKey = $modx->db->insert($field, $tbl_web_users); - - $field = compact('internalKey', 'fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'blocked', 'blockeduntil', 'blockedafter'); - $field = $modx->db->escape($field); - $modx->db->insert($field, $tbl_web_user_attributes); - - // Save User Settings - saveUserSettings($internalKey); - - // Set the item name for logger - $_SESSION['itemname'] = $newusername; - - /*******************************************************************************/ - // put the user in the user_groups he/ she should be in - // first, check that up_perms are switched on! - if($use_udperms == 1) { - if(!empty($user_groups)) { - for($i = 0; $i < count($user_groups); $i++) { - $f = array(); - $f['webgroup'] = (int)$user_groups[$i]; - $f['webuser'] = $internalKey; - $modx->db->insert($f, $tbl_web_groups); - } - } - } - // end of user_groups stuff! +switch ($input['mode']) { + case '87': // new user + // check if this user name already exist + $rs = $modx->db->select('count(id)', $tbl_web_users, "username='{$esc_newusername}'"); + $limit = $modx->db->getValue($rs); + if ($limit > 0) { + webAlertAndQuit("User name is already in use!"); + } + + // check if the email address already exist + if ($modx->config['allow_multiple_emails'] != 1) { + $rs = $modx->db->select('count(id)', $tbl_web_user_attributes, "email='{$esc_email}' AND id!='{$id}'"); + $limit = $modx->db->getValue($rs); + if ($limit > 0) { + webAlertAndQuit("Email is already in use!"); + } + } + + // generate a new password for this user + if ($specifiedpassword != "" && $passwordgenmethod == "spec") { + if (strlen($specifiedpassword) < 6) { + webAlertAndQuit("Password is too short!"); + } else { + $newpassword = $specifiedpassword; + } + } elseif ($specifiedpassword == "" && $passwordgenmethod == "spec") { + webAlertAndQuit("You didn't specify a password for this user!"); + } elseif ($passwordgenmethod == 'g') { + $newpassword = generate_password(8); + } else { + webAlertAndQuit("No password generation method specified!"); + } + + // invoke OnBeforeWUsrFormSave event + $modx->invokeEvent("OnBeforeWUsrFormSave", array( + "mode" => "new", + )); + + // create the user account + $field = array(); + $field['username'] = $esc_newusername; + $field['password'] = md5($newpassword); + $internalKey = $modx->db->insert($field, $tbl_web_users); + + $field = compact('internalKey', 'fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'blocked', 'blockeduntil', 'blockedafter'); + $field = $modx->db->escape($field); + $modx->db->insert($field, $tbl_web_user_attributes); + + // Save User Settings + saveUserSettings($internalKey); + + // Set the item name for logger + $_SESSION['itemname'] = $newusername; + + /*******************************************************************************/ + // put the user in the user_groups he/ she should be in + // first, check that up_perms are switched on! + if ($use_udperms == 1) { + if (!empty($user_groups)) { + for ($i = 0; $i < count($user_groups); $i++) { + $f = array(); + $f['webgroup'] = (int)$user_groups[$i]; + $f['webuser'] = $internalKey; + $modx->db->insert($f, $tbl_web_groups); + } + } + } + // end of user_groups stuff! // invoke OnWebSaveUser event $modx->invokeEvent("OnWebSaveUser", array( @@ -144,26 +144,25 @@ "id" => $internalKey )); - if($passwordnotifymethod == 'e') { - sendMailMessage($email, $newusername, $newpassword, $fullname); - if($input['stay'] != '') { - $a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87"; - $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay']; - header($header); - } else { - $header = "Location: index.php?a=99&r=2"; - header($header); - } - } else { - if($input['stay'] != '') { - $a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87"; - $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; - } else { - $stayUrl = "index.php?a=99&r=2"; - } - - include_once "header.inc.php"; - ?> + if ($passwordnotifymethod == 'e') { + sendMailMessage($email, $newusername, $newpassword, $fullname); + if ($input['stay'] != '') { + $a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87"; + $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay']; + header($header); + } else { + $header = "Location: index.php?a=99&r=2"; + header($header); + } + } else { + if ($input['stay'] != '') { + $a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87"; + $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; + } else { + $stayUrl = "index.php?a=99&r=2"; + } + + include_once "header.inc.php"; ?>

    @@ -185,86 +184,86 @@ db->select('count(id)', $tbl_web_users, "username='{$esc_newusername}' AND id!='{$id}'"); - $limit = $modx->db->getValue($rs); - if($limit > 0) { - webAlertAndQuit("User name is already in use!"); - } - - // check if the email address already exists - if ($modx->config['allow_multiple_emails'] != 1) { - $rs = $modx->db->select('count(internalKey)', $tbl_web_user_attributes, "email='{$esc_email}' AND internalKey!='{$id}'"); - $limit = $modx->db->getValue($rs); - if($limit > 0) { - webAlertAndQuit("Email is already in use!"); - } - } - - // invoke OnBeforeWUsrFormSave event - $modx->invokeEvent("OnBeforeWUsrFormSave", array( - "mode" => "upd", - "id" => $id - )); - - // update user name and password - $field = array(); - $field['username'] = $esc_newusername; - if($genpassword == 1) { - $field['password'] = md5($newpassword); - } - $modx->db->update($field, $tbl_web_users, "id='{$id}'"); - $field = compact('fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'failedlogincount', 'blocked', 'blockeduntil', 'blockedafter'); - $field = $modx->db->escape($field); - $modx->db->update($field, $tbl_web_user_attributes, "internalKey='{$id}'"); - - // Save User Settings - saveUserSettings($id); - - // Set the item name for logger - $_SESSION['itemname'] = $newusername; - - /*******************************************************************************/ - // put the user in the user_groups he/ she should be in - // first, check that up_perms are switched on! - if($use_udperms == 1) { - // as this is an existing user, delete his/ her entries in the groups before saving the new groups - $modx->db->delete($tbl_web_groups, "webuser='{$id}'"); - if(!empty($user_groups)) { - for($i = 0; $i < count($user_groups); $i++) { - $field = array(); - $field['webgroup'] = (int)$user_groups[$i]; - $field['webuser'] = $id; - $modx->db->insert($field, $tbl_web_groups); - } - } - } - // end of user_groups stuff! - /*******************************************************************************/ + include_once "footer.inc.php"; + } + break; + case '88': // edit user + // generate a new password for this user + if ($genpassword == 1) { + if ($specifiedpassword != "" && $passwordgenmethod == "spec") { + if (strlen($specifiedpassword) < 6) { + webAlertAndQuit("Password is too short!"); + } else { + $newpassword = $specifiedpassword; + } + } elseif ($specifiedpassword == "" && $passwordgenmethod == "spec") { + webAlertAndQuit("You didn't specify a password for this user!"); + } elseif ($passwordgenmethod == 'g') { + $newpassword = generate_password(8); + } else { + webAlertAndQuit("No password generation method specified!"); + } + } + if ($passwordnotifymethod == 'e') { + sendMailMessage($email, $newusername, $newpassword, $fullname); + } + + // check if the username already exist + $rs = $modx->db->select('count(id)', $tbl_web_users, "username='{$esc_newusername}' AND id!='{$id}'"); + $limit = $modx->db->getValue($rs); + if ($limit > 0) { + webAlertAndQuit("User name is already in use!"); + } + + // check if the email address already exists + if ($modx->config['allow_multiple_emails'] != 1) { + $rs = $modx->db->select('count(internalKey)', $tbl_web_user_attributes, "email='{$esc_email}' AND internalKey!='{$id}'"); + $limit = $modx->db->getValue($rs); + if ($limit > 0) { + webAlertAndQuit("Email is already in use!"); + } + } + + // invoke OnBeforeWUsrFormSave event + $modx->invokeEvent("OnBeforeWUsrFormSave", array( + "mode" => "upd", + "id" => $id + )); + + // update user name and password + $field = array(); + $field['username'] = $esc_newusername; + if ($genpassword == 1) { + $field['password'] = md5($newpassword); + } + $modx->db->update($field, $tbl_web_users, "id='{$id}'"); + $field = compact('fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'failedlogincount', 'blocked', 'blockeduntil', 'blockedafter'); + $field = $modx->db->escape($field); + $modx->db->update($field, $tbl_web_user_attributes, "internalKey='{$id}'"); + + // Save User Settings + saveUserSettings($id); + + // Set the item name for logger + $_SESSION['itemname'] = $newusername; + + /*******************************************************************************/ + // put the user in the user_groups he/ she should be in + // first, check that up_perms are switched on! + if ($use_udperms == 1) { + // as this is an existing user, delete his/ her entries in the groups before saving the new groups + $modx->db->delete($tbl_web_groups, "webuser='{$id}'"); + if (!empty($user_groups)) { + for ($i = 0; $i < count($user_groups); $i++) { + $field = array(); + $field['webgroup'] = (int)$user_groups[$i]; + $field['webuser'] = $id; + $modx->db->insert($field, $tbl_web_groups); + } + } + } + // end of user_groups stuff! + /*******************************************************************************/ // invoke OnWebSaveUser event $modx->invokeEvent("OnWebSaveUser", array( @@ -279,7 +278,7 @@ )); // invoke OnWebChangePassword event - if($genpassword == 1) { + if ($genpassword == 1) { $modx->invokeEvent("OnWebChangePassword", array( "userid" => $id, "username" => $newusername, @@ -293,16 +292,15 @@ "id" => $id )); - if($genpassword == 1 && $passwordnotifymethod == 's') { - if($input['stay'] != '') { - $a = ($input['stay'] == '2') ? "88&id={$id}" : "87"; - $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; - } else { - $stayUrl = "index.php?a=99&r=2"; - } + if ($genpassword == 1 && $passwordnotifymethod == 's') { + if ($input['stay'] != '') { + $a = ($input['stay'] == '2') ? "88&id={$id}" : "87"; + $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; + } else { + $stayUrl = "index.php?a=99&r=2"; + } - include_once "header.inc.php"; - ?> + include_once "header.inc.php"; ?>

    @@ -322,20 +320,20 @@ "; - $param['subject'] = $emailsubject; - $param['body'] = $message; - $param['to'] = $email; - $param['type'] = 'text'; - $rs = $modx->sendmail($param); - if(!$rs) { - $modx->manager->saveFormValues(); - $modx->messageQuit("{$email} - {$_lang['error_sending_email']}"); - } +function sendMailMessage($email, $uid, $pwd, $ufn) +{ + $modx = evolutionCMS(); + global $_lang, $websignupemail_message; + global $emailsubject, $emailsender; + global $site_name, $site_url; + $message = sprintf($websignupemail_message, $uid, $pwd); // use old method + // replace placeholders + $message = str_replace("[+uid+]", $uid, $message); + $message = str_replace("[+pwd+]", $pwd, $message); + $message = str_replace("[+ufn+]", $ufn, $message); + $message = str_replace("[+sname+]", $site_name, $message); + $message = str_replace("[+saddr+]", $emailsender, $message); + $message = str_replace("[+semail+]", $emailsender, $message); + $message = str_replace("[+surl+]", $site_url, $message); + + $param = array(); + $param['from'] = "{$site_name}<{$emailsender}>"; + $param['subject'] = $emailsubject; + $param['body'] = $message; + $param['to'] = $email; + $param['type'] = 'text'; + $rs = $modx->sendmail($param); + if (!$rs) { + $modx->manager->saveFormValues(); + $modx->messageQuit("{$email} - {$_lang['error_sending_email']}"); + } } // Save User Settings -function saveUserSettings($id) { - $modx = evolutionCMS(); - $tbl_web_user_settings = $modx->getFullTableName('web_user_settings'); - - $settings = array( - "login_home", - "allowed_ip", - "allowed_days" - ); - - $modx->db->delete($tbl_web_user_settings, "webuser='{$id}'"); - - foreach($settings as $n) { - $vl = $_POST[$n]; - if(is_array($vl)) { - $vl = implode(",", $vl); - } - if($vl != '') { - $f = array(); - $f['webuser'] = $id; - $f['setting_name'] = $n; - $f['setting_value'] = $vl; - $f = $modx->db->escape($f); - $modx->db->insert($f, $tbl_web_user_settings); - } - } +function saveUserSettings($id) +{ + $modx = evolutionCMS(); + $tbl_web_user_settings = $modx->getFullTableName('web_user_settings'); + + $settings = array( + "login_home", + "allowed_ip", + "allowed_days" + ); + + $modx->db->delete($tbl_web_user_settings, "webuser='{$id}'"); + + foreach ($settings as $n) { + $vl = $_POST[$n]; + if (is_array($vl)) { + $vl = implode(",", $vl); + } + if ($vl != '') { + $f = array(); + $f['webuser'] = $id; + $f['setting_name'] = $n; + $f['setting_value'] = $vl; + $f = $modx->db->escape($f); + $modx->db->insert($f, $tbl_web_user_settings); + } + } } // Web alert - sends an alert to web browser -function webAlertAndQuit($msg) { - global $id, $modx; - $mode = $_POST['mode']; - $modx->manager->saveFormValues($mode); - $modx->webAlertAndQuit($msg, "index.php?a={$mode}" . ($mode == '88' ? "&id={$id}" : '')); +function webAlertAndQuit($msg) +{ + global $id, $modx; + $mode = $_POST['mode']; + $modx->manager->saveFormValues($mode); + $modx->webAlertAndQuit($msg, "index.php?a={$mode}" . ($mode == '88' ? "&id={$id}" : '')); } // Generate password -function generate_password($length = 10) { - $allowable_characters = "abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"; - $ps_len = strlen($allowable_characters); - mt_srand((double) microtime() * 1000000); - $pass = ""; - for($i = 0; $i < $length; $i++) { - $pass .= $allowable_characters[mt_rand(0, $ps_len - 1)]; - } - return $pass; +function generate_password($length = 10) +{ + $allowable_characters = "abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"; + $ps_len = strlen($allowable_characters); + mt_srand((double) microtime() * 1000000); + $pass = ""; + for ($i = 0; $i < $length; $i++) { + $pass .= $allowable_characters[mt_rand(0, $ps_len - 1)]; + } + return $pass; } -function sanitize($str = '', $safecount = 0) { - $modx = evolutionCMS(); - $safecount++; - if(1000 < $safecount) { - exit("error too many loops '{$safecount}'"); - } - if(is_array($str)) { - foreach($str as $i => $v) { - $str[$i] = sanitize($v, $safecount); - } - } else { - // $str = strip_tags($str); // LEAVE < and > intact - $str = htmlspecialchars($str, ENT_NOQUOTES, $modx->config['modx_charset']); - } - return $str; +function sanitize($str = '', $safecount = 0) +{ + $modx = evolutionCMS(); + $safecount++; + if (1000 < $safecount) { + exit("error too many loops '{$safecount}'"); + } + if (is_array($str)) { + foreach ($str as $i => $v) { + $str[$i] = sanitize($v, $safecount); + } + } else { + // $str = strip_tags($str); // LEAVE < and > intact + $str = htmlspecialchars($str, ENT_NOQUOTES, $modx->config['modx_charset']); + } + return $str; } diff --git a/manager/processors/send_message.processor.php b/manager/processors/send_message.processor.php index 868f1ab8d1..7ddd362ec5 100755 --- a/manager/processors/send_message.processor.php +++ b/manager/processors/send_message.processor.php @@ -1,70 +1,74 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('messages')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('messages')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $sendto = $_REQUEST['sendto']; $userid = $_REQUEST['user']; $groupid = $_REQUEST['group']; $subject = $modx->db->escape($_REQUEST['messagesubject']); -if($subject=="") $subject="(no subject)"; +if ($subject=="") { + $subject="(no subject)"; +} $message = $modx->db->escape($_REQUEST['messagebody']); -if($message=="") $message="(no message)"; +if ($message=="") { + $message="(no message)"; +} $postdate = time(); -if($sendto=='u') { - if($userid==0) { - $modx->webAlertAndQuit($_lang["error_no_user_selected"]); - } - $modx->db->insert( - array( - 'recipient' => $userid, - 'sender' => $modx->getLoginUserID(), - 'subject' => $subject, - 'message' => $message, - 'postdate' => $postdate, - 'type' => 'Message', - 'private' => 1, - ), $modx->getFullTableName('user_messages')); +if ($sendto=='u') { + if ($userid==0) { + $modx->webAlertAndQuit($_lang["error_no_user_selected"]); + } + $modx->db->insert( + array( + 'recipient' => $userid, + 'sender' => $modx->getLoginUserID(), + 'subject' => $subject, + 'message' => $message, + 'postdate' => $postdate, + 'type' => 'Message', + 'private' => 1, + ), $modx->getFullTableName('user_messages')); } -if($sendto=='g') { - if($groupid==0) { - $modx->webAlertAndQuit($_lang["error_no_group_selected"]); - } - $rs = $modx->db->select('internalKey', $modx->getFullTableName('user_attributes'), "role='{$groupid}' AND internalKey!='".$modx->getLoginUserID()."'"); - while ($row=$modx->db->getRow($rs)) { - $modx->db->insert( - array( - 'recipient' => $row['internalKey'], - 'sender' => $modx->getLoginUserID(), - 'subject' => $subject, - 'message' => $message, - 'postdate' => $postdate, - 'type' => 'Message', - 'private' => 0, - ), $modx->getFullTableName('user_messages')); - } +if ($sendto=='g') { + if ($groupid==0) { + $modx->webAlertAndQuit($_lang["error_no_group_selected"]); + } + $rs = $modx->db->select('internalKey', $modx->getFullTableName('user_attributes'), "role='{$groupid}' AND internalKey!='" . $modx->getLoginUserID() . "'"); + while ($row=$modx->db->getRow($rs)) { + $modx->db->insert( + array( + 'recipient' => $row['internalKey'], + 'sender' => $modx->getLoginUserID(), + 'subject' => $subject, + 'message' => $message, + 'postdate' => $postdate, + 'type' => 'Message', + 'private' => 0, + ), $modx->getFullTableName('user_messages')); + } } -if($sendto=='a') { - $rs = $modx->db->select('id', $modx->getFullTableName('manager_users'), "id!='".$modx->getLoginUserID()."'"); - while ($row=$modx->db->getRow($rs)) { - $modx->db->insert( - array( - 'recipient' => $row['id'], - 'sender' => $modx->getLoginUserID(), - 'subject' => $subject, - 'message' => $message, - 'postdate' => $postdate, - 'type' => 'Message', - 'private' => 0, - ), $modx->getFullTableName('user_messages')); - } +if ($sendto=='a') { + $rs = $modx->db->select('id', $modx->getFullTableName('manager_users'), "id!='" . $modx->getLoginUserID() . "'"); + while ($row=$modx->db->getRow($rs)) { + $modx->db->insert( + array( + 'recipient' => $row['id'], + 'sender' => $modx->getLoginUserID(), + 'subject' => $subject, + 'message' => $message, + 'postdate' => $postdate, + 'type' => 'Message', + 'private' => 0, + ), $modx->getFullTableName('user_messages')); + } } $header = "Location: index.php?a=10"; diff --git a/manager/processors/undelete_content.processor.php b/manager/processors/undelete_content.processor.php index 84cdc95f72..928ad54133 100755 --- a/manager/processors/undelete_content.processor.php +++ b/manager/processors/undelete_content.processor.php @@ -1,14 +1,14 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('delete_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('delete_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id'])? (int)$_REQUEST['id'] : 0; -if($id==0) { - $modx->webAlertAndQuit($_lang["error_no_id"]); +if ($id==0) { + $modx->webAlertAndQuit($_lang["error_no_id"]); } /************ webber ********/ @@ -16,10 +16,10 @@ $pid=($content['parent']==0?$id:$content['parent']); /************** webber *************/ -$sd=isset($_REQUEST['dir'])?'&dir='.$_REQUEST['dir']:'&dir=DESC'; -$sb=isset($_REQUEST['sort'])?'&sort='.$_REQUEST['sort']:'&sort=createdon'; -$pg=isset($_REQUEST['page'])?'&page='.(int)$_REQUEST['page']:''; -$add_path=$sd.$sb.$pg; +$sd=isset($_REQUEST['dir'])?'&dir=' . $_REQUEST['dir']:'&dir=DESC'; +$sb=isset($_REQUEST['sort'])?'&sort=' . $_REQUEST['sort']:'&sort=createdon'; +$pg=isset($_REQUEST['page'])?'&page=' . (int)$_REQUEST['page']:''; +$add_path=$sd . $sb . $pg; /***********************************/ @@ -31,15 +31,15 @@ $udperms->document = $id; $udperms->role = $_SESSION['mgrRole']; -if(!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); +if (!$udperms->checkPermissions()) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); } // get the timestamp on which the document was deleted. $rs = $modx->db->select('deletedon', $modx->getFullTableName('site_content'), "id='{$id}' AND deleted=1"); $deltime = $modx->db->getValue($rs); -if(!$deltime) { - $modx->webAlertAndQuit("Couldn't find document to determine it's date of deletion!"); +if (!$deltime) { + $modx->webAlertAndQuit("Couldn't find document to determine it's date of deletion!"); } $children = array(); @@ -47,38 +47,38 @@ /** * @param int $parent */ -function getChildren($parent) { - - $modx = evolutionCMS(); - global $children; - global $deltime; - - $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent='".(int)$parent."' AND deleted=1 AND deletedon='".(int)$deltime."'"); - // the document has children documents, we'll need to delete those too - while ($row=$modx->db->getRow($rs)) { - $children[] = $row['id']; - getChildren($row['id']); - //echo "Found childNode of parentNode $parent: ".$row['id']."
    "; - } +function getChildren($parent) +{ + $modx = evolutionCMS(); + global $children; + global $deltime; + + $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent='" . (int)$parent . "' AND deleted=1 AND deletedon='" . (int)$deltime . "'"); + // the document has children documents, we'll need to delete those too + while ($row=$modx->db->getRow($rs)) { + $children[] = $row['id']; + getChildren($row['id']); + //echo "Found childNode of parentNode $parent: ".$row['id']."
    "; + } } getChildren($id); -if(count($children)>0) { - $modx->db->update( - array( - 'deleted' => 0, - 'deletedby' => 0, - 'deletedon' => 0, - ), $modx->getFullTableName('site_content'), "id IN(".implode(", ", $children).")"); +if (count($children)>0) { + $modx->db->update( + array( + 'deleted' => 0, + 'deletedby' => 0, + 'deletedon' => 0, + ), $modx->getFullTableName('site_content'), "id IN(" . implode(", ", $children) . ")"); } //'undelete' the document. $modx->db->update( - array( - 'deleted' => 0, - 'deletedby' => 0, - 'deletedon' => 0, - ), $modx->getFullTableName('site_content'), "id='{$id}'"); + array( + 'deleted' => 0, + 'deletedby' => 0, + 'deletedon' => 0, + ), $modx->getFullTableName('site_content'), "id='{$id}'"); $modx->invokeEvent("OnDocFormUnDelete", array( @@ -93,5 +93,5 @@ function getChildren($parent) { $modx->clearCache('full'); // finished emptying cache - redirect -$header="Location: index.php?a=3&id=$pid&r=1".$add_path; +$header="Location: index.php?a=3&id=$pid&r=1" . $add_path; header($header); diff --git a/manager/processors/unpublish_content.processor.php b/manager/processors/unpublish_content.processor.php index 43b5b72ff8..1de6b8cec3 100755 --- a/manager/processors/unpublish_content.processor.php +++ b/manager/processors/unpublish_content.processor.php @@ -1,14 +1,14 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('save_document')||!$modx->hasPermission('publish_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('save_document')||!$modx->hasPermission('publish_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id'])? (int)$_REQUEST['id'] : 0; -if($id==0) { - $modx->webAlertAndQuit($_lang["error_no_id"]); +if ($id==0) { + $modx->webAlertAndQuit($_lang["error_no_id"]); } /************webber ********/ @@ -16,10 +16,10 @@ $pid=($content['parent']==0?$id:$content['parent']); /************** webber *************/ -$sd=isset($_REQUEST['dir'])?'&dir='.$_REQUEST['dir']:'&dir=DESC'; -$sb=isset($_REQUEST['sort'])?'&sort='.$_REQUEST['sort']:'&sort=createdon'; -$pg=isset($_REQUEST['page'])?'&page='.(int)$_REQUEST['page']:''; -$add_path=$sd.$sb.$pg; +$sd=isset($_REQUEST['dir'])?'&dir=' . $_REQUEST['dir']:'&dir=DESC'; +$sb=isset($_REQUEST['sort'])?'&sort=' . $_REQUEST['sort']:'&sort=createdon'; +$pg=isset($_REQUEST['page'])?'&page=' . (int)$_REQUEST['page']:''; +$add_path=$sd . $sb . $pg; /***********************************/ @@ -32,24 +32,24 @@ $udperms->document = $id; $udperms->role = $_SESSION['mgrRole']; -if(!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); +if (!$udperms->checkPermissions()) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); } // update the document $modx->db->update( - array( - 'published' => 0, - 'pub_date' => 0, - 'unpub_date' => 0, - 'editedby' => $modx->getLoginUserID(), - 'editedon' => time(), - 'publishedby' => 0, - 'publishedon' => 0, - ), $modx->getFullTableName('site_content'), "id='{$id}'"); + array( + 'published' => 0, + 'pub_date' => 0, + 'unpub_date' => 0, + 'editedby' => $modx->getLoginUserID(), + 'editedon' => time(), + 'publishedby' => 0, + 'publishedon' => 0, + ), $modx->getFullTableName('site_content'), "id='{$id}'"); // invoke OnDocUnPublished event -$modx->invokeEvent("OnDocUnPublished",array("docid"=>$id)); +$modx->invokeEvent("OnDocUnPublished", array("docid"=>$id)); // Set the item name for logger $_SESSION['itemname'] = $content['pagetitle']; @@ -57,6 +57,6 @@ // empty cache $modx->clearCache('full'); -$header="Location: index.php?a=3&id=$pid&r=1".$add_path; +$header="Location: index.php?a=3&id=$pid&r=1" . $add_path; header($header); diff --git a/manager/processors/user_documents_permissions.class.php b/manager/processors/user_documents_permissions.class.php index 50fdf27bbe..7fbf82d6a0 100755 --- a/manager/processors/user_documents_permissions.class.php +++ b/manager/processors/user_documents_permissions.class.php @@ -24,7 +24,6 @@ class udperms */ public function checkPermissions() { - global $udperms_allowroot; $modx = evolutionCMS(); diff --git a/manager/processors/web_access_groups.processor.php b/manager/processors/web_access_groups.processor.php index 477bff505f..82c1aa24e0 100755 --- a/manager/processors/web_access_groups.processor.php +++ b/manager/processors/web_access_groups.processor.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('web_access_permissions')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('web_access_permissions')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // web access group processor. @@ -20,111 +20,111 @@ $operation = $_REQUEST['operation']; switch ($operation) { - case "add_user_group" : - $newgroup = $_REQUEST['newusergroup']; - if(empty($newgroup)) { - $modx->webAlertAndQuit("No group name specified."); - } else { - $id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_webgroup_names); + case "add_user_group": + $newgroup = $_REQUEST['newusergroup']; + if (empty($newgroup)) { + $modx->webAlertAndQuit("No group name specified."); + } else { + $id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_webgroup_names); - // invoke OnWebCreateGroup event - $modx->invokeEvent('OnWebCreateGroup', array( - 'groupid' => $id, - 'groupname' => $newgroup, - )); - } - break; - case "add_document_group" : - $newgroup = $_REQUEST['newdocgroup']; - if(empty($newgroup)) { - $modx->webAlertAndQuit("No group name specified."); - } else { - $id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_documentgroup_names); + // invoke OnWebCreateGroup event + $modx->invokeEvent('OnWebCreateGroup', array( + 'groupid' => $id, + 'groupname' => $newgroup, + )); + } + break; + case "add_document_group": + $newgroup = $_REQUEST['newdocgroup']; + if (empty($newgroup)) { + $modx->webAlertAndQuit("No group name specified."); + } else { + $id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_documentgroup_names); - // invoke OnCreateDocGroup event - $modx->invokeEvent('OnCreateDocGroup', array( - 'groupid' => $id, - 'groupname' => $newgroup, - )); - } - break; - case "delete_user_group" : - $updategroupaccess = true; - $usergroup = (int)$_REQUEST['usergroup']; - if(empty($usergroup)) { - $modx->webAlertAndQuit("No user group id specified for deletion."); - } else { - $modx->db->delete($tbl_webgroup_names, "id='{$usergroup}'"); + // invoke OnCreateDocGroup event + $modx->invokeEvent('OnCreateDocGroup', array( + 'groupid' => $id, + 'groupname' => $newgroup, + )); + } + break; + case "delete_user_group": + $updategroupaccess = true; + $usergroup = (int)$_REQUEST['usergroup']; + if (empty($usergroup)) { + $modx->webAlertAndQuit("No user group id specified for deletion."); + } else { + $modx->db->delete($tbl_webgroup_names, "id='{$usergroup}'"); - $modx->db->delete($tbl_webgroup_access, "webgroup='{$usergroup}'"); + $modx->db->delete($tbl_webgroup_access, "webgroup='{$usergroup}'"); - $modx->db->delete($tbl_web_groups, "webuser='{$usergroup}'"); - } - break; - case "delete_document_group" : - $group = (int)$_REQUEST['documentgroup']; - if(empty($group)) { - $modx->webAlertAndQuit("No document group id specified for deletion."); - } else { - $modx->db->delete($tbl_documentgroup_names, "id='{$group}'"); + $modx->db->delete($tbl_web_groups, "webuser='{$usergroup}'"); + } + break; + case "delete_document_group": + $group = (int)$_REQUEST['documentgroup']; + if (empty($group)) { + $modx->webAlertAndQuit("No document group id specified for deletion."); + } else { + $modx->db->delete($tbl_documentgroup_names, "id='{$group}'"); - $modx->db->delete($tbl_webgroup_access, "documentgroup='{$group}'"); + $modx->db->delete($tbl_webgroup_access, "documentgroup='{$group}'"); - $modx->db->delete($tbl_document_groups, "document_group='{$group}'"); - } - break; - case "rename_user_group" : - $newgroupname = $_REQUEST['newgroupname']; - if(empty($newgroupname)) { - $modx->webAlertAndQuit("No group name specified."); - } - $groupid = (int)$_REQUEST['groupid']; - if(empty($groupid)) { - $modx->webAlertAndQuit("No user group id specified for rename."); - } - $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_webgroup_names, "id='{$groupid}'"); - break; - case "rename_document_group" : - $newgroupname = $_REQUEST['newgroupname']; - if(empty($newgroupname)) { - $modx->webAlertAndQuit("No group name specified."); - } - $groupid = (int)$_REQUEST['groupid']; - if(empty($groupid)) { - $modx->webAlertAndQuit("No document group id specified for rename."); - } - $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_documentgroup_names, "id='{$groupid}'"); - break; - case "add_document_group_to_user_group" : - $updategroupaccess = true; - $usergroup = (int)$_REQUEST['usergroup']; - $docgroup = (int)$_REQUEST['docgroup']; - $rs = $modx->db->select('COUNT(*)', $tbl_webgroup_access, "webgroup='{$usergroup}' AND documentgroup='{$docgroup}'"); - $limit = $modx->db->getValue($rs); - if($limit<=0) { - $modx->db->insert(array('webgroup'=>$usergroup, 'documentgroup'=>$docgroup), $tbl_webgroup_access); - } else { - //alert user that coupling already exists? - } - break; - case "remove_document_group_from_user_group" : - $updategroupaccess = true; - $coupling = (int)$_REQUEST['coupling']; - $modx->db->delete($tbl_webgroup_access, "id='{$coupling}'"); - break; - default : - $modx->webAlertAndQuit("No operation set in request."); + $modx->db->delete($tbl_document_groups, "document_group='{$group}'"); + } + break; + case "rename_user_group": + $newgroupname = $_REQUEST['newgroupname']; + if (empty($newgroupname)) { + $modx->webAlertAndQuit("No group name specified."); + } + $groupid = (int)$_REQUEST['groupid']; + if (empty($groupid)) { + $modx->webAlertAndQuit("No user group id specified for rename."); + } + $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_webgroup_names, "id='{$groupid}'"); + break; + case "rename_document_group": + $newgroupname = $_REQUEST['newgroupname']; + if (empty($newgroupname)) { + $modx->webAlertAndQuit("No group name specified."); + } + $groupid = (int)$_REQUEST['groupid']; + if (empty($groupid)) { + $modx->webAlertAndQuit("No document group id specified for rename."); + } + $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_documentgroup_names, "id='{$groupid}'"); + break; + case "add_document_group_to_user_group": + $updategroupaccess = true; + $usergroup = (int)$_REQUEST['usergroup']; + $docgroup = (int)$_REQUEST['docgroup']; + $rs = $modx->db->select('COUNT(*)', $tbl_webgroup_access, "webgroup='{$usergroup}' AND documentgroup='{$docgroup}'"); + $limit = $modx->db->getValue($rs); + if ($limit<=0) { + $modx->db->insert(array('webgroup'=>$usergroup, 'documentgroup'=>$docgroup), $tbl_webgroup_access); + } else { + //alert user that coupling already exists? + } + break; + case "remove_document_group_from_user_group": + $updategroupaccess = true; + $coupling = (int)$_REQUEST['coupling']; + $modx->db->delete($tbl_webgroup_access, "id='{$coupling}'"); + break; + default: + $modx->webAlertAndQuit("No operation set in request."); } // secure web documents - flag as private -if($updategroupaccess==true){ - include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php"; - secureWebDocument(); +if ($updategroupaccess==true) { + include MODX_MANAGER_PATH . "includes/secure_web_documents.inc.php"; + secureWebDocument(); - // Update the private group column - $modx->db->update( - 'dgn.private_webgroup = (wga.webgroup IS NOT NULL)', - "{$tbl_documentgroup_names} AS dgn LEFT JOIN {$tbl_webgroup_access} AS wga ON wga.documentgroup = dgn.id"); + // Update the private group column + $modx->db->update( + 'dgn.private_webgroup = (wga.webgroup IS NOT NULL)', + "{$tbl_documentgroup_names} AS dgn LEFT JOIN {$tbl_webgroup_access} AS wga ON wga.documentgroup = dgn.id"); } $header = "Location: index.php?a=91"; From beaa53a180a41bb7bbda692ac9f16a5c5925bb02 Mon Sep 17 00:00:00 2001 From: Agel_Nash Date: Thu, 31 May 2018 03:22:32 +0500 Subject: [PATCH 243/274] Move SystemEvent --- manager/includes/SystemEvent.class.php | 70 ++++++++++++++++++ .../includes/document.parser.class.inc.php | 72 +------------------ 2 files changed, 72 insertions(+), 70 deletions(-) create mode 100644 manager/includes/SystemEvent.class.php diff --git a/manager/includes/SystemEvent.class.php b/manager/includes/SystemEvent.class.php new file mode 100644 index 0000000000..c73133608b --- /dev/null +++ b/manager/includes/SystemEvent.class.php @@ -0,0 +1,70 @@ +_resetEventObject(); + $this->name = $name; + } + + /** + * Display a message to the user + * + * @global array $SystemAlertMsgQueque + * @param string $msg The message + */ + public function alert($msg) + { + global $SystemAlertMsgQueque; + if ($msg == "") { + return; + } + if (is_array($SystemAlertMsgQueque)) { + $title = ''; + if ($this->name && $this->activePlugin) { + $title = "
    " . $this->activePlugin . " - " . $this->name . "
    "; + } + $SystemAlertMsgQueque[] = "$title
    $msg
    "; + } + } + + /** + * Output + * + * @param string $msg + */ + public function output($msg) + { + $this->_output .= $msg; + } + + /** + * Stop event propogation + */ + public function stopPropagation() + { + $this->_propagate = false; + } + + public function _resetEventObject() + { + unset($this->returnedValues); + $this->name = ""; + $this->_output = ""; + $this->_propagate = true; + $this->activated = false; + } +} diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index bd30b7e28f..3b69061896 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -11,6 +11,8 @@ define('E_USER_DEPRECATED', 16384); } +require_once 'SystemEvent.class.php'; + class DocumentParser { /** @@ -6684,73 +6686,3 @@ public function addLog($title = 'no title', $msg = '', $type = 1) $this->logEvent(0, $type, $msg, $title); } } - -/** - * System Event Class - */ -class SystemEvent -{ - public $name = ''; - public $_propagate = true; - public $_output = ''; - public $activated = false; - public $activePlugin = ''; - public $params = array(); - - /** - * @param string $name Name of the event - */ - public function __construct($name = "") - { - $this->_resetEventObject(); - $this->name = $name; - } - - /** - * Display a message to the user - * - * @global array $SystemAlertMsgQueque - * @param string $msg The message - */ - public function alert($msg) - { - global $SystemAlertMsgQueque; - if ($msg == "") { - return; - } - if (is_array($SystemAlertMsgQueque)) { - $title = ''; - if ($this->name && $this->activePlugin) { - $title = "
    " . $this->activePlugin . " - " . $this->name . "
    "; - } - $SystemAlertMsgQueque[] = "$title
    $msg
    "; - } - } - - /** - * Output - * - * @param string $msg - */ - public function output($msg) - { - $this->_output .= $msg; - } - - /** - * Stop event propogation - */ - public function stopPropagation() - { - $this->_propagate = false; - } - - public function _resetEventObject() - { - unset($this->returnedValues); - $this->name = ""; - $this->_output = ""; - $this->_propagate = true; - $this->activated = false; - } -} From e6bcf2b5f0875fbd74e761b2f5f47477647bb78d Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Thu, 31 May 2018 23:31:27 +0300 Subject: [PATCH 244/274] return file back ) --- manager/actions/mutate_user.dynamic.php | 799 ++++++++++++++++++++++++ 1 file changed, 799 insertions(+) diff --git a/manager/actions/mutate_user.dynamic.php b/manager/actions/mutate_user.dynamic.php index e69de29bb2..cd01ac1009 100755 --- a/manager/actions/mutate_user.dynamic.php +++ b/manager/actions/mutate_user.dynamic.php @@ -0,0 +1,799 @@ +INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +} + +switch($modx->manager->action) { + case 12: + if(!$modx->hasPermission('edit_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 11: + if(!$modx->hasPermission('new_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); +} + +$user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; + +// check to see the snippet editor isn't locked +$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); +if($username = $modx->db->getValue($rs)) { + $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user")); +} +// end check for lock + +if($modx->manager->action == '12') { + // get user attribute + $rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'"); + $userdata = $modx->db->getRow($rs); + if(!$userdata) { + $modx->webAlertAndQuit("No user returned!"); + } + + + // get user settings + $rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'"); + $usersettings = array(); + while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; + // manually extract so that user display settings are not overwritten + foreach($usersettings as $k => $v) { + if($k != 'manager_language' && $k != 'manager_theme') { + ${$k} = $v; + } + } + + // get user name + $rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'"); + $usernamedata = $modx->db->getRow($rs); + if(!$usernamedata) { + $modx->webAlertAndQuit("No user returned while getting username!"); + } + $_SESSION['itemname'] = $usernamedata['username']; +} else { + $userdata = array(); + $usersettings = array(); + $usernamedata = array(); + $_SESSION['itemname'] = $_lang["new_user"]; +} + +// avoid doubling htmlspecialchars (already encoded in DB) +foreach($userdata as $key => $val) { + $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); +}; +$usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); + +// restore saved form +$formRestored = false; +if($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); + // restore post values + $userdata = array_merge($userdata, $_POST); + $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); + $usernamedata['username'] = $userdata['newusername']; + $usernamedata['oldusername'] = $_POST['oldusername']; + $usersettings = array_merge($usersettings, $userdata); + $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; + extract($usersettings, EXTR_OVERWRITE); +} + +// include the country list language file +$_country_lang = array(); +include_once "lang/country/english_country.inc.php"; +if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { + include_once "lang/country/" . $manager_language . "_country.inc.php"; +} +asort($_country_lang); + +$displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; +if($which_browser == 'default') { + $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser']; +} +?> + + + + invokeEvent("OnUserFormPrerender", array( + "id" => $user + )); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> + + + " /> + +

    + (' . $usernamedata['id'] . ')' : $_lang['user_title']) ?> +

    + + + + +
    + +
    + +
    +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + manager->action == '12') { ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?> + + + +
    "> htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?> - + +
    : 
    manager->action == '11' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?> manager->action == "11" ? " checked disabled" : ""; ?>> + " onChange="documentDirty=true;" /> +
    + " id="passwordBlock"> +
    + + /> + +
    + > + +
    +
    + + +
    + + +
    +
    +
    +
    +
    + + /> + +
    + /> + +
    +
    : 
    :  +
    : db->select('name, id', '[+prefix+]user_roles', ($modx->hasPermission('save_role')) ? '' : 'id != 1'); + ?> +
    : 
    : 
    : 
    : 
    : 
    : 
    : 
    : 
    : " onBlur='documentDirty=true;'> + " data-tooltip="">
    : 
    : 
    : 
    : toDateFormat($userdata['lastlogin'] + $server_offset_time) ?>
    :  +    []
    :  time() && $userdata['blockeduntil'] != 0)) ? " checked" : ""; ?>> +
    : " onBlur='documentDirty=true;' readonly> + " data-tooltip="">
    : " onBlur='documentDirty=true;' readonly> + " data-tooltip="">
    + getLoginUserID()) { ?> +

    + +
    + + +
    +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
     
     
    /> + +
    + /> +
     
     
    +
    + +
    + +
    + +
    + +
    + +
    + +
     
    +
     

    + [(manager_theme_mode)] +
    + +
    + + +
    + +
    + +
    + +
     
    ">
     
    "> +    + /> + +
     
    "> +    + /> + +
     
    "> +    + /> + +
     
    "> +    + /> + +
     
    ">
     
     
    " />
     
    " />
     
    " />
     
    + invokeEvent("OnInterfaceSettingsRender"); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> +
    + + +
    +

    + + + + + + + + + + + + + + +
    +
     
    +
    + manager->action == '12') { // only do this bit if the user is being edited + $rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'"); + $groupsarray = $modx->db->getColumn('user_group', $rs); + } + // retain selected doc groups between post + if(is_array($_POST['user_groups'])) { + foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; + } + ?> +
    +

    + +

    + db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name'); + while($row = $modx->db->getRow($rs)) { + echo "
    "; + } + } + ?> +
    +
    +
    + + invokeEvent("OnUserFormRender", array( + "id" => $user + )); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> + From 7b58caeca5ff4e073a98011c56364550d2128ad4 Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Fri, 1 Jun 2018 00:19:06 +0300 Subject: [PATCH 245/274] revert --- index.php | 112 +- .../actions/access_permissions.dynamic.php | 181 +- manager/actions/bkmanager.static.php | 65 +- .../inc/Module_Categories_Manager.php | 1 + .../category_mgr/inc/request_trigger.inc.php | 142 +- manager/actions/document_data.static.php | 338 ++-- manager/actions/eventlog.dynamic.php | 74 +- manager/actions/eventlog_details.dynamic.php | 32 +- manager/actions/export_site.static.php | 24 +- manager/actions/files.dynamic.php | 34 +- manager/actions/help.static.php | 63 +- manager/actions/import_site.static.php | 690 ++++--- manager/actions/logging.static.php | 167 +- manager/actions/messages.static.php | 67 +- manager/actions/modules.static.php | 4 +- manager/actions/move_document.dynamic.php | 2 +- manager/actions/mutate_categories.dynamic.php | 48 +- manager/actions/mutate_content.dynamic.php | 1197 ++++++------ .../actions/mutate_htmlsnippet.dynamic.php | 4 +- .../actions/mutate_menuindex_sort.dynamic.php | 4 +- manager/actions/mutate_module.dynamic.php | 207 ++- .../mutate_module_resources.dynamic.php | 184 +- manager/actions/mutate_password.dynamic.php | 8 +- manager/actions/mutate_plugin.dynamic.php | 2 +- .../mutate_plugin_priority.dynamic.php | 4 +- manager/actions/mutate_role.dynamic.php | 264 ++- manager/actions/mutate_settings.dynamic.php | 56 +- .../mutate_settings/snippet_smtp.inc.php | 12 +- .../tab1_site_settings.inc.php | 122 +- .../tab2_furl_settings.inc.php | 36 +- .../tab3_user_settings.inc.php | 14 +- .../tab4_manager_settings.inc.php | 4 +- .../tab5_security_settings.inc.php | 58 +- .../tab6_filemanager_settings.inc.php | 4 +- .../tab7_filebrowser_settings.inc.php | 6 +- manager/actions/mutate_snippet.dynamic.php | 4 +- .../mutate_template_tv_rank.dynamic.php | 4 +- manager/actions/mutate_templates.dynamic.php | 263 +-- manager/actions/mutate_tmplvars.dynamic.php | 262 +-- manager/actions/mutate_tv_rank.dynamic.php | 4 +- manager/actions/mutate_user.dynamic.php | 1601 +++++++++++++++++ manager/actions/mutate_web_user.dynamic.php | 209 ++- manager/actions/phpinfo.static.php | 2 +- manager/actions/refresh_site.dynamic.php | 20 +- manager/actions/resource_selector.static.php | 2 +- manager/actions/resources.static.php | 132 +- manager/actions/resources/functions.inc.php | 352 ++-- .../actions/resources/mgrResources.class.php | 226 ++- .../actions/resources/tab1_templates.inc.php | 8 +- .../resources/tab2_templatevars.inc.php | 8 +- manager/actions/resources/tab3_chunks.inc.php | 8 +- .../actions/resources/tab4_snippets.inc.php | 8 +- .../actions/resources/tab5_plugins.inc.php | 23 +- .../resources/tab6_categoryview.inc.php | 2 +- manager/actions/role_management.static.php | 38 +- manager/actions/search.static.php | 105 +- manager/actions/site_schedule.static.php | 77 +- manager/actions/sysinfo.static.php | 33 +- manager/actions/user_management.static.php | 114 +- .../web_access_permissions.dynamic.php | 179 +- .../actions/web_user_management.static.php | 64 +- manager/actions/welcome.static.php | 550 +++--- manager/frames/1.php | 134 +- manager/frames/mainmenu.php | 702 ++++---- manager/frames/nodes.functions.inc.php | 16 +- manager/frames/tree.php | 70 +- manager/includes/accesscontrol.inc.php | 11 +- manager/includes/actionlist.inc.php | 265 ++- manager/includes/active_user_locks.inc.php | 4 +- manager/includes/charsets.php | 48 +- manager/includes/config_check.inc.php | 140 +- manager/includes/controls/contextmenu.php | 94 +- manager/includes/controls/datagrid.class.php | 475 +++-- .../includes/controls/datasetpager.class.php | 344 ++-- manager/includes/controls/phpmailer/OAuth.php | 2 +- .../includes/controls/phpmailer/PHPMailer.php | 182 +- manager/includes/controls/phpmailer/POP3.php | 6 +- manager/includes/controls/phpmailer/SMTP.php | 44 +- manager/includes/debug.inc.php | 15 +- manager/includes/default_config.php | 3 + .../includes/document.parser.class.inc.php | 297 +-- manager/includes/error.class.inc.php | 1 + .../extenders/dbapi.mysql.class.inc.php | 20 +- .../extenders/dbapi.mysqli.class.inc.php | 37 +- .../extenders/deprecated.functions.inc.php | 6 +- manager/includes/extenders/ex_dbapi.inc.php | 8 +- .../includes/extenders/export.class.inc.php | 7 +- .../includes/extenders/maketable.class.php | 8 +- .../extenders/manager.api.class.inc.php | 1 + .../includes/extenders/message.quit.inc.php | 77 +- .../extenders/modifiers.class.inc.php | 1089 +++++------ .../extenders/modifiers/mdf_addbreak.inc.php | 17 +- .../extenders/modifiers/mdf_getimage.inc.php | 23 +- .../extenders/modifiers/mdf_memberof.inc.php | 25 +- .../extenders/modifiers/mdf_moduser.inc.php | 7 +- .../extenders/modifiers/mdf_summary.inc.php | 57 +- .../extenders/modifiers/mdf_wordwrap.inc.php | 4 +- manager/includes/footer.inc.php | 30 +- manager/includes/header.inc.php | 12 +- manager/includes/log.class.inc.php | 10 +- manager/includes/manager.lockout.inc.php | 99 +- manager/includes/menu.class.inc.php | 3 +- manager/includes/preload.functions.inc.php | 16 +- manager/includes/protect.inc.php | 4 +- manager/includes/sysalert.display.inc.php | 45 +- .../includes/template.parser.class.inc.php | 285 ++- manager/includes/tmplvars.commands.inc.php | 97 +- manager/includes/tmplvars.format.inc.php | 661 ++++--- manager/includes/tmplvars.inc.php | 504 +++--- manager/includes/user_settings.inc.php | 2 +- manager/includes/veriword.php | 61 +- manager/index.php | 1377 +++++++------- manager/media/browser/mcpuk/browse.php | 17 +- manager/media/browser/mcpuk/browser.php | 18 +- manager/media/browser/mcpuk/config.php | 22 +- manager/media/browser/mcpuk/core/autoload.php | 44 +- manager/media/browser/mcpuk/core/browser.php | 611 +++---- .../browser/mcpuk/core/types/type_img.php | 11 +- .../browser/mcpuk/core/types/type_mime.php | 20 +- manager/media/browser/mcpuk/core/uploader.php | 474 ++--- manager/media/browser/mcpuk/css.php | 6 +- .../media/browser/mcpuk/js/browser/joiner.php | 6 +- manager/media/browser/mcpuk/js_localize.php | 10 +- manager/media/browser/mcpuk/lang/af.php | 2 + manager/media/browser/mcpuk/lang/bg.php | 2 + manager/media/browser/mcpuk/lang/ca.php | 2 + manager/media/browser/mcpuk/lang/cs.php | 2 + manager/media/browser/mcpuk/lang/da.php | 4 +- manager/media/browser/mcpuk/lang/de.php | 2 + manager/media/browser/mcpuk/lang/el.php | 2 + manager/media/browser/mcpuk/lang/en.php | 2 + manager/media/browser/mcpuk/lang/es.php | 2 + manager/media/browser/mcpuk/lang/et.php | 2 + manager/media/browser/mcpuk/lang/fa.php | 2 + manager/media/browser/mcpuk/lang/fi.php | 2 + manager/media/browser/mcpuk/lang/fr.php | 2 + manager/media/browser/mcpuk/lang/he.php | 2 + manager/media/browser/mcpuk/lang/hu.php | 2 + manager/media/browser/mcpuk/lang/id.php | 2 + manager/media/browser/mcpuk/lang/it.php | 2 + manager/media/browser/mcpuk/lang/ja.php | 2 + manager/media/browser/mcpuk/lang/lt.php | 2 + manager/media/browser/mcpuk/lang/nl.php | 2 + manager/media/browser/mcpuk/lang/no.php | 2 + manager/media/browser/mcpuk/lang/pl.php | 2 + manager/media/browser/mcpuk/lang/pt-br.php | 2 + manager/media/browser/mcpuk/lang/pt.php | 2 + manager/media/browser/mcpuk/lang/ro.php | 2 + manager/media/browser/mcpuk/lang/ru.php | 2 + manager/media/browser/mcpuk/lang/sk.php | 2 + manager/media/browser/mcpuk/lang/sv.php | 2 + manager/media/browser/mcpuk/lang/tr.php | 2 + manager/media/browser/mcpuk/lang/uk.php | 6 +- manager/media/browser/mcpuk/lang/vi.php | 2 + manager/media/browser/mcpuk/lang/zh-cn.php | 2 + .../browser/mcpuk/lib/class_fastImage.php | 426 ++--- manager/media/browser/mcpuk/lib/class_gd.php | 353 ++-- .../media/browser/mcpuk/lib/class_image.php | 270 ++- .../browser/mcpuk/lib/class_image_gd.php | 197 +- .../browser/mcpuk/lib/class_image_gmagick.php | 112 +- .../browser/mcpuk/lib/class_image_imagick.php | 112 +- .../media/browser/mcpuk/lib/class_input.php | 23 +- .../browser/mcpuk/lib/class_zipFolder.php | 20 +- .../media/browser/mcpuk/lib/helper_dir.php | 106 +- .../media/browser/mcpuk/lib/helper_file.php | 112 +- .../browser/mcpuk/lib/helper_httpCache.php | 86 +- .../media/browser/mcpuk/lib/helper_path.php | 100 +- .../media/browser/mcpuk/lib/helper_text.php | 45 +- .../media/browser/mcpuk/tpl/tpl_browser.php | 4 +- manager/media/browser/mcpuk/tpl/tpl_css.php | 2 +- .../browser/mcpuk/tpl/tpl_javascript.php | 24 +- manager/media/calendar/datepicker.inc.php | 20 +- .../script/air-datepicker/datepicker.inc.php | 30 +- .../common/moo-datepicker/datepicker.inc.php | 16 +- manager/media/style/default/ajax.php | 19 +- manager/media/style/default/style.php | 242 +-- manager/media/style/default/welcome.php | 14 +- .../processors/access_groups.processor.php | 196 +- .../processors/cache_sync.class.processor.php | 19 +- .../processors/delete_category.processor.php | 4 +- .../processors/delete_content.processor.php | 48 +- .../processors/delete_eventlog.processor.php | 18 +- .../delete_htmlsnippet.processor.php | 22 +- .../processors/delete_message.processor.php | 2 +- .../processors/delete_module.processor.php | 22 +- .../processors/delete_plugin.processor.php | 22 +- manager/processors/delete_role.processor.php | 18 +- .../processors/delete_snippet.processor.php | 22 +- .../processors/delete_template.processor.php | 40 +- .../processors/delete_tmplvars.processor.php | 40 +- manager/processors/delete_user.processor.php | 34 +- .../processors/delete_web_user.processor.php | 30 +- .../duplicate_content.processor.php | 225 ++- .../duplicate_htmlsnippet.processor.php | 31 +- .../processors/duplicate_module.processor.php | 86 +- .../processors/duplicate_plugin.processor.php | 49 +- .../duplicate_snippet.processor.php | 33 +- .../duplicate_template.processor.php | 43 +- .../duplicate_tmplvars.processor.php | 65 +- manager/processors/empty_table.processor.php | 6 +- .../processors/execute_module.processor.php | 141 +- manager/processors/export_site.processor.php | 32 +- manager/processors/login.processor.php | 418 +++-- manager/processors/logout.processor.php | 18 +- .../processors/move_document.processor.php | 157 +- .../processors/optimize_table.processor.php | 36 +- .../processors/publish_content.processor.php | 44 +- manager/processors/purge_plugin.processor.php | 17 +- .../processors/remove_content.processor.php | 40 +- .../processors/remove_installer.processor.php | 42 +- manager/processors/remove_locks.processor.php | 38 +- manager/processors/save_content.processor.php | 110 +- .../processors/save_htmlsnippet.processor.php | 2 +- manager/processors/save_module.processor.php | 2 +- .../processors/save_password.processor.php | 36 +- manager/processors/save_plugin.processor.php | 23 +- manager/processors/save_role.processor.php | 220 +-- .../processors/save_settings.processor.php | 233 +-- manager/processors/save_snippet.processor.php | 2 +- .../processors/save_template.processor.php | 2 +- .../processors/save_tmplvars.processor.php | 7 +- manager/processors/save_user.processor.php | 764 ++++---- .../processors/save_web_user.processor.php | 597 +++--- manager/processors/send_message.processor.php | 104 +- .../processors/undelete_content.processor.php | 78 +- .../unpublish_content.processor.php | 44 +- .../user_documents_permissions.class.php | 1 + .../web_access_groups.processor.php | 196 +- 228 files changed, 12373 insertions(+), 11721 deletions(-) diff --git a/index.php b/index.php index 3d2e2beef2..5322472776 100644 --- a/index.php +++ b/index.php @@ -1,42 +1,42 @@ stopOnNotice = false; // Don't show PHP errors to the public -if (!isset($_SESSION['mgrValidated']) || !$_SESSION['mgrValidated']) { - @ini_set("display_errors", "0"); +if(!isset($_SESSION['mgrValidated']) || !$_SESSION['mgrValidated']) { + @ini_set("display_errors","0"); } -if (MODX_CLI) { +if(MODX_CLI){ @set_time_limit(0); - @ini_set('max_execution_time', 0); + @ini_set('max_execution_time',0); } // execute the parser if index.php was not included diff --git a/manager/actions/access_permissions.dynamic.php b/manager/actions/access_permissions.dynamic.php index a354a2e9fc..0450f6ad9a 100755 --- a/manager/actions/access_permissions.dynamic.php +++ b/manager/actions/access_permissions.dynamic.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('access_permissions')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('access_permissions')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // Get table names (alphabetical) @@ -17,25 +17,25 @@ // find all document groups, for the select :) $rs = $modx->db->select('*', $tbl_documentgroup_names, '', 'name'); -if ($modx->db->getRecordCount($rs) < 1) { - $docgroupselector = '[no groups to add]'; +if($modx->db->getRecordCount($rs) < 1) { + $docgroupselector = '[no groups to add]'; } else { - $docgroupselector = '\n"; + $docgroupselector = '\n"; } $rs = $modx->db->select('*', $tbl_membergroup_names, '', 'name'); -if ($modx->db->getRecordCount($rs) < 1) { - $usrgroupselector = '[no user groups]'; +if($modx->db->getRecordCount($rs) < 1) { + $usrgroupselector = '[no user groups]'; } else { - $usrgroupselector = '\n"; + $usrgroupselector = '\n"; } ?> @@ -96,23 +96,24 @@ function deletegroup(groupid, type) { db->select('groupnames.*, users.id AS user_id, users.username user_name', $tbl_membergroup_names . ' AS groupnames + $rs = $modx->db->select('groupnames.*, users.id AS user_id, users.username user_name', $tbl_membergroup_names . ' AS groupnames LEFT JOIN ' . $tbl_member_groups . ' AS groups ON groups.user_group = groupnames.id LEFT JOIN ' . $tbl_manager_users . ' AS users ON users.id = groups.member', '', 'groupnames.name, user_name'); - if ($modx->db->getRecordCount($rs) < 1) { - ?> + if($modx->db->getRecordCount($rs) < 1) { + ?>
    + } else { + ?>
    db->getRow($rs)) { - if ($pid != $row['id']) { - if ($pid != '') { - echo '
    '; - } ?> + $pid = ''; + while($row = $modx->db->getRow($rs)) { + if($pid != $row['id']) { + if($pid != '') { + echo '
    '; + } + ?>
    @@ -127,20 +128,21 @@ function deletegroup(groupid, type) {
    + } + if(!$row['user_id']) { + ?> + $pid = $row['id']; + continue; + } + ?> + $pid = $row['id']; + } + } + ?>
    @@ -165,23 +167,24 @@ function deletegroup(groupid, type) { db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $tbl_documentgroup_names . ' AS dgnames + $rs = $modx->db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $tbl_documentgroup_names . ' AS dgnames LEFT JOIN ' . $tbl_document_groups . ' AS dg ON dg.document_group = dgnames.id LEFT JOIN ' . $tbl_site_content . ' AS sc ON sc.id = dg.document', '', 'dgnames.name, sc.id'); - if ($modx->db->getRecordCount($rs) < 1) { - ?> + if($modx->db->getRecordCount($rs) < 1) { + ?>
    + } else { + ?>
    db->getRow($rs)) { - if ($pid != $row['id']) { - if ($pid != '') { - echo '
    '; - } ?> + $pid = ''; + while($row = $modx->db->getRow($rs)) { + if($pid != $row['id']) { + if($pid != '') { + echo '
    '; + } + ?>
    @@ -196,20 +199,21 @@ function deletegroup(groupid, type) {
    + } + if(!$row['doc_id']) { + ?> + $pid = $row['id']; + continue; + } + ?> + $pid = $row['id']; + } + } + ?>
    @@ -221,16 +225,16 @@ function deletegroup(groupid, type) {

    db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $tbl_membergroup_names . ' AS groupnames + // User/Document Group Links + $rs = $modx->db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $tbl_membergroup_names . ' AS groupnames LEFT JOIN ' . $tbl_membergroup_access . ' AS groupacc ON groupacc.membergroup = groupnames.id LEFT JOIN ' . $tbl_documentgroup_names . ' AS dgnames ON dgnames.id = groupacc.documentgroup', '', 'name, dg_name'); - if ($modx->db->getRecordCount($rs) < 1) { - ?> + if($modx->db->getRecordCount($rs) < 1) { + ?>
    + } else { + ?>
    @@ -246,35 +250,38 @@ function deletegroup(groupid, type) {
      db->getRow($rs)) { - if ($row['id'] != $pid) { - if ($pid != '') { - echo '
    '; - } // close previous one ?> + $pid = ''; + while($row = $modx->db->getRow($rs)) { + if($row['id'] != $pid) { + if($pid != '') { + echo ''; + } // close previous one + ?>
  • ' . $_lang['no_groups_found'] . ''; - $pid = ''; - continue; - } else { - echo '
      '; - } - } - if (!$row['dg_id']) { - continue; - } ?> + if(!$row['dg_id']) { + echo '' . $_lang['no_groups_found'] . ''; + $pid = ''; + continue; + } else { + echo '
        '; + } + } + if(!$row['dg_id']) { + continue; + } + ?>
      • ()
      • + $pid = $row['id']; + } + ?>
      + } + ?>
    diff --git a/manager/actions/bkmanager.static.php b/manager/actions/bkmanager.static.php index 64b910ac50..6927c17d53 100755 --- a/manager/actions/bkmanager.static.php +++ b/manager/actions/bkmanager.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('bk_manager')) { @@ -274,12 +274,10 @@ function showhide(a) - 0) { - ?> + 0) { ?>

    - + @@ -425,33 +423,34 @@ function checked($cond) nicesize(filesize($file)); - - $file = fopen($file, "r"); - $count = 0; - $details = array(); - while ($count < 11) { - $line = fgets($file); - foreach ($detailFields as $label) { - $fileLabel = '# ' . $label; - if (strpos($line, $fileLabel) !== false) { - $details[$label] = htmlentities(trim(str_replace(array( + while ($file = array_shift($files)) { + $filename = substr($file, strrpos($file, '/') + 1); + $filesize = $modx->nicesize(filesize($file)); + + $file = fopen($file, "r"); + $count = 0; + $details = array(); + while ($count < 11) { + $line = fgets($file); + foreach ($detailFields as $label) { + $fileLabel = '# ' . $label; + if (strpos($line, $fileLabel) !== false) { + $details[$label] = htmlentities(trim(str_replace(array( $fileLabel, ':', '`' ), '', $line)), ENT_QUOTES, $modx_manager_charset); - } - } - $count++; - }; - fclose($file); - - $tooltip = "Generation Time: " . $details["Generation Time"] . "\n"; - $tooltip .= "Server version: " . $details["Server version"] . "\n"; - $tooltip .= "PHP Version: " . $details["PHP Version"] . "\n"; - $tooltip .= "Host: " . $details["Host"] . "\n"; ?> + } + } + $count++; + }; + fclose($file); + + $tooltip = "Generation Time: " . $details["Generation Time"] . "\n"; + $tooltip .= "Server version: " . $details["Server version"] . "\n"; + $tooltip .= "PHP Version: " . $details["PHP Version"] . "\n"; + $tooltip .= "Host: " . $details["Host"] . "\n"; + ?> @@ -462,7 +461,8 @@ function checked($cond) + } + ?> @@ -623,9 +623,7 @@ public function createDump($callBack) $insertdump = $lf; $insertdump .= "INSERT INTO `{$tblval}` VALUES ("; $arr = $this->object2Array($row); - if (! is_array($arr)) { - $arr = array(); - } + if( ! is_array($arr)) $arr = array(); foreach ($arr as $key => $value) { if (is_null($value)) { $value = 'NULL'; @@ -736,8 +734,7 @@ public function object2Array($obj) */ function import_sql($source, $result_code = 'import_ok') { - $modx = evolutionCMS(); - global $e; + $modx = evolutionCMS(); global $e; $rs = null; if ($modx->getLockedElements() !== array()) { diff --git a/manager/actions/category_mgr/inc/Module_Categories_Manager.php b/manager/actions/category_mgr/inc/Module_Categories_Manager.php index e5a5e7628b..ef43029465 100755 --- a/manager/actions/category_mgr/inc/Module_Categories_Manager.php +++ b/manager/actions/category_mgr/inc/Module_Categories_Manager.php @@ -118,6 +118,7 @@ public function renderView($view_name, $data = array()) */ public function updateElement($element, $element_id, $category_id) { + $_update = array( 'id' => (int)$element_id, 'category' => (int)$category_id diff --git a/manager/actions/category_mgr/inc/request_trigger.inc.php b/manager/actions/category_mgr/inc/request_trigger.inc.php index d8bda1eb62..d95f86fd55 100755 --- a/manager/actions/category_mgr/inc/request_trigger.inc.php +++ b/manager/actions/category_mgr/inc/request_trigger.inc.php @@ -2,32 +2,36 @@ /** * Ajax Requests */ -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (isset($_REQUEST[$cm->get('request_key')]['ajax'])) { +if( isset( $_REQUEST[$cm->get('request_key')]['ajax'] ) ) +{ $_data = $_REQUEST[$cm->get('request_key')]; $output = ''; $task = $_data['task']; - switch ($task) { + switch( $task ) + { /** * get categories */ case 'categorize_load_elements': $elements = $_data['elements']; - if ($uncategorized_elements = $cm->getAssignedElements(0, $_data['elements'])) { - $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements); + if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) ) + { + $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements); } - foreach ($cm->getCategories() as $category) { - $category['elements'] = $cm->getAssignedElements($category['id'], $_data['elements']); + foreach( $cm->getCategories() as $category ) + { + $category['elements'] = $cm->getAssignedElements( $category['id'], $_data['elements'] ); $output .= $cm->renderView('chunks/categorize/category', $category); } break; } - exit($output); + exit( $output ); } /** * Categorize elements @@ -37,7 +41,8 @@ * @see http://modxcms.com/forums/index.php/topic,40430.msg251476.html#msg251476 * */ -if (isset($_POST[$cm->get('request_key')]['categorize']['submit'])) { +if( isset( $_POST[$cm->get('request_key')]['categorize']['submit'] ) ) +{ $_data = $_POST[$cm->get('request_key')]['categorize']; $_changes = 0; @@ -49,13 +54,16 @@ 'categorize' ); - if (!isset($_data['elements'])) { - $cm->addMessage($cm->txt('cm_unknown_error'), 'categorize'); + if( !isset( $_data['elements'] ) ) + { + $cm->addMessage( $cm->txt('cm_unknown_error'), 'categorize' ); return; } - foreach ($_data['elements'] as $element_id => $data) { - if ($cm->updateElement($_data['elementsgroup'], $element_id, $data['category_id'])) { + foreach( $_data['elements'] as $element_id => $data ) + { + if( $cm->updateElement( $_data['elementsgroup'], $element_id, $data['category_id'] ) ) + { $cm->addMessage( sprintf( $cm->txt('cm_x_assigned_to_category_y'), @@ -70,10 +78,13 @@ } } - if ($_changes === 0) { - $cm->addMessage($cm->txt('cm_no_categorization'), 'categorize'); + if( $_changes === 0 ) + { + $cm->addMessage( $cm->txt('cm_no_categorization'), 'categorize' ); return; - } else { + } + else + { $cm->addMessage( sprintf( $cm->txt('cm_x_changes_made'), @@ -87,49 +98,58 @@ /** * Add a new category */ -if (isset($_POST[$cm->get('request_key')]['add']['submit'])) { +if( isset( $_POST[$cm->get('request_key')]['add']['submit'] ) ) +{ $_data = $_POST[$cm->get('request_key')]['add']['data']; - $category = trim(html_entity_decode($_data['name'])); + $category = trim( html_entity_decode($_data['name']) ); $rank = (int) $_data['rank']; - if (empty($category)) { - $cm->addMessage($cm->txt('cm_enter_name_for_category'), 'add'); - return; + if( empty( $category ) ) + { + $cm->addMessage( $cm->txt('cm_enter_name_for_category'), 'add' ); + return; } - if ($cm->isCategoryExists($category)) { - $cm->addMessage(sprintf($cm->txt('cm_category_x_exists'), $category), 'add'); - return; + if( $cm->isCategoryExists( $category ) ) + { + $cm->addMessage( sprintf( $cm->txt('cm_category_x_exists'), $category ), 'add' ); + return; } - if ($cm->addCategory($category, $rank) !== 0) { + if( $cm->addCategory( $category, $rank ) !== 0 ) + { $cm->addMessage( sprintf( - $cm->txt('cm_category_x_saved_at_position_y'), + $cm->txt( 'cm_category_x_saved_at_position_y' ), $category, $rank ), 'add' ); - } else { - $cm->addMessage($cm->txt('cm_unknown_error'), 'add'); + } + else + { + $cm->addMessage( $cm->txt('cm_unknown_error'), 'add' ); } } /** * Sort categories */ -if (isset($_POST[$cm->get('request_key')]['sort']['submit'])) { +if( isset( $_POST[$cm->get('request_key')]['sort']['submit'] ) ) +{ $categories = $_POST[$cm->get('request_key')]['sort']['data']; $_changes = 0; - foreach ($categories as $category_id => $_data) { + foreach( $categories as $category_id => $_data ) + { $data = array( - 'category' => urldecode($_data['category']), + 'category' => urldecode( $_data['category'] ), 'rank' => $_data['rank'] ); - if ($cm->updateCategory($category_id, $data)) { + if( $cm->updateCategory( $category_id, $data ) ) + { $cm->addMessage( sprintf( $cm->txt('cm_category_x_moved_to_position_y'), @@ -142,9 +162,12 @@ } } - if ($_changes === 0) { - $cm->addMessage($cm->txt('cm_no_changes'), 'sort'); - } else { + if( $_changes === 0 ) + { + $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'sort'); + } + else + { $cm->addMessage( sprintf( $cm->txt('cm_x_changes_made'), @@ -158,17 +181,21 @@ /** * Edit categories */ -if (isset($_POST[$cm->get('request_key')]['edit']['submit'])) { +if( isset( $_POST[$cm->get('request_key')]['edit']['submit'] ) ) +{ $categories = $_POST[$cm->get('request_key')]['edit']['data']; $_changes = 0; - foreach ($categories as $category_id => $_data) { - if (isset($_data['delete'])) { - if ($cm->deleteCategory($category_id)) { + foreach( $categories as $category_id => $_data ) + { + if( isset( $_data['delete'] ) ) + { + if( $cm->deleteCategory( $category_id ) ) + { $cm->addMessage( sprintf( $cm->txt('cm_category_x_deleted'), - urldecode($_data['origin']) + urldecode( $_data['origin'] ) ), 'edit' ); @@ -178,15 +205,16 @@ } $data = array( - 'category' => trim(html_entity_decode($_data['category'])), + 'category' => trim( html_entity_decode( $_data['category'] ) ), 'rank' => $_data['rank'] ); - if ($cm->updateCategory($category_id, $data)) { + if( $cm->updateCategory( $category_id, $data ) ) + { $cm->addMessage( sprintf( $cm->txt('cm_category_x_renamed_to_y'), - urldecode($_data['origin']), + urldecode( $_data['origin'] ), $data['category'] ), 'edit' @@ -195,23 +223,26 @@ } } - if ($_changes === 0) { - $cm->addMessage($cm->txt('cm_no_changes'), 'edit'); + if( $_changes === 0 ) + { + $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'edit'); } } /** * Delete singel category by $_GET */ -if (isset($_GET[$cm->get('request_key')]['delete']) - && !empty($_GET[$cm->get('request_key')]['delete'])) { +if( isset( $_GET[$cm->get('request_key')]['delete'] ) + && !empty( $_GET[$cm->get('request_key')]['delete'] ) ) +{ $category_id = (int)$_GET[$cm->get('request_key')]['delete']; - if ($cm->deleteCategory($category_id)) { + if( $cm->deleteCategory( $category_id ) ) + { $cm->addMessage( sprintf( $cm->txt('cm_category_x_deleted'), - urldecode($_GET[$cm->get('request_key')]['category']) + urldecode( $_GET[$cm->get('request_key')]['category'] ) ), 'edit' ); @@ -220,13 +251,16 @@ /** * Translate phrases */ -if (isset($_POST[$cm->get('request_key')]['translate']['submit'])) { +if( isset( $_POST[$cm->get('request_key')]['translate']['submit'] ) ) +{ $translations = $_POST[$cm->get('request_key')]['translate']['data']; - foreach ($translations as $native_phrase => $translation) { - $native_phrase = urldecode($native_phrase); + foreach( $translations as $native_phrase => $translation ) + { + $native_phrase = urldecode( $native_phrase ); - if (empty($translation)) { + if( empty( $translation ) ) + { $translation = $native_phrase; $cm->addMessage( @@ -238,7 +272,7 @@ ); } - $cm->c('Translator')->addTranslation($native_phrase, $translation, 'phrase'); + $cm->c('Translator')->addTranslation( $native_phrase, $translation, 'phrase' ); $cm->addMessage( sprintf( diff --git a/manager/actions/document_data.static.php b/manager/actions/document_data.static.php index c11565e2ab..84b7e291ee 100755 --- a/manager/actions/document_data.static.php +++ b/manager/actions/document_data.static.php @@ -1,16 +1,16 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (isset($_REQUEST['id'])) { - $id = (int) $_REQUEST['id']; +if(isset($_REQUEST['id'])) { + $id = (int) $_REQUEST['id']; } else { - $id = 0; + $id = 0; } -if (isset($_GET['opened'])) { - $_SESSION['openedArray'] = $_GET['opened']; +if(isset($_GET['opened'])) { + $_SESSION['openedArray'] = $_GET['opened']; } $url = $modx->config['site_url']; @@ -22,26 +22,26 @@ $tbl_site_templates = $modx->getFullTableName('site_templates'); // Get access permissions -if ($_SESSION['mgrDocgroups']) { - $docgrp = implode(",", $_SESSION['mgrDocgroups']); +if($_SESSION['mgrDocgroups']) { + $docgrp = implode(",", $_SESSION['mgrDocgroups']); } $access = "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0" . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); // -if ($_SESSION['tree_show_only_folders']) { - $parent = $id ? ($modx->db->getValue("SELECT parent FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1")) : 0; - $isfolder = $modx->db->getValue("SELECT isfolder FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1"); - if (!$isfolder && $parent != 0) { - $id = $_REQUEST['id'] = $parent; - } +if($_SESSION['tree_show_only_folders']) { + $parent = $id ? ($modx->db->getValue("SELECT parent FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1")) : 0; + $isfolder = $modx->db->getValue("SELECT isfolder FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1"); + if(!$isfolder && $parent != 0) { + $id = $_REQUEST['id'] = $parent; + } } // Get the document content $rs = $modx->db->select('DISTINCT sc.*', "{$tbl_site_content} AS sc LEFT JOIN {$tbl_document_groups} AS dg ON dg.document = sc.id", "sc.id ='{$id}' AND ({$access})"); $content = $modx->db->getRow($rs); -if (!$content) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); +if(!$content) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); } /** @@ -84,134 +84,135 @@ ); $filter_sort = ''; $filter_dir = ''; -if ($numRecords > 0) { - $filter_sort = ''; - $filter_dir = ''; - $resource = $modx->db->makeArray($rs); - - // CSS style for table - // $tableClass = 'grid'; - // $rowHeaderClass = 'gridHeader'; - // $rowRegularClass = 'gridItem'; - // $rowAlternateClass = 'gridAltItem'; - $tableClass = 'table data nowrap'; - $columnHeaderClass = array( - 'text-center', - 'text-left', - 'text-center', - 'text-center', - 'text-center', - 'text-center' - ); - - - $modx->table->setTableClass($tableClass); - $modx->table->setColumnHeaderClass($columnHeaderClass); - // $modx->table->setRowHeaderClass($rowHeaderClass); - // $modx->table->setRowRegularClass($rowRegularClass); - // $modx->table->setRowAlternateClass($rowAlternateClass); - - // Table header - $listTableHeader = array( - 'docid' => $_lang['id'], - 'title' => $_lang['resource_title'], - 'createdon' => $_lang['createdon'], - 'pub_date' => $_lang['page_data_publishdate'], - 'status' => $_lang['page_data_status'], - 'edit' => $_lang['mgrlog_action'], - ); - $tbWidth = array( - '1%', - '', - '1%', - '1%', - '1%', - '1%' - ); - $modx->table->setColumnWidths($tbWidth); - - $sd = isset($_REQUEST['dir']) ? '&dir=' . $_REQUEST['dir'] : '&dir=DESC'; - $sb = isset($_REQUEST['sort']) ? '&sort=' . $_REQUEST['sort'] : '&sort=createdon'; - $pg = isset($_REQUEST['page']) ? '&page=' . (int) $_REQUEST['page'] : ''; - $add_path = $sd . $sb . $pg; - - $icons = array( - 'text/html' => $_style['tree_page_html'], - 'text/plain' => $_style['tree_page'], - 'text/xml' => $_style['tree_page_xml'], - 'text/css' => $_style['tree_page_css'], - 'text/javascript' => $_style['tree_page_js'], - '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'], - 'image/gif' => $_style['tree_page_gif'], - 'image/jpg' => $_style['tree_page_jpg'], - 'image/png' => $_style['tree_page_png'] - ); - - $listDocs = array(); - foreach ($resource as $k => $children) { - switch ($children['id']) { - case $modx->config['site_start']: - $icon = $_style['tree_page_home']; - break; - case $modx->config['error_page']: - $icon = $_style['tree_page_404']; - break; - case $modx->config['site_unavailable_page']: - $icon = $_style['tree_page_hourglass']; - break; - case $modx->config['unauthorized_page']: - $icon = $_style['tree_page_info']; - break; - default: - if ($children['isfolder']) { - $icon = $_style['tree_folder_new']; - } else { - if (isset($icons[$children['contentType']])) { - $icon = $icons[$children['contentType']]; - } else { - $icon = $_style['tree_page']; - } - } - } - - $private = ($children['privateweb'] || $children['privatemgr'] ? ' private' : ''); - - // дописываем в заголовок класс для неопубликованных плюс по всем ссылкам обратный путь - // для сохранения сортировки - $class = ($children['deleted'] ? 'text-danger text-decoration-through' : (!$children['published'] ? ' font-italic text-muted' : ' publish')); - //$class .= ($children['hidemenu'] ? ' text-muted' : ' text-primary'); - //$class .= ($children['isfolder'] ? ' font-weight-bold' : ''); - if ($modx->hasPermission('edit_document')) { - $title = '' . $icon . '' . '' . $children['pagetitle'] . ''; - } else { - $title = '' . $icon . '' . $children['pagetitle'] . ''; - } - - $icon_pub_unpub = (!$children['published']) ? '' : ''; - - $icon_del_undel = (!$children['deleted']) ? '' : ''; - - $listDocs[] = array( - 'docid' => '
    ' . $children['id'] . '
    ', - 'title' => $title, - 'createdon' => '
    ' . ($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')) . '
    ', - 'pub_date' => '
    ' . ($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '') . '
    ', - 'status' => '
    ' . ($children['published'] == 0 ? '' . $_lang['page_data_unpublished'] . '' : '' . $_lang['page_data_published'] . '') . '
    ', - 'edit' => '
    ' . ($modx->hasPermission('edit_document') ? ' 0) { + $filter_sort = ''; + $filter_dir = ''; + $resource = $modx->db->makeArray($rs); + + // CSS style for table + // $tableClass = 'grid'; + // $rowHeaderClass = 'gridHeader'; + // $rowRegularClass = 'gridItem'; + // $rowAlternateClass = 'gridAltItem'; + $tableClass = 'table data nowrap'; + $columnHeaderClass = array( + 'text-center', + 'text-left', + 'text-center', + 'text-center', + 'text-center', + 'text-center' + ); + + + $modx->table->setTableClass($tableClass); + $modx->table->setColumnHeaderClass($columnHeaderClass); + // $modx->table->setRowHeaderClass($rowHeaderClass); + // $modx->table->setRowRegularClass($rowRegularClass); + // $modx->table->setRowAlternateClass($rowAlternateClass); + + // Table header + $listTableHeader = array( + 'docid' => $_lang['id'], + 'title' => $_lang['resource_title'], + 'createdon' => $_lang['createdon'], + 'pub_date' => $_lang['page_data_publishdate'], + 'status' => $_lang['page_data_status'], + 'edit' => $_lang['mgrlog_action'], + ); + $tbWidth = array( + '1%', + '', + '1%', + '1%', + '1%', + '1%' + ); + $modx->table->setColumnWidths($tbWidth); + + $sd = isset($_REQUEST['dir']) ? '&dir=' . $_REQUEST['dir'] : '&dir=DESC'; + $sb = isset($_REQUEST['sort']) ? '&sort=' . $_REQUEST['sort'] : '&sort=createdon'; + $pg = isset($_REQUEST['page']) ? '&page=' . (int) $_REQUEST['page'] : ''; + $add_path = $sd . $sb . $pg; + + $icons = array( + 'text/html' => $_style['tree_page_html'], + 'text/plain' => $_style['tree_page'], + 'text/xml' => $_style['tree_page_xml'], + 'text/css' => $_style['tree_page_css'], + 'text/javascript' => $_style['tree_page_js'], + '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'], + 'image/gif' => $_style['tree_page_gif'], + 'image/jpg' => $_style['tree_page_jpg'], + 'image/png' => $_style['tree_page_png'] + ); + + $listDocs = array(); + foreach($resource as $k => $children) { + + switch($children['id']) { + case $modx->config['site_start'] : + $icon = $_style['tree_page_home']; + break; + case $modx->config['error_page'] : + $icon = $_style['tree_page_404']; + break; + case $modx->config['site_unavailable_page'] : + $icon = $_style['tree_page_hourglass']; + break; + case $modx->config['unauthorized_page'] : + $icon = $_style['tree_page_info']; + break; + default: + if($children['isfolder']) { + $icon = $_style['tree_folder_new']; + } else { + if(isset($icons[$children['contentType']])) { + $icon = $icons[$children['contentType']]; + } else { + $icon = $_style['tree_page']; + } + } + } + + $private = ($children['privateweb'] || $children['privatemgr'] ? ' private' : ''); + + // дописываем в заголовок класс для неопубликованных плюс по всем ссылкам обратный путь + // для сохранения сортировки + $class = ($children['deleted'] ? 'text-danger text-decoration-through' : (!$children['published'] ? ' font-italic text-muted' : ' publish')); + //$class .= ($children['hidemenu'] ? ' text-muted' : ' text-primary'); + //$class .= ($children['isfolder'] ? ' font-weight-bold' : ''); + if($modx->hasPermission('edit_document')) { + $title = '' . $icon . '' . '' . $children['pagetitle'] . ''; + } else { + $title = '' . $icon . '' . $children['pagetitle'] . ''; + } + + $icon_pub_unpub = (!$children['published']) ? '' : ''; + + $icon_del_undel = (!$children['deleted']) ? '' : ''; + + $listDocs[] = array( + 'docid' => '
    ' . $children['id'] . '
    ', + 'title' => $title, + 'createdon' => '
    ' . ($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')) . '
    ', + 'pub_date' => '
    ' . ($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '') . '
    ', + 'status' => '
    ' . ($children['published'] == 0 ? '' . $_lang['page_data_unpublished'] . '' : '' . $_lang['page_data_published'] . '') . '
    ', + 'edit' => '
    ' . ($modx->hasPermission('edit_document') ? '' . $icon_pub_unpub : '') . ($modx->hasPermission('delete_document') ? $icon_del_undel : '') . '
    ' - ); - } + ); + } - $modx->table->createPagingNavigation($numRecords, 'a=3&id=' . $content['id'] . '&dir=' . $dir . '&sort=' . $sort); - $children_output = $modx->table->create($listDocs, $listTableHeader, 'index.php?a=3&id=' . $content['id']); + $modx->table->createPagingNavigation($numRecords, 'a=3&id=' . $content['id'] . '&dir=' . $dir . '&sort=' . $sort); + $children_output = $modx->table->create($listDocs, $listTableHeader, 'index.php?a=3&id=' . $content['id']); } else { - // No Child documents - $children_output = '

    ' . $_lang['resources_in_container_no'] . '

    '; + // No Child documents + $children_output = '

    ' . $_lang['resources_in_container_no'] . '

    '; } ?>
    - 0) : ?> + 0) : ?>
    ()
    @@ -408,43 +407,40 @@ class="' . $_style["icons_move_document"] . '">
    ' . $icon_pub_unpub : '')
    - config['cache_type'] != 2) { - ?> + config['cache_type'] != 2) { ?>

    config['base_path'] . "assets/cache/docid_" . $id . ".pageCache.php"; - $handle = @fopen($filename, "r"); - if (!$handle) { - $buffer = '
    ' . $_lang['page_data_notcached'] . '
    '; - } else { - while (!feof($handle)) { - $buffer .= fgets($handle, 4096); - } - fclose($handle); - $buffer = '
    \n"; - } - echo $buffer; ?> + $buffer = ""; + $filename = $modx->config['base_path'] . "assets/cache/docid_" . $id . ".pageCache.php"; + $handle = @fopen($filename, "r"); + if(!$handle) { + $buffer = '
    ' . $_lang['page_data_notcached'] . '
    '; + } else { + while(!feof($handle)) { + $buffer .= fgets($handle, 4096); + } + fclose($handle); + $buffer = '
    \n"; + } + echo $buffer; + ?>
    - +
    docSettings.setSelectedIndex( ' . $_GET['tab'] . ' );'; - } +if(isset($_GET['tab']) && is_numeric($_GET['tab'])) { + echo ''; +} ?> - +
    -INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('view_eventlog')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('view_eventlog')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // Get table Names (alphabetical) @@ -15,15 +15,15 @@ $modx->manager->initPageViewState(); // get and save search string -if ($_REQUEST['op'] == 'reset') { - $sqlQuery = $query = ''; - $_PAGE['vs']['search'] = ''; +if($_REQUEST['op'] == 'reset') { + $sqlQuery = $query = ''; + $_PAGE['vs']['search'] = ''; } else { - $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; - if (!is_numeric($sqlQuery)) { - $sqlQuery = $modx->db->escape($query); - } - $_PAGE['vs']['search'] = $query; + $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; + if(!is_numeric($sqlQuery)) { + $sqlQuery = $modx->db->escape($query); + } + $_PAGE['vs']['search'] = $query; } // get & save listmode @@ -125,33 +125,33 @@ function menuAction(a) {
    db->select("el.id, ELT(el.type , 'text-info {$_style['actions_info']}' , 'text-warning {$_style['actions_triangle']}' , 'text-danger {$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el + $ds = $modx->db->select("el.id, ELT(el.type , 'text-info {$_style['actions_info']}' , 'text-warning {$_style['actions_triangle']}' , 'text-danger {$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el LEFT JOIN {$tbl_manager_users} AS mu ON mu.id=el.user AND el.usertype=0 LEFT JOIN {$tbl_web_users} AS wu ON wu.id=el.user AND el.usertype=1", ($sqlQuery ? "" . (is_numeric($sqlQuery) ? "(eventid='{$sqlQuery}') OR " : '') . "(source LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "createdon DESC"); - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items - $grd->pagerClass = ''; - $grd->pageClass = 'page-item'; - $grd->selPageClass = 'page-item active'; - $grd->noRecordMsg = $_lang['no_records_found']; - $grd->cssClass = "table data nowrap"; - $grd->columnHeaderClass = "tableHeader"; - $grd->itemClass = "tableItem"; - $grd->altItemClass = "tableAltItem"; - $grd->fields = "type,source,createdon,eventid,username"; - $grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid']; - $grd->colWidths = "1%,,1%,1%,1%"; - $grd->colAligns = "center,,,center,center"; - $grd->colTypes = "template:||template:[+source+]||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p'; - if ($listmode == '1') { - $grd->pageSize = 0; - } - if ($_REQUEST['op'] == 'reset') { - $grd->pageNumber = 1; - } - // render grid - echo $grd->render(); - ?> + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items + $grd->pagerClass = ''; + $grd->pageClass = 'page-item'; + $grd->selPageClass = 'page-item active'; + $grd->noRecordMsg = $_lang['no_records_found']; + $grd->cssClass = "table data nowrap"; + $grd->columnHeaderClass = "tableHeader"; + $grd->itemClass = "tableItem"; + $grd->altItemClass = "tableAltItem"; + $grd->fields = "type,source,createdon,eventid,username"; + $grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid']; + $grd->colWidths = "1%,,1%,1%,1%"; + $grd->colAligns = "center,,,center,center"; + $grd->colTypes = "template:||template:[+source+]||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p'; + if($listmode == '1') { + $grd->pageSize = 0; + } + if($_REQUEST['op'] == 'reset') { + $grd->pageNumber = 1; + } + // render grid + echo $grd->render(); + ?>
    diff --git a/manager/actions/eventlog_details.dynamic.php b/manager/actions/eventlog_details.dynamic.php index 7270f330ab..d72e0c394c 100755 --- a/manager/actions/eventlog_details.dynamic.php +++ b/manager/actions/eventlog_details.dynamic.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('view_eventlog')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('view_eventlog')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // get id @@ -41,18 +41,18 @@
    toDateFormat($content["createdon"]); - if ($content["type"] == 1) { - $icon = $_style['actions_info'] . ' text-info'; - $msgtype = $_lang["information"]; - } elseif ($content["type"] == 2) { - $icon = $_style['actions_triangle'] . ' text-warning'; - $msgtype = $_lang["warning"]; - } elseif ($content["type"] == 3) { - $icon = $_style['actions_error'] . ' text-danger'; - $msgtype = $_lang["error"]; - } - ?> + $date = $modx->toDateFormat($content["createdon"]); + if($content["type"] == 1) { + $icon = $_style['actions_info'] . ' text-info'; + $msgtype = $_lang["information"]; + } else if($content["type"] == 2) { + $icon = $_style['actions_triangle'] . ' text-warning'; + $msgtype = $_lang["warning"]; + } else if($content["type"] == 3) { + $icon = $_style['actions_error'] . ' text-danger'; + $msgtype = $_lang["error"]; + } + ?>

    diff --git a/manager/actions/export_site.static.php b/manager/actions/export_site.static.php index cbb83cb9f2..878cad704f 100755 --- a/manager/actions/export_site.static.php +++ b/manager/actions/export_site.static.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('export_static')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('export_static')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // figure out the base of the server, so we know where to get the documents in order to export them @@ -35,11 +35,11 @@

    + if(isset($_POST['export'])) { + $rs = include_once(MODX_MANAGER_PATH . 'processors/export_site.processor.php'); + echo $rs; + } else { + ?>
    @@ -76,13 +76,13 @@ ">
    + } + ?>
    diff --git a/manager/actions/files.dynamic.php b/manager/actions/files.dynamic.php index 3d6cd1c866..0b9bae5166 100755 --- a/manager/actions/files.dynamic.php +++ b/manager/actions/files.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('file_manager')) { @@ -407,7 +407,7 @@ function renameFile (file) if (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newDirname) !== 0) { echo $_lang['files.dynamic.php3']; - } elseif (!rename($dirname, $_REQUEST['path'] . '/' . $newDirname)) { + } else if (!rename($dirname, $_REQUEST['path'] . '/' . $newDirname)) { echo '', $_lang['file_folder_not_created'], '

    '; } umask($old_umask); @@ -482,7 +482,8 @@ function renameFile (file) + @ini_set("upload_max_filesize", $upload_maxsize); // modified by raymond + ?>
    @@ -490,8 +491,8 @@ function renameFile (file) + echo $information; + } ?>
    @@ -516,12 +517,13 @@ function renameFile (file) webAlertAndQuit("Error opening file for reading."); - } ?> + $buffer = file_get_contents($filename); + // Log the change + logFileChange('view', $filename); + if ($buffer === false) { + $modx->webAlertAndQuit("Error opening file for reading."); + } + ?> @@ -564,6 +566,7 @@ function renameFile (file) if (is_array($evtOut)) { echo implode('', $evtOut); } + } /** @@ -846,7 +849,7 @@ function unzip($file, $path) $complete_name = $path . str_replace('\\', '/', $zip_entry_name); if (!file_exists($complete_path)) { $tmp = ''; - foreach (explode('/', $complete_path) as $k) { + foreach (explode('/', $complete_path) AS $k) { $tmp .= $k . '/'; if (!is_dir($tmp)) { mkdir($tmp, 0777); @@ -887,13 +890,10 @@ function rrmdir($dir) */ function fileupload() { - $modx = evolutionCMS(); - global $_lang, $startpath, $filemanager_path, $uploadablefiles, $new_file_permissions; + $modx = evolutionCMS(); global $_lang, $startpath, $filemanager_path, $uploadablefiles, $new_file_permissions; $msg = ''; foreach ($_FILES['userfile']['name'] as $i => $name) { - if (empty($_FILES['userfile']['tmp_name'][$i])) { - continue; - } + if (empty($_FILES['userfile']['tmp_name'][$i])) continue; $userfile= array(); $userfile['tmp_name'] = $_FILES['userfile']['tmp_name'][$i]; diff --git a/manager/actions/help.static.php b/manager/actions/help.static.php index c46668939a..1978dc5f54 100755 --- a/manager/actions/help.static.php +++ b/manager/actions/help.static.php @@ -1,6 +1,6 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } $helpBasePath = "actions/help/"; ?> @@ -16,35 +16,36 @@ $v) { - $helpname = substr($v, 0, strrpos($v, '.')); - - $prefix = substr($helpname, 0, 2); - if (is_numeric($prefix)) { - $helpname = substr($helpname, 2, strlen($helpname) - 1); - } - - $hnLower = strtolower($helpname); - $helpname = isset($_lang[$hnLower]) ? $_lang[$hnLower] : str_replace('_', ' ', $helpname); - - echo '
    '; - echo '

    ' . $helpname . '

    '; - echo ''; - include_once($helpBasePath . "{$v}"); - echo '
    '; - } - ?> + if($handle = opendir('actions/help')) { + while(false !== ($file = readdir($handle))) { + if($file != "." && $file != ".." && $file != ".svn" && $file != 'index.html' && !is_dir($helpBasePath . $file)) { + $help[] = $file; + } + } + closedir($handle); + } + + natcasesort($help); + + foreach($help as $k => $v) { + + $helpname = substr($v, 0, strrpos($v, '.')); + + $prefix = substr($helpname, 0, 2); + if(is_numeric($prefix)) { + $helpname = substr($helpname, 2, strlen($helpname) - 1); + } + + $hnLower = strtolower($helpname); + $helpname = isset($_lang[$hnLower]) ? $_lang[$hnLower] : str_replace('_', ' ', $helpname); + + echo '
    '; + echo '

    ' . $helpname . '

    '; + echo ''; + include_once($helpBasePath . "{$v}"); + echo '
    '; + } + ?>
    + } + ?> @@ -102,67 +104,65 @@ function setParent(pId, pName) { /** * @return string */ -function run() -{ - $modx = evolutionCMS(); - global $_lang; +function run() { + $modx = evolutionCMS(); global $_lang; - $tbl_site_content = $modx->getFullTableName('site_content'); - $output = ''; - $maxtime = $_POST['maxtime']; + $tbl_site_content = $modx->getFullTableName('site_content'); + $output = ''; + $maxtime = $_POST['maxtime']; - if (!is_numeric($maxtime)) { - $maxtime = 30; - } + if(!is_numeric($maxtime)) { + $maxtime = 30; + } - @set_time_limit($maxtime); + @set_time_limit($maxtime); - $mtime = microtime(); - $mtime = explode(' ', $mtime); - $mtime = $mtime[1] + $mtime[0]; - $importstart = $mtime; + $mtime = microtime(); + $mtime = explode(' ', $mtime); + $mtime = $mtime[1] + $mtime[0]; + $importstart = $mtime; - if ($_POST['reset'] == 'on') { - $modx->db->truncate($tbl_site_content); - $modx->db->query("ALTER TABLE {$tbl_site_content} AUTO_INCREMENT = 1"); - } + if($_POST['reset'] == 'on') { + $modx->db->truncate($tbl_site_content); + $modx->db->query("ALTER TABLE {$tbl_site_content} AUTO_INCREMENT = 1"); + } - $parent = (int)$_POST['parent']; + $parent = (int)$_POST['parent']; - if (is_dir(MODX_BASE_PATH . 'temp/import')) { - $filedir = MODX_BASE_PATH . 'temp/import/'; - } elseif (is_dir(MODX_BASE_PATH . 'assets/import')) { - $filedir = MODX_BASE_PATH . 'assets/import/'; - } else { + if(is_dir(MODX_BASE_PATH . 'temp/import')) { + $filedir = MODX_BASE_PATH . 'temp/import/'; + } elseif(is_dir(MODX_BASE_PATH . 'assets/import')) { + $filedir = MODX_BASE_PATH . 'assets/import/'; + } else { $filedir = ''; } - $filesfound = 0; + $filesfound = 0; - $files = getFiles($filedir); - $files = pop_index($files); + $files = getFiles($filedir); + $files = pop_index($files); - // no. of files to import - $output .= sprintf('

    ' . $_lang['import_files_found'] . '

    ', $filesfound); + // no. of files to import + $output .= sprintf('

    ' . $_lang['import_files_found'] . '

    ', $filesfound); - // import files - if (0 < count($files)) { - $modx->db->update(array('isfolder' => 1), $tbl_site_content, "id='{$parent}'"); - importFiles($parent, $filedir, $files, 'root'); - } + // import files + if(0 < count($files)) { + $modx->db->update(array('isfolder' => 1), $tbl_site_content, "id='{$parent}'"); + importFiles($parent, $filedir, $files, 'root'); + } - $mtime = microtime(); - $mtime = explode(' ', $mtime); - $mtime = $mtime[1] + $mtime[0]; - $importend = $mtime; - $totaltime = ($importend - $importstart); - $output .= sprintf('

    ' . $_lang['import_site_time'] . '

    ', round($totaltime, 3)); + $mtime = microtime(); + $mtime = explode(' ', $mtime); + $mtime = $mtime[1] + $mtime[0]; + $importend = $mtime; + $totaltime = ($importend - $importstart); + $output .= sprintf('

    ' . $_lang['import_site_time'] . '

    ', round($totaltime, 3)); - if ($_POST['convert_link'] == 'on') { - convertLink(); - } + if($_POST['convert_link'] == 'on') { + convertLink(); + } - return $output; + return $output; } /** @@ -171,146 +171,145 @@ function run() * @param array $files * @param string $mode */ -function importFiles($parent, $filedir, $files, $mode) -{ - $modx = evolutionCMS(); - global $_lang, $allowedfiles; - global $search_default, $cache_default, $publish_default; - - $tbl_site_content = $modx->getFullTableName('site_content'); - $tbl_system_settings = $modx->getFullTableName('system_settings'); - - $createdby = $modx->getLoginUserID(); - if (!is_array($files)) { - return; - } - if ($_POST['object'] === 'all') { - $modx->config['default_template'] = '0'; - $richtext = '0'; - } else { - $richtext = '1'; - } - - foreach ($files as $id => $value) { - if (is_array($value)) { - // create folder - $alias = $id; - printf('' . $_lang['import_site_importing_document'] . '', $alias); - $field = array(); - $field['type'] = 'document'; - $field['contentType'] = 'text/html'; - $field['published'] = $publish_default; - $field['parent'] = $parent; - $field['alias'] = $modx->stripAlias($alias); - $field['richtext'] = $richtext; - $field['template'] = $modx->config['default_template']; - $field['searchable'] = $search_default; - $field['cacheable'] = $cache_default; - $field['createdby'] = $createdby; - $field['isfolder'] = 1; - $field['menuindex'] = 1; - $find = false; - foreach (array( - 'index.html', - 'index.htm' - ) as $filename) { - $filepath = $filedir . $alias . '/' . $filename; - if ($find === false && file_exists($filepath)) { - $file = getFileContent($filepath); - list($pagetitle, $content, $description) = treatContent($file, $filename, $alias); - - $date = filemtime($filepath); - $field['pagetitle'] = $pagetitle; - $field['longtitle'] = $pagetitle; - $field['description'] = $description; - $field['content'] = $modx->db->escape($content); - $field['createdon'] = $date; - $field['editedon'] = $date; - $newid = $modx->db->insert($field, $tbl_site_content); - if ($newid) { - $find = true; - echo ' - ' . $_lang['import_site_success'] . '
    ' . "\n"; - importFiles($newid, $filedir . $alias . '/', $value, 'sub'); - } else { - echo '' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError(); - exit; - } - } - } - if ($find === false) { - $date = time(); - $field['pagetitle'] = '---'; - $field['content'] = ''; - $field['createdon'] = $date; - $field['editedon'] = $date; - $field['hidemenu'] = '1'; - $newid = $modx->db->insert($field, $tbl_site_content); - if ($newid) { - $find = true; - echo ' - ' . $_lang['import_site_success'] . '
    ' . "\n"; - importFiles($newid, $filedir . $alias . '/', $value, 'sub'); - } else { - echo '' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError(); - exit; - } - } - } else { - // create document - if ($mode == 'sub' && $value == 'index.html') { - continue; - } - $filename = $value; - $fparts = explode('.', $value); - $alias = $fparts[0]; - $ext = (count($fparts) > 1) ? $fparts[count($fparts) - 1] : ""; - printf("" . $_lang['import_site_importing_document'] . "", $filename); - - if (!in_array($ext, $allowedfiles)) { - echo ' - ' . $_lang["import_site_skip"] . '
    ' . "\n"; - } else { - $filepath = $filedir . $filename; - $file = getFileContent($filepath); - list($pagetitle, $content, $description) = treatContent($file, $filename, $alias); - - $date = filemtime($filepath); - $field = array(); - $field['type'] = 'document'; - $field['contentType'] = 'text/html'; - $field['pagetitle'] = $pagetitle; - $field['longtitle'] = $pagetitle; - $field['description'] = $description; - $field['alias'] = $modx->stripAlias($alias); - $field['published'] = $publish_default; - $field['parent'] = $parent; - $field['content'] = $modx->db->escape($content); - $field['richtext'] = $richtext; - $field['template'] = $modx->config['default_template']; - $field['searchable'] = $search_default; - $field['cacheable'] = $cache_default; - $field['createdby'] = $createdby; - $field['createdon'] = $date; - $field['editedon'] = $date; - $field['isfolder'] = 0; - $field['menuindex'] = ($alias == 'index') ? 0 : 2; - $newid = $modx->db->insert($field, $tbl_site_content); - if ($newid) { - echo ' - ' . $_lang['import_site_success'] . '
    ' . "\n"; - } else { - echo '' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError(); - exit; - } - - $is_site_start = false; - if ($filename == 'index.html') { - $is_site_start = true; - } - if ($is_site_start == true && $_POST['reset'] == 'on') { - $modx->db->update(array('setting_value' => $newid), $tbl_system_settings, "setting_name='site_start'"); - $modx->db->update(array('menuindex' => 0), $tbl_site_content, "id='{$newid}'"); - } - } - } - } +function importFiles($parent, $filedir, $files, $mode) { + $modx = evolutionCMS(); + global $_lang, $allowedfiles; + global $search_default, $cache_default, $publish_default; + + $tbl_site_content = $modx->getFullTableName('site_content'); + $tbl_system_settings = $modx->getFullTableName('system_settings'); + + $createdby = $modx->getLoginUserID(); + if(!is_array($files)) { + return; + } + if($_POST['object'] === 'all') { + $modx->config['default_template'] = '0'; + $richtext = '0'; + } else { + $richtext = '1'; + } + + foreach($files as $id => $value) { + if(is_array($value)) { + // create folder + $alias = $id; + printf('' . $_lang['import_site_importing_document'] . '', $alias); + $field = array(); + $field['type'] = 'document'; + $field['contentType'] = 'text/html'; + $field['published'] = $publish_default; + $field['parent'] = $parent; + $field['alias'] = $modx->stripAlias($alias); + $field['richtext'] = $richtext; + $field['template'] = $modx->config['default_template']; + $field['searchable'] = $search_default; + $field['cacheable'] = $cache_default; + $field['createdby'] = $createdby; + $field['isfolder'] = 1; + $field['menuindex'] = 1; + $find = false; + foreach(array( + 'index.html', + 'index.htm' + ) as $filename) { + $filepath = $filedir . $alias . '/' . $filename; + if($find === false && file_exists($filepath)) { + $file = getFileContent($filepath); + list($pagetitle, $content, $description) = treatContent($file, $filename, $alias); + + $date = filemtime($filepath); + $field['pagetitle'] = $pagetitle; + $field['longtitle'] = $pagetitle; + $field['description'] = $description; + $field['content'] = $modx->db->escape($content); + $field['createdon'] = $date; + $field['editedon'] = $date; + $newid = $modx->db->insert($field, $tbl_site_content); + if($newid) { + $find = true; + echo ' - ' . $_lang['import_site_success'] . '
    ' . "\n"; + importFiles($newid, $filedir . $alias . '/', $value, 'sub'); + } else { + echo '' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError(); + exit; + } + } + } + if($find === false) { + $date = time(); + $field['pagetitle'] = '---'; + $field['content'] = ''; + $field['createdon'] = $date; + $field['editedon'] = $date; + $field['hidemenu'] = '1'; + $newid = $modx->db->insert($field, $tbl_site_content); + if($newid) { + $find = true; + echo ' - ' . $_lang['import_site_success'] . '
    ' . "\n"; + importFiles($newid, $filedir . $alias . '/', $value, 'sub'); + } else { + echo '' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError(); + exit; + } + } + } else { + // create document + if($mode == 'sub' && $value == 'index.html') { + continue; + } + $filename = $value; + $fparts = explode('.', $value); + $alias = $fparts[0]; + $ext = (count($fparts) > 1) ? $fparts[count($fparts) - 1] : ""; + printf("" . $_lang['import_site_importing_document'] . "", $filename); + + if(!in_array($ext, $allowedfiles)) { + echo ' - ' . $_lang["import_site_skip"] . '
    ' . "\n"; + } else { + $filepath = $filedir . $filename; + $file = getFileContent($filepath); + list($pagetitle, $content, $description) = treatContent($file, $filename, $alias); + + $date = filemtime($filepath); + $field = array(); + $field['type'] = 'document'; + $field['contentType'] = 'text/html'; + $field['pagetitle'] = $pagetitle; + $field['longtitle'] = $pagetitle; + $field['description'] = $description; + $field['alias'] = $modx->stripAlias($alias); + $field['published'] = $publish_default; + $field['parent'] = $parent; + $field['content'] = $modx->db->escape($content); + $field['richtext'] = $richtext; + $field['template'] = $modx->config['default_template']; + $field['searchable'] = $search_default; + $field['cacheable'] = $cache_default; + $field['createdby'] = $createdby; + $field['createdon'] = $date; + $field['editedon'] = $date; + $field['isfolder'] = 0; + $field['menuindex'] = ($alias == 'index') ? 0 : 2; + $newid = $modx->db->insert($field, $tbl_site_content); + if($newid) { + echo ' - ' . $_lang['import_site_success'] . '
    ' . "\n"; + } else { + echo '' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError(); + exit; + } + + $is_site_start = false; + if($filename == 'index.html') { + $is_site_start = true; + } + if($is_site_start == true && $_POST['reset'] == 'on') { + $modx->db->update(array('setting_value' => $newid), $tbl_system_settings, "setting_name='site_start'"); + $modx->db->update(array('menuindex' => 0), $tbl_site_content, "id='{$newid}'"); + } + } + } + } } /** @@ -319,66 +318,63 @@ function importFiles($parent, $filedir, $files, $mode) * @param int $count * @return array */ -function getFiles($directory, $listing = array(), $count = 0) -{ - global $_lang; - global $filesfound; - $dummy = $count; - if (! empty($directory) && $files = scandir($directory)) { - foreach ($files as $file) { - if ($file == '.' || $file == '..') { - continue; - } elseif ($h = @opendir($directory . $file . "/")) { - closedir($h); - $count = -1; - $listing[$file] = getFiles($directory . $file . "/", array(), $count + 1); - } elseif (strpos($file, '.htm') !== false) { - $listing[$dummy] = $file; - $dummy = $dummy + 1; - $filesfound++; - } - } - } else { - echo '

    ' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_no_open_dir"] . $directory . ".

    "; - } - return ($listing); +function getFiles($directory, $listing = array(), $count = 0) { + global $_lang; + global $filesfound; + $dummy = $count; + if( ! empty($directory) && $files = scandir($directory)) { + foreach($files as $file) { + if($file == '.' || $file == '..') { + continue; + } elseif($h = @opendir($directory . $file . "/")) { + closedir($h); + $count = -1; + $listing[$file] = getFiles($directory . $file . "/", array(), $count + 1); + } elseif(strpos($file, '.htm') !== false) { + $listing[$dummy] = $file; + $dummy = $dummy + 1; + $filesfound++; + } + } + } else { + echo '

    ' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_no_open_dir"] . $directory . ".

    "; + } + return ($listing); } /** * @param string $filepath * @return bool|string */ -function getFileContent($filepath) -{ - global $_lang; - // get the file - if (!$buffer = file_get_contents($filepath)) { - echo '

    ' . $_lang['import_site_failed'] . " " . $_lang["import_site_failed_no_retrieve_file"] . $filepath . ".

    "; - } else { - return $buffer; - } +function getFileContent($filepath) { + global $_lang; + // get the file + if(!$buffer = file_get_contents($filepath)) { + echo '

    ' . $_lang['import_site_failed'] . " " . $_lang["import_site_failed_no_retrieve_file"] . $filepath . ".

    "; + } else { + return $buffer; + } } /** * @param array $array * @return array */ -function pop_index($array) -{ - $new_array = array(); - foreach ($array as $k => $v) { - if ($v !== 'index.html' && $v !== 'index.htm') { - $new_array[$k] = $v; - } else { - array_unshift($new_array, $v); - } - } - foreach ($array as $k => $v) { - if (is_array($v)) { - $new_array[$k] = $v; - } - } - return $new_array; +function pop_index($array) { + $new_array = array(); + foreach($array as $k => $v) { + if($v !== 'index.html' && $v !== 'index.htm') { + $new_array[$k] = $v; + } else { + array_unshift($new_array, $v); + } + } + foreach($array as $k => $v) { + if(is_array($v)) { + $new_array[$k] = $v; + } + } + return $new_array; } /** @@ -387,111 +383,109 @@ function pop_index($array) * @param string $alias * @return array */ -function treatContent($src, $filename, $alias) -{ - $modx = evolutionCMS(); - - $src = mb_convert_encoding($src, $modx->config['modx_charset'], 'UTF-8,SJIS-win,eucJP-win,SJIS,EUC-JP,ASCII'); - - if (preg_match("@(.*)@i", $src, $matches)) { - $pagetitle = ($matches[1] !== '') ? $matches[1] : $filename; - $pagetitle = str_replace('[*pagetitle*]', '', $pagetitle); - } else { - $pagetitle = $alias; - } - if (!$pagetitle) { - $pagetitle = $alias; - } - - if (preg_match('@]+"description"[^>]+content=[\'"](.*)[\'"].+>@i', $src, $matches)) { - $description = ($matches[1] !== '') ? $matches[1] : $filename; - $description = str_replace('[*description*]', '', $description); - } else { - $description = ''; - } - - if ((preg_match("@]*>(.*)[^<]+@is", $src, $matches)) && $_POST['object'] == 'body') { - $content = $matches[1]; - } else { - $content = $src; - $s = '/(]+charset\s*=)[^>"\'=]+(.+>)/i'; - $r = '$1' . $modx->config['modx_charset'] . '$2'; - $content = preg_replace($s, $r, $content); - $content = preg_replace('@.*@i', "[*pagetitle*]", $content); - } - $content = str_replace('[*content*]', '[ *content* ]', $content); - $content = trim($content); - $pagetitle = $modx->db->escape($pagetitle); - return array( - $pagetitle, - $content, - $description - ); +function treatContent($src, $filename, $alias) { + $modx = evolutionCMS(); + + $src = mb_convert_encoding($src, $modx->config['modx_charset'], 'UTF-8,SJIS-win,eucJP-win,SJIS,EUC-JP,ASCII'); + + if(preg_match("@(.*)@i", $src, $matches)) { + $pagetitle = ($matches[1] !== '') ? $matches[1] : $filename; + $pagetitle = str_replace('[*pagetitle*]', '', $pagetitle); + } else { + $pagetitle = $alias; + } + if(!$pagetitle) { + $pagetitle = $alias; + } + + if(preg_match('@]+"description"[^>]+content=[\'"](.*)[\'"].+>@i', $src, $matches)) { + $description = ($matches[1] !== '') ? $matches[1] : $filename; + $description = str_replace('[*description*]', '', $description); + } else { + $description = ''; + } + + if((preg_match("@]*>(.*)[^<]+@is", $src, $matches)) && $_POST['object'] == 'body') { + $content = $matches[1]; + } else { + $content = $src; + $s = '/(]+charset\s*=)[^>"\'=]+(.+>)/i'; + $r = '$1' . $modx->config['modx_charset'] . '$2'; + $content = preg_replace($s, $r, $content); + $content = preg_replace('@.*@i', "[*pagetitle*]", $content); + } + $content = str_replace('[*content*]', '[ *content* ]', $content); + $content = trim($content); + $pagetitle = $modx->db->escape($pagetitle); + return array( + $pagetitle, + $content, + $description + ); } /** * @return void */ -function convertLink() -{ - $modx = evolutionCMS(); - $tbl_site_content = $modx->getFullTableName('site_content'); +function convertLink() { + $modx = evolutionCMS(); + $tbl_site_content = $modx->getFullTableName('site_content'); - $rs = $modx->db->select('id,content', $tbl_site_content); - $p = array(); + $rs = $modx->db->select('id,content', $tbl_site_content); + $p = array(); $target = array(); - $dir = ''; - while ($row = $modx->db->getRow($rs)) { - $id = $row['id']; - $array = explode('config['site_url']) !== false) { - $_ = $modx->config['base_url'] . str_replace($modx->config['site_url'], '', $_); - } - if ($_[0] === '/') { - $_ = substr($_, 1); - } - $_ = str_replace('/index.html', '.html', $_); - $level = substr_count($_, '../'); - if (1 < $level) { - if (!isset($p[$id])) { - $p[$id] = $modx->getParentIds($id); - } - $k = array_keys($p[$id]); - while (0 < $level) { - $dir = array_shift($k); - $level--; - } - if ($dir != '') { - $dir .= '/'; - } - } else { - $dir = ''; - } - - $_ = trim($_, './'); - if (strpos($_, '/') !== false) { - $_ = substr($_, strrpos($_, '/')); - } - $_ = $dir . str_replace('.html', '', $_); - if (!isset($target[$_])) { - $target[$_] = $modx->getIdFromAlias($_); - } - $target[$_] = trim($target[$_]); - if (!empty($target[$_])) { - $href = '[~' . $target[$_] . '~]'; - } - $array[$c] = 'db->escape($content); - $modx->db->update($f, $tbl_site_content, "id='{$id}'"); - } + $dir = ''; + while($row = $modx->db->getRow($rs)) { + $id = $row['id']; + $array = explode('config['site_url']) !== false) { + $_ = $modx->config['base_url'] . str_replace($modx->config['site_url'], '', $_); + } + if($_[0] === '/') { + $_ = substr($_, 1); + } + $_ = str_replace('/index.html', '.html', $_); + $level = substr_count($_, '../'); + if(1 < $level) { + if(!isset($p[$id])) { + $p[$id] = $modx->getParentIds($id); + } + $k = array_keys($p[$id]); + while(0 < $level) { + $dir = array_shift($k); + $level--; + } + if($dir != '') { + $dir .= '/'; + } + } else { + $dir = ''; + } + + $_ = trim($_, './'); + if(strpos($_, '/') !== false) { + $_ = substr($_, strrpos($_, '/')); + } + $_ = $dir . str_replace('.html', '', $_); + if(!isset($target[$_])) { + $target[$_] = $modx->getIdFromAlias($_); + } + $target[$_] = trim($target[$_]); + if(!empty($target[$_])) { + $href = '[~' . $target[$_] . '~]'; + } + $array[$c] = 'db->escape($content); + $modx->db->update($f, $tbl_site_content, "id='{$id}'"); + } } diff --git a/manager/actions/logging.static.php b/manager/actions/logging.static.php index e763c659e7..26f678b7ad 100755 --- a/manager/actions/logging.static.php +++ b/manager/actions/logging.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('logs')) { @@ -183,83 +183,83 @@ function record_sort($array, $key) db->escape($_REQUEST['itemname']) . "'"; - } - if ($_REQUEST['message'] != "") { - $sqladd[] = "message LIKE '%" . $modx->db->escape($_REQUEST['message']) . "%'"; - } - // date stuff - if ($_REQUEST['datefrom'] != "") { - $sqladd[] = "timestamp>" . $modx->toTimeStamp($_REQUEST['datefrom']); - } - if ($_REQUEST['dateto'] != "") { - $sqladd[] = "timestamp<" . $modx->toTimeStamp($_REQUEST['dateto']); - } + // get the selections the user made. + $sqladd = array(); + if ($_REQUEST['searchuser'] != 0) { + $sqladd[] = "internalKey='" . (int)$_REQUEST['searchuser'] . "'"; + } + if ($_REQUEST['action'] != 0) { + $sqladd[] = "action=" . (int)$_REQUEST['action']; + } + if ($_REQUEST['itemid'] != 0 || $_REQUEST['itemid'] == "-") { + $sqladd[] = "itemid='" . $_REQUEST['itemid'] . "'"; + } + if ($_REQUEST['itemname'] != '0') { + $sqladd[] = "itemname='" . $modx->db->escape($_REQUEST['itemname']) . "'"; + } + if ($_REQUEST['message'] != "") { + $sqladd[] = "message LIKE '%" . $modx->db->escape($_REQUEST['message']) . "%'"; + } + // date stuff + if ($_REQUEST['datefrom'] != "") { + $sqladd[] = "timestamp>" . $modx->toTimeStamp($_REQUEST['datefrom']); + } + if ($_REQUEST['dateto'] != "") { + $sqladd[] = "timestamp<" . $modx->toTimeStamp($_REQUEST['dateto']); + } - // If current position is not set, set it to zero - if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) { - $int_cur_position = 0; - } else { - $int_cur_position = $_REQUEST['int_cur_position']; - } + // If current position is not set, set it to zero + if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) { + $int_cur_position = 0; + } else { + $int_cur_position = $_REQUEST['int_cur_position']; + } - // Number of result to display on the page, will be in the LIMIT of the sql query also - $int_num_result = is_numeric($_REQUEST['nrresults']) ? $_REQUEST['nrresults'] : $number_of_logs; + // Number of result to display on the page, will be in the LIMIT of the sql query also + $int_num_result = is_numeric($_REQUEST['nrresults']) ? $_REQUEST['nrresults'] : $number_of_logs; - $extargv = "&a=13&searchuser=" . $_REQUEST['searchuser'] . "&action=" . $_REQUEST['action'] . "&itemid=" . $_REQUEST['itemid'] . "&itemname=" . $_REQUEST['itemname'] . "&message=" . $_REQUEST['message'] . "&dateto=" . $_REQUEST['dateto'] . "&datefrom=" . $_REQUEST['datefrom'] . "&nrresults=" . $int_num_result . "&log_submit=" . $_REQUEST['log_submit']; // extra argv here (could be anything depending on your page) + $extargv = "&a=13&searchuser=" . $_REQUEST['searchuser'] . "&action=" . $_REQUEST['action'] . "&itemid=" . $_REQUEST['itemid'] . "&itemname=" . $_REQUEST['itemname'] . "&message=" . $_REQUEST['message'] . "&dateto=" . $_REQUEST['dateto'] . "&datefrom=" . $_REQUEST['datefrom'] . "&nrresults=" . $int_num_result . "&log_submit=" . $_REQUEST['log_submit']; // extra argv here (could be anything depending on your page) - // build the sql - $limit = $num_rows = $modx->db->getValue($modx->db->select('COUNT(*)', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''))); + // build the sql + $limit = $num_rows = $modx->db->getValue($modx->db->select('COUNT(*)', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''))); - $rs = $modx->db->select('*', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''), 'timestamp DESC, id DESC', "{$int_cur_position}, {$int_num_result}"); + $rs = $modx->db->select('*', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''), 'timestamp DESC, id DESC', "{$int_cur_position}, {$int_num_result}"); - if ($limit < 1) { - echo '

    ' . $_lang["mgrlog_emptysrch"] . '

    '; - } else { - echo '

    ' . $_lang["mgrlog_sortinst"] . '

    '; +if ($limit < 1) { + echo '

    ' . $_lang["mgrlog_emptysrch"] . '

    '; +} else { + echo '

    ' . $_lang["mgrlog_sortinst"] . '

    '; - include_once "paginate.inc.php"; - // New instance of the Paging class, you can modify the color and the width of the html table - $p = new Paging($num_rows, $int_cur_position, $int_num_result, $extargv); + include_once "paginate.inc.php"; + // New instance of the Paging class, you can modify the color and the width of the html table + $p = new Paging($num_rows, $int_cur_position, $int_num_result, $extargv); - // Load up the 2 array in order to display result - $array_paging = $p->getPagingArray(); - $array_row_paging = $p->getPagingRowArray(); - $current_row = $int_cur_position / $int_num_result; + // Load up the 2 array in order to display result + $array_paging = $p->getPagingArray(); + $array_row_paging = $p->getPagingRowArray(); + $current_row = $int_cur_position / $int_num_result; - // Display the result as you like... - print "

    " . $_lang["paging_showing"] . " " . $array_paging['lower']; - print " " . $_lang["paging_to"] . " " . $array_paging['upper']; - print " (" . $array_paging['total'] . " " . $_lang["paging_total"] . ")
    "; - $paging = $array_paging['first_link'] . $_lang["paging_first"] . (isset($array_paging['first_link']) ? "
    " : " "); - $paging .= $array_paging['previous_link'] . $_lang["paging_prev"] . (isset($array_paging['previous_link']) ? " " : " "); - $pagesfound = sizeof($array_row_paging); - if ($pagesfound > 6) { - $paging .= $array_row_paging[$current_row - 2]; // ." "; + // Display the result as you like... + print "

    " . $_lang["paging_showing"] . " " . $array_paging['lower']; + print " " . $_lang["paging_to"] . " " . $array_paging['upper']; + print " (" . $array_paging['total'] . " " . $_lang["paging_total"] . ")
    "; + $paging = $array_paging['first_link'] . $_lang["paging_first"] . (isset($array_paging['first_link']) ? " " : " "); + $paging .= $array_paging['previous_link'] . $_lang["paging_prev"] . (isset($array_paging['previous_link']) ? " " : " "); + $pagesfound = sizeof($array_row_paging); + if ($pagesfound > 6) { + $paging .= $array_row_paging[$current_row - 2]; // ." "; $paging .= $array_row_paging[$current_row - 1]; // ." "; $paging .= $array_row_paging[$current_row]; // ." "; $paging .= $array_row_paging[$current_row + 1]; // ." "; $paging .= $array_row_paging[$current_row + 2]; // ." "; - } else { - for ($i = 0; $i < $pagesfound; $i++) { - $paging .= $array_row_paging[$i] . " "; - } - } - $paging .= $array_paging['next_link'] . $_lang["paging_next"] . (isset($array_paging['next_link']) ? " " : " ") . " "; - $paging .= $array_paging['last_link'] . $_lang["paging_last"] . (isset($array_paging['last_link']) ? " " : " ") . " "; - // The above exemple print somethings like: + } else { + for ($i = 0; $i < $pagesfound; $i++) { + $paging .= $array_row_paging[$i] . " "; + } + } + $paging .= $array_paging['next_link'] . $_lang["paging_next"] . (isset($array_paging['next_link']) ? " " : " ") . " "; + $paging .= $array_paging['last_link'] . $_lang["paging_last"] . (isset($array_paging['last_link']) ? " " : " ") . " "; + // The above exemple print somethings like: // Results 1 to 20 of 597 <<< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 >>> // Of course you can now play with array_row_paging in order to print // only the results you would like... @@ -289,17 +289,18 @@ function record_sort($array, $key) db->getRow($rs)) { - if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) { - $item = '

    -
    '; - } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) { - $item = '' . $logentry['itemname'] . ''; - } else { - $item = $logentry['itemname']; - } - //index.php?a=13&searchuser=' . $logentry['internalKey'] . '&action=' . $logentry['action'] . '&itemname=' . $logentry['itemname'] . '&log_submit=true' - $user_drill = 'index.php?a=13&searchuser=' . $logentry['internalKey'] . '&itemname=0&log_submit=true'; ?> + $i = 0; + while ($logentry = $modx->db->getRow($rs)) { + if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) { + $item = '
    -
    '; + } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) { + $item = '' . $logentry['itemname'] . ''; + } else { + $item = $logentry['itemname']; + } + //index.php?a=13&searchuser=' . $logentry['internalKey'] . '&action=' . $logentry['action'] . '&itemname=' . $logentry['itemname'] . '&log_submit=true' + $user_drill = 'index.php?a=13&searchuser=' . $logentry['internalKey'] . '&itemname=0&log_submit=true'; + ?> ' . $logentry['username'] . '' ?> @@ -311,7 +312,8 @@ function record_sort($array, $key) + } + ?> @@ -321,14 +323,15 @@ function record_sort($array, $key) +} +?> INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('messages')) { @@ -11,29 +11,29 @@ - +
    db->select('*', $modx->getFullTableName('user_messages'), "id='" . (int)$_REQUEST['id'] . "'"); - $message = $modx->db->getRow($rs); - if (!$message) { - echo "Wrong number of messages returned!"; - } else { - if ($message['recipient'] != $modx->getLoginUserID()) { - echo $_lang['messages_not_allowed_to_read']; - } else { - // output message! - // get the name of the sender - $sender = $message['sender']; - if ($sender == 0) { - $sendername = $_lang['messages_system_user']; + $message = $modx->db->getRow($rs); + if (!$message) { + echo "Wrong number of messages returned!"; } else { - $rs2 = $modx->db->select('username', $modx->getFullTableName('manager_users'), "id='{$sender}'"); - $sendername = $modx->db->getValue($rs2); - } ?> + if ($message['recipient'] != $modx->getLoginUserID()) { + echo $_lang['messages_not_allowed_to_read']; + } else { + // output message! + // get the name of the sender + $sender = $message['sender']; + if ($sender == 0) { + $sendername = $_lang['messages_system_user']; + } else { + $rs2 = $modx->db->select('username', $modx->getFullTableName('manager_users'), "id='{$sender}'"); + $sendername = $modx->db->getValue($rs2); + } + ?>
    @@ -63,23 +63,24 @@ ', $message['message']); - $dashcount = substr_count($message, '-----'); - $message = str_replace('-----', '', $message); - for ($i = 0; $i < $dashcount; $i++) { - $message .= ''; - } ?> + $dashcount = substr_count($message, '-----'); + $message = str_replace('-----', '', $message); + for ($i = 0; $i < $dashcount; $i++) { + $message .= ''; + } + ?>
    db->update(array('messageread' => 1), $modx->getFullTableName('user_messages'), "id='{$_REQUEST['id']}'"); - } - } ?> + } + } + ?>

    - +
    @@ -135,7 +136,8 @@ if ($limit < 1) { echo $_lang['messages_no_messages']; } else { - $dotablestuff = 1; ?> + $dotablestuff = 1; + ?>
    @@ -160,7 +162,8 @@ $rs2 = $modx->db->select('username', $modx->getFullTableName('manager_users'), "id='{$sender}'"); $sendername = $modx->db->getValue($rs2); } - $messagestyle = $message['messageread'] == 0 ? "text-primary" : ""; ?> + $messagestyle = $message['messageread'] == 0 ? "text-primary" : ""; + ?> ' : "" ?> @@ -169,13 +172,13 @@ toDateFormat($message['postdate'] + $server_offset_time) ?> + } + ?>
    - +
    diff --git a/manager/actions/modules.static.php b/manager/actions/modules.static.php index 829941e32d..a5257e8cfc 100755 --- a/manager/actions/modules.static.php +++ b/manager/actions/modules.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('exec_module'))) { @@ -116,7 +116,7 @@ function menuAction(a) ORDER BY sm.name'); if ($modx->hasPermission('edit_module')) { $title = "[+value+]"; - } elseif ($modx->hasPermission('exec_module')) { + } else if ($modx->hasPermission('exec_module')) { $title = "[+value+]"; } else { $title = '[+value+]'; diff --git a/manager/actions/move_document.dynamic.php b/manager/actions/move_document.dynamic.php index 5f9b6c0002..435f7b2625 100755 --- a/manager/actions/move_document.dynamic.php +++ b/manager/actions/move_document.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_document')) { diff --git a/manager/actions/mutate_categories.dynamic.php b/manager/actions/mutate_categories.dynamic.php index f98e83a47c..f58cede882 100755 --- a/manager/actions/mutate_categories.dynamic.php +++ b/manager/actions/mutate_categories.dynamic.php @@ -1,44 +1,46 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('category_manager')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('category_manager')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $_module_params = array( - 'module_version' => '1.0.0', - 'module_params' => '', - 'module_id' => $_GET['id'], - 'package_name' => 'Module_Categories_Manager', - 'native_language' => 'de', - 'name' => 'Categories Manager', - 'dirname' => $site_manager_url, - 'url' => 'index.php?a=120&id=' . $_GET['id'], - 'path' => realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR, - 'inc_dir' => realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR, - 'languages_dir' => realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR, - 'views_dir' => realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'skin' . DIRECTORY_SEPARATOR, - 'request_key' => 'module_categories_manager', - 'messages' => array() + 'module_version' => '1.0.0', + 'module_params' => '', + 'module_id' => $_GET['id'], + 'package_name' => 'Module_Categories_Manager', + 'native_language' => 'de', + 'name' => 'Categories Manager', + 'dirname' => $site_manager_url, + 'url' => 'index.php?a=120&id=' . $_GET['id'], + 'path' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR, + 'inc_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR, + 'languages_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR, + 'views_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'skin' . DIRECTORY_SEPARATOR, + 'request_key' => 'module_categories_manager', + 'messages' => array() ); require_once $_module_params['inc_dir'] . 'Module_Categories_Manager.php'; $cm = new Module_Categories_Manager(); // assign module_params to internal params -foreach ($_module_params as $param => $value) { - $cm->set($param, $value); +foreach( $_module_params as $param => $value ) +{ + $cm->set( $param, $value ); } // catch the request actions include_once $cm->get('inc_dir') . 'request_trigger.inc.php'; -if (!$categories = $cm->getCategories()) { - setcookie('webfxtab_manage-categories-pane', 0); - $cm->addMessage($cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global'); +if( !$categories = $cm->getCategories() ) +{ + setcookie('webfxtab_manage-categories-pane', 0 ); + $cm->addMessage( $cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global' ); } -$cm->renderView('main', $categories); +$cm->renderView('main', $categories ); return; diff --git a/manager/actions/mutate_content.dynamic.php b/manager/actions/mutate_content.dynamic.php index 8d9b770d32..55c2714d57 100755 --- a/manager/actions/mutate_content.dynamic.php +++ b/manager/actions/mutate_content.dynamic.php @@ -1,6 +1,6 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } /********************/ @@ -11,31 +11,31 @@ /*******************/ // check permissions -switch ($modx->manager->action) { - case 27: - if (!$modx->hasPermission('edit_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 85: - case 72: - case 4: - if (!$modx->hasPermission('new_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '0') { - // check user has permissions for parent - include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php'); - $udperms = new udperms(); - $udperms->user = $modx->getLoginUserID(); - $udperms->document = empty($_REQUEST['pid']) ? 0 : $_REQUEST['pid']; - $udperms->role = $_SESSION['mgrRole']; - if (!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); - } - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +switch($modx->manager->action) { + case 27: + if(!$modx->hasPermission('edit_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 85: + case 72: + case 4: + if(!$modx->hasPermission('new_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } elseif(isset($_REQUEST['pid']) && $_REQUEST['pid'] != '0') { + // check user has permissions for parent + include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php'); + $udperms = new udperms(); + $udperms->user = $modx->getLoginUserID(); + $udperms->document = empty($_REQUEST['pid']) ? 0 : $_REQUEST['pid']; + $udperms->role = $_SESSION['mgrRole']; + if(!$udperms->checkPermissions()) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); + } + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; @@ -53,23 +53,23 @@ $tbl_site_tmplvar_templates = $modx->getFullTableName('site_tmplvar_templates'); $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); -if ($modx->manager->action == 27) { - //editing an existing document - // check permissions on the document - include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php'); - $udperms = new udperms(); - $udperms->user = $modx->getLoginUserID(); - $udperms->document = $id; - $udperms->role = $_SESSION['mgrRole']; - - if (!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); - } +if($modx->manager->action == 27) { + //editing an existing document + // check permissions on the document + include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php'); + $udperms = new udperms(); + $udperms->user = $modx->getLoginUserID(); + $udperms->document = $id; + $udperms->role = $_SESSION['mgrRole']; + + if(!$udperms->checkPermissions()) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); + } } // check to see if resource isn't locked -if ($lockedEl = $modx->elementIsLocked(7, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['resource'])); +if($lockedEl = $modx->elementIsLocked(7, $id)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['resource'])); } // end check for lock @@ -77,75 +77,75 @@ $modx->lockElement(7, $id); // get document groups for current user -if ($_SESSION['mgrDocgroups']) { - $docgrp = implode(',', $_SESSION['mgrDocgroups']); +if($_SESSION['mgrDocgroups']) { + $docgrp = implode(',', $_SESSION['mgrDocgroups']); } -if (!empty($id)) { - $access = sprintf("1='%s' OR sc.privatemgr=0", $_SESSION['mgrRole']); - if ($docgrp) { - $access .= " OR dg.document_group IN ({$docgrp})"; - } - $rs = $modx->db->select('sc.*', "{$tbl_site_content} AS sc LEFT JOIN {$tbl_document_groups} AS dg ON dg.document=sc.id", "sc.id='{$id}' AND ({$access})"); - $content = array(); - $content = $modx->db->getRow($rs); - $modx->documentObject = &$content; - if (!$content) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); - } - $_SESSION['itemname'] = $content['pagetitle']; +if(!empty ($id)) { + $access = sprintf("1='%s' OR sc.privatemgr=0", $_SESSION['mgrRole']); + if($docgrp) { + $access .= " OR dg.document_group IN ({$docgrp})"; + } + $rs = $modx->db->select('sc.*', "{$tbl_site_content} AS sc LEFT JOIN {$tbl_document_groups} AS dg ON dg.document=sc.id", "sc.id='{$id}' AND ({$access})"); + $content = array(); + $content = $modx->db->getRow($rs); + $modx->documentObject = &$content; + if(!$content) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); + } + $_SESSION['itemname'] = $content['pagetitle']; } else { - $content = array(); + $content = array(); - if (isset($_REQUEST['newtemplate'])) { - $content['template'] = $_REQUEST['newtemplate']; - } else { - $content['template'] = getDefaultTemplate(); - } + if(isset($_REQUEST['newtemplate'])) { + $content['template'] = $_REQUEST['newtemplate']; + } else { + $content['template'] = getDefaultTemplate(); + } - $_SESSION['itemname'] = $_lang["new_resource"]; + $_SESSION['itemname'] = $_lang["new_resource"]; } // restore saved form $formRestored = $modx->manager->loadFormValues(); -if (isset($_REQUEST['newtemplate'])) { - $formRestored = true; +if(isset($_REQUEST['newtemplate'])) { + $formRestored = true; } // retain form values if template was changed // edited to convert pub_date and unpub_date // sottwell 02-09-2006 -if ($formRestored == true) { - $content = array_merge($content, $_POST); - $content['content'] = $_POST['ta']; - if (empty($content['pub_date'])) { - unset($content['pub_date']); - } else { - $content['pub_date'] = $modx->toTimeStamp($content['pub_date']); - } - if (empty($content['unpub_date'])) { - unset($content['unpub_date']); - } else { - $content['unpub_date'] = $modx->toTimeStamp($content['unpub_date']); - } +if($formRestored == true) { + $content = array_merge($content, $_POST); + $content['content'] = $_POST['ta']; + if(empty ($content['pub_date'])) { + unset ($content['pub_date']); + } else { + $content['pub_date'] = $modx->toTimeStamp($content['pub_date']); + } + if(empty ($content['unpub_date'])) { + unset ($content['unpub_date']); + } else { + $content['unpub_date'] = $modx->toTimeStamp($content['unpub_date']); + } } // increase menu index if this is a new document -if (!isset($_REQUEST['id'])) { - if (!isset($modx->config['auto_menuindex'])) { - $modx->config['auto_menuindex'] = 1; - } - if ($modx->config['auto_menuindex']) { - $pid = (int)$_REQUEST['pid']; - $rs = $modx->db->select('count(*)', $tbl_site_content, "parent='{$pid}'"); - $content['menuindex'] = $modx->db->getValue($rs); - } else { - $content['menuindex'] = 0; - } +if(!isset ($_REQUEST['id'])) { + if(!isset ($modx->config['auto_menuindex'])) { + $modx->config['auto_menuindex'] = 1; + } + if($modx->config['auto_menuindex']) { + $pid = (int)$_REQUEST['pid']; + $rs = $modx->db->select('count(*)', $tbl_site_content, "parent='{$pid}'"); + $content['menuindex'] = $modx->db->getValue($rs); + } else { + $content['menuindex'] = 0; + } } -if (isset($_POST['which_editor'])) { - $modx->config['which_editor'] = $_POST['which_editor']; +if(isset ($_POST['which_editor'])) { + $modx->config['which_editor'] = $_POST['which_editor']; } // Add lock-element JS-Script @@ -478,7 +478,7 @@ function decode(s) { return s; } - manager->action == '72') { // Web Link specific?> + manager->action == '72') { // Web Link specific ?> var lastImageCtrl; var lastFileCtrl; @@ -539,30 +539,29 @@ function SetUrl(url, width, height, alt) { } } - + /* ]]> */ invokeEvent('OnDocFormPrerender', array( - 'id' => $id, - 'template' => $content['template'] - )); - - if (is_array($evtOut)) { - echo implode('', $evtOut); - } - - /*************************/ - $dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : ''; - $sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : 'createdon'; - $page = isset($_REQUEST['page']) ? (int) $_REQUEST['page'] : ''; - /*************************/ - - ?> + // invoke OnDocFormPrerender event + $evtOut = $modx->invokeEvent('OnDocFormPrerender', array( + 'id' => $id, + 'template' => $content['template'] + )); + + if(is_array($evtOut)) { + echo implode('', $evtOut); + } + + /*************************/ + $dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : ''; + $sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : 'createdon'; + $page = isset($_REQUEST['page']) ? (int) $_REQUEST['page'] : ''; + /*************************/ + + ?> @@ -576,55 +575,55 @@ function SetUrl(url, width, height, alt) {

    - config['modx_charset']) . (iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '') . '(' . $_REQUEST['id'] . ')'; - } else { - if ($modx->manager->action == '4') { - echo $_lang['add_resource']; - } elseif ($modx->manager->action == '72') { - echo $_lang['add_weblink']; - } else { - echo $_lang['create_resource_title']; - } - } ?> + config['modx_charset']) . (iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '') . '(' . $_REQUEST['id'] . ')'; + } else { + if ($modx->manager->action == '4') { + echo $_lang['add_resource']; + } else if ($modx->manager->action == '72') { + echo $_lang['add_weblink']; + } else { + echo $_lang['create_resource_title']; + } + } ?>

    config['use_breadcrumbs']) { - $temp = array(); - $title = isset($content['pagetitle']) ? $content['pagetitle'] : $_lang['create_resource_title']; - - if (isset($_REQUEST['id']) && $content['parent'] != 0) { - $bID = (int) $_REQUEST['id']; - $temp = $modx->getParentIds($bID); - } elseif (isset($_REQUEST['pid'])) { - $bID = (int) $_REQUEST['pid']; - $temp = $modx->getParentIds($bID); - array_unshift($temp, $bID); - } - - if ($temp) { - $parents = implode(',', $temp); - - if (!empty($parents)) { - $where = "FIND_IN_SET(id,'{$parents}') DESC"; - $rs = $modx->db->select('id, pagetitle', $tbl_site_content, "id IN ({$parents})", $where); - while ($row = $modx->db->getRow($rs)) { - $out .= ''; - } - } - } + } + } + } - $out .= ''; - echo ''; - } - ?> + $out .= ''; + echo ''; + } + ?>
    @@ -636,13 +635,13 @@ function SetUrl(url, width, height, alt) { invokeEvent('OnDocFormTemplateRender', array( - 'id' => $id - )); - if (is_array($evtOut)) { - echo implode('', $evtOut); - } else { - ?> + $evtOut = $modx->invokeEvent('OnDocFormTemplateRender', array( + 'id' => $id + )); + if(is_array($evtOut)) { + echo implode('', $evtOut); + } else { + ?>

    @@ -695,7 +694,7 @@ function SetUrl(url, width, height, alt) { - manager->action == '72') { // Web Link specific?> + manager->action == '72') { // Web Link specific ?> @@ -707,8 +706,7 @@ function SetUrl(url, width, height, alt) { - + @@ -728,35 +726,36 @@ function SetUrl(url, width, height, alt) { @@ -796,36 +795,37 @@ function SetUrl(url, width, height, alt) { db->select('pagetitle', $tbl_site_content, "id='{$parentlookup}'"); - $parentname = $modx->db->getValue($rs); - if (!$parentname) { - $modx->webAlertAndQuit($_lang["error_no_parent"]); - } - } ?> + $parentlookup = false; + if(isset ($_REQUEST['id'])) { + if($content['parent'] == 0) { + $parentname = $site_name; + } else { + $parentlookup = $content['parent']; + } + } elseif(isset ($_REQUEST['pid'])) { + if($_REQUEST['pid'] == 0) { + $parentname = $site_name; + } else { + $parentlookup = $_REQUEST['pid']; + } + } elseif(isset($_POST['parent'])) { + if($_POST['parent'] == 0) { + $parentname = $site_name; + } else { + $parentlookup = $_POST['parent']; + } + } else { + $parentname = $site_name; + $content['parent'] = 0; + } + if($parentlookup !== false && is_numeric($parentlookup)) { + $rs = $modx->db->select('pagetitle', $tbl_site_content, "id='{$parentlookup}'"); + $parentname = $modx->db->getValue($rs); + if(!$parentname) { + $modx->webAlertAndQuit($_lang["error_no_parent"]); + } + } + ?> " onclick="enableParentSelection(!allowParentSelection);"> () @@ -833,38 +833,37 @@ function SetUrl(url, width, height, alt) { manager->action == '72') { - ?> - - -
    - - - - - - - - - - - - manager->action == '4') { - ?> + /* + if($content['type'] == 'reference' || $modx->manager->action == '72') { + ?> + + +
    + + + + + + + + + + + + manager->action == '4') { ?>
    @@ -875,105 +874,107 @@ function SetUrl(url, width, height, alt) {
    manager->action == '4') && $use_editor == 1) { - $htmlContent = $content['content']; ?> + if(($content['richtext'] == 1 || $modx->manager->action == '4') && $use_editor == 1) { + $htmlContent = $content['content']; + ?>
    config['which_editor']][] = 'ta'; - $richtexteditorOptions[$modx->config['which_editor']]['ta'] = ''; - } else { - echo "\t" . '
    ' . "\n"; - } ?> + // Richtext-[*content*] + $richtexteditorIds = array(); + $richtexteditorOptions = array(); + $richtexteditorIds[$modx->config['which_editor']][] = 'ta'; + $richtexteditorOptions[$modx->config['which_editor']]['ta'] = ''; + } else { + echo "\t" . '
    ' . "\n"; + } + ?>
    - + manager->action == '4') || ($content['type'] == 'reference' || $modx->manager->action == 72)) { - $template = $default_template; - $group_tvs = empty($modx->config['group_tvs']) ? 0 : (int)$modx->config['group_tvs']; - if (isset($_REQUEST['newtemplate'])) { - $template = $_REQUEST['newtemplate']; - } else { - if (isset($content['template'])) { - $template = $content['template']; + if (($content['type'] == 'document' || $modx->manager->action == '4') || ($content['type'] == 'reference' || $modx->manager->action == 72)) { + $template = $default_template; + $group_tvs = empty($modx->config['group_tvs']) ? 0 : (int)$modx->config['group_tvs']; + if (isset ($_REQUEST['newtemplate'])) { + $template = $_REQUEST['newtemplate']; + } else { + if (isset ($content['template'])) { + $template = $content['template']; + } } - } - $field = "DISTINCT tv.*, IF(tvc.value!='',tvc.value,tv.default_text) as value, tvtpl.rank as tvrank"; - $vs = array( + $field = "DISTINCT tv.*, IF(tvc.value!='',tvc.value,tv.default_text) as value, tvtpl.rank as tvrank"; + $vs = array( $tbl_site_tmplvars, $tbl_site_tmplvar_templates, $tbl_site_tmplvar_contentvalues, $id, $tbl_site_tmplvar_access ); - $from = vsprintf("%s AS tv INNER JOIN %s AS tvtpl ON tvtpl.tmplvarid = tv.id + $from = vsprintf("%s AS tv INNER JOIN %s AS tvtpl ON tvtpl.tmplvarid = tv.id LEFT JOIN %s AS tvc ON tvc.tmplvarid=tv.id AND tvc.contentid='%s' LEFT JOIN %s AS tva ON tva.tmplvarid=tv.id", $vs); - $dgs = $docgrp ? " OR tva.documentgroup IN ({$docgrp})" : ''; - $vs = array( + $dgs = $docgrp ? " OR tva.documentgroup IN ({$docgrp})" : ''; + $vs = array( $template, $_SESSION['mgrRole'], $dgs ); - $sort = 'tvtpl.rank,tv.rank, tv.id'; - if ($group_tvs) { - $field .= ', IFNULL(tv.category,0) as category_id, IFNULL(cat.category,"' . $_lang['no_category'] . '") AS category, IFNULL(cat.rank,0) AS category_rank'; - $from .= ' + $sort = 'tvtpl.rank,tv.rank, tv.id'; + if ($group_tvs) { + $field .= ', IFNULL(tv.category,0) as category_id, IFNULL(cat.category,"' . $_lang['no_category'] . '") AS category, IFNULL(cat.rank,0) AS category_rank'; + $from .= ' LEFT JOIN ' . $tbl_categories . ' AS cat ON cat.id=tv.category'; - $sort = 'cat.rank,cat.id,' . $sort; - } - $where = vsprintf("tvtpl.templateid='%s' AND (1='%s' OR ISNULL(tva.documentgroup) %s)", $vs); - $rs = $modx->db->select($field, $from, $where, $sort); - if ($modx->db->getRecordCount($rs)) { - $tvsArray = $modx->db->makeArray($rs, 'name'); - require_once(MODX_MANAGER_PATH . 'includes/tmplvars.inc.php'); - require_once(MODX_MANAGER_PATH . 'includes/tmplvars.commands.inc.php'); - - $templateVariablesOutput = ''; - $templateVariablesGeneral = ''; - - $i = $ii = 0; - $tab = ''; - foreach ($tvsArray as $row) { - if ($group_tvs && $row['category_id'] != 0) { - $ii = 0; - if ($tab !== $row['category_id']) { - if ($group_tvs == 1 || $group_tvs == 3) { - if ($i === 0) { - $templateVariablesOutput .= ' + $sort = 'cat.rank,cat.id,' . $sort; + } + $where = vsprintf("tvtpl.templateid='%s' AND (1='%s' OR ISNULL(tva.documentgroup) %s)", $vs); + $rs = $modx->db->select($field, $from, $where, $sort); + if ($modx->db->getRecordCount($rs)) { + $tvsArray = $modx->db->makeArray($rs, 'name'); + require_once(MODX_MANAGER_PATH . 'includes/tmplvars.inc.php'); + require_once(MODX_MANAGER_PATH . 'includes/tmplvars.commands.inc.php'); + + $templateVariablesOutput = ''; + $templateVariablesGeneral = ''; + + $i = $ii = 0; + $tab = ''; + foreach ($tvsArray as $row) { + if ($group_tvs && $row['category_id'] != 0) { + $ii = 0; + if ($tab !== $row['category_id']) { + if ($group_tvs == 1 || $group_tvs == 3) { + if ($i === 0) { + $templateVariablesOutput .= '
    ' . $row['category'] . '
    ' . "\n"; - } else { - $templateVariablesOutput .= ' + } else { + $templateVariablesOutput .= '
    @@ -982,18 +983,18 @@ function SetUrl(url, width, height, alt) {
    ' . $row['category'] . '
    '; - } - } elseif ($group_tvs == 2 || $group_tvs == 4) { - if ($i === 0) { - $templateVariablesOutput .= ' + } + } else if ($group_tvs == 2 || $group_tvs == 4) { + if ($i === 0) { + $templateVariablesOutput .= '

    ' . $row['category'] . '

    '; - } else { - $templateVariablesOutput .= ' + } else { + $templateVariablesOutput .= '
    @@ -1004,16 +1005,16 @@ function SetUrl(url, width, height, alt) {
    '; - } - } elseif ($group_tvs == 5) { - if ($i === 0) { - $templateVariablesOutput .= ' + } + } else if ($group_tvs == 5) { + if ($i === 0) { + $templateVariablesOutput .= '

    ' . $row['category'] . '

    '; - } else { - $templateVariablesOutput .= ' + } else { + $templateVariablesOutput .= '
    @@ -1022,97 +1023,97 @@ function SetUrl(url, width, height, alt) { '; + } } + $split = 0; + } else { + $split = 1; } - $split = 0; - } else { - $split = 1; } - } - // Go through and display all Template Variables - if ($row['type'] == 'richtext' || $row['type'] == 'htmlarea') { - // determine TV-options - $tvOptions = $modx->parseProperties($row['elements']); - if (!empty($tvOptions)) { - // Allow different Editor with TV-option {"editor":"CKEditor4"} or &editor=Editor;text;CKEditor4 - $editor = isset($tvOptions['editor']) ? $tvOptions['editor'] : $modx->config['which_editor']; - }; - // Add richtext editor to the list - $richtexteditorIds[$editor][] = "tv" . $row['id']; - $richtexteditorOptions[$editor]["tv" . $row['id']] = $tvOptions; - } + // Go through and display all Template Variables + if ($row['type'] == 'richtext' || $row['type'] == 'htmlarea') { + // determine TV-options + $tvOptions = $modx->parseProperties($row['elements']); + if (!empty($tvOptions)) { + // Allow different Editor with TV-option {"editor":"CKEditor4"} or &editor=Editor;text;CKEditor4 + $editor = isset($tvOptions['editor']) ? $tvOptions['editor'] : $modx->config['which_editor']; + }; + // Add richtext editor to the list + $richtexteditorIds[$editor][] = "tv" . $row['id']; + $richtexteditorOptions[$editor]["tv" . $row['id']] = $tvOptions; + } - $templateVariablesTmp = ''; + $templateVariablesTmp = ''; - // splitter - if ($group_tvs) { - if (($split && $i) || $ii) { - $templateVariablesTmp .= ' + // splitter + if ($group_tvs) { + if (($split && $i) || $ii) { + $templateVariablesTmp .= ' ' . "\n"; - } - } elseif ($i) { - $templateVariablesTmp .= ' + } + } else if ($i) { + $templateVariablesTmp .= ' ' . "\n"; - } + } - // post back value - if (array_key_exists('tv' . $row['id'], $_POST)) { - if (is_array($_POST['tv' . $row['id']])) { - $tvPBV = implode('||', $_POST['tv' . $row['id']]); + // post back value + if (array_key_exists('tv' . $row['id'], $_POST)) { + if (is_array($_POST['tv' . $row['id']])) { + $tvPBV = implode('||', $_POST['tv' . $row['id']]); + } else { + $tvPBV = $_POST['tv' . $row['id']]; + } } else { - $tvPBV = $_POST['tv' . $row['id']]; + $tvPBV = $row['value']; } - } else { - $tvPBV = $row['value']; - } - $tvDescription = (!empty($row['description'])) ? '
    ' . $row['description'] . '' : ''; - $tvInherited = (substr($tvPBV, 0, 8) == '@INHERIT') ? '
    (' . $_lang['tmplvars_inherited'] . ')' : ''; - $tvName = $modx->hasPermission('edit_template') ? '
    [*' . $row['name'] . '*]' : ''; + $tvDescription = (!empty($row['description'])) ? '
    ' . $row['description'] . '' : ''; + $tvInherited = (substr($tvPBV, 0, 8) == '@INHERIT') ? '
    (' . $_lang['tmplvars_inherited'] . ')' : ''; + $tvName = $modx->hasPermission('edit_template') ? '
    [*' . $row['name'] . '*]' : ''; - $templateVariablesTmp .= ' + $templateVariablesTmp .= ' '; - if ($group_tvs && $row['category_id'] == 0) { - $templateVariablesGeneral .= $templateVariablesTmp; - $ii++; - } else { - $templateVariablesOutput .= $templateVariablesTmp; - $tab = $row['category_id']; - $i++; + if ($group_tvs && $row['category_id'] == 0) { + $templateVariablesGeneral .= $templateVariablesTmp; + $ii++; + } else { + $templateVariablesOutput .= $templateVariablesTmp; + $tab = $row['category_id']; + $i++; + } } - } - if ($templateVariablesGeneral) { - echo '
    ' . $row['caption'] . $tvName . '' . $tvDescription . $tvInherited . '
    ' . renderFormElement($row['type'], $row['id'], $row['default_text'], $row['elements'], $tvPBV, '', $row, $tvsArray) . '
    ' . $templateVariablesGeneral . '
    '; - } + if ($templateVariablesGeneral) { + echo '' . $templateVariablesGeneral . '
    '; + } - $templateVariables .= ' - ' . "\n"; - if (!$group_tvs) { $templateVariables .= ' + ' . "\n"; + if (!$group_tvs) { + $templateVariables .= '
    ' . $_lang['settings_templvars'] . '
    '; - } elseif ($group_tvs == 2) { - $templateVariables .= ' + } else if ($group_tvs == 2) { + $templateVariables .= '
    ' . $_lang['settings_templvars'] . '
    '; - } elseif ($group_tvs == 3) { - $templateVariables .= ' + } else if ($group_tvs == 3) { + $templateVariables .= '

    ' . $_lang['settings_templvars'] . '

    '; - } elseif ($group_tvs == 4) { - $templateVariables .= ' + } else if ($group_tvs == 4) { + $templateVariables .= '

    ' . $_lang['settings_templvars'] . '

    @@ -1121,33 +1122,34 @@ function SetUrl(url, width, height, alt) { '; - } - $templateVariables .= $templateVariablesOutput; - $templateVariables .= ' + } + $templateVariables .= $templateVariablesOutput; + $templateVariables .= '
    ' . "\n"; - if ($group_tvs == 1) { - $templateVariables .= ' + if ($group_tvs == 1) { + $templateVariables .= ' ' . "\n"; - } elseif ($group_tvs == 2 || $group_tvs == 4) { - $templateVariables .= ' + } else if ($group_tvs == 2 || $group_tvs == 4) { + $templateVariables .= ' ' . "\n"; - } elseif ($group_tvs == 3) { - $templateVariables .= ' + } else if ($group_tvs == 3) { + $templateVariables .= ' ' . "\n"; - } - $templateVariables .= ' + } + $templateVariables .= ' ' . "\n"; + } } - } - // Template Variables - if ($modx->config['group_tvs'] < 3) { - echo $templateVariables; - } ?> + // Template Variables + if ($modx->config['group_tvs'] < 3) { + echo $templateVariables; + } + ?> @@ -1210,8 +1212,8 @@ function SetUrl(url, width, height, alt) { manager->action != '27' || $_SESSION['mgrInternalKey'] == $content['createdby'] || $modx->hasPermission('change_resourcetype')) { - ?> + if($_SESSION['mgrRole'] == 1 || $modx->manager->action != '27' || $_SESSION['mgrInternalKey'] == $content['createdby'] || $modx->hasPermission('change_resourcetype')) { + ?> @@ -1233,14 +1235,15 @@ function SetUrl(url, width, height, alt) { @@ -1263,23 +1266,23 @@ function SetUrl(url, width, height, alt) { manager->action != '72') { - // non-admin managers creating or editing a document resource - ?> + } else { + if($content['type'] != 'reference' && $modx->manager->action != '72') { + // non-admin managers creating or editing a document resource + ?> " /> + } else { + // non-admin managers creating or editing a reference (weblink) resource + ?> + } + }//if mgrRole + ?> @@ -1352,8 +1355,7 @@ function SetUrl(url, width, height, alt) { - + manager->action == '27' ? $id : (!empty($_REQUEST['pid']) ? $_REQUEST['pid'] : $content['parent'])); - if ($documentId > 0) { - // Load up, the permissions from the parent (if new document) or existing document - $rs = $modx->db->select('id, document_group', $tbl_document_groups, "document='{$documentId}'"); - while ($currentgroup = $modx->db->getRow($rs)) { - $groupsarray[] = $currentgroup['document_group'] . ',' . $currentgroup['id']; - } - - // Load up the current permissions and names - $vs = array( - $tbl_document_group_names, - $tbl_document_groups, - $documentId - ); - $from = vsprintf("%s AS dgn LEFT JOIN %s AS groups ON groups.document_group=dgn.id AND groups.document='%s'", $vs); - $rs = $modx->db->select('dgn.*, groups.id AS link_id', $from, '', 'name'); - } else { - // Just load up the names, we're starting clean - $rs = $modx->db->select('*, NULL AS link_id', $tbl_document_group_names, '', 'name'); - } - - // retain selected doc groups between post - if (isset($_POST['docgroups'])) { - $groupsarray = array_merge($groupsarray, $_POST['docgroups']); - } - - $isManager = $modx->hasPermission('access_permissions'); - $isWeb = $modx->hasPermission('web_access_permissions'); - - // Setup Basic attributes for each Input box - $inputAttributes = array( - 'type' => 'checkbox', - 'class' => 'checkbox', - 'name' => 'docgroups[]', - 'onclick' => 'makePublic(false);', - ); - $permissions = array(); // New Permissions array list (this contains the HTML) - $permissions_yes = 0; // count permissions the current mgr user has - $permissions_no = 0; // count permissions the current mgr user doesn't have - - // Loop through the permissions list - while ($row = $modx->db->getRow($rs)) { - - // Create an inputValue pair (group ID and group link (if it exists)) - $inputValue = $row['id'] . ',' . ($row['link_id'] ? $row['link_id'] : 'new'); - $inputId = 'group-' . $row['id']; - - $checked = in_array($inputValue, $groupsarray); - if ($checked) { - $notPublic = true; - } // Mark as private access (either web or manager) - - // Skip the access permission if the user doesn't have access... - if ((!$isManager && $row['private_memgroup'] == '1') || (!$isWeb && $row['private_webgroup'] == '1')) { - continue; - } + /******************************* + * Document Access Permissions */ + if($use_udperms == 1) { + $groupsarray = array(); + $sql = ''; + + $documentId = ($modx->manager->action == '27' ? $id : (!empty($_REQUEST['pid']) ? $_REQUEST['pid'] : $content['parent'])); + if($documentId > 0) { + // Load up, the permissions from the parent (if new document) or existing document + $rs = $modx->db->select('id, document_group', $tbl_document_groups, "document='{$documentId}'"); + while($currentgroup = $modx->db->getRow($rs)) $groupsarray[] = $currentgroup['document_group'] . ',' . $currentgroup['id']; + + // Load up the current permissions and names + $vs = array( + $tbl_document_group_names, + $tbl_document_groups, + $documentId + ); + $from = vsprintf("%s AS dgn LEFT JOIN %s AS groups ON groups.document_group=dgn.id AND groups.document='%s'", $vs); + $rs = $modx->db->select('dgn.*, groups.id AS link_id', $from, '', 'name'); + } else { + // Just load up the names, we're starting clean + $rs = $modx->db->select('*, NULL AS link_id', $tbl_document_group_names, '', 'name'); + } - // Setup attributes for this Input box - $inputAttributes['id'] = $inputId; - $inputAttributes['value'] = $inputValue; - if ($checked) { - $inputAttributes['checked'] = 'checked'; - } else { - unset($inputAttributes['checked']); - } + // retain selected doc groups between post + if(isset($_POST['docgroups'])) { + $groupsarray = array_merge($groupsarray, $_POST['docgroups']); + } - // Create attribute string list - $inputString = array(); - foreach ($inputAttributes as $k => $v) { - $inputString[] = $k . '="' . $v . '"'; - } + $isManager = $modx->hasPermission('access_permissions'); + $isWeb = $modx->hasPermission('web_access_permissions'); + + // Setup Basic attributes for each Input box + $inputAttributes = array( + 'type' => 'checkbox', + 'class' => 'checkbox', + 'name' => 'docgroups[]', + 'onclick' => 'makePublic(false);', + ); + $permissions = array(); // New Permissions array list (this contains the HTML) + $permissions_yes = 0; // count permissions the current mgr user has + $permissions_no = 0; // count permissions the current mgr user doesn't have + + // Loop through the permissions list + while($row = $modx->db->getRow($rs)) { + + // Create an inputValue pair (group ID and group link (if it exists)) + $inputValue = $row['id'] . ',' . ($row['link_id'] ? $row['link_id'] : 'new'); + $inputId = 'group-' . $row['id']; + + $checked = in_array($inputValue, $groupsarray); + if($checked) { + $notPublic = true; + } // Mark as private access (either web or manager) + + // Skip the access permission if the user doesn't have access... + if((!$isManager && $row['private_memgroup'] == '1') || (!$isWeb && $row['private_webgroup'] == '1')) { + continue; + } + + // Setup attributes for this Input box + $inputAttributes['id'] = $inputId; + $inputAttributes['value'] = $inputValue; + if($checked) { + $inputAttributes['checked'] = 'checked'; + } else { + unset($inputAttributes['checked']); + } + + // Create attribute string list + $inputString = array(); + foreach($inputAttributes as $k => $v) $inputString[] = $k . '="' . $v . '"'; + + // Make the HTML + $inputHTML = ''; + + // does user have this permission? + $from = "{$tbl_membergroup_access} AS mga, {$tbl_member_groups} AS mg"; + $vs = array( + $row['id'], + $_SESSION['mgrInternalKey'] + ); + $where = vsprintf("mga.membergroup=mg.user_group AND mga.documentgroup=%s AND mg.member=%s", $vs); + $rsp = $modx->db->select('COUNT(mg.id)', $from, $where); + $count = $modx->db->getValue($rsp); + if($count > 0) { + ++$permissions_yes; + } else { + ++$permissions_no; + } + $permissions[] = "\t\t" . '
  • ' . $inputHTML . '
  • '; + } + // if mgr user doesn't have access to any of the displayable permissions, forget about them and make doc public + if($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0)) { + $permissions = array(); + } - // Make the HTML - $inputHTML = ''; - - // does user have this permission? - $from = "{$tbl_membergroup_access} AS mga, {$tbl_member_groups} AS mg"; - $vs = array( - $row['id'], - $_SESSION['mgrInternalKey'] - ); - $where = vsprintf("mga.membergroup=mg.user_group AND mga.documentgroup=%s AND mg.member=%s", $vs); - $rsp = $modx->db->select('COUNT(mg.id)', $from, $where); - $count = $modx->db->getValue($rsp); - if ($count > 0) { - ++$permissions_yes; - } else { - ++$permissions_no; - } - $permissions[] = "\t\t" . '
  • ' . $inputHTML . '
  • '; - } - // if mgr user doesn't have access to any of the displayable permissions, forget about them and make doc public - if ($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0)) { - $permissions = array(); - } - - // See if the Access Permissions section is worth displaying... - if (!empty($permissions)) { - // Add the "All Document Groups" item if we have rights in both contexts - if ($isManager && $isWeb) { - array_unshift($permissions, "\t\t" . '
  • '); - } - // Output the permissions list... - ?> + // See if the Access Permissions section is worth displaying... + if(!empty($permissions)) { + // Add the "All Document Groups" item if we have rights in both contexts + if($isManager && $isWeb) { + array_unshift($permissions, "\t\t" . '
  • '); + } + // Output the permissions list... + ?>

    @@ -1506,30 +1504,31 @@ function makePublic(b) {
    0) && ($_SESSION['mgrPermissions']['access_permissions'] == 1 || $_SESSION['mgrPermissions']['web_access_permissions'] == 1)) { - ?> + } // !empty($permissions) + elseif($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0) && ($_SESSION['mgrPermissions']['access_permissions'] == 1 || $_SESSION['mgrPermissions']['web_access_permissions'] == 1)) { + ?>

    + + } + } + /* End Document Access Permissions * + ***********************************/ + ?> invokeEvent('OnDocFormRender', array( - 'id' => $id, - 'template' => $content['template'] - )); + // invoke OnDocFormRender event + $evtOut = $modx->invokeEvent('OnDocFormRender', array( + 'id' => $id, + 'template' => $content['template'] + )); - if (is_array($evtOut)) { - echo implode('', $evtOut); - } - ?> + if(is_array($evtOut)) { + echo implode('', $evtOut); + } + ?>
    @@ -1539,66 +1538,64 @@ function makePublic(b) { storeCurTemplate(); manager->action == '4' || $modx->manager->action == '72') && $use_editor == 1) { - if (is_array($richtexteditorIds)) { - foreach ($richtexteditorIds as $editor => $elements) { - // invoke OnRichTextEditorInit event - $evtOut = $modx->invokeEvent('OnRichTextEditorInit', array( - 'editor' => $editor, - 'elements' => $elements, - 'options' => $richtexteditorOptions[$editor] - )); - if (is_array($evtOut)) { - echo implode('', $evtOut); - } - } - } - } +if(($content['richtext'] == 1 || $modx->manager->action == '4' || $modx->manager->action == '72') && $use_editor == 1) { + if(is_array($richtexteditorIds)) { + foreach($richtexteditorIds as $editor => $elements) { + // invoke OnRichTextEditorInit event + $evtOut = $modx->invokeEvent('OnRichTextEditorInit', array( + 'editor' => $editor, + 'elements' => $elements, + 'options' => $richtexteditorOptions[$editor] + )); + if(is_array($evtOut)) { + echo implode('', $evtOut); + } + } + } +} /** * @return string */ -function getDefaultTemplate() -{ - $modx = evolutionCMS(); +function getDefaultTemplate() { + $modx = evolutionCMS(); $default_template = ''; - switch ($modx->config['auto_template_logic']) { - case 'sibling': - if (!isset($_GET['pid']) || empty($_GET['pid'])) { - $site_start = $modx->config['site_start']; - $where = "sc.isfolder=0 AND sc.id!='{$site_start}'"; - $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 1, 0, 'template', $where, 'menuindex', 'ASC', 1); - if (isset($sibl[0]['template']) && $sibl[0]['template'] !== '') { - $default_template = $sibl[0]['template']; - } - } else { - $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 1, 0, 'template', 'isfolder=0', 'menuindex', 'ASC', 1); - if (isset($sibl[0]['template']) && $sibl[0]['template'] !== '') { - $default_template = $sibl[0]['template']; - } else { - $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 0, 0, 'template', 'isfolder=0', 'menuindex', 'ASC', 1); - if (isset($sibl[0]['template']) && $sibl[0]['template'] !== '') { - $default_template = $sibl[0]['template']; - } - } - } - if (isset($default_template)) { - break; - } // If $default_template could not be determined, fall back / through to "parent"-mode - // no break - case 'parent': - if (isset($_REQUEST['pid']) && !empty($_REQUEST['pid'])) { - $parent = $modx->getPageInfo($_REQUEST['pid'], 0, 'template'); - if (isset($parent['template'])) { - $default_template = $parent['template']; - } - } - break; - case 'system': - default: // default_template is already set - $default_template = $modx->config['default_template']; - } - - return empty($default_template) ? $modx->config['default_template'] : $default_template; + switch($modx->config['auto_template_logic']) { + case 'sibling': + if(!isset($_GET['pid']) || empty($_GET['pid'])) { + $site_start = $modx->config['site_start']; + $where = "sc.isfolder=0 AND sc.id!='{$site_start}'"; + $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 1, 0, 'template', $where, 'menuindex', 'ASC', 1); + if(isset($sibl[0]['template']) && $sibl[0]['template'] !== '') { + $default_template = $sibl[0]['template']; + } + } else { + $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 1, 0, 'template', 'isfolder=0', 'menuindex', 'ASC', 1); + if(isset($sibl[0]['template']) && $sibl[0]['template'] !== '') { + $default_template = $sibl[0]['template']; + } else { + $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 0, 0, 'template', 'isfolder=0', 'menuindex', 'ASC', 1); + if(isset($sibl[0]['template']) && $sibl[0]['template'] !== '') { + $default_template = $sibl[0]['template']; + } + } + } + if(isset($default_template)) { + break; + } // If $default_template could not be determined, fall back / through to "parent"-mode + case 'parent': + if(isset($_REQUEST['pid']) && !empty($_REQUEST['pid'])) { + $parent = $modx->getPageInfo($_REQUEST['pid'], 0, 'template'); + if(isset($parent['template'])) { + $default_template = $parent['template']; + } + } + break; + case 'system': + default: // default_template is already set + $default_template = $modx->config['default_template']; + } + + return empty($default_template) ? $modx->config['default_template'] : $default_template; } diff --git a/manager/actions/mutate_htmlsnippet.dynamic.php b/manager/actions/mutate_htmlsnippet.dynamic.php index 25e1ebcc28..9305315b5c 100755 --- a/manager/actions/mutate_htmlsnippet.dynamic.php +++ b/manager/actions/mutate_htmlsnippet.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } @@ -43,7 +43,7 @@ if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } -} elseif (isset($_REQUEST['itemname'])) { +} else if (isset($_REQUEST['itemname'])) { $content['name'] = $_REQUEST['itemname']; } else { $_SESSION['itemname'] = $_lang["new_htmlsnippet"]; diff --git a/manager/actions/mutate_menuindex_sort.dynamic.php b/manager/actions/mutate_menuindex_sort.dynamic.php index 64f823e562..989eedeada 100755 --- a/manager/actions/mutate_menuindex_sort.dynamic.php +++ b/manager/actions/mutate_menuindex_sort.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('edit_document') || !$modx->hasPermission('save_document')) { @@ -49,7 +49,7 @@ $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; $docgrp_cond = $docgrp ? "OR dg.document_group IN ({$docgrp})" : ''; - $mgrRole = (isset($_SESSION['mgrRole']) && (string)$_SESSION['mgrRole'] === '1') ? '1' : '0'; + $mgrRole = (isset ($_SESSION['mgrRole']) && (string)$_SESSION['mgrRole'] === '1') ? '1' : '0'; $access = " AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); $rs = $modx->db->select('sc.id, sc.pagetitle, sc.parent, sc.menuindex, sc.published, sc.hidemenu, sc.deleted, sc.isfolder', $tblsc . 'AS sc LEFT JOIN ' . $tbldg . ' dg ON dg.document=sc.id', 'sc.parent=' . $id . $access . ' GROUP BY sc.id', 'menuindex ASC'); diff --git a/manager/actions/mutate_module.dynamic.php b/manager/actions/mutate_module.dynamic.php index a4f6ab0d40..38694b9403 100755 --- a/manager/actions/mutate_module.dynamic.php +++ b/manager/actions/mutate_module.dynamic.php @@ -1,20 +1,20 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -switch ($modx->manager->action) { - case 107: - if (!$modx->hasPermission('new_module')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 108: - if (!$modx->hasPermission('edit_module')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +switch($modx->manager->action) { + case 107: + if(!$modx->hasPermission('new_module')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 108: + if(!$modx->hasPermission('edit_module')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; // Get table names (alphabetical) @@ -33,41 +33,40 @@ * * @return string */ -function createGUID() -{ - srand((double) microtime() * 1000000); - $r = rand(); - $u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1); - $m = md5($u); - return $m; +function createGUID() { + srand((double) microtime() * 1000000); + $r = rand(); + $u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1); + $m = md5($u); + return $m; } // check to see the module editor isn't locked -if ($lockedEl = $modx->elementIsLocked(6, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); +if($lockedEl = $modx->elementIsLocked(6, $id)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); } // end check for lock // Lock snippet for other users to edit $modx->lockElement(6, $id); -if (isset($_GET['id'])) { - $rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'"); - $content = $modx->db->getRow($rs); - if (!$content) { - $modx->webAlertAndQuit("Module not found for id '{$id}'."); - } - $content['properties'] = str_replace("&", "&", $content['properties']); - $_SESSION['itemname'] = $content['name']; - if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } +if(isset($_GET['id'])) { + $rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'"); + $content = $modx->db->getRow($rs); + if(!$content) { + $modx->webAlertAndQuit("Module not found for id '{$id}'."); + } + $content['properties'] = str_replace("&", "&", $content['properties']); + $_SESSION['itemname'] = $content['name']; + if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } } else { - $_SESSION['itemname'] = $_lang["new_module"]; - $content['wrap'] = '1'; + $_SESSION['itemname'] = $_lang["new_module"]; + $content['wrap'] = '1'; } -if ($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); +if($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); } // Add lock-element JS-Script @@ -438,18 +437,18 @@ function SetUrl(url, width, height, alt) { invokeEvent('OnModFormPrerender', array('id' => $id)); - if (is_array($evtOut)) { - echo implode('', $evtOut); - } - - // Prepare internal params & info-tab via parseDocBlock - $modulecode = isset($content['modulecode']) ? $modx->db->escape($content['modulecode']) : ''; - $docBlock = $modx->parseDocBlockFromString($modulecode); - $docBlockList = $modx->convertDocBlockIntoList($docBlock); - $internal = array(); - ?> + // invoke OnModFormPrerender event + $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id)); + if(is_array($evtOut)) { + echo implode('', $evtOut); + } + + // Prepare internal params & info-tab via parseDocBlock + $modulecode = isset($content['modulecode']) ? $modx->db->escape($content['modulecode']) : ''; + $docBlock = $modx->parseDocBlockFromString($modulecode); + $docBlockList = $modx->convertDocBlockIntoList($docBlock); + $internal = array(); + ?> @@ -479,7 +478,7 @@ function SetUrl(url, width, height, alt) {
    - hasPermission('save_role')): ?> + hasPermission('save_role')): ?>
    @@ -601,7 +600,7 @@ function SetUrl(url, width, height, alt) { - manager->action == '108'): ?> + manager->action == '108'): ?>

    @@ -613,7 +612,7 @@ function SetUrl(url, width, height, alt) { ">
    db->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, + $ds = $modx->db->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, CASE smd.type WHEN 10 THEN 'Chunk' WHEN 20 THEN 'Document' @@ -629,17 +628,17 @@ function SetUrl(url, width, height, alt) { LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = 50 LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = 60", "smd.module='{$id}'", 'smd.type,name'); - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items - $grd->noRecordMsg = $_lang['no_records_found']; - $grd->cssClass = 'grid'; - $grd->columnHeaderClass = 'gridHeader'; - $grd->itemClass = 'gridItem'; - $grd->altItemClass = 'gridAltItem'; - $grd->columns = $_lang['element_name'] . " ," . $_lang['type']; - $grd->fields = "name,type"; - echo $grd->render(); - ?> + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items + $grd->noRecordMsg = $_lang['no_records_found']; + $grd->cssClass = 'grid'; + $grd->columnHeaderClass = 'gridHeader'; + $grd->itemClass = 'gridItem'; + $grd->altItemClass = 'gridAltItem'; + $grd->columns = $_lang['element_name'] . " ," . $_lang['type']; + $grd->fields = "name,type"; + echo $grd->render(); + ?> @@ -649,14 +648,14 @@ function SetUrl(url, width, height, alt) {

    - + db->select('usergroup', $tbl_site_module_access, "module='{$id}'"); - $groupsarray = $modx->db->getColumn('usergroup', $rs); + // fetch user access permissions for the module + $rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'"); + $groupsarray = $modx->db->getColumn('usergroup', $rs); - if ($modx->hasPermission('access_permissions')) { - ?> + if($modx->hasPermission('access_permissions')) { + ?>

    db->select('name, id', $tbl_membergroup_names, '', 'name'); - while ($row = $modx->db->getRow($rs)) { - $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); - $checked = in_array($row['id'], $groupsarray); - if ($modx->hasPermission('access_permissions')) { - if ($checked) { - $notPublic = true; - } - $chks .= '
    \n"; - } else { - if ($checked) { - $chks = '' . "\n" . $chks; - } - } - } - if ($modx->hasPermission('access_permissions')) { - $chks = '
    ' . "\n" . $chks; - } - echo $chks; - ?> + } + $chk = ''; + $rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name'); + while($row = $modx->db->getRow($rs)) { + $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); + $checked = in_array($row['id'], $groupsarray); + if($modx->hasPermission('access_permissions')) { + if($checked) { + $notPublic = true; + } + $chks .= '
    \n"; + } else { + if($checked) { + $chks = '' . "\n" . $chks; + } + } + } + if($modx->hasPermission('access_permissions')) { + $chks = '
    ' . "\n" . $chks; + } + echo $chks; + ?>
    @@ -717,11 +716,11 @@ function makePublic(b) { invokeEvent('OnModFormRender', array('id' => $id)); - if (is_array($evtOut)) { - echo implode('', $evtOut); - } - ?> + // invoke OnModFormRender event + $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id)); + if(is_array($evtOut)) { + echo implode('', $evtOut); + } + ?> diff --git a/manager/actions/mutate_module_resources.dynamic.php b/manager/actions/mutate_module_resources.dynamic.php index 61ffcbb973..c7afe8e1ac 100755 --- a/manager/actions/mutate_module_resources.dynamic.php +++ b/manager/actions/mutate_module_resources.dynamic.php @@ -1,10 +1,10 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('edit_module')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('edit_module')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; @@ -25,92 +25,92 @@ // check to see the editor isn't locked $rs = $modx->db->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='" . $modx->getLoginUserID() . "'"); -if ($username = $modx->db->getValue($rs)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $username, 'module')); +if($username = $modx->db->getValue($rs)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $username, 'module')); } // end check for lock // take action -switch ($_REQUEST['op']) { - case 'add': - // convert ids to numbers - $opids = array_filter(array_map('intval', explode(',', $_REQUEST['newids']))); - - if (count($opids) > 0) { - // 1-snips, 2-tpls, 3-tvs, 4-chunks, 5-plugins, 6-docs - $rt = strtolower($_REQUEST["rt"]); - if ($rt == 'chunk') { - $type = 10; - } - if ($rt == 'doc') { - $type = 20; - } - if ($rt == 'plug') { - $type = 30; - } - if ($rt == 'snip') { - $type = 40; - } - if ($rt == 'tpl') { - $type = 50; - } - if ($rt == 'tv') { - $type = 60; - } - $modx->db->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'"); - foreach ($opids as $opid) { - $modx->db->insert(array( - 'module' => $id, - 'resource' => $opid, - 'type' => $type, - ), $tbl_site_module_depobj); - } - } - break; - case 'del': - // convert ids to numbers - $opids = array_filter(array_map('intval', $_REQUEST['depid'])); - - // get resources that needs to be removed - $ds = $modx->db->select('*', $tbl_site_module_depobj, "id IN (" . implode(",", $opids) . ")"); - // loop through resources and look for plugins and snippets - $plids = array(); - $snid = array(); - while ($row = $modx->db->getRow($ds)) { - if ($row['type'] == '30') { - $plids[$i] = $row['resource']; - } - if ($row['type'] == '40') { - $snids[$i] = $row['resource']; - } - } - // get guid - $ds = $modx->db->select('guid', $tbl_site_modules, "id='{$id}'"); - $guid = $modx->db->getValue($ds); - // reset moduleguid for deleted resources - if (($cp = count($plids)) || ($cs = count($snids))) { - if ($cp) { - $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $plids) . ") AND moduleguid='{$guid}'"); - } - if ($cs) { - $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'"); - } - // reset cache - $modx->clearCache('full'); - } - $modx->db->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")"); - break; +switch($_REQUEST['op']) { + case 'add': + // convert ids to numbers + $opids = array_filter(array_map('intval', explode(',', $_REQUEST['newids']))); + + if(count($opids) > 0) { + // 1-snips, 2-tpls, 3-tvs, 4-chunks, 5-plugins, 6-docs + $rt = strtolower($_REQUEST["rt"]); + if($rt == 'chunk') { + $type = 10; + } + if($rt == 'doc') { + $type = 20; + } + if($rt == 'plug') { + $type = 30; + } + if($rt == 'snip') { + $type = 40; + } + if($rt == 'tpl') { + $type = 50; + } + if($rt == 'tv') { + $type = 60; + } + $modx->db->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'"); + foreach($opids as $opid) { + $modx->db->insert(array( + 'module' => $id, + 'resource' => $opid, + 'type' => $type, + ), $tbl_site_module_depobj); + } + } + break; + case 'del': + // convert ids to numbers + $opids = array_filter(array_map('intval', $_REQUEST['depid'])); + + // get resources that needs to be removed + $ds = $modx->db->select('*', $tbl_site_module_depobj, "id IN (" . implode(",", $opids) . ")"); + // loop through resources and look for plugins and snippets + $plids = array(); + $snid = array(); + while($row = $modx->db->getRow($ds)) { + if($row['type'] == '30') { + $plids[$i] = $row['resource']; + } + if($row['type'] == '40') { + $snids[$i] = $row['resource']; + } + } + // get guid + $ds = $modx->db->select('guid', $tbl_site_modules, "id='{$id}'"); + $guid = $modx->db->getValue($ds); + // reset moduleguid for deleted resources + if(($cp = count($plids)) || ($cs = count($snids))) { + if($cp) { + $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $plids) . ") AND moduleguid='{$guid}'"); + } + if($cs) { + $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'"); + } + // reset cache + $modx->clearCache('full'); + } + $modx->db->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")"); + break; } // load record $rs = $modx->db->select('*', $tbl_site_modules, "id = '{$id}'"); $content = $modx->db->getRow($rs); -if (!$content) { - $modx->webAlertAndQuit("Module not found for id '{$id}'."); +if(!$content) { + $modx->webAlertAndQuit("Module not found for id '{$id}'."); } $_SESSION['itemname'] = $content['name']; -if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } ?> @@ -203,7 +203,7 @@ function openSelector(resource, mode, callback, w, h) { db->select("smd.id,COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) as name, + $ds = $modx->db->select("smd.id,COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) as name, CASE smd.type WHEN 10 THEN 'Chunk' WHEN 20 THEN 'Document' @@ -218,18 +218,18 @@ function openSelector(resource, mode, callback, w, h) { LEFT JOIN {$tbl_site_snippets} AS ss ON ss.id = smd.resource AND smd.type = '40' LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = '50' LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = '60'", "smd.module={$id}", "smd.type,name"); - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items - $grd->noRecordMsg = $_lang["no_records_found"]; - $grd->cssClass = "grid"; - $grd->columnHeaderClass = "gridHeader"; - $grd->itemClass = "gridItem"; - $grd->altItemClass = "gridAltItem"; - $grd->columns = $_lang["element_name"] . " ," . $_lang["type"]; - $grd->colTypes = "template: [+value+]"; - $grd->fields = "name,type"; - echo $grd->render(); - ?> + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items + $grd->noRecordMsg = $_lang["no_records_found"]; + $grd->cssClass = "grid"; + $grd->columnHeaderClass = "gridHeader"; + $grd->itemClass = "gridItem"; + $grd->altItemClass = "gridAltItem"; + $grd->columns = $_lang["element_name"] . " ," . $_lang["type"]; + $grd->colTypes = "template: [+value+]"; + $grd->fields = "name,type"; + echo $grd->render(); + ?> "> diff --git a/manager/actions/mutate_password.dynamic.php b/manager/actions/mutate_password.dynamic.php index f2483a4ddb..44ed413422 100755 --- a/manager/actions/mutate_password.dynamic.php +++ b/manager/actions/mutate_password.dynamic.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('change_password')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('change_password')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } ?> diff --git a/manager/actions/mutate_plugin.dynamic.php b/manager/actions/mutate_plugin.dynamic.php index 3fd35f4b3c..84c6b357b5 100755 --- a/manager/actions/mutate_plugin.dynamic.php +++ b/manager/actions/mutate_plugin.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } diff --git a/manager/actions/mutate_plugin_priority.dynamic.php b/manager/actions/mutate_plugin_priority.dynamic.php index 91756906a9..0811873b13 100755 --- a/manager/actions/mutate_plugin_priority.dynamic.php +++ b/manager/actions/mutate_plugin_priority.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_plugin')) { @@ -103,7 +103,7 @@ + ?> INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -switch ((int) $modx->manager->action) { - case 35: - if (!$modx->hasPermission('edit_role')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 38: - if (!$modx->hasPermission('new_role')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +switch((int) $modx->manager->action) { + case 35: + if(!$modx->hasPermission('edit_role')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 38: + if(!$modx->hasPermission('new_role')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $role = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; @@ -23,24 +23,24 @@ $tbl_user_roles = $modx->getFullTableName('user_roles'); // check to see the snippet editor isn't locked -if ($lockedEl = $modx->elementIsLocked(8, $role)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['role'])); +if($lockedEl = $modx->elementIsLocked(8, $role)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['role'])); } // end check for lock // Lock snippet for other users to edit $modx->lockElement(8, $role); -if ($modx->manager->action == '35') { - $rs = $modx->db->select('*', $tbl_user_roles, "id='{$role}'"); - $roledata = $modx->db->getRow($rs); - if (!$roledata) { - $modx->webAlertAndQuit("No role returned!"); - } - $_SESSION['itemname'] = $roledata['name']; +if($modx->manager->action == '35') { + $rs = $modx->db->select('*', $tbl_user_roles, "id='{$role}'"); + $roledata = $modx->db->getRow($rs); + if(!$roledata) { + $modx->webAlertAndQuit("No role returned!"); + } + $_SESSION['itemname'] = $roledata['name']; } else { - $roledata = 0; - $_SESSION['itemname'] = $_lang["new_role"]; + $roledata = 0; + $_SESSION['itemname'] = $_lang["new_role"]; } // Add lock-element JS-Script @@ -107,63 +107,63 @@ function changestate(element) {

    + echo render_form('frames', $_lang['role_frames'], 'disabled'); + echo render_form('home', $_lang['role_home'], 'disabled'); + echo render_form('messages', $_lang['role_messages']); + echo render_form('logout', $_lang['role_logout'], 'disabled'); + echo render_form('help', $_lang['role_help']); + echo render_form('action_ok', $_lang['role_actionok'], 'disabled'); + echo render_form('error_dialog', $_lang['role_errors'], 'disabled'); + echo render_form('about', $_lang['role_about'], 'disabled'); + echo render_form('credits', $_lang['role_credits'], 'disabled'); + echo render_form('change_password', $_lang['role_change_password']); + echo render_form('save_password', $_lang['role_save_password']); + ?>

    + echo render_form('view_document', $_lang['role_view_docdata'], 'disabled'); + echo render_form('new_document', $_lang['role_create_doc']); + echo render_form('edit_document', $_lang['role_edit_doc']); + echo render_form('change_resourcetype', $_lang['role_change_resourcetype']); + echo render_form('save_document', $_lang['role_save_doc']); + echo render_form('publish_document', $_lang['role_publish_doc']); + echo render_form('delete_document', $_lang['role_delete_doc']); + echo render_form('empty_trash', $_lang['role_empty_trash']); + echo render_form('empty_cache', $_lang['role_cache_refresh']); + echo render_form('view_unpublished', $_lang['role_view_unpublished']); + ?>

    + echo render_form('file_manager', $_lang['role_file_manager']); + echo render_form('assets_files', $_lang['role_assets_files']); + echo render_form('assets_images', $_lang['role_assets_images']); + ?>

    + echo render_form('category_manager', $_lang['role_category_manager']); + ?>

    + echo render_form('new_module', $_lang['role_new_module']); + echo render_form('edit_module', $_lang['role_edit_module']); + echo render_form('save_module', $_lang['role_save_module']); + echo render_form('delete_module', $_lang['role_delete_module']); + echo render_form('exec_module', $_lang['role_run_module']); + ?>
    @@ -173,44 +173,44 @@ function changestate(element) {

    + echo render_form('new_template', $_lang['role_create_template']); + echo render_form('edit_template', $_lang['role_edit_template']); + echo render_form('save_template', $_lang['role_save_template']); + echo render_form('delete_template', $_lang['role_delete_template']); + ?>

    + echo render_form('new_snippet', $_lang['role_create_snippet']); + echo render_form('edit_snippet', $_lang['role_edit_snippet']); + echo render_form('save_snippet', $_lang['role_save_snippet']); + echo render_form('delete_snippet', $_lang['role_delete_snippet']); + ?>

    + echo render_form('new_chunk', $_lang['role_create_chunk']); + echo render_form('edit_chunk', $_lang['role_edit_chunk']); + echo render_form('save_chunk', $_lang['role_save_chunk']); + echo render_form('delete_chunk', $_lang['role_delete_chunk']); + ?>

    + echo render_form('new_plugin', $_lang['role_create_plugin']); + echo render_form('edit_plugin', $_lang['role_edit_plugin']); + echo render_form('save_plugin', $_lang['role_save_plugin']); + echo render_form('delete_plugin', $_lang['role_delete_plugin']); + ?>
    @@ -220,42 +220,42 @@ function changestate(element) {

    + echo render_form('new_user', $_lang['role_new_user']); + echo render_form('edit_user', $_lang['role_edit_user']); + echo render_form('save_user', $_lang['role_save_user']); + echo render_form('delete_user', $_lang['role_delete_user']); + ?>

    + echo render_form('new_web_user', $_lang['role_new_web_user']); + echo render_form('edit_web_user', $_lang['role_edit_web_user']); + echo render_form('save_web_user', $_lang['role_save_web_user']); + echo render_form('delete_web_user', $_lang['role_delete_web_user']); + ?>

    + echo render_form('access_permissions', $_lang['role_access_persmissions']); + echo render_form('web_access_permissions', $_lang['role_web_access_persmissions']); + ?>

    + echo render_form('new_role', $_lang['role_new_role']); + echo render_form('edit_role', $_lang['role_edit_role']); + echo render_form('save_role', $_lang['role_save_role']); + echo render_form('delete_role', $_lang['role_delete_role']); + ?>
    @@ -265,23 +265,23 @@ function changestate(element) {

    + echo render_form('view_eventlog', $_lang['role_view_eventlog']); + echo render_form('delete_eventlog', $_lang['role_delete_eventlog']); + ?>

    + echo render_form('logs', $_lang['role_view_logs']); + echo render_form('settings', $_lang['role_edit_settings']); + echo render_form('bk_manager', $_lang['role_bk_manager']); + echo render_form('import_static', $_lang['role_import_static']); + echo render_form('export_static', $_lang['role_export_static']); + echo render_form('remove_locks', $_lang['role_remove_locks']); + echo render_form('display_locks', $_lang['role_display_locks']); + ?>
    @@ -299,35 +299,33 @@ function changestate(element) { * @param string $status * @return string */ -function render_form($name, $label, $status = '') -{ - $modx = evolutionCMS(); - global $roledata; +function render_form($name, $label, $status = '') { + $modx = evolutionCMS(); global $roledata; - $tpl = '
    - +
    @@ -124,15 +124,9 @@
    [(auto_template_logic)]

    -
    -
    -
    +
    +
    +
    @@ -141,17 +135,16 @@ db->getRecordCount( - $modx->db->select('id', '[+prefix+]site_plugins', + $modx->db->select('id', '[+prefix+]site_plugins', "plugincode LIKE '%phx.parser.class.inc.php%OnParseDocument();%' AND disabled != 1") ); - if ($count) { + if($count) { $disabledFilters = 1; - echo '' . $_lang['enable_filter_phx_warning'] . '
    '; - } else { - $disabledFilters = false; + echo ''.$_lang['enable_filter_phx_warning'].'
    '; } + else $disabledFilters = false; ?> -
    +
    @@ -159,7 +152,7 @@
    [(enable_at_syntax)] -
    +
    @@ -174,8 +167,8 @@
    [(publish_default)] -
    - +
    +
    @@ -183,24 +176,24 @@
    [(cache_default)] -
    - +
    +

    [(search_default)] -
    - +
    +

    [(auto_menuindex)] -
    - +
    +
    @@ -210,9 +203,9 @@ @@ -249,14 +242,14 @@ @@ -266,9 +259,10 @@ @@ -294,8 +288,8 @@ @@ -307,9 +301,7 @@ invokeEvent('OnSiteSettingsRender'); - if (is_array($evtOut)) { - echo implode("", $evtOut); - } + if(is_array($evtOut)) echo implode("",$evtOut); ?> diff --git a/manager/actions/mutate_settings/tab2_furl_settings.inc.php b/manager/actions/mutate_settings/tab2_furl_settings.inc.php index 526bc44333..2269244e37 100755 --- a/manager/actions/mutate_settings/tab2_furl_settings.inc.php +++ b/manager/actions/mutate_settings/tab2_furl_settings.inc.php @@ -6,7 +6,7 @@ @@ -20,7 +20,7 @@ @@ -56,8 +56,8 @@ > > @@ -71,8 +71,8 @@ > > @@ -86,8 +86,8 @@ > > @@ -101,8 +101,8 @@ > > @@ -115,8 +115,8 @@ > > @@ -129,8 +129,8 @@ > > @@ -143,8 +143,8 @@ > > @@ -159,9 +159,7 @@ invokeEvent('OnFriendlyURLSettingsRender'); - if (is_array($evtOut)) { - echo implode("", $evtOut); - } + if(is_array($evtOut)) echo implode("",$evtOut); ?> diff --git a/manager/actions/mutate_settings/tab3_user_settings.inc.php b/manager/actions/mutate_settings/tab3_user_settings.inc.php index 201b087a32..c190b78fb6 100755 --- a/manager/actions/mutate_settings/tab3_user_settings.inc.php +++ b/manager/actions/mutate_settings/tab3_user_settings.inc.php @@ -6,7 +6,7 @@ @@ -55,8 +55,8 @@ @@ -157,9 +157,7 @@ invokeEvent('OnUserSettingsRender'); - if (is_array($evtOut)) { - echo implode("", $evtOut); - } + if(is_array($evtOut)) echo implode("",$evtOut); ?> diff --git a/manager/actions/mutate_settings/tab4_manager_settings.inc.php b/manager/actions/mutate_settings/tab4_manager_settings.inc.php index 190c709708..4fac9f68b2 100755 --- a/manager/actions/mutate_settings/tab4_manager_settings.inc.php +++ b/manager/actions/mutate_settings/tab4_manager_settings.inc.php @@ -180,7 +180,7 @@ function SetUrl(url, width, height, alt) { @@ -194,7 +194,7 @@ function SetUrl(url, width, height, alt) { diff --git a/manager/actions/mutate_settings/tab5_security_settings.inc.php b/manager/actions/mutate_settings/tab5_security_settings.inc.php index 97d5143f15..78c039a8a3 100755 --- a/manager/actions/mutate_settings/tab5_security_settings.inc.php +++ b/manager/actions/mutate_settings/tab5_security_settings.inc.php @@ -1,6 +1,6 @@ @@ -89,10 +89,10 @@ @@ -103,11 +103,11 @@ +
    +
    +
    +
    +$modx->config['emailsender']));?> @@ -115,8 +115,8 @@ @@ -157,9 +157,7 @@ @@ -188,9 +186,7 @@ ?> @@ -230,9 +226,7 @@ invokeEvent('OnSecuritySettingsRender'); - if (is_array($evtOut)) { - echo implode("", $evtOut); - } + if(is_array($evtOut)) echo implode("",$evtOut); ?> diff --git a/manager/actions/mutate_settings/tab6_filemanager_settings.inc.php b/manager/actions/mutate_settings/tab6_filemanager_settings.inc.php index e38e020fb8..67a5059a2c 100755 --- a/manager/actions/mutate_settings/tab6_filemanager_settings.inc.php +++ b/manager/actions/mutate_settings/tab6_filemanager_settings.inc.php @@ -113,9 +113,7 @@ invokeEvent('OnFileManagerSettingsRender'); - if (is_array($evtOut)) { - echo implode("", $evtOut); - } + if(is_array($evtOut)) echo implode("",$evtOut); ?> diff --git a/manager/actions/mutate_settings/tab7_filebrowser_settings.inc.php b/manager/actions/mutate_settings/tab7_filebrowser_settings.inc.php index 198f385bad..2534a2de5d 100755 --- a/manager/actions/mutate_settings/tab7_filebrowser_settings.inc.php +++ b/manager/actions/mutate_settings/tab7_filebrowser_settings.inc.php @@ -6,7 +6,7 @@ @@ -235,9 +235,7 @@ invokeEvent('OnMiscSettingsRender'); - if (is_array($evtOut)) { - echo implode("", $evtOut); - } + if(is_array($evtOut)) echo implode("",$evtOut); ?> diff --git a/manager/actions/mutate_snippet.dynamic.php b/manager/actions/mutate_snippet.dynamic.php index 70bf425c41..75bd9b9c88 100755 --- a/manager/actions/mutate_snippet.dynamic.php +++ b/manager/actions/mutate_snippet.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } @@ -46,7 +46,7 @@ $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $content['properties'] = str_replace("&", "&", $content['properties']); -} elseif (isset($_REQUEST['itemname'])) { +} else if (isset($_REQUEST['itemname'])) { $content['name'] = $_REQUEST['itemname']; } else { $_SESSION['itemname'] = $_lang["new_snippet"]; diff --git a/manager/actions/mutate_template_tv_rank.dynamic.php b/manager/actions/mutate_template_tv_rank.dynamic.php index d0933b3a01..70518f964d 100755 --- a/manager/actions/mutate_template_tv_rank.dynamic.php +++ b/manager/actions/mutate_template_tv_rank.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_template')) { @@ -137,7 +137,7 @@ function resetSortOrder()
    + ?>

    diff --git a/manager/actions/mutate_templates.dynamic.php b/manager/actions/mutate_templates.dynamic.php index 8dc46bb62e..4b46fa9ac0 100755 --- a/manager/actions/mutate_templates.dynamic.php +++ b/manager/actions/mutate_templates.dynamic.php @@ -1,21 +1,21 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -switch ($modx->manager->action) { - case 16: - if (!$modx->hasPermission('edit_template')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 19: - if (!$modx->hasPermission('new_template')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +switch($modx->manager->action) { + case 16: + if(!$modx->hasPermission('edit_template')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 19: + if(!$modx->hasPermission('new_template')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; @@ -23,8 +23,8 @@ $tbl_site_templates = $modx->getFullTableName('site_templates'); // check to see the snippet editor isn't locked -if ($lockedEl = $modx->elementIsLocked(1, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['template'])); +if($lockedEl = $modx->elementIsLocked(1, $id)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['template'])); } // end check for lock @@ -32,24 +32,24 @@ $modx->lockElement(1, $id); $content = array(); -if (!empty($id)) { - $rs = $modx->db->select('*', $tbl_site_templates, "id='{$id}'"); - $content = $modx->db->getRow($rs); - if (!$content) { - $modx->webAlertAndQuit("No database record has been found for this template."); - } - - $_SESSION['itemname'] = $content['templatename']; - if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } +if(!empty($id)) { + $rs = $modx->db->select('*', $tbl_site_templates, "id='{$id}'"); + $content = $modx->db->getRow($rs); + if(!$content) { + $modx->webAlertAndQuit("No database record has been found for this template."); + } + + $_SESSION['itemname'] = $content['templatename']; + if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } } else { - $_SESSION['itemname'] = $_lang["new_template"]; - $content['category'] = (int)$_REQUEST['catid']; + $_SESSION['itemname'] = $_lang["new_template"]; + $content['category'] = (int)$_REQUEST['catid']; } -if ($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); +if($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); } $content = array_merge($content, $_POST); @@ -98,12 +98,12 @@
    invokeEvent("OnTempFormPrerender", array("id" => $id)); - if (is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> + // invoke OnTempFormPrerender event + $evtOut = $modx->invokeEvent("OnTempFormPrerender", array("id" => $id)); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> @@ -132,14 +132,14 @@

    - hasPermission('save_role')): ?> + hasPermission('save_role')): ?>
    @@ -177,7 +177,7 @@
    - hasPermission('save_role')): ?> + hasPermission('save_role')): ?>
    @@ -197,38 +197,38 @@ db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category", $_lang['no_category']), sprintf("%s tv + $selectedTvs = array(); + if(!isset($_POST['assignedTv'])) { + $rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category", $_lang['no_category']), sprintf("%s tv LEFT JOIN %s tr ON tv.id=tr.tmplvarid LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "templateid='{$id}'", "tr.rank DESC, tv.rank DESC, tvcaption DESC, tvid DESC" // workaround for correct sort of none-existing ranks - ); - while ($row = $modx->db->getRow($rs)) { - $selectedTvs[$row['tvid']] = $row; - } - $selectedTvs = array_reverse($selectedTvs, true); // reverse ORDERBY DESC - } - - $unselectedTvs = array(); - $rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category, cat.id as catid", $_lang['no_category']), sprintf("%s tv + ); + while($row = $modx->db->getRow($rs)) { + $selectedTvs[$row['tvid']] = $row; + } + $selectedTvs = array_reverse($selectedTvs, true); // reverse ORDERBY DESC + } + + $unselectedTvs = array(); + $rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category, cat.id as catid", $_lang['no_category']), sprintf("%s tv LEFT JOIN %s tr ON tv.id=tr.tmplvarid LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "", "category, tvcaption"); - while ($row = $modx->db->getRow($rs)) { - $unselectedTvs[$row['tvid']] = $row; - } - - // Catch checkboxes if form not validated - if (isset($_POST['assignedTv'])) { - $selectedTvs = array(); - foreach ($_POST['assignedTv'] as $tvid) { - if (isset($unselectedTvs[$tvid])) { - $selectedTvs[$tvid] = $unselectedTvs[$tvid]; - } - }; - } - - $total = count($selectedTvs); - ?> + while($row = $modx->db->getRow($rs)) { + $unselectedTvs[$row['tvid']] = $row; + } + + // Catch checkboxes if form not validated + if(isset($_POST['assignedTv'])) { + $selectedTvs = array(); + foreach($_POST['assignedTv'] as $tvid) { + if(isset($unselectedTvs[$tvid])) { + $selectedTvs[$tvid] = $unselectedTvs[$tvid]; + } + }; + } + + $total = count($selectedTvs); + ?>
    @@ -238,64 +238,65 @@
    0) { - echo '

    ' . $_lang['template_tv_msg'] . '

    '; - } - if ($modx->hasPermission('save_template') && $total > 1 && $id) { - echo sprintf('', $id, $_lang['template_tv_edit']); - } - - // Selected TVs - $tvList = ''; - if ($total > 0) { - $tvList .= '
      '; - foreach ($selectedTvs as $row) { - $desc = !empty($row['tvdescription']) ? '  (' . $row['tvdescription'] . ')' : ''; - $locked = $row['tvlocked'] ? ' (' . $_lang['locked'] . ')' : ""; - $tvList .= sprintf('
    • %s %s
    • ', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); - } - $tvList .= '
    '; - } else { - echo $_lang['template_no_tv']; - } - echo $tvList; - - // Unselected TVs - $tvList = '

    ' . $_lang['template_notassigned_tv'] . '

      '; - $preCat = ''; - $insideUl = 0; - while ($row = array_shift($unselectedTvs)) { - if (isset($selectedTvs[$row['tvid']])) { - continue; - } // Skip selected - $row['category'] = stripslashes($row['category']); //pixelchutes - if ($preCat !== $row['category']) { - $tvList .= $insideUl ? '
    ' : ''; - $tvList .= '
  • ' . $row['category'] . ($row['catid'] != '' ? ' (' . $row['catid'] . ')' : '') . '
      '; - $insideUl = 1; - } - - $desc = !empty($row['tvdescription']) ? '  (' . $row['tvdescription'] . ')' : ''; - $locked = $row['tvlocked'] ? ' (' . $_lang['locked'] . ')' : ""; - $tvList .= sprintf('
    • %s %s
    • ', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); - $tvList .= ''; - - $preCat = $row['category']; - } - $tvList .= $insideUl ? '
    ' : ''; - $tvList .= ''; - echo $tvList; - - ?> + if($total > 0) { + echo '

    ' . $_lang['template_tv_msg'] . '

    '; + } + if($modx->hasPermission('save_template') && $total > 1 && $id) { + echo sprintf('', $id, $_lang['template_tv_edit']); + } + + // Selected TVs + $tvList = ''; + if($total > 0) { + $tvList .= '
      '; + foreach($selectedTvs as $row) { + $desc = !empty($row['tvdescription']) ? '  (' . $row['tvdescription'] . ')' : ''; + $locked = $row['tvlocked'] ? ' (' . $_lang['locked'] . ')' : ""; + $tvList .= sprintf('
    • %s %s
    • ', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); + } + $tvList .= '
    '; + + } else { + echo $_lang['template_no_tv']; + } + echo $tvList; + + // Unselected TVs + $tvList = '

    ' . $_lang['template_notassigned_tv'] . '

      '; + $preCat = ''; + $insideUl = 0; + while($row = array_shift($unselectedTvs)) { + if(isset($selectedTvs[$row['tvid']])) { + continue; + } // Skip selected + $row['category'] = stripslashes($row['category']); //pixelchutes + if($preCat !== $row['category']) { + $tvList .= $insideUl ? '
    ' : ''; + $tvList .= '
  • ' . $row['category'] . ($row['catid'] != '' ? ' (' . $row['catid'] . ')' : '') . '
      '; + $insideUl = 1; + } + + $desc = !empty($row['tvdescription']) ? '  (' . $row['tvdescription'] . ')' : ''; + $locked = $row['tvlocked'] ? ' (' . $_lang['locked'] . ')' : ""; + $tvList .= sprintf('
    • %s %s
    • ', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); + $tvList .= ''; + + $preCat = $row['category']; + } + $tvList .= $insideUl ? '
    ' : ''; + $tvList .= ''; + echo $tvList; + + ?>
  • invokeEvent("OnTempFormRender", array("id" => $id)); - if (is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> + // invoke OnTempFormRender event + $evtOut = $modx->invokeEvent("OnTempFormRender", array("id" => $id)); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> diff --git a/manager/actions/mutate_tmplvars.dynamic.php b/manager/actions/mutate_tmplvars.dynamic.php index bc780011c8..895b0e125a 100755 --- a/manager/actions/mutate_tmplvars.dynamic.php +++ b/manager/actions/mutate_tmplvars.dynamic.php @@ -1,17 +1,17 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('edit_template') && $modx->manager->action == '301') { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('edit_template') && $modx->manager->action == '301') { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } -if (!$modx->hasPermission('new_template') && $modx->manager->action == '300') { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('new_template') && $modx->manager->action == '300') { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; $origin = isset($_REQUEST['or']) ? (int)$_REQUEST['or'] : 76; -$originId = isset($_REQUEST['oid']) ? (int)$_REQUEST['oid'] : null; +$originId = isset($_REQUEST['oid']) ? (int)$_REQUEST['oid'] : NULL; $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); $tbl_site_templates = $modx->getFullTableName('site_templates'); @@ -19,8 +19,8 @@ $tbl_documentgroup_names = $modx->getFullTableName('documentgroup_names'); // check to see the snippet editor isn't locked -if ($lockedEl = $modx->elementIsLocked(2, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar'])); +if($lockedEl = $modx->elementIsLocked(2, $id)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar'])); } // end check for lock @@ -29,26 +29,26 @@ global $content; $content = array(); -if (isset($_GET['id'])) { - $rs = $modx->db->select('*', $tbl_site_tmplvars, "id='{$id}'"); - $content = $modx->db->getRow($rs); - if (!$content) { - header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}"); - } - - $_SESSION['itemname'] = $content['caption']; - if ($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } -} elseif (isset($_REQUEST['itemname'])) { - $content['name'] = $_REQUEST['itemname']; +if(isset($_GET['id'])) { + $rs = $modx->db->select('*', $tbl_site_tmplvars, "id='{$id}'"); + $content = $modx->db->getRow($rs); + if(!$content) { + header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}"); + } + + $_SESSION['itemname'] = $content['caption']; + if($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } +} else if(isset($_REQUEST['itemname'])) { + $content['name'] = $_REQUEST['itemname']; } else { - $_SESSION['itemname'] = $_lang["new_tmplvars"]; - $content['category'] = (int)$_REQUEST['catid']; + $_SESSION['itemname'] = $_lang["new_tmplvars"]; + $content['category'] = (int)$_REQUEST['catid']; } -if ($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); +if($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); } $content = array_merge($content, $_POST); @@ -61,8 +61,8 @@ // get available RichText Editors $RTEditors = ''; $evtOut = $modx->invokeEvent('OnRichTextEditorRegister', array('forfrontend' => 1)); -if (is_array($evtOut)) { - $RTEditors = implode(',', $evtOut); +if(is_array($evtOut)) { + $RTEditors = implode(',', $evtOut); } ?> @@ -277,12 +277,12 @@ function decode(s) { invokeEvent('OnTVFormPrerender', array('id' => $id)); - if (is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> + // invoke OnTVFormPrerender event + $evtOut = $modx->invokeEvent('OnTVFormPrerender', array('id' => $id)); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> @@ -314,7 +314,7 @@ function decode(s) {
    - hasPermission('save_role')): ?> + hasPermission('save_role')): ?>
    @@ -383,14 +383,14 @@ function decode(s) { ' . $ctv . ''; - } - } - ?> + $custom_tvs = scandir(MODX_BASE_PATH . 'assets/tvs'); + foreach($custom_tvs as $ctv) { + if(strpos($ctv, '.') !== 0 && $ctv != 'index.html') { + $selected = ($content['type'] == 'custom_tv:' . $ctv ? "selected='selected'" : ""); + echo ''; + } + } + ?> @@ -455,63 +455,64 @@ function decode(s) { db->select(sprintf("tpl.id AS id, templatename, tpl.description AS tpldescription, tpl.locked AS tpllocked, tpl.selectable AS selectable, tmplvarid, if(isnull(cat.category),'%s',cat.category) AS category, cat.id AS catid", $_lang['no_category']), sprintf("%s as tpl + $rs = $modx->db->select(sprintf("tpl.id AS id, templatename, tpl.description AS tpldescription, tpl.locked AS tpllocked, tpl.selectable AS selectable, tmplvarid, if(isnull(cat.category),'%s',cat.category) AS category, cat.id AS catid", $_lang['no_category']), sprintf("%s as tpl LEFT JOIN %s as stt ON stt.templateid=tpl.id AND stt.tmplvarid='%s' LEFT JOIN %s as cat ON tpl.category=cat.id", $modx->getFullTableName('site_templates'), $modx->getFullTableName('site_tmplvar_templates'), $id, $modx->getFullTableName('categories')), '', "category, templatename"); - $tplList = '
      '; - $preCat = ''; - $insideUl = 0; - while ($row = $modx->db->getRow($rs)) { - $row['category'] = stripslashes($row['category']); //pixelchutes - if ($preCat !== $row['category']) { - $tplList .= $insideUl ? '
    ' : ''; - $tplList .= '
  • ' . $row['category'] . ($row['catid'] != '' ? ' (' . $row['catid'] . ')' : '') . '
      '; - $insideUl = 1; - } - - if ($modx->manager->action == '300' && $modx->config['default_template'] == $row['id']) { - $checked = true; - } elseif (isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) { - $checked = true; - } elseif ($id == 0 && is_array($_POST['template'])) { - $checked = in_array($row['id'], $_POST['template']); - } else { - $checked = $row['tmplvarid']; - } - $selectable = !$row['selectable'] ? ' class="disabled"' : ''; - $checked = $checked ? ' checked="checked"' : ''; - $tplId = ' (' . $row['id'] . ')'; - $desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : ''; - - $tplInfo = array(); - if ($row['tpllocked']) { - $tplInfo[] = $_lang['locked']; - } - if ($row['id'] == $modx->config['default_template']) { - $tplInfo[] = $_lang['defaulttemplate_title']; - } - $tplInfo = !empty($tplInfo) ? ' (' . implode(', ', $tplInfo) . ')' : ''; - - $tplList .= sprintf('
    • %s%s%s%s
    • ', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo); - $tplList .= ''; - - $preCat = $row['category']; - } - $tplList .= $insideUl ? '
    ' : ''; - $tplList .= ''; - echo $tplList; - - ?> + $tplList = '
      '; + $preCat = ''; + $insideUl = 0; + while($row = $modx->db->getRow($rs)) { + $row['category'] = stripslashes($row['category']); //pixelchutes + if($preCat !== $row['category']) { + $tplList .= $insideUl ? '
    ' : ''; + $tplList .= '
  • ' . $row['category'] . ($row['catid'] != '' ? ' (' . $row['catid'] . ')' : '') . '
      '; + $insideUl = 1; + } + + if($modx->manager->action == '300' && $modx->config['default_template'] == $row['id']) { + $checked = true; + } elseif(isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) { + $checked = true; + } elseif($id == 0 && is_array($_POST['template'])) { + $checked = in_array($row['id'], $_POST['template']); + } else { + $checked = $row['tmplvarid']; + } + $selectable = !$row['selectable'] ? ' class="disabled"' : ''; + $checked = $checked ? ' checked="checked"' : ''; + $tplId = ' (' . $row['id'] . ')'; + $desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : ''; + + $tplInfo = array(); + if($row['tpllocked']) { + $tplInfo[] = $_lang['locked']; + } + if($row['id'] == $modx->config['default_template']) { + $tplInfo[] = $_lang['defaulttemplate_title']; + } + $tplInfo = !empty($tplInfo) ? ' (' . implode(', ', $tplInfo) . ')' : ''; + + $tplList .= sprintf('
    • %s%s%s%s
    • ', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo); + $tplList .= ''; + + $preCat = $row['category']; + } + $tplList .= $insideUl ? '
    ' : ''; + $tplList .= ''; + echo $tplList; + + ?> db->select('documentgroup', $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); - $groupsarray = $modx->db->getColumn('documentgroup', $rs); ?> - hasPermission('access_permissions')) { - ?> + if($use_udperms == 1) { + // fetch permissions for the variable + $rs = $modx->db->select('documentgroup', $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); + $groupsarray = $modx->db->getColumn('documentgroup', $rs); + + ?> + hasPermission('access_permissions')) { ?> diff --git a/manager/actions/mutate_tv_rank.dynamic.php b/manager/actions/mutate_tv_rank.dynamic.php index ce8500f81d..46dd598245 100755 --- a/manager/actions/mutate_tv_rank.dynamic.php +++ b/manager/actions/mutate_tv_rank.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_template')) { @@ -130,7 +130,7 @@ function resetSortOrder()
    + ?>

    diff --git a/manager/actions/mutate_user.dynamic.php b/manager/actions/mutate_user.dynamic.php index e69de29bb2..3adfcde70d 100755 --- a/manager/actions/mutate_user.dynamic.php +++ b/manager/actions/mutate_user.dynamic.php @@ -0,0 +1,1601 @@ +<<<<<<< HEAD +INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +} + +switch($modx->manager->action) { + case 12: + if(!$modx->hasPermission('edit_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 11: + if(!$modx->hasPermission('new_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); +} + +$user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; + +// check to see the snippet editor isn't locked +$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); +if($username = $modx->db->getValue($rs)) { + $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user")); +} +// end check for lock + +if($modx->manager->action == '12') { + // get user attribute + $rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'"); + $userdata = $modx->db->getRow($rs); + if(!$userdata) { + $modx->webAlertAndQuit("No user returned!"); + } + + + // get user settings + $rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'"); + $usersettings = array(); + while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; + // manually extract so that user display settings are not overwritten + foreach($usersettings as $k => $v) { + if($k != 'manager_language' && $k != 'manager_theme') { + ${$k} = $v; + } + } + + // get user name + $rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'"); + $usernamedata = $modx->db->getRow($rs); + if(!$usernamedata) { + $modx->webAlertAndQuit("No user returned while getting username!"); + } + $_SESSION['itemname'] = $usernamedata['username']; +} else { + $userdata = array(); + $usersettings = array(); + $usernamedata = array(); + $_SESSION['itemname'] = $_lang["new_user"]; +} + +// avoid doubling htmlspecialchars (already encoded in DB) +foreach($userdata as $key => $val) { + $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); +}; +$usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); + +// restore saved form +$formRestored = false; +if($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); + // restore post values + $userdata = array_merge($userdata, $_POST); + $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); + $usernamedata['username'] = $userdata['newusername']; + $usernamedata['oldusername'] = $_POST['oldusername']; + $usersettings = array_merge($usersettings, $userdata); + $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; + extract($usersettings, EXTR_OVERWRITE); +} + +// include the country list language file +$_country_lang = array(); +include_once "lang/country/english_country.inc.php"; +if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { + include_once "lang/country/" . $manager_language . "_country.inc.php"; +} +asort($_country_lang); + +$displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; +if($which_browser == 'default') { + $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser']; +} +?> + + + + invokeEvent("OnUserFormPrerender", array( + "id" => $user + )); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> + + + " /> + +

    + (' . $usernamedata['id'] . ')' : $_lang['user_title']) ?> +

    + + + + +
    + +
    + +
    +

    + +
  • @@ -240,7 +233,7 @@

    [(enable_cache)]
    -
    +


    [(cache_type)]
    -
    +

    [(minifyphp_incache)]
    -
    +

    [(server_offset_time)]

    [(server_protocol)]
    -
    +

    [(track_visitors)]
    -
    - +
    +

    [(friendly_urls)]
    -
    +

    [(xhtml_urls)]
    -
    +

    [(make_folders)]
    -
    - +
    +

    [(seostrict)]
    -
    - +
    +

    [(aliaslistingfolder)]
    -
    - +
    +

    [(friendly_alias_urls)]
    -
    - +
    +

    [(use_alias_path)]
    -
    - +
    +

    [(allow_duplicate_alias)]
    -
    - +
    +

    [(automatic_alias)]
    -
    - +
    +

    [(use_udperms)]
    -
    +

    [(email_method)]
    -
    - +
    +
    >
    @@ -144,8 +144,8 @@

    [(allow_multiple_emails)]
    -
    - +
    +

    [(login_form_position)]
    -
    +


    [(manager_menu_position)]
    -
    +


    [(allow_eval)]
    -
    -
    -
    - +
    +
    +
    +
    @@ -53,7 +53,7 @@

    [(validate_referer)]
    -
    +

    [(error_reporting)]
    -
    -
    -
    - +
    +
    +
    +

    [(send_errormail)]
    -
    -
    -
    -
    -$modx->config['emailsender']));?>

    [(enable_bindings)]
    -
    - +
    +

    [(pwd_hash_algo)]
    manager->checkHashAlgorithm('BLOWFISH_Y') ? 0:1; $phm['e']['BLOWFISH_A'] = $modx->manager->checkHashAlgorithm('BLOWFISH_A') ? 0:1; $phm['e']['SHA512'] = $modx->manager->checkHashAlgorithm('SHA512') ? 0:1; @@ -167,12 +165,12 @@ $phm['e']['MD5'] = $modx->manager->checkHashAlgorithm('MD5') ? 0:1; $phm['e']['UNCRYPT'] = $modx->manager->checkHashAlgorithm('UNCRYPT') ? 0:1; ?> -
    -
    -
    -
    -
    - +
    +
    +
    +
    +
    +

    [(use_captcha)]

    [(use_browser)]
    -
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + manager->action == '12') { ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?> + + + +
    "> htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?> - + +
    : 
    manager->action == '11' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?> manager->action == "11" ? " checked disabled" : ""; ?>> + " onChange="documentDirty=true;" /> +
    + " id="passwordBlock"> +
    + + /> + +
    + > + +
    +
    + + +
    + + +
    +
    +
    +
    +
    + + /> + +
    + /> + +
    +
    : 
    :  +
    : db->select('name, id', '[+prefix+]user_roles', ($modx->hasPermission('save_role')) ? '' : 'id != 1'); + ?> +
    : 
    : 
    : 
    : 
    : 
    : 
    : 
    : 
    : " onBlur='documentDirty=true;'> + " data-tooltip="">
    : 
    : 
    : 
    : toDateFormat($userdata['lastlogin'] + $server_offset_time) ?>
    :  +    []
    :  time() && $userdata['blockeduntil'] != 0)) ? " checked" : ""; ?>> +
    : " onBlur='documentDirty=true;' readonly> + " data-tooltip="">
    : " onBlur='documentDirty=true;' readonly> + " data-tooltip="">
    + getLoginUserID()) { ?> +

    + +
    + + +
    +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
     
     
    /> + +
    + /> +
     
     
    +
    + +
    + +
    + +
    + +
    + +
    + +
     
    +
     

    + [(manager_theme_mode)] +
    + +
    + + +
    + +
    + +
    + +
     
    ">
     
    "> +    + /> + +
     
    "> +    + /> + +
     
    "> +    + /> + +
     
    "> +    + /> + +
     
    ">
     
     
    " />
     
    " />
     
    " />
     
    + invokeEvent("OnInterfaceSettingsRender"); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> +
    + + +
    +

    + + + + + + + + + + + + + + +
    +
     
    +
    + manager->action == '12') { // only do this bit if the user is being edited + $rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'"); + $groupsarray = $modx->db->getColumn('user_group', $rs); + } + // retain selected doc groups between post + if(is_array($_POST['user_groups'])) { + foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; + } + ?> +
    +

    + +

    + db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name'); + while($row = $modx->db->getRow($rs)) { + echo "
    "; + } + } + ?> +
    + + + + invokeEvent("OnUserFormRender", array( + "id" => $user + )); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> + +======= +INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +} + +switch($modx->manager->action) { + case 12: + if(!$modx->hasPermission('edit_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 11: + if(!$modx->hasPermission('new_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); +} + +$user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; + +// check to see the snippet editor isn't locked +$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); +if($username = $modx->db->getValue($rs)) { + $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user")); +} +// end check for lock + +if($modx->manager->action == '12') { + // get user attribute + $rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'"); + $userdata = $modx->db->getRow($rs); + if(!$userdata) { + $modx->webAlertAndQuit("No user returned!"); + } + + + // get user settings + $rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'"); + $usersettings = array(); + while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; + // manually extract so that user display settings are not overwritten + foreach($usersettings as $k => $v) { + if($k != 'manager_language' && $k != 'manager_theme') { + ${$k} = $v; + } + } + + // get user name + $rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'"); + $usernamedata = $modx->db->getRow($rs); + if(!$usernamedata) { + $modx->webAlertAndQuit("No user returned while getting username!"); + } + $_SESSION['itemname'] = $usernamedata['username']; +} else { + $userdata = array(); + $usersettings = array(); + $usernamedata = array(); + $_SESSION['itemname'] = $_lang["new_user"]; +} + +// avoid doubling htmlspecialchars (already encoded in DB) +foreach($userdata as $key => $val) { + $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); +}; +$usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); + +// restore saved form +$formRestored = false; +if($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); + // restore post values + $userdata = array_merge($userdata, $_POST); + $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); + $usernamedata['username'] = $userdata['newusername']; + $usernamedata['oldusername'] = $_POST['oldusername']; + $usersettings = array_merge($usersettings, $userdata); + $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; + extract($usersettings, EXTR_OVERWRITE); +} + +// include the country list language file +$_country_lang = array(); +include_once "lang/country/english_country.inc.php"; +if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { + include_once "lang/country/" . $manager_language . "_country.inc.php"; +} +asort($_country_lang); + +$displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; +if($which_browser == 'default') { + $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser']; +} +?> + + +
    + invokeEvent("OnUserFormPrerender", array( + "id" => $user + )); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> + + + " /> + +

    + (' . $usernamedata['id'] . ')' : $_lang['user_title']) ?> +

    + + + + +
    + +
    + +
    +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + manager->action == '12') { ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?> + + + +
    "> htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?> - + +
    : 
    manager->action == '11' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?> manager->action == "11" ? " checked disabled" : ""; ?>> + " onChange="documentDirty=true;" /> +
    + " id="passwordBlock"> +
    + + /> + +
    + > + +
    +
    + + +
    + + +
    +
    +
    +
    +
    + + /> + +
    + /> + +
    +
    : 
    :  +
    : db->select('name, id', '[+prefix+]user_roles', ($modx->hasPermission('save_role')) ? '' : 'id != 1'); + ?> +
    : 
    : 
    : 
    : 
    : 
    : 
    : 
    : 
    : " onBlur='documentDirty=true;'> + " data-tooltip="">
    : 
    : 
    : 
    : toDateFormat($userdata['lastlogin'] + $server_offset_time) ?>
    :  +    []
    :  time() && $userdata['blockeduntil'] != 0)) ? " checked" : ""; ?>> +
    : " onBlur='documentDirty=true;' readonly> + " data-tooltip="">
    : " onBlur='documentDirty=true;' readonly> + " data-tooltip="">
    + getLoginUserID()) { ?> +

    + +
    + + +
    +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
     
     
    /> + +
    + /> +
     
     
    +
    + +
    + +
    + +
    + +
    + +
    + +
     
    +
     

    + [(manager_theme_mode)] +
    + +
    + + +
    + +
    + +
    + +
     
    ">
     
    "> +    + /> + +
     
    "> +    + /> + +
     
    "> +    + /> + +
     
    "> +    + /> + +
     
    ">
     
     
    " />
     
    " />
     
    " />
     
    + invokeEvent("OnInterfaceSettingsRender"); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> +
    + + +
    +

    + + + + + + + + + + + + + + +
    +
     
    +
    + manager->action == '12') { // only do this bit if the user is being edited + $rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'"); + $groupsarray = $modx->db->getColumn('user_group', $rs); + } + // retain selected doc groups between post + if(is_array($_POST['user_groups'])) { + foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; + } + ?> +
    +

    + +

    + db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name'); + while($row = $modx->db->getRow($rs)) { + echo "
    "; + } + } + ?> +
    +
    +
    + + invokeEvent("OnUserFormRender", array( + "id" => $user + )); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> +
    +>>>>>>> parent of c061fce27... vendor/bin/php-cs-fixer fix diff --git a/manager/actions/mutate_web_user.dynamic.php b/manager/actions/mutate_web_user.dynamic.php index 1c2dc7103e..c070b64b76 100755 --- a/manager/actions/mutate_web_user.dynamic.php +++ b/manager/actions/mutate_web_user.dynamic.php @@ -1,21 +1,21 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -switch ($modx->manager->action) { - case 88: - if (!$modx->hasPermission('edit_web_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 87: - if (!$modx->hasPermission('new_web_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +switch($modx->manager->action) { + case 88: + if(!$modx->hasPermission('edit_web_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 87: + if(!$modx->hasPermission('new_web_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; @@ -23,67 +23,65 @@ // check to see the snippet editor isn't locked $rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); -if ($username = $modx->db->getValue($rs)) { - $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user")); +if($username = $modx->db->getValue($rs)) { + $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user")); } // end check for lock -if ($modx->manager->action == '88') { - // get user attributes - $rs = $modx->db->select('*', $modx->getFullTableName('web_user_attributes'), "internalKey = '{$user}'"); - $userdata = $modx->db->getRow($rs); - if (!$userdata) { - $modx->webAlertAndQuit("No user returned!"); - } - - // get user settings - $rs = $modx->db->select('*', $modx->getFullTableName('web_user_settings'), "webuser = '{$user}'"); - $usersettings = array(); - while ($row = $modx->db->getRow($rs)) { - $usersettings[$row['setting_name']] = $row['setting_value']; - } - extract($usersettings, EXTR_OVERWRITE); - - // get user name - $rs = $modx->db->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'"); - $usernamedata = $modx->db->getRow($rs); - if (!$usernamedata) { - $modx->webAlertAndQuit("No user returned while getting username!"); - } - $_SESSION['itemname'] = $usernamedata['username']; +if($modx->manager->action == '88') { + // get user attributes + $rs = $modx->db->select('*', $modx->getFullTableName('web_user_attributes'), "internalKey = '{$user}'"); + $userdata = $modx->db->getRow($rs); + if(!$userdata) { + $modx->webAlertAndQuit("No user returned!"); + } + + // get user settings + $rs = $modx->db->select('*', $modx->getFullTableName('web_user_settings'), "webuser = '{$user}'"); + $usersettings = array(); + while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; + extract($usersettings, EXTR_OVERWRITE); + + // get user name + $rs = $modx->db->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'"); + $usernamedata = $modx->db->getRow($rs); + if(!$usernamedata) { + $modx->webAlertAndQuit("No user returned while getting username!"); + } + $_SESSION['itemname'] = $usernamedata['username']; } else { - $userdata = array(); - $usersettings = array(); - $usernamedata = array(); - $_SESSION['itemname'] = $_lang["new_web_user"]; + $userdata = array(); + $usersettings = array(); + $usernamedata = array(); + $_SESSION['itemname'] = $_lang["new_web_user"]; } // avoid doubling htmlspecialchars (already encoded in DB) -foreach ($userdata as $key => $val) { - $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); +foreach($userdata as $key => $val) { + $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); }; $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); // restore saved form $formRestored = false; -if ($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); - // restore post values - $userdata = array_merge($userdata, $_POST); - $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); - $usernamedata['username'] = $userdata['newusername']; - $usernamedata['oldusername'] = $_POST['oldusername']; - $usersettings = array_merge($usersettings, $userdata); - $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; - extract($usersettings, EXTR_OVERWRITE); +if($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); + // restore post values + $userdata = array_merge($userdata, $_POST); + $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); + $usernamedata['username'] = $userdata['newusername']; + $usernamedata['oldusername'] = $_POST['oldusername']; + $usersettings = array_merge($usersettings, $userdata); + $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; + extract($usersettings, EXTR_OVERWRITE); } // include the country list language file $_country_lang = array(); -if ($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { - include_once "lang/country/" . $manager_language . "_country.inc.php"; +if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { + include_once "lang/country/" . $manager_language . "_country.inc.php"; } else { - include_once "lang/country/english_country.inc.php"; + include_once "lang/country/english_country.inc.php"; } asort($_country_lang); @@ -191,12 +189,12 @@ function showHide(what, onoff) {
    invokeEvent("OnWUsrFormPrerender", array("id" => $user)); - if (is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> + // invoke OnWUsrFormPrerender event + $evtOut = $modx->invokeEvent("OnWUsrFormPrerender", array("id" => $user)); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> " /> @@ -220,23 +218,19 @@ function showHide(what, onoff) { - + - + @@ -330,10 +324,10 @@ function showHide(what, onoff) { $country) { - echo ""; - } - ?> + foreach($_country_lang as $key => $country) { + echo ""; + } + ?> @@ -357,8 +351,7 @@ function showHide(what, onoff) { - manager->action == '88') { - ?> + manager->action == '88') { ?> @@ -394,8 +387,8 @@ function showHide(what, onoff) { " data-tooltip=""> + } + ?>
    - time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) { - ?> + time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) { ?> - +
    "> htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?> -
    :  
     
    :  
    @@ -503,40 +496,40 @@ function SetUrl(url, width, height, alt) { manager->action == '88') { // only do this bit if the user is being edited - $rs = $modx->db->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'"); - $groupsarray = $modx->db->getColumn('webgroup', $rs); - } - // retain selected user groups between post - if (is_array($_POST['user_groups'])) { - foreach ($_POST['user_groups'] as $n => $v) { - $groupsarray[] = $v; - } - } ?> + if($use_udperms == 1) { + + $groupsarray = array(); + + if($modx->manager->action == '88') { // only do this bit if the user is being edited + $rs = $modx->db->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'"); + $groupsarray = $modx->db->getColumn('webgroup', $rs); + } + // retain selected user groups between post + if(is_array($_POST['user_groups'])) { + foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; + } + ?>

    db->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name'); - while ($row = $modx->db->getRow($rs)) { - echo '
    '; - } - } - ?> + $rs = $modx->db->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name'); + while($row = $modx->db->getRow($rs)) { + echo '
    '; + } + } + ?>
    invokeEvent("OnWUsrFormRender", array( - "id" => $user - )); - if (is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> + // invoke OnWUsrFormRender event + $evtOut = $modx->invokeEvent("OnWUsrFormRender", array( + "id" => $user + )); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> diff --git a/manager/actions/phpinfo.static.php b/manager/actions/phpinfo.static.php index 1bc0356c99..5729512f85 100755 --- a/manager/actions/phpinfo.static.php +++ b/manager/actions/phpinfo.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } ?> diff --git a/manager/actions/refresh_site.dynamic.php b/manager/actions/refresh_site.dynamic.php index 0ec740137f..a73ea46e2b 100755 --- a/manager/actions/refresh_site.dynamic.php +++ b/manager/actions/refresh_site.dynamic.php @@ -1,6 +1,6 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } // (un)publishing of documents, version 2! @@ -29,16 +29,12 @@
    - ' . $_lang["refresh_published"] . '

    ', $num_rows_pub); -} ?> - ' . $_lang["refresh_unpublished"] . '

    ', $num_rows_unpub); -} ?> + ' . $_lang["refresh_published"] . '

    ', $num_rows_pub) ?> + ' . $_lang["refresh_unpublished"] . '

    ', $num_rows_unpub) ?> clearCache('full', true); - // invoke OnSiteRefresh event - $modx->invokeEvent("OnSiteRefresh"); - ?> + $modx->clearCache('full', true); + // invoke OnSiteRefresh event + $modx->invokeEvent("OnSiteRefresh"); + ?>
    diff --git a/manager/actions/resource_selector.static.php b/manager/actions/resource_selector.static.php index 068bb21295..065cb0666e 100755 --- a/manager/actions/resource_selector.static.php +++ b/manager/actions/resource_selector.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('edit_module')) { diff --git a/manager/actions/resources.static.php b/manager/actions/resources.static.php index 18e1491e82..7899784644 100755 --- a/manager/actions/resources.static.php +++ b/manager/actions/resources.static.php @@ -1,54 +1,50 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/functions.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/functions.inc.php'); +if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/functions.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/functions.inc.php'); } else { - include_once(MODX_MANAGER_PATH . 'actions/resources/functions.inc.php'); + include_once(MODX_MANAGER_PATH . 'actions/resources/functions.inc.php'); } -if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/mgrResources.class.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/mgrResources.class.php'); +if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/mgrResources.class.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/mgrResources.class.php'); } else { - include_once(MODX_MANAGER_PATH . 'actions/resources/mgrResources.class.php'); + include_once(MODX_MANAGER_PATH . 'actions/resources/mgrResources.class.php'); } $resources = new mgrResources(); // Prepare lang-strings for "Lock Elements" $unlockTranslations = array( - 'msg' => $_lang["unlock_element_id_warning"], - 'type1' => $_lang["lock_element_type_1"], - 'type2' => $_lang["lock_element_type_2"], - 'type3' => $_lang["lock_element_type_3"], - 'type4' => $_lang["lock_element_type_4"], - 'type5' => $_lang["lock_element_type_5"], - 'type6' => $_lang["lock_element_type_6"], - 'type7' => $_lang["lock_element_type_7"], - 'type8' => $_lang["lock_element_type_8"] + 'msg' => $_lang["unlock_element_id_warning"], + 'type1' => $_lang["lock_element_type_1"], + 'type2' => $_lang["lock_element_type_2"], + 'type3' => $_lang["lock_element_type_3"], + 'type4' => $_lang["lock_element_type_4"], + 'type5' => $_lang["lock_element_type_5"], + 'type6' => $_lang["lock_element_type_6"], + 'type7' => $_lang["lock_element_type_7"], + 'type8' => $_lang["lock_element_type_8"] ); -foreach ($unlockTranslations as $key => $value) { - $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); -} +foreach($unlockTranslations as $key => $value) $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); // Prepare lang-strings for mgrResAction() $mraTranslations = array( - 'create_new' => $_lang["create_new"], - 'edit' => $_lang["edit"], - 'duplicate' => $_lang["duplicate"], - 'remove' => $_lang["remove"], - 'confirm_duplicate_record' => $_lang["confirm_duplicate_record"], - 'confirm_delete_template' => $_lang["confirm_delete_template"], - 'confirm_delete_tmplvars' => $_lang["confirm_delete_tmplvars"], - 'confirm_delete_htmlsnippet' => $_lang["confirm_delete_htmlsnippet"], - 'confirm_delete_snippet' => $_lang["confirm_delete_htmlsnippet"], - 'confirm_delete_plugin' => $_lang["confirm_delete_plugin"], - 'confirm_delete_module' => $_lang["confirm_delete_module"], + 'create_new' => $_lang["create_new"], + 'edit' => $_lang["edit"], + 'duplicate' => $_lang["duplicate"], + 'remove' => $_lang["remove"], + 'confirm_duplicate_record' => $_lang["confirm_duplicate_record"], + 'confirm_delete_template' => $_lang["confirm_delete_template"], + 'confirm_delete_tmplvars' => $_lang["confirm_delete_tmplvars"], + 'confirm_delete_htmlsnippet' => $_lang["confirm_delete_htmlsnippet"], + 'confirm_delete_snippet' => $_lang["confirm_delete_htmlsnippet"], + 'confirm_delete_plugin' => $_lang["confirm_delete_plugin"], + 'confirm_delete_module' => $_lang["confirm_delete_module"], ); -foreach ($mraTranslations as $key => $value) { - $mraTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); -} +foreach($mraTranslations as $key => $value) $mraTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); ?> @@ -69,46 +65,46 @@ config['manager_theme'] . '/actions/resources/tab1_templates.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab1_templates.inc.php'); - } else { - include_once(MODX_MANAGER_PATH . '/actions/resources/tab1_templates.inc.php'); - } + if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab1_templates.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab1_templates.inc.php'); + } else { + include_once(MODX_MANAGER_PATH . '/actions/resources/tab1_templates.inc.php'); + } - if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab2_templatevars.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab2_templatevars.inc.php'); - } else { - include_once(MODX_MANAGER_PATH . '/actions/resources/tab2_templatevars.inc.php'); - } + if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab2_templatevars.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab2_templatevars.inc.php'); + } else { + include_once(MODX_MANAGER_PATH . '/actions/resources/tab2_templatevars.inc.php'); + } - if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab3_chunks.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab3_chunks.inc.php'); - } else { - include_once(MODX_MANAGER_PATH . '/actions/resources/tab3_chunks.inc.php'); - } + if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab3_chunks.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab3_chunks.inc.php'); + } else { + include_once(MODX_MANAGER_PATH . '/actions/resources/tab3_chunks.inc.php'); + } - if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab4_snippets.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab4_snippets.inc.php'); - } else { - include_once(MODX_MANAGER_PATH . '/actions/resources/tab4_snippets.inc.php'); - } + if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab4_snippets.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab4_snippets.inc.php'); + } else { + include_once(MODX_MANAGER_PATH . '/actions/resources/tab4_snippets.inc.php'); + } - if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab5_plugins.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab5_plugins.inc.php'); - } else { - include_once(MODX_MANAGER_PATH . '/actions/resources/tab5_plugins.inc.php'); - } + if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab5_plugins.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab5_plugins.inc.php'); + } else { + include_once(MODX_MANAGER_PATH . '/actions/resources/tab5_plugins.inc.php'); + } - if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab6_categoryview.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab6_categoryview.inc.php'); - } else { - include_once(MODX_MANAGER_PATH . '/actions/resources/tab6_categoryview.inc.php'); - } + if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab6_categoryview.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab6_categoryview.inc.php'); + } else { + include_once(MODX_MANAGER_PATH . '/actions/resources/tab6_categoryview.inc.php'); + } - if (is_numeric($_GET['tab'])) { - echo ''; - } - ?> + if(is_numeric($_GET['tab'])) { + echo ''; + } + ?> diff --git a/manager/actions/resources/functions.inc.php b/manager/actions/resources/functions.inc.php index 680e0e3236..0c52eaa27f 100755 --- a/manager/actions/resources/functions.inc.php +++ b/manager/actions/resources/functions.inc.php @@ -1,14 +1,14 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } $tpl = array( - 'viewForm' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_viewForm.tpl'), - 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), - 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), - 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), - 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl') + 'viewForm' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_viewForm.tpl'), + 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), + 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), + 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), + 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl') ); /** @@ -16,26 +16,22 @@ * @param array $ph * @return string */ -function parsePh($tpl, $ph) -{ - $modx = evolutionCMS(); - global $_lang; - $tpl = $modx->parseText($tpl, $_lang, '[%', '%]'); - return $modx->parseText($tpl, $ph); +function parsePh($tpl, $ph) { + $modx = evolutionCMS(); global $_lang; + $tpl = $modx->parseText($tpl, $_lang, '[%', '%]'); + return $modx->parseText($tpl, $ph); } /** * @param string|int $cssId * @return string */ -function renderViewSwitchButtons($cssId) -{ - $modx = evolutionCMS(); - global $_lang, $tpl; +function renderViewSwitchButtons($cssId) { + $modx = evolutionCMS(); global $_lang, $tpl; - return parsePh($tpl['viewForm'], array( - 'cssId' => $cssId - )); + return parsePh($tpl['viewForm'], array( + 'cssId' => $cssId + )); } /** @@ -43,112 +39,108 @@ function renderViewSwitchButtons($cssId) * @param mgrResources $resources * @return string */ -function createResourceList($resourceTable, $resources) -{ - $modx = evolutionCMS(); - global $_lang, $_style, $modx_textdir, $tpl; +function createResourceList($resourceTable, $resources) { + $modx = evolutionCMS(); global $_lang, $_style, $modx_textdir, $tpl; - $items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false; + $items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false; - if (! is_array($items) || empty($items)) { - return $_lang['no_results']; - } + if( ! is_array($items) || empty($items)) { + return $_lang['no_results']; + } - // Prepare elements- and categories-list - $elements = array(); - $categories = array(); - foreach ($items as $row) { - $catid = $row['catid'] ? $row['catid'] : 0; - $categories[$catid] = array('name' => stripslashes($row['category'])); - $elements[$catid][] = prepareElementRowPh($row, $resourceTable, $resources); - } + // Prepare elements- and categories-list + $elements = array(); + $categories = array(); + foreach($items as $row) { + $catid = $row['catid'] ? $row['catid'] : 0; + $categories[$catid] = array('name' => stripslashes($row['category'])); + $elements[$catid][] = prepareElementRowPh($row, $resourceTable, $resources); + } - // Now render categories / panel-collapse - $panelGroup = ''; - foreach ($elements as $catid => $elList) { - // Add panel-heading / category-collapse to output - $panelGroup .= parsePh($tpl['panelHeading'], array( - 'tab' => $resourceTable, - 'category' => $categories[$catid]['name'], - 'categoryid' => $catid != '' ? ' (' . $catid . ')' : '', - 'catid' => $catid, - )); + // Now render categories / panel-collapse + $panelGroup = ''; + foreach($elements as $catid => $elList) { + // Add panel-heading / category-collapse to output + $panelGroup .= parsePh($tpl['panelHeading'], array( + 'tab' => $resourceTable, + 'category' => $categories[$catid]['name'], + 'categoryid' => $catid != '' ? ' (' . $catid . ')' : '', + 'catid' => $catid, + )); - // Prepare content for panel-collapse - $panelCollapse = ''; - foreach ($elList as $el) { - $panelCollapse .= parsePh($tpl['elementsRow'], $el); - } + // Prepare content for panel-collapse + $panelCollapse = ''; + foreach($elList as $el) { + $panelCollapse .= parsePh($tpl['elementsRow'], $el); + } - // Add panel-collapse with elements to output - $panelGroup .= parsePh($tpl['panelCollapse'], array( - 'tab' => $resourceTable, - 'catid' => $catid, - 'wrapper' => $panelCollapse, - )); - } + // Add panel-collapse with elements to output + $panelGroup .= parsePh($tpl['panelCollapse'], array( + 'tab' => $resourceTable, + 'catid' => $catid, + 'wrapper' => $panelCollapse, + )); + } - return parsePh($tpl['panelGroup'], array( - 'resourceTable' => $resourceTable, - 'wrapper' => $panelGroup - )); + return parsePh($tpl['panelGroup'], array( + 'resourceTable' => $resourceTable, + 'wrapper' => $panelGroup + )); } /** * @param mgrResources $resources * @return string */ -function createCombinedView($resources) -{ - $modx = evolutionCMS(); - global $_lang, $_style, $modx_textdir; +function createCombinedView($resources) { + $modx = evolutionCMS(); global $_lang, $_style, $modx_textdir; - $itemsPerCategory = isset($resources->itemsPerCategory) ? $resources->itemsPerCategory : false; - $types = isset($resources->types) ? $resources->types : false; - $categories = isset($resources->categories) ? $resources->categories : false; + $itemsPerCategory = isset($resources->itemsPerCategory) ? $resources->itemsPerCategory : false; + $types = isset($resources->types) ? $resources->types : false; + $categories = isset($resources->categories) ? $resources->categories : false; - if (!$itemsPerCategory) { - return $_lang['no_results']; - } + if(!$itemsPerCategory) { + return $_lang['no_results']; + } - $tpl = array( - 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), - 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), - 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), - 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl'), - ); + $tpl = array( + 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), + 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), + 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), + 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl'), + ); - // Easily loop through $itemsPerCategory-Array - $panelGroup = ''; - foreach ($categories as $catid => $category) { - // Prepare collapse content / elements-list - $panelCollapse = ''; - foreach ($itemsPerCategory[$catid] as $el) { - $resourceTable = $el['type']; - $ph = prepareElementRowPh($el, $resourceTable, $resources); - $panelCollapse .= parsePh($tpl['elementsRow'], $ph); - } + // Easily loop through $itemsPerCategory-Array + $panelGroup = ''; + foreach($categories as $catid => $category) { + // Prepare collapse content / elements-list + $panelCollapse = ''; + foreach($itemsPerCategory[$catid] as $el) { + $resourceTable = $el['type']; + $ph = prepareElementRowPh($el, $resourceTable, $resources); + $panelCollapse .= parsePh($tpl['elementsRow'], $ph); + } - // Add panel-heading / button - $panelGroup .= parsePh($tpl['panelHeading'], array( - 'tab' => 'categories_list', - 'category' => $categories[$catid], - 'categoryid' => $catid != '' ? ' (' . $catid . ')' : '', - 'catid' => $catid, - )); + // Add panel-heading / button + $panelGroup .= parsePh($tpl['panelHeading'], array( + 'tab' => 'categories_list', + 'category' => $categories[$catid], + 'categoryid' => $catid != '' ? ' (' . $catid . ')' : '', + 'catid' => $catid, + )); - // Add panel - $panelGroup .= parsePh($tpl['panelCollapse'], array( - 'tab' => 'categories_list', - 'catid' => $catid, - 'wrapper' => $panelCollapse, - )); - } + // Add panel + $panelGroup .= parsePh($tpl['panelCollapse'], array( + 'tab' => 'categories_list', + 'catid' => $catid, + 'wrapper' => $panelCollapse, + )); + } - return parsePh($tpl['panelGroup'], array( - 'resourceTable' => 'categories_list', - 'wrapper' => $panelGroup - )); + return parsePh($tpl['panelGroup'], array( + 'resourceTable' => 'categories_list', + 'wrapper' => $panelGroup + )); } /** @@ -157,16 +149,14 @@ function createCombinedView($resources) * @param mgrResources $resources * @return array */ -function prepareElementRowPh($row, $resourceTable, $resources) -{ - $modx = evolutionCMS(); - global $modx_textdir, $_style, $_lang; +function prepareElementRowPh($row, $resourceTable, $resources) { + $modx = evolutionCMS(); global $modx_textdir, $_style, $_lang; - $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false; + $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false; - $_lang["confirm_delete"] = $_lang["delete"]; + $_lang["confirm_delete"] = $_lang["delete"]; - switch ($resourceTable) { + switch($resourceTable){ case 'site_templates': $class = $row['selectable'] ? '' : 'disabledPlugin'; $lockElementType = 1; @@ -200,77 +190,77 @@ function prepareElementRowPh($row, $resourceTable, $resources) return array(); } - // Prepare displaying user-locks - $lockedByUser = ''; - $rowLock = $modx->elementIsLocked($lockElementType, $row['id'], true); - if ($rowLock && $modx->hasPermission('display_locks')) { - if ($rowLock['sid'] == $modx->sid) { - $title = $modx->parseText($_lang["lock_element_editing"], array( - 'element_type' => $_lang["lock_element_type_" . $lockElementType], - 'lasthit_df' => $rowLock['lasthit_df'] - )); - $lockedByUser = '' . $_style['tree_preview_resource'] . ' '; - } else { - $title = $modx->parseText($_lang["lock_element_locked_by"], array( - 'element_type' => $_lang["lock_element_type_" . $lockElementType], - 'username' => $rowLock['username'], - 'lasthit_df' => $rowLock['lasthit_df'] - )); - if ($modx->hasPermission('remove_locks')) { - $lockedByUser = ''; - } else { - $lockedByUser = ''; - } - } - } - if ($lockedByUser) { - $lockedByUser = '
    ' . $lockedByUser . '
    '; - } + // Prepare displaying user-locks + $lockedByUser = ''; + $rowLock = $modx->elementIsLocked($lockElementType, $row['id'], true); + if($rowLock && $modx->hasPermission('display_locks')) { + if($rowLock['sid'] == $modx->sid) { + $title = $modx->parseText($_lang["lock_element_editing"], array( + 'element_type' => $_lang["lock_element_type_" . $lockElementType], + 'lasthit_df' => $rowLock['lasthit_df'] + )); + $lockedByUser = '' . $_style['tree_preview_resource'] . ' '; + } else { + $title = $modx->parseText($_lang["lock_element_locked_by"], array( + 'element_type' => $_lang["lock_element_type_" . $lockElementType], + 'username' => $rowLock['username'], + 'lasthit_df' => $rowLock['lasthit_df'] + )); + if($modx->hasPermission('remove_locks')) { + $lockedByUser = ''; + } else { + $lockedByUser = ''; + } + } + } + if($lockedByUser) { + $lockedByUser = '
    ' . $lockedByUser . '
    '; + } - // Caption - if ($resourceTable == 'site_tmplvars') { - $caption = !empty($row['description']) ? ' ' . $row['caption'] . '   (' . $row['description'] . ')' : ' ' . $row['caption']; - } else { - $caption = !empty($row['description']) ? ' ' . $row['description'] : ''; - } + // Caption + if($resourceTable == 'site_tmplvars') { + $caption = !empty($row['description']) ? ' ' . $row['caption'] . '   (' . $row['description'] . ')' : ' ' . $row['caption']; + } else { + $caption = !empty($row['description']) ? ' ' . $row['description'] : ''; + } - // Special marks - $tplInfo = array(); - if ($row['locked']) { - $tplInfo[] = $_lang['locked']; - } - if ($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') { - $tplInfo[] = $_lang['defaulttemplate_title']; - } - $marks = !empty($tplInfo) ? ' (' . implode(', ', $tplInfo) . ')' : ''; + // Special marks + $tplInfo = array(); + if($row['locked']) { + $tplInfo[] = $_lang['locked']; + } + if($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') { + $tplInfo[] = $_lang['defaulttemplate_title']; + } + $marks = !empty($tplInfo) ? ' (' . implode(', ', $tplInfo) . ')' : ''; - /* row buttons */ - $buttons = ''; - if ($modx->hasPermission($types['actions']['edit'][1])) { - $buttons .= '
  • '; - } - if ($modx->hasPermission($types['actions']['duplicate'][1])) { - $buttons .= '
  • '; - } - if ($modx->hasPermission($types['actions']['remove'][1])) { - $buttons .= '
  • '; - } - $buttons = $buttons ? '
      ' . $buttons . '
    ' : ''; + /* row buttons */ + $buttons = ''; + if($modx->hasPermission($types['actions']['edit'][1])) { + $buttons .= '
  • '; + } + if($modx->hasPermission($types['actions']['duplicate'][1])) { + $buttons .= '
  • '; + } + if($modx->hasPermission($types['actions']['remove'][1])) { + $buttons .= '
  • '; + } + $buttons = $buttons ? '
      ' . $buttons . '
    ' : ''; - $catid = $row['catid'] ? $row['catid'] : 0; + $catid = $row['catid'] ? $row['catid'] : 0; - // Placeholders for elements-row - return array( - 'class' => $class ? ' class="' . $class . '"' : '', - 'lockedByUser' => $lockedByUser, - 'name' => $row['name'], - 'caption' => $caption, - 'buttons' => $buttons, - 'marks' => $marks, - 'id' => $row['id'], - 'resourceTable' => $resourceTable, - 'actionEdit' => $types['actions']['edit'][0], - 'catid' => $catid, - 'textdir' => $modx_textdir ? '‏' : '', - ); + // Placeholders for elements-row + return array( + 'class' => $class ? ' class="' . $class . '"' : '', + 'lockedByUser' => $lockedByUser, + 'name' => $row['name'], + 'caption' => $caption, + 'buttons' => $buttons, + 'marks' => $marks, + 'id' => $row['id'], + 'resourceTable' => $resourceTable, + 'actionEdit' => $types['actions']['edit'][0], + 'catid' => $catid, + 'textdir' => $modx_textdir ? '‏' : '', + ); } diff --git a/manager/actions/resources/mgrResources.class.php b/manager/actions/resources/mgrResources.class.php index 54b7473345..2b34adb3c3 100755 --- a/manager/actions/resources/mgrResources.class.php +++ b/manager/actions/resources/mgrResources.class.php @@ -1,14 +1,13 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -class mgrResources -{ +class mgrResources { /** * @var array */ - public $types = array(); + public $types = array(); /** * @var array */ @@ -25,91 +24,82 @@ class mgrResources /** * mgrResources constructor. */ - public function __construct() - { - $this->setTypes(); - $this->queryItemsFromDB(); - $this->prepareCategoryArrays(); - } + public function __construct() { + $this->setTypes(); + $this->queryItemsFromDB(); + $this->prepareCategoryArrays(); + } /** * @return void */ - public function setTypes() - { - global $_lang; - $this->types['site_templates'] = array( - 'title'=>$_lang["manage_templates"], - 'actions'=>array( 'edit'=>array(16,'edit_template'), 'duplicate'=>array(96,'new_template'), 'remove'=>array(21,'delete_template') ), - 'permissions'=>array('new_template','edit_template'), - 'name'=>'templatename' - ); - $this->types['site_tmplvars'] = array( - 'title'=>$_lang["tmplvars"], - 'actions'=>array('edit'=>array(301,'edit_template'), 'duplicate'=>array(304,'edit_template'), 'remove'=>array(303,'edit_template')), - 'permissions'=>array('new_template','edit_template'), - ); - $this->types['site_htmlsnippets'] = array( - 'title'=>$_lang["manage_htmlsnippets"], - 'actions'=>array('edit'=>array(78,'edit_chunk'), 'duplicate'=>array(97,'new_chunk'), 'remove'=>array(80,'delete_chunk')), - 'permissions'=>array('new_chunk','edit_chunk'), - ); - $this->types['site_snippets'] = array( - 'title'=>$_lang["manage_snippets"], - 'actions'=>array('edit'=>array(22,'edit_snippet'), 'duplicate'=>array(98,'new_snippet'), 'remove'=>array(25,'delete_snippet')), - 'permissions'=>array('new_snippet','edit_snippet'), - ); - $this->types['site_plugins'] = array( - 'title'=>$_lang["manage_plugins"], - 'actions'=>array('edit'=>array(102,'edit_plugin'), 'duplicate'=>array(105,'new_plugin'), 'remove'=>array(104,'delete_plugin')), - 'permissions'=>array('new_plugin','edit_plugin'), - ); - $this->types['site_modules'] = array( - 'title'=>$_lang["manage_modules"], - 'actions'=>array('edit'=>array(108,'edit_module'), 'duplicate'=>array(111,'new_module'), 'remove'=>array(110,'delete_module')), - 'permissions'=>array('new_module','edit_module'), - ); - } + public function setTypes() { + global $_lang; + $this->types['site_templates'] = array( + 'title'=>$_lang["manage_templates"], + 'actions'=>array( 'edit'=>array(16,'edit_template'), 'duplicate'=>array(96,'new_template'), 'remove'=>array(21,'delete_template') ), + 'permissions'=>array('new_template','edit_template'), + 'name'=>'templatename' + ); + $this->types['site_tmplvars'] = array( + 'title'=>$_lang["tmplvars"], + 'actions'=>array('edit'=>array(301,'edit_template'), 'duplicate'=>array(304,'edit_template'), 'remove'=>array(303,'edit_template')), + 'permissions'=>array('new_template','edit_template'), + ); + $this->types['site_htmlsnippets'] = array( + 'title'=>$_lang["manage_htmlsnippets"], + 'actions'=>array('edit'=>array(78,'edit_chunk'), 'duplicate'=>array(97,'new_chunk'), 'remove'=>array(80,'delete_chunk')), + 'permissions'=>array('new_chunk','edit_chunk'), + ); + $this->types['site_snippets'] = array( + 'title'=>$_lang["manage_snippets"], + 'actions'=>array('edit'=>array(22,'edit_snippet'), 'duplicate'=>array(98,'new_snippet'), 'remove'=>array(25,'delete_snippet')), + 'permissions'=>array('new_snippet','edit_snippet'), + ); + $this->types['site_plugins'] = array( + 'title'=>$_lang["manage_plugins"], + 'actions'=>array('edit'=>array(102,'edit_plugin'), 'duplicate'=>array(105,'new_plugin'), 'remove'=>array(104,'delete_plugin')), + 'permissions'=>array('new_plugin','edit_plugin'), + ); + $this->types['site_modules'] = array( + 'title'=>$_lang["manage_modules"], + 'actions'=>array('edit'=>array(108,'edit_module'), 'duplicate'=>array(111,'new_module'), 'remove'=>array(110,'delete_module')), + 'permissions'=>array('new_module','edit_module'), + ); + } /** * @return void */ - public function queryItemsFromDB() - { - foreach ($this->types as $resourceTable=>$type) { - if ($this->hasAnyPermissions($type['permissions'])) { - $nameField = isset($type['name']) ? $type['name'] : 'name'; - $this->items[$resourceTable] = $this->queryResources($resourceTable, $nameField); - } - } - } + public function queryItemsFromDB() { + foreach($this->types as $resourceTable=>$type) { + if($this->hasAnyPermissions($type['permissions'])) { + $nameField = isset($type['name']) ? $type['name'] : 'name'; + $this->items[$resourceTable] = $this->queryResources($resourceTable, $nameField); + } + } + } /** * @param array $permissions * @return bool */ - public function hasAnyPermissions($permissions) - { - $modx = evolutionCMS(); + public function hasAnyPermissions($permissions) { + $modx = evolutionCMS(); - foreach ($permissions as $p) { - if ($modx->hasPermission($p)) { - return true; - } - } + foreach($permissions as $p) + if($modx->hasPermission($p)) return true; - return false; - } + return false; + } /** * @param string $resourceTable * @param string $nameField * @return array|bool */ - public function queryResources($resourceTable, $nameField = 'name') - { - $modx = evolutionCMS(); - global $_lang; + public function queryResources($resourceTable, $nameField = 'name') { + $modx = evolutionCMS(); global $_lang; $allowed = array( 'site_htmlsnippets', @@ -117,63 +107,59 @@ public function queryResources($resourceTable, $nameField = 'name') 'site_plugins', 'site_modules' ); - $pluginsql = !empty($resourceTable) && in_array($resourceTable, $allowed) ? $resourceTable . '.disabled, ' : ''; - - $tvsql = ''; - $tvjoin = ''; - if ($resourceTable === 'site_tmplvars') { - $tvsql = 'site_tmplvars.caption, '; - $tvjoin = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl', $modx->getFullTableName('site_tmplvar_templates')); - $sttfield = 'IF(stt.templateid,1,0) AS reltpl,'; - } else { - $sttfield = ''; - } - - $selectableTemplates = $resourceTable === 'site_templates' ? "{$resourceTable}.selectable, " : ""; - - $rs = $modx->db->select( - "{$sttfield} {$pluginsql} {$tvsql} {$resourceTable}.{$nameField} as name, {$resourceTable}.id, {$resourceTable}.description, {$resourceTable}.locked, {$selectableTemplates}IF(isnull(categories.category),'{$_lang['no_category']}',categories.category) as category, categories.id as catid", - $modx->getFullTableName($resourceTable) . " AS {$resourceTable} + $pluginsql = !empty($resourceTable) && in_array($resourceTable, $allowed) ? $resourceTable . '.disabled, ' : ''; + + $tvsql = ''; + $tvjoin = ''; + if ($resourceTable === 'site_tmplvars') { + $tvsql = 'site_tmplvars.caption, '; + $tvjoin = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl', $modx->getFullTableName('site_tmplvar_templates')); + $sttfield = 'IF(stt.templateid,1,0) AS reltpl,'; + } + else $sttfield = ''; + + $selectableTemplates = $resourceTable === 'site_templates' ? "{$resourceTable}.selectable, " : ""; + + $rs = $modx->db->select( + "{$sttfield} {$pluginsql} {$tvsql} {$resourceTable}.{$nameField} as name, {$resourceTable}.id, {$resourceTable}.description, {$resourceTable}.locked, {$selectableTemplates}IF(isnull(categories.category),'{$_lang['no_category']}',categories.category) as category, categories.id as catid", + $modx->getFullTableName($resourceTable) . " AS {$resourceTable} LEFT JOIN " . $modx->getFullTableName('categories') . " AS categories ON {$resourceTable}.category = categories.id {$tvjoin}", - "", - "category,name" - ); - $limit = $modx->db->getRecordCount($rs); + "", + "category,name" + ); + $limit = $modx->db->getRecordCount($rs); - if ($limit < 1) { - return false; - } + if($limit < 1) return false; - $result = array(); - while ($row = $modx->db->getRow($rs)) { - $result[] = $row; - } - return $result; - } + $result = array(); + while ($row = $modx->db->getRow($rs)) { + $result[] = $row; + } + return $result; + } /** * @return void */ - public function prepareCategoryArrays() - { - foreach ($this->items as $type=>$items) { - foreach ((array)$items as $item) { - $catid = $item['catid'] ? $item['catid'] : 0; - $this->categories[$catid] = $item['category']; - - $item['type'] = $type; - $this->itemsPerCategory[$catid][] = $item; - } - } - - // Sort categories by name - natcasesort($this->categories); - - // Now sort by name - foreach ($this->itemsPerCategory as $catid=>$items) { - usort($this->itemsPerCategory[$catid], function ($a, $b) { - return strcasecmp($a['name'], $b['name']); - }); - } - } + public function prepareCategoryArrays() { + foreach($this->items as $type=>$items) { + foreach((array)$items as $item) { + $catid = $item['catid'] ? $item['catid'] : 0; + $this->categories[$catid] = $item['category']; + + $item['type'] = $type; + $this->itemsPerCategory[$catid][] = $item; + } + } + + // Sort categories by name + natcasesort($this->categories); + + // Now sort by name + foreach($this->itemsPerCategory as $catid=>$items) { + usort($this->itemsPerCategory[$catid], function ($a, $b) { + return strcasecmp($a['name'], $b['name']); + }); + } + } } diff --git a/manager/actions/resources/tab1_templates.inc.php b/manager/actions/resources/tab1_templates.inc.php index 59a41c2a2f..23b0758e87 100755 --- a/manager/actions/resources/tab1_templates.inc.php +++ b/manager/actions/resources/tab1_templates.inc.php @@ -1,11 +1,10 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (isset($resources->items['site_templates'])) { - ?> +if (isset($resources->items['site_templates'])) { ?>

    @@ -36,5 +35,4 @@ initViews('tmp', 'template', 'site_templates')
    - + diff --git a/manager/actions/resources/tab2_templatevars.inc.php b/manager/actions/resources/tab2_templatevars.inc.php index 667d3542ce..72d8f8d4e7 100755 --- a/manager/actions/resources/tab2_templatevars.inc.php +++ b/manager/actions/resources/tab2_templatevars.inc.php @@ -1,11 +1,10 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (isset($resources->items['site_tmplvars'])) { - ?> +if (isset($resources->items['site_tmplvars'])) { ?>

    @@ -41,5 +40,4 @@ initViews('tv', 'tv', 'site_tmplvars')
    - + diff --git a/manager/actions/resources/tab3_chunks.inc.php b/manager/actions/resources/tab3_chunks.inc.php index fda510755b..6183b1afb9 100755 --- a/manager/actions/resources/tab3_chunks.inc.php +++ b/manager/actions/resources/tab3_chunks.inc.php @@ -1,11 +1,10 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (isset($resources->items['site_htmlsnippets'])) { - ?> +if (isset($resources->items['site_htmlsnippets'])) { ?>

    @@ -37,5 +36,4 @@ initViews('ch', 'chunks', 'site_htmlsnippets')
    - + diff --git a/manager/actions/resources/tab4_snippets.inc.php b/manager/actions/resources/tab4_snippets.inc.php index 68190d5948..921b4e4089 100755 --- a/manager/actions/resources/tab4_snippets.inc.php +++ b/manager/actions/resources/tab4_snippets.inc.php @@ -1,11 +1,10 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (isset($resources->items['site_snippets'])) { - ?> +if (isset($resources->items['site_snippets'])) { ?>

    @@ -37,5 +36,4 @@ initViews('sn', 'snippets', 'site_snippets')
    - + diff --git a/manager/actions/resources/tab5_plugins.inc.php b/manager/actions/resources/tab5_plugins.inc.php index 198deb4aac..b07db5ab55 100755 --- a/manager/actions/resources/tab5_plugins.inc.php +++ b/manager/actions/resources/tab5_plugins.inc.php @@ -1,11 +1,10 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (isset($resources->items['site_plugins'])) { - ?> +if (isset($resources->items['site_plugins'])) { ?>

    @@ -20,21 +19,16 @@
    - hasPermission('new_plugin')) { - ?> + hasPermission('new_plugin')) { ?> "> - - hasPermission('save_plugin')) { - ?> + + hasPermission('save_plugin')) { ?> "> - + hasPermission('delete_plugin') && $_SESSION['mgrRole'] == 1) { $tbl_site_plugins = $modx->getFullTableName('site_plugins'); - if ($modx->db->getRecordCount($modx->db->query("SELECT id FROM {$tbl_site_plugins} t1 WHERE disabled = 1 AND name IN (SELECT name FROM {$tbl_site_plugins} t2 WHERE t1.name = t2.name AND t1.id != t2.id)"))) { - ?> + if ($modx->db->getRecordCount($modx->db->query("SELECT id FROM {$tbl_site_plugins} t1 WHERE disabled = 1 AND name IN (SELECT name FROM {$tbl_site_plugins} t2 WHERE t1.name = t2.name AND t1.id != t2.id)"))) { ?>
    - + diff --git a/manager/actions/resources/tab6_categoryview.inc.php b/manager/actions/resources/tab6_categoryview.inc.php index 9c7263ad9f..2f118d79d9 100755 --- a/manager/actions/resources/tab6_categoryview.inc.php +++ b/manager/actions/resources/tab6_categoryview.inc.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } ?> diff --git a/manager/actions/role_management.static.php b/manager/actions/role_management.static.php index 41504d52a6..bd6adb1dce 100755 --- a/manager/actions/role_management.static.php +++ b/manager/actions/role_management.static.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('edit_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('edit_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } ?> @@ -18,14 +18,14 @@
    db->select('name, id, description', $modx->getFullTableName('user_roles'), '', 'name'); - $limit = $modx->db->getRecordCount($rs); - if ($limit < 1) { - ?> + $rs = $modx->db->select('name, id, description', $modx->getFullTableName('user_roles'), '', 'name'); + $limit = $modx->db->getRecordCount($rs); + if($limit < 1) { + ?>

    + } else { + ?>
    @@ -37,29 +37,29 @@ db->getRow($rs)) { - if ($row['id'] == 1) { - ?> + while($row = $modx->db->getRow($rs)) { + if($row['id'] == 1) { + ?> + } else { + ?> + } + } + ?>
    - +
    diff --git a/manager/actions/search.static.php b/manager/actions/search.static.php index e640556c4d..86f76bafcd 100755 --- a/manager/actions/search.static.php +++ b/manager/actions/search.static.php @@ -1,5 +1,5 @@ getFullTableName('site_tmplvar_contentvalues'); - $articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'"; - $articul_result = $modx->db->query($articul_query); - $articul_id_array = $modx->db->makeArray($articul_result); - if (count($articul_id_array)>0) { - $articul_id = ''; - $i = 1; - foreach ($articul_id_array as $articul) { - $articul_id.=$articul['contentid']; - if ($i !== count($articul_id_array)) { - $articul_id.=','; - } - $i++; - } - $articul_id_query = " OR sc.id IN ({$articul_id})"; - } else { - $articul_id_query = ''; - } - /*end search by TV*/ + /*start search by TV. Added Rising13*/ + $tbl_site_tmplvar_contentvalues = $modx->getFullTableName('site_tmplvar_contentvalues'); + $articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'"; + $articul_result = $modx->db->query($articul_query); + $articul_id_array = $modx->db->makeArray($articul_result); + if(count($articul_id_array)>0){ + $articul_id = ''; + $i = 1; + foreach( $articul_id_array as $articul ) { + $articul_id.=$articul['contentid']; + if($i !== count($articul_id_array)){ + $articul_id.=','; + } + $i++; + } + $articul_id_query = " OR sc.id IN ({$articul_id})"; + }else{ + $articul_id_query = ''; + } + /*end search by TV*/ if (ctype_digit($searchfields)) { $sqladd .= "sc.id='{$searchfields}'"; if (strlen($searchfields) > 3) { - $sqladd .= $articul_id_query;//search by TV + $sqladd .= $articul_id_query;//search by TV $sqladd .= " OR sc.pagetitle LIKE '%{$searchfields}%'"; } } if ($idFromAlias) { $sqladd .= $sqladd != '' ? ' OR ' : ''; $sqladd .= "sc.id='{$idFromAlias}'"; + } $sqladd = $sqladd ? "({$sqladd})" : $sqladd; @@ -159,7 +160,7 @@ $sqladd .= $articul_id_query;//search by TV $sqladd .= ")"; } - } elseif ($idFromAlias) { + } else if ($idFromAlias) { $sqladd .= " sc.id='{$idFromAlias}'"; } @@ -178,7 +179,7 @@ // get document groups for current user if (!empty($modx->config['use_udperms']) && $sqladd) { $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; - $mgrRole = (isset($_SESSION['mgrRole']) && $_SESSION['mgrRole'] == 1) ? 1 : 0; + $mgrRole = (isset ($_SESSION['mgrRole']) && $_SESSION['mgrRole'] == 1) ? 1 : 0; $docgrp_cond = $docgrp ? " OR dg.document_group IN ({$docgrp})" : ''; $fields .= ', MAX(IF(1=' . $mgrRole . ' OR sc.privatemgr=0' . $docgrp_cond . ',1,0)) AS hasAccess'; $sqladd = '(' . $sqladd . ") AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); @@ -195,7 +196,9 @@ $limit = $modx->db->getRecordCount($rs); } else { $limit = 0; - } ?> + } + + ?> @@ -204,10 +207,12 @@
    ' . $_lang['search_results_returned_msg'] . '

    ', $limit); ?> + printf('

    ' . $_lang['search_results_returned_msg'] . '

    ', $limit); + ?> @@ -237,24 +242,25 @@ 'image/png' => $_style["tree_page_png"] ); - while ($row = $modx->db->getRow($rs)) { - // figure out the icon for the document... - $icon = ""; - if ($row['type'] == 'reference') { - $icon .= $_style["tree_linkgo"]; - } elseif ($row['isfolder'] == 0) { - $icon .= isset($icons[$row['contenttype']]) ? $icons[$row['contenttype']] : $_style["tree_page_html"]; - } else { - $icon .= $_style['tree_folder_new']; - } - - $tdClass = ""; - if ($row['published'] == 0) { - $tdClass .= ' class="unpublishedNode"'; - } - if ($row['deleted'] == 1) { - $tdClass .= ' class="deletedNode"'; - } ?> + while ($row = $modx->db->getRow($rs)) { + // figure out the icon for the document... + $icon = ""; + if ($row['type'] == 'reference') { + $icon .= $_style["tree_linkgo"]; + } elseif ($row['isfolder'] == 0) { + $icon .= isset($icons[$row['contenttype']]) ? $icons[$row['contenttype']] : $_style["tree_page_html"]; + } else { + $icon .= $_style['tree_folder_new']; + } + + $tdClass = ""; + if ($row['published'] == 0) { + $tdClass .= ' class="unpublishedNode"'; + } + if ($row['deleted'] == 1) { + $tdClass .= ' class="deletedNode"'; + } + ?> > 35 ? substr($row['description'], 0, 35) . '...' : $row['description'] ?> + } + ?> + } + ?>
    @@ -274,13 +280,16 @@ > 20 ? substr($row['pagetitle'], 0, 20) . '...' : $row['pagetitle'] ?>
      ' . $output . '
    ' : '1'; - } ?> + } + + ?> INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('view_eventlog')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('view_eventlog')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } ?> @@ -17,14 +17,14 @@
    db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC'); - $limit = $modx->db->getRecordCount($rs); - if ($limit < 1) { - ?> + $rs = $modx->db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC'); + $limit = $modx->db->getRecordCount($rs); + if($limit < 1) { + ?>

    + } else { + ?>
    @@ -36,33 +36,34 @@ db->getRow($rs)) { - ?> + while($row = $modx->db->getRow($rs)) { + ?> + } + ?>
    toDateFormat($row['pub_date'] + $server_offset_time) ?>
    + } + ?>
    db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC'); - $limit = $modx->db->getRecordCount($rs); - if ($limit < 1) { - ?> + $rs = $modx->db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC'); + $limit = $modx->db->getRecordCount($rs); + if($limit < 1) { + ?>

    + } else { + ?>
    @@ -74,33 +75,34 @@ db->getRow($rs)) { - ?> + while($row = $modx->db->getRow($rs)) { + ?> + } + ?>
    toDateFormat($row['unpub_date'] + $server_offset_time) ?>
    + } + ?>
    db->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC"); - $limit = $modx->db->getRecordCount($rs); - if ($limit < 1) { - ?> + $rs = $modx->db->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC"); + $limit = $modx->db->getRecordCount($rs); + if($limit < 1) { + ?>

    + } else { + ?>
    @@ -113,8 +115,8 @@ db->getRow($rs)) { - ?> + while($row = $modx->db->getRow($rs)) { + ?> @@ -122,13 +124,14 @@ + } + ?>
    toDateFormat($row['unpub_date'] + $server_offset_time) ?>
    + } + ?>
    diff --git a/manager/actions/sysinfo.static.php b/manager/actions/sysinfo.static.php index a12908da6d..6ac4cab6fd 100755 --- a/manager/actions/sysinfo.static.php +++ b/manager/actions/sysinfo.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('logs')) { @@ -110,19 +110,20 @@ function viewPHPInfo() $modx->db->config['table_prefix'] . 'event_log', $modx->db->config['table_prefix'] . 'manager_log', ); - if ($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) { - echo ""; - echo "" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . ""; - echo ""; - } else { - echo "" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . ""; - } + if ($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) { + echo ""; + echo "" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . ""; + echo ""; + } else { + echo "" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . ""; + } - if ($modx->hasPermission('settings')) { - echo "" . ($log_status['Data_free'] > 0 ? "" . $modx->nicesize($log_status['Data_free']) . "" : "-") . ""; - } else { - echo "" . ($log_status['Data_free'] > 0 ? $modx->nicesize($log_status['Data_free']) : "-") . ""; - } ?> + if ($modx->hasPermission('settings')) { + echo "" . ($log_status['Data_free'] > 0 ? "" . $modx->nicesize($log_status['Data_free']) . "" : "-") . ""; + } else { + echo "" . ($log_status['Data_free'] > 0 ? $modx->nicesize($log_status['Data_free']) : "-") . ""; + } + ?> nicesize($log_status['Data_length'] - $log_status['Data_free']) ?> nicesize($log_status['Index_length']) ?> nicesize($log_status['Index_length'] + $log_status['Data_length'] + $log_status['Data_free']) ?> @@ -143,11 +144,9 @@ function viewPHPInfo() - 0) { - ?> + 0) { ?>

    - + diff --git a/manager/actions/user_management.static.php b/manager/actions/user_management.static.php index 4e26c6b077..8402d14429 100755 --- a/manager/actions/user_management.static.php +++ b/manager/actions/user_management.static.php @@ -1,22 +1,22 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('edit_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('edit_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // initialize page view state - the $_PAGE object $modx->manager->initPageViewState(); // get and save search string -if ($_REQUEST['op'] == 'reset') { - $query = ''; - $_PAGE['vs']['search'] = ''; +if($_REQUEST['op'] == 'reset') { + $query = ''; + $_PAGE['vs']['search'] = ''; } else { - $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; - $sqlQuery = $modx->db->escape($query); - $_PAGE['vs']['search'] = $query; + $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; + $sqlQuery = $modx->db->escape($query); + $_PAGE['vs']['search'] = $query; } // get & save listmode @@ -120,55 +120,55 @@ function menuAction(a) {
    hasPermission('save_role')) { - $where .= (empty($where) ? "" : " AND ") . "mua.role != 1"; - } - if (!empty($sqlQuery)) { - $where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))"; - } - $ds = $modx->db->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, ELT(mua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin", $modx->getFullTableName('manager_users') . " AS mu + $where = ""; + if(!$modx->hasPermission('save_role')) { + $where .= (empty($where) ? "" : " AND ") . "mua.role != 1"; + } + if(!empty($sqlQuery)) { + $where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))"; + } + $ds = $modx->db->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, ELT(mua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin", $modx->getFullTableName('manager_users') . " AS mu INNER JOIN " . $modx->getFullTableName('user_attributes') . " AS mua ON mua.internalKey=mu.id LEFT JOIN " . $modx->getFullTableName('user_roles') . " AS rname ON mua.role=rname.id", $where, 'mua.blocked ASC, mua.thislogin DESC'); - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items - $grd->noRecordMsg = $_lang["no_records_found"]; - $grd->cssClass = "table data"; - $grd->columnHeaderClass = "tableHeader"; - $grd->itemClass = "tableItem"; - $grd->altItemClass = "tableAltItem"; - $grd->fields = "id,username,fullname,role,email,gender,blocked,thislogin"; - $grd->columns = implode(',', array( - $_lang["icon"], - $_lang["name"], - $_lang["user_full_name"], - $_lang['role'], - $_lang["email"], - $_lang["user_gender"], - $_lang["user_block"], - $_lang["login_button"] - )); - $grd->colWidths = "1%,,,,,,1%,1%"; - $grd->colAligns = "center,,,,,center,center,right' nowrap='nowrap"; - $grd->colTypes = implode('||', array( - 'template:', - 'template:[+value+]', - 'template:[+fullname+]', - 'template:[+role+]', - 'template:[+email+]', - 'template:[+gender+]', - 'template:[+blocked+]', - 'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M' - )); - if ($listmode == '1') { - $grd->pageSize = 0; - } - if ($_REQUEST['op'] == 'reset') { - $grd->pageNumber = 1; - } - // render grid - echo $grd->render(); - ?> + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items + $grd->noRecordMsg = $_lang["no_records_found"]; + $grd->cssClass = "table data"; + $grd->columnHeaderClass = "tableHeader"; + $grd->itemClass = "tableItem"; + $grd->altItemClass = "tableAltItem"; + $grd->fields = "id,username,fullname,role,email,gender,blocked,thislogin"; + $grd->columns = implode(',', array( + $_lang["icon"], + $_lang["name"], + $_lang["user_full_name"], + $_lang['role'], + $_lang["email"], + $_lang["user_gender"], + $_lang["user_block"], + $_lang["login_button"] + )); + $grd->colWidths = "1%,,,,,,1%,1%"; + $grd->colAligns = "center,,,,,center,center,right' nowrap='nowrap"; + $grd->colTypes = implode('||', array( + 'template:', + 'template:[+value+]', + 'template:[+fullname+]', + 'template:[+role+]', + 'template:[+email+]', + 'template:[+gender+]', + 'template:[+blocked+]', + 'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M' + )); + if($listmode == '1') { + $grd->pageSize = 0; + } + if($_REQUEST['op'] == 'reset') { + $grd->pageNumber = 1; + } + // render grid + echo $grd->render(); + ?>
    diff --git a/manager/actions/web_access_permissions.dynamic.php b/manager/actions/web_access_permissions.dynamic.php index 4c0659b4f7..38e71fd698 100755 --- a/manager/actions/web_access_permissions.dynamic.php +++ b/manager/actions/web_access_permissions.dynamic.php @@ -1,32 +1,32 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('web_access_permissions')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('web_access_permissions')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // find all document groups, for the select :) $rs = $modx->db->select('*', $modx->getFullTableName('documentgroup_names'), '', 'name'); -if ($modx->db->getRecordCount($rs) < 1) { - $docgroupselector = "[no groups to add]"; +if($modx->db->getRecordCount($rs) < 1) { + $docgroupselector = "[no groups to add]"; } else { - $docgroupselector = '\n"; + $docgroupselector = '\n"; } $rs = $modx->db->select('*', $modx->getFullTableName('webgroup_names'), '', 'name'); -if ($modx->db->getRecordCount($rs) < 1) { - $usrgroupselector = '[no user groups]'; +if($modx->db->getRecordCount($rs) < 1) { + $usrgroupselector = '[no user groups]'; } else { - $usrgroupselector = '\n"; + $usrgroupselector = '\n"; } ?> @@ -88,23 +88,24 @@ function deletegroup(groupid, type) {
    db->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getFullTableName('webgroup_names') . " AS groupnames + $rs = $modx->db->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getFullTableName('webgroup_names') . " AS groupnames LEFT JOIN " . $modx->getFullTableName('web_groups') . " AS groups ON groups.webgroup = groupnames.id LEFT JOIN " . $modx->getFullTableName('web_users') . " AS users ON users.id = groups.webuser", '', 'groupnames.name, user_name'); - if ($modx->db->getRecordCount($rs) < 1) { - ?> + if($modx->db->getRecordCount($rs) < 1) { + ?>
    + } else { + ?>
    db->getRow($rs)) { - if ($pid != $row['id']) { - if ($pid != '') { - echo '
    '; - } ?> + $pid = ''; + while($row = $modx->db->getRow($rs)) { + if($pid != $row['id']) { + if($pid != '') { + echo '
    '; + } + ?>
    @@ -119,20 +120,21 @@ function deletegroup(groupid, type) {
    + } + if(!$row['user_id']) { + ?> + $pid = $row['id']; + continue; + } + ?> + $pid = $row['id']; + } + } + ?>
    @@ -157,23 +159,24 @@ function deletegroup(groupid, type) { db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getFullTableName('documentgroup_names') . " AS dgnames + $rs = $modx->db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getFullTableName('documentgroup_names') . " AS dgnames LEFT JOIN " . $modx->getFullTableName('document_groups') . " AS dg ON dg.document_group = dgnames.id LEFT JOIN " . $modx->getFullTableName('site_content') . " AS sc ON sc.id = dg.document", '', 'dgnames.name, sc.id'); - if ($modx->db->getRecordCount($rs) < 1) { - ?> + if($modx->db->getRecordCount($rs) < 1) { + ?>
    + } else { + ?>
    db->getRow($rs)) { - if ($pid != $row['id']) { - if ($pid != '') { - echo '
    '; - } ?> + $pid = ''; + while($row = $modx->db->getRow($rs)) { + if($pid != $row['id']) { + if($pid != '') { + echo '
    '; + } + ?>
    @@ -188,20 +191,21 @@ function deletegroup(groupid, type) {
    + } + if(!$row['doc_id']) { + ?> + $pid = $row['id']; + continue; + } + ?> + $pid = $row['id']; + } + } + ?>
    @@ -213,15 +217,15 @@ function deletegroup(groupid, type) {

    db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getFullTableName('webgroup_names') . " AS groupnames + $rs = $modx->db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getFullTableName('webgroup_names') . " AS groupnames LEFT JOIN " . $modx->getFullTableName('webgroup_access') . " AS groupacc ON groupacc.webgroup = groupnames.id LEFT JOIN " . $modx->getFullTableName('documentgroup_names') . " AS dgnames ON dgnames.id = groupacc.documentgroup", '', 'name, dg_name'); - if ($modx->db->getRecordCount($rs) < 1) { - ?> + if($modx->db->getRecordCount($rs) < 1) { + ?>
    + } else { + ?>
    @@ -237,35 +241,38 @@ function deletegroup(groupid, type) {
      db->getRow($rs)) { - if ($row['id'] != $pid) { - if ($pid != '') { - echo '
    '; - } // close previous one ?> + $pid = ''; + while($row = $modx->db->getRow($rs)) { + if($row['id'] != $pid) { + if($pid != '') { + echo ''; + } // close previous one + ?>
  • ' . $_lang['no_groups_found'] . ''; - $pid = ''; - continue; - } else { - echo '
      '; - } - } - if (!$row['dg_id']) { - continue; - } ?> + if(!$row['dg_id']) { + echo '' . $_lang['no_groups_found'] . ''; + $pid = ''; + continue; + } else { + echo '
        '; + } + } + if(!$row['dg_id']) { + continue; + } + ?>
      • ()
      • + $pid = $row['id']; + } + ?>
      + } + ?>
    diff --git a/manager/actions/web_user_management.static.php b/manager/actions/web_user_management.static.php index 9eba4565b5..013a88a38d 100755 --- a/manager/actions/web_user_management.static.php +++ b/manager/actions/web_user_management.static.php @@ -1,22 +1,22 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('edit_web_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('edit_web_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // initialize page view state - the $_PAGE object $modx->manager->initPageViewState(); // get and save search string -if ($_REQUEST['op'] == 'reset') { - $query = ''; - $_PAGE['vs']['search'] = ''; +if($_REQUEST['op'] == 'reset') { + $query = ''; + $_PAGE['vs']['search'] = ''; } else { - $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; - $sqlQuery = $modx->db->escape($query); - $_PAGE['vs']['search'] = $query; + $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; + $sqlQuery = $modx->db->escape($query); + $_PAGE['vs']['search'] = $query; } // get & save listmode @@ -120,29 +120,29 @@ function menuAction(a) {
    db->select("wu.id, wu.username, wua.fullname, wua.email, ELT(wua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu + $ds = $modx->db->select("wu.id, wu.username, wua.fullname, wua.email, ELT(wua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu INNER JOIN " . $modx->getFullTableName("web_user_attributes") . " wua ON wua.internalKey=wu.id", ($sqlQuery ? "(wu.username LIKE '{$sqlQuery}%') OR (wua.fullname LIKE '%{$sqlQuery}%') OR (wua.email LIKE '%{$sqlQuery}%')" : ""), 'username'); - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items - $grd->noRecordMsg = $_lang["no_records_found"]; - $grd->cssClass = "table data"; - $grd->columnHeaderClass = "tableHeader"; - $grd->itemClass = "tableItem"; - $grd->altItemClass = "tableAltItem"; - $grd->fields = "id,username,fullname,email,gender,blocked"; - $grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["user_full_name"] . " ," . $_lang["email"] . " ," . $_lang["user_gender"] . " ," . $_lang["user_block"]; - $grd->colWidths = "1%,,,,1%,1%"; - $grd->colAligns = "center,,,,center,right' nowrap='nowrap"; - $grd->colTypes = "template:||template:[+value+]"; - if ($listmode == '1') { - $grd->pageSize = 0; - } - if ($_REQUEST['op'] == 'reset') { - $grd->pageNumber = 1; - } - // render grid - echo $grd->render(); - ?> + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items + $grd->noRecordMsg = $_lang["no_records_found"]; + $grd->cssClass = "table data"; + $grd->columnHeaderClass = "tableHeader"; + $grd->itemClass = "tableItem"; + $grd->altItemClass = "tableAltItem"; + $grd->fields = "id,username,fullname,email,gender,blocked"; + $grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["user_full_name"] . " ," . $_lang["email"] . " ," . $_lang["user_gender"] . " ," . $_lang["user_block"]; + $grd->colWidths = "1%,,,,1%,1%"; + $grd->colAligns = "center,,,,center,right' nowrap='nowrap"; + $grd->colTypes = "template:||template:[+value+]"; + if($listmode == '1') { + $grd->pageSize = 0; + } + if($_REQUEST['op'] == 'reset') { + $grd->pageNumber = 1; + } + // render grid + echo $grd->render(); + ?>
    diff --git a/manager/actions/welcome.static.php b/manager/actions/welcome.static.php index 4c657f8c59..f36d7f58c2 100755 --- a/manager/actions/welcome.static.php +++ b/manager/actions/welcome.static.php @@ -1,13 +1,13 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly.'); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die('INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly.'); } unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes -if ($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) { - // seems to be a new install - send the user to the configuration page - exit(''); +if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) { + // seems to be a new install - send the user to the configuration page + exit(''); } // set placeholders @@ -16,93 +16,93 @@ $_SESSION['nrnewmessages'] = 0; // setup message info -if ($modx->hasPermission('messages')) { - include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); - $_SESSION['nrtotalmessages'] = $nrtotalmessages; - $_SESSION['nrnewmessages'] = $nrnewmessages; - - $msg = array(); - $msg[] = sprintf('', $_style['icons_mail_large']); - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (' . $_SESSION['nrnewmessages'] . ')' : ''; - $msg[] = sprintf(' [%%inbox%%]%s
    ', $nrnewmessages); - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '' . $_SESSION['nrnewmessages'] . '' : '0'; - $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); - $msg[] = sprintf('%s', $welcome_messages); - $ph['MessageInfo'] = implode("\n", $msg); +if($modx->hasPermission('messages')) { + include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); + $_SESSION['nrtotalmessages'] = $nrtotalmessages; + $_SESSION['nrnewmessages'] = $nrnewmessages; + + $msg = array(); + $msg[] = sprintf('', $_style['icons_mail_large']); + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (' . $_SESSION['nrnewmessages'] . ')' : ''; + $msg[] = sprintf(' [%%inbox%%]%s
    ', $nrnewmessages); + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '' . $_SESSION['nrnewmessages'] . '' : '0'; + $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); + $msg[] = sprintf('%s', $welcome_messages); + $ph['MessageInfo'] = implode("\n", $msg); } // setup icons -if ($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { - $icon = ' [%user_management_title%]'; - $ph['SecurityIcon'] = wrapIcon($icon, 75); +if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { + $icon = ' [%user_management_title%]'; + $ph['SecurityIcon'] = wrapIcon($icon, 75); } -if ($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { - $icon = ' [%web_user_management_title%]'; - $ph['WebUserIcon'] = wrapIcon($icon, 99); +if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { + $icon = ' [%web_user_management_title%]'; + $ph['WebUserIcon'] = wrapIcon($icon, 99); } -if ($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { - $icon = ' [%modules%]'; - $ph['ModulesIcon'] = wrapIcon($icon, 106); +if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { + $icon = ' [%modules%]'; + $ph['ModulesIcon'] = wrapIcon($icon, 106); } -if ($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) { - $icon = ' [%elements%]'; - $ph['ResourcesIcon'] = wrapIcon($icon, 76); +if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) { + $icon = ' [%elements%]'; + $ph['ResourcesIcon'] = wrapIcon($icon, 76); } -if ($modx->hasPermission('bk_manager')) { - $icon = ' [%backup%]'; - $ph['BackupIcon'] = wrapIcon($icon, 93); +if($modx->hasPermission('bk_manager')) { + $icon = ' [%backup%]'; + $ph['BackupIcon'] = wrapIcon($icon, 93); } -if ($modx->hasPermission('help')) { - $icon = ' [%help%]'; - $ph['HelpIcon'] = wrapIcon($icon, 9); +if($modx->hasPermission('help')) { + $icon = ' [%help%]'; + $ph['HelpIcon'] = wrapIcon($icon, 9); } -if ($modx->hasPermission('new_document')) { - $icon = '[%add_resource%]'; - $ph['ResourceIcon'] = wrapIcon($icon, 4); - $icon = '[%add_weblink%]'; - $ph['WeblinkIcon'] = wrapIcon($icon, 72); +if($modx->hasPermission('new_document')) { + $icon = '[%add_resource%]'; + $ph['ResourceIcon'] = wrapIcon($icon, 4); + $icon = '[%add_weblink%]'; + $ph['WeblinkIcon'] = wrapIcon($icon, 72); } -if ($modx->hasPermission('assets_images')) { - $icon = '[%images_management%]'; - $ph['ImagesIcon'] = wrapIcon($icon, 72); +if($modx->hasPermission('assets_images')) { + $icon = '[%images_management%]'; + $ph['ImagesIcon'] = wrapIcon($icon, 72); } -if ($modx->hasPermission('assets_files')) { - $icon = '[%files_management%]'; - $ph['FilesIcon'] = wrapIcon($icon, 72); +if($modx->hasPermission('assets_files')) { + $icon = '[%files_management%]'; + $ph['FilesIcon'] = wrapIcon($icon, 72); } -if ($modx->hasPermission('change_password')) { - $icon = '[%change_password%]'; - $ph['PasswordIcon'] = wrapIcon($icon, 28); +if($modx->hasPermission('change_password')) { + $icon = '[%change_password%]'; + $ph['PasswordIcon'] = wrapIcon($icon, 28); } $icon = '[%logout%]'; $ph['LogoutIcon'] = wrapIcon($icon, 8); // do some config checks -if (($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { - include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); - if ($config_check_results != $_lang['configcheck_ok']) { - $ph['config_check_results'] = $config_check_results; - $ph['config_display'] = 'block'; - } else { - $ph['config_display'] = 'none'; - } +if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { + include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); + if($config_check_results != $_lang['configcheck_ok']) { + $ph['config_check_results'] = $config_check_results; + $ph['config_display'] = 'block'; + } else { + $ph['config_display'] = 'none'; + } } else { - $ph['config_display'] = 'none'; + $ph['config_display'] = 'none'; } // Check logout-reminder -if (isset($_SESSION['show_logout_reminder'])) { - switch ($_SESSION['show_logout_reminder']['type']) { - case 'logout_reminder': - $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); - $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']); - break; - } - $ph['show_logout_reminder'] = 'block'; - unset($_SESSION['show_logout_reminder']); +if(isset($_SESSION['show_logout_reminder'])) { + switch($_SESSION['show_logout_reminder']['type']) { + case 'logout_reminder': + $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); + $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']); + break; + } + $ph['show_logout_reminder'] = 'block'; + unset($_SESSION['show_logout_reminder']); } else { - $ph['show_logout_reminder'] = 'none'; + $ph['show_logout_reminder'] = 'none'; } // Check multiple sessions @@ -111,13 +111,13 @@ //$count = $modx->db->getValue($rs); /* if($count > 1) { - $ph['multiple_sessions_msg'] = $modx->parseText($_lang['multiple_sessions_msg'], array( - 'username' => $_SESSION['mgrShortname'], - 'total' => $count - )); - $ph['show_multiple_sessions'] = 'block'; + $ph['multiple_sessions_msg'] = $modx->parseText($_lang['multiple_sessions_msg'], array( + 'username' => $_SESSION['mgrShortname'], + 'total' => $count + )); + $ph['show_multiple_sessions'] = 'block'; } else { - $ph['show_multiple_sessions'] = 'none'; + $ph['show_multiple_sessions'] = 'none'; }*/ $ph['show_multiple_sessions'] = 'none'; @@ -150,11 +150,11 @@ $nrnewmessages = '' . $_SESSION['nrnewmessages'] . ''; $ph['UserInfo'] = $modx->parseText($tpl, array( - 'username' => $modx->getLoginUserName(), - 'role' => $_SESSION['mgrPermissions']['name'], - 'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time), - 'logincount' => $_SESSION['mgrLogincount'] + 1, - 'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages) + 'username' => $modx->getLoginUserName(), + 'role' => $_SESSION['mgrPermissions']['name'], + 'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time), + 'logincount' => $_SESSION['mgrLogincount'] + 1, + 'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages) )); $from = array(); @@ -162,14 +162,14 @@ $from[] = " us LEFT JOIN [+prefix+]active_users au ON au.sid=us.sid WHERE au.action <> '8'"; $rs = $modx->db->select('*', $from, '', 'username ASC, au.sid ASC'); -if ($modx->db->getRecordCount($rs) < 1) { - $html = '

    [%no_active_users_found%]

    '; +if($modx->db->getRecordCount($rs) < 1) { + $html = '

    [%no_active_users_found%]

    '; } else { - include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); - $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; - $ph['now'] = strftime('%H:%M:%S', $now); - $timetocheck = ($now - (60 * 20)); //+$server_offset_time; - $html = ' + include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); + $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; + $ph['now'] = strftime('%H:%M:%S', $now); + $timetocheck = ($now - (60 * 20)); //+$server_offset_time; + $html = '
    [%onlineusers_message%] [+now+]): @@ -187,33 +187,33 @@ '; - $userList = array(); - $userCount = array(); - // Create userlist with session-count first before output - while ($activeusers = $modx->db->getRow($rs)) { - $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; - - $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; - $webicon = $activeusers['internalKey'] < 0 ? 'Web user ' : ''; - $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip']; - $currentaction = getAction($activeusers['action'], $activeusers['id']); - $userList[] = array( - $idle, - '', - $activeusers['username'], - $webicon, - abs($activeusers['internalKey']), - $ip, - strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time), - $currentaction - ); - } - foreach ($userList as $params) { - $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; - $html .= "\n\t\t" . vsprintf('%s%s%s%s%s%s', $params); - } - - $html .= ' + $userList = array(); + $userCount = array(); + // Create userlist with session-count first before output + while($activeusers = $modx->db->getRow($rs)) { + $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; + + $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; + $webicon = $activeusers['internalKey'] < 0 ? 'Web user ' : ''; + $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip']; + $currentaction = getAction($activeusers['action'], $activeusers['id']); + $userList[] = array( + $idle, + '', + $activeusers['username'], + $webicon, + abs($activeusers['internalKey']), + $ip, + strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time), + $currentaction + ); + } + foreach($userList as $params) { + $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; + $html .= "\n\t\t" . vsprintf('%s%s%s%s%s%s', $params); + } + + $html .= '
    @@ -253,18 +253,18 @@ // invoke event OnManagerWelcomePrerender $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender'); -if (is_array($evtOut)) { - $output = implode('', $evtOut); - $ph['OnManagerWelcomePrerender'] = $output; +if(is_array($evtOut)) { + $output = implode('', $evtOut); + $ph['OnManagerWelcomePrerender'] = $output; } $widgets['welcome'] = array( - 'menuindex' => '10', - 'id' => 'welcome', - 'cols' => 'col-lg-6', - 'icon' => 'fa-home', - 'title' => '[%welcome_title%]', - 'body' => ' + 'menuindex' => '10', + 'id' => 'welcome', + 'cols' => 'col-lg-6', + 'icon' => 'fa-home', + 'title' => '[%welcome_title%]', + 'body' => '
    @@ -338,25 +338,25 @@
    ', - 'hide'=>'0' + 'hide'=>'0' ); $widgets['onlineinfo'] = array( - 'menuindex' => '20', - 'id' => 'onlineinfo', - 'cols' => 'col-lg-6', - 'icon' => 'fa-user', - 'title' => '[%onlineusers_title%]', - 'body' => '
    [+OnlineInfo+]
    ', - 'hide'=>'0' + 'menuindex' => '20', + 'id' => 'onlineinfo', + 'cols' => 'col-lg-6', + 'icon' => 'fa-user', + 'title' => '[%onlineusers_title%]', + 'body' => '
    [+OnlineInfo+]
    ', + 'hide'=>'0' ); $widgets['recentinfo'] = array( - 'menuindex' => '30', - 'id' => 'modxrecent_widget', - 'cols' => 'col-sm-12', - 'icon' => 'fa-pencil-square-o', - 'title' => '[%activity_title%]', - 'body' => '
    [+RecentInfo+]
    ', - 'hide'=>'0' + 'menuindex' => '30', + 'id' => 'modxrecent_widget', + 'cols' => 'col-sm-12', + 'icon' => 'fa-pencil-square-o', + 'title' => '[%activity_title%]', + 'body' => '
    [+RecentInfo+]
    ', + 'hide'=>'0' ); if ($modx->config['rss_url_news']) { $widgets['news'] = array( @@ -383,75 +383,75 @@ // invoke OnManagerWelcomeHome event $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets)); -if (is_array($sitewidgets)) { - $newwidgets = array(); - foreach ($sitewidgets as $widget) { +if(is_array($sitewidgets)) { + $newwidgets = array(); + foreach($sitewidgets as $widget){ $newwidgets = array_merge($newwidgets, unserialize($widget)); } $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets; } usort($widgets, function ($a, $b) { - return $a['menuindex'] - $b['menuindex']; + return $a['menuindex'] - $b['menuindex']; }); $tpl = getTplWidget(); $output = ''; -foreach ($widgets as $widget) { - if ($widget['hide'] != '1') { - $output .= $modx->parseText($tpl, $widget); - } +foreach($widgets as $widget) { + if ($widget['hide'] != '1'){ + $output .= $modx->parseText($tpl, $widget); + } } $ph['widgets'] = $output; // load template -if (!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { - $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; +if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { + $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; } $target = $modx->config['manager_welcome_tpl']; $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target); $target = $modx->mergeSettingsContent($target); -if (substr($target, 0, 1) === '@') { - if (substr($target, 0, 6) === '@CHUNK') { - $content = $modx->getChunk(trim(substr($target, 7))); - } elseif (substr($target, 0, 5) === '@FILE') { - $content = file_get_contents(trim(substr($target, 6))); - } else { - $content = ''; - } +if(substr($target, 0, 1) === '@') { + if(substr($target, 0, 6) === '@CHUNK') { + $content = $modx->getChunk(trim(substr($target, 7))); + } elseif(substr($target, 0, 5) === '@FILE') { + $content = file_get_contents(trim(substr($target, 6))); + } else { + $content = ''; + } } else { - $chunk = $modx->getChunk($target); - if ($chunk !== false && !empty($chunk)) { - $content = $chunk; - } elseif (is_file(MODX_BASE_PATH . $target)) { - $content = file_get_contents(MODX_BASE_PATH . $target); - } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); - } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) { // ClipperCMS compatible - - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); - } else { - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); - } + $chunk = $modx->getChunk($target); + if($chunk !== false && !empty($chunk)) { + $content = $chunk; + } elseif(is_file(MODX_BASE_PATH . $target)) { + $content = file_get_contents(MODX_BASE_PATH . $target); + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible + { + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); + } else { + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); + } } // merge placeholders $content = $modx->mergeConditionalTagsContent($content); $content = $modx->mergeSettingsContent($content); $content = $modx->parseText($content, $ph); -if (strpos($content, '[+') !== false) { - $modx->toPlaceholders($ph); - $content = $modx->mergePlaceholderContent($content); +if(strpos($content, '[+') !== false) { + $modx->toPlaceholders($ph); + $content = $modx->mergePlaceholderContent($content); } $content = $modx->parseDocumentSource($content); $content = $modx->parseText($content, $_lang, '[%', '%]'); $content = $modx->parseText($content, $_style, '[&', '&]'); $content = $modx->cleanUpMODXTags($content); //cleanup -if ($js = $modx->getRegisteredClientScripts()) { - $content .= $js; +if($js = $modx->getRegisteredClientScripts()) { + $content .= $js; } echo $content; @@ -460,9 +460,8 @@ // // // -function getTplWidget() -{ // recent document info - return ' +function getTplWidget() { // recent document info + return '
    [+title+]
    @@ -472,13 +471,12 @@ function getTplWidget() '; } -function getRecentInfo() -{ // recent document info - $modx = evolutionCMS(); +function getRecentInfo() { // recent document info + $modx = evolutionCMS(); - $modx->addSnippet('recentInfoList', 'getRecentInfoList'); + $modx->addSnippet('recentInfoList', 'getRecentInfoList'); - $html = ' + $html = '
    @@ -496,98 +494,96 @@ function getRecentInfo()
    '; - return $html; + return $html; } -function getRecentInfoList() -{ - $modx = evolutionCMS(); - - $rs = $modx->db->select('*', '[+prefix+]site_content', '', 'editedon DESC', 10); - - if ($modx->db->getRecordCount($rs) < 1) { - return '[%no_activity_message%]'; - } - - $tpl = getRecentInfoRowTpl(); - - $btntpl['edit'] = ' '; - $btntpl['preview_btn'] = ' '; - - $output = array(); - while ($ph = $modx->db->getRow($rs)) { - $docid = $ph['id']; - $_ = $modx->getUserInfo($ph['editedby']); - $ph['username'] = $_['username']; - - if ($ph['deleted'] == 1) { - $ph['status'] = 'deleted text-danger'; - } elseif ($ph['published'] == 0) { - $ph['status'] = 'unpublished font-italic text-muted'; - } else { - $ph['status'] = 'published'; - } - - if ($modx->hasPermission('edit_document')) { - $ph['edit_btn'] = str_replace('[+id+]', $docid, $btntpl['edit']); - } else { - $ph['edit_btn'] = ''; - } - - $preview_disabled = ($ph['deleted'] == 1) ? 'disabled' : ''; - $ph['preview_btn'] = str_replace(array( - '[+id+]', - '[+preview_disabled+]' - ), array( - $docid, - $preview_disabled - ), $btntpl['preview_btn']); - - if ($modx->hasPermission('delete_document')) { - if ($ph['deleted'] == 0) { - $delete_btn = ' '; - } else { - $delete_btn = ' '; - } - $ph['delete_btn'] = str_replace('[+id+]', $docid, $delete_btn); - } else { - $ph['delete_btn'] = ''; - } - - if ($ph['deleted'] == 1 && $ph['published'] == 0) { - $publish_btn = ' '; - } elseif ($ph['deleted'] == 1 && $ph['published'] == 1) { - $publish_btn = ' '; - } elseif ($ph['deleted'] == 0 && $ph['published'] == 0) { - $publish_btn = ' '; - } else { - $publish_btn = ' '; - } - $ph['publish_btn'] = str_replace('[+id+]', $docid, $publish_btn); - - $ph['info_btn'] = str_replace('[+id+]', $docid, ''); - - if ($ph['longtitle'] == '') { - $ph['longtitle'] = '([%not_set%])'; - } - if ($ph['description'] == '') { - $ph['description'] = '([%not_set%])'; - } - if ($ph['introtext'] == '') { - $ph['introtext'] = '([%not_set%])'; - } - if ($ph['alias'] == '') { - $ph['alias'] = '([%not_set%])'; - } - - $output[] = $modx->parseText($tpl, $ph); - } - return implode("\n", $output); +function getRecentInfoList() { + $modx = evolutionCMS(); + + $rs = $modx->db->select('*', '[+prefix+]site_content', '', 'editedon DESC', 10); + + if($modx->db->getRecordCount($rs) < 1) { + return '[%no_activity_message%]'; + } + + $tpl = getRecentInfoRowTpl(); + + $btntpl['edit'] = ' '; + $btntpl['preview_btn'] = ' '; + + $output = array(); + while($ph = $modx->db->getRow($rs)) { + $docid = $ph['id']; + $_ = $modx->getUserInfo($ph['editedby']); + $ph['username'] = $_['username']; + + if($ph['deleted'] == 1) { + $ph['status'] = 'deleted text-danger'; + } elseif($ph['published'] == 0) { + $ph['status'] = 'unpublished font-italic text-muted'; + } else { + $ph['status'] = 'published'; + } + + if($modx->hasPermission('edit_document')) { + $ph['edit_btn'] = str_replace('[+id+]', $docid, $btntpl['edit']); + } else { + $ph['edit_btn'] = ''; + } + + $preview_disabled = ($ph['deleted'] == 1) ? 'disabled' : ''; + $ph['preview_btn'] = str_replace(array( + '[+id+]', + '[+preview_disabled+]' + ), array( + $docid, + $preview_disabled + ), $btntpl['preview_btn']); + + if($modx->hasPermission('delete_document')) { + if($ph['deleted'] == 0) { + $delete_btn = ' '; + } else { + $delete_btn = ' '; + } + $ph['delete_btn'] = str_replace('[+id+]', $docid, $delete_btn); + } else { + $ph['delete_btn'] = ''; + } + + if($ph['deleted'] == 1 && $ph['published'] == 0) { + $publish_btn = ' '; + } elseif($ph['deleted'] == 1 && $ph['published'] == 1) { + $publish_btn = ' '; + } elseif($ph['deleted'] == 0 && $ph['published'] == 0) { + $publish_btn = ' '; + } else { + $publish_btn = ' '; + } + $ph['publish_btn'] = str_replace('[+id+]', $docid, $publish_btn); + + $ph['info_btn'] = str_replace('[+id+]', $docid, ''); + + if($ph['longtitle'] == '') { + $ph['longtitle'] = '([%not_set%])'; + } + if($ph['description'] == '') { + $ph['description'] = '([%not_set%])'; + } + if($ph['introtext'] == '') { + $ph['introtext'] = '([%not_set%])'; + } + if($ph['alias'] == '') { + $ph['alias'] = '([%not_set%])'; + } + + $output[] = $modx->parseText($tpl, $ph); + } + return implode("\n", $output); } -function getRecentInfoRowTpl() -{ - $tpl = ' +function getRecentInfoRowTpl() { + $tpl = ' [+id+] [+pagetitle+] @@ -611,18 +607,16 @@ function getRecentInfoRowTpl()
    '; - return $tpl; + return $tpl; } // setup icons -function wrapIcon($i, $action) -{ - return sprintf('%s', $action, $i); +function wrapIcon($i, $action) { + return sprintf('%s', $action, $i); } -function getStartUpScript() -{ - $script = ' +function getStartUpScript() { + $script = ' '; - return $script; + return $script; } diff --git a/manager/frames/1.php b/manager/frames/1.php index 5a6015b09e..a34aa16e55 100755 --- a/manager/frames/1.php +++ b/manager/frames/1.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } header("X-XSS-Protection: 0"); @@ -119,12 +119,10 @@ - config['show_picker'] != "0") { - ?> + config['show_picker'] != "0") { ?> - + + $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $tend = $mtime; $totaltime = ($tend - $tstart); + ?>
    @@ -47,7 +44,7 @@ function removeDebugDiv() { - +
    Time taken
    diff --git a/manager/includes/default_config.php b/manager/includes/default_config.php index 72b9fabc18..e002f11942 100755 --- a/manager/includes/default_config.php +++ b/manager/includes/default_config.php @@ -111,3 +111,6 @@ $c['login_form_position'] = 'left'; $c['manager_menu_position'] = 'top'; $c['tinymce4_skin'] = 'lightgray'; + + + diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index 3b69061896..bcce93c755 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -225,7 +225,7 @@ public static function getInstance() * @param $arguments * @return mixed */ - public function __call($method_name, $arguments) + function __call($method_name, $arguments) { include_once(MODX_MANAGER_PATH . 'includes/extenders/deprecated.functions.inc.php'); if (method_exists($this->old, $method_name)) { @@ -310,7 +310,7 @@ public function loadExtension($extname, $reload = true) */ public function getMicroTime() { - list($usec, $sec) = explode(' ', microtime()); + list ($usec, $sec) = explode(' ', microtime()); return ((float)$usec + (float)$sec); } @@ -328,12 +328,12 @@ public function getMicroTime() public function sendRedirect($url, $count_attempts = 0, $type = '', $responseCode = '') { $header = ''; - if (empty($url)) { + if (empty ($url)) { return false; } if ($count_attempts == 1) { // append the redirect count string to the url - $currentNumberOfRedirects = isset($_REQUEST['err']) ? $_REQUEST['err'] : 0; + $currentNumberOfRedirects = isset ($_REQUEST['err']) ? $_REQUEST['err'] : 0; if ($currentNumberOfRedirects > 3) { $this->messageQuit('Redirection attempt failed - please ensure the document you\'re trying to redirect to exists.

    Redirection URL: ' . $url . '

    '); } else { @@ -351,7 +351,7 @@ public function sendRedirect($url, $count_attempts = 0, $type = '', $responseCod $header = ''; echo $header; exit; - } elseif ($type == 'REDIRECT_HEADER' || empty($type)) { + } elseif ($type == 'REDIRECT_HEADER' || empty ($type)) { // check if url has /$base_url global $base_url, $site_url; if (substr($url, 0, strlen($base_url)) == $base_url) { @@ -368,7 +368,7 @@ public function sendRedirect($url, $count_attempts = 0, $type = '', $responseCod header($responseCode); } - if (!empty($header)) { + if(!empty($header)) { header($header); } @@ -526,7 +526,7 @@ public function getUserSettings() $usrSettings = array(); if ($id = $this->getLoginUserID()) { $usrType = $this->getLoginUserType(); - if (isset($usrType) && $usrType == 'manager') { + if (isset ($usrType) && $usrType == 'manager') { $usrType = 'mgr'; } @@ -535,7 +535,7 @@ public function getUserSettings() $this->invokeEvent("OnBeforeManagerPageInit"); } - if (isset($_SESSION[$usrType . 'UsrConfigSet'])) { + if (isset ($_SESSION[$usrType . 'UsrConfigSet'])) { $usrSettings = &$_SESSION[$usrType . 'UsrConfigSet']; } else { if ($usrType == 'web') { @@ -555,14 +555,14 @@ public function getUserSettings() } $usrSettings[$row['setting_name']] = $row['setting_value']; } - if (isset($usrType)) { + if (isset ($usrType)) { $_SESSION[$usrType . 'UsrConfigSet'] = $usrSettings; } // store user settings in session } } if ($this->isFrontend() && $mgrid = $this->getLoginUserID('mgr')) { $musrSettings = array(); - if (isset($_SESSION['mgrUsrConfigSet'])) { + if (isset ($_SESSION['mgrUsrConfigSet'])) { $musrSettings = &$_SESSION['mgrUsrConfigSet']; } else { if ($result = $this->db->select('setting_name, setting_value', $tbl_user_settings, "user='{$mgrid}'")) { @@ -572,7 +572,7 @@ public function getUserSettings() $_SESSION['mgrUsrConfigSet'] = $musrSettings; // store user settings in session } } - if (!empty($musrSettings)) { + if (!empty ($musrSettings)) { $usrSettings = array_merge($musrSettings, $usrSettings); } } @@ -656,7 +656,7 @@ public function checkSession() public function checkPreview() { if ($this->isLoggedIn() == true) { - if (isset($_REQUEST['z']) && $_REQUEST['z'] == 'manprev') { + if (isset ($_REQUEST['z']) && $_REQUEST['z'] == 'manprev') { return true; } else { return false; @@ -767,23 +767,22 @@ public function getHashFile($key) * @param $id * @return array|mixed|null|string */ - public function makePageCacheKey($id) - { + public function makePageCacheKey($id){ $hash = $id; $tmp = null; $params = array(); - if (!empty($this->systemCacheKey)) { + if(!empty($this->systemCacheKey)){ $hash = $this->systemCacheKey; - } else { + }else { if (!empty($_GET)) { // Sort GET parameters so that the order of parameters on the HTTP request don't affect the generated cache ID. $params = $_GET; ksort($params); - $hash .= '_' . md5(http_build_query($params)); + $hash .= '_'.md5(http_build_query($params)); } } - $evtOut = $this->invokeEvent("OnMakePageCacheKey", array("hash" => $hash, "id" => $id, 'params' => $params)); - if (is_array($evtOut) && count($evtOut) > 0) { + $evtOut = $this->invokeEvent("OnMakePageCacheKey", array ("hash" => $hash, "id" => $id, 'params' => $params)); + if (is_array($evtOut) && count($evtOut) > 0){ $tmp = array_pop($evtOut); } return empty($tmp) ? $hash : $tmp; @@ -830,7 +829,7 @@ public function getDocumentObjectFromCache($id, $loading = false) else { $docObj = unserialize($a[0]); // rebuild document object // check page security - if ($docObj['privateweb'] && isset($docObj['__MODxDocGroups__'])) { + if ($docObj['privateweb'] && isset ($docObj['__MODxDocGroups__'])) { $pass = false; $usrGrps = $this->getUserDocGroups(); $docGrps = explode(',', $docObj['__MODxDocGroups__']); @@ -940,7 +939,7 @@ public function outputContent($noEvent = false) // send out content-type and content-disposition headers if (IN_PARSER_MODE == "true") { - $type = !empty($this->contentTypes[$this->documentIdentifier]) ? $this->contentTypes[$this->documentIdentifier] : "text/html"; + $type = !empty ($this->contentTypes[$this->documentIdentifier]) ? $this->contentTypes[$this->documentIdentifier] : "text/html"; header('Content-Type: ' . $type . '; charset=' . $this->config['modx_charset']); // if (($this->documentIdentifier == $this->config['error_page']) || $redirect_error) // header('HTTP/1.0 404 Not Found'); @@ -1063,7 +1062,7 @@ public function getTimerStats($tstart) $stats['totalTime'] = sprintf("%2.4f s", $stats['totalTime']); $stats['phpTime'] = sprintf("%2.4f s", $stats['phpTime']); $stats['source'] = $this->documentGenerated == 1 ? "database" : "cache"; - $stats['queries'] = isset($this->executedQueries) ? $this->executedQueries : 0; + $stats['queries'] = isset ($this->executedQueries) ? $this->executedQueries : 0; $stats['phpMemory'] = (memory_get_peak_usage(true) / 1024 / 1024) . " mb"; return $stats; @@ -1108,7 +1107,7 @@ public function updatePubStatus() // now, check for documents that need publishing $field = array('published' => 1, 'publishedon' => $timeNow); $where = "pub_date <= {$timeNow} AND pub_date!=0 AND published=0"; - $result_pub = $this->db->select('id', '[+prefix+]site_content', $where); + $result_pub = $this->db->select( 'id', '[+prefix+]site_content', $where); $this->db->update($field, '[+prefix+]site_content', $where); if ($this->db->getRecordCount($result_pub) >= 1) { //Event unPublished doc while ($row_pub = $this->db->getRow($result_pub)) { @@ -1121,7 +1120,7 @@ public function updatePubStatus() // now, check for documents that need un-publishing $field = array('published' => 0, 'publishedon' => 0); $where = "unpub_date <= {$timeNow} AND unpub_date!=0 AND published=1"; - $result_unpub = $this->db->select('id', '[+prefix+]site_content', $where); + $result_unpub = $this->db->select( 'id', '[+prefix+]site_content', $where); $this->db->update($field, '[+prefix+]site_content', $where); if ($this->db->getRecordCount($result_unpub) >= 1) { //Event unPublished doc while ($row_unpub = $this->db->getRow($result_unpub)) { @@ -1210,18 +1209,10 @@ public function _getTagsFromContent($content, $left = '[+', $right = '+]') return array(); } $spacer = md5('<<>>'); - if ($left==='{{' && strpos($content, ';}}')!==false) { - $content = str_replace(';}}', sprintf(';}%s}', $spacer), $content); - } - if ($left==='{{' && strpos($content, '{{}}')!==false) { - $content = str_replace('{{}}', sprintf('{%$1s{}%$1s}', $spacer), $content); - } - if ($left==='[[' && strpos($content, ']]]]')!==false) { - $content = str_replace(']]]]', sprintf(']]%s]]', $spacer), $content); - } - if ($left==='[[' && strpos($content, ']]]')!==false) { - $content = str_replace(']]]', sprintf(']%s]]', $spacer), $content); - } + if($left==='{{' && strpos($content,';}}')!==false) $content = str_replace(';}}', sprintf(';}%s}', $spacer),$content); + if($left==='{{' && strpos($content,'{{}}')!==false) $content = str_replace('{{}}',sprintf('{%$1s{}%$1s}',$spacer),$content); + if($left==='[[' && strpos($content,']]]]')!==false) $content = str_replace(']]]]',sprintf(']]%s]]', $spacer),$content); + if($left==='[[' && strpos($content,']]]')!==false) $content = str_replace(']]]', sprintf(']%s]]', $spacer),$content); $pos[''] = strpos($content, ']]>'); @@ -1291,10 +1282,8 @@ public function _getTagsFromContent($content, $left = '[+', $right = '+]') } } } - foreach ($tags as $i=>$tag) { - if (strpos($tag, $spacer)!==false) { - $tags[$i] = str_replace($spacer, '', $tag); - } + foreach($tags as $i=>$tag) { + if(strpos($tag,$spacer)!==false) $tags[$i] = str_replace($spacer, '', $tag); } return $tags; } @@ -1334,9 +1323,7 @@ public function mergeDocumentContent($content, $ph = false) } foreach ($matches[1] as $i => $key) { - if (strpos($key, '[+')!==false) { - continue; - } // Allow chunk {{chunk?¶m=`xxx`}} with [*tv_name_[+param+]*] as content + if(strpos($key,'[+')!==false) continue; // Allow chunk {{chunk?¶m=`xxx`}} with [*tv_name_[+param+]*] as content if (substr($key, 0, 1) == '#') { $key = substr($key, 1); } // remove # for QuickEdit format @@ -1368,7 +1355,7 @@ public function mergeDocumentContent($content, $ph = false) if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('mergeDocumentContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -1536,7 +1523,7 @@ public function mergeSettingsContent($content, $ph = false) $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('mergeSettingsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -1605,7 +1592,7 @@ public function mergeChunkContent($content, $ph = false) $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('mergeChunkContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -1621,6 +1608,7 @@ public function mergeChunkContent($content, $ph = false) */ public function mergePlaceholderContent($content, $ph = false) { + if ($this->config['enable_at_syntax']) { if (stripos($content, '<@LITERAL>') !== false) { $content = $this->escapeLiteralTagsContent($content); @@ -1645,6 +1633,7 @@ public function mergePlaceholderContent($content, $ph = false) return $content; } foreach ($matches[1] as $i => $key) { + list($key, $modifiers) = $this->splitKeyAndFilter($key); if (isset($ph[$key])) { @@ -1662,7 +1651,7 @@ public function mergePlaceholderContent($content, $ph = false) $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('mergePlaceholderContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -1831,7 +1820,7 @@ private function _parseCTagCMD($cmd) * @param string $right * @return mixed */ - public function ignoreCommentedTagsContent($content, $left = '') + function ignoreCommentedTagsContent($content, $left = '') { if (strpos($content, $left) === false) { return $content; @@ -1873,7 +1862,7 @@ public function escapeLiteralTagsContent($content, $left = '<@LITERAL>', $right $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $v, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('ignoreCommentedTagsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -2030,7 +2019,7 @@ public function evalSnippets($content) } if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('evalSnippetsSGVar parse error', $_SERVER['REQUEST_URI'] . $s, 2); } continue; @@ -2042,7 +2031,7 @@ public function evalSnippets($content) if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('evalSnippets parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -2510,6 +2499,7 @@ public function rewriteUrls($documentSource) } return $out; }, $documentSource); + } else { $in = '!\[\~([0-9]+)\~\]!is'; $out = "index.php?id=" . '\1'; @@ -2594,6 +2584,7 @@ public function sendStrictURI() */ public function getDocumentObject($method, $identifier, $isPrepareResponse = false) { + $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { return $this->tmpCache[__FUNCTION__][$cacheKey]; @@ -2696,8 +2687,8 @@ public function getDocumentObject($method, $identifier, $isPrepareResponse = fal public function parseDocumentSource($source) { // set the number of times we are to parse the document source - $this->minParserPasses = empty($this->minParserPasses) ? 2 : $this->minParserPasses; - $this->maxParserPasses = empty($this->maxParserPasses) ? 10 : $this->maxParserPasses; + $this->minParserPasses = empty ($this->minParserPasses) ? 2 : $this->minParserPasses; + $this->maxParserPasses = empty ($this->maxParserPasses) ? 10 : $this->maxParserPasses; $passes = $this->minParserPasses; for ($i = 0; $i < $passes; $i++) { // get source length if this is the final pass @@ -2747,7 +2738,7 @@ public function parseDocumentSource($source) */ public function executeParser() { - if (MODX_CLI) { + if(MODX_CLI) { throw new RuntimeException('Call DocumentParser::executeParser on CLI mode'); } @@ -2759,7 +2750,7 @@ public function executeParser() $this->db->connect(); // get the settings - if (empty($this->config)) { + if (empty ($this->config)) { $this->getSettings(); } @@ -2901,11 +2892,11 @@ public function _IIS_furl_fix() } $k = array_keys($_GET); - unset($_GET[$k[0]]); - unset($_REQUEST[$k[0]]); // remove 404,405 entry + unset ($_GET[$k[0]]); + unset ($_REQUEST[$k[0]]); // remove 404,405 entry $qp = parse_url(str_replace($this->config['site_url'], '', substr($url, 4))); $_SERVER['QUERY_STRING'] = $qp['query']; - if (!empty($qp['query'])) { + if (!empty ($qp['query'])) { parse_str($qp['query'], $qv); foreach ($qv as $n => $v) { $_REQUEST[$n] = $_GET[$n] = $v; @@ -3102,12 +3093,14 @@ public function getUltimateParentId($id, $top = 0) */ public function getChildIds($id, $depth = 10, $children = array()) { + $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { return $this->tmpCache[__FUNCTION__][$cacheKey]; } if ($this->config['aliaslistingfolder'] == 1) { + $res = $this->db->select("id,alias,isfolder,parent", $this->getFullTableName('site_content'), "parent IN (" . $id . ") AND deleted = '0'"); $idx = array(); while ($row = $this->db->getRow($res)) { @@ -3130,6 +3123,7 @@ public function getChildIds($id, $depth = 10, $children = array()) } $this->tmpCache[__FUNCTION__][$cacheKey] = $children; return $children; + } else { // Initialise a static array to index parents->children @@ -3160,6 +3154,7 @@ public function getChildIds($id, $depth = 10, $children = array()) } $this->tmpCache[__FUNCTION__][$cacheKey] = $children; return $children; + } } @@ -3330,6 +3325,7 @@ public function cleanupExpiredLocks() } else { $this->db->delete($this->getFullTableName('active_user_locks')); } + } /** @@ -3365,11 +3361,13 @@ public function cleanupMultipleActiveUsers() $deleteSids .= $deleteSids == '' ? '' : ' OR '; $deleteSids .= "sid='{$row['sid']}'"; }; + } if ($deleteSids) { $this->db->delete($this->getFullTableName('active_users'), $deleteSids); } } + } /** @@ -3670,6 +3668,7 @@ public function isFrontend() */ public function getAllChildren($id = 0, $sort = 'menuindex', $dir = 'ASC', $fields = 'id, pagetitle, description, parent, alias, menutitle') { + $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { return $this->tmpCache[__FUNCTION__][$cacheKey]; @@ -3751,6 +3750,7 @@ public function getActiveChildren($id = 0, $sort = 'menuindex', $dir = 'ASC', $f */ public function getDocumentChildren($parentid = 0, $published = 1, $deleted = 0, $fields = '*', $where = '', $sort = 'menuindex', $dir = 'ASC', $limit = '') { + $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { return $this->tmpCache[__FUNCTION__][$cacheKey]; @@ -3807,6 +3807,7 @@ public function getDocumentChildren($parentid = 0, $published = 1, $deleted = 0, */ public function getDocuments($ids = array(), $published = 1, $deleted = 0, $fields = '*', $where = '', $sort = 'menuindex', $dir = 'ASC', $limit = '') { + $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { return $this->tmpCache[__FUNCTION__][$cacheKey]; @@ -3936,6 +3937,7 @@ public function getField($field = 'content', $docid = '') */ public function getPageInfo($pageid = -1, $active = 1, $fields = 'id, pagetitle, description, alias') { + $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { return $this->tmpCache[__FUNCTION__][$cacheKey]; @@ -3980,7 +3982,7 @@ public function getParent($pid = -1, $active = 1, $fields = 'id, pagetitle, desc if ($pid == -1) { $pid = $this->documentObject['parent']; return ($pid == 0) ? false : $this->getPageInfo($pid, $active, $fields); - } elseif ($pid == 0) { + } else if ($pid == 0) { return false; } else { // first get the child document @@ -4109,6 +4111,7 @@ public function makeUrl($id, $alias = '', $args = '', $scheme = '') $alPath = ''; if ($this->config['friendly_alias_urls'] == 1) { + if ($this->config['aliaslistingfolder'] == 1) { $al = $this->getAliasListing($id); } else { @@ -4119,11 +4122,12 @@ public function makeUrl($id, $alias = '', $args = '', $scheme = '') $f_url_suffix = '/'; } - $alPath = !empty($al['path']) ? $al['path'] . '/' : ''; + $alPath = !empty ($al['path']) ? $al['path'] . '/' : ''; if ($al && $al['alias']) { $alias = $al['alias']; } + } $alias = $alPath . $f_url_prefix . $alias . $f_url_suffix; @@ -4216,7 +4220,7 @@ public function getAliasListing($id) */ public function getConfig($name = '') { - if (!empty($this->config[$name])) { + if (!empty ($this->config[$name])) { return $this->config[$name]; } else { return false; @@ -4255,7 +4259,7 @@ public function getVersionData($data = null) */ public function runSnippet($snippetName, $params = array()) { - if (isset($this->snippetCache[$snippetName])) { + if (isset ($this->snippetCache[$snippetName])) { $snippet = $this->snippetCache[$snippetName]; $properties = !empty($this->snippetCache[$snippetName . "Props"]) ? $this->snippetCache[$snippetName . "Props"] : ''; } else { // not in cache so let's check the db @@ -4291,9 +4295,9 @@ public function getChunk($chunkName) if (empty($chunkName)) { return $out; } - if (isset($this->chunkCache[$chunkName])) { + if (isset ($this->chunkCache[$chunkName])) { $out = $this->chunkCache[$chunkName]; - } elseif (stripos($chunkName, '@FILE') === 0) { + } else if (stripos($chunkName, '@FILE') === 0) { $out = $this->chunkCache[$chunkName] = $this->atBindFileContent($chunkName); } else { $where = sprintf("`name`='%s' AND disabled=0", $this->db->escape($chunkName)); @@ -4345,6 +4349,7 @@ public function parseText($tpl = '', $ph = array(), $left = '[+', $right = '+]', } foreach ($matches[1] as $i => $key) { + if (strpos($key, ':') !== false && $execModifier) { list($key, $modifiers) = $this->splitKeyAndFilter($key); } else { @@ -4367,7 +4372,7 @@ public function parseText($tpl = '', $ph = array(), $left = '[+', $right = '+]', } if (strpos($tpl, $s) !== false) { $tpl = str_replace($s, $value, $tpl); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('parseText parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -4497,19 +4502,19 @@ public function toTimeStamp($str) if (!preg_match('/^[0-9]{4}\/[0-9]{2}\/[0-9]{2}[0-9 :]*$/', $str)) { return ''; } - list($Y, $m, $d, $H, $M, $S) = sscanf($str, '%4d/%2d/%2d %2d:%2d:%2d'); + list ($Y, $m, $d, $H, $M, $S) = sscanf($str, '%4d/%2d/%2d %2d:%2d:%2d'); break; case 'dd-mm-YYYY': if (!preg_match('/^[0-9]{2}-[0-9]{2}-[0-9]{4}[0-9 :]*$/', $str)) { return ''; } - list($d, $m, $Y, $H, $M, $S) = sscanf($str, '%2d-%2d-%4d %2d:%2d:%2d'); + list ($d, $m, $Y, $H, $M, $S) = sscanf($str, '%2d-%2d-%4d %2d:%2d:%2d'); break; case 'mm/dd/YYYY': if (!preg_match('/^[0-9]{2}\/[0-9]{2}\/[0-9]{4}[0-9 :]*$/', $str)) { return ''; } - list($m, $d, $Y, $H, $M, $S) = sscanf($str, '%2d/%2d/%4d %2d:%2d:%2d'); + list ($m, $d, $Y, $H, $M, $S) = sscanf($str, '%2d/%2d/%4d %2d:%2d:%2d'); break; /* case 'dd-mmm-YYYY': @@ -4586,6 +4591,7 @@ public function getDocumentChildrenTVars($parentid = 0, $tvidnames = array(), $p $this->getUserDocGroups(); foreach ($docs as $doc) { + $docid = $doc['id']; $rs = $this->db->select("{$fields}, IF(tvc.value!='',tvc.value,tv.default_text) as value ", "[+prefix+]site_tmplvars tv @@ -4648,7 +4654,7 @@ public function getDocumentChildrenTVarOutput($parentid = 0, $tvidnames = array( $tvidnames[] = $resultKey; $unsetResultKey = true; } - } elseif ($tvidnames != '*' && $tvidnames != $resultKey) { + } else if ($tvidnames != '*' && $tvidnames != $resultKey) { $tvidnames = array($tvidnames, $resultKey); $unsetResultKey = true; } @@ -4723,7 +4729,7 @@ public function getTemplateVars($idnames = array(), $fields = '*', $docid = '', return $this->tmpCache[__FUNCTION__][$cacheKey]; } - if (($idnames != '*' && !is_array($idnames)) || empty($idnames)) { + if (($idnames != '*' && !is_array($idnames)) || empty($idnames) ) { return false; } else { @@ -4757,7 +4763,7 @@ public function getTemplateVars($idnames = array(), $fields = '*', $docid = '', $result = $this->db->makeArray($rs); // get default/built-in template variables - if (is_array($docRow)) { + if(is_array($docRow)){ ksort($docRow); foreach ($docRow as $key => $value) { @@ -4795,7 +4801,7 @@ public function getTemplateVars($idnames = array(), $fields = '*', $docid = '', */ public function getTemplateVarOutput($idnames = array(), $docid = '', $published = 1, $sep = '') { - if (is_array($idnames) && empty($idnames)) { + if (is_array($idnames) && empty($idnames) ) { return false; } else { $output = array(); @@ -4971,11 +4977,11 @@ public function getLoginUserID($context = '') } } else { switch (true) { - case ($this->isFrontend() && isset($_SESSION['webValidated'])): { + case ($this->isFrontend() && isset ($_SESSION['webValidated'])): { $out = $_SESSION['webInternalKey']; break; } - case ($this->isBackend() && isset($_SESSION['mgrValidated'])): { + case ($this->isBackend() && isset ($_SESSION['mgrValidated'])): { $out = $_SESSION['mgrInternalKey']; break; } @@ -5000,11 +5006,11 @@ public function getLoginUserName($context = '') } } else { switch (true) { - case ($this->isFrontend() && isset($_SESSION['webValidated'])): { + case ($this->isFrontend() && isset ($_SESSION['webValidated'])): { $out = $_SESSION['webShortname']; break; } - case ($this->isBackend() && isset($_SESSION['mgrValidated'])): { + case ($this->isBackend() && isset ($_SESSION['mgrValidated'])): { $out = $_SESSION['mgrShortname']; break; } @@ -5020,9 +5026,9 @@ public function getLoginUserName($context = '') */ public function getLoginUserType() { - if ($this->isFrontend() && isset($_SESSION['webValidated'])) { + if ($this->isFrontend() && isset ($_SESSION['webValidated'])) { return 'web'; - } elseif ($this->isBackend() && isset($_SESSION['mgrValidated'])) { + } elseif ($this->isBackend() && isset ($_SESSION['mgrValidated'])) { return 'manager'; } else { return ''; @@ -5091,7 +5097,7 @@ public function getUserDocGroups($resolveIds = false) if ($this->isFrontend() && isset($_SESSION['webDocgroups']) && isset($_SESSION['webValidated'])) { $dg = $_SESSION['webDocgroups']; $dgn = isset($_SESSION['webDocgrpNames']) ? $_SESSION['webDocgrpNames'] : false; - } elseif ($this->isBackend() && isset($_SESSION['mgrDocgroups']) && isset($_SESSION['mgrValidated'])) { + } else if ($this->isBackend() && isset($_SESSION['mgrDocgroups']) && isset($_SESSION['mgrValidated'])) { $dg = $_SESSION['mgrDocgroups']; $dgn = isset($_SESSION['mgrDocgrpNames']) ? $_SESSION['mgrDocgrpNames'] : false; } else { @@ -5099,9 +5105,9 @@ public function getUserDocGroups($resolveIds = false) } if (!$resolveIds) { return $dg; - } elseif (is_array($dgn)) { + } else if (is_array($dgn)) { return $dgn; - } elseif (is_array($dg)) { + } else if (is_array($dg)) { // resolve ids to names $dgn = array(); $ds = $this->db->select('name', $this->getFullTableName("documentgroup_names"), "id IN (" . implode(",", $dg) . ")"); @@ -5171,7 +5177,7 @@ public function isMemberOfWebGroup($groupNames = array()) return false; } // check cache - $grpNames = isset($_SESSION['webUserGroupNames']) ? $_SESSION['webUserGroupNames'] : false; + $grpNames = isset ($_SESSION['webUserGroupNames']) ? $_SESSION['webUserGroupNames'] : false; if (!is_array($grpNames)) { $rs = $this->db->select('wgn.name', $this->getFullTableName("webgroup_names") . " wgn INNER JOIN " . $this->getFullTableName("web_groups") . " wg ON wg.webgroup=wgn.id AND wg.webuser='" . $this->getLoginUserID() . "'"); @@ -5197,7 +5203,7 @@ public function isMemberOfWebGroup($groupNames = array()) */ public function regClientCSS($src, $media = '') { - if (empty($src) || isset($this->loadedjscripts[$src])) { + if (empty($src) || isset ($this->loadedjscripts[$src])) { return ''; } $nextpos = max(array_merge(array(0), array_keys($this->sjscripts))) + 1; @@ -5236,11 +5242,11 @@ public function regClientScript($src, $options = array('name' => '', 'version' = return ''; } // nothing to register if (!is_array($options)) { - if (is_bool($options)) { // backward compatibility with old plaintext parameter - + if (is_bool($options)) // backward compatibility with old plaintext parameter + { $options = array('plaintext' => $options); - } elseif (is_string($options)) { // Also allow script name as 2nd param - + } elseif (is_string($options)) // Also allow script name as 2nd param + { $options = array('name' => $options); } else { $options = array(); @@ -5369,7 +5375,7 @@ public function removeEventListener($evtName) if (!$evtName) { return false; } - unset($this->pluginEvent[$evtName]); + unset ($this->pluginEvent[$evtName]); } /** @@ -5377,7 +5383,7 @@ public function removeEventListener($evtName) */ public function removeAllEventListener() { - unset($this->pluginEvent); + unset ($this->pluginEvent); $this->pluginEvent = array(); } @@ -5393,7 +5399,7 @@ public function invokeEvent($evtName, $extParams = array()) if (!$evtName) { return false; } - if (!isset($this->pluginEvent[$evtName])) { + if (!isset ($this->pluginEvent[$evtName])) { return false; } @@ -5459,7 +5465,7 @@ public function invokeEvent($evtName, $extParams = array()) public function getPluginCode($pluginName) { $plugin = array(); - if (isset($this->pluginCache[$pluginName])) { + if (isset ($this->pluginCache[$pluginName])) { $pluginCode = $this->pluginCache[$pluginName]; $pluginProperties = isset($this->pluginCache[$pluginName . "Props"]) ? $this->pluginCache[$pluginName . "Props"] : ''; } else { @@ -5499,6 +5505,7 @@ public function parseProperties($propertyString, $elementName = null, $elementTy if ($jsonFormat === false) { $props = explode('&', $propertyString); foreach ($props as $prop) { + if (empty($prop)) { continue; } elseif (strpos($prop, '=') === false) { @@ -5524,7 +5531,7 @@ public function parseProperties($propertyString, $elementName = null, $elementTy } } // new json-format - } elseif (!empty($jsonFormat)) { + } else if (!empty($jsonFormat)) { foreach ($jsonFormat as $key => $row) { if (!empty($key)) { if (is_array($row)) { @@ -5901,17 +5908,17 @@ public function safeEval($phpcode = '', $evalmode = '', $safe_functions = '') modx_sanitize_gpc($phpcode); switch ($evalmode) { - case 'with_scan': + case 'with_scan' : $isSafe = $this->isSafeCode($phpcode, $safe_functions); break; - case 'with_scan_at_post': + case 'with_scan_at_post' : $isSafe = $_POST ? $this->isSafeCode($phpcode, $safe_functions) : true; break; - case 'everytime_eval': + case 'everytime_eval' : $isSafe = true; break; // Should debug only - case 'dont_eval': - default: + case 'dont_eval' : + default : return $phpcode; } @@ -5984,6 +5991,7 @@ public function isSafeCode($phpcode = '', $safe_functions = '') */ public function atBindFileContent($str = '') { + $search_path = array('assets/tvs/', 'assets/chunks/', 'assets/templates/', $this->config['rb_base_url'] . 'files/', ''); if (stripos($str, '@FILE') !== 0) { @@ -6115,6 +6123,7 @@ public function phpError($nr, $text, $file, $line) */ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = true, $nr = '', $file = '', $source = '', $text = '', $line = '', $output = '') { + if (0 < $this->messageQuitCount) { return; } @@ -6131,8 +6140,8 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = $table = array(); - $version = isset($GLOBALS['modx_version']) ? $GLOBALS['modx_version'] : ''; - $release_date = isset($GLOBALS['release_date']) ? $GLOBALS['release_date'] : ''; + $version = isset ($GLOBALS['modx_version']) ? $GLOBALS['modx_version'] : ''; + $release_date = isset ($GLOBALS['release_date']) ? $GLOBALS['release_date'] : ''; $request_uri = "http://" . $_SERVER['HTTP_HOST'] . ($_SERVER["SERVER_PORT"] == 80 ? "" : (":" . $_SERVER["SERVER_PORT"])) . $_SERVER['REQUEST_URI']; $request_uri = $this->htmlspecialchars($request_uri, ENT_QUOTES, $this->config['modx_charset']); $ua = $this->htmlspecialchars($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, $this->config['modx_charset']); @@ -6147,7 +6156,7 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = $str .= '

    ' . $msg . '

    '; } - if (!empty($query)) { + if (!empty ($query)) { $str .= '
    SQL > ' . $query . '
    '; } @@ -6185,6 +6194,7 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = if ($line) { $table[] = array('Line', $line); } + } if ($source != '') { @@ -6241,7 +6251,7 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = $queryTime = $this->queryTime; $phpTime = $totalTime - $queryTime; - $queries = isset($this->executedQueries) ? $this->executedQueries : 0; + $queries = isset ($this->executedQueries) ? $this->executedQueries : 0; $queryTime = sprintf("%2.4f s", $queryTime); $totalTime = sprintf("%2.4f s", $totalTime); $phpTime = sprintf("%2.4f s", $phpTime); @@ -6275,11 +6285,11 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = $source .= $actionName; } switch ($nr) { - case E_DEPRECATED: - case E_USER_DEPRECATED: - case E_STRICT: - case E_NOTICE: - case E_USER_NOTICE: + case E_DEPRECATED : + case E_USER_DEPRECATED : + case E_STRICT : + case E_NOTICE : + case E_USER_NOTICE : $error_level = 2; break; default: @@ -6307,6 +6317,7 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = ' . $str . ''; + } else { echo 'Error'; } @@ -6685,4 +6696,78 @@ public function addLog($title = 'no title', $msg = '', $type = 1) } $this->logEvent(0, $type, $msg, $title); } + +} +<<<<<<< HEAD +======= + +/** + * System Event Class + */ +class SystemEvent +{ + public $name = ''; + public $_propagate = true; + public $_output = ''; + public $activated = false; + public $activePlugin = ''; + public $params = array(); + + /** + * @param string $name Name of the event + */ + public function __construct($name = "") + { + $this->_resetEventObject(); + $this->name = $name; + } + + /** + * Display a message to the user + * + * @global array $SystemAlertMsgQueque + * @param string $msg The message + */ + public function alert($msg) + { + global $SystemAlertMsgQueque; + if ($msg == "") { + return; + } + if (is_array($SystemAlertMsgQueque)) { + $title = ''; + if ($this->name && $this->activePlugin) { + $title = "
    " . $this->activePlugin . " - " . $this->name . "
    "; + } + $SystemAlertMsgQueque[] = "$title
    $msg
    "; + } + } + + /** + * Output + * + * @param string $msg + */ + public function output($msg) + { + $this->_output .= $msg; + } + + /** + * Stop event propogation + */ + public function stopPropagation() + { + $this->_propagate = false; + } + + public function _resetEventObject() + { + unset ($this->returnedValues); + $this->name = ""; + $this->_output = ""; + $this->_propagate = true; + $this->activated = false; + } } +>>>>>>> parent of c061fce27... vendor/bin/php-cs-fixer fix diff --git a/manager/includes/error.class.inc.php b/manager/includes/error.class.inc.php index 42dd3abc3c..f82cd17d1a 100755 --- a/manager/includes/error.class.inc.php +++ b/manager/includes/error.class.inc.php @@ -22,6 +22,7 @@ class errorHandler */ public function __construct() { + $_lang = $this->include_lang('errormsg'); $this->errors = array( diff --git a/manager/includes/extenders/dbapi.mysql.class.inc.php b/manager/includes/extenders/dbapi.mysql.class.inc.php index 5172d7f252..6f5b60b78a 100755 --- a/manager/includes/extenders/dbapi.mysql.class.inc.php +++ b/manager/includes/extenders/dbapi.mysql.class.inc.php @@ -7,6 +7,7 @@ class DBAPI { + public $conn; public $config; public $lastQuery; @@ -171,12 +172,13 @@ public function disconnect() public function escape($s, $safecount = 0) { + $safecount++; if (1000 < $safecount) { exit("Too many loops '{$safecount}'"); } - if (empty($this->conn) || !is_resource($this->conn)) { + if (empty ($this->conn) || !is_resource($this->conn)) { $this->connect(); } @@ -203,7 +205,7 @@ public function escape($s, $safecount = 0) public function query($sql, $watchError = true) { $modx = evolutionCMS(); - if (empty($this->conn) || !is_resource($this->conn)) { + if (empty ($this->conn) || !is_resource($this->conn)) { $this->connect(); } $tstart = $modx->getMicroTime(); @@ -414,6 +416,7 @@ public function insert($fields, $intotable, $fromfields = "*", $fromtable = "", public function save($fields, $table, $where = '') { + if ($where === '') { $mode = 'insert'; } elseif ($this->getRecordCount($this->select('*', $table, $where)) == 0) { @@ -614,7 +617,7 @@ public function getValue($dsq) public function getTableMetaData($table) { $metadata = false; - if (!empty($table)) { + if (!empty ($table)) { $sql = "SHOW FIELDS FROM $table"; if ($ds = $this->query($sql)) { while ($row = $this->getRow($ds)) { @@ -640,16 +643,16 @@ public function prepareDate($timestamp, $fieldType = 'DATETIME') $date = ''; if (!$timestamp === false && $timestamp > 0) { switch ($fieldType) { - case 'DATE': + case 'DATE' : $date = date('Y-m-d', $timestamp); break; - case 'TIME': + case 'TIME' : $date = date('H:i:s', $timestamp); break; - case 'YEAR': + case 'YEAR' : $date = date('Y', $timestamp); break; - default: + default : $date = date('Y-m-d H:i:s', $timestamp); break; } @@ -702,6 +705,7 @@ public function getVersion() */ public function replaceFullTableName($str, $force = null) { + $str = trim($str); $dbase = trim($this->config['dbase'], '`'); $prefix = $this->config['table_prefix']; @@ -740,6 +744,7 @@ public function dataSeek($result, $row_number) public function _getFieldsStringFromArray($fields = array()) { + if (empty($fields)) { return '*'; } @@ -766,3 +771,4 @@ public function _getFromStringFromArray($tables = array()) return implode(' ', $_); } } + diff --git a/manager/includes/extenders/dbapi.mysqli.class.inc.php b/manager/includes/extenders/dbapi.mysqli.class.inc.php index b9a9b0136a..8596b6f091 100755 --- a/manager/includes/extenders/dbapi.mysqli.class.inc.php +++ b/manager/includes/extenders/dbapi.mysqli.class.inc.php @@ -119,7 +119,7 @@ public function escape($s, $safeCount = 0) if (1000 < $safeCount) { exit("Too many loops '{$safeCount}'"); } - if (! ($this->conn instanceof mysqli)) { + if ( ! ($this->conn instanceof mysqli)) { $this->connect(); } if (is_array($s)) { @@ -145,7 +145,7 @@ public function escape($s, $safeCount = 0) public function query($sql, $watchError = true) { $modx = evolutionCMS(); - if (! ($this->conn instanceof mysqli)) { + if ( ! ($this->conn instanceof mysqli)) { $this->connect(); } $tStart = $modx->getMicroTime(); @@ -295,7 +295,7 @@ public function update($fields, $table, $where = "") $modx = evolutionCMS(); $out = false; if (!$table) { - $modx->messageQuit('Empty ' . $table . ' parameter in DBAPI::update().'); + $modx->messageQuit('Empty '.$table.' parameter in DBAPI::update().'); } else { $table = $this->replaceFullTableName($table); if (is_array($fields)) { @@ -311,10 +311,10 @@ public function update($fields, $table, $where = "") } $where = trim($where); if ($where !== '' && stripos($where, 'WHERE') !== 0) { - $where = 'WHERE ' . $where; + $where = 'WHERE '.$where; } - return $this->query('UPDATE ' . $table . ' SET ' . $fields . ' ' . $where); + return $this->query('UPDATE '.$table.' SET '.$fields.' '.$where); } return $out; } @@ -490,7 +490,7 @@ public function getRow($ds, $mode = 'assoc') { $out = false; if ($ds instanceof mysqli_result) { - switch ($mode) { + switch($mode){ case 'assoc': $out = $ds->fetch_assoc(); break; @@ -520,7 +520,7 @@ public function getRow($ds, $mode = 'assoc') public function getColumn($name, $dsq) { $col = array(); - if (! ($dsq instanceof mysqli_result)) { + if ( ! ($dsq instanceof mysqli_result)) { $dsq = $this->query($dsq); } if ($dsq) { @@ -539,7 +539,7 @@ public function getColumn($name, $dsq) public function getColumnNames($dsq) { $names = array(); - if (! ($dsq instanceof mysqli_result)) { + if ( ! ($dsq instanceof mysqli_result)) { $dsq = $this->query($dsq); } if ($dsq) { @@ -559,7 +559,7 @@ public function getColumnNames($dsq) public function getValue($dsq) { $out = false; - if (! ($dsq instanceof mysqli_result)) { + if ( ! ($dsq instanceof mysqli_result)) { $dsq = $this->query($dsq); } if ($dsq) { @@ -578,7 +578,7 @@ public function getTableMetaData($table) { $metadata = array(); if (!empty($table) && is_scalar($table)) { - $sql = 'SHOW FIELDS FROM ' . $table; + $sql = 'SHOW FIELDS FROM '.$table; if ($ds = $this->query($sql)) { while ($row = $this->getRow($ds)) { $fieldName = $row['Field']; @@ -600,16 +600,16 @@ public function prepareDate($timestamp, $fieldType = 'DATETIME') $date = false; if (!$timestamp === false && $timestamp > 0) { switch ($fieldType) { - case 'DATE': + case 'DATE' : $date = date('Y-m-d', $timestamp); break; - case 'TIME': + case 'TIME' : $date = date('H:i:s', $timestamp); break; - case 'YEAR': + case 'YEAR' : $date = date('Y', $timestamp); break; - default: + default : $date = date('Y-m-d H:i:s', $timestamp); break; } @@ -674,9 +674,9 @@ public function replaceFullTableName($tableName, $force = false) */ public function optimize($table_name) { - $rs = $this->query('OPTIMIZE TABLE ' . $table_name); + $rs = $this->query('OPTIMIZE TABLE '.$table_name); if ($rs) { - $rs = $this->query('ALTER TABLE ' . $table_name); + $rs = $this->query('ALTER TABLE '.$table_name); } return $rs; @@ -688,7 +688,7 @@ public function optimize($table_name) */ public function truncate($table_name) { - return $this->query('TRUNCATE ' . $table_name); + return $this->query('TRUNCATE '.$table_name); } /** @@ -707,6 +707,7 @@ public function dataSeek($result, $row_number) */ public function _getFieldsStringFromArray($fields = array()) { + if (empty($fields)) { return '*'; } @@ -714,7 +715,7 @@ public function _getFieldsStringFromArray($fields = array()) $_ = array(); foreach ($fields as $k => $v) { if ($k !== $v) { - $_[] = $v . ' as ' . $k; + $_[] = $v.' as '.$k; } else { $_[] = $v; } diff --git a/manager/includes/extenders/deprecated.functions.inc.php b/manager/includes/extenders/deprecated.functions.inc.php index 5e8c8d138e..42b91290f2 100755 --- a/manager/includes/extenders/deprecated.functions.inc.php +++ b/manager/includes/extenders/deprecated.functions.inc.php @@ -109,7 +109,7 @@ public function makeList($array, $ulroot = 'root', $ulprefix = 'sub_', $type = ' if (!is_array($array)) { return "
    • Bad list
    "; } - if (!empty($type)) { + if (!empty ($type)) { $typestr = " style='list-style-type: $type'"; } else { $typestr = ""; @@ -218,7 +218,7 @@ public function userLoggedIn() { $modx = evolutionCMS(); $userdetails = array(); - if ($modx->isFrontend() && isset($_SESSION['webValidated'])) { + if ($modx->isFrontend() && isset ($_SESSION['webValidated'])) { // web user $userdetails['loggedIn'] = true; $userdetails['id'] = $_SESSION['webInternalKey']; @@ -227,7 +227,7 @@ public function userLoggedIn() return $userdetails; } else { - if ($modx->isBackend() && isset($_SESSION['mgrValidated'])) { + if ($modx->isBackend() && isset ($_SESSION['mgrValidated'])) { // manager user $userdetails['loggedIn'] = true; $userdetails['id'] = $_SESSION['mgrInternalKey']; diff --git a/manager/includes/extenders/ex_dbapi.inc.php b/manager/includes/extenders/ex_dbapi.inc.php index bebeda3af1..949109de89 100755 --- a/manager/includes/extenders/ex_dbapi.inc.php +++ b/manager/includes/extenders/ex_dbapi.inc.php @@ -7,17 +7,15 @@ global $database_type; -if (empty($database_type)) { - $database_type = 'mysql'; -} +if (empty($database_type)) $database_type = 'mysql'; $out = false; $class = 'DBAPI'; -if (! class_exists($class)) { +if( ! class_exists($class)){ include_once MODX_MANAGER_PATH . 'includes/extenders/dbapi.' . $database_type . '.class.inc.php'; } -if (class_exists($class)) { +if(class_exists($class)){ $this->db= new $class; $out = true; } diff --git a/manager/includes/extenders/export.class.inc.php b/manager/includes/extenders/export.class.inc.php index adc689163e..42e7b98850 100755 --- a/manager/includes/extenders/export.class.inc.php +++ b/manager/includes/extenders/export.class.inc.php @@ -172,8 +172,7 @@ public function removeDirectoryAll($directory = '') */ public function makeFile($docid, $filepath) { - $modx = evolutionCMS(); - global $_lang; + $modx = evolutionCMS(); global $_lang; $file_permission = octdec($modx->config['new_file_permissions']); if ($this->generate_mode === 'direct') { $back_lang = $_lang; @@ -287,7 +286,7 @@ public function run($parent = 0) if ($row['published'] === '1') { $status = $this->makeFile($row['id'], $filename); switch ($status) { - case 'failed_no_write': + case 'failed_no_write' : $row['status'] = $msg_failed_no_write; break; case 'failed_no_retrieve': @@ -320,6 +319,7 @@ public function run($parent = 0) } mkdir($dir_path); @chmod($dir_path, $folder_permission); + } @@ -370,4 +370,5 @@ public function parsePlaceholder($tpl, $ph = array()) return $tpl; } + } diff --git a/manager/includes/extenders/maketable.class.php b/manager/includes/extenders/maketable.class.php index 2a9f4034b8..ccd716197b 100755 --- a/manager/includes/extenders/maketable.class.php +++ b/manager/includes/extenders/maketable.class.php @@ -332,10 +332,10 @@ public function getColumnWidth($columnPosition) public function determineRowClass($position) { switch ($this->rowAlternatingScheme) { - case 'ODD': + case 'ODD' : $modRemainder = 1; break; - case 'EVEN': + case 'EVEN' : default: $modRemainder = 0; break; @@ -441,7 +441,7 @@ public function create($fieldsArray, $fieldHeadersArray = array(), $linkpage = " $table .= $this->createCellText($currentActionFieldValue, $value); $table .= "\n"; if ($i == 0) { - if (empty($header) && $this->formElementType) { + if (empty ($header) && $this->formElementType) { $header .= "\t\tthClass ? 'class="' . $this->thClass . '"' : '') . ">" . ($this->allOption ? 'all' : '') . "\n"; } $headerText = array_key_exists($key, $fieldHeadersArray) ? $fieldHeadersArray[$key] : $key; @@ -471,6 +471,7 @@ public function create($fieldsArray, $fieldHeadersArray = array(), $linkpage = " */ $table .= ''; //$table .= ''; + } if ($this->allOption) { $table .= ' @@ -643,4 +644,5 @@ public function prepareOrderByLink($key, $text, $qs = '') return '' . $text . ''; } + } diff --git a/manager/includes/extenders/manager.api.class.inc.php b/manager/includes/extenders/manager.api.class.inc.php index 323e2a0d5a..b1643f1605 100755 --- a/manager/includes/extenders/manager.api.class.inc.php +++ b/manager/includes/extenders/manager.api.class.inc.php @@ -86,6 +86,7 @@ public function saveFormValues($id = 0) */ public function loadFormValues() { + if (!$this->hasFormValues()) { return false; } diff --git a/manager/includes/extenders/message.quit.inc.php b/manager/includes/extenders/message.quit.inc.php index 3830fa14c4..e076ce04c2 100755 --- a/manager/includes/extenders/message.quit.inc.php +++ b/manager/includes/extenders/message.quit.inc.php @@ -3,7 +3,7 @@ * Message Quit Template * */ -if ((! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) && IN_PARSER_MODE!="true") { +if(( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) && IN_PARSER_MODE!="true") { die("INCLUDE ACCESS ERROR

    Direct access to this file prohibited."); } @@ -20,60 +20,61 @@ function copyToClip() "; -if ($is_error) { - $parsedMessageString .= "

     MODX Parse Error

    +if($is_error) { + $parsedMessageString .= "

     MODX Parse Error

    "; } else { - $parsedMessageString .= "

     MODX Debug/ stop message

    + $parsedMessageString .= "

     MODX Debug/ stop message

    MODX encountered the following error while attempting to parse the requested resource:
    « $msg »
    "; } -if (!empty($query)) { - $parsedMessageString .= ""; } -if ($text!='') { - $errortype = array( - E_ERROR => "Error", - E_WARNING => "Warning", - E_PARSE => "Parsing Error", - E_NOTICE => "Notice", - E_CORE_ERROR => "Core Error", - E_CORE_WARNING => "Core Warning", - E_COMPILE_ERROR => "Compile Error", - E_COMPILE_WARNING => "Compile Warning", - E_USER_ERROR => "User Error", - E_USER_WARNING => "User Warning", - E_USER_NOTICE => "User Notice", - ); +if($text!='') { - $parsedMessageString .= ""; + $errortype = array ( + E_ERROR => "Error", + E_WARNING => "Warning", + E_PARSE => "Parsing Error", + E_NOTICE => "Notice", + E_CORE_ERROR => "Core Error", + E_CORE_WARNING => "Core Warning", + E_COMPILE_ERROR => "Compile Error", + E_COMPILE_WARNING => "Compile Warning", + E_USER_ERROR => "User Error", + E_USER_WARNING => "User Warning", + E_USER_NOTICE => "User Notice", + ); - $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; + $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; - if ($source!='') { - $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; - } + $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; + + $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; + if($source!='') { + $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; + } } $parsedMessageString .= ""; diff --git a/manager/includes/extenders/modifiers.class.inc.php b/manager/includes/extenders/modifiers.class.inc.php index 082f34e90e..da6e862edd 100755 --- a/manager/includes/extenders/modifiers.class.inc.php +++ b/manager/includes/extenders/modifiers.class.inc.php @@ -1,11 +1,8 @@ config['modx_charset']); - } + if (function_exists('mb_internal_encoding')) mb_internal_encoding($modx->config['modx_charset']); $this->condModifiers = '=,is,eq,equals,ne,neq,notequals,isnot,isnt,not,%,isempty,isnotempty,isntempty,>=,gte,eg,gte,greaterthan,>,gt,isgreaterthan,isgt,lowerthan,<,lt,<=,lte,islte,islowerthan,islt,el,find,in,inarray,in_array,fnmatch,wcard,wcard_match,wildcard,wildcard_match,is_file,is_dir,file_exists,is_readable,is_writable,is_image,regex,preg,preg_match,memberof,mo,isinrole,ir'; } @@ -75,15 +70,13 @@ public function __construct() * @param string $modifiers * @return bool|mixed|string */ - public function phxFilter($key, $value, $modifiers) + public function phxFilter($key,$value,$modifiers) { $modx = evolutionCMS(); - if (substr($modifiers, 0, 3)!=='id(') { - $value = $this->parseDocumentSource($value); - } + if(substr($modifiers,0,3)!=='id(') $value = $this->parseDocumentSource($value); $this->srcValue = $value; $modifiers = trim($modifiers); - $modifiers = ':' . trim($modifiers, ':'); + $modifiers = ':'.trim($modifiers,':'); $modifiers = str_replace(array("\r\n","\r"), "\n", $modifiers); $modifiers = $this->splitEachModifiers($modifiers); @@ -93,7 +86,7 @@ public function phxFilter($key, $value, $modifiers) $this->condition = array(); $this->vars = array(); $this->vars['name'] = & $key; - $value = $this->parsePhx($key, $value, $modifiers); + $value = $this->parsePhx($key,$value,$modifiers); $this->vars = array(); return $value; } @@ -103,18 +96,13 @@ public function phxFilter($key, $value, $modifiers) * @param string $modifiers * @return bool|string */ - public function _getDelim($mode, $modifiers) - { - $c = substr($modifiers, 0, 1); - if (!in_array($c, array('"', "'", '`'))) { - return false; - } + public function _getDelim($mode,$modifiers) { + $c = substr($modifiers,0,1); + if(!in_array($c, array('"', "'", '`')) ) return false; - $modifiers = substr($modifiers, 1); + $modifiers = substr($modifiers,1); $closure = $mode=='(' ? "{$c})" : $c; - if (strpos($modifiers, $closure)===false) { - return false; - } + if(strpos($modifiers, $closure)===false) return false; return $c; } @@ -125,157 +113,142 @@ public function _getDelim($mode, $modifiers) * @param string $modifiers * @return bool|string */ - public function _getOpt($mode, $delim, $modifiers) - { - if ($delim) { - if ($mode=='(') { - return substr($modifiers, 1, strpos($modifiers, $delim . ')')-1); - } + public function _getOpt($mode,$delim,$modifiers) { + if($delim) { + if($mode=='(') return substr($modifiers,1,strpos($modifiers, $delim . ')' )-1); - return substr($modifiers, 1, strpos($modifiers, $delim, 1)-1); - } else { - if ($mode=='(') { - return substr($modifiers, 0, strpos($modifiers, ')')); - } + return substr($modifiers,1,strpos($modifiers,$delim,1)-1); + } + else { + if($mode=='(') return substr($modifiers,0,strpos($modifiers, ')') ); $chars = str_split($modifiers); $opt=''; - foreach ($chars as $c) { - if ($c==':' || $c==')') { - break; - } + foreach($chars as $c) { + if($c==':' || $c==')') break; $opt .=$c; } return $opt; } } - public function _getRemainModifiers($mode, $delim, $modifiers) - { - if ($delim) { - if ($mode=='(') { + public function _getRemainModifiers($mode,$delim,$modifiers) { + if($delim) { + if($mode=='(') return $this->_fetchContent($modifiers, $delim . ')'); - } else { + else { $modifiers = trim($modifiers); - $modifiers = substr($modifiers, 1); + $modifiers = substr($modifiers,1); return $this->_fetchContent($modifiers, $delim); } - } else { - if ($mode=='(') { - return $this->_fetchContent($modifiers, ')'); - } + } + else { + if($mode=='(') return $this->_fetchContent($modifiers, ')'); $chars = str_split($modifiers); - foreach ($chars as $c) { - if ($c==':') { - return $modifiers; - } else { - $modifiers = substr($modifiers, 1); - } + foreach($chars as $c) { + if($c==':') return $modifiers; + else $modifiers = substr($modifiers,1); } return $modifiers; } } - public function _fetchContent($string, $delim) - { + public function _fetchContent($string,$delim) { $len = strlen($delim); $string = $this->parseDocumentSource($string); - return substr($string, strpos($string, $delim)+$len); + return substr($string,strpos($string, $delim)+$len); } - public function splitEachModifiers($modifiers) - { + public function splitEachModifiers($modifiers) { $modx = evolutionCMS(); $cmd = ''; $bt = ''; $result = array(); - while ($bt!==$modifiers) { + while($bt!==$modifiers) { $bt = $modifiers; - $c = substr($modifiers, 0, 1); - $modifiers = substr($modifiers, 1); + $c = substr($modifiers,0,1); + $modifiers = substr($modifiers,1); - if ($c===':' && preg_match('@^(!?[<>=]{1,2})@', $modifiers, $match)) { // :=, :!=, :<=, :>=, :!<=, :!>= - $c = substr($modifiers, strlen($match[1]), 1); + if($c===':' && preg_match('@^(!?[<>=]{1,2})@', $modifiers, $match)) { // :=, :!=, :<=, :>=, :!<=, :!>= + $c = substr($modifiers,strlen($match[1]),1); $debuginfo = "#i=0 #c=[{$c}] #m=[{$modifiers}]"; - if ($c==='(') { - $modifiers = substr($modifiers, strlen($match[1])+1); - } else { - $modifiers = substr($modifiers, strlen($match[1])); - } + if($c==='(') $modifiers = substr($modifiers,strlen($match[1])+1); + else $modifiers = substr($modifiers,strlen($match[1])); - $delim = $this->_getDelim($c, $modifiers); - $opt = $this->_getOpt($c, $delim, $modifiers); - $modifiers = trim($this->_getRemainModifiers($c, $delim, $modifiers)); + $delim = $this->_getDelim($c,$modifiers); + $opt = $this->_getOpt($c,$delim,$modifiers); + $modifiers = trim($this->_getRemainModifiers($c,$delim,$modifiers)); $result[]=array('cmd'=>trim($match[1]),'opt'=>$opt,'debuginfo'=>$debuginfo); $cmd = ''; - } elseif (in_array($c, array('+','-','*','/')) && preg_match('@^[0-9]+@', $modifiers, $match)) { // :+3, :-3, :*3 ... - $modifiers = substr($modifiers, strlen($match[0])); - $result[]=array('cmd'=>'math','opt'=>'%s' . $c . $match[0]); + } + elseif(in_array($c,array('+','-','*','/')) && preg_match('@^[0-9]+@', $modifiers, $match)) { // :+3, :-3, :*3 ... + $modifiers = substr($modifiers,strlen($match[0])); + $result[]=array('cmd'=>'math','opt'=>'%s'.$c.$match[0]); $cmd = ''; - } elseif ($c==='(' || $c==='=') { + } + elseif($c==='(' || $c==='=') { $modifiers = $m1 = trim($modifiers); - $delim = $this->_getDelim($c, $modifiers); - $opt = $this->_getOpt($c, $delim, $modifiers); - $modifiers = trim($this->_getRemainModifiers($c, $delim, $modifiers)); + $delim = $this->_getDelim($c,$modifiers); + $opt = $this->_getOpt($c,$delim,$modifiers); + $modifiers = trim($this->_getRemainModifiers($c,$delim,$modifiers)); $debuginfo = "#i=1 #c=[{$c}] #delim=[{$delim}] #m1=[{$m1}] remainMdf=[{$modifiers}]"; $result[]=array('cmd'=>trim($cmd),'opt'=>$opt,'debuginfo'=>$debuginfo); $cmd = ''; - } elseif ($c==':') { + } + elseif($c==':') { $debuginfo = "#i=2 #c=[{$c}] #m=[{$modifiers}]"; - if ($cmd!=='') { - $result[]=array('cmd'=>trim($cmd),'opt'=>'','debuginfo'=>$debuginfo); - } + if($cmd!=='') $result[]=array('cmd'=>trim($cmd),'opt'=>'','debuginfo'=>$debuginfo); $cmd = ''; - } elseif (trim($modifiers)=='' && trim($cmd)!=='') { + } + elseif(trim($modifiers)=='' && trim($cmd)!=='') { $debuginfo = "#i=3 #c=[{$c}] #m=[{$modifiers}]"; $cmd .= $c; $result[]=array('cmd'=>trim($cmd),'opt'=>'','debuginfo'=>$debuginfo); break; - } else { + } + else { $cmd .= $c; } } - if (empty($result)) { - return array(); - } + if(empty($result)) return array(); - foreach ($result as $i=>$a) { + foreach($result as $i=>$a) + { $a['opt'] = $this->parseDocumentSource($a['opt']); - $result[$i]['opt'] = $modx->mergePlaceholderContent($a['opt'], $this->placeholders); + $result[$i]['opt'] = $modx->mergePlaceholderContent($a['opt'],$this->placeholders); } return $result; } - public function parsePhx($key, $value, $modifiers) + public function parsePhx($key,$value,$modifiers) { $modx = evolutionCMS(); $lastKey = ''; - $cacheKey = md5(sprintf('parsePhx#%s#%s#%s', $key, $value, print_r($modifiers, true))); - if (isset($this->tmpCache[$cacheKey])) { - return $this->tmpCache[$cacheKey]; - } - if (empty($modifiers)) { - return ''; - } + $cacheKey = md5(sprintf('parsePhx#%s#%s#%s',$key,$value,print_r($modifiers,true))); + if(isset($this->tmpCache[$cacheKey])) return $this->tmpCache[$cacheKey]; + if(empty($modifiers)) return ''; - foreach ($modifiers as $m) { + foreach($modifiers as $m) + { $lastKey = strtolower($m['cmd']); } - $_ = explode(',', $this->condModifiers); - if (in_array($lastKey, $_)) { + $_ = explode(',',$this->condModifiers); + if(in_array($lastKey,$_)) + { $modifiers[] = array('cmd'=>'then','opt'=>'1'); $modifiers[] = array('cmd'=>'else','opt'=>'0'); } - foreach ($modifiers as $i=>$a) { - $value = $this->Filter($key, $value, $a['cmd'], $a['opt']); + foreach($modifiers as $i=>$a) + { + $value = $this->Filter($key,$value, $a['cmd'], $a['opt']); } $this->tmpCache[$cacheKey] = $value; return $value; @@ -286,71 +259,56 @@ public function Filter($key, $value, $cmd, $opt='') { $modx = evolutionCMS(); - if ($key==='documentObject') { - $value = $modx->documentIdentifier; - } + if($key==='documentObject') $value = $modx->documentIdentifier; $cmd = $this->parseDocumentSource($cmd); - if (preg_match('@^[1-9][/0-9]*$@', $cmd)) { - if (strpos($cmd, '/')!==false) { - $cmd = $this->substr($cmd, strrpos($cmd, '/')+1); - } + if(preg_match('@^[1-9][/0-9]*$@',$cmd)) + { + if(strpos($cmd,'/')!==false) + $cmd = $this->substr($cmd,strrpos($cmd,'/')+1); $opt = $cmd; $cmd = 'id'; } - if (isset($modx->snippetCache["phx:{$cmd}"])) { - $this->elmName = "phx:{$cmd}"; - } elseif (isset($modx->chunkCache["phx:{$cmd}"])) { - $this->elmName = "phx:{$cmd}"; - } else { - $this->elmName = ''; - } + if(isset($modx->snippetCache["phx:{$cmd}"])) $this->elmName = "phx:{$cmd}"; + elseif(isset($modx->chunkCache["phx:{$cmd}"])) $this->elmName = "phx:{$cmd}"; + else $this->elmName = ''; $cmd = strtolower($cmd); - if ($this->elmName!=='') { + if($this->elmName!=='') $value = $this->getValueFromElement($key, $value, $cmd, $opt); - } else { + else $value = $this->getValueFromPreset($key, $value, $cmd, $opt); - } $value = str_replace('[+key+]', $key, $value); return $value; } - public function isEmpty($cmd, $value) + public function isEmpty($cmd,$value) { - if ($value!=='') { - return false; - } + if($value!=='') return false; $_ = explode(',', $this->condModifiers . ',_default,default,if,input,or,and,show,this,select,switch,then,else,id,ifempty,smart_desc,smart_description,summary'); - if (in_array($cmd, $_)) { - return false; - } else { - return true; - } + if(in_array($cmd,$_)) return false; + else return true; } public function getValueFromPreset($key, $value, $cmd, $opt) { $modx = evolutionCMS(); - if ($this->isEmpty($cmd, $value)) { - return ''; - } + if($this->isEmpty($cmd,$value)) return ''; $this->key = $key; $this->value = $value; $this->opt = $opt; - switch ($cmd) { + switch ($cmd) + { ##### Conditional Modifiers case 'input': case 'if': - if (!$opt) { - return $value; - } + if(!$opt) return $value; return $opt; case '=': case 'eq': @@ -411,35 +369,22 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'file_exists': case 'is_readable': case 'is_writable': - if (!$opt) { - $path = $value; - } else { - $path = $opt; - } - if (strpos($path, MODX_MANAGER_PATH)!==false) { - exit('Can not read core path'); - } - if (strpos($path, $modx->config['base_path'])===false) { - $path = ltrim($path, '/'); - } + if(!$opt) $path = $value; + else $path = $opt; + if(strpos($path,MODX_MANAGER_PATH)!==false) exit('Can not read core path'); + if(strpos($path,$modx->config['base_path'])===false) $path = ltrim($path,'/'); $this->condition[] = (int)($cmd($path)!==false);break; case 'is_image': - if (!$opt) { - $path = $value; - } else { - $path = $opt; - } - if (!is_file($path)) { - $this->condition[]='0'; - break; - } + if(!$opt) $path = $value; + else $path = $opt; + if(!is_file($path)) {$this->condition[]='0';break;} $_ = getimagesize($path); $this->condition[] = (int)($_[0]);break; case 'regex': case 'preg': case 'preg_match': case 'isinrole': - $this->condition[] = (int)(preg_match($opt, $value));break; + $this->condition[] = (int)(preg_match($opt,$value));break; case 'ir': case 'memberof': case 'mo': @@ -452,55 +397,45 @@ public function getValueFromPreset($key, $value, $cmd, $opt) $this->condition[] = '&&';break; case 'show': case 'this': - $conditional = implode(' ', $this->condition); + $conditional = implode(' ',$this->condition); $isvalid = (int)(eval("return ({$conditional});")); - if ($isvalid) { - return $this->srcValue; - } - return null; + if ($isvalid) return $this->srcValue; + return NULL; case 'then': - $conditional = implode(' ', $this->condition); + $conditional = implode(' ',$this->condition); $isvalid = (int)eval("return ({$conditional});"); - if ($isvalid) { - return $opt; - } + if ($isvalid) return $opt; return null; case 'else': - $conditional = implode(' ', $this->condition); + $conditional = implode(' ',$this->condition); $isvalid = (int)eval("return ({$conditional});"); - if (!$isvalid) { - return $opt; - } + if (!$isvalid) return $opt; break; case 'select': case 'switch': - $raw = explode('&', $opt); + $raw = explode('&',$opt); $map = array(); $c = count($raw); - for ($m=0; $m<$c; $m++) { - $mi = explode('=', $raw[$m], 2); + for($m=0; $m<$c; $m++) { + $mi = explode('=',$raw[$m],2); $map[$mi[0]] = $mi[1]; } - if (isset($map[$value])) { - return $map[$value]; - } else { - return ''; - } + if(isset($map[$value])) return $map[$value]; + else return ''; ##### End of Conditional Modifiers ##### Encode / Decode / Hash / Escape - // no break case 'htmlent': case 'htmlentities': - return htmlentities($value, ENT_QUOTES, $modx->config['modx_charset']); + return htmlentities($value,ENT_QUOTES,$modx->config['modx_charset']); case 'html_entity_decode': case 'decode_html': case 'html_decode': - return html_entity_decode($value, ENT_QUOTES, $modx->config['modx_charset']); + return html_entity_decode($value,ENT_QUOTES,$modx->config['modx_charset']); case 'esc': case 'escape': $value = preg_replace('/&(#[0-9]+|[a-z]+);/i', '&$1;', htmlspecialchars($value, ENT_QUOTES, $modx->config['modx_charset'])); - return str_replace(array('[', ']', '`'), array('[', ']', '`'), $value); + return str_replace(array('[', ']', '`'),array('[', ']', '`'),$value); case 'sql_escape': case 'encode_js': return $modx->db->escape($value); @@ -510,45 +445,40 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'html_encode': return preg_replace('/&(#[0-9]+|[a-z]+);/i', '&$1;', htmlspecialchars($value, ENT_QUOTES, $modx->config['modx_charset'])); case 'spam_protect': - return str_replace(array('@','.'), array('@','.'), $value); + return str_replace(array('@','.'),array('@','.'),$value); case 'strip': - if ($opt==='') { - $opt = ' '; - } + if($opt==='') $opt = ' '; return preg_replace('/[\n\r\t\s]+/', $opt, $value); case 'strip_linefeeds': return str_replace(array("\n","\r"), '', $value); case 'notags': case 'strip_tags': case 'remove_html': - if ($opt!=='') { + if($opt!=='') + { $param = array(); - foreach (explode(',', $opt) as $v) { - $v = trim($v, ' '); + foreach(explode(',',$opt) as $v) + { + $v = trim($v,' '); $param[] = "<{$v}>"; } - $params = implode(',', $param); - } else { - $params = ''; + $params = implode(',',$param); } - if (!strpos($params, '
    ')===false) { - $value = preg_replace('@()\n@', '$1', $value); - $value = preg_replace('@@', "\n", $value); + else $params = ''; + if(!strpos($params,'
    ')===false) { + $value = preg_replace('@()\n@','$1',$value); + $value = preg_replace('@@',"\n",$value); } - return $this->strip_tags($value, $params); + return $this->strip_tags($value,$params); case 'urlencode': case 'url_encode': case 'encode_url': return urlencode($value); case 'base64_decode': - if ($opt!=='false') { - $opt = true; - } else { - $opt = false; - } - return base64_decode($value, $opt); + if($opt!=='false') $opt = true; + else $opt = false; + return base64_decode($value,$opt); case 'encode_sha1': $cmd = 'sha1'; - // no break case 'addslashes': case 'urldecode': case 'url_decode': @@ -571,21 +501,18 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'upper_case': return $this->strtoupper($value); case 'capitalize': - $_ = explode(' ', $value); - foreach ($_ as $i=>$v) { + $_ = explode(' ',$value); + foreach($_ as $i=>$v) + { $_[$i] = ucfirst($v); } - return implode(' ', $_); + return implode(' ',$_); case 'zenhan': - if (empty($opt)) { - $opt='VKas'; - } - return mb_convert_kana($value, $opt, $modx->config['modx_charset']); + if(empty($opt)) $opt='VKas'; + return mb_convert_kana($value,$opt,$modx->config['modx_charset']); case 'hanzen': - if (empty($opt)) { - $opt='VKAS'; - } - return mb_convert_kana($value, $opt, $modx->config['modx_charset']); + if(empty($opt)) $opt='VKAS'; + return mb_convert_kana($value,$opt,$modx->config['modx_charset']); case 'str_shuffle': case 'shuffle': return $this->str_shuffle($value); @@ -599,7 +526,7 @@ public function getValueFromPreset($key, $value, $cmd, $opt) return $this->strlen($value); case 'count_words': $value = trim($value); - return count(preg_split('/\s+/', $value)); + return count(preg_split('/\s+/',$value)); case 'str_word_count': case 'word_count': case 'wordcount': @@ -607,69 +534,55 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'count_paragraphs': $value = trim($value); $value = preg_replace('/\r/', '', $value); - return count(preg_split('/\n+/', $value)); + return count(preg_split('/\n+/',$value)); case 'strpos': - if ($opt!=0&&empty($opt)) { - return $value; - } - return $this->strpos($value, $opt); + if($opt!=0&&empty($opt)) return $value; + return $this->strpos($value,$opt); case 'wordwrap': // default: 70 $wrapat = (int)$opt > 0 ? (int)$opt : 70; - if (version_compare(PHP_VERSION, '5.3.0') >= 0) { - return $this->includeMdfFile('wordwrap'); - } else { - return preg_replace("@(\b\w+\b)@e", "wordwrap('\\1',\$wrapat,' ',1)", $value); - } - // no break + if (version_compare(PHP_VERSION, '5.3.0') >= 0) return $this->includeMdfFile('wordwrap'); + else return preg_replace("@(\b\w+\b)@e","wordwrap('\\1',\$wrapat,' ',1)",$value); case 'wrap_text': - $width = preg_match('/^[1-9][0-9]*$/', $opt) ? $opt : 70; - if ($modx->config['manager_language']==='japanese-utf8') { + $width = preg_match('/^[1-9][0-9]*$/',$opt) ? $opt : 70; + if($modx->config['manager_language']==='japanese-utf8') { $chunk = array(); $bt=''; - while ($bt!=$value) { + while($bt!=$value) { $bt = $value; - if ($this->strlen($value)<$width) { + if($this->strlen($value)<$width) { $chunk[] = $value; break; } - $chunk[] = $this->substr($value, 0, $width); - $value = $this->substr($value, $width); + $chunk[] = $this->substr($value,0,$width); + $value = $this->substr($value,$width); } - return implode("\n", $chunk); - } else { - return wordwrap($value, $width, "\n", true); + return implode("\n",$chunk); } - // no break + else + return wordwrap($value,$width,"\n",true); case 'substr': - if (empty($opt)) { - break; + if(empty($opt)) break; + if(strpos($opt,',')!==false) { + list($b,$e) = explode(',',$opt,2); + return $this->substr($value,$b,(int)$e); } - if (strpos($opt, ',')!==false) { - list($b, $e) = explode(',', $opt, 2); - return $this->substr($value, $b, (int)$e); - } else { - return $this->substr($value, $opt); - } - // no break + else return $this->substr($value,$opt); case 'limit': case 'trim_to': // http://www.movabletype.jp/documentation/appendices/modifiers/trim_to.html - if (strpos($opt, '+')!==false) { - list($len, $str) = explode('+', $opt, 2); - } else { + if(strpos($opt,'+')!==false) + list($len,$str) = explode('+',$opt,2); + else { $len = $opt; $str = ''; } - if ($len==='') { - $len = 100; - } - if (abs($len) > $this->strlen($value)) { - $str =''; + if($len==='') $len = 100; + if(abs($len) > $this->strlen($value)) $str =''; + if(preg_match('/^[1-9][0-9]*$/',$len)) { + return $this->substr($value,0,$len) . $str; } - if (preg_match('/^[1-9][0-9]*$/', $len)) { - return $this->substr($value, 0, $len) . $str; - } elseif (preg_match('/^\-[1-9][0-9]*$/', $len)) { - return $str . $this->substr($value, $len); + elseif(preg_match('/^\-[1-9][0-9]*$/',$len)) { + return $str . $this->substr($value,$len); } break; case 'summary': @@ -678,119 +591,82 @@ public function getValueFromPreset($key, $value, $cmd, $opt) return $this->includeMdfFile('summary'); case 'replace': case 'str_replace': - if (empty($opt) || strpos($opt, ',')===false) { - break; - } - if (substr_count($opt, ',') ==1) { - $delim = ','; - } elseif (substr_count($opt, '|') ==1) { - $delim = '|'; - } elseif (substr_count($opt, '=>')==1) { - $delim = '=>'; - } elseif (substr_count($opt, '/') ==1) { - $delim = '/'; - } else { - break; - } - list($s, $r) = explode($delim, $opt); - if ($value!=='') { - return str_replace($s, $r, $value); - } + if(empty($opt) || strpos($opt,',')===false) break; + if (substr_count($opt, ',') ==1) $delim = ','; + elseif(substr_count($opt, '|') ==1) $delim = '|'; + elseif(substr_count($opt, '=>')==1) $delim = '=>'; + elseif(substr_count($opt, '/') ==1) $delim = '/'; + else break; + list($s,$r) = explode($delim,$opt); + if($value!=='') return str_replace($s,$r,$value); break; case 'replace_to': case 'tpl': - if ($value!=='') { - return str_replace(array('[+value+]','[+output+]','{value}','%s'), $value, $opt); - } + if($value!=='') return str_replace(array('[+value+]','[+output+]','{value}','%s'),$value,$opt); break; case 'eachtpl': - $value = explode('||', $value); + $value = explode('||',$value); $_ = array(); - foreach ($value as $v) { - $_[] = str_replace(array('[+value+]','[+output+]','{value}','%s'), $v, $opt); + foreach($value as $v) { + $_[] = str_replace(array('[+value+]','[+output+]','{value}','%s'),$v,$opt); } return implode("\n", $_); case 'array_pop': case 'array_shift': - if (strpos($value, '||')!==false) { - $delim = '||'; - } else { - $delim = ','; - } - return $cmd(explode($delim, $value)); + if(strpos($value,'||')!==false) $delim = '||'; + else $delim = ','; + return $cmd(explode($delim,$value)); case 'preg_replace': case 'regex_replace': - if (empty($opt) || strpos($opt, ',')===false) { - break; - } - list($s, $r) = explode(',', $opt, 2); - if ($value!=='') { - return preg_replace($s, $r, $value); - } + if(empty($opt) || strpos($opt,',')===false) break; + list($s,$r) = explode(',',$opt,2); + if($value!=='') return preg_replace($s,$r,$value); break; case 'cat': case 'concatenate': case '.': - if ($value!=='') { - return $value . $opt; - } + if($value!=='') return $value . $opt; break; case 'sprintf': case 'string_format': - if ($value!=='') { - return sprintf($opt, $value); - } + if($value!=='') return sprintf($opt,$value); break; case 'number_format': - if ($opt=='') { - $opt = 0; - } - return number_format($value, $opt); + if($opt=='') $opt = 0; + return number_format($value,$opt); case 'money_format': - setlocale(LC_MONETARY, setlocale(LC_TIME, 0)); - if ($value!=='') { - return money_format($opt, (double)$value); - } + setlocale(LC_MONETARY,setlocale(LC_TIME,0)); + if($value!=='') return money_format($opt,(double)$value); break; case 'tobool': return boolval($value); case 'nl2lf': - if ($value!=='') { - return str_replace(array("\r\n","\n", "\r"), '\n', $value); - } + if($value!=='') return str_replace(array("\r\n","\n", "\r"), '\n', $value); break; case 'br2nl': return preg_replace('@@i', "\n", $value); case 'nl2br': - if (version_compare(PHP_VERSION, '5.3.0', '<')) { + if (version_compare(PHP_VERSION, '5.3.0', '<')) return nl2br($value); - } - if ($opt!=='') { + if($opt!=='') + { $opt = trim($opt); $opt = strtolower($opt); - if ($opt==='false') { - $opt = false; - } elseif ($opt==='0') { - $opt = false; - } else { - $opt = true; - } - } elseif (isset($modx->config['mce_element_format'])&&$modx->config['mce_element_format']==='html') { - $opt = false; - } else { - $opt = true; - } - return nl2br($value, $opt); + if($opt==='false') $opt = false; + elseif($opt==='0') $opt = false; + else $opt = true; + } + elseif(isset($modx->config['mce_element_format'])&&$modx->config['mce_element_format']==='html') + $opt = false; + else $opt = true; + return nl2br($value,$opt); case 'ltrim': case 'rtrim': case 'trim': // ref http://mblo.info/modifiers/custom-modifiers/rtrim_opt.html - if ($opt==='') { + if($opt==='') return $cmd($value); - } else { - return $cmd($value, $opt); - } + else return $cmd($value,$opt); // These are all straight wrappers for PHP functions - // no break case 'ucfirst': case 'lcfirst': case 'ucwords': @@ -800,26 +676,16 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'strftime': case 'date': case 'dateformat': - if (empty($opt)) { - $opt = $modx->toDateFormat(null, 'formatOnly'); - } - if (!preg_match('@^[0-9]+$@', $value)) { - $value = strtotime($value); - } - if (strpos($opt, '%')!==false) { - return strftime($opt, 0+$value); - } else { - return date($opt, 0+$value); - } - // no break + if(empty($opt)) $opt = $modx->toDateFormat(null, 'formatOnly'); + if(!preg_match('@^[0-9]+$@',$value)) $value = strtotime($value); + if(strpos($opt,'%')!==false) + return strftime($opt,0+$value); + else + return date($opt,0+$value); case 'time': - if (empty($opt)) { - $opt = '%H:%M'; - } - if (!preg_match('@^[0-9]+$@', $value)) { - $value = strtotime($value); - } - return strftime($opt, 0+$value); + if(empty($opt)) $opt = '%H:%M'; + if(!preg_match('@^[0-9]+$@',$value)) $value = strtotime($value); + return strftime($opt,0+$value); case 'strtotime': return strtotime($value); ##### mathematical function @@ -828,13 +694,11 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'tofloat': return floatval($value); case 'round': - if (!$opt) { - $opt = 0; - } - return $cmd($value, $opt); + if(!$opt) $opt = 0; + return $cmd($value,$opt); case 'max': case 'min': - return $cmd(explode(',', $value)); + return $cmd(explode(',',$value)); case 'floor': case 'ceil': case 'abs': @@ -842,42 +706,28 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'math': case 'calc': $value = (int)$value; - if (empty($value)) { - $value = '0'; - } - $filter = str_replace(array('[+value+]','[+output+]','{value}','%s'), '?', $opt); - $filter = preg_replace('@([a-zA-Z\n\r\t\s])@', '', $filter); - if (strpos($filter, '?')===false) { - $filter = "?{$filter}"; - } - $filter = str_replace('?', $value, $filter); + if(empty($value)) $value = '0'; + $filter = str_replace(array('[+value+]','[+output+]','{value}','%s'),'?',$opt); + $filter = preg_replace('@([a-zA-Z\n\r\t\s])@','',$filter); + if(strpos($filter,'?')===false) $filter = "?{$filter}"; + $filter = str_replace('?',$value,$filter); return eval("return {$filter};"); case 'count': - if ($value=='') { - return 0; - } - $value = explode(',', $value); + if($value=='') return 0; + $value = explode(',',$value); return count($value); case 'sort': case 'rsort': - if (strpos($value, "\n")!==false) { - $delim="\n"; - } else { - $delim = ','; - } - $swap = explode($delim, $value); - if (!$opt) { - $opt = SORT_REGULAR; - } else { - $opt = constant($opt); - } - $cmd($swap, $opt); - return implode($delim, $swap); + if(strpos($value,"\n")!==false) $delim="\n"; + else $delim = ','; + $swap = explode($delim,$value); + if(!$opt) $opt = SORT_REGULAR; + else $opt = constant($opt); + $cmd($swap,$opt); + return implode($delim,$swap); ##### Resource fields case 'id': - if ($opt) { - return $this->getDocumentObject($opt, $key); - } + if($opt) return $this->getDocumentObject($opt,$key); break; case 'type': case 'contenttype': @@ -914,44 +764,36 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'privatemgr': case 'content_dispo': case 'hidemenu': - if ($cmd==='contenttype') { - $cmd = 'contentType'; - } - return $this->getDocumentObject($value, $cmd); + if($cmd==='contenttype') $cmd = 'contentType'; + return $this->getDocumentObject($value,$cmd); case 'title': - $pagetitle = $this->getDocumentObject($value, 'pagetitle'); - $longtitle = $this->getDocumentObject($value, 'longtitle'); + $pagetitle = $this->getDocumentObject($value,'pagetitle'); + $longtitle = $this->getDocumentObject($value,'longtitle'); return $longtitle ? $longtitle : $pagetitle; case 'shorttitle': - $pagetitle = $this->getDocumentObject($value, 'pagetitle'); - $menutitle = $this->getDocumentObject($value, 'menutitle'); + $pagetitle = $this->getDocumentObject($value,'pagetitle'); + $menutitle = $this->getDocumentObject($value,'menutitle'); return $menutitle ? $menutitle : $pagetitle; case 'templatename': - $rs = $modx->db->select('templatename', '[+prefix+]site_templates', "id='{$value}'"); + $rs = $modx->db->select('templatename','[+prefix+]site_templates',"id='{$value}'"); $templateName = $modx->db->getValue($rs); return !$templateName ? '(blank)' : $templateName; case 'getfield': - if (!$opt) { - $opt = 'content'; - } - return $modx->getField($opt, $value); + if(!$opt) $opt = 'content'; + return $modx->getField($opt,$value); case 'children': case 'childids': - if ($value=='') { - $value = 0; - } // 値がない場合はルートと見なす + if($value=='') $value = 0; // 値がない場合はルートと見なす $published = 1; - if ($opt=='') { - $opt = 'page'; - } - $_ = explode(',', $opt); + if($opt=='') $opt = 'page'; + $_ = explode(',',$opt); $where = array(); - foreach ($_ as $opt) { - switch (trim($opt)) { - case 'page': case '!folder': case '!isfolder': $where[] = 'sc.isfolder=0'; break; - case 'folder': case 'isfolder': $where[] = 'sc.isfolder=1'; break; - case 'menu': case 'show_menu': $where[] = 'sc.hidemenu=0'; break; - case '!menu': case '!show_menu': $where[] = 'sc.hidemenu=1'; break; + foreach($_ as $opt) { + switch(trim($opt)) { + case 'page'; case '!folder'; case '!isfolder': $where[] = 'sc.isfolder=0'; break; + case 'folder'; case 'isfolder': $where[] = 'sc.isfolder=1'; break; + case 'menu'; case 'show_menu': $where[] = 'sc.hidemenu=0'; break; + case '!menu'; case '!show_menu': $where[] = 'sc.hidemenu=1'; break; case 'published': $published = 1; break; case '!published': $published = 0; break; } @@ -959,105 +801,75 @@ public function getValueFromPreset($key, $value, $cmd, $opt) $where = implode(' AND ', $where); $children = $modx->getDocumentChildren($value, $published, '0', 'id', $where); $result = array(); - foreach ((array)$children as $child) { + foreach((array)$children as $child){ $result[] = $child['id']; } return implode(',', $result); case 'fullurl': - if (!is_numeric($value)) { - return $value; - } + if(!is_numeric($value)) return $value; return $modx->makeUrl($value); case 'makeurl': - if (!is_numeric($value)) { - return $value; - } - if (!$opt) { - $opt = 'full'; - } - return $modx->makeUrl($value, '', '', $opt); + if(!is_numeric($value)) return $value; + if(!$opt) $opt = 'full'; + return $modx->makeUrl($value,'','',$opt); ##### File system case 'getimageinfo': case 'imageinfo': - if (!is_file($value)) { - return ''; - } + if(!is_file($value)) return ''; $_ = getimagesize($value); - if (!$_[0]) { - return ''; - } + if(!$_[0]) return ''; $info['width'] = $_[0]; $info['height'] = $_[1]; - if ($_[0] > $_[1]) { - $info['aspect'] = 'landscape'; - } elseif ($_[0] < $_[1]) { - $info['aspect'] = 'portrait'; - } else { - $info['aspect'] = 'square'; - } - switch ($_[2]) { - case IMAGETYPE_GIF: $info['type'] = 'gif'; break; - case IMAGETYPE_JPEG: $info['type'] = 'jpg'; break; - case IMAGETYPE_PNG: $info['type'] = 'png'; break; - default: $info['type'] = 'unknown'; + if ($_[0] > $_[1]) $info['aspect'] = 'landscape'; + elseif($_[0] < $_[1]) $info['aspect'] = 'portrait'; + else $info['aspect'] = 'square'; + switch($_[2]) { + case IMAGETYPE_GIF : $info['type'] = 'gif'; break; + case IMAGETYPE_JPEG : $info['type'] = 'jpg'; break; + case IMAGETYPE_PNG : $info['type'] = 'png'; break; + default : $info['type'] = 'unknown'; } $info['attrib'] = $_[3]; - switch ($opt) { - case 'width': return $info['width']; + switch($opt) { + case 'width' : return $info['width']; case 'height': return $info['height']; case 'aspect': return $info['aspect']; - case 'type': return $info['type']; + case 'type' : return $info['type']; case 'attrib': return $info['attrib']; - default: return print_r($info, true); + default : return print_r($info,true); } - // no break case 'file_get_contents': case 'readfile': - if (!is_file($value)) { - return $value; - } + if(!is_file($value)) return $value; $value = realpath($value); - if (strpos($value, MODX_MANAGER_PATH)!==false) { - exit('Can not read core file'); - } - $ext = strtolower(substr($value, -4)); - if ($ext==='.php') { - exit('Can not read php file'); - } - if ($ext==='.cgi') { - exit('Can not read cgi file'); - } + if(strpos($value,MODX_MANAGER_PATH)!==false) exit('Can not read core file'); + $ext = strtolower(substr($value,-4)); + if($ext==='.php') exit('Can not read php file'); + if($ext==='.cgi') exit('Can not read cgi file'); return file_get_contents($value); case 'filesize': - if ($value == '') { - return ''; - } + if($value == '') return ''; $filename = $value; $site_url = $modx->config['site_url']; - if (strpos($filename, $site_url) === 0) { - $filename = substr($filename, 0, strlen($site_url)); - } - $filename = trim($filename, '/'); + if(strpos($filename,$site_url) === 0) + $filename = substr($filename,0,strlen($site_url)); + $filename = trim($filename,'/'); - $opt = trim($opt, '/'); - if ($opt!=='') { - $opt .= '/'; - } + $opt = trim($opt,'/'); + if($opt!=='') $opt .= '/'; - $filename = MODX_BASE_PATH . $opt . $filename; + $filename = MODX_BASE_PATH.$opt.$filename; - if (is_file($filename)) { + if(is_file($filename)){ clearstatcache(); $size = filesize($filename); return $size; - } else { - return ''; } + else return ''; ##### User info - // no break case 'username': case 'fullname': case 'role': @@ -1084,56 +896,41 @@ public function getValueFromPreset($key, $value, $cmd, $opt) $this->opt = $cmd; return $this->includeMdfFile('moduser'); case 'userinfo': - if (empty($opt)) { - $this->opt = 'username'; - } + if(empty($opt)) $this->opt = 'username'; return $this->includeMdfFile('moduser'); case 'webuserinfo': - if (empty($opt)) { - $this->opt = 'username'; - } + if(empty($opt)) $this->opt = 'username'; $this->value = -$value; return $this->includeMdfFile('moduser'); ##### Special functions case 'ifempty': case '_default': case 'default': - if (empty($value)) { - return $opt; - } break; + if (empty($value)) return $opt; break; case 'ifnotempty': - if (!empty($value)) { - return $opt; - } break; + if (!empty($value)) return $opt; break; case 'datagrid': include_once(MODX_CORE_PATH . 'controls/datagrid.class.php'); $grd = new DataGrid(null, trim($value)); $grd->itemStyle = ''; $grd->altItemStyle = ''; - $pos = strpos($value, "\n"); - if ($pos) { - $_ = substr($value, 0, $pos); - } else { - $_ = $pos; - } - $grd->cdelim = strpos($_, "\t")!==false ? 'tab' : ','; + $pos = strpos($value,"\n"); + if($pos) $_ = substr($value,0,$pos); + else $_ = $pos; + $grd->cdelim = strpos($_,"\t")!==false ? 'tab' : ','; return $grd->render(); case 'rotate': case 'evenodd': - if (strpos($opt, ',')===false) { - $opt = 'odd,even'; - } + if(strpos($opt,',')===false) $opt = 'odd,even'; $_ = explode(',', $opt); $c = count($_); $i = $value + $c; $i = $i % $c; return $_[$i]; case 'takeval': - $arr = explode(",", $opt); + $arr = explode(",",$opt); $idx = $value; - if (!is_numeric($idx)) { - return $value; - } + if(!is_numeric($idx)) return $value; return $arr[$idx]; case 'getimage': return $this->includeMdfFile('getimage'); @@ -1141,21 +938,17 @@ public function getValueFromPreset($key, $value, $cmd, $opt) return $modx->nicesize($value); case 'googlemap': case 'googlemaps': - if (empty($opt)) { - $opt = 'border:none;width:500px;height:350px;'; - } + if(empty($opt)) $opt = 'border:none;width:500px;height:350px;'; $tpl = ''; $ph['style'] = $opt; $ph['value'] = $value; - return $modx->parseText($tpl, $ph); + return $modx->parseText($tpl,$ph); case 'youtube': case 'youtube16x9': - if (empty($opt)) { - $opt = 560; - } + if(empty($opt)) $opt = 560; $h = round($opt*0.5625); $tpl = ''; - return sprintf($tpl, $opt, $h, $value); + return sprintf($tpl,$opt,$h,$value); //case 'youtube4x3':%s*0.75+25 case 'setvar': $modx->placeholders[$opt] = $value; @@ -1185,77 +978,66 @@ public function getValueFromPreset($key, $value, $cmd, $opt) return $value; } - public function includeMdfFile($cmd) - { + public function includeMdfFile($cmd) { $modx = evolutionCMS(); $key = $this->key; $value = $this->value; $opt = $this->opt; - return include(MODX_CORE_PATH . "extenders/modifiers/mdf_{$cmd}.inc.php"); + return include(MODX_CORE_PATH."extenders/modifiers/mdf_{$cmd}.inc.php"); } public function getValueFromElement($key, $value, $cmd, $opt) { $modx = evolutionCMS(); - if (isset($modx->snippetCache[$this->elmName])) { + if( isset($modx->snippetCache[$this->elmName]) ) + { $php = $modx->snippetCache[$this->elmName]; - } else { + } + else + { $esc_elmName = $modx->db->escape($this->elmName); - $result = $modx->db->select('snippet', '[+prefix+]site_snippets', "name='{$esc_elmName}'"); + $result = $modx->db->select('snippet','[+prefix+]site_snippets',"name='{$esc_elmName}'"); $total = $modx->db->getRecordCount($result); - if ($total == 1) { + if($total == 1) + { $row = $modx->db->getRow($result); $php = $row['snippet']; - } elseif ($total == 0) { - $assets_path = MODX_BASE_PATH . 'assets/'; - if (is_file($assets_path . "modifiers/mdf_{$cmd}.inc.php")) { - $modifiers_path = $assets_path . "modifiers/mdf_{$cmd}.inc.php"; - } elseif (is_file($assets_path . "plugins/phx/modifiers/{$cmd}.phx.php")) { - $modifiers_path = $assets_path . "plugins/phx/modifiers/{$cmd}.phx.php"; - } elseif (is_file(MODX_CORE_PATH . "extenders/modifiers/mdf_{$cmd}.inc.php")) { - $modifiers_path = MODX_CORE_PATH . "extenders/modifiers/mdf_{$cmd}.inc.php"; - } else { - $modifiers_path = false; - } - - if ($modifiers_path !== false) { + } + elseif($total == 0) + { + $assets_path = MODX_BASE_PATH.'assets/'; + if(is_file($assets_path."modifiers/mdf_{$cmd}.inc.php")) + $modifiers_path = $assets_path."modifiers/mdf_{$cmd}.inc.php"; + elseif(is_file($assets_path."plugins/phx/modifiers/{$cmd}.phx.php")) + $modifiers_path = $assets_path."plugins/phx/modifiers/{$cmd}.phx.php"; + elseif(is_file(MODX_CORE_PATH."extenders/modifiers/mdf_{$cmd}.inc.php")) + $modifiers_path = MODX_CORE_PATH."extenders/modifiers/mdf_{$cmd}.inc.php"; + else $modifiers_path = false; + + if($modifiers_path !== false) { $php = @file_get_contents($modifiers_path); $php = trim($php); - if (substr($php, 0, 5)==='') { - $php = substr($php, 0, -2); - } - if ($this->elmName!=='') { - $modx->snippetCache[$this->elmName . 'Props'] = ''; - } - } else { - $php = false; + if(substr($php,0,5)==='') $php = substr($php,0,-2); + if($this->elmName!=='') + $modx->snippetCache[$this->elmName.'Props'] = ''; } - } else { - $php = false; - } - if ($this->elmName!=='') { - $modx->snippetCache[$this->elmName]= $php; + else + $php = false; } + else $php = false; + if($this->elmName!=='') $modx->snippetCache[$this->elmName]= $php; } - if ($php==='') { - $php=false; - } + if($php==='') $php=false; - if ($php===false) { - $html = $modx->getChunk($this->elmName); - } else { - $html = false; - } + if($php===false) $html = $modx->getChunk($this->elmName); + else $html = false; $self = '[+output+]'; - if ($php !== false) { + if($php !== false) + { ob_start(); $options = $opt; $output = $value; @@ -1267,20 +1049,20 @@ public function getValueFromElement($key, $value, $cmd, $opt) $this->vars['options'] = & $opt; $custom = eval($php); $msg = ob_get_contents(); - if ($value===$this->bt) { - $value = $msg . $custom; - } + if($value===$this->bt) $value = $msg . $custom; ob_end_clean(); - } elseif ($html!==false && isset($value) && $value!=='') { + } + elseif($html!==false && isset($value) && $value!=='') + { $html = str_replace(array($self,'[+value+]'), $value, $html); $value = str_replace(array('[+options+]','[+param+]'), $opt, $html); - } else { - return false; } + else return false; - if ($php===false && $html===false && $value!=='' - && (strpos($cmd, '[+value+]')!==false || strpos($cmd, $self)!==false)) { - $value = str_replace(array('[+value+]',$self), $value, $cmd); + if($php===false && $html===false && $value!=='' + && (strpos($cmd,'[+value+]')!==false || strpos($cmd,$self)!==false)) + { + $value = str_replace(array('[+value+]',$self),$value,$cmd); } return $value; } @@ -1289,190 +1071,139 @@ public function parseDocumentSource($content='') { $modx = evolutionCMS(); - if (strpos($content, '[')===false && strpos($content, '{')===false) { - return $content; - } + if(strpos($content,'[')===false && strpos($content,'{')===false) return $content; - if (!$modx->maxParserPasses) { - $modx->maxParserPasses = 10; - } + if(!$modx->maxParserPasses) $modx->maxParserPasses = 10; $bt=''; $i=0; - while ($bt!==$content) { + while($bt!==$content) + { $bt = $content; - if (strpos($content, '[*')!==false && $modx->documentIdentifier) { - $content = $modx->mergeDocumentContent($content); - } - if (strpos($content, '[(')!==false) { - $content = $modx->mergeSettingsContent($content); - } - if (strpos($content, '{{')!==false) { - $content = $modx->mergeChunkContent($content); - } - if (strpos($content, '[!')!==false) { - $content = str_replace(array('[!','!]'), array('[[',']]'), $content); - } - if (strpos($content, '[[')!==false) { - $content = $modx->evalSnippets($content); - } - - if ($content===$bt) { - break; - } - if ($modx->maxParserPasses < $i) { - break; - } + if(strpos($content,'[*')!==false && $modx->documentIdentifier) + $content = $modx->mergeDocumentContent($content); + if(strpos($content,'[(')!==false) $content = $modx->mergeSettingsContent($content); + if(strpos($content,'{{')!==false) $content = $modx->mergeChunkContent($content); + if(strpos($content,'[!')!==false) $content = str_replace(array('[!','!]'),array('[[',']]'),$content); + if(strpos($content,'[[')!==false) $content = $modx->evalSnippets($content); + + if($content===$bt) break; + if($modx->maxParserPasses < $i) break; $i++; } return $content; } - public function getDocumentObject($target='', $field='pagetitle') + public function getDocumentObject($target='',$field='pagetitle') { $modx = evolutionCMS(); $target = trim($target); - if (empty($target)) { - $target = $modx->config['site_start']; - } - if (preg_match('@^[1-9][0-9]*$@', $target)) { - $method='id'; - } else { - $method = 'alias'; - } + if(empty($target)) $target = $modx->config['site_start']; + if(preg_match('@^[1-9][0-9]*$@',$target)) $method='id'; + else $method = 'alias'; - if (!isset($this->documentObject[$target])) { - $this->documentObject[$target] = $modx->getDocumentObject($method, $target, 'direct'); + if(!isset($this->documentObject[$target])) + { + $this->documentObject[$target] = $modx->getDocumentObject($method,$target,'direct'); } - if ($this->documentObject[$target]['publishedon']==='0') { + if($this->documentObject[$target]['publishedon']==='0') return ''; - } elseif (isset($this->documentObject[$target][$field])) { - if (is_array($this->documentObject[$target][$field])) { - $a = $modx->getTemplateVarOutput($field, $target); + elseif(isset($this->documentObject[$target][$field])) + { + if(is_array($this->documentObject[$target][$field])) + { + $a = $modx->getTemplateVarOutput($field,$target); $this->documentObject[$target][$field] = $a[$field]; } - } else { - $this->documentObject[$target][$field] = false; } + else $this->documentObject[$target][$field] = false; return $this->documentObject[$target][$field]; } - public function setPlaceholders($value = '', $key = '', $path = '') - { - if ($path!=='') { - $key = "{$path}.{$key}"; - } + public function setPlaceholders($value = '', $key = '', $path = '') { + if($path!=='') $key = "{$path}.{$key}"; if (is_array($value)) { foreach ($value as $subkey => $subval) { $this->setPlaceholders($subval, $subkey, $key); } - } else { - $this->setModifiersVariable($key, $value); } + else $this->setModifiersVariable($key, $value); } // Sets a placeholder variable which can only be access by Modifiers - public function setModifiersVariable($key, $value) - { - if ($key != 'phx' && $key != 'dummy') { - $this->placeholders[$key] = $value; - } + public function setModifiersVariable($key, $value) { + if ($key != 'phx' && $key != 'dummy') $this->placeholders[$key] = $value; } //mbstring - public function substr($str, $s, $l = null) - { + public function substr($str, $s, $l = null) { $modx = evolutionCMS(); - if (is_null($l)) { - $l = $this->strlen($str); - } - if (function_exists('mb_substr')) { - if (strpos($str, "\r")!==false) { + if(is_null($l)) $l = $this->strlen($str); + if (function_exists('mb_substr')) + { + if(strpos($str,"\r")!==false) $str = str_replace(array("\r\n","\r"), "\n", $str); - } return mb_substr($str, $s, $l, $modx->config['modx_charset']); } return substr($str, $s, $l); } - public function strpos($haystack, $needle, $offset=0) - { + public function strpos($haystack,$needle,$offset=0) { $modx = evolutionCMS(); - if (function_exists('mb_strpos')) { - return mb_strpos($haystack, $needle, $offset, $modx->config['modx_charset']); - } - return strpos($haystack, $needle, $offset); + if (function_exists('mb_strpos')) return mb_strpos($haystack,$needle,$offset,$modx->config['modx_charset']); + return strpos($haystack,$needle,$offset); } - public function strlen($str) - { + public function strlen($str) { $modx = evolutionCMS(); - if (function_exists('mb_strlen')) { - return mb_strlen(str_replace("\r\n", "\n", $str), $modx->config['modx_charset']); - } + if (function_exists('mb_strlen')) return mb_strlen(str_replace("\r\n", "\n", $str),$modx->config['modx_charset']); return strlen($str); } - public function strtolower($str) - { - if (function_exists('mb_strtolower')) { - return mb_strtolower($str); - } + public function strtolower($str) { + if (function_exists('mb_strtolower')) return mb_strtolower($str); return strtolower($str); } - public function strtoupper($str) - { - if (function_exists('mb_strtoupper')) { - return mb_strtoupper($str); - } + public function strtoupper($str) { + if (function_exists('mb_strtoupper')) return mb_strtoupper($str); return strtoupper($str); } - public function ucfirst($str) - { - if (function_exists('mb_strtoupper')) { - return mb_strtoupper($this->substr($str, 0, 1)) . $this->substr($str, 1, $this->strlen($str)); - } + public function ucfirst($str) { + if (function_exists('mb_strtoupper')) + return mb_strtoupper($this->substr($str, 0, 1)).$this->substr($str, 1, $this->strlen($str)); return ucfirst($str); } - public function lcfirst($str) - { - if (function_exists('mb_strtolower')) { - return mb_strtolower($this->substr($str, 0, 1)) . $this->substr($str, 1, $this->strlen($str)); - } + public function lcfirst($str) { + if (function_exists('mb_strtolower')) + return mb_strtolower($this->substr($str, 0, 1)).$this->substr($str, 1, $this->strlen($str)); return lcfirst($str); } - public function ucwords($str) - { - if (function_exists('mb_convert_case')) { + public function ucwords($str) { + if (function_exists('mb_convert_case')) return mb_convert_case($str, MB_CASE_TITLE); - } return ucwords($str); } - public function strrev($str) - { + public function strrev($str) { preg_match_all('/./us', $str, $ar); return implode(array_reverse($ar[0])); } - public function str_shuffle($str) - { + public function str_shuffle($str) { preg_match_all('/./us', $str, $ar); shuffle($ar[0]); return implode($ar[0]); } - public function str_word_count($str) - { - return count(preg_split('~[^\p{L}\p{N}\']+~u', $str)); + public function str_word_count($str) { + return count(preg_split('~[^\p{L}\p{N}\']+~u',$str)); } - public function strip_tags($value, $params='') - { + public function strip_tags($value,$params='') { $modx = evolutionCMS(); - if (stripos($params, 'style')===false && stripos($value, '')!==false) { + if(stripos($params,'style')===false && stripos($value,'')!==false) { $value = preg_replace('@.*?@is', '', $value); } - if (stripos($params, 'script')===false && stripos($value, '')!==false) { + if(stripos($params,'script')===false && stripos($value,'')!==false) { $value = preg_replace('@.*?@is', '', $value); } - return trim(strip_tags($value, $params)); + return trim(strip_tags($value,$params)); } } diff --git a/manager/includes/extenders/modifiers/mdf_addbreak.inc.php b/manager/includes/extenders/modifiers/mdf_addbreak.inc.php index 8568eb5f9a..03c3a1abff 100755 --- a/manager/includes/extenders/modifiers/mdf_addbreak.inc.php +++ b/manager/includes/extenders/modifiers/mdf_addbreak.inc.php @@ -1,23 +1,22 @@ filter->parseDocumentSource($value); -$text = str_replace(array("\r\n","\r"), "\n", $text); +$text = str_replace(array("\r\n","\r"),"\n",$text); $blockElms = 'br,table,tbody,tr,td,th,thead,tfoot,caption,colgroup,div'; $blockElms .= ',dl,dd,dt,ul,ol,li,pre,select,option,form,map,area,blockquote'; $blockElms .= ',address,math,style,input,p,h1,h2,h3,h4,h5,h6,hr,object,param,embed'; $blockElms .= ',noframes,noscript,section,article,aside,hgroup,footer,address,code'; $blockElms = explode(',', $blockElms); -$lines = explode("\n", $text); +$lines = explode("\n",$text); $c = count($lines); -foreach ($lines as $i=>$line) { +foreach($lines as $i=>$line) +{ $line = rtrim($line); - if ($i===$c-1) { - break; - } - foreach ($blockElms as $block) { - if (preg_match("@]*>$@', $line)) { + if($i===$c-1) break; + foreach($blockElms as $block) + { + if(preg_match("@]*>$@',$line)) continue 2; - } } $lines[$i] = "{$line}
    "; } diff --git a/manager/includes/extenders/modifiers/mdf_getimage.inc.php b/manager/includes/extenders/modifiers/mdf_getimage.inc.php index dce110774c..9f68f3ce0b 100755 --- a/manager/includes/extenders/modifiers/mdf_getimage.inc.php +++ b/manager/includes/extenders/modifiers/mdf_getimage.inc.php @@ -1,17 +1,16 @@ ]+>/i'; -preg_match_all($pattern, $value, $images); -if ($opt==='') { - if ($images[1][0]) { - return $images[1][0]; - } else { - return ''; - } -} else { - foreach ($images[0] as $i=>$image) { - if (strpos($image, $opt)!==false) { - return $images[1][$i]; - } +preg_match_all($pattern , $value , $images); +if($opt==='') +{ + if($images[1][0]) return $images[1][0]; + else return ''; +} +else +{ + foreach($images[0] as $i=>$image) + { + if(strpos($image,$opt)!==false) return $images[1][$i]; } } diff --git a/manager/includes/extenders/modifiers/mdf_memberof.inc.php b/manager/includes/extenders/modifiers/mdf_memberof.inc.php index c2105bd668..011b882534 100755 --- a/manager/includes/extenders/modifiers/mdf_memberof.inc.php +++ b/manager/includes/extenders/modifiers/mdf_memberof.inc.php @@ -1,28 +1,23 @@ getLoginUserID('web')); -$modx->qs_hash = md5($modx->qs_hash . "^{$userID}^"); +$modx->qs_hash = md5($modx->qs_hash."^{$userID}^"); -$groupNames = ($this->strlen($opt) > 0) ? explode(',', $opt) : array(); +$groupNames = ($this->strlen($opt) > 0 ) ? explode(',',$opt) : array(); // if $groupNames is not an array return false -if (!is_array($groupNames)) { - return 0; -} +if(!is_array($groupNames)) return 0; // Creates an array with all webgroups the user id is in -if (isset($modx->filter->cache['mo'][$userID])) { - $grpNames = $modx->filter->cache['mo'][$userID]; -} else { - $from = sprintf("[+prefix+]webgroup_names wgn INNER JOIN [+prefix+]web_groups wg ON wg.webgroup=wgn.id AND wg.webuser='%s'", $userID); - $rs = $modx->db->select('wgn.name', $from); - $modx->filter->cache['mo'][$userID] = $grpNames = $modx->db->getColumn('name', $rs); +if (isset($modx->filter->cache['mo'][$userID])) $grpNames = $modx->filter->cache['mo'][$userID]; +else { + $from = sprintf("[+prefix+]webgroup_names wgn INNER JOIN [+prefix+]web_groups wg ON wg.webgroup=wgn.id AND wg.webuser='%s'",$userID); + $rs = $modx->db->select('wgn.name',$from); + $modx->filter->cache['mo'][$userID] = $grpNames = $modx->db->getColumn('name',$rs); } // Check if a supplied group matches a webgroup from the array we just created -foreach ($groupNames as $k=>$v) { - if (in_array(trim($v), $grpNames)) { - return 1; - } +foreach($groupNames as $k=>$v) { + if(in_array(trim($v),$grpNames)) return 1; } // If we get here the above logic did not find a match, so return false diff --git a/manager/includes/extenders/modifiers/mdf_moduser.inc.php b/manager/includes/extenders/modifiers/mdf_moduser.inc.php index 3cb23bbb44..1349964cef 100755 --- a/manager/includes/extenders/modifiers/mdf_moduser.inc.php +++ b/manager/includes/extenders/modifiers/mdf_moduser.inc.php @@ -1,11 +1,8 @@ filter->cache['ui'][$userid])) { - if ($userid < 0) { - $user = $modx->getWebUserInfo(abs($userid)); - } else { - $user = $modx->getUserInfo($userid); - } + if ($userid < 0) $user = $modx->getWebUserInfo(abs($userid)); + else $user = $modx->getUserInfo($userid); $modx->filter->cache['ui'][$userid] = $user; } else { $user = $modx->filter->cache['ui'][$userid]; diff --git a/manager/includes/extenders/modifiers/mdf_summary.inc.php b/manager/includes/extenders/modifiers/mdf_summary.inc.php index f40a7c57cb..4cb0dd703b 100755 --- a/manager/includes/extenders/modifiers/mdf_summary.inc.php +++ b/manager/includes/extenders/modifiers/mdf_summary.inc.php @@ -1,64 +1,43 @@ config['manager_language']==='japanese-utf8' ? '。' : '.'; -} +if($delim==='') $delim = $modx->config['manager_language']==='japanese-utf8' ? '。' : '.'; $limit = (int)$limit; $content = $modx->filter->parseDocumentSource($value); $content = strip_tags($content); -$content = str_replace(array("\r\n","\r","\n","\t",' '), ' ', $content); -if (preg_match('/\s+/', $content)) { - $content = preg_replace('/\s+/', ' ', $content); -} +$content = str_replace(array("\r\n","\r","\n","\t",' '),' ',$content); +if(preg_match('/\s+/',$content)) + $content = preg_replace('/\s+/',' ',$content); $content = trim($content); $pos = $modx->filter->strpos($content, $delim); -if ($pos!==false && $pos<$limit) { +if($pos!==false && $pos<$limit) { $_ = explode($delim, $content); $text = ''; - foreach ($_ as $v) { - if ($limit <= $modx->filter->strlen($text . $v . $delim)) { - break; - } - $text .= $v . $delim; - } - if ($text) { - $content = $text; + foreach($_ as $v) { + if($limit <= $modx->filter->strlen($text.$v.$delim)) break; + $text .= $v.$delim; } + if($text) $content = $text; } -if ($limit<$modx->filter->strlen($content) && strpos($content, ' ')!==false) { +if($limit<$modx->filter->strlen($content) && strpos($content,' ')!==false) { $_ = explode(' ', $content); $text = ''; - foreach ($_ as $v) { - if ($limit <= $modx->filter->strlen($text . $v . ' ')) { - break; - } + foreach($_ as $v) { + if($limit <= $modx->filter->strlen($text.$v.' ')) break; $text .= $v . ' '; } - if ($text!=='') { - $content = $text; - } + if($text!=='') $content = $text; } -if ($limit < $modx->filter->strlen($content)) { - $content = $modx->filter->substr($content, 0, $limit); -} -if ($modx->filter->substr($content, -1)==$delim) { - $content = rtrim($content, $delim) . $delim; -} +if($limit < $modx->filter->strlen($content)) $content = $modx->filter->substr($content, 0, $limit); +if($modx->filter->substr($content,-1)==$delim) $content = rtrim($content,$delim) . $delim; return $content; diff --git a/manager/includes/extenders/modifiers/mdf_wordwrap.inc.php b/manager/includes/extenders/modifiers/mdf_wordwrap.inc.php index 5afbd2a85a..2613e8094b 100755 --- a/manager/includes/extenders/modifiers/mdf_wordwrap.inc.php +++ b/manager/includes/extenders/modifiers/mdf_wordwrap.inc.php @@ -1,4 +1,2 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } global $SystemAlertMsgQueque; // display system alert window if messages are available -if (count($SystemAlertMsgQueque) > 0) { - include "sysalert.display.inc.php"; +if(count($SystemAlertMsgQueque) > 0) { + include "sysalert.display.inc.php"; } ?> manager->action, array( - 85, - 27, - 4, - 72, - 13, - 11, - 12, - 87, - 88 +if(in_array($modx->manager->action, array( + 85, + 27, + 4, + 72, + 13, + 11, + 12, + 87, + 88 ))) { - echo $modx->manager->loadDatePicker($modx->config['mgr_date_picker_path']); + echo $modx->manager->loadDatePicker($modx->config['mgr_date_picker_path']); } ?> diff --git a/manager/includes/header.inc.php b/manager/includes/header.inc.php index a3b92dfb05..147c0f6e04 100755 --- a/manager/includes/header.inc.php +++ b/manager/includes/header.inc.php @@ -66,20 +66,16 @@ ' . "\n", $modx->config['mgr_jquery_path']) ?> - config['show_picker'] != "0") { - ?> + config['show_picker'] != "0") { ?> - + + if (!in_array($_REQUEST['a'], $aArr)) { ?> - + diff --git a/manager/includes/log.class.inc.php b/manager/includes/log.class.inc.php index 42cd407691..c6855d14c3 100755 --- a/manager/includes/log.class.inc.php +++ b/manager/includes/log.class.inc.php @@ -106,16 +106,16 @@ public function writeToLog() } } - private function getUserIP() - { - if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER) && !empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { + private function getUserIP() { + if( array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER) && !empty($_SERVER['HTTP_X_FORWARDED_FOR']) ) { if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',')>0) { - $addr = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']); + $addr = explode(",",$_SERVER['HTTP_X_FORWARDED_FOR']); return trim($addr[0]); } else { return $_SERVER['HTTP_X_FORWARDED_FOR']; } - } else { + } + else { return $_SERVER['REMOTE_ADDR']; } } diff --git a/manager/includes/manager.lockout.inc.php b/manager/includes/manager.lockout.inc.php index 02e179df9e..400371a225 100755 --- a/manager/includes/manager.lockout.inc.php +++ b/manager/includes/manager.lockout.inc.php @@ -1,68 +1,75 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if ($modx->manager->action!='8' && isset($_SESSION['mgrValidated'])) { +if($modx->manager->action!='8' && isset($_SESSION['mgrValidated'])){ + $homeurl = $modx->makeUrl($manager_login_startup>0 ? $manager_login_startup:$site_start); - $logouturl = MODX_MANAGER_URL . 'index.php?a=8'; + $logouturl = MODX_MANAGER_URL.'index.php?a=8'; - $modx->setPlaceholder('modx_charset', $modx_manager_charset); - $modx->setPlaceholder('theme', $manager_theme); + $modx->setPlaceholder('modx_charset',$modx_manager_charset); + $modx->setPlaceholder('theme',$manager_theme); - $modx->setPlaceholder('site_name', $site_name); - $modx->setPlaceholder('logo_slogan', $_lang["logo_slogan"]); - $modx->setPlaceholder('manager_lockout_message', $_lang["manager_lockout_message"]); + $modx->setPlaceholder('site_name',$site_name); + $modx->setPlaceholder('logo_slogan',$_lang["logo_slogan"]); + $modx->setPlaceholder('manager_lockout_message',$_lang["manager_lockout_message"]); - $modx->setPlaceholder('home', $_lang["home"]); - $modx->setPlaceholder('homeurl', $homeurl); - $modx->setPlaceholder('logout', $_lang["logout"]); - $modx->setPlaceholder('logouturl', $logouturl); - $modx->setPlaceholder('manager_theme_url', MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/'); - $modx->setPlaceholder('year', date('Y')); + $modx->setPlaceholder('home',$_lang["home"]); + $modx->setPlaceholder('homeurl',$homeurl); + $modx->setPlaceholder('logout',$_lang["logout"]); + $modx->setPlaceholder('logouturl',$logouturl); + $modx->setPlaceholder('manager_theme_url',MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/'); + $modx->setPlaceholder('year',date('Y')); // load template - if (!isset($modx->config['manager_lockout_tpl']) || empty($modx->config['manager_lockout_tpl'])) { - $modx->config['manager_lockout_tpl'] = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; + if(!isset($modx->config['manager_lockout_tpl']) || empty($modx->config['manager_lockout_tpl'])) { + $modx->config['manager_lockout_tpl'] = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; } $target = $modx->config['manager_lockout_tpl']; $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target); $target = $modx->mergeSettingsContent($target); - if (substr($target, 0, 1)==='@') { - if (substr($target, 0, 6)==='@CHUNK') { - $target = trim(substr($target, 7)); - $lockout_tpl = $modx->getChunk($target); - } elseif (substr($target, 0, 5)==='@FILE') { - $target = trim(substr($target, 6)); - $lockout_tpl = file_get_contents($target); - } - } else { - $chunk = $modx->getChunk($target); - if ($chunk!==false && !empty($chunk)) { - $lockout_tpl = $chunk; - } elseif (is_file(MODX_BASE_PATH . $target)) { - $target = MODX_BASE_PATH . $target; - $lockout_tpl = file_get_contents($target); - } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl')) { - $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl'; - $lockout_tpl = file_get_contents($target); - } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl')) { - $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl'; - $login_tpl = file_get_contents($target); - } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html')) { // ClipperCMS compatible - $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html'; - $lockout_tpl = file_get_contents($target); - } else { - $target = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; - $lockout_tpl = file_get_contents($target); - } - } + if(substr($target,0,1)==='@') { + if(substr($target,0,6)==='@CHUNK') { + $target = trim(substr($target,7)); + $lockout_tpl = $modx->getChunk($target); + } + elseif(substr($target,0,5)==='@FILE') { + $target = trim(substr($target,6)); + $lockout_tpl = file_get_contents($target); + } + } else { + $chunk = $modx->getChunk($target); + if($chunk!==false && !empty($chunk)) { + $lockout_tpl = $chunk; + } + elseif(is_file(MODX_BASE_PATH . $target)) { + $target = MODX_BASE_PATH . $target; + $lockout_tpl = file_get_contents($target); + } + elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl')) { + $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl'; + $lockout_tpl = file_get_contents($target); + } + elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl')) { + $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl'; + $login_tpl = file_get_contents($target); + } + elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html')) { // ClipperCMS compatible + $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html'; + $lockout_tpl = file_get_contents($target); + } + else { + $target = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; + $lockout_tpl = file_get_contents($target); + } + } // merge placeholders $lockout_tpl = $modx->mergePlaceholderContent($lockout_tpl); - $regx = strpos($lockout_tpl, '[[+')!==false ? '~\[\[\+(.*?)\]\]~' : '~\[\+(.*?)\+\]~'; // little tweak for newer parsers + $regx = strpos($lockout_tpl,'[[+')!==false ? '~\[\[\+(.*?)\]\]~' : '~\[\+(.*?)\+\]~'; // little tweak for newer parsers $lockout_tpl = preg_replace($regx, '', $lockout_tpl); //cleanup echo $lockout_tpl; diff --git a/manager/includes/menu.class.inc.php b/manager/includes/menu.class.inc.php index 438d6bedbe..d131fc79f7 100755 --- a/manager/includes/menu.class.inc.php +++ b/manager/includes/menu.class.inc.php @@ -68,6 +68,7 @@ public function DrawSub($parentid, $level) $output = ''; if (isset($this->menu[$parentid])) { + $ph = array(); $countChild = 0; $itemTpl = ' @@ -101,7 +102,7 @@ public function DrawSub($parentid, $level) $level++; $ph['DrawSub'] = $this->DrawSub($id, $level); $level--; - // Optional buttons + // Optional buttons } else { if (isset($value[11]) && !empty($value[11])) { $optionalButton = ''; diff --git a/manager/includes/preload.functions.inc.php b/manager/includes/preload.functions.inc.php index a2494134af..e348415912 100755 --- a/manager/includes/preload.functions.inc.php +++ b/manager/includes/preload.functions.inc.php @@ -4,14 +4,14 @@ $site_sessionname = genEvoSessionName(); // For legacy extras not using startCMSSession -if (! function_exists('evolutionCMS')) { +if( ! function_exists('evolutionCMS')) { /** * @return DocumentParser */ function evolutionCMS() { - if (! defined('MODX_CLASS')) { - if (! class_exists('DocumentParser')) { + if( ! defined('MODX_CLASS')) { + if( ! class_exists('DocumentParser')) { throw new RuntimeException('MODX_CLASS not defined and DocumentParser class not exists'); } define('MODX_CLASS', 'DocumentParser'); @@ -38,14 +38,12 @@ function genEvoSessionName() function startCMSSession() { global $site_sessionname, $https_port, $session_cookie_path, $session_cookie_domain; - if (MODX_CLI) { - return; - } + if(MODX_CLI) return; session_name($site_sessionname); removeInvalidCmsSessionIds($site_sessionname); $cookieExpiration = 0; - $secure = ((isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port); + $secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port); $cookiePath = !empty($session_cookie_path) ? $session_cookie_path : MODX_BASE_URL; $cookieDomain = !empty($session_cookie_domain) ? $session_cookie_domain : ''; session_set_cookie_params($cookieExpiration, $cookiePath, $cookieDomain, $secure, true); @@ -81,9 +79,7 @@ function removeInvalidCmsSessionFromStorage(&$storage, $session_name) */ function removeInvalidCmsSessionIds($session_name) { - if (MODX_CLI) { - return; - } + if(MODX_CLI) return; // session ids is invalid iff it is empty string // storage priorioty can see in PHP source ext/session/session.c removeInvalidCmsSessionFromStorage($_COOKIE, $session_name); diff --git a/manager/includes/protect.inc.php b/manager/includes/protect.inc.php index 968e76eff1..f868ed98b8 100755 --- a/manager/includes/protect.inc.php +++ b/manager/includes/protect.inc.php @@ -77,8 +77,8 @@ function getSanitizedValue($value = '') modx_sanitize_gpc($_REQUEST); foreach (array('PHP_SELF', 'HTTP_USER_AGENT', 'HTTP_REFERER', 'QUERY_STRING') as $key) { - $_SERVER[$key] = isset($_SERVER[$key]) ? htmlspecialchars($_SERVER[$key], ENT_QUOTES) : null; + $_SERVER[$key] = isset ($_SERVER[$key]) ? htmlspecialchars($_SERVER[$key], ENT_QUOTES) : null; } // Unset vars -unset($key, $value); +unset ($key, $value); diff --git a/manager/includes/sysalert.display.inc.php b/manager/includes/sysalert.display.inc.php index 8300f08e49..0b97e73b96 100755 --- a/manager/includes/sysalert.display.inc.php +++ b/manager/includes/sysalert.display.inc.php @@ -1,37 +1,38 @@ "; - } - // reset message queque - unset($_SESSION['SystemAlertMsgQueque']); - $_SESSION['SystemAlertMsgQueque'] = array(); - $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque']; + $sysMsgs = ""; + $limit = count($SystemAlertMsgQueque); + for($i=0;$i<$limit;$i++) { + $sysMsgs .= $SystemAlertMsgQueque[$i]."
    "; + } + // reset message queque + unset($_SESSION['SystemAlertMsgQueque']); + $_SESSION['SystemAlertMsgQueque'] = array(); + $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque']; - if ($sysMsgs!="") { - ?> + if($sysMsgs!="") { +?> '; ?> + echo ''; +?> \ No newline at end of file diff --git a/manager/includes/template.parser.class.inc.php b/manager/includes/template.parser.class.inc.php index 8cf3029481..cc999700ad 100755 --- a/manager/includes/template.parser.class.inc.php +++ b/manager/includes/template.parser.class.inc.php @@ -7,185 +7,182 @@ * */ -class TemplateParser -{ +Class TemplateParser { /** - * @param array $config [action, tabs, toArray] - * @param array $data - * @return string - */ - public function output($config = array(), $data = array()) - { + * @param array $config [action, tabs, toArray] + * @param array $data + * @return string + */ + public function output($config = array(), $data = array()) { $modx = evolutionCMS(); - $output = ''; - $action = !empty($config['action']) ? $config['action'] : (!empty($_REQUEST['a']) ? $_REQUEST['a'] : ''); - $tab = isset($config['tab']) ? ' AND tab IN(' . $config['tab'] . ')' : ''; + $output = ''; + $action = !empty($config['action']) ? $config['action'] : (!empty($_REQUEST['a']) ? $_REQUEST['a'] : ''); + $tab = isset($config['tab']) ? ' AND tab IN(' . $config['tab'] . ')' : ''; - if ($action) { - $sql = $modx->db->query('SELECT t1.*, IF(t1.alias=\'\',t1.name,t1.alias) AS alias, t2.category AS category_name + if($action) { + $sql = $modx->db->query('SELECT t1.*, IF(t1.alias=\'\',t1.name,t1.alias) AS alias, t2.category AS category_name FROM ' . $modx->getFullTableName('system_templates') . ' AS t1 INNER JOIN ' . $modx->getFullTableName('categories') . ' AS t2 ON t2.id=t1.category WHERE t1.action IN(' . $action . ') ' . $tab . ' ORDER BY t1.tab ASC, t1.rank ASC'); - if ($modx->db->getRecordCount($sql)) { - $tabs = array(); - while ($row = $modx->db->getRow($sql)) { - if (!$row['value'] && !empty($data[$row['name']])) { - $row['value'] = $data[$row['name']]; - } - $tabs[$row['tab']]['category_name'] = $row['category_name']; - $tabs[$row['tab']][$row['name']] = TemplateParser::render($row); - } - - if (!empty($config['toArray'])) { - $output = $tabs; - } else { - $output .= '
    '; - $output .= ' + if($modx->db->getRecordCount($sql)) { + $tabs = array(); + while($row = $modx->db->getRow($sql)) { + if(!$row['value'] && !empty($data[$row['name']])) { + $row['value'] = $data[$row['name']]; + } + $tabs[$row['tab']]['category_name'] = $row['category_name']; + $tabs[$row['tab']][$row['name']] = TemplateParser::render($row); + } + + if(!empty($config['toArray'])) { + $output = $tabs; + } else { + $output .= '
    '; + $output .= ' '; - foreach ($tabs as $idTab => $tab) { - $output .= '
    '; - $output .= ' + foreach($tabs as $idTab => $tab) { + $output .= '
    '; + $output .= '

    ' . (!empty($config['tabs'][$idTab]) ? $config['tabs'][$idTab] : $tab['category_name']) . '

    '; - unset($tab['category_name']); - foreach ($tab as $item) { - $output .= $item; - } - $output .= '
    '; - } - $output .= '
    '; - } - } - } - - return $output; - } + unset($tab['category_name']); + foreach($tab as $item) { + $output .= $item; + } + $output .= '
    '; + } + $output .= '
    '; + } + } + } + + return $output; + } /** * @param array $data * @return string */ - private function render($data) - { - $modx = evolutionCMS(); - global $_lang, $_country_lang; + private function render($data) { + $modx = evolutionCMS(); global $_lang, $_country_lang; - $data['lang.name'] = (isset($_lang[$data['alias']]) ? $_lang[$data['alias']] : $data['alias']); - $data['value'] = (isset($_POST[$data['name']][$data['value']]) ? $_POST[$data['name']][$data['value']] : (isset($data['value']) ? $modx->htmlspecialchars($data['value']) : '')); - $data['readonly'] = ($data['readonly'] ? ' readonly' : ''); + $data['lang.name'] = (isset($_lang[$data['alias']]) ? $_lang[$data['alias']] : $data['alias']); + $data['value'] = (isset($_POST[$data['name']][$data['value']]) ? $_POST[$data['name']][$data['value']] : (isset($data['value']) ? $modx->htmlspecialchars($data['value']) : '')); + $data['readonly'] = ($data['readonly'] ? ' readonly' : ''); - $output = ''; - $output .= '
    '; + $output = ''; + $output .= '
    '; - switch ($data['type']) { + switch($data['type']) { - case 'text': - $output .= ' + case 'text': + $output .= '
    '; - $output .= $data['content']; - $output .= '
    '; + $output .= $data['content']; + $output .= '
    '; - break; + break; - case 'textarea': - $output .= ' + case 'textarea': + $output .= '
    '; - $output .= $data['content']; - $output .= '
    '; + $output .= $data['content']; + $output .= '
    '; - break; + break; - case 'date': - $data['value'] = (isset($_POST[$data['name']][$data['value']]) ? $modx->toDateFormat($_POST[$data['name']][$data['value']]) : (isset($data['value']) ? $modx->toDateFormat($data['value']) : '')); - $output .= ' + case 'date': + $data['value'] = (isset($_POST[$data['name']][$data['value']]) ? $modx->toDateFormat($_POST[$data['name']][$data['value']]) : (isset($data['value']) ? $modx->toDateFormat($data['value']) : '')); + $output .= '
    '; - $output .= $data['content']; - $output .= '
    '; - - break; - - case 'select': - $output .= ''; - $output .= '
    '; - $output .= ''; - $output .= $data['content']; - $output .= '
    '; - - break; - - case 'checkbox': - $output .= ''; - $output .= '
    '; - $output .= ''; - if ($data['elements']) { - $elements = explode('||', $data['elements']); - foreach ($elements as $key => $value) { - $value = explode('==', $value); - $output .= '
    ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); - } - } - $output .= $data['content']; - $output .= '
    '; - - break; - - case 'radio': - $output .= ''; - $output .= '
    '; - $output .= ''; - if ($data['elements']) { - $elements = explode('||', $data['elements']); - foreach ($elements as $key => $value) { - $value = explode('==', $value); - $output .= '
    ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); - } - } - $output .= $data['content']; - $output .= '
    '; - - break; - - case 'custom': - $output .= ''; - $output .= '
    '; - $output .= $data['content']; - $output .= '
    '; - - break; - } - - $output .= ''; - - $output = $modx->parseText($output, $data); - - return $output; - } + $output .= $data['content']; + $output .= ''; + + break; + + case 'select': + $output .= ''; + $output .= '
    '; + $output .= ''; + $output .= $data['content']; + $output .= '
    '; + + break; + + case 'checkbox': + $output .= ''; + $output .= '
    '; + $output .= ''; + if($data['elements']) { + $elements = explode('||', $data['elements']); + foreach($elements as $key => $value) { + $value = explode('==', $value); + $output .= '
    ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); + } + } + $output .= $data['content']; + $output .= '
    '; + + break; + + case 'radio': + $output .= ''; + $output .= '
    '; + $output .= ''; + if($data['elements']) { + $elements = explode('||', $data['elements']); + foreach($elements as $key => $value) { + $value = explode('==', $value); + $output .= '
    ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); + } + } + $output .= $data['content']; + $output .= '
    '; + + break; + + case 'custom': + $output .= ''; + $output .= '
    '; + $output .= $data['content']; + $output .= '
    '; + + break; + } + + $output .= ''; + + $output = $modx->parseText($output, $data); + + return $output; + } + } ?> diff --git a/manager/includes/tmplvars.commands.inc.php b/manager/includes/tmplvars.commands.inc.php index dd49967362..8137692b9d 100755 --- a/manager/includes/tmplvars.commands.inc.php +++ b/manager/includes/tmplvars.commands.inc.php @@ -4,7 +4,7 @@ * Created by Raymond Irving Feb, 2005 */ global $BINDINGS; // Array of supported bindings. must be upper case -$BINDINGS = array( +$BINDINGS = array ( 'FILE', 'CHUNK', 'DOCUMENT', @@ -22,41 +22,40 @@ * @param array $tvsArray * @return string */ -function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsArray = array()) -{ +function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsArray = array()) { $modx = evolutionCMS(); $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier; $nvalue = trim($value); - if (substr($nvalue, 0, 1) != '@') { + if (substr($nvalue, 0, 1) != '@') return $value; - } elseif (isset($modx->config['enable_bindings']) && $modx->config['enable_bindings']!=1 && $src==='docform') { + elseif(isset($modx->config['enable_bindings']) && $modx->config['enable_bindings']!=1 && $src==='docform') { return '@Bindings is disabled.'; - } else { - list($cmd, $param) = ParseCommand($nvalue); + } + else { + list ($cmd, $param) = ParseCommand($nvalue); $cmd = trim($cmd); $param = parseTvValues($param, $tvsArray); switch ($cmd) { - case "FILE": + case "FILE" : $output = $modx->atBindFileContent($nvalue); break; - case "CHUNK": // retrieve a chunk and process it's content + case "CHUNK" : // retrieve a chunk and process it's content $chunk = $modx->getChunk(trim($param)); $output = $chunk; break; - case "DOCUMENT": // retrieve a document and process it's content + case "DOCUMENT" : // retrieve a document and process it's content $rs = $modx->getDocument($param); - if (is_array($rs)) { + if (is_array($rs)) $output = $rs['content']; - } else { + else $output = "Unable to locate document $param"; - } break; - case "SELECT": // selects a record from the cms database - $rt = array(); - $replacementVars = array( + case "SELECT" : // selects a record from the cms database + $rt = array (); + $replacementVars = array ( 'DBASE' => $modx->db->config['dbase'], 'PREFIX' => $modx->db->config['table_prefix'] ); @@ -68,11 +67,11 @@ function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsA $output = $rs; break; - case "EVAL": // evaluates text as php codes return the results - $output = eval($param); + case "EVAL" : // evaluates text as php codes return the results + $output = eval ($param); break; - case "INHERIT": + case "INHERIT" : $output = $param; // Default to param value if no content from parents $doc = $modx->getPageInfo($docid, 0, 'id,parent'); @@ -81,9 +80,8 @@ function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsA // Grab document regardless of publish status $doc = $modx->getPageInfo($parent_id, 0, 'id,parent,published'); - if ($doc['parent'] != 0 && !$doc['published']) { - continue; - } // hide unpublished docs if we're not at the top + if ($doc['parent'] != 0 && !$doc['published']) + continue; // hide unpublished docs if we're not at the top $tv = $modx->getTemplateVar($name, '*', $doc['id'], $doc['published']); @@ -97,8 +95,8 @@ function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsA } break; - case 'DIRECTORY': - $files = array(); + case 'DIRECTORY' : + $files = array (); $path = $modx->config['base_path'] . $param; if (substr($path, -1, 1) != '/') { $path .= '/'; @@ -117,7 +115,7 @@ function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsA $output = implode('||', $files); break; - default: + default : $output = $value; break; @@ -131,13 +129,10 @@ function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsA * @param $file * @return string */ -function ProcessFile($file) -{ +function ProcessFile($file) { // get the file - $buffer = @file_get_contents($file); - if ($buffer === false) { - $buffer = " Could not retrieve document '$file'."; - } + $buffer = @file_get_contents($file); + if ($buffer === false) $buffer = " Could not retrieve document '$file'."; return $buffer; } @@ -151,9 +146,11 @@ function ParseCommand($binding_string) { global $BINDINGS; $binding_array = array(); - foreach ($BINDINGS as $cmd) { - if (strpos($binding_string, '@' . $cmd)===0) { - $code = substr($binding_string, strlen($cmd)+1); + foreach($BINDINGS as $cmd) + { + if(strpos($binding_string,'@'.$cmd)===0) + { + $code = substr($binding_string,strlen($cmd)+1); $binding_array = array($cmd,trim($code)); break; } @@ -171,20 +168,20 @@ function ParseCommand($binding_string) function parseTvValues($param, $tvsArray) { $modx = evolutionCMS(); - $tvsArray = is_array($modx->documentObject) ? array_merge($tvsArray, $modx->documentObject) : $tvsArray; - if (strpos($param, '[*') !== false) { - $matches = $modx->getTagsFromContent($param, '[*', '*]'); - foreach ($matches[0] as $i=>$match) { - if (isset($tvsArray[ $matches[1][$i] ])) { - if (is_array($tvsArray[ $matches[1][$i] ])) { - $value = $tvsArray[$matches[1][$i]]['value']; - $value = $value === '' ? $tvsArray[$matches[1][$i]]['default_text'] : $value; - } else { - $value = $tvsArray[ $matches[1][$i] ]; - } - $param = str_replace($match, $value, $param); - } - } - } - return $param; + $tvsArray = is_array($modx->documentObject) ? array_merge($tvsArray, $modx->documentObject) : $tvsArray; + if (strpos($param, '[*') !== false) { + $matches = $modx->getTagsFromContent($param, '[*', '*]'); + foreach ($matches[0] as $i=>$match) { + if(isset($tvsArray[ $matches[1][$i] ])) { + if(is_array($tvsArray[ $matches[1][$i] ])) { + $value = $tvsArray[$matches[1][$i]]['value']; + $value = $value === '' ? $tvsArray[$matches[1][$i]]['default_text'] : $value; + } else { + $value = $tvsArray[ $matches[1][$i] ]; + } + $param = str_replace($match, $value, $param); + } + } + } + return $param; } diff --git a/manager/includes/tmplvars.format.inc.php b/manager/includes/tmplvars.format.inc.php index 141c2a6a5b..edd050bd85 100755 --- a/manager/includes/tmplvars.format.inc.php +++ b/manager/includes/tmplvars.format.inc.php @@ -15,342 +15,335 @@ * @param string $sep * @return mixed|string */ -function getTVDisplayFormat($name, $value, $format, $paramstring = "", $tvtype = "", $docid = "", $sep = '') -{ +function getTVDisplayFormat($name, $value, $format, $paramstring = "", $tvtype = "", $docid = "", $sep = '') { + $modx = evolutionCMS(); $o = ''; // process any TV commands in value - $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier; - $value = ProcessTVCommand($value, $name, $docid); + $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier; + $value = ProcessTVCommand($value, $name, $docid); - $params = array(); - if ($paramstring) { - $cp = explode("&", $paramstring); - foreach ($cp as $p => $v) { - $v = trim($v); // trim - $ar = explode("=", $v); - if (is_array($ar) && count($ar) == 2) { - $params[$ar[0]] = decodeParamValue($ar[1]); - } - } - } + $params = array(); + if($paramstring) { + $cp = explode("&", $paramstring); + foreach($cp as $p => $v) { + $v = trim($v); // trim + $ar = explode("=", $v); + if(is_array($ar) && count($ar) == 2) { + $params[$ar[0]] = decodeParamValue($ar[1]); + } + } + } - $id = "tv$name"; - switch ($format) { - case 'image': - $images = parseInput($value, '||', 'array'); - foreach ($images as $image) { - if (!is_array($image)) { - $image = explode('==', $image); - } - $src = $image[0]; + $id = "tv$name"; + switch($format) { + case 'image': + $images = parseInput($value, '||', 'array'); + foreach($images as $image) { + if(!is_array($image)) { + $image = explode('==', $image); + } + $src = $image[0]; - if ($src) { - // We have a valid source - $attributes = ''; - $attr = array( - 'class' => $params['class'], - 'src' => $src, - 'id' => ($params['id'] ? $params['id'] : ''), - 'alt' => $modx->htmlspecialchars($params['alttext']), - 'style' => $params['style'] - ); - if (isset($params['align']) && $params['align'] != 'none') { - $attr['align'] = $params['align']; - } - foreach ($attr as $k => $v) { - $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); - } - $attributes .= ' ' . $params['attrib']; + if($src) { + // We have a valid source + $attributes = ''; + $attr = array( + 'class' => $params['class'], + 'src' => $src, + 'id' => ($params['id'] ? $params['id'] : ''), + 'alt' => $modx->htmlspecialchars($params['alttext']), + 'style' => $params['style'] + ); + if(isset($params['align']) && $params['align'] != 'none') { + $attr['align'] = $params['align']; + } + foreach($attr as $k => $v) $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); + $attributes .= ' ' . $params['attrib']; - // Output the image with attributes - $o .= ''; - } - } - break; + // Output the image with attributes + $o .= ''; + } + } + break; - case "delim": // display as delimitted list - $value = parseInput($value, "||"); - $p = $params['format'] ? $params['format'] : " "; - if ($p == "\\n") { - $p = "\n"; - } - $o = str_replace("||", $p, $value); - break; + case "delim": // display as delimitted list + $value = parseInput($value, "||"); + $p = $params['format'] ? $params['format'] : " "; + if($p == "\\n") { + $p = "\n"; + } + $o = str_replace("||", $p, $value); + break; - case "string": - $value = parseInput($value); - $format = strtolower($params['format']); - if ($format == 'upper case') { - $o = strtoupper($value); - } elseif ($format == 'lower case') { - $o = strtolower($value); - } elseif ($format == 'sentence case') { - $o = ucfirst($value); - } elseif ($format == 'capitalize') { - $o = ucwords($value); - } else { - $o = $value; - } - break; + case "string": + $value = parseInput($value); + $format = strtolower($params['format']); + if($format == 'upper case') { + $o = strtoupper($value); + } else if($format == 'lower case') { + $o = strtolower($value); + } else if($format == 'sentence case') { + $o = ucfirst($value); + } else if($format == 'capitalize') { + $o = ucwords($value); + } else { + $o = $value; + } + break; - case "date": - if ($value != '' || $params['default'] == 'Yes') { - if (empty($value)) { - $value = 'now'; - } - $timestamp = getUnixtimeFromDateString($value); - $p = $params['format'] ? $params['format'] : "%A %d, %B %Y"; - $o = strftime($p, $timestamp); - } else { - $value = ''; - } - break; + case "date": + if($value != '' || $params['default'] == 'Yes') { + if(empty($value)) { + $value = 'now'; + } + $timestamp = getUnixtimeFromDateString($value); + $p = $params['format'] ? $params['format'] : "%A %d, %B %Y"; + $o = strftime($p, $timestamp); + } else { + $value = ''; + } + break; - case "hyperlink": - $value = parseInput($value, "||", "array"); - $o = ''; - $countValue = count($value); - for ($i = 0; $i < $countValue; $i++) { - list($name, $url) = is_array($value[$i]) ? $value[$i] : explode("==", $value[$i]); - if (!$url) { - $url = $name; - } - if ($url) { - if ($o) { - $o .= '
    '; - } - $attributes = ''; - // setup the link attributes - $attr = array( - 'href' => $url, - 'title' => $params['title'] ? $modx->htmlspecialchars($params['title']) : $name, - 'class' => $params['class'], - 'style' => $params['style'], - 'target' => $params['target'], - ); - foreach ($attr as $k => $v) { - $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); - } - $attributes .= ' ' . $params['attrib']; // add extra + case "hyperlink": + $value = parseInput($value, "||", "array"); + $o = ''; + $countValue = count($value); + for($i = 0; $i < $countValue; $i++) { + list($name, $url) = is_array($value[$i]) ? $value[$i] : explode("==", $value[$i]); + if(!$url) { + $url = $name; + } + if($url) { + if($o) { + $o .= '
    '; + } + $attributes = ''; + // setup the link attributes + $attr = array( + 'href' => $url, + 'title' => $params['title'] ? $modx->htmlspecialchars($params['title']) : $name, + 'class' => $params['class'], + 'style' => $params['style'], + 'target' => $params['target'], + ); + foreach($attr as $k => $v) $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); + $attributes .= ' ' . $params['attrib']; // add extra - // Output the link - $o .= '' . ($params['text'] ? $modx->htmlspecialchars($params['text']) : $name) . ''; - } - } - break; + // Output the link + $o .= '' . ($params['text'] ? $modx->htmlspecialchars($params['text']) : $name) . ''; + } + } + break; - case "htmltag": - $value = parseInput($value, "||", "array"); - $tagid = $params['tagid']; - $tagname = ($params['tagname']) ? $params['tagname'] : 'div'; - $o = ''; - // Loop through a list of tags + case "htmltag": + $value = parseInput($value, "||", "array"); + $tagid = $params['tagid']; + $tagname = ($params['tagname']) ? $params['tagname'] : 'div'; + $o = ''; + // Loop through a list of tags $countValue = count($value); - for ($i = 0; $i < $countValue; $i++) { - $tagvalue = is_array($value[$i]) ? implode(' ', $value[$i]) : $value[$i]; - if (!$tagvalue) { - continue; - } + for($i = 0; $i < $countValue; $i++) { + $tagvalue = is_array($value[$i]) ? implode(' ', $value[$i]) : $value[$i]; + if(!$tagvalue) { + continue; + } - $attributes = ''; - $attr = array( - 'id' => ($tagid ? $tagid : $id), - // 'tv' already added to id - 'class' => $params['class'], - 'style' => $params['style'], - ); - foreach ($attr as $k => $v) { - $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); - } - $attributes .= ' ' . $params['attrib']; // add extra + $attributes = ''; + $attr = array( + 'id' => ($tagid ? $tagid : $id), + // 'tv' already added to id + 'class' => $params['class'], + 'style' => $params['style'], + ); + foreach($attr as $k => $v) $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); + $attributes .= ' ' . $params['attrib']; // add extra - // Output the HTML Tag - $o .= '<' . $tagname . rtrim($attributes) . '>' . $tagvalue . ''; - } - break; + // Output the HTML Tag + $o .= '<' . $tagname . rtrim($attributes) . '>' . $tagvalue . ''; + } + break; - case "richtext": - $value = parseInput($value); - $w = $params['w'] ? $params['w'] : '100%'; - $h = $params['h'] ? $params['h'] : '400px'; - $richtexteditor = $params['edt'] ? $params['edt'] : ""; - $o = '
    '; - $replace_richtext = array($id); - // setup editors - if (!empty($replace_richtext) && !empty($richtexteditor)) { - // invoke OnRichTextEditorInit event - $evtOut = $modx->invokeEvent("OnRichTextEditorInit", array( - 'editor' => $richtexteditor, - 'elements' => $replace_richtext, - 'forfrontend' => 1, - 'width' => $w, - 'height' => $h - )); - if (is_array($evtOut)) { - $o .= implode("", $evtOut); - } - } - break; + case "richtext": + $value = parseInput($value); + $w = $params['w'] ? $params['w'] : '100%'; + $h = $params['h'] ? $params['h'] : '400px'; + $richtexteditor = $params['edt'] ? $params['edt'] : ""; + $o = '
    '; + $replace_richtext = array($id); + // setup editors + if(!empty($replace_richtext) && !empty($richtexteditor)) { + // invoke OnRichTextEditorInit event + $evtOut = $modx->invokeEvent("OnRichTextEditorInit", array( + 'editor' => $richtexteditor, + 'elements' => $replace_richtext, + 'forfrontend' => 1, + 'width' => $w, + 'height' => $h + )); + if(is_array($evtOut)) { + $o .= implode("", $evtOut); + } + } + break; - case "unixtime": - $value = parseInput($value); - $o = getUnixtimeFromDateString($value); - break; + case "unixtime": + $value = parseInput($value); + $o = getUnixtimeFromDateString($value); + break; - case "viewport": - $value = parseInput($value); - $id = '_' . time(); - if (!$params['vpid']) { - $params['vpid'] = $id; - } - $sTag = "regClientStartupScript(MODX_MANAGER_URL . "media/script/bin/viewport.js", array( - 'name' => 'viewport', - 'version' => '0', - 'plaintext' => false - )); - $o = $sTag . " id='" . $params['vpid'] . "' name='" . $params['vpid'] . "' "; - if ($params['class']) { - $o .= " class='" . $params['class'] . "' "; - } - if ($params['style']) { - $o .= " style='" . $params['style'] . "' "; - } - if ($params['attrib']) { - $o .= $params['attrib'] . " "; - } - $o .= "scrolling='" . ($params['sbar'] == 'No' ? "no" : ($params['sbar'] == 'Yes' ? "yes" : "auto")) . "' "; - $o .= "src='" . $value . "' frameborder='" . $params['borsize'] . "' "; - $o .= "onload=\"window.setTimeout('ResizeViewPort(\\'" . $params['vpid'] . "\\'," . $autoMode . ")',100);\" width='" . $w . "' height='" . $h . "' "; - $o .= ">"; - $o .= $eTag; - break; + $modx->regClientStartupScript(MODX_MANAGER_URL . "media/script/bin/viewport.js", array( + 'name' => 'viewport', + 'version' => '0', + 'plaintext' => false + )); + $o = $sTag . " id='" . $params['vpid'] . "' name='" . $params['vpid'] . "' "; + if($params['class']) { + $o .= " class='" . $params['class'] . "' "; + } + if($params['style']) { + $o .= " style='" . $params['style'] . "' "; + } + if($params['attrib']) { + $o .= $params['attrib'] . " "; + } + $o .= "scrolling='" . ($params['sbar'] == 'No' ? "no" : ($params['sbar'] == 'Yes' ? "yes" : "auto")) . "' "; + $o .= "src='" . $value . "' frameborder='" . $params['borsize'] . "' "; + $o .= "onload=\"window.setTimeout('ResizeViewPort(\\'" . $params['vpid'] . "\\'," . $autoMode . ")',100);\" width='" . $w . "' height='" . $h . "' "; + $o .= ">"; + $o .= $eTag; + break; - case "datagrid": - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $value); + case "datagrid": + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $value); - $grd->noRecordMsg = $params['egmsg']; + $grd->noRecordMsg = $params['egmsg']; - $grd->columnHeaderClass = $params['chdrc']; - $grd->cssClass = $params['tblc']; - $grd->itemClass = $params['itmc']; - $grd->altItemClass = $params['aitmc']; + $grd->columnHeaderClass = $params['chdrc']; + $grd->cssClass = $params['tblc']; + $grd->itemClass = $params['itmc']; + $grd->altItemClass = $params['aitmc']; - $grd->columnHeaderStyle = $params['chdrs']; - $grd->cssStyle = $params['tbls']; - $grd->itemStyle = $params['itms']; - $grd->altItemStyle = $params['aitms']; + $grd->columnHeaderStyle = $params['chdrs']; + $grd->cssStyle = $params['tbls']; + $grd->itemStyle = $params['itms']; + $grd->altItemStyle = $params['aitms']; - $grd->columns = $params['cols']; - $grd->fields = $params['flds']; - $grd->colWidths = $params['cwidth']; - $grd->colAligns = $params['calign']; - $grd->colColors = $params['ccolor']; - $grd->colTypes = $params['ctype']; + $grd->columns = $params['cols']; + $grd->fields = $params['flds']; + $grd->colWidths = $params['cwidth']; + $grd->colAligns = $params['calign']; + $grd->colColors = $params['ccolor']; + $grd->colTypes = $params['ctype']; - $grd->cellPadding = $params['cpad']; - $grd->cellSpacing = $params['cspace']; - $grd->header = $params['head']; - $grd->footer = $params['foot']; - $grd->pageSize = $params['psize']; - $grd->pagerLocation = $params['ploc']; - $grd->pagerClass = $params['pclass']; - $grd->pagerStyle = $params['pstyle']; - $o = $grd->render(); - break; + $grd->cellPadding = $params['cpad']; + $grd->cellSpacing = $params['cspace']; + $grd->header = $params['head']; + $grd->footer = $params['foot']; + $grd->pageSize = $params['psize']; + $grd->pagerLocation = $params['ploc']; + $grd->pagerClass = $params['pclass']; + $grd->pagerStyle = $params['pstyle']; + $o = $grd->render(); + break; - case 'htmlentities': - $value = parseInput($value); - if ($tvtype == 'checkbox' || $tvtype == 'listbox-multiple') { - // remove delimiter from checkbox and listbox-multiple TVs - $value = str_replace('||', '', $value); - } - $o = htmlentities($value, ENT_NOQUOTES, $modx->config['modx_charset']); - break; + case 'htmlentities': + $value = parseInput($value); + if($tvtype == 'checkbox' || $tvtype == 'listbox-multiple') { + // remove delimiter from checkbox and listbox-multiple TVs + $value = str_replace('||', '', $value); + } + $o = htmlentities($value, ENT_NOQUOTES, $modx->config['modx_charset']); + break; - case 'custom_widget': - $widget_output = ''; - $o = ''; - /* If we are loading a file */ - if (substr($params['output'], 0, 5) == "@FILE") { - $file_name = MODX_BASE_PATH . trim(substr($params['output'], 6)); - if (!file_exists($file_name)) { - $widget_output = $file_name . ' does not exist'; - } else { - $widget_output = file_get_contents($file_name); - } - } elseif (substr($params['output'], 0, 8) == '@INCLUDE') { - $file_name = MODX_BASE_PATH . trim(substr($params['output'], 9)); - if (!file_exists($file_name)) { - $widget_output = $file_name . ' does not exist'; - } else { - /* The included file needs to set $widget_output. Can be string, array, object */ - include $file_name; - } - } elseif (substr($params['output'], 0, 6) == '@CHUNK' && $value !== '') { - $chunk_name = trim(substr($params['output'], 7)); - $widget_output = $modx->getChunk($chunk_name); - } elseif (substr($params['output'], 0, 5) == '@EVAL' && $value !== '') { - $eval_str = trim(substr($params['output'], 6)); - $widget_output = eval($eval_str); - } elseif ($value !== '') { - $widget_output = $params['output']; - } else { - $widget_output = ''; - } - if (is_string($widget_output)) { - $_ = $modx->config['enable_filter']; - $modx->config['enable_filter'] = 1; - $widget_output = $modx->parseText($widget_output, array('value' => $value)); - $modx->config['enable_filter'] = $_; - $o = $modx->parseDocumentSource($widget_output); - } else { - $o = $widget_output; - } - break; + case 'custom_widget': + $widget_output = ''; + $o = ''; + /* If we are loading a file */ + if(substr($params['output'], 0, 5) == "@FILE") { + $file_name = MODX_BASE_PATH . trim(substr($params['output'], 6)); + if(!file_exists($file_name)) { + $widget_output = $file_name . ' does not exist'; + } else { + $widget_output = file_get_contents($file_name); + } + } elseif(substr($params['output'], 0, 8) == '@INCLUDE') { + $file_name = MODX_BASE_PATH . trim(substr($params['output'], 9)); + if(!file_exists($file_name)) { + $widget_output = $file_name . ' does not exist'; + } else { + /* The included file needs to set $widget_output. Can be string, array, object */ + include $file_name; + } + } elseif(substr($params['output'], 0, 6) == '@CHUNK' && $value !== '') { + $chunk_name = trim(substr($params['output'], 7)); + $widget_output = $modx->getChunk($chunk_name); + } elseif(substr($params['output'], 0, 5) == '@EVAL' && $value !== '') { + $eval_str = trim(substr($params['output'], 6)); + $widget_output = eval($eval_str); + } elseif($value !== '') { + $widget_output = $params['output']; + } else { + $widget_output = ''; + } + if(is_string($widget_output)) { + $_ = $modx->config['enable_filter']; + $modx->config['enable_filter'] = 1; + $widget_output = $modx->parseText($widget_output, array('value' => $value)); + $modx->config['enable_filter'] = $_; + $o = $modx->parseDocumentSource($widget_output); + } else { + $o = $widget_output; + } + break; - default: - $value = parseInput($value); - if ($tvtype == 'checkbox' || $tvtype == 'listbox-multiple') { - // add separator - $value = explode('||', $value); - $value = implode($sep, $value); - } - $o = $value; - break; - } - return $o; + default: + $value = parseInput($value); + if($tvtype == 'checkbox' || $tvtype == 'listbox-multiple') { + // add separator + $value = explode('||', $value); + $value = implode($sep, $value); + } + $o = $value; + break; + } + return $o; } /** * @param string $s * @return string */ -function decodeParamValue($s) -{ - $s = str_replace("%3D", '=', $s); // = - return str_replace("%26", '&', $s); // & +function decodeParamValue($s) { + $s = str_replace("%3D", '=', $s); // = + return str_replace("%26", '&', $s); // & } /** @@ -362,47 +355,43 @@ function decodeParamValue($s) * @param bool $columns * @return array|string */ -function parseInput($src, $delim = "||", $type = "string", $columns = true) -{ // type can be: string, array +function parseInput($src, $delim = "||", $type = "string", $columns = true) { // type can be: string, array $modx = evolutionCMS(); - if ($modx->db->isResult($src)) { - // must be a recordset - $rows = array(); - while ($cols = $modx->db->getRow($src, 'num')) { - $rows[] = ($columns) ? $cols : implode(" ", $cols); - } - return ($type == "array") ? $rows : implode($delim, $rows); - } else { - // must be a text - if ($type == "array") { - return explode($delim, $src); - } else { - return $src; - } - } + if($modx->db->isResult($src)) { + // must be a recordset + $rows = array(); + while($cols = $modx->db->getRow($src, 'num')) $rows[] = ($columns) ? $cols : implode(" ", $cols); + return ($type == "array") ? $rows : implode($delim, $rows); + } else { + // must be a text + if($type == "array") { + return explode($delim, $src); + } else { + return $src; + } + } } /** * @param string $value * @return bool|false|int */ -function getUnixtimeFromDateString($value) -{ - $timestamp = false; - // Check for MySQL or legacy style date - $date_match_1 = '/^([0-9]{2})-([0-9]{2})-([0-9]{4})\ ([0-9]{2}):([0-9]{2}):([0-9]{2})$/'; - $date_match_2 = '/^([0-9]{4})-([0-9]{2})-([0-9]{2})\ ([0-9]{2}):([0-9]{2}):([0-9]{2})$/'; - $matches = array(); - if (strpos($value, '-') !== false) { - if (preg_match($date_match_1, $value, $matches)) { - $timestamp = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[1], $matches[3]); - } elseif (preg_match($date_match_2, $value, $matches)) { - $timestamp = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]); - } - } - // If those didn't work, use strtotime to figure out the date - if ($timestamp === false || $timestamp === -1) { - $timestamp = strtotime($value); - } - return $timestamp; +function getUnixtimeFromDateString($value) { + $timestamp = false; + // Check for MySQL or legacy style date + $date_match_1 = '/^([0-9]{2})-([0-9]{2})-([0-9]{4})\ ([0-9]{2}):([0-9]{2}):([0-9]{2})$/'; + $date_match_2 = '/^([0-9]{4})-([0-9]{2})-([0-9]{2})\ ([0-9]{2}):([0-9]{2}):([0-9]{2})$/'; + $matches = array(); + if(strpos($value, '-') !== false) { + if(preg_match($date_match_1, $value, $matches)) { + $timestamp = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[1], $matches[3]); + } elseif(preg_match($date_match_2, $value, $matches)) { + $timestamp = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]); + } + } + // If those didn't work, use strtotime to figure out the date + if($timestamp === false || $timestamp === -1) { + $timestamp = strtotime($value); + } + return $timestamp; } diff --git a/manager/includes/tmplvars.inc.php b/manager/includes/tmplvars.inc.php index 725d66def2..98dad01b12 100755 --- a/manager/includes/tmplvars.inc.php +++ b/manager/includes/tmplvars.inc.php @@ -12,161 +12,160 @@ * @param array $tvsArray * @return string */ -function renderFormElement($field_type, $field_id, $default_text = '', $field_elements = '', $field_value = '', $field_style = '', $row = array(), $tvsArray = array()) -{ +function renderFormElement($field_type, $field_id, $default_text = '', $field_elements = '', $field_value = '', $field_style = '', $row = array(), $tvsArray = array()) { $modx = evolutionCMS(); - global $_style; - global $_lang; - global $content; - global $which_browser; + global $_style; + global $_lang; + global $content; + global $which_browser; - if (substr($default_text, 0, 6) === '@@EVAL' && $field_value === $default_text) { - $eval_str = trim(substr($default_text, 7)); - $default_text = eval($eval_str); - $field_value = $default_text; - } + if(substr($default_text, 0, 6) === '@@EVAL' && $field_value === $default_text) { + $eval_str = trim(substr($default_text, 7)); + $default_text = eval($eval_str); + $field_value = $default_text; + } - $field_html = ''; - $cimode = strpos($field_type, ':'); - if ($cimode === false) { - switch ($field_type) { + $field_html = ''; + $cimode = strpos($field_type, ':'); + if($cimode === false) { + switch($field_type) { - case "text": // handler for regular text boxes - case "rawtext": // non-htmlentity converted text boxes - $field_html .= ''; - break; - case "email": // handles email input fields - $field_html .= ''; - break; - case "number": // handles the input of numbers - $field_html .= ''; - break; - case "textareamini": // handler for textarea mini boxes - $field_html .= ''; - break; - case "textarea": // handler for textarea boxes - case "rawtextarea": // non-htmlentity convertex textarea boxes - case "htmlarea": // handler for textarea boxes (deprecated) - case "richtext": // handler for textarea boxes - $field_html .= ''; - break; - case "date": - $field_id = str_replace(array( - '-', - '.' - ), '_', urldecode($field_id)); - if ($field_value == '') { - $field_value = 0; - } - $field_html .= ''; - $field_html .= ' '; + case "text": // handler for regular text boxes + case "rawtext"; // non-htmlentity converted text boxes + $field_html .= ''; + break; + case "email": // handles email input fields + $field_html .= ''; + break; + case "number": // handles the input of numbers + $field_html .= ''; + break; + case "textareamini": // handler for textarea mini boxes + $field_html .= ''; + break; + case "textarea": // handler for textarea boxes + case "rawtextarea": // non-htmlentity convertex textarea boxes + case "htmlarea": // handler for textarea boxes (deprecated) + case "richtext": // handler for textarea boxes + $field_html .= ''; + break; + case "date": + $field_id = str_replace(array( + '-', + '.' + ), '_', urldecode($field_id)); + if($field_value == '') { + $field_value = 0; + } + $field_html .= ''; + $field_html .= ' '; - break; - case "dropdown": // handler for select boxes - $field_html .= '"; - break; - case "listbox": // handler for select boxes - $field_html .= '"; - break; - case "listbox-multiple": // handler for select boxes where you can choose multiple items - $field_value = explode("||", $field_value); - $field_html .= '"; - break; - case "url": // handles url input fields - $urls = array( - '' => '--', - 'http://' => 'http://', - 'https://' => 'https://', - 'ftp://' => 'ftp://', - 'mailto:' => 'mailto:' - ); - $field_html = '
    The MODX parser recieved the following debug/ stop message:
    « $msg »

          SQL: $query
    +if(!empty($query)) { + $parsedMessageString .= "

          SQL: $query
          [Copy SQL to ClipBoard]
     
    PHP error debug
      Error: $text 
     
    PHP error debug
      Error type/ Nr.: " . $errortype[$nr] . " - $nr 
      Error: $text 
      File: $file 
      Error type/ Nr.: ".$errortype[$nr]." - $nr 
      Line: $line 
      Line $line source: $source 
      File: $file 
      Line: $line 
      Line $line source: $source 
     
    Parser timing
    '; - $field_html .= '
    '; - break; - case 'checkbox': // handles check boxes - $values = !is_array($field_value) ? explode('||', $field_value) : $field_value; - $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); - $tpl = '
    '; - static $i = 0; - $_ = array(); - foreach ($index_list as $c => $item) { - if (is_array($item)) { - $name = trim($item[0]); - $value = isset($item[1]) ? $item[1] : $name; - } else { - $item = trim($item); - list($name, $value) = (strpos($item, '==') !== false) ? explode('==', $item, 2) : array( - $item, - $item - ); - } - $checked = in_array($value, $values) ? ' checked="checked"' : ''; - $param = array( - $modx->htmlspecialchars($value), - $i, - $field_id, - $checked, - $name - ); - $_[] = vsprintf($tpl, $param); - $i++; - } - $field_html = implode("\n", $_); - break; - case "option": // handles radio buttons - $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); - static $i = 0; - while (list($item, $itemvalue) = each($index_list)) { - list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue); - if (strlen($itemvalue) == 0) { - $itemvalue = $item; - } - $field_html .= '
    '; - $i++; - } - break; - case "image": // handles image fields using htmlarea image manager - global $_lang; - global $ResourceManagerLoaded; - global $content, $use_editor, $which_editor; - if (!$ResourceManagerLoaded && !(($content['richtext'] == 1 || $modx->manager->action == 4) && $use_editor == 1 && $which_editor == 3)) { - $field_html .= " + break; + case "dropdown": // handler for select boxes + $field_html .= '"; + break; + case "listbox": // handler for select boxes + $field_html .= '"; + break; + case "listbox-multiple": // handler for select boxes where you can choose multiple items + $field_value = explode("||", $field_value); + $field_html .= '"; + break; + case "url": // handles url input fields + $urls = array( + '' => '--', + 'http://' => 'http://', + 'https://' => 'https://', + 'ftp://' => 'ftp://', + 'mailto:' => 'mailto:' + ); + $field_html = '
    '; + $field_html .= '
    '; + break; + case 'checkbox': // handles check boxes + $values = !is_array($field_value) ? explode('||', $field_value) : $field_value; + $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); + $tpl = '
    '; + static $i = 0; + $_ = array(); + foreach($index_list as $c => $item) { + if(is_array($item)) { + $name = trim($item[0]); + $value = isset($item[1]) ? $item[1] : $name; + } else { + $item = trim($item); + list($name, $value) = (strpos($item, '==') !== false) ? explode('==', $item, 2) : array( + $item, + $item + ); + } + $checked = in_array($value, $values) ? ' checked="checked"' : ''; + $param = array( + $modx->htmlspecialchars($value), + $i, + $field_id, + $checked, + $name + ); + $_[] = vsprintf($tpl, $param); + $i++; + } + $field_html = implode("\n", $_); + break; + case "option": // handles radio buttons + $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); + static $i = 0; + while(list($item, $itemvalue) = each($index_list)) { + list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue); + if(strlen($itemvalue) == 0) { + $itemvalue = $item; + } + $field_html .= '
    '; + $i++; + } + break; + case "image": // handles image fields using htmlarea image manager + global $_lang; + global $ResourceManagerLoaded; + global $content, $use_editor, $which_editor; + if(!$ResourceManagerLoaded && !(($content['richtext'] == 1 || $modx->manager->action == 4) && $use_editor == 1 && $which_editor == 3)) { + $field_html .= " "; - $ResourceManagerLoaded = true; - } - $field_html .= ''; - break; - case "file": // handles the input of file uploads - /* Modified by Timon for use with resource browser */ - global $_lang; - global $ResourceManagerLoaded; - global $content, $use_editor, $which_editor; - if (!$ResourceManagerLoaded && !(($content['richtext'] == 1 || $modx->manager->action == 4) && $use_editor == 1 && $which_editor == 3)) { - /* I didn't understand the meaning of the condition above, so I left it untouched ;-) */ - $field_html .= " + $ResourceManagerLoaded = true; + } + $field_html .= ''; + break; + case "file": // handles the input of file uploads + /* Modified by Timon for use with resource browser */ + global $_lang; + global $ResourceManagerLoaded; + global $content, $use_editor, $which_editor; + if(!$ResourceManagerLoaded && !(($content['richtext'] == 1 || $modx->manager->action == 4) && $use_editor == 1 && $which_editor == 3)) { + /* I didn't understand the meaning of the condition above, so I left it untouched ;-) */ + $field_html .= " "; - $ResourceManagerLoaded = true; - } - $field_html .= ''; + $ResourceManagerLoaded = true; + } + $field_html .= ''; - break; + break; - case 'custom_tv': - $custom_output = ''; - /* If we are loading a file */ - if (substr($field_elements, 0, 5) == "@FILE") { - $file_name = MODX_BASE_PATH . trim(substr($field_elements, 6)); - if (!file_exists($file_name)) { - $custom_output = $file_name . ' does not exist'; - } else { - $custom_output = file_get_contents($file_name); - } - } elseif (substr($field_elements, 0, 8) == '@INCLUDE') { - $file_name = MODX_BASE_PATH . trim(substr($field_elements, 9)); - if (!file_exists($file_name)) { - $custom_output = $file_name . ' does not exist'; - } else { - ob_start(); - include $file_name; - $custom_output = ob_get_contents(); - ob_end_clean(); - } - } elseif (substr($field_elements, 0, 6) == "@CHUNK") { - $chunk_name = trim(substr($field_elements, 7)); - $chunk_body = $modx->getChunk($chunk_name); - if ($chunk_body == false) { - $custom_output = $_lang['chunk_no_exist'] . '(' . $_lang['htmlsnippet_name'] . ':' . $chunk_name . ')'; - } else { - $custom_output = $chunk_body; - } - } elseif (substr($field_elements, 0, 5) == "@EVAL") { - $eval_str = trim(substr($field_elements, 6)); - $custom_output = eval($eval_str); - } else { - $custom_output = $field_elements; - } - $replacements = array( - '[+field_type+]' => $field_type, - '[+field_id+]' => $field_id, - '[+default_text+]' => $default_text, - '[+field_value+]' => $modx->htmlspecialchars($field_value), - '[+field_style+]' => $field_style, - ); - $custom_output = str_replace(array_keys($replacements), $replacements, $custom_output); - $modx->documentObject = $content; - $modx->documentIdentifier = $content['id']; - $custom_output = $modx->parseDocumentSource($custom_output); - $field_html .= $custom_output; - break; + case 'custom_tv': + $custom_output = ''; + /* If we are loading a file */ + if(substr($field_elements, 0, 5) == "@FILE") { + $file_name = MODX_BASE_PATH . trim(substr($field_elements, 6)); + if(!file_exists($file_name)) { + $custom_output = $file_name . ' does not exist'; + } else { + $custom_output = file_get_contents($file_name); + } + } elseif(substr($field_elements, 0, 8) == '@INCLUDE') { + $file_name = MODX_BASE_PATH . trim(substr($field_elements, 9)); + if(!file_exists($file_name)) { + $custom_output = $file_name . ' does not exist'; + } else { + ob_start(); + include $file_name; + $custom_output = ob_get_contents(); + ob_end_clean(); + } + } elseif(substr($field_elements, 0, 6) == "@CHUNK") { + $chunk_name = trim(substr($field_elements, 7)); + $chunk_body = $modx->getChunk($chunk_name); + if($chunk_body == false) { + $custom_output = $_lang['chunk_no_exist'] . '(' . $_lang['htmlsnippet_name'] . ':' . $chunk_name . ')'; + } else { + $custom_output = $chunk_body; + } + } elseif(substr($field_elements, 0, 5) == "@EVAL") { + $eval_str = trim(substr($field_elements, 6)); + $custom_output = eval($eval_str); + } else { + $custom_output = $field_elements; + } + $replacements = array( + '[+field_type+]' => $field_type, + '[+field_id+]' => $field_id, + '[+default_text+]' => $default_text, + '[+field_value+]' => $modx->htmlspecialchars($field_value), + '[+field_style+]' => $field_style, + ); + $custom_output = str_replace(array_keys($replacements), $replacements, $custom_output); + $modx->documentObject = $content; + $modx->documentIdentifier = $content['id']; + $custom_output = $modx->parseDocumentSource($custom_output); + $field_html .= $custom_output; + break; - default: // the default handler -- for errors, mostly - $field_html .= ''; + default: // the default handler -- for errors, mostly + $field_html .= ''; - } // end switch statement - } else { - $custom = explode(":", $field_type); - $custom_output = ''; - $file_name = MODX_BASE_PATH . 'assets/tvs/' . $custom['1'] . '/' . $custom['1'] . '.customtv.php'; - if (!file_exists($file_name)) { - $custom_output = $file_name . ' does not exist'; - } else { - ob_start(); - include $file_name; - $custom_output = ob_get_contents(); - ob_end_clean(); - } - $replacements = array( - '[+field_type+]' => $field_type, - '[+field_id+]' => $field_id, - '[+default_text+]' => $default_text, - '[+field_value+]' => $modx->htmlspecialchars($field_value), - '[+field_style+]' => $field_style, - ); - $custom_output = str_replace(array_keys($replacements), $replacements, $custom_output); - $modx->documentObject = $content; - $custom_output = $modx->parseDocumentSource($custom_output); - $field_html .= $custom_output; - } + } // end switch statement + } else { + $custom = explode(":", $field_type); + $custom_output = ''; + $file_name = MODX_BASE_PATH . 'assets/tvs/' . $custom['1'] . '/' . $custom['1'] . '.customtv.php'; + if(!file_exists($file_name)) { + $custom_output = $file_name . ' does not exist'; + } else { + ob_start(); + include $file_name; + $custom_output = ob_get_contents(); + ob_end_clean(); + } + $replacements = array( + '[+field_type+]' => $field_type, + '[+field_id+]' => $field_id, + '[+default_text+]' => $default_text, + '[+field_value+]' => $modx->htmlspecialchars($field_value), + '[+field_style+]' => $field_style, + ); + $custom_output = str_replace(array_keys($replacements), $replacements, $custom_output); + $modx->documentObject = $content; + $custom_output = $modx->parseDocumentSource($custom_output); + $field_html .= $custom_output; + } - return $field_html; + return $field_html; } // end renderFormElement function /** * @param string|array|mysqli_result $v * @return array */ -function ParseIntputOptions($v) -{ +function ParseIntputOptions($v) { $modx = evolutionCMS(); - $a = array(); - if (is_array($v)) { - return $v; - } elseif ($modx->db->isResult($v)) { - while ($cols = $modx->db->getRow($v, 'num')) { - $a[] = $cols; - } - } else { - $a = explode("||", $v); - } - return $a; + $a = array(); + if(is_array($v)) { + return $v; + } else if($modx->db->isResult($v)) { + while($cols = $modx->db->getRow($v, 'num')) $a[] = $cols; + } else { + $a = explode("||", $v); + } + return $a; } diff --git a/manager/includes/user_settings.inc.php b/manager/includes/user_settings.inc.php index 78848257fc..81ae5c37c6 100755 --- a/manager/includes/user_settings.inc.php +++ b/manager/includes/user_settings.inc.php @@ -4,7 +4,7 @@ } // START HACK -if (isset($modx)) { +if (isset ($modx)) { $user_id = $modx->getLoginUserID(); } else { $user_id = $_SESSION['mgrInternalKey']; diff --git a/manager/includes/veriword.php b/manager/includes/veriword.php index 4c438bada0..c33556b14f 100755 --- a/manager/includes/veriword.php +++ b/manager/includes/veriword.php @@ -5,7 +5,7 @@ $modx->getSettings(); $modx->invokeEvent('OnWebPageInit'); -$vword = new VeriWord(148, 60); +$vword = new VeriWord(148,60); $vword->output_image(); $vword->destroy_image(); @@ -41,8 +41,7 @@ ## see sample.php for test and usage ## sample URL: http://www.program-ruti.org/veriword/ #### -class VeriWord -{ +class VeriWord { /* path to font directory*/ public $dir_font = "ttf/"; @@ -53,8 +52,7 @@ class VeriWord public $im_height = 0; public $im; - public function __construct($w=200, $h=80) - { + public function __construct($w=200, $h=80) { /* create session to set word for verification */ $this->set_veriword(); $this->dir_font = dirname(__FILE__) . '/' . $this->dir_font; @@ -62,24 +60,21 @@ public function __construct($w=200, $h=80) $this->im_height = $h; } - public function set_veriword() - { + public function set_veriword() { /* create session variable for verification, you may change the session variable name */ $this->word = $this->pick_word(); $_SESSION['veriword'] = $this->word; } - public function output_image() - { + public function output_image() { /* output the image as jpeg */ $this->draw_image(); header("Content-type: image/jpeg"); imagejpeg($this->im); } - public function pick_word() - { + public function pick_word() { $modx = evolutionCMS(); // set default words $words="MODX,Access,Better,BitCode,Chunk,Cache,Desc,Design,Excell,Enjoy,URLs,TechView,Gerald,Griff,Humphrey,Holiday,Intel,Integration,Joystick,Join(),Oscope,Genetic,Light,Likeness,Marit,Maaike,Niche,Netherlands,Ordinance,Oscillo,Parser,Phusion,Query,Question,Regalia,Righteous,Snippet,Sentinel,Template,Thespian,Unity,Enterprise,Verily,Veri,Website,WideWeb,Yap,Yellow,Zebra,Zygote"; @@ -87,27 +82,26 @@ public function pick_word() $arr_words = array_filter(array_map('trim', explode(',', $words))); /* pick one randomly for text verification */ - return (string) $arr_words[array_rand($arr_words)] . rand(10, 999); + return (string) $arr_words[array_rand($arr_words)].rand(10,999); } - public function draw_text() - { + public function draw_text() { $dir = dir($this->dir_font); $fontstmp = array(); while (false !== ($file = $dir->read())) { - if (substr($file, -4) == '.ttf') { - $fontstmp[] = $this->dir_font . $file; + if(substr($file, -4) == '.ttf') { + $fontstmp[] = $this->dir_font.$file; } } $dir->close(); $text_font = (string) $fontstmp[array_rand($fontstmp)]; /* angle for text inclination */ - $text_angle = rand(-9, 9); + $text_angle = rand(-9,9); /* initial text size */ $text_size = 30; /* calculate text width and height */ - $box = imagettfbbox($text_size, $text_angle, $text_font, $this->word); + $box = imagettfbbox ( $text_size, $text_angle, $text_font, $this->word); $text_width = $box[2]-$box[0]; //text width $text_height= $box[5]-$box[3]; //text height @@ -115,7 +109,7 @@ public function draw_text() $text_size = round((20 * $this->im_width)/$text_width); /* recalculate text width and height */ - $box = imagettfbbox($text_size, $text_angle, $text_font, $this->word); + $box = imagettfbbox ( $text_size, $text_angle, $text_font, $this->word); $text_width = $box[2]-$box[0]; //text width $text_height= $box[5]-$box[3]; //text height @@ -124,14 +118,14 @@ public function draw_text() $text_y = ($this->im_height - $text_height)/2; /* create canvas for text drawing */ - $im_text = imagecreate($this->im_width, $this->im_height); - $bg_color = imagecolorallocate($im_text, 255, 255, 255); + $im_text = imagecreate ($this->im_width, $this->im_height); + $bg_color = imagecolorallocate ($im_text, 255, 255, 255); /* pick color for text */ - $text_color = imagecolorallocate($im_text, 0, 51, 153); + $text_color = imagecolorallocate ($im_text, 0, 51, 153); /* draw text into canvas */ - imagettftext($im_text, + imagettftext ( $im_text, $text_size, $text_angle, $text_x, @@ -146,20 +140,19 @@ public function draw_text() } - public function draw_image() - { + public function draw_image() { /* pick one background image randomly from image directory */ - $img_file = $this->dir_noise . "noise" . rand(1, 4) . ".jpg"; + $img_file = $this->dir_noise."noise".rand(1,4).".jpg"; /* create "noise" background image from your image stock*/ - $noise_img = @imagecreatefromjpeg($img_file); + $noise_img = @imagecreatefromjpeg ($img_file); $noise_width = imagesx($noise_img); $noise_height = imagesy($noise_img); /* resize the background image to fit the size of image output */ - $this->im = imagecreatetruecolor($this->im_width, $this->im_height); - imagecopyresampled($this->im, + $this->im = imagecreatetruecolor($this->im_width,$this->im_height); + imagecopyresampled ($this->im, $noise_img, 0, 0, 0, 0, $this->im_width, @@ -168,18 +161,20 @@ public function draw_image() $noise_height); /* put text image into background image */ - imagecopymerge($this->im, + imagecopymerge ( $this->im, $this->draw_text(), 0, 0, 0, 0, $this->im_width, $this->im_height, - 70); + 70 ); return $this->im; } - public function destroy_image() - { + public function destroy_image() { + imagedestroy($this->im); + } + } diff --git a/manager/index.php b/manager/index.php index 921bbf7f22..2d134aefe9 100755 --- a/manager/index.php +++ b/manager/index.php @@ -1,42 +1,42 @@ Unable to load configuration settings"; - echo "Please run the EVO install utility"; - exit; + echo "

    Unable to load configuration settings

    "; + echo "Please run the EVO install utility"; + exit; } // include the database configuration file @@ -149,11 +139,11 @@ // initiate the content manager class if (isset($coreClass) && class_exists($coreClass)) { - $modx = new $coreClass; + $modx = new $coreClass; } if (!isset($modx) || !($modx instanceof DocumentParser)) { - include_once(MODX_MANAGER_PATH . 'includes/document.parser.class.inc.php'); - $modx = evolutionCMS(); + include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php'); + $modx = evolutionCMS(); } $modx->loadExtension("ManagerAPI"); @@ -175,31 +165,30 @@ extract($modx->config, EXTR_OVERWRITE); // now include_once different language file as english -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. +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. } // $length_eng_lang = count($_lang); // Not used for now, required for difference-check with other languages than english (i.e. inside installer) -if ($manager_language!="english" && file_exists(MODX_MANAGER_PATH . "includes/lang/" . $manager_language . ".inc.php")) { - include_once "lang/" . $manager_language . ".inc.php"; +if($manager_language!="english" && file_exists(MODX_MANAGER_PATH."includes/lang/".$manager_language.".inc.php")) { + include_once "lang/".$manager_language.".inc.php"; } // allow custom language overrides not altered by future EVO-updates -if (file_exists(MODX_MANAGER_PATH . "includes/lang/override/" . $manager_language . ".inc.php")) { - include_once "lang/override/" . $manager_language . ".inc.php"; +if(file_exists(MODX_MANAGER_PATH."includes/lang/override/".$manager_language.".inc.php")) { + include_once "lang/override/".$manager_language.".inc.php"; } $s = array('[+MGR_DIR+]'); $r = array(MGR_DIR); -foreach ($_lang as $k=>$v) { - if (strpos($v, '[+')!==false) { - $_lang[$k] = str_replace($s, $r, $v); - } +foreach($_lang as $k=>$v) +{ + if(strpos($v,'[+')!==false) $_lang[$k] = str_replace($s, $r, $v); } // send the charset header -header('Content-Type: text/html; charset=' . $modx_manager_charset); +header('Content-Type: text/html; charset='.$modx_manager_charset); /* * include_once "version.inc.php"; //include version info. Use $modx->getVersionData() @@ -209,53 +198,46 @@ include_once "accesscontrol.inc.php"; // double check the session -if (!isset($_SESSION['mgrValidated'])) { - echo "Not Logged In!"; - exit; +if(!isset($_SESSION['mgrValidated'])){ + echo "Not Logged In!"; + exit; } // include_once the style variables file -if (isset($manager_theme) && !isset($_style)) { - $_style = array(); - include_once "media/style/" . $manager_theme . "/style.php"; +if(isset($manager_theme) && !isset($_style)) { + $_style = array(); + include_once "media/style/".$manager_theme."/style.php"; } // check if user is allowed to access manager interface -if (isset($allow_manager_access) && $allow_manager_access==0) { - include_once "manager.lockout.inc.php"; +if(isset($allow_manager_access) && $allow_manager_access==0) { + include_once "manager.lockout.inc.php"; } // Initialize System Alert Message Queque -if (!isset($_SESSION['SystemAlertMsgQueque'])) { - $_SESSION['SystemAlertMsgQueque'] = array(); -} +if (!isset($_SESSION['SystemAlertMsgQueque'])) $_SESSION['SystemAlertMsgQueque'] = array(); $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque']; // first we check to see if this is a frameset request -if (!isset($_POST['a']) && !isset($_GET['a']) && !isset($_POST['updateMsgCount'])) { - // this looks to be a top-level frameset request, so let's serve up a frameset - if (is_file(MODX_MANAGER_PATH . "media/style/" . $manager_theme . "/frames/1.php")) { - include_once "media/style/" . $manager_theme . "/frames/1.php"; - } else { - include_once "frames/1.php"; - } - exit; +if(!isset($_POST['a']) && !isset($_GET['a']) && !isset($_POST['updateMsgCount'])) { + // this looks to be a top-level frameset request, so let's serve up a frameset + if(is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/frames/1.php")) { + include_once "media/style/".$manager_theme."/frames/1.php"; + }else{ + include_once "frames/1.php"; + } + exit; } // OK, let's retrieve the action directive from the request $option = array('min_range'=>1,'max_range'=>2000); -if (isset($_GET['a']) && isset($_POST['a'])) { - $modx->webAlertAndQuit($_lang['error_double_action']); -} elseif (isset($_GET['a'])) { - $action = filter_input(INPUT_GET, 'a', FILTER_VALIDATE_INT, $option); -} elseif (isset($_POST['a'])) { - $action = filter_input(INPUT_POST, 'a', FILTER_VALIDATE_INT, $option); -} else { - $action = null; -} +if(isset($_GET['a']) && isset($_POST['a'])) $modx->webAlertAndQuit($_lang['error_double_action']); +elseif(isset($_GET['a'])) $action = filter_input(INPUT_GET, 'a',FILTER_VALIDATE_INT,$option); +elseif(isset($_POST['a'])) $action = filter_input(INPUT_POST,'a',FILTER_VALIDATE_INT,$option); +else $action = null; if (isset($_POST['updateMsgCount']) && $modx->hasPermission('messages')) { - include_once 'messageCount.inc.php'; + include_once 'messageCount.inc.php'; } // save page to manager object @@ -263,34 +245,33 @@ // attempt to foil some simple types of CSRF attacks if (isset($modx->config['validate_referer']) && (int)$modx->config['validate_referer']) { - if (isset($_SERVER['HTTP_REFERER'])) { - $referer = $_SERVER['HTTP_REFERER']; - - if (!empty($referer)) { - if (!preg_match('/^' . preg_quote(MODX_SITE_URL, '/') . '/i', $referer)) { - $modx->webAlertAndQuit("A possible CSRF attempt was detected from referer: {$referer}.", "index.php"); - } - } else { - $modx->webAlertAndQuit("A possible CSRF attempt was detected. No referer was provided by the client.", "index.php"); - } - } else { - $modx->webAlertAndQuit("A possible CSRF attempt was detected. No referer was provided by the server.", "index.php"); - } + if (isset($_SERVER['HTTP_REFERER'])) { + $referer = $_SERVER['HTTP_REFERER']; + + if (!empty($referer)) { + if (!preg_match('/^'.preg_quote(MODX_SITE_URL, '/').'/i', $referer)) { + $modx->webAlertAndQuit("A possible CSRF attempt was detected from referer: {$referer}.", "index.php"); + } + } else { + $modx->webAlertAndQuit("A possible CSRF attempt was detected. No referer was provided by the client.", "index.php"); + } + } else { + $modx->webAlertAndQuit("A possible CSRF attempt was detected. No referer was provided by the server.", "index.php"); + } } // invoke OnManagerPageInit event $modx->invokeEvent("OnManagerPageInit", array("action" => $action)); // return element filepath -function includeFileProcessor($filepath, $manager_theme) -{ - $element = ""; - if (is_file(MODX_MANAGER_PATH . "media/style/" . $manager_theme . "/" . $filepath)) { - $element = MODX_MANAGER_PATH . "media/style/" . $manager_theme . "/" . $filepath; - } else { - $element = $filepath; - } - return $element; +function includeFileProcessor ($filepath,$manager_theme) { + $element = ""; + if(is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath)) { + $element = MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath; + }else{ + $element = $filepath; + } + return $element; } // Now we decide what to do according to the action request. This is a BIG list :) @@ -298,714 +279,714 @@ function includeFileProcessor($filepath, $manager_theme) /********************************************************************/ /* frame management - show the requested frame */ /********************************************************************/ - case 1: - // get the requested frame - $frame = preg_replace('/[^a-z0-9]/i', '', $_REQUEST['f']); - if ($frame>9) { - $enable_debug=false; // this is to stop the debug thingy being attached to the framesets - } - include_once(includeFileProcessor("frames/" . $frame . ".php", $manager_theme)); - break; + case 1 : + // get the requested frame + $frame = preg_replace('/[^a-z0-9]/i','',$_REQUEST['f']); + if($frame>9) { + $enable_debug=false; // this is to stop the debug thingy being attached to the framesets + } + include_once(includeFileProcessor("frames/".$frame.".php",$manager_theme)); + break; /********************************************************************/ /* show the homepage */ /********************************************************************/ - case 2: - // get the home page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/welcome.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 2: + // get the home page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/welcome.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* document data */ /********************************************************************/ - case 3: - // get the page to show document's data - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/document_data.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 3: + // get the page to show document's data + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/document_data.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* content management */ /********************************************************************/ - case 85: - // get the mutate page for adding a folder - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_content.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 27: - // get the mutate page for changing content - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_content.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 4: - // get the mutate page for adding content - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_content.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 5: - // get the save processor - include_once(includeFileProcessor("processors/save_content.processor.php", $manager_theme)); - break; - case 6: - // get the delete processor - include_once(includeFileProcessor("processors/delete_content.processor.php", $manager_theme)); - break; - case 63: - // get the undelete processor - include_once(includeFileProcessor("processors/undelete_content.processor.php", $manager_theme)); - break; - case 51: - // get the move action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/move_document.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 52: - // get the move document processor - include_once(includeFileProcessor("processors/move_document.processor.php", $manager_theme)); - break; - case 61: - // get the processor for publishing content - include_once(includeFileProcessor("processors/publish_content.processor.php", $manager_theme)); - break; - case 62: - // get the processor for publishing content - include_once(includeFileProcessor("processors/unpublish_content.processor.php", $manager_theme)); - break; - case 56: - // get the sort menuindex action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_menuindex_sort.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 85: + // get the mutate page for adding a folder + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 27: + // get the mutate page for changing content + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 4: + // get the mutate page for adding content + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 5: + // get the save processor + include_once(includeFileProcessor("processors/save_content.processor.php",$manager_theme)); + break; + case 6: + // get the delete processor + include_once(includeFileProcessor("processors/delete_content.processor.php",$manager_theme)); + break; + case 63: + // get the undelete processor + include_once(includeFileProcessor("processors/undelete_content.processor.php",$manager_theme)); + break; + case 51: + // get the move action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/move_document.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 52: + // get the move document processor + include_once(includeFileProcessor("processors/move_document.processor.php",$manager_theme)); + break; + case 61: + // get the processor for publishing content + include_once(includeFileProcessor("processors/publish_content.processor.php",$manager_theme)); + break; + case 62: + // get the processor for publishing content + include_once(includeFileProcessor("processors/unpublish_content.processor.php",$manager_theme)); + break; + case 56: + // get the sort menuindex action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_menuindex_sort.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* show the wait page - gives the tree time to refresh (hopefully) */ /********************************************************************/ - case 7: - // get the wait page (so the tree can reload) - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/wait.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 7: + // get the wait page (so the tree can reload) + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/wait.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* let the user log out */ /********************************************************************/ - case 8: - // get the logout processor - include_once(includeFileProcessor("processors/logout.processor.php", $manager_theme)); - break; + case 8: + // get the logout processor + include_once(includeFileProcessor("processors/logout.processor.php",$manager_theme)); + break; /********************************************************************/ /* user management */ /********************************************************************/ - case 87: - // get the new web user page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 88: - // get the edit web user page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 89: - // get the save web user processor - include_once(includeFileProcessor("processors/save_web_user.processor.php", $manager_theme)); - break; - case 90: - // get the delete web user page - include_once(includeFileProcessor("processors/delete_web_user.processor.php", $manager_theme)); - break; - case 11: - // get the new user page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_user.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 12: - // get the edit user page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_user.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 32: - // get the save user processor - include_once(includeFileProcessor("processors/save_user.processor.php", $manager_theme)); - break; - case 28: - // get the change password page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_password.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 34: - // get the save new password page - include_once(includeFileProcessor("processors/save_password.processor.php", $manager_theme)); - break; - case 33: - // get the delete user page - include_once(includeFileProcessor("processors/delete_user.processor.php", $manager_theme)); - break; + case 87: + // get the new web user page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 88: + // get the edit web user page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 89: + // get the save web user processor + include_once(includeFileProcessor("processors/save_web_user.processor.php",$manager_theme)); + break; + case 90: + // get the delete web user page + include_once(includeFileProcessor("processors/delete_web_user.processor.php",$manager_theme)); + break; + case 11: + // get the new user page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_user.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 12: + // get the edit user page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_user.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 32: + // get the save user processor + include_once(includeFileProcessor("processors/save_user.processor.php",$manager_theme)); + break; + case 28: + // get the change password page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_password.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 34: + // get the save new password page + include_once(includeFileProcessor("processors/save_password.processor.php",$manager_theme)); + break; + case 33: + // get the delete user page + include_once(includeFileProcessor("processors/delete_user.processor.php",$manager_theme)); + break; /********************************************************************/ /* role management */ /********************************************************************/ - case 38: - // get the new role page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_role.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 35: - // get the edit role page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_role.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 36: - // get the save role page - include_once(includeFileProcessor("processors/save_role.processor.php", $manager_theme)); - break; - case 37: - // get the delete role page - include_once(includeFileProcessor("processors/delete_role.processor.php", $manager_theme)); - break; + case 38: + // get the new role page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_role.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 35: + // get the edit role page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_role.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 36: + // get the save role page + include_once(includeFileProcessor("processors/save_role.processor.php",$manager_theme)); + break; + case 37: + // get the delete role page + include_once(includeFileProcessor("processors/delete_role.processor.php",$manager_theme)); + break; /********************************************************************/ /* category management */ /********************************************************************/ - case 120: - // get the edit category page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_categories.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 121: - // for ajax-requests - include_once(includeFileProcessor("actions/mutate_categories.dynamic.php", $manager_theme)); - break; + case 120: + // get the edit category page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_categories.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 121: + // for ajax-requests + include_once(includeFileProcessor("actions/mutate_categories.dynamic.php",$manager_theme)); + break; /********************************************************************/ /* template management */ /********************************************************************/ - case 16: - // get the edit template action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_templates.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 19: - // get the new template action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_templates.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 20: - // get the save processor - include_once(includeFileProcessor("processors/save_template.processor.php", $manager_theme)); - break; - case 21: - // get the delete processor - include_once(includeFileProcessor("processors/delete_template.processor.php", $manager_theme)); - break; - case 96: - // get the duplicate template processor - include_once(includeFileProcessor("processors/duplicate_template.processor.php", $manager_theme)); - break; - case 117: - // change the tv rank for selected template - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_template_tv_rank.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 16: + // get the edit template action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_templates.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 19: + // get the new template action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_templates.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 20: + // get the save processor + include_once(includeFileProcessor("processors/save_template.processor.php",$manager_theme)); + break; + case 21: + // get the delete processor + include_once(includeFileProcessor("processors/delete_template.processor.php",$manager_theme)); + break; + case 96: + // get the duplicate template processor + include_once(includeFileProcessor("processors/duplicate_template.processor.php",$manager_theme)); + break; + case 117: + // change the tv rank for selected template + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_template_tv_rank.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* snippet management */ /********************************************************************/ - case 22: - // get the edit snippet action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 23: - // get the new snippet action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 24: - // get the save processor - include_once(includeFileProcessor("processors/save_snippet.processor.php", $manager_theme)); - break; - case 25: - // get the delete processor - include_once(includeFileProcessor("processors/delete_snippet.processor.php", $manager_theme)); - break; - case 98: - // get the duplicate processor - include_once(includeFileProcessor("processors/duplicate_snippet.processor.php", $manager_theme)); - break; + case 22: + // get the edit snippet action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 23: + // get the new snippet action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 24: + // get the save processor + include_once(includeFileProcessor("processors/save_snippet.processor.php",$manager_theme)); + break; + case 25: + // get the delete processor + include_once(includeFileProcessor("processors/delete_snippet.processor.php",$manager_theme)); + break; + case 98: + // get the duplicate processor + include_once(includeFileProcessor("processors/duplicate_snippet.processor.php",$manager_theme)); + break; /********************************************************************/ /* htmlsnippet management */ /********************************************************************/ - case 78: - // get the edit snippet action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 77: - // get the new snippet action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 79: - // get the save processor - include_once(includeFileProcessor("processors/save_htmlsnippet.processor.php", $manager_theme)); - break; - case 80: - // get the delete processor - include_once(includeFileProcessor("processors/delete_htmlsnippet.processor.php", $manager_theme)); - break; - case 97: - // get the duplicate processor - include_once(includeFileProcessor("processors/duplicate_htmlsnippet.processor.php", $manager_theme)); - break; + case 78: + // get the edit snippet action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 77: + // get the new snippet action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 79: + // get the save processor + include_once(includeFileProcessor("processors/save_htmlsnippet.processor.php",$manager_theme)); + break; + case 80: + // get the delete processor + include_once(includeFileProcessor("processors/delete_htmlsnippet.processor.php",$manager_theme)); + break; + case 97: + // get the duplicate processor + include_once(includeFileProcessor("processors/duplicate_htmlsnippet.processor.php",$manager_theme)); + break; /********************************************************************/ /* show the credits page */ /********************************************************************/ - case 18: - // get the credits page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/credits.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 18: + // get the credits page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/credits.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* empty cache & synchronisation */ /********************************************************************/ - case 26: - // get the cache emptying processor - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/refresh_site.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 26: + // get the cache emptying processor + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/refresh_site.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* Module management */ /********************************************************************/ - case 106: - // get module management - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/modules.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 107: - // get the new module action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_module.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 108: - // get the edit module action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_module.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 109: - // get the save processor - include_once(includeFileProcessor("processors/save_module.processor.php", $manager_theme)); - break; - case 110: - // get the delete processor - include_once(includeFileProcessor("processors/delete_module.processor.php", $manager_theme)); - break; - case 111: - // get the duplicate processor - include_once(includeFileProcessor("processors/duplicate_module.processor.php", $manager_theme)); - break; - case 112: - // execute/run the module - //include_once "header.inc.php"; - include_once(includeFileProcessor("processors/execute_module.processor.php", $manager_theme)); - //include_once "footer.inc.php"; - break; - case 113: - // get the module resources (dependencies) action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_module_resources.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 106: + // get module management + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/modules.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 107: + // get the new module action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_module.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 108: + // get the edit module action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_module.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 109: + // get the save processor + include_once(includeFileProcessor("processors/save_module.processor.php",$manager_theme)); + break; + case 110: + // get the delete processor + include_once(includeFileProcessor("processors/delete_module.processor.php",$manager_theme)); + break; + case 111: + // get the duplicate processor + include_once(includeFileProcessor("processors/duplicate_module.processor.php",$manager_theme)); + break; + case 112: + // execute/run the module + //include_once "header.inc.php"; + include_once(includeFileProcessor("processors/execute_module.processor.php",$manager_theme)); + //include_once "footer.inc.php"; + break; + case 113: + // get the module resources (dependencies) action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_module_resources.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* plugin management */ /********************************************************************/ - case 100: - // change the plugin priority - //include_once "header.inc.php"; - in action file - include_once(includeFileProcessor("actions/mutate_plugin_priority.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 101: - // get the new plugin action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 102: - // get the edit plugin action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 103: - // get the save processor - include_once(includeFileProcessor("processors/save_plugin.processor.php", $manager_theme)); - break; - case 104: - // get the delete processor - include_once(includeFileProcessor("processors/delete_plugin.processor.php", $manager_theme)); - break; - case 105: - // get the duplicate processor - include_once(includeFileProcessor("processors/duplicate_plugin.processor.php", $manager_theme)); - break; - case 119: - // get the purge processor - include_once(includeFileProcessor("processors/purge_plugin.processor.php", $manager_theme)); - break; + case 100: + // change the plugin priority + //include_once "header.inc.php"; - in action file + include_once(includeFileProcessor("actions/mutate_plugin_priority.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 101: + // get the new plugin action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 102: + // get the edit plugin action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 103: + // get the save processor + include_once(includeFileProcessor("processors/save_plugin.processor.php",$manager_theme)); + break; + case 104: + // get the delete processor + include_once(includeFileProcessor("processors/delete_plugin.processor.php",$manager_theme)); + break; + case 105: + // get the duplicate processor + include_once(includeFileProcessor("processors/duplicate_plugin.processor.php",$manager_theme)); + break; + case 119: + // get the purge processor + include_once(includeFileProcessor("processors/purge_plugin.processor.php",$manager_theme)); + break; /********************************************************************/ /* view phpinfo */ /********************************************************************/ - case 200: - // show phpInfo - if ($modx->hasPermission('logs')) { - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/phpinfo.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - } - break; + case 200: + // show phpInfo + if($modx->hasPermission('logs')) { + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/phpinfo.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + } + break; /********************************************************************/ /* errorpage */ /********************************************************************/ - case 29: - // get the error page - include_once(includeFileProcessor("actions/error_dialog.static.php", $manager_theme)); - break; + case 29: + // get the error page + include_once(includeFileProcessor("actions/error_dialog.static.php",$manager_theme)); + break; /********************************************************************/ /* file manager */ /********************************************************************/ - case 31: - // get the page to manage files - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/files.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 31: + // get the page to manage files + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/files.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* access permissions */ /********************************************************************/ - case 40: - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/access_permissions.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 91: - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/web_access_permissions.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 40: + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/access_permissions.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 91: + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/web_access_permissions.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* access groups processor */ /********************************************************************/ - case 41: - include_once(includeFileProcessor("processors/access_groups.processor.php", $manager_theme)); - break; - case 92: - include_once(includeFileProcessor("processors/web_access_groups.processor.php", $manager_theme)); - break; + case 41: + include_once(includeFileProcessor("processors/access_groups.processor.php",$manager_theme)); + break; + case 92: + include_once(includeFileProcessor("processors/web_access_groups.processor.php",$manager_theme)); + break; /********************************************************************/ /* settings editor */ /********************************************************************/ - case 17: - // get the settings editor - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_settings.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 118: - // call settings ajax include - ob_clean(); - include_once(includeFileProcessor("includes/mutate_settings.ajax.php", $manager_theme)); - break; + case 17: + // get the settings editor + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_settings.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 118: + // call settings ajax include + ob_clean(); + include_once(includeFileProcessor("includes/mutate_settings.ajax.php",$manager_theme)); + break; /********************************************************************/ /* save settings */ /********************************************************************/ - case 30: - // get the save settings processor - include_once(includeFileProcessor("processors/save_settings.processor.php", $manager_theme)); - break; + case 30: + // get the save settings processor + include_once(includeFileProcessor("processors/save_settings.processor.php",$manager_theme)); + break; /********************************************************************/ /* system information */ /********************************************************************/ - case 53: - // get the settings editor - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/sysinfo.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 53: + // get the settings editor + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/sysinfo.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* optimise table */ /********************************************************************/ - case 54: - // get the table optimizer/truncate processor - include_once(includeFileProcessor("processors/optimize_table.processor.php", $manager_theme)); - break; + case 54: + // get the table optimizer/truncate processor + include_once(includeFileProcessor("processors/optimize_table.processor.php",$manager_theme)); + break; /********************************************************************/ /* view logging */ /********************************************************************/ - case 13: - // view logging - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/logging.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 13: + // view logging + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/logging.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* empty logs */ /********************************************************************/ - case 55: - // get the settings editor - include_once(includeFileProcessor("processors/empty_table.processor.php", $manager_theme)); - break; + case 55: + // get the settings editor + include_once(includeFileProcessor("processors/empty_table.processor.php",$manager_theme)); + break; /********************************************************************/ /* calls test page */ /********************************************************************/ - case 999: - // get the test page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("test_page.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 999: + // get the test page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("test_page.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* Empty recycle bin */ /********************************************************************/ - case 64: - // get the Recycle bin emptier - include_once(includeFileProcessor("processors/remove_content.processor.php", $manager_theme)); - break; + case 64: + // get the Recycle bin emptier + include_once(includeFileProcessor("processors/remove_content.processor.php",$manager_theme)); + break; /********************************************************************/ /* Messages */ /********************************************************************/ - case 10: - // get the messages page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/messages.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 10: + // get the messages page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/messages.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* Delete a message */ /********************************************************************/ - case 65: - // get the message deleter - include_once(includeFileProcessor("processors/delete_message.processor.php", $manager_theme)); - break; + case 65: + // get the message deleter + include_once(includeFileProcessor("processors/delete_message.processor.php",$manager_theme)); + break; /********************************************************************/ /* Send a message */ /********************************************************************/ - case 66: - // get the message deleter - include_once(includeFileProcessor("processors/send_message.processor.php", $manager_theme)); - break; + case 66: + // get the message deleter + include_once(includeFileProcessor("processors/send_message.processor.php",$manager_theme)); + break; /********************************************************************/ /* Remove locks */ /********************************************************************/ - case 67: - // get the lock remover - include_once(includeFileProcessor("processors/remove_locks.processor.php", $manager_theme)); - break; + case 67: + // get the lock remover + include_once(includeFileProcessor("processors/remove_locks.processor.php",$manager_theme)); + break; /********************************************************************/ /* Site schedule */ /********************************************************************/ - case 70: - // get the schedule page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/site_schedule.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 70: + // get the schedule page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/site_schedule.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* Search */ /********************************************************************/ - case 71: - // get the search page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/search.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 71: + // get the search page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/search.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* About */ /********************************************************************/ - case 59: - // get the about page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/about.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 59: + // get the about page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/about.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* Add weblink */ /********************************************************************/ - case 72: - // get the weblink page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_content.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 72: + // get the weblink page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* User management */ /********************************************************************/ - case 75: - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/user_management.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 99: - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/web_user_management.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 86: - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/role_management.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 75: + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/user_management.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 99: + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/web_user_management.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 86: + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/role_management.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* template/ snippet management */ /********************************************************************/ - case 76: - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/resources.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 76: + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/resources.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* Export to file */ /********************************************************************/ - case 83: - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/export_site.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 83: + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/export_site.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* Resource Selector */ /********************************************************************/ - case 84: - include_once(includeFileProcessor("actions/resource_selector.static.php", $manager_theme)); - break; + case 84: + include_once(includeFileProcessor("actions/resource_selector.static.php",$manager_theme)); + break; /********************************************************************/ /* Backup Manager */ /********************************************************************/ - case 93: - # header and footer will be handled interally - include_once(includeFileProcessor("actions/bkmanager.static.php", $manager_theme)); - break; + case 93: + # header and footer will be handled interally + include_once(includeFileProcessor("actions/bkmanager.static.php",$manager_theme)); + break; /********************************************************************/ /* Duplicate Document */ /********************************************************************/ - case 94: - // get the duplicate processor - include_once(includeFileProcessor("processors/duplicate_content.processor.php", $manager_theme)); - break; + case 94: + // get the duplicate processor + include_once(includeFileProcessor("processors/duplicate_content.processor.php",$manager_theme)); + break; /********************************************************************/ /* Import Document from file */ /********************************************************************/ - case 95: - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/import_site.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 95: + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/import_site.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* Help */ /********************************************************************/ - case 9: - // get the help page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/help.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 9: + // get the help page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/help.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* Template Variables - Based on Apodigm's Docvars */ /********************************************************************/ - case 300: - // get the new document variable action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 301: - // get the edit document variable action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 302: - // get the save processor - include_once(includeFileProcessor("processors/save_tmplvars.processor.php", $manager_theme)); - break; - case 303: - // get the delete processor - include_once(includeFileProcessor("processors/delete_tmplvars.processor.php", $manager_theme)); - break; - case 304: - // get the duplicate processor - include_once(includeFileProcessor("processors/duplicate_tmplvars.processor.php", $manager_theme)); - break; - case 305: - // get the tv-rank action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_tv_rank.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 300: + // get the new document variable action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 301: + // get the edit document variable action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 302: + // get the save processor + include_once(includeFileProcessor("processors/save_tmplvars.processor.php",$manager_theme)); + break; + case 303: + // get the delete processor + include_once(includeFileProcessor("processors/delete_tmplvars.processor.php",$manager_theme)); + break; + case 304: + // get the duplicate processor + include_once(includeFileProcessor("processors/duplicate_tmplvars.processor.php",$manager_theme)); + break; + case 305: + // get the tv-rank action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_tv_rank.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* Event viewer: show event message log */ /********************************************************************/ - case 114: - // get event logs - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/eventlog.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 115: - // get event log details viewer - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/eventlog_details.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 116: - // get the event log delete processor - include_once(includeFileProcessor("processors/delete_eventlog.processor.php", $manager_theme)); - break; - - case 501: - //delete category - include_once(includeFileProcessor("processors/delete_category.processor.php", $manager_theme)); - break; + case 114: + // get event logs + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/eventlog.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 115: + // get event log details viewer + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/eventlog_details.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 116: + // get the event log delete processor + include_once(includeFileProcessor("processors/delete_eventlog.processor.php",$manager_theme)); + break; + + case 501: + //delete category + include_once(includeFileProcessor("processors/delete_category.processor.php",$manager_theme)); + break; /********************************************************************/ /* default action: show not implemented message */ /********************************************************************/ - default: - // say that what was requested doesn't do anything yet - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - echo " -
    " . $_lang['functionnotimpl'] . "
    + default : + // say that what was requested doesn't do anything yet + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + echo " +
    ".$_lang['functionnotimpl']."
    -

    " . $_lang['functionnotimpl_message'] . "

    +

    ".$_lang['functionnotimpl_message']."

    "; - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); } /********************************************************************/ // log action, unless it's a frame request -if ($action!=1 && $action!=7 && $action!=2) { - include_once "log.class.inc.php"; - $log = new logHandler; - $log->initAndWriteLog(); +if($action!=1 && $action!=7 && $action!=2) { + include_once "log.class.inc.php"; + $log = new logHandler; + $log->initAndWriteLog(); } /********************************************************************/ // show debug diff --git a/manager/media/browser/mcpuk/browse.php b/manager/media/browser/mcpuk/browse.php index a89e141a4e..0f0e308919 100755 --- a/manager/media/browser/mcpuk/browse.php +++ b/manager/media/browser/mcpuk/browse.php @@ -14,19 +14,14 @@ require "core/autoload.php"; // Init MODX -function returnNoPermissionsMessage($role) -{ - global $_lang; - echo sprintf($_lang['files_management_no_permission'], $role); - exit; +function returnNoPermissionsMessage($role) { + global $_lang; + echo sprintf($_lang['files_management_no_permission'], $role); + exit; } -if ($_GET['type'] == 'images' && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_images')) { - returnNoPermissionsMessage('assets_images'); -} -if ($_GET['type'] == 'files' && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_files')) { - returnNoPermissionsMessage('assets_files'); -} +if( $_GET['type'] == 'images' && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_images')) returnNoPermissionsMessage('assets_images'); +if( $_GET['type'] == 'files' && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_files')) returnNoPermissionsMessage('assets_files'); $browser = new browser($modx); $browser->action(); diff --git a/manager/media/browser/mcpuk/browser.php b/manager/media/browser/mcpuk/browser.php index 0e76c21c27..7ed522bbbf 100755 --- a/manager/media/browser/mcpuk/browser.php +++ b/manager/media/browser/mcpuk/browser.php @@ -10,20 +10,14 @@ } }; window.location.href = "browse.php?"; diff --git a/manager/media/browser/mcpuk/config.php b/manager/media/browser/mcpuk/config.php index eff680bb65..6bb2648559 100755 --- a/manager/media/browser/mcpuk/config.php +++ b/manager/media/browser/mcpuk/config.php @@ -26,12 +26,12 @@ 'theme' => "evo", - 'uploadURL' => rtrim($modx->config['rb_base_url'], '/'), - 'uploadDir' => rtrim($modx->config['rb_base_dir'], '/'), + 'uploadURL' => rtrim($modx->config['rb_base_url'],'/'), + 'uploadDir' => rtrim($modx->config['rb_base_dir'],'/'), 'siteURL' => $modx->config['site_url'], - 'assetsURL' => rtrim($modx->config['rb_base_url'], '/'), - 'dirPerms' => intval($modx->config['new_folder_permissions'], 8), - 'filePerms' => intval($modx->config['new_file_permissions'], 8), + 'assetsURL' => rtrim($modx->config['rb_base_url'],'/'), + 'dirPerms' => intval($modx->config['new_folder_permissions'],8), + 'filePerms' => intval($modx->config['new_file_permissions'],8), 'maxfilesize' => $settings['upload_maxsize'], 'denyUpdateCheck' => true, @@ -58,14 +58,14 @@ 'types' => array( // CKEditor & FCKEditor types - 'files' => str_replace(',', ' ', $modx->config['upload_files']), - 'flash' => str_replace(',', ' ', $modx->config['upload_flash']), - 'images' => str_replace(',', ' ', $modx->config['upload_images']), + 'files' => str_replace(',',' ',$modx->config['upload_files']), + 'flash' => str_replace(',',' ',$modx->config['upload_flash']), + 'images' => str_replace(',',' ',$modx->config['upload_images']), // TinyMCE types - 'file' => str_replace(',', ' ', $modx->config['upload_files']), - 'media' => str_replace(',', ' ', $modx->config['upload_media']), - 'image' => str_replace(',', ' ', $modx->config['upload_images']), + 'file' => str_replace(',',' ',$modx->config['upload_files']), + 'media' => str_replace(',',' ',$modx->config['upload_media']), + 'image' => str_replace(',',' ',$modx->config['upload_images']), ), 'dirnameChangeChars' => array( ' ' => "_", diff --git a/manager/media/browser/mcpuk/core/autoload.php b/manager/media/browser/mcpuk/core/autoload.php index bcb37f83c2..8f910cad63 100755 --- a/manager/media/browser/mcpuk/core/autoload.php +++ b/manager/media/browser/mcpuk/core/autoload.php @@ -19,42 +19,39 @@ * here, they can be accessed in config.php via $GLOBALS array. * It's recommended to use constants instead. */ -include_once(dirname(__FILE__) . "/../../../../../assets/cache/siteManager.php"); +include_once(dirname(__FILE__)."/../../../../../assets/cache/siteManager.php"); require_once('../../../includes/protect.inc.php'); include_once('../../../includes/config.inc.php'); include_once('../../../includes/document.parser.class.inc.php'); $modx = evolutionCMS(); $modx->db->connect(); startCMSSession(); -if (!isset($_SESSION['mgrValidated'])) { - die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if(!isset($_SESSION['mgrValidated'])) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } define('IN_MANAGER_MODE', true); $modx->getSettings(); $manager_language = $modx->config['manager_language']; // Pass language code from MODX to KCFinder -if (!file_exists("../../../includes/lang/" . $manager_language . ".inc.php")) { +if(!file_exists("../../../includes/lang/".$manager_language.".inc.php")) { $manager_language = "english"; // if not set, get the english language file. } -include_once "../../../includes/lang/" . $manager_language . ".inc.php"; +include_once "../../../includes/lang/".$manager_language.".inc.php"; $_GET['langCode'] = $modx_lang_attribute; // PHP VERSION CHECK -if (substr(PHP_VERSION, 0, strpos(PHP_VERSION, '.')) < 5) { +if (substr(PHP_VERSION, 0, strpos(PHP_VERSION, '.')) < 5) die("You are using PHP " . PHP_VERSION . " when KCFinder require at least version 5! Some systems has an option to change the active PHP version. Please refer to your hosting provider or upgrade your PHP distribution."); -} // SAFE MODE CHECK -if (ini_get("safe_mode")) { +if (ini_get("safe_mode")) die("The \"safe_mode\" PHP ini setting is turned on! You cannot run KCFinder in safe mode."); -} // MAGIC AUTOLOAD CLASSES FUNCTION -function autoloadda9d06472ccb71b84928677ce2a6ca89($class) -{ +function autoloadda9d06472ccb71b84928677ce2a6ca89($class) { static $classes = null; if ($classes === null) { $classes = array( @@ -86,8 +83,8 @@ function autoloadda9d06472ccb71b84928677ce2a6ca89($class) // json_encode() IMPLEMENTATION IF JSON EXTENSION IS MISSING if (!function_exists("json_encode")) { - function kcfinder_json_string_encode($string) - { + + function kcfinder_json_string_encode($string) { return '"' . str_replace('/', "\\/", str_replace("\t", "\\t", @@ -98,42 +95,37 @@ function kcfinder_json_string_encode($string) $string)))))) . '"'; } - function json_encode($data) - { + function json_encode($data) { + if (is_array($data)) { $ret = array(); // OBJECT if (array_keys($data) !== range(0, count($data) - 1)) { - foreach ($data as $key => $val) { + foreach ($data as $key => $val) $ret[] = kcfinder_json_string_encode($key) . ':' . json_encode($val); - } return "{" . implode(",", $ret) . "}"; // ARRAY } else { - foreach ($data as $val) { + foreach ($data as $val) $ret[] = json_encode($val); - } return "[" . implode(",", $ret) . "]"; } - // BOOLEAN OR NULL - } elseif (is_bool($data) || ($data === null)) { + // BOOLEAN OR NULL + } elseif (is_bool($data) || ($data === null)) return ($data === null) ? "null" : ($data ? "true" : "false"); - } // FLOAT - elseif (is_float($data)) { + elseif (is_float($data)) return rtrim(rtrim(number_format($data, 14, ".", ""), "0"), "."); - } // INTEGER - elseif (is_int($data)) { + elseif (is_int($data)) return $data; - } // STRING return kcfinder_json_string_encode($data); diff --git a/manager/media/browser/mcpuk/core/browser.php b/manager/media/browser/mcpuk/core/browser.php index 79d61b8f07..a978b321b1 100755 --- a/manager/media/browser/mcpuk/core/browser.php +++ b/manager/media/browser/mcpuk/core/browser.php @@ -12,29 +12,23 @@ * @link http://kcfinder.sunhater.com */ -class browser extends uploader -{ +class browser extends uploader { protected $action; protected $thumbsDir; protected $thumbsTypeDir; - public function __construct($modx) - { + public function __construct($modx) { parent::__construct($modx); if (isset($this->post['dir'])) { $dir = $this->checkInputDir($this->post['dir'], true, false); - if ($dir === false) { - unset($this->post['dir']); - } + if ($dir === false) unset($this->post['dir']); $this->post['dir'] = $dir; } if (isset($this->get['dir'])) { $dir = $this->checkInputDir($this->get['dir'], true, false); - if ($dir === false) { - unset($this->get['dir']); - } + if ($dir === false) unset($this->get['dir']); $this->get['dir'] = $dir; } @@ -50,9 +44,8 @@ public function __construct($modx) !is_dir("$thumbsDir/{$this->type}") && !@mkdir("$thumbsDir/{$this->type}", $this->config['dirPerms']) ) - ) { + ) $this->errorMsg("Cannot access or create thumbnails folder."); - } $this->thumbsDir = $thumbsDir; $this->thumbsTypeDir = "$thumbsDir/{$this->type}"; @@ -65,30 +58,23 @@ public function __construct($modx) if (is_array($files) && count($files)) { $time = time(); - foreach ($files as $file) { - if (is_file($file) && ($time - filemtime($file) > 3600)) { + foreach ($files as $file) + if (is_file($file) && ($time - filemtime($file) > 3600)) unlink($file); - } - } } if (isset($this->get['theme']) && ($this->get['theme'] == basename($this->get['theme'])) && is_dir("themes/{$this->get['theme']}") - ) { + ) $this->config['theme'] = $this->get['theme']; - } } - public function action() - { + public function action() { $act = isset($this->get['act']) ? $this->get['act'] : "browser"; - if (!preg_match('@^[0-9a-zA-Z_]+$@', $act)) { - $this->errorMsg("Unknown error."); - } - if (!method_exists($this, "act_$act")) { + if(!preg_match('@^[0-9a-zA-Z_]+$@', $act)) $this->errorMsg("Unknown error."); + if (!method_exists($this, "act_$act")) $act = "browser"; - } $this->action = $act; $method = "act_$act"; @@ -96,22 +82,21 @@ public function action() $message = $this->label("You don't have permissions to browse server."); if (in_array($act, array("browser", "upload")) || (substr($act, 0, 8) == "download") - ) { + ) $this->backMsg($message); - } else { + else { header("Content-Type: text/plain; charset={$this->charset}"); die(json_encode(array('error' => $message))); } } - if (!isset($this->session['dir'])) { + if (!isset($this->session['dir'])) $this->session['dir'] = $this->type; - } else { + else { $type = $this->getTypeFromPath($this->session['dir']); $dir = $this->config['uploadDir'] . "/" . $this->session['dir']; - if (($type != $this->type) || !is_dir($dir) || !is_readable($dir)) { + if (($type != $this->type) || !is_dir($dir) || !is_readable($dir)) $this->session['dir'] = $this->type; - } } $this->session['dir'] = path::normalize($this->session['dir']); @@ -121,9 +106,8 @@ public function action() } elseif ( (substr($act, 0, 8) != "download") && !in_array($act, array("thumb", "upload")) - ) { + ) header("Content-Type: text/plain; charset={$this->charset}"); - } $return = $this->$method(); echo ($return === true) @@ -131,25 +115,21 @@ public function action() : $return; } - protected function act_browser() - { + protected function act_browser() { if (isset($this->get['dir']) && is_dir("{$this->typeDir}/{$this->get['dir']}") && is_readable("{$this->typeDir}/{$this->get['dir']}") - ) { + ) $this->session['dir'] = path::normalize("{$this->type}/{$this->get['dir']}"); - } return $this->output(); } - protected function act_init() - { + protected function act_init() { $tree = $this->getDirInfo($this->typeDir); $tree['dirs'] = $this->getTree($this->session['dir']); - if (!is_array($tree['dirs']) || !count($tree['dirs'])) { + if (!is_array($tree['dirs']) || !count($tree['dirs'])) unset($tree['dirs']); - } $files = $this->getFiles($this->session['dir']); $dirWritable = dir::isWritable("{$this->config['uploadDir']}/{$this->session['dir']}"); $data = array( @@ -160,26 +140,21 @@ protected function act_init() return json_encode($data); } - protected function act_thumb() - { + protected function act_thumb() { $this->getDir($this->get['dir'], true); - if (!isset($this->get['file']) || !isset($this->get['dir'])) { + if (!isset($this->get['file']) || !isset($this->get['dir'])) $this->sendDefaultThumb(); - } $file = $this->get['file']; - if (basename($file) != $file) { + if (basename($file) != $file) $this->sendDefaultThumb(); - } $file = "{$this->thumbsDir}/{$this->type}/{$this->get['dir']}/$file"; if (!is_file($file) || !is_readable($file)) { $file = "{$this->config['uploadDir']}/{$this->type}/{$this->get['dir']}/" . basename($file); - if (!is_file($file) || !is_readable($file)) { + if (!is_file($file) || !is_readable($file)) $this->sendDefaultThumb($file); - } $image = image::factory($this->imageDriver, $file); - if ($image->initError) { + if ($image->initError) $this->sendDefaultThumb($file); - } list($tmp, $tmp, $type) = getimagesize($file); if (in_array($type, array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG)) && ($image->width <= $this->config['thumbWidth']) && @@ -190,20 +165,17 @@ protected function act_thumb() ($type == IMAGETYPE_PNG) ? "png" : "jpeg"); $mime = "image/$mime"; httpCache::file($file, $mime); - } else { + } else $this->sendDefaultThumb($file); - } } httpCache::file($file, "image/jpeg"); } - protected function act_expand() - { + protected function act_expand() { return json_encode(array('dirs' => $this->getDirs($this->postDir()))); } - protected function act_chDir() - { + protected function act_chDir() { $this->postDir(); // Just for existing check $this->session['dir'] = $this->type . "/" . $this->post['dir']; $dirWritable = dir::isWritable("{$this->config['uploadDir']}/{$this->session['dir']}"); @@ -213,104 +185,81 @@ protected function act_chDir() )); } - protected function act_newDir() - { + protected function act_newDir() { if (!$this->config['access']['dirs']['create'] || !isset($this->post['dir']) || !isset($this->post['newDir']) - ) { + ) $this->errorMsg("Unknown error."); - } $dir = $this->postDir(); $newDir = $this->normalizeDirname(trim($this->post['newDir'])); - if (!strlen($newDir)) { + if (!strlen($newDir)) $this->errorMsg("Please enter new folder name."); - } - if (preg_match('/[\/\\\\]/s', $newDir)) { + if (preg_match('/[\/\\\\]/s', $newDir)) $this->errorMsg("Unallowable characters in folder name."); - } - if (substr($newDir, 0, 1) == ".") { + if (substr($newDir, 0, 1) == ".") $this->errorMsg("Folder name shouldn't begins with '.'"); - } - if (file_exists("$dir/$newDir")) { + if (file_exists("$dir/$newDir")) $this->errorMsg("A file or folder with that name already exists."); - } - if (!@mkdir("$dir/$newDir", $this->config['dirPerms'])) { + if (!@mkdir("$dir/$newDir", $this->config['dirPerms'])) $this->errorMsg("Cannot create {dir} folder.", array('dir' => $newDir)); - } return true; } - protected function act_renameDir() - { + protected function act_renameDir() { if (!$this->config['access']['dirs']['rename'] || !isset($this->post['dir']) || !isset($this->post['newName']) - ) { + ) $this->errorMsg("Unknown error."); - } $dir = $this->postDir(); $newName = $this->normalizeDirname(trim($this->post['newName'])); - if (!strlen($newName)) { + if (!strlen($newName)) $this->errorMsg("Please enter new folder name."); - } - if (preg_match('/[\/\\\\]/s', $newName)) { + if (preg_match('/[\/\\\\]/s', $newName)) $this->errorMsg("Unallowable characters in folder name."); - } - if (substr($newName, 0, 1) == ".") { + if (substr($newName, 0, 1) == ".") $this->errorMsg("Folder name shouldn't begins with '.'"); - } - if (!@rename($dir, dirname($dir) . "/$newName")) { + if (!@rename($dir, dirname($dir) . "/$newName")) $this->errorMsg("Cannot rename the folder."); - } $thumbDir = "$this->thumbsTypeDir/{$this->post['dir']}"; - if (is_dir($thumbDir)) { + if (is_dir($thumbDir)) @rename($thumbDir, dirname($thumbDir) . "/$newName"); - } return json_encode(array('name' => $newName)); } - protected function act_deleteDir() - { + protected function act_deleteDir() { if (!$this->config['access']['dirs']['delete'] || !isset($this->post['dir']) || !strlen(trim($this->post['dir'])) - ) { + ) $this->errorMsg("Unknown error."); - } $dir = $this->postDir(); - if (!dir::isWritable($dir)) { + if (!dir::isWritable($dir)) $this->errorMsg("Cannot delete the folder."); - } $result = !dir::prune($dir, false); - if (is_array($result) && count($result)) { + if (is_array($result) && count($result)) $this->errorMsg("Failed to delete {count} files/folders.", array('count' => count($result))); - } $thumbDir = "$this->thumbsTypeDir/{$this->post['dir']}"; - if (is_dir($thumbDir)) { - dir::prune($thumbDir); - } + if (is_dir($thumbDir)) dir::prune($thumbDir); return true; } - protected function act_upload() - { + protected function act_upload() { if (!$this->config['access']['files']['upload'] || !isset($this->post['dir']) - ) { + ) $this->errorMsg("Unknown error."); - } $dir = $this->postDir(); - if (!dir::isWritable($dir)) { + if (!dir::isWritable($dir)) $this->errorMsg("Cannot access or write to upload folder."); - } if (is_array($this->file['name'])) { $return = array(); @@ -322,22 +271,19 @@ protected function act_upload() ), $dir); } return implode("\n", $return); - } else { + } else return $this->moveUploadFile($this->file, $dir); - } } - protected function act_download() - { + protected function act_download() { $dir = $this->postDir(); if (!isset($this->post['dir']) || !isset($this->post['file']) || - strpos($this->post['file'], '../')!==false || + strpos($this->post['file'],'../')!==false || (false === ($file = "$dir/{$this->post['file']}")) || !file_exists($file) || !is_readable($file) - ) { + ) $this->errorMsg("Unknown error."); - } header("Pragma: public"); header("Expires: 0"); @@ -351,248 +297,205 @@ protected function act_download() die; } - protected function act_rename() - { + protected function act_rename() { $dir = $this->postDir(); if (!$this->config['access']['files']['rename'] || !isset($this->post['dir']) || !isset($this->post['file']) || - strpos($this->post['file'], '../')!==false || + strpos($this->post['file'],'../')!==false || !isset($this->post['newName']) || (false === ($file = "$dir/{$this->post['file']}")) || !file_exists($file) || !is_readable($file) || !file::isWritable($file) - ) { + ) $this->errorMsg("Unknown error."); - } if (isset($this->config['denyExtensionRename']) && $this->config['denyExtensionRename'] && (file::getExtension($this->post['file'], true) !== file::getExtension($this->post['newName'], true) ) - ) { + ) $this->errorMsg("You cannot rename the extension of files!"); - } $newName = $this->normalizeFilename(trim($this->post['newName'])); - if (!strlen($newName)) { + if (!strlen($newName)) $this->errorMsg("Please enter new file name."); - } - if (preg_match('/[\/\\\\]/s', $newName)) { + if (preg_match('/[\/\\\\]/s', $newName)) $this->errorMsg("Unallowable characters in file name."); - } - if (substr($newName, 0, 1) == ".") { + if (substr($newName, 0, 1) == ".") $this->errorMsg("File name shouldn't begins with '.'"); - } $newName = "$dir/$newName"; - if (file_exists($newName)) { + if (file_exists($newName)) $this->errorMsg("A file or folder with that name already exists."); - } $ext = file::getExtension($newName); - if (!$this->validateExtension($ext, $this->type)) { + if (!$this->validateExtension($ext, $this->type)) $this->errorMsg("Denied file extension."); - } - if (!@rename($file, $newName)) { + if (!@rename($file, $newName)) $this->errorMsg("Unknown error."); - } $thumbDir = "{$this->thumbsTypeDir}/{$this->post['dir']}"; $thumbFile = "$thumbDir/{$this->post['file']}"; - if (file_exists($thumbFile)) { + if (file_exists($thumbFile)) @rename($thumbFile, "$thumbDir/" . basename($newName)); - } return true; } - protected function act_delete() - { + protected function act_delete() { $dir = $this->postDir(); if (!$this->config['access']['files']['delete'] || !isset($this->post['dir']) || !isset($this->post['file']) || - strpos($this->post['file'], '../')!==false || + strpos($this->post['file'],'../')!==false || (false === ($file = "$dir/{$this->post['file']}")) || !file_exists($file) || !is_readable($file) || !file::isWritable($file) || !@unlink($file) - ) { + ) $this->errorMsg("Unknown error."); - } $thumb = "{$this->thumbsTypeDir}/{$this->post['dir']}/{$this->post['file']}"; - if (file_exists($thumb)) { - @unlink($thumb); - } + if (file_exists($thumb)) @unlink($thumb); return true; } - protected function act_cp_cbd() - { + protected function act_cp_cbd() { $dir = $this->postDir(); if (!$this->config['access']['files']['copy'] || !isset($this->post['dir']) || !is_dir($dir) || !is_readable($dir) || !dir::isWritable($dir) || !isset($this->post['files']) || !is_array($this->post['files']) || !count($this->post['files']) - ) { + ) $this->errorMsg("Unknown error."); - } $error = array(); - foreach ($this->post['files'] as $file) { + foreach($this->post['files'] as $file) { $file = path::normalize($file); - if (substr($file, 0, 1) == ".") { - continue; - } + if (substr($file, 0, 1) == ".") continue; $type = explode("/", $file); $type = $type[0]; - if ($type != $this->type) { - continue; - } + if ($type != $this->type) continue; $path = "{$this->config['uploadDir']}/$file"; $base = basename($file); $replace = array('file' => $base); $ext = file::getExtension($base); - if (!file_exists($path)) { + if (!file_exists($path)) $error[] = $this->label("The file '{file}' does not exist.", $replace); - } elseif (substr($base, 0, 1) == ".") { + elseif (substr($base, 0, 1) == ".") $error[] = "$base: " . $this->label("File name shouldn't begins with '.'"); - } elseif (!$this->validateExtension($ext, $type)) { + elseif (!$this->validateExtension($ext, $type)) $error[] = "$base: " . $this->label("Denied file extension."); - } elseif (file_exists("$dir/$base")) { + elseif (file_exists("$dir/$base")) $error[] = "$base: " . $this->label("A file or folder with that name already exists."); - } elseif (!is_readable($path) || !is_file($path)) { + elseif (!is_readable($path) || !is_file($path)) $error[] = $this->label("Cannot read '{file}'.", $replace); - } elseif (!@copy($path, "$dir/$base")) { + elseif (!@copy($path, "$dir/$base")) $error[] = $this->label("Cannot copy '{file}'.", $replace); - } else { - if (function_exists("chmod")) { + else { + if (function_exists("chmod")) @chmod("$dir/$base", $this->config['filePerms']); - } $fromThumb = "{$this->thumbsDir}/$file"; if (is_file($fromThumb) && is_readable($fromThumb)) { $toThumb = "{$this->thumbsTypeDir}/{$this->post['dir']}"; - if (!is_dir($toThumb)) { + if (!is_dir($toThumb)) @mkdir($toThumb, $this->config['dirPerms'], true); - } $toThumb .= "/$base"; @copy($fromThumb, $toThumb); } } } - if (count($error)) { + if (count($error)) return json_encode(array('error' => $error)); - } return true; } - protected function act_mv_cbd() - { + protected function act_mv_cbd() { $dir = $this->postDir(); if (!$this->config['access']['files']['move'] || !isset($this->post['dir']) || !is_dir($dir) || !is_readable($dir) || !dir::isWritable($dir) || !isset($this->post['files']) || !is_array($this->post['files']) || !count($this->post['files']) - ) { + ) $this->errorMsg("Unknown error."); - } $error = array(); - foreach ($this->post['files'] as $file) { + foreach($this->post['files'] as $file) { $file = path::normalize($file); - if (substr($file, 0, 1) == ".") { - continue; - } + if (substr($file, 0, 1) == ".") continue; $type = explode("/", $file); $type = $type[0]; - if ($type != $this->type) { - continue; - } + if ($type != $this->type) continue; $path = "{$this->config['uploadDir']}/$file"; $base = basename($file); $replace = array('file' => $base); $ext = file::getExtension($base); - if (!file_exists($path)) { + if (!file_exists($path)) $error[] = $this->label("The file '{file}' does not exist.", $replace); - } elseif (substr($base, 0, 1) == ".") { + elseif (substr($base, 0, 1) == ".") $error[] = "$base: " . $this->label("File name shouldn't begins with '.'"); - } elseif (!$this->validateExtension($ext, $type)) { + elseif (!$this->validateExtension($ext, $type)) $error[] = "$base: " . $this->label("Denied file extension."); - } elseif (file_exists("$dir/$base")) { + elseif (file_exists("$dir/$base")) $error[] = "$base: " . $this->label("A file or folder with that name already exists."); - } elseif (!is_readable($path) || !is_file($path)) { + elseif (!is_readable($path) || !is_file($path)) $error[] = $this->label("Cannot read '{file}'.", $replace); - } elseif (!file::isWritable($path) || !@rename($path, "$dir/$base")) { + elseif (!file::isWritable($path) || !@rename($path, "$dir/$base")) $error[] = $this->label("Cannot move '{file}'.", $replace); - } else { - if (function_exists("chmod")) { + else { + if (function_exists("chmod")) @chmod("$dir/$base", $this->config['filePerms']); - } $fromThumb = "{$this->thumbsDir}/$file"; if (is_file($fromThumb) && is_readable($fromThumb)) { $toThumb = "{$this->thumbsTypeDir}/{$this->post['dir']}"; - if (!is_dir($toThumb)) { + if (!is_dir($toThumb)) @mkdir($toThumb, $this->config['dirPerms'], true); - } $toThumb .= "/$base"; @rename($fromThumb, $toThumb); } } } - if (count($error)) { + if (count($error)) return json_encode(array('error' => $error)); - } return true; } - protected function act_rm_cbd() - { + protected function act_rm_cbd() { if (!$this->config['access']['files']['delete'] || !isset($this->post['files']) || !is_array($this->post['files']) || !count($this->post['files']) - ) { + ) $this->errorMsg("Unknown error."); - } $error = array(); - foreach ($this->post['files'] as $file) { + foreach($this->post['files'] as $file) { $file = path::normalize($file); - if (substr($file, 0, 1) == ".") { - continue; - } + if (substr($file, 0, 1) == ".") continue; $type = explode("/", $file); $type = $type[0]; - if ($type != $this->type) { - continue; - } + if ($type != $this->type) continue; $path = "{$this->config['uploadDir']}/$file"; $base = basename($file); $replace = array('file' => $base); - if (!is_file($path)) { + if (!is_file($path)) $error[] = $this->label("The file '{file}' does not exist.", $replace); - } elseif (!@unlink($path)) { + elseif (!@unlink($path)) $error[] = $this->label("Cannot delete '{file}'.", $replace); - } else { + else { $thumb = "{$this->thumbsDir}/$file"; - if (is_file($thumb)) { - @unlink($thumb); - } + if (is_file($thumb)) @unlink($thumb); } } - if (count($error)) { + if (count($error)) return json_encode(array('error' => $error)); - } return true; } - protected function act_downloadDir() - { + protected function act_downloadDir() { $dir = $this->postDir(); - if (!isset($this->post['dir']) || $this->config['denyZipDownload']) { + if (!isset($this->post['dir']) || $this->config['denyZipDownload']) $this->errorMsg("Unknown error."); - } $filename = basename($dir) . ".zip"; do { $file = md5(time() . session_id()); @@ -607,27 +510,23 @@ protected function act_downloadDir() die; } - protected function act_downloadSelected() - { + protected function act_downloadSelected() { $dir = $this->postDir(); if (!isset($this->post['dir']) || !isset($this->post['files']) || !is_array($this->post['files']) || $this->config['denyZipDownload'] - ) { + ) $this->errorMsg("Unknown error."); - } $zipFiles = array(); foreach ($this->post['files'] as $file) { $file = path::normalize($file); - if ((substr($file, 0, 1) == ".") || (strpos($file, '/') !== false)) { + if ((substr($file, 0, 1) == ".") || (strpos($file, '/') !== false)) continue; - } $file = "$dir/$file"; - if (!is_file($file) || !is_readable($file)) { + if (!is_file($file) || !is_readable($file)) continue; - } $zipFiles[] = $file; } @@ -638,10 +537,9 @@ protected function act_downloadSelected() $zip = new ZipArchive(); $res = $zip->open($file, ZipArchive::CREATE); - if ($res === true) { - foreach ($zipFiles as $cfile) { + if ($res === TRUE) { + foreach ($zipFiles as $cfile) $zip->addFile($cfile, basename($cfile)); - } $zip->close(); } header("Content-Type: application/x-zip"); @@ -652,30 +550,25 @@ protected function act_downloadSelected() die; } - protected function act_downloadClipboard() - { + protected function act_downloadClipboard() { if (!isset($this->post['files']) || !is_array($this->post['files']) || $this->config['denyZipDownload'] - ) { + ) $this->errorMsg("Unknown error."); - } $zipFiles = array(); foreach ($this->post['files'] as $file) { $file = path::normalize($file); - if ((substr($file, 0, 1) == ".")) { + if ((substr($file, 0, 1) == ".")) continue; - } $type = explode("/", $file); $type = $type[0]; - if ($type != $this->type) { + if ($type != $this->type) continue; - } $file = $this->config['uploadDir'] . "/$file"; - if (!is_file($file) || !is_readable($file)) { + if (!is_file($file) || !is_readable($file)) continue; - } $zipFiles[] = $file; } @@ -686,10 +579,9 @@ protected function act_downloadClipboard() $zip = new ZipArchive(); $res = $zip->open($file, ZipArchive::CREATE); - if ($res === true) { - foreach ($zipFiles as $cfile) { + if ($res === TRUE) { + foreach ($zipFiles as $cfile) $zip->addFile($cfile, basename($cfile)); - } $zip->close(); } header("Content-Type: application/x-zip"); @@ -700,19 +592,16 @@ protected function act_downloadClipboard() die; } - protected function act_check4Update() - { - if ($this->config['denyUpdateCheck']) { + protected function act_check4Update() { + if ($this->config['denyUpdateCheck']) return json_encode(array('version' => false)); - } // Caching HTTP request for 6 hours if (isset($this->session['checkVersion']) && isset($this->session['checkVersionTime']) && ((time() - $this->session['checkVersionTime']) < 21600) - ) { + ) return json_encode(array('version' => $this->session['checkVersion'])); - } $protocol = "http"; $host = "kcfinder.sunhater.com"; @@ -729,8 +618,7 @@ protected function act_check4Update() preg_match($pattern, $ver) // HTTP extension - ) { - } elseif ( + ) {} elseif ( function_exists("http_get") && (false !== ($ver = @http_get($url))) && ( @@ -742,55 +630,48 @@ function_exists("http_get") && preg_match($pattern, $ver) // Curl extension - ) { - } elseif ( + ) {} elseif ( function_exists("curl_init") && - (false !== ($curl = @curl_init($url))) && - (@ob_start() || (@curl_close($curl) && false)) && - (@curl_exec($curl) || (@curl_close($curl) && false)) && - ((false !== ($ver = @ob_get_clean())) || (@curl_close($curl) && false)) && - (@curl_close($curl) || true) && + (false !== ( $curl = @curl_init($url) )) && + ( @ob_start() || (@curl_close($curl) && false)) && + ( @curl_exec($curl) || (@curl_close($curl) && false)) && + ((false !== ( $ver = @ob_get_clean() )) || (@curl_close($curl) && false)) && + ( @curl_close($curl) || true ) && preg_match($pattern, $ver) // Socket extension - ) { - } elseif (function_exists('socket_create')) { + ) {} elseif (function_exists('socket_create')) { $cmd = "GET $path " . strtoupper($protocol) . "/1.1\r\n" . "Host: $host\r\n" . "Connection: Close\r\n\r\n"; - if ((false !== ($socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) && - (false !== @socket_connect($socket, $host, $port)) && - (false !== @socket_write($socket, $cmd, strlen($cmd))) && - (false !== ($ver = @socket_read($socket, 2048))) && + if ((false !== ( $socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP) )) && + (false !== @socket_connect($socket, $host, $port) ) && + (false !== @socket_write($socket, $cmd, strlen($cmd)) ) && + (false !== ( $ver = @socket_read($socket, 2048) )) && preg_match($responsePattern, $ver, $match) - ) { + ) $ver = $match[2]; - } - if (isset($socket) && is_resource($socket)) { + if (isset($socket) && is_resource($socket)) @socket_close($socket); - } } if (isset($ver) && preg_match($pattern, $ver)) { $this->session['checkVersion'] = $ver; $this->session['checkVersionTime'] = time(); return json_encode(array('version' => $ver)); - } else { + } else return json_encode(array('version' => false)); - } } - protected function moveUploadFile($file, $dir) - { + protected function moveUploadFile($file, $dir) { $message = $this->checkUploadedFile($file); if ($message !== true) { - if (isset($file['tmp_name'])) { + if (isset($file['tmp_name'])) @unlink($file['tmp_name']); - } return "{$file['name']}: $message"; } @@ -803,13 +684,12 @@ protected function moveUploadFile($file, $dir) ) { @unlink($file['tmp_name']); return "{$file['name']}: " . $this->label("Cannot move uploaded file to target folder."); - } elseif (function_exists('chmod')) { + } elseif (function_exists('chmod')) chmod($target, $this->config['filePerms']); - } - $this->modx->invokeEvent('OnFileBrowserUpload', array( + $this->modx->invokeEvent('OnFileBrowserUpload',array( 'filepath'=>realpath($dir), - 'filename'=>str_replace("/", "", str_replace($dir, "", realpath($target))) + 'filename'=>str_replace("/","",str_replace($dir,"",realpath($target))) )); $this->makeThumb($target); @@ -817,95 +697,82 @@ protected function moveUploadFile($file, $dir) return "/" . basename($target); } - protected function sendDefaultThumb($file=null) - { + protected function sendDefaultThumb($file=null) { if ($file !== null) { $ext = file::getExtension($file); $thumb = "themes/{$this->config['theme']}/img/files/big/$ext.png"; } - if (!isset($thumb) || !file_exists($thumb)) { + if (!isset($thumb) || !file_exists($thumb)) $thumb = "themes/{$this->config['theme']}/img/files/big/..png"; - } header("Content-Type: image/png"); readfile($thumb); die; } - protected function getFiles($dir) - { - $thumbDir = "{$this->config['uploadDir']}/{$this->config['thumbsDir']}/$dir"; - $dir = "{$this->config['uploadDir']}/$dir"; - $return = array(); - $files = dir::content($dir, array('types' => "file")); - if ($files === false) { - return $return; - } - - foreach ($files as $file) { - $ext = file::getExtension($file); - $smallThumb = false; - if (in_array(strtolower($ext), array('png', 'jpg', 'gif', 'jpeg' ))) { - $size = @getimagesize($file); - if (is_array($size) && count($size)) { - $thumb_file = "$thumbDir/" . basename($file); - if (!is_file($thumb_file) || filemtime($file) > filemtime($thumb_file)) { - $this->makeThumb($file); - } - $smallThumb = - ($size[0] <= $this->config['thumbWidth']) && - ($size[1] <= $this->config['thumbHeight']) && - in_array($size[2], array(IMAGETYPE_GIF, IMAGETYPE_PNG, IMAGETYPE_JPEG)); - } - } - $stat = stat($file); - if ($stat === false) { - continue; - } - $name = basename($file); - $types = $this->config['types']; - $types = explode(' ', $types['images'] . ' ' . $types['image']); - if (substr($name, 0, 1) == '.' && !$this->config['showHiddenFiles']) { - continue; - } - if ($this->type == 'images' && !in_array(strtolower($ext), $types)) { - continue; - } - $bigIcon = file_exists("themes/{$this->config['theme']}/img/files/big/$ext.png"); - $smallIcon = file_exists("themes/{$this->config['theme']}/img/files/small/$ext.png"); - $thumb = file_exists("$thumbDir/$name"); - $return[] = array( - 'name' => stripcslashes($name), - 'size' => $stat['size'], - 'mtime' => $stat['mtime'], - 'date' => @strftime($this->dateTimeSmall, $stat['mtime']), - 'readable' => is_readable($file), - 'writable' => file::isWritable($file), - 'bigIcon' => $bigIcon, - 'smallIcon' => $smallIcon, - 'thumb' => $thumb, - 'smallThumb' => $smallThumb - ); - } - return $return; - } - - protected function getTree($dir, $index=0) - { + protected function getFiles($dir) { + $thumbDir = "{$this->config['uploadDir']}/{$this->config['thumbsDir']}/$dir"; + $dir = "{$this->config['uploadDir']}/$dir"; + $return = array(); + $files = dir::content($dir, array('types' => "file")); + if ($files === false) + return $return; + + foreach ($files as $file) { + $ext = file::getExtension($file); + $smallThumb = false; + if (in_array(strtolower($ext), array('png', 'jpg', 'gif', 'jpeg' )) ) { + $size = @getimagesize($file); + if (is_array($size) && count($size)) { + $thumb_file = "$thumbDir/" . basename($file); + if (!is_file($thumb_file) || filemtime($file) > filemtime($thumb_file)) + $this->makeThumb($file); + $smallThumb = + ($size[0] <= $this->config['thumbWidth']) && + ($size[1] <= $this->config['thumbHeight']) && + in_array($size[2], array(IMAGETYPE_GIF, IMAGETYPE_PNG, IMAGETYPE_JPEG)); + } + } + $stat = stat($file); + if ($stat === false) continue; + $name = basename($file); + $types = $this->config['types']; + $types = explode(' ',$types['images'].' '.$types['image']); + if (substr($name,0,1) == '.' && !$this->config['showHiddenFiles']) continue; + if ($this->type == 'images' && !in_array(strtolower($ext),$types)) continue; + $bigIcon = file_exists("themes/{$this->config['theme']}/img/files/big/$ext.png"); + $smallIcon = file_exists("themes/{$this->config['theme']}/img/files/small/$ext.png"); + $thumb = file_exists("$thumbDir/$name"); + $return[] = array( + 'name' => stripcslashes($name), + 'size' => $stat['size'], + 'mtime' => $stat['mtime'], + 'date' => @strftime($this->dateTimeSmall, $stat['mtime']), + 'readable' => is_readable($file), + 'writable' => file::isWritable($file), + 'bigIcon' => $bigIcon, + 'smallIcon' => $smallIcon, + 'thumb' => $thumb, + 'smallThumb' => $smallThumb + ); + } + return $return; + } + + protected function getTree($dir, $index=0) { $path = explode("/", $dir); $pdir = ""; - for ($i = 0; ($i <= $index && $i < count($path)); $i++) { + for ($i = 0; ($i <= $index && $i < count($path)); $i++) $pdir .= "/{$path[$i]}"; - } - if (strlen($pdir)) { + if (strlen($pdir)) $pdir = substr($pdir, 1); - } $fdir = "{$this->config['uploadDir']}/$pdir"; $dirs = $this->getDirs($fdir); if (is_array($dirs) && count($dirs) && ($index <= count($path) - 1)) { + foreach ($dirs as $i => $cdir) { if ($cdir['hasDirs'] && ( @@ -920,48 +787,38 @@ protected function getTree($dir, $index=0) } } } - } else { + } else return false; - } return $dirs; } - protected function postDir($existent=true) - { + protected function postDir($existent=true) { $dir = $this->typeDir; - if (isset($this->post['dir'])) { + if (isset($this->post['dir'])) $dir .= "/" . $this->post['dir']; - } - if ($existent && (!is_dir($dir) || !is_readable($dir))) { + if ($existent && (!is_dir($dir) || !is_readable($dir))) $this->errorMsg("Inexistant or inaccessible folder."); - } return $dir; } - protected function getDir($existent=true) - { + protected function getDir($existent=true) { $dir = $this->typeDir; - if (isset($this->get['dir'])) { + if (isset($this->get['dir'])) $dir .= "/" . $this->get['dir']; - } - if ($existent && (!is_dir($dir) || !is_readable($dir))) { + if ($existent && (!is_dir($dir) || !is_readable($dir))) $this->errorMsg("Inexistant or inaccessible folder."); - } return $dir; } - protected function getDirs($dir) - { + protected function getDirs($dir) { $dirs = dir::content($dir, array('types' => "dir")); $return = array(); if (is_array($dirs)) { $writable = dir::isWritable($dir); foreach ($dirs as $cdir) { $info = $this->getDirInfo($cdir); - if ($info === false) { - continue; - } + if ($info === false) continue; $info['removable'] = $writable && $info['writable']; $return[] = $info; } @@ -969,22 +826,17 @@ protected function getDirs($dir) return $return; } - protected function getDirInfo($dir, $removable=false) - { - if ((substr(basename($dir), 0, 1) == ".") || !is_dir($dir) || !is_readable($dir)) { + protected function getDirInfo($dir, $removable=false) { + if ((substr(basename($dir), 0, 1) == ".") || !is_dir($dir) || !is_readable($dir)) return false; - } $dirs = dir::content($dir, array('types' => "dir")); if (is_array($dirs)) { - foreach ($dirs as $key => $cdir) { - if (substr(basename($cdir), 0, 1) == ".") { + foreach ($dirs as $key => $cdir) + if (substr(basename($cdir), 0, 1) == ".") unset($dirs[$key]); - } - } $hasDirs = count($dirs) ? true : false; - } else { + } else $hasDirs = false; - } $writable = dir::isWritable($dir); $info = array( @@ -995,31 +847,24 @@ protected function getDirInfo($dir, $removable=false) 'hasDirs' => $hasDirs ); - if ($dir == "{$this->config['uploadDir']}/{$this->session['dir']}") { + if ($dir == "{$this->config['uploadDir']}/{$this->session['dir']}") $info['current'] = true; - } return $info; } - protected function output($data=null, $template=null) - { - if (!is_array($data)) { - $data = array(); - } - if ($template === null) { + protected function output($data=null, $template=null) { + if (!is_array($data)) $data = array(); + if ($template === null) $template = $this->action; - } if (file_exists("tpl/tpl_$template.php")) { ob_start(); $eval = "unset(\$data);unset(\$template);unset(\$eval);"; $_ = $data; - foreach (array_keys($data) as $key) { - if (preg_match('/^[a-z\d_]+$/i', $key)) { + foreach (array_keys($data) as $key) + if (preg_match('/^[a-z\d_]+$/i', $key)) $eval .= "\$$key=\$_['$key'];"; - } - } $eval .= "unset(\$_);require \"tpl/tpl_$template.php\";"; eval($eval); return ob_get_clean(); @@ -1028,14 +873,12 @@ protected function output($data=null, $template=null) return ""; } - protected function errorMsg($message, array $data=null) - { - if (in_array($this->action, array("thumb", "upload", "download", "downloadDir"))) { + protected function errorMsg($message, array $data=null) { + if (in_array($this->action, array("thumb", "upload", "download", "downloadDir"))) die($this->label($message, $data)); - } - if (($this->action === null) || ($this->action == "browser")) { + if (($this->action === null) || ($this->action == "browser")) $this->backMsg($message, $data); - } else { + else { $message = $this->label($message, $data); die(json_encode(array('error' => $message))); } diff --git a/manager/media/browser/mcpuk/core/types/type_img.php b/manager/media/browser/mcpuk/core/types/type_img.php index 15a7feda94..158e81b21a 100755 --- a/manager/media/browser/mcpuk/core/types/type_img.php +++ b/manager/media/browser/mcpuk/core/types/type_img.php @@ -12,18 +12,17 @@ * @link http://kcfinder.sunhater.com */ -class type_img -{ - public function checkFile($file, array $config) - { +class type_img { + + public function checkFile($file, array $config) { + $driver = isset($config['imageDriversPriority']) ? image::getDriver(explode(" ", $config['imageDriversPriority'])) : "gd"; $img = image::factory($driver, $file); - if ($img->initError) { + if ($img->initError) return "Unknown image format/encoding."; - } return true; } diff --git a/manager/media/browser/mcpuk/core/types/type_mime.php b/manager/media/browser/mcpuk/core/types/type_mime.php index b11f826ded..ec4a2eaa5c 100755 --- a/manager/media/browser/mcpuk/core/types/type_mime.php +++ b/manager/media/browser/mcpuk/core/types/type_mime.php @@ -12,24 +12,20 @@ * @link http://kcfinder.sunhater.com */ -class type_mime -{ - public function checkFile($file, array $config) - { - if (!class_exists("finfo")) { +class type_mime { + + public function checkFile($file, array $config) { + if (!class_exists("finfo")) return "Fileinfo PECL extension is missing."; - } - if (!isset($config['params'])) { + if (!isset($config['params'])) return "Undefined MIME types."; - } $finfo = strlen($config['mime_magic']) ? new finfo(FILEINFO_MIME, $config['mime_magic']) : new finfo(FILEINFO_MIME); - if (!$finfo) { + if (!$finfo) return "Opening fileinfo database failed."; - } $type = $finfo->file($file); $type = substr($type, 0, strrpos($type, ";")); @@ -37,12 +33,12 @@ public function checkFile($file, array $config) $mimes = $config['params']; if (substr($mimes, 0, 1) == "!") { $mimes = trim(substr($mimes, 1)); - return in_array($type, explode(" ", $mimes)) + return in_array($type , explode(" ", $mimes)) ? "You can't upload such files." : true; } - return !in_array($type, explode(" ", $mimes)) + return !in_array($type , explode(" ", $mimes)) ? "You can't upload such files." : true; } diff --git a/manager/media/browser/mcpuk/core/uploader.php b/manager/media/browser/mcpuk/core/uploader.php index 6e13c7b3e6..5db404e622 100755 --- a/manager/media/browser/mcpuk/core/uploader.php +++ b/manager/media/browser/mcpuk/core/uploader.php @@ -12,114 +12,109 @@ * @link http://kcfinder.sunhater.com */ -class uploader -{ +class uploader { /** Release version */ const VERSION = "2.54"; - /** Config session-overrided settings - * @var array */ +/** Config session-overrided settings + * @var array */ protected $config = array(); - /** Default image driver - * @var string */ +/** Default image driver + * @var string */ protected $imageDriver = "gd"; - /** Opener applocation properties - * $opener['name'] Got from $_GET['opener']; - * $opener['CKEditor']['funcNum'] CKEditor function number (got from $_GET) - * $opener['TinyMCE'] Boolean - * @var array */ +/** Opener applocation properties + * $opener['name'] Got from $_GET['opener']; + * $opener['CKEditor']['funcNum'] CKEditor function number (got from $_GET) + * $opener['TinyMCE'] Boolean + * @var array */ protected $opener = array(); - /** Got from $_GET['type'] or first one $config['types'] array key, if inexistant - * @var string */ +/** Got from $_GET['type'] or first one $config['types'] array key, if inexistant + * @var string */ protected $type; - /** Helper property. Local filesystem path to the Type Directory - * Equivalent: $config['uploadDir'] . "/" . $type - * @var string */ +/** Helper property. Local filesystem path to the Type Directory + * Equivalent: $config['uploadDir'] . "/" . $type + * @var string */ protected $typeDir; - /** Helper property. Web URL to the Type Directory - * Equivalent: $config['uploadURL'] . "/" . $type - * @var string */ +/** Helper property. Web URL to the Type Directory + * Equivalent: $config['uploadURL'] . "/" . $type + * @var string */ protected $typeURL; - /** Linked to $config['types'] - * @var array */ +/** Linked to $config['types'] + * @var array */ protected $types = array(); - /** Settings which can override default settings if exists as keys in $config['types'][$type] array - * @var array */ +/** Settings which can override default settings if exists as keys in $config['types'][$type] array + * @var array */ protected $typeSettings = array('disabled', 'theme', 'dirPerms', 'filePerms', 'denyZipDownload', 'maxImageWidth', 'maxImageHeight', 'thumbWidth', 'thumbHeight', 'jpegQuality', 'access', 'filenameChangeChars', 'dirnameChangeChars', 'denyExtensionRename', 'deniedExts', 'watermark'); - /** Got from language file - * @var string */ +/** Got from language file + * @var string */ protected $charset; - /** The language got from $_GET['lng'] or $_GET['lang'] or... Please see next property - * @var string */ +/** The language got from $_GET['lng'] or $_GET['lang'] or... Please see next property + * @var string */ protected $lang = 'en'; - /** Possible language $_GET keys - * @var array */ +/** Possible language $_GET keys + * @var array */ protected $langInputNames = array('lang', 'langCode', 'lng', 'language', 'lang_code'); - /** Uploaded file(s) info. Linked to first $_FILES element - * @var array */ +/** Uploaded file(s) info. Linked to first $_FILES element + * @var array */ protected $file; - /** Next three properties are got from the current language file - * @var string */ +/** Next three properties are got from the current language file + * @var string */ protected $dateTimeFull; // Currently not used protected $dateTimeMid; // Currently not used protected $dateTimeSmall; - /** Contain Specified language labels - * @var array */ +/** Contain Specified language labels + * @var array */ protected $labels = array(); - /** Contain unprocessed $_GET array. Please use this instead of $_GET - * @var array */ +/** Contain unprocessed $_GET array. Please use this instead of $_GET + * @var array */ protected $get; - /** Contain unprocessed $_POST array. Please use this instead of $_POST - * @var array */ +/** Contain unprocessed $_POST array. Please use this instead of $_POST + * @var array */ protected $post; - /** Contain unprocessed $_COOKIE array. Please use this instead of $_COOKIE - * @var array */ +/** Contain unprocessed $_COOKIE array. Please use this instead of $_COOKIE + * @var array */ protected $cookie; - /** Session array. Please use this property instead of $_SESSION - * @var array */ +/** Session array. Please use this property instead of $_SESSION + * @var array */ protected $session; - /** CMS integration attribute (got from $_GET['cms']) - * @var string */ +/** CMS integration attribute (got from $_GET['cms']) + * @var string */ protected $cms = ""; protected $modx = null; - /** Magic method which allows read-only access to protected or private class properties - * @param string $property - * @return mixed */ - public function __get($property) - { +/** Magic method which allows read-only access to protected or private class properties + * @param string $property + * @return mixed */ + public function __get($property) { return property_exists($this, $property) ? $this->$property : null; } - public function __construct($modx) - { + public function __construct($modx) { //MODX try { if ($modx instanceof DocumentParser) { $this->modx = $modx; - } else { - throw new Exception('MODX should be instance of DocumentParser'); - } + } else throw new Exception('MODX should be instance of DocumentParser'); } catch (Exception $e) { die($e->getMessage()); } @@ -134,33 +129,26 @@ public function __construct($modx) // SET CMS INTEGRATION ATTRIBUTE if (isset($this->get['cms']) && in_array($this->get['cms'], array("drupal")) - ) { + ) $this->cms = $this->get['cms']; - } - // LINKING UPLOADED FILE - if (count($_FILES)) { + // LINKING UPLOADED FILE + if (count($_FILES)) $this->file = &$_FILES[key($_FILES)]; - } // LOAD DEFAULT CONFIGURATION require "config.php"; // SETTING UP SESSION - if (isset($_CONFIG['_sessionLifetime'])) { + if (isset($_CONFIG['_sessionLifetime'])) ini_set('session.gc_maxlifetime', $_CONFIG['_sessionLifetime'] * 60); - } - if (isset($_CONFIG['_sessionDir'])) { + if (isset($_CONFIG['_sessionDir'])) ini_set('session.save_path', $_CONFIG['_sessionDir']); - } - if (isset($_CONFIG['_sessionDomain'])) { + if (isset($_CONFIG['_sessionDomain'])) ini_set('session.cookie_domain', $_CONFIG['_sessionDomain']); - } switch ($this->cms) { case "drupal": break; - default: if (!session_id()) { - session_start(); - } break; + default: if (!session_id()) session_start(); break; } // RELOAD DEFAULT CONFIGURATION @@ -171,38 +159,31 @@ public function __construct($modx) if (isset($_CONFIG['_sessionVar']) && is_array($_CONFIG['_sessionVar']) ) { - foreach ($_CONFIG['_sessionVar'] as $key => $val) { - if ((substr($key, 0, 1) != "_") && isset($_CONFIG[$key])) { + foreach ($_CONFIG['_sessionVar'] as $key => $val) + if ((substr($key, 0, 1) != "_") && isset($_CONFIG[$key])) $this->config[$key] = $val; - } - } - if (!isset($this->config['_sessionVar']['self'])) { + if (!isset($this->config['_sessionVar']['self'])) $this->config['_sessionVar']['self'] = array(); - } $this->session = &$this->config['_sessionVar']['self']; - } else { + } else $this->session = &$_SESSION; - } // IMAGE DRIVER INIT if (isset($this->config['imageDriversPriority'])) { $this->config['imageDriversPriority'] = text::clearWhitespaces($this->config['imageDriversPriority']); $driver = image::getDriver(explode(' ', $this->config['imageDriversPriority'])); - if ($driver !== false) { + if ($driver !== false) $this->imageDriver = $driver; - } } if ((!isset($driver) || ($driver === false)) && (image::getDriver(array($this->imageDriver)) === false) - ) { + ) die("Cannot find any of the supported PHP image extensions!"); - } // WATERMARK INIT - if (isset($this->config['watermark']) && is_string($this->config['watermark'])) { + if (isset($this->config['watermark']) && is_string($this->config['watermark'])) $this->config['watermark'] = array('file' => $this->config['watermark']); - } // GET TYPE DIRECTORY $this->types = &$this->config['types']; @@ -216,11 +197,9 @@ public function __construct($modx) // LOAD TYPE DIRECTORY SPECIFIC CONFIGURATION IF EXISTS if (is_array($this->types[$this->type])) { - foreach ($this->types[$this->type] as $key => $val) { - if (in_array($key, $this->typeSettings)) { + foreach ($this->types[$this->type] as $key => $val) + if (in_array($key, $this->typeSettings)) $this->config[$key] = $val; - } - } $this->types[$this->type] = isset($this->types[$this->type]['type']) ? $this->types[$this->type]['type'] : ""; } @@ -230,14 +209,12 @@ public function __construct($modx) $ip = '/^' . implode('\.', array($ip, $ip, $ip, $ip)) . '$/'; if (preg_match($ip, $_SERVER['HTTP_HOST']) || preg_match('/^[^\.]+$/', $_SERVER['HTTP_HOST']) - ) { + ) $this->config['cookieDomain'] = ""; - } elseif (!strlen($this->config['cookieDomain'])) { + elseif (!strlen($this->config['cookieDomain'])) $this->config['cookieDomain'] = $_SERVER['HTTP_HOST']; - } - if (!strlen($this->config['cookiePath'])) { + if (!strlen($this->config['cookiePath'])) $this->config['cookiePath'] = "/"; - } // UPLOAD FOLDER INIT @@ -251,8 +228,8 @@ public function __construct($modx) $this->config['uploadDir'] = strlen($this->config['uploadDir']) ? path::normalize($this->config['uploadDir']) : path::url2fullPath("/$path"); - $this->typeDir = "{$this->config['uploadDir']}/{$this->type}"; - $this->typeURL = "{$this->config['siteURL']}/{$this->config['uploadURL']}/{$this->type}"; + $this->typeDir = "{$this->config['uploadDir']}/{$this->type}"; + $this->typeURL = "{$this->config['siteURL']}/{$this->config['uploadURL']}/{$this->type}"; // SITE ROOT } elseif ($this->config['uploadURL'] == "/") { @@ -273,24 +250,21 @@ public function __construct($modx) $this->typeDir = "{$this->config['uploadDir']}/{$this->type}"; $this->typeURL = "{$this->config['uploadURL']}/{$this->type}"; } - if (!is_dir($this->config['uploadDir'])) { + if (!is_dir($this->config['uploadDir'])) @mkdir($this->config['uploadDir'], $this->config['dirPerms']); - } // HOST APPLICATIONS INIT - if (isset($this->get['CKEditorFuncNum'])) { + if (isset($this->get['CKEditorFuncNum'])) $this->opener['CKEditor']['funcNum'] = $this->get['CKEditorFuncNum']; - } if (isset($this->get['opener']) && (strtolower($this->get['opener']) == "tinymce") && isset($this->config['_tinyMCEPath']) && strlen($this->config['_tinyMCEPath']) - ) { + ) $this->opener['TinyMCE'] = true; - } // LOCALIZATION - foreach ($this->langInputNames as $key) { + foreach ($this->langInputNames as $key) if (isset($this->get[$key]) && preg_match('/^[a-z][a-z\._\-]*$/i', $this->get[$key]) && file_exists("lang/" . strtolower($this->get[$key]) . ".php") @@ -298,7 +272,6 @@ public function __construct($modx) $this->lang = $this->get[$key]; break; } - } $this->localize($this->lang); // CHECK & MAKE DEFAULT .htaccess @@ -307,40 +280,33 @@ public function __construct($modx) ) { $htaccess = "{$this->config['uploadDir']}/.htaccess"; if (!file_exists($htaccess)) { - if (!@file_put_contents($htaccess, $this->get_htaccess())) { + if (!@file_put_contents($htaccess, $this->get_htaccess())) $this->backMsg("Cannot write to upload folder. {$this->config['uploadDir']}"); - } } else { - if (false === ($data = @file_get_contents($htaccess))) { + if (false === ($data = @file_get_contents($htaccess))) $this->backMsg("Cannot read .htaccess"); - } - if (($data != $this->get_htaccess()) && !@file_put_contents($htaccess, $data)) { + if (($data != $this->get_htaccess()) && !@file_put_contents($htaccess, $data)) $this->backMsg("Incorrect .htaccess file. Cannot rewrite it!"); - } } } // CHECK & CREATE UPLOAD FOLDER if (!is_dir($this->typeDir)) { - if (!mkdir($this->typeDir, $this->config['dirPerms'])) { + if (!mkdir($this->typeDir, $this->config['dirPerms'])) $this->backMsg("Cannot create {dir} folder.", array('dir' => $this->type)); - } - } elseif (!is_readable($this->typeDir)) { + } elseif (!is_readable($this->typeDir)) $this->backMsg("Cannot read upload folder."); - } } - public function upload() - { + public function upload() { $config = &$this->config; $file = &$this->file; $url = $message = ""; if ($config['disabled'] || !$config['access']['files']['upload']) { - if (isset($file['tmp_name'])) { - @unlink($file['tmp_name']); - } + if (isset($file['tmp_name'])) @unlink($file['tmp_name']); $message = $this->label("You don't have permissions to upload files."); + } elseif (true === ($message = $this->checkUploadedFile())) { $message = ""; @@ -349,9 +315,9 @@ public function upload() (false !== ($gdir = $this->checkInputDir($this->get['dir']))) ) { $udir = path::normalize("$dir$gdir"); - if (substr($udir, 0, strlen($dir)) !== $dir) { + if (substr($udir, 0, strlen($dir)) !== $dir) $message = $this->label("Unknown error."); - } else { + else { $l = strlen($dir); $dir = "$udir/"; $udir = substr($udir, $l); @@ -359,9 +325,8 @@ public function upload() } if (!strlen($message)) { - if (!is_dir(path::normalize($dir))) { + if (!is_dir(path::normalize($dir))) @mkdir(path::normalize($dir), $this->config['dirPerms'], true); - } $filename = $this->normalizeFilename($file['name']); $target = file::getInexistantFilename($dir . $filename); @@ -369,25 +334,21 @@ public function upload() if (!@move_uploaded_file($file['tmp_name'], $target) && !@rename($file['tmp_name'], $target) && !@copy($file['tmp_name'], $target) - ) { + ) $message = $this->label("Cannot move uploaded file to target folder."); - } else { - if (function_exists('chmod')) { + else { + if (function_exists('chmod')) @chmod($target, $this->config['filePerms']); - } $this->makeThumb($target); $url = $this->typeURL; - if (isset($udir)) { - $url .= "/$udir"; - } + if (isset($udir)) $url .= "/$udir"; $url .= "/" . basename($target); if (preg_match('/^([a-z]+)\:\/\/([^\/^\:]+)(\:(\d+))?\/(.+)$/', $url, $patt)) { list($unused, $protocol, $domain, $unused, $port, $path) = $patt; $base = "$protocol://$domain" . (strlen($port) ? ":$port" : "") . "/"; $url = $base . path::urlPathEncode($path); - } else { + } else $url = path::urlPathEncode($url); - } } } } @@ -395,61 +356,54 @@ public function upload() if (strlen($message) && isset($this->file['tmp_name']) && file_exists($this->file['tmp_name']) - ) { + ) @unlink($this->file['tmp_name']); - } - if (strlen($message) && method_exists($this, 'errorMsg')) { + if (strlen($message) && method_exists($this, 'errorMsg')) $this->errorMsg($message); - } $this->callBack($url, $message); } - protected function getTransaliasSettings() - { - $modx = evolutionCMS(); - - // Cleaning uploaded filename? - $setting = $modx->db->select('count(*)', $modx->getFullTableName('system_settings'), 'setting_name="clean_uploaded_filename" AND setting_value=1'); - if ($modx->db->getValue($setting)>0) { - // Transalias plugin active? - $res = $modx->db->select('properties', $modx->getFullTableName('site_plugins'), 'name="TransAlias" AND disabled=0'); - if ($properties = $modx->db->getValue($res)) { - $properties = $modx->parseProperties($properties, 'TransAlias', 'plugin'); - } else { - $properties = null; - } - } else { - $properties = null; - } - return $properties; - } - - - protected function normalizeFilename($filename) - { - if ($this->getTransaliasSettings()) { - $format = strrchr($filename, "."); - $filename = str_replace($format, "", $filename); - $filename = $this->modx->stripAlias($filename) . $format; - } - return $filename; - } - - protected function normalizeDirname($dirname) - { + protected function getTransaliasSettings() { + $modx = evolutionCMS(); + + // Cleaning uploaded filename? + $setting = $modx->db->select('count(*)', $modx->getFullTableName('system_settings'), 'setting_name="clean_uploaded_filename" AND setting_value=1'); + if ($modx->db->getValue($setting)>0) { + // Transalias plugin active? + $res = $modx->db->select('properties', $modx->getFullTableName('site_plugins'), 'name="TransAlias" AND disabled=0'); + if ($properties = $modx->db->getValue($res)) { + $properties = $modx->parseProperties($properties, 'TransAlias', 'plugin'); + } else { + $properties = NULL; + } + } else { + $properties = NULL; + } + return $properties; + } + + + protected function normalizeFilename($filename) { + if ($this->getTransaliasSettings()) { + $format = strrchr($filename, "."); + $filename = str_replace($format, "", $filename); + $filename = $this->modx->stripAlias($filename).$format; + } + return $filename; + } + + protected function normalizeDirname($dirname) { return $this->modx->stripAlias($dirname); } - protected function checkUploadedFile(array $aFile=null) - { + protected function checkUploadedFile(array $aFile=null) { $config = &$this->config; $file = ($aFile === null) ? $this->file : $aFile; - if (!is_array($file) || !isset($file['name'])) { + if (!is_array($file) || !isset($file['name'])) return $this->label("Unknown error"); - } if (is_array($file['name'])) { foreach ($file['name'] as $i => $name) { @@ -458,9 +412,8 @@ protected function checkUploadedFile(array $aFile=null) 'tmp_name' => $file['tmp_name'][$i], 'error' => $file['error'][$i] )); - if ($return !== true) { + if ($return !== true) return "$name: $return"; - } } return true; } @@ -469,7 +422,7 @@ protected function checkUploadedFile(array $aFile=null) $typePatt = strtolower(text::clearWhitespaces($this->types[$this->type])); // CHECK FOR UPLOAD ERRORS - if ($file['error']) { + if ($file['error']) return ($file['error'] == UPLOAD_ERR_INI_SIZE) ? $this->label("The uploaded file exceeds {size} bytes.", @@ -487,17 +440,14 @@ protected function checkUploadedFile(array $aFile=null) $this->label("Failed to write file.") : $this->label("Unknown error.") ))))); - } // HIDDEN FILENAMES CHECK - elseif (substr($file['name'], 0, 1) == ".") { + elseif (substr($file['name'], 0, 1) == ".") return $this->label("File name shouldn't begins with '.'"); - } // EXTENSION CHECK - elseif (!$this->validateExtension($extension, $this->type)) { + elseif (!$this->validateExtension($extension, $this->type)) return $this->label("Denied file extension."); - } // SPECIAL DIRECTORY TYPES CHECK (e.g. *img) elseif (preg_match('/^\*([^ ]+)(.*)?$/s', $typePatt, $patt)) { @@ -507,84 +457,70 @@ protected function checkUploadedFile(array $aFile=null) $type = new $class(); $cfg = $config; $cfg['filename'] = $file['name']; - if (strlen($params)) { + if (strlen($params)) $cfg['params'] = trim($params); - } $response = $type->checkFile($file['tmp_name'], $cfg); - if ($response !== true) { + if ($response !== true) return $this->label($response); - } - } else { + } else return $this->label("Non-existing directory type."); - } } // IMAGE RESIZE $img = image::factory($this->imageDriver, $file['tmp_name']); - if (!$img->initError && !$this->imageResize($img, $file['tmp_name'])) { + if (!$img->initError && !$this->imageResize($img, $file['tmp_name'])) return $this->label("The image is too big and/or cannot be resized."); - } - // CHECK FOR MODX MAX FILE SIZE - $actualfilesize=filesize($file['tmp_name']); - if (isset($this->config['maxfilesize']) && $actualfilesize > $this->config['maxfilesize']) { - return $this->label("File is too big: " . $actualfilesize . " Bytes. (max " . $this->config['maxfilesize'] . " Bytes)"); - } + // CHECK FOR MODX MAX FILE SIZE + $actualfilesize=filesize($file['tmp_name']); + if (isset($this->config['maxfilesize']) && $actualfilesize > $this->config['maxfilesize']) + return $this->label("File is too big: ".$actualfilesize." Bytes. (max ".$this->config['maxfilesize']." Bytes)"); return true; } - protected function checkInputDir($dir, $inclType=true, $existing=true) - { + protected function checkInputDir($dir, $inclType=true, $existing=true) { $dir = path::normalize($dir); - if (substr($dir, 0, 1) == "/") { + if (substr($dir, 0, 1) == "/") $dir = substr($dir, 1); - } - if ((substr($dir, 0, 1) == ".") || (substr(basename($dir), 0, 1) == ".")) { + if ((substr($dir, 0, 1) == ".") || (substr(basename($dir), 0, 1) == ".")) return false; - } if ($inclType) { $first = explode("/", $dir); $first = $first[0]; - if ($first != $this->type) { + if ($first != $this->type) return false; - } $return = $this->removeTypeFromPath($dir); } else { $return = $dir; $dir = "{$this->type}/$dir"; } - if (!$existing) { + if (!$existing) return $return; - } $path = "{$this->config['uploadDir']}/$dir"; return (is_dir($path) && is_readable($path)) ? $return : false; } - protected function validateExtension($ext, $type) - { + protected function validateExtension($ext, $type) { $ext = trim(strtolower($ext)); - if (!isset($this->types[$type])) { + if (!isset($this->types[$type])) return false; - } $exts = strtolower(text::clearWhitespaces($this->config['deniedExts'])); if (strlen($exts)) { $exts = explode(" ", $exts); - if (in_array($ext, $exts)) { + if (in_array($ext, $exts)) return false; - } } $exts = trim($this->types[$type]); - if (!strlen($exts) || substr($exts, 0, 1) == "*") { + if (!strlen($exts) || substr($exts, 0, 1) == "*") return true; - } if (substr($exts, 0, 1) == "!") { $exts = explode(" ", trim(strtolower(substr($exts, 1)))); @@ -595,31 +531,26 @@ protected function validateExtension($ext, $type) return in_array($ext, $exts); } - protected function getTypeFromPath($path) - { + protected function getTypeFromPath($path) { return preg_match('/^([^\/]*)\/.*$/', $path, $patt) ? $patt[1] : $path; } - protected function removeTypeFromPath($path) - { + protected function removeTypeFromPath($path) { return preg_match('/^[^\/]*\/(.*)$/', $path, $patt) ? $patt[1] : ""; } - protected function imageResize($image, $file=null) - { + protected function imageResize($image, $file=null) { + if (!($image instanceof image)) { $img = image::factory($this->imageDriver, $image); - if ($img->initError) { - return false; - } + if ($img->initError) return false; $file = $image; - } elseif ($file === null) { + } elseif ($file === null) return false; - } else { + else $img = $image; - } $orientation = 1; if (function_exists("exif_read_data")) { @@ -641,18 +572,19 @@ protected function imageResize($image, $file=null) ) ) && ($orientation == 1) - ) { + ) return true; - } // PROPORTIONAL RESIZE if ((!$this->config['maxImageWidth'] || !$this->config['maxImageHeight'])) { + if ($this->config['maxImageWidth'] && ($this->config['maxImageWidth'] < $img->width) ) { $width = $this->config['maxImageWidth']; $height = $img->getPropHeight($width); + } elseif ( $this->config['maxImageHeight'] && ($this->config['maxImageHeight'] < $img->height) @@ -661,17 +593,15 @@ protected function imageResize($image, $file=null) $width = $img->getPropWidth($height); } - if (isset($width) && isset($height) && !$img->resize($width, $height)) { + if (isset($width) && isset($height) && !$img->resize($width, $height)) return false; - } - // RESIZE TO FIT + // RESIZE TO FIT } elseif ( $this->config['maxImageWidth'] && $this->config['maxImageHeight'] && !$img->resizeFit($this->config['maxImageWidth'], $this->config['maxImageHeight']) - ) { + ) return false; - } // AUTO FLIP AND ROTATE FROM EXIF if ((($orientation == 2) && !$img->flipHorizontal()) || @@ -681,15 +611,12 @@ protected function imageResize($image, $file=null) (($orientation == 6) && !$img->rotate(90)) || (($orientation == 7) && (!$img->flipHorizontal() || !$img->rotate(90))) || (($orientation == 8) && !$img->rotate(270)) - ) { + ) return false; - } - if (($orientation >= 2) && ($orientation <= 8) && ($this->imageDriver == "imagick")) { + if (($orientation >= 2) && ($orientation <= 8) && ($this->imageDriver == "imagick")) try { $img->image->setImageProperty('exif:Orientation', "1"); - } catch (Exception $e) { - } - } + } catch (Exception $e) {} // WATERMARK if (isset($this->config['watermark']['file']) && @@ -700,44 +627,41 @@ protected function imageResize($image, $file=null) $top = isset($this->config['watermark']['top']) ? $this->config['watermark']['top'] : false; $img->watermark($this->config['watermark']['file'], $left, $top); - } + } $options = array( 'file' => $file ); - $type = exif_imagetype($file); + $type = exif_imagetype( $file ); - switch ($type) { + switch ( $type ) { case IMAGETYPE_GIF: - return $img->output('gif', $options); + return $img->output( 'gif', $options ); case IMAGETYPE_PNG: - return $img->output('png', $options); + return $img->output( 'png', $options ); default: - return $img->output('jpeg', array_merge($options, array( 'quality' => $this->config['jpegQuality'] ))); + return $img->output( 'jpeg', array_merge( $options, array( 'quality' => $this->config['jpegQuality'] ) ) ); } + } - protected function makeThumb($file, $overwrite=true) - { + protected function makeThumb($file, $overwrite=true) { $img = image::factory($this->imageDriver, $file); // Drop files which are not images - if ($img->initError) { + if ($img->initError) return true; - } $thumb = substr($file, strlen($this->config['uploadDir'])); $thumb = $this->config['uploadDir'] . "/" . $this->config['thumbsDir'] . "/" . $thumb; $thumb = path::normalize($thumb); $thumbDir = dirname($thumb); - if (!is_dir($thumbDir) && !@mkdir($thumbDir, $this->config['dirPerms'], true)) { + if (!is_dir($thumbDir) && !@mkdir($thumbDir, $this->config['dirPerms'], true)) return false; - } - if (!$overwrite && is_file($thumb)) { + if (!$overwrite && is_file($thumb)) return true; - } // Images with smaller resolutions than thumbnails /*if (($img->width <= $this->config['thumbWidth']) && @@ -750,19 +674,18 @@ protected function makeThumb($file, $overwrite=true) // Resize image } else */ - if (!$img->resizeFit($this->config['thumbWidth'], $this->config['thumbHeight'])) { + if (!$img->resizeFit($this->config['thumbWidth'], $this->config['thumbHeight'])) return false; - } - if ($this->imageDriver == 'gd') { - $width = imagesx($img->image); - $height = imagesy($img->image); - $back = image::factory($this->imageDriver, array( $width, $height )); - $tile = image::factory($this->imageDriver, __DIR__ . '/../themes/' . $this->config['theme'] . '/img/bg_transparent.png'); + if ( $this->imageDriver == 'gd' ) { + $width = imagesx( $img->image ); + $height = imagesy( $img->image ); + $back = image::factory( $this->imageDriver, array( $width, $height ) ); + $tile = image::factory( $this->imageDriver, __DIR__ . '/../themes/' . $this->config['theme'] . '/img/bg_transparent.png' ); - imagesettile($back->image, $tile->image); - imagefilledrectangle($back->image, 0, 0, $width, $height, IMG_COLOR_TILED); - imagecopy($back->image, $img->image, 0, 0, 0, 0, $width, $height); + imagesettile( $back->image, $tile->image ); + imagefilledrectangle( $back->image, 0, 0, $width, $height, IMG_COLOR_TILED ); + imagecopy( $back->image, $img->image, 0, 0, 0, 0, $width, $height ); $img = $back; } @@ -774,8 +697,7 @@ protected function makeThumb($file, $overwrite=true) )); } - protected function localize($langCode) - { + protected function localize($langCode) { require "lang/{$langCode}.php"; setlocale(LC_ALL, $lang['_locale']); $this->charset = $lang['_charset']; @@ -790,36 +712,30 @@ protected function localize($langCode) $this->labels = $lang; } - protected function label($string, array $data=null) - { + protected function label($string, array $data=null) { $return = isset($this->labels[$string]) ? $this->labels[$string] : $string; - if (is_array($data)) { - foreach ($data as $key => $val) { + if (is_array($data)) + foreach ($data as $key => $val) $return = str_replace("{{$key}}", $val, $return); - } - } return $return; } - protected function backMsg($message, array $data=null) - { + protected function backMsg($message, array $data=null) { $message = $this->label($message, $data); - if (isset($this->file['tmp_name']) && file_exists($this->file['tmp_name'])) { + if (isset($this->file['tmp_name']) && file_exists($this->file['tmp_name'])) @unlink($this->file['tmp_name']); - } $this->callBack("", $message); die; } - protected function callBack($url, $message="") - { + protected function callBack($url, $message="") { $message = text::jsValue($message); $CKfuncNum = isset($this->opener['CKEditor']['funcNum']) ? $this->opener['CKEditor']['funcNum'] : 0; - if (!$CKfuncNum) { - $CKfuncNum = 0; - } - header("Content-Type: text/html; charset={$this->charset}"); ?> + if (!$CKfuncNum) $CKfuncNum = 0; + header("Content-Type: text/html; charset={$this->charset}"); + +?> php_value engine off diff --git a/manager/media/browser/mcpuk/css.php b/manager/media/browser/mcpuk/css.php index 6e441b0eee..225f918e48 100755 --- a/manager/media/browser/mcpuk/css.php +++ b/manager/media/browser/mcpuk/css.php @@ -14,9 +14,7 @@ require "core/autoload.php"; $mtime = @filemtime(__FILE__); -if ($mtime) { - httpCache::checkMTime($mtime); -} +if ($mtime) httpCache::checkMTime($mtime); $browser = new browser($modx); $config = $browser->config; ob_start(); @@ -256,4 +254,4 @@ } $mtime)) { + if (!isset($mtime) || ($fmtime > $mtime)) $mtime = $fmtime; - } } httpCache::checkMTime($mtime); header("Content-Type: text/javascript"); -foreach ($files as $file) { +foreach ($files as $file) require $file; -} diff --git a/manager/media/browser/mcpuk/js_localize.php b/manager/media/browser/mcpuk/js_localize.php index 5aff27a157..1fb386cd96 100755 --- a/manager/media/browser/mcpuk/js_localize.php +++ b/manager/media/browser/mcpuk/js_localize.php @@ -28,13 +28,9 @@ die; } $mtime = @filemtime($file); -if ($mtime) { - httpCache::checkMTime($mtime); -} +if ($mtime) httpCache::checkMTime($mtime); require $file; header("Content-Type: text/javascript; charset={$lang['_charset']}"); -foreach ($lang as $english => $native) { - if (substr($english, 0, 1) != "_") { +foreach ($lang as $english => $native) + if (substr($english, 0, 1) != "_") echo "browser.labels['" . text::jsValue($english) . "']=\"" . text::jsValue($native) . "\";"; - } -} diff --git a/manager/media/browser/mcpuk/lang/af.php b/manager/media/browser/mcpuk/lang/af.php index a5e5823887..1eccc0add2 100755 --- a/manager/media/browser/mcpuk/lang/af.php +++ b/manager/media/browser/mcpuk/lang/af.php @@ -241,3 +241,5 @@ "Select Thumbnails" => "Kies duimnaels", "Download files" => "Laai lêers af", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/bg.php b/manager/media/browser/mcpuk/lang/bg.php index ba72a1d852..c1a3ee387d 100755 --- a/manager/media/browser/mcpuk/lang/bg.php +++ b/manager/media/browser/mcpuk/lang/bg.php @@ -258,3 +258,5 @@ "Failed to upload {filename}!" => "Несполучливо качване на {filename}!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/ca.php b/manager/media/browser/mcpuk/lang/ca.php index bdc414fc74..9e9c6c2f56 100755 --- a/manager/media/browser/mcpuk/lang/ca.php +++ b/manager/media/browser/mcpuk/lang/ca.php @@ -124,3 +124,5 @@ "Uploading file {number} of {count}... {progress}" => "Carregant arxiu {number} de {count}... {progress}", "Failed to upload {filename}!" => "Error al carregar {filename}", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/cs.php b/manager/media/browser/mcpuk/lang/cs.php index 5167dfe041..8cd858cbe6 100755 --- a/manager/media/browser/mcpuk/lang/cs.php +++ b/manager/media/browser/mcpuk/lang/cs.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "Nahrávám soubor {number} z {count}... {progress}", "Failed to upload {filename}!" => "Nepodařilo se nahrát soubor {filename}!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/da.php b/manager/media/browser/mcpuk/lang/da.php index 843bde90a3..c9ad9e5c9b 100755 --- a/manager/media/browser/mcpuk/lang/da.php +++ b/manager/media/browser/mcpuk/lang/da.php @@ -12,7 +12,7 @@ '_dateTimeMid' => "%a %e %b %Y %H:%M", '_dateTimeSmall' => "%d/%m/%Y %H:%M", - "You don't have permissions to upload files." => + "You don't have permissions to upload files." => "Du har ikke tilladelser til at uploade filer.", "You don't have permissions to browse server." => @@ -238,3 +238,5 @@ "Select Thumbnails" => "V�lg Miniaturer", "Download files" => "Download filer", ); + +?> diff --git a/manager/media/browser/mcpuk/lang/de.php b/manager/media/browser/mcpuk/lang/de.php index 2b6952e298..7318de10a2 100755 --- a/manager/media/browser/mcpuk/lang/de.php +++ b/manager/media/browser/mcpuk/lang/de.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "Lade Datei {number} von {count} hinauf ... {progress}", "Failed to upload {filename}!" => "Upload von {filename} fehlgeschlagen!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/el.php b/manager/media/browser/mcpuk/lang/el.php index 375b48a1f8..c8eb9ab6ae 100755 --- a/manager/media/browser/mcpuk/lang/el.php +++ b/manager/media/browser/mcpuk/lang/el.php @@ -249,3 +249,5 @@ "Yes" => "Ναι", "No" => "Όχι", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/en.php b/manager/media/browser/mcpuk/lang/en.php index e6c1dedfb2..ba12dcf369 100755 --- a/manager/media/browser/mcpuk/lang/en.php +++ b/manager/media/browser/mcpuk/lang/en.php @@ -21,3 +21,5 @@ '_dateTimeMid' => "%a %b %e %Y %I:%M %p", '_dateTimeSmall' => "%m/%d/%Y %I:%M %p", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/es.php b/manager/media/browser/mcpuk/lang/es.php index 311c4a6cf4..a86f22efc3 100755 --- a/manager/media/browser/mcpuk/lang/es.php +++ b/manager/media/browser/mcpuk/lang/es.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "Cargando archivo {number} de {count}... {progress}", "Failed to upload {filename}!" => "¡No se pudo cargar el archivo {filename}!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/et.php b/manager/media/browser/mcpuk/lang/et.php index 59e450c9f1..3553b16b7e 100755 --- a/manager/media/browser/mcpuk/lang/et.php +++ b/manager/media/browser/mcpuk/lang/et.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "Laen üles faili {number} {count}-st... {progress}", "Failed to upload {filename}!" => "{filename} üleslaadimine ebaõnnestus!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/fa.php b/manager/media/browser/mcpuk/lang/fa.php index 6b39dddad5..09481e590b 100755 --- a/manager/media/browser/mcpuk/lang/fa.php +++ b/manager/media/browser/mcpuk/lang/fa.php @@ -263,3 +263,5 @@ "Failed to upload {filename}!" => "! {filename} خطا در ارسال" ); + +?> diff --git a/manager/media/browser/mcpuk/lang/fi.php b/manager/media/browser/mcpuk/lang/fi.php index 48907be9b7..ab17048a50 100755 --- a/manager/media/browser/mcpuk/lang/fi.php +++ b/manager/media/browser/mcpuk/lang/fi.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "Siirretään tiedostoa {number}/{count} ... {progress}", "Failed to upload {filename}!" => "Siirto epäonnistui {filename}!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/fr.php b/manager/media/browser/mcpuk/lang/fr.php index 56104ad5f8..ac33d22d14 100755 --- a/manager/media/browser/mcpuk/lang/fr.php +++ b/manager/media/browser/mcpuk/lang/fr.php @@ -124,3 +124,5 @@ "Uploading file {number} of {count}... {progress}" => "Envoi du fichier {number} sur {count}... {progress}", "Failed to upload {filename}!" => "Échec du téléchargement du fichier {filename} !", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/he.php b/manager/media/browser/mcpuk/lang/he.php index 7f680ac5b8..56b31a23d0 100755 --- a/manager/media/browser/mcpuk/lang/he.php +++ b/manager/media/browser/mcpuk/lang/he.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "מעלה קובץ {number} מתוך {count}... {progress}", "Failed to upload {filename}!" => "העלאת הקובץ נכשלה!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/hu.php b/manager/media/browser/mcpuk/lang/hu.php index e90afe939b..3539f4a5b4 100755 --- a/manager/media/browser/mcpuk/lang/hu.php +++ b/manager/media/browser/mcpuk/lang/hu.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "A(z) {number}. fájl feltöltése (összesen {count}) ... {progress}", "Failed to upload {filename}!" => "Nem sikerült feltölteni a '{filename}' fájlt.", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/id.php b/manager/media/browser/mcpuk/lang/id.php index cc54698900..2eebd4726d 100755 --- a/manager/media/browser/mcpuk/lang/id.php +++ b/manager/media/browser/mcpuk/lang/id.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "Mengunggah file {nomor} of {jumlah}... {progress)", "Failed to upload {filename}!" => "Gagal untuk mengunggah {nama file}", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/it.php b/manager/media/browser/mcpuk/lang/it.php index bb7bd2090d..557e5b9d02 100755 --- a/manager/media/browser/mcpuk/lang/it.php +++ b/manager/media/browser/mcpuk/lang/it.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "Caricmento del file {number} di {count}... {progress}", "Failed to upload {filename}!" => "Il caricamento del file {filename} è fallito ", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/ja.php b/manager/media/browser/mcpuk/lang/ja.php index 4ec58a2f88..19b7d79535 100755 --- a/manager/media/browser/mcpuk/lang/ja.php +++ b/manager/media/browser/mcpuk/lang/ja.php @@ -128,3 +128,5 @@ "Uploading file {number} of {count}... {progress}" => "ファイルをアップロード中({number}/{count})... {progress}", "Failed to upload {filename}!" => "{filename}のアップロードに失敗しました!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/lt.php b/manager/media/browser/mcpuk/lang/lt.php index 0a2cad029d..22174d27a4 100755 --- a/manager/media/browser/mcpuk/lang/lt.php +++ b/manager/media/browser/mcpuk/lang/lt.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "Įkeliamas {number} failas iš {count}... {progress}", "Failed to upload {filename}!" => "Nepavyko įkelti {filename}!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/nl.php b/manager/media/browser/mcpuk/lang/nl.php index de72b571b8..37d2f0854d 100755 --- a/manager/media/browser/mcpuk/lang/nl.php +++ b/manager/media/browser/mcpuk/lang/nl.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "Bestand {number} van de {count} aan het uploaden... {progress}", "Failed to upload {filename}!" => "Uploaden van {filename} mislukt!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/no.php b/manager/media/browser/mcpuk/lang/no.php index ae785334d6..80aaf6a6ee 100755 --- a/manager/media/browser/mcpuk/lang/no.php +++ b/manager/media/browser/mcpuk/lang/no.php @@ -238,3 +238,5 @@ "Select Thumbnails" => "Velg miniatyrbilde", "Download files" => "Last ned filer", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/pl.php b/manager/media/browser/mcpuk/lang/pl.php index ed6b70a346..413b5f92c6 100755 --- a/manager/media/browser/mcpuk/lang/pl.php +++ b/manager/media/browser/mcpuk/lang/pl.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "Wysyłanie pliku nr {number} spośród {count} ... {progress}", "Failed to upload {filename}!" => "Wysyłanie pliku {filename} nie powiodło się!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/pt-br.php b/manager/media/browser/mcpuk/lang/pt-br.php index 4ba0636816..8d6095353e 100755 --- a/manager/media/browser/mcpuk/lang/pt-br.php +++ b/manager/media/browser/mcpuk/lang/pt-br.php @@ -126,3 +126,5 @@ "Uploading file {number} of {count}... {progress}" => "Enviando arquivo {number} de {count}... {progress}", "Failed to upload {filename}!" => "Falha no envio do arquivo {filename}!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/pt.php b/manager/media/browser/mcpuk/lang/pt.php index 6b35ea926d..dfcd2dd677 100755 --- a/manager/media/browser/mcpuk/lang/pt.php +++ b/manager/media/browser/mcpuk/lang/pt.php @@ -239,3 +239,5 @@ "Select Thumbnails" => "Seleccionar miniaturas", "Download files" => "Sacar ficheiros", ); + +?> diff --git a/manager/media/browser/mcpuk/lang/ro.php b/manager/media/browser/mcpuk/lang/ro.php index 248b01263c..ecbe6ac2a0 100755 --- a/manager/media/browser/mcpuk/lang/ro.php +++ b/manager/media/browser/mcpuk/lang/ro.php @@ -122,3 +122,5 @@ "Uploading file {number} of {count}... {progress}" => "Încărcare fișier {number} din {count}... {progress}", "Failed to upload {filename}!" => "Încărcare {filename} eșuată!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/ru.php b/manager/media/browser/mcpuk/lang/ru.php index 59e4683aaf..13c6a55865 100755 --- a/manager/media/browser/mcpuk/lang/ru.php +++ b/manager/media/browser/mcpuk/lang/ru.php @@ -124,3 +124,5 @@ "Uploading file {number} of {count}... {progress}" => "Загрузка {number} файла из {count}... {progress}", "Failed to upload {filename}!" => "Неудачная попытка загрузки {filename}!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/sk.php b/manager/media/browser/mcpuk/lang/sk.php index 85fa04103f..330fb7fc35 100755 --- a/manager/media/browser/mcpuk/lang/sk.php +++ b/manager/media/browser/mcpuk/lang/sk.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "Nahrávam súbor {number} z {count}... {progress}", "Failed to upload {filename}!" => "Nepodarilo sa nahrať súbor {filename}!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/sv.php b/manager/media/browser/mcpuk/lang/sv.php index 7d82f9e1d9..7a5f806a0d 100755 --- a/manager/media/browser/mcpuk/lang/sv.php +++ b/manager/media/browser/mcpuk/lang/sv.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "Ladda upp fil {number} av {count} ... {progress}", "Failed to upload {filename}!" => "Uppladdning misslyckad {filename}!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/tr.php b/manager/media/browser/mcpuk/lang/tr.php index e228013a14..b36345d6a7 100755 --- a/manager/media/browser/mcpuk/lang/tr.php +++ b/manager/media/browser/mcpuk/lang/tr.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "{number} / {count} dosya yükleniyor... {progress}", "Failed to upload {filename}!" => "{filename} dosyası yüklenemedi!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/uk.php b/manager/media/browser/mcpuk/lang/uk.php index ea0c0a8242..5caa120c6e 100755 --- a/manager/media/browser/mcpuk/lang/uk.php +++ b/manager/media/browser/mcpuk/lang/uk.php @@ -1,8 +1,8 @@ "Завантаження файлу {number} з {count}... {progress}", "Failed to upload {filename}!" => "Помилка завантаження {filename}!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/vi.php b/manager/media/browser/mcpuk/lang/vi.php index 30fa3e8b62..0119121cf5 100755 --- a/manager/media/browser/mcpuk/lang/vi.php +++ b/manager/media/browser/mcpuk/lang/vi.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "Đang tải tập tin thứ {number} của {count}... {progress}", "Failed to upload {filename}!" => "Tải lên thất bại {filename}!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/zh-cn.php b/manager/media/browser/mcpuk/lang/zh-cn.php index 9aa0dc0c85..ac68e2ea13 100755 --- a/manager/media/browser/mcpuk/lang/zh-cn.php +++ b/manager/media/browser/mcpuk/lang/zh-cn.php @@ -126,3 +126,5 @@ "Uploading file {number} of {count}... {progress}" => "正在上传文件{number} / {count}... {progress}", "Failed to upload {filename}!" => "上传失败{filename}!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lib/class_fastImage.php b/manager/media/browser/mcpuk/lib/class_fastImage.php index 08cf2af557..ec12ef40cc 100755 --- a/manager/media/browser/mcpuk/lib/class_fastImage.php +++ b/manager/media/browser/mcpuk/lib/class_fastImage.php @@ -13,217 +13,227 @@ class fastImage { - private $strpos = 0; - private $str; - private $uri; - private $type; - private $handle; - - public function __construct($uri = null) - { - if ($uri) { - $this->load($uri); - } - } + private $strpos = 0; + private $str; + private $uri; + private $type; + private $handle; + public function __construct($uri = null) + { + if ($uri) $this->load($uri); + } - public function load($uri) - { - if ($this->handle) { - $this->close(); - } - - $this->uri = $uri; - $this->handle = fopen($uri, 'r'); - } - - - public function close() - { - if (is_resource($this->handle)) { - fclose($this->handle); - } - } - - - public function getSize() - { - $this->strpos = 0; - if ($this->getType()) { - return array_values($this->parseSize()); - } - - return false; - } - - - public function getType() - { - $this->strpos = 0; - - if (!$this->type) { - switch ($this->getChars(2)) { - case "BM": - return $this->type = 'bmp'; - case "GI": - return $this->type = 'gif'; - case chr(0xFF) . chr(0xd8): - return $this->type = 'jpeg'; - case chr(0x89) . 'P': - return $this->type = 'png'; - default: - return false; - } - } - - return $this->type; - } - - - private function parseSize() - { - $this->strpos = 0; - - switch ($this->type) { - case 'png': - return $this->parseSizeForPNG(); - case 'gif': - return $this->parseSizeForGIF(); - case 'bmp': - return $this->parseSizeForBMP(); - case 'jpeg': - return $this->parseSizeForJPEG(); - } - - return null; - } - - - private function parseSizeForPNG() - { - $chars = $this->getChars(25); - - return unpack("N*", substr($chars, 16, 8)); - } - - - private function parseSizeForGIF() - { - $chars = $this->getChars(11); - - return unpack("S*", substr($chars, 6, 4)); - } - - - private function parseSizeForBMP() - { - $chars = $this->getChars(29); - $chars = substr($chars, 14, 14); - $type = unpack('C', $chars); - - return (reset($type) == 40) ? unpack('L*', substr($chars, 4)) : unpack('L*', substr($chars, 4, 8)); - } + public function load($uri) + { + if ($this->handle) $this->close(); + + $this->uri = $uri; + $this->handle = fopen($uri, 'r'); + } + + + public function close() + { + if (is_resource($this->handle)) fclose($this->handle); + } - private function parseSizeForJPEG() - { - $state = null; - - while (true) { - switch ($state) { - default: - $this->getChars(2); - $state = 'started'; - break; - case 'started': - $b = $this->getByte(); - if ($b === false) { - return false; - } - - $state = $b == 0xFF ? 'sof' : 'started'; - break; - - case 'sof': - $b = $this->getByte(); - if (in_array($b, range(0xe0, 0xef))) { - $state = 'skipframe'; - } elseif (in_array($b, array_merge(range(0xC0, 0xC3), range(0xC5, 0xC7), range(0xC9, 0xCB), range(0xCD, 0xCF)))) { - $state = 'readsize'; - } elseif ($b == 0xFF) { - $state = 'sof'; - } else { - $state = 'skipframe'; - } - break; - - case 'skipframe': - $skip = $this->readInt($this->getChars(2)) - 2; - $state = 'doskip'; - break; - - case 'doskip': - $this->getChars($skip); - $state = 'started'; - break; - - case 'readsize': - $c = $this->getChars(7); - - return array($this->readInt(substr($c, 5, 2)), $this->readInt(substr($c, 3, 2))); - } - } - } - - - private function getChars($n) - { - $response = null; - - // do we need more data? - if ($this->strpos + $n -1 >= strlen($this->str)) { - $end = ($this->strpos + $n); - - while (strlen($this->str) < $end && $response !== false) { - // read more from the file handle - $need = $end - ftell($this->handle); - - if ($response = fread($this->handle, $need)) { - $this->str .= $response; - } else { - return false; - } - } - } - - $result = substr($this->str, $this->strpos, $n); - $this->strpos += $n; - - // we are dealing with bytes here, so force the encoding - return mb_convert_encoding($result, "8BIT"); - } - - - private function getByte() - { - $c = $this->getChars(1); - $b = unpack("C", $c); - - return reset($b); - } - - - private function readInt($str) - { - $size = unpack("C*", $str); - - return ($size[1] << 8) + $size[2]; - } - - - public function __destruct() - { - $this->close(); - } + public function getSize() + { + $this->strpos = 0; + if ($this->getType()) + { + return array_values($this->parseSize()); + } + + return false; + } + + + public function getType() + { + $this->strpos = 0; + + if (!$this->type) + { + switch ($this->getChars(2)) + { + case "BM": + return $this->type = 'bmp'; + case "GI": + return $this->type = 'gif'; + case chr(0xFF).chr(0xd8): + return $this->type = 'jpeg'; + case chr(0x89).'P': + return $this->type = 'png'; + default: + return false; + } + } + + return $this->type; + } + + + private function parseSize() + { + $this->strpos = 0; + + switch ($this->type) + { + case 'png': + return $this->parseSizeForPNG(); + case 'gif': + return $this->parseSizeForGIF(); + case 'bmp': + return $this->parseSizeForBMP(); + case 'jpeg': + return $this->parseSizeForJPEG(); + } + + return null; + } + + + private function parseSizeForPNG() + { + $chars = $this->getChars(25); + + return unpack("N*", substr($chars, 16, 8)); + } + + + private function parseSizeForGIF() + { + $chars = $this->getChars(11); + + return unpack("S*", substr($chars, 6, 4)); + } + + + private function parseSizeForBMP() + { + $chars = $this->getChars(29); + $chars = substr($chars, 14, 14); + $type = unpack('C', $chars); + + return (reset($type) == 40) ? unpack('L*', substr($chars, 4)) : unpack('L*', substr($chars, 4, 8)); + } + + + private function parseSizeForJPEG() + { + $state = null; + + while (true) + { + switch ($state) + { + default: + $this->getChars(2); + $state = 'started'; + break; + + case 'started': + $b = $this->getByte(); + if ($b === false) return false; + + $state = $b == 0xFF ? 'sof' : 'started'; + break; + + case 'sof': + $b = $this->getByte(); + if (in_array($b, range(0xe0, 0xef))) + { + $state = 'skipframe'; + } + elseif (in_array($b, array_merge(range(0xC0,0xC3), range(0xC5,0xC7), range(0xC9,0xCB), range(0xCD,0xCF)))) + { + $state = 'readsize'; + } + elseif ($b == 0xFF) + { + $state = 'sof'; + } + else + { + $state = 'skipframe'; + } + break; + + case 'skipframe': + $skip = $this->readInt($this->getChars(2)) - 2; + $state = 'doskip'; + break; + + case 'doskip': + $this->getChars($skip); + $state = 'started'; + break; + + case 'readsize': + $c = $this->getChars(7); + + return array($this->readInt(substr($c, 5, 2)), $this->readInt(substr($c, 3, 2))); + } + } + } + + + private function getChars($n) + { + $response = null; + + // do we need more data? + if ($this->strpos + $n -1 >= strlen($this->str)) + { + $end = ($this->strpos + $n); + + while (strlen($this->str) < $end && $response !== false) + { + // read more from the file handle + $need = $end - ftell($this->handle); + + if ($response = fread($this->handle, $need)) + { + $this->str .= $response; + } + else + { + return false; + } + } + } + + $result = substr($this->str, $this->strpos, $n); + $this->strpos += $n; + + // we are dealing with bytes here, so force the encoding + return mb_convert_encoding($result, "8BIT"); + } + + + private function getByte() + { + $c = $this->getChars(1); + $b = unpack("C", $c); + + return reset($b); + } + + + private function readInt($str) + { + $size = unpack("C*", $str); + + return ($size[1] << 8) + $size[2]; + } + + + public function __destruct() + { + $this->close(); + } } diff --git a/manager/media/browser/mcpuk/lib/class_gd.php b/manager/media/browser/mcpuk/lib/class_gd.php index 0b7df86033..c9ed6f04af 100755 --- a/manager/media/browser/mcpuk/lib/class_gd.php +++ b/manager/media/browser/mcpuk/lib/class_gd.php @@ -12,48 +12,50 @@ * @link http://kcfinder.sunhater.com */ -class gd -{ +class gd { /** GD resource * @var resource */ protected $image; - /** Image width - * @var integer */ + /** Image width + * @var integer */ protected $width; - /** Image height - * @var integer */ + /** Image height + * @var integer */ protected $height; - /** Init error - * @var bool */ + /** Init error + * @var bool */ public $init_error = false; - /** Last builded image type constant (IMAGETYPE_XXX) - * @var integer */ + /** Last builded image type constant (IMAGETYPE_XXX) + * @var integer */ public $type; - /** Returns an array. Element 0 - GD resource. Element 1 - width. Element 2 - height. - * Returns FALSE on failure. The only one parameter $image can be an instance of this class, - * a GD resource, an array(width, height) or path to image file. - * @param mixed $image - * @return array */ + /** Returns an array. Element 0 - GD resource. Element 1 - width. Element 2 - height. + * Returns FALSE on failure. The only one parameter $image can be an instance of this class, + * a GD resource, an array(width, height) or path to image file. + * @param mixed $image + * @return array */ + + protected function build_image($image) { - protected function build_image($image) - { if ($image instanceof gd) { $width = $image->get_width(); $height = $image->get_height(); $image = $image->get_image(); + } elseif (is_resource($image) && (get_resource_type($image) == "gd")) { $width = @imagesx($image); $height = @imagesy($image); + } elseif (is_array($image)) { list($key, $width) = each($image); list($key, $height) = each($image); $image = imagecreatetruecolor($width, $height); + } elseif (false !== (list($width, $height, $type) = @getimagesize($image))) { $image = ($type == IMAGETYPE_GIF) ? @imagecreatefromgif($image) : ( @@ -64,9 +66,8 @@ protected function build_image($image) ($type == IMAGETYPE_XBM) ? @imagecreatefromxbm($image) : false ))))); - if ($type == IMAGETYPE_PNG) { + if ($type == IMAGETYPE_PNG) imagealphablending($image, false); - } } $return = ( @@ -80,35 +81,32 @@ protected function build_image($image) ? array($image, $width, $height) : false; - if (($return !== false) && isset($type)) { + if (($return !== false) && isset($type)) $this->type = $type; - } return $return; } - /** Parameter $image can be: - * 1. An instance of this class (copy instance). - * 2. A GD resource. - * 3. An array with two elements. First - width, second - height. Create a blank image. - * 4. A filename string. Get image form file. - * The non-required parameter $bigger_size is the bigger dimension (width or height) the image - * will be resized to. The other dimension (height or width) will be calculated autamaticaly - * @param mixed $image - * @param integer $bigger_size - * @return gd */ - - public function __construct($image, $bigger_size=null) - { + /** Parameter $image can be: + * 1. An instance of this class (copy instance). + * 2. A GD resource. + * 3. An array with two elements. First - width, second - height. Create a blank image. + * 4. A filename string. Get image form file. + * The non-required parameter $bigger_size is the bigger dimension (width or height) the image + * will be resized to. The other dimension (height or width) will be calculated autamaticaly + * @param mixed $image + * @param integer $bigger_size + * @return gd */ + + public function __construct($image, $bigger_size=null) { $this->image = $this->width = $this->height = null; $image_details = $this->build_image($image); - if ($image_details !== false) { + if ($image_details !== false) list($this->image, $this->width, $this->height) = $image_details; - } else { + else $this->init_error = true; - } if (!is_null($this->image) && !is_null($bigger_size) && @@ -117,98 +115,85 @@ public function __construct($image, $bigger_size=null) $image = $this->image; list($width, $height) = $this->get_prop_size($bigger_size); $this->image = imagecreatetruecolor($width, $height); - imagealphablending($this->image, false); - imagesavealpha($this->image, true); + imagealphablending($this->image, false); + imagesavealpha($this->image, true); $this->width = $width; $this->height = $height; $this->imagecopyresampled($image); } } - /** Returns the GD resource - * @return resource */ + /** Returns the GD resource + * @return resource */ - public function get_image() - { + public function get_image() { return $this->image; } - /** Returns the image width - * @return integer */ + /** Returns the image width + * @return integer */ - public function get_width() - { + public function get_width() { return $this->width; } - /** Returns the image height - * @return integer */ + /** Returns the image height + * @return integer */ - public function get_height() - { + public function get_height() { return $this->height; } - /** Returns calculated proportional width from the given height - * @param integer $resized_height - * @return integer */ + /** Returns calculated proportional width from the given height + * @param integer $resized_height + * @return integer */ - public function get_prop_width($resized_height) - { + public function get_prop_width($resized_height) { $width = intval(($this->width * $resized_height) / $this->height); - if (!$width) { - $width = 1; - } + if (!$width) $width = 1; return $width; } - /** Returns calculated proportional height from the given width - * @param integer $resized_width - * @return integer */ + /** Returns calculated proportional height from the given width + * @param integer $resized_width + * @return integer */ - public function get_prop_height($resized_width) - { + public function get_prop_height($resized_width) { $height = intval(($this->height * $resized_width) / $this->width); - if (!$height) { - $height = 1; - } + if (!$height) $height = 1; return $height; } - /** Returns an array with calculated proportional width & height. - * The parameter $bigger_size is the bigger dimension (width or height) of calculated sizes. - * The other dimension (height or width) will be calculated autamaticaly - * @param integer $bigger_size - * @return array */ + /** Returns an array with calculated proportional width & height. + * The parameter $bigger_size is the bigger dimension (width or height) of calculated sizes. + * The other dimension (height or width) will be calculated autamaticaly + * @param integer $bigger_size + * @return array */ + + public function get_prop_size($bigger_size) { - public function get_prop_size($bigger_size) - { if ($this->width > $this->height) { $width = $bigger_size; $height = $this->get_prop_height($width); + } elseif ($this->height > $this->width) { $height = $bigger_size; $width = $this->get_prop_width($height); - } else { + + } else $width = $height = $bigger_size; - } return array($width, $height); } - /** Resize image. Returns TRUE on success or FALSE on failure - * @param integer $width - * @param integer $height - * @return bool */ + /** Resize image. Returns TRUE on success or FALSE on failure + * @param integer $width + * @param integer $height + * @return bool */ - public function resize($width, $height) - { - if (!$width) { - $width = 1; - } - if (!$height) { - $height = 1; - } + public function resize($width, $height) { + if (!$width) $width = 1; + if (!$height) $height = 1; return ( (false !== ($img = new gd(array($width, $height)))) && $img->imagecopyresampled($this) && @@ -218,13 +203,12 @@ public function resize($width, $height) ); } - /** Resize the given image source (GD, gd object or image file path) to fit in the own image. - * The outside ares will be cropped out. Returns TRUE on success or FALSE on failure - * @param mixed $src - * @return bool */ + /** Resize the given image source (GD, gd object or image file path) to fit in the own image. + * The outside ares will be cropped out. Returns TRUE on success or FALSE on failure + * @param mixed $src + * @return bool */ - public function resize_crop($src) - { + public function resize_crop($src) { $image_details = $this->build_image($src); if ($image_details !== false) { @@ -235,6 +219,7 @@ public function resize_crop($src) $src_h = $src_height; $src_x = intval(($src_width - $src_w) / 2); $src_y = 0; + } else { $src_w = $src_width; $src_h = $this->get_prop_height($src_width); @@ -243,44 +228,37 @@ public function resize_crop($src) } return imagecopyresampled($this->image, $src, 0, 0, $src_x, $src_y, $this->width, $this->height, $src_w, $src_h); - } else { + + } else return false; - } } - /** Resize image to fit in given resolution. Returns TRUE on success or FALSE on failure - * @param integer $width - * @param integer $height - * @return bool */ + /** Resize image to fit in given resolution. Returns TRUE on success or FALSE on failure + * @param integer $width + * @param integer $height + * @return bool */ - public function resize_fit($width, $height) - { - if ((!$width && !$height) || (($width == $this->width) && ($height == $this->height))) { + public function resize_fit($width, $height) { + if ((!$width && !$height) || (($width == $this->width) && ($height == $this->height))) return true; - } - if (!$width || (($height / $width) < ($this->height / $this->width))) { + if (!$width || (($height / $width) < ($this->height / $this->width))) $width = intval(($this->width * $height) / $this->height); - } elseif (!$height || (($width / $height) < ($this->width / $this->height))) { + elseif (!$height || (($width / $height) < ($this->width / $this->height))) $height = intval(($this->height * $width) / $this->width); - } - if (!$width) { - $width = 1; - } - if (!$height) { - $height = 1; - } + if (!$width) $width = 1; + if (!$height) $height = 1; return $this->resize($width, $height); } - /** Neka si predstavim vyobrazhaem pravoygylnik s razmeri $width i $height. - * Izobrazhenieto shte se preorazmeri taka che to shte izliza ot tozi pravoygylnik, - * no samo po edno (x ili y) izmerenie - * @param integer $width - * @param integer $height - * @return bool */ + /** Neka si predstavim vyobrazhaem pravoygylnik s razmeri $width i $height. + * Izobrazhenieto shte se preorazmeri taka che to shte izliza ot tozi pravoygylnik, + * no samo po edno (x ili y) izmerenie + * @param integer $width + * @param integer $height + * @return bool */ + + public function resize_overflow($width, $height) { - public function resize_overflow($width, $height) - { $big = (($this->width / $this->height) > ($width / $height)) ? ($this->width * $height) / $this->height : ($this->height * $width) / $this->width; @@ -297,8 +275,7 @@ public function resize_overflow($width, $height) return $return; } - public function gd_color() - { + public function gd_color() { $args = func_get_args(); $expr_rgb = '/^rgb\(\s*(\d{1,3})\s*\,\s*(\d{1,3})\s*\,\s*(\d{1,3})\s*\)$/i'; @@ -306,44 +283,46 @@ public function gd_color() $expr_hex2 = '/^\#?([0-9a-f])([0-9a-f])([0-9a-f])$/i'; $expr_byte = '/^([01]?\d?\d|2[0-4]\d|25[0-5])$/'; - if (!isset($args[0])) { + if (!isset($args[0])) return false; - } if (count($args[0]) == 3) { list($r, $g, $b) = $args[0]; + } elseif (preg_match($expr_rgb, $args[0])) { list($r, $g, $b) = explode(" ", preg_replace($expr_rgb, "$1 $2 $3", $args[0])); + } elseif (preg_match($expr_hex1, $args[0])) { list($r, $g, $b) = explode(" ", preg_replace($expr_hex1, "$1 $2 $3", $args[0])); $r = hexdec($r); $g = hexdec($g); $b = hexdec($b); + } elseif (preg_match($expr_hex2, $args[0])) { list($r, $g, $b) = explode(" ", preg_replace($expr_hex2, "$1$1 $2$2 $3$3", $args[0])); $r = hexdec($r); $g = hexdec($g); $b = hexdec($b); + } elseif ((count($args) == 3) && preg_match($expr_byte, $args[0]) && preg_match($expr_byte, $args[1]) && preg_match($expr_byte, $args[2]) ) { list($r, $g, $b) = $args; - } else { + + } else return false; - } return imagecolorallocate($this->image, $r, $g, $b); } - public function fill_color($color) - { + public function fill_color($color) { return $this->imagefilledrectangle(0, 0, $this->width - 1, $this->height - 1, $color); } - /* G D M E T H O D S */ +/* G D M E T H O D S */ public function imagecopy( $src, @@ -357,22 +336,14 @@ public function imagecopy( if ($image_details !== false) { list($src, $src_width, $src_height) = $image_details; - if (is_null($dst_w)) { - $dst_w = $this->width - $dst_x; - } - if (is_null($dst_h)) { - $dst_h = $this->height - $dst_y; - } - if (is_null($src_w)) { - $src_w = $src_width - $src_x; - } - if (is_null($src_h)) { - $src_h = $src_height - $src_y; - } + if (is_null($dst_w)) $dst_w = $this->width - $dst_x; + if (is_null($dst_h)) $dst_h = $this->height - $dst_y; + if (is_null($src_w)) $src_w = $src_width - $src_x; + if (is_null($src_h)) $src_h = $src_height - $src_y; return imagecopy($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h); - } else { + + } else return false; - } } public function imagecopyresampled( @@ -387,88 +358,68 @@ public function imagecopyresampled( if ($image_details !== false) { list($src, $src_width, $src_height) = $image_details; - if (is_null($dst_w)) { - $dst_w = $this->width - $dst_x; - } - if (is_null($dst_h)) { - $dst_h = $this->height - $dst_y; - } - if (is_null($src_w)) { - $src_w = $src_width - $src_x; - } - if (is_null($src_h)) { - $src_h = $src_height - $src_y; - } + if (is_null($dst_w)) $dst_w = $this->width - $dst_x; + if (is_null($dst_h)) $dst_h = $this->height - $dst_y; + if (is_null($src_w)) $src_w = $src_width - $src_x; + if (is_null($src_h)) $src_h = $src_height - $src_y; imagealphablending($this->image, false); - imagesavealpha($this->image, true); + imagesavealpha($this->image,true); - /*** gif transparent fix - 1.10.2013 ***/ + /*** gif transparent fix - 1.10.2013 ***/ - $transindex = imagecolortransparent($src); - $palletsize = imagecolorstotal($src); - if ($transindex >= 0 && $transindex < $palletsize) { - $transcol = imagecolorsforindex($src, $transindex); + $transindex = imagecolortransparent($src); + $palletsize = imagecolorstotal($src); + if($transindex >= 0 && $transindex < $palletsize) { + $transcol = imagecolorsforindex($src, $transindex); - /*** end gif transparent fix ***/ + /*** end gif transparent fix ***/ - $transindex = imagecolorallocatealpha($this->image, $transcol['red'], $transcol['green'], $transcol['blue'], 127); - imagefilledrectangle($this->image, 0, 0, $dst_w, $dst_h, $transindex); - imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); - imagecolortransparent($this->image, $transindex); - for ($y=0; $y<$dst_h; ++$y) { - for ($x=0; $x<$dst_w; ++$x) { - if (((imagecolorat($this->image, $x, $y)>>24) & 0x7F) >= 100) { - imagesetpixel($this->image, $x, $y, $transindex); - } - } - } - imagetruecolortopalette($this->image, true, 255); - } else { - $transparent = imagecolorallocatealpha($this->image, 255, 255, 255, 127); - imagefilledrectangle($this->image, 0, 0, $dst_w, $dst_h, $transparent); - imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); - } - return $this->image; - } else { + $transindex = imagecolorallocatealpha($this->image, $transcol['red'], $transcol['green'], $transcol['blue'], 127); + imagefilledrectangle($this->image, 0, 0, $dst_w, $dst_h, $transindex); + imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); + imagecolortransparent($this->image, $transindex); + for($y=0; $y<$dst_h; ++$y) + for($x=0; $x<$dst_w; ++$x) + if(((imagecolorat($this->image, $x, $y)>>24) & 0x7F) >= 100) imagesetpixel($this->image, $x, $y, $transindex); + imagetruecolortopalette($this->image, true, 255); + } + else { + $transparent = imagecolorallocatealpha($this->image, 255, 255, 255, 127); + imagefilledrectangle($this->image, 0, 0, $dst_w, $dst_h, $transparent); + imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); + } + return $this->image; + + } else return false; - } } - public function imagefilledrectangle($x1, $y1, $x2, $y2, $color) - { + public function imagefilledrectangle($x1, $y1, $x2, $y2, $color) { $color = $this->gd_color($color); - if ($color === false) { - return false; - } + if ($color === false) return false; return imagefilledrectangle($this->image, $x1, $y1, $x2, $y2, $color); } - public function imagepng($filename=null, $quality=null, $filters=null) - { - if (is_null($filename) && !headers_sent()) { + public function imagepng($filename=null, $quality=null, $filters=null) { + if (is_null($filename) && !headers_sent()) header("Content-Type: image/png"); - } @imagesavealpha($this->image, true); return imagepng($this->image, $filename, $quality, $filters); } - public function imagejpeg($filename=null, $quality=75) - { - if (is_null($filename) && !headers_sent()) { + public function imagejpeg($filename=null, $quality=75) { + if (is_null($filename) && !headers_sent()) header("Content-Type: image/jpeg"); - } return imagejpeg($this->image, $filename, $quality); } - public function imagegif($filename=null) - { - if (is_null($filename) && !headers_sent()) { + public function imagegif($filename=null) { + if (is_null($filename) && !headers_sent()) header("Content-Type: image/gif"); - } - @imagesavealpha($this->image, true); + @imagesavealpha($this->image, true); return imagegif($this->image, $filename); } } diff --git a/manager/media/browser/mcpuk/lib/class_image.php b/manager/media/browser/mcpuk/lib/class_image.php index 09985d7f27..79918a49b2 100755 --- a/manager/media/browser/mcpuk/lib/class_image.php +++ b/manager/media/browser/mcpuk/lib/class_image.php @@ -12,123 +12,114 @@ * @link http://kcfinder.sunhater.com */ -abstract class image -{ +abstract class image { const DEFAULT_JPEG_QUALITY = 75; - /** Image resource or object - * @var mixed */ +/** Image resource or object + * @var mixed */ protected $image; - /** Image width in pixels - * @var integer */ +/** Image width in pixels + * @var integer */ protected $width; - /** Image height in pixels - * @var integer */ +/** Image height in pixels + * @var integer */ protected $height; - /** Init error - * @var bool */ +/** Init error + * @var bool */ protected $initError = false; - /** Driver specific options - * @var array */ +/** Driver specific options + * @var array */ protected $options = array(); - /** Magic method which allows read-only access to all protected or private - * class properties - * @param string $property - * @return mixed */ +/** Magic method which allows read-only access to all protected or private + * class properties + * @param string $property + * @return mixed */ - final public function __get($property) - { + final public function __get($property) { return property_exists($this, $property) ? $this->$property : null; } - /** Constructor. Parameter $image should be: - * 1. An instance of image driver class (copy instance). - * 2. An image represented by the type of the $image property - * (resource or object). - * 3. An array with two elements. First - width, second - height. - * Creates a blank image. - * 4. A filename string. Get image form file. - * Second paramaeter is used by pass some specific image driver options - * @param mixed $image - * @param array $options */ +/** Constructor. Parameter $image should be: + * 1. An instance of image driver class (copy instance). + * 2. An image represented by the type of the $image property + * (resource or object). + * 3. An array with two elements. First - width, second - height. + * Creates a blank image. + * 4. A filename string. Get image form file. + * Second paramaeter is used by pass some specific image driver options + * @param mixed $image + * @param array $options */ - public function __construct($image, array $options=array()) - { + public function __construct($image, array $options=array()) { $this->image = $this->width = $this->height = null; $imageDetails = $this->buildImage($image); - if ($imageDetails !== false) { + if ($imageDetails !== false) list($this->image, $this->width, $this->height) = $imageDetails; - } else { + else $this->initError = true; - } $this->options = $options; } - /** Factory pattern to load selected driver. $image and $options are passed - * to the constructor of the image driver - * @param string $driver - * @param mixed $image - * @return object */ +/** Factory pattern to load selected driver. $image and $options are passed + * to the constructor of the image driver + * @param string $driver + * @param mixed $image + * @return object */ - final public static function factory($driver, $image, array $options=array()) - { + final static function factory($driver, $image, array $options=array()) { $class = "image_$driver"; return new $class($image, $options); } - /** Checks if the drivers in the array parameter could be used. Returns first - * found one - * @param array $drivers - * @return string */ +/** Checks if the drivers in the array parameter could be used. Returns first + * found one + * @param array $drivers + * @return string */ - final public static function getDriver(array $drivers=array('gd')) - { + final static function getDriver(array $drivers=array('gd')) { foreach ($drivers as $driver) { - if (!preg_match('/^[a-z0-9\_]+$/i', $driver)) { + if (!preg_match('/^[a-z0-9\_]+$/i', $driver)) continue; - } $class = "image_$driver"; if (class_exists($class) && method_exists($class, "available")) { eval("\$avail = $class::available();"); - if ($avail) { - return $driver; - } + if ($avail) return $driver; } } return false; } - /** Returns an array. Element 0 - image resource. Element 1 - width. Element 2 - height. - * Returns FALSE on failure. - * @param mixed $image - * @return array */ +/** Returns an array. Element 0 - image resource. Element 1 - width. Element 2 - height. + * Returns FALSE on failure. + * @param mixed $image + * @return array */ - final protected function buildImage($image) - { + final protected function buildImage($image) { $class = get_class($this); if ($image instanceof $class) { $width = $image->width; $height = $image->height; $img = $image->image; + } elseif (is_array($image)) { list($key, $width) = each($image); list($key, $height) = each($image); $img = $this->getBlankImage($width, $height); - } else { + + } else $img = $this->getImage($image, $width, $height); - } return ($img !== false) ? array($img, $width, $height) @@ -136,124 +127,113 @@ final protected function buildImage($image) } - /** Returns calculated proportional width from the given height - * @param integer $resizedHeight - * @return integer */ +/** Returns calculated proportional width from the given height + * @param integer $resizedHeight + * @return integer */ - final public function getPropWidth($resizedHeight) - { + final public function getPropWidth($resizedHeight) { $width = round(($this->width * $resizedHeight) / $this->height); - if (!$width) { - $width = 1; - } + if (!$width) $width = 1; return $width; } - /** Returns calculated proportional height from the given width - * @param integer $resizedWidth - * @return integer */ +/** Returns calculated proportional height from the given width + * @param integer $resizedWidth + * @return integer */ - final public function getPropHeight($resizedWidth) - { + final public function getPropHeight($resizedWidth) { $height = round(($this->height * $resizedWidth) / $this->width); - if (!$height) { - $height = 1; - } + if (!$height) $height = 1; return $height; } - /** Checks if PHP needs some extra extensions to use the image driver. This - * static method should be implemented into driver classes like abstract - * methods - * @return bool */ - public static function available() - { - return false; - } +/** Checks if PHP needs some extra extensions to use the image driver. This + * static method should be implemented into driver classes like abstract + * methods + * @return bool */ + static function available() { return false; } - /** Checks if file is an image. This static method should be implemented into - * driver classes like abstract methods - * @param string $file - * @return bool */ - public static function checkImage($file) - { - return false; - } +/** Checks if file is an image. This static method should be implemented into + * driver classes like abstract methods + * @param string $file + * @return bool */ + static function checkImage($file) { return false; } - /** Resize image. Should return TRUE on success or FALSE on failure - * @param integer $width - * @param integer $height - * @return bool */ +/** Resize image. Should return TRUE on success or FALSE on failure + * @param integer $width + * @param integer $height + * @return bool */ abstract public function resize($width, $height); - /** Resize image to fit in given resolution. Should returns TRUE on success - * or FALSE on failure. If $background is set, the image size will be - * $width x $height and the empty spaces (if any) will be filled with defined - * color. Background color examples: "#5f5", "#ff67ca", array(255, 255, 255) - * @param integer $width - * @param integer $height - * @param mixed $background - * @return bool */ +/** Resize image to fit in given resolution. Should returns TRUE on success + * or FALSE on failure. If $background is set, the image size will be + * $width x $height and the empty spaces (if any) will be filled with defined + * color. Background color examples: "#5f5", "#ff67ca", array(255, 255, 255) + * @param integer $width + * @param integer $height + * @param mixed $background + * @return bool */ abstract public function resizeFit($width, $height, $background=false); - /** Resize and crop the image to fit in given resolution. Returns TRUE on - * success or FALSE on failure - * @param mixed $src - * @param integer $offset - * @return bool */ +/** Resize and crop the image to fit in given resolution. Returns TRUE on + * success or FALSE on failure + * @param mixed $src + * @param integer $offset + * @return bool */ abstract public function resizeCrop($width, $height, $offset=false); - /** Rotate image - * @param integer $angle - * @param string $background - * @return bool */ +/** Rotate image + * @param integer $angle + * @param string $background + * @return bool */ abstract public function rotate($angle, $background="#000000"); abstract public function flipHorizontal(); abstract public function flipVertical(); - /** Apply a PNG or GIF watermark to the image. $top and $left parameters sets - * the offset of the watermark in pixels. Boolean and NULL values are possible - * too. In default case (FALSE, FALSE) the watermark should be applyed to - * the bottom right corner. NULL values means center aligning. If the - * watermark is bigger than the image or it's partialy or fully outside the - * image, it shoudn't be applied - * @param string $file - * @param mixed $top - * @param mixed $left - * @return bool */ +/** Apply a PNG or GIF watermark to the image. $top and $left parameters sets + * the offset of the watermark in pixels. Boolean and NULL values are possible + * too. In default case (FALSE, FALSE) the watermark should be applyed to + * the bottom right corner. NULL values means center aligning. If the + * watermark is bigger than the image or it's partialy or fully outside the + * image, it shoudn't be applied + * @param string $file + * @param mixed $top + * @param mixed $left + * @return bool */ abstract public function watermark($file, $left=false, $top=false); - /** Should output the image. Second parameter is used to pass some options like - * 'file' - if is set, the output will be written to a file - * 'quality' - compression quality - * It's possible to use extra specific options required by image type ($type) - * @param string $type - * @param array $options - * @return bool */ +/** Should output the image. Second parameter is used to pass some options like + * 'file' - if is set, the output will be written to a file + * 'quality' - compression quality + * It's possible to use extra specific options required by image type ($type) + * @param string $type + * @param array $options + * @return bool */ abstract public function output($type='jpeg', array $options=array()); - /** This method should create a blank image with selected size. Should returns - * resource or object related to the created image, which will be passed to - * $image property - * @param integer $width - * @param integer $height - * @return mixed */ +/** This method should create a blank image with selected size. Should returns + * resource or object related to the created image, which will be passed to + * $image property + * @param integer $width + * @param integer $height + * @return mixed */ abstract protected function getBlankImage($width, $height); - /** This method should create an image from source image. Only first parameter - * ($image) is input. Its type should be filename string or a type of the - * $image property. See the constructor reference for details. The - * parametters $width and $height are output only. Should returns resource or - * object related to the created image, which will be passed to $image - * property - * @param mixed $image - * @param integer $width - * @param integer $height - * @return mixed */ +/** This method should create an image from source image. Only first parameter + * ($image) is input. Its type should be filename string or a type of the + * $image property. See the constructor reference for details. The + * parametters $width and $height are output only. Should returns resource or + * object related to the created image, which will be passed to $image + * property + * @param mixed $image + * @param integer $width + * @param integer $height + * @return mixed */ abstract protected function getImage($image, &$width, &$height); + } diff --git a/manager/media/browser/mcpuk/lib/class_image_gd.php b/manager/media/browser/mcpuk/lib/class_image_gd.php index 55426518ea..c564ce8e43 100755 --- a/manager/media/browser/mcpuk/lib/class_image_gd.php +++ b/manager/media/browser/mcpuk/lib/class_image_gd.php @@ -12,20 +12,14 @@ * @link http://kcfinder.sunhater.com */ -class image_gd extends image -{ +class image_gd extends image { // ABSTRACT PUBLIC METHODS - public function resize($width, $height) - { - if (!$width) { - $width = 1; - } - if (!$height) { - $height = 1; - } + public function resize($width, $height) { + if (!$width) $width = 1; + if (!$height) $height = 1; return ( (false !== ($img = new image_gd(array($width, $height)))) && $img->imageCopyResampled($this) && @@ -35,11 +29,9 @@ public function resize($width, $height) ); } - public function resizeFit($width, $height, $background=false) - { - if ((!$width && !$height) || (($width == $this->width) && ($height == $this->height))) { + public function resizeFit($width, $height, $background=false) { + if ((!$width && !$height) || (($width == $this->width) && ($height == $this->height))) return true; - } if (!$width || (($height / $width) < ($this->height / $this->width))) { $h = $height; $w = round(($this->width * $h) / $this->height); @@ -50,16 +42,13 @@ public function resizeFit($width, $height, $background=false) $w = $width; $h = $height; } - if (!$w) { - $w = 1; - } - if (!$h) { - $h = 1; - } + if (!$w) $w = 1; + if (!$h) $h = 1; - if ($background === false) { + if ($background === false) return $this->resize($w, $h); - } else { + + else { $img = new image_gd(array($width, $height)); $x = round(($width - $w) / 2); $y = round(($height - $h) / 2); @@ -67,9 +56,8 @@ public function resizeFit($width, $height, $background=false) if ((false === $this->resize($w, $h)) || (false === $img->imageFilledRectangle(0, 0, $width, $height, $background)) || (false === $img->imageCopyResampled($this->image, $x, $y, 0, 0, $w, $h)) - ) { + ) return false; - } $this->image = $img->image; $this->width = $width; @@ -79,50 +67,41 @@ public function resizeFit($width, $height, $background=false) } } - public function resizeCrop($width, $height, $offset=false) - { + public function resizeCrop($width, $height, $offset=false) { + if (($this->width / $this->height) > ($width / $height)) { $h = $height; $w = ($this->width * $h) / $this->height; $y = 0; if ($offset !== false) { - if ($offset > 0) { + if ($offset > 0) $offset = -$offset; - } - if (($w + $offset) <= $width) { + if (($w + $offset) <= $width) $offset = $width - $w; - } $x = $offset; - } else { + } else $x = ($width - $w) / 2; - } + } else { $w = $width; $h = ($this->height * $w) / $this->width; $x = 0; if ($offset !== false) { - if ($offset > 0) { + if ($offset > 0) $offset = -$offset; - } - if (($h + $offset) <= $height) { + if (($h + $offset) <= $height) $offset = $height - $h; - } $y = $offset; - } else { + } else $y = ($height - $h) / 2; - } } $x = round($x); $y = round($y); $w = round($w); $h = round($h); - if (!$w) { - $w = 1; - } - if (!$h) { - $h = 1; - } + if (!$w) $w = 1; + if (!$h) $h = 1; $return = ( (false !== ($img = new image_gd(array($width, $height))))) && @@ -138,59 +117,50 @@ public function resizeCrop($width, $height, $offset=false) return $return; } - public function rotate($angle, $background="#000000") - { + public function rotate($angle, $background="#000000") { $angle = -$angle; $img = @imagerotate($this->image, $angle, $this->gdColor($background)); - if ($img === false) { + if ($img === false) return false; - } $this->width = imagesx($img); $this->height = imagesy($img); $this->image = $img; return true; } - public function flipHorizontal() - { + public function flipHorizontal() { $img = imagecreatetruecolor($this->width, $this->height); - imagealphablending($img, false); - imagesavealpha($img, true); - if (imagecopyresampled($img, $this->image, 0, 0, ($this->width - 1), 0, $this->width, $this->height, -$this->width, $this->height)) { + imagealphablending($img, false); + imagesavealpha($img, true); + if (imagecopyresampled($img, $this->image, 0, 0, ($this->width - 1), 0, $this->width, $this->height, -$this->width, $this->height)) $this->image = $img; - } else { + else return false; - } return true; } - public function flipVertical() - { + public function flipVertical() { $img = imagecreatetruecolor($this->width, $this->height); - imagealphablending($img, false); - imagesavealpha($img, true); - if (imagecopyresampled($img, $this->image, 0, 0, 0, ($this->height - 1), $this->width, $this->height, $this->width, -$this->height)) { + imagealphablending($img, false); + imagesavealpha($img, true); + if (imagecopyresampled($img, $this->image, 0, 0, 0, ($this->height - 1), $this->width, $this->height, $this->width, -$this->height)) $this->image = $img; - } else { + else return false; - } return true; } - public function watermark($file, $left=false, $top=false) - { + public function watermark($file, $left=false, $top=false) { $info = getimagesize($file); list($w, $h, $t) = $info; - if (!in_array($t, array(IMAGETYPE_PNG, IMAGETYPE_GIF))) { + if (!in_array($t, array(IMAGETYPE_PNG, IMAGETYPE_GIF))) return false; - } $imagecreate = ($t == IMAGETYPE_PNG) ? "imagecreatefrompng" : "imagecreatefromgif"; if (!@imagealphablending($this->image, true) || (false === ($wm = @$imagecreate($file))) - ) { + ) return false; - } $w = imagesx($wm); $h = imagesy($wm); @@ -206,33 +176,28 @@ public function watermark($file, $left=false, $top=false) if ((($x + $w) > $this->width) || (($y + $h) > $this->height) || ($x < 0) || ($y < 0) - ) { + ) return false; - } - if (($wm === false) || !@imagecopy($this->image, $wm, $x, $y, 0, 0, $w, $h)) { + if (($wm === false) || !@imagecopy($this->image, $wm, $x, $y, 0, 0, $w, $h)) return false; - } @imagealphablending($this->image, false); @imagesavealpha($this->image, true); return true; } - public function output($type='jpeg', array $options=array()) - { + public function output($type='jpeg', array $options=array()) { $method = "output_$type"; - if (!method_exists($this, $method)) { + if (!method_exists($this, $method)) return false; - } return $this->$method($options); } // ABSTRACT PROTECTED METHODS - protected function getBlankImage($width, $height) - { + protected function getBlankImage($width, $height) { $img = @imagecreatetruecolor($width, $height); // imagealphablending($img, false); // imagesavealpha($img, true); @@ -242,12 +207,13 @@ protected function getBlankImage($width, $height) return $img; } - protected function getImage($image, &$width, &$height) - { + protected function getImage($image, &$width, &$height) { + if (is_resource($image) && (get_resource_type($image) == "gd")) { $width = @imagesx($image); $height = @imagesy($image); return $image; + } elseif (is_string($image) && (false !== (list($width, $height, $t) = @getimagesize($image))) ) { @@ -260,26 +226,23 @@ protected function getImage($image, &$width, &$height) )))); return $image; - } else { + + } else return false; - } } // PSEUDO-ABSTRACT STATIC METHODS - public static function available() - { + static function available() { return function_exists("imagecreatefromjpeg"); } - public static function checkImage($file) - { + static function checkImage($file) { if (!is_string($file) || ((false === (list($width, $height, $t) = @getimagesize($file)))) - ) { + ) return false; - } $img = ($t == IMAGETYPE_GIF) ? @imagecreatefromgif($file) : ( @@ -295,41 +258,34 @@ public static function checkImage($file) // OWN METHODS - protected function output_png(array $options=array()) - { + protected function output_png(array $options=array()) { $file = isset($options['file']) ? $options['file'] : null; $quality = isset($options['quality']) ? $options['quality'] : null; $filters = isset($options['filters']) ? $options['filters'] : null; - if (($file === null) && !headers_sent()) { + if (($file === null) && !headers_sent()) header("Content-Type: image/png"); - } @imagesavealpha($this->image, true); return imagepng($this->image, $file, $quality, $filters); } - protected function output_jpeg(array $options=array()) - { + protected function output_jpeg(array $options=array()) { $file = isset($options['file']) ? $options['file'] : null; $quality = isset($options['quality']) ? $options['quality'] : self::DEFAULT_JPEG_QUALITY; - if (($file === null) && !headers_sent()) { + if (($file === null) && !headers_sent()) header("Content-Type: image/jpeg"); - } return imagejpeg($this->image, $file, $quality); } - protected function output_gif(array $options=array()) - { + protected function output_gif(array $options=array()) { $file = isset($options['file']) ? $options['file'] : null; - if (isset($options['file']) && !headers_sent()) { + if (isset($options['file']) && !headers_sent()) header("Content-Type: image/gif"); - } return imagegif($this->image, $file); } - protected function gdColor() - { + protected function gdColor() { $args = func_get_args(); $exprRGB = '/^rgb\(\s*(\d{1,3})\s*\,\s*(\d{1,3})\s*\,\s*(\d{1,3})\s*\)$/i'; @@ -337,43 +293,43 @@ protected function gdColor() $exprHex2 = '/^\#?([0-9a-f])([0-9a-f])([0-9a-f])$/i'; $exprByte = '/^([01]?\d?\d|2[0-4]\d|25[0-5])$/'; - if (!isset($args[0])) { + if (!isset($args[0])) return false; - } if (count($args[0]) == 3) { list($r, $g, $b) = $args[0]; + } elseif (preg_match($exprRGB, $args[0], $match)) { list($tmp, $r, $g, $b) = $match; + } elseif (preg_match($exprHex1, $args[0], $match)) { list($tmp, $r, $g, $b) = $match; $r = hexdec($r); $g = hexdec($g); $b = hexdec($b); + } elseif (preg_match($exprHex2, $args[0], $match)) { list($tmp, $r, $g, $b) = $match; $r = hexdec("$r$r"); $g = hexdec("$g$g"); $b = hexdec("$b$b"); + } elseif ((count($args) == 3) && preg_match($exprByte, $args[0]) && preg_match($exprByte, $args[1]) && preg_match($exprByte, $args[2]) ) { list($r, $g, $b) = $args; - } else { + + } else return false; - } return imagecolorallocate($this->image, $r, $g, $b); } - protected function imageFilledRectangle($x1, $y1, $x2, $y2, $color) - { + protected function imageFilledRectangle($x1, $y1, $x2, $y2, $color) { $color = $this->gdColor($color); - if ($color === false) { - return false; - } + if ($color === false) return false; return imageFilledRectangle($this->image, $x1, $y1, $x2, $y2, $color); } @@ -382,24 +338,15 @@ protected function imageCopyResampled( ) { $imageDetails = $this->buildImage($src); - if ($imageDetails === false) { + if ($imageDetails === false) return false; - } list($src, $srcWidth, $srcHeight) = $imageDetails; - if (is_null($dstW)) { - $dstW = $this->width - $dstW; - } - if (is_null($dstH)) { - $dstH = $this->height - $dstY; - } - if (is_null($srcW)) { - $srcW = $srcWidth - $srcX; - } - if (is_null($srcH)) { - $srcH = $srcHeight - $srcY; - } + if (is_null($dstW)) $dstW = $this->width - $dstW; + if (is_null($dstH)) $dstH = $this->height - $dstY; + if (is_null($srcW)) $srcW = $srcWidth - $srcX; + if (is_null($srcH)) $srcH = $srcHeight - $srcY; return imageCopyResampled($this->image, $src, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH); } } diff --git a/manager/media/browser/mcpuk/lib/class_image_gmagick.php b/manager/media/browser/mcpuk/lib/class_image_gmagick.php index c2cb3726f0..f67691f99b 100755 --- a/manager/media/browser/mcpuk/lib/class_image_gmagick.php +++ b/manager/media/browser/mcpuk/lib/class_image_gmagick.php @@ -12,23 +12,18 @@ * @link http://kcfinder.sunhater.com */ -class image_gmagick extends image -{ - public static $MIMES = array( +class image_gmagick extends image { + + static $MIMES = array( //'tif' => "image/tiff" ); // ABSTRACT PUBLIC METHODS - public function resize($width, $height) - {// - if (!$width) { - $width = 1; - } - if (!$height) { - $height = 1; - } + public function resize($width, $height) {// + if (!$width) $width = 1; + if (!$height) $height = 1; try { $this->image->scaleImage($width, $height); } catch (Exception $e) { @@ -39,14 +34,9 @@ public function resize($width, $height) return true; } - public function resizeFit($width, $height, $background=false) - {// - if (!$width) { - $width = 1; - } - if (!$height) { - $height = 1; - } + public function resizeFit($width, $height, $background=false) {// + if (!$width) $width = 1; + if (!$height) $height = 1; try { $this->image->scaleImage($width, $height, true); @@ -60,6 +50,7 @@ public function resizeFit($width, $height, $background=false) $this->width = $w; $this->height = $h; return true; + } else { try { $this->image->setImageBackgroundColor($background); @@ -78,57 +69,43 @@ public function resizeFit($width, $height, $background=false) } } - public function resizeCrop($width, $height, $offset=false) - { - if (!$width) { - $width = 1; - } - if (!$height) { - $height = 1; - } + public function resizeCrop($width, $height, $offset=false) { + if (!$width) $width = 1; + if (!$height) $height = 1; if (($this->width / $this->height) > ($width / $height)) { $h = $height; $w = ($this->width * $h) / $this->height; $y = 0; if ($offset !== false) { - if ($offset > 0) { + if ($offset > 0) $offset = -$offset; - } - if (($w + $offset) <= $width) { + if (($w + $offset) <= $width) $offset = $width - $w; - } $x = $offset; - } else { + } else $x = ($width - $w) / 2; - } + } else { $w = $width; $h = ($this->height * $w) / $this->width; $x = 0; if ($offset !== false) { - if ($offset > 0) { + if ($offset > 0) $offset = -$offset; - } - if (($h + $offset) <= $height) { + if (($h + $offset) <= $height) $offset = $height - $h; - } $y = $offset; - } else { + } else $y = ($height - $h) / 2; - } } $x = round($x); $y = round($y); $w = round($w); $h = round($h); - if (!$w) { - $w = 1; - } - if (!$h) { - $h = 1; - } + if (!$w) $w = 1; + if (!$h) $h = 1; try { $this->image->scaleImage($w, $h); @@ -142,8 +119,7 @@ public function resizeCrop($width, $height, $offset=false) return true; } - public function rotate($angle, $background="#000000") - { + public function rotate($angle, $background="#000000") { try { $this->image->rotateImage($background, $angle); $w = $this->image->getImageWidth(); @@ -156,8 +132,7 @@ public function rotate($angle, $background="#000000") return true; } - public function flipHorizontal() - { + public function flipHorizontal() { try { $this->image->flopImage(); } catch (Exception $e) { @@ -166,8 +141,7 @@ public function flipHorizontal() return true; } - public function flipVertical() - { + public function flipVertical() { try { $this->image->flipImage(); } catch (Exception $e) { @@ -176,8 +150,7 @@ public function flipVertical() return true; } - public function watermark($file, $left=false, $top=false) - { + public function watermark($file, $left=false, $top=false) { try { $wm = new Gmagick($file); $w = $wm->getImageWidth(); @@ -198,9 +171,8 @@ public function watermark($file, $left=false, $top=false) if ((($x + $w) > $this->width) || (($y + $h) > $this->height) || ($x < 0) || ($y < 0) - ) { + ) return false; - } try { $this->image->compositeImage($wm, 1, $x, $y); @@ -213,8 +185,7 @@ public function watermark($file, $left=false, $top=false) // ABSTRACT PROTECTED METHODS - protected function getBlankImage($width, $height) - { + protected function getBlankImage($width, $height) { try { $img = new Gmagick(); $img->newImage($width, $height, "none"); @@ -224,12 +195,13 @@ protected function getBlankImage($width, $height) return $img; } - protected function getImage($image, &$width, &$height) - { + protected function getImage($image, &$width, &$height) { + if (is_object($image) && ($image instanceof image_gmagick)) { $width = $image->width; $height = $image->height; return $image->image; + } elseif (is_object($image) && ($image instanceof Gmagick)) { try { $w = $image->getImageWidth(); @@ -240,6 +212,7 @@ protected function getImage($image, &$width, &$height) $width = $w; $height = $h; return $image; + } elseif (is_string($image)) { try { $image = new Gmagick($image); @@ -251,21 +224,19 @@ protected function getImage($image, &$width, &$height) $width = $w; $height = $h; return $image; - } else { + + } else return false; - } } // PSEUDO-ABSTRACT STATIC METHODS - public static function available() - { + static function available() { return class_exists("Gmagick"); } - public static function checkImage($file) - { + static function checkImage($file) { try { new Gmagick($file); } catch (Exception $e) { @@ -277,8 +248,7 @@ public static function checkImage($file) // INHERIT METHODS - public function output($type="jpeg", array $options=array()) - { + public function output($type="jpeg", array $options=array()) { $type = strtolower($type); try { $this->image->setImageFormat($type); @@ -286,9 +256,8 @@ public function output($type="jpeg", array $options=array()) return false; } $method = "optimize_$type"; - if (method_exists($this, $method) && !$this->$method($options)) { + if (method_exists($this, $method) && !$this->$method($options)) return false; - } if (!isset($options['file'])) { if (!headers_sent()) { @@ -296,6 +265,7 @@ public function output($type="jpeg", array $options=array()) header("Content-Type: $mime"); } echo $this->image; + } else { $file = $options['file'] . ".$type"; try { @@ -317,8 +287,7 @@ public function output($type="jpeg", array $options=array()) // OWN METHODS - protected function optimize_jpeg(array $options=array()) - { + protected function optimize_jpeg(array $options=array()) { $quality = isset($options['quality']) ? $options['quality'] : self::DEFAULT_JPEG_QUALITY; try { $this->image->setCompressionQuality($quality); @@ -327,4 +296,5 @@ protected function optimize_jpeg(array $options=array()) } return true; } + } diff --git a/manager/media/browser/mcpuk/lib/class_image_imagick.php b/manager/media/browser/mcpuk/lib/class_image_imagick.php index a64863f52c..0d576fa345 100755 --- a/manager/media/browser/mcpuk/lib/class_image_imagick.php +++ b/manager/media/browser/mcpuk/lib/class_image_imagick.php @@ -12,23 +12,18 @@ * @link http://kcfinder.sunhater.com */ -class image_imagick extends image -{ - public static $MIMES = array( +class image_imagick extends image { + + static $MIMES = array( //'tif' => "image/tiff" ); // ABSTRACT PUBLIC METHODS - public function resize($width, $height) - {// - if (!$width) { - $width = 1; - } - if (!$height) { - $height = 1; - } + public function resize($width, $height) {// + if (!$width) $width = 1; + if (!$height) $height = 1; try { $this->image->scaleImage($width, $height); } catch (Exception $e) { @@ -39,14 +34,9 @@ public function resize($width, $height) return true; } - public function resizeFit($width, $height, $background=false) - {// - if (!$width) { - $width = 1; - } - if (!$height) { - $height = 1; - } + public function resizeFit($width, $height, $background=false) {// + if (!$width) $width = 1; + if (!$height) $height = 1; try { $this->image->scaleImage($width, $height, true); @@ -59,6 +49,7 @@ public function resizeFit($width, $height, $background=false) $this->width = $size['width']; $this->height = $size['height']; return true; + } else { try { $this->image->setImageBackgroundColor($background); @@ -74,57 +65,43 @@ public function resizeFit($width, $height, $background=false) } } - public function resizeCrop($width, $height, $offset=false) - { - if (!$width) { - $width = 1; - } - if (!$height) { - $height = 1; - } + public function resizeCrop($width, $height, $offset=false) { + if (!$width) $width = 1; + if (!$height) $height = 1; if (($this->width / $this->height) > ($width / $height)) { $h = $height; $w = ($this->width * $h) / $this->height; $y = 0; if ($offset !== false) { - if ($offset > 0) { + if ($offset > 0) $offset = -$offset; - } - if (($w + $offset) <= $width) { + if (($w + $offset) <= $width) $offset = $width - $w; - } $x = $offset; - } else { + } else $x = ($width - $w) / 2; - } + } else { $w = $width; $h = ($this->height * $w) / $this->width; $x = 0; if ($offset !== false) { - if ($offset > 0) { + if ($offset > 0) $offset = -$offset; - } - if (($h + $offset) <= $height) { + if (($h + $offset) <= $height) $offset = $height - $h; - } $y = $offset; - } else { + } else $y = ($height - $h) / 2; - } } $x = round($x); $y = round($y); $w = round($w); $h = round($h); - if (!$w) { - $w = 1; - } - if (!$h) { - $h = 1; - } + if (!$w) $w = 1; + if (!$h) $h = 1; try { $this->image->scaleImage($w, $h); @@ -138,8 +115,7 @@ public function resizeCrop($width, $height, $offset=false) return true; } - public function rotate($angle, $background="#000000") - { + public function rotate($angle, $background="#000000") { try { $this->image->rotateImage(new ImagickPixel($background), $angle); $size = $this->image->getImageGeometry(); @@ -151,8 +127,7 @@ public function rotate($angle, $background="#000000") return true; } - public function flipHorizontal() - { + public function flipHorizontal() { try { $this->image->flopImage(); } catch (Exception $e) { @@ -161,8 +136,7 @@ public function flipHorizontal() return true; } - public function flipVertical() - { + public function flipVertical() { try { $this->image->flipImage(); } catch (Exception $e) { @@ -171,8 +145,7 @@ public function flipVertical() return true; } - public function watermark($file, $left=false, $top=false) - { + public function watermark($file, $left=false, $top=false) { try { $wm = new Imagick($file); $size = $wm->getImageGeometry(); @@ -194,9 +167,8 @@ public function watermark($file, $left=false, $top=false) if ((($x + $w) > $this->width) || (($y + $h) > $this->height) || ($x < 0) || ($y < 0) - ) { + ) return false; - } try { $this->image->compositeImage($wm, Imagick::COMPOSITE_DEFAULT, $x, $y); @@ -209,8 +181,7 @@ public function watermark($file, $left=false, $top=false) // ABSTRACT PROTECTED METHODS - protected function getBlankImage($width, $height) - { + protected function getBlankImage($width, $height) { try { $img = new Imagick(); $img->newImage($width, $height, "none"); @@ -221,8 +192,8 @@ protected function getBlankImage($width, $height) return $img; } - protected function getImage($image, &$width, &$height) - { + protected function getImage($image, &$width, &$height) { + if (is_object($image) && ($image instanceof image_imagick)) { try { $image->image->setImageCompressionQuality(100); @@ -232,6 +203,7 @@ protected function getImage($image, &$width, &$height) $width = $image->width; $height = $image->height; return $image->image; + } elseif (is_object($image) && ($image instanceof Imagick)) { try { $image->setImageCompressionQuality(100); @@ -242,6 +214,7 @@ protected function getImage($image, &$width, &$height) $width = $size['width']; $height = $size['height']; return $image; + } elseif (is_string($image)) { try { $image = new Imagick($image); @@ -253,21 +226,19 @@ protected function getImage($image, &$width, &$height) $width = $size['width']; $height = $size['height']; return $image; - } else { + + } else return false; - } } // PSEUDO-ABSTRACT STATIC METHODS - public static function available() - { + static function available() { return class_exists("Imagick"); } - public static function checkImage($file) - { + static function checkImage($file) { try { new Imagick($file); } catch (Exception $e) { @@ -279,8 +250,7 @@ public static function checkImage($file) // INHERIT METHODS - public function output($type="jpeg", array $options=array()) - { + public function output($type="jpeg", array $options=array()) { $type = strtolower($type); try { $this->image->setImageFormat($type); @@ -288,9 +258,8 @@ public function output($type="jpeg", array $options=array()) return false; } $method = "optimize_$type"; - if (method_exists($this, $method) && !$this->$method($options)) { + if (method_exists($this, $method) && !$this->$method($options)) return false; - } if (!isset($options['file'])) { if (!headers_sent()) { @@ -298,6 +267,7 @@ public function output($type="jpeg", array $options=array()) header("Content-Type: $mime"); } echo $this->image; + } else { $file = $options['file'] . ".$type"; try { @@ -319,8 +289,7 @@ public function output($type="jpeg", array $options=array()) // OWN METHODS - protected function optimize_jpeg(array $options=array()) - { + protected function optimize_jpeg(array $options=array()) { $quality = isset($options['quality']) ? $options['quality'] : self::DEFAULT_JPEG_QUALITY; try { $this->image->setImageCompression(Imagick::COMPRESSION_JPEG); @@ -330,4 +299,5 @@ protected function optimize_jpeg(array $options=array()) } return true; } + } diff --git a/manager/media/browser/mcpuk/lib/class_input.php b/manager/media/browser/mcpuk/lib/class_input.php index 84f20b0721..36917217ad 100755 --- a/manager/media/browser/mcpuk/lib/class_input.php +++ b/manager/media/browser/mcpuk/lib/class_input.php @@ -12,34 +12,31 @@ * @link http://kcfinder.sunhater.com */ -class input -{ +class input { /** Filtered $_GET array * @var array */ public $get; - /** Filtered $_POST array - * @var array */ + /** Filtered $_POST array + * @var array */ public $post; - /** Filtered $_COOKIE array - * @var array */ + /** Filtered $_COOKIE array + * @var array */ public $cookie; - public function __construct() - { + public function __construct() { $this->get = &$_GET; $this->post = &$_POST; $this->cookie = &$_COOKIE; } - /** Magic method to get non-public properties like public. - * @param string $property - * @return mixed */ + /** Magic method to get non-public properties like public. + * @param string $property + * @return mixed */ - public function __get($property) - { + public function __get($property) { return property_exists($this, $property) ? $this->$property : null; } } diff --git a/manager/media/browser/mcpuk/lib/class_zipFolder.php b/manager/media/browser/mcpuk/lib/class_zipFolder.php index 87f17f3b0a..a5d469f7ab 100755 --- a/manager/media/browser/mcpuk/lib/class_zipFolder.php +++ b/manager/media/browser/mcpuk/lib/class_zipFolder.php @@ -13,23 +13,20 @@ * @link http://kcfinder.sunhater.com */ -class zipFolder -{ +class zipFolder { protected $zip; protected $root; protected $ignored; - public function __construct($file, $folder, $ignored=null) - { + function __construct($file, $folder, $ignored=null) { $this->zip = new ZipArchive(); $this->ignored = is_array($ignored) ? $ignored : ($ignored ? array($ignored) : array()); - if ($this->zip->open($file, ZIPARCHIVE::CREATE) !== true) { + if ($this->zip->open($file, ZIPARCHIVE::CREATE) !== TRUE) throw new Exception("cannot open <$file>\n"); - } $folder = rtrim($folder, '/'); @@ -42,23 +39,20 @@ public function __construct($file, $folder, $ignored=null) $this->zip->close(); } - public function zip($folder, $parent=null) - { + function zip($folder, $parent=null) { $full_path = "{$this->root}$parent$folder"; $zip_path = "$parent$folder"; $this->zip->addEmptyDir($zip_path); $dir = new DirectoryIterator($full_path); - foreach ($dir as $file) { + foreach ($dir as $file) if (!$file->isDot()) { $filename = $file->getFilename(); if (!in_array($filename, $this->ignored)) { - if ($file->isDir()) { + if ($file->isDir()) $this->zip($filename, "$zip_path/"); - } else { + else $this->zip->addFile("$full_path/$filename", "$zip_path/$filename"); - } } } - } } } diff --git a/manager/media/browser/mcpuk/lib/helper_dir.php b/manager/media/browser/mcpuk/lib/helper_dir.php index 800535f990..2f61f2ebe8 100755 --- a/manager/media/browser/mcpuk/lib/helper_dir.php +++ b/manager/media/browser/mcpuk/lib/helper_dir.php @@ -12,52 +12,44 @@ * @link http://kcfinder.sunhater.com */ -class dir -{ +class dir { /** Checks if the given directory is really writable. The standard PHP * function is_writable() does not work properly on Windows servers * @param string $dir * @return bool */ - public static function isWritable($dir) - { + static function isWritable($dir) { $dir = path::normalize($dir); - if (!is_dir($dir)) { + if (!is_dir($dir)) return false; - } $i = 0; do { $file = "$dir/is_writable_" . md5($i++); } while (file_exists($file)); - if (!@touch($file)) { + if (!@touch($file)) return false; - } unlink($file); return true; } - /** Recursively delete the given directory. Returns TRUE on success. - * If $firstFailExit parameter is true (default), the method returns the - * path to the first failed file or directory which cannot be deleted. - * If $firstFailExit is false, the method returns an array with failed - * files and directories which cannot be deleted. The third parameter - * $failed is used for internal use only. - * @param string $dir - * @param bool $firstFailExit - * @param array $failed - * @return mixed */ - - public static function prune($dir, $firstFailExit=true, array $failed=null) - { - if ($failed === null) { - $failed = array(); - } + /** Recursively delete the given directory. Returns TRUE on success. + * If $firstFailExit parameter is true (default), the method returns the + * path to the first failed file or directory which cannot be deleted. + * If $firstFailExit is false, the method returns an array with failed + * files and directories which cannot be deleted. The third parameter + * $failed is used for internal use only. + * @param string $dir + * @param bool $firstFailExit + * @param array $failed + * @return mixed */ + + static function prune($dir, $firstFailExit=true, array $failed=null) { + if ($failed === null) $failed = array(); $files = self::content($dir); if ($files === false) { - if ($firstFailExit) { + if ($firstFailExit) return $dir; - } $failed[] = $dir; return $failed; } @@ -66,41 +58,37 @@ public static function prune($dir, $firstFailExit=true, array $failed=null) if (is_dir($file)) { $failed_in = self::prune($file, $firstFailExit, $failed); if ($failed_in !== true) { - if ($firstFailExit) { + if ($firstFailExit) return $failed_in; - } - if (is_array($failed_in)) { + if (is_array($failed_in)) $failed = array_merge($failed, $failed_in); - } else { + else $failed[] = $failed_in; - } } } elseif (!@unlink($file)) { - if ($firstFailExit) { + if ($firstFailExit) return $file; - } $failed[] = $file; } } if (!@rmdir($dir)) { - if ($firstFailExit) { + if ($firstFailExit) return $dir; - } $failed[] = $dir; } return count($failed) ? $failed : true; } - /** Get the content of the given directory. Returns an array with filenames - * or FALSE on failure - * @param string $dir - * @param array $options - * @return mixed */ + /** Get the content of the given directory. Returns an array with filenames + * or FALSE on failure + * @param string $dir + * @param array $options + * @return mixed */ + + static function content($dir, array $options=null) { - public static function content($dir, array $options=null) - { $defaultOptions = array( 'types' => "all", // Allowed: "all" or possible return values // of filetype(), or an array with them @@ -109,29 +97,23 @@ public static function content($dir, array $options=null) 'followLinks' => true ); - if (!is_dir($dir) || !is_readable($dir)) { + if (!is_dir($dir) || !is_readable($dir)) return false; - } - if (strtoupper(substr(PHP_OS, 0, 3)) == "WIN") { + if (strtoupper(substr(PHP_OS, 0, 3)) == "WIN") $dir = str_replace("\\", "/", $dir); - } $dir = rtrim($dir, "/"); $dh = @opendir($dir); - if ($dh === false) { + if ($dh === false) return false; - } - if ($options === null) { + if ($options === null) $options = $defaultOptions; - } - foreach ($defaultOptions as $key => $val) { - if (!isset($options[$key])) { + foreach ($defaultOptions as $key => $val) + if (!isset($options[$key])) $options[$key] = $val; - } - } $files = array(); while (($file = @readdir($dh)) !== false) { @@ -142,32 +124,28 @@ public static function content($dir, array $options=null) do { $ldir = dirname($lfile); $lfile = @readlink($lfile); - if (substr($lfile, 0, 1) != "/") { + if (substr($lfile, 0, 1) != "/") $lfile = "$ldir/$lfile"; - } $type = filetype($lfile); } while ($type == "link"); } if ((($type === "dir") && (($file == ".") || ($file == ".."))) || !preg_match($options['pattern'], $file) - ) { + ) continue; - } if (($options['types'] === "all") || ($type === $options['types']) || ((is_array($options['types'])) && in_array($type, $options['types'])) - ) { + ) $files[] = $options['addPath'] ? "$dir/$file" : $file; - } } closedir($dh); usort($files, array("dir", "fileSort")); return $files; } - public static function fileSort($a, $b) - { + static function fileSort($a, $b) { if (function_exists("mb_strtolower")) { $a = mb_strtolower($a); $b = mb_strtolower($b); @@ -175,9 +153,7 @@ public static function fileSort($a, $b) $a = strtolower($a); $b = strtolower($b); } - if ($a == $b) { - return 0; - } + if ($a == $b) return 0; return ($a < $b) ? -1 : 1; } } diff --git a/manager/media/browser/mcpuk/lib/helper_file.php b/manager/media/browser/mcpuk/lib/helper_file.php index 73ef8b5fb0..1f0200bcd7 100755 --- a/manager/media/browser/mcpuk/lib/helper_file.php +++ b/manager/media/browser/mcpuk/lib/helper_file.php @@ -12,9 +12,9 @@ * @link http://kcfinder.sunhater.com */ -class file -{ - public static $MIME = array( +class file { + + static $MIME = array( 'ai' => 'application/postscript', 'aif' => 'audio/x-aiff', 'aifc' => 'audio/x-aiff', @@ -100,45 +100,41 @@ class file 'zip' => 'application/x-zip' ); - /** Checks if the given file is really writable. The standard PHP function - * is_writable() does not work properly on Windows servers. - * @param string $dir - * @return bool */ + /** Checks if the given file is really writable. The standard PHP function + * is_writable() does not work properly on Windows servers. + * @param string $dir + * @return bool */ - public static function isWritable($filename) - { + static function isWritable($filename) { $filename = path::normalize($filename); - if (!is_file($filename) || (false === ($fp = @fopen($filename, 'a+')))) { + if (!is_file($filename) || (false === ($fp = @fopen($filename, 'a+')))) return false; - } fclose($fp); return true; } - /** Get the extension from filename - * @param string $file - * @param bool $toLower - * @return string */ + /** Get the extension from filename + * @param string $file + * @param bool $toLower + * @return string */ - public static function getExtension($filename, $toLower=true) - { + static function getExtension($filename, $toLower=true) { return preg_match('/^.*\.([^\.]*)$/s', $filename, $patt) ? ($toLower ? strtolower($patt[1]) : $patt[1]) : ""; } - /** Get MIME type of the given filename. If Fileinfo PHP extension is - * available the MIME type will be fetched by the file's content. The - * second parameter is optional and defines the magic file path. If you - * skip it, the default one will be loaded. - * If Fileinfo PHP extension is not available the MIME type will be fetched - * by filename extension regarding $MIME property. If the file extension - * does not exist there, returned type will be application/octet-stream - * @param string $filename - * @param string $magic - * @return string */ + /** Get MIME type of the given filename. If Fileinfo PHP extension is + * available the MIME type will be fetched by the file's content. The + * second parameter is optional and defines the magic file path. If you + * skip it, the default one will be loaded. + * If Fileinfo PHP extension is not available the MIME type will be fetched + * by filename extension regarding $MIME property. If the file extension + * does not exist there, returned type will be application/octet-stream + * @param string $filename + * @param string $magic + * @return string */ - public static function getMimeType($filename, $magic=null) - { + static function getMimeType($filename, $magic=null) { if (class_exists("finfo")) { $finfo = ($magic === null) ? new finfo(FILEINFO_MIME) @@ -153,36 +149,33 @@ public static function getMimeType($filename, $magic=null) return isset(self::$MIME[$ext]) ? self::$MIME[$ext] : "application/octet-stream"; } - /** Get inexistant filename based on the given filename. If you skip $dir - * parameter the directory will be fetched from $filename and returned - * value will be full filename path. The third parameter is optional and - * defines the template, the filename will be renamed to. Default template - * is {name}({sufix}){ext}. Examples: - * - * file::getInexistantFilename("/my/directory/myfile.txt"); - * If myfile.txt does not exist - returns the same path to the file - * otherwise returns "/my/directory/myfile(1).txt" - * - * file::getInexistantFilename("myfile.txt", "/my/directory"); - * returns "myfile.txt" or "myfile(1).txt" or "myfile(2).txt" etc... - * - * file::getInexistantFilename("myfile.txt", "/dir", "{name}[{sufix}]{ext}"); - * returns "myfile.txt" or "myfile[1].txt" or "myfile[2].txt" etc... - * - * @param string $filename - * @param string $dir - * @param string $tpl - * @return string */ + /** Get inexistant filename based on the given filename. If you skip $dir + * parameter the directory will be fetched from $filename and returned + * value will be full filename path. The third parameter is optional and + * defines the template, the filename will be renamed to. Default template + * is {name}({sufix}){ext}. Examples: + * + * file::getInexistantFilename("/my/directory/myfile.txt"); + * If myfile.txt does not exist - returns the same path to the file + * otherwise returns "/my/directory/myfile(1).txt" + * + * file::getInexistantFilename("myfile.txt", "/my/directory"); + * returns "myfile.txt" or "myfile(1).txt" or "myfile(2).txt" etc... + * + * file::getInexistantFilename("myfile.txt", "/dir", "{name}[{sufix}]{ext}"); + * returns "myfile.txt" or "myfile[1].txt" or "myfile[2].txt" etc... + * + * @param string $filename + * @param string $dir + * @param string $tpl + * @return string */ - public static function getInexistantFilename($filename, $dir=null, $tpl=null) - { - if ($tpl === null) { - $tpl = "{name}({sufix}){ext}"; - } + static function getInexistantFilename($filename, $dir=null, $tpl=null) { + if ($tpl === null) $tpl = "{name}({sufix}){ext}"; $fullPath = ($dir === null); - if ($fullPath) { + if ($fullPath) $dir = path::normalize(dirname($filename)); - } else { + else { $fdir = dirname($filename); $dir = strlen($fdir) ? path::normalize("$dir/$fdir") @@ -193,11 +186,9 @@ public static function getInexistantFilename($filename, $dir=null, $tpl=null) $name = strlen($ext) ? substr($filename, 0, -strlen($ext) - 1) : $filename; $tpl = str_replace('{name}', $name, $tpl); $tpl = str_replace('{ext}', (strlen($ext) ? ".$ext" : ""), $tpl); - $i = 1; - $file = "$dir/$filename"; - while (file_exists($file)) { + $i = 1; $file = "$dir/$filename"; + while (file_exists($file)) $file = "$dir/" . str_replace('{sufix}', $i++, $tpl); - } return $fullPath ? $file @@ -205,4 +196,5 @@ public static function getInexistantFilename($filename, $dir=null, $tpl=null) ? "$fdir/" . basename($file) : basename($file)); } + } diff --git a/manager/media/browser/mcpuk/lib/helper_httpCache.php b/manager/media/browser/mcpuk/lib/helper_httpCache.php index fcb864451a..2dd660c6d0 100755 --- a/manager/media/browser/mcpuk/lib/helper_httpCache.php +++ b/manager/media/browser/mcpuk/lib/helper_httpCache.php @@ -12,58 +12,45 @@ * @link http://kcfinder.sunhater.com */ -class httpCache -{ +class httpCache { const DEFAULT_TYPE = "text/html"; const DEFAULT_EXPIRE = 604800; // in seconds - /** Cache a file. The $type parameter might define the MIME type of the file - * or path to magic file to autodetect the MIME type. If you skip $type - * parameter the method will try with the default magic file. Autodetection - * of MIME type requires Fileinfo PHP extension used in file::getMimeType() - * @param string $file - * @param string $type - * @param integer $expire - * @param array $headers */ + /** Cache a file. The $type parameter might define the MIME type of the file + * or path to magic file to autodetect the MIME type. If you skip $type + * parameter the method will try with the default magic file. Autodetection + * of MIME type requires Fileinfo PHP extension used in file::getMimeType() + * @param string $file + * @param string $type + * @param integer $expire + * @param array $headers */ - public static function file($file, $type=null, $expire=null, array $headers=null) - { + static function file($file, $type=null, $expire=null, array $headers=null) { $mtime = @filemtime($file); - if ($mtime !== false) { - self::checkMTime($mtime); - } + if ($mtime !== false) self::checkMTime($mtime); if ($type === null) { $magic = ((substr($type, 0, 1) == "/") || preg_match('/^[a-z]\:/i', $type)) ? $type : null; $type = file::getMimeType($file, $magic); - if (!$type) { - $type = null; - } + if (!$type) $type = null; } self::content(@file_get_contents($file), $mtime, $type, $expire, $headers, false); } - /** Cache the given $content with $mtime modification time. - * @param binary $content - * @param integer $mtime - * @param string $type - * @param integer $expire - * @param array $headers - * @param bool $checkMTime */ + /** Cache the given $content with $mtime modification time. + * @param binary $content + * @param integer $mtime + * @param string $type + * @param integer $expire + * @param array $headers + * @param bool $checkMTime */ - public static function content($content, $mtime, $type=null, $expire=null, array $headers=null, $checkMTime=true) - { - if ($checkMTime) { - self::checkMTime($mtime); - } - if ($type === null) { - $type = self::DEFAULT_TYPE; - } - if ($expire === null) { - $expire = self::DEFAULT_EXPIRE; - } + static function content($content, $mtime, $type=null, $expire=null, array $headers=null, $checkMTime=true) { + if ($checkMTime) self::checkMTime($mtime); + if ($type === null) $type = self::DEFAULT_TYPE; + if ($expire === null) $expire = self::DEFAULT_EXPIRE; $size = strlen($content); $expires = gmdate("D, d M Y H:i:s", time() + $expire) . " GMT"; header("Content-Type: $type"); @@ -71,22 +58,17 @@ public static function content($content, $mtime, $type=null, $expire=null, array header("Cache-Control: max-age=$expire"); header("Pragma: !invalid"); header("Content-Length: $size"); - if ($headers !== null) { - foreach ($headers as $header) { - header($header); - } - } + if ($headers !== null) foreach ($headers as $header) header($header); echo $content; } - /** Check if given modification time is newer than client-side one. If not, - * the method will tell the client to get the content from its own cache. - * Afterwards the script process will be terminated. This feature requires - * the PHP to be configured as Apache module. - * @param integer $mtime */ + /** Check if given modification time is newer than client-side one. If not, + * the method will tell the client to get the content from its own cache. + * Afterwards the script process will be terminated. This feature requires + * the PHP to be configured as Apache module. + * @param integer $mtime */ - public static function checkMTime($mtime, $sendHeaders=null) - { + static function checkMTime($mtime, $sendHeaders=null) { header("Last-Modified: " . gmdate("D, d M Y H:i:s", $mtime) . " GMT"); $headers = function_exists("getallheaders") @@ -100,13 +82,11 @@ public static function checkMTime($mtime, $sendHeaders=null) $client_mtime = @strtotime($client_mtime[0]); if ($client_mtime >= $mtime) { header('HTTP/1.1 304 Not Modified'); - if (is_array($sendHeaders) && count($sendHeaders)) { - foreach ($sendHeaders as $header) { + if (is_array($sendHeaders) && count($sendHeaders)) + foreach ($sendHeaders as $header) header($header); - } - } elseif ($sendHeaders !== null) { + elseif ($sendHeaders !== null) header($sendHeaders); - } die; diff --git a/manager/media/browser/mcpuk/lib/helper_path.php b/manager/media/browser/mcpuk/lib/helper_path.php index 7e5078f5bd..04e9de087b 100755 --- a/manager/media/browser/mcpuk/lib/helper_path.php +++ b/manager/media/browser/mcpuk/lib/helper_path.php @@ -12,47 +12,39 @@ * @link http://kcfinder.sunhater.com */ -class path -{ +class path { /** Get the absolute URL path of the given one. Returns FALSE if the URL * is not valid or the current directory cannot be resolved (getcwd()) * @param string $path * @return string */ - public static function rel2abs_url($path) - { - if (substr($path, 0, 1) == "/") { - return $path; - } + static function rel2abs_url($path) { + if (substr($path, 0, 1) == "/") return $path; $dir = @getcwd(); - if (!isset($_SERVER['DOCUMENT_ROOT']) || ($dir === false)) { + if (!isset($_SERVER['DOCUMENT_ROOT']) || ($dir === false)) return false; - } $dir = self::normalize($dir); $doc_root = self::normalize($_SERVER['DOCUMENT_ROOT']); - if (substr($dir, 0, strlen($doc_root)) != $doc_root) { + if (substr($dir, 0, strlen($doc_root)) != $doc_root) return false; - } $return = self::normalize(substr($dir, strlen($doc_root)) . "/$path"); - if (substr($return, 0, 1) !== "/") { + if (substr($return, 0, 1) !== "/") $return = "/$return"; - } return $return; } - /** Resolve full filesystem path of given URL. Returns FALSE if the URL - * cannot be resolved - * @param string $url - * @return string */ + /** Resolve full filesystem path of given URL. Returns FALSE if the URL + * cannot be resolved + * @param string $url + * @return string */ - public static function url2fullPath($url) - { + static function url2fullPath($url) { $url = self::normalize($url); $uri = isset($_SERVER['SCRIPT_NAME']) @@ -63,18 +55,15 @@ public static function url2fullPath($url) $uri = self::normalize($uri); if (substr($url, 0, 1) !== "/") { - if ($uri === false) { - return false; - } + if ($uri === false) return false; $url = dirname($uri) . "/$url"; } if (isset($_SERVER['DOCUMENT_ROOT'])) { return self::normalize($_SERVER['DOCUMENT_ROOT'] . "/$url"); + } else { - if ($uri === false) { - return false; - } + if ($uri === false) return false; if (isset($_SERVER['SCRIPT_FILENAME'])) { $scr_filename = self::normalize($_SERVER['SCRIPT_FILENAME']); @@ -82,84 +71,71 @@ public static function url2fullPath($url) } $count = count(explode('/', $uri)) - 1; - for ($i = 0, $chdir = ""; $i < $count; $i++) { + for ($i = 0, $chdir = ""; $i < $count; $i++) $chdir .= "../"; - } $chdir = self::normalize($chdir); $dir = getcwd(); - if (($dir === false) || !@chdir($chdir)) { + if (($dir === false) || !@chdir($chdir)) return false; - } $rdir = getcwd(); chdir($dir); return ($rdir !== false) ? self::normalize($rdir . "/$url") : false; } } - /** Normalize the given path. On Windows servers backslash will be replaced - * with slash. Remobes unnecessary doble slashes and double dots. Removes - * last slash if it exists. Examples: - * path::normalize("C:\\any\\path\\") returns "C:/any/path" - * path::normalize("/your/path/..//home/") returns "/your/home" - * @param string $path - * @return string */ + /** Normalize the given path. On Windows servers backslash will be replaced + * with slash. Remobes unnecessary doble slashes and double dots. Removes + * last slash if it exists. Examples: + * path::normalize("C:\\any\\path\\") returns "C:/any/path" + * path::normalize("/your/path/..//home/") returns "/your/home" + * @param string $path + * @return string */ - public static function normalize($path) - { + static function normalize($path) { if (strtoupper(substr(PHP_OS, 0, 3)) == "WIN") { $path = preg_replace('/([^\\\])\\\([^\\\])/', "$1/$2", $path); - if (substr($path, -1) == "\\") { - $path = substr($path, 0, -1); - } - if (substr($path, 0, 1) == "\\") { - $path = "/" . substr($path, 1); - } + if (substr($path, -1) == "\\") $path = substr($path, 0, -1); + if (substr($path, 0, 1) == "\\") $path = "/" . substr($path, 1); } $path = preg_replace('/\/+/s', "/", $path); $path = "/$path"; - if (substr($path, -1) != "/") { + if (substr($path, -1) != "/") $path .= "/"; - } $expr = '/\/([^\/]{1}|[^\.\/]{2}|[^\/]{3,})\/\.\.\//s'; - while (preg_match($expr, $path)) { + while (preg_match($expr, $path)) $path = preg_replace($expr, "/", $path); - } $path = substr($path, 0, -1); $path = substr($path, 1); return $path; } - /** Encode URL Path - * @param string $path - * @return string */ + /** Encode URL Path + * @param string $path + * @return string */ - public static function urlPathEncode($path) - { + static function urlPathEncode($path) { $path = self::normalize($path); $encoded = ""; - foreach (explode("/", $path) as $dir) { + foreach (explode("/", $path) as $dir) $encoded .= rawurlencode($dir) . "/"; - } $encoded = substr($encoded, 0, -1); return $encoded; } - /** Decode URL Path - * @param string $path - * @return string */ + /** Decode URL Path + * @param string $path + * @return string */ - public static function urlPathDecode($path) - { + static function urlPathDecode($path) { $path = self::normalize($path); $decoded = ""; - foreach (explode("/", $path) as $dir) { + foreach (explode("/", $path) as $dir) $decoded .= rawurldecode($dir) . "/"; - } $decoded = substr($decoded, 0, -1); return $decoded; } diff --git a/manager/media/browser/mcpuk/lib/helper_text.php b/manager/media/browser/mcpuk/lib/helper_text.php index 0d03082554..8cecc353d1 100755 --- a/manager/media/browser/mcpuk/lib/helper_text.php +++ b/manager/media/browser/mcpuk/lib/helper_text.php @@ -12,24 +12,21 @@ * @link http://kcfinder.sunhater.com */ -class text -{ +class text { /** Replace repeated white spaces to single space * @param string $string * @return string */ - public static function clearWhitespaces($string) - { + static function clearWhitespaces($string) { return trim(preg_replace('/\s+/s', " ", $string)); } - /** Normalize the string for HTML attribute value - * @param string $string - * @return string */ + /** Normalize the string for HTML attribute value + * @param string $string + * @return string */ - public static function htmlValue($string) - { + static function htmlValue($string) { return str_replace('"', """, str_replace("'", ''', @@ -38,12 +35,11 @@ public static function htmlValue($string) $string)))); } - /** Normalize the string for JavaScript string value - * @param string $string - * @return string */ + /** Normalize the string for JavaScript string value + * @param string $string + * @return string */ - public static function jsValue($string) - { + static function jsValue($string) { return preg_replace('/\r?\n/', "\\n", str_replace('"', "\\\"", @@ -52,25 +48,22 @@ public static function jsValue($string) $string)))); } - /** Normalize the string for XML tag content data - * @param string $string - * @param bool $cdata */ + /** Normalize the string for XML tag content data + * @param string $string + * @param bool $cdata */ - public static function xmlData($string, $cdata=false) - { + static function xmlData($string, $cdata=false) { $string = str_replace("]]>", "]]]]>", $string); - if (!$cdata) { + if (!$cdata) $string = ""; - } return $string; } - /** Returns compressed content of given CSS code - * @param string $code - * @return string */ + /** Returns compressed content of given CSS code + * @param string $code + * @return string */ - public static function compressCSS($code) - { + static function compressCSS($code) { $code = self::clearWhitespaces($code); $code = preg_replace('/ ?\{ ?/', "{", $code); $code = preg_replace('/ ?\} ?/', "}", $code); diff --git a/manager/media/browser/mcpuk/tpl/tpl_browser.php b/manager/media/browser/mcpuk/tpl/tpl_browser.php index caa1560b53..e16bcfb396 100755 --- a/manager/media/browser/mcpuk/tpl/tpl_browser.php +++ b/manager/media/browser/mcpuk/tpl/tpl_browser.php @@ -4,8 +4,8 @@ KCFinder: / <?php echo $this->session['dir'] ?> - - + + diff --git a/manager/media/browser/mcpuk/tpl/tpl_css.php b/manager/media/browser/mcpuk/tpl/tpl_css.php index baf4171682..dbf5d58e97 100755 --- a/manager/media/browser/mcpuk/tpl/tpl_css.php +++ b/manager/media/browser/mcpuk/tpl/tpl_css.php @@ -1,2 +1,2 @@ -cms}" : "") ?>" rel="stylesheet" type="text/css" /> +cms}" : "" ) ?>" rel="stylesheet" type="text/css" /> diff --git a/manager/media/browser/mcpuk/tpl/tpl_javascript.php b/manager/media/browser/mcpuk/tpl/tpl_javascript.php index b90a26b1c9..d43aa8f8b7 100755 --- a/manager/media/browser/mcpuk/tpl/tpl_javascript.php +++ b/manager/media/browser/mcpuk/tpl/tpl_javascript.php @@ -4,12 +4,12 @@ -opener['TinyMCE']) && $this->opener['TinyMCE']): ?> +opener['TinyMCE']) && $this->opener['TinyMCE']): ?> - -config['theme']}/init.js")): ?> + +config['theme']}/init.js")): ?> - + "; - } else { - echo $msg . "\n"; - } +function jsAlert($msg) { + $modx = evolutionCMS(); + if($_POST['ajax'] != 1) { + echo ""; + } else { + echo $msg . "\n"; + } } /** @@ -312,10 +311,9 @@ function jsAlert($msg) * @param string $dbasePassword * @return bool */ -function login($username, $givenPassword, $dbasePassword) -{ - $modx = evolutionCMS(); - return $modx->phpass->CheckPassword($givenPassword, $dbasePassword); +function login($username, $givenPassword, $dbasePassword) { + $modx = evolutionCMS(); + return $modx->phpass->CheckPassword($givenPassword, $dbasePassword); } /** @@ -325,28 +323,27 @@ function login($username, $givenPassword, $dbasePassword) * @param string $username * @return bool */ -function loginV1($internalKey, $givenPassword, $dbasePassword, $username) -{ - $modx = evolutionCMS(); +function loginV1($internalKey, $givenPassword, $dbasePassword, $username) { + $modx = evolutionCMS(); - $user_algo = $modx->manager->getV1UserHashAlgorithm($internalKey); + $user_algo = $modx->manager->getV1UserHashAlgorithm($internalKey); - if (!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) { - $modx->config['pwd_hash_algo'] = 'UNCRYPT'; - } + if(!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) { + $modx->config['pwd_hash_algo'] = 'UNCRYPT'; + } - if ($user_algo !== $modx->config['pwd_hash_algo']) { - $bk_pwd_hash_algo = $modx->config['pwd_hash_algo']; - $modx->config['pwd_hash_algo'] = $user_algo; - } + if($user_algo !== $modx->config['pwd_hash_algo']) { + $bk_pwd_hash_algo = $modx->config['pwd_hash_algo']; + $modx->config['pwd_hash_algo'] = $user_algo; + } - if ($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) { - return false; - } + if($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) { + return false; + } - updateNewHash($username, $givenPassword); + updateNewHash($username, $givenPassword); - return true; + return true; } /** @@ -356,28 +353,26 @@ function loginV1($internalKey, $givenPassword, $dbasePassword, $username) * @param string $username * @return bool */ -function loginMD5($internalKey, $givenPassword, $dbasePassword, $username) -{ - $modx = evolutionCMS(); - - if ($dbasePassword != md5($givenPassword)) { - return false; - } - updateNewHash($username, $givenPassword); - return true; +function loginMD5($internalKey, $givenPassword, $dbasePassword, $username) { + $modx = evolutionCMS(); + + if($dbasePassword != md5($givenPassword)) { + return false; + } + updateNewHash($username, $givenPassword); + return true; } /** * @param string $username * @param string $password */ -function updateNewHash($username, $password) -{ - $modx = evolutionCMS(); +function updateNewHash($username, $password) { + $modx = evolutionCMS(); - $field = array(); - $field['password'] = $modx->phpass->HashPassword($password); - $modx->db->update($field, '[+prefix+]manager_users', "username='{$username}'"); + $field = array(); + $field['password'] = $modx->phpass->HashPassword($password); + $modx->db->update($field, '[+prefix+]manager_users', "username='{$username}'"); } /** @@ -386,29 +381,28 @@ function updateNewHash($username, $password) * @param int $failed_allowed * @param int $blocked_minutes */ -function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes) -{ - $modx = evolutionCMS(); - - $failedlogins += 1; - - $fields = array('failedlogincount' => $failedlogins); - if ($failedlogins >= $failed_allowed) { //block user for too many fail attempts - - $fields['blockeduntil'] = time() + ($blocked_minutes * 60); - } - - $modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'"); - - if ($failedlogins < $failed_allowed) { - //sleep to help prevent brute force attacks - $sleep = (int) $failedlogins / 2; - if ($sleep > 5) { - $sleep = 5; - } - sleep($sleep); - } - @session_destroy(); - session_unset(); - return; +function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes) { + $modx = evolutionCMS(); + + $failedlogins += 1; + + $fields = array('failedlogincount' => $failedlogins); + if($failedlogins >= $failed_allowed) //block user for too many fail attempts + { + $fields['blockeduntil'] = time() + ($blocked_minutes * 60); + } + + $modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'"); + + if($failedlogins < $failed_allowed) { + //sleep to help prevent brute force attacks + $sleep = (int) $failedlogins / 2; + if($sleep > 5) { + $sleep = 5; + } + sleep($sleep); + } + @session_destroy(); + session_unset(); + return; } diff --git a/manager/processors/logout.processor.php b/manager/processors/logout.processor.php index d69b6d6900..7af6ff4518 100755 --- a/manager/processors/logout.processor.php +++ b/manager/processors/logout.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } @@ -9,10 +9,10 @@ // invoke OnBeforeManagerLogout event $modx->invokeEvent("OnBeforeManagerLogout", - array( - "userid" => $internalKey, - "username" => $username - )); + array( + "userid" => $internalKey, + "username" => $username + )); //// Unset all of the session variables. //$_SESSION = array(); @@ -35,10 +35,10 @@ // invoke OnManagerLogout event $modx->invokeEvent("OnManagerLogout", - array( - "userid" => $internalKey, - "username" => $username - )); + array( + "userid" => $internalKey, + "username" => $username + )); // show login screen header('Location: ' . MODX_MANAGER_URL); diff --git a/manager/processors/move_document.processor.php b/manager/processors/move_document.processor.php index d7fb93b55e..c0a8c390fd 100755 --- a/manager/processors/move_document.processor.php +++ b/manager/processors/move_document.processor.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('edit_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('edit_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $newParentID = isset($_REQUEST['new_parent']) ? (int)$_REQUEST['new_parent'] : 0; @@ -12,20 +12,12 @@ // ok, two things to check. // first, document cannot be moved to itself // second, new parent must be a folder. If not, set it to folder. -if ($documentID==$newParentID) { - $modx->webAlertAndQuit($_lang["error_movedocument1"]); -} -if ($documentID <= 0) { - $modx->webAlertAndQuit($_lang["error_movedocument2"]); -} -if ($newParentID < 0) { - $modx->webAlertAndQuit($_lang["error_movedocument2"]); -} +if($documentID==$newParentID) $modx->webAlertAndQuit($_lang["error_movedocument1"]); +if($documentID <= 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]); +if($newParentID < 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]); $parents = $modx->getParentIds($newParentID); -if (in_array($documentID, $parents)) { - $modx->webAlertAndQuit($_lang["error_movedocument2"]); -} +if (in_array($documentID, $parents)) $modx->webAlertAndQuit($_lang["error_movedocument2"]); $rs = $modx->db->select('parent', $modx->getFullTableName('site_content'), "id='{$documentID}'"); $oldparent = $modx->db->getValue($rs); @@ -33,86 +25,85 @@ // check user has permission to move document to chosen location if ($use_udperms == 1) { - if ($oldparent != $newParentID) { - include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php"; - $udperms = new udperms(); - $udperms->user = $modx->getLoginUserID(); - $udperms->document = $newParentID; - $udperms->role = $_SESSION['mgrRole']; - - if (!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_parent_denied"]); - } - } + if ($oldparent != $newParentID) { + include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php"; + $udperms = new udperms(); + $udperms->user = $modx->getLoginUserID(); + $udperms->document = $newParentID; + $udperms->role = $_SESSION['mgrRole']; + + if (!$udperms->checkPermissions()) { + $modx->webAlertAndQuit($_lang["access_permission_parent_denied"]); + } + } } /** * @param int $currDocID * @return array */ -function allChildren($currDocID) -{ - $modx = evolutionCMS(); - $children= array(); - $currDocID = $modx->db->escape($currDocID); - $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent = '{$currDocID}'"); - while ($child= $modx->db->getRow($rs)) { - $children[]= $child['id']; - $children= array_merge($children, allChildren($child['id'])); - } - return $children; +function allChildren($currDocID) { + $modx = evolutionCMS(); + $children= array(); + $currDocID = $modx->db->escape($currDocID); + $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent = '{$currDocID}'"); + while ($child= $modx->db->getRow($rs)) { + $children[]= $child['id']; + $children= array_merge($children, allChildren($child['id'])); + } + return $children; } -$evtOut = $modx->invokeEvent("onBeforeMoveDocument", array( - "id_document" => $documentID, - "old_parent" => $oldparent, - "new_parent" => $newParentID +$evtOut = $modx->invokeEvent("onBeforeMoveDocument", array ( + "id_document" => $documentID, + "old_parent" => $oldparent, + "new_parent" => $newParentID )); -if (is_array($evtOut) && count($evtOut) > 0) { - $newParent = array_pop($evtOut); - if ($newParent == $oldparent) { - $modx->webAlertAndQuit($_lang["error_movedocument2"]); - } else { - $newParentID = $newParent; - } +if (is_array($evtOut) && count($evtOut) > 0){ + $newParent = array_pop($evtOut); + if($newParent == $oldparent) { + $modx->webAlertAndQuit($_lang["error_movedocument2"]); + }else{ + $newParentID = $newParent; + } } $children = allChildren($documentID); if (!array_search($newParentID, $children)) { - $modx->db->update(array( - 'isfolder' => 1, - ), $modx->getFullTableName('site_content'), "id='{$newParentID}'"); - - $modx->db->update(array( - 'parent' => $newParentID, - 'editedby' => $modx->getLoginUserID(), - 'editedon' => time(), - ), $modx->getFullTableName('site_content'), "id='{$documentID}'"); - - // finished moving the document, now check to see if the old_parent should no longer be a folder. - $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('site_content'), "parent='{$oldparent}'"); - $limit = $modx->db->getValue($rs); - - if (!$limit>0) { - $modx->db->update(array( - 'isfolder' => 0, - ), $modx->getFullTableName('site_content'), "id='{$oldparent}'"); - } - // Set the item name for logger - $pagetitle = $modx->db->getValue($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "id='{$documentID}'")); - $_SESSION['itemname'] = $pagetitle; - - $modx->invokeEvent("onAfterMoveDocument", array( - "id_document" => $documentID, - "old_parent" => $oldparent, - "new_parent" => $newParentID - )); - - // empty cache & sync site - $modx->clearCache('full'); - - $header="Location: index.php?a=3&id={$documentID}&r=9"; - header($header); + $modx->db->update(array( + 'isfolder' => 1, + ), $modx->getFullTableName('site_content'), "id='{$newParentID}'"); + + $modx->db->update(array( + 'parent' => $newParentID, + 'editedby' => $modx->getLoginUserID(), + 'editedon' => time(), + ), $modx->getFullTableName('site_content'), "id='{$documentID}'"); + + // finished moving the document, now check to see if the old_parent should no longer be a folder. + $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('site_content'), "parent='{$oldparent}'"); + $limit = $modx->db->getValue($rs); + + if(!$limit>0) { + $modx->db->update(array( + 'isfolder' => 0, + ), $modx->getFullTableName('site_content'), "id='{$oldparent}'"); + } + // Set the item name for logger + $pagetitle = $modx->db->getValue($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "id='{$documentID}'")); + $_SESSION['itemname'] = $pagetitle; + + $modx->invokeEvent("onAfterMoveDocument", array ( + "id_document" => $documentID, + "old_parent" => $oldparent, + "new_parent" => $newParentID + )); + + // empty cache & sync site + $modx->clearCache('full'); + + $header="Location: index.php?a=3&id={$documentID}&r=9"; + header($header); } else { - $modx->webAlertAndQuit("You cannot move a document to a child document!"); + $modx->webAlertAndQuit("You cannot move a document to a child document!"); } diff --git a/manager/processors/optimize_table.processor.php b/manager/processors/optimize_table.processor.php index ddcc8755ea..4a971a7e4a 100755 --- a/manager/processors/optimize_table.processor.php +++ b/manager/processors/optimize_table.processor.php @@ -1,31 +1,35 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!($modx->hasPermission('settings') && ($modx->hasPermission('logs')||$modx->hasPermission('bk_manager')))) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!($modx->hasPermission('settings') && ($modx->hasPermission('logs')||$modx->hasPermission('bk_manager')))) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } if (isset($_REQUEST['t'])) { - if (empty($_REQUEST['t'])) { - $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]); - } - // Set the item name for logger - $_SESSION['itemname'] = $_REQUEST['t']; + if (empty($_REQUEST['t'])) { + $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]); + } + + // Set the item name for logger + $_SESSION['itemname'] = $_REQUEST['t']; + + $modx->db->optimize($_REQUEST['t']); - $modx->db->optimize($_REQUEST['t']); } elseif (isset($_REQUEST['u'])) { - if (empty($_REQUEST['u'])) { - $modx->webAlertAndQuit($_lang["error_no_truncate_tablename"]); - } - // Set the item name for logger - $_SESSION['itemname'] = $_REQUEST['u']; + if (empty($_REQUEST['u'])) { + $modx->webAlertAndQuit($_lang["error_no_truncate_tablename"]); + } + + // Set the item name for logger + $_SESSION['itemname'] = $_REQUEST['u']; + + $modx->db->truncate($_REQUEST['u']); - $modx->db->truncate($_REQUEST['u']); } else { - $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]); + $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]); } $mode = (int)$_REQUEST['mode']; diff --git a/manager/processors/publish_content.processor.php b/manager/processors/publish_content.processor.php index 235d39e791..87e66c07f7 100755 --- a/manager/processors/publish_content.processor.php +++ b/manager/processors/publish_content.processor.php @@ -1,14 +1,14 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('save_document')||!$modx->hasPermission('publish_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('save_document')||!$modx->hasPermission('publish_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id'])? (int)$_REQUEST['id'] : 0; -if ($id==0) { - $modx->webAlertAndQuit($_lang["error_no_id"]); +if($id==0) { + $modx->webAlertAndQuit($_lang["error_no_id"]); } /************webber ********/ @@ -16,10 +16,10 @@ $pid=($content['parent']==0?$id:$content['parent']); /************** webber *************/ -$sd=isset($_REQUEST['dir'])?'&dir=' . $_REQUEST['dir']:'&dir=DESC'; -$sb=isset($_REQUEST['sort'])?'&sort=' . $_REQUEST['sort']:'&sort=createdon'; -$pg=isset($_REQUEST['page'])?'&page=' . (int)$_REQUEST['page']:''; -$add_path=$sd . $sb . $pg; +$sd=isset($_REQUEST['dir'])?'&dir='.$_REQUEST['dir']:'&dir=DESC'; +$sb=isset($_REQUEST['sort'])?'&sort='.$_REQUEST['sort']:'&sort=createdon'; +$pg=isset($_REQUEST['page'])?'&page='.(int)$_REQUEST['page']:''; +$add_path=$sd.$sb.$pg; /***********************************/ @@ -32,24 +32,24 @@ $udperms->document = $id; $udperms->role = $_SESSION['mgrRole']; -if (!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); +if(!$udperms->checkPermissions()) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); } // update the document $modx->db->update( - array( - 'published' => 1, - 'pub_date' => 0, - 'unpub_date' => 0, - 'editedby' => $modx->getLoginUserID(), - 'editedon' => time(), - 'publishedby' => $modx->getLoginUserID(), - 'publishedon' => time(), - ), $modx->getFullTableName('site_content'), "id='{$id}'"); + array( + 'published' => 1, + 'pub_date' => 0, + 'unpub_date' => 0, + 'editedby' => $modx->getLoginUserID(), + 'editedon' => time(), + 'publishedby' => $modx->getLoginUserID(), + 'publishedon' => time(), + ), $modx->getFullTableName('site_content'), "id='{$id}'"); // invoke OnDocPublished event -$modx->invokeEvent("OnDocPublished", array("docid"=>$id)); +$modx->invokeEvent("OnDocPublished",array("docid"=>$id)); // Set the item name for logger $_SESSION['itemname'] = $content['pagetitle']; @@ -57,6 +57,6 @@ // empty cache $modx->clearCache('full'); -$header="Location: index.php?a=3&id=$pid&r=1" . $add_path; +$header="Location: index.php?a=3&id=$pid&r=1".$add_path; header($header); diff --git a/manager/processors/purge_plugin.processor.php b/manager/processors/purge_plugin.processor.php index 7df736a632..2e31e0092a 100755 --- a/manager/processors/purge_plugin.processor.php +++ b/manager/processors/purge_plugin.processor.php @@ -1,11 +1,11 @@ hasPermission('delete_plugin')) { - $e->setError(3); - $e->dumpError(); +if(!$modx->hasPermission('delete_plugin')) { + $e->setError(3); + $e->dumpError(); } $tbl_site_plugins = $modx->getFullTablename('site_plugins'); @@ -14,19 +14,18 @@ // Get unique list of latest added plugins by highest sql-id $rs = $modx->db->query("SELECT t1.id FROM {$tbl_site_plugins} t1 LEFT JOIN {$tbl_site_plugins} t2 ON (t1.name = t2.name AND t1.id < t2.id) WHERE t2.id IS NULL;"); $latestIds = array(); -while ($row = $modx->db->getRow($rs)) { +while($row = $modx->db->getRow($rs)) { $latestIds[] = $row['id']; } // Get list of plugins with disabled and enabled versions $rs = $modx->db->query("SELECT id FROM {$tbl_site_plugins} t1 WHERE disabled = 1 AND name IN (SELECT name FROM {$tbl_site_plugins} t2 WHERE t1.name = t2.name AND t1.id != t2.id)"); -while ($row = $modx->db->getRow($rs)) { +while($row = $modx->db->getRow($rs)) { + $id = $row['id']; - if (in_array($id, $latestIds)) { - continue; - } // Keep latest version of disabled plugins + if(in_array($id,$latestIds)) continue; // Keep latest version of disabled plugins // invoke OnBeforePluginFormDelete event $modx->invokeEvent('OnBeforePluginFormDelete', array('id'=> $id)); diff --git a/manager/processors/remove_content.processor.php b/manager/processors/remove_content.processor.php index 495568b41d..d55584c60f 100755 --- a/manager/processors/remove_content.processor.php +++ b/manager/processors/remove_content.processor.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('delete_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('delete_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "deleted=1"); @@ -11,36 +11,36 @@ // invoke OnBeforeEmptyTrash event $modx->invokeEvent("OnBeforeEmptyTrash", - array( - "ids"=>$ids - )); + array( + "ids"=>$ids + )); // remove the document groups link. $sql = "DELETE document_groups - FROM " . $modx->getFullTableName('document_groups') . " AS document_groups - INNER JOIN " . $modx->getFullTableName('site_content') . " AS site_content ON site_content.id = document_groups.document + FROM ".$modx->getFullTableName('document_groups')." AS document_groups + INNER JOIN ".$modx->getFullTableName('site_content')." AS site_content ON site_content.id = document_groups.document WHERE site_content.deleted=1"; $modx->db->query($sql); // remove the TV content values. $sql = "DELETE site_tmplvar_contentvalues - FROM " . $modx->getFullTableName('site_tmplvar_contentvalues') . " AS site_tmplvar_contentvalues - INNER JOIN " . $modx->getFullTableName('site_content') . " AS site_content ON site_content.id = site_tmplvar_contentvalues.contentid + FROM ".$modx->getFullTableName('site_tmplvar_contentvalues')." AS site_tmplvar_contentvalues + INNER JOIN ".$modx->getFullTableName('site_content')." AS site_content ON site_content.id = site_tmplvar_contentvalues.contentid WHERE site_content.deleted=1"; $modx->db->query($sql); //'undelete' the document. $modx->db->delete($modx->getFullTableName('site_content'), "deleted=1"); - // invoke OnEmptyTrash event - $modx->invokeEvent("OnEmptyTrash", - array( - "ids"=>$ids - )); + // invoke OnEmptyTrash event + $modx->invokeEvent("OnEmptyTrash", + array( + "ids"=>$ids + )); - // empty cache - $modx->clearCache('full'); + // empty cache + $modx->clearCache('full'); - // finished emptying cache - redirect - $header="Location: index.php?a=2&r=1"; - header($header); + // finished emptying cache - redirect + $header="Location: index.php?a=2&r=1"; + header($header); diff --git a/manager/processors/remove_installer.processor.php b/manager/processors/remove_installer.processor.php index 519f8f7958..c2d758d84d 100755 --- a/manager/processors/remove_installer.processor.php +++ b/manager/processors/remove_installer.processor.php @@ -13,18 +13,14 @@ */ $msg =''; -$pth = dirname(dirname(dirname(__FILE__))) . "/install/"; -$pth = str_replace("\\", "/", $pth); -if (isset($_GET["rminstall"])) { - if (is_dir($pth)) { - if (!rmdirRecursive($pth)) { - $msg="An error occured while attempting to remove the install folder"; - } - } -} -if ($msg) { - echo ""; +$pth = dirname(dirname(dirname(__FILE__)))."/install/"; +$pth = str_replace("\\","/",$pth); +if(isset($_GET["rminstall"])) { + if(is_dir($pth)) { + if(!rmdirRecursive($pth)) $msg="An error occured while attempting to remove the install folder"; + } } +if($msg) echo ""; echo ""; /** @@ -34,16 +30,16 @@ * @param bool $followLinks * @return bool */ -function rmdirRecursive($path, $followLinks=false) -{ - $dir = opendir($path) ; - while ($entry = readdir($dir)) { - if (is_file("$path/$entry") || ((!$followLinks) && is_link("$path/$entry"))) { - @unlink("$path/$entry"); - } elseif (is_dir("$path/$entry") && $entry!='.' && $entry!='..') { - rmdirRecursive("$path/$entry"); // recursive - } - } - closedir($dir); - return @rmdir($path); +function rmdirRecursive($path, $followLinks=false) { + $dir = opendir($path) ; + while ($entry = readdir($dir)) { + if (is_file("$path/$entry") || ((!$followLinks) && is_link("$path/$entry"))) { + @unlink( "$path/$entry" ); + } + elseif (is_dir("$path/$entry") && $entry!='.' && $entry!='..') { + rmdirRecursive("$path/$entry"); // recursive + } + } + closedir($dir); + return @rmdir($path); } diff --git a/manager/processors/remove_locks.processor.php b/manager/processors/remove_locks.processor.php index 0b4d3218ea..5808378f9e 100755 --- a/manager/processors/remove_locks.processor.php +++ b/manager/processors/remove_locks.processor.php @@ -1,28 +1,26 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!isset($_GET['id'])) { - if (!$modx->hasPermission('remove_locks')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } +if(!isset($_GET['id'])) { + if(!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]); - // Remove all locks - $modx->db->truncate($modx->getFullTableName('active_user_locks')); + // Remove all locks + $modx->db->truncate($modx->getFullTableName('active_user_locks')); - $header = "Location: index.php?a=2"; - header($header); + $header = "Location: index.php?a=2"; + header($header); } else { - // Remove single locks via AJAX / window.onbeforeunload - $type = (int)$_GET['type']; - $id = (int)$_GET['id']; - $includeAllUsers = $modx->hasPermission('remove_locks'); // Enables usage of "unlock"-ajax-button - if ($type && $id) { - $modx->unlockElement($type, $id, $includeAllUsers); - echo '1'; - exit; - } else { - echo 'No type or id sent with request.'; - } + // Remove single locks via AJAX / window.onbeforeunload + $type = (int)$_GET['type']; + $id = (int)$_GET['id']; + $includeAllUsers = $modx->hasPermission('remove_locks'); // Enables usage of "unlock"-ajax-button + if($type && $id) { + $modx->unlockElement($type, $id, $includeAllUsers); + echo '1'; + exit; + } else { + echo 'No type or id sent with request.'; + } } diff --git a/manager/processors/save_content.processor.php b/manager/processors/save_content.processor.php index e311e6505d..942e2dbc18 100755 --- a/manager/processors/save_content.processor.php +++ b/manager/processors/save_content.processor.php @@ -36,10 +36,10 @@ $aliasvisible = $_POST['alias_visible']; /************* webber ********/ -$sd = isset($_POST['dir']) ? '&dir=' . $_POST['dir'] : '&dir=DESC'; -$sb = isset($_POST['sort']) ? '&sort=' . $_POST['sort'] : '&sort=pub_date'; -$pg = isset($_POST['page']) ? '&page=' . (int) $_POST['page'] : ''; -$add_path = $sd . $sb . $pg; +$sd = isset($_POST['dir']) ? '&dir='.$_POST['dir'] : '&dir=DESC'; +$sb = isset($_POST['sort']) ? '&sort='.$_POST['sort'] : '&sort=pub_date'; +$pg = isset($_POST['page']) ? '&page='.(int) $_POST['page'] : ''; +$add_path = $sd.$sb.$pg; @@ -134,26 +134,28 @@ } //end webber } -} elseif ($alias) { +} +elseif ($alias) { $alias = $modx->stripAlias($alias); } // determine published status $currentdate = $_SERVER['REQUEST_TIME'] + $modx->config['server_offset_time']; -if (empty($pub_date)) { +if (empty ($pub_date)) { $pub_date = 0; } else { $pub_date = $modx->toTimeStamp($pub_date); if ($pub_date < $currentdate) { $published = 1; - } elseif ($pub_date > $currentdate) { + } + elseif ($pub_date > $currentdate) { $published = 0; } } -if (empty($unpub_date)) { +if (empty ($unpub_date)) { $unpub_date = 0; } else { $unpub_date = $modx->toTimeStamp($unpub_date); @@ -193,15 +195,15 @@ INNER JOIN {$tbl_site_tmplvar_templates} AS tvtpl ON tvtpl.tmplvarid = tv.id LEFT JOIN {$tbl_site_tmplvar_contentvalues} AS tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$id}' LEFT JOIN {$tbl_site_tmplvar_access} AS tva ON tva.tmplvarid=tv.id", - "tvtpl.templateid = '{$template}' AND (1='{$_SESSION['mgrRole']}' OR ISNULL(tva.documentgroup)" . ((!$docgrp) ? "" : " OR tva.documentgroup IN ($docgrp)") . ")", + "tvtpl.templateid = '{$template}' AND (1='{$_SESSION['mgrRole']}' OR ISNULL(tva.documentgroup)".((!$docgrp) ? "" : " OR tva.documentgroup IN ($docgrp)").")", "tv.rank" ); while ($row = $modx->db->getRow($rs)) { $tmplvar = ''; switch ($row['type']) { case 'url': - $tmplvar = $_POST["tv" . $row['id']]; - if ($_POST["tv" . $row['id'] . '_prefix'] != '--') { + $tmplvar = $_POST["tv".$row['id']]; + if ($_POST["tv".$row['id'].'_prefix'] != '--') { $tmplvar = str_replace(array( "feed://", "ftp://", @@ -209,23 +211,23 @@ "https://", "mailto:" ), "", $tmplvar); - $tmplvar = $_POST["tv" . $row['id'] . '_prefix'] . $tmplvar; + $tmplvar = $_POST["tv".$row['id'].'_prefix'].$tmplvar; } break; case 'file': - $tmplvar = $_POST["tv" . $row['id']]; + $tmplvar = $_POST["tv".$row['id']]; break; default: - if (is_array($_POST["tv" . $row['id']])) { + if (is_array($_POST["tv".$row['id']])) { // handles checkboxes & multiple selects elements $feature_insert = array(); - $lst = $_POST["tv" . $row['id']]; - while (list($featureValue, $feature_item) = each($lst)) { + $lst = $_POST["tv".$row['id']]; + while (list ($featureValue, $feature_item) = each($lst)) { $feature_insert[count($feature_insert)] = $feature_item; } $tmplvar = implode("||", $feature_insert); } else { - $tmplvar = $_POST["tv" . $row['id']]; + $tmplvar = $_POST["tv".$row['id']]; } break; } @@ -248,12 +250,13 @@ if (!$existingDocument) { $modx->webAlertAndQuit($_lang["error_no_results"]); } + } // check to see if the user is allowed to save the document in the place he wants to save it in if ($use_udperms == 1) { if ($existingDocument['parent'] != $parent) { - include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php"; + include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php"; $udperms = new udperms(); $udperms->user = $modx->getLoginUserID(); $udperms->document = $parent; @@ -272,10 +275,11 @@ } switch ($actionToTake) { - case 'new': + case 'new' : // invoke OnBeforeDocFormSave event - switch ($modx->config['docid_incrmnt_method']) { + switch($modx->config['docid_incrmnt_method']) + { case '1': $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id"; $where = "T1.id IS NULL"; @@ -343,9 +347,8 @@ "alias_visible" => $aliasvisible ); - if ($id != '') { + if ($id != '') $dbInsert["id"] = $id; - } $key = $modx->db->insert($dbInsert, $tbl_site_content); @@ -369,11 +372,11 @@ foreach ($document_groups as $value_pair) { // first, split the pair (this is a new document, so ignore the second value list($group) = explode(',', $value_pair); // @see actions/mutate_content.dynamic.php @ line 1138 (permissions list) - $new_groups[] = '(' . (int) $group . ',' . $key . ')'; + $new_groups[] = '('.(int) $group.','.$key.')'; } $saved = true; if (!empty($new_groups)) { - $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES " . implode(',', $new_groups)); + $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES ".implode(',', $new_groups)); } } else { $isManager = $modx->hasPermission('access_permissions'); @@ -403,11 +406,11 @@ )); // secure web documents - flag as private - include MODX_MANAGER_PATH . "includes/secure_web_documents.inc.php"; + include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php"; secureWebDocument($key); // secure manager documents - flag as private - include MODX_MANAGER_PATH . "includes/secure_mgr_documents.inc.php"; + include MODX_MANAGER_PATH."includes/secure_mgr_documents.inc.php"; secureMgrDocument($key); // Set the item name for logger @@ -421,14 +424,12 @@ // redirect/stay options if ($_POST['stay'] != '') { // weblink - if ($_POST['mode'] == "72") { + if ($_POST['mode'] == "72") $a = ($_POST['stay'] == '2') ? "27&id=$key" : "72&pid=$parent"; - } // document - if ($_POST['mode'] == "4") { + if ($_POST['mode'] == "4") $a = ($_POST['stay'] == '2') ? "27&id=$key" : "4&pid=$parent"; - } - $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay']; + $header = "Location: index.php?a=".$a."&r=1&stay=".$_POST['stay']; } else { $header = "Location: index.php?a=3&id=$key&r=1"; } @@ -442,7 +443,7 @@ break; - case 'edit': + case 'edit' : // get the document's current parent $oldparent = $existingDocument['parent']; @@ -488,10 +489,10 @@ if (!$was_published && $published) { $publishedon = $currentdate; $publishedby = $modx->getLoginUserID(); - } elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { + }elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { $publishedon = $pub_date; $publishedby = $modx->getLoginUserID(); - } elseif ($was_published && !$published) { + }elseif ($was_published && !$published) { $publishedon = 0; $publishedby = 0; } else { @@ -500,7 +501,7 @@ } // invoke OnBeforeDocFormSave event - $modx->invokeEvent("OnBeforeDocFormSave", array( + $modx->invokeEvent("OnBeforeDocFormSave", array ( "mode" => "upd", "id" => $id )); @@ -534,11 +535,12 @@ . "donthit={$donthit}, " . "menutitle='{$menutitle}', " . "hidemenu={$hidemenu}, " - . "alias_visible={$aliasvisible}", $tbl_site_content, "id='{$id}'"); + . "alias_visible={$aliasvisible}" + , $tbl_site_content, "id='{$id}'"); // update template variables $rs = $modx->db->select('id, tmplvarid', $tbl_site_tmplvar_contentvalues, "contentid='{$id}'"); - $tvIds = array(); + $tvIds = array (); while ($row = $modx->db->getRow($rs)) { $tvIds[$row['tmplvarid']] = $row['id']; } @@ -546,9 +548,7 @@ $tvChanges = array(); foreach ($tmplvars as $field => $value) { if (!is_array($value)) { - if (isset($tvIds[$value])) { - $tvDeletions[] = $tvIds[$value]; - } + if (isset($tvIds[$value])) $tvDeletions[] = $tvIds[$value]; } else { $tvId = $value[0]; $tvVal = $value[1]; @@ -562,7 +562,7 @@ } if (!empty($tvDeletions)) { - $modx->db->delete($tbl_site_tmplvar_contentvalues, 'id IN(' . implode(',', $tvDeletions) . ')'); + $modx->db->delete($tbl_site_tmplvar_contentvalues, 'id IN('.implode(',', $tvDeletions).')'); } if (!empty($tvAdded)) { @@ -593,12 +593,10 @@ 'groups.id, groups.document_group', "{$tbl_document_groups} AS groups LEFT JOIN {$tbl_documentgroup_names} AS dgn ON dgn.id = groups.document_group", - "((1=" . (int)$isManager . " AND dgn.private_memgroup) OR (1=" . (int)$isWeb . " AND dgn.private_webgroup)) AND groups.document = '{$id}'" + "((1=".(int)$isManager." AND dgn.private_memgroup) OR (1=".(int)$isWeb." AND dgn.private_webgroup)) AND groups.document = '{$id}'" ); $old_groups = array(); - while ($row = $modx->db->getRow($rs)) { - $old_groups[$row['document_group']] = $row['id']; - } + while ($row = $modx->db->getRow($rs)) $old_groups[$row['document_group']] = $row['id']; // update the permissions in the database $insertions = $deletions = array(); @@ -607,14 +605,14 @@ unset($old_groups[$group]); continue; } elseif ($link_id == 'new') { - $insertions[] = '(' . (int)$group . ',' . $id . ')'; + $insertions[] = '('.(int)$group.','.$id.')'; } } if (!empty($insertions)) { - $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES " . implode(',', $insertions)); + $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES ".implode(',', $insertions)); } if (!empty($old_groups)) { - $modx->db->delete($tbl_document_groups, "id IN (" . implode(',', $old_groups) . ")"); + $modx->db->delete($tbl_document_groups, "id IN (".implode(',', $old_groups).")"); } // necessary to remove all permissions as document is public if ((isset($_POST['chkalldocs']) && $_POST['chkalldocs'] == 'on')) { @@ -639,7 +637,7 @@ // invoke OnDocFormSave event - $modx->invokeEvent("OnDocFormSave", array( + $modx->invokeEvent("OnDocFormSave", array ( "mode" => "upd", "id" => $id )); @@ -660,9 +658,9 @@ $modx->clearCache('full'); } - if ($_POST['refresh_preview'] == '1') { - $header = "Location: " . MODX_SITE_URL . "index.php?id=$id&z=manprev"; - } else { + if ($_POST['refresh_preview'] == '1') + $header = "Location: ".MODX_SITE_URL."index.php?id=$id&z=manprev"; + else { if ($_POST['stay'] != '2' && $id > 0) { $modx->unlockElement(7, $id); } @@ -675,18 +673,18 @@ // document $a = ($_POST['stay'] == '2') ? "27&id=$id" : "4&pid=$parent"; } - $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay'] . $add_path; + $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay'].$add_path; } else { - $header = "Location: index.php?a=3&id=$id&r=1" . $add_path; + $header = "Location: index.php?a=3&id=$id&r=1".$add_path; } } if (headers_sent()) { - $header = str_replace('Location: ', '', $header); + $header = str_replace('Location: ','',$header); echo "\n"; } else { header($header); } break; - default: + default : $modx->webAlertAndQuit("No operation set in request."); } diff --git a/manager/processors/save_htmlsnippet.processor.php b/manager/processors/save_htmlsnippet.processor.php index ff40879a34..f23421ba90 100755 --- a/manager/processors/save_htmlsnippet.processor.php +++ b/manager/processors/save_htmlsnippet.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_chunk')) { diff --git a/manager/processors/save_module.processor.php b/manager/processors/save_module.processor.php index 1e12674098..ada5f818de 100755 --- a/manager/processors/save_module.processor.php +++ b/manager/processors/save_module.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_module')) { diff --git a/manager/processors/save_password.processor.php b/manager/processors/save_password.processor.php index a99d264c83..c9db342473 100755 --- a/manager/processors/save_password.processor.php +++ b/manager/processors/save_password.processor.php @@ -1,36 +1,36 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('save_password')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('save_password')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = $_POST['id']; $pass1 = $_POST['pass1']; $pass2 = $_POST['pass2']; -if ($pass1!=$pass2) { - $modx->webAlertAndQuit("Passwords don't match!"); +if($pass1!=$pass2){ + $modx->webAlertAndQuit("Passwords don't match!"); } -if (strlen($pass1)<6) { - $modx->webAlertAndQuit("Password is too short. Please specify a password of at least 6 characters."); +if(strlen($pass1)<6){ + $modx->webAlertAndQuit("Password is too short. Please specify a password of at least 6 characters."); } $pass1 = $modx->htmlspecialchars($pass1, ENT_NOQUOTES); - $tbl_manager_users = $modx->getFullTableName('manager_users'); - $uid = $modx->getLoginUserID(); - $modx->loadExtension('phpass'); - $f['password'] = $modx->phpass->HashPassword($pass1); - $modx->db->update($f, $tbl_manager_users, "id='{$uid}'"); + $tbl_manager_users = $modx->getFullTableName('manager_users'); + $uid = $modx->getLoginUserID(); + $modx->loadExtension('phpass'); + $f['password'] = $modx->phpass->HashPassword($pass1); + $modx->db->update($f,$tbl_manager_users,"id='{$uid}'"); - // invoke OnManagerChangePassword event - $modx->invokeEvent('OnManagerChangePassword', array( - 'userid' => $uid, - 'username' => $_SESSION['mgrShortname'], - 'userpassword' => $pass1 - )); + // invoke OnManagerChangePassword event + $modx->invokeEvent('OnManagerChangePassword', array ( + 'userid' => $uid, + 'username' => $_SESSION['mgrShortname'], + 'userpassword' => $pass1 + )); $header="Location: index.php?a=2"; header($header); diff --git a/manager/processors/save_plugin.processor.php b/manager/processors/save_plugin.processor.php index e0edf20e1b..1d25a72b8e 100755 --- a/manager/processors/save_plugin.processor.php +++ b/manager/processors/save_plugin.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly.'); } if (!$modx->hasPermission('save_plugin')) { @@ -177,9 +177,7 @@ function saveEventListeners($id, $sysevents, $mode) // save selected system events $formEventList = array(); foreach ($sysevents as $evtId) { - if (!preg_match('@^[1-9][0-9]*$@', $evtId)) { - $evtId = getEventIdByName($evtId); - } + if(!preg_match('@^[1-9][0-9]*$@',$evtId)) $evtId = getEventIdByName($evtId); if ($mode == '101') { $rs = $modx->db->select('max(priority) as priority', '[+prefix+]site_plugin_events', "evtid='{$evtId}'"); } else { @@ -204,17 +202,13 @@ function saveEventListeners($id, $sysevents, $mode) $rs = $modx->db->select('*', '[+prefix+]site_plugin_events', sprintf("pluginid='%s'", $id)); $dbEventList = array(); $del = array(); - while ($row = $modx->db->getRow($rs)) { - if (!in_array($row['evtid'], $evtids)) { - $del[] = $row['evtid']; - } + while($row = $modx->db->getRow($rs)) { + if(!in_array($row['evtid'], $evtids)) $del[] = $row['evtid']; } - if (empty($del)) { - return; - } + if(empty($del)) return; - foreach ($del as $delid) { + foreach($del as $delid) { $modx->db->delete('[+prefix+]site_plugin_events', sprintf("evtid='%s' AND pluginid='%s'", $delid, $id)); } } @@ -228,9 +222,7 @@ function getEventIdByName($name) $modx = evolutionCMS(); static $eventIds=array(); - if (isset($eventIds[$name])) { - return $eventIds[$name]; - } + if(isset($eventIds[$name])) return $eventIds[$name]; $rs = $modx->db->select('id, name', '[+prefix+]system_eventnames'); while ($row = $modx->db->getRow($rs)) { @@ -239,3 +231,4 @@ function getEventIdByName($name) return $eventIds[$name]; } + diff --git a/manager/processors/save_role.processor.php b/manager/processors/save_role.processor.php index 45c6398b35..1d4f55c83a 100755 --- a/manager/processors/save_role.processor.php +++ b/manager/processors/save_role.processor.php @@ -1,135 +1,135 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('save_role')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('save_role')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } extract($_POST); -if ($name == '' || !isset($name)) { - $modx->webAlertAndQuit("Please enter a name for this role!", "index.php?a={$mode}" . ($mode = 35 ? "&id={$id}" : "")); +if($name == '' || !isset ($name)) { + $modx->webAlertAndQuit("Please enter a name for this role!", "index.php?a={$mode}" . ($mode = 35 ? "&id={$id}" : "")); } // setup fields $fields = array( - 'name' => $name, - 'description' => $description, - 'frames' => $frames, - 'home' => $home, - 'view_document' => $view_document, - 'new_document' => $new_document, - 'save_document' => $save_document, - 'publish_document' => $publish_document, - 'delete_document' => $delete_document, - 'empty_trash' => $empty_trash, - 'action_ok' => $action_ok, - 'logout' => $logout, - 'help' => $help, - 'messages' => $messages, - 'new_user' => $new_user, - 'edit_user' => $edit_user, - 'logs' => $logs, - 'edit_parser' => (isset($edit_parser)) ? $edit_parser : '0', - 'save_parser' => (isset($save_parser)) ? $save_parser : '0', - 'edit_template' => $edit_template, - 'settings' => $settings, - 'credits' => $credits, - 'new_template' => $new_template, - 'save_template' => $save_template, - 'delete_template' => $delete_template, - 'edit_snippet' => $edit_snippet, - 'new_snippet' => $new_snippet, - 'save_snippet' => $save_snippet, - 'delete_snippet' => $delete_snippet, - 'edit_chunk' => $edit_chunk, - 'new_chunk' => $new_chunk, - 'save_chunk' => $save_chunk, - 'delete_chunk' => $delete_chunk, - 'empty_cache' => $empty_cache, - 'edit_document' => $edit_document, - 'change_password' => $change_password, - 'error_dialog' => $error_dialog, - 'about' => $about, - 'file_manager' => $file_manager, - 'assets_files' => $assets_files, - 'assets_images' => $assets_images, - 'save_user' => $save_user, - 'delete_user' => $delete_user, - 'save_password' => $save_password, - 'edit_role' => $edit_role, - 'save_role' => $save_role, - 'delete_role' => $delete_role, - 'new_role' => $new_role, - 'access_permissions' => $access_permissions, - 'bk_manager' => $bk_manager, - 'new_plugin' => $new_plugin, - 'edit_plugin' => $edit_plugin, - 'save_plugin' => $save_plugin, - 'delete_plugin' => $delete_plugin, - 'new_module' => $new_module, - 'edit_module' => $edit_module, - 'save_module' => $save_module, - 'delete_module' => $delete_module, - 'exec_module' => $exec_module, - 'view_eventlog' => $view_eventlog, - 'delete_eventlog' => $delete_eventlog, - 'new_web_user' => $new_web_user, - 'edit_web_user' => $edit_web_user, - 'save_web_user' => $save_web_user, - 'delete_web_user' => $delete_web_user, - 'web_access_permissions' => $web_access_permissions, - 'view_unpublished' => $view_unpublished, - 'import_static' => $import_static, - 'export_static' => $export_static, - 'remove_locks' => $remove_locks, - 'display_locks' => $display_locks, - 'change_resourcetype' => $change_resourcetype, - 'category_manager' => $category_manager + 'name' => $name, + 'description' => $description, + 'frames' => $frames, + 'home' => $home, + 'view_document' => $view_document, + 'new_document' => $new_document, + 'save_document' => $save_document, + 'publish_document' => $publish_document, + 'delete_document' => $delete_document, + 'empty_trash' => $empty_trash, + 'action_ok' => $action_ok, + 'logout' => $logout, + 'help' => $help, + 'messages' => $messages, + 'new_user' => $new_user, + 'edit_user' => $edit_user, + 'logs' => $logs, + 'edit_parser' => (isset ($edit_parser)) ? $edit_parser : '0', + 'save_parser' => (isset ($save_parser)) ? $save_parser : '0', + 'edit_template' => $edit_template, + 'settings' => $settings, + 'credits' => $credits, + 'new_template' => $new_template, + 'save_template' => $save_template, + 'delete_template' => $delete_template, + 'edit_snippet' => $edit_snippet, + 'new_snippet' => $new_snippet, + 'save_snippet' => $save_snippet, + 'delete_snippet' => $delete_snippet, + 'edit_chunk' => $edit_chunk, + 'new_chunk' => $new_chunk, + 'save_chunk' => $save_chunk, + 'delete_chunk' => $delete_chunk, + 'empty_cache' => $empty_cache, + 'edit_document' => $edit_document, + 'change_password' => $change_password, + 'error_dialog' => $error_dialog, + 'about' => $about, + 'file_manager' => $file_manager, + 'assets_files' => $assets_files, + 'assets_images' => $assets_images, + 'save_user' => $save_user, + 'delete_user' => $delete_user, + 'save_password' => $save_password, + 'edit_role' => $edit_role, + 'save_role' => $save_role, + 'delete_role' => $delete_role, + 'new_role' => $new_role, + 'access_permissions' => $access_permissions, + 'bk_manager' => $bk_manager, + 'new_plugin' => $new_plugin, + 'edit_plugin' => $edit_plugin, + 'save_plugin' => $save_plugin, + 'delete_plugin' => $delete_plugin, + 'new_module' => $new_module, + 'edit_module' => $edit_module, + 'save_module' => $save_module, + 'delete_module' => $delete_module, + 'exec_module' => $exec_module, + 'view_eventlog' => $view_eventlog, + 'delete_eventlog' => $delete_eventlog, + 'new_web_user' => $new_web_user, + 'edit_web_user' => $edit_web_user, + 'save_web_user' => $save_web_user, + 'delete_web_user' => $delete_web_user, + 'web_access_permissions' => $web_access_permissions, + 'view_unpublished' => $view_unpublished, + 'import_static' => $import_static, + 'export_static' => $export_static, + 'remove_locks' => $remove_locks, + 'display_locks' => $display_locks, + 'change_resourcetype' => $change_resourcetype, + 'category_manager' => $category_manager ); $fields = $modx->db->escape($fields); -switch ($_POST['mode']) { - case '38': - $tbl = $modx->getFullTableName("user_roles"); +switch($_POST['mode']) { + case '38' : + $tbl = $modx->getFullTableName("user_roles"); - // disallow duplicate names for role - $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}'"); - if ($modx->db->getValue($rs) > 0) { - $modx->manager->saveFormValues(38); - $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=38"); - } + // disallow duplicate names for role + $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}'"); + if($modx->db->getValue($rs) > 0) { + $modx->manager->saveFormValues(38); + $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=38"); + } - $modx->db->insert($fields, $tbl); + $modx->db->insert($fields, $tbl); - // Set the item name for logger - $_SESSION['itemname'] = $_POST['name']; + // Set the item name for logger + $_SESSION['itemname'] = $_POST['name']; - $header = "Location: index.php?a=86&r=2"; - header($header); - break; - case '35': - $tbl = $modx->getFullTableName("user_roles"); + $header = "Location: index.php?a=86&r=2"; + header($header); + break; + case '35' : + $tbl = $modx->getFullTableName("user_roles"); - // disallow duplicate names for role - $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}' AND id!='{$id}'"); - if ($modx->db->getValue($rs) > 0) { - $modx->manager->saveFormValues(35); - $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=35&id={$id}"); - } + // disallow duplicate names for role + $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}' AND id!='{$id}'"); + if($modx->db->getValue($rs) > 0) { + $modx->manager->saveFormValues(35); + $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=35&id={$id}"); + } - $modx->db->update($fields, $tbl, "id='{$id}'"); + $modx->db->update($fields, $tbl, "id='{$id}'"); - // Set the item name for logger - $_SESSION['itemname'] = $_POST['name']; + // Set the item name for logger + $_SESSION['itemname'] = $_POST['name']; - $header = "Location: index.php?a=86&r=2"; - header($header); - break; - default: - $modx->webAlertAndQuit("No operation set in request."); + $header = "Location: index.php?a=86&r=2"; + header($header); + break; + default : + $modx->webAlertAndQuit("No operation set in request."); } $modx->unlockElement(8, $id); diff --git a/manager/processors/save_settings.processor.php b/manager/processors/save_settings.processor.php index ee4316e82f..ebe7c6f654 100755 --- a/manager/processors/save_settings.processor.php +++ b/manager/processors/save_settings.processor.php @@ -1,152 +1,159 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('settings')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('settings')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $data = $_POST; // lose the POST now, gets rid of quirky issue with Safari 3 - see FS#972 unset($_POST); -if ($data['friendly_urls']==='1' && strpos($_SERVER['SERVER_SOFTWARE'], 'IIS')===false) { - $htaccess = $modx->config['base_path'] . '.htaccess'; - $sample_htaccess = $modx->config['base_path'] . 'ht.access'; - $dir = '/' . trim($modx->config['base_url'], '/'); - if (is_file($htaccess)) { - $_ = file_get_contents($htaccess); - if (strpos($_, 'RewriteBase')===false) { - $warnings[] = $_lang["settings_friendlyurls_alert2"]; - } elseif (is_writable($htaccess)) { - $_ = preg_replace('@RewriteBase.+@', "RewriteBase {$dir}", $_); - if (!@file_put_contents($htaccess, $_)) { - $warnings[] = $_lang["settings_friendlyurls_alert2"]; - } - } - } elseif (is_file($sample_htaccess)) { - if (!@rename($sample_htaccess, $htaccess)) { - $warnings[] = $_lang["settings_friendlyurls_alert"]; - } elseif ($modx->config['base_url']!=='/') { - $_ = file_get_contents($htaccess); - $_ = preg_replace('@RewriteBase.+@', "RewriteBase {$dir}", $_); - if (!@file_put_contents($htaccess, $_)) { - $warnings[] = $_lang["settings_friendlyurls_alert2"]; - } - } - } +if($data['friendly_urls']==='1' && strpos($_SERVER['SERVER_SOFTWARE'],'IIS')===false) +{ + $htaccess = $modx->config['base_path'] . '.htaccess'; + $sample_htaccess = $modx->config['base_path'] . 'ht.access'; + $dir = '/' . trim($modx->config['base_url'],'/'); + if(is_file($htaccess)) + { + $_ = file_get_contents($htaccess); + if(strpos($_,'RewriteBase')===false) + { + $warnings[] = $_lang["settings_friendlyurls_alert2"]; + } + elseif(is_writable($htaccess)) + { + $_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_); + if(!@file_put_contents($htaccess,$_)) + { + $warnings[] = $_lang["settings_friendlyurls_alert2"]; + } + } + } + elseif(is_file($sample_htaccess)) + { + if(!@rename($sample_htaccess,$htaccess)) + { + $warnings[] = $_lang["settings_friendlyurls_alert"]; + } + elseif($modx->config['base_url']!=='/') + { + $_ = file_get_contents($htaccess); + $_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_); + if(!@file_put_contents($htaccess,$_)) + { + $warnings[] = $_lang["settings_friendlyurls_alert2"]; + } + } + } } if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { unlink(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css'); } -$data['filemanager_path'] = str_replace('[(base_path)]', MODX_BASE_PATH, $data['filemanager_path']); -$data['rb_base_dir'] = str_replace('[(base_path)]', MODX_BASE_PATH, $data['rb_base_dir']); +$data['filemanager_path'] = str_replace('[(base_path)]',MODX_BASE_PATH,$data['filemanager_path']); +$data['rb_base_dir'] = str_replace('[(base_path)]',MODX_BASE_PATH,$data['rb_base_dir']); if (isset($data) && count($data) > 0) { - if (isset($data['manager_language'])) { - $lang_path = MODX_MANAGER_PATH . 'includes/lang/' . $data['manager_language'] . '.inc.php'; - if (is_file($lang_path)) { - include($lang_path); + if(isset($data['manager_language'])) { + $lang_path = MODX_MANAGER_PATH . 'includes/lang/' . $data['manager_language'] . '.inc.php'; + if(is_file($lang_path)) { + include($lang_path); global $modx_lang_attribute; $data['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute; - } - } - $savethese = array(); - $data['sys_files_checksum'] = $modx->manager->getSystemChecksum($data['check_files_onlogin']); - $data['mail_check_timeperiod'] = (int)$data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute - foreach ($data as $k => $v) { - switch ($k) { - case 'site_name': - $v = htmlspecialchars($v); - break; + } + } + $savethese = array(); + $data['sys_files_checksum'] = $modx->manager->getSystemChecksum($data['check_files_onlogin']); + $data['mail_check_timeperiod'] = (int)$data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute + foreach ($data as $k => $v) { + switch ($k) { + case 'site_name': + $v = htmlspecialchars($v); + break; case 'settings_version':{ - if ($modx->getVersionData('version')!=$data['settings_version']) { - $modx->logEvent(17, 2, '
    ' . var_export($data['settings_version'], true) . '
    ', 'fake settings_version'); + if($modx->getVersionData('version')!=$data['settings_version']){ + $modx->logEvent(17,2,'
    '.var_export($data['settings_version'],true).'
    ','fake settings_version'); $v = $modx->getVersionData('version'); } break; } - case 'error_page': - case 'unauthorized_page': - if (trim($v) == '' || !is_numeric($v)) { - $v = $data['site_start']; - } - break; + case 'error_page': + case 'unauthorized_page': + if (trim($v) == '' || !is_numeric($v)) { + $v = $data['site_start']; + } + break; - case 'lst_custom_contenttype': - case 'txt_custom_contenttype': - // Skip these - $k = ''; - break; - case 'rb_base_dir': - case 'rb_base_url': - case 'filemanager_path': - $v = trim($v); - $v = rtrim($v, '/') . '/'; - break; + case 'lst_custom_contenttype': + case 'txt_custom_contenttype': + // Skip these + $k = ''; + break; + case 'rb_base_dir': + case 'rb_base_url': + case 'filemanager_path': + $v = trim($v); + $v = rtrim($v,'/') . '/'; + break; case 'manager_language': $langDir = realpath(MODX_MANAGER_PATH . 'includes/lang'); $langFile = realpath(MODX_MANAGER_PATH . 'includes/lang/' . $v . '.inc.php'); $langFileDir = dirname($langFile); - if ($langDir !== $langFileDir || !file_exists($langFile)) { + if($langDir !== $langFileDir || !file_exists($langFile)) { $v = 'english'; } - break; - case 'smtppw': - if ($v !== '********************' && $v !== '') { - $v = trim($v); - $v = base64_encode($v) . substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7); - $v = str_replace('=', '%', $v); - } elseif ($v === '********************') { - $k = ''; - } - break; + break; + case 'smtppw': + if ($v !== '********************' && $v !== '') { + $v = trim($v); + $v = base64_encode($v) . substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7); + $v = str_replace('=','%',$v); + } elseif ($v === '********************') { + $k = ''; + } + break; case 'valid_hostnames': - $v = str_replace(array(' ,', ', '), ',', $v); - if ($v !== ',') { - $v = ($v != 'MODX_SITE_HOSTNAMES') ? $v : ''; - $configString = 'config[$k] = $v; + $modx->config[$k] = $v; - if (!empty($k)) { - $savethese[] = '(\'' . $modx->db->escape($k) . '\', \'' . $modx->db->escape($v) . '\')'; - } - } + if(!empty($k)) $savethese[] = '(\''.$modx->db->escape($k).'\', \''.$modx->db->escape($v).'\')'; + } - // Run a single query to save all the values - $sql = "REPLACE INTO " . $modx->getFullTableName("system_settings") . " (setting_name, setting_value) - VALUES " . implode(', ', $savethese); - $modx->db->query($sql); + // Run a single query to save all the values + $sql = "REPLACE INTO ".$modx->getFullTableName("system_settings")." (setting_name, setting_value) + VALUES ".implode(', ', $savethese); + $modx->db->query($sql); - // Reset Template Pages - if (isset($data['reset_template'])) { - $newtemplate = (int)$data['default_template']; - $oldtemplate = (int)$data['old_template']; - $tbl = $modx->getFullTableName('site_content'); - $reset = $data['reset_template']; - if ($reset==1) { - $modx->db->update(array('template' => $newtemplate), $tbl, "type='document'"); - } elseif ($reset==2) { - $modx->db->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'"); - } - } + // Reset Template Pages + if (isset($data['reset_template'])) { + $newtemplate = (int)$data['default_template']; + $oldtemplate = (int)$data['old_template']; + $tbl = $modx->getFullTableName('site_content'); + $reset = $data['reset_template']; + if($reset==1) $modx->db->update(array('template' => $newtemplate), $tbl, "type='document'"); + else if($reset==2) $modx->db->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'"); + } - // empty cache - $modx->clearCache('full'); + // empty cache + $modx->clearCache('full'); } $header="Location: index.php?a=7&r=10"; header($header); diff --git a/manager/processors/save_snippet.processor.php b/manager/processors/save_snippet.processor.php index e681e48f40..28bdfe12a0 100755 --- a/manager/processors/save_snippet.processor.php +++ b/manager/processors/save_snippet.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_snippet')) { diff --git a/manager/processors/save_template.processor.php b/manager/processors/save_template.processor.php index 0a6d6cc6ef..ed4dca716c 100755 --- a/manager/processors/save_template.processor.php +++ b/manager/processors/save_template.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_template')) { diff --git a/manager/processors/save_tmplvars.processor.php b/manager/processors/save_tmplvars.processor.php index 74c365afa2..8d05b975e0 100755 --- a/manager/processors/save_tmplvars.processor.php +++ b/manager/processors/save_tmplvars.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_template')) { @@ -13,7 +13,7 @@ $type = $modx->db->escape($_POST['type']); $elements = $modx->db->escape($_POST['elements']); $default_text = $modx->db->escape($_POST['default_text']); -$rank = isset($_POST['rank']) ? $modx->db->escape($_POST['rank']) : 0; +$rank = isset ($_POST['rank']) ? $modx->db->escape($_POST['rank']) : 0; $display = $modx->db->escape($_POST['display']); $params = $modx->db->escape($_POST['params']); $locked = $_POST['locked'] == 'on' ? 1 : 0; @@ -213,8 +213,7 @@ function saveTemplateVarAccess() function saveDocumentAccessPermissons() { global $id, $newid; - $modx = evolutionCMS(); - global $use_udperms; + $modx = evolutionCMS(); global $use_udperms; $tbl_site_tmplvar_templates = $modx->getFullTableName('site_tmplvar_access'); diff --git a/manager/processors/save_user.processor.php b/manager/processors/save_user.processor.php index daf650acee..b853ee0b06 100755 --- a/manager/processors/save_user.processor.php +++ b/manager/processors/save_user.processor.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('save_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('save_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $modx->loadExtension('phpass'); @@ -16,7 +16,7 @@ $id = (int)$input['id']; $oldusername = $input['oldusername']; -$newusername = !empty($input['newusername']) ? trim($input['newusername']) : "New User"; +$newusername = !empty ($input['newusername']) ? trim($input['newusername']) : "New User"; $fullname = $input['fullname']; $genpassword = $input['newpassword']; $passwordgenmethod = $input['passwordgenmethod']; @@ -27,7 +27,7 @@ $phone = $input['phone']; $mobilephone = $input['mobilephone']; $fax = $input['fax']; -$dob = !empty($input['dob']) ? $modx->toTimeStamp($input['dob']) : 0; +$dob = !empty ($input['dob']) ? $modx->toTimeStamp($input['dob']) : 0; $country = $input['country']; $street = $input['street']; $city = $input['city']; @@ -44,133 +44,135 @@ $user_groups = $input['user_groups']; // verify password -if ($passwordgenmethod == "spec" && $input['specifiedpassword'] != $input['confirmpassword']) { - webAlertAndQuit("Password typed is mismatched"); +if($passwordgenmethod == "spec" && $input['specifiedpassword'] != $input['confirmpassword']) { + webAlertAndQuit("Password typed is mismatched"); } // verify email -if ($email == '' || !preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,24}$/i", $email)) { - webAlertAndQuit("E-mail address doesn't seem to be valid!"); +if($email == '' || !preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,24}$/i", $email)) { + webAlertAndQuit("E-mail address doesn't seem to be valid!"); } // verify admin security -if ($_SESSION['mgrRole'] != 1) { - // Check to see if user tried to spoof a "1" (admin) role - if (!$modx->hasPermission('save_role')) { - webAlertAndQuit("Illegal attempt to create/modify administrator by non-administrator!"); - } - // Verify that the user being edited wasn't an admin and the user ID got spoofed - $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, "internalKey='{$id}' AND role=1"); - $limit = $modx->db->getValue($rs); - if ($limit > 0) { - webAlertAndQuit("You cannot alter an administrative user."); - } +if($_SESSION['mgrRole'] != 1) { + // Check to see if user tried to spoof a "1" (admin) role + if(!$modx->hasPermission('save_role')) { + webAlertAndQuit("Illegal attempt to create/modify administrator by non-administrator!"); + } + // Verify that the user being edited wasn't an admin and the user ID got spoofed + $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, "internalKey='{$id}' AND role=1"); + $limit = $modx->db->getValue($rs); + if($limit > 0) { + webAlertAndQuit("You cannot alter an administrative user."); + } + } -switch ($input['mode']) { - case '11': // new user - // check if this user name already exist - $rs = $modx->db->select('count(id)', $tbl_manager_users, sprintf("username='%s'", $modx->db->escape($newusername))); - $limit = $modx->db->getValue($rs); - if ($limit > 0) { - webAlertAndQuit("User name is already in use!"); - } - - // check if the email address already exist - $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, sprintf("email='%s' AND id!='%s'", $modx->db->escape($email), $id)); - $limit = $modx->db->getValue($rs); - if ($limit > 0) { - webAlertAndQuit("Email is already in use!"); - } - - // generate a new password for this user - if ($specifiedpassword != "" && $passwordgenmethod == "spec") { - if (strlen($specifiedpassword) < 6) { - webAlertAndQuit("Password is too short!"); - } else { - $newpassword = $specifiedpassword; - } - } elseif ($specifiedpassword == "" && $passwordgenmethod == "spec") { - webAlertAndQuit("You didn't specify a password for this user!"); - } elseif ($passwordgenmethod == 'g') { - $newpassword = generate_password(8); - } else { - webAlertAndQuit("No password generation method specified!"); - } - - // invoke OnBeforeUserFormSave event - $modx->invokeEvent("OnBeforeUserFormSave", array( - "mode" => "new", - )); - - // create the user account - $internalKey = $modx->db->insert(array('username' => $modx->db->escape($newusername)), $tbl_manager_users); - - $field = array(); - $field['password'] = $modx->phpass->HashPassword($newpassword); - $modx->db->update($field, $tbl_manager_users, "id='{$internalKey}'"); - - $field = compact('internalKey', 'fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'blocked', 'blockeduntil', 'blockedafter'); - $field = $modx->db->escape($field); - $modx->db->insert($field, $tbl_user_attributes); - - // Save user settings - saveUserSettings($internalKey); - - // invoke OnManagerSaveUser event - $modx->invokeEvent("OnManagerSaveUser", array( - "mode" => "new", - "userid" => $internalKey, - "username" => $newusername, - "userpassword" => $newpassword, - "useremail" => $email, - "userfullname" => $fullname, - "userroleid" => $role - )); - - // invoke OnUserFormSave event - $modx->invokeEvent("OnUserFormSave", array( - "mode" => "new", - "id" => $internalKey - )); - - // Set the item name for logger - $_SESSION['itemname'] = $newusername; - - /*******************************************************************************/ - // put the user in the user_groups he/ she should be in - // first, check that up_perms are switched on! - if ($use_udperms == 1) { - if (!empty($user_groups)) { - for ($i = 0; $i < count($user_groups); $i++) { - $f = array(); - $f['user_group'] = (int)$user_groups[$i]; - $f['member'] = $internalKey; - $modx->db->insert($f, $tbl_member_groups); - } - } - } - // end of user_groups stuff! - - if ($passwordnotifymethod == 'e') { - sendMailMessage($email, $newusername, $newpassword, $fullname); - if ($input['stay'] != '') { - $a = ($input['stay'] == '2') ? "12&id={$internalKey}" : "11"; - $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay']; - header($header); - } else { - $header = "Location: index.php?a=75&r=2"; - header($header); - } - } else { - if ($input['stay'] != '') { - $a = ($input['stay'] == '2') ? "12&id={$internalKey}" : "11"; - $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; - } else { - $stayUrl = "index.php?a=75&r=2"; - } - - include_once "header.inc.php"; ?> +switch($input['mode']) { + case '11' : // new user + // check if this user name already exist + $rs = $modx->db->select('count(id)', $tbl_manager_users, sprintf("username='%s'", $modx->db->escape($newusername))); + $limit = $modx->db->getValue($rs); + if($limit > 0) { + webAlertAndQuit("User name is already in use!"); + } + + // check if the email address already exist + $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, sprintf("email='%s' AND id!='%s'", $modx->db->escape($email), $id)); + $limit = $modx->db->getValue($rs); + if($limit > 0) { + webAlertAndQuit("Email is already in use!"); + } + + // generate a new password for this user + if($specifiedpassword != "" && $passwordgenmethod == "spec") { + if(strlen($specifiedpassword) < 6) { + webAlertAndQuit("Password is too short!"); + } else { + $newpassword = $specifiedpassword; + } + } elseif($specifiedpassword == "" && $passwordgenmethod == "spec") { + webAlertAndQuit("You didn't specify a password for this user!"); + } elseif($passwordgenmethod == 'g') { + $newpassword = generate_password(8); + } else { + webAlertAndQuit("No password generation method specified!"); + } + + // invoke OnBeforeUserFormSave event + $modx->invokeEvent("OnBeforeUserFormSave", array( + "mode" => "new", + )); + + // create the user account + $internalKey = $modx->db->insert(array('username' => $modx->db->escape($newusername)), $tbl_manager_users); + + $field = array(); + $field['password'] = $modx->phpass->HashPassword($newpassword); + $modx->db->update($field, $tbl_manager_users, "id='{$internalKey}'"); + + $field = compact('internalKey', 'fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'blocked', 'blockeduntil', 'blockedafter'); + $field = $modx->db->escape($field); + $modx->db->insert($field, $tbl_user_attributes); + + // Save user settings + saveUserSettings($internalKey); + + // invoke OnManagerSaveUser event + $modx->invokeEvent("OnManagerSaveUser", array( + "mode" => "new", + "userid" => $internalKey, + "username" => $newusername, + "userpassword" => $newpassword, + "useremail" => $email, + "userfullname" => $fullname, + "userroleid" => $role + )); + + // invoke OnUserFormSave event + $modx->invokeEvent("OnUserFormSave", array( + "mode" => "new", + "id" => $internalKey + )); + + // Set the item name for logger + $_SESSION['itemname'] = $newusername; + + /*******************************************************************************/ + // put the user in the user_groups he/ she should be in + // first, check that up_perms are switched on! + if($use_udperms == 1) { + if(!empty($user_groups)) { + for($i = 0; $i < count($user_groups); $i++) { + $f = array(); + $f['user_group'] = (int)$user_groups[$i]; + $f['member'] = $internalKey; + $modx->db->insert($f, $tbl_member_groups); + } + } + } + // end of user_groups stuff! + + if($passwordnotifymethod == 'e') { + sendMailMessage($email, $newusername, $newpassword, $fullname); + if($input['stay'] != '') { + $a = ($input['stay'] == '2') ? "12&id={$internalKey}" : "11"; + $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay']; + header($header); + } else { + $header = "Location: index.php?a=75&r=2"; + header($header); + } + } else { + if($input['stay'] != '') { + $a = ($input['stay'] == '2') ? "12&id={$internalKey}" : "11"; + $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; + } else { + $stayUrl = "index.php?a=75&r=2"; + } + + include_once "header.inc.php"; + ?>

    @@ -192,124 +194,125 @@
    db->select('count(id)', $tbl_manager_users, sprintf("username='%s' AND id!='%s'", $modx->db->escape($newusername), $id)); - $limit = $modx->db->getValue($rs); - if ($limit > 0) { - webAlertAndQuit("User name is already in use!"); - } - - // check if the email address already exists - $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, sprintf("email='%s' AND internalKey!='%s'", $modx->db->escape($email), $id)); - $limit = $modx->db->getValue($rs); - if ($limit > 0) { - webAlertAndQuit("Email is already in use!"); - } - - // invoke OnBeforeUserFormSave event - $modx->invokeEvent("OnBeforeUserFormSave", array( - "mode" => "upd", - "id" => $id - )); - - // update user name and password - $field = array(); - $field['username'] = $modx->db->escape($newusername); - if ($genpassword == 1) { - $field['password'] = $modx->phpass->HashPassword($newpassword); - } - $modx->db->update($field, $tbl_manager_users, "id='{$id}'"); - $field = compact('fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'failedlogincount', 'blocked', 'blockeduntil', 'blockedafter'); - $field = $modx->db->escape($field); - $modx->db->update($field, $tbl_user_attributes, "internalKey='{$id}'"); - - // Save user settings - saveUserSettings($id); - - // Set the item name for logger - $_SESSION['itemname'] = $newusername; - - // invoke OnManagerSaveUser event - $modx->invokeEvent("OnManagerSaveUser", array( - "mode" => "upd", - "userid" => $id, - "username" => $newusername, - "userpassword" => $newpassword, - "useremail" => $email, - "userfullname" => $fullname, - "userroleid" => $role, - "oldusername" => (($oldusername != $newusername) ? $oldusername : ""), - "olduseremail" => (($oldemail != $email) ? $oldemail : "") - )); - - // invoke OnManagerChangePassword event - if ($genpassword == 1) { - $modx->invokeEvent("OnManagerChangePassword", array( - "userid" => $id, - "username" => $newusername, - "userpassword" => $newpassword - )); - } - - // invoke OnUserFormSave event - $modx->invokeEvent("OnUserFormSave", array( - "mode" => "upd", - "id" => $id - )); - - /*******************************************************************************/ - // put the user in the user_groups he/ she should be in - // first, check that up_perms are switched on! - if ($use_udperms == 1) { - // as this is an existing user, delete his/ her entries in the groups before saving the new groups - $modx->db->delete($tbl_member_groups, "member='{$id}'"); - if (!empty($user_groups)) { - for ($i = 0; $i < count($user_groups); $i++) { - $field = array(); - $field['user_group'] = (int)$user_groups[$i]; - $field['member'] = $id; - $modx->db->insert($field, $tbl_member_groups); - } - } - } - // end of user_groups stuff! - /*******************************************************************************/ - if ($id == $modx->getLoginUserID() && ($genpassword !== 1 && $passwordnotifymethod != 's')) { - $modx->webAlertAndQuit($_lang["user_changeddata"], 'javascript:top.location.href="index.php?a=8";'); - } - if ($genpassword == 1 && $passwordnotifymethod == 's') { - if ($input['stay'] != '') { - $a = ($input['stay'] == '2') ? "12&id={$id}" : "11"; - $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; - } else { - $stayUrl = "index.php?a=75&r=2"; - } - - include_once "header.inc.php"; ?> + include_once "footer.inc.php"; + } + break; + case '12' : // edit user + // generate a new password for this user + if($genpassword == 1) { + if($specifiedpassword != "" && $passwordgenmethod == "spec") { + if(strlen($specifiedpassword) < 6) { + webAlertAndQuit("Password is too short!"); + } else { + $newpassword = $specifiedpassword; + } + } elseif($specifiedpassword == "" && $passwordgenmethod == "spec") { + webAlertAndQuit("You didn't specify a password for this user!"); + } elseif($passwordgenmethod == 'g') { + $newpassword = generate_password(8); + } else { + webAlertAndQuit("No password generation method specified!"); + } + } + if($passwordnotifymethod == 'e') { + sendMailMessage($email, $newusername, $newpassword, $fullname); + } + + // check if the username already exist + $rs = $modx->db->select('count(id)', $tbl_manager_users, sprintf("username='%s' AND id!='%s'", $modx->db->escape($newusername), $id)); + $limit = $modx->db->getValue($rs); + if($limit > 0) { + webAlertAndQuit("User name is already in use!"); + } + + // check if the email address already exists + $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, sprintf("email='%s' AND internalKey!='%s'", $modx->db->escape($email), $id)); + $limit = $modx->db->getValue($rs); + if($limit > 0) { + webAlertAndQuit("Email is already in use!"); + } + + // invoke OnBeforeUserFormSave event + $modx->invokeEvent("OnBeforeUserFormSave", array( + "mode" => "upd", + "id" => $id + )); + + // update user name and password + $field = array(); + $field['username'] = $modx->db->escape($newusername); + if($genpassword == 1) { + $field['password'] = $modx->phpass->HashPassword($newpassword); + } + $modx->db->update($field, $tbl_manager_users, "id='{$id}'"); + $field = compact('fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'failedlogincount', 'blocked', 'blockeduntil', 'blockedafter'); + $field = $modx->db->escape($field); + $modx->db->update($field, $tbl_user_attributes, "internalKey='{$id}'"); + + // Save user settings + saveUserSettings($id); + + // Set the item name for logger + $_SESSION['itemname'] = $newusername; + + // invoke OnManagerSaveUser event + $modx->invokeEvent("OnManagerSaveUser", array( + "mode" => "upd", + "userid" => $id, + "username" => $newusername, + "userpassword" => $newpassword, + "useremail" => $email, + "userfullname" => $fullname, + "userroleid" => $role, + "oldusername" => (($oldusername != $newusername) ? $oldusername : ""), + "olduseremail" => (($oldemail != $email) ? $oldemail : "") + )); + + // invoke OnManagerChangePassword event + if($genpassword == 1) { + $modx->invokeEvent("OnManagerChangePassword", array( + "userid" => $id, + "username" => $newusername, + "userpassword" => $newpassword + )); + } + + // invoke OnUserFormSave event + $modx->invokeEvent("OnUserFormSave", array( + "mode" => "upd", + "id" => $id + )); + + /*******************************************************************************/ + // put the user in the user_groups he/ she should be in + // first, check that up_perms are switched on! + if($use_udperms == 1) { + // as this is an existing user, delete his/ her entries in the groups before saving the new groups + $modx->db->delete($tbl_member_groups, "member='{$id}'"); + if(!empty($user_groups)) { + for($i = 0; $i < count($user_groups); $i++) { + $field = array(); + $field['user_group'] = (int)$user_groups[$i]; + $field['member'] = $id; + $modx->db->insert($field, $tbl_member_groups); + } + } + } + // end of user_groups stuff! + /*******************************************************************************/ + if($id == $modx->getLoginUserID() && ($genpassword !== 1 && $passwordnotifymethod != 's')) { + $modx->webAlertAndQuit($_lang["user_changeddata"], 'javascript:top.location.href="index.php?a=8";'); + } + if($genpassword == 1 && $passwordnotifymethod == 's') { + if($input['stay'] != '') { + $a = ($input['stay'] == '2') ? "12&id={$id}" : "11"; + $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; + } else { + $stayUrl = "index.php?a=75&r=2"; + } + + include_once "header.inc.php"; + ?>

    @@ -329,20 +332,20 @@ "; - $param['subject'] = $emailsubject; - $param['body'] = $message; - $param['to'] = $email; - $param['type'] = 'text'; - $rs = $modx->sendmail($param); - if (!$rs) { - $modx->manager->saveFormValues(); - $modx->messageQuit("{$email} - {$_lang['error_sending_email']}"); - } +function sendMailMessage($email, $uid, $pwd, $ufn) { + $modx = evolutionCMS(); global $_lang, $signupemail_message; + global $emailsubject, $emailsender; + global $site_name; + $manager_url = MODX_MANAGER_URL; + $message = sprintf($signupemail_message, $uid, $pwd); // use old method + // replace placeholders + $message = str_replace("[+uid+]", $uid, $message); + $message = str_replace("[+pwd+]", $pwd, $message); + $message = str_replace("[+ufn+]", $ufn, $message); + $message = str_replace("[+sname+]", $site_name, $message); + $message = str_replace("[+saddr+]", $emailsender, $message); + $message = str_replace("[+semail+]", $emailsender, $message); + $message = str_replace("[+surl+]", $manager_url, $message); + + $param = array(); + $param['from'] = "{$site_name}<{$emailsender}>"; + $param['subject'] = $emailsubject; + $param['body'] = $message; + $param['to'] = $email; + $param['type'] = 'text'; + $rs = $modx->sendmail($param); + if(!$rs) { + $modx->manager->saveFormValues(); + $modx->messageQuit("{$email} - {$_lang['error_sending_email']}"); + } } /** @@ -388,88 +389,87 @@ function sendMailMessage($email, $uid, $pwd, $ufn) * * @param int $id */ -function saveUserSettings($id) -{ - $modx = evolutionCMS(); - $tbl_user_settings = $modx->getFullTableName('user_settings'); - - $ignore = array( - 'id', - 'oldusername', - 'oldemail', - 'newusername', - 'fullname', - 'newpassword', - 'newpasswordcheck', - 'passwordgenmethod', - 'passwordnotifymethod', - 'specifiedpassword', - 'confirmpassword', - 'email', - 'phone', - 'mobilephone', - 'fax', - 'dob', - 'country', - 'street', - 'city', - 'state', - 'zip', - 'gender', - 'photo', - 'comment', - 'role', - 'failedlogincount', - 'blocked', - 'blockeduntil', - 'blockedafter', - 'user_groups', - 'mode', - 'blockedmode', - 'stay', - 'save', - 'theme_refresher' - ); - - // determine which settings can be saved blank (based on 'default_{settingname}' POST checkbox values) - $defaults = array( - 'upload_images', - 'upload_media', - 'upload_flash', - 'upload_files' - ); - - // get user setting field names - $settings = array(); - foreach ($_POST as $n => $v) { - if (in_array($n, $ignore) || (!in_array($n, $defaults) && is_scalar($v) && trim($v) == '') || (!in_array($n, $defaults) && is_array($v) && empty($v))) { - continue; - } // ignore blacklist and empties - $settings[$n] = $v; // this value should be saved - } - - foreach ($defaults as $k) { - if (isset($settings['default_' . $k]) && $settings['default_' . $k] == '1') { - unset($settings[$k]); - } - unset($settings['default_' . $k]); - } - - $modx->db->delete($tbl_user_settings, "user='{$id}'"); - - foreach ($settings as $n => $vl) { - if (is_array($vl)) { - $vl = implode(",", $vl); - } - if ($vl != '') { - $f = array(); - $f['user'] = $id; - $f['setting_name'] = $n; - $f['setting_value'] = $vl; - $f = $modx->db->escape($f); - $modx->db->insert($f, $tbl_user_settings); - } - } +function saveUserSettings($id) { + $modx = evolutionCMS(); + $tbl_user_settings = $modx->getFullTableName('user_settings'); + + $ignore = array( + 'id', + 'oldusername', + 'oldemail', + 'newusername', + 'fullname', + 'newpassword', + 'newpasswordcheck', + 'passwordgenmethod', + 'passwordnotifymethod', + 'specifiedpassword', + 'confirmpassword', + 'email', + 'phone', + 'mobilephone', + 'fax', + 'dob', + 'country', + 'street', + 'city', + 'state', + 'zip', + 'gender', + 'photo', + 'comment', + 'role', + 'failedlogincount', + 'blocked', + 'blockeduntil', + 'blockedafter', + 'user_groups', + 'mode', + 'blockedmode', + 'stay', + 'save', + 'theme_refresher' + ); + + // determine which settings can be saved blank (based on 'default_{settingname}' POST checkbox values) + $defaults = array( + 'upload_images', + 'upload_media', + 'upload_flash', + 'upload_files' + ); + + // get user setting field names + $settings = array(); + foreach($_POST as $n => $v) { + if(in_array($n, $ignore) || (!in_array($n, $defaults) && is_scalar($v) && trim($v) == '') || (!in_array($n, $defaults) && is_array($v) && empty($v))) { + continue; + } // ignore blacklist and empties + $settings[$n] = $v; // this value should be saved + } + + foreach($defaults as $k) { + if(isset($settings['default_' . $k]) && $settings['default_' . $k] == '1') { + unset($settings[$k]); + } + unset($settings['default_' . $k]); + } + + $modx->db->delete($tbl_user_settings, "user='{$id}'"); + + foreach($settings as $n => $vl) { + if(is_array($vl)) { + $vl = implode(",", $vl); + } + if($vl != '') { + $f = array(); + $f['user'] = $id; + $f['setting_name'] = $n; + $f['setting_value'] = $vl; + $f = $modx->db->escape($f); + $modx->db->insert($f, $tbl_user_settings); + } + } } /** @@ -477,12 +477,11 @@ function saveUserSettings($id) * * @param $msg */ -function webAlertAndQuit($msg) -{ - global $id, $modx; - $mode = $_POST['mode']; - $modx->manager->saveFormValues($mode); - $modx->webAlertAndQuit($msg, "index.php?a={$mode}" . ($mode == '12' ? "&id={$id}" : '')); +function webAlertAndQuit($msg) { + global $id, $modx; + $mode = $_POST['mode']; + $modx->manager->saveFormValues($mode); + $modx->webAlertAndQuit($msg, "index.php?a={$mode}" . ($mode == '12' ? "&id={$id}" : '')); } /** @@ -491,14 +490,13 @@ function webAlertAndQuit($msg) * @param int $length * @return string */ -function generate_password($length = 10) -{ - $allowable_characters = "abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"; - $ps_len = strlen($allowable_characters); - mt_srand((double) microtime() * 1000000); - $pass = ""; - for ($i = 0; $i < $length; $i++) { - $pass .= $allowable_characters[mt_rand(0, $ps_len - 1)]; - } - return $pass; +function generate_password($length = 10) { + $allowable_characters = "abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"; + $ps_len = strlen($allowable_characters); + mt_srand((double) microtime() * 1000000); + $pass = ""; + for($i = 0; $i < $length; $i++) { + $pass .= $allowable_characters[mt_rand(0, $ps_len - 1)]; + } + return $pass; } diff --git a/manager/processors/save_web_user.processor.php b/manager/processors/save_web_user.processor.php index 9414759856..f1d1e7a98e 100755 --- a/manager/processors/save_web_user.processor.php +++ b/manager/processors/save_web_user.processor.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('save_web_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('save_web_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $tbl_web_users = $modx->getFullTableName('web_users'); @@ -11,16 +11,16 @@ $tbl_web_groups = $modx->getFullTableName('web_groups'); $input = $_POST; -foreach ($input as $k => $v) { - if ($k !== 'comment') { - $v = sanitize($v); - } - $input[$k] = $v; +foreach($input as $k => $v) { + if($k !== 'comment') { + $v = sanitize($v); + } + $input[$k] = $v; } $id = (int)$input['id']; $oldusername = $input['oldusername']; -$newusername = !empty($input['newusername']) ? trim($input['newusername']) : "New User"; +$newusername = !empty ($input['newusername']) ? trim($input['newusername']) : "New User"; $esc_newusername = $modx->db->escape($newusername); $fullname = $input['fullname']; $genpassword = $input['newpassword']; @@ -33,7 +33,7 @@ $phone = $input['phone']; $mobilephone = $input['mobilephone']; $fax = $input['fax']; -$dob = !empty($input['dob']) ? $modx->toTimeStamp($input['dob']) : 0; +$dob = !empty ($input['dob']) ? $modx->toTimeStamp($input['dob']) : 0; $country = $input['country']; $street = $input['street']; $city = $input['city']; @@ -50,83 +50,83 @@ $user_groups = $input['user_groups']; // verify password -if ($passwordgenmethod == "spec" && $input['specifiedpassword'] != $input['confirmpassword']) { - webAlertAndQuit("Password typed is mismatched"); +if($passwordgenmethod == "spec" && $input['specifiedpassword'] != $input['confirmpassword']) { + webAlertAndQuit("Password typed is mismatched"); } // verify email -if ($email == '' || !preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,24}$/i", $email)) { - webAlertAndQuit("E-mail address doesn't seem to be valid!"); +if($email == '' || !preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,24}$/i", $email)) { + webAlertAndQuit("E-mail address doesn't seem to be valid!"); } -switch ($input['mode']) { - case '87': // new user - // check if this user name already exist - $rs = $modx->db->select('count(id)', $tbl_web_users, "username='{$esc_newusername}'"); - $limit = $modx->db->getValue($rs); - if ($limit > 0) { - webAlertAndQuit("User name is already in use!"); - } - - // check if the email address already exist - if ($modx->config['allow_multiple_emails'] != 1) { - $rs = $modx->db->select('count(id)', $tbl_web_user_attributes, "email='{$esc_email}' AND id!='{$id}'"); - $limit = $modx->db->getValue($rs); - if ($limit > 0) { - webAlertAndQuit("Email is already in use!"); - } - } - - // generate a new password for this user - if ($specifiedpassword != "" && $passwordgenmethod == "spec") { - if (strlen($specifiedpassword) < 6) { - webAlertAndQuit("Password is too short!"); - } else { - $newpassword = $specifiedpassword; - } - } elseif ($specifiedpassword == "" && $passwordgenmethod == "spec") { - webAlertAndQuit("You didn't specify a password for this user!"); - } elseif ($passwordgenmethod == 'g') { - $newpassword = generate_password(8); - } else { - webAlertAndQuit("No password generation method specified!"); - } - - // invoke OnBeforeWUsrFormSave event - $modx->invokeEvent("OnBeforeWUsrFormSave", array( - "mode" => "new", - )); - - // create the user account - $field = array(); - $field['username'] = $esc_newusername; - $field['password'] = md5($newpassword); - $internalKey = $modx->db->insert($field, $tbl_web_users); - - $field = compact('internalKey', 'fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'blocked', 'blockeduntil', 'blockedafter'); - $field = $modx->db->escape($field); - $modx->db->insert($field, $tbl_web_user_attributes); - - // Save User Settings - saveUserSettings($internalKey); - - // Set the item name for logger - $_SESSION['itemname'] = $newusername; - - /*******************************************************************************/ - // put the user in the user_groups he/ she should be in - // first, check that up_perms are switched on! - if ($use_udperms == 1) { - if (!empty($user_groups)) { - for ($i = 0; $i < count($user_groups); $i++) { - $f = array(); - $f['webgroup'] = (int)$user_groups[$i]; - $f['webuser'] = $internalKey; - $modx->db->insert($f, $tbl_web_groups); - } - } - } - // end of user_groups stuff! +switch($input['mode']) { + case '87' : // new user + // check if this user name already exist + $rs = $modx->db->select('count(id)', $tbl_web_users, "username='{$esc_newusername}'"); + $limit = $modx->db->getValue($rs); + if($limit > 0) { + webAlertAndQuit("User name is already in use!"); + } + + // check if the email address already exist + if ($modx->config['allow_multiple_emails'] != 1) { + $rs = $modx->db->select('count(id)', $tbl_web_user_attributes, "email='{$esc_email}' AND id!='{$id}'"); + $limit = $modx->db->getValue($rs); + if($limit > 0) { + webAlertAndQuit("Email is already in use!"); + } + } + + // generate a new password for this user + if($specifiedpassword != "" && $passwordgenmethod == "spec") { + if(strlen($specifiedpassword) < 6) { + webAlertAndQuit("Password is too short!"); + } else { + $newpassword = $specifiedpassword; + } + } elseif($specifiedpassword == "" && $passwordgenmethod == "spec") { + webAlertAndQuit("You didn't specify a password for this user!"); + } elseif($passwordgenmethod == 'g') { + $newpassword = generate_password(8); + } else { + webAlertAndQuit("No password generation method specified!"); + } + + // invoke OnBeforeWUsrFormSave event + $modx->invokeEvent("OnBeforeWUsrFormSave", array( + "mode" => "new", + )); + + // create the user account + $field = array(); + $field['username'] = $esc_newusername; + $field['password'] = md5($newpassword); + $internalKey = $modx->db->insert($field, $tbl_web_users); + + $field = compact('internalKey', 'fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'blocked', 'blockeduntil', 'blockedafter'); + $field = $modx->db->escape($field); + $modx->db->insert($field, $tbl_web_user_attributes); + + // Save User Settings + saveUserSettings($internalKey); + + // Set the item name for logger + $_SESSION['itemname'] = $newusername; + + /*******************************************************************************/ + // put the user in the user_groups he/ she should be in + // first, check that up_perms are switched on! + if($use_udperms == 1) { + if(!empty($user_groups)) { + for($i = 0; $i < count($user_groups); $i++) { + $f = array(); + $f['webgroup'] = (int)$user_groups[$i]; + $f['webuser'] = $internalKey; + $modx->db->insert($f, $tbl_web_groups); + } + } + } + // end of user_groups stuff! // invoke OnWebSaveUser event $modx->invokeEvent("OnWebSaveUser", array( @@ -144,25 +144,26 @@ "id" => $internalKey )); - if ($passwordnotifymethod == 'e') { - sendMailMessage($email, $newusername, $newpassword, $fullname); - if ($input['stay'] != '') { - $a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87"; - $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay']; - header($header); - } else { - $header = "Location: index.php?a=99&r=2"; - header($header); - } - } else { - if ($input['stay'] != '') { - $a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87"; - $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; - } else { - $stayUrl = "index.php?a=99&r=2"; - } - - include_once "header.inc.php"; ?> + if($passwordnotifymethod == 'e') { + sendMailMessage($email, $newusername, $newpassword, $fullname); + if($input['stay'] != '') { + $a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87"; + $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay']; + header($header); + } else { + $header = "Location: index.php?a=99&r=2"; + header($header); + } + } else { + if($input['stay'] != '') { + $a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87"; + $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; + } else { + $stayUrl = "index.php?a=99&r=2"; + } + + include_once "header.inc.php"; + ?>

    @@ -184,86 +185,86 @@ db->select('count(id)', $tbl_web_users, "username='{$esc_newusername}' AND id!='{$id}'"); - $limit = $modx->db->getValue($rs); - if ($limit > 0) { - webAlertAndQuit("User name is already in use!"); - } - - // check if the email address already exists - if ($modx->config['allow_multiple_emails'] != 1) { - $rs = $modx->db->select('count(internalKey)', $tbl_web_user_attributes, "email='{$esc_email}' AND internalKey!='{$id}'"); - $limit = $modx->db->getValue($rs); - if ($limit > 0) { - webAlertAndQuit("Email is already in use!"); - } - } - - // invoke OnBeforeWUsrFormSave event - $modx->invokeEvent("OnBeforeWUsrFormSave", array( - "mode" => "upd", - "id" => $id - )); - - // update user name and password - $field = array(); - $field['username'] = $esc_newusername; - if ($genpassword == 1) { - $field['password'] = md5($newpassword); - } - $modx->db->update($field, $tbl_web_users, "id='{$id}'"); - $field = compact('fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'failedlogincount', 'blocked', 'blockeduntil', 'blockedafter'); - $field = $modx->db->escape($field); - $modx->db->update($field, $tbl_web_user_attributes, "internalKey='{$id}'"); - - // Save User Settings - saveUserSettings($id); - - // Set the item name for logger - $_SESSION['itemname'] = $newusername; - - /*******************************************************************************/ - // put the user in the user_groups he/ she should be in - // first, check that up_perms are switched on! - if ($use_udperms == 1) { - // as this is an existing user, delete his/ her entries in the groups before saving the new groups - $modx->db->delete($tbl_web_groups, "webuser='{$id}'"); - if (!empty($user_groups)) { - for ($i = 0; $i < count($user_groups); $i++) { - $field = array(); - $field['webgroup'] = (int)$user_groups[$i]; - $field['webuser'] = $id; - $modx->db->insert($field, $tbl_web_groups); - } - } - } - // end of user_groups stuff! - /*******************************************************************************/ + include_once "footer.inc.php"; + } + break; + case '88' : // edit user + // generate a new password for this user + if($genpassword == 1) { + if($specifiedpassword != "" && $passwordgenmethod == "spec") { + if(strlen($specifiedpassword) < 6) { + webAlertAndQuit("Password is too short!"); + } else { + $newpassword = $specifiedpassword; + } + } elseif($specifiedpassword == "" && $passwordgenmethod == "spec") { + webAlertAndQuit("You didn't specify a password for this user!"); + } elseif($passwordgenmethod == 'g') { + $newpassword = generate_password(8); + } else { + webAlertAndQuit("No password generation method specified!"); + } + } + if($passwordnotifymethod == 'e') { + sendMailMessage($email, $newusername, $newpassword, $fullname); + } + + // check if the username already exist + $rs = $modx->db->select('count(id)', $tbl_web_users, "username='{$esc_newusername}' AND id!='{$id}'"); + $limit = $modx->db->getValue($rs); + if($limit > 0) { + webAlertAndQuit("User name is already in use!"); + } + + // check if the email address already exists + if ($modx->config['allow_multiple_emails'] != 1) { + $rs = $modx->db->select('count(internalKey)', $tbl_web_user_attributes, "email='{$esc_email}' AND internalKey!='{$id}'"); + $limit = $modx->db->getValue($rs); + if($limit > 0) { + webAlertAndQuit("Email is already in use!"); + } + } + + // invoke OnBeforeWUsrFormSave event + $modx->invokeEvent("OnBeforeWUsrFormSave", array( + "mode" => "upd", + "id" => $id + )); + + // update user name and password + $field = array(); + $field['username'] = $esc_newusername; + if($genpassword == 1) { + $field['password'] = md5($newpassword); + } + $modx->db->update($field, $tbl_web_users, "id='{$id}'"); + $field = compact('fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'failedlogincount', 'blocked', 'blockeduntil', 'blockedafter'); + $field = $modx->db->escape($field); + $modx->db->update($field, $tbl_web_user_attributes, "internalKey='{$id}'"); + + // Save User Settings + saveUserSettings($id); + + // Set the item name for logger + $_SESSION['itemname'] = $newusername; + + /*******************************************************************************/ + // put the user in the user_groups he/ she should be in + // first, check that up_perms are switched on! + if($use_udperms == 1) { + // as this is an existing user, delete his/ her entries in the groups before saving the new groups + $modx->db->delete($tbl_web_groups, "webuser='{$id}'"); + if(!empty($user_groups)) { + for($i = 0; $i < count($user_groups); $i++) { + $field = array(); + $field['webgroup'] = (int)$user_groups[$i]; + $field['webuser'] = $id; + $modx->db->insert($field, $tbl_web_groups); + } + } + } + // end of user_groups stuff! + /*******************************************************************************/ // invoke OnWebSaveUser event $modx->invokeEvent("OnWebSaveUser", array( @@ -278,7 +279,7 @@ )); // invoke OnWebChangePassword event - if ($genpassword == 1) { + if($genpassword == 1) { $modx->invokeEvent("OnWebChangePassword", array( "userid" => $id, "username" => $newusername, @@ -292,15 +293,16 @@ "id" => $id )); - if ($genpassword == 1 && $passwordnotifymethod == 's') { - if ($input['stay'] != '') { - $a = ($input['stay'] == '2') ? "88&id={$id}" : "87"; - $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; - } else { - $stayUrl = "index.php?a=99&r=2"; - } + if($genpassword == 1 && $passwordnotifymethod == 's') { + if($input['stay'] != '') { + $a = ($input['stay'] == '2') ? "88&id={$id}" : "87"; + $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; + } else { + $stayUrl = "index.php?a=99&r=2"; + } - include_once "header.inc.php"; ?> + include_once "header.inc.php"; + ?>

    @@ -320,20 +322,20 @@ "; - $param['subject'] = $emailsubject; - $param['body'] = $message; - $param['to'] = $email; - $param['type'] = 'text'; - $rs = $modx->sendmail($param); - if (!$rs) { - $modx->manager->saveFormValues(); - $modx->messageQuit("{$email} - {$_lang['error_sending_email']}"); - } +function sendMailMessage($email, $uid, $pwd, $ufn) { + $modx = evolutionCMS(); global $_lang, $websignupemail_message; + global $emailsubject, $emailsender; + global $site_name, $site_url; + $message = sprintf($websignupemail_message, $uid, $pwd); // use old method + // replace placeholders + $message = str_replace("[+uid+]", $uid, $message); + $message = str_replace("[+pwd+]", $pwd, $message); + $message = str_replace("[+ufn+]", $ufn, $message); + $message = str_replace("[+sname+]", $site_name, $message); + $message = str_replace("[+saddr+]", $emailsender, $message); + $message = str_replace("[+semail+]", $emailsender, $message); + $message = str_replace("[+surl+]", $site_url, $message); + + $param = array(); + $param['from'] = "{$site_name}<{$emailsender}>"; + $param['subject'] = $emailsubject; + $param['body'] = $message; + $param['to'] = $email; + $param['type'] = 'text'; + $rs = $modx->sendmail($param); + if(!$rs) { + $modx->manager->saveFormValues(); + $modx->messageQuit("{$email} - {$_lang['error_sending_email']}"); + } } // Save User Settings -function saveUserSettings($id) -{ - $modx = evolutionCMS(); - $tbl_web_user_settings = $modx->getFullTableName('web_user_settings'); - - $settings = array( - "login_home", - "allowed_ip", - "allowed_days" - ); - - $modx->db->delete($tbl_web_user_settings, "webuser='{$id}'"); - - foreach ($settings as $n) { - $vl = $_POST[$n]; - if (is_array($vl)) { - $vl = implode(",", $vl); - } - if ($vl != '') { - $f = array(); - $f['webuser'] = $id; - $f['setting_name'] = $n; - $f['setting_value'] = $vl; - $f = $modx->db->escape($f); - $modx->db->insert($f, $tbl_web_user_settings); - } - } +function saveUserSettings($id) { + $modx = evolutionCMS(); + $tbl_web_user_settings = $modx->getFullTableName('web_user_settings'); + + $settings = array( + "login_home", + "allowed_ip", + "allowed_days" + ); + + $modx->db->delete($tbl_web_user_settings, "webuser='{$id}'"); + + foreach($settings as $n) { + $vl = $_POST[$n]; + if(is_array($vl)) { + $vl = implode(",", $vl); + } + if($vl != '') { + $f = array(); + $f['webuser'] = $id; + $f['setting_name'] = $n; + $f['setting_value'] = $vl; + $f = $modx->db->escape($f); + $modx->db->insert($f, $tbl_web_user_settings); + } + } } // Web alert - sends an alert to web browser -function webAlertAndQuit($msg) -{ - global $id, $modx; - $mode = $_POST['mode']; - $modx->manager->saveFormValues($mode); - $modx->webAlertAndQuit($msg, "index.php?a={$mode}" . ($mode == '88' ? "&id={$id}" : '')); +function webAlertAndQuit($msg) { + global $id, $modx; + $mode = $_POST['mode']; + $modx->manager->saveFormValues($mode); + $modx->webAlertAndQuit($msg, "index.php?a={$mode}" . ($mode == '88' ? "&id={$id}" : '')); } // Generate password -function generate_password($length = 10) -{ - $allowable_characters = "abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"; - $ps_len = strlen($allowable_characters); - mt_srand((double) microtime() * 1000000); - $pass = ""; - for ($i = 0; $i < $length; $i++) { - $pass .= $allowable_characters[mt_rand(0, $ps_len - 1)]; - } - return $pass; +function generate_password($length = 10) { + $allowable_characters = "abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"; + $ps_len = strlen($allowable_characters); + mt_srand((double) microtime() * 1000000); + $pass = ""; + for($i = 0; $i < $length; $i++) { + $pass .= $allowable_characters[mt_rand(0, $ps_len - 1)]; + } + return $pass; } -function sanitize($str = '', $safecount = 0) -{ - $modx = evolutionCMS(); - $safecount++; - if (1000 < $safecount) { - exit("error too many loops '{$safecount}'"); - } - if (is_array($str)) { - foreach ($str as $i => $v) { - $str[$i] = sanitize($v, $safecount); - } - } else { - // $str = strip_tags($str); // LEAVE < and > intact - $str = htmlspecialchars($str, ENT_NOQUOTES, $modx->config['modx_charset']); - } - return $str; +function sanitize($str = '', $safecount = 0) { + $modx = evolutionCMS(); + $safecount++; + if(1000 < $safecount) { + exit("error too many loops '{$safecount}'"); + } + if(is_array($str)) { + foreach($str as $i => $v) { + $str[$i] = sanitize($v, $safecount); + } + } else { + // $str = strip_tags($str); // LEAVE < and > intact + $str = htmlspecialchars($str, ENT_NOQUOTES, $modx->config['modx_charset']); + } + return $str; } diff --git a/manager/processors/send_message.processor.php b/manager/processors/send_message.processor.php index 7ddd362ec5..868f1ab8d1 100755 --- a/manager/processors/send_message.processor.php +++ b/manager/processors/send_message.processor.php @@ -1,74 +1,70 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('messages')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('messages')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $sendto = $_REQUEST['sendto']; $userid = $_REQUEST['user']; $groupid = $_REQUEST['group']; $subject = $modx->db->escape($_REQUEST['messagesubject']); -if ($subject=="") { - $subject="(no subject)"; -} +if($subject=="") $subject="(no subject)"; $message = $modx->db->escape($_REQUEST['messagebody']); -if ($message=="") { - $message="(no message)"; -} +if($message=="") $message="(no message)"; $postdate = time(); -if ($sendto=='u') { - if ($userid==0) { - $modx->webAlertAndQuit($_lang["error_no_user_selected"]); - } - $modx->db->insert( - array( - 'recipient' => $userid, - 'sender' => $modx->getLoginUserID(), - 'subject' => $subject, - 'message' => $message, - 'postdate' => $postdate, - 'type' => 'Message', - 'private' => 1, - ), $modx->getFullTableName('user_messages')); +if($sendto=='u') { + if($userid==0) { + $modx->webAlertAndQuit($_lang["error_no_user_selected"]); + } + $modx->db->insert( + array( + 'recipient' => $userid, + 'sender' => $modx->getLoginUserID(), + 'subject' => $subject, + 'message' => $message, + 'postdate' => $postdate, + 'type' => 'Message', + 'private' => 1, + ), $modx->getFullTableName('user_messages')); } -if ($sendto=='g') { - if ($groupid==0) { - $modx->webAlertAndQuit($_lang["error_no_group_selected"]); - } - $rs = $modx->db->select('internalKey', $modx->getFullTableName('user_attributes'), "role='{$groupid}' AND internalKey!='" . $modx->getLoginUserID() . "'"); - while ($row=$modx->db->getRow($rs)) { - $modx->db->insert( - array( - 'recipient' => $row['internalKey'], - 'sender' => $modx->getLoginUserID(), - 'subject' => $subject, - 'message' => $message, - 'postdate' => $postdate, - 'type' => 'Message', - 'private' => 0, - ), $modx->getFullTableName('user_messages')); - } +if($sendto=='g') { + if($groupid==0) { + $modx->webAlertAndQuit($_lang["error_no_group_selected"]); + } + $rs = $modx->db->select('internalKey', $modx->getFullTableName('user_attributes'), "role='{$groupid}' AND internalKey!='".$modx->getLoginUserID()."'"); + while ($row=$modx->db->getRow($rs)) { + $modx->db->insert( + array( + 'recipient' => $row['internalKey'], + 'sender' => $modx->getLoginUserID(), + 'subject' => $subject, + 'message' => $message, + 'postdate' => $postdate, + 'type' => 'Message', + 'private' => 0, + ), $modx->getFullTableName('user_messages')); + } } -if ($sendto=='a') { - $rs = $modx->db->select('id', $modx->getFullTableName('manager_users'), "id!='" . $modx->getLoginUserID() . "'"); - while ($row=$modx->db->getRow($rs)) { - $modx->db->insert( - array( - 'recipient' => $row['id'], - 'sender' => $modx->getLoginUserID(), - 'subject' => $subject, - 'message' => $message, - 'postdate' => $postdate, - 'type' => 'Message', - 'private' => 0, - ), $modx->getFullTableName('user_messages')); - } +if($sendto=='a') { + $rs = $modx->db->select('id', $modx->getFullTableName('manager_users'), "id!='".$modx->getLoginUserID()."'"); + while ($row=$modx->db->getRow($rs)) { + $modx->db->insert( + array( + 'recipient' => $row['id'], + 'sender' => $modx->getLoginUserID(), + 'subject' => $subject, + 'message' => $message, + 'postdate' => $postdate, + 'type' => 'Message', + 'private' => 0, + ), $modx->getFullTableName('user_messages')); + } } $header = "Location: index.php?a=10"; diff --git a/manager/processors/undelete_content.processor.php b/manager/processors/undelete_content.processor.php index 928ad54133..84cdc95f72 100755 --- a/manager/processors/undelete_content.processor.php +++ b/manager/processors/undelete_content.processor.php @@ -1,14 +1,14 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('delete_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('delete_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id'])? (int)$_REQUEST['id'] : 0; -if ($id==0) { - $modx->webAlertAndQuit($_lang["error_no_id"]); +if($id==0) { + $modx->webAlertAndQuit($_lang["error_no_id"]); } /************ webber ********/ @@ -16,10 +16,10 @@ $pid=($content['parent']==0?$id:$content['parent']); /************** webber *************/ -$sd=isset($_REQUEST['dir'])?'&dir=' . $_REQUEST['dir']:'&dir=DESC'; -$sb=isset($_REQUEST['sort'])?'&sort=' . $_REQUEST['sort']:'&sort=createdon'; -$pg=isset($_REQUEST['page'])?'&page=' . (int)$_REQUEST['page']:''; -$add_path=$sd . $sb . $pg; +$sd=isset($_REQUEST['dir'])?'&dir='.$_REQUEST['dir']:'&dir=DESC'; +$sb=isset($_REQUEST['sort'])?'&sort='.$_REQUEST['sort']:'&sort=createdon'; +$pg=isset($_REQUEST['page'])?'&page='.(int)$_REQUEST['page']:''; +$add_path=$sd.$sb.$pg; /***********************************/ @@ -31,15 +31,15 @@ $udperms->document = $id; $udperms->role = $_SESSION['mgrRole']; -if (!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); +if(!$udperms->checkPermissions()) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); } // get the timestamp on which the document was deleted. $rs = $modx->db->select('deletedon', $modx->getFullTableName('site_content'), "id='{$id}' AND deleted=1"); $deltime = $modx->db->getValue($rs); -if (!$deltime) { - $modx->webAlertAndQuit("Couldn't find document to determine it's date of deletion!"); +if(!$deltime) { + $modx->webAlertAndQuit("Couldn't find document to determine it's date of deletion!"); } $children = array(); @@ -47,38 +47,38 @@ /** * @param int $parent */ -function getChildren($parent) -{ - $modx = evolutionCMS(); - global $children; - global $deltime; - - $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent='" . (int)$parent . "' AND deleted=1 AND deletedon='" . (int)$deltime . "'"); - // the document has children documents, we'll need to delete those too - while ($row=$modx->db->getRow($rs)) { - $children[] = $row['id']; - getChildren($row['id']); - //echo "Found childNode of parentNode $parent: ".$row['id']."
    "; - } +function getChildren($parent) { + + $modx = evolutionCMS(); + global $children; + global $deltime; + + $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent='".(int)$parent."' AND deleted=1 AND deletedon='".(int)$deltime."'"); + // the document has children documents, we'll need to delete those too + while ($row=$modx->db->getRow($rs)) { + $children[] = $row['id']; + getChildren($row['id']); + //echo "Found childNode of parentNode $parent: ".$row['id']."
    "; + } } getChildren($id); -if (count($children)>0) { - $modx->db->update( - array( - 'deleted' => 0, - 'deletedby' => 0, - 'deletedon' => 0, - ), $modx->getFullTableName('site_content'), "id IN(" . implode(", ", $children) . ")"); +if(count($children)>0) { + $modx->db->update( + array( + 'deleted' => 0, + 'deletedby' => 0, + 'deletedon' => 0, + ), $modx->getFullTableName('site_content'), "id IN(".implode(", ", $children).")"); } //'undelete' the document. $modx->db->update( - array( - 'deleted' => 0, - 'deletedby' => 0, - 'deletedon' => 0, - ), $modx->getFullTableName('site_content'), "id='{$id}'"); + array( + 'deleted' => 0, + 'deletedby' => 0, + 'deletedon' => 0, + ), $modx->getFullTableName('site_content'), "id='{$id}'"); $modx->invokeEvent("OnDocFormUnDelete", array( @@ -93,5 +93,5 @@ function getChildren($parent) $modx->clearCache('full'); // finished emptying cache - redirect -$header="Location: index.php?a=3&id=$pid&r=1" . $add_path; +$header="Location: index.php?a=3&id=$pid&r=1".$add_path; header($header); diff --git a/manager/processors/unpublish_content.processor.php b/manager/processors/unpublish_content.processor.php index 1de6b8cec3..43b5b72ff8 100755 --- a/manager/processors/unpublish_content.processor.php +++ b/manager/processors/unpublish_content.processor.php @@ -1,14 +1,14 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('save_document')||!$modx->hasPermission('publish_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('save_document')||!$modx->hasPermission('publish_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id'])? (int)$_REQUEST['id'] : 0; -if ($id==0) { - $modx->webAlertAndQuit($_lang["error_no_id"]); +if($id==0) { + $modx->webAlertAndQuit($_lang["error_no_id"]); } /************webber ********/ @@ -16,10 +16,10 @@ $pid=($content['parent']==0?$id:$content['parent']); /************** webber *************/ -$sd=isset($_REQUEST['dir'])?'&dir=' . $_REQUEST['dir']:'&dir=DESC'; -$sb=isset($_REQUEST['sort'])?'&sort=' . $_REQUEST['sort']:'&sort=createdon'; -$pg=isset($_REQUEST['page'])?'&page=' . (int)$_REQUEST['page']:''; -$add_path=$sd . $sb . $pg; +$sd=isset($_REQUEST['dir'])?'&dir='.$_REQUEST['dir']:'&dir=DESC'; +$sb=isset($_REQUEST['sort'])?'&sort='.$_REQUEST['sort']:'&sort=createdon'; +$pg=isset($_REQUEST['page'])?'&page='.(int)$_REQUEST['page']:''; +$add_path=$sd.$sb.$pg; /***********************************/ @@ -32,24 +32,24 @@ $udperms->document = $id; $udperms->role = $_SESSION['mgrRole']; -if (!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); +if(!$udperms->checkPermissions()) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); } // update the document $modx->db->update( - array( - 'published' => 0, - 'pub_date' => 0, - 'unpub_date' => 0, - 'editedby' => $modx->getLoginUserID(), - 'editedon' => time(), - 'publishedby' => 0, - 'publishedon' => 0, - ), $modx->getFullTableName('site_content'), "id='{$id}'"); + array( + 'published' => 0, + 'pub_date' => 0, + 'unpub_date' => 0, + 'editedby' => $modx->getLoginUserID(), + 'editedon' => time(), + 'publishedby' => 0, + 'publishedon' => 0, + ), $modx->getFullTableName('site_content'), "id='{$id}'"); // invoke OnDocUnPublished event -$modx->invokeEvent("OnDocUnPublished", array("docid"=>$id)); +$modx->invokeEvent("OnDocUnPublished",array("docid"=>$id)); // Set the item name for logger $_SESSION['itemname'] = $content['pagetitle']; @@ -57,6 +57,6 @@ // empty cache $modx->clearCache('full'); -$header="Location: index.php?a=3&id=$pid&r=1" . $add_path; +$header="Location: index.php?a=3&id=$pid&r=1".$add_path; header($header); diff --git a/manager/processors/user_documents_permissions.class.php b/manager/processors/user_documents_permissions.class.php index 7fbf82d6a0..50fdf27bbe 100755 --- a/manager/processors/user_documents_permissions.class.php +++ b/manager/processors/user_documents_permissions.class.php @@ -24,6 +24,7 @@ class udperms */ public function checkPermissions() { + global $udperms_allowroot; $modx = evolutionCMS(); diff --git a/manager/processors/web_access_groups.processor.php b/manager/processors/web_access_groups.processor.php index 82c1aa24e0..477bff505f 100755 --- a/manager/processors/web_access_groups.processor.php +++ b/manager/processors/web_access_groups.processor.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('web_access_permissions')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('web_access_permissions')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // web access group processor. @@ -20,111 +20,111 @@ $operation = $_REQUEST['operation']; switch ($operation) { - case "add_user_group": - $newgroup = $_REQUEST['newusergroup']; - if (empty($newgroup)) { - $modx->webAlertAndQuit("No group name specified."); - } else { - $id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_webgroup_names); + case "add_user_group" : + $newgroup = $_REQUEST['newusergroup']; + if(empty($newgroup)) { + $modx->webAlertAndQuit("No group name specified."); + } else { + $id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_webgroup_names); - // invoke OnWebCreateGroup event - $modx->invokeEvent('OnWebCreateGroup', array( - 'groupid' => $id, - 'groupname' => $newgroup, - )); - } - break; - case "add_document_group": - $newgroup = $_REQUEST['newdocgroup']; - if (empty($newgroup)) { - $modx->webAlertAndQuit("No group name specified."); - } else { - $id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_documentgroup_names); + // invoke OnWebCreateGroup event + $modx->invokeEvent('OnWebCreateGroup', array( + 'groupid' => $id, + 'groupname' => $newgroup, + )); + } + break; + case "add_document_group" : + $newgroup = $_REQUEST['newdocgroup']; + if(empty($newgroup)) { + $modx->webAlertAndQuit("No group name specified."); + } else { + $id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_documentgroup_names); - // invoke OnCreateDocGroup event - $modx->invokeEvent('OnCreateDocGroup', array( - 'groupid' => $id, - 'groupname' => $newgroup, - )); - } - break; - case "delete_user_group": - $updategroupaccess = true; - $usergroup = (int)$_REQUEST['usergroup']; - if (empty($usergroup)) { - $modx->webAlertAndQuit("No user group id specified for deletion."); - } else { - $modx->db->delete($tbl_webgroup_names, "id='{$usergroup}'"); + // invoke OnCreateDocGroup event + $modx->invokeEvent('OnCreateDocGroup', array( + 'groupid' => $id, + 'groupname' => $newgroup, + )); + } + break; + case "delete_user_group" : + $updategroupaccess = true; + $usergroup = (int)$_REQUEST['usergroup']; + if(empty($usergroup)) { + $modx->webAlertAndQuit("No user group id specified for deletion."); + } else { + $modx->db->delete($tbl_webgroup_names, "id='{$usergroup}'"); - $modx->db->delete($tbl_webgroup_access, "webgroup='{$usergroup}'"); + $modx->db->delete($tbl_webgroup_access, "webgroup='{$usergroup}'"); - $modx->db->delete($tbl_web_groups, "webuser='{$usergroup}'"); - } - break; - case "delete_document_group": - $group = (int)$_REQUEST['documentgroup']; - if (empty($group)) { - $modx->webAlertAndQuit("No document group id specified for deletion."); - } else { - $modx->db->delete($tbl_documentgroup_names, "id='{$group}'"); + $modx->db->delete($tbl_web_groups, "webuser='{$usergroup}'"); + } + break; + case "delete_document_group" : + $group = (int)$_REQUEST['documentgroup']; + if(empty($group)) { + $modx->webAlertAndQuit("No document group id specified for deletion."); + } else { + $modx->db->delete($tbl_documentgroup_names, "id='{$group}'"); - $modx->db->delete($tbl_webgroup_access, "documentgroup='{$group}'"); + $modx->db->delete($tbl_webgroup_access, "documentgroup='{$group}'"); - $modx->db->delete($tbl_document_groups, "document_group='{$group}'"); - } - break; - case "rename_user_group": - $newgroupname = $_REQUEST['newgroupname']; - if (empty($newgroupname)) { - $modx->webAlertAndQuit("No group name specified."); - } - $groupid = (int)$_REQUEST['groupid']; - if (empty($groupid)) { - $modx->webAlertAndQuit("No user group id specified for rename."); - } - $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_webgroup_names, "id='{$groupid}'"); - break; - case "rename_document_group": - $newgroupname = $_REQUEST['newgroupname']; - if (empty($newgroupname)) { - $modx->webAlertAndQuit("No group name specified."); - } - $groupid = (int)$_REQUEST['groupid']; - if (empty($groupid)) { - $modx->webAlertAndQuit("No document group id specified for rename."); - } - $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_documentgroup_names, "id='{$groupid}'"); - break; - case "add_document_group_to_user_group": - $updategroupaccess = true; - $usergroup = (int)$_REQUEST['usergroup']; - $docgroup = (int)$_REQUEST['docgroup']; - $rs = $modx->db->select('COUNT(*)', $tbl_webgroup_access, "webgroup='{$usergroup}' AND documentgroup='{$docgroup}'"); - $limit = $modx->db->getValue($rs); - if ($limit<=0) { - $modx->db->insert(array('webgroup'=>$usergroup, 'documentgroup'=>$docgroup), $tbl_webgroup_access); - } else { - //alert user that coupling already exists? - } - break; - case "remove_document_group_from_user_group": - $updategroupaccess = true; - $coupling = (int)$_REQUEST['coupling']; - $modx->db->delete($tbl_webgroup_access, "id='{$coupling}'"); - break; - default: - $modx->webAlertAndQuit("No operation set in request."); + $modx->db->delete($tbl_document_groups, "document_group='{$group}'"); + } + break; + case "rename_user_group" : + $newgroupname = $_REQUEST['newgroupname']; + if(empty($newgroupname)) { + $modx->webAlertAndQuit("No group name specified."); + } + $groupid = (int)$_REQUEST['groupid']; + if(empty($groupid)) { + $modx->webAlertAndQuit("No user group id specified for rename."); + } + $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_webgroup_names, "id='{$groupid}'"); + break; + case "rename_document_group" : + $newgroupname = $_REQUEST['newgroupname']; + if(empty($newgroupname)) { + $modx->webAlertAndQuit("No group name specified."); + } + $groupid = (int)$_REQUEST['groupid']; + if(empty($groupid)) { + $modx->webAlertAndQuit("No document group id specified for rename."); + } + $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_documentgroup_names, "id='{$groupid}'"); + break; + case "add_document_group_to_user_group" : + $updategroupaccess = true; + $usergroup = (int)$_REQUEST['usergroup']; + $docgroup = (int)$_REQUEST['docgroup']; + $rs = $modx->db->select('COUNT(*)', $tbl_webgroup_access, "webgroup='{$usergroup}' AND documentgroup='{$docgroup}'"); + $limit = $modx->db->getValue($rs); + if($limit<=0) { + $modx->db->insert(array('webgroup'=>$usergroup, 'documentgroup'=>$docgroup), $tbl_webgroup_access); + } else { + //alert user that coupling already exists? + } + break; + case "remove_document_group_from_user_group" : + $updategroupaccess = true; + $coupling = (int)$_REQUEST['coupling']; + $modx->db->delete($tbl_webgroup_access, "id='{$coupling}'"); + break; + default : + $modx->webAlertAndQuit("No operation set in request."); } // secure web documents - flag as private -if ($updategroupaccess==true) { - include MODX_MANAGER_PATH . "includes/secure_web_documents.inc.php"; - secureWebDocument(); +if($updategroupaccess==true){ + include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php"; + secureWebDocument(); - // Update the private group column - $modx->db->update( - 'dgn.private_webgroup = (wga.webgroup IS NOT NULL)', - "{$tbl_documentgroup_names} AS dgn LEFT JOIN {$tbl_webgroup_access} AS wga ON wga.documentgroup = dgn.id"); + // Update the private group column + $modx->db->update( + 'dgn.private_webgroup = (wga.webgroup IS NOT NULL)', + "{$tbl_documentgroup_names} AS dgn LEFT JOIN {$tbl_webgroup_access} AS wga ON wga.documentgroup = dgn.id"); } $header = "Location: index.php?a=91"; From e686e06983de1ee7f9c35ed83f30106a755ad0bd Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Fri, 1 Jun 2018 00:31:24 +0300 Subject: [PATCH 246/274] revert last Agel_Nesh work --- index.php | 112 +- .../actions/access_permissions.dynamic.php | 181 ++- manager/actions/bkmanager.static.php | 65 +- .../inc/Module_Categories_Manager.php | 1 - .../category_mgr/inc/request_trigger.inc.php | 142 +- manager/actions/document_data.static.php | 338 ++-- manager/actions/eventlog.dynamic.php | 74 +- manager/actions/eventlog_details.dynamic.php | 32 +- manager/actions/export_site.static.php | 24 +- manager/actions/files.dynamic.php | 34 +- manager/actions/help.static.php | 63 +- manager/actions/import_site.static.php | 690 +++++---- manager/actions/logging.static.php | 167 +- manager/actions/messages.static.php | 67 +- manager/actions/modules.static.php | 4 +- manager/actions/move_document.dynamic.php | 2 +- manager/actions/mutate_categories.dynamic.php | 48 +- manager/actions/mutate_content.dynamic.php | 1197 +++++++------- .../actions/mutate_htmlsnippet.dynamic.php | 4 +- .../actions/mutate_menuindex_sort.dynamic.php | 4 +- manager/actions/mutate_module.dynamic.php | 207 +-- .../mutate_module_resources.dynamic.php | 184 +-- manager/actions/mutate_password.dynamic.php | 8 +- manager/actions/mutate_plugin.dynamic.php | 2 +- .../mutate_plugin_priority.dynamic.php | 4 +- manager/actions/mutate_role.dynamic.php | 264 ++-- manager/actions/mutate_settings.dynamic.php | 56 +- .../mutate_settings/snippet_smtp.inc.php | 12 +- .../tab1_site_settings.inc.php | 122 +- .../tab2_furl_settings.inc.php | 36 +- .../tab3_user_settings.inc.php | 14 +- .../tab4_manager_settings.inc.php | 4 +- .../tab5_security_settings.inc.php | 58 +- .../tab6_filemanager_settings.inc.php | 4 +- .../tab7_filebrowser_settings.inc.php | 6 +- manager/actions/mutate_snippet.dynamic.php | 4 +- .../mutate_template_tv_rank.dynamic.php | 4 +- manager/actions/mutate_templates.dynamic.php | 263 ++-- manager/actions/mutate_tmplvars.dynamic.php | 262 ++-- manager/actions/mutate_tv_rank.dynamic.php | 4 +- manager/actions/mutate_user.dynamic.php | 799 ---------- manager/actions/mutate_web_user.dynamic.php | 209 +-- manager/actions/phpinfo.static.php | 2 +- manager/actions/refresh_site.dynamic.php | 20 +- manager/actions/resource_selector.static.php | 2 +- manager/actions/resources.static.php | 132 +- manager/actions/resources/functions.inc.php | 352 +++-- .../actions/resources/mgrResources.class.php | 226 +-- .../actions/resources/tab1_templates.inc.php | 8 +- .../resources/tab2_templatevars.inc.php | 8 +- manager/actions/resources/tab3_chunks.inc.php | 8 +- .../actions/resources/tab4_snippets.inc.php | 8 +- .../actions/resources/tab5_plugins.inc.php | 23 +- .../resources/tab6_categoryview.inc.php | 2 +- manager/actions/role_management.static.php | 38 +- manager/actions/search.static.php | 105 +- manager/actions/site_schedule.static.php | 77 +- manager/actions/sysinfo.static.php | 33 +- manager/actions/user_management.static.php | 114 +- .../web_access_permissions.dynamic.php | 179 +-- .../actions/web_user_management.static.php | 64 +- manager/actions/welcome.static.php | 550 +++---- manager/frames/1.php | 134 +- manager/frames/mainmenu.php | 702 ++++----- manager/frames/nodes.functions.inc.php | 16 +- manager/frames/tree.php | 70 +- manager/includes/SystemEvent.class.php | 70 + manager/includes/accesscontrol.inc.php | 11 +- manager/includes/actionlist.inc.php | 265 ++-- manager/includes/active_user_locks.inc.php | 4 +- manager/includes/charsets.php | 48 +- manager/includes/config_check.inc.php | 140 +- manager/includes/controls/contextmenu.php | 94 +- manager/includes/controls/datagrid.class.php | 475 +++--- .../includes/controls/datasetpager.class.php | 344 ++-- manager/includes/controls/phpmailer/OAuth.php | 2 +- .../includes/controls/phpmailer/PHPMailer.php | 182 +-- manager/includes/controls/phpmailer/POP3.php | 6 +- manager/includes/controls/phpmailer/SMTP.php | 44 +- manager/includes/debug.inc.php | 15 +- manager/includes/default_config.php | 3 - .../includes/document.parser.class.inc.php | 296 ++-- manager/includes/error.class.inc.php | 1 - .../extenders/dbapi.mysql.class.inc.php | 20 +- .../extenders/dbapi.mysqli.class.inc.php | 37 +- .../extenders/deprecated.functions.inc.php | 6 +- manager/includes/extenders/ex_dbapi.inc.php | 8 +- .../includes/extenders/export.class.inc.php | 7 +- .../includes/extenders/maketable.class.php | 8 +- .../extenders/manager.api.class.inc.php | 1 - .../includes/extenders/message.quit.inc.php | 77 +- .../extenders/modifiers.class.inc.php | 1089 ++++++++----- .../extenders/modifiers/mdf_addbreak.inc.php | 17 +- .../extenders/modifiers/mdf_getimage.inc.php | 23 +- .../extenders/modifiers/mdf_memberof.inc.php | 25 +- .../extenders/modifiers/mdf_moduser.inc.php | 7 +- .../extenders/modifiers/mdf_summary.inc.php | 57 +- .../extenders/modifiers/mdf_wordwrap.inc.php | 4 +- manager/includes/footer.inc.php | 30 +- manager/includes/header.inc.php | 12 +- manager/includes/log.class.inc.php | 10 +- manager/includes/manager.lockout.inc.php | 99 +- manager/includes/menu.class.inc.php | 3 +- manager/includes/preload.functions.inc.php | 16 +- manager/includes/protect.inc.php | 4 +- manager/includes/sysalert.display.inc.php | 45 +- .../includes/template.parser.class.inc.php | 285 ++-- manager/includes/tmplvars.commands.inc.php | 97 +- manager/includes/tmplvars.format.inc.php | 661 ++++---- manager/includes/tmplvars.inc.php | 504 +++--- manager/includes/user_settings.inc.php | 2 +- manager/includes/veriword.php | 61 +- manager/index.php | 1377 +++++++++-------- manager/media/browser/mcpuk/browse.php | 17 +- manager/media/browser/mcpuk/browser.php | 18 +- manager/media/browser/mcpuk/config.php | 22 +- manager/media/browser/mcpuk/core/autoload.php | 44 +- manager/media/browser/mcpuk/core/browser.php | 611 +++++--- .../browser/mcpuk/core/types/type_img.php | 11 +- .../browser/mcpuk/core/types/type_mime.php | 20 +- manager/media/browser/mcpuk/core/uploader.php | 474 +++--- manager/media/browser/mcpuk/css.php | 6 +- .../media/browser/mcpuk/js/browser/joiner.php | 6 +- manager/media/browser/mcpuk/js_localize.php | 10 +- manager/media/browser/mcpuk/lang/af.php | 2 - manager/media/browser/mcpuk/lang/bg.php | 2 - manager/media/browser/mcpuk/lang/ca.php | 2 - manager/media/browser/mcpuk/lang/cs.php | 2 - manager/media/browser/mcpuk/lang/da.php | 4 +- manager/media/browser/mcpuk/lang/de.php | 2 - manager/media/browser/mcpuk/lang/el.php | 2 - manager/media/browser/mcpuk/lang/en.php | 2 - manager/media/browser/mcpuk/lang/es.php | 2 - manager/media/browser/mcpuk/lang/et.php | 2 - manager/media/browser/mcpuk/lang/fa.php | 2 - manager/media/browser/mcpuk/lang/fi.php | 2 - manager/media/browser/mcpuk/lang/fr.php | 2 - manager/media/browser/mcpuk/lang/he.php | 2 - manager/media/browser/mcpuk/lang/hu.php | 2 - manager/media/browser/mcpuk/lang/id.php | 2 - manager/media/browser/mcpuk/lang/it.php | 2 - manager/media/browser/mcpuk/lang/ja.php | 2 - manager/media/browser/mcpuk/lang/lt.php | 2 - manager/media/browser/mcpuk/lang/nl.php | 2 - manager/media/browser/mcpuk/lang/no.php | 2 - manager/media/browser/mcpuk/lang/pl.php | 2 - manager/media/browser/mcpuk/lang/pt-br.php | 2 - manager/media/browser/mcpuk/lang/pt.php | 2 - manager/media/browser/mcpuk/lang/ro.php | 2 - manager/media/browser/mcpuk/lang/ru.php | 2 - manager/media/browser/mcpuk/lang/sk.php | 2 - manager/media/browser/mcpuk/lang/sv.php | 2 - manager/media/browser/mcpuk/lang/tr.php | 2 - manager/media/browser/mcpuk/lang/uk.php | 6 +- manager/media/browser/mcpuk/lang/vi.php | 2 - manager/media/browser/mcpuk/lang/zh-cn.php | 2 - .../browser/mcpuk/lib/class_fastImage.php | 426 +++-- manager/media/browser/mcpuk/lib/class_gd.php | 353 +++-- .../media/browser/mcpuk/lib/class_image.php | 270 ++-- .../browser/mcpuk/lib/class_image_gd.php | 197 ++- .../browser/mcpuk/lib/class_image_gmagick.php | 112 +- .../browser/mcpuk/lib/class_image_imagick.php | 112 +- .../media/browser/mcpuk/lib/class_input.php | 23 +- .../browser/mcpuk/lib/class_zipFolder.php | 20 +- .../media/browser/mcpuk/lib/helper_dir.php | 106 +- .../media/browser/mcpuk/lib/helper_file.php | 112 +- .../browser/mcpuk/lib/helper_httpCache.php | 86 +- .../media/browser/mcpuk/lib/helper_path.php | 100 +- .../media/browser/mcpuk/lib/helper_text.php | 45 +- .../media/browser/mcpuk/tpl/tpl_browser.php | 4 +- manager/media/browser/mcpuk/tpl/tpl_css.php | 2 +- .../browser/mcpuk/tpl/tpl_javascript.php | 24 +- manager/media/calendar/datepicker.inc.php | 20 +- .../script/air-datepicker/datepicker.inc.php | 30 +- .../common/moo-datepicker/datepicker.inc.php | 16 +- manager/media/style/default/ajax.php | 19 +- manager/media/style/default/style.php | 242 +-- manager/media/style/default/welcome.php | 14 +- .../processors/access_groups.processor.php | 196 +-- .../processors/cache_sync.class.processor.php | 19 +- .../processors/delete_category.processor.php | 4 +- .../processors/delete_content.processor.php | 48 +- .../processors/delete_eventlog.processor.php | 18 +- .../delete_htmlsnippet.processor.php | 22 +- .../processors/delete_message.processor.php | 2 +- .../processors/delete_module.processor.php | 22 +- .../processors/delete_plugin.processor.php | 22 +- manager/processors/delete_role.processor.php | 18 +- .../processors/delete_snippet.processor.php | 22 +- .../processors/delete_template.processor.php | 40 +- .../processors/delete_tmplvars.processor.php | 40 +- manager/processors/delete_user.processor.php | 34 +- .../processors/delete_web_user.processor.php | 30 +- .../duplicate_content.processor.php | 225 +-- .../duplicate_htmlsnippet.processor.php | 31 +- .../processors/duplicate_module.processor.php | 86 +- .../processors/duplicate_plugin.processor.php | 49 +- .../duplicate_snippet.processor.php | 33 +- .../duplicate_template.processor.php | 43 +- .../duplicate_tmplvars.processor.php | 65 +- manager/processors/empty_table.processor.php | 6 +- .../processors/execute_module.processor.php | 141 +- manager/processors/export_site.processor.php | 32 +- manager/processors/login.processor.php | 418 ++--- manager/processors/logout.processor.php | 18 +- .../processors/move_document.processor.php | 157 +- .../processors/optimize_table.processor.php | 36 +- .../processors/publish_content.processor.php | 44 +- manager/processors/purge_plugin.processor.php | 17 +- .../processors/remove_content.processor.php | 40 +- .../processors/remove_installer.processor.php | 42 +- manager/processors/remove_locks.processor.php | 38 +- manager/processors/save_content.processor.php | 110 +- .../processors/save_htmlsnippet.processor.php | 2 +- manager/processors/save_module.processor.php | 2 +- .../processors/save_password.processor.php | 36 +- manager/processors/save_plugin.processor.php | 23 +- manager/processors/save_role.processor.php | 220 +-- .../processors/save_settings.processor.php | 233 ++- manager/processors/save_snippet.processor.php | 2 +- .../processors/save_template.processor.php | 2 +- .../processors/save_tmplvars.processor.php | 7 +- manager/processors/save_user.processor.php | 764 ++++----- .../processors/save_web_user.processor.php | 597 +++---- manager/processors/send_message.processor.php | 104 +- .../processors/undelete_content.processor.php | 78 +- .../unpublish_content.processor.php | 44 +- .../user_documents_permissions.class.php | 1 - .../web_access_groups.processor.php | 196 +-- 229 files changed, 11793 insertions(+), 11568 deletions(-) create mode 100644 manager/includes/SystemEvent.class.php diff --git a/index.php b/index.php index 5322472776..3d2e2beef2 100644 --- a/index.php +++ b/index.php @@ -1,42 +1,42 @@ stopOnNotice = false; // Don't show PHP errors to the public -if(!isset($_SESSION['mgrValidated']) || !$_SESSION['mgrValidated']) { - @ini_set("display_errors","0"); +if (!isset($_SESSION['mgrValidated']) || !$_SESSION['mgrValidated']) { + @ini_set("display_errors", "0"); } -if(MODX_CLI){ +if (MODX_CLI) { @set_time_limit(0); - @ini_set('max_execution_time',0); + @ini_set('max_execution_time', 0); } // execute the parser if index.php was not included diff --git a/manager/actions/access_permissions.dynamic.php b/manager/actions/access_permissions.dynamic.php index 0450f6ad9a..a354a2e9fc 100755 --- a/manager/actions/access_permissions.dynamic.php +++ b/manager/actions/access_permissions.dynamic.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('access_permissions')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('access_permissions')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // Get table names (alphabetical) @@ -17,25 +17,25 @@ // find all document groups, for the select :) $rs = $modx->db->select('*', $tbl_documentgroup_names, '', 'name'); -if($modx->db->getRecordCount($rs) < 1) { - $docgroupselector = '[no groups to add]'; +if ($modx->db->getRecordCount($rs) < 1) { + $docgroupselector = '[no groups to add]'; } else { - $docgroupselector = '\n"; + $docgroupselector = '\n"; } $rs = $modx->db->select('*', $tbl_membergroup_names, '', 'name'); -if($modx->db->getRecordCount($rs) < 1) { - $usrgroupselector = '[no user groups]'; +if ($modx->db->getRecordCount($rs) < 1) { + $usrgroupselector = '[no user groups]'; } else { - $usrgroupselector = '\n"; + $usrgroupselector = '\n"; } ?> @@ -96,24 +96,23 @@ function deletegroup(groupid, type) { db->select('groupnames.*, users.id AS user_id, users.username user_name', $tbl_membergroup_names . ' AS groupnames + $rs = $modx->db->select('groupnames.*, users.id AS user_id, users.username user_name', $tbl_membergroup_names . ' AS groupnames LEFT JOIN ' . $tbl_member_groups . ' AS groups ON groups.user_group = groupnames.id LEFT JOIN ' . $tbl_manager_users . ' AS users ON users.id = groups.member', '', 'groupnames.name, user_name'); - if($modx->db->getRecordCount($rs) < 1) { - ?> + if ($modx->db->getRecordCount($rs) < 1) { + ?>
    + } else { + ?>
    db->getRow($rs)) { - if($pid != $row['id']) { - if($pid != '') { - echo '
    '; - } - ?> + $pid = ''; + while ($row = $modx->db->getRow($rs)) { + if ($pid != $row['id']) { + if ($pid != '') { + echo '
    '; + } ?>
    @@ -128,21 +127,20 @@ function deletegroup(groupid, type) {
    + } + if (!$row['user_id']) { + ?> + $pid = $row['id']; + continue; + } ?> + $pid = $row['id']; + } + } + ?>
    @@ -167,24 +165,23 @@ function deletegroup(groupid, type) { db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $tbl_documentgroup_names . ' AS dgnames + $rs = $modx->db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $tbl_documentgroup_names . ' AS dgnames LEFT JOIN ' . $tbl_document_groups . ' AS dg ON dg.document_group = dgnames.id LEFT JOIN ' . $tbl_site_content . ' AS sc ON sc.id = dg.document', '', 'dgnames.name, sc.id'); - if($modx->db->getRecordCount($rs) < 1) { - ?> + if ($modx->db->getRecordCount($rs) < 1) { + ?>
    + } else { + ?>
    db->getRow($rs)) { - if($pid != $row['id']) { - if($pid != '') { - echo '
    '; - } - ?> + $pid = ''; + while ($row = $modx->db->getRow($rs)) { + if ($pid != $row['id']) { + if ($pid != '') { + echo '
    '; + } ?>
    @@ -199,21 +196,20 @@ function deletegroup(groupid, type) {
    + } + if (!$row['doc_id']) { + ?> + $pid = $row['id']; + continue; + } ?> + $pid = $row['id']; + } + } + ?>
    @@ -225,16 +221,16 @@ function deletegroup(groupid, type) {

    db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $tbl_membergroup_names . ' AS groupnames + // User/Document Group Links + $rs = $modx->db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $tbl_membergroup_names . ' AS groupnames LEFT JOIN ' . $tbl_membergroup_access . ' AS groupacc ON groupacc.membergroup = groupnames.id LEFT JOIN ' . $tbl_documentgroup_names . ' AS dgnames ON dgnames.id = groupacc.documentgroup', '', 'name, dg_name'); - if($modx->db->getRecordCount($rs) < 1) { - ?> + if ($modx->db->getRecordCount($rs) < 1) { + ?>
    + } else { + ?>
    @@ -250,38 +246,35 @@ function deletegroup(groupid, type) {
      db->getRow($rs)) { - if($row['id'] != $pid) { - if($pid != '') { - echo '
    '; - } // close previous one - ?> + $pid = ''; + while ($row = $modx->db->getRow($rs)) { + if ($row['id'] != $pid) { + if ($pid != '') { + echo ''; + } // close previous one ?>
  • ' . $_lang['no_groups_found'] . ''; - $pid = ''; - continue; - } else { - echo '
      '; - } - } - if(!$row['dg_id']) { - continue; - } - ?> + if (!$row['dg_id']) { + echo '' . $_lang['no_groups_found'] . ''; + $pid = ''; + continue; + } else { + echo '
        '; + } + } + if (!$row['dg_id']) { + continue; + } ?>
      • ()
      • + $pid = $row['id']; + } ?>
      + } + ?>
    diff --git a/manager/actions/bkmanager.static.php b/manager/actions/bkmanager.static.php index 6927c17d53..64b910ac50 100755 --- a/manager/actions/bkmanager.static.php +++ b/manager/actions/bkmanager.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('bk_manager')) { @@ -274,10 +274,12 @@ function showhide(a) - 0) { ?> + 0) { + ?>

    - + @@ -423,34 +425,33 @@ function checked($cond) nicesize(filesize($file)); - - $file = fopen($file, "r"); - $count = 0; - $details = array(); - while ($count < 11) { - $line = fgets($file); - foreach ($detailFields as $label) { - $fileLabel = '# ' . $label; - if (strpos($line, $fileLabel) !== false) { - $details[$label] = htmlentities(trim(str_replace(array( + while ($file = array_shift($files)) { + $filename = substr($file, strrpos($file, '/') + 1); + $filesize = $modx->nicesize(filesize($file)); + + $file = fopen($file, "r"); + $count = 0; + $details = array(); + while ($count < 11) { + $line = fgets($file); + foreach ($detailFields as $label) { + $fileLabel = '# ' . $label; + if (strpos($line, $fileLabel) !== false) { + $details[$label] = htmlentities(trim(str_replace(array( $fileLabel, ':', '`' ), '', $line)), ENT_QUOTES, $modx_manager_charset); - } - } - $count++; - }; - fclose($file); - - $tooltip = "Generation Time: " . $details["Generation Time"] . "\n"; - $tooltip .= "Server version: " . $details["Server version"] . "\n"; - $tooltip .= "PHP Version: " . $details["PHP Version"] . "\n"; - $tooltip .= "Host: " . $details["Host"] . "\n"; - ?> + } + } + $count++; + }; + fclose($file); + + $tooltip = "Generation Time: " . $details["Generation Time"] . "\n"; + $tooltip .= "Server version: " . $details["Server version"] . "\n"; + $tooltip .= "PHP Version: " . $details["PHP Version"] . "\n"; + $tooltip .= "Host: " . $details["Host"] . "\n"; ?> @@ -461,8 +462,7 @@ function checked($cond) + } ?> @@ -623,7 +623,9 @@ public function createDump($callBack) $insertdump = $lf; $insertdump .= "INSERT INTO `{$tblval}` VALUES ("; $arr = $this->object2Array($row); - if( ! is_array($arr)) $arr = array(); + if (! is_array($arr)) { + $arr = array(); + } foreach ($arr as $key => $value) { if (is_null($value)) { $value = 'NULL'; @@ -734,7 +736,8 @@ public function object2Array($obj) */ function import_sql($source, $result_code = 'import_ok') { - $modx = evolutionCMS(); global $e; + $modx = evolutionCMS(); + global $e; $rs = null; if ($modx->getLockedElements() !== array()) { diff --git a/manager/actions/category_mgr/inc/Module_Categories_Manager.php b/manager/actions/category_mgr/inc/Module_Categories_Manager.php index ef43029465..e5a5e7628b 100755 --- a/manager/actions/category_mgr/inc/Module_Categories_Manager.php +++ b/manager/actions/category_mgr/inc/Module_Categories_Manager.php @@ -118,7 +118,6 @@ public function renderView($view_name, $data = array()) */ public function updateElement($element, $element_id, $category_id) { - $_update = array( 'id' => (int)$element_id, 'category' => (int)$category_id diff --git a/manager/actions/category_mgr/inc/request_trigger.inc.php b/manager/actions/category_mgr/inc/request_trigger.inc.php index d95f86fd55..d8bda1eb62 100755 --- a/manager/actions/category_mgr/inc/request_trigger.inc.php +++ b/manager/actions/category_mgr/inc/request_trigger.inc.php @@ -2,36 +2,32 @@ /** * Ajax Requests */ -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if( isset( $_REQUEST[$cm->get('request_key')]['ajax'] ) ) -{ +if (isset($_REQUEST[$cm->get('request_key')]['ajax'])) { $_data = $_REQUEST[$cm->get('request_key')]; $output = ''; $task = $_data['task']; - switch( $task ) - { + switch ($task) { /** * get categories */ case 'categorize_load_elements': $elements = $_data['elements']; - if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) ) - { - $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements); + if ($uncategorized_elements = $cm->getAssignedElements(0, $_data['elements'])) { + $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements); } - foreach( $cm->getCategories() as $category ) - { - $category['elements'] = $cm->getAssignedElements( $category['id'], $_data['elements'] ); + foreach ($cm->getCategories() as $category) { + $category['elements'] = $cm->getAssignedElements($category['id'], $_data['elements']); $output .= $cm->renderView('chunks/categorize/category', $category); } break; } - exit( $output ); + exit($output); } /** * Categorize elements @@ -41,8 +37,7 @@ * @see http://modxcms.com/forums/index.php/topic,40430.msg251476.html#msg251476 * */ -if( isset( $_POST[$cm->get('request_key')]['categorize']['submit'] ) ) -{ +if (isset($_POST[$cm->get('request_key')]['categorize']['submit'])) { $_data = $_POST[$cm->get('request_key')]['categorize']; $_changes = 0; @@ -54,16 +49,13 @@ 'categorize' ); - if( !isset( $_data['elements'] ) ) - { - $cm->addMessage( $cm->txt('cm_unknown_error'), 'categorize' ); + if (!isset($_data['elements'])) { + $cm->addMessage($cm->txt('cm_unknown_error'), 'categorize'); return; } - foreach( $_data['elements'] as $element_id => $data ) - { - if( $cm->updateElement( $_data['elementsgroup'], $element_id, $data['category_id'] ) ) - { + foreach ($_data['elements'] as $element_id => $data) { + if ($cm->updateElement($_data['elementsgroup'], $element_id, $data['category_id'])) { $cm->addMessage( sprintf( $cm->txt('cm_x_assigned_to_category_y'), @@ -78,13 +70,10 @@ } } - if( $_changes === 0 ) - { - $cm->addMessage( $cm->txt('cm_no_categorization'), 'categorize' ); + if ($_changes === 0) { + $cm->addMessage($cm->txt('cm_no_categorization'), 'categorize'); return; - } - else - { + } else { $cm->addMessage( sprintf( $cm->txt('cm_x_changes_made'), @@ -98,58 +87,49 @@ /** * Add a new category */ -if( isset( $_POST[$cm->get('request_key')]['add']['submit'] ) ) -{ +if (isset($_POST[$cm->get('request_key')]['add']['submit'])) { $_data = $_POST[$cm->get('request_key')]['add']['data']; - $category = trim( html_entity_decode($_data['name']) ); + $category = trim(html_entity_decode($_data['name'])); $rank = (int) $_data['rank']; - if( empty( $category ) ) - { - $cm->addMessage( $cm->txt('cm_enter_name_for_category'), 'add' ); - return; + if (empty($category)) { + $cm->addMessage($cm->txt('cm_enter_name_for_category'), 'add'); + return; } - if( $cm->isCategoryExists( $category ) ) - { - $cm->addMessage( sprintf( $cm->txt('cm_category_x_exists'), $category ), 'add' ); - return; + if ($cm->isCategoryExists($category)) { + $cm->addMessage(sprintf($cm->txt('cm_category_x_exists'), $category), 'add'); + return; } - if( $cm->addCategory( $category, $rank ) !== 0 ) - { + if ($cm->addCategory($category, $rank) !== 0) { $cm->addMessage( sprintf( - $cm->txt( 'cm_category_x_saved_at_position_y' ), + $cm->txt('cm_category_x_saved_at_position_y'), $category, $rank ), 'add' ); - } - else - { - $cm->addMessage( $cm->txt('cm_unknown_error'), 'add' ); + } else { + $cm->addMessage($cm->txt('cm_unknown_error'), 'add'); } } /** * Sort categories */ -if( isset( $_POST[$cm->get('request_key')]['sort']['submit'] ) ) -{ +if (isset($_POST[$cm->get('request_key')]['sort']['submit'])) { $categories = $_POST[$cm->get('request_key')]['sort']['data']; $_changes = 0; - foreach( $categories as $category_id => $_data ) - { + foreach ($categories as $category_id => $_data) { $data = array( - 'category' => urldecode( $_data['category'] ), + 'category' => urldecode($_data['category']), 'rank' => $_data['rank'] ); - if( $cm->updateCategory( $category_id, $data ) ) - { + if ($cm->updateCategory($category_id, $data)) { $cm->addMessage( sprintf( $cm->txt('cm_category_x_moved_to_position_y'), @@ -162,12 +142,9 @@ } } - if( $_changes === 0 ) - { - $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'sort'); - } - else - { + if ($_changes === 0) { + $cm->addMessage($cm->txt('cm_no_changes'), 'sort'); + } else { $cm->addMessage( sprintf( $cm->txt('cm_x_changes_made'), @@ -181,21 +158,17 @@ /** * Edit categories */ -if( isset( $_POST[$cm->get('request_key')]['edit']['submit'] ) ) -{ +if (isset($_POST[$cm->get('request_key')]['edit']['submit'])) { $categories = $_POST[$cm->get('request_key')]['edit']['data']; $_changes = 0; - foreach( $categories as $category_id => $_data ) - { - if( isset( $_data['delete'] ) ) - { - if( $cm->deleteCategory( $category_id ) ) - { + foreach ($categories as $category_id => $_data) { + if (isset($_data['delete'])) { + if ($cm->deleteCategory($category_id)) { $cm->addMessage( sprintf( $cm->txt('cm_category_x_deleted'), - urldecode( $_data['origin'] ) + urldecode($_data['origin']) ), 'edit' ); @@ -205,16 +178,15 @@ } $data = array( - 'category' => trim( html_entity_decode( $_data['category'] ) ), + 'category' => trim(html_entity_decode($_data['category'])), 'rank' => $_data['rank'] ); - if( $cm->updateCategory( $category_id, $data ) ) - { + if ($cm->updateCategory($category_id, $data)) { $cm->addMessage( sprintf( $cm->txt('cm_category_x_renamed_to_y'), - urldecode( $_data['origin'] ), + urldecode($_data['origin']), $data['category'] ), 'edit' @@ -223,26 +195,23 @@ } } - if( $_changes === 0 ) - { - $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'edit'); + if ($_changes === 0) { + $cm->addMessage($cm->txt('cm_no_changes'), 'edit'); } } /** * Delete singel category by $_GET */ -if( isset( $_GET[$cm->get('request_key')]['delete'] ) - && !empty( $_GET[$cm->get('request_key')]['delete'] ) ) -{ +if (isset($_GET[$cm->get('request_key')]['delete']) + && !empty($_GET[$cm->get('request_key')]['delete'])) { $category_id = (int)$_GET[$cm->get('request_key')]['delete']; - if( $cm->deleteCategory( $category_id ) ) - { + if ($cm->deleteCategory($category_id)) { $cm->addMessage( sprintf( $cm->txt('cm_category_x_deleted'), - urldecode( $_GET[$cm->get('request_key')]['category'] ) + urldecode($_GET[$cm->get('request_key')]['category']) ), 'edit' ); @@ -251,16 +220,13 @@ /** * Translate phrases */ -if( isset( $_POST[$cm->get('request_key')]['translate']['submit'] ) ) -{ +if (isset($_POST[$cm->get('request_key')]['translate']['submit'])) { $translations = $_POST[$cm->get('request_key')]['translate']['data']; - foreach( $translations as $native_phrase => $translation ) - { - $native_phrase = urldecode( $native_phrase ); + foreach ($translations as $native_phrase => $translation) { + $native_phrase = urldecode($native_phrase); - if( empty( $translation ) ) - { + if (empty($translation)) { $translation = $native_phrase; $cm->addMessage( @@ -272,7 +238,7 @@ ); } - $cm->c('Translator')->addTranslation( $native_phrase, $translation, 'phrase' ); + $cm->c('Translator')->addTranslation($native_phrase, $translation, 'phrase'); $cm->addMessage( sprintf( diff --git a/manager/actions/document_data.static.php b/manager/actions/document_data.static.php index 84b7e291ee..c11565e2ab 100755 --- a/manager/actions/document_data.static.php +++ b/manager/actions/document_data.static.php @@ -1,16 +1,16 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(isset($_REQUEST['id'])) { - $id = (int) $_REQUEST['id']; +if (isset($_REQUEST['id'])) { + $id = (int) $_REQUEST['id']; } else { - $id = 0; + $id = 0; } -if(isset($_GET['opened'])) { - $_SESSION['openedArray'] = $_GET['opened']; +if (isset($_GET['opened'])) { + $_SESSION['openedArray'] = $_GET['opened']; } $url = $modx->config['site_url']; @@ -22,26 +22,26 @@ $tbl_site_templates = $modx->getFullTableName('site_templates'); // Get access permissions -if($_SESSION['mgrDocgroups']) { - $docgrp = implode(",", $_SESSION['mgrDocgroups']); +if ($_SESSION['mgrDocgroups']) { + $docgrp = implode(",", $_SESSION['mgrDocgroups']); } $access = "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0" . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); // -if($_SESSION['tree_show_only_folders']) { - $parent = $id ? ($modx->db->getValue("SELECT parent FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1")) : 0; - $isfolder = $modx->db->getValue("SELECT isfolder FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1"); - if(!$isfolder && $parent != 0) { - $id = $_REQUEST['id'] = $parent; - } +if ($_SESSION['tree_show_only_folders']) { + $parent = $id ? ($modx->db->getValue("SELECT parent FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1")) : 0; + $isfolder = $modx->db->getValue("SELECT isfolder FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1"); + if (!$isfolder && $parent != 0) { + $id = $_REQUEST['id'] = $parent; + } } // Get the document content $rs = $modx->db->select('DISTINCT sc.*', "{$tbl_site_content} AS sc LEFT JOIN {$tbl_document_groups} AS dg ON dg.document = sc.id", "sc.id ='{$id}' AND ({$access})"); $content = $modx->db->getRow($rs); -if(!$content) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); +if (!$content) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); } /** @@ -84,135 +84,134 @@ ); $filter_sort = ''; $filter_dir = ''; -if($numRecords > 0) { - $filter_sort = ''; - $filter_dir = ''; - $resource = $modx->db->makeArray($rs); - - // CSS style for table - // $tableClass = 'grid'; - // $rowHeaderClass = 'gridHeader'; - // $rowRegularClass = 'gridItem'; - // $rowAlternateClass = 'gridAltItem'; - $tableClass = 'table data nowrap'; - $columnHeaderClass = array( - 'text-center', - 'text-left', - 'text-center', - 'text-center', - 'text-center', - 'text-center' - ); - - - $modx->table->setTableClass($tableClass); - $modx->table->setColumnHeaderClass($columnHeaderClass); - // $modx->table->setRowHeaderClass($rowHeaderClass); - // $modx->table->setRowRegularClass($rowRegularClass); - // $modx->table->setRowAlternateClass($rowAlternateClass); - - // Table header - $listTableHeader = array( - 'docid' => $_lang['id'], - 'title' => $_lang['resource_title'], - 'createdon' => $_lang['createdon'], - 'pub_date' => $_lang['page_data_publishdate'], - 'status' => $_lang['page_data_status'], - 'edit' => $_lang['mgrlog_action'], - ); - $tbWidth = array( - '1%', - '', - '1%', - '1%', - '1%', - '1%' - ); - $modx->table->setColumnWidths($tbWidth); - - $sd = isset($_REQUEST['dir']) ? '&dir=' . $_REQUEST['dir'] : '&dir=DESC'; - $sb = isset($_REQUEST['sort']) ? '&sort=' . $_REQUEST['sort'] : '&sort=createdon'; - $pg = isset($_REQUEST['page']) ? '&page=' . (int) $_REQUEST['page'] : ''; - $add_path = $sd . $sb . $pg; - - $icons = array( - 'text/html' => $_style['tree_page_html'], - 'text/plain' => $_style['tree_page'], - 'text/xml' => $_style['tree_page_xml'], - 'text/css' => $_style['tree_page_css'], - 'text/javascript' => $_style['tree_page_js'], - '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'], - 'image/gif' => $_style['tree_page_gif'], - 'image/jpg' => $_style['tree_page_jpg'], - 'image/png' => $_style['tree_page_png'] - ); - - $listDocs = array(); - foreach($resource as $k => $children) { - - switch($children['id']) { - case $modx->config['site_start'] : - $icon = $_style['tree_page_home']; - break; - case $modx->config['error_page'] : - $icon = $_style['tree_page_404']; - break; - case $modx->config['site_unavailable_page'] : - $icon = $_style['tree_page_hourglass']; - break; - case $modx->config['unauthorized_page'] : - $icon = $_style['tree_page_info']; - break; - default: - if($children['isfolder']) { - $icon = $_style['tree_folder_new']; - } else { - if(isset($icons[$children['contentType']])) { - $icon = $icons[$children['contentType']]; - } else { - $icon = $_style['tree_page']; - } - } - } - - $private = ($children['privateweb'] || $children['privatemgr'] ? ' private' : ''); - - // дописываем в заголовок класс для неопубликованных плюс по всем ссылкам обратный путь - // для сохранения сортировки - $class = ($children['deleted'] ? 'text-danger text-decoration-through' : (!$children['published'] ? ' font-italic text-muted' : ' publish')); - //$class .= ($children['hidemenu'] ? ' text-muted' : ' text-primary'); - //$class .= ($children['isfolder'] ? ' font-weight-bold' : ''); - if($modx->hasPermission('edit_document')) { - $title = '' . $icon . '' . '' . $children['pagetitle'] . ''; - } else { - $title = '' . $icon . '' . $children['pagetitle'] . ''; - } - - $icon_pub_unpub = (!$children['published']) ? '' : ''; - - $icon_del_undel = (!$children['deleted']) ? '' : ''; - - $listDocs[] = array( - 'docid' => '
    ' . $children['id'] . '
    ', - 'title' => $title, - 'createdon' => '
    ' . ($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')) . '
    ', - 'pub_date' => '
    ' . ($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '') . '
    ', - 'status' => '
    ' . ($children['published'] == 0 ? '' . $_lang['page_data_unpublished'] . '' : '' . $_lang['page_data_published'] . '') . '
    ', - 'edit' => '
    ' . ($modx->hasPermission('edit_document') ? ' 0) { + $filter_sort = ''; + $filter_dir = ''; + $resource = $modx->db->makeArray($rs); + + // CSS style for table + // $tableClass = 'grid'; + // $rowHeaderClass = 'gridHeader'; + // $rowRegularClass = 'gridItem'; + // $rowAlternateClass = 'gridAltItem'; + $tableClass = 'table data nowrap'; + $columnHeaderClass = array( + 'text-center', + 'text-left', + 'text-center', + 'text-center', + 'text-center', + 'text-center' + ); + + + $modx->table->setTableClass($tableClass); + $modx->table->setColumnHeaderClass($columnHeaderClass); + // $modx->table->setRowHeaderClass($rowHeaderClass); + // $modx->table->setRowRegularClass($rowRegularClass); + // $modx->table->setRowAlternateClass($rowAlternateClass); + + // Table header + $listTableHeader = array( + 'docid' => $_lang['id'], + 'title' => $_lang['resource_title'], + 'createdon' => $_lang['createdon'], + 'pub_date' => $_lang['page_data_publishdate'], + 'status' => $_lang['page_data_status'], + 'edit' => $_lang['mgrlog_action'], + ); + $tbWidth = array( + '1%', + '', + '1%', + '1%', + '1%', + '1%' + ); + $modx->table->setColumnWidths($tbWidth); + + $sd = isset($_REQUEST['dir']) ? '&dir=' . $_REQUEST['dir'] : '&dir=DESC'; + $sb = isset($_REQUEST['sort']) ? '&sort=' . $_REQUEST['sort'] : '&sort=createdon'; + $pg = isset($_REQUEST['page']) ? '&page=' . (int) $_REQUEST['page'] : ''; + $add_path = $sd . $sb . $pg; + + $icons = array( + 'text/html' => $_style['tree_page_html'], + 'text/plain' => $_style['tree_page'], + 'text/xml' => $_style['tree_page_xml'], + 'text/css' => $_style['tree_page_css'], + 'text/javascript' => $_style['tree_page_js'], + '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'], + 'image/gif' => $_style['tree_page_gif'], + 'image/jpg' => $_style['tree_page_jpg'], + 'image/png' => $_style['tree_page_png'] + ); + + $listDocs = array(); + foreach ($resource as $k => $children) { + switch ($children['id']) { + case $modx->config['site_start']: + $icon = $_style['tree_page_home']; + break; + case $modx->config['error_page']: + $icon = $_style['tree_page_404']; + break; + case $modx->config['site_unavailable_page']: + $icon = $_style['tree_page_hourglass']; + break; + case $modx->config['unauthorized_page']: + $icon = $_style['tree_page_info']; + break; + default: + if ($children['isfolder']) { + $icon = $_style['tree_folder_new']; + } else { + if (isset($icons[$children['contentType']])) { + $icon = $icons[$children['contentType']]; + } else { + $icon = $_style['tree_page']; + } + } + } + + $private = ($children['privateweb'] || $children['privatemgr'] ? ' private' : ''); + + // дописываем в заголовок класс для неопубликованных плюс по всем ссылкам обратный путь + // для сохранения сортировки + $class = ($children['deleted'] ? 'text-danger text-decoration-through' : (!$children['published'] ? ' font-italic text-muted' : ' publish')); + //$class .= ($children['hidemenu'] ? ' text-muted' : ' text-primary'); + //$class .= ($children['isfolder'] ? ' font-weight-bold' : ''); + if ($modx->hasPermission('edit_document')) { + $title = '' . $icon . '' . '' . $children['pagetitle'] . ''; + } else { + $title = '' . $icon . '' . $children['pagetitle'] . ''; + } + + $icon_pub_unpub = (!$children['published']) ? '' : ''; + + $icon_del_undel = (!$children['deleted']) ? '' : ''; + + $listDocs[] = array( + 'docid' => '
    ' . $children['id'] . '
    ', + 'title' => $title, + 'createdon' => '
    ' . ($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')) . '
    ', + 'pub_date' => '
    ' . ($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '') . '
    ', + 'status' => '
    ' . ($children['published'] == 0 ? '' . $_lang['page_data_unpublished'] . '' : '' . $_lang['page_data_published'] . '') . '
    ', + 'edit' => '
    ' . ($modx->hasPermission('edit_document') ? '' . $icon_pub_unpub : '') . ($modx->hasPermission('delete_document') ? $icon_del_undel : '') . '
    ' - ); - } + ); + } - $modx->table->createPagingNavigation($numRecords, 'a=3&id=' . $content['id'] . '&dir=' . $dir . '&sort=' . $sort); - $children_output = $modx->table->create($listDocs, $listTableHeader, 'index.php?a=3&id=' . $content['id']); + $modx->table->createPagingNavigation($numRecords, 'a=3&id=' . $content['id'] . '&dir=' . $dir . '&sort=' . $sort); + $children_output = $modx->table->create($listDocs, $listTableHeader, 'index.php?a=3&id=' . $content['id']); } else { - // No Child documents - $children_output = '

    ' . $_lang['resources_in_container_no'] . '

    '; + // No Child documents + $children_output = '

    ' . $_lang['resources_in_container_no'] . '

    '; } ?>
    - 0) : ?> + 0) : ?>
    ()
    @@ -407,40 +408,43 @@ class="' . $_style["icons_move_document"] . '">
    ' . $icon_pub_unpub : '')
    - config['cache_type'] != 2) { ?> + config['cache_type'] != 2) { + ?>

    config['base_path'] . "assets/cache/docid_" . $id . ".pageCache.php"; - $handle = @fopen($filename, "r"); - if(!$handle) { - $buffer = '
    ' . $_lang['page_data_notcached'] . '
    '; - } else { - while(!feof($handle)) { - $buffer .= fgets($handle, 4096); - } - fclose($handle); - $buffer = '
    \n"; - } - echo $buffer; - ?> + $buffer = ""; + $filename = $modx->config['base_path'] . "assets/cache/docid_" . $id . ".pageCache.php"; + $handle = @fopen($filename, "r"); + if (!$handle) { + $buffer = '
    ' . $_lang['page_data_notcached'] . '
    '; + } else { + while (!feof($handle)) { + $buffer .= fgets($handle, 4096); + } + fclose($handle); + $buffer = '
    \n"; + } + echo $buffer; ?>
    - +
    docSettings.setSelectedIndex( ' . $_GET['tab'] . ' );'; -} +if (isset($_GET['tab']) && is_numeric($_GET['tab'])) { + echo ''; + } ?> - +
    -INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('view_eventlog')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('view_eventlog')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // Get table Names (alphabetical) @@ -15,15 +15,15 @@ $modx->manager->initPageViewState(); // get and save search string -if($_REQUEST['op'] == 'reset') { - $sqlQuery = $query = ''; - $_PAGE['vs']['search'] = ''; +if ($_REQUEST['op'] == 'reset') { + $sqlQuery = $query = ''; + $_PAGE['vs']['search'] = ''; } else { - $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; - if(!is_numeric($sqlQuery)) { - $sqlQuery = $modx->db->escape($query); - } - $_PAGE['vs']['search'] = $query; + $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; + if (!is_numeric($sqlQuery)) { + $sqlQuery = $modx->db->escape($query); + } + $_PAGE['vs']['search'] = $query; } // get & save listmode @@ -125,33 +125,33 @@ function menuAction(a) {
    db->select("el.id, ELT(el.type , 'text-info {$_style['actions_info']}' , 'text-warning {$_style['actions_triangle']}' , 'text-danger {$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el + $ds = $modx->db->select("el.id, ELT(el.type , 'text-info {$_style['actions_info']}' , 'text-warning {$_style['actions_triangle']}' , 'text-danger {$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el LEFT JOIN {$tbl_manager_users} AS mu ON mu.id=el.user AND el.usertype=0 LEFT JOIN {$tbl_web_users} AS wu ON wu.id=el.user AND el.usertype=1", ($sqlQuery ? "" . (is_numeric($sqlQuery) ? "(eventid='{$sqlQuery}') OR " : '') . "(source LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "createdon DESC"); - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items - $grd->pagerClass = ''; - $grd->pageClass = 'page-item'; - $grd->selPageClass = 'page-item active'; - $grd->noRecordMsg = $_lang['no_records_found']; - $grd->cssClass = "table data nowrap"; - $grd->columnHeaderClass = "tableHeader"; - $grd->itemClass = "tableItem"; - $grd->altItemClass = "tableAltItem"; - $grd->fields = "type,source,createdon,eventid,username"; - $grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid']; - $grd->colWidths = "1%,,1%,1%,1%"; - $grd->colAligns = "center,,,center,center"; - $grd->colTypes = "template:||template:[+source+]||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p'; - if($listmode == '1') { - $grd->pageSize = 0; - } - if($_REQUEST['op'] == 'reset') { - $grd->pageNumber = 1; - } - // render grid - echo $grd->render(); - ?> + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items + $grd->pagerClass = ''; + $grd->pageClass = 'page-item'; + $grd->selPageClass = 'page-item active'; + $grd->noRecordMsg = $_lang['no_records_found']; + $grd->cssClass = "table data nowrap"; + $grd->columnHeaderClass = "tableHeader"; + $grd->itemClass = "tableItem"; + $grd->altItemClass = "tableAltItem"; + $grd->fields = "type,source,createdon,eventid,username"; + $grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid']; + $grd->colWidths = "1%,,1%,1%,1%"; + $grd->colAligns = "center,,,center,center"; + $grd->colTypes = "template:||template:[+source+]||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p'; + if ($listmode == '1') { + $grd->pageSize = 0; + } + if ($_REQUEST['op'] == 'reset') { + $grd->pageNumber = 1; + } + // render grid + echo $grd->render(); + ?>
    diff --git a/manager/actions/eventlog_details.dynamic.php b/manager/actions/eventlog_details.dynamic.php index d72e0c394c..7270f330ab 100755 --- a/manager/actions/eventlog_details.dynamic.php +++ b/manager/actions/eventlog_details.dynamic.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('view_eventlog')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('view_eventlog')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // get id @@ -41,18 +41,18 @@
    toDateFormat($content["createdon"]); - if($content["type"] == 1) { - $icon = $_style['actions_info'] . ' text-info'; - $msgtype = $_lang["information"]; - } else if($content["type"] == 2) { - $icon = $_style['actions_triangle'] . ' text-warning'; - $msgtype = $_lang["warning"]; - } else if($content["type"] == 3) { - $icon = $_style['actions_error'] . ' text-danger'; - $msgtype = $_lang["error"]; - } - ?> + $date = $modx->toDateFormat($content["createdon"]); + if ($content["type"] == 1) { + $icon = $_style['actions_info'] . ' text-info'; + $msgtype = $_lang["information"]; + } elseif ($content["type"] == 2) { + $icon = $_style['actions_triangle'] . ' text-warning'; + $msgtype = $_lang["warning"]; + } elseif ($content["type"] == 3) { + $icon = $_style['actions_error'] . ' text-danger'; + $msgtype = $_lang["error"]; + } + ?>

    diff --git a/manager/actions/export_site.static.php b/manager/actions/export_site.static.php index 878cad704f..cbb83cb9f2 100755 --- a/manager/actions/export_site.static.php +++ b/manager/actions/export_site.static.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('export_static')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('export_static')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // figure out the base of the server, so we know where to get the documents in order to export them @@ -35,11 +35,11 @@

    + if (isset($_POST['export'])) { + $rs = include_once(MODX_MANAGER_PATH . 'processors/export_site.processor.php'); + echo $rs; + } else { + ?>
    @@ -76,13 +76,13 @@ ">
    + } + ?>
    diff --git a/manager/actions/files.dynamic.php b/manager/actions/files.dynamic.php index 0b9bae5166..3d6cd1c866 100755 --- a/manager/actions/files.dynamic.php +++ b/manager/actions/files.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('file_manager')) { @@ -407,7 +407,7 @@ function renameFile (file) if (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newDirname) !== 0) { echo $_lang['files.dynamic.php3']; - } else if (!rename($dirname, $_REQUEST['path'] . '/' . $newDirname)) { + } elseif (!rename($dirname, $_REQUEST['path'] . '/' . $newDirname)) { echo '', $_lang['file_folder_not_created'], '

    '; } umask($old_umask); @@ -482,8 +482,7 @@ function renameFile (file) + @ini_set("upload_max_filesize", $upload_maxsize); // modified by raymond ?>
    @@ -491,8 +490,8 @@ function renameFile (file) + echo $information; + } ?>
    @@ -517,13 +516,12 @@ function renameFile (file) webAlertAndQuit("Error opening file for reading."); - } - ?> + $buffer = file_get_contents($filename); + // Log the change + logFileChange('view', $filename); + if ($buffer === false) { + $modx->webAlertAndQuit("Error opening file for reading."); + } ?> @@ -566,7 +564,6 @@ function renameFile (file) if (is_array($evtOut)) { echo implode('', $evtOut); } - } /** @@ -849,7 +846,7 @@ function unzip($file, $path) $complete_name = $path . str_replace('\\', '/', $zip_entry_name); if (!file_exists($complete_path)) { $tmp = ''; - foreach (explode('/', $complete_path) AS $k) { + foreach (explode('/', $complete_path) as $k) { $tmp .= $k . '/'; if (!is_dir($tmp)) { mkdir($tmp, 0777); @@ -890,10 +887,13 @@ function rrmdir($dir) */ function fileupload() { - $modx = evolutionCMS(); global $_lang, $startpath, $filemanager_path, $uploadablefiles, $new_file_permissions; + $modx = evolutionCMS(); + global $_lang, $startpath, $filemanager_path, $uploadablefiles, $new_file_permissions; $msg = ''; foreach ($_FILES['userfile']['name'] as $i => $name) { - if (empty($_FILES['userfile']['tmp_name'][$i])) continue; + if (empty($_FILES['userfile']['tmp_name'][$i])) { + continue; + } $userfile= array(); $userfile['tmp_name'] = $_FILES['userfile']['tmp_name'][$i]; diff --git a/manager/actions/help.static.php b/manager/actions/help.static.php index 1978dc5f54..c46668939a 100755 --- a/manager/actions/help.static.php +++ b/manager/actions/help.static.php @@ -1,6 +1,6 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } $helpBasePath = "actions/help/"; ?> @@ -16,36 +16,35 @@ $v) { - - $helpname = substr($v, 0, strrpos($v, '.')); - - $prefix = substr($helpname, 0, 2); - if(is_numeric($prefix)) { - $helpname = substr($helpname, 2, strlen($helpname) - 1); - } - - $hnLower = strtolower($helpname); - $helpname = isset($_lang[$hnLower]) ? $_lang[$hnLower] : str_replace('_', ' ', $helpname); - - echo '
    '; - echo '

    ' . $helpname . '

    '; - echo ''; - include_once($helpBasePath . "{$v}"); - echo '
    '; - } - ?> + if ($handle = opendir('actions/help')) { + while (false !== ($file = readdir($handle))) { + if ($file != "." && $file != ".." && $file != ".svn" && $file != 'index.html' && !is_dir($helpBasePath . $file)) { + $help[] = $file; + } + } + closedir($handle); + } + + natcasesort($help); + + foreach ($help as $k => $v) { + $helpname = substr($v, 0, strrpos($v, '.')); + + $prefix = substr($helpname, 0, 2); + if (is_numeric($prefix)) { + $helpname = substr($helpname, 2, strlen($helpname) - 1); + } + + $hnLower = strtolower($helpname); + $helpname = isset($_lang[$hnLower]) ? $_lang[$hnLower] : str_replace('_', ' ', $helpname); + + echo '
    '; + echo '

    ' . $helpname . '

    '; + echo ''; + include_once($helpBasePath . "{$v}"); + echo '
    '; + } + ?>
    + } + ?> @@ -104,65 +102,67 @@ function setParent(pId, pName) { /** * @return string */ -function run() { - $modx = evolutionCMS(); global $_lang; +function run() +{ + $modx = evolutionCMS(); + global $_lang; - $tbl_site_content = $modx->getFullTableName('site_content'); - $output = ''; - $maxtime = $_POST['maxtime']; + $tbl_site_content = $modx->getFullTableName('site_content'); + $output = ''; + $maxtime = $_POST['maxtime']; - if(!is_numeric($maxtime)) { - $maxtime = 30; - } + if (!is_numeric($maxtime)) { + $maxtime = 30; + } - @set_time_limit($maxtime); + @set_time_limit($maxtime); - $mtime = microtime(); - $mtime = explode(' ', $mtime); - $mtime = $mtime[1] + $mtime[0]; - $importstart = $mtime; + $mtime = microtime(); + $mtime = explode(' ', $mtime); + $mtime = $mtime[1] + $mtime[0]; + $importstart = $mtime; - if($_POST['reset'] == 'on') { - $modx->db->truncate($tbl_site_content); - $modx->db->query("ALTER TABLE {$tbl_site_content} AUTO_INCREMENT = 1"); - } + if ($_POST['reset'] == 'on') { + $modx->db->truncate($tbl_site_content); + $modx->db->query("ALTER TABLE {$tbl_site_content} AUTO_INCREMENT = 1"); + } - $parent = (int)$_POST['parent']; + $parent = (int)$_POST['parent']; - if(is_dir(MODX_BASE_PATH . 'temp/import')) { - $filedir = MODX_BASE_PATH . 'temp/import/'; - } elseif(is_dir(MODX_BASE_PATH . 'assets/import')) { - $filedir = MODX_BASE_PATH . 'assets/import/'; - } else { + if (is_dir(MODX_BASE_PATH . 'temp/import')) { + $filedir = MODX_BASE_PATH . 'temp/import/'; + } elseif (is_dir(MODX_BASE_PATH . 'assets/import')) { + $filedir = MODX_BASE_PATH . 'assets/import/'; + } else { $filedir = ''; } - $filesfound = 0; + $filesfound = 0; - $files = getFiles($filedir); - $files = pop_index($files); + $files = getFiles($filedir); + $files = pop_index($files); - // no. of files to import - $output .= sprintf('

    ' . $_lang['import_files_found'] . '

    ', $filesfound); + // no. of files to import + $output .= sprintf('

    ' . $_lang['import_files_found'] . '

    ', $filesfound); - // import files - if(0 < count($files)) { - $modx->db->update(array('isfolder' => 1), $tbl_site_content, "id='{$parent}'"); - importFiles($parent, $filedir, $files, 'root'); - } + // import files + if (0 < count($files)) { + $modx->db->update(array('isfolder' => 1), $tbl_site_content, "id='{$parent}'"); + importFiles($parent, $filedir, $files, 'root'); + } - $mtime = microtime(); - $mtime = explode(' ', $mtime); - $mtime = $mtime[1] + $mtime[0]; - $importend = $mtime; - $totaltime = ($importend - $importstart); - $output .= sprintf('

    ' . $_lang['import_site_time'] . '

    ', round($totaltime, 3)); + $mtime = microtime(); + $mtime = explode(' ', $mtime); + $mtime = $mtime[1] + $mtime[0]; + $importend = $mtime; + $totaltime = ($importend - $importstart); + $output .= sprintf('

    ' . $_lang['import_site_time'] . '

    ', round($totaltime, 3)); - if($_POST['convert_link'] == 'on') { - convertLink(); - } + if ($_POST['convert_link'] == 'on') { + convertLink(); + } - return $output; + return $output; } /** @@ -171,145 +171,146 @@ function run() { * @param array $files * @param string $mode */ -function importFiles($parent, $filedir, $files, $mode) { - $modx = evolutionCMS(); - global $_lang, $allowedfiles; - global $search_default, $cache_default, $publish_default; - - $tbl_site_content = $modx->getFullTableName('site_content'); - $tbl_system_settings = $modx->getFullTableName('system_settings'); - - $createdby = $modx->getLoginUserID(); - if(!is_array($files)) { - return; - } - if($_POST['object'] === 'all') { - $modx->config['default_template'] = '0'; - $richtext = '0'; - } else { - $richtext = '1'; - } - - foreach($files as $id => $value) { - if(is_array($value)) { - // create folder - $alias = $id; - printf('' . $_lang['import_site_importing_document'] . '', $alias); - $field = array(); - $field['type'] = 'document'; - $field['contentType'] = 'text/html'; - $field['published'] = $publish_default; - $field['parent'] = $parent; - $field['alias'] = $modx->stripAlias($alias); - $field['richtext'] = $richtext; - $field['template'] = $modx->config['default_template']; - $field['searchable'] = $search_default; - $field['cacheable'] = $cache_default; - $field['createdby'] = $createdby; - $field['isfolder'] = 1; - $field['menuindex'] = 1; - $find = false; - foreach(array( - 'index.html', - 'index.htm' - ) as $filename) { - $filepath = $filedir . $alias . '/' . $filename; - if($find === false && file_exists($filepath)) { - $file = getFileContent($filepath); - list($pagetitle, $content, $description) = treatContent($file, $filename, $alias); - - $date = filemtime($filepath); - $field['pagetitle'] = $pagetitle; - $field['longtitle'] = $pagetitle; - $field['description'] = $description; - $field['content'] = $modx->db->escape($content); - $field['createdon'] = $date; - $field['editedon'] = $date; - $newid = $modx->db->insert($field, $tbl_site_content); - if($newid) { - $find = true; - echo ' - ' . $_lang['import_site_success'] . '
    ' . "\n"; - importFiles($newid, $filedir . $alias . '/', $value, 'sub'); - } else { - echo '' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError(); - exit; - } - } - } - if($find === false) { - $date = time(); - $field['pagetitle'] = '---'; - $field['content'] = ''; - $field['createdon'] = $date; - $field['editedon'] = $date; - $field['hidemenu'] = '1'; - $newid = $modx->db->insert($field, $tbl_site_content); - if($newid) { - $find = true; - echo ' - ' . $_lang['import_site_success'] . '
    ' . "\n"; - importFiles($newid, $filedir . $alias . '/', $value, 'sub'); - } else { - echo '' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError(); - exit; - } - } - } else { - // create document - if($mode == 'sub' && $value == 'index.html') { - continue; - } - $filename = $value; - $fparts = explode('.', $value); - $alias = $fparts[0]; - $ext = (count($fparts) > 1) ? $fparts[count($fparts) - 1] : ""; - printf("" . $_lang['import_site_importing_document'] . "", $filename); - - if(!in_array($ext, $allowedfiles)) { - echo ' - ' . $_lang["import_site_skip"] . '
    ' . "\n"; - } else { - $filepath = $filedir . $filename; - $file = getFileContent($filepath); - list($pagetitle, $content, $description) = treatContent($file, $filename, $alias); - - $date = filemtime($filepath); - $field = array(); - $field['type'] = 'document'; - $field['contentType'] = 'text/html'; - $field['pagetitle'] = $pagetitle; - $field['longtitle'] = $pagetitle; - $field['description'] = $description; - $field['alias'] = $modx->stripAlias($alias); - $field['published'] = $publish_default; - $field['parent'] = $parent; - $field['content'] = $modx->db->escape($content); - $field['richtext'] = $richtext; - $field['template'] = $modx->config['default_template']; - $field['searchable'] = $search_default; - $field['cacheable'] = $cache_default; - $field['createdby'] = $createdby; - $field['createdon'] = $date; - $field['editedon'] = $date; - $field['isfolder'] = 0; - $field['menuindex'] = ($alias == 'index') ? 0 : 2; - $newid = $modx->db->insert($field, $tbl_site_content); - if($newid) { - echo ' - ' . $_lang['import_site_success'] . '
    ' . "\n"; - } else { - echo '' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError(); - exit; - } - - $is_site_start = false; - if($filename == 'index.html') { - $is_site_start = true; - } - if($is_site_start == true && $_POST['reset'] == 'on') { - $modx->db->update(array('setting_value' => $newid), $tbl_system_settings, "setting_name='site_start'"); - $modx->db->update(array('menuindex' => 0), $tbl_site_content, "id='{$newid}'"); - } - } - } - } +function importFiles($parent, $filedir, $files, $mode) +{ + $modx = evolutionCMS(); + global $_lang, $allowedfiles; + global $search_default, $cache_default, $publish_default; + + $tbl_site_content = $modx->getFullTableName('site_content'); + $tbl_system_settings = $modx->getFullTableName('system_settings'); + + $createdby = $modx->getLoginUserID(); + if (!is_array($files)) { + return; + } + if ($_POST['object'] === 'all') { + $modx->config['default_template'] = '0'; + $richtext = '0'; + } else { + $richtext = '1'; + } + + foreach ($files as $id => $value) { + if (is_array($value)) { + // create folder + $alias = $id; + printf('' . $_lang['import_site_importing_document'] . '', $alias); + $field = array(); + $field['type'] = 'document'; + $field['contentType'] = 'text/html'; + $field['published'] = $publish_default; + $field['parent'] = $parent; + $field['alias'] = $modx->stripAlias($alias); + $field['richtext'] = $richtext; + $field['template'] = $modx->config['default_template']; + $field['searchable'] = $search_default; + $field['cacheable'] = $cache_default; + $field['createdby'] = $createdby; + $field['isfolder'] = 1; + $field['menuindex'] = 1; + $find = false; + foreach (array( + 'index.html', + 'index.htm' + ) as $filename) { + $filepath = $filedir . $alias . '/' . $filename; + if ($find === false && file_exists($filepath)) { + $file = getFileContent($filepath); + list($pagetitle, $content, $description) = treatContent($file, $filename, $alias); + + $date = filemtime($filepath); + $field['pagetitle'] = $pagetitle; + $field['longtitle'] = $pagetitle; + $field['description'] = $description; + $field['content'] = $modx->db->escape($content); + $field['createdon'] = $date; + $field['editedon'] = $date; + $newid = $modx->db->insert($field, $tbl_site_content); + if ($newid) { + $find = true; + echo ' - ' . $_lang['import_site_success'] . '
    ' . "\n"; + importFiles($newid, $filedir . $alias . '/', $value, 'sub'); + } else { + echo '' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError(); + exit; + } + } + } + if ($find === false) { + $date = time(); + $field['pagetitle'] = '---'; + $field['content'] = ''; + $field['createdon'] = $date; + $field['editedon'] = $date; + $field['hidemenu'] = '1'; + $newid = $modx->db->insert($field, $tbl_site_content); + if ($newid) { + $find = true; + echo ' - ' . $_lang['import_site_success'] . '
    ' . "\n"; + importFiles($newid, $filedir . $alias . '/', $value, 'sub'); + } else { + echo '' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError(); + exit; + } + } + } else { + // create document + if ($mode == 'sub' && $value == 'index.html') { + continue; + } + $filename = $value; + $fparts = explode('.', $value); + $alias = $fparts[0]; + $ext = (count($fparts) > 1) ? $fparts[count($fparts) - 1] : ""; + printf("" . $_lang['import_site_importing_document'] . "", $filename); + + if (!in_array($ext, $allowedfiles)) { + echo ' - ' . $_lang["import_site_skip"] . '
    ' . "\n"; + } else { + $filepath = $filedir . $filename; + $file = getFileContent($filepath); + list($pagetitle, $content, $description) = treatContent($file, $filename, $alias); + + $date = filemtime($filepath); + $field = array(); + $field['type'] = 'document'; + $field['contentType'] = 'text/html'; + $field['pagetitle'] = $pagetitle; + $field['longtitle'] = $pagetitle; + $field['description'] = $description; + $field['alias'] = $modx->stripAlias($alias); + $field['published'] = $publish_default; + $field['parent'] = $parent; + $field['content'] = $modx->db->escape($content); + $field['richtext'] = $richtext; + $field['template'] = $modx->config['default_template']; + $field['searchable'] = $search_default; + $field['cacheable'] = $cache_default; + $field['createdby'] = $createdby; + $field['createdon'] = $date; + $field['editedon'] = $date; + $field['isfolder'] = 0; + $field['menuindex'] = ($alias == 'index') ? 0 : 2; + $newid = $modx->db->insert($field, $tbl_site_content); + if ($newid) { + echo ' - ' . $_lang['import_site_success'] . '
    ' . "\n"; + } else { + echo '' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError(); + exit; + } + + $is_site_start = false; + if ($filename == 'index.html') { + $is_site_start = true; + } + if ($is_site_start == true && $_POST['reset'] == 'on') { + $modx->db->update(array('setting_value' => $newid), $tbl_system_settings, "setting_name='site_start'"); + $modx->db->update(array('menuindex' => 0), $tbl_site_content, "id='{$newid}'"); + } + } + } + } } /** @@ -318,63 +319,66 @@ function importFiles($parent, $filedir, $files, $mode) { * @param int $count * @return array */ -function getFiles($directory, $listing = array(), $count = 0) { - global $_lang; - global $filesfound; - $dummy = $count; - if( ! empty($directory) && $files = scandir($directory)) { - foreach($files as $file) { - if($file == '.' || $file == '..') { - continue; - } elseif($h = @opendir($directory . $file . "/")) { - closedir($h); - $count = -1; - $listing[$file] = getFiles($directory . $file . "/", array(), $count + 1); - } elseif(strpos($file, '.htm') !== false) { - $listing[$dummy] = $file; - $dummy = $dummy + 1; - $filesfound++; - } - } - } else { - echo '

    ' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_no_open_dir"] . $directory . ".

    "; - } - return ($listing); +function getFiles($directory, $listing = array(), $count = 0) +{ + global $_lang; + global $filesfound; + $dummy = $count; + if (! empty($directory) && $files = scandir($directory)) { + foreach ($files as $file) { + if ($file == '.' || $file == '..') { + continue; + } elseif ($h = @opendir($directory . $file . "/")) { + closedir($h); + $count = -1; + $listing[$file] = getFiles($directory . $file . "/", array(), $count + 1); + } elseif (strpos($file, '.htm') !== false) { + $listing[$dummy] = $file; + $dummy = $dummy + 1; + $filesfound++; + } + } + } else { + echo '

    ' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_no_open_dir"] . $directory . ".

    "; + } + return ($listing); } /** * @param string $filepath * @return bool|string */ -function getFileContent($filepath) { - global $_lang; - // get the file - if(!$buffer = file_get_contents($filepath)) { - echo '

    ' . $_lang['import_site_failed'] . " " . $_lang["import_site_failed_no_retrieve_file"] . $filepath . ".

    "; - } else { - return $buffer; - } +function getFileContent($filepath) +{ + global $_lang; + // get the file + if (!$buffer = file_get_contents($filepath)) { + echo '

    ' . $_lang['import_site_failed'] . " " . $_lang["import_site_failed_no_retrieve_file"] . $filepath . ".

    "; + } else { + return $buffer; + } } /** * @param array $array * @return array */ -function pop_index($array) { - $new_array = array(); - foreach($array as $k => $v) { - if($v !== 'index.html' && $v !== 'index.htm') { - $new_array[$k] = $v; - } else { - array_unshift($new_array, $v); - } - } - foreach($array as $k => $v) { - if(is_array($v)) { - $new_array[$k] = $v; - } - } - return $new_array; +function pop_index($array) +{ + $new_array = array(); + foreach ($array as $k => $v) { + if ($v !== 'index.html' && $v !== 'index.htm') { + $new_array[$k] = $v; + } else { + array_unshift($new_array, $v); + } + } + foreach ($array as $k => $v) { + if (is_array($v)) { + $new_array[$k] = $v; + } + } + return $new_array; } /** @@ -383,109 +387,111 @@ function pop_index($array) { * @param string $alias * @return array */ -function treatContent($src, $filename, $alias) { - $modx = evolutionCMS(); - - $src = mb_convert_encoding($src, $modx->config['modx_charset'], 'UTF-8,SJIS-win,eucJP-win,SJIS,EUC-JP,ASCII'); - - if(preg_match("@(.*)@i", $src, $matches)) { - $pagetitle = ($matches[1] !== '') ? $matches[1] : $filename; - $pagetitle = str_replace('[*pagetitle*]', '', $pagetitle); - } else { - $pagetitle = $alias; - } - if(!$pagetitle) { - $pagetitle = $alias; - } - - if(preg_match('@]+"description"[^>]+content=[\'"](.*)[\'"].+>@i', $src, $matches)) { - $description = ($matches[1] !== '') ? $matches[1] : $filename; - $description = str_replace('[*description*]', '', $description); - } else { - $description = ''; - } - - if((preg_match("@]*>(.*)[^<]+@is", $src, $matches)) && $_POST['object'] == 'body') { - $content = $matches[1]; - } else { - $content = $src; - $s = '/(]+charset\s*=)[^>"\'=]+(.+>)/i'; - $r = '$1' . $modx->config['modx_charset'] . '$2'; - $content = preg_replace($s, $r, $content); - $content = preg_replace('@.*@i', "[*pagetitle*]", $content); - } - $content = str_replace('[*content*]', '[ *content* ]', $content); - $content = trim($content); - $pagetitle = $modx->db->escape($pagetitle); - return array( - $pagetitle, - $content, - $description - ); +function treatContent($src, $filename, $alias) +{ + $modx = evolutionCMS(); + + $src = mb_convert_encoding($src, $modx->config['modx_charset'], 'UTF-8,SJIS-win,eucJP-win,SJIS,EUC-JP,ASCII'); + + if (preg_match("@(.*)@i", $src, $matches)) { + $pagetitle = ($matches[1] !== '') ? $matches[1] : $filename; + $pagetitle = str_replace('[*pagetitle*]', '', $pagetitle); + } else { + $pagetitle = $alias; + } + if (!$pagetitle) { + $pagetitle = $alias; + } + + if (preg_match('@]+"description"[^>]+content=[\'"](.*)[\'"].+>@i', $src, $matches)) { + $description = ($matches[1] !== '') ? $matches[1] : $filename; + $description = str_replace('[*description*]', '', $description); + } else { + $description = ''; + } + + if ((preg_match("@]*>(.*)[^<]+@is", $src, $matches)) && $_POST['object'] == 'body') { + $content = $matches[1]; + } else { + $content = $src; + $s = '/(]+charset\s*=)[^>"\'=]+(.+>)/i'; + $r = '$1' . $modx->config['modx_charset'] . '$2'; + $content = preg_replace($s, $r, $content); + $content = preg_replace('@.*@i', "[*pagetitle*]", $content); + } + $content = str_replace('[*content*]', '[ *content* ]', $content); + $content = trim($content); + $pagetitle = $modx->db->escape($pagetitle); + return array( + $pagetitle, + $content, + $description + ); } /** * @return void */ -function convertLink() { - $modx = evolutionCMS(); - $tbl_site_content = $modx->getFullTableName('site_content'); +function convertLink() +{ + $modx = evolutionCMS(); + $tbl_site_content = $modx->getFullTableName('site_content'); - $rs = $modx->db->select('id,content', $tbl_site_content); - $p = array(); + $rs = $modx->db->select('id,content', $tbl_site_content); + $p = array(); $target = array(); - $dir = ''; - while($row = $modx->db->getRow($rs)) { - $id = $row['id']; - $array = explode('config['site_url']) !== false) { - $_ = $modx->config['base_url'] . str_replace($modx->config['site_url'], '', $_); - } - if($_[0] === '/') { - $_ = substr($_, 1); - } - $_ = str_replace('/index.html', '.html', $_); - $level = substr_count($_, '../'); - if(1 < $level) { - if(!isset($p[$id])) { - $p[$id] = $modx->getParentIds($id); - } - $k = array_keys($p[$id]); - while(0 < $level) { - $dir = array_shift($k); - $level--; - } - if($dir != '') { - $dir .= '/'; - } - } else { - $dir = ''; - } - - $_ = trim($_, './'); - if(strpos($_, '/') !== false) { - $_ = substr($_, strrpos($_, '/')); - } - $_ = $dir . str_replace('.html', '', $_); - if(!isset($target[$_])) { - $target[$_] = $modx->getIdFromAlias($_); - } - $target[$_] = trim($target[$_]); - if(!empty($target[$_])) { - $href = '[~' . $target[$_] . '~]'; - } - $array[$c] = 'db->escape($content); - $modx->db->update($f, $tbl_site_content, "id='{$id}'"); - } + $dir = ''; + while ($row = $modx->db->getRow($rs)) { + $id = $row['id']; + $array = explode('config['site_url']) !== false) { + $_ = $modx->config['base_url'] . str_replace($modx->config['site_url'], '', $_); + } + if ($_[0] === '/') { + $_ = substr($_, 1); + } + $_ = str_replace('/index.html', '.html', $_); + $level = substr_count($_, '../'); + if (1 < $level) { + if (!isset($p[$id])) { + $p[$id] = $modx->getParentIds($id); + } + $k = array_keys($p[$id]); + while (0 < $level) { + $dir = array_shift($k); + $level--; + } + if ($dir != '') { + $dir .= '/'; + } + } else { + $dir = ''; + } + + $_ = trim($_, './'); + if (strpos($_, '/') !== false) { + $_ = substr($_, strrpos($_, '/')); + } + $_ = $dir . str_replace('.html', '', $_); + if (!isset($target[$_])) { + $target[$_] = $modx->getIdFromAlias($_); + } + $target[$_] = trim($target[$_]); + if (!empty($target[$_])) { + $href = '[~' . $target[$_] . '~]'; + } + $array[$c] = 'db->escape($content); + $modx->db->update($f, $tbl_site_content, "id='{$id}'"); + } } diff --git a/manager/actions/logging.static.php b/manager/actions/logging.static.php index 26f678b7ad..e763c659e7 100755 --- a/manager/actions/logging.static.php +++ b/manager/actions/logging.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('logs')) { @@ -183,83 +183,83 @@ function record_sort($array, $key) db->escape($_REQUEST['itemname']) . "'"; - } - if ($_REQUEST['message'] != "") { - $sqladd[] = "message LIKE '%" . $modx->db->escape($_REQUEST['message']) . "%'"; - } - // date stuff - if ($_REQUEST['datefrom'] != "") { - $sqladd[] = "timestamp>" . $modx->toTimeStamp($_REQUEST['datefrom']); - } - if ($_REQUEST['dateto'] != "") { - $sqladd[] = "timestamp<" . $modx->toTimeStamp($_REQUEST['dateto']); - } + // get the selections the user made. + $sqladd = array(); + if ($_REQUEST['searchuser'] != 0) { + $sqladd[] = "internalKey='" . (int)$_REQUEST['searchuser'] . "'"; + } + if ($_REQUEST['action'] != 0) { + $sqladd[] = "action=" . (int)$_REQUEST['action']; + } + if ($_REQUEST['itemid'] != 0 || $_REQUEST['itemid'] == "-") { + $sqladd[] = "itemid='" . $_REQUEST['itemid'] . "'"; + } + if ($_REQUEST['itemname'] != '0') { + $sqladd[] = "itemname='" . $modx->db->escape($_REQUEST['itemname']) . "'"; + } + if ($_REQUEST['message'] != "") { + $sqladd[] = "message LIKE '%" . $modx->db->escape($_REQUEST['message']) . "%'"; + } + // date stuff + if ($_REQUEST['datefrom'] != "") { + $sqladd[] = "timestamp>" . $modx->toTimeStamp($_REQUEST['datefrom']); + } + if ($_REQUEST['dateto'] != "") { + $sqladd[] = "timestamp<" . $modx->toTimeStamp($_REQUEST['dateto']); + } - // If current position is not set, set it to zero - if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) { - $int_cur_position = 0; - } else { - $int_cur_position = $_REQUEST['int_cur_position']; - } + // If current position is not set, set it to zero + if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) { + $int_cur_position = 0; + } else { + $int_cur_position = $_REQUEST['int_cur_position']; + } - // Number of result to display on the page, will be in the LIMIT of the sql query also - $int_num_result = is_numeric($_REQUEST['nrresults']) ? $_REQUEST['nrresults'] : $number_of_logs; + // Number of result to display on the page, will be in the LIMIT of the sql query also + $int_num_result = is_numeric($_REQUEST['nrresults']) ? $_REQUEST['nrresults'] : $number_of_logs; - $extargv = "&a=13&searchuser=" . $_REQUEST['searchuser'] . "&action=" . $_REQUEST['action'] . "&itemid=" . $_REQUEST['itemid'] . "&itemname=" . $_REQUEST['itemname'] . "&message=" . $_REQUEST['message'] . "&dateto=" . $_REQUEST['dateto'] . "&datefrom=" . $_REQUEST['datefrom'] . "&nrresults=" . $int_num_result . "&log_submit=" . $_REQUEST['log_submit']; // extra argv here (could be anything depending on your page) + $extargv = "&a=13&searchuser=" . $_REQUEST['searchuser'] . "&action=" . $_REQUEST['action'] . "&itemid=" . $_REQUEST['itemid'] . "&itemname=" . $_REQUEST['itemname'] . "&message=" . $_REQUEST['message'] . "&dateto=" . $_REQUEST['dateto'] . "&datefrom=" . $_REQUEST['datefrom'] . "&nrresults=" . $int_num_result . "&log_submit=" . $_REQUEST['log_submit']; // extra argv here (could be anything depending on your page) - // build the sql - $limit = $num_rows = $modx->db->getValue($modx->db->select('COUNT(*)', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''))); + // build the sql + $limit = $num_rows = $modx->db->getValue($modx->db->select('COUNT(*)', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''))); - $rs = $modx->db->select('*', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''), 'timestamp DESC, id DESC', "{$int_cur_position}, {$int_num_result}"); + $rs = $modx->db->select('*', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''), 'timestamp DESC, id DESC', "{$int_cur_position}, {$int_num_result}"); -if ($limit < 1) { - echo '

    ' . $_lang["mgrlog_emptysrch"] . '

    '; -} else { - echo '

    ' . $_lang["mgrlog_sortinst"] . '

    '; + if ($limit < 1) { + echo '

    ' . $_lang["mgrlog_emptysrch"] . '

    '; + } else { + echo '

    ' . $_lang["mgrlog_sortinst"] . '

    '; - include_once "paginate.inc.php"; - // New instance of the Paging class, you can modify the color and the width of the html table - $p = new Paging($num_rows, $int_cur_position, $int_num_result, $extargv); + include_once "paginate.inc.php"; + // New instance of the Paging class, you can modify the color and the width of the html table + $p = new Paging($num_rows, $int_cur_position, $int_num_result, $extargv); - // Load up the 2 array in order to display result - $array_paging = $p->getPagingArray(); - $array_row_paging = $p->getPagingRowArray(); - $current_row = $int_cur_position / $int_num_result; + // Load up the 2 array in order to display result + $array_paging = $p->getPagingArray(); + $array_row_paging = $p->getPagingRowArray(); + $current_row = $int_cur_position / $int_num_result; - // Display the result as you like... - print "

    " . $_lang["paging_showing"] . " " . $array_paging['lower']; - print " " . $_lang["paging_to"] . " " . $array_paging['upper']; - print " (" . $array_paging['total'] . " " . $_lang["paging_total"] . ")
    "; - $paging = $array_paging['first_link'] . $_lang["paging_first"] . (isset($array_paging['first_link']) ? "
    " : " "); - $paging .= $array_paging['previous_link'] . $_lang["paging_prev"] . (isset($array_paging['previous_link']) ? " " : " "); - $pagesfound = sizeof($array_row_paging); - if ($pagesfound > 6) { - $paging .= $array_row_paging[$current_row - 2]; // ." "; + // Display the result as you like... + print "

    " . $_lang["paging_showing"] . " " . $array_paging['lower']; + print " " . $_lang["paging_to"] . " " . $array_paging['upper']; + print " (" . $array_paging['total'] . " " . $_lang["paging_total"] . ")
    "; + $paging = $array_paging['first_link'] . $_lang["paging_first"] . (isset($array_paging['first_link']) ? " " : " "); + $paging .= $array_paging['previous_link'] . $_lang["paging_prev"] . (isset($array_paging['previous_link']) ? " " : " "); + $pagesfound = sizeof($array_row_paging); + if ($pagesfound > 6) { + $paging .= $array_row_paging[$current_row - 2]; // ." "; $paging .= $array_row_paging[$current_row - 1]; // ." "; $paging .= $array_row_paging[$current_row]; // ." "; $paging .= $array_row_paging[$current_row + 1]; // ." "; $paging .= $array_row_paging[$current_row + 2]; // ." "; - } else { - for ($i = 0; $i < $pagesfound; $i++) { - $paging .= $array_row_paging[$i] . " "; - } - } - $paging .= $array_paging['next_link'] . $_lang["paging_next"] . (isset($array_paging['next_link']) ? " " : " ") . " "; - $paging .= $array_paging['last_link'] . $_lang["paging_last"] . (isset($array_paging['last_link']) ? " " : " ") . " "; - // The above exemple print somethings like: + } else { + for ($i = 0; $i < $pagesfound; $i++) { + $paging .= $array_row_paging[$i] . " "; + } + } + $paging .= $array_paging['next_link'] . $_lang["paging_next"] . (isset($array_paging['next_link']) ? " " : " ") . " "; + $paging .= $array_paging['last_link'] . $_lang["paging_last"] . (isset($array_paging['last_link']) ? " " : " ") . " "; + // The above exemple print somethings like: // Results 1 to 20 of 597 <<< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 >>> // Of course you can now play with array_row_paging in order to print // only the results you would like... @@ -289,18 +289,17 @@ function record_sort($array, $key) db->getRow($rs)) { - if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) { - $item = '

    -
    '; - } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) { - $item = '' . $logentry['itemname'] . ''; - } else { - $item = $logentry['itemname']; - } - //index.php?a=13&searchuser=' . $logentry['internalKey'] . '&action=' . $logentry['action'] . '&itemname=' . $logentry['itemname'] . '&log_submit=true' - $user_drill = 'index.php?a=13&searchuser=' . $logentry['internalKey'] . '&itemname=0&log_submit=true'; - ?> + $i = 0; + while ($logentry = $modx->db->getRow($rs)) { + if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) { + $item = '
    -
    '; + } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) { + $item = '' . $logentry['itemname'] . ''; + } else { + $item = $logentry['itemname']; + } + //index.php?a=13&searchuser=' . $logentry['internalKey'] . '&action=' . $logentry['action'] . '&itemname=' . $logentry['itemname'] . '&log_submit=true' + $user_drill = 'index.php?a=13&searchuser=' . $logentry['internalKey'] . '&itemname=0&log_submit=true'; ?> ' . $logentry['username'] . '' ?> @@ -312,8 +311,7 @@ function record_sort($array, $key) + } ?> @@ -323,15 +321,14 @@ function record_sort($array, $key) + } ?> INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('messages')) { @@ -11,29 +11,29 @@ - +
    db->select('*', $modx->getFullTableName('user_messages'), "id='" . (int)$_REQUEST['id'] . "'"); - $message = $modx->db->getRow($rs); - if (!$message) { - echo "Wrong number of messages returned!"; + $message = $modx->db->getRow($rs); + if (!$message) { + echo "Wrong number of messages returned!"; + } else { + if ($message['recipient'] != $modx->getLoginUserID()) { + echo $_lang['messages_not_allowed_to_read']; + } else { + // output message! + // get the name of the sender + $sender = $message['sender']; + if ($sender == 0) { + $sendername = $_lang['messages_system_user']; } else { - if ($message['recipient'] != $modx->getLoginUserID()) { - echo $_lang['messages_not_allowed_to_read']; - } else { - // output message! - // get the name of the sender - $sender = $message['sender']; - if ($sender == 0) { - $sendername = $_lang['messages_system_user']; - } else { - $rs2 = $modx->db->select('username', $modx->getFullTableName('manager_users'), "id='{$sender}'"); - $sendername = $modx->db->getValue($rs2); - } - ?> + $rs2 = $modx->db->select('username', $modx->getFullTableName('manager_users'), "id='{$sender}'"); + $sendername = $modx->db->getValue($rs2); + } ?>
    @@ -63,24 +63,23 @@ ', $message['message']); - $dashcount = substr_count($message, '-----'); - $message = str_replace('-----', '', $message); - for ($i = 0; $i < $dashcount; $i++) { - $message .= ''; - } - ?> + $dashcount = substr_count($message, '-----'); + $message = str_replace('-----', '', $message); + for ($i = 0; $i < $dashcount; $i++) { + $message .= ''; + } ?>
    db->update(array('messageread' => 1), $modx->getFullTableName('user_messages'), "id='{$_REQUEST['id']}'"); - } - } - ?> + } + } ?>

    - +
    @@ -136,8 +135,7 @@ if ($limit < 1) { echo $_lang['messages_no_messages']; } else { - $dotablestuff = 1; - ?> + $dotablestuff = 1; ?>
    @@ -162,8 +160,7 @@ $rs2 = $modx->db->select('username', $modx->getFullTableName('manager_users'), "id='{$sender}'"); $sendername = $modx->db->getValue($rs2); } - $messagestyle = $message['messageread'] == 0 ? "text-primary" : ""; - ?> + $messagestyle = $message['messageread'] == 0 ? "text-primary" : ""; ?> ' : "" ?> @@ -172,13 +169,13 @@ toDateFormat($message['postdate'] + $server_offset_time) ?> + } ?>
    - +
    diff --git a/manager/actions/modules.static.php b/manager/actions/modules.static.php index a5257e8cfc..829941e32d 100755 --- a/manager/actions/modules.static.php +++ b/manager/actions/modules.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('exec_module'))) { @@ -116,7 +116,7 @@ function menuAction(a) ORDER BY sm.name'); if ($modx->hasPermission('edit_module')) { $title = "[+value+]"; - } else if ($modx->hasPermission('exec_module')) { + } elseif ($modx->hasPermission('exec_module')) { $title = "[+value+]"; } else { $title = '[+value+]'; diff --git a/manager/actions/move_document.dynamic.php b/manager/actions/move_document.dynamic.php index 435f7b2625..5f9b6c0002 100755 --- a/manager/actions/move_document.dynamic.php +++ b/manager/actions/move_document.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_document')) { diff --git a/manager/actions/mutate_categories.dynamic.php b/manager/actions/mutate_categories.dynamic.php index f58cede882..f98e83a47c 100755 --- a/manager/actions/mutate_categories.dynamic.php +++ b/manager/actions/mutate_categories.dynamic.php @@ -1,46 +1,44 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('category_manager')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('category_manager')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $_module_params = array( - 'module_version' => '1.0.0', - 'module_params' => '', - 'module_id' => $_GET['id'], - 'package_name' => 'Module_Categories_Manager', - 'native_language' => 'de', - 'name' => 'Categories Manager', - 'dirname' => $site_manager_url, - 'url' => 'index.php?a=120&id=' . $_GET['id'], - 'path' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR, - 'inc_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR, - 'languages_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR, - 'views_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'skin' . DIRECTORY_SEPARATOR, - 'request_key' => 'module_categories_manager', - 'messages' => array() + 'module_version' => '1.0.0', + 'module_params' => '', + 'module_id' => $_GET['id'], + 'package_name' => 'Module_Categories_Manager', + 'native_language' => 'de', + 'name' => 'Categories Manager', + 'dirname' => $site_manager_url, + 'url' => 'index.php?a=120&id=' . $_GET['id'], + 'path' => realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR, + 'inc_dir' => realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR, + 'languages_dir' => realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR, + 'views_dir' => realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'skin' . DIRECTORY_SEPARATOR, + 'request_key' => 'module_categories_manager', + 'messages' => array() ); require_once $_module_params['inc_dir'] . 'Module_Categories_Manager.php'; $cm = new Module_Categories_Manager(); // assign module_params to internal params -foreach( $_module_params as $param => $value ) -{ - $cm->set( $param, $value ); +foreach ($_module_params as $param => $value) { + $cm->set($param, $value); } // catch the request actions include_once $cm->get('inc_dir') . 'request_trigger.inc.php'; -if( !$categories = $cm->getCategories() ) -{ - setcookie('webfxtab_manage-categories-pane', 0 ); - $cm->addMessage( $cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global' ); +if (!$categories = $cm->getCategories()) { + setcookie('webfxtab_manage-categories-pane', 0); + $cm->addMessage($cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global'); } -$cm->renderView('main', $categories ); +$cm->renderView('main', $categories); return; diff --git a/manager/actions/mutate_content.dynamic.php b/manager/actions/mutate_content.dynamic.php index 55c2714d57..8d9b770d32 100755 --- a/manager/actions/mutate_content.dynamic.php +++ b/manager/actions/mutate_content.dynamic.php @@ -1,6 +1,6 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } /********************/ @@ -11,31 +11,31 @@ /*******************/ // check permissions -switch($modx->manager->action) { - case 27: - if(!$modx->hasPermission('edit_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 85: - case 72: - case 4: - if(!$modx->hasPermission('new_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } elseif(isset($_REQUEST['pid']) && $_REQUEST['pid'] != '0') { - // check user has permissions for parent - include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php'); - $udperms = new udperms(); - $udperms->user = $modx->getLoginUserID(); - $udperms->document = empty($_REQUEST['pid']) ? 0 : $_REQUEST['pid']; - $udperms->role = $_SESSION['mgrRole']; - if(!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); - } - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +switch ($modx->manager->action) { + case 27: + if (!$modx->hasPermission('edit_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 85: + case 72: + case 4: + if (!$modx->hasPermission('new_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '0') { + // check user has permissions for parent + include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php'); + $udperms = new udperms(); + $udperms->user = $modx->getLoginUserID(); + $udperms->document = empty($_REQUEST['pid']) ? 0 : $_REQUEST['pid']; + $udperms->role = $_SESSION['mgrRole']; + if (!$udperms->checkPermissions()) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); + } + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; @@ -53,23 +53,23 @@ $tbl_site_tmplvar_templates = $modx->getFullTableName('site_tmplvar_templates'); $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); -if($modx->manager->action == 27) { - //editing an existing document - // check permissions on the document - include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php'); - $udperms = new udperms(); - $udperms->user = $modx->getLoginUserID(); - $udperms->document = $id; - $udperms->role = $_SESSION['mgrRole']; - - if(!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); - } +if ($modx->manager->action == 27) { + //editing an existing document + // check permissions on the document + include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php'); + $udperms = new udperms(); + $udperms->user = $modx->getLoginUserID(); + $udperms->document = $id; + $udperms->role = $_SESSION['mgrRole']; + + if (!$udperms->checkPermissions()) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); + } } // check to see if resource isn't locked -if($lockedEl = $modx->elementIsLocked(7, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['resource'])); +if ($lockedEl = $modx->elementIsLocked(7, $id)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['resource'])); } // end check for lock @@ -77,75 +77,75 @@ $modx->lockElement(7, $id); // get document groups for current user -if($_SESSION['mgrDocgroups']) { - $docgrp = implode(',', $_SESSION['mgrDocgroups']); +if ($_SESSION['mgrDocgroups']) { + $docgrp = implode(',', $_SESSION['mgrDocgroups']); } -if(!empty ($id)) { - $access = sprintf("1='%s' OR sc.privatemgr=0", $_SESSION['mgrRole']); - if($docgrp) { - $access .= " OR dg.document_group IN ({$docgrp})"; - } - $rs = $modx->db->select('sc.*', "{$tbl_site_content} AS sc LEFT JOIN {$tbl_document_groups} AS dg ON dg.document=sc.id", "sc.id='{$id}' AND ({$access})"); - $content = array(); - $content = $modx->db->getRow($rs); - $modx->documentObject = &$content; - if(!$content) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); - } - $_SESSION['itemname'] = $content['pagetitle']; +if (!empty($id)) { + $access = sprintf("1='%s' OR sc.privatemgr=0", $_SESSION['mgrRole']); + if ($docgrp) { + $access .= " OR dg.document_group IN ({$docgrp})"; + } + $rs = $modx->db->select('sc.*', "{$tbl_site_content} AS sc LEFT JOIN {$tbl_document_groups} AS dg ON dg.document=sc.id", "sc.id='{$id}' AND ({$access})"); + $content = array(); + $content = $modx->db->getRow($rs); + $modx->documentObject = &$content; + if (!$content) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); + } + $_SESSION['itemname'] = $content['pagetitle']; } else { - $content = array(); + $content = array(); - if(isset($_REQUEST['newtemplate'])) { - $content['template'] = $_REQUEST['newtemplate']; - } else { - $content['template'] = getDefaultTemplate(); - } + if (isset($_REQUEST['newtemplate'])) { + $content['template'] = $_REQUEST['newtemplate']; + } else { + $content['template'] = getDefaultTemplate(); + } - $_SESSION['itemname'] = $_lang["new_resource"]; + $_SESSION['itemname'] = $_lang["new_resource"]; } // restore saved form $formRestored = $modx->manager->loadFormValues(); -if(isset($_REQUEST['newtemplate'])) { - $formRestored = true; +if (isset($_REQUEST['newtemplate'])) { + $formRestored = true; } // retain form values if template was changed // edited to convert pub_date and unpub_date // sottwell 02-09-2006 -if($formRestored == true) { - $content = array_merge($content, $_POST); - $content['content'] = $_POST['ta']; - if(empty ($content['pub_date'])) { - unset ($content['pub_date']); - } else { - $content['pub_date'] = $modx->toTimeStamp($content['pub_date']); - } - if(empty ($content['unpub_date'])) { - unset ($content['unpub_date']); - } else { - $content['unpub_date'] = $modx->toTimeStamp($content['unpub_date']); - } +if ($formRestored == true) { + $content = array_merge($content, $_POST); + $content['content'] = $_POST['ta']; + if (empty($content['pub_date'])) { + unset($content['pub_date']); + } else { + $content['pub_date'] = $modx->toTimeStamp($content['pub_date']); + } + if (empty($content['unpub_date'])) { + unset($content['unpub_date']); + } else { + $content['unpub_date'] = $modx->toTimeStamp($content['unpub_date']); + } } // increase menu index if this is a new document -if(!isset ($_REQUEST['id'])) { - if(!isset ($modx->config['auto_menuindex'])) { - $modx->config['auto_menuindex'] = 1; - } - if($modx->config['auto_menuindex']) { - $pid = (int)$_REQUEST['pid']; - $rs = $modx->db->select('count(*)', $tbl_site_content, "parent='{$pid}'"); - $content['menuindex'] = $modx->db->getValue($rs); - } else { - $content['menuindex'] = 0; - } +if (!isset($_REQUEST['id'])) { + if (!isset($modx->config['auto_menuindex'])) { + $modx->config['auto_menuindex'] = 1; + } + if ($modx->config['auto_menuindex']) { + $pid = (int)$_REQUEST['pid']; + $rs = $modx->db->select('count(*)', $tbl_site_content, "parent='{$pid}'"); + $content['menuindex'] = $modx->db->getValue($rs); + } else { + $content['menuindex'] = 0; + } } -if(isset ($_POST['which_editor'])) { - $modx->config['which_editor'] = $_POST['which_editor']; +if (isset($_POST['which_editor'])) { + $modx->config['which_editor'] = $_POST['which_editor']; } // Add lock-element JS-Script @@ -478,7 +478,7 @@ function decode(s) { return s; } - manager->action == '72') { // Web Link specific ?> + manager->action == '72') { // Web Link specific?> var lastImageCtrl; var lastFileCtrl; @@ -539,29 +539,30 @@ function SetUrl(url, width, height, alt) { } } - + /* ]]> */ invokeEvent('OnDocFormPrerender', array( - 'id' => $id, - 'template' => $content['template'] - )); - - if(is_array($evtOut)) { - echo implode('', $evtOut); - } - - /*************************/ - $dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : ''; - $sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : 'createdon'; - $page = isset($_REQUEST['page']) ? (int) $_REQUEST['page'] : ''; - /*************************/ - - ?> + // invoke OnDocFormPrerender event + $evtOut = $modx->invokeEvent('OnDocFormPrerender', array( + 'id' => $id, + 'template' => $content['template'] + )); + + if (is_array($evtOut)) { + echo implode('', $evtOut); + } + + /*************************/ + $dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : ''; + $sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : 'createdon'; + $page = isset($_REQUEST['page']) ? (int) $_REQUEST['page'] : ''; + /*************************/ + + ?> @@ -575,55 +576,55 @@ function SetUrl(url, width, height, alt) {

    - config['modx_charset']) . (iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '') . '(' . $_REQUEST['id'] . ')'; - } else { - if ($modx->manager->action == '4') { - echo $_lang['add_resource']; - } else if ($modx->manager->action == '72') { - echo $_lang['add_weblink']; - } else { - echo $_lang['create_resource_title']; - } - } ?> + config['modx_charset']) . (iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '') . '(' . $_REQUEST['id'] . ')'; + } else { + if ($modx->manager->action == '4') { + echo $_lang['add_resource']; + } elseif ($modx->manager->action == '72') { + echo $_lang['add_weblink']; + } else { + echo $_lang['create_resource_title']; + } + } ?>

    config['use_breadcrumbs']) { - $temp = array(); - $title = isset($content['pagetitle']) ? $content['pagetitle'] : $_lang['create_resource_title']; - - if(isset($_REQUEST['id']) && $content['parent'] != 0) { - $bID = (int) $_REQUEST['id']; - $temp = $modx->getParentIds($bID); - } else if(isset($_REQUEST['pid'])) { - $bID = (int) $_REQUEST['pid']; - $temp = $modx->getParentIds($bID); - array_unshift($temp, $bID); - } - - if($temp) { - $parents = implode(',', $temp); - - if(!empty($parents)) { - $where = "FIND_IN_SET(id,'{$parents}') DESC"; - $rs = $modx->db->select('id, pagetitle', $tbl_site_content, "id IN ({$parents})", $where); - while($row = $modx->db->getRow($rs)) { - $out .= ''; - } - } - } + } + } + } - $out .= ''; - echo ''; - } - ?> + $out .= ''; + echo ''; + } + ?>
    @@ -635,13 +636,13 @@ function SetUrl(url, width, height, alt) { invokeEvent('OnDocFormTemplateRender', array( - 'id' => $id - )); - if(is_array($evtOut)) { - echo implode('', $evtOut); - } else { - ?> + $evtOut = $modx->invokeEvent('OnDocFormTemplateRender', array( + 'id' => $id + )); + if (is_array($evtOut)) { + echo implode('', $evtOut); + } else { + ?>

    @@ -694,7 +695,7 @@ function SetUrl(url, width, height, alt) { - manager->action == '72') { // Web Link specific ?> + manager->action == '72') { // Web Link specific?> @@ -706,7 +707,8 @@ function SetUrl(url, width, height, alt) { - + @@ -726,36 +728,35 @@ function SetUrl(url, width, height, alt) { @@ -795,37 +796,36 @@ function SetUrl(url, width, height, alt) { db->select('pagetitle', $tbl_site_content, "id='{$parentlookup}'"); - $parentname = $modx->db->getValue($rs); - if(!$parentname) { - $modx->webAlertAndQuit($_lang["error_no_parent"]); - } - } - ?> + $parentlookup = false; + if (isset($_REQUEST['id'])) { + if ($content['parent'] == 0) { + $parentname = $site_name; + } else { + $parentlookup = $content['parent']; + } + } elseif (isset($_REQUEST['pid'])) { + if ($_REQUEST['pid'] == 0) { + $parentname = $site_name; + } else { + $parentlookup = $_REQUEST['pid']; + } + } elseif (isset($_POST['parent'])) { + if ($_POST['parent'] == 0) { + $parentname = $site_name; + } else { + $parentlookup = $_POST['parent']; + } + } else { + $parentname = $site_name; + $content['parent'] = 0; + } + if ($parentlookup !== false && is_numeric($parentlookup)) { + $rs = $modx->db->select('pagetitle', $tbl_site_content, "id='{$parentlookup}'"); + $parentname = $modx->db->getValue($rs); + if (!$parentname) { + $modx->webAlertAndQuit($_lang["error_no_parent"]); + } + } ?> " onclick="enableParentSelection(!allowParentSelection);"> () @@ -833,37 +833,38 @@ function SetUrl(url, width, height, alt) { manager->action == '72') { - ?> - - -
    - - - - - - - - - - - - manager->action == '4') { ?> + /* + if($content['type'] == 'reference' || $modx->manager->action == '72') { + ?> + + +
    + + + + + + + + + + + + manager->action == '4') { + ?>
    @@ -874,107 +875,105 @@ function SetUrl(url, width, height, alt) {
    manager->action == '4') && $use_editor == 1) { - $htmlContent = $content['content']; - ?> + if (($content['richtext'] == 1 || $modx->manager->action == '4') && $use_editor == 1) { + $htmlContent = $content['content']; ?>
    config['which_editor']][] = 'ta'; - $richtexteditorOptions[$modx->config['which_editor']]['ta'] = ''; - } else { - echo "\t" . '
    ' . "\n"; - } - ?> + // Richtext-[*content*] + $richtexteditorIds = array(); + $richtexteditorOptions = array(); + $richtexteditorIds[$modx->config['which_editor']][] = 'ta'; + $richtexteditorOptions[$modx->config['which_editor']]['ta'] = ''; + } else { + echo "\t" . '
    ' . "\n"; + } ?>
    - + manager->action == '4') || ($content['type'] == 'reference' || $modx->manager->action == 72)) { - $template = $default_template; - $group_tvs = empty($modx->config['group_tvs']) ? 0 : (int)$modx->config['group_tvs']; - if (isset ($_REQUEST['newtemplate'])) { - $template = $_REQUEST['newtemplate']; - } else { - if (isset ($content['template'])) { - $template = $content['template']; - } + if (($content['type'] == 'document' || $modx->manager->action == '4') || ($content['type'] == 'reference' || $modx->manager->action == 72)) { + $template = $default_template; + $group_tvs = empty($modx->config['group_tvs']) ? 0 : (int)$modx->config['group_tvs']; + if (isset($_REQUEST['newtemplate'])) { + $template = $_REQUEST['newtemplate']; + } else { + if (isset($content['template'])) { + $template = $content['template']; } + } - $field = "DISTINCT tv.*, IF(tvc.value!='',tvc.value,tv.default_text) as value, tvtpl.rank as tvrank"; - $vs = array( + $field = "DISTINCT tv.*, IF(tvc.value!='',tvc.value,tv.default_text) as value, tvtpl.rank as tvrank"; + $vs = array( $tbl_site_tmplvars, $tbl_site_tmplvar_templates, $tbl_site_tmplvar_contentvalues, $id, $tbl_site_tmplvar_access ); - $from = vsprintf("%s AS tv INNER JOIN %s AS tvtpl ON tvtpl.tmplvarid = tv.id + $from = vsprintf("%s AS tv INNER JOIN %s AS tvtpl ON tvtpl.tmplvarid = tv.id LEFT JOIN %s AS tvc ON tvc.tmplvarid=tv.id AND tvc.contentid='%s' LEFT JOIN %s AS tva ON tva.tmplvarid=tv.id", $vs); - $dgs = $docgrp ? " OR tva.documentgroup IN ({$docgrp})" : ''; - $vs = array( + $dgs = $docgrp ? " OR tva.documentgroup IN ({$docgrp})" : ''; + $vs = array( $template, $_SESSION['mgrRole'], $dgs ); - $sort = 'tvtpl.rank,tv.rank, tv.id'; - if ($group_tvs) { - $field .= ', IFNULL(tv.category,0) as category_id, IFNULL(cat.category,"' . $_lang['no_category'] . '") AS category, IFNULL(cat.rank,0) AS category_rank'; - $from .= ' + $sort = 'tvtpl.rank,tv.rank, tv.id'; + if ($group_tvs) { + $field .= ', IFNULL(tv.category,0) as category_id, IFNULL(cat.category,"' . $_lang['no_category'] . '") AS category, IFNULL(cat.rank,0) AS category_rank'; + $from .= ' LEFT JOIN ' . $tbl_categories . ' AS cat ON cat.id=tv.category'; - $sort = 'cat.rank,cat.id,' . $sort; - } - $where = vsprintf("tvtpl.templateid='%s' AND (1='%s' OR ISNULL(tva.documentgroup) %s)", $vs); - $rs = $modx->db->select($field, $from, $where, $sort); - if ($modx->db->getRecordCount($rs)) { - $tvsArray = $modx->db->makeArray($rs, 'name'); - require_once(MODX_MANAGER_PATH . 'includes/tmplvars.inc.php'); - require_once(MODX_MANAGER_PATH . 'includes/tmplvars.commands.inc.php'); - - $templateVariablesOutput = ''; - $templateVariablesGeneral = ''; - - $i = $ii = 0; - $tab = ''; - foreach ($tvsArray as $row) { - if ($group_tvs && $row['category_id'] != 0) { - $ii = 0; - if ($tab !== $row['category_id']) { - if ($group_tvs == 1 || $group_tvs == 3) { - if ($i === 0) { - $templateVariablesOutput .= ' + $sort = 'cat.rank,cat.id,' . $sort; + } + $where = vsprintf("tvtpl.templateid='%s' AND (1='%s' OR ISNULL(tva.documentgroup) %s)", $vs); + $rs = $modx->db->select($field, $from, $where, $sort); + if ($modx->db->getRecordCount($rs)) { + $tvsArray = $modx->db->makeArray($rs, 'name'); + require_once(MODX_MANAGER_PATH . 'includes/tmplvars.inc.php'); + require_once(MODX_MANAGER_PATH . 'includes/tmplvars.commands.inc.php'); + + $templateVariablesOutput = ''; + $templateVariablesGeneral = ''; + + $i = $ii = 0; + $tab = ''; + foreach ($tvsArray as $row) { + if ($group_tvs && $row['category_id'] != 0) { + $ii = 0; + if ($tab !== $row['category_id']) { + if ($group_tvs == 1 || $group_tvs == 3) { + if ($i === 0) { + $templateVariablesOutput .= '
    ' . $row['category'] . '
    ' . "\n"; - } else { - $templateVariablesOutput .= ' + } else { + $templateVariablesOutput .= '
    @@ -983,18 +982,18 @@ function SetUrl(url, width, height, alt) {
    ' . $row['category'] . '
    '; - } - } else if ($group_tvs == 2 || $group_tvs == 4) { - if ($i === 0) { - $templateVariablesOutput .= ' + } + } elseif ($group_tvs == 2 || $group_tvs == 4) { + if ($i === 0) { + $templateVariablesOutput .= '

    ' . $row['category'] . '

    '; - } else { - $templateVariablesOutput .= ' + } else { + $templateVariablesOutput .= '
    @@ -1005,16 +1004,16 @@ function SetUrl(url, width, height, alt) {
    '; - } - } else if ($group_tvs == 5) { - if ($i === 0) { - $templateVariablesOutput .= ' + } + } elseif ($group_tvs == 5) { + if ($i === 0) { + $templateVariablesOutput .= '

    ' . $row['category'] . '

    '; - } else { - $templateVariablesOutput .= ' + } else { + $templateVariablesOutput .= '
    @@ -1023,97 +1022,97 @@ function SetUrl(url, width, height, alt) { '; - } } - $split = 0; - } else { - $split = 1; } + $split = 0; + } else { + $split = 1; } + } - // Go through and display all Template Variables - if ($row['type'] == 'richtext' || $row['type'] == 'htmlarea') { - // determine TV-options - $tvOptions = $modx->parseProperties($row['elements']); - if (!empty($tvOptions)) { - // Allow different Editor with TV-option {"editor":"CKEditor4"} or &editor=Editor;text;CKEditor4 - $editor = isset($tvOptions['editor']) ? $tvOptions['editor'] : $modx->config['which_editor']; - }; - // Add richtext editor to the list - $richtexteditorIds[$editor][] = "tv" . $row['id']; - $richtexteditorOptions[$editor]["tv" . $row['id']] = $tvOptions; - } + // Go through and display all Template Variables + if ($row['type'] == 'richtext' || $row['type'] == 'htmlarea') { + // determine TV-options + $tvOptions = $modx->parseProperties($row['elements']); + if (!empty($tvOptions)) { + // Allow different Editor with TV-option {"editor":"CKEditor4"} or &editor=Editor;text;CKEditor4 + $editor = isset($tvOptions['editor']) ? $tvOptions['editor'] : $modx->config['which_editor']; + }; + // Add richtext editor to the list + $richtexteditorIds[$editor][] = "tv" . $row['id']; + $richtexteditorOptions[$editor]["tv" . $row['id']] = $tvOptions; + } - $templateVariablesTmp = ''; + $templateVariablesTmp = ''; - // splitter - if ($group_tvs) { - if (($split && $i) || $ii) { - $templateVariablesTmp .= ' - ' . "\n"; - } - } else if ($i) { + // splitter + if ($group_tvs) { + if (($split && $i) || $ii) { $templateVariablesTmp .= ' - ' . "\n"; + ' . "\n"; } + } elseif ($i) { + $templateVariablesTmp .= ' + ' . "\n"; + } - // post back value - if (array_key_exists('tv' . $row['id'], $_POST)) { - if (is_array($_POST['tv' . $row['id']])) { - $tvPBV = implode('||', $_POST['tv' . $row['id']]); - } else { - $tvPBV = $_POST['tv' . $row['id']]; - } + // post back value + if (array_key_exists('tv' . $row['id'], $_POST)) { + if (is_array($_POST['tv' . $row['id']])) { + $tvPBV = implode('||', $_POST['tv' . $row['id']]); } else { - $tvPBV = $row['value']; + $tvPBV = $_POST['tv' . $row['id']]; } + } else { + $tvPBV = $row['value']; + } - $tvDescription = (!empty($row['description'])) ? '
    ' . $row['description'] . '' : ''; - $tvInherited = (substr($tvPBV, 0, 8) == '@INHERIT') ? '
    (' . $_lang['tmplvars_inherited'] . ')' : ''; - $tvName = $modx->hasPermission('edit_template') ? '
    [*' . $row['name'] . '*]' : ''; + $tvDescription = (!empty($row['description'])) ? '
    ' . $row['description'] . '' : ''; + $tvInherited = (substr($tvPBV, 0, 8) == '@INHERIT') ? '
    (' . $_lang['tmplvars_inherited'] . ')' : ''; + $tvName = $modx->hasPermission('edit_template') ? '
    [*' . $row['name'] . '*]' : ''; - $templateVariablesTmp .= ' + $templateVariablesTmp .= ' '; - if ($group_tvs && $row['category_id'] == 0) { - $templateVariablesGeneral .= $templateVariablesTmp; - $ii++; - } else { - $templateVariablesOutput .= $templateVariablesTmp; - $tab = $row['category_id']; - $i++; - } + if ($group_tvs && $row['category_id'] == 0) { + $templateVariablesGeneral .= $templateVariablesTmp; + $ii++; + } else { + $templateVariablesOutput .= $templateVariablesTmp; + $tab = $row['category_id']; + $i++; } + } - if ($templateVariablesGeneral) { - echo '
    ' . $row['caption'] . $tvName . '' . $tvDescription . $tvInherited . '
    ' . renderFormElement($row['type'], $row['id'], $row['default_text'], $row['elements'], $tvPBV, '', $row, $tvsArray) . '
    ' . $templateVariablesGeneral . '
    '; - } + if ($templateVariablesGeneral) { + echo '' . $templateVariablesGeneral . '
    '; + } - $templateVariables .= ' + $templateVariables .= ' ' . "\n"; - if (!$group_tvs) { - $templateVariables .= ' + if (!$group_tvs) { + $templateVariables .= '
    ' . $_lang['settings_templvars'] . '
    '; - } else if ($group_tvs == 2) { - $templateVariables .= ' + } elseif ($group_tvs == 2) { + $templateVariables .= '
    ' . $_lang['settings_templvars'] . '
    '; - } else if ($group_tvs == 3) { - $templateVariables .= ' + } elseif ($group_tvs == 3) { + $templateVariables .= '

    ' . $_lang['settings_templvars'] . '

    '; - } else if ($group_tvs == 4) { - $templateVariables .= ' + } elseif ($group_tvs == 4) { + $templateVariables .= '

    ' . $_lang['settings_templvars'] . '

    @@ -1122,34 +1121,33 @@ function SetUrl(url, width, height, alt) { '; - } - $templateVariables .= $templateVariablesOutput; - $templateVariables .= ' + } + $templateVariables .= $templateVariablesOutput; + $templateVariables .= '
    ' . "\n"; - if ($group_tvs == 1) { - $templateVariables .= ' + if ($group_tvs == 1) { + $templateVariables .= ' ' . "\n"; - } else if ($group_tvs == 2 || $group_tvs == 4) { - $templateVariables .= ' + } elseif ($group_tvs == 2 || $group_tvs == 4) { + $templateVariables .= ' ' . "\n"; - } else if ($group_tvs == 3) { - $templateVariables .= ' + } elseif ($group_tvs == 3) { + $templateVariables .= ' ' . "\n"; - } - $templateVariables .= ' - ' . "\n"; } + $templateVariables .= ' + ' . "\n"; } + } - // Template Variables - if ($modx->config['group_tvs'] < 3) { - echo $templateVariables; - } - ?> + // Template Variables + if ($modx->config['group_tvs'] < 3) { + echo $templateVariables; + } ?> @@ -1212,8 +1210,8 @@ function SetUrl(url, width, height, alt) { manager->action != '27' || $_SESSION['mgrInternalKey'] == $content['createdby'] || $modx->hasPermission('change_resourcetype')) { - ?> + if ($_SESSION['mgrRole'] == 1 || $modx->manager->action != '27' || $_SESSION['mgrInternalKey'] == $content['createdby'] || $modx->hasPermission('change_resourcetype')) { + ?> @@ -1235,15 +1233,14 @@ function SetUrl(url, width, height, alt) { @@ -1266,23 +1263,23 @@ function SetUrl(url, width, height, alt) { manager->action != '72') { - // non-admin managers creating or editing a document resource - ?> + } else { + if ($content['type'] != 'reference' && $modx->manager->action != '72') { + // non-admin managers creating or editing a document resource + ?> " /> + } else { + // non-admin managers creating or editing a reference (weblink) resource + ?> + } + }//if mgrRole + ?> @@ -1355,7 +1352,8 @@ function SetUrl(url, width, height, alt) { - + manager->action == '27' ? $id : (!empty($_REQUEST['pid']) ? $_REQUEST['pid'] : $content['parent'])); - if($documentId > 0) { - // Load up, the permissions from the parent (if new document) or existing document - $rs = $modx->db->select('id, document_group', $tbl_document_groups, "document='{$documentId}'"); - while($currentgroup = $modx->db->getRow($rs)) $groupsarray[] = $currentgroup['document_group'] . ',' . $currentgroup['id']; - - // Load up the current permissions and names - $vs = array( - $tbl_document_group_names, - $tbl_document_groups, - $documentId - ); - $from = vsprintf("%s AS dgn LEFT JOIN %s AS groups ON groups.document_group=dgn.id AND groups.document='%s'", $vs); - $rs = $modx->db->select('dgn.*, groups.id AS link_id', $from, '', 'name'); - } else { - // Just load up the names, we're starting clean - $rs = $modx->db->select('*, NULL AS link_id', $tbl_document_group_names, '', 'name'); - } + /******************************* + * Document Access Permissions */ + if ($use_udperms == 1) { + $groupsarray = array(); + $sql = ''; + + $documentId = ($modx->manager->action == '27' ? $id : (!empty($_REQUEST['pid']) ? $_REQUEST['pid'] : $content['parent'])); + if ($documentId > 0) { + // Load up, the permissions from the parent (if new document) or existing document + $rs = $modx->db->select('id, document_group', $tbl_document_groups, "document='{$documentId}'"); + while ($currentgroup = $modx->db->getRow($rs)) { + $groupsarray[] = $currentgroup['document_group'] . ',' . $currentgroup['id']; + } - // retain selected doc groups between post - if(isset($_POST['docgroups'])) { - $groupsarray = array_merge($groupsarray, $_POST['docgroups']); - } + // Load up the current permissions and names + $vs = array( + $tbl_document_group_names, + $tbl_document_groups, + $documentId + ); + $from = vsprintf("%s AS dgn LEFT JOIN %s AS groups ON groups.document_group=dgn.id AND groups.document='%s'", $vs); + $rs = $modx->db->select('dgn.*, groups.id AS link_id', $from, '', 'name'); + } else { + // Just load up the names, we're starting clean + $rs = $modx->db->select('*, NULL AS link_id', $tbl_document_group_names, '', 'name'); + } + + // retain selected doc groups between post + if (isset($_POST['docgroups'])) { + $groupsarray = array_merge($groupsarray, $_POST['docgroups']); + } + + $isManager = $modx->hasPermission('access_permissions'); + $isWeb = $modx->hasPermission('web_access_permissions'); + + // Setup Basic attributes for each Input box + $inputAttributes = array( + 'type' => 'checkbox', + 'class' => 'checkbox', + 'name' => 'docgroups[]', + 'onclick' => 'makePublic(false);', + ); + $permissions = array(); // New Permissions array list (this contains the HTML) + $permissions_yes = 0; // count permissions the current mgr user has + $permissions_no = 0; // count permissions the current mgr user doesn't have + + // Loop through the permissions list + while ($row = $modx->db->getRow($rs)) { + + // Create an inputValue pair (group ID and group link (if it exists)) + $inputValue = $row['id'] . ',' . ($row['link_id'] ? $row['link_id'] : 'new'); + $inputId = 'group-' . $row['id']; + + $checked = in_array($inputValue, $groupsarray); + if ($checked) { + $notPublic = true; + } // Mark as private access (either web or manager) + + // Skip the access permission if the user doesn't have access... + if ((!$isManager && $row['private_memgroup'] == '1') || (!$isWeb && $row['private_webgroup'] == '1')) { + continue; + } - $isManager = $modx->hasPermission('access_permissions'); - $isWeb = $modx->hasPermission('web_access_permissions'); - - // Setup Basic attributes for each Input box - $inputAttributes = array( - 'type' => 'checkbox', - 'class' => 'checkbox', - 'name' => 'docgroups[]', - 'onclick' => 'makePublic(false);', - ); - $permissions = array(); // New Permissions array list (this contains the HTML) - $permissions_yes = 0; // count permissions the current mgr user has - $permissions_no = 0; // count permissions the current mgr user doesn't have - - // Loop through the permissions list - while($row = $modx->db->getRow($rs)) { - - // Create an inputValue pair (group ID and group link (if it exists)) - $inputValue = $row['id'] . ',' . ($row['link_id'] ? $row['link_id'] : 'new'); - $inputId = 'group-' . $row['id']; - - $checked = in_array($inputValue, $groupsarray); - if($checked) { - $notPublic = true; - } // Mark as private access (either web or manager) - - // Skip the access permission if the user doesn't have access... - if((!$isManager && $row['private_memgroup'] == '1') || (!$isWeb && $row['private_webgroup'] == '1')) { - continue; - } - - // Setup attributes for this Input box - $inputAttributes['id'] = $inputId; - $inputAttributes['value'] = $inputValue; - if($checked) { - $inputAttributes['checked'] = 'checked'; - } else { - unset($inputAttributes['checked']); - } - - // Create attribute string list - $inputString = array(); - foreach($inputAttributes as $k => $v) $inputString[] = $k . '="' . $v . '"'; - - // Make the HTML - $inputHTML = ''; - - // does user have this permission? - $from = "{$tbl_membergroup_access} AS mga, {$tbl_member_groups} AS mg"; - $vs = array( - $row['id'], - $_SESSION['mgrInternalKey'] - ); - $where = vsprintf("mga.membergroup=mg.user_group AND mga.documentgroup=%s AND mg.member=%s", $vs); - $rsp = $modx->db->select('COUNT(mg.id)', $from, $where); - $count = $modx->db->getValue($rsp); - if($count > 0) { - ++$permissions_yes; - } else { - ++$permissions_no; - } - $permissions[] = "\t\t" . '
  • ' . $inputHTML . '
  • '; - } - // if mgr user doesn't have access to any of the displayable permissions, forget about them and make doc public - if($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0)) { - $permissions = array(); - } + // Setup attributes for this Input box + $inputAttributes['id'] = $inputId; + $inputAttributes['value'] = $inputValue; + if ($checked) { + $inputAttributes['checked'] = 'checked'; + } else { + unset($inputAttributes['checked']); + } - // See if the Access Permissions section is worth displaying... - if(!empty($permissions)) { - // Add the "All Document Groups" item if we have rights in both contexts - if($isManager && $isWeb) { - array_unshift($permissions, "\t\t" . '
  • '); - } - // Output the permissions list... - ?> + // Create attribute string list + $inputString = array(); + foreach ($inputAttributes as $k => $v) { + $inputString[] = $k . '="' . $v . '"'; + } + + // Make the HTML + $inputHTML = ''; + + // does user have this permission? + $from = "{$tbl_membergroup_access} AS mga, {$tbl_member_groups} AS mg"; + $vs = array( + $row['id'], + $_SESSION['mgrInternalKey'] + ); + $where = vsprintf("mga.membergroup=mg.user_group AND mga.documentgroup=%s AND mg.member=%s", $vs); + $rsp = $modx->db->select('COUNT(mg.id)', $from, $where); + $count = $modx->db->getValue($rsp); + if ($count > 0) { + ++$permissions_yes; + } else { + ++$permissions_no; + } + $permissions[] = "\t\t" . '
  • ' . $inputHTML . '
  • '; + } + // if mgr user doesn't have access to any of the displayable permissions, forget about them and make doc public + if ($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0)) { + $permissions = array(); + } + + // See if the Access Permissions section is worth displaying... + if (!empty($permissions)) { + // Add the "All Document Groups" item if we have rights in both contexts + if ($isManager && $isWeb) { + array_unshift($permissions, "\t\t" . '
  • '); + } + // Output the permissions list... + ?>

    @@ -1504,31 +1506,30 @@ function makePublic(b) {
    0) && ($_SESSION['mgrPermissions']['access_permissions'] == 1 || $_SESSION['mgrPermissions']['web_access_permissions'] == 1)) { - ?> + } // !empty($permissions) + elseif ($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0) && ($_SESSION['mgrPermissions']['access_permissions'] == 1 || $_SESSION['mgrPermissions']['web_access_permissions'] == 1)) { + ?>

    + } + } + /* End Document Access Permissions * + ***********************************/ + ?> invokeEvent('OnDocFormRender', array( - 'id' => $id, - 'template' => $content['template'] - )); + // invoke OnDocFormRender event + $evtOut = $modx->invokeEvent('OnDocFormRender', array( + 'id' => $id, + 'template' => $content['template'] + )); - if(is_array($evtOut)) { - echo implode('', $evtOut); - } - ?> + if (is_array($evtOut)) { + echo implode('', $evtOut); + } + ?>
    @@ -1538,64 +1539,66 @@ function makePublic(b) { storeCurTemplate(); manager->action == '4' || $modx->manager->action == '72') && $use_editor == 1) { - if(is_array($richtexteditorIds)) { - foreach($richtexteditorIds as $editor => $elements) { - // invoke OnRichTextEditorInit event - $evtOut = $modx->invokeEvent('OnRichTextEditorInit', array( - 'editor' => $editor, - 'elements' => $elements, - 'options' => $richtexteditorOptions[$editor] - )); - if(is_array($evtOut)) { - echo implode('', $evtOut); - } - } - } -} +if (($content['richtext'] == 1 || $modx->manager->action == '4' || $modx->manager->action == '72') && $use_editor == 1) { + if (is_array($richtexteditorIds)) { + foreach ($richtexteditorIds as $editor => $elements) { + // invoke OnRichTextEditorInit event + $evtOut = $modx->invokeEvent('OnRichTextEditorInit', array( + 'editor' => $editor, + 'elements' => $elements, + 'options' => $richtexteditorOptions[$editor] + )); + if (is_array($evtOut)) { + echo implode('', $evtOut); + } + } + } + } /** * @return string */ -function getDefaultTemplate() { - $modx = evolutionCMS(); +function getDefaultTemplate() +{ + $modx = evolutionCMS(); $default_template = ''; - switch($modx->config['auto_template_logic']) { - case 'sibling': - if(!isset($_GET['pid']) || empty($_GET['pid'])) { - $site_start = $modx->config['site_start']; - $where = "sc.isfolder=0 AND sc.id!='{$site_start}'"; - $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 1, 0, 'template', $where, 'menuindex', 'ASC', 1); - if(isset($sibl[0]['template']) && $sibl[0]['template'] !== '') { - $default_template = $sibl[0]['template']; - } - } else { - $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 1, 0, 'template', 'isfolder=0', 'menuindex', 'ASC', 1); - if(isset($sibl[0]['template']) && $sibl[0]['template'] !== '') { - $default_template = $sibl[0]['template']; - } else { - $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 0, 0, 'template', 'isfolder=0', 'menuindex', 'ASC', 1); - if(isset($sibl[0]['template']) && $sibl[0]['template'] !== '') { - $default_template = $sibl[0]['template']; - } - } - } - if(isset($default_template)) { - break; - } // If $default_template could not be determined, fall back / through to "parent"-mode - case 'parent': - if(isset($_REQUEST['pid']) && !empty($_REQUEST['pid'])) { - $parent = $modx->getPageInfo($_REQUEST['pid'], 0, 'template'); - if(isset($parent['template'])) { - $default_template = $parent['template']; - } - } - break; - case 'system': - default: // default_template is already set - $default_template = $modx->config['default_template']; - } - - return empty($default_template) ? $modx->config['default_template'] : $default_template; + switch ($modx->config['auto_template_logic']) { + case 'sibling': + if (!isset($_GET['pid']) || empty($_GET['pid'])) { + $site_start = $modx->config['site_start']; + $where = "sc.isfolder=0 AND sc.id!='{$site_start}'"; + $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 1, 0, 'template', $where, 'menuindex', 'ASC', 1); + if (isset($sibl[0]['template']) && $sibl[0]['template'] !== '') { + $default_template = $sibl[0]['template']; + } + } else { + $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 1, 0, 'template', 'isfolder=0', 'menuindex', 'ASC', 1); + if (isset($sibl[0]['template']) && $sibl[0]['template'] !== '') { + $default_template = $sibl[0]['template']; + } else { + $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 0, 0, 'template', 'isfolder=0', 'menuindex', 'ASC', 1); + if (isset($sibl[0]['template']) && $sibl[0]['template'] !== '') { + $default_template = $sibl[0]['template']; + } + } + } + if (isset($default_template)) { + break; + } // If $default_template could not be determined, fall back / through to "parent"-mode + // no break + case 'parent': + if (isset($_REQUEST['pid']) && !empty($_REQUEST['pid'])) { + $parent = $modx->getPageInfo($_REQUEST['pid'], 0, 'template'); + if (isset($parent['template'])) { + $default_template = $parent['template']; + } + } + break; + case 'system': + default: // default_template is already set + $default_template = $modx->config['default_template']; + } + + return empty($default_template) ? $modx->config['default_template'] : $default_template; } diff --git a/manager/actions/mutate_htmlsnippet.dynamic.php b/manager/actions/mutate_htmlsnippet.dynamic.php index 9305315b5c..25e1ebcc28 100755 --- a/manager/actions/mutate_htmlsnippet.dynamic.php +++ b/manager/actions/mutate_htmlsnippet.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } @@ -43,7 +43,7 @@ if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } -} else if (isset($_REQUEST['itemname'])) { +} elseif (isset($_REQUEST['itemname'])) { $content['name'] = $_REQUEST['itemname']; } else { $_SESSION['itemname'] = $_lang["new_htmlsnippet"]; diff --git a/manager/actions/mutate_menuindex_sort.dynamic.php b/manager/actions/mutate_menuindex_sort.dynamic.php index 989eedeada..64f823e562 100755 --- a/manager/actions/mutate_menuindex_sort.dynamic.php +++ b/manager/actions/mutate_menuindex_sort.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('edit_document') || !$modx->hasPermission('save_document')) { @@ -49,7 +49,7 @@ $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; $docgrp_cond = $docgrp ? "OR dg.document_group IN ({$docgrp})" : ''; - $mgrRole = (isset ($_SESSION['mgrRole']) && (string)$_SESSION['mgrRole'] === '1') ? '1' : '0'; + $mgrRole = (isset($_SESSION['mgrRole']) && (string)$_SESSION['mgrRole'] === '1') ? '1' : '0'; $access = " AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); $rs = $modx->db->select('sc.id, sc.pagetitle, sc.parent, sc.menuindex, sc.published, sc.hidemenu, sc.deleted, sc.isfolder', $tblsc . 'AS sc LEFT JOIN ' . $tbldg . ' dg ON dg.document=sc.id', 'sc.parent=' . $id . $access . ' GROUP BY sc.id', 'menuindex ASC'); diff --git a/manager/actions/mutate_module.dynamic.php b/manager/actions/mutate_module.dynamic.php index 38694b9403..a4f6ab0d40 100755 --- a/manager/actions/mutate_module.dynamic.php +++ b/manager/actions/mutate_module.dynamic.php @@ -1,20 +1,20 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -switch($modx->manager->action) { - case 107: - if(!$modx->hasPermission('new_module')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 108: - if(!$modx->hasPermission('edit_module')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +switch ($modx->manager->action) { + case 107: + if (!$modx->hasPermission('new_module')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 108: + if (!$modx->hasPermission('edit_module')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; // Get table names (alphabetical) @@ -33,40 +33,41 @@ * * @return string */ -function createGUID() { - srand((double) microtime() * 1000000); - $r = rand(); - $u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1); - $m = md5($u); - return $m; +function createGUID() +{ + srand((double) microtime() * 1000000); + $r = rand(); + $u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1); + $m = md5($u); + return $m; } // check to see the module editor isn't locked -if($lockedEl = $modx->elementIsLocked(6, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); +if ($lockedEl = $modx->elementIsLocked(6, $id)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); } // end check for lock // Lock snippet for other users to edit $modx->lockElement(6, $id); -if(isset($_GET['id'])) { - $rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'"); - $content = $modx->db->getRow($rs); - if(!$content) { - $modx->webAlertAndQuit("Module not found for id '{$id}'."); - } - $content['properties'] = str_replace("&", "&", $content['properties']); - $_SESSION['itemname'] = $content['name']; - if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } +if (isset($_GET['id'])) { + $rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'"); + $content = $modx->db->getRow($rs); + if (!$content) { + $modx->webAlertAndQuit("Module not found for id '{$id}'."); + } + $content['properties'] = str_replace("&", "&", $content['properties']); + $_SESSION['itemname'] = $content['name']; + if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } } else { - $_SESSION['itemname'] = $_lang["new_module"]; - $content['wrap'] = '1'; + $_SESSION['itemname'] = $_lang["new_module"]; + $content['wrap'] = '1'; } -if($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); +if ($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); } // Add lock-element JS-Script @@ -437,18 +438,18 @@ function SetUrl(url, width, height, alt) { invokeEvent('OnModFormPrerender', array('id' => $id)); - if(is_array($evtOut)) { - echo implode('', $evtOut); - } - - // Prepare internal params & info-tab via parseDocBlock - $modulecode = isset($content['modulecode']) ? $modx->db->escape($content['modulecode']) : ''; - $docBlock = $modx->parseDocBlockFromString($modulecode); - $docBlockList = $modx->convertDocBlockIntoList($docBlock); - $internal = array(); - ?> + // invoke OnModFormPrerender event + $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id)); + if (is_array($evtOut)) { + echo implode('', $evtOut); + } + + // Prepare internal params & info-tab via parseDocBlock + $modulecode = isset($content['modulecode']) ? $modx->db->escape($content['modulecode']) : ''; + $docBlock = $modx->parseDocBlockFromString($modulecode); + $docBlockList = $modx->convertDocBlockIntoList($docBlock); + $internal = array(); + ?> @@ -478,7 +479,7 @@ function SetUrl(url, width, height, alt) {
    - hasPermission('save_role')): ?> + hasPermission('save_role')): ?>
    @@ -600,7 +601,7 @@ function SetUrl(url, width, height, alt) { - manager->action == '108'): ?> + manager->action == '108'): ?>

    @@ -612,7 +613,7 @@ function SetUrl(url, width, height, alt) { ">
    db->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, + $ds = $modx->db->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, CASE smd.type WHEN 10 THEN 'Chunk' WHEN 20 THEN 'Document' @@ -628,17 +629,17 @@ function SetUrl(url, width, height, alt) { LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = 50 LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = 60", "smd.module='{$id}'", 'smd.type,name'); - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items - $grd->noRecordMsg = $_lang['no_records_found']; - $grd->cssClass = 'grid'; - $grd->columnHeaderClass = 'gridHeader'; - $grd->itemClass = 'gridItem'; - $grd->altItemClass = 'gridAltItem'; - $grd->columns = $_lang['element_name'] . " ," . $_lang['type']; - $grd->fields = "name,type"; - echo $grd->render(); - ?> + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items + $grd->noRecordMsg = $_lang['no_records_found']; + $grd->cssClass = 'grid'; + $grd->columnHeaderClass = 'gridHeader'; + $grd->itemClass = 'gridItem'; + $grd->altItemClass = 'gridAltItem'; + $grd->columns = $_lang['element_name'] . " ," . $_lang['type']; + $grd->fields = "name,type"; + echo $grd->render(); + ?> @@ -648,14 +649,14 @@ function SetUrl(url, width, height, alt) {

    - + db->select('usergroup', $tbl_site_module_access, "module='{$id}'"); - $groupsarray = $modx->db->getColumn('usergroup', $rs); + // fetch user access permissions for the module + $rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'"); + $groupsarray = $modx->db->getColumn('usergroup', $rs); - if($modx->hasPermission('access_permissions')) { - ?> + if ($modx->hasPermission('access_permissions')) { + ?>

    db->select('name, id', $tbl_membergroup_names, '', 'name'); - while($row = $modx->db->getRow($rs)) { - $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); - $checked = in_array($row['id'], $groupsarray); - if($modx->hasPermission('access_permissions')) { - if($checked) { - $notPublic = true; - } - $chks .= '
    \n"; - } else { - if($checked) { - $chks = '' . "\n" . $chks; - } - } - } - if($modx->hasPermission('access_permissions')) { - $chks = '
    ' . "\n" . $chks; - } - echo $chks; - ?> + } + $chk = ''; + $rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name'); + while ($row = $modx->db->getRow($rs)) { + $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); + $checked = in_array($row['id'], $groupsarray); + if ($modx->hasPermission('access_permissions')) { + if ($checked) { + $notPublic = true; + } + $chks .= '
    \n"; + } else { + if ($checked) { + $chks = '' . "\n" . $chks; + } + } + } + if ($modx->hasPermission('access_permissions')) { + $chks = '
    ' . "\n" . $chks; + } + echo $chks; + ?>
    @@ -716,11 +717,11 @@ function makePublic(b) { invokeEvent('OnModFormRender', array('id' => $id)); - if(is_array($evtOut)) { - echo implode('', $evtOut); - } - ?> + // invoke OnModFormRender event + $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id)); + if (is_array($evtOut)) { + echo implode('', $evtOut); + } + ?> diff --git a/manager/actions/mutate_module_resources.dynamic.php b/manager/actions/mutate_module_resources.dynamic.php index c7afe8e1ac..61ffcbb973 100755 --- a/manager/actions/mutate_module_resources.dynamic.php +++ b/manager/actions/mutate_module_resources.dynamic.php @@ -1,10 +1,10 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('edit_module')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('edit_module')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; @@ -25,92 +25,92 @@ // check to see the editor isn't locked $rs = $modx->db->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='" . $modx->getLoginUserID() . "'"); -if($username = $modx->db->getValue($rs)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $username, 'module')); +if ($username = $modx->db->getValue($rs)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $username, 'module')); } // end check for lock // take action -switch($_REQUEST['op']) { - case 'add': - // convert ids to numbers - $opids = array_filter(array_map('intval', explode(',', $_REQUEST['newids']))); - - if(count($opids) > 0) { - // 1-snips, 2-tpls, 3-tvs, 4-chunks, 5-plugins, 6-docs - $rt = strtolower($_REQUEST["rt"]); - if($rt == 'chunk') { - $type = 10; - } - if($rt == 'doc') { - $type = 20; - } - if($rt == 'plug') { - $type = 30; - } - if($rt == 'snip') { - $type = 40; - } - if($rt == 'tpl') { - $type = 50; - } - if($rt == 'tv') { - $type = 60; - } - $modx->db->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'"); - foreach($opids as $opid) { - $modx->db->insert(array( - 'module' => $id, - 'resource' => $opid, - 'type' => $type, - ), $tbl_site_module_depobj); - } - } - break; - case 'del': - // convert ids to numbers - $opids = array_filter(array_map('intval', $_REQUEST['depid'])); - - // get resources that needs to be removed - $ds = $modx->db->select('*', $tbl_site_module_depobj, "id IN (" . implode(",", $opids) . ")"); - // loop through resources and look for plugins and snippets - $plids = array(); - $snid = array(); - while($row = $modx->db->getRow($ds)) { - if($row['type'] == '30') { - $plids[$i] = $row['resource']; - } - if($row['type'] == '40') { - $snids[$i] = $row['resource']; - } - } - // get guid - $ds = $modx->db->select('guid', $tbl_site_modules, "id='{$id}'"); - $guid = $modx->db->getValue($ds); - // reset moduleguid for deleted resources - if(($cp = count($plids)) || ($cs = count($snids))) { - if($cp) { - $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $plids) . ") AND moduleguid='{$guid}'"); - } - if($cs) { - $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'"); - } - // reset cache - $modx->clearCache('full'); - } - $modx->db->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")"); - break; +switch ($_REQUEST['op']) { + case 'add': + // convert ids to numbers + $opids = array_filter(array_map('intval', explode(',', $_REQUEST['newids']))); + + if (count($opids) > 0) { + // 1-snips, 2-tpls, 3-tvs, 4-chunks, 5-plugins, 6-docs + $rt = strtolower($_REQUEST["rt"]); + if ($rt == 'chunk') { + $type = 10; + } + if ($rt == 'doc') { + $type = 20; + } + if ($rt == 'plug') { + $type = 30; + } + if ($rt == 'snip') { + $type = 40; + } + if ($rt == 'tpl') { + $type = 50; + } + if ($rt == 'tv') { + $type = 60; + } + $modx->db->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'"); + foreach ($opids as $opid) { + $modx->db->insert(array( + 'module' => $id, + 'resource' => $opid, + 'type' => $type, + ), $tbl_site_module_depobj); + } + } + break; + case 'del': + // convert ids to numbers + $opids = array_filter(array_map('intval', $_REQUEST['depid'])); + + // get resources that needs to be removed + $ds = $modx->db->select('*', $tbl_site_module_depobj, "id IN (" . implode(",", $opids) . ")"); + // loop through resources and look for plugins and snippets + $plids = array(); + $snid = array(); + while ($row = $modx->db->getRow($ds)) { + if ($row['type'] == '30') { + $plids[$i] = $row['resource']; + } + if ($row['type'] == '40') { + $snids[$i] = $row['resource']; + } + } + // get guid + $ds = $modx->db->select('guid', $tbl_site_modules, "id='{$id}'"); + $guid = $modx->db->getValue($ds); + // reset moduleguid for deleted resources + if (($cp = count($plids)) || ($cs = count($snids))) { + if ($cp) { + $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $plids) . ") AND moduleguid='{$guid}'"); + } + if ($cs) { + $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'"); + } + // reset cache + $modx->clearCache('full'); + } + $modx->db->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")"); + break; } // load record $rs = $modx->db->select('*', $tbl_site_modules, "id = '{$id}'"); $content = $modx->db->getRow($rs); -if(!$content) { - $modx->webAlertAndQuit("Module not found for id '{$id}'."); +if (!$content) { + $modx->webAlertAndQuit("Module not found for id '{$id}'."); } $_SESSION['itemname'] = $content['name']; -if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } ?> @@ -203,7 +203,7 @@ function openSelector(resource, mode, callback, w, h) { db->select("smd.id,COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) as name, + $ds = $modx->db->select("smd.id,COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) as name, CASE smd.type WHEN 10 THEN 'Chunk' WHEN 20 THEN 'Document' @@ -218,18 +218,18 @@ function openSelector(resource, mode, callback, w, h) { LEFT JOIN {$tbl_site_snippets} AS ss ON ss.id = smd.resource AND smd.type = '40' LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = '50' LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = '60'", "smd.module={$id}", "smd.type,name"); - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items - $grd->noRecordMsg = $_lang["no_records_found"]; - $grd->cssClass = "grid"; - $grd->columnHeaderClass = "gridHeader"; - $grd->itemClass = "gridItem"; - $grd->altItemClass = "gridAltItem"; - $grd->columns = $_lang["element_name"] . " ," . $_lang["type"]; - $grd->colTypes = "template: [+value+]"; - $grd->fields = "name,type"; - echo $grd->render(); - ?> + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items + $grd->noRecordMsg = $_lang["no_records_found"]; + $grd->cssClass = "grid"; + $grd->columnHeaderClass = "gridHeader"; + $grd->itemClass = "gridItem"; + $grd->altItemClass = "gridAltItem"; + $grd->columns = $_lang["element_name"] . " ," . $_lang["type"]; + $grd->colTypes = "template: [+value+]"; + $grd->fields = "name,type"; + echo $grd->render(); + ?> "> diff --git a/manager/actions/mutate_password.dynamic.php b/manager/actions/mutate_password.dynamic.php index 44ed413422..f2483a4ddb 100755 --- a/manager/actions/mutate_password.dynamic.php +++ b/manager/actions/mutate_password.dynamic.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('change_password')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('change_password')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } ?> diff --git a/manager/actions/mutate_plugin.dynamic.php b/manager/actions/mutate_plugin.dynamic.php index 84c6b357b5..3fd35f4b3c 100755 --- a/manager/actions/mutate_plugin.dynamic.php +++ b/manager/actions/mutate_plugin.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } diff --git a/manager/actions/mutate_plugin_priority.dynamic.php b/manager/actions/mutate_plugin_priority.dynamic.php index 0811873b13..91756906a9 100755 --- a/manager/actions/mutate_plugin_priority.dynamic.php +++ b/manager/actions/mutate_plugin_priority.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_plugin')) { @@ -103,7 +103,7 @@ + ?> INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -switch((int) $modx->manager->action) { - case 35: - if(!$modx->hasPermission('edit_role')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 38: - if(!$modx->hasPermission('new_role')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +switch ((int) $modx->manager->action) { + case 35: + if (!$modx->hasPermission('edit_role')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 38: + if (!$modx->hasPermission('new_role')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $role = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; @@ -23,24 +23,24 @@ $tbl_user_roles = $modx->getFullTableName('user_roles'); // check to see the snippet editor isn't locked -if($lockedEl = $modx->elementIsLocked(8, $role)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['role'])); +if ($lockedEl = $modx->elementIsLocked(8, $role)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['role'])); } // end check for lock // Lock snippet for other users to edit $modx->lockElement(8, $role); -if($modx->manager->action == '35') { - $rs = $modx->db->select('*', $tbl_user_roles, "id='{$role}'"); - $roledata = $modx->db->getRow($rs); - if(!$roledata) { - $modx->webAlertAndQuit("No role returned!"); - } - $_SESSION['itemname'] = $roledata['name']; +if ($modx->manager->action == '35') { + $rs = $modx->db->select('*', $tbl_user_roles, "id='{$role}'"); + $roledata = $modx->db->getRow($rs); + if (!$roledata) { + $modx->webAlertAndQuit("No role returned!"); + } + $_SESSION['itemname'] = $roledata['name']; } else { - $roledata = 0; - $_SESSION['itemname'] = $_lang["new_role"]; + $roledata = 0; + $_SESSION['itemname'] = $_lang["new_role"]; } // Add lock-element JS-Script @@ -107,63 +107,63 @@ function changestate(element) {

    + echo render_form('frames', $_lang['role_frames'], 'disabled'); + echo render_form('home', $_lang['role_home'], 'disabled'); + echo render_form('messages', $_lang['role_messages']); + echo render_form('logout', $_lang['role_logout'], 'disabled'); + echo render_form('help', $_lang['role_help']); + echo render_form('action_ok', $_lang['role_actionok'], 'disabled'); + echo render_form('error_dialog', $_lang['role_errors'], 'disabled'); + echo render_form('about', $_lang['role_about'], 'disabled'); + echo render_form('credits', $_lang['role_credits'], 'disabled'); + echo render_form('change_password', $_lang['role_change_password']); + echo render_form('save_password', $_lang['role_save_password']); + ?>

    + echo render_form('view_document', $_lang['role_view_docdata'], 'disabled'); + echo render_form('new_document', $_lang['role_create_doc']); + echo render_form('edit_document', $_lang['role_edit_doc']); + echo render_form('change_resourcetype', $_lang['role_change_resourcetype']); + echo render_form('save_document', $_lang['role_save_doc']); + echo render_form('publish_document', $_lang['role_publish_doc']); + echo render_form('delete_document', $_lang['role_delete_doc']); + echo render_form('empty_trash', $_lang['role_empty_trash']); + echo render_form('empty_cache', $_lang['role_cache_refresh']); + echo render_form('view_unpublished', $_lang['role_view_unpublished']); + ?>

    + echo render_form('file_manager', $_lang['role_file_manager']); + echo render_form('assets_files', $_lang['role_assets_files']); + echo render_form('assets_images', $_lang['role_assets_images']); + ?>

    + echo render_form('category_manager', $_lang['role_category_manager']); + ?>

    + echo render_form('new_module', $_lang['role_new_module']); + echo render_form('edit_module', $_lang['role_edit_module']); + echo render_form('save_module', $_lang['role_save_module']); + echo render_form('delete_module', $_lang['role_delete_module']); + echo render_form('exec_module', $_lang['role_run_module']); + ?>
    @@ -173,44 +173,44 @@ function changestate(element) {

    + echo render_form('new_template', $_lang['role_create_template']); + echo render_form('edit_template', $_lang['role_edit_template']); + echo render_form('save_template', $_lang['role_save_template']); + echo render_form('delete_template', $_lang['role_delete_template']); + ?>

    + echo render_form('new_snippet', $_lang['role_create_snippet']); + echo render_form('edit_snippet', $_lang['role_edit_snippet']); + echo render_form('save_snippet', $_lang['role_save_snippet']); + echo render_form('delete_snippet', $_lang['role_delete_snippet']); + ?>

    + echo render_form('new_chunk', $_lang['role_create_chunk']); + echo render_form('edit_chunk', $_lang['role_edit_chunk']); + echo render_form('save_chunk', $_lang['role_save_chunk']); + echo render_form('delete_chunk', $_lang['role_delete_chunk']); + ?>

    + echo render_form('new_plugin', $_lang['role_create_plugin']); + echo render_form('edit_plugin', $_lang['role_edit_plugin']); + echo render_form('save_plugin', $_lang['role_save_plugin']); + echo render_form('delete_plugin', $_lang['role_delete_plugin']); + ?>
    @@ -220,42 +220,42 @@ function changestate(element) {

    + echo render_form('new_user', $_lang['role_new_user']); + echo render_form('edit_user', $_lang['role_edit_user']); + echo render_form('save_user', $_lang['role_save_user']); + echo render_form('delete_user', $_lang['role_delete_user']); + ?>

    + echo render_form('new_web_user', $_lang['role_new_web_user']); + echo render_form('edit_web_user', $_lang['role_edit_web_user']); + echo render_form('save_web_user', $_lang['role_save_web_user']); + echo render_form('delete_web_user', $_lang['role_delete_web_user']); + ?>

    + echo render_form('access_permissions', $_lang['role_access_persmissions']); + echo render_form('web_access_permissions', $_lang['role_web_access_persmissions']); + ?>

    + echo render_form('new_role', $_lang['role_new_role']); + echo render_form('edit_role', $_lang['role_edit_role']); + echo render_form('save_role', $_lang['role_save_role']); + echo render_form('delete_role', $_lang['role_delete_role']); + ?>
    @@ -265,23 +265,23 @@ function changestate(element) {

    + echo render_form('view_eventlog', $_lang['role_view_eventlog']); + echo render_form('delete_eventlog', $_lang['role_delete_eventlog']); + ?>

    + echo render_form('logs', $_lang['role_view_logs']); + echo render_form('settings', $_lang['role_edit_settings']); + echo render_form('bk_manager', $_lang['role_bk_manager']); + echo render_form('import_static', $_lang['role_import_static']); + echo render_form('export_static', $_lang['role_export_static']); + echo render_form('remove_locks', $_lang['role_remove_locks']); + echo render_form('display_locks', $_lang['role_display_locks']); + ?>
    @@ -299,33 +299,35 @@ function changestate(element) { * @param string $status * @return string */ -function render_form($name, $label, $status = '') { - $modx = evolutionCMS(); global $roledata; +function render_form($name, $label, $status = '') +{ + $modx = evolutionCMS(); + global $roledata; - $tpl = '
    - +
    @@ -124,9 +124,15 @@
    [(auto_template_logic)]

    -
    -
    -
    +
    +
    +
    @@ -135,16 +141,17 @@ db->getRecordCount( - $modx->db->select('id', '[+prefix+]site_plugins', + $modx->db->select('id', '[+prefix+]site_plugins', "plugincode LIKE '%phx.parser.class.inc.php%OnParseDocument();%' AND disabled != 1") ); - if($count) { + if ($count) { $disabledFilters = 1; - echo ''.$_lang['enable_filter_phx_warning'].'
    '; + echo '' . $_lang['enable_filter_phx_warning'] . '
    '; + } else { + $disabledFilters = false; } - else $disabledFilters = false; ?> -
    +
    @@ -152,7 +159,7 @@
    [(enable_at_syntax)] -
    +
    @@ -167,8 +174,8 @@
    [(publish_default)] -
    - +
    +
    @@ -176,24 +183,24 @@
    [(cache_default)] -
    - +
    +

    [(search_default)] -
    - +
    +

    [(auto_menuindex)] -
    - +
    +
    @@ -203,9 +210,9 @@ @@ -242,14 +249,14 @@ @@ -259,10 +266,9 @@ @@ -288,8 +294,8 @@ @@ -301,7 +307,9 @@ invokeEvent('OnSiteSettingsRender'); - if(is_array($evtOut)) echo implode("",$evtOut); + if (is_array($evtOut)) { + echo implode("", $evtOut); + } ?> diff --git a/manager/actions/mutate_settings/tab2_furl_settings.inc.php b/manager/actions/mutate_settings/tab2_furl_settings.inc.php index 2269244e37..526bc44333 100755 --- a/manager/actions/mutate_settings/tab2_furl_settings.inc.php +++ b/manager/actions/mutate_settings/tab2_furl_settings.inc.php @@ -6,7 +6,7 @@ @@ -20,7 +20,7 @@ @@ -56,8 +56,8 @@ > > @@ -71,8 +71,8 @@ > > @@ -86,8 +86,8 @@ > > @@ -101,8 +101,8 @@ > > @@ -115,8 +115,8 @@ > > @@ -129,8 +129,8 @@ > > @@ -143,8 +143,8 @@ > > @@ -159,7 +159,9 @@ invokeEvent('OnFriendlyURLSettingsRender'); - if(is_array($evtOut)) echo implode("",$evtOut); + if (is_array($evtOut)) { + echo implode("", $evtOut); + } ?> diff --git a/manager/actions/mutate_settings/tab3_user_settings.inc.php b/manager/actions/mutate_settings/tab3_user_settings.inc.php index c190b78fb6..201b087a32 100755 --- a/manager/actions/mutate_settings/tab3_user_settings.inc.php +++ b/manager/actions/mutate_settings/tab3_user_settings.inc.php @@ -6,7 +6,7 @@ @@ -55,8 +55,8 @@ @@ -157,7 +157,9 @@ invokeEvent('OnUserSettingsRender'); - if(is_array($evtOut)) echo implode("",$evtOut); + if (is_array($evtOut)) { + echo implode("", $evtOut); + } ?> diff --git a/manager/actions/mutate_settings/tab4_manager_settings.inc.php b/manager/actions/mutate_settings/tab4_manager_settings.inc.php index 4fac9f68b2..190c709708 100755 --- a/manager/actions/mutate_settings/tab4_manager_settings.inc.php +++ b/manager/actions/mutate_settings/tab4_manager_settings.inc.php @@ -180,7 +180,7 @@ function SetUrl(url, width, height, alt) { @@ -194,7 +194,7 @@ function SetUrl(url, width, height, alt) { diff --git a/manager/actions/mutate_settings/tab5_security_settings.inc.php b/manager/actions/mutate_settings/tab5_security_settings.inc.php index 78c039a8a3..97d5143f15 100755 --- a/manager/actions/mutate_settings/tab5_security_settings.inc.php +++ b/manager/actions/mutate_settings/tab5_security_settings.inc.php @@ -1,6 +1,6 @@ @@ -89,10 +89,10 @@ @@ -103,11 +103,11 @@ +
    +
    +
    +
    +$modx->config['emailsender']));?> @@ -115,8 +115,8 @@ @@ -157,7 +157,9 @@ @@ -186,7 +188,9 @@ ?> @@ -226,7 +230,9 @@ invokeEvent('OnSecuritySettingsRender'); - if(is_array($evtOut)) echo implode("",$evtOut); + if (is_array($evtOut)) { + echo implode("", $evtOut); + } ?> diff --git a/manager/actions/mutate_settings/tab6_filemanager_settings.inc.php b/manager/actions/mutate_settings/tab6_filemanager_settings.inc.php index 67a5059a2c..e38e020fb8 100755 --- a/manager/actions/mutate_settings/tab6_filemanager_settings.inc.php +++ b/manager/actions/mutate_settings/tab6_filemanager_settings.inc.php @@ -113,7 +113,9 @@ invokeEvent('OnFileManagerSettingsRender'); - if(is_array($evtOut)) echo implode("",$evtOut); + if (is_array($evtOut)) { + echo implode("", $evtOut); + } ?> diff --git a/manager/actions/mutate_settings/tab7_filebrowser_settings.inc.php b/manager/actions/mutate_settings/tab7_filebrowser_settings.inc.php index 2534a2de5d..198f385bad 100755 --- a/manager/actions/mutate_settings/tab7_filebrowser_settings.inc.php +++ b/manager/actions/mutate_settings/tab7_filebrowser_settings.inc.php @@ -6,7 +6,7 @@ @@ -235,7 +235,9 @@ invokeEvent('OnMiscSettingsRender'); - if(is_array($evtOut)) echo implode("",$evtOut); + if (is_array($evtOut)) { + echo implode("", $evtOut); + } ?> diff --git a/manager/actions/mutate_snippet.dynamic.php b/manager/actions/mutate_snippet.dynamic.php index 75bd9b9c88..70bf425c41 100755 --- a/manager/actions/mutate_snippet.dynamic.php +++ b/manager/actions/mutate_snippet.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } @@ -46,7 +46,7 @@ $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $content['properties'] = str_replace("&", "&", $content['properties']); -} else if (isset($_REQUEST['itemname'])) { +} elseif (isset($_REQUEST['itemname'])) { $content['name'] = $_REQUEST['itemname']; } else { $_SESSION['itemname'] = $_lang["new_snippet"]; diff --git a/manager/actions/mutate_template_tv_rank.dynamic.php b/manager/actions/mutate_template_tv_rank.dynamic.php index 70518f964d..d0933b3a01 100755 --- a/manager/actions/mutate_template_tv_rank.dynamic.php +++ b/manager/actions/mutate_template_tv_rank.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_template')) { @@ -137,7 +137,7 @@ function resetSortOrder()
    + ?>

    diff --git a/manager/actions/mutate_templates.dynamic.php b/manager/actions/mutate_templates.dynamic.php index 4b46fa9ac0..8dc46bb62e 100755 --- a/manager/actions/mutate_templates.dynamic.php +++ b/manager/actions/mutate_templates.dynamic.php @@ -1,21 +1,21 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -switch($modx->manager->action) { - case 16: - if(!$modx->hasPermission('edit_template')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 19: - if(!$modx->hasPermission('new_template')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +switch ($modx->manager->action) { + case 16: + if (!$modx->hasPermission('edit_template')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 19: + if (!$modx->hasPermission('new_template')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; @@ -23,8 +23,8 @@ $tbl_site_templates = $modx->getFullTableName('site_templates'); // check to see the snippet editor isn't locked -if($lockedEl = $modx->elementIsLocked(1, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['template'])); +if ($lockedEl = $modx->elementIsLocked(1, $id)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['template'])); } // end check for lock @@ -32,24 +32,24 @@ $modx->lockElement(1, $id); $content = array(); -if(!empty($id)) { - $rs = $modx->db->select('*', $tbl_site_templates, "id='{$id}'"); - $content = $modx->db->getRow($rs); - if(!$content) { - $modx->webAlertAndQuit("No database record has been found for this template."); - } - - $_SESSION['itemname'] = $content['templatename']; - if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } +if (!empty($id)) { + $rs = $modx->db->select('*', $tbl_site_templates, "id='{$id}'"); + $content = $modx->db->getRow($rs); + if (!$content) { + $modx->webAlertAndQuit("No database record has been found for this template."); + } + + $_SESSION['itemname'] = $content['templatename']; + if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } } else { - $_SESSION['itemname'] = $_lang["new_template"]; - $content['category'] = (int)$_REQUEST['catid']; + $_SESSION['itemname'] = $_lang["new_template"]; + $content['category'] = (int)$_REQUEST['catid']; } -if($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); +if ($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); } $content = array_merge($content, $_POST); @@ -98,12 +98,12 @@
    invokeEvent("OnTempFormPrerender", array("id" => $id)); - if(is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> + // invoke OnTempFormPrerender event + $evtOut = $modx->invokeEvent("OnTempFormPrerender", array("id" => $id)); + if (is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> @@ -132,14 +132,14 @@

    - hasPermission('save_role')): ?> + hasPermission('save_role')): ?>
    @@ -177,7 +177,7 @@
    - hasPermission('save_role')): ?> + hasPermission('save_role')): ?>
    @@ -197,38 +197,38 @@ db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category", $_lang['no_category']), sprintf("%s tv + $selectedTvs = array(); + if (!isset($_POST['assignedTv'])) { + $rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category", $_lang['no_category']), sprintf("%s tv LEFT JOIN %s tr ON tv.id=tr.tmplvarid LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "templateid='{$id}'", "tr.rank DESC, tv.rank DESC, tvcaption DESC, tvid DESC" // workaround for correct sort of none-existing ranks - ); - while($row = $modx->db->getRow($rs)) { - $selectedTvs[$row['tvid']] = $row; - } - $selectedTvs = array_reverse($selectedTvs, true); // reverse ORDERBY DESC - } - - $unselectedTvs = array(); - $rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category, cat.id as catid", $_lang['no_category']), sprintf("%s tv + ); + while ($row = $modx->db->getRow($rs)) { + $selectedTvs[$row['tvid']] = $row; + } + $selectedTvs = array_reverse($selectedTvs, true); // reverse ORDERBY DESC + } + + $unselectedTvs = array(); + $rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category, cat.id as catid", $_lang['no_category']), sprintf("%s tv LEFT JOIN %s tr ON tv.id=tr.tmplvarid LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "", "category, tvcaption"); - while($row = $modx->db->getRow($rs)) { - $unselectedTvs[$row['tvid']] = $row; - } - - // Catch checkboxes if form not validated - if(isset($_POST['assignedTv'])) { - $selectedTvs = array(); - foreach($_POST['assignedTv'] as $tvid) { - if(isset($unselectedTvs[$tvid])) { - $selectedTvs[$tvid] = $unselectedTvs[$tvid]; - } - }; - } - - $total = count($selectedTvs); - ?> + while ($row = $modx->db->getRow($rs)) { + $unselectedTvs[$row['tvid']] = $row; + } + + // Catch checkboxes if form not validated + if (isset($_POST['assignedTv'])) { + $selectedTvs = array(); + foreach ($_POST['assignedTv'] as $tvid) { + if (isset($unselectedTvs[$tvid])) { + $selectedTvs[$tvid] = $unselectedTvs[$tvid]; + } + }; + } + + $total = count($selectedTvs); + ?>
    @@ -238,65 +238,64 @@
    0) { - echo '

    ' . $_lang['template_tv_msg'] . '

    '; - } - if($modx->hasPermission('save_template') && $total > 1 && $id) { - echo sprintf('', $id, $_lang['template_tv_edit']); - } - - // Selected TVs - $tvList = ''; - if($total > 0) { - $tvList .= '
      '; - foreach($selectedTvs as $row) { - $desc = !empty($row['tvdescription']) ? '  (' . $row['tvdescription'] . ')' : ''; - $locked = $row['tvlocked'] ? ' (' . $_lang['locked'] . ')' : ""; - $tvList .= sprintf('
    • %s %s
    • ', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); - } - $tvList .= '
    '; - - } else { - echo $_lang['template_no_tv']; - } - echo $tvList; - - // Unselected TVs - $tvList = '

    ' . $_lang['template_notassigned_tv'] . '

      '; - $preCat = ''; - $insideUl = 0; - while($row = array_shift($unselectedTvs)) { - if(isset($selectedTvs[$row['tvid']])) { - continue; - } // Skip selected - $row['category'] = stripslashes($row['category']); //pixelchutes - if($preCat !== $row['category']) { - $tvList .= $insideUl ? '
    ' : ''; - $tvList .= '
  • ' . $row['category'] . ($row['catid'] != '' ? ' (' . $row['catid'] . ')' : '') . '
      '; - $insideUl = 1; - } - - $desc = !empty($row['tvdescription']) ? '  (' . $row['tvdescription'] . ')' : ''; - $locked = $row['tvlocked'] ? ' (' . $_lang['locked'] . ')' : ""; - $tvList .= sprintf('
    • %s %s
    • ', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); - $tvList .= ''; - - $preCat = $row['category']; - } - $tvList .= $insideUl ? '
    ' : ''; - $tvList .= ''; - echo $tvList; - - ?> + if ($total > 0) { + echo '

    ' . $_lang['template_tv_msg'] . '

    '; + } + if ($modx->hasPermission('save_template') && $total > 1 && $id) { + echo sprintf('', $id, $_lang['template_tv_edit']); + } + + // Selected TVs + $tvList = ''; + if ($total > 0) { + $tvList .= '
      '; + foreach ($selectedTvs as $row) { + $desc = !empty($row['tvdescription']) ? '  (' . $row['tvdescription'] . ')' : ''; + $locked = $row['tvlocked'] ? ' (' . $_lang['locked'] . ')' : ""; + $tvList .= sprintf('
    • %s %s
    • ', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); + } + $tvList .= '
    '; + } else { + echo $_lang['template_no_tv']; + } + echo $tvList; + + // Unselected TVs + $tvList = '

    ' . $_lang['template_notassigned_tv'] . '

      '; + $preCat = ''; + $insideUl = 0; + while ($row = array_shift($unselectedTvs)) { + if (isset($selectedTvs[$row['tvid']])) { + continue; + } // Skip selected + $row['category'] = stripslashes($row['category']); //pixelchutes + if ($preCat !== $row['category']) { + $tvList .= $insideUl ? '
    ' : ''; + $tvList .= '
  • ' . $row['category'] . ($row['catid'] != '' ? ' (' . $row['catid'] . ')' : '') . '
      '; + $insideUl = 1; + } + + $desc = !empty($row['tvdescription']) ? '  (' . $row['tvdescription'] . ')' : ''; + $locked = $row['tvlocked'] ? ' (' . $_lang['locked'] . ')' : ""; + $tvList .= sprintf('
    • %s %s
    • ', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); + $tvList .= ''; + + $preCat = $row['category']; + } + $tvList .= $insideUl ? '
    ' : ''; + $tvList .= ''; + echo $tvList; + + ?>
  • invokeEvent("OnTempFormRender", array("id" => $id)); - if(is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> + // invoke OnTempFormRender event + $evtOut = $modx->invokeEvent("OnTempFormRender", array("id" => $id)); + if (is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> diff --git a/manager/actions/mutate_tmplvars.dynamic.php b/manager/actions/mutate_tmplvars.dynamic.php index 895b0e125a..bc780011c8 100755 --- a/manager/actions/mutate_tmplvars.dynamic.php +++ b/manager/actions/mutate_tmplvars.dynamic.php @@ -1,17 +1,17 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('edit_template') && $modx->manager->action == '301') { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('edit_template') && $modx->manager->action == '301') { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } -if(!$modx->hasPermission('new_template') && $modx->manager->action == '300') { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('new_template') && $modx->manager->action == '300') { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; $origin = isset($_REQUEST['or']) ? (int)$_REQUEST['or'] : 76; -$originId = isset($_REQUEST['oid']) ? (int)$_REQUEST['oid'] : NULL; +$originId = isset($_REQUEST['oid']) ? (int)$_REQUEST['oid'] : null; $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); $tbl_site_templates = $modx->getFullTableName('site_templates'); @@ -19,8 +19,8 @@ $tbl_documentgroup_names = $modx->getFullTableName('documentgroup_names'); // check to see the snippet editor isn't locked -if($lockedEl = $modx->elementIsLocked(2, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar'])); +if ($lockedEl = $modx->elementIsLocked(2, $id)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar'])); } // end check for lock @@ -29,26 +29,26 @@ global $content; $content = array(); -if(isset($_GET['id'])) { - $rs = $modx->db->select('*', $tbl_site_tmplvars, "id='{$id}'"); - $content = $modx->db->getRow($rs); - if(!$content) { - header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}"); - } - - $_SESSION['itemname'] = $content['caption']; - if($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } -} else if(isset($_REQUEST['itemname'])) { - $content['name'] = $_REQUEST['itemname']; +if (isset($_GET['id'])) { + $rs = $modx->db->select('*', $tbl_site_tmplvars, "id='{$id}'"); + $content = $modx->db->getRow($rs); + if (!$content) { + header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}"); + } + + $_SESSION['itemname'] = $content['caption']; + if ($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } +} elseif (isset($_REQUEST['itemname'])) { + $content['name'] = $_REQUEST['itemname']; } else { - $_SESSION['itemname'] = $_lang["new_tmplvars"]; - $content['category'] = (int)$_REQUEST['catid']; + $_SESSION['itemname'] = $_lang["new_tmplvars"]; + $content['category'] = (int)$_REQUEST['catid']; } -if($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); +if ($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); } $content = array_merge($content, $_POST); @@ -61,8 +61,8 @@ // get available RichText Editors $RTEditors = ''; $evtOut = $modx->invokeEvent('OnRichTextEditorRegister', array('forfrontend' => 1)); -if(is_array($evtOut)) { - $RTEditors = implode(',', $evtOut); +if (is_array($evtOut)) { + $RTEditors = implode(',', $evtOut); } ?> @@ -277,12 +277,12 @@ function decode(s) { invokeEvent('OnTVFormPrerender', array('id' => $id)); - if(is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> + // invoke OnTVFormPrerender event + $evtOut = $modx->invokeEvent('OnTVFormPrerender', array('id' => $id)); + if (is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> @@ -314,7 +314,7 @@ function decode(s) {
    - hasPermission('save_role')): ?> + hasPermission('save_role')): ?>
    @@ -383,14 +383,14 @@ function decode(s) { ' . $ctv . ''; - } - } - ?> + $custom_tvs = scandir(MODX_BASE_PATH . 'assets/tvs'); + foreach ($custom_tvs as $ctv) { + if (strpos($ctv, '.') !== 0 && $ctv != 'index.html') { + $selected = ($content['type'] == 'custom_tv:' . $ctv ? "selected='selected'" : ""); + echo ''; + } + } + ?> @@ -455,64 +455,63 @@ function decode(s) { db->select(sprintf("tpl.id AS id, templatename, tpl.description AS tpldescription, tpl.locked AS tpllocked, tpl.selectable AS selectable, tmplvarid, if(isnull(cat.category),'%s',cat.category) AS category, cat.id AS catid", $_lang['no_category']), sprintf("%s as tpl + $rs = $modx->db->select(sprintf("tpl.id AS id, templatename, tpl.description AS tpldescription, tpl.locked AS tpllocked, tpl.selectable AS selectable, tmplvarid, if(isnull(cat.category),'%s',cat.category) AS category, cat.id AS catid", $_lang['no_category']), sprintf("%s as tpl LEFT JOIN %s as stt ON stt.templateid=tpl.id AND stt.tmplvarid='%s' LEFT JOIN %s as cat ON tpl.category=cat.id", $modx->getFullTableName('site_templates'), $modx->getFullTableName('site_tmplvar_templates'), $id, $modx->getFullTableName('categories')), '', "category, templatename"); - $tplList = '
      '; - $preCat = ''; - $insideUl = 0; - while($row = $modx->db->getRow($rs)) { - $row['category'] = stripslashes($row['category']); //pixelchutes - if($preCat !== $row['category']) { - $tplList .= $insideUl ? '
    ' : ''; - $tplList .= '
  • ' . $row['category'] . ($row['catid'] != '' ? ' (' . $row['catid'] . ')' : '') . '
      '; - $insideUl = 1; - } - - if($modx->manager->action == '300' && $modx->config['default_template'] == $row['id']) { - $checked = true; - } elseif(isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) { - $checked = true; - } elseif($id == 0 && is_array($_POST['template'])) { - $checked = in_array($row['id'], $_POST['template']); - } else { - $checked = $row['tmplvarid']; - } - $selectable = !$row['selectable'] ? ' class="disabled"' : ''; - $checked = $checked ? ' checked="checked"' : ''; - $tplId = ' (' . $row['id'] . ')'; - $desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : ''; - - $tplInfo = array(); - if($row['tpllocked']) { - $tplInfo[] = $_lang['locked']; - } - if($row['id'] == $modx->config['default_template']) { - $tplInfo[] = $_lang['defaulttemplate_title']; - } - $tplInfo = !empty($tplInfo) ? ' (' . implode(', ', $tplInfo) . ')' : ''; - - $tplList .= sprintf('
    • %s%s%s%s
    • ', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo); - $tplList .= ''; - - $preCat = $row['category']; - } - $tplList .= $insideUl ? '
    ' : ''; - $tplList .= ''; - echo $tplList; - - ?> + $tplList = '
      '; + $preCat = ''; + $insideUl = 0; + while ($row = $modx->db->getRow($rs)) { + $row['category'] = stripslashes($row['category']); //pixelchutes + if ($preCat !== $row['category']) { + $tplList .= $insideUl ? '
    ' : ''; + $tplList .= '
  • ' . $row['category'] . ($row['catid'] != '' ? ' (' . $row['catid'] . ')' : '') . '
      '; + $insideUl = 1; + } + + if ($modx->manager->action == '300' && $modx->config['default_template'] == $row['id']) { + $checked = true; + } elseif (isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) { + $checked = true; + } elseif ($id == 0 && is_array($_POST['template'])) { + $checked = in_array($row['id'], $_POST['template']); + } else { + $checked = $row['tmplvarid']; + } + $selectable = !$row['selectable'] ? ' class="disabled"' : ''; + $checked = $checked ? ' checked="checked"' : ''; + $tplId = ' (' . $row['id'] . ')'; + $desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : ''; + + $tplInfo = array(); + if ($row['tpllocked']) { + $tplInfo[] = $_lang['locked']; + } + if ($row['id'] == $modx->config['default_template']) { + $tplInfo[] = $_lang['defaulttemplate_title']; + } + $tplInfo = !empty($tplInfo) ? ' (' . implode(', ', $tplInfo) . ')' : ''; + + $tplList .= sprintf('
    • %s%s%s%s
    • ', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo); + $tplList .= ''; + + $preCat = $row['category']; + } + $tplList .= $insideUl ? '
    ' : ''; + $tplList .= ''; + echo $tplList; + + ?> db->select('documentgroup', $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); - $groupsarray = $modx->db->getColumn('documentgroup', $rs); - - ?> - hasPermission('access_permissions')) { ?> + if ($use_udperms == 1) { + // fetch permissions for the variable + $rs = $modx->db->select('documentgroup', $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); + $groupsarray = $modx->db->getColumn('documentgroup', $rs); ?> + hasPermission('access_permissions')) { + ?> diff --git a/manager/actions/mutate_tv_rank.dynamic.php b/manager/actions/mutate_tv_rank.dynamic.php index 46dd598245..ce8500f81d 100755 --- a/manager/actions/mutate_tv_rank.dynamic.php +++ b/manager/actions/mutate_tv_rank.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_template')) { @@ -130,7 +130,7 @@ function resetSortOrder()
    + ?>

    diff --git a/manager/actions/mutate_user.dynamic.php b/manager/actions/mutate_user.dynamic.php index 6c0631d076..e69de29bb2 100755 --- a/manager/actions/mutate_user.dynamic.php +++ b/manager/actions/mutate_user.dynamic.php @@ -1,799 +0,0 @@ -INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); -} - -switch($modx->manager->action) { - case 12: - if(!$modx->hasPermission('edit_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 11: - if(!$modx->hasPermission('new_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); -} - -$user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; - -// check to see the snippet editor isn't locked -$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); -if($username = $modx->db->getValue($rs)) { - $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user")); -} -// end check for lock - -if($modx->manager->action == '12') { - // get user attribute - $rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'"); - $userdata = $modx->db->getRow($rs); - if(!$userdata) { - $modx->webAlertAndQuit("No user returned!"); - } - - - // get user settings - $rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'"); - $usersettings = array(); - while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; - // manually extract so that user display settings are not overwritten - foreach($usersettings as $k => $v) { - if($k != 'manager_language' && $k != 'manager_theme') { - ${$k} = $v; - } - } - - // get user name - $rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'"); - $usernamedata = $modx->db->getRow($rs); - if(!$usernamedata) { - $modx->webAlertAndQuit("No user returned while getting username!"); - } - $_SESSION['itemname'] = $usernamedata['username']; -} else { - $userdata = array(); - $usersettings = array(); - $usernamedata = array(); - $_SESSION['itemname'] = $_lang["new_user"]; -} - -// avoid doubling htmlspecialchars (already encoded in DB) -foreach($userdata as $key => $val) { - $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); -}; -$usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); - -// restore saved form -$formRestored = false; -if($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); - // restore post values - $userdata = array_merge($userdata, $_POST); - $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); - $usernamedata['username'] = $userdata['newusername']; - $usernamedata['oldusername'] = $_POST['oldusername']; - $usersettings = array_merge($usersettings, $userdata); - $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; - extract($usersettings, EXTR_OVERWRITE); -} - -// include the country list language file -$_country_lang = array(); -include_once "lang/country/english_country.inc.php"; -if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { - include_once "lang/country/" . $manager_language . "_country.inc.php"; -} -asort($_country_lang); - -$displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; -if($which_browser == 'default') { - $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser']; -} -?> - - - - invokeEvent("OnUserFormPrerender", array( - "id" => $user - )); - if(is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> - - - " /> - -

    - (' . $usernamedata['id'] . ')' : $_lang['user_title']) ?> -

    - - - - -
    - -
    - -
    -

    - -
  • @@ -233,7 +240,7 @@

    [(enable_cache)]
    -
    +


    [(cache_type)]
    -
    +

    [(minifyphp_incache)]
    -
    +

    [(server_offset_time)]

    [(server_protocol)]
    -
    +

    [(track_visitors)]
    -
    - +
    +

    [(friendly_urls)]
    -
    +

    [(xhtml_urls)]
    -
    +

    [(make_folders)]
    -
    - +
    +

    [(seostrict)]
    -
    - +
    +

    [(aliaslistingfolder)]
    -
    - +
    +

    [(friendly_alias_urls)]
    -
    - +
    +

    [(use_alias_path)]
    -
    - +
    +

    [(allow_duplicate_alias)]
    -
    - +
    +

    [(automatic_alias)]
    -
    - +
    +

    [(use_udperms)]
    -
    +

    [(email_method)]
    -
    - +
    +
    >
    @@ -144,8 +144,8 @@

    [(allow_multiple_emails)]
    -
    - +
    +

    [(login_form_position)]
    -
    +


    [(manager_menu_position)]
    -
    +


    [(allow_eval)]
    -
    -
    -
    - +
    +
    +
    +
    @@ -53,7 +53,7 @@

    [(validate_referer)]
    -
    +

    [(error_reporting)]
    -
    -
    -
    - +
    +
    +
    +

    [(send_errormail)]
    -
    -
    -
    -
    -$modx->config['emailsender']));?>

    [(enable_bindings)]
    -
    - +
    +

    [(pwd_hash_algo)]
    manager->checkHashAlgorithm('BLOWFISH_Y') ? 0:1; $phm['e']['BLOWFISH_A'] = $modx->manager->checkHashAlgorithm('BLOWFISH_A') ? 0:1; $phm['e']['SHA512'] = $modx->manager->checkHashAlgorithm('SHA512') ? 0:1; @@ -165,12 +167,12 @@ $phm['e']['MD5'] = $modx->manager->checkHashAlgorithm('MD5') ? 0:1; $phm['e']['UNCRYPT'] = $modx->manager->checkHashAlgorithm('UNCRYPT') ? 0:1; ?> -
    -
    -
    -
    -
    - +
    +
    +
    +
    +
    +

    [(use_captcha)]

    [(use_browser)]
    -
    +
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - manager->action == '12') { ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?> - - - -
    "> htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?> - - -
    : 
    manager->action == '11' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?> manager->action == "11" ? " checked disabled" : ""; ?>> - " onChange="documentDirty=true;" /> -
    - " id="passwordBlock"> -
    - - /> - -
    - > - -
    -
    - - -
    - - -
    -
    -
    -
    -
    - - /> - -
    - /> - -
    -
    : 
    :  -
    : db->select('name, id', '[+prefix+]user_roles', ($modx->hasPermission('save_role')) ? '' : 'id != 1'); - ?> -
    : 
    : 
    : 
    : 
    : 
    : 
    : 
    : 
    : " onBlur='documentDirty=true;'> - " data-tooltip="">
    : 
    : 
    : 
    : toDateFormat($userdata['lastlogin'] + $server_offset_time) ?>
    :  -    []
    :  time() && $userdata['blockeduntil'] != 0)) ? " checked" : ""; ?>> -
    : " onBlur='documentDirty=true;' readonly> - " data-tooltip="">
    : " onBlur='documentDirty=true;' readonly> - " data-tooltip="">
    - getLoginUserID()) { ?> -

    - -
    - - -
    -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     
     
    /> - -
    - /> -
     
     
    -
    - -
    - -
    - -
    - -
    - -
    - -
     
    -
     

    - [(manager_theme_mode)] -
    - -
    - - -
    - -
    - -
    - -
     
    ">
     
    "> -    - /> - -
     
    "> -    - /> - -
     
    "> -    - /> - -
     
    "> -    - /> - -
     
    ">
     
     
    " />
     
    " />
     
    " />
     
    - invokeEvent("OnInterfaceSettingsRender"); - if(is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> -
    - - -
    -

    - - - - - - - - - - - - - - -
    -
     
    -
    - manager->action == '12') { // only do this bit if the user is being edited - $rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'"); - $groupsarray = $modx->db->getColumn('user_group', $rs); - } - // retain selected doc groups between post - if(is_array($_POST['user_groups'])) { - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; - } - ?> -
    -

    - -

    - db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name'); - while($row = $modx->db->getRow($rs)) { - echo "
    "; - } - } - ?> -
    - - - - invokeEvent("OnUserFormRender", array( - "id" => $user - )); - if(is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> - diff --git a/manager/actions/mutate_web_user.dynamic.php b/manager/actions/mutate_web_user.dynamic.php index c070b64b76..1c2dc7103e 100755 --- a/manager/actions/mutate_web_user.dynamic.php +++ b/manager/actions/mutate_web_user.dynamic.php @@ -1,21 +1,21 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -switch($modx->manager->action) { - case 88: - if(!$modx->hasPermission('edit_web_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 87: - if(!$modx->hasPermission('new_web_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +switch ($modx->manager->action) { + case 88: + if (!$modx->hasPermission('edit_web_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 87: + if (!$modx->hasPermission('new_web_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; @@ -23,65 +23,67 @@ // check to see the snippet editor isn't locked $rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); -if($username = $modx->db->getValue($rs)) { - $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user")); +if ($username = $modx->db->getValue($rs)) { + $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user")); } // end check for lock -if($modx->manager->action == '88') { - // get user attributes - $rs = $modx->db->select('*', $modx->getFullTableName('web_user_attributes'), "internalKey = '{$user}'"); - $userdata = $modx->db->getRow($rs); - if(!$userdata) { - $modx->webAlertAndQuit("No user returned!"); - } - - // get user settings - $rs = $modx->db->select('*', $modx->getFullTableName('web_user_settings'), "webuser = '{$user}'"); - $usersettings = array(); - while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; - extract($usersettings, EXTR_OVERWRITE); - - // get user name - $rs = $modx->db->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'"); - $usernamedata = $modx->db->getRow($rs); - if(!$usernamedata) { - $modx->webAlertAndQuit("No user returned while getting username!"); - } - $_SESSION['itemname'] = $usernamedata['username']; +if ($modx->manager->action == '88') { + // get user attributes + $rs = $modx->db->select('*', $modx->getFullTableName('web_user_attributes'), "internalKey = '{$user}'"); + $userdata = $modx->db->getRow($rs); + if (!$userdata) { + $modx->webAlertAndQuit("No user returned!"); + } + + // get user settings + $rs = $modx->db->select('*', $modx->getFullTableName('web_user_settings'), "webuser = '{$user}'"); + $usersettings = array(); + while ($row = $modx->db->getRow($rs)) { + $usersettings[$row['setting_name']] = $row['setting_value']; + } + extract($usersettings, EXTR_OVERWRITE); + + // get user name + $rs = $modx->db->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'"); + $usernamedata = $modx->db->getRow($rs); + if (!$usernamedata) { + $modx->webAlertAndQuit("No user returned while getting username!"); + } + $_SESSION['itemname'] = $usernamedata['username']; } else { - $userdata = array(); - $usersettings = array(); - $usernamedata = array(); - $_SESSION['itemname'] = $_lang["new_web_user"]; + $userdata = array(); + $usersettings = array(); + $usernamedata = array(); + $_SESSION['itemname'] = $_lang["new_web_user"]; } // avoid doubling htmlspecialchars (already encoded in DB) -foreach($userdata as $key => $val) { - $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); +foreach ($userdata as $key => $val) { + $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); }; $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); // restore saved form $formRestored = false; -if($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); - // restore post values - $userdata = array_merge($userdata, $_POST); - $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); - $usernamedata['username'] = $userdata['newusername']; - $usernamedata['oldusername'] = $_POST['oldusername']; - $usersettings = array_merge($usersettings, $userdata); - $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; - extract($usersettings, EXTR_OVERWRITE); +if ($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); + // restore post values + $userdata = array_merge($userdata, $_POST); + $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); + $usernamedata['username'] = $userdata['newusername']; + $usernamedata['oldusername'] = $_POST['oldusername']; + $usersettings = array_merge($usersettings, $userdata); + $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; + extract($usersettings, EXTR_OVERWRITE); } // include the country list language file $_country_lang = array(); -if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { - include_once "lang/country/" . $manager_language . "_country.inc.php"; +if ($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { + include_once "lang/country/" . $manager_language . "_country.inc.php"; } else { - include_once "lang/country/english_country.inc.php"; + include_once "lang/country/english_country.inc.php"; } asort($_country_lang); @@ -189,12 +191,12 @@ function showHide(what, onoff) {
    invokeEvent("OnWUsrFormPrerender", array("id" => $user)); - if(is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> + // invoke OnWUsrFormPrerender event + $evtOut = $modx->invokeEvent("OnWUsrFormPrerender", array("id" => $user)); + if (is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> " /> @@ -218,19 +220,23 @@ function showHide(what, onoff) { - + - + @@ -324,10 +330,10 @@ function showHide(what, onoff) { $country) { - echo ""; - } - ?> + foreach ($_country_lang as $key => $country) { + echo ""; + } + ?> @@ -351,7 +357,8 @@ function showHide(what, onoff) { - manager->action == '88') { ?> + manager->action == '88') { + ?> @@ -387,8 +394,8 @@ function showHide(what, onoff) { " data-tooltip=""> + } + ?>
    - time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) { ?> + time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) { + ?> - +
    "> htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?> -
    :  
     
    :  
    @@ -496,40 +503,40 @@ function SetUrl(url, width, height, alt) { manager->action == '88') { // only do this bit if the user is being edited - $rs = $modx->db->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'"); - $groupsarray = $modx->db->getColumn('webgroup', $rs); - } - // retain selected user groups between post - if(is_array($_POST['user_groups'])) { - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; - } - ?> + if ($use_udperms == 1) { + $groupsarray = array(); + + if ($modx->manager->action == '88') { // only do this bit if the user is being edited + $rs = $modx->db->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'"); + $groupsarray = $modx->db->getColumn('webgroup', $rs); + } + // retain selected user groups between post + if (is_array($_POST['user_groups'])) { + foreach ($_POST['user_groups'] as $n => $v) { + $groupsarray[] = $v; + } + } ?>

    db->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name'); - while($row = $modx->db->getRow($rs)) { - echo '
    '; - } - } - ?> + $rs = $modx->db->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name'); + while ($row = $modx->db->getRow($rs)) { + echo '
    '; + } + } + ?>
    invokeEvent("OnWUsrFormRender", array( - "id" => $user - )); - if(is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> + // invoke OnWUsrFormRender event + $evtOut = $modx->invokeEvent("OnWUsrFormRender", array( + "id" => $user + )); + if (is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> diff --git a/manager/actions/phpinfo.static.php b/manager/actions/phpinfo.static.php index 5729512f85..1bc0356c99 100755 --- a/manager/actions/phpinfo.static.php +++ b/manager/actions/phpinfo.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } ?> diff --git a/manager/actions/refresh_site.dynamic.php b/manager/actions/refresh_site.dynamic.php index a73ea46e2b..0ec740137f 100755 --- a/manager/actions/refresh_site.dynamic.php +++ b/manager/actions/refresh_site.dynamic.php @@ -1,6 +1,6 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } // (un)publishing of documents, version 2! @@ -29,12 +29,16 @@
    - ' . $_lang["refresh_published"] . '

    ', $num_rows_pub) ?> - ' . $_lang["refresh_unpublished"] . '

    ', $num_rows_unpub) ?> + ' . $_lang["refresh_published"] . '

    ', $num_rows_pub); +} ?> + ' . $_lang["refresh_unpublished"] . '

    ', $num_rows_unpub); +} ?> clearCache('full', true); - // invoke OnSiteRefresh event - $modx->invokeEvent("OnSiteRefresh"); - ?> + $modx->clearCache('full', true); + // invoke OnSiteRefresh event + $modx->invokeEvent("OnSiteRefresh"); + ?>
    diff --git a/manager/actions/resource_selector.static.php b/manager/actions/resource_selector.static.php index 065cb0666e..068bb21295 100755 --- a/manager/actions/resource_selector.static.php +++ b/manager/actions/resource_selector.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('edit_module')) { diff --git a/manager/actions/resources.static.php b/manager/actions/resources.static.php index 7899784644..18e1491e82 100755 --- a/manager/actions/resources.static.php +++ b/manager/actions/resources.static.php @@ -1,50 +1,54 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/functions.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/functions.inc.php'); +if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/functions.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/functions.inc.php'); } else { - include_once(MODX_MANAGER_PATH . 'actions/resources/functions.inc.php'); + include_once(MODX_MANAGER_PATH . 'actions/resources/functions.inc.php'); } -if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/mgrResources.class.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/mgrResources.class.php'); +if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/mgrResources.class.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/mgrResources.class.php'); } else { - include_once(MODX_MANAGER_PATH . 'actions/resources/mgrResources.class.php'); + include_once(MODX_MANAGER_PATH . 'actions/resources/mgrResources.class.php'); } $resources = new mgrResources(); // Prepare lang-strings for "Lock Elements" $unlockTranslations = array( - 'msg' => $_lang["unlock_element_id_warning"], - 'type1' => $_lang["lock_element_type_1"], - 'type2' => $_lang["lock_element_type_2"], - 'type3' => $_lang["lock_element_type_3"], - 'type4' => $_lang["lock_element_type_4"], - 'type5' => $_lang["lock_element_type_5"], - 'type6' => $_lang["lock_element_type_6"], - 'type7' => $_lang["lock_element_type_7"], - 'type8' => $_lang["lock_element_type_8"] + 'msg' => $_lang["unlock_element_id_warning"], + 'type1' => $_lang["lock_element_type_1"], + 'type2' => $_lang["lock_element_type_2"], + 'type3' => $_lang["lock_element_type_3"], + 'type4' => $_lang["lock_element_type_4"], + 'type5' => $_lang["lock_element_type_5"], + 'type6' => $_lang["lock_element_type_6"], + 'type7' => $_lang["lock_element_type_7"], + 'type8' => $_lang["lock_element_type_8"] ); -foreach($unlockTranslations as $key => $value) $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); +foreach ($unlockTranslations as $key => $value) { + $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); +} // Prepare lang-strings for mgrResAction() $mraTranslations = array( - 'create_new' => $_lang["create_new"], - 'edit' => $_lang["edit"], - 'duplicate' => $_lang["duplicate"], - 'remove' => $_lang["remove"], - 'confirm_duplicate_record' => $_lang["confirm_duplicate_record"], - 'confirm_delete_template' => $_lang["confirm_delete_template"], - 'confirm_delete_tmplvars' => $_lang["confirm_delete_tmplvars"], - 'confirm_delete_htmlsnippet' => $_lang["confirm_delete_htmlsnippet"], - 'confirm_delete_snippet' => $_lang["confirm_delete_htmlsnippet"], - 'confirm_delete_plugin' => $_lang["confirm_delete_plugin"], - 'confirm_delete_module' => $_lang["confirm_delete_module"], + 'create_new' => $_lang["create_new"], + 'edit' => $_lang["edit"], + 'duplicate' => $_lang["duplicate"], + 'remove' => $_lang["remove"], + 'confirm_duplicate_record' => $_lang["confirm_duplicate_record"], + 'confirm_delete_template' => $_lang["confirm_delete_template"], + 'confirm_delete_tmplvars' => $_lang["confirm_delete_tmplvars"], + 'confirm_delete_htmlsnippet' => $_lang["confirm_delete_htmlsnippet"], + 'confirm_delete_snippet' => $_lang["confirm_delete_htmlsnippet"], + 'confirm_delete_plugin' => $_lang["confirm_delete_plugin"], + 'confirm_delete_module' => $_lang["confirm_delete_module"], ); -foreach($mraTranslations as $key => $value) $mraTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); +foreach ($mraTranslations as $key => $value) { + $mraTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); +} ?> @@ -65,46 +69,46 @@ config['manager_theme'] . '/actions/resources/tab1_templates.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab1_templates.inc.php'); - } else { - include_once(MODX_MANAGER_PATH . '/actions/resources/tab1_templates.inc.php'); - } + if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab1_templates.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab1_templates.inc.php'); + } else { + include_once(MODX_MANAGER_PATH . '/actions/resources/tab1_templates.inc.php'); + } - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab2_templatevars.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab2_templatevars.inc.php'); - } else { - include_once(MODX_MANAGER_PATH . '/actions/resources/tab2_templatevars.inc.php'); - } + if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab2_templatevars.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab2_templatevars.inc.php'); + } else { + include_once(MODX_MANAGER_PATH . '/actions/resources/tab2_templatevars.inc.php'); + } - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab3_chunks.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab3_chunks.inc.php'); - } else { - include_once(MODX_MANAGER_PATH . '/actions/resources/tab3_chunks.inc.php'); - } + if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab3_chunks.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab3_chunks.inc.php'); + } else { + include_once(MODX_MANAGER_PATH . '/actions/resources/tab3_chunks.inc.php'); + } - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab4_snippets.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab4_snippets.inc.php'); - } else { - include_once(MODX_MANAGER_PATH . '/actions/resources/tab4_snippets.inc.php'); - } + if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab4_snippets.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab4_snippets.inc.php'); + } else { + include_once(MODX_MANAGER_PATH . '/actions/resources/tab4_snippets.inc.php'); + } - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab5_plugins.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab5_plugins.inc.php'); - } else { - include_once(MODX_MANAGER_PATH . '/actions/resources/tab5_plugins.inc.php'); - } + if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab5_plugins.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab5_plugins.inc.php'); + } else { + include_once(MODX_MANAGER_PATH . '/actions/resources/tab5_plugins.inc.php'); + } - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab6_categoryview.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab6_categoryview.inc.php'); - } else { - include_once(MODX_MANAGER_PATH . '/actions/resources/tab6_categoryview.inc.php'); - } + if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab6_categoryview.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab6_categoryview.inc.php'); + } else { + include_once(MODX_MANAGER_PATH . '/actions/resources/tab6_categoryview.inc.php'); + } - if(is_numeric($_GET['tab'])) { - echo ''; - } - ?> + if (is_numeric($_GET['tab'])) { + echo ''; + } + ?> diff --git a/manager/actions/resources/functions.inc.php b/manager/actions/resources/functions.inc.php index 0c52eaa27f..680e0e3236 100755 --- a/manager/actions/resources/functions.inc.php +++ b/manager/actions/resources/functions.inc.php @@ -1,14 +1,14 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } $tpl = array( - 'viewForm' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_viewForm.tpl'), - 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), - 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), - 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), - 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl') + 'viewForm' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_viewForm.tpl'), + 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), + 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), + 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), + 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl') ); /** @@ -16,22 +16,26 @@ * @param array $ph * @return string */ -function parsePh($tpl, $ph) { - $modx = evolutionCMS(); global $_lang; - $tpl = $modx->parseText($tpl, $_lang, '[%', '%]'); - return $modx->parseText($tpl, $ph); +function parsePh($tpl, $ph) +{ + $modx = evolutionCMS(); + global $_lang; + $tpl = $modx->parseText($tpl, $_lang, '[%', '%]'); + return $modx->parseText($tpl, $ph); } /** * @param string|int $cssId * @return string */ -function renderViewSwitchButtons($cssId) { - $modx = evolutionCMS(); global $_lang, $tpl; +function renderViewSwitchButtons($cssId) +{ + $modx = evolutionCMS(); + global $_lang, $tpl; - return parsePh($tpl['viewForm'], array( - 'cssId' => $cssId - )); + return parsePh($tpl['viewForm'], array( + 'cssId' => $cssId + )); } /** @@ -39,108 +43,112 @@ function renderViewSwitchButtons($cssId) { * @param mgrResources $resources * @return string */ -function createResourceList($resourceTable, $resources) { - $modx = evolutionCMS(); global $_lang, $_style, $modx_textdir, $tpl; +function createResourceList($resourceTable, $resources) +{ + $modx = evolutionCMS(); + global $_lang, $_style, $modx_textdir, $tpl; - $items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false; + $items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false; - if( ! is_array($items) || empty($items)) { - return $_lang['no_results']; - } + if (! is_array($items) || empty($items)) { + return $_lang['no_results']; + } - // Prepare elements- and categories-list - $elements = array(); - $categories = array(); - foreach($items as $row) { - $catid = $row['catid'] ? $row['catid'] : 0; - $categories[$catid] = array('name' => stripslashes($row['category'])); - $elements[$catid][] = prepareElementRowPh($row, $resourceTable, $resources); - } + // Prepare elements- and categories-list + $elements = array(); + $categories = array(); + foreach ($items as $row) { + $catid = $row['catid'] ? $row['catid'] : 0; + $categories[$catid] = array('name' => stripslashes($row['category'])); + $elements[$catid][] = prepareElementRowPh($row, $resourceTable, $resources); + } - // Now render categories / panel-collapse - $panelGroup = ''; - foreach($elements as $catid => $elList) { - // Add panel-heading / category-collapse to output - $panelGroup .= parsePh($tpl['panelHeading'], array( - 'tab' => $resourceTable, - 'category' => $categories[$catid]['name'], - 'categoryid' => $catid != '' ? ' (' . $catid . ')' : '', - 'catid' => $catid, - )); + // Now render categories / panel-collapse + $panelGroup = ''; + foreach ($elements as $catid => $elList) { + // Add panel-heading / category-collapse to output + $panelGroup .= parsePh($tpl['panelHeading'], array( + 'tab' => $resourceTable, + 'category' => $categories[$catid]['name'], + 'categoryid' => $catid != '' ? ' (' . $catid . ')' : '', + 'catid' => $catid, + )); - // Prepare content for panel-collapse - $panelCollapse = ''; - foreach($elList as $el) { - $panelCollapse .= parsePh($tpl['elementsRow'], $el); - } + // Prepare content for panel-collapse + $panelCollapse = ''; + foreach ($elList as $el) { + $panelCollapse .= parsePh($tpl['elementsRow'], $el); + } - // Add panel-collapse with elements to output - $panelGroup .= parsePh($tpl['panelCollapse'], array( - 'tab' => $resourceTable, - 'catid' => $catid, - 'wrapper' => $panelCollapse, - )); - } + // Add panel-collapse with elements to output + $panelGroup .= parsePh($tpl['panelCollapse'], array( + 'tab' => $resourceTable, + 'catid' => $catid, + 'wrapper' => $panelCollapse, + )); + } - return parsePh($tpl['panelGroup'], array( - 'resourceTable' => $resourceTable, - 'wrapper' => $panelGroup - )); + return parsePh($tpl['panelGroup'], array( + 'resourceTable' => $resourceTable, + 'wrapper' => $panelGroup + )); } /** * @param mgrResources $resources * @return string */ -function createCombinedView($resources) { - $modx = evolutionCMS(); global $_lang, $_style, $modx_textdir; +function createCombinedView($resources) +{ + $modx = evolutionCMS(); + global $_lang, $_style, $modx_textdir; - $itemsPerCategory = isset($resources->itemsPerCategory) ? $resources->itemsPerCategory : false; - $types = isset($resources->types) ? $resources->types : false; - $categories = isset($resources->categories) ? $resources->categories : false; + $itemsPerCategory = isset($resources->itemsPerCategory) ? $resources->itemsPerCategory : false; + $types = isset($resources->types) ? $resources->types : false; + $categories = isset($resources->categories) ? $resources->categories : false; - if(!$itemsPerCategory) { - return $_lang['no_results']; - } + if (!$itemsPerCategory) { + return $_lang['no_results']; + } - $tpl = array( - 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), - 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), - 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), - 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl'), - ); + $tpl = array( + 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), + 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), + 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), + 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl'), + ); - // Easily loop through $itemsPerCategory-Array - $panelGroup = ''; - foreach($categories as $catid => $category) { - // Prepare collapse content / elements-list - $panelCollapse = ''; - foreach($itemsPerCategory[$catid] as $el) { - $resourceTable = $el['type']; - $ph = prepareElementRowPh($el, $resourceTable, $resources); - $panelCollapse .= parsePh($tpl['elementsRow'], $ph); - } + // Easily loop through $itemsPerCategory-Array + $panelGroup = ''; + foreach ($categories as $catid => $category) { + // Prepare collapse content / elements-list + $panelCollapse = ''; + foreach ($itemsPerCategory[$catid] as $el) { + $resourceTable = $el['type']; + $ph = prepareElementRowPh($el, $resourceTable, $resources); + $panelCollapse .= parsePh($tpl['elementsRow'], $ph); + } - // Add panel-heading / button - $panelGroup .= parsePh($tpl['panelHeading'], array( - 'tab' => 'categories_list', - 'category' => $categories[$catid], - 'categoryid' => $catid != '' ? ' (' . $catid . ')' : '', - 'catid' => $catid, - )); + // Add panel-heading / button + $panelGroup .= parsePh($tpl['panelHeading'], array( + 'tab' => 'categories_list', + 'category' => $categories[$catid], + 'categoryid' => $catid != '' ? ' (' . $catid . ')' : '', + 'catid' => $catid, + )); - // Add panel - $panelGroup .= parsePh($tpl['panelCollapse'], array( - 'tab' => 'categories_list', - 'catid' => $catid, - 'wrapper' => $panelCollapse, - )); - } + // Add panel + $panelGroup .= parsePh($tpl['panelCollapse'], array( + 'tab' => 'categories_list', + 'catid' => $catid, + 'wrapper' => $panelCollapse, + )); + } - return parsePh($tpl['panelGroup'], array( - 'resourceTable' => 'categories_list', - 'wrapper' => $panelGroup - )); + return parsePh($tpl['panelGroup'], array( + 'resourceTable' => 'categories_list', + 'wrapper' => $panelGroup + )); } /** @@ -149,14 +157,16 @@ function createCombinedView($resources) { * @param mgrResources $resources * @return array */ -function prepareElementRowPh($row, $resourceTable, $resources) { - $modx = evolutionCMS(); global $modx_textdir, $_style, $_lang; +function prepareElementRowPh($row, $resourceTable, $resources) +{ + $modx = evolutionCMS(); + global $modx_textdir, $_style, $_lang; - $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false; + $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false; - $_lang["confirm_delete"] = $_lang["delete"]; + $_lang["confirm_delete"] = $_lang["delete"]; - switch($resourceTable){ + switch ($resourceTable) { case 'site_templates': $class = $row['selectable'] ? '' : 'disabledPlugin'; $lockElementType = 1; @@ -190,77 +200,77 @@ function prepareElementRowPh($row, $resourceTable, $resources) { return array(); } - // Prepare displaying user-locks - $lockedByUser = ''; - $rowLock = $modx->elementIsLocked($lockElementType, $row['id'], true); - if($rowLock && $modx->hasPermission('display_locks')) { - if($rowLock['sid'] == $modx->sid) { - $title = $modx->parseText($_lang["lock_element_editing"], array( - 'element_type' => $_lang["lock_element_type_" . $lockElementType], - 'lasthit_df' => $rowLock['lasthit_df'] - )); - $lockedByUser = '' . $_style['tree_preview_resource'] . ' '; - } else { - $title = $modx->parseText($_lang["lock_element_locked_by"], array( - 'element_type' => $_lang["lock_element_type_" . $lockElementType], - 'username' => $rowLock['username'], - 'lasthit_df' => $rowLock['lasthit_df'] - )); - if($modx->hasPermission('remove_locks')) { - $lockedByUser = ''; - } else { - $lockedByUser = ''; - } - } - } - if($lockedByUser) { - $lockedByUser = '
    ' . $lockedByUser . '
    '; - } + // Prepare displaying user-locks + $lockedByUser = ''; + $rowLock = $modx->elementIsLocked($lockElementType, $row['id'], true); + if ($rowLock && $modx->hasPermission('display_locks')) { + if ($rowLock['sid'] == $modx->sid) { + $title = $modx->parseText($_lang["lock_element_editing"], array( + 'element_type' => $_lang["lock_element_type_" . $lockElementType], + 'lasthit_df' => $rowLock['lasthit_df'] + )); + $lockedByUser = '' . $_style['tree_preview_resource'] . ' '; + } else { + $title = $modx->parseText($_lang["lock_element_locked_by"], array( + 'element_type' => $_lang["lock_element_type_" . $lockElementType], + 'username' => $rowLock['username'], + 'lasthit_df' => $rowLock['lasthit_df'] + )); + if ($modx->hasPermission('remove_locks')) { + $lockedByUser = ''; + } else { + $lockedByUser = ''; + } + } + } + if ($lockedByUser) { + $lockedByUser = '
    ' . $lockedByUser . '
    '; + } - // Caption - if($resourceTable == 'site_tmplvars') { - $caption = !empty($row['description']) ? ' ' . $row['caption'] . '   (' . $row['description'] . ')' : ' ' . $row['caption']; - } else { - $caption = !empty($row['description']) ? ' ' . $row['description'] : ''; - } + // Caption + if ($resourceTable == 'site_tmplvars') { + $caption = !empty($row['description']) ? ' ' . $row['caption'] . '   (' . $row['description'] . ')' : ' ' . $row['caption']; + } else { + $caption = !empty($row['description']) ? ' ' . $row['description'] : ''; + } - // Special marks - $tplInfo = array(); - if($row['locked']) { - $tplInfo[] = $_lang['locked']; - } - if($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') { - $tplInfo[] = $_lang['defaulttemplate_title']; - } - $marks = !empty($tplInfo) ? ' (' . implode(', ', $tplInfo) . ')' : ''; + // Special marks + $tplInfo = array(); + if ($row['locked']) { + $tplInfo[] = $_lang['locked']; + } + if ($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') { + $tplInfo[] = $_lang['defaulttemplate_title']; + } + $marks = !empty($tplInfo) ? ' (' . implode(', ', $tplInfo) . ')' : ''; - /* row buttons */ - $buttons = ''; - if($modx->hasPermission($types['actions']['edit'][1])) { - $buttons .= '
  • '; - } - if($modx->hasPermission($types['actions']['duplicate'][1])) { - $buttons .= '
  • '; - } - if($modx->hasPermission($types['actions']['remove'][1])) { - $buttons .= '
  • '; - } - $buttons = $buttons ? '
      ' . $buttons . '
    ' : ''; + /* row buttons */ + $buttons = ''; + if ($modx->hasPermission($types['actions']['edit'][1])) { + $buttons .= '
  • '; + } + if ($modx->hasPermission($types['actions']['duplicate'][1])) { + $buttons .= '
  • '; + } + if ($modx->hasPermission($types['actions']['remove'][1])) { + $buttons .= '
  • '; + } + $buttons = $buttons ? '
      ' . $buttons . '
    ' : ''; - $catid = $row['catid'] ? $row['catid'] : 0; + $catid = $row['catid'] ? $row['catid'] : 0; - // Placeholders for elements-row - return array( - 'class' => $class ? ' class="' . $class . '"' : '', - 'lockedByUser' => $lockedByUser, - 'name' => $row['name'], - 'caption' => $caption, - 'buttons' => $buttons, - 'marks' => $marks, - 'id' => $row['id'], - 'resourceTable' => $resourceTable, - 'actionEdit' => $types['actions']['edit'][0], - 'catid' => $catid, - 'textdir' => $modx_textdir ? '‏' : '', - ); + // Placeholders for elements-row + return array( + 'class' => $class ? ' class="' . $class . '"' : '', + 'lockedByUser' => $lockedByUser, + 'name' => $row['name'], + 'caption' => $caption, + 'buttons' => $buttons, + 'marks' => $marks, + 'id' => $row['id'], + 'resourceTable' => $resourceTable, + 'actionEdit' => $types['actions']['edit'][0], + 'catid' => $catid, + 'textdir' => $modx_textdir ? '‏' : '', + ); } diff --git a/manager/actions/resources/mgrResources.class.php b/manager/actions/resources/mgrResources.class.php index 2b34adb3c3..54b7473345 100755 --- a/manager/actions/resources/mgrResources.class.php +++ b/manager/actions/resources/mgrResources.class.php @@ -1,13 +1,14 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -class mgrResources { +class mgrResources +{ /** * @var array */ - public $types = array(); + public $types = array(); /** * @var array */ @@ -24,82 +25,91 @@ class mgrResources { /** * mgrResources constructor. */ - public function __construct() { - $this->setTypes(); - $this->queryItemsFromDB(); - $this->prepareCategoryArrays(); - } + public function __construct() + { + $this->setTypes(); + $this->queryItemsFromDB(); + $this->prepareCategoryArrays(); + } /** * @return void */ - public function setTypes() { - global $_lang; - $this->types['site_templates'] = array( - 'title'=>$_lang["manage_templates"], - 'actions'=>array( 'edit'=>array(16,'edit_template'), 'duplicate'=>array(96,'new_template'), 'remove'=>array(21,'delete_template') ), - 'permissions'=>array('new_template','edit_template'), - 'name'=>'templatename' - ); - $this->types['site_tmplvars'] = array( - 'title'=>$_lang["tmplvars"], - 'actions'=>array('edit'=>array(301,'edit_template'), 'duplicate'=>array(304,'edit_template'), 'remove'=>array(303,'edit_template')), - 'permissions'=>array('new_template','edit_template'), - ); - $this->types['site_htmlsnippets'] = array( - 'title'=>$_lang["manage_htmlsnippets"], - 'actions'=>array('edit'=>array(78,'edit_chunk'), 'duplicate'=>array(97,'new_chunk'), 'remove'=>array(80,'delete_chunk')), - 'permissions'=>array('new_chunk','edit_chunk'), - ); - $this->types['site_snippets'] = array( - 'title'=>$_lang["manage_snippets"], - 'actions'=>array('edit'=>array(22,'edit_snippet'), 'duplicate'=>array(98,'new_snippet'), 'remove'=>array(25,'delete_snippet')), - 'permissions'=>array('new_snippet','edit_snippet'), - ); - $this->types['site_plugins'] = array( - 'title'=>$_lang["manage_plugins"], - 'actions'=>array('edit'=>array(102,'edit_plugin'), 'duplicate'=>array(105,'new_plugin'), 'remove'=>array(104,'delete_plugin')), - 'permissions'=>array('new_plugin','edit_plugin'), - ); - $this->types['site_modules'] = array( - 'title'=>$_lang["manage_modules"], - 'actions'=>array('edit'=>array(108,'edit_module'), 'duplicate'=>array(111,'new_module'), 'remove'=>array(110,'delete_module')), - 'permissions'=>array('new_module','edit_module'), - ); - } + public function setTypes() + { + global $_lang; + $this->types['site_templates'] = array( + 'title'=>$_lang["manage_templates"], + 'actions'=>array( 'edit'=>array(16,'edit_template'), 'duplicate'=>array(96,'new_template'), 'remove'=>array(21,'delete_template') ), + 'permissions'=>array('new_template','edit_template'), + 'name'=>'templatename' + ); + $this->types['site_tmplvars'] = array( + 'title'=>$_lang["tmplvars"], + 'actions'=>array('edit'=>array(301,'edit_template'), 'duplicate'=>array(304,'edit_template'), 'remove'=>array(303,'edit_template')), + 'permissions'=>array('new_template','edit_template'), + ); + $this->types['site_htmlsnippets'] = array( + 'title'=>$_lang["manage_htmlsnippets"], + 'actions'=>array('edit'=>array(78,'edit_chunk'), 'duplicate'=>array(97,'new_chunk'), 'remove'=>array(80,'delete_chunk')), + 'permissions'=>array('new_chunk','edit_chunk'), + ); + $this->types['site_snippets'] = array( + 'title'=>$_lang["manage_snippets"], + 'actions'=>array('edit'=>array(22,'edit_snippet'), 'duplicate'=>array(98,'new_snippet'), 'remove'=>array(25,'delete_snippet')), + 'permissions'=>array('new_snippet','edit_snippet'), + ); + $this->types['site_plugins'] = array( + 'title'=>$_lang["manage_plugins"], + 'actions'=>array('edit'=>array(102,'edit_plugin'), 'duplicate'=>array(105,'new_plugin'), 'remove'=>array(104,'delete_plugin')), + 'permissions'=>array('new_plugin','edit_plugin'), + ); + $this->types['site_modules'] = array( + 'title'=>$_lang["manage_modules"], + 'actions'=>array('edit'=>array(108,'edit_module'), 'duplicate'=>array(111,'new_module'), 'remove'=>array(110,'delete_module')), + 'permissions'=>array('new_module','edit_module'), + ); + } /** * @return void */ - public function queryItemsFromDB() { - foreach($this->types as $resourceTable=>$type) { - if($this->hasAnyPermissions($type['permissions'])) { - $nameField = isset($type['name']) ? $type['name'] : 'name'; - $this->items[$resourceTable] = $this->queryResources($resourceTable, $nameField); - } - } - } + public function queryItemsFromDB() + { + foreach ($this->types as $resourceTable=>$type) { + if ($this->hasAnyPermissions($type['permissions'])) { + $nameField = isset($type['name']) ? $type['name'] : 'name'; + $this->items[$resourceTable] = $this->queryResources($resourceTable, $nameField); + } + } + } /** * @param array $permissions * @return bool */ - public function hasAnyPermissions($permissions) { - $modx = evolutionCMS(); + public function hasAnyPermissions($permissions) + { + $modx = evolutionCMS(); - foreach($permissions as $p) - if($modx->hasPermission($p)) return true; + foreach ($permissions as $p) { + if ($modx->hasPermission($p)) { + return true; + } + } - return false; - } + return false; + } /** * @param string $resourceTable * @param string $nameField * @return array|bool */ - public function queryResources($resourceTable, $nameField = 'name') { - $modx = evolutionCMS(); global $_lang; + public function queryResources($resourceTable, $nameField = 'name') + { + $modx = evolutionCMS(); + global $_lang; $allowed = array( 'site_htmlsnippets', @@ -107,59 +117,63 @@ public function queryResources($resourceTable, $nameField = 'name') { 'site_plugins', 'site_modules' ); - $pluginsql = !empty($resourceTable) && in_array($resourceTable, $allowed) ? $resourceTable . '.disabled, ' : ''; - - $tvsql = ''; - $tvjoin = ''; - if ($resourceTable === 'site_tmplvars') { - $tvsql = 'site_tmplvars.caption, '; - $tvjoin = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl', $modx->getFullTableName('site_tmplvar_templates')); - $sttfield = 'IF(stt.templateid,1,0) AS reltpl,'; - } - else $sttfield = ''; - - $selectableTemplates = $resourceTable === 'site_templates' ? "{$resourceTable}.selectable, " : ""; - - $rs = $modx->db->select( - "{$sttfield} {$pluginsql} {$tvsql} {$resourceTable}.{$nameField} as name, {$resourceTable}.id, {$resourceTable}.description, {$resourceTable}.locked, {$selectableTemplates}IF(isnull(categories.category),'{$_lang['no_category']}',categories.category) as category, categories.id as catid", - $modx->getFullTableName($resourceTable) . " AS {$resourceTable} + $pluginsql = !empty($resourceTable) && in_array($resourceTable, $allowed) ? $resourceTable . '.disabled, ' : ''; + + $tvsql = ''; + $tvjoin = ''; + if ($resourceTable === 'site_tmplvars') { + $tvsql = 'site_tmplvars.caption, '; + $tvjoin = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl', $modx->getFullTableName('site_tmplvar_templates')); + $sttfield = 'IF(stt.templateid,1,0) AS reltpl,'; + } else { + $sttfield = ''; + } + + $selectableTemplates = $resourceTable === 'site_templates' ? "{$resourceTable}.selectable, " : ""; + + $rs = $modx->db->select( + "{$sttfield} {$pluginsql} {$tvsql} {$resourceTable}.{$nameField} as name, {$resourceTable}.id, {$resourceTable}.description, {$resourceTable}.locked, {$selectableTemplates}IF(isnull(categories.category),'{$_lang['no_category']}',categories.category) as category, categories.id as catid", + $modx->getFullTableName($resourceTable) . " AS {$resourceTable} LEFT JOIN " . $modx->getFullTableName('categories') . " AS categories ON {$resourceTable}.category = categories.id {$tvjoin}", - "", - "category,name" - ); - $limit = $modx->db->getRecordCount($rs); + "", + "category,name" + ); + $limit = $modx->db->getRecordCount($rs); - if($limit < 1) return false; + if ($limit < 1) { + return false; + } - $result = array(); - while ($row = $modx->db->getRow($rs)) { - $result[] = $row; - } - return $result; - } + $result = array(); + while ($row = $modx->db->getRow($rs)) { + $result[] = $row; + } + return $result; + } /** * @return void */ - public function prepareCategoryArrays() { - foreach($this->items as $type=>$items) { - foreach((array)$items as $item) { - $catid = $item['catid'] ? $item['catid'] : 0; - $this->categories[$catid] = $item['category']; - - $item['type'] = $type; - $this->itemsPerCategory[$catid][] = $item; - } - } - - // Sort categories by name - natcasesort($this->categories); - - // Now sort by name - foreach($this->itemsPerCategory as $catid=>$items) { - usort($this->itemsPerCategory[$catid], function ($a, $b) { - return strcasecmp($a['name'], $b['name']); - }); - } - } + public function prepareCategoryArrays() + { + foreach ($this->items as $type=>$items) { + foreach ((array)$items as $item) { + $catid = $item['catid'] ? $item['catid'] : 0; + $this->categories[$catid] = $item['category']; + + $item['type'] = $type; + $this->itemsPerCategory[$catid][] = $item; + } + } + + // Sort categories by name + natcasesort($this->categories); + + // Now sort by name + foreach ($this->itemsPerCategory as $catid=>$items) { + usort($this->itemsPerCategory[$catid], function ($a, $b) { + return strcasecmp($a['name'], $b['name']); + }); + } + } } diff --git a/manager/actions/resources/tab1_templates.inc.php b/manager/actions/resources/tab1_templates.inc.php index 23b0758e87..59a41c2a2f 100755 --- a/manager/actions/resources/tab1_templates.inc.php +++ b/manager/actions/resources/tab1_templates.inc.php @@ -1,10 +1,11 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (isset($resources->items['site_templates'])) { ?> +if (isset($resources->items['site_templates'])) { + ?>

    @@ -35,4 +36,5 @@ initViews('tmp', 'template', 'site_templates')
    - + diff --git a/manager/actions/resources/tab2_templatevars.inc.php b/manager/actions/resources/tab2_templatevars.inc.php index 72d8f8d4e7..667d3542ce 100755 --- a/manager/actions/resources/tab2_templatevars.inc.php +++ b/manager/actions/resources/tab2_templatevars.inc.php @@ -1,10 +1,11 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (isset($resources->items['site_tmplvars'])) { ?> +if (isset($resources->items['site_tmplvars'])) { + ?>

    @@ -40,4 +41,5 @@ initViews('tv', 'tv', 'site_tmplvars')
    - + diff --git a/manager/actions/resources/tab3_chunks.inc.php b/manager/actions/resources/tab3_chunks.inc.php index 6183b1afb9..fda510755b 100755 --- a/manager/actions/resources/tab3_chunks.inc.php +++ b/manager/actions/resources/tab3_chunks.inc.php @@ -1,10 +1,11 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (isset($resources->items['site_htmlsnippets'])) { ?> +if (isset($resources->items['site_htmlsnippets'])) { + ?>

    @@ -36,4 +37,5 @@ initViews('ch', 'chunks', 'site_htmlsnippets')
    - + diff --git a/manager/actions/resources/tab4_snippets.inc.php b/manager/actions/resources/tab4_snippets.inc.php index 921b4e4089..68190d5948 100755 --- a/manager/actions/resources/tab4_snippets.inc.php +++ b/manager/actions/resources/tab4_snippets.inc.php @@ -1,10 +1,11 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (isset($resources->items['site_snippets'])) { ?> +if (isset($resources->items['site_snippets'])) { + ?>

    @@ -36,4 +37,5 @@ initViews('sn', 'snippets', 'site_snippets')
    - + diff --git a/manager/actions/resources/tab5_plugins.inc.php b/manager/actions/resources/tab5_plugins.inc.php index b07db5ab55..198deb4aac 100755 --- a/manager/actions/resources/tab5_plugins.inc.php +++ b/manager/actions/resources/tab5_plugins.inc.php @@ -1,10 +1,11 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (isset($resources->items['site_plugins'])) { ?> +if (isset($resources->items['site_plugins'])) { + ?>

    @@ -19,16 +20,21 @@
    - hasPermission('new_plugin')) { ?> + hasPermission('new_plugin')) { + ?> "> - - hasPermission('save_plugin')) { ?> + + hasPermission('save_plugin')) { + ?> "> - + hasPermission('delete_plugin') && $_SESSION['mgrRole'] == 1) { $tbl_site_plugins = $modx->getFullTableName('site_plugins'); - if ($modx->db->getRecordCount($modx->db->query("SELECT id FROM {$tbl_site_plugins} t1 WHERE disabled = 1 AND name IN (SELECT name FROM {$tbl_site_plugins} t2 WHERE t1.name = t2.name AND t1.id != t2.id)"))) { ?> + if ($modx->db->getRecordCount($modx->db->query("SELECT id FROM {$tbl_site_plugins} t1 WHERE disabled = 1 AND name IN (SELECT name FROM {$tbl_site_plugins} t2 WHERE t1.name = t2.name AND t1.id != t2.id)"))) { + ?>
    - + diff --git a/manager/actions/resources/tab6_categoryview.inc.php b/manager/actions/resources/tab6_categoryview.inc.php index 2f118d79d9..9c7263ad9f 100755 --- a/manager/actions/resources/tab6_categoryview.inc.php +++ b/manager/actions/resources/tab6_categoryview.inc.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } ?> diff --git a/manager/actions/role_management.static.php b/manager/actions/role_management.static.php index bd6adb1dce..41504d52a6 100755 --- a/manager/actions/role_management.static.php +++ b/manager/actions/role_management.static.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('edit_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('edit_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } ?> @@ -18,14 +18,14 @@
    db->select('name, id, description', $modx->getFullTableName('user_roles'), '', 'name'); - $limit = $modx->db->getRecordCount($rs); - if($limit < 1) { - ?> + $rs = $modx->db->select('name, id, description', $modx->getFullTableName('user_roles'), '', 'name'); + $limit = $modx->db->getRecordCount($rs); + if ($limit < 1) { + ?>

    + } else { + ?>
    @@ -37,29 +37,29 @@ db->getRow($rs)) { - if($row['id'] == 1) { - ?> + while ($row = $modx->db->getRow($rs)) { + if ($row['id'] == 1) { + ?> + } else { + ?> + } + } ?>
    - +
    diff --git a/manager/actions/search.static.php b/manager/actions/search.static.php index 86f76bafcd..e640556c4d 100755 --- a/manager/actions/search.static.php +++ b/manager/actions/search.static.php @@ -1,5 +1,5 @@ getFullTableName('site_tmplvar_contentvalues'); - $articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'"; - $articul_result = $modx->db->query($articul_query); - $articul_id_array = $modx->db->makeArray($articul_result); - if(count($articul_id_array)>0){ - $articul_id = ''; - $i = 1; - foreach( $articul_id_array as $articul ) { - $articul_id.=$articul['contentid']; - if($i !== count($articul_id_array)){ - $articul_id.=','; - } - $i++; - } - $articul_id_query = " OR sc.id IN ({$articul_id})"; - }else{ - $articul_id_query = ''; - } - /*end search by TV*/ + /*start search by TV. Added Rising13*/ + $tbl_site_tmplvar_contentvalues = $modx->getFullTableName('site_tmplvar_contentvalues'); + $articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'"; + $articul_result = $modx->db->query($articul_query); + $articul_id_array = $modx->db->makeArray($articul_result); + if (count($articul_id_array)>0) { + $articul_id = ''; + $i = 1; + foreach ($articul_id_array as $articul) { + $articul_id.=$articul['contentid']; + if ($i !== count($articul_id_array)) { + $articul_id.=','; + } + $i++; + } + $articul_id_query = " OR sc.id IN ({$articul_id})"; + } else { + $articul_id_query = ''; + } + /*end search by TV*/ if (ctype_digit($searchfields)) { $sqladd .= "sc.id='{$searchfields}'"; if (strlen($searchfields) > 3) { - $sqladd .= $articul_id_query;//search by TV + $sqladd .= $articul_id_query;//search by TV $sqladd .= " OR sc.pagetitle LIKE '%{$searchfields}%'"; } } if ($idFromAlias) { $sqladd .= $sqladd != '' ? ' OR ' : ''; $sqladd .= "sc.id='{$idFromAlias}'"; - } $sqladd = $sqladd ? "({$sqladd})" : $sqladd; @@ -160,7 +159,7 @@ $sqladd .= $articul_id_query;//search by TV $sqladd .= ")"; } - } else if ($idFromAlias) { + } elseif ($idFromAlias) { $sqladd .= " sc.id='{$idFromAlias}'"; } @@ -179,7 +178,7 @@ // get document groups for current user if (!empty($modx->config['use_udperms']) && $sqladd) { $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; - $mgrRole = (isset ($_SESSION['mgrRole']) && $_SESSION['mgrRole'] == 1) ? 1 : 0; + $mgrRole = (isset($_SESSION['mgrRole']) && $_SESSION['mgrRole'] == 1) ? 1 : 0; $docgrp_cond = $docgrp ? " OR dg.document_group IN ({$docgrp})" : ''; $fields .= ', MAX(IF(1=' . $mgrRole . ' OR sc.privatemgr=0' . $docgrp_cond . ',1,0)) AS hasAccess'; $sqladd = '(' . $sqladd . ") AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); @@ -196,9 +195,7 @@ $limit = $modx->db->getRecordCount($rs); } else { $limit = 0; - } - - ?> + } ?> @@ -207,12 +204,10 @@
    ' . $_lang['search_results_returned_msg'] . '

    ', $limit); - ?> + printf('

    ' . $_lang['search_results_returned_msg'] . '

    ', $limit); ?> @@ -242,25 +237,24 @@ 'image/png' => $_style["tree_page_png"] ); - while ($row = $modx->db->getRow($rs)) { - // figure out the icon for the document... - $icon = ""; - if ($row['type'] == 'reference') { - $icon .= $_style["tree_linkgo"]; - } elseif ($row['isfolder'] == 0) { - $icon .= isset($icons[$row['contenttype']]) ? $icons[$row['contenttype']] : $_style["tree_page_html"]; - } else { - $icon .= $_style['tree_folder_new']; - } - - $tdClass = ""; - if ($row['published'] == 0) { - $tdClass .= ' class="unpublishedNode"'; - } - if ($row['deleted'] == 1) { - $tdClass .= ' class="deletedNode"'; - } - ?> + while ($row = $modx->db->getRow($rs)) { + // figure out the icon for the document... + $icon = ""; + if ($row['type'] == 'reference') { + $icon .= $_style["tree_linkgo"]; + } elseif ($row['isfolder'] == 0) { + $icon .= isset($icons[$row['contenttype']]) ? $icons[$row['contenttype']] : $_style["tree_page_html"]; + } else { + $icon .= $_style['tree_folder_new']; + } + + $tdClass = ""; + if ($row['published'] == 0) { + $tdClass .= ' class="unpublishedNode"'; + } + if ($row['deleted'] == 1) { + $tdClass .= ' class="deletedNode"'; + } ?> > 35 ? substr($row['description'], 0, 35) . '...' : $row['description'] ?> + } ?> + } ?>
    @@ -280,16 +274,13 @@ > 20 ? substr($row['pagetitle'], 0, 20) . '...' : $row['pagetitle'] ?>
      ' . $output . '
    ' : '1'; - } - - ?> + } ?> INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('view_eventlog')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('view_eventlog')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } ?> @@ -17,14 +17,14 @@
    db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC'); - $limit = $modx->db->getRecordCount($rs); - if($limit < 1) { - ?> + $rs = $modx->db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC'); + $limit = $modx->db->getRecordCount($rs); + if ($limit < 1) { + ?>

    + } else { + ?>
    @@ -36,34 +36,33 @@ db->getRow($rs)) { - ?> + while ($row = $modx->db->getRow($rs)) { + ?> + } ?>
    toDateFormat($row['pub_date'] + $server_offset_time) ?>
    + } + ?>
    db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC'); - $limit = $modx->db->getRecordCount($rs); - if($limit < 1) { - ?> + $rs = $modx->db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC'); + $limit = $modx->db->getRecordCount($rs); + if ($limit < 1) { + ?>

    + } else { + ?>
    @@ -75,34 +74,33 @@ db->getRow($rs)) { - ?> + while ($row = $modx->db->getRow($rs)) { + ?> + } ?>
    toDateFormat($row['unpub_date'] + $server_offset_time) ?>
    + } + ?>
    db->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC"); - $limit = $modx->db->getRecordCount($rs); - if($limit < 1) { - ?> + $rs = $modx->db->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC"); + $limit = $modx->db->getRecordCount($rs); + if ($limit < 1) { + ?>

    + } else { + ?>
    @@ -115,8 +113,8 @@ db->getRow($rs)) { - ?> + while ($row = $modx->db->getRow($rs)) { + ?> @@ -124,14 +122,13 @@ + } ?>
    toDateFormat($row['unpub_date'] + $server_offset_time) ?>
    + } + ?>
    diff --git a/manager/actions/sysinfo.static.php b/manager/actions/sysinfo.static.php index 6ac4cab6fd..a12908da6d 100755 --- a/manager/actions/sysinfo.static.php +++ b/manager/actions/sysinfo.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('logs')) { @@ -110,20 +110,19 @@ function viewPHPInfo() $modx->db->config['table_prefix'] . 'event_log', $modx->db->config['table_prefix'] . 'manager_log', ); - if ($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) { - echo ""; - echo "" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . ""; - echo ""; - } else { - echo "" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . ""; - } + if ($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) { + echo ""; + echo "" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . ""; + echo ""; + } else { + echo "" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . ""; + } - if ($modx->hasPermission('settings')) { - echo "" . ($log_status['Data_free'] > 0 ? "" . $modx->nicesize($log_status['Data_free']) . "" : "-") . ""; - } else { - echo "" . ($log_status['Data_free'] > 0 ? $modx->nicesize($log_status['Data_free']) : "-") . ""; - } - ?> + if ($modx->hasPermission('settings')) { + echo "" . ($log_status['Data_free'] > 0 ? "" . $modx->nicesize($log_status['Data_free']) . "" : "-") . ""; + } else { + echo "" . ($log_status['Data_free'] > 0 ? $modx->nicesize($log_status['Data_free']) : "-") . ""; + } ?> nicesize($log_status['Data_length'] - $log_status['Data_free']) ?> nicesize($log_status['Index_length']) ?> nicesize($log_status['Index_length'] + $log_status['Data_length'] + $log_status['Data_free']) ?> @@ -144,9 +143,11 @@ function viewPHPInfo() - 0) { ?> + 0) { + ?>

    - + diff --git a/manager/actions/user_management.static.php b/manager/actions/user_management.static.php index 8402d14429..4e26c6b077 100755 --- a/manager/actions/user_management.static.php +++ b/manager/actions/user_management.static.php @@ -1,22 +1,22 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('edit_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('edit_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // initialize page view state - the $_PAGE object $modx->manager->initPageViewState(); // get and save search string -if($_REQUEST['op'] == 'reset') { - $query = ''; - $_PAGE['vs']['search'] = ''; +if ($_REQUEST['op'] == 'reset') { + $query = ''; + $_PAGE['vs']['search'] = ''; } else { - $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; - $sqlQuery = $modx->db->escape($query); - $_PAGE['vs']['search'] = $query; + $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; + $sqlQuery = $modx->db->escape($query); + $_PAGE['vs']['search'] = $query; } // get & save listmode @@ -120,55 +120,55 @@ function menuAction(a) {
    hasPermission('save_role')) { - $where .= (empty($where) ? "" : " AND ") . "mua.role != 1"; - } - if(!empty($sqlQuery)) { - $where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))"; - } - $ds = $modx->db->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, ELT(mua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin", $modx->getFullTableName('manager_users') . " AS mu + $where = ""; + if (!$modx->hasPermission('save_role')) { + $where .= (empty($where) ? "" : " AND ") . "mua.role != 1"; + } + if (!empty($sqlQuery)) { + $where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))"; + } + $ds = $modx->db->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, ELT(mua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin", $modx->getFullTableName('manager_users') . " AS mu INNER JOIN " . $modx->getFullTableName('user_attributes') . " AS mua ON mua.internalKey=mu.id LEFT JOIN " . $modx->getFullTableName('user_roles') . " AS rname ON mua.role=rname.id", $where, 'mua.blocked ASC, mua.thislogin DESC'); - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items - $grd->noRecordMsg = $_lang["no_records_found"]; - $grd->cssClass = "table data"; - $grd->columnHeaderClass = "tableHeader"; - $grd->itemClass = "tableItem"; - $grd->altItemClass = "tableAltItem"; - $grd->fields = "id,username,fullname,role,email,gender,blocked,thislogin"; - $grd->columns = implode(',', array( - $_lang["icon"], - $_lang["name"], - $_lang["user_full_name"], - $_lang['role'], - $_lang["email"], - $_lang["user_gender"], - $_lang["user_block"], - $_lang["login_button"] - )); - $grd->colWidths = "1%,,,,,,1%,1%"; - $grd->colAligns = "center,,,,,center,center,right' nowrap='nowrap"; - $grd->colTypes = implode('||', array( - 'template:', - 'template:[+value+]', - 'template:[+fullname+]', - 'template:[+role+]', - 'template:[+email+]', - 'template:[+gender+]', - 'template:[+blocked+]', - 'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M' - )); - if($listmode == '1') { - $grd->pageSize = 0; - } - if($_REQUEST['op'] == 'reset') { - $grd->pageNumber = 1; - } - // render grid - echo $grd->render(); - ?> + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items + $grd->noRecordMsg = $_lang["no_records_found"]; + $grd->cssClass = "table data"; + $grd->columnHeaderClass = "tableHeader"; + $grd->itemClass = "tableItem"; + $grd->altItemClass = "tableAltItem"; + $grd->fields = "id,username,fullname,role,email,gender,blocked,thislogin"; + $grd->columns = implode(',', array( + $_lang["icon"], + $_lang["name"], + $_lang["user_full_name"], + $_lang['role'], + $_lang["email"], + $_lang["user_gender"], + $_lang["user_block"], + $_lang["login_button"] + )); + $grd->colWidths = "1%,,,,,,1%,1%"; + $grd->colAligns = "center,,,,,center,center,right' nowrap='nowrap"; + $grd->colTypes = implode('||', array( + 'template:', + 'template:[+value+]', + 'template:[+fullname+]', + 'template:[+role+]', + 'template:[+email+]', + 'template:[+gender+]', + 'template:[+blocked+]', + 'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M' + )); + if ($listmode == '1') { + $grd->pageSize = 0; + } + if ($_REQUEST['op'] == 'reset') { + $grd->pageNumber = 1; + } + // render grid + echo $grd->render(); + ?>
    diff --git a/manager/actions/web_access_permissions.dynamic.php b/manager/actions/web_access_permissions.dynamic.php index 38e71fd698..4c0659b4f7 100755 --- a/manager/actions/web_access_permissions.dynamic.php +++ b/manager/actions/web_access_permissions.dynamic.php @@ -1,32 +1,32 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('web_access_permissions')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('web_access_permissions')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // find all document groups, for the select :) $rs = $modx->db->select('*', $modx->getFullTableName('documentgroup_names'), '', 'name'); -if($modx->db->getRecordCount($rs) < 1) { - $docgroupselector = "[no groups to add]"; +if ($modx->db->getRecordCount($rs) < 1) { + $docgroupselector = "[no groups to add]"; } else { - $docgroupselector = '\n"; + $docgroupselector = '\n"; } $rs = $modx->db->select('*', $modx->getFullTableName('webgroup_names'), '', 'name'); -if($modx->db->getRecordCount($rs) < 1) { - $usrgroupselector = '[no user groups]'; +if ($modx->db->getRecordCount($rs) < 1) { + $usrgroupselector = '[no user groups]'; } else { - $usrgroupselector = '\n"; + $usrgroupselector = '\n"; } ?> @@ -88,24 +88,23 @@ function deletegroup(groupid, type) {
    db->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getFullTableName('webgroup_names') . " AS groupnames + $rs = $modx->db->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getFullTableName('webgroup_names') . " AS groupnames LEFT JOIN " . $modx->getFullTableName('web_groups') . " AS groups ON groups.webgroup = groupnames.id LEFT JOIN " . $modx->getFullTableName('web_users') . " AS users ON users.id = groups.webuser", '', 'groupnames.name, user_name'); - if($modx->db->getRecordCount($rs) < 1) { - ?> + if ($modx->db->getRecordCount($rs) < 1) { + ?>
    + } else { + ?>
    db->getRow($rs)) { - if($pid != $row['id']) { - if($pid != '') { - echo '
    '; - } - ?> + $pid = ''; + while ($row = $modx->db->getRow($rs)) { + if ($pid != $row['id']) { + if ($pid != '') { + echo '
    '; + } ?>
    @@ -120,21 +119,20 @@ function deletegroup(groupid, type) {
    + } + if (!$row['user_id']) { + ?> + $pid = $row['id']; + continue; + } ?> + $pid = $row['id']; + } + } + ?>
    @@ -159,24 +157,23 @@ function deletegroup(groupid, type) { db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getFullTableName('documentgroup_names') . " AS dgnames + $rs = $modx->db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getFullTableName('documentgroup_names') . " AS dgnames LEFT JOIN " . $modx->getFullTableName('document_groups') . " AS dg ON dg.document_group = dgnames.id LEFT JOIN " . $modx->getFullTableName('site_content') . " AS sc ON sc.id = dg.document", '', 'dgnames.name, sc.id'); - if($modx->db->getRecordCount($rs) < 1) { - ?> + if ($modx->db->getRecordCount($rs) < 1) { + ?>
    + } else { + ?>
    db->getRow($rs)) { - if($pid != $row['id']) { - if($pid != '') { - echo '
    '; - } - ?> + $pid = ''; + while ($row = $modx->db->getRow($rs)) { + if ($pid != $row['id']) { + if ($pid != '') { + echo '
    '; + } ?>
    @@ -191,21 +188,20 @@ function deletegroup(groupid, type) {
    + } + if (!$row['doc_id']) { + ?> + $pid = $row['id']; + continue; + } ?> + $pid = $row['id']; + } + } + ?>
    @@ -217,15 +213,15 @@ function deletegroup(groupid, type) {

    db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getFullTableName('webgroup_names') . " AS groupnames + $rs = $modx->db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getFullTableName('webgroup_names') . " AS groupnames LEFT JOIN " . $modx->getFullTableName('webgroup_access') . " AS groupacc ON groupacc.webgroup = groupnames.id LEFT JOIN " . $modx->getFullTableName('documentgroup_names') . " AS dgnames ON dgnames.id = groupacc.documentgroup", '', 'name, dg_name'); - if($modx->db->getRecordCount($rs) < 1) { - ?> + if ($modx->db->getRecordCount($rs) < 1) { + ?>
    + } else { + ?>
    @@ -241,38 +237,35 @@ function deletegroup(groupid, type) {
      db->getRow($rs)) { - if($row['id'] != $pid) { - if($pid != '') { - echo '
    '; - } // close previous one - ?> + $pid = ''; + while ($row = $modx->db->getRow($rs)) { + if ($row['id'] != $pid) { + if ($pid != '') { + echo ''; + } // close previous one ?>
  • ' . $_lang['no_groups_found'] . ''; - $pid = ''; - continue; - } else { - echo '
      '; - } - } - if(!$row['dg_id']) { - continue; - } - ?> + if (!$row['dg_id']) { + echo '' . $_lang['no_groups_found'] . ''; + $pid = ''; + continue; + } else { + echo '
        '; + } + } + if (!$row['dg_id']) { + continue; + } ?>
      • ()
      • + $pid = $row['id']; + } ?>
      + } + ?>
    diff --git a/manager/actions/web_user_management.static.php b/manager/actions/web_user_management.static.php index 013a88a38d..9eba4565b5 100755 --- a/manager/actions/web_user_management.static.php +++ b/manager/actions/web_user_management.static.php @@ -1,22 +1,22 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('edit_web_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('edit_web_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // initialize page view state - the $_PAGE object $modx->manager->initPageViewState(); // get and save search string -if($_REQUEST['op'] == 'reset') { - $query = ''; - $_PAGE['vs']['search'] = ''; +if ($_REQUEST['op'] == 'reset') { + $query = ''; + $_PAGE['vs']['search'] = ''; } else { - $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; - $sqlQuery = $modx->db->escape($query); - $_PAGE['vs']['search'] = $query; + $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; + $sqlQuery = $modx->db->escape($query); + $_PAGE['vs']['search'] = $query; } // get & save listmode @@ -120,29 +120,29 @@ function menuAction(a) {
    db->select("wu.id, wu.username, wua.fullname, wua.email, ELT(wua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu + $ds = $modx->db->select("wu.id, wu.username, wua.fullname, wua.email, ELT(wua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu INNER JOIN " . $modx->getFullTableName("web_user_attributes") . " wua ON wua.internalKey=wu.id", ($sqlQuery ? "(wu.username LIKE '{$sqlQuery}%') OR (wua.fullname LIKE '%{$sqlQuery}%') OR (wua.email LIKE '%{$sqlQuery}%')" : ""), 'username'); - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items - $grd->noRecordMsg = $_lang["no_records_found"]; - $grd->cssClass = "table data"; - $grd->columnHeaderClass = "tableHeader"; - $grd->itemClass = "tableItem"; - $grd->altItemClass = "tableAltItem"; - $grd->fields = "id,username,fullname,email,gender,blocked"; - $grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["user_full_name"] . " ," . $_lang["email"] . " ," . $_lang["user_gender"] . " ," . $_lang["user_block"]; - $grd->colWidths = "1%,,,,1%,1%"; - $grd->colAligns = "center,,,,center,right' nowrap='nowrap"; - $grd->colTypes = "template:||template:[+value+]"; - if($listmode == '1') { - $grd->pageSize = 0; - } - if($_REQUEST['op'] == 'reset') { - $grd->pageNumber = 1; - } - // render grid - echo $grd->render(); - ?> + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items + $grd->noRecordMsg = $_lang["no_records_found"]; + $grd->cssClass = "table data"; + $grd->columnHeaderClass = "tableHeader"; + $grd->itemClass = "tableItem"; + $grd->altItemClass = "tableAltItem"; + $grd->fields = "id,username,fullname,email,gender,blocked"; + $grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["user_full_name"] . " ," . $_lang["email"] . " ," . $_lang["user_gender"] . " ," . $_lang["user_block"]; + $grd->colWidths = "1%,,,,1%,1%"; + $grd->colAligns = "center,,,,center,right' nowrap='nowrap"; + $grd->colTypes = "template:||template:[+value+]"; + if ($listmode == '1') { + $grd->pageSize = 0; + } + if ($_REQUEST['op'] == 'reset') { + $grd->pageNumber = 1; + } + // render grid + echo $grd->render(); + ?>
    diff --git a/manager/actions/welcome.static.php b/manager/actions/welcome.static.php index f36d7f58c2..4c657f8c59 100755 --- a/manager/actions/welcome.static.php +++ b/manager/actions/welcome.static.php @@ -1,13 +1,13 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly.'); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die('INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly.'); } unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes -if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) { - // seems to be a new install - send the user to the configuration page - exit(''); +if ($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) { + // seems to be a new install - send the user to the configuration page + exit(''); } // set placeholders @@ -16,93 +16,93 @@ $_SESSION['nrnewmessages'] = 0; // setup message info -if($modx->hasPermission('messages')) { - include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); - $_SESSION['nrtotalmessages'] = $nrtotalmessages; - $_SESSION['nrnewmessages'] = $nrnewmessages; - - $msg = array(); - $msg[] = sprintf('', $_style['icons_mail_large']); - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (' . $_SESSION['nrnewmessages'] . ')' : ''; - $msg[] = sprintf(' [%%inbox%%]%s
    ', $nrnewmessages); - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '' . $_SESSION['nrnewmessages'] . '' : '0'; - $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); - $msg[] = sprintf('%s', $welcome_messages); - $ph['MessageInfo'] = implode("\n", $msg); +if ($modx->hasPermission('messages')) { + include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); + $_SESSION['nrtotalmessages'] = $nrtotalmessages; + $_SESSION['nrnewmessages'] = $nrnewmessages; + + $msg = array(); + $msg[] = sprintf('', $_style['icons_mail_large']); + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (' . $_SESSION['nrnewmessages'] . ')' : ''; + $msg[] = sprintf(' [%%inbox%%]%s
    ', $nrnewmessages); + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '' . $_SESSION['nrnewmessages'] . '' : '0'; + $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); + $msg[] = sprintf('%s', $welcome_messages); + $ph['MessageInfo'] = implode("\n", $msg); } // setup icons -if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { - $icon = ' [%user_management_title%]'; - $ph['SecurityIcon'] = wrapIcon($icon, 75); +if ($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { + $icon = ' [%user_management_title%]'; + $ph['SecurityIcon'] = wrapIcon($icon, 75); } -if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { - $icon = ' [%web_user_management_title%]'; - $ph['WebUserIcon'] = wrapIcon($icon, 99); +if ($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { + $icon = ' [%web_user_management_title%]'; + $ph['WebUserIcon'] = wrapIcon($icon, 99); } -if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { - $icon = ' [%modules%]'; - $ph['ModulesIcon'] = wrapIcon($icon, 106); +if ($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { + $icon = ' [%modules%]'; + $ph['ModulesIcon'] = wrapIcon($icon, 106); } -if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) { - $icon = ' [%elements%]'; - $ph['ResourcesIcon'] = wrapIcon($icon, 76); +if ($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) { + $icon = ' [%elements%]'; + $ph['ResourcesIcon'] = wrapIcon($icon, 76); } -if($modx->hasPermission('bk_manager')) { - $icon = ' [%backup%]'; - $ph['BackupIcon'] = wrapIcon($icon, 93); +if ($modx->hasPermission('bk_manager')) { + $icon = ' [%backup%]'; + $ph['BackupIcon'] = wrapIcon($icon, 93); } -if($modx->hasPermission('help')) { - $icon = ' [%help%]'; - $ph['HelpIcon'] = wrapIcon($icon, 9); +if ($modx->hasPermission('help')) { + $icon = ' [%help%]'; + $ph['HelpIcon'] = wrapIcon($icon, 9); } -if($modx->hasPermission('new_document')) { - $icon = '[%add_resource%]'; - $ph['ResourceIcon'] = wrapIcon($icon, 4); - $icon = '[%add_weblink%]'; - $ph['WeblinkIcon'] = wrapIcon($icon, 72); +if ($modx->hasPermission('new_document')) { + $icon = '[%add_resource%]'; + $ph['ResourceIcon'] = wrapIcon($icon, 4); + $icon = '[%add_weblink%]'; + $ph['WeblinkIcon'] = wrapIcon($icon, 72); } -if($modx->hasPermission('assets_images')) { - $icon = '[%images_management%]'; - $ph['ImagesIcon'] = wrapIcon($icon, 72); +if ($modx->hasPermission('assets_images')) { + $icon = '[%images_management%]'; + $ph['ImagesIcon'] = wrapIcon($icon, 72); } -if($modx->hasPermission('assets_files')) { - $icon = '[%files_management%]'; - $ph['FilesIcon'] = wrapIcon($icon, 72); +if ($modx->hasPermission('assets_files')) { + $icon = '[%files_management%]'; + $ph['FilesIcon'] = wrapIcon($icon, 72); } -if($modx->hasPermission('change_password')) { - $icon = '[%change_password%]'; - $ph['PasswordIcon'] = wrapIcon($icon, 28); +if ($modx->hasPermission('change_password')) { + $icon = '[%change_password%]'; + $ph['PasswordIcon'] = wrapIcon($icon, 28); } $icon = '[%logout%]'; $ph['LogoutIcon'] = wrapIcon($icon, 8); // do some config checks -if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { - include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); - if($config_check_results != $_lang['configcheck_ok']) { - $ph['config_check_results'] = $config_check_results; - $ph['config_display'] = 'block'; - } else { - $ph['config_display'] = 'none'; - } +if (($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { + include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); + if ($config_check_results != $_lang['configcheck_ok']) { + $ph['config_check_results'] = $config_check_results; + $ph['config_display'] = 'block'; + } else { + $ph['config_display'] = 'none'; + } } else { - $ph['config_display'] = 'none'; + $ph['config_display'] = 'none'; } // Check logout-reminder -if(isset($_SESSION['show_logout_reminder'])) { - switch($_SESSION['show_logout_reminder']['type']) { - case 'logout_reminder': - $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); - $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']); - break; - } - $ph['show_logout_reminder'] = 'block'; - unset($_SESSION['show_logout_reminder']); +if (isset($_SESSION['show_logout_reminder'])) { + switch ($_SESSION['show_logout_reminder']['type']) { + case 'logout_reminder': + $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); + $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']); + break; + } + $ph['show_logout_reminder'] = 'block'; + unset($_SESSION['show_logout_reminder']); } else { - $ph['show_logout_reminder'] = 'none'; + $ph['show_logout_reminder'] = 'none'; } // Check multiple sessions @@ -111,13 +111,13 @@ //$count = $modx->db->getValue($rs); /* if($count > 1) { - $ph['multiple_sessions_msg'] = $modx->parseText($_lang['multiple_sessions_msg'], array( - 'username' => $_SESSION['mgrShortname'], - 'total' => $count - )); - $ph['show_multiple_sessions'] = 'block'; + $ph['multiple_sessions_msg'] = $modx->parseText($_lang['multiple_sessions_msg'], array( + 'username' => $_SESSION['mgrShortname'], + 'total' => $count + )); + $ph['show_multiple_sessions'] = 'block'; } else { - $ph['show_multiple_sessions'] = 'none'; + $ph['show_multiple_sessions'] = 'none'; }*/ $ph['show_multiple_sessions'] = 'none'; @@ -150,11 +150,11 @@ $nrnewmessages = '' . $_SESSION['nrnewmessages'] . ''; $ph['UserInfo'] = $modx->parseText($tpl, array( - 'username' => $modx->getLoginUserName(), - 'role' => $_SESSION['mgrPermissions']['name'], - 'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time), - 'logincount' => $_SESSION['mgrLogincount'] + 1, - 'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages) + 'username' => $modx->getLoginUserName(), + 'role' => $_SESSION['mgrPermissions']['name'], + 'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time), + 'logincount' => $_SESSION['mgrLogincount'] + 1, + 'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages) )); $from = array(); @@ -162,14 +162,14 @@ $from[] = " us LEFT JOIN [+prefix+]active_users au ON au.sid=us.sid WHERE au.action <> '8'"; $rs = $modx->db->select('*', $from, '', 'username ASC, au.sid ASC'); -if($modx->db->getRecordCount($rs) < 1) { - $html = '

    [%no_active_users_found%]

    '; +if ($modx->db->getRecordCount($rs) < 1) { + $html = '

    [%no_active_users_found%]

    '; } else { - include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); - $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; - $ph['now'] = strftime('%H:%M:%S', $now); - $timetocheck = ($now - (60 * 20)); //+$server_offset_time; - $html = ' + include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); + $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; + $ph['now'] = strftime('%H:%M:%S', $now); + $timetocheck = ($now - (60 * 20)); //+$server_offset_time; + $html = '
    [%onlineusers_message%] [+now+]): @@ -187,33 +187,33 @@ '; - $userList = array(); - $userCount = array(); - // Create userlist with session-count first before output - while($activeusers = $modx->db->getRow($rs)) { - $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; - - $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; - $webicon = $activeusers['internalKey'] < 0 ? 'Web user ' : ''; - $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip']; - $currentaction = getAction($activeusers['action'], $activeusers['id']); - $userList[] = array( - $idle, - '', - $activeusers['username'], - $webicon, - abs($activeusers['internalKey']), - $ip, - strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time), - $currentaction - ); - } - foreach($userList as $params) { - $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; - $html .= "\n\t\t" . vsprintf('%s%s%s%s%s%s', $params); - } - - $html .= ' + $userList = array(); + $userCount = array(); + // Create userlist with session-count first before output + while ($activeusers = $modx->db->getRow($rs)) { + $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; + + $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; + $webicon = $activeusers['internalKey'] < 0 ? 'Web user ' : ''; + $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip']; + $currentaction = getAction($activeusers['action'], $activeusers['id']); + $userList[] = array( + $idle, + '', + $activeusers['username'], + $webicon, + abs($activeusers['internalKey']), + $ip, + strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time), + $currentaction + ); + } + foreach ($userList as $params) { + $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; + $html .= "\n\t\t" . vsprintf('%s%s%s%s%s%s', $params); + } + + $html .= '
    @@ -253,18 +253,18 @@ // invoke event OnManagerWelcomePrerender $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender'); -if(is_array($evtOut)) { - $output = implode('', $evtOut); - $ph['OnManagerWelcomePrerender'] = $output; +if (is_array($evtOut)) { + $output = implode('', $evtOut); + $ph['OnManagerWelcomePrerender'] = $output; } $widgets['welcome'] = array( - 'menuindex' => '10', - 'id' => 'welcome', - 'cols' => 'col-lg-6', - 'icon' => 'fa-home', - 'title' => '[%welcome_title%]', - 'body' => ' + 'menuindex' => '10', + 'id' => 'welcome', + 'cols' => 'col-lg-6', + 'icon' => 'fa-home', + 'title' => '[%welcome_title%]', + 'body' => '
    @@ -338,25 +338,25 @@
    ', - 'hide'=>'0' + 'hide'=>'0' ); $widgets['onlineinfo'] = array( - 'menuindex' => '20', - 'id' => 'onlineinfo', - 'cols' => 'col-lg-6', - 'icon' => 'fa-user', - 'title' => '[%onlineusers_title%]', - 'body' => '
    [+OnlineInfo+]
    ', - 'hide'=>'0' + 'menuindex' => '20', + 'id' => 'onlineinfo', + 'cols' => 'col-lg-6', + 'icon' => 'fa-user', + 'title' => '[%onlineusers_title%]', + 'body' => '
    [+OnlineInfo+]
    ', + 'hide'=>'0' ); $widgets['recentinfo'] = array( - 'menuindex' => '30', - 'id' => 'modxrecent_widget', - 'cols' => 'col-sm-12', - 'icon' => 'fa-pencil-square-o', - 'title' => '[%activity_title%]', - 'body' => '
    [+RecentInfo+]
    ', - 'hide'=>'0' + 'menuindex' => '30', + 'id' => 'modxrecent_widget', + 'cols' => 'col-sm-12', + 'icon' => 'fa-pencil-square-o', + 'title' => '[%activity_title%]', + 'body' => '
    [+RecentInfo+]
    ', + 'hide'=>'0' ); if ($modx->config['rss_url_news']) { $widgets['news'] = array( @@ -383,75 +383,75 @@ // invoke OnManagerWelcomeHome event $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets)); -if(is_array($sitewidgets)) { - $newwidgets = array(); - foreach($sitewidgets as $widget){ +if (is_array($sitewidgets)) { + $newwidgets = array(); + foreach ($sitewidgets as $widget) { $newwidgets = array_merge($newwidgets, unserialize($widget)); } $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets; } usort($widgets, function ($a, $b) { - return $a['menuindex'] - $b['menuindex']; + return $a['menuindex'] - $b['menuindex']; }); $tpl = getTplWidget(); $output = ''; -foreach($widgets as $widget) { - if ($widget['hide'] != '1'){ - $output .= $modx->parseText($tpl, $widget); - } +foreach ($widgets as $widget) { + if ($widget['hide'] != '1') { + $output .= $modx->parseText($tpl, $widget); + } } $ph['widgets'] = $output; // load template -if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { - $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; +if (!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { + $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; } $target = $modx->config['manager_welcome_tpl']; $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target); $target = $modx->mergeSettingsContent($target); -if(substr($target, 0, 1) === '@') { - if(substr($target, 0, 6) === '@CHUNK') { - $content = $modx->getChunk(trim(substr($target, 7))); - } elseif(substr($target, 0, 5) === '@FILE') { - $content = file_get_contents(trim(substr($target, 6))); - } else { - $content = ''; - } +if (substr($target, 0, 1) === '@') { + if (substr($target, 0, 6) === '@CHUNK') { + $content = $modx->getChunk(trim(substr($target, 7))); + } elseif (substr($target, 0, 5) === '@FILE') { + $content = file_get_contents(trim(substr($target, 6))); + } else { + $content = ''; + } } else { - $chunk = $modx->getChunk($target); - if($chunk !== false && !empty($chunk)) { - $content = $chunk; - } elseif(is_file(MODX_BASE_PATH . $target)) { - $content = file_get_contents(MODX_BASE_PATH . $target); - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible - { - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); - } else { - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); - } + $chunk = $modx->getChunk($target); + if ($chunk !== false && !empty($chunk)) { + $content = $chunk; + } elseif (is_file(MODX_BASE_PATH . $target)) { + $content = file_get_contents(MODX_BASE_PATH . $target); + } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); + } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) { // ClipperCMS compatible + + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); + } else { + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); + } } // merge placeholders $content = $modx->mergeConditionalTagsContent($content); $content = $modx->mergeSettingsContent($content); $content = $modx->parseText($content, $ph); -if(strpos($content, '[+') !== false) { - $modx->toPlaceholders($ph); - $content = $modx->mergePlaceholderContent($content); +if (strpos($content, '[+') !== false) { + $modx->toPlaceholders($ph); + $content = $modx->mergePlaceholderContent($content); } $content = $modx->parseDocumentSource($content); $content = $modx->parseText($content, $_lang, '[%', '%]'); $content = $modx->parseText($content, $_style, '[&', '&]'); $content = $modx->cleanUpMODXTags($content); //cleanup -if($js = $modx->getRegisteredClientScripts()) { - $content .= $js; +if ($js = $modx->getRegisteredClientScripts()) { + $content .= $js; } echo $content; @@ -460,8 +460,9 @@ // // // -function getTplWidget() { // recent document info - return ' +function getTplWidget() +{ // recent document info + return '
    [+title+]
    @@ -471,12 +472,13 @@ function getTplWidget() { // recent document info '; } -function getRecentInfo() { // recent document info - $modx = evolutionCMS(); +function getRecentInfo() +{ // recent document info + $modx = evolutionCMS(); - $modx->addSnippet('recentInfoList', 'getRecentInfoList'); + $modx->addSnippet('recentInfoList', 'getRecentInfoList'); - $html = ' + $html = '
    @@ -494,96 +496,98 @@ function getRecentInfo() { // recent document info
    '; - return $html; + return $html; } -function getRecentInfoList() { - $modx = evolutionCMS(); - - $rs = $modx->db->select('*', '[+prefix+]site_content', '', 'editedon DESC', 10); - - if($modx->db->getRecordCount($rs) < 1) { - return '[%no_activity_message%]'; - } - - $tpl = getRecentInfoRowTpl(); - - $btntpl['edit'] = ' '; - $btntpl['preview_btn'] = ' '; - - $output = array(); - while($ph = $modx->db->getRow($rs)) { - $docid = $ph['id']; - $_ = $modx->getUserInfo($ph['editedby']); - $ph['username'] = $_['username']; - - if($ph['deleted'] == 1) { - $ph['status'] = 'deleted text-danger'; - } elseif($ph['published'] == 0) { - $ph['status'] = 'unpublished font-italic text-muted'; - } else { - $ph['status'] = 'published'; - } - - if($modx->hasPermission('edit_document')) { - $ph['edit_btn'] = str_replace('[+id+]', $docid, $btntpl['edit']); - } else { - $ph['edit_btn'] = ''; - } - - $preview_disabled = ($ph['deleted'] == 1) ? 'disabled' : ''; - $ph['preview_btn'] = str_replace(array( - '[+id+]', - '[+preview_disabled+]' - ), array( - $docid, - $preview_disabled - ), $btntpl['preview_btn']); - - if($modx->hasPermission('delete_document')) { - if($ph['deleted'] == 0) { - $delete_btn = ' '; - } else { - $delete_btn = ' '; - } - $ph['delete_btn'] = str_replace('[+id+]', $docid, $delete_btn); - } else { - $ph['delete_btn'] = ''; - } - - if($ph['deleted'] == 1 && $ph['published'] == 0) { - $publish_btn = ' '; - } elseif($ph['deleted'] == 1 && $ph['published'] == 1) { - $publish_btn = ' '; - } elseif($ph['deleted'] == 0 && $ph['published'] == 0) { - $publish_btn = ' '; - } else { - $publish_btn = ' '; - } - $ph['publish_btn'] = str_replace('[+id+]', $docid, $publish_btn); - - $ph['info_btn'] = str_replace('[+id+]', $docid, ''); - - if($ph['longtitle'] == '') { - $ph['longtitle'] = '([%not_set%])'; - } - if($ph['description'] == '') { - $ph['description'] = '([%not_set%])'; - } - if($ph['introtext'] == '') { - $ph['introtext'] = '([%not_set%])'; - } - if($ph['alias'] == '') { - $ph['alias'] = '([%not_set%])'; - } - - $output[] = $modx->parseText($tpl, $ph); - } - return implode("\n", $output); +function getRecentInfoList() +{ + $modx = evolutionCMS(); + + $rs = $modx->db->select('*', '[+prefix+]site_content', '', 'editedon DESC', 10); + + if ($modx->db->getRecordCount($rs) < 1) { + return '[%no_activity_message%]'; + } + + $tpl = getRecentInfoRowTpl(); + + $btntpl['edit'] = ' '; + $btntpl['preview_btn'] = ' '; + + $output = array(); + while ($ph = $modx->db->getRow($rs)) { + $docid = $ph['id']; + $_ = $modx->getUserInfo($ph['editedby']); + $ph['username'] = $_['username']; + + if ($ph['deleted'] == 1) { + $ph['status'] = 'deleted text-danger'; + } elseif ($ph['published'] == 0) { + $ph['status'] = 'unpublished font-italic text-muted'; + } else { + $ph['status'] = 'published'; + } + + if ($modx->hasPermission('edit_document')) { + $ph['edit_btn'] = str_replace('[+id+]', $docid, $btntpl['edit']); + } else { + $ph['edit_btn'] = ''; + } + + $preview_disabled = ($ph['deleted'] == 1) ? 'disabled' : ''; + $ph['preview_btn'] = str_replace(array( + '[+id+]', + '[+preview_disabled+]' + ), array( + $docid, + $preview_disabled + ), $btntpl['preview_btn']); + + if ($modx->hasPermission('delete_document')) { + if ($ph['deleted'] == 0) { + $delete_btn = ' '; + } else { + $delete_btn = ' '; + } + $ph['delete_btn'] = str_replace('[+id+]', $docid, $delete_btn); + } else { + $ph['delete_btn'] = ''; + } + + if ($ph['deleted'] == 1 && $ph['published'] == 0) { + $publish_btn = ' '; + } elseif ($ph['deleted'] == 1 && $ph['published'] == 1) { + $publish_btn = ' '; + } elseif ($ph['deleted'] == 0 && $ph['published'] == 0) { + $publish_btn = ' '; + } else { + $publish_btn = ' '; + } + $ph['publish_btn'] = str_replace('[+id+]', $docid, $publish_btn); + + $ph['info_btn'] = str_replace('[+id+]', $docid, ''); + + if ($ph['longtitle'] == '') { + $ph['longtitle'] = '([%not_set%])'; + } + if ($ph['description'] == '') { + $ph['description'] = '([%not_set%])'; + } + if ($ph['introtext'] == '') { + $ph['introtext'] = '([%not_set%])'; + } + if ($ph['alias'] == '') { + $ph['alias'] = '([%not_set%])'; + } + + $output[] = $modx->parseText($tpl, $ph); + } + return implode("\n", $output); } -function getRecentInfoRowTpl() { - $tpl = ' +function getRecentInfoRowTpl() +{ + $tpl = ' [+id+] [+pagetitle+] @@ -607,16 +611,18 @@ function getRecentInfoRowTpl() {
    '; - return $tpl; + return $tpl; } // setup icons -function wrapIcon($i, $action) { - return sprintf('%s', $action, $i); +function wrapIcon($i, $action) +{ + return sprintf('%s', $action, $i); } -function getStartUpScript() { - $script = ' +function getStartUpScript() +{ + $script = ' '; - return $script; + return $script; } diff --git a/manager/frames/1.php b/manager/frames/1.php index a34aa16e55..5a6015b09e 100755 --- a/manager/frames/1.php +++ b/manager/frames/1.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } header("X-XSS-Protection: 0"); @@ -119,10 +119,12 @@ - config['show_picker'] != "0") { ?> + config['show_picker'] != "0") { + ?> - + + $mtime = microtime(); + $mtime = explode(" ", $mtime); + $mtime = $mtime[1] + $mtime[0]; + $tend = $mtime; + $totaltime = ($tend - $tstart); ?>
    @@ -44,7 +47,7 @@ function removeDebugDiv() { - +
    Time taken
    diff --git a/manager/includes/default_config.php b/manager/includes/default_config.php index e002f11942..72b9fabc18 100755 --- a/manager/includes/default_config.php +++ b/manager/includes/default_config.php @@ -111,6 +111,3 @@ $c['login_form_position'] = 'left'; $c['manager_menu_position'] = 'top'; $c['tinymce4_skin'] = 'lightgray'; - - - diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index 20f88fa6c4..3b69061896 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -11,6 +11,8 @@ define('E_USER_DEPRECATED', 16384); } +require_once 'SystemEvent.class.php'; + class DocumentParser { /** @@ -223,7 +225,7 @@ public static function getInstance() * @param $arguments * @return mixed */ - function __call($method_name, $arguments) + public function __call($method_name, $arguments) { include_once(MODX_MANAGER_PATH . 'includes/extenders/deprecated.functions.inc.php'); if (method_exists($this->old, $method_name)) { @@ -308,7 +310,7 @@ public function loadExtension($extname, $reload = true) */ public function getMicroTime() { - list ($usec, $sec) = explode(' ', microtime()); + list($usec, $sec) = explode(' ', microtime()); return ((float)$usec + (float)$sec); } @@ -326,12 +328,12 @@ public function getMicroTime() public function sendRedirect($url, $count_attempts = 0, $type = '', $responseCode = '') { $header = ''; - if (empty ($url)) { + if (empty($url)) { return false; } if ($count_attempts == 1) { // append the redirect count string to the url - $currentNumberOfRedirects = isset ($_REQUEST['err']) ? $_REQUEST['err'] : 0; + $currentNumberOfRedirects = isset($_REQUEST['err']) ? $_REQUEST['err'] : 0; if ($currentNumberOfRedirects > 3) { $this->messageQuit('Redirection attempt failed - please ensure the document you\'re trying to redirect to exists.

    Redirection URL: ' . $url . '

    '); } else { @@ -349,7 +351,7 @@ public function sendRedirect($url, $count_attempts = 0, $type = '', $responseCod $header = ''; echo $header; exit; - } elseif ($type == 'REDIRECT_HEADER' || empty ($type)) { + } elseif ($type == 'REDIRECT_HEADER' || empty($type)) { // check if url has /$base_url global $base_url, $site_url; if (substr($url, 0, strlen($base_url)) == $base_url) { @@ -366,7 +368,7 @@ public function sendRedirect($url, $count_attempts = 0, $type = '', $responseCod header($responseCode); } - if(!empty($header)) { + if (!empty($header)) { header($header); } @@ -524,7 +526,7 @@ public function getUserSettings() $usrSettings = array(); if ($id = $this->getLoginUserID()) { $usrType = $this->getLoginUserType(); - if (isset ($usrType) && $usrType == 'manager') { + if (isset($usrType) && $usrType == 'manager') { $usrType = 'mgr'; } @@ -533,7 +535,7 @@ public function getUserSettings() $this->invokeEvent("OnBeforeManagerPageInit"); } - if (isset ($_SESSION[$usrType . 'UsrConfigSet'])) { + if (isset($_SESSION[$usrType . 'UsrConfigSet'])) { $usrSettings = &$_SESSION[$usrType . 'UsrConfigSet']; } else { if ($usrType == 'web') { @@ -553,14 +555,14 @@ public function getUserSettings() } $usrSettings[$row['setting_name']] = $row['setting_value']; } - if (isset ($usrType)) { + if (isset($usrType)) { $_SESSION[$usrType . 'UsrConfigSet'] = $usrSettings; } // store user settings in session } } if ($this->isFrontend() && $mgrid = $this->getLoginUserID('mgr')) { $musrSettings = array(); - if (isset ($_SESSION['mgrUsrConfigSet'])) { + if (isset($_SESSION['mgrUsrConfigSet'])) { $musrSettings = &$_SESSION['mgrUsrConfigSet']; } else { if ($result = $this->db->select('setting_name, setting_value', $tbl_user_settings, "user='{$mgrid}'")) { @@ -570,7 +572,7 @@ public function getUserSettings() $_SESSION['mgrUsrConfigSet'] = $musrSettings; // store user settings in session } } - if (!empty ($musrSettings)) { + if (!empty($musrSettings)) { $usrSettings = array_merge($musrSettings, $usrSettings); } } @@ -654,7 +656,7 @@ public function checkSession() public function checkPreview() { if ($this->isLoggedIn() == true) { - if (isset ($_REQUEST['z']) && $_REQUEST['z'] == 'manprev') { + if (isset($_REQUEST['z']) && $_REQUEST['z'] == 'manprev') { return true; } else { return false; @@ -765,22 +767,23 @@ public function getHashFile($key) * @param $id * @return array|mixed|null|string */ - public function makePageCacheKey($id){ + public function makePageCacheKey($id) + { $hash = $id; $tmp = null; $params = array(); - if(!empty($this->systemCacheKey)){ + if (!empty($this->systemCacheKey)) { $hash = $this->systemCacheKey; - }else { + } else { if (!empty($_GET)) { // Sort GET parameters so that the order of parameters on the HTTP request don't affect the generated cache ID. $params = $_GET; ksort($params); - $hash .= '_'.md5(http_build_query($params)); + $hash .= '_' . md5(http_build_query($params)); } } - $evtOut = $this->invokeEvent("OnMakePageCacheKey", array ("hash" => $hash, "id" => $id, 'params' => $params)); - if (is_array($evtOut) && count($evtOut) > 0){ + $evtOut = $this->invokeEvent("OnMakePageCacheKey", array("hash" => $hash, "id" => $id, 'params' => $params)); + if (is_array($evtOut) && count($evtOut) > 0) { $tmp = array_pop($evtOut); } return empty($tmp) ? $hash : $tmp; @@ -827,7 +830,7 @@ public function getDocumentObjectFromCache($id, $loading = false) else { $docObj = unserialize($a[0]); // rebuild document object // check page security - if ($docObj['privateweb'] && isset ($docObj['__MODxDocGroups__'])) { + if ($docObj['privateweb'] && isset($docObj['__MODxDocGroups__'])) { $pass = false; $usrGrps = $this->getUserDocGroups(); $docGrps = explode(',', $docObj['__MODxDocGroups__']); @@ -937,7 +940,7 @@ public function outputContent($noEvent = false) // send out content-type and content-disposition headers if (IN_PARSER_MODE == "true") { - $type = !empty ($this->contentTypes[$this->documentIdentifier]) ? $this->contentTypes[$this->documentIdentifier] : "text/html"; + $type = !empty($this->contentTypes[$this->documentIdentifier]) ? $this->contentTypes[$this->documentIdentifier] : "text/html"; header('Content-Type: ' . $type . '; charset=' . $this->config['modx_charset']); // if (($this->documentIdentifier == $this->config['error_page']) || $redirect_error) // header('HTTP/1.0 404 Not Found'); @@ -1060,7 +1063,7 @@ public function getTimerStats($tstart) $stats['totalTime'] = sprintf("%2.4f s", $stats['totalTime']); $stats['phpTime'] = sprintf("%2.4f s", $stats['phpTime']); $stats['source'] = $this->documentGenerated == 1 ? "database" : "cache"; - $stats['queries'] = isset ($this->executedQueries) ? $this->executedQueries : 0; + $stats['queries'] = isset($this->executedQueries) ? $this->executedQueries : 0; $stats['phpMemory'] = (memory_get_peak_usage(true) / 1024 / 1024) . " mb"; return $stats; @@ -1105,7 +1108,7 @@ public function updatePubStatus() // now, check for documents that need publishing $field = array('published' => 1, 'publishedon' => $timeNow); $where = "pub_date <= {$timeNow} AND pub_date!=0 AND published=0"; - $result_pub = $this->db->select( 'id', '[+prefix+]site_content', $where); + $result_pub = $this->db->select('id', '[+prefix+]site_content', $where); $this->db->update($field, '[+prefix+]site_content', $where); if ($this->db->getRecordCount($result_pub) >= 1) { //Event unPublished doc while ($row_pub = $this->db->getRow($result_pub)) { @@ -1118,7 +1121,7 @@ public function updatePubStatus() // now, check for documents that need un-publishing $field = array('published' => 0, 'publishedon' => 0); $where = "unpub_date <= {$timeNow} AND unpub_date!=0 AND published=1"; - $result_unpub = $this->db->select( 'id', '[+prefix+]site_content', $where); + $result_unpub = $this->db->select('id', '[+prefix+]site_content', $where); $this->db->update($field, '[+prefix+]site_content', $where); if ($this->db->getRecordCount($result_unpub) >= 1) { //Event unPublished doc while ($row_unpub = $this->db->getRow($result_unpub)) { @@ -1207,10 +1210,18 @@ public function _getTagsFromContent($content, $left = '[+', $right = '+]') return array(); } $spacer = md5('<<>>'); - if($left==='{{' && strpos($content,';}}')!==false) $content = str_replace(';}}', sprintf(';}%s}', $spacer),$content); - if($left==='{{' && strpos($content,'{{}}')!==false) $content = str_replace('{{}}',sprintf('{%$1s{}%$1s}',$spacer),$content); - if($left==='[[' && strpos($content,']]]]')!==false) $content = str_replace(']]]]',sprintf(']]%s]]', $spacer),$content); - if($left==='[[' && strpos($content,']]]')!==false) $content = str_replace(']]]', sprintf(']%s]]', $spacer),$content); + if ($left==='{{' && strpos($content, ';}}')!==false) { + $content = str_replace(';}}', sprintf(';}%s}', $spacer), $content); + } + if ($left==='{{' && strpos($content, '{{}}')!==false) { + $content = str_replace('{{}}', sprintf('{%$1s{}%$1s}', $spacer), $content); + } + if ($left==='[[' && strpos($content, ']]]]')!==false) { + $content = str_replace(']]]]', sprintf(']]%s]]', $spacer), $content); + } + if ($left==='[[' && strpos($content, ']]]')!==false) { + $content = str_replace(']]]', sprintf(']%s]]', $spacer), $content); + } $pos[''] = strpos($content, ']]>'); @@ -1280,8 +1291,10 @@ public function _getTagsFromContent($content, $left = '[+', $right = '+]') } } } - foreach($tags as $i=>$tag) { - if(strpos($tag,$spacer)!==false) $tags[$i] = str_replace($spacer, '', $tag); + foreach ($tags as $i=>$tag) { + if (strpos($tag, $spacer)!==false) { + $tags[$i] = str_replace($spacer, '', $tag); + } } return $tags; } @@ -1321,7 +1334,9 @@ public function mergeDocumentContent($content, $ph = false) } foreach ($matches[1] as $i => $key) { - if(strpos($key,'[+')!==false) continue; // Allow chunk {{chunk?¶m=`xxx`}} with [*tv_name_[+param+]*] as content + if (strpos($key, '[+')!==false) { + continue; + } // Allow chunk {{chunk?¶m=`xxx`}} with [*tv_name_[+param+]*] as content if (substr($key, 0, 1) == '#') { $key = substr($key, 1); } // remove # for QuickEdit format @@ -1353,7 +1368,7 @@ public function mergeDocumentContent($content, $ph = false) if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif($this->debug) { + } elseif ($this->debug) { $this->addLog('mergeDocumentContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -1521,7 +1536,7 @@ public function mergeSettingsContent($content, $ph = false) $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif($this->debug) { + } elseif ($this->debug) { $this->addLog('mergeSettingsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -1590,7 +1605,7 @@ public function mergeChunkContent($content, $ph = false) $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif($this->debug) { + } elseif ($this->debug) { $this->addLog('mergeChunkContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -1606,7 +1621,6 @@ public function mergeChunkContent($content, $ph = false) */ public function mergePlaceholderContent($content, $ph = false) { - if ($this->config['enable_at_syntax']) { if (stripos($content, '<@LITERAL>') !== false) { $content = $this->escapeLiteralTagsContent($content); @@ -1631,7 +1645,6 @@ public function mergePlaceholderContent($content, $ph = false) return $content; } foreach ($matches[1] as $i => $key) { - list($key, $modifiers) = $this->splitKeyAndFilter($key); if (isset($ph[$key])) { @@ -1649,7 +1662,7 @@ public function mergePlaceholderContent($content, $ph = false) $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif($this->debug) { + } elseif ($this->debug) { $this->addLog('mergePlaceholderContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -1818,7 +1831,7 @@ private function _parseCTagCMD($cmd) * @param string $right * @return mixed */ - function ignoreCommentedTagsContent($content, $left = '') + public function ignoreCommentedTagsContent($content, $left = '') { if (strpos($content, $left) === false) { return $content; @@ -1860,7 +1873,7 @@ public function escapeLiteralTagsContent($content, $left = '<@LITERAL>', $right $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $v, $content); - } elseif($this->debug) { + } elseif ($this->debug) { $this->addLog('ignoreCommentedTagsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -2017,7 +2030,7 @@ public function evalSnippets($content) } if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif($this->debug) { + } elseif ($this->debug) { $this->addLog('evalSnippetsSGVar parse error', $_SERVER['REQUEST_URI'] . $s, 2); } continue; @@ -2029,7 +2042,7 @@ public function evalSnippets($content) if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif($this->debug) { + } elseif ($this->debug) { $this->addLog('evalSnippets parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -2497,7 +2510,6 @@ public function rewriteUrls($documentSource) } return $out; }, $documentSource); - } else { $in = '!\[\~([0-9]+)\~\]!is'; $out = "index.php?id=" . '\1'; @@ -2582,7 +2594,6 @@ public function sendStrictURI() */ public function getDocumentObject($method, $identifier, $isPrepareResponse = false) { - $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { return $this->tmpCache[__FUNCTION__][$cacheKey]; @@ -2685,8 +2696,8 @@ public function getDocumentObject($method, $identifier, $isPrepareResponse = fal public function parseDocumentSource($source) { // set the number of times we are to parse the document source - $this->minParserPasses = empty ($this->minParserPasses) ? 2 : $this->minParserPasses; - $this->maxParserPasses = empty ($this->maxParserPasses) ? 10 : $this->maxParserPasses; + $this->minParserPasses = empty($this->minParserPasses) ? 2 : $this->minParserPasses; + $this->maxParserPasses = empty($this->maxParserPasses) ? 10 : $this->maxParserPasses; $passes = $this->minParserPasses; for ($i = 0; $i < $passes; $i++) { // get source length if this is the final pass @@ -2736,7 +2747,7 @@ public function parseDocumentSource($source) */ public function executeParser() { - if(MODX_CLI) { + if (MODX_CLI) { throw new RuntimeException('Call DocumentParser::executeParser on CLI mode'); } @@ -2748,7 +2759,7 @@ public function executeParser() $this->db->connect(); // get the settings - if (empty ($this->config)) { + if (empty($this->config)) { $this->getSettings(); } @@ -2890,11 +2901,11 @@ public function _IIS_furl_fix() } $k = array_keys($_GET); - unset ($_GET[$k[0]]); - unset ($_REQUEST[$k[0]]); // remove 404,405 entry + unset($_GET[$k[0]]); + unset($_REQUEST[$k[0]]); // remove 404,405 entry $qp = parse_url(str_replace($this->config['site_url'], '', substr($url, 4))); $_SERVER['QUERY_STRING'] = $qp['query']; - if (!empty ($qp['query'])) { + if (!empty($qp['query'])) { parse_str($qp['query'], $qv); foreach ($qv as $n => $v) { $_REQUEST[$n] = $_GET[$n] = $v; @@ -3091,14 +3102,12 @@ public function getUltimateParentId($id, $top = 0) */ public function getChildIds($id, $depth = 10, $children = array()) { - $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { return $this->tmpCache[__FUNCTION__][$cacheKey]; } if ($this->config['aliaslistingfolder'] == 1) { - $res = $this->db->select("id,alias,isfolder,parent", $this->getFullTableName('site_content'), "parent IN (" . $id . ") AND deleted = '0'"); $idx = array(); while ($row = $this->db->getRow($res)) { @@ -3121,7 +3130,6 @@ public function getChildIds($id, $depth = 10, $children = array()) } $this->tmpCache[__FUNCTION__][$cacheKey] = $children; return $children; - } else { // Initialise a static array to index parents->children @@ -3152,7 +3160,6 @@ public function getChildIds($id, $depth = 10, $children = array()) } $this->tmpCache[__FUNCTION__][$cacheKey] = $children; return $children; - } } @@ -3323,7 +3330,6 @@ public function cleanupExpiredLocks() } else { $this->db->delete($this->getFullTableName('active_user_locks')); } - } /** @@ -3359,13 +3365,11 @@ public function cleanupMultipleActiveUsers() $deleteSids .= $deleteSids == '' ? '' : ' OR '; $deleteSids .= "sid='{$row['sid']}'"; }; - } if ($deleteSids) { $this->db->delete($this->getFullTableName('active_users'), $deleteSids); } } - } /** @@ -3666,7 +3670,6 @@ public function isFrontend() */ public function getAllChildren($id = 0, $sort = 'menuindex', $dir = 'ASC', $fields = 'id, pagetitle, description, parent, alias, menutitle') { - $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { return $this->tmpCache[__FUNCTION__][$cacheKey]; @@ -3748,7 +3751,6 @@ public function getActiveChildren($id = 0, $sort = 'menuindex', $dir = 'ASC', $f */ public function getDocumentChildren($parentid = 0, $published = 1, $deleted = 0, $fields = '*', $where = '', $sort = 'menuindex', $dir = 'ASC', $limit = '') { - $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { return $this->tmpCache[__FUNCTION__][$cacheKey]; @@ -3805,7 +3807,6 @@ public function getDocumentChildren($parentid = 0, $published = 1, $deleted = 0, */ public function getDocuments($ids = array(), $published = 1, $deleted = 0, $fields = '*', $where = '', $sort = 'menuindex', $dir = 'ASC', $limit = '') { - $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { return $this->tmpCache[__FUNCTION__][$cacheKey]; @@ -3935,7 +3936,6 @@ public function getField($field = 'content', $docid = '') */ public function getPageInfo($pageid = -1, $active = 1, $fields = 'id, pagetitle, description, alias') { - $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { return $this->tmpCache[__FUNCTION__][$cacheKey]; @@ -3980,7 +3980,7 @@ public function getParent($pid = -1, $active = 1, $fields = 'id, pagetitle, desc if ($pid == -1) { $pid = $this->documentObject['parent']; return ($pid == 0) ? false : $this->getPageInfo($pid, $active, $fields); - } else if ($pid == 0) { + } elseif ($pid == 0) { return false; } else { // first get the child document @@ -4109,7 +4109,6 @@ public function makeUrl($id, $alias = '', $args = '', $scheme = '') $alPath = ''; if ($this->config['friendly_alias_urls'] == 1) { - if ($this->config['aliaslistingfolder'] == 1) { $al = $this->getAliasListing($id); } else { @@ -4120,12 +4119,11 @@ public function makeUrl($id, $alias = '', $args = '', $scheme = '') $f_url_suffix = '/'; } - $alPath = !empty ($al['path']) ? $al['path'] . '/' : ''; + $alPath = !empty($al['path']) ? $al['path'] . '/' : ''; if ($al && $al['alias']) { $alias = $al['alias']; } - } $alias = $alPath . $f_url_prefix . $alias . $f_url_suffix; @@ -4218,7 +4216,7 @@ public function getAliasListing($id) */ public function getConfig($name = '') { - if (!empty ($this->config[$name])) { + if (!empty($this->config[$name])) { return $this->config[$name]; } else { return false; @@ -4257,7 +4255,7 @@ public function getVersionData($data = null) */ public function runSnippet($snippetName, $params = array()) { - if (isset ($this->snippetCache[$snippetName])) { + if (isset($this->snippetCache[$snippetName])) { $snippet = $this->snippetCache[$snippetName]; $properties = !empty($this->snippetCache[$snippetName . "Props"]) ? $this->snippetCache[$snippetName . "Props"] : ''; } else { // not in cache so let's check the db @@ -4293,9 +4291,9 @@ public function getChunk($chunkName) if (empty($chunkName)) { return $out; } - if (isset ($this->chunkCache[$chunkName])) { + if (isset($this->chunkCache[$chunkName])) { $out = $this->chunkCache[$chunkName]; - } else if (stripos($chunkName, '@FILE') === 0) { + } elseif (stripos($chunkName, '@FILE') === 0) { $out = $this->chunkCache[$chunkName] = $this->atBindFileContent($chunkName); } else { $where = sprintf("`name`='%s' AND disabled=0", $this->db->escape($chunkName)); @@ -4347,7 +4345,6 @@ public function parseText($tpl = '', $ph = array(), $left = '[+', $right = '+]', } foreach ($matches[1] as $i => $key) { - if (strpos($key, ':') !== false && $execModifier) { list($key, $modifiers) = $this->splitKeyAndFilter($key); } else { @@ -4370,7 +4367,7 @@ public function parseText($tpl = '', $ph = array(), $left = '[+', $right = '+]', } if (strpos($tpl, $s) !== false) { $tpl = str_replace($s, $value, $tpl); - } elseif($this->debug) { + } elseif ($this->debug) { $this->addLog('parseText parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -4500,19 +4497,19 @@ public function toTimeStamp($str) if (!preg_match('/^[0-9]{4}\/[0-9]{2}\/[0-9]{2}[0-9 :]*$/', $str)) { return ''; } - list ($Y, $m, $d, $H, $M, $S) = sscanf($str, '%4d/%2d/%2d %2d:%2d:%2d'); + list($Y, $m, $d, $H, $M, $S) = sscanf($str, '%4d/%2d/%2d %2d:%2d:%2d'); break; case 'dd-mm-YYYY': if (!preg_match('/^[0-9]{2}-[0-9]{2}-[0-9]{4}[0-9 :]*$/', $str)) { return ''; } - list ($d, $m, $Y, $H, $M, $S) = sscanf($str, '%2d-%2d-%4d %2d:%2d:%2d'); + list($d, $m, $Y, $H, $M, $S) = sscanf($str, '%2d-%2d-%4d %2d:%2d:%2d'); break; case 'mm/dd/YYYY': if (!preg_match('/^[0-9]{2}\/[0-9]{2}\/[0-9]{4}[0-9 :]*$/', $str)) { return ''; } - list ($m, $d, $Y, $H, $M, $S) = sscanf($str, '%2d/%2d/%4d %2d:%2d:%2d'); + list($m, $d, $Y, $H, $M, $S) = sscanf($str, '%2d/%2d/%4d %2d:%2d:%2d'); break; /* case 'dd-mmm-YYYY': @@ -4589,7 +4586,6 @@ public function getDocumentChildrenTVars($parentid = 0, $tvidnames = array(), $p $this->getUserDocGroups(); foreach ($docs as $doc) { - $docid = $doc['id']; $rs = $this->db->select("{$fields}, IF(tvc.value!='',tvc.value,tv.default_text) as value ", "[+prefix+]site_tmplvars tv @@ -4652,7 +4648,7 @@ public function getDocumentChildrenTVarOutput($parentid = 0, $tvidnames = array( $tvidnames[] = $resultKey; $unsetResultKey = true; } - } else if ($tvidnames != '*' && $tvidnames != $resultKey) { + } elseif ($tvidnames != '*' && $tvidnames != $resultKey) { $tvidnames = array($tvidnames, $resultKey); $unsetResultKey = true; } @@ -4727,7 +4723,7 @@ public function getTemplateVars($idnames = array(), $fields = '*', $docid = '', return $this->tmpCache[__FUNCTION__][$cacheKey]; } - if (($idnames != '*' && !is_array($idnames)) || empty($idnames) ) { + if (($idnames != '*' && !is_array($idnames)) || empty($idnames)) { return false; } else { @@ -4761,7 +4757,7 @@ public function getTemplateVars($idnames = array(), $fields = '*', $docid = '', $result = $this->db->makeArray($rs); // get default/built-in template variables - if(is_array($docRow)){ + if (is_array($docRow)) { ksort($docRow); foreach ($docRow as $key => $value) { @@ -4799,7 +4795,7 @@ public function getTemplateVars($idnames = array(), $fields = '*', $docid = '', */ public function getTemplateVarOutput($idnames = array(), $docid = '', $published = 1, $sep = '') { - if (is_array($idnames) && empty($idnames) ) { + if (is_array($idnames) && empty($idnames)) { return false; } else { $output = array(); @@ -4975,11 +4971,11 @@ public function getLoginUserID($context = '') } } else { switch (true) { - case ($this->isFrontend() && isset ($_SESSION['webValidated'])): { + case ($this->isFrontend() && isset($_SESSION['webValidated'])): { $out = $_SESSION['webInternalKey']; break; } - case ($this->isBackend() && isset ($_SESSION['mgrValidated'])): { + case ($this->isBackend() && isset($_SESSION['mgrValidated'])): { $out = $_SESSION['mgrInternalKey']; break; } @@ -5004,11 +5000,11 @@ public function getLoginUserName($context = '') } } else { switch (true) { - case ($this->isFrontend() && isset ($_SESSION['webValidated'])): { + case ($this->isFrontend() && isset($_SESSION['webValidated'])): { $out = $_SESSION['webShortname']; break; } - case ($this->isBackend() && isset ($_SESSION['mgrValidated'])): { + case ($this->isBackend() && isset($_SESSION['mgrValidated'])): { $out = $_SESSION['mgrShortname']; break; } @@ -5024,9 +5020,9 @@ public function getLoginUserName($context = '') */ public function getLoginUserType() { - if ($this->isFrontend() && isset ($_SESSION['webValidated'])) { + if ($this->isFrontend() && isset($_SESSION['webValidated'])) { return 'web'; - } elseif ($this->isBackend() && isset ($_SESSION['mgrValidated'])) { + } elseif ($this->isBackend() && isset($_SESSION['mgrValidated'])) { return 'manager'; } else { return ''; @@ -5095,7 +5091,7 @@ public function getUserDocGroups($resolveIds = false) if ($this->isFrontend() && isset($_SESSION['webDocgroups']) && isset($_SESSION['webValidated'])) { $dg = $_SESSION['webDocgroups']; $dgn = isset($_SESSION['webDocgrpNames']) ? $_SESSION['webDocgrpNames'] : false; - } else if ($this->isBackend() && isset($_SESSION['mgrDocgroups']) && isset($_SESSION['mgrValidated'])) { + } elseif ($this->isBackend() && isset($_SESSION['mgrDocgroups']) && isset($_SESSION['mgrValidated'])) { $dg = $_SESSION['mgrDocgroups']; $dgn = isset($_SESSION['mgrDocgrpNames']) ? $_SESSION['mgrDocgrpNames'] : false; } else { @@ -5103,9 +5099,9 @@ public function getUserDocGroups($resolveIds = false) } if (!$resolveIds) { return $dg; - } else if (is_array($dgn)) { + } elseif (is_array($dgn)) { return $dgn; - } else if (is_array($dg)) { + } elseif (is_array($dg)) { // resolve ids to names $dgn = array(); $ds = $this->db->select('name', $this->getFullTableName("documentgroup_names"), "id IN (" . implode(",", $dg) . ")"); @@ -5175,7 +5171,7 @@ public function isMemberOfWebGroup($groupNames = array()) return false; } // check cache - $grpNames = isset ($_SESSION['webUserGroupNames']) ? $_SESSION['webUserGroupNames'] : false; + $grpNames = isset($_SESSION['webUserGroupNames']) ? $_SESSION['webUserGroupNames'] : false; if (!is_array($grpNames)) { $rs = $this->db->select('wgn.name', $this->getFullTableName("webgroup_names") . " wgn INNER JOIN " . $this->getFullTableName("web_groups") . " wg ON wg.webgroup=wgn.id AND wg.webuser='" . $this->getLoginUserID() . "'"); @@ -5201,7 +5197,7 @@ public function isMemberOfWebGroup($groupNames = array()) */ public function regClientCSS($src, $media = '') { - if (empty($src) || isset ($this->loadedjscripts[$src])) { + if (empty($src) || isset($this->loadedjscripts[$src])) { return ''; } $nextpos = max(array_merge(array(0), array_keys($this->sjscripts))) + 1; @@ -5240,11 +5236,11 @@ public function regClientScript($src, $options = array('name' => '', 'version' = return ''; } // nothing to register if (!is_array($options)) { - if (is_bool($options)) // backward compatibility with old plaintext parameter - { + if (is_bool($options)) { // backward compatibility with old plaintext parameter + $options = array('plaintext' => $options); - } elseif (is_string($options)) // Also allow script name as 2nd param - { + } elseif (is_string($options)) { // Also allow script name as 2nd param + $options = array('name' => $options); } else { $options = array(); @@ -5373,7 +5369,7 @@ public function removeEventListener($evtName) if (!$evtName) { return false; } - unset ($this->pluginEvent[$evtName]); + unset($this->pluginEvent[$evtName]); } /** @@ -5381,7 +5377,7 @@ public function removeEventListener($evtName) */ public function removeAllEventListener() { - unset ($this->pluginEvent); + unset($this->pluginEvent); $this->pluginEvent = array(); } @@ -5397,7 +5393,7 @@ public function invokeEvent($evtName, $extParams = array()) if (!$evtName) { return false; } - if (!isset ($this->pluginEvent[$evtName])) { + if (!isset($this->pluginEvent[$evtName])) { return false; } @@ -5463,7 +5459,7 @@ public function invokeEvent($evtName, $extParams = array()) public function getPluginCode($pluginName) { $plugin = array(); - if (isset ($this->pluginCache[$pluginName])) { + if (isset($this->pluginCache[$pluginName])) { $pluginCode = $this->pluginCache[$pluginName]; $pluginProperties = isset($this->pluginCache[$pluginName . "Props"]) ? $this->pluginCache[$pluginName . "Props"] : ''; } else { @@ -5503,7 +5499,6 @@ public function parseProperties($propertyString, $elementName = null, $elementTy if ($jsonFormat === false) { $props = explode('&', $propertyString); foreach ($props as $prop) { - if (empty($prop)) { continue; } elseif (strpos($prop, '=') === false) { @@ -5529,7 +5524,7 @@ public function parseProperties($propertyString, $elementName = null, $elementTy } } // new json-format - } else if (!empty($jsonFormat)) { + } elseif (!empty($jsonFormat)) { foreach ($jsonFormat as $key => $row) { if (!empty($key)) { if (is_array($row)) { @@ -5906,17 +5901,17 @@ public function safeEval($phpcode = '', $evalmode = '', $safe_functions = '') modx_sanitize_gpc($phpcode); switch ($evalmode) { - case 'with_scan' : + case 'with_scan': $isSafe = $this->isSafeCode($phpcode, $safe_functions); break; - case 'with_scan_at_post' : + case 'with_scan_at_post': $isSafe = $_POST ? $this->isSafeCode($phpcode, $safe_functions) : true; break; - case 'everytime_eval' : + case 'everytime_eval': $isSafe = true; break; // Should debug only - case 'dont_eval' : - default : + case 'dont_eval': + default: return $phpcode; } @@ -5989,7 +5984,6 @@ public function isSafeCode($phpcode = '', $safe_functions = '') */ public function atBindFileContent($str = '') { - $search_path = array('assets/tvs/', 'assets/chunks/', 'assets/templates/', $this->config['rb_base_url'] . 'files/', ''); if (stripos($str, '@FILE') !== 0) { @@ -6121,7 +6115,6 @@ public function phpError($nr, $text, $file, $line) */ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = true, $nr = '', $file = '', $source = '', $text = '', $line = '', $output = '') { - if (0 < $this->messageQuitCount) { return; } @@ -6138,8 +6131,8 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = $table = array(); - $version = isset ($GLOBALS['modx_version']) ? $GLOBALS['modx_version'] : ''; - $release_date = isset ($GLOBALS['release_date']) ? $GLOBALS['release_date'] : ''; + $version = isset($GLOBALS['modx_version']) ? $GLOBALS['modx_version'] : ''; + $release_date = isset($GLOBALS['release_date']) ? $GLOBALS['release_date'] : ''; $request_uri = "http://" . $_SERVER['HTTP_HOST'] . ($_SERVER["SERVER_PORT"] == 80 ? "" : (":" . $_SERVER["SERVER_PORT"])) . $_SERVER['REQUEST_URI']; $request_uri = $this->htmlspecialchars($request_uri, ENT_QUOTES, $this->config['modx_charset']); $ua = $this->htmlspecialchars($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, $this->config['modx_charset']); @@ -6154,7 +6147,7 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = $str .= '

    ' . $msg . '

    '; } - if (!empty ($query)) { + if (!empty($query)) { $str .= '
    SQL > ' . $query . '
    '; } @@ -6192,7 +6185,6 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = if ($line) { $table[] = array('Line', $line); } - } if ($source != '') { @@ -6249,7 +6241,7 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = $queryTime = $this->queryTime; $phpTime = $totalTime - $queryTime; - $queries = isset ($this->executedQueries) ? $this->executedQueries : 0; + $queries = isset($this->executedQueries) ? $this->executedQueries : 0; $queryTime = sprintf("%2.4f s", $queryTime); $totalTime = sprintf("%2.4f s", $totalTime); $phpTime = sprintf("%2.4f s", $phpTime); @@ -6283,11 +6275,11 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = $source .= $actionName; } switch ($nr) { - case E_DEPRECATED : - case E_USER_DEPRECATED : - case E_STRICT : - case E_NOTICE : - case E_USER_NOTICE : + case E_DEPRECATED: + case E_USER_DEPRECATED: + case E_STRICT: + case E_NOTICE: + case E_USER_NOTICE: $error_level = 2; break; default: @@ -6315,7 +6307,6 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = ' . $str . ''; - } else { echo 'Error'; } @@ -6694,75 +6685,4 @@ public function addLog($title = 'no title', $msg = '', $type = 1) } $this->logEvent(0, $type, $msg, $title); } - -} - -/** - * System Event Class - */ -class SystemEvent -{ - public $name = ''; - public $_propagate = true; - public $_output = ''; - public $activated = false; - public $activePlugin = ''; - public $params = array(); - - /** - * @param string $name Name of the event - */ - public function __construct($name = "") - { - $this->_resetEventObject(); - $this->name = $name; - } - - /** - * Display a message to the user - * - * @global array $SystemAlertMsgQueque - * @param string $msg The message - */ - public function alert($msg) - { - global $SystemAlertMsgQueque; - if ($msg == "") { - return; - } - if (is_array($SystemAlertMsgQueque)) { - $title = ''; - if ($this->name && $this->activePlugin) { - $title = "
    " . $this->activePlugin . " - " . $this->name . "
    "; - } - $SystemAlertMsgQueque[] = "$title
    $msg
    "; - } - } - - /** - * Output - * - * @param string $msg - */ - public function output($msg) - { - $this->_output .= $msg; - } - - /** - * Stop event propogation - */ - public function stopPropagation() - { - $this->_propagate = false; - } - - public function _resetEventObject() - { - unset ($this->returnedValues); - $this->name = ""; - $this->_output = ""; - $this->_propagate = true; - $this->activated = false; - } } diff --git a/manager/includes/error.class.inc.php b/manager/includes/error.class.inc.php index f82cd17d1a..42dd3abc3c 100755 --- a/manager/includes/error.class.inc.php +++ b/manager/includes/error.class.inc.php @@ -22,7 +22,6 @@ class errorHandler */ public function __construct() { - $_lang = $this->include_lang('errormsg'); $this->errors = array( diff --git a/manager/includes/extenders/dbapi.mysql.class.inc.php b/manager/includes/extenders/dbapi.mysql.class.inc.php index 6f5b60b78a..5172d7f252 100755 --- a/manager/includes/extenders/dbapi.mysql.class.inc.php +++ b/manager/includes/extenders/dbapi.mysql.class.inc.php @@ -7,7 +7,6 @@ class DBAPI { - public $conn; public $config; public $lastQuery; @@ -172,13 +171,12 @@ public function disconnect() public function escape($s, $safecount = 0) { - $safecount++; if (1000 < $safecount) { exit("Too many loops '{$safecount}'"); } - if (empty ($this->conn) || !is_resource($this->conn)) { + if (empty($this->conn) || !is_resource($this->conn)) { $this->connect(); } @@ -205,7 +203,7 @@ public function escape($s, $safecount = 0) public function query($sql, $watchError = true) { $modx = evolutionCMS(); - if (empty ($this->conn) || !is_resource($this->conn)) { + if (empty($this->conn) || !is_resource($this->conn)) { $this->connect(); } $tstart = $modx->getMicroTime(); @@ -416,7 +414,6 @@ public function insert($fields, $intotable, $fromfields = "*", $fromtable = "", public function save($fields, $table, $where = '') { - if ($where === '') { $mode = 'insert'; } elseif ($this->getRecordCount($this->select('*', $table, $where)) == 0) { @@ -617,7 +614,7 @@ public function getValue($dsq) public function getTableMetaData($table) { $metadata = false; - if (!empty ($table)) { + if (!empty($table)) { $sql = "SHOW FIELDS FROM $table"; if ($ds = $this->query($sql)) { while ($row = $this->getRow($ds)) { @@ -643,16 +640,16 @@ public function prepareDate($timestamp, $fieldType = 'DATETIME') $date = ''; if (!$timestamp === false && $timestamp > 0) { switch ($fieldType) { - case 'DATE' : + case 'DATE': $date = date('Y-m-d', $timestamp); break; - case 'TIME' : + case 'TIME': $date = date('H:i:s', $timestamp); break; - case 'YEAR' : + case 'YEAR': $date = date('Y', $timestamp); break; - default : + default: $date = date('Y-m-d H:i:s', $timestamp); break; } @@ -705,7 +702,6 @@ public function getVersion() */ public function replaceFullTableName($str, $force = null) { - $str = trim($str); $dbase = trim($this->config['dbase'], '`'); $prefix = $this->config['table_prefix']; @@ -744,7 +740,6 @@ public function dataSeek($result, $row_number) public function _getFieldsStringFromArray($fields = array()) { - if (empty($fields)) { return '*'; } @@ -771,4 +766,3 @@ public function _getFromStringFromArray($tables = array()) return implode(' ', $_); } } - diff --git a/manager/includes/extenders/dbapi.mysqli.class.inc.php b/manager/includes/extenders/dbapi.mysqli.class.inc.php index 8596b6f091..b9a9b0136a 100755 --- a/manager/includes/extenders/dbapi.mysqli.class.inc.php +++ b/manager/includes/extenders/dbapi.mysqli.class.inc.php @@ -119,7 +119,7 @@ public function escape($s, $safeCount = 0) if (1000 < $safeCount) { exit("Too many loops '{$safeCount}'"); } - if ( ! ($this->conn instanceof mysqli)) { + if (! ($this->conn instanceof mysqli)) { $this->connect(); } if (is_array($s)) { @@ -145,7 +145,7 @@ public function escape($s, $safeCount = 0) public function query($sql, $watchError = true) { $modx = evolutionCMS(); - if ( ! ($this->conn instanceof mysqli)) { + if (! ($this->conn instanceof mysqli)) { $this->connect(); } $tStart = $modx->getMicroTime(); @@ -295,7 +295,7 @@ public function update($fields, $table, $where = "") $modx = evolutionCMS(); $out = false; if (!$table) { - $modx->messageQuit('Empty '.$table.' parameter in DBAPI::update().'); + $modx->messageQuit('Empty ' . $table . ' parameter in DBAPI::update().'); } else { $table = $this->replaceFullTableName($table); if (is_array($fields)) { @@ -311,10 +311,10 @@ public function update($fields, $table, $where = "") } $where = trim($where); if ($where !== '' && stripos($where, 'WHERE') !== 0) { - $where = 'WHERE '.$where; + $where = 'WHERE ' . $where; } - return $this->query('UPDATE '.$table.' SET '.$fields.' '.$where); + return $this->query('UPDATE ' . $table . ' SET ' . $fields . ' ' . $where); } return $out; } @@ -490,7 +490,7 @@ public function getRow($ds, $mode = 'assoc') { $out = false; if ($ds instanceof mysqli_result) { - switch($mode){ + switch ($mode) { case 'assoc': $out = $ds->fetch_assoc(); break; @@ -520,7 +520,7 @@ public function getRow($ds, $mode = 'assoc') public function getColumn($name, $dsq) { $col = array(); - if ( ! ($dsq instanceof mysqli_result)) { + if (! ($dsq instanceof mysqli_result)) { $dsq = $this->query($dsq); } if ($dsq) { @@ -539,7 +539,7 @@ public function getColumn($name, $dsq) public function getColumnNames($dsq) { $names = array(); - if ( ! ($dsq instanceof mysqli_result)) { + if (! ($dsq instanceof mysqli_result)) { $dsq = $this->query($dsq); } if ($dsq) { @@ -559,7 +559,7 @@ public function getColumnNames($dsq) public function getValue($dsq) { $out = false; - if ( ! ($dsq instanceof mysqli_result)) { + if (! ($dsq instanceof mysqli_result)) { $dsq = $this->query($dsq); } if ($dsq) { @@ -578,7 +578,7 @@ public function getTableMetaData($table) { $metadata = array(); if (!empty($table) && is_scalar($table)) { - $sql = 'SHOW FIELDS FROM '.$table; + $sql = 'SHOW FIELDS FROM ' . $table; if ($ds = $this->query($sql)) { while ($row = $this->getRow($ds)) { $fieldName = $row['Field']; @@ -600,16 +600,16 @@ public function prepareDate($timestamp, $fieldType = 'DATETIME') $date = false; if (!$timestamp === false && $timestamp > 0) { switch ($fieldType) { - case 'DATE' : + case 'DATE': $date = date('Y-m-d', $timestamp); break; - case 'TIME' : + case 'TIME': $date = date('H:i:s', $timestamp); break; - case 'YEAR' : + case 'YEAR': $date = date('Y', $timestamp); break; - default : + default: $date = date('Y-m-d H:i:s', $timestamp); break; } @@ -674,9 +674,9 @@ public function replaceFullTableName($tableName, $force = false) */ public function optimize($table_name) { - $rs = $this->query('OPTIMIZE TABLE '.$table_name); + $rs = $this->query('OPTIMIZE TABLE ' . $table_name); if ($rs) { - $rs = $this->query('ALTER TABLE '.$table_name); + $rs = $this->query('ALTER TABLE ' . $table_name); } return $rs; @@ -688,7 +688,7 @@ public function optimize($table_name) */ public function truncate($table_name) { - return $this->query('TRUNCATE '.$table_name); + return $this->query('TRUNCATE ' . $table_name); } /** @@ -707,7 +707,6 @@ public function dataSeek($result, $row_number) */ public function _getFieldsStringFromArray($fields = array()) { - if (empty($fields)) { return '*'; } @@ -715,7 +714,7 @@ public function _getFieldsStringFromArray($fields = array()) $_ = array(); foreach ($fields as $k => $v) { if ($k !== $v) { - $_[] = $v.' as '.$k; + $_[] = $v . ' as ' . $k; } else { $_[] = $v; } diff --git a/manager/includes/extenders/deprecated.functions.inc.php b/manager/includes/extenders/deprecated.functions.inc.php index 42b91290f2..5e8c8d138e 100755 --- a/manager/includes/extenders/deprecated.functions.inc.php +++ b/manager/includes/extenders/deprecated.functions.inc.php @@ -109,7 +109,7 @@ public function makeList($array, $ulroot = 'root', $ulprefix = 'sub_', $type = ' if (!is_array($array)) { return "
    • Bad list
    "; } - if (!empty ($type)) { + if (!empty($type)) { $typestr = " style='list-style-type: $type'"; } else { $typestr = ""; @@ -218,7 +218,7 @@ public function userLoggedIn() { $modx = evolutionCMS(); $userdetails = array(); - if ($modx->isFrontend() && isset ($_SESSION['webValidated'])) { + if ($modx->isFrontend() && isset($_SESSION['webValidated'])) { // web user $userdetails['loggedIn'] = true; $userdetails['id'] = $_SESSION['webInternalKey']; @@ -227,7 +227,7 @@ public function userLoggedIn() return $userdetails; } else { - if ($modx->isBackend() && isset ($_SESSION['mgrValidated'])) { + if ($modx->isBackend() && isset($_SESSION['mgrValidated'])) { // manager user $userdetails['loggedIn'] = true; $userdetails['id'] = $_SESSION['mgrInternalKey']; diff --git a/manager/includes/extenders/ex_dbapi.inc.php b/manager/includes/extenders/ex_dbapi.inc.php index 949109de89..bebeda3af1 100755 --- a/manager/includes/extenders/ex_dbapi.inc.php +++ b/manager/includes/extenders/ex_dbapi.inc.php @@ -7,15 +7,17 @@ global $database_type; -if (empty($database_type)) $database_type = 'mysql'; +if (empty($database_type)) { + $database_type = 'mysql'; +} $out = false; $class = 'DBAPI'; -if( ! class_exists($class)){ +if (! class_exists($class)) { include_once MODX_MANAGER_PATH . 'includes/extenders/dbapi.' . $database_type . '.class.inc.php'; } -if(class_exists($class)){ +if (class_exists($class)) { $this->db= new $class; $out = true; } diff --git a/manager/includes/extenders/export.class.inc.php b/manager/includes/extenders/export.class.inc.php index 42e7b98850..adc689163e 100755 --- a/manager/includes/extenders/export.class.inc.php +++ b/manager/includes/extenders/export.class.inc.php @@ -172,7 +172,8 @@ public function removeDirectoryAll($directory = '') */ public function makeFile($docid, $filepath) { - $modx = evolutionCMS(); global $_lang; + $modx = evolutionCMS(); + global $_lang; $file_permission = octdec($modx->config['new_file_permissions']); if ($this->generate_mode === 'direct') { $back_lang = $_lang; @@ -286,7 +287,7 @@ public function run($parent = 0) if ($row['published'] === '1') { $status = $this->makeFile($row['id'], $filename); switch ($status) { - case 'failed_no_write' : + case 'failed_no_write': $row['status'] = $msg_failed_no_write; break; case 'failed_no_retrieve': @@ -319,7 +320,6 @@ public function run($parent = 0) } mkdir($dir_path); @chmod($dir_path, $folder_permission); - } @@ -370,5 +370,4 @@ public function parsePlaceholder($tpl, $ph = array()) return $tpl; } - } diff --git a/manager/includes/extenders/maketable.class.php b/manager/includes/extenders/maketable.class.php index ccd716197b..2a9f4034b8 100755 --- a/manager/includes/extenders/maketable.class.php +++ b/manager/includes/extenders/maketable.class.php @@ -332,10 +332,10 @@ public function getColumnWidth($columnPosition) public function determineRowClass($position) { switch ($this->rowAlternatingScheme) { - case 'ODD' : + case 'ODD': $modRemainder = 1; break; - case 'EVEN' : + case 'EVEN': default: $modRemainder = 0; break; @@ -441,7 +441,7 @@ public function create($fieldsArray, $fieldHeadersArray = array(), $linkpage = " $table .= $this->createCellText($currentActionFieldValue, $value); $table .= "\n"; if ($i == 0) { - if (empty ($header) && $this->formElementType) { + if (empty($header) && $this->formElementType) { $header .= "\t\tthClass ? 'class="' . $this->thClass . '"' : '') . ">" . ($this->allOption ? 'all' : '') . "\n"; } $headerText = array_key_exists($key, $fieldHeadersArray) ? $fieldHeadersArray[$key] : $key; @@ -471,7 +471,6 @@ public function create($fieldsArray, $fieldHeadersArray = array(), $linkpage = " */ $table .= ''; //$table .= ''; - } if ($this->allOption) { $table .= ' @@ -644,5 +643,4 @@ public function prepareOrderByLink($key, $text, $qs = '') return '' . $text . ''; } - } diff --git a/manager/includes/extenders/manager.api.class.inc.php b/manager/includes/extenders/manager.api.class.inc.php index b1643f1605..323e2a0d5a 100755 --- a/manager/includes/extenders/manager.api.class.inc.php +++ b/manager/includes/extenders/manager.api.class.inc.php @@ -86,7 +86,6 @@ public function saveFormValues($id = 0) */ public function loadFormValues() { - if (!$this->hasFormValues()) { return false; } diff --git a/manager/includes/extenders/message.quit.inc.php b/manager/includes/extenders/message.quit.inc.php index e076ce04c2..3830fa14c4 100755 --- a/manager/includes/extenders/message.quit.inc.php +++ b/manager/includes/extenders/message.quit.inc.php @@ -3,7 +3,7 @@ * Message Quit Template * */ -if(( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) && IN_PARSER_MODE!="true") { +if ((! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) && IN_PARSER_MODE!="true") { die("INCLUDE ACCESS ERROR

    Direct access to this file prohibited."); } @@ -20,61 +20,60 @@ function copyToClip() "; -if($is_error) { - $parsedMessageString .= "

     MODX Parse Error

    +if ($is_error) { + $parsedMessageString .= "

     MODX Parse Error

    "; } else { - $parsedMessageString .= "

     MODX Debug/ stop message

    + $parsedMessageString .= "

     MODX Debug/ stop message

    MODX encountered the following error while attempting to parse the requested resource:
    « $msg »
    "; } -if(!empty($query)) { - $parsedMessageString .= ""; } -if($text!='') { +if ($text!='') { + $errortype = array( + E_ERROR => "Error", + E_WARNING => "Warning", + E_PARSE => "Parsing Error", + E_NOTICE => "Notice", + E_CORE_ERROR => "Core Error", + E_CORE_WARNING => "Core Warning", + E_COMPILE_ERROR => "Compile Error", + E_COMPILE_WARNING => "Compile Warning", + E_USER_ERROR => "User Error", + E_USER_WARNING => "User Warning", + E_USER_NOTICE => "User Notice", + ); - $errortype = array ( - E_ERROR => "Error", - E_WARNING => "Warning", - E_PARSE => "Parsing Error", - E_NOTICE => "Notice", - E_CORE_ERROR => "Core Error", - E_CORE_WARNING => "Core Warning", - E_COMPILE_ERROR => "Compile Error", - E_COMPILE_WARNING => "Compile Warning", - E_USER_ERROR => "User Error", - E_USER_WARNING => "User Warning", - E_USER_NOTICE => "User Notice", - ); + $parsedMessageString .= ""; - $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; - - $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; - if($source!='') { - $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; - } + $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; + if ($source!='') { + $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; + } } $parsedMessageString .= ""; diff --git a/manager/includes/extenders/modifiers.class.inc.php b/manager/includes/extenders/modifiers.class.inc.php index da6e862edd..082f34e90e 100755 --- a/manager/includes/extenders/modifiers.class.inc.php +++ b/manager/includes/extenders/modifiers.class.inc.php @@ -1,8 +1,11 @@ config['modx_charset']); + if (function_exists('mb_internal_encoding')) { + mb_internal_encoding($modx->config['modx_charset']); + } $this->condModifiers = '=,is,eq,equals,ne,neq,notequals,isnot,isnt,not,%,isempty,isnotempty,isntempty,>=,gte,eg,gte,greaterthan,>,gt,isgreaterthan,isgt,lowerthan,<,lt,<=,lte,islte,islowerthan,islt,el,find,in,inarray,in_array,fnmatch,wcard,wcard_match,wildcard,wildcard_match,is_file,is_dir,file_exists,is_readable,is_writable,is_image,regex,preg,preg_match,memberof,mo,isinrole,ir'; } @@ -70,13 +75,15 @@ public function __construct() * @param string $modifiers * @return bool|mixed|string */ - public function phxFilter($key,$value,$modifiers) + public function phxFilter($key, $value, $modifiers) { $modx = evolutionCMS(); - if(substr($modifiers,0,3)!=='id(') $value = $this->parseDocumentSource($value); + if (substr($modifiers, 0, 3)!=='id(') { + $value = $this->parseDocumentSource($value); + } $this->srcValue = $value; $modifiers = trim($modifiers); - $modifiers = ':'.trim($modifiers,':'); + $modifiers = ':' . trim($modifiers, ':'); $modifiers = str_replace(array("\r\n","\r"), "\n", $modifiers); $modifiers = $this->splitEachModifiers($modifiers); @@ -86,7 +93,7 @@ public function phxFilter($key,$value,$modifiers) $this->condition = array(); $this->vars = array(); $this->vars['name'] = & $key; - $value = $this->parsePhx($key,$value,$modifiers); + $value = $this->parsePhx($key, $value, $modifiers); $this->vars = array(); return $value; } @@ -96,13 +103,18 @@ public function phxFilter($key,$value,$modifiers) * @param string $modifiers * @return bool|string */ - public function _getDelim($mode,$modifiers) { - $c = substr($modifiers,0,1); - if(!in_array($c, array('"', "'", '`')) ) return false; + public function _getDelim($mode, $modifiers) + { + $c = substr($modifiers, 0, 1); + if (!in_array($c, array('"', "'", '`'))) { + return false; + } - $modifiers = substr($modifiers,1); + $modifiers = substr($modifiers, 1); $closure = $mode=='(' ? "{$c})" : $c; - if(strpos($modifiers, $closure)===false) return false; + if (strpos($modifiers, $closure)===false) { + return false; + } return $c; } @@ -113,142 +125,157 @@ public function _getDelim($mode,$modifiers) { * @param string $modifiers * @return bool|string */ - public function _getOpt($mode,$delim,$modifiers) { - if($delim) { - if($mode=='(') return substr($modifiers,1,strpos($modifiers, $delim . ')' )-1); + public function _getOpt($mode, $delim, $modifiers) + { + if ($delim) { + if ($mode=='(') { + return substr($modifiers, 1, strpos($modifiers, $delim . ')')-1); + } - return substr($modifiers,1,strpos($modifiers,$delim,1)-1); - } - else { - if($mode=='(') return substr($modifiers,0,strpos($modifiers, ')') ); + return substr($modifiers, 1, strpos($modifiers, $delim, 1)-1); + } else { + if ($mode=='(') { + return substr($modifiers, 0, strpos($modifiers, ')')); + } $chars = str_split($modifiers); $opt=''; - foreach($chars as $c) { - if($c==':' || $c==')') break; + foreach ($chars as $c) { + if ($c==':' || $c==')') { + break; + } $opt .=$c; } return $opt; } } - public function _getRemainModifiers($mode,$delim,$modifiers) { - if($delim) { - if($mode=='(') + public function _getRemainModifiers($mode, $delim, $modifiers) + { + if ($delim) { + if ($mode=='(') { return $this->_fetchContent($modifiers, $delim . ')'); - else { + } else { $modifiers = trim($modifiers); - $modifiers = substr($modifiers,1); + $modifiers = substr($modifiers, 1); return $this->_fetchContent($modifiers, $delim); } - } - else { - if($mode=='(') return $this->_fetchContent($modifiers, ')'); + } else { + if ($mode=='(') { + return $this->_fetchContent($modifiers, ')'); + } $chars = str_split($modifiers); - foreach($chars as $c) { - if($c==':') return $modifiers; - else $modifiers = substr($modifiers,1); + foreach ($chars as $c) { + if ($c==':') { + return $modifiers; + } else { + $modifiers = substr($modifiers, 1); + } } return $modifiers; } } - public function _fetchContent($string,$delim) { + public function _fetchContent($string, $delim) + { $len = strlen($delim); $string = $this->parseDocumentSource($string); - return substr($string,strpos($string, $delim)+$len); + return substr($string, strpos($string, $delim)+$len); } - public function splitEachModifiers($modifiers) { + public function splitEachModifiers($modifiers) + { $modx = evolutionCMS(); $cmd = ''; $bt = ''; $result = array(); - while($bt!==$modifiers) { + while ($bt!==$modifiers) { $bt = $modifiers; - $c = substr($modifiers,0,1); - $modifiers = substr($modifiers,1); + $c = substr($modifiers, 0, 1); + $modifiers = substr($modifiers, 1); - if($c===':' && preg_match('@^(!?[<>=]{1,2})@', $modifiers, $match)) { // :=, :!=, :<=, :>=, :!<=, :!>= - $c = substr($modifiers,strlen($match[1]),1); + if ($c===':' && preg_match('@^(!?[<>=]{1,2})@', $modifiers, $match)) { // :=, :!=, :<=, :>=, :!<=, :!>= + $c = substr($modifiers, strlen($match[1]), 1); $debuginfo = "#i=0 #c=[{$c}] #m=[{$modifiers}]"; - if($c==='(') $modifiers = substr($modifiers,strlen($match[1])+1); - else $modifiers = substr($modifiers,strlen($match[1])); + if ($c==='(') { + $modifiers = substr($modifiers, strlen($match[1])+1); + } else { + $modifiers = substr($modifiers, strlen($match[1])); + } - $delim = $this->_getDelim($c,$modifiers); - $opt = $this->_getOpt($c,$delim,$modifiers); - $modifiers = trim($this->_getRemainModifiers($c,$delim,$modifiers)); + $delim = $this->_getDelim($c, $modifiers); + $opt = $this->_getOpt($c, $delim, $modifiers); + $modifiers = trim($this->_getRemainModifiers($c, $delim, $modifiers)); $result[]=array('cmd'=>trim($match[1]),'opt'=>$opt,'debuginfo'=>$debuginfo); $cmd = ''; - } - elseif(in_array($c,array('+','-','*','/')) && preg_match('@^[0-9]+@', $modifiers, $match)) { // :+3, :-3, :*3 ... - $modifiers = substr($modifiers,strlen($match[0])); - $result[]=array('cmd'=>'math','opt'=>'%s'.$c.$match[0]); + } elseif (in_array($c, array('+','-','*','/')) && preg_match('@^[0-9]+@', $modifiers, $match)) { // :+3, :-3, :*3 ... + $modifiers = substr($modifiers, strlen($match[0])); + $result[]=array('cmd'=>'math','opt'=>'%s' . $c . $match[0]); $cmd = ''; - } - elseif($c==='(' || $c==='=') { + } elseif ($c==='(' || $c==='=') { $modifiers = $m1 = trim($modifiers); - $delim = $this->_getDelim($c,$modifiers); - $opt = $this->_getOpt($c,$delim,$modifiers); - $modifiers = trim($this->_getRemainModifiers($c,$delim,$modifiers)); + $delim = $this->_getDelim($c, $modifiers); + $opt = $this->_getOpt($c, $delim, $modifiers); + $modifiers = trim($this->_getRemainModifiers($c, $delim, $modifiers)); $debuginfo = "#i=1 #c=[{$c}] #delim=[{$delim}] #m1=[{$m1}] remainMdf=[{$modifiers}]"; $result[]=array('cmd'=>trim($cmd),'opt'=>$opt,'debuginfo'=>$debuginfo); $cmd = ''; - } - elseif($c==':') { + } elseif ($c==':') { $debuginfo = "#i=2 #c=[{$c}] #m=[{$modifiers}]"; - if($cmd!=='') $result[]=array('cmd'=>trim($cmd),'opt'=>'','debuginfo'=>$debuginfo); + if ($cmd!=='') { + $result[]=array('cmd'=>trim($cmd),'opt'=>'','debuginfo'=>$debuginfo); + } $cmd = ''; - } - elseif(trim($modifiers)=='' && trim($cmd)!=='') { + } elseif (trim($modifiers)=='' && trim($cmd)!=='') { $debuginfo = "#i=3 #c=[{$c}] #m=[{$modifiers}]"; $cmd .= $c; $result[]=array('cmd'=>trim($cmd),'opt'=>'','debuginfo'=>$debuginfo); break; - } - else { + } else { $cmd .= $c; } } - if(empty($result)) return array(); + if (empty($result)) { + return array(); + } - foreach($result as $i=>$a) - { + foreach ($result as $i=>$a) { $a['opt'] = $this->parseDocumentSource($a['opt']); - $result[$i]['opt'] = $modx->mergePlaceholderContent($a['opt'],$this->placeholders); + $result[$i]['opt'] = $modx->mergePlaceholderContent($a['opt'], $this->placeholders); } return $result; } - public function parsePhx($key,$value,$modifiers) + public function parsePhx($key, $value, $modifiers) { $modx = evolutionCMS(); $lastKey = ''; - $cacheKey = md5(sprintf('parsePhx#%s#%s#%s',$key,$value,print_r($modifiers,true))); - if(isset($this->tmpCache[$cacheKey])) return $this->tmpCache[$cacheKey]; - if(empty($modifiers)) return ''; + $cacheKey = md5(sprintf('parsePhx#%s#%s#%s', $key, $value, print_r($modifiers, true))); + if (isset($this->tmpCache[$cacheKey])) { + return $this->tmpCache[$cacheKey]; + } + if (empty($modifiers)) { + return ''; + } - foreach($modifiers as $m) - { + foreach ($modifiers as $m) { $lastKey = strtolower($m['cmd']); } - $_ = explode(',',$this->condModifiers); - if(in_array($lastKey,$_)) - { + $_ = explode(',', $this->condModifiers); + if (in_array($lastKey, $_)) { $modifiers[] = array('cmd'=>'then','opt'=>'1'); $modifiers[] = array('cmd'=>'else','opt'=>'0'); } - foreach($modifiers as $i=>$a) - { - $value = $this->Filter($key,$value, $a['cmd'], $a['opt']); + foreach ($modifiers as $i=>$a) { + $value = $this->Filter($key, $value, $a['cmd'], $a['opt']); } $this->tmpCache[$cacheKey] = $value; return $value; @@ -259,56 +286,71 @@ public function Filter($key, $value, $cmd, $opt='') { $modx = evolutionCMS(); - if($key==='documentObject') $value = $modx->documentIdentifier; + if ($key==='documentObject') { + $value = $modx->documentIdentifier; + } $cmd = $this->parseDocumentSource($cmd); - if(preg_match('@^[1-9][/0-9]*$@',$cmd)) - { - if(strpos($cmd,'/')!==false) - $cmd = $this->substr($cmd,strrpos($cmd,'/')+1); + if (preg_match('@^[1-9][/0-9]*$@', $cmd)) { + if (strpos($cmd, '/')!==false) { + $cmd = $this->substr($cmd, strrpos($cmd, '/')+1); + } $opt = $cmd; $cmd = 'id'; } - if(isset($modx->snippetCache["phx:{$cmd}"])) $this->elmName = "phx:{$cmd}"; - elseif(isset($modx->chunkCache["phx:{$cmd}"])) $this->elmName = "phx:{$cmd}"; - else $this->elmName = ''; + if (isset($modx->snippetCache["phx:{$cmd}"])) { + $this->elmName = "phx:{$cmd}"; + } elseif (isset($modx->chunkCache["phx:{$cmd}"])) { + $this->elmName = "phx:{$cmd}"; + } else { + $this->elmName = ''; + } $cmd = strtolower($cmd); - if($this->elmName!=='') + if ($this->elmName!=='') { $value = $this->getValueFromElement($key, $value, $cmd, $opt); - else + } else { $value = $this->getValueFromPreset($key, $value, $cmd, $opt); + } $value = str_replace('[+key+]', $key, $value); return $value; } - public function isEmpty($cmd,$value) + public function isEmpty($cmd, $value) { - if($value!=='') return false; + if ($value!=='') { + return false; + } $_ = explode(',', $this->condModifiers . ',_default,default,if,input,or,and,show,this,select,switch,then,else,id,ifempty,smart_desc,smart_description,summary'); - if(in_array($cmd,$_)) return false; - else return true; + if (in_array($cmd, $_)) { + return false; + } else { + return true; + } } public function getValueFromPreset($key, $value, $cmd, $opt) { $modx = evolutionCMS(); - if($this->isEmpty($cmd,$value)) return ''; + if ($this->isEmpty($cmd, $value)) { + return ''; + } $this->key = $key; $this->value = $value; $this->opt = $opt; - switch ($cmd) - { + switch ($cmd) { ##### Conditional Modifiers case 'input': case 'if': - if(!$opt) return $value; + if (!$opt) { + return $value; + } return $opt; case '=': case 'eq': @@ -369,22 +411,35 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'file_exists': case 'is_readable': case 'is_writable': - if(!$opt) $path = $value; - else $path = $opt; - if(strpos($path,MODX_MANAGER_PATH)!==false) exit('Can not read core path'); - if(strpos($path,$modx->config['base_path'])===false) $path = ltrim($path,'/'); + if (!$opt) { + $path = $value; + } else { + $path = $opt; + } + if (strpos($path, MODX_MANAGER_PATH)!==false) { + exit('Can not read core path'); + } + if (strpos($path, $modx->config['base_path'])===false) { + $path = ltrim($path, '/'); + } $this->condition[] = (int)($cmd($path)!==false);break; case 'is_image': - if(!$opt) $path = $value; - else $path = $opt; - if(!is_file($path)) {$this->condition[]='0';break;} + if (!$opt) { + $path = $value; + } else { + $path = $opt; + } + if (!is_file($path)) { + $this->condition[]='0'; + break; + } $_ = getimagesize($path); $this->condition[] = (int)($_[0]);break; case 'regex': case 'preg': case 'preg_match': case 'isinrole': - $this->condition[] = (int)(preg_match($opt,$value));break; + $this->condition[] = (int)(preg_match($opt, $value));break; case 'ir': case 'memberof': case 'mo': @@ -397,45 +452,55 @@ public function getValueFromPreset($key, $value, $cmd, $opt) $this->condition[] = '&&';break; case 'show': case 'this': - $conditional = implode(' ',$this->condition); + $conditional = implode(' ', $this->condition); $isvalid = (int)(eval("return ({$conditional});")); - if ($isvalid) return $this->srcValue; - return NULL; + if ($isvalid) { + return $this->srcValue; + } + return null; case 'then': - $conditional = implode(' ',$this->condition); + $conditional = implode(' ', $this->condition); $isvalid = (int)eval("return ({$conditional});"); - if ($isvalid) return $opt; + if ($isvalid) { + return $opt; + } return null; case 'else': - $conditional = implode(' ',$this->condition); + $conditional = implode(' ', $this->condition); $isvalid = (int)eval("return ({$conditional});"); - if (!$isvalid) return $opt; + if (!$isvalid) { + return $opt; + } break; case 'select': case 'switch': - $raw = explode('&',$opt); + $raw = explode('&', $opt); $map = array(); $c = count($raw); - for($m=0; $m<$c; $m++) { - $mi = explode('=',$raw[$m],2); + for ($m=0; $m<$c; $m++) { + $mi = explode('=', $raw[$m], 2); $map[$mi[0]] = $mi[1]; } - if(isset($map[$value])) return $map[$value]; - else return ''; + if (isset($map[$value])) { + return $map[$value]; + } else { + return ''; + } ##### End of Conditional Modifiers ##### Encode / Decode / Hash / Escape + // no break case 'htmlent': case 'htmlentities': - return htmlentities($value,ENT_QUOTES,$modx->config['modx_charset']); + return htmlentities($value, ENT_QUOTES, $modx->config['modx_charset']); case 'html_entity_decode': case 'decode_html': case 'html_decode': - return html_entity_decode($value,ENT_QUOTES,$modx->config['modx_charset']); + return html_entity_decode($value, ENT_QUOTES, $modx->config['modx_charset']); case 'esc': case 'escape': $value = preg_replace('/&(#[0-9]+|[a-z]+);/i', '&$1;', htmlspecialchars($value, ENT_QUOTES, $modx->config['modx_charset'])); - return str_replace(array('[', ']', '`'),array('[', ']', '`'),$value); + return str_replace(array('[', ']', '`'), array('[', ']', '`'), $value); case 'sql_escape': case 'encode_js': return $modx->db->escape($value); @@ -445,40 +510,45 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'html_encode': return preg_replace('/&(#[0-9]+|[a-z]+);/i', '&$1;', htmlspecialchars($value, ENT_QUOTES, $modx->config['modx_charset'])); case 'spam_protect': - return str_replace(array('@','.'),array('@','.'),$value); + return str_replace(array('@','.'), array('@','.'), $value); case 'strip': - if($opt==='') $opt = ' '; + if ($opt==='') { + $opt = ' '; + } return preg_replace('/[\n\r\t\s]+/', $opt, $value); case 'strip_linefeeds': return str_replace(array("\n","\r"), '', $value); case 'notags': case 'strip_tags': case 'remove_html': - if($opt!=='') - { + if ($opt!=='') { $param = array(); - foreach(explode(',',$opt) as $v) - { - $v = trim($v,' '); + foreach (explode(',', $opt) as $v) { + $v = trim($v, ' '); $param[] = "<{$v}>"; } - $params = implode(',',$param); + $params = implode(',', $param); + } else { + $params = ''; } - else $params = ''; - if(!strpos($params,'
    ')===false) { - $value = preg_replace('@()\n@','$1',$value); - $value = preg_replace('@@',"\n",$value); + if (!strpos($params, '
    ')===false) { + $value = preg_replace('@()\n@', '$1', $value); + $value = preg_replace('@@', "\n", $value); } - return $this->strip_tags($value,$params); + return $this->strip_tags($value, $params); case 'urlencode': case 'url_encode': case 'encode_url': return urlencode($value); case 'base64_decode': - if($opt!=='false') $opt = true; - else $opt = false; - return base64_decode($value,$opt); + if ($opt!=='false') { + $opt = true; + } else { + $opt = false; + } + return base64_decode($value, $opt); case 'encode_sha1': $cmd = 'sha1'; + // no break case 'addslashes': case 'urldecode': case 'url_decode': @@ -501,18 +571,21 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'upper_case': return $this->strtoupper($value); case 'capitalize': - $_ = explode(' ',$value); - foreach($_ as $i=>$v) - { + $_ = explode(' ', $value); + foreach ($_ as $i=>$v) { $_[$i] = ucfirst($v); } - return implode(' ',$_); + return implode(' ', $_); case 'zenhan': - if(empty($opt)) $opt='VKas'; - return mb_convert_kana($value,$opt,$modx->config['modx_charset']); + if (empty($opt)) { + $opt='VKas'; + } + return mb_convert_kana($value, $opt, $modx->config['modx_charset']); case 'hanzen': - if(empty($opt)) $opt='VKAS'; - return mb_convert_kana($value,$opt,$modx->config['modx_charset']); + if (empty($opt)) { + $opt='VKAS'; + } + return mb_convert_kana($value, $opt, $modx->config['modx_charset']); case 'str_shuffle': case 'shuffle': return $this->str_shuffle($value); @@ -526,7 +599,7 @@ public function getValueFromPreset($key, $value, $cmd, $opt) return $this->strlen($value); case 'count_words': $value = trim($value); - return count(preg_split('/\s+/',$value)); + return count(preg_split('/\s+/', $value)); case 'str_word_count': case 'word_count': case 'wordcount': @@ -534,55 +607,69 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'count_paragraphs': $value = trim($value); $value = preg_replace('/\r/', '', $value); - return count(preg_split('/\n+/',$value)); + return count(preg_split('/\n+/', $value)); case 'strpos': - if($opt!=0&&empty($opt)) return $value; - return $this->strpos($value,$opt); + if ($opt!=0&&empty($opt)) { + return $value; + } + return $this->strpos($value, $opt); case 'wordwrap': // default: 70 $wrapat = (int)$opt > 0 ? (int)$opt : 70; - if (version_compare(PHP_VERSION, '5.3.0') >= 0) return $this->includeMdfFile('wordwrap'); - else return preg_replace("@(\b\w+\b)@e","wordwrap('\\1',\$wrapat,' ',1)",$value); + if (version_compare(PHP_VERSION, '5.3.0') >= 0) { + return $this->includeMdfFile('wordwrap'); + } else { + return preg_replace("@(\b\w+\b)@e", "wordwrap('\\1',\$wrapat,' ',1)", $value); + } + // no break case 'wrap_text': - $width = preg_match('/^[1-9][0-9]*$/',$opt) ? $opt : 70; - if($modx->config['manager_language']==='japanese-utf8') { + $width = preg_match('/^[1-9][0-9]*$/', $opt) ? $opt : 70; + if ($modx->config['manager_language']==='japanese-utf8') { $chunk = array(); $bt=''; - while($bt!=$value) { + while ($bt!=$value) { $bt = $value; - if($this->strlen($value)<$width) { + if ($this->strlen($value)<$width) { $chunk[] = $value; break; } - $chunk[] = $this->substr($value,0,$width); - $value = $this->substr($value,$width); + $chunk[] = $this->substr($value, 0, $width); + $value = $this->substr($value, $width); } - return implode("\n",$chunk); + return implode("\n", $chunk); + } else { + return wordwrap($value, $width, "\n", true); } - else - return wordwrap($value,$width,"\n",true); + // no break case 'substr': - if(empty($opt)) break; - if(strpos($opt,',')!==false) { - list($b,$e) = explode(',',$opt,2); - return $this->substr($value,$b,(int)$e); + if (empty($opt)) { + break; } - else return $this->substr($value,$opt); + if (strpos($opt, ',')!==false) { + list($b, $e) = explode(',', $opt, 2); + return $this->substr($value, $b, (int)$e); + } else { + return $this->substr($value, $opt); + } + // no break case 'limit': case 'trim_to': // http://www.movabletype.jp/documentation/appendices/modifiers/trim_to.html - if(strpos($opt,'+')!==false) - list($len,$str) = explode('+',$opt,2); - else { + if (strpos($opt, '+')!==false) { + list($len, $str) = explode('+', $opt, 2); + } else { $len = $opt; $str = ''; } - if($len==='') $len = 100; - if(abs($len) > $this->strlen($value)) $str =''; - if(preg_match('/^[1-9][0-9]*$/',$len)) { - return $this->substr($value,0,$len) . $str; + if ($len==='') { + $len = 100; + } + if (abs($len) > $this->strlen($value)) { + $str =''; } - elseif(preg_match('/^\-[1-9][0-9]*$/',$len)) { - return $str . $this->substr($value,$len); + if (preg_match('/^[1-9][0-9]*$/', $len)) { + return $this->substr($value, 0, $len) . $str; + } elseif (preg_match('/^\-[1-9][0-9]*$/', $len)) { + return $str . $this->substr($value, $len); } break; case 'summary': @@ -591,82 +678,119 @@ public function getValueFromPreset($key, $value, $cmd, $opt) return $this->includeMdfFile('summary'); case 'replace': case 'str_replace': - if(empty($opt) || strpos($opt,',')===false) break; - if (substr_count($opt, ',') ==1) $delim = ','; - elseif(substr_count($opt, '|') ==1) $delim = '|'; - elseif(substr_count($opt, '=>')==1) $delim = '=>'; - elseif(substr_count($opt, '/') ==1) $delim = '/'; - else break; - list($s,$r) = explode($delim,$opt); - if($value!=='') return str_replace($s,$r,$value); + if (empty($opt) || strpos($opt, ',')===false) { + break; + } + if (substr_count($opt, ',') ==1) { + $delim = ','; + } elseif (substr_count($opt, '|') ==1) { + $delim = '|'; + } elseif (substr_count($opt, '=>')==1) { + $delim = '=>'; + } elseif (substr_count($opt, '/') ==1) { + $delim = '/'; + } else { + break; + } + list($s, $r) = explode($delim, $opt); + if ($value!=='') { + return str_replace($s, $r, $value); + } break; case 'replace_to': case 'tpl': - if($value!=='') return str_replace(array('[+value+]','[+output+]','{value}','%s'),$value,$opt); + if ($value!=='') { + return str_replace(array('[+value+]','[+output+]','{value}','%s'), $value, $opt); + } break; case 'eachtpl': - $value = explode('||',$value); + $value = explode('||', $value); $_ = array(); - foreach($value as $v) { - $_[] = str_replace(array('[+value+]','[+output+]','{value}','%s'),$v,$opt); + foreach ($value as $v) { + $_[] = str_replace(array('[+value+]','[+output+]','{value}','%s'), $v, $opt); } return implode("\n", $_); case 'array_pop': case 'array_shift': - if(strpos($value,'||')!==false) $delim = '||'; - else $delim = ','; - return $cmd(explode($delim,$value)); + if (strpos($value, '||')!==false) { + $delim = '||'; + } else { + $delim = ','; + } + return $cmd(explode($delim, $value)); case 'preg_replace': case 'regex_replace': - if(empty($opt) || strpos($opt,',')===false) break; - list($s,$r) = explode(',',$opt,2); - if($value!=='') return preg_replace($s,$r,$value); + if (empty($opt) || strpos($opt, ',')===false) { + break; + } + list($s, $r) = explode(',', $opt, 2); + if ($value!=='') { + return preg_replace($s, $r, $value); + } break; case 'cat': case 'concatenate': case '.': - if($value!=='') return $value . $opt; + if ($value!=='') { + return $value . $opt; + } break; case 'sprintf': case 'string_format': - if($value!=='') return sprintf($opt,$value); + if ($value!=='') { + return sprintf($opt, $value); + } break; case 'number_format': - if($opt=='') $opt = 0; - return number_format($value,$opt); + if ($opt=='') { + $opt = 0; + } + return number_format($value, $opt); case 'money_format': - setlocale(LC_MONETARY,setlocale(LC_TIME,0)); - if($value!=='') return money_format($opt,(double)$value); + setlocale(LC_MONETARY, setlocale(LC_TIME, 0)); + if ($value!=='') { + return money_format($opt, (double)$value); + } break; case 'tobool': return boolval($value); case 'nl2lf': - if($value!=='') return str_replace(array("\r\n","\n", "\r"), '\n', $value); + if ($value!=='') { + return str_replace(array("\r\n","\n", "\r"), '\n', $value); + } break; case 'br2nl': return preg_replace('@@i', "\n", $value); case 'nl2br': - if (version_compare(PHP_VERSION, '5.3.0', '<')) + if (version_compare(PHP_VERSION, '5.3.0', '<')) { return nl2br($value); - if($opt!=='') - { + } + if ($opt!=='') { $opt = trim($opt); $opt = strtolower($opt); - if($opt==='false') $opt = false; - elseif($opt==='0') $opt = false; - else $opt = true; - } - elseif(isset($modx->config['mce_element_format'])&&$modx->config['mce_element_format']==='html') - $opt = false; - else $opt = true; - return nl2br($value,$opt); + if ($opt==='false') { + $opt = false; + } elseif ($opt==='0') { + $opt = false; + } else { + $opt = true; + } + } elseif (isset($modx->config['mce_element_format'])&&$modx->config['mce_element_format']==='html') { + $opt = false; + } else { + $opt = true; + } + return nl2br($value, $opt); case 'ltrim': case 'rtrim': case 'trim': // ref http://mblo.info/modifiers/custom-modifiers/rtrim_opt.html - if($opt==='') + if ($opt==='') { return $cmd($value); - else return $cmd($value,$opt); + } else { + return $cmd($value, $opt); + } // These are all straight wrappers for PHP functions + // no break case 'ucfirst': case 'lcfirst': case 'ucwords': @@ -676,16 +800,26 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'strftime': case 'date': case 'dateformat': - if(empty($opt)) $opt = $modx->toDateFormat(null, 'formatOnly'); - if(!preg_match('@^[0-9]+$@',$value)) $value = strtotime($value); - if(strpos($opt,'%')!==false) - return strftime($opt,0+$value); - else - return date($opt,0+$value); + if (empty($opt)) { + $opt = $modx->toDateFormat(null, 'formatOnly'); + } + if (!preg_match('@^[0-9]+$@', $value)) { + $value = strtotime($value); + } + if (strpos($opt, '%')!==false) { + return strftime($opt, 0+$value); + } else { + return date($opt, 0+$value); + } + // no break case 'time': - if(empty($opt)) $opt = '%H:%M'; - if(!preg_match('@^[0-9]+$@',$value)) $value = strtotime($value); - return strftime($opt,0+$value); + if (empty($opt)) { + $opt = '%H:%M'; + } + if (!preg_match('@^[0-9]+$@', $value)) { + $value = strtotime($value); + } + return strftime($opt, 0+$value); case 'strtotime': return strtotime($value); ##### mathematical function @@ -694,11 +828,13 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'tofloat': return floatval($value); case 'round': - if(!$opt) $opt = 0; - return $cmd($value,$opt); + if (!$opt) { + $opt = 0; + } + return $cmd($value, $opt); case 'max': case 'min': - return $cmd(explode(',',$value)); + return $cmd(explode(',', $value)); case 'floor': case 'ceil': case 'abs': @@ -706,28 +842,42 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'math': case 'calc': $value = (int)$value; - if(empty($value)) $value = '0'; - $filter = str_replace(array('[+value+]','[+output+]','{value}','%s'),'?',$opt); - $filter = preg_replace('@([a-zA-Z\n\r\t\s])@','',$filter); - if(strpos($filter,'?')===false) $filter = "?{$filter}"; - $filter = str_replace('?',$value,$filter); + if (empty($value)) { + $value = '0'; + } + $filter = str_replace(array('[+value+]','[+output+]','{value}','%s'), '?', $opt); + $filter = preg_replace('@([a-zA-Z\n\r\t\s])@', '', $filter); + if (strpos($filter, '?')===false) { + $filter = "?{$filter}"; + } + $filter = str_replace('?', $value, $filter); return eval("return {$filter};"); case 'count': - if($value=='') return 0; - $value = explode(',',$value); + if ($value=='') { + return 0; + } + $value = explode(',', $value); return count($value); case 'sort': case 'rsort': - if(strpos($value,"\n")!==false) $delim="\n"; - else $delim = ','; - $swap = explode($delim,$value); - if(!$opt) $opt = SORT_REGULAR; - else $opt = constant($opt); - $cmd($swap,$opt); - return implode($delim,$swap); + if (strpos($value, "\n")!==false) { + $delim="\n"; + } else { + $delim = ','; + } + $swap = explode($delim, $value); + if (!$opt) { + $opt = SORT_REGULAR; + } else { + $opt = constant($opt); + } + $cmd($swap, $opt); + return implode($delim, $swap); ##### Resource fields case 'id': - if($opt) return $this->getDocumentObject($opt,$key); + if ($opt) { + return $this->getDocumentObject($opt, $key); + } break; case 'type': case 'contenttype': @@ -764,36 +914,44 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'privatemgr': case 'content_dispo': case 'hidemenu': - if($cmd==='contenttype') $cmd = 'contentType'; - return $this->getDocumentObject($value,$cmd); + if ($cmd==='contenttype') { + $cmd = 'contentType'; + } + return $this->getDocumentObject($value, $cmd); case 'title': - $pagetitle = $this->getDocumentObject($value,'pagetitle'); - $longtitle = $this->getDocumentObject($value,'longtitle'); + $pagetitle = $this->getDocumentObject($value, 'pagetitle'); + $longtitle = $this->getDocumentObject($value, 'longtitle'); return $longtitle ? $longtitle : $pagetitle; case 'shorttitle': - $pagetitle = $this->getDocumentObject($value,'pagetitle'); - $menutitle = $this->getDocumentObject($value,'menutitle'); + $pagetitle = $this->getDocumentObject($value, 'pagetitle'); + $menutitle = $this->getDocumentObject($value, 'menutitle'); return $menutitle ? $menutitle : $pagetitle; case 'templatename': - $rs = $modx->db->select('templatename','[+prefix+]site_templates',"id='{$value}'"); + $rs = $modx->db->select('templatename', '[+prefix+]site_templates', "id='{$value}'"); $templateName = $modx->db->getValue($rs); return !$templateName ? '(blank)' : $templateName; case 'getfield': - if(!$opt) $opt = 'content'; - return $modx->getField($opt,$value); + if (!$opt) { + $opt = 'content'; + } + return $modx->getField($opt, $value); case 'children': case 'childids': - if($value=='') $value = 0; // 値がない場合はルートと見なす + if ($value=='') { + $value = 0; + } // 値がない場合はルートと見なす $published = 1; - if($opt=='') $opt = 'page'; - $_ = explode(',',$opt); + if ($opt=='') { + $opt = 'page'; + } + $_ = explode(',', $opt); $where = array(); - foreach($_ as $opt) { - switch(trim($opt)) { - case 'page'; case '!folder'; case '!isfolder': $where[] = 'sc.isfolder=0'; break; - case 'folder'; case 'isfolder': $where[] = 'sc.isfolder=1'; break; - case 'menu'; case 'show_menu': $where[] = 'sc.hidemenu=0'; break; - case '!menu'; case '!show_menu': $where[] = 'sc.hidemenu=1'; break; + foreach ($_ as $opt) { + switch (trim($opt)) { + case 'page': case '!folder': case '!isfolder': $where[] = 'sc.isfolder=0'; break; + case 'folder': case 'isfolder': $where[] = 'sc.isfolder=1'; break; + case 'menu': case 'show_menu': $where[] = 'sc.hidemenu=0'; break; + case '!menu': case '!show_menu': $where[] = 'sc.hidemenu=1'; break; case 'published': $published = 1; break; case '!published': $published = 0; break; } @@ -801,75 +959,105 @@ public function getValueFromPreset($key, $value, $cmd, $opt) $where = implode(' AND ', $where); $children = $modx->getDocumentChildren($value, $published, '0', 'id', $where); $result = array(); - foreach((array)$children as $child){ + foreach ((array)$children as $child) { $result[] = $child['id']; } return implode(',', $result); case 'fullurl': - if(!is_numeric($value)) return $value; + if (!is_numeric($value)) { + return $value; + } return $modx->makeUrl($value); case 'makeurl': - if(!is_numeric($value)) return $value; - if(!$opt) $opt = 'full'; - return $modx->makeUrl($value,'','',$opt); + if (!is_numeric($value)) { + return $value; + } + if (!$opt) { + $opt = 'full'; + } + return $modx->makeUrl($value, '', '', $opt); ##### File system case 'getimageinfo': case 'imageinfo': - if(!is_file($value)) return ''; + if (!is_file($value)) { + return ''; + } $_ = getimagesize($value); - if(!$_[0]) return ''; + if (!$_[0]) { + return ''; + } $info['width'] = $_[0]; $info['height'] = $_[1]; - if ($_[0] > $_[1]) $info['aspect'] = 'landscape'; - elseif($_[0] < $_[1]) $info['aspect'] = 'portrait'; - else $info['aspect'] = 'square'; - switch($_[2]) { - case IMAGETYPE_GIF : $info['type'] = 'gif'; break; - case IMAGETYPE_JPEG : $info['type'] = 'jpg'; break; - case IMAGETYPE_PNG : $info['type'] = 'png'; break; - default : $info['type'] = 'unknown'; + if ($_[0] > $_[1]) { + $info['aspect'] = 'landscape'; + } elseif ($_[0] < $_[1]) { + $info['aspect'] = 'portrait'; + } else { + $info['aspect'] = 'square'; + } + switch ($_[2]) { + case IMAGETYPE_GIF: $info['type'] = 'gif'; break; + case IMAGETYPE_JPEG: $info['type'] = 'jpg'; break; + case IMAGETYPE_PNG: $info['type'] = 'png'; break; + default: $info['type'] = 'unknown'; } $info['attrib'] = $_[3]; - switch($opt) { - case 'width' : return $info['width']; + switch ($opt) { + case 'width': return $info['width']; case 'height': return $info['height']; case 'aspect': return $info['aspect']; - case 'type' : return $info['type']; + case 'type': return $info['type']; case 'attrib': return $info['attrib']; - default : return print_r($info,true); + default: return print_r($info, true); } + // no break case 'file_get_contents': case 'readfile': - if(!is_file($value)) return $value; + if (!is_file($value)) { + return $value; + } $value = realpath($value); - if(strpos($value,MODX_MANAGER_PATH)!==false) exit('Can not read core file'); - $ext = strtolower(substr($value,-4)); - if($ext==='.php') exit('Can not read php file'); - if($ext==='.cgi') exit('Can not read cgi file'); + if (strpos($value, MODX_MANAGER_PATH)!==false) { + exit('Can not read core file'); + } + $ext = strtolower(substr($value, -4)); + if ($ext==='.php') { + exit('Can not read php file'); + } + if ($ext==='.cgi') { + exit('Can not read cgi file'); + } return file_get_contents($value); case 'filesize': - if($value == '') return ''; + if ($value == '') { + return ''; + } $filename = $value; $site_url = $modx->config['site_url']; - if(strpos($filename,$site_url) === 0) - $filename = substr($filename,0,strlen($site_url)); - $filename = trim($filename,'/'); + if (strpos($filename, $site_url) === 0) { + $filename = substr($filename, 0, strlen($site_url)); + } + $filename = trim($filename, '/'); - $opt = trim($opt,'/'); - if($opt!=='') $opt .= '/'; + $opt = trim($opt, '/'); + if ($opt!=='') { + $opt .= '/'; + } - $filename = MODX_BASE_PATH.$opt.$filename; + $filename = MODX_BASE_PATH . $opt . $filename; - if(is_file($filename)){ + if (is_file($filename)) { clearstatcache(); $size = filesize($filename); return $size; + } else { + return ''; } - else return ''; ##### User info + // no break case 'username': case 'fullname': case 'role': @@ -896,41 +1084,56 @@ public function getValueFromPreset($key, $value, $cmd, $opt) $this->opt = $cmd; return $this->includeMdfFile('moduser'); case 'userinfo': - if(empty($opt)) $this->opt = 'username'; + if (empty($opt)) { + $this->opt = 'username'; + } return $this->includeMdfFile('moduser'); case 'webuserinfo': - if(empty($opt)) $this->opt = 'username'; + if (empty($opt)) { + $this->opt = 'username'; + } $this->value = -$value; return $this->includeMdfFile('moduser'); ##### Special functions case 'ifempty': case '_default': case 'default': - if (empty($value)) return $opt; break; + if (empty($value)) { + return $opt; + } break; case 'ifnotempty': - if (!empty($value)) return $opt; break; + if (!empty($value)) { + return $opt; + } break; case 'datagrid': include_once(MODX_CORE_PATH . 'controls/datagrid.class.php'); $grd = new DataGrid(null, trim($value)); $grd->itemStyle = ''; $grd->altItemStyle = ''; - $pos = strpos($value,"\n"); - if($pos) $_ = substr($value,0,$pos); - else $_ = $pos; - $grd->cdelim = strpos($_,"\t")!==false ? 'tab' : ','; + $pos = strpos($value, "\n"); + if ($pos) { + $_ = substr($value, 0, $pos); + } else { + $_ = $pos; + } + $grd->cdelim = strpos($_, "\t")!==false ? 'tab' : ','; return $grd->render(); case 'rotate': case 'evenodd': - if(strpos($opt,',')===false) $opt = 'odd,even'; + if (strpos($opt, ',')===false) { + $opt = 'odd,even'; + } $_ = explode(',', $opt); $c = count($_); $i = $value + $c; $i = $i % $c; return $_[$i]; case 'takeval': - $arr = explode(",",$opt); + $arr = explode(",", $opt); $idx = $value; - if(!is_numeric($idx)) return $value; + if (!is_numeric($idx)) { + return $value; + } return $arr[$idx]; case 'getimage': return $this->includeMdfFile('getimage'); @@ -938,17 +1141,21 @@ public function getValueFromPreset($key, $value, $cmd, $opt) return $modx->nicesize($value); case 'googlemap': case 'googlemaps': - if(empty($opt)) $opt = 'border:none;width:500px;height:350px;'; + if (empty($opt)) { + $opt = 'border:none;width:500px;height:350px;'; + } $tpl = ''; $ph['style'] = $opt; $ph['value'] = $value; - return $modx->parseText($tpl,$ph); + return $modx->parseText($tpl, $ph); case 'youtube': case 'youtube16x9': - if(empty($opt)) $opt = 560; + if (empty($opt)) { + $opt = 560; + } $h = round($opt*0.5625); $tpl = ''; - return sprintf($tpl,$opt,$h,$value); + return sprintf($tpl, $opt, $h, $value); //case 'youtube4x3':%s*0.75+25 case 'setvar': $modx->placeholders[$opt] = $value; @@ -978,66 +1185,77 @@ public function getValueFromPreset($key, $value, $cmd, $opt) return $value; } - public function includeMdfFile($cmd) { + public function includeMdfFile($cmd) + { $modx = evolutionCMS(); $key = $this->key; $value = $this->value; $opt = $this->opt; - return include(MODX_CORE_PATH."extenders/modifiers/mdf_{$cmd}.inc.php"); + return include(MODX_CORE_PATH . "extenders/modifiers/mdf_{$cmd}.inc.php"); } public function getValueFromElement($key, $value, $cmd, $opt) { $modx = evolutionCMS(); - if( isset($modx->snippetCache[$this->elmName]) ) - { + if (isset($modx->snippetCache[$this->elmName])) { $php = $modx->snippetCache[$this->elmName]; - } - else - { + } else { $esc_elmName = $modx->db->escape($this->elmName); - $result = $modx->db->select('snippet','[+prefix+]site_snippets',"name='{$esc_elmName}'"); + $result = $modx->db->select('snippet', '[+prefix+]site_snippets', "name='{$esc_elmName}'"); $total = $modx->db->getRecordCount($result); - if($total == 1) - { + if ($total == 1) { $row = $modx->db->getRow($result); $php = $row['snippet']; - } - elseif($total == 0) - { - $assets_path = MODX_BASE_PATH.'assets/'; - if(is_file($assets_path."modifiers/mdf_{$cmd}.inc.php")) - $modifiers_path = $assets_path."modifiers/mdf_{$cmd}.inc.php"; - elseif(is_file($assets_path."plugins/phx/modifiers/{$cmd}.phx.php")) - $modifiers_path = $assets_path."plugins/phx/modifiers/{$cmd}.phx.php"; - elseif(is_file(MODX_CORE_PATH."extenders/modifiers/mdf_{$cmd}.inc.php")) - $modifiers_path = MODX_CORE_PATH."extenders/modifiers/mdf_{$cmd}.inc.php"; - else $modifiers_path = false; - - if($modifiers_path !== false) { + } elseif ($total == 0) { + $assets_path = MODX_BASE_PATH . 'assets/'; + if (is_file($assets_path . "modifiers/mdf_{$cmd}.inc.php")) { + $modifiers_path = $assets_path . "modifiers/mdf_{$cmd}.inc.php"; + } elseif (is_file($assets_path . "plugins/phx/modifiers/{$cmd}.phx.php")) { + $modifiers_path = $assets_path . "plugins/phx/modifiers/{$cmd}.phx.php"; + } elseif (is_file(MODX_CORE_PATH . "extenders/modifiers/mdf_{$cmd}.inc.php")) { + $modifiers_path = MODX_CORE_PATH . "extenders/modifiers/mdf_{$cmd}.inc.php"; + } else { + $modifiers_path = false; + } + + if ($modifiers_path !== false) { $php = @file_get_contents($modifiers_path); $php = trim($php); - if(substr($php,0,5)==='') $php = substr($php,0,-2); - if($this->elmName!=='') - $modx->snippetCache[$this->elmName.'Props'] = ''; - } - else + if (substr($php, 0, 5)==='') { + $php = substr($php, 0, -2); + } + if ($this->elmName!=='') { + $modx->snippetCache[$this->elmName . 'Props'] = ''; + } + } else { $php = false; + } + } else { + $php = false; } - else $php = false; - if($this->elmName!=='') $modx->snippetCache[$this->elmName]= $php; + if ($this->elmName!=='') { + $modx->snippetCache[$this->elmName]= $php; + } + } + if ($php==='') { + $php=false; } - if($php==='') $php=false; - if($php===false) $html = $modx->getChunk($this->elmName); - else $html = false; + if ($php===false) { + $html = $modx->getChunk($this->elmName); + } else { + $html = false; + } $self = '[+output+]'; - if($php !== false) - { + if ($php !== false) { ob_start(); $options = $opt; $output = $value; @@ -1049,20 +1267,20 @@ public function getValueFromElement($key, $value, $cmd, $opt) $this->vars['options'] = & $opt; $custom = eval($php); $msg = ob_get_contents(); - if($value===$this->bt) $value = $msg . $custom; + if ($value===$this->bt) { + $value = $msg . $custom; + } ob_end_clean(); - } - elseif($html!==false && isset($value) && $value!=='') - { + } elseif ($html!==false && isset($value) && $value!=='') { $html = str_replace(array($self,'[+value+]'), $value, $html); $value = str_replace(array('[+options+]','[+param+]'), $opt, $html); + } else { + return false; } - else return false; - if($php===false && $html===false && $value!=='' - && (strpos($cmd,'[+value+]')!==false || strpos($cmd,$self)!==false)) - { - $value = str_replace(array('[+value+]',$self),$value,$cmd); + if ($php===false && $html===false && $value!=='' + && (strpos($cmd, '[+value+]')!==false || strpos($cmd, $self)!==false)) { + $value = str_replace(array('[+value+]',$self), $value, $cmd); } return $value; } @@ -1071,139 +1289,190 @@ public function parseDocumentSource($content='') { $modx = evolutionCMS(); - if(strpos($content,'[')===false && strpos($content,'{')===false) return $content; + if (strpos($content, '[')===false && strpos($content, '{')===false) { + return $content; + } - if(!$modx->maxParserPasses) $modx->maxParserPasses = 10; + if (!$modx->maxParserPasses) { + $modx->maxParserPasses = 10; + } $bt=''; $i=0; - while($bt!==$content) - { + while ($bt!==$content) { $bt = $content; - if(strpos($content,'[*')!==false && $modx->documentIdentifier) - $content = $modx->mergeDocumentContent($content); - if(strpos($content,'[(')!==false) $content = $modx->mergeSettingsContent($content); - if(strpos($content,'{{')!==false) $content = $modx->mergeChunkContent($content); - if(strpos($content,'[!')!==false) $content = str_replace(array('[!','!]'),array('[[',']]'),$content); - if(strpos($content,'[[')!==false) $content = $modx->evalSnippets($content); - - if($content===$bt) break; - if($modx->maxParserPasses < $i) break; + if (strpos($content, '[*')!==false && $modx->documentIdentifier) { + $content = $modx->mergeDocumentContent($content); + } + if (strpos($content, '[(')!==false) { + $content = $modx->mergeSettingsContent($content); + } + if (strpos($content, '{{')!==false) { + $content = $modx->mergeChunkContent($content); + } + if (strpos($content, '[!')!==false) { + $content = str_replace(array('[!','!]'), array('[[',']]'), $content); + } + if (strpos($content, '[[')!==false) { + $content = $modx->evalSnippets($content); + } + + if ($content===$bt) { + break; + } + if ($modx->maxParserPasses < $i) { + break; + } $i++; } return $content; } - public function getDocumentObject($target='',$field='pagetitle') + public function getDocumentObject($target='', $field='pagetitle') { $modx = evolutionCMS(); $target = trim($target); - if(empty($target)) $target = $modx->config['site_start']; - if(preg_match('@^[1-9][0-9]*$@',$target)) $method='id'; - else $method = 'alias'; + if (empty($target)) { + $target = $modx->config['site_start']; + } + if (preg_match('@^[1-9][0-9]*$@', $target)) { + $method='id'; + } else { + $method = 'alias'; + } - if(!isset($this->documentObject[$target])) - { - $this->documentObject[$target] = $modx->getDocumentObject($method,$target,'direct'); + if (!isset($this->documentObject[$target])) { + $this->documentObject[$target] = $modx->getDocumentObject($method, $target, 'direct'); } - if($this->documentObject[$target]['publishedon']==='0') + if ($this->documentObject[$target]['publishedon']==='0') { return ''; - elseif(isset($this->documentObject[$target][$field])) - { - if(is_array($this->documentObject[$target][$field])) - { - $a = $modx->getTemplateVarOutput($field,$target); + } elseif (isset($this->documentObject[$target][$field])) { + if (is_array($this->documentObject[$target][$field])) { + $a = $modx->getTemplateVarOutput($field, $target); $this->documentObject[$target][$field] = $a[$field]; } + } else { + $this->documentObject[$target][$field] = false; } - else $this->documentObject[$target][$field] = false; return $this->documentObject[$target][$field]; } - public function setPlaceholders($value = '', $key = '', $path = '') { - if($path!=='') $key = "{$path}.{$key}"; + public function setPlaceholders($value = '', $key = '', $path = '') + { + if ($path!=='') { + $key = "{$path}.{$key}"; + } if (is_array($value)) { foreach ($value as $subkey => $subval) { $this->setPlaceholders($subval, $subkey, $key); } + } else { + $this->setModifiersVariable($key, $value); } - else $this->setModifiersVariable($key, $value); } // Sets a placeholder variable which can only be access by Modifiers - public function setModifiersVariable($key, $value) { - if ($key != 'phx' && $key != 'dummy') $this->placeholders[$key] = $value; + public function setModifiersVariable($key, $value) + { + if ($key != 'phx' && $key != 'dummy') { + $this->placeholders[$key] = $value; + } } //mbstring - public function substr($str, $s, $l = null) { + public function substr($str, $s, $l = null) + { $modx = evolutionCMS(); - if(is_null($l)) $l = $this->strlen($str); - if (function_exists('mb_substr')) - { - if(strpos($str,"\r")!==false) + if (is_null($l)) { + $l = $this->strlen($str); + } + if (function_exists('mb_substr')) { + if (strpos($str, "\r")!==false) { $str = str_replace(array("\r\n","\r"), "\n", $str); + } return mb_substr($str, $s, $l, $modx->config['modx_charset']); } return substr($str, $s, $l); } - public function strpos($haystack,$needle,$offset=0) { + public function strpos($haystack, $needle, $offset=0) + { $modx = evolutionCMS(); - if (function_exists('mb_strpos')) return mb_strpos($haystack,$needle,$offset,$modx->config['modx_charset']); - return strpos($haystack,$needle,$offset); + if (function_exists('mb_strpos')) { + return mb_strpos($haystack, $needle, $offset, $modx->config['modx_charset']); + } + return strpos($haystack, $needle, $offset); } - public function strlen($str) { + public function strlen($str) + { $modx = evolutionCMS(); - if (function_exists('mb_strlen')) return mb_strlen(str_replace("\r\n", "\n", $str),$modx->config['modx_charset']); + if (function_exists('mb_strlen')) { + return mb_strlen(str_replace("\r\n", "\n", $str), $modx->config['modx_charset']); + } return strlen($str); } - public function strtolower($str) { - if (function_exists('mb_strtolower')) return mb_strtolower($str); + public function strtolower($str) + { + if (function_exists('mb_strtolower')) { + return mb_strtolower($str); + } return strtolower($str); } - public function strtoupper($str) { - if (function_exists('mb_strtoupper')) return mb_strtoupper($str); + public function strtoupper($str) + { + if (function_exists('mb_strtoupper')) { + return mb_strtoupper($str); + } return strtoupper($str); } - public function ucfirst($str) { - if (function_exists('mb_strtoupper')) - return mb_strtoupper($this->substr($str, 0, 1)).$this->substr($str, 1, $this->strlen($str)); + public function ucfirst($str) + { + if (function_exists('mb_strtoupper')) { + return mb_strtoupper($this->substr($str, 0, 1)) . $this->substr($str, 1, $this->strlen($str)); + } return ucfirst($str); } - public function lcfirst($str) { - if (function_exists('mb_strtolower')) - return mb_strtolower($this->substr($str, 0, 1)).$this->substr($str, 1, $this->strlen($str)); + public function lcfirst($str) + { + if (function_exists('mb_strtolower')) { + return mb_strtolower($this->substr($str, 0, 1)) . $this->substr($str, 1, $this->strlen($str)); + } return lcfirst($str); } - public function ucwords($str) { - if (function_exists('mb_convert_case')) + public function ucwords($str) + { + if (function_exists('mb_convert_case')) { return mb_convert_case($str, MB_CASE_TITLE); + } return ucwords($str); } - public function strrev($str) { + public function strrev($str) + { preg_match_all('/./us', $str, $ar); return implode(array_reverse($ar[0])); } - public function str_shuffle($str) { + public function str_shuffle($str) + { preg_match_all('/./us', $str, $ar); shuffle($ar[0]); return implode($ar[0]); } - public function str_word_count($str) { - return count(preg_split('~[^\p{L}\p{N}\']+~u',$str)); + public function str_word_count($str) + { + return count(preg_split('~[^\p{L}\p{N}\']+~u', $str)); } - public function strip_tags($value,$params='') { + public function strip_tags($value, $params='') + { $modx = evolutionCMS(); - if(stripos($params,'style')===false && stripos($value,'')!==false) { + if (stripos($params, 'style')===false && stripos($value, '')!==false) { $value = preg_replace('@.*?@is', '', $value); } - if(stripos($params,'script')===false && stripos($value,'')!==false) { + if (stripos($params, 'script')===false && stripos($value, '')!==false) { $value = preg_replace('@.*?@is', '', $value); } - return trim(strip_tags($value,$params)); + return trim(strip_tags($value, $params)); } } diff --git a/manager/includes/extenders/modifiers/mdf_addbreak.inc.php b/manager/includes/extenders/modifiers/mdf_addbreak.inc.php index 03c3a1abff..8568eb5f9a 100755 --- a/manager/includes/extenders/modifiers/mdf_addbreak.inc.php +++ b/manager/includes/extenders/modifiers/mdf_addbreak.inc.php @@ -1,22 +1,23 @@ filter->parseDocumentSource($value); -$text = str_replace(array("\r\n","\r"),"\n",$text); +$text = str_replace(array("\r\n","\r"), "\n", $text); $blockElms = 'br,table,tbody,tr,td,th,thead,tfoot,caption,colgroup,div'; $blockElms .= ',dl,dd,dt,ul,ol,li,pre,select,option,form,map,area,blockquote'; $blockElms .= ',address,math,style,input,p,h1,h2,h3,h4,h5,h6,hr,object,param,embed'; $blockElms .= ',noframes,noscript,section,article,aside,hgroup,footer,address,code'; $blockElms = explode(',', $blockElms); -$lines = explode("\n",$text); +$lines = explode("\n", $text); $c = count($lines); -foreach($lines as $i=>$line) -{ +foreach ($lines as $i=>$line) { $line = rtrim($line); - if($i===$c-1) break; - foreach($blockElms as $block) - { - if(preg_match("@]*>$@',$line)) + if ($i===$c-1) { + break; + } + foreach ($blockElms as $block) { + if (preg_match("@]*>$@', $line)) { continue 2; + } } $lines[$i] = "{$line}
    "; } diff --git a/manager/includes/extenders/modifiers/mdf_getimage.inc.php b/manager/includes/extenders/modifiers/mdf_getimage.inc.php index 9f68f3ce0b..dce110774c 100755 --- a/manager/includes/extenders/modifiers/mdf_getimage.inc.php +++ b/manager/includes/extenders/modifiers/mdf_getimage.inc.php @@ -1,16 +1,17 @@ ]+>/i'; -preg_match_all($pattern , $value , $images); -if($opt==='') -{ - if($images[1][0]) return $images[1][0]; - else return ''; -} -else -{ - foreach($images[0] as $i=>$image) - { - if(strpos($image,$opt)!==false) return $images[1][$i]; +preg_match_all($pattern, $value, $images); +if ($opt==='') { + if ($images[1][0]) { + return $images[1][0]; + } else { + return ''; + } +} else { + foreach ($images[0] as $i=>$image) { + if (strpos($image, $opt)!==false) { + return $images[1][$i]; + } } } diff --git a/manager/includes/extenders/modifiers/mdf_memberof.inc.php b/manager/includes/extenders/modifiers/mdf_memberof.inc.php index 011b882534..c2105bd668 100755 --- a/manager/includes/extenders/modifiers/mdf_memberof.inc.php +++ b/manager/includes/extenders/modifiers/mdf_memberof.inc.php @@ -1,23 +1,28 @@ getLoginUserID('web')); -$modx->qs_hash = md5($modx->qs_hash."^{$userID}^"); +$modx->qs_hash = md5($modx->qs_hash . "^{$userID}^"); -$groupNames = ($this->strlen($opt) > 0 ) ? explode(',',$opt) : array(); +$groupNames = ($this->strlen($opt) > 0) ? explode(',', $opt) : array(); // if $groupNames is not an array return false -if(!is_array($groupNames)) return 0; +if (!is_array($groupNames)) { + return 0; +} // Creates an array with all webgroups the user id is in -if (isset($modx->filter->cache['mo'][$userID])) $grpNames = $modx->filter->cache['mo'][$userID]; -else { - $from = sprintf("[+prefix+]webgroup_names wgn INNER JOIN [+prefix+]web_groups wg ON wg.webgroup=wgn.id AND wg.webuser='%s'",$userID); - $rs = $modx->db->select('wgn.name',$from); - $modx->filter->cache['mo'][$userID] = $grpNames = $modx->db->getColumn('name',$rs); +if (isset($modx->filter->cache['mo'][$userID])) { + $grpNames = $modx->filter->cache['mo'][$userID]; +} else { + $from = sprintf("[+prefix+]webgroup_names wgn INNER JOIN [+prefix+]web_groups wg ON wg.webgroup=wgn.id AND wg.webuser='%s'", $userID); + $rs = $modx->db->select('wgn.name', $from); + $modx->filter->cache['mo'][$userID] = $grpNames = $modx->db->getColumn('name', $rs); } // Check if a supplied group matches a webgroup from the array we just created -foreach($groupNames as $k=>$v) { - if(in_array(trim($v),$grpNames)) return 1; +foreach ($groupNames as $k=>$v) { + if (in_array(trim($v), $grpNames)) { + return 1; + } } // If we get here the above logic did not find a match, so return false diff --git a/manager/includes/extenders/modifiers/mdf_moduser.inc.php b/manager/includes/extenders/modifiers/mdf_moduser.inc.php index 1349964cef..3cb23bbb44 100755 --- a/manager/includes/extenders/modifiers/mdf_moduser.inc.php +++ b/manager/includes/extenders/modifiers/mdf_moduser.inc.php @@ -1,8 +1,11 @@ filter->cache['ui'][$userid])) { - if ($userid < 0) $user = $modx->getWebUserInfo(abs($userid)); - else $user = $modx->getUserInfo($userid); + if ($userid < 0) { + $user = $modx->getWebUserInfo(abs($userid)); + } else { + $user = $modx->getUserInfo($userid); + } $modx->filter->cache['ui'][$userid] = $user; } else { $user = $modx->filter->cache['ui'][$userid]; diff --git a/manager/includes/extenders/modifiers/mdf_summary.inc.php b/manager/includes/extenders/modifiers/mdf_summary.inc.php index 4cb0dd703b..f40a7c57cb 100755 --- a/manager/includes/extenders/modifiers/mdf_summary.inc.php +++ b/manager/includes/extenders/modifiers/mdf_summary.inc.php @@ -1,43 +1,64 @@ config['manager_language']==='japanese-utf8' ? '。' : '.'; +if ($delim==='') { + $delim = $modx->config['manager_language']==='japanese-utf8' ? '。' : '.'; +} $limit = (int)$limit; $content = $modx->filter->parseDocumentSource($value); $content = strip_tags($content); -$content = str_replace(array("\r\n","\r","\n","\t",' '),' ',$content); -if(preg_match('/\s+/',$content)) - $content = preg_replace('/\s+/',' ',$content); +$content = str_replace(array("\r\n","\r","\n","\t",' '), ' ', $content); +if (preg_match('/\s+/', $content)) { + $content = preg_replace('/\s+/', ' ', $content); +} $content = trim($content); $pos = $modx->filter->strpos($content, $delim); -if($pos!==false && $pos<$limit) { +if ($pos!==false && $pos<$limit) { $_ = explode($delim, $content); $text = ''; - foreach($_ as $v) { - if($limit <= $modx->filter->strlen($text.$v.$delim)) break; - $text .= $v.$delim; + foreach ($_ as $v) { + if ($limit <= $modx->filter->strlen($text . $v . $delim)) { + break; + } + $text .= $v . $delim; + } + if ($text) { + $content = $text; } - if($text) $content = $text; } -if($limit<$modx->filter->strlen($content) && strpos($content,' ')!==false) { +if ($limit<$modx->filter->strlen($content) && strpos($content, ' ')!==false) { $_ = explode(' ', $content); $text = ''; - foreach($_ as $v) { - if($limit <= $modx->filter->strlen($text.$v.' ')) break; + foreach ($_ as $v) { + if ($limit <= $modx->filter->strlen($text . $v . ' ')) { + break; + } $text .= $v . ' '; } - if($text!=='') $content = $text; + if ($text!=='') { + $content = $text; + } } -if($limit < $modx->filter->strlen($content)) $content = $modx->filter->substr($content, 0, $limit); -if($modx->filter->substr($content,-1)==$delim) $content = rtrim($content,$delim) . $delim; +if ($limit < $modx->filter->strlen($content)) { + $content = $modx->filter->substr($content, 0, $limit); +} +if ($modx->filter->substr($content, -1)==$delim) { + $content = rtrim($content, $delim) . $delim; +} return $content; diff --git a/manager/includes/extenders/modifiers/mdf_wordwrap.inc.php b/manager/includes/extenders/modifiers/mdf_wordwrap.inc.php index 2613e8094b..5afbd2a85a 100755 --- a/manager/includes/extenders/modifiers/mdf_wordwrap.inc.php +++ b/manager/includes/extenders/modifiers/mdf_wordwrap.inc.php @@ -1,2 +1,4 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } global $SystemAlertMsgQueque; // display system alert window if messages are available -if(count($SystemAlertMsgQueque) > 0) { - include "sysalert.display.inc.php"; +if (count($SystemAlertMsgQueque) > 0) { + include "sysalert.display.inc.php"; } ?> manager->action, array( - 85, - 27, - 4, - 72, - 13, - 11, - 12, - 87, - 88 +if (in_array($modx->manager->action, array( + 85, + 27, + 4, + 72, + 13, + 11, + 12, + 87, + 88 ))) { - echo $modx->manager->loadDatePicker($modx->config['mgr_date_picker_path']); + echo $modx->manager->loadDatePicker($modx->config['mgr_date_picker_path']); } ?> diff --git a/manager/includes/header.inc.php b/manager/includes/header.inc.php index 147c0f6e04..a3b92dfb05 100755 --- a/manager/includes/header.inc.php +++ b/manager/includes/header.inc.php @@ -66,16 +66,20 @@ ' . "\n", $modx->config['mgr_jquery_path']) ?> - config['show_picker'] != "0") { ?> + config['show_picker'] != "0") { + ?> - + + if (!in_array($_REQUEST['a'], $aArr)) { + ?> - + diff --git a/manager/includes/log.class.inc.php b/manager/includes/log.class.inc.php index c6855d14c3..42cd407691 100755 --- a/manager/includes/log.class.inc.php +++ b/manager/includes/log.class.inc.php @@ -106,16 +106,16 @@ public function writeToLog() } } - private function getUserIP() { - if( array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER) && !empty($_SERVER['HTTP_X_FORWARDED_FOR']) ) { + private function getUserIP() + { + if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER) && !empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',')>0) { - $addr = explode(",",$_SERVER['HTTP_X_FORWARDED_FOR']); + $addr = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']); return trim($addr[0]); } else { return $_SERVER['HTTP_X_FORWARDED_FOR']; } - } - else { + } else { return $_SERVER['REMOTE_ADDR']; } } diff --git a/manager/includes/manager.lockout.inc.php b/manager/includes/manager.lockout.inc.php index 400371a225..02e179df9e 100755 --- a/manager/includes/manager.lockout.inc.php +++ b/manager/includes/manager.lockout.inc.php @@ -1,75 +1,68 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if($modx->manager->action!='8' && isset($_SESSION['mgrValidated'])){ - +if ($modx->manager->action!='8' && isset($_SESSION['mgrValidated'])) { $homeurl = $modx->makeUrl($manager_login_startup>0 ? $manager_login_startup:$site_start); - $logouturl = MODX_MANAGER_URL.'index.php?a=8'; + $logouturl = MODX_MANAGER_URL . 'index.php?a=8'; - $modx->setPlaceholder('modx_charset',$modx_manager_charset); - $modx->setPlaceholder('theme',$manager_theme); + $modx->setPlaceholder('modx_charset', $modx_manager_charset); + $modx->setPlaceholder('theme', $manager_theme); - $modx->setPlaceholder('site_name',$site_name); - $modx->setPlaceholder('logo_slogan',$_lang["logo_slogan"]); - $modx->setPlaceholder('manager_lockout_message',$_lang["manager_lockout_message"]); + $modx->setPlaceholder('site_name', $site_name); + $modx->setPlaceholder('logo_slogan', $_lang["logo_slogan"]); + $modx->setPlaceholder('manager_lockout_message', $_lang["manager_lockout_message"]); - $modx->setPlaceholder('home',$_lang["home"]); - $modx->setPlaceholder('homeurl',$homeurl); - $modx->setPlaceholder('logout',$_lang["logout"]); - $modx->setPlaceholder('logouturl',$logouturl); - $modx->setPlaceholder('manager_theme_url',MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/'); - $modx->setPlaceholder('year',date('Y')); + $modx->setPlaceholder('home', $_lang["home"]); + $modx->setPlaceholder('homeurl', $homeurl); + $modx->setPlaceholder('logout', $_lang["logout"]); + $modx->setPlaceholder('logouturl', $logouturl); + $modx->setPlaceholder('manager_theme_url', MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/'); + $modx->setPlaceholder('year', date('Y')); // load template - if(!isset($modx->config['manager_lockout_tpl']) || empty($modx->config['manager_lockout_tpl'])) { - $modx->config['manager_lockout_tpl'] = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; + if (!isset($modx->config['manager_lockout_tpl']) || empty($modx->config['manager_lockout_tpl'])) { + $modx->config['manager_lockout_tpl'] = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; } $target = $modx->config['manager_lockout_tpl']; $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target); $target = $modx->mergeSettingsContent($target); - if(substr($target,0,1)==='@') { - if(substr($target,0,6)==='@CHUNK') { - $target = trim(substr($target,7)); - $lockout_tpl = $modx->getChunk($target); - } - elseif(substr($target,0,5)==='@FILE') { - $target = trim(substr($target,6)); - $lockout_tpl = file_get_contents($target); - } - } else { - $chunk = $modx->getChunk($target); - if($chunk!==false && !empty($chunk)) { - $lockout_tpl = $chunk; - } - elseif(is_file(MODX_BASE_PATH . $target)) { - $target = MODX_BASE_PATH . $target; - $lockout_tpl = file_get_contents($target); - } - elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl')) { - $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl'; - $lockout_tpl = file_get_contents($target); - } - elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl')) { - $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl'; - $login_tpl = file_get_contents($target); - } - elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html')) { // ClipperCMS compatible - $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html'; - $lockout_tpl = file_get_contents($target); - } - else { - $target = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; - $lockout_tpl = file_get_contents($target); - } - } + if (substr($target, 0, 1)==='@') { + if (substr($target, 0, 6)==='@CHUNK') { + $target = trim(substr($target, 7)); + $lockout_tpl = $modx->getChunk($target); + } elseif (substr($target, 0, 5)==='@FILE') { + $target = trim(substr($target, 6)); + $lockout_tpl = file_get_contents($target); + } + } else { + $chunk = $modx->getChunk($target); + if ($chunk!==false && !empty($chunk)) { + $lockout_tpl = $chunk; + } elseif (is_file(MODX_BASE_PATH . $target)) { + $target = MODX_BASE_PATH . $target; + $lockout_tpl = file_get_contents($target); + } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl')) { + $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl'; + $lockout_tpl = file_get_contents($target); + } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl')) { + $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl'; + $login_tpl = file_get_contents($target); + } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html')) { // ClipperCMS compatible + $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html'; + $lockout_tpl = file_get_contents($target); + } else { + $target = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; + $lockout_tpl = file_get_contents($target); + } + } // merge placeholders $lockout_tpl = $modx->mergePlaceholderContent($lockout_tpl); - $regx = strpos($lockout_tpl,'[[+')!==false ? '~\[\[\+(.*?)\]\]~' : '~\[\+(.*?)\+\]~'; // little tweak for newer parsers + $regx = strpos($lockout_tpl, '[[+')!==false ? '~\[\[\+(.*?)\]\]~' : '~\[\+(.*?)\+\]~'; // little tweak for newer parsers $lockout_tpl = preg_replace($regx, '', $lockout_tpl); //cleanup echo $lockout_tpl; diff --git a/manager/includes/menu.class.inc.php b/manager/includes/menu.class.inc.php index d131fc79f7..438d6bedbe 100755 --- a/manager/includes/menu.class.inc.php +++ b/manager/includes/menu.class.inc.php @@ -68,7 +68,6 @@ public function DrawSub($parentid, $level) $output = ''; if (isset($this->menu[$parentid])) { - $ph = array(); $countChild = 0; $itemTpl = ' @@ -102,7 +101,7 @@ public function DrawSub($parentid, $level) $level++; $ph['DrawSub'] = $this->DrawSub($id, $level); $level--; - // Optional buttons + // Optional buttons } else { if (isset($value[11]) && !empty($value[11])) { $optionalButton = ''; diff --git a/manager/includes/preload.functions.inc.php b/manager/includes/preload.functions.inc.php index e348415912..a2494134af 100755 --- a/manager/includes/preload.functions.inc.php +++ b/manager/includes/preload.functions.inc.php @@ -4,14 +4,14 @@ $site_sessionname = genEvoSessionName(); // For legacy extras not using startCMSSession -if( ! function_exists('evolutionCMS')) { +if (! function_exists('evolutionCMS')) { /** * @return DocumentParser */ function evolutionCMS() { - if( ! defined('MODX_CLASS')) { - if( ! class_exists('DocumentParser')) { + if (! defined('MODX_CLASS')) { + if (! class_exists('DocumentParser')) { throw new RuntimeException('MODX_CLASS not defined and DocumentParser class not exists'); } define('MODX_CLASS', 'DocumentParser'); @@ -38,12 +38,14 @@ function genEvoSessionName() function startCMSSession() { global $site_sessionname, $https_port, $session_cookie_path, $session_cookie_domain; - if(MODX_CLI) return; + if (MODX_CLI) { + return; + } session_name($site_sessionname); removeInvalidCmsSessionIds($site_sessionname); $cookieExpiration = 0; - $secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port); + $secure = ((isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port); $cookiePath = !empty($session_cookie_path) ? $session_cookie_path : MODX_BASE_URL; $cookieDomain = !empty($session_cookie_domain) ? $session_cookie_domain : ''; session_set_cookie_params($cookieExpiration, $cookiePath, $cookieDomain, $secure, true); @@ -79,7 +81,9 @@ function removeInvalidCmsSessionFromStorage(&$storage, $session_name) */ function removeInvalidCmsSessionIds($session_name) { - if(MODX_CLI) return; + if (MODX_CLI) { + return; + } // session ids is invalid iff it is empty string // storage priorioty can see in PHP source ext/session/session.c removeInvalidCmsSessionFromStorage($_COOKIE, $session_name); diff --git a/manager/includes/protect.inc.php b/manager/includes/protect.inc.php index f868ed98b8..968e76eff1 100755 --- a/manager/includes/protect.inc.php +++ b/manager/includes/protect.inc.php @@ -77,8 +77,8 @@ function getSanitizedValue($value = '') modx_sanitize_gpc($_REQUEST); foreach (array('PHP_SELF', 'HTTP_USER_AGENT', 'HTTP_REFERER', 'QUERY_STRING') as $key) { - $_SERVER[$key] = isset ($_SERVER[$key]) ? htmlspecialchars($_SERVER[$key], ENT_QUOTES) : null; + $_SERVER[$key] = isset($_SERVER[$key]) ? htmlspecialchars($_SERVER[$key], ENT_QUOTES) : null; } // Unset vars -unset ($key, $value); +unset($key, $value); diff --git a/manager/includes/sysalert.display.inc.php b/manager/includes/sysalert.display.inc.php index 0b97e73b96..8300f08e49 100755 --- a/manager/includes/sysalert.display.inc.php +++ b/manager/includes/sysalert.display.inc.php @@ -1,38 +1,37 @@ "; - } - // reset message queque - unset($_SESSION['SystemAlertMsgQueque']); - $_SESSION['SystemAlertMsgQueque'] = array(); - $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque']; + $sysMsgs = ""; + $limit = count($SystemAlertMsgQueque); + for ($i=0;$i<$limit;$i++) { + $sysMsgs .= $SystemAlertMsgQueque[$i] . "
    "; + } + // reset message queque + unset($_SESSION['SystemAlertMsgQueque']); + $_SESSION['SystemAlertMsgQueque'] = array(); + $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque']; - if($sysMsgs!="") { -?> + if ($sysMsgs!="") { + ?> '; -?> + echo ''; ?> \ No newline at end of file diff --git a/manager/includes/template.parser.class.inc.php b/manager/includes/template.parser.class.inc.php index cc999700ad..8cf3029481 100755 --- a/manager/includes/template.parser.class.inc.php +++ b/manager/includes/template.parser.class.inc.php @@ -7,182 +7,185 @@ * */ -Class TemplateParser { +class TemplateParser +{ /** - * @param array $config [action, tabs, toArray] - * @param array $data - * @return string - */ - public function output($config = array(), $data = array()) { + * @param array $config [action, tabs, toArray] + * @param array $data + * @return string + */ + public function output($config = array(), $data = array()) + { $modx = evolutionCMS(); - $output = ''; - $action = !empty($config['action']) ? $config['action'] : (!empty($_REQUEST['a']) ? $_REQUEST['a'] : ''); - $tab = isset($config['tab']) ? ' AND tab IN(' . $config['tab'] . ')' : ''; + $output = ''; + $action = !empty($config['action']) ? $config['action'] : (!empty($_REQUEST['a']) ? $_REQUEST['a'] : ''); + $tab = isset($config['tab']) ? ' AND tab IN(' . $config['tab'] . ')' : ''; - if($action) { - $sql = $modx->db->query('SELECT t1.*, IF(t1.alias=\'\',t1.name,t1.alias) AS alias, t2.category AS category_name + if ($action) { + $sql = $modx->db->query('SELECT t1.*, IF(t1.alias=\'\',t1.name,t1.alias) AS alias, t2.category AS category_name FROM ' . $modx->getFullTableName('system_templates') . ' AS t1 INNER JOIN ' . $modx->getFullTableName('categories') . ' AS t2 ON t2.id=t1.category WHERE t1.action IN(' . $action . ') ' . $tab . ' ORDER BY t1.tab ASC, t1.rank ASC'); - if($modx->db->getRecordCount($sql)) { - $tabs = array(); - while($row = $modx->db->getRow($sql)) { - if(!$row['value'] && !empty($data[$row['name']])) { - $row['value'] = $data[$row['name']]; - } - $tabs[$row['tab']]['category_name'] = $row['category_name']; - $tabs[$row['tab']][$row['name']] = TemplateParser::render($row); - } - - if(!empty($config['toArray'])) { - $output = $tabs; - } else { - $output .= '
    '; - $output .= ' + if ($modx->db->getRecordCount($sql)) { + $tabs = array(); + while ($row = $modx->db->getRow($sql)) { + if (!$row['value'] && !empty($data[$row['name']])) { + $row['value'] = $data[$row['name']]; + } + $tabs[$row['tab']]['category_name'] = $row['category_name']; + $tabs[$row['tab']][$row['name']] = TemplateParser::render($row); + } + + if (!empty($config['toArray'])) { + $output = $tabs; + } else { + $output .= '
    '; + $output .= ' '; - foreach($tabs as $idTab => $tab) { - $output .= '
    '; - $output .= ' + foreach ($tabs as $idTab => $tab) { + $output .= '
    '; + $output .= '

    ' . (!empty($config['tabs'][$idTab]) ? $config['tabs'][$idTab] : $tab['category_name']) . '

    '; - unset($tab['category_name']); - foreach($tab as $item) { - $output .= $item; - } - $output .= '
    '; - } - $output .= '
    '; - } - } - } - - return $output; - } + unset($tab['category_name']); + foreach ($tab as $item) { + $output .= $item; + } + $output .= '
    '; + } + $output .= '
    '; + } + } + } + + return $output; + } /** * @param array $data * @return string */ - private function render($data) { - $modx = evolutionCMS(); global $_lang, $_country_lang; + private function render($data) + { + $modx = evolutionCMS(); + global $_lang, $_country_lang; - $data['lang.name'] = (isset($_lang[$data['alias']]) ? $_lang[$data['alias']] : $data['alias']); - $data['value'] = (isset($_POST[$data['name']][$data['value']]) ? $_POST[$data['name']][$data['value']] : (isset($data['value']) ? $modx->htmlspecialchars($data['value']) : '')); - $data['readonly'] = ($data['readonly'] ? ' readonly' : ''); + $data['lang.name'] = (isset($_lang[$data['alias']]) ? $_lang[$data['alias']] : $data['alias']); + $data['value'] = (isset($_POST[$data['name']][$data['value']]) ? $_POST[$data['name']][$data['value']] : (isset($data['value']) ? $modx->htmlspecialchars($data['value']) : '')); + $data['readonly'] = ($data['readonly'] ? ' readonly' : ''); - $output = ''; - $output .= '
    '; + $output = ''; + $output .= '
    '; - switch($data['type']) { + switch ($data['type']) { - case 'text': - $output .= ' + case 'text': + $output .= '
    '; - $output .= $data['content']; - $output .= '
    '; + $output .= $data['content']; + $output .= '
    '; - break; + break; - case 'textarea': - $output .= ' + case 'textarea': + $output .= '
    '; - $output .= $data['content']; - $output .= '
    '; + $output .= $data['content']; + $output .= '
    '; - break; + break; - case 'date': - $data['value'] = (isset($_POST[$data['name']][$data['value']]) ? $modx->toDateFormat($_POST[$data['name']][$data['value']]) : (isset($data['value']) ? $modx->toDateFormat($data['value']) : '')); - $output .= ' + case 'date': + $data['value'] = (isset($_POST[$data['name']][$data['value']]) ? $modx->toDateFormat($_POST[$data['name']][$data['value']]) : (isset($data['value']) ? $modx->toDateFormat($data['value']) : '')); + $output .= '
    '; - $output .= $data['content']; - $output .= '
    '; - - break; - - case 'select': - $output .= ''; - $output .= '
    '; - $output .= ''; - $output .= $data['content']; - $output .= '
    '; - - break; - - case 'checkbox': - $output .= ''; - $output .= '
    '; - $output .= ''; - if($data['elements']) { - $elements = explode('||', $data['elements']); - foreach($elements as $key => $value) { - $value = explode('==', $value); - $output .= '
    ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); - } - } - $output .= $data['content']; - $output .= '
    '; - - break; - - case 'radio': - $output .= ''; - $output .= '
    '; - $output .= ''; - if($data['elements']) { - $elements = explode('||', $data['elements']); - foreach($elements as $key => $value) { - $value = explode('==', $value); - $output .= '
    ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); - } - } - $output .= $data['content']; - $output .= '
    '; - - break; - - case 'custom': - $output .= ''; - $output .= '
    '; - $output .= $data['content']; - $output .= '
    '; - - break; - } - - $output .= ''; - - $output = $modx->parseText($output, $data); - - return $output; - } - + $output .= $data['content']; + $output .= ''; + + break; + + case 'select': + $output .= ''; + $output .= '
    '; + $output .= ''; + $output .= $data['content']; + $output .= '
    '; + + break; + + case 'checkbox': + $output .= ''; + $output .= '
    '; + $output .= ''; + if ($data['elements']) { + $elements = explode('||', $data['elements']); + foreach ($elements as $key => $value) { + $value = explode('==', $value); + $output .= '
    ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); + } + } + $output .= $data['content']; + $output .= '
    '; + + break; + + case 'radio': + $output .= ''; + $output .= '
    '; + $output .= ''; + if ($data['elements']) { + $elements = explode('||', $data['elements']); + foreach ($elements as $key => $value) { + $value = explode('==', $value); + $output .= '
    ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); + } + } + $output .= $data['content']; + $output .= '
    '; + + break; + + case 'custom': + $output .= ''; + $output .= '
    '; + $output .= $data['content']; + $output .= '
    '; + + break; + } + + $output .= ''; + + $output = $modx->parseText($output, $data); + + return $output; + } } ?> diff --git a/manager/includes/tmplvars.commands.inc.php b/manager/includes/tmplvars.commands.inc.php index 8137692b9d..dd49967362 100755 --- a/manager/includes/tmplvars.commands.inc.php +++ b/manager/includes/tmplvars.commands.inc.php @@ -4,7 +4,7 @@ * Created by Raymond Irving Feb, 2005 */ global $BINDINGS; // Array of supported bindings. must be upper case -$BINDINGS = array ( +$BINDINGS = array( 'FILE', 'CHUNK', 'DOCUMENT', @@ -22,40 +22,41 @@ * @param array $tvsArray * @return string */ -function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsArray = array()) { +function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsArray = array()) +{ $modx = evolutionCMS(); $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier; $nvalue = trim($value); - if (substr($nvalue, 0, 1) != '@') + if (substr($nvalue, 0, 1) != '@') { return $value; - elseif(isset($modx->config['enable_bindings']) && $modx->config['enable_bindings']!=1 && $src==='docform') { + } elseif (isset($modx->config['enable_bindings']) && $modx->config['enable_bindings']!=1 && $src==='docform') { return '@Bindings is disabled.'; - } - else { - list ($cmd, $param) = ParseCommand($nvalue); + } else { + list($cmd, $param) = ParseCommand($nvalue); $cmd = trim($cmd); $param = parseTvValues($param, $tvsArray); switch ($cmd) { - case "FILE" : + case "FILE": $output = $modx->atBindFileContent($nvalue); break; - case "CHUNK" : // retrieve a chunk and process it's content + case "CHUNK": // retrieve a chunk and process it's content $chunk = $modx->getChunk(trim($param)); $output = $chunk; break; - case "DOCUMENT" : // retrieve a document and process it's content + case "DOCUMENT": // retrieve a document and process it's content $rs = $modx->getDocument($param); - if (is_array($rs)) + if (is_array($rs)) { $output = $rs['content']; - else + } else { $output = "Unable to locate document $param"; + } break; - case "SELECT" : // selects a record from the cms database - $rt = array (); - $replacementVars = array ( + case "SELECT": // selects a record from the cms database + $rt = array(); + $replacementVars = array( 'DBASE' => $modx->db->config['dbase'], 'PREFIX' => $modx->db->config['table_prefix'] ); @@ -67,11 +68,11 @@ function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsA $output = $rs; break; - case "EVAL" : // evaluates text as php codes return the results - $output = eval ($param); + case "EVAL": // evaluates text as php codes return the results + $output = eval($param); break; - case "INHERIT" : + case "INHERIT": $output = $param; // Default to param value if no content from parents $doc = $modx->getPageInfo($docid, 0, 'id,parent'); @@ -80,8 +81,9 @@ function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsA // Grab document regardless of publish status $doc = $modx->getPageInfo($parent_id, 0, 'id,parent,published'); - if ($doc['parent'] != 0 && !$doc['published']) - continue; // hide unpublished docs if we're not at the top + if ($doc['parent'] != 0 && !$doc['published']) { + continue; + } // hide unpublished docs if we're not at the top $tv = $modx->getTemplateVar($name, '*', $doc['id'], $doc['published']); @@ -95,8 +97,8 @@ function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsA } break; - case 'DIRECTORY' : - $files = array (); + case 'DIRECTORY': + $files = array(); $path = $modx->config['base_path'] . $param; if (substr($path, -1, 1) != '/') { $path .= '/'; @@ -115,7 +117,7 @@ function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsA $output = implode('||', $files); break; - default : + default: $output = $value; break; @@ -129,10 +131,13 @@ function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsA * @param $file * @return string */ -function ProcessFile($file) { +function ProcessFile($file) +{ // get the file - $buffer = @file_get_contents($file); - if ($buffer === false) $buffer = " Could not retrieve document '$file'."; + $buffer = @file_get_contents($file); + if ($buffer === false) { + $buffer = " Could not retrieve document '$file'."; + } return $buffer; } @@ -146,11 +151,9 @@ function ParseCommand($binding_string) { global $BINDINGS; $binding_array = array(); - foreach($BINDINGS as $cmd) - { - if(strpos($binding_string,'@'.$cmd)===0) - { - $code = substr($binding_string,strlen($cmd)+1); + foreach ($BINDINGS as $cmd) { + if (strpos($binding_string, '@' . $cmd)===0) { + $code = substr($binding_string, strlen($cmd)+1); $binding_array = array($cmd,trim($code)); break; } @@ -168,20 +171,20 @@ function ParseCommand($binding_string) function parseTvValues($param, $tvsArray) { $modx = evolutionCMS(); - $tvsArray = is_array($modx->documentObject) ? array_merge($tvsArray, $modx->documentObject) : $tvsArray; - if (strpos($param, '[*') !== false) { - $matches = $modx->getTagsFromContent($param, '[*', '*]'); - foreach ($matches[0] as $i=>$match) { - if(isset($tvsArray[ $matches[1][$i] ])) { - if(is_array($tvsArray[ $matches[1][$i] ])) { - $value = $tvsArray[$matches[1][$i]]['value']; - $value = $value === '' ? $tvsArray[$matches[1][$i]]['default_text'] : $value; - } else { - $value = $tvsArray[ $matches[1][$i] ]; - } - $param = str_replace($match, $value, $param); - } - } - } - return $param; + $tvsArray = is_array($modx->documentObject) ? array_merge($tvsArray, $modx->documentObject) : $tvsArray; + if (strpos($param, '[*') !== false) { + $matches = $modx->getTagsFromContent($param, '[*', '*]'); + foreach ($matches[0] as $i=>$match) { + if (isset($tvsArray[ $matches[1][$i] ])) { + if (is_array($tvsArray[ $matches[1][$i] ])) { + $value = $tvsArray[$matches[1][$i]]['value']; + $value = $value === '' ? $tvsArray[$matches[1][$i]]['default_text'] : $value; + } else { + $value = $tvsArray[ $matches[1][$i] ]; + } + $param = str_replace($match, $value, $param); + } + } + } + return $param; } diff --git a/manager/includes/tmplvars.format.inc.php b/manager/includes/tmplvars.format.inc.php index edd050bd85..141c2a6a5b 100755 --- a/manager/includes/tmplvars.format.inc.php +++ b/manager/includes/tmplvars.format.inc.php @@ -15,335 +15,342 @@ * @param string $sep * @return mixed|string */ -function getTVDisplayFormat($name, $value, $format, $paramstring = "", $tvtype = "", $docid = "", $sep = '') { - +function getTVDisplayFormat($name, $value, $format, $paramstring = "", $tvtype = "", $docid = "", $sep = '') +{ $modx = evolutionCMS(); $o = ''; // process any TV commands in value - $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier; - $value = ProcessTVCommand($value, $name, $docid); + $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier; + $value = ProcessTVCommand($value, $name, $docid); - $params = array(); - if($paramstring) { - $cp = explode("&", $paramstring); - foreach($cp as $p => $v) { - $v = trim($v); // trim - $ar = explode("=", $v); - if(is_array($ar) && count($ar) == 2) { - $params[$ar[0]] = decodeParamValue($ar[1]); - } - } - } + $params = array(); + if ($paramstring) { + $cp = explode("&", $paramstring); + foreach ($cp as $p => $v) { + $v = trim($v); // trim + $ar = explode("=", $v); + if (is_array($ar) && count($ar) == 2) { + $params[$ar[0]] = decodeParamValue($ar[1]); + } + } + } - $id = "tv$name"; - switch($format) { - case 'image': - $images = parseInput($value, '||', 'array'); - foreach($images as $image) { - if(!is_array($image)) { - $image = explode('==', $image); - } - $src = $image[0]; + $id = "tv$name"; + switch ($format) { + case 'image': + $images = parseInput($value, '||', 'array'); + foreach ($images as $image) { + if (!is_array($image)) { + $image = explode('==', $image); + } + $src = $image[0]; - if($src) { - // We have a valid source - $attributes = ''; - $attr = array( - 'class' => $params['class'], - 'src' => $src, - 'id' => ($params['id'] ? $params['id'] : ''), - 'alt' => $modx->htmlspecialchars($params['alttext']), - 'style' => $params['style'] - ); - if(isset($params['align']) && $params['align'] != 'none') { - $attr['align'] = $params['align']; - } - foreach($attr as $k => $v) $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); - $attributes .= ' ' . $params['attrib']; + if ($src) { + // We have a valid source + $attributes = ''; + $attr = array( + 'class' => $params['class'], + 'src' => $src, + 'id' => ($params['id'] ? $params['id'] : ''), + 'alt' => $modx->htmlspecialchars($params['alttext']), + 'style' => $params['style'] + ); + if (isset($params['align']) && $params['align'] != 'none') { + $attr['align'] = $params['align']; + } + foreach ($attr as $k => $v) { + $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); + } + $attributes .= ' ' . $params['attrib']; - // Output the image with attributes - $o .= ''; - } - } - break; + // Output the image with attributes + $o .= ''; + } + } + break; - case "delim": // display as delimitted list - $value = parseInput($value, "||"); - $p = $params['format'] ? $params['format'] : " "; - if($p == "\\n") { - $p = "\n"; - } - $o = str_replace("||", $p, $value); - break; + case "delim": // display as delimitted list + $value = parseInput($value, "||"); + $p = $params['format'] ? $params['format'] : " "; + if ($p == "\\n") { + $p = "\n"; + } + $o = str_replace("||", $p, $value); + break; - case "string": - $value = parseInput($value); - $format = strtolower($params['format']); - if($format == 'upper case') { - $o = strtoupper($value); - } else if($format == 'lower case') { - $o = strtolower($value); - } else if($format == 'sentence case') { - $o = ucfirst($value); - } else if($format == 'capitalize') { - $o = ucwords($value); - } else { - $o = $value; - } - break; + case "string": + $value = parseInput($value); + $format = strtolower($params['format']); + if ($format == 'upper case') { + $o = strtoupper($value); + } elseif ($format == 'lower case') { + $o = strtolower($value); + } elseif ($format == 'sentence case') { + $o = ucfirst($value); + } elseif ($format == 'capitalize') { + $o = ucwords($value); + } else { + $o = $value; + } + break; - case "date": - if($value != '' || $params['default'] == 'Yes') { - if(empty($value)) { - $value = 'now'; - } - $timestamp = getUnixtimeFromDateString($value); - $p = $params['format'] ? $params['format'] : "%A %d, %B %Y"; - $o = strftime($p, $timestamp); - } else { - $value = ''; - } - break; + case "date": + if ($value != '' || $params['default'] == 'Yes') { + if (empty($value)) { + $value = 'now'; + } + $timestamp = getUnixtimeFromDateString($value); + $p = $params['format'] ? $params['format'] : "%A %d, %B %Y"; + $o = strftime($p, $timestamp); + } else { + $value = ''; + } + break; - case "hyperlink": - $value = parseInput($value, "||", "array"); - $o = ''; - $countValue = count($value); - for($i = 0; $i < $countValue; $i++) { - list($name, $url) = is_array($value[$i]) ? $value[$i] : explode("==", $value[$i]); - if(!$url) { - $url = $name; - } - if($url) { - if($o) { - $o .= '
    '; - } - $attributes = ''; - // setup the link attributes - $attr = array( - 'href' => $url, - 'title' => $params['title'] ? $modx->htmlspecialchars($params['title']) : $name, - 'class' => $params['class'], - 'style' => $params['style'], - 'target' => $params['target'], - ); - foreach($attr as $k => $v) $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); - $attributes .= ' ' . $params['attrib']; // add extra + case "hyperlink": + $value = parseInput($value, "||", "array"); + $o = ''; + $countValue = count($value); + for ($i = 0; $i < $countValue; $i++) { + list($name, $url) = is_array($value[$i]) ? $value[$i] : explode("==", $value[$i]); + if (!$url) { + $url = $name; + } + if ($url) { + if ($o) { + $o .= '
    '; + } + $attributes = ''; + // setup the link attributes + $attr = array( + 'href' => $url, + 'title' => $params['title'] ? $modx->htmlspecialchars($params['title']) : $name, + 'class' => $params['class'], + 'style' => $params['style'], + 'target' => $params['target'], + ); + foreach ($attr as $k => $v) { + $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); + } + $attributes .= ' ' . $params['attrib']; // add extra - // Output the link - $o .= '' . ($params['text'] ? $modx->htmlspecialchars($params['text']) : $name) . ''; - } - } - break; + // Output the link + $o .= '' . ($params['text'] ? $modx->htmlspecialchars($params['text']) : $name) . ''; + } + } + break; - case "htmltag": - $value = parseInput($value, "||", "array"); - $tagid = $params['tagid']; - $tagname = ($params['tagname']) ? $params['tagname'] : 'div'; - $o = ''; - // Loop through a list of tags + case "htmltag": + $value = parseInput($value, "||", "array"); + $tagid = $params['tagid']; + $tagname = ($params['tagname']) ? $params['tagname'] : 'div'; + $o = ''; + // Loop through a list of tags $countValue = count($value); - for($i = 0; $i < $countValue; $i++) { - $tagvalue = is_array($value[$i]) ? implode(' ', $value[$i]) : $value[$i]; - if(!$tagvalue) { - continue; - } + for ($i = 0; $i < $countValue; $i++) { + $tagvalue = is_array($value[$i]) ? implode(' ', $value[$i]) : $value[$i]; + if (!$tagvalue) { + continue; + } - $attributes = ''; - $attr = array( - 'id' => ($tagid ? $tagid : $id), - // 'tv' already added to id - 'class' => $params['class'], - 'style' => $params['style'], - ); - foreach($attr as $k => $v) $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); - $attributes .= ' ' . $params['attrib']; // add extra + $attributes = ''; + $attr = array( + 'id' => ($tagid ? $tagid : $id), + // 'tv' already added to id + 'class' => $params['class'], + 'style' => $params['style'], + ); + foreach ($attr as $k => $v) { + $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); + } + $attributes .= ' ' . $params['attrib']; // add extra - // Output the HTML Tag - $o .= '<' . $tagname . rtrim($attributes) . '>' . $tagvalue . ''; - } - break; + // Output the HTML Tag + $o .= '<' . $tagname . rtrim($attributes) . '>' . $tagvalue . ''; + } + break; - case "richtext": - $value = parseInput($value); - $w = $params['w'] ? $params['w'] : '100%'; - $h = $params['h'] ? $params['h'] : '400px'; - $richtexteditor = $params['edt'] ? $params['edt'] : ""; - $o = '
    '; - $replace_richtext = array($id); - // setup editors - if(!empty($replace_richtext) && !empty($richtexteditor)) { - // invoke OnRichTextEditorInit event - $evtOut = $modx->invokeEvent("OnRichTextEditorInit", array( - 'editor' => $richtexteditor, - 'elements' => $replace_richtext, - 'forfrontend' => 1, - 'width' => $w, - 'height' => $h - )); - if(is_array($evtOut)) { - $o .= implode("", $evtOut); - } - } - break; + case "richtext": + $value = parseInput($value); + $w = $params['w'] ? $params['w'] : '100%'; + $h = $params['h'] ? $params['h'] : '400px'; + $richtexteditor = $params['edt'] ? $params['edt'] : ""; + $o = '
    '; + $replace_richtext = array($id); + // setup editors + if (!empty($replace_richtext) && !empty($richtexteditor)) { + // invoke OnRichTextEditorInit event + $evtOut = $modx->invokeEvent("OnRichTextEditorInit", array( + 'editor' => $richtexteditor, + 'elements' => $replace_richtext, + 'forfrontend' => 1, + 'width' => $w, + 'height' => $h + )); + if (is_array($evtOut)) { + $o .= implode("", $evtOut); + } + } + break; - case "unixtime": - $value = parseInput($value); - $o = getUnixtimeFromDateString($value); - break; + case "unixtime": + $value = parseInput($value); + $o = getUnixtimeFromDateString($value); + break; - case "viewport": - $value = parseInput($value); - $id = '_' . time(); - if(!$params['vpid']) { - $params['vpid'] = $id; - } - $sTag = "regClientStartupScript(MODX_MANAGER_URL . "media/script/bin/viewport.js", array( - 'name' => 'viewport', - 'version' => '0', - 'plaintext' => false - )); - $o = $sTag . " id='" . $params['vpid'] . "' name='" . $params['vpid'] . "' "; - if($params['class']) { - $o .= " class='" . $params['class'] . "' "; - } - if($params['style']) { - $o .= " style='" . $params['style'] . "' "; - } - if($params['attrib']) { - $o .= $params['attrib'] . " "; - } - $o .= "scrolling='" . ($params['sbar'] == 'No' ? "no" : ($params['sbar'] == 'Yes' ? "yes" : "auto")) . "' "; - $o .= "src='" . $value . "' frameborder='" . $params['borsize'] . "' "; - $o .= "onload=\"window.setTimeout('ResizeViewPort(\\'" . $params['vpid'] . "\\'," . $autoMode . ")',100);\" width='" . $w . "' height='" . $h . "' "; - $o .= ">"; - $o .= $eTag; - break; + $modx->regClientStartupScript(MODX_MANAGER_URL . "media/script/bin/viewport.js", array( + 'name' => 'viewport', + 'version' => '0', + 'plaintext' => false + )); + $o = $sTag . " id='" . $params['vpid'] . "' name='" . $params['vpid'] . "' "; + if ($params['class']) { + $o .= " class='" . $params['class'] . "' "; + } + if ($params['style']) { + $o .= " style='" . $params['style'] . "' "; + } + if ($params['attrib']) { + $o .= $params['attrib'] . " "; + } + $o .= "scrolling='" . ($params['sbar'] == 'No' ? "no" : ($params['sbar'] == 'Yes' ? "yes" : "auto")) . "' "; + $o .= "src='" . $value . "' frameborder='" . $params['borsize'] . "' "; + $o .= "onload=\"window.setTimeout('ResizeViewPort(\\'" . $params['vpid'] . "\\'," . $autoMode . ")',100);\" width='" . $w . "' height='" . $h . "' "; + $o .= ">"; + $o .= $eTag; + break; - case "datagrid": - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $value); + case "datagrid": + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $value); - $grd->noRecordMsg = $params['egmsg']; + $grd->noRecordMsg = $params['egmsg']; - $grd->columnHeaderClass = $params['chdrc']; - $grd->cssClass = $params['tblc']; - $grd->itemClass = $params['itmc']; - $grd->altItemClass = $params['aitmc']; + $grd->columnHeaderClass = $params['chdrc']; + $grd->cssClass = $params['tblc']; + $grd->itemClass = $params['itmc']; + $grd->altItemClass = $params['aitmc']; - $grd->columnHeaderStyle = $params['chdrs']; - $grd->cssStyle = $params['tbls']; - $grd->itemStyle = $params['itms']; - $grd->altItemStyle = $params['aitms']; + $grd->columnHeaderStyle = $params['chdrs']; + $grd->cssStyle = $params['tbls']; + $grd->itemStyle = $params['itms']; + $grd->altItemStyle = $params['aitms']; - $grd->columns = $params['cols']; - $grd->fields = $params['flds']; - $grd->colWidths = $params['cwidth']; - $grd->colAligns = $params['calign']; - $grd->colColors = $params['ccolor']; - $grd->colTypes = $params['ctype']; + $grd->columns = $params['cols']; + $grd->fields = $params['flds']; + $grd->colWidths = $params['cwidth']; + $grd->colAligns = $params['calign']; + $grd->colColors = $params['ccolor']; + $grd->colTypes = $params['ctype']; - $grd->cellPadding = $params['cpad']; - $grd->cellSpacing = $params['cspace']; - $grd->header = $params['head']; - $grd->footer = $params['foot']; - $grd->pageSize = $params['psize']; - $grd->pagerLocation = $params['ploc']; - $grd->pagerClass = $params['pclass']; - $grd->pagerStyle = $params['pstyle']; - $o = $grd->render(); - break; + $grd->cellPadding = $params['cpad']; + $grd->cellSpacing = $params['cspace']; + $grd->header = $params['head']; + $grd->footer = $params['foot']; + $grd->pageSize = $params['psize']; + $grd->pagerLocation = $params['ploc']; + $grd->pagerClass = $params['pclass']; + $grd->pagerStyle = $params['pstyle']; + $o = $grd->render(); + break; - case 'htmlentities': - $value = parseInput($value); - if($tvtype == 'checkbox' || $tvtype == 'listbox-multiple') { - // remove delimiter from checkbox and listbox-multiple TVs - $value = str_replace('||', '', $value); - } - $o = htmlentities($value, ENT_NOQUOTES, $modx->config['modx_charset']); - break; + case 'htmlentities': + $value = parseInput($value); + if ($tvtype == 'checkbox' || $tvtype == 'listbox-multiple') { + // remove delimiter from checkbox and listbox-multiple TVs + $value = str_replace('||', '', $value); + } + $o = htmlentities($value, ENT_NOQUOTES, $modx->config['modx_charset']); + break; - case 'custom_widget': - $widget_output = ''; - $o = ''; - /* If we are loading a file */ - if(substr($params['output'], 0, 5) == "@FILE") { - $file_name = MODX_BASE_PATH . trim(substr($params['output'], 6)); - if(!file_exists($file_name)) { - $widget_output = $file_name . ' does not exist'; - } else { - $widget_output = file_get_contents($file_name); - } - } elseif(substr($params['output'], 0, 8) == '@INCLUDE') { - $file_name = MODX_BASE_PATH . trim(substr($params['output'], 9)); - if(!file_exists($file_name)) { - $widget_output = $file_name . ' does not exist'; - } else { - /* The included file needs to set $widget_output. Can be string, array, object */ - include $file_name; - } - } elseif(substr($params['output'], 0, 6) == '@CHUNK' && $value !== '') { - $chunk_name = trim(substr($params['output'], 7)); - $widget_output = $modx->getChunk($chunk_name); - } elseif(substr($params['output'], 0, 5) == '@EVAL' && $value !== '') { - $eval_str = trim(substr($params['output'], 6)); - $widget_output = eval($eval_str); - } elseif($value !== '') { - $widget_output = $params['output']; - } else { - $widget_output = ''; - } - if(is_string($widget_output)) { - $_ = $modx->config['enable_filter']; - $modx->config['enable_filter'] = 1; - $widget_output = $modx->parseText($widget_output, array('value' => $value)); - $modx->config['enable_filter'] = $_; - $o = $modx->parseDocumentSource($widget_output); - } else { - $o = $widget_output; - } - break; + case 'custom_widget': + $widget_output = ''; + $o = ''; + /* If we are loading a file */ + if (substr($params['output'], 0, 5) == "@FILE") { + $file_name = MODX_BASE_PATH . trim(substr($params['output'], 6)); + if (!file_exists($file_name)) { + $widget_output = $file_name . ' does not exist'; + } else { + $widget_output = file_get_contents($file_name); + } + } elseif (substr($params['output'], 0, 8) == '@INCLUDE') { + $file_name = MODX_BASE_PATH . trim(substr($params['output'], 9)); + if (!file_exists($file_name)) { + $widget_output = $file_name . ' does not exist'; + } else { + /* The included file needs to set $widget_output. Can be string, array, object */ + include $file_name; + } + } elseif (substr($params['output'], 0, 6) == '@CHUNK' && $value !== '') { + $chunk_name = trim(substr($params['output'], 7)); + $widget_output = $modx->getChunk($chunk_name); + } elseif (substr($params['output'], 0, 5) == '@EVAL' && $value !== '') { + $eval_str = trim(substr($params['output'], 6)); + $widget_output = eval($eval_str); + } elseif ($value !== '') { + $widget_output = $params['output']; + } else { + $widget_output = ''; + } + if (is_string($widget_output)) { + $_ = $modx->config['enable_filter']; + $modx->config['enable_filter'] = 1; + $widget_output = $modx->parseText($widget_output, array('value' => $value)); + $modx->config['enable_filter'] = $_; + $o = $modx->parseDocumentSource($widget_output); + } else { + $o = $widget_output; + } + break; - default: - $value = parseInput($value); - if($tvtype == 'checkbox' || $tvtype == 'listbox-multiple') { - // add separator - $value = explode('||', $value); - $value = implode($sep, $value); - } - $o = $value; - break; - } - return $o; + default: + $value = parseInput($value); + if ($tvtype == 'checkbox' || $tvtype == 'listbox-multiple') { + // add separator + $value = explode('||', $value); + $value = implode($sep, $value); + } + $o = $value; + break; + } + return $o; } /** * @param string $s * @return string */ -function decodeParamValue($s) { - $s = str_replace("%3D", '=', $s); // = - return str_replace("%26", '&', $s); // & +function decodeParamValue($s) +{ + $s = str_replace("%3D", '=', $s); // = + return str_replace("%26", '&', $s); // & } /** @@ -355,43 +362,47 @@ function decodeParamValue($s) { * @param bool $columns * @return array|string */ -function parseInput($src, $delim = "||", $type = "string", $columns = true) { // type can be: string, array +function parseInput($src, $delim = "||", $type = "string", $columns = true) +{ // type can be: string, array $modx = evolutionCMS(); - if($modx->db->isResult($src)) { - // must be a recordset - $rows = array(); - while($cols = $modx->db->getRow($src, 'num')) $rows[] = ($columns) ? $cols : implode(" ", $cols); - return ($type == "array") ? $rows : implode($delim, $rows); - } else { - // must be a text - if($type == "array") { - return explode($delim, $src); - } else { - return $src; - } - } + if ($modx->db->isResult($src)) { + // must be a recordset + $rows = array(); + while ($cols = $modx->db->getRow($src, 'num')) { + $rows[] = ($columns) ? $cols : implode(" ", $cols); + } + return ($type == "array") ? $rows : implode($delim, $rows); + } else { + // must be a text + if ($type == "array") { + return explode($delim, $src); + } else { + return $src; + } + } } /** * @param string $value * @return bool|false|int */ -function getUnixtimeFromDateString($value) { - $timestamp = false; - // Check for MySQL or legacy style date - $date_match_1 = '/^([0-9]{2})-([0-9]{2})-([0-9]{4})\ ([0-9]{2}):([0-9]{2}):([0-9]{2})$/'; - $date_match_2 = '/^([0-9]{4})-([0-9]{2})-([0-9]{2})\ ([0-9]{2}):([0-9]{2}):([0-9]{2})$/'; - $matches = array(); - if(strpos($value, '-') !== false) { - if(preg_match($date_match_1, $value, $matches)) { - $timestamp = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[1], $matches[3]); - } elseif(preg_match($date_match_2, $value, $matches)) { - $timestamp = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]); - } - } - // If those didn't work, use strtotime to figure out the date - if($timestamp === false || $timestamp === -1) { - $timestamp = strtotime($value); - } - return $timestamp; +function getUnixtimeFromDateString($value) +{ + $timestamp = false; + // Check for MySQL or legacy style date + $date_match_1 = '/^([0-9]{2})-([0-9]{2})-([0-9]{4})\ ([0-9]{2}):([0-9]{2}):([0-9]{2})$/'; + $date_match_2 = '/^([0-9]{4})-([0-9]{2})-([0-9]{2})\ ([0-9]{2}):([0-9]{2}):([0-9]{2})$/'; + $matches = array(); + if (strpos($value, '-') !== false) { + if (preg_match($date_match_1, $value, $matches)) { + $timestamp = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[1], $matches[3]); + } elseif (preg_match($date_match_2, $value, $matches)) { + $timestamp = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]); + } + } + // If those didn't work, use strtotime to figure out the date + if ($timestamp === false || $timestamp === -1) { + $timestamp = strtotime($value); + } + return $timestamp; } diff --git a/manager/includes/tmplvars.inc.php b/manager/includes/tmplvars.inc.php index 98dad01b12..725d66def2 100755 --- a/manager/includes/tmplvars.inc.php +++ b/manager/includes/tmplvars.inc.php @@ -12,160 +12,161 @@ * @param array $tvsArray * @return string */ -function renderFormElement($field_type, $field_id, $default_text = '', $field_elements = '', $field_value = '', $field_style = '', $row = array(), $tvsArray = array()) { +function renderFormElement($field_type, $field_id, $default_text = '', $field_elements = '', $field_value = '', $field_style = '', $row = array(), $tvsArray = array()) +{ $modx = evolutionCMS(); - global $_style; - global $_lang; - global $content; - global $which_browser; + global $_style; + global $_lang; + global $content; + global $which_browser; - if(substr($default_text, 0, 6) === '@@EVAL' && $field_value === $default_text) { - $eval_str = trim(substr($default_text, 7)); - $default_text = eval($eval_str); - $field_value = $default_text; - } + if (substr($default_text, 0, 6) === '@@EVAL' && $field_value === $default_text) { + $eval_str = trim(substr($default_text, 7)); + $default_text = eval($eval_str); + $field_value = $default_text; + } - $field_html = ''; - $cimode = strpos($field_type, ':'); - if($cimode === false) { - switch($field_type) { + $field_html = ''; + $cimode = strpos($field_type, ':'); + if ($cimode === false) { + switch ($field_type) { - case "text": // handler for regular text boxes - case "rawtext"; // non-htmlentity converted text boxes - $field_html .= ''; - break; - case "email": // handles email input fields - $field_html .= ''; - break; - case "number": // handles the input of numbers - $field_html .= ''; - break; - case "textareamini": // handler for textarea mini boxes - $field_html .= ''; - break; - case "textarea": // handler for textarea boxes - case "rawtextarea": // non-htmlentity convertex textarea boxes - case "htmlarea": // handler for textarea boxes (deprecated) - case "richtext": // handler for textarea boxes - $field_html .= ''; - break; - case "date": - $field_id = str_replace(array( - '-', - '.' - ), '_', urldecode($field_id)); - if($field_value == '') { - $field_value = 0; - } - $field_html .= ''; - $field_html .= ' '; + case "text": // handler for regular text boxes + case "rawtext": // non-htmlentity converted text boxes + $field_html .= ''; + break; + case "email": // handles email input fields + $field_html .= ''; + break; + case "number": // handles the input of numbers + $field_html .= ''; + break; + case "textareamini": // handler for textarea mini boxes + $field_html .= ''; + break; + case "textarea": // handler for textarea boxes + case "rawtextarea": // non-htmlentity convertex textarea boxes + case "htmlarea": // handler for textarea boxes (deprecated) + case "richtext": // handler for textarea boxes + $field_html .= ''; + break; + case "date": + $field_id = str_replace(array( + '-', + '.' + ), '_', urldecode($field_id)); + if ($field_value == '') { + $field_value = 0; + } + $field_html .= ''; + $field_html .= ' '; - break; - case "dropdown": // handler for select boxes - $field_html .= '"; - break; - case "listbox": // handler for select boxes - $field_html .= '"; - break; - case "listbox-multiple": // handler for select boxes where you can choose multiple items - $field_value = explode("||", $field_value); - $field_html .= '"; - break; - case "url": // handles url input fields - $urls = array( - '' => '--', - 'http://' => 'http://', - 'https://' => 'https://', - 'ftp://' => 'ftp://', - 'mailto:' => 'mailto:' - ); - $field_html = '
    The MODX parser recieved the following debug/ stop message:
    « $msg »

          SQL: $query
    +if (!empty($query)) { + $parsedMessageString .= "

          SQL: $query
          [Copy SQL to ClipBoard]
     
    PHP error debug
     
    PHP error debug
      Error: $text 
      Error: $text 
      Error type/ Nr.: " . $errortype[$nr] . " - $nr 
      Error type/ Nr.: ".$errortype[$nr]." - $nr 
      File: $file 
      File: $file 
      Line: $line 
      Line $line source: $source 
      Line: $line 
      Line $line source: $source 
     
    Parser timing
    '; - $field_html .= '
    '; - break; - case 'checkbox': // handles check boxes - $values = !is_array($field_value) ? explode('||', $field_value) : $field_value; - $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); - $tpl = '
    '; - static $i = 0; - $_ = array(); - foreach($index_list as $c => $item) { - if(is_array($item)) { - $name = trim($item[0]); - $value = isset($item[1]) ? $item[1] : $name; - } else { - $item = trim($item); - list($name, $value) = (strpos($item, '==') !== false) ? explode('==', $item, 2) : array( - $item, - $item - ); - } - $checked = in_array($value, $values) ? ' checked="checked"' : ''; - $param = array( - $modx->htmlspecialchars($value), - $i, - $field_id, - $checked, - $name - ); - $_[] = vsprintf($tpl, $param); - $i++; - } - $field_html = implode("\n", $_); - break; - case "option": // handles radio buttons - $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); - static $i = 0; - while(list($item, $itemvalue) = each($index_list)) { - list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue); - if(strlen($itemvalue) == 0) { - $itemvalue = $item; - } - $field_html .= '
    '; - $i++; - } - break; - case "image": // handles image fields using htmlarea image manager - global $_lang; - global $ResourceManagerLoaded; - global $content, $use_editor, $which_editor; - if(!$ResourceManagerLoaded && !(($content['richtext'] == 1 || $modx->manager->action == 4) && $use_editor == 1 && $which_editor == 3)) { - $field_html .= " + break; + case "dropdown": // handler for select boxes + $field_html .= '"; + break; + case "listbox": // handler for select boxes + $field_html .= '"; + break; + case "listbox-multiple": // handler for select boxes where you can choose multiple items + $field_value = explode("||", $field_value); + $field_html .= '"; + break; + case "url": // handles url input fields + $urls = array( + '' => '--', + 'http://' => 'http://', + 'https://' => 'https://', + 'ftp://' => 'ftp://', + 'mailto:' => 'mailto:' + ); + $field_html = '
    '; + $field_html .= '
    '; + break; + case 'checkbox': // handles check boxes + $values = !is_array($field_value) ? explode('||', $field_value) : $field_value; + $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); + $tpl = '
    '; + static $i = 0; + $_ = array(); + foreach ($index_list as $c => $item) { + if (is_array($item)) { + $name = trim($item[0]); + $value = isset($item[1]) ? $item[1] : $name; + } else { + $item = trim($item); + list($name, $value) = (strpos($item, '==') !== false) ? explode('==', $item, 2) : array( + $item, + $item + ); + } + $checked = in_array($value, $values) ? ' checked="checked"' : ''; + $param = array( + $modx->htmlspecialchars($value), + $i, + $field_id, + $checked, + $name + ); + $_[] = vsprintf($tpl, $param); + $i++; + } + $field_html = implode("\n", $_); + break; + case "option": // handles radio buttons + $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); + static $i = 0; + while (list($item, $itemvalue) = each($index_list)) { + list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue); + if (strlen($itemvalue) == 0) { + $itemvalue = $item; + } + $field_html .= '
    '; + $i++; + } + break; + case "image": // handles image fields using htmlarea image manager + global $_lang; + global $ResourceManagerLoaded; + global $content, $use_editor, $which_editor; + if (!$ResourceManagerLoaded && !(($content['richtext'] == 1 || $modx->manager->action == 4) && $use_editor == 1 && $which_editor == 3)) { + $field_html .= " "; - $ResourceManagerLoaded = true; - } - $field_html .= ''; - break; - case "file": // handles the input of file uploads - /* Modified by Timon for use with resource browser */ - global $_lang; - global $ResourceManagerLoaded; - global $content, $use_editor, $which_editor; - if(!$ResourceManagerLoaded && !(($content['richtext'] == 1 || $modx->manager->action == 4) && $use_editor == 1 && $which_editor == 3)) { - /* I didn't understand the meaning of the condition above, so I left it untouched ;-) */ - $field_html .= " + $ResourceManagerLoaded = true; + } + $field_html .= ''; + break; + case "file": // handles the input of file uploads + /* Modified by Timon for use with resource browser */ + global $_lang; + global $ResourceManagerLoaded; + global $content, $use_editor, $which_editor; + if (!$ResourceManagerLoaded && !(($content['richtext'] == 1 || $modx->manager->action == 4) && $use_editor == 1 && $which_editor == 3)) { + /* I didn't understand the meaning of the condition above, so I left it untouched ;-) */ + $field_html .= " "; - $ResourceManagerLoaded = true; - } - $field_html .= ''; + $ResourceManagerLoaded = true; + } + $field_html .= ''; - break; + break; - case 'custom_tv': - $custom_output = ''; - /* If we are loading a file */ - if(substr($field_elements, 0, 5) == "@FILE") { - $file_name = MODX_BASE_PATH . trim(substr($field_elements, 6)); - if(!file_exists($file_name)) { - $custom_output = $file_name . ' does not exist'; - } else { - $custom_output = file_get_contents($file_name); - } - } elseif(substr($field_elements, 0, 8) == '@INCLUDE') { - $file_name = MODX_BASE_PATH . trim(substr($field_elements, 9)); - if(!file_exists($file_name)) { - $custom_output = $file_name . ' does not exist'; - } else { - ob_start(); - include $file_name; - $custom_output = ob_get_contents(); - ob_end_clean(); - } - } elseif(substr($field_elements, 0, 6) == "@CHUNK") { - $chunk_name = trim(substr($field_elements, 7)); - $chunk_body = $modx->getChunk($chunk_name); - if($chunk_body == false) { - $custom_output = $_lang['chunk_no_exist'] . '(' . $_lang['htmlsnippet_name'] . ':' . $chunk_name . ')'; - } else { - $custom_output = $chunk_body; - } - } elseif(substr($field_elements, 0, 5) == "@EVAL") { - $eval_str = trim(substr($field_elements, 6)); - $custom_output = eval($eval_str); - } else { - $custom_output = $field_elements; - } - $replacements = array( - '[+field_type+]' => $field_type, - '[+field_id+]' => $field_id, - '[+default_text+]' => $default_text, - '[+field_value+]' => $modx->htmlspecialchars($field_value), - '[+field_style+]' => $field_style, - ); - $custom_output = str_replace(array_keys($replacements), $replacements, $custom_output); - $modx->documentObject = $content; - $modx->documentIdentifier = $content['id']; - $custom_output = $modx->parseDocumentSource($custom_output); - $field_html .= $custom_output; - break; + case 'custom_tv': + $custom_output = ''; + /* If we are loading a file */ + if (substr($field_elements, 0, 5) == "@FILE") { + $file_name = MODX_BASE_PATH . trim(substr($field_elements, 6)); + if (!file_exists($file_name)) { + $custom_output = $file_name . ' does not exist'; + } else { + $custom_output = file_get_contents($file_name); + } + } elseif (substr($field_elements, 0, 8) == '@INCLUDE') { + $file_name = MODX_BASE_PATH . trim(substr($field_elements, 9)); + if (!file_exists($file_name)) { + $custom_output = $file_name . ' does not exist'; + } else { + ob_start(); + include $file_name; + $custom_output = ob_get_contents(); + ob_end_clean(); + } + } elseif (substr($field_elements, 0, 6) == "@CHUNK") { + $chunk_name = trim(substr($field_elements, 7)); + $chunk_body = $modx->getChunk($chunk_name); + if ($chunk_body == false) { + $custom_output = $_lang['chunk_no_exist'] . '(' . $_lang['htmlsnippet_name'] . ':' . $chunk_name . ')'; + } else { + $custom_output = $chunk_body; + } + } elseif (substr($field_elements, 0, 5) == "@EVAL") { + $eval_str = trim(substr($field_elements, 6)); + $custom_output = eval($eval_str); + } else { + $custom_output = $field_elements; + } + $replacements = array( + '[+field_type+]' => $field_type, + '[+field_id+]' => $field_id, + '[+default_text+]' => $default_text, + '[+field_value+]' => $modx->htmlspecialchars($field_value), + '[+field_style+]' => $field_style, + ); + $custom_output = str_replace(array_keys($replacements), $replacements, $custom_output); + $modx->documentObject = $content; + $modx->documentIdentifier = $content['id']; + $custom_output = $modx->parseDocumentSource($custom_output); + $field_html .= $custom_output; + break; - default: // the default handler -- for errors, mostly - $field_html .= ''; + default: // the default handler -- for errors, mostly + $field_html .= ''; - } // end switch statement - } else { - $custom = explode(":", $field_type); - $custom_output = ''; - $file_name = MODX_BASE_PATH . 'assets/tvs/' . $custom['1'] . '/' . $custom['1'] . '.customtv.php'; - if(!file_exists($file_name)) { - $custom_output = $file_name . ' does not exist'; - } else { - ob_start(); - include $file_name; - $custom_output = ob_get_contents(); - ob_end_clean(); - } - $replacements = array( - '[+field_type+]' => $field_type, - '[+field_id+]' => $field_id, - '[+default_text+]' => $default_text, - '[+field_value+]' => $modx->htmlspecialchars($field_value), - '[+field_style+]' => $field_style, - ); - $custom_output = str_replace(array_keys($replacements), $replacements, $custom_output); - $modx->documentObject = $content; - $custom_output = $modx->parseDocumentSource($custom_output); - $field_html .= $custom_output; - } + } // end switch statement + } else { + $custom = explode(":", $field_type); + $custom_output = ''; + $file_name = MODX_BASE_PATH . 'assets/tvs/' . $custom['1'] . '/' . $custom['1'] . '.customtv.php'; + if (!file_exists($file_name)) { + $custom_output = $file_name . ' does not exist'; + } else { + ob_start(); + include $file_name; + $custom_output = ob_get_contents(); + ob_end_clean(); + } + $replacements = array( + '[+field_type+]' => $field_type, + '[+field_id+]' => $field_id, + '[+default_text+]' => $default_text, + '[+field_value+]' => $modx->htmlspecialchars($field_value), + '[+field_style+]' => $field_style, + ); + $custom_output = str_replace(array_keys($replacements), $replacements, $custom_output); + $modx->documentObject = $content; + $custom_output = $modx->parseDocumentSource($custom_output); + $field_html .= $custom_output; + } - return $field_html; + return $field_html; } // end renderFormElement function /** * @param string|array|mysqli_result $v * @return array */ -function ParseIntputOptions($v) { +function ParseIntputOptions($v) +{ $modx = evolutionCMS(); - $a = array(); - if(is_array($v)) { - return $v; - } else if($modx->db->isResult($v)) { - while($cols = $modx->db->getRow($v, 'num')) $a[] = $cols; - } else { - $a = explode("||", $v); - } - return $a; + $a = array(); + if (is_array($v)) { + return $v; + } elseif ($modx->db->isResult($v)) { + while ($cols = $modx->db->getRow($v, 'num')) { + $a[] = $cols; + } + } else { + $a = explode("||", $v); + } + return $a; } diff --git a/manager/includes/user_settings.inc.php b/manager/includes/user_settings.inc.php index 81ae5c37c6..78848257fc 100755 --- a/manager/includes/user_settings.inc.php +++ b/manager/includes/user_settings.inc.php @@ -4,7 +4,7 @@ } // START HACK -if (isset ($modx)) { +if (isset($modx)) { $user_id = $modx->getLoginUserID(); } else { $user_id = $_SESSION['mgrInternalKey']; diff --git a/manager/includes/veriword.php b/manager/includes/veriword.php index c33556b14f..4c438bada0 100755 --- a/manager/includes/veriword.php +++ b/manager/includes/veriword.php @@ -5,7 +5,7 @@ $modx->getSettings(); $modx->invokeEvent('OnWebPageInit'); -$vword = new VeriWord(148,60); +$vword = new VeriWord(148, 60); $vword->output_image(); $vword->destroy_image(); @@ -41,7 +41,8 @@ ## see sample.php for test and usage ## sample URL: http://www.program-ruti.org/veriword/ #### -class VeriWord { +class VeriWord +{ /* path to font directory*/ public $dir_font = "ttf/"; @@ -52,7 +53,8 @@ class VeriWord { public $im_height = 0; public $im; - public function __construct($w=200, $h=80) { + public function __construct($w=200, $h=80) + { /* create session to set word for verification */ $this->set_veriword(); $this->dir_font = dirname(__FILE__) . '/' . $this->dir_font; @@ -60,21 +62,24 @@ public function __construct($w=200, $h=80) { $this->im_height = $h; } - public function set_veriword() { + public function set_veriword() + { /* create session variable for verification, you may change the session variable name */ $this->word = $this->pick_word(); $_SESSION['veriword'] = $this->word; } - public function output_image() { + public function output_image() + { /* output the image as jpeg */ $this->draw_image(); header("Content-type: image/jpeg"); imagejpeg($this->im); } - public function pick_word() { + public function pick_word() + { $modx = evolutionCMS(); // set default words $words="MODX,Access,Better,BitCode,Chunk,Cache,Desc,Design,Excell,Enjoy,URLs,TechView,Gerald,Griff,Humphrey,Holiday,Intel,Integration,Joystick,Join(),Oscope,Genetic,Light,Likeness,Marit,Maaike,Niche,Netherlands,Ordinance,Oscillo,Parser,Phusion,Query,Question,Regalia,Righteous,Snippet,Sentinel,Template,Thespian,Unity,Enterprise,Verily,Veri,Website,WideWeb,Yap,Yellow,Zebra,Zygote"; @@ -82,26 +87,27 @@ public function pick_word() { $arr_words = array_filter(array_map('trim', explode(',', $words))); /* pick one randomly for text verification */ - return (string) $arr_words[array_rand($arr_words)].rand(10,999); + return (string) $arr_words[array_rand($arr_words)] . rand(10, 999); } - public function draw_text() { + public function draw_text() + { $dir = dir($this->dir_font); $fontstmp = array(); while (false !== ($file = $dir->read())) { - if(substr($file, -4) == '.ttf') { - $fontstmp[] = $this->dir_font.$file; + if (substr($file, -4) == '.ttf') { + $fontstmp[] = $this->dir_font . $file; } } $dir->close(); $text_font = (string) $fontstmp[array_rand($fontstmp)]; /* angle for text inclination */ - $text_angle = rand(-9,9); + $text_angle = rand(-9, 9); /* initial text size */ $text_size = 30; /* calculate text width and height */ - $box = imagettfbbox ( $text_size, $text_angle, $text_font, $this->word); + $box = imagettfbbox($text_size, $text_angle, $text_font, $this->word); $text_width = $box[2]-$box[0]; //text width $text_height= $box[5]-$box[3]; //text height @@ -109,7 +115,7 @@ public function draw_text() { $text_size = round((20 * $this->im_width)/$text_width); /* recalculate text width and height */ - $box = imagettfbbox ( $text_size, $text_angle, $text_font, $this->word); + $box = imagettfbbox($text_size, $text_angle, $text_font, $this->word); $text_width = $box[2]-$box[0]; //text width $text_height= $box[5]-$box[3]; //text height @@ -118,14 +124,14 @@ public function draw_text() { $text_y = ($this->im_height - $text_height)/2; /* create canvas for text drawing */ - $im_text = imagecreate ($this->im_width, $this->im_height); - $bg_color = imagecolorallocate ($im_text, 255, 255, 255); + $im_text = imagecreate($this->im_width, $this->im_height); + $bg_color = imagecolorallocate($im_text, 255, 255, 255); /* pick color for text */ - $text_color = imagecolorallocate ($im_text, 0, 51, 153); + $text_color = imagecolorallocate($im_text, 0, 51, 153); /* draw text into canvas */ - imagettftext ( $im_text, + imagettftext($im_text, $text_size, $text_angle, $text_x, @@ -140,19 +146,20 @@ public function draw_text() { } - public function draw_image() { + public function draw_image() + { /* pick one background image randomly from image directory */ - $img_file = $this->dir_noise."noise".rand(1,4).".jpg"; + $img_file = $this->dir_noise . "noise" . rand(1, 4) . ".jpg"; /* create "noise" background image from your image stock*/ - $noise_img = @imagecreatefromjpeg ($img_file); + $noise_img = @imagecreatefromjpeg($img_file); $noise_width = imagesx($noise_img); $noise_height = imagesy($noise_img); /* resize the background image to fit the size of image output */ - $this->im = imagecreatetruecolor($this->im_width,$this->im_height); - imagecopyresampled ($this->im, + $this->im = imagecreatetruecolor($this->im_width, $this->im_height); + imagecopyresampled($this->im, $noise_img, 0, 0, 0, 0, $this->im_width, @@ -161,20 +168,18 @@ public function draw_image() { $noise_height); /* put text image into background image */ - imagecopymerge ( $this->im, + imagecopymerge($this->im, $this->draw_text(), 0, 0, 0, 0, $this->im_width, $this->im_height, - 70 ); + 70); return $this->im; } - public function destroy_image() { - + public function destroy_image() + { imagedestroy($this->im); - } - } diff --git a/manager/index.php b/manager/index.php index 2d134aefe9..921bbf7f22 100755 --- a/manager/index.php +++ b/manager/index.php @@ -1,42 +1,42 @@ Unable to load configuration settings"; - echo "Please run the EVO install utility"; - exit; + echo "

    Unable to load configuration settings

    "; + echo "Please run the EVO install utility"; + exit; } // include the database configuration file @@ -139,11 +149,11 @@ // initiate the content manager class if (isset($coreClass) && class_exists($coreClass)) { - $modx = new $coreClass; + $modx = new $coreClass; } if (!isset($modx) || !($modx instanceof DocumentParser)) { - include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php'); - $modx = evolutionCMS(); + include_once(MODX_MANAGER_PATH . 'includes/document.parser.class.inc.php'); + $modx = evolutionCMS(); } $modx->loadExtension("ManagerAPI"); @@ -165,30 +175,31 @@ extract($modx->config, EXTR_OVERWRITE); // now include_once different language file as english -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. +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. } // $length_eng_lang = count($_lang); // Not used for now, required for difference-check with other languages than english (i.e. inside installer) -if($manager_language!="english" && file_exists(MODX_MANAGER_PATH."includes/lang/".$manager_language.".inc.php")) { - include_once "lang/".$manager_language.".inc.php"; +if ($manager_language!="english" && file_exists(MODX_MANAGER_PATH . "includes/lang/" . $manager_language . ".inc.php")) { + include_once "lang/" . $manager_language . ".inc.php"; } // allow custom language overrides not altered by future EVO-updates -if(file_exists(MODX_MANAGER_PATH."includes/lang/override/".$manager_language.".inc.php")) { - include_once "lang/override/".$manager_language.".inc.php"; +if (file_exists(MODX_MANAGER_PATH . "includes/lang/override/" . $manager_language . ".inc.php")) { + include_once "lang/override/" . $manager_language . ".inc.php"; } $s = array('[+MGR_DIR+]'); $r = array(MGR_DIR); -foreach($_lang as $k=>$v) -{ - if(strpos($v,'[+')!==false) $_lang[$k] = str_replace($s, $r, $v); +foreach ($_lang as $k=>$v) { + if (strpos($v, '[+')!==false) { + $_lang[$k] = str_replace($s, $r, $v); + } } // send the charset header -header('Content-Type: text/html; charset='.$modx_manager_charset); +header('Content-Type: text/html; charset=' . $modx_manager_charset); /* * include_once "version.inc.php"; //include version info. Use $modx->getVersionData() @@ -198,46 +209,53 @@ include_once "accesscontrol.inc.php"; // double check the session -if(!isset($_SESSION['mgrValidated'])){ - echo "Not Logged In!"; - exit; +if (!isset($_SESSION['mgrValidated'])) { + echo "Not Logged In!"; + exit; } // include_once the style variables file -if(isset($manager_theme) && !isset($_style)) { - $_style = array(); - include_once "media/style/".$manager_theme."/style.php"; +if (isset($manager_theme) && !isset($_style)) { + $_style = array(); + include_once "media/style/" . $manager_theme . "/style.php"; } // check if user is allowed to access manager interface -if(isset($allow_manager_access) && $allow_manager_access==0) { - include_once "manager.lockout.inc.php"; +if (isset($allow_manager_access) && $allow_manager_access==0) { + include_once "manager.lockout.inc.php"; } // Initialize System Alert Message Queque -if (!isset($_SESSION['SystemAlertMsgQueque'])) $_SESSION['SystemAlertMsgQueque'] = array(); +if (!isset($_SESSION['SystemAlertMsgQueque'])) { + $_SESSION['SystemAlertMsgQueque'] = array(); +} $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque']; // first we check to see if this is a frameset request -if(!isset($_POST['a']) && !isset($_GET['a']) && !isset($_POST['updateMsgCount'])) { - // this looks to be a top-level frameset request, so let's serve up a frameset - if(is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/frames/1.php")) { - include_once "media/style/".$manager_theme."/frames/1.php"; - }else{ - include_once "frames/1.php"; - } - exit; +if (!isset($_POST['a']) && !isset($_GET['a']) && !isset($_POST['updateMsgCount'])) { + // this looks to be a top-level frameset request, so let's serve up a frameset + if (is_file(MODX_MANAGER_PATH . "media/style/" . $manager_theme . "/frames/1.php")) { + include_once "media/style/" . $manager_theme . "/frames/1.php"; + } else { + include_once "frames/1.php"; + } + exit; } // OK, let's retrieve the action directive from the request $option = array('min_range'=>1,'max_range'=>2000); -if(isset($_GET['a']) && isset($_POST['a'])) $modx->webAlertAndQuit($_lang['error_double_action']); -elseif(isset($_GET['a'])) $action = filter_input(INPUT_GET, 'a',FILTER_VALIDATE_INT,$option); -elseif(isset($_POST['a'])) $action = filter_input(INPUT_POST,'a',FILTER_VALIDATE_INT,$option); -else $action = null; +if (isset($_GET['a']) && isset($_POST['a'])) { + $modx->webAlertAndQuit($_lang['error_double_action']); +} elseif (isset($_GET['a'])) { + $action = filter_input(INPUT_GET, 'a', FILTER_VALIDATE_INT, $option); +} elseif (isset($_POST['a'])) { + $action = filter_input(INPUT_POST, 'a', FILTER_VALIDATE_INT, $option); +} else { + $action = null; +} if (isset($_POST['updateMsgCount']) && $modx->hasPermission('messages')) { - include_once 'messageCount.inc.php'; + include_once 'messageCount.inc.php'; } // save page to manager object @@ -245,33 +263,34 @@ // attempt to foil some simple types of CSRF attacks if (isset($modx->config['validate_referer']) && (int)$modx->config['validate_referer']) { - if (isset($_SERVER['HTTP_REFERER'])) { - $referer = $_SERVER['HTTP_REFERER']; - - if (!empty($referer)) { - if (!preg_match('/^'.preg_quote(MODX_SITE_URL, '/').'/i', $referer)) { - $modx->webAlertAndQuit("A possible CSRF attempt was detected from referer: {$referer}.", "index.php"); - } - } else { - $modx->webAlertAndQuit("A possible CSRF attempt was detected. No referer was provided by the client.", "index.php"); - } - } else { - $modx->webAlertAndQuit("A possible CSRF attempt was detected. No referer was provided by the server.", "index.php"); - } + if (isset($_SERVER['HTTP_REFERER'])) { + $referer = $_SERVER['HTTP_REFERER']; + + if (!empty($referer)) { + if (!preg_match('/^' . preg_quote(MODX_SITE_URL, '/') . '/i', $referer)) { + $modx->webAlertAndQuit("A possible CSRF attempt was detected from referer: {$referer}.", "index.php"); + } + } else { + $modx->webAlertAndQuit("A possible CSRF attempt was detected. No referer was provided by the client.", "index.php"); + } + } else { + $modx->webAlertAndQuit("A possible CSRF attempt was detected. No referer was provided by the server.", "index.php"); + } } // invoke OnManagerPageInit event $modx->invokeEvent("OnManagerPageInit", array("action" => $action)); // return element filepath -function includeFileProcessor ($filepath,$manager_theme) { - $element = ""; - if(is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath)) { - $element = MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath; - }else{ - $element = $filepath; - } - return $element; +function includeFileProcessor($filepath, $manager_theme) +{ + $element = ""; + if (is_file(MODX_MANAGER_PATH . "media/style/" . $manager_theme . "/" . $filepath)) { + $element = MODX_MANAGER_PATH . "media/style/" . $manager_theme . "/" . $filepath; + } else { + $element = $filepath; + } + return $element; } // Now we decide what to do according to the action request. This is a BIG list :) @@ -279,714 +298,714 @@ function includeFileProcessor ($filepath,$manager_theme) { /********************************************************************/ /* frame management - show the requested frame */ /********************************************************************/ - case 1 : - // get the requested frame - $frame = preg_replace('/[^a-z0-9]/i','',$_REQUEST['f']); - if($frame>9) { - $enable_debug=false; // this is to stop the debug thingy being attached to the framesets - } - include_once(includeFileProcessor("frames/".$frame.".php",$manager_theme)); - break; + case 1: + // get the requested frame + $frame = preg_replace('/[^a-z0-9]/i', '', $_REQUEST['f']); + if ($frame>9) { + $enable_debug=false; // this is to stop the debug thingy being attached to the framesets + } + include_once(includeFileProcessor("frames/" . $frame . ".php", $manager_theme)); + break; /********************************************************************/ /* show the homepage */ /********************************************************************/ - case 2: - // get the home page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/welcome.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 2: + // get the home page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/welcome.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* document data */ /********************************************************************/ - case 3: - // get the page to show document's data - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/document_data.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 3: + // get the page to show document's data + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/document_data.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* content management */ /********************************************************************/ - case 85: - // get the mutate page for adding a folder - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 27: - // get the mutate page for changing content - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 4: - // get the mutate page for adding content - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 5: - // get the save processor - include_once(includeFileProcessor("processors/save_content.processor.php",$manager_theme)); - break; - case 6: - // get the delete processor - include_once(includeFileProcessor("processors/delete_content.processor.php",$manager_theme)); - break; - case 63: - // get the undelete processor - include_once(includeFileProcessor("processors/undelete_content.processor.php",$manager_theme)); - break; - case 51: - // get the move action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/move_document.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 52: - // get the move document processor - include_once(includeFileProcessor("processors/move_document.processor.php",$manager_theme)); - break; - case 61: - // get the processor for publishing content - include_once(includeFileProcessor("processors/publish_content.processor.php",$manager_theme)); - break; - case 62: - // get the processor for publishing content - include_once(includeFileProcessor("processors/unpublish_content.processor.php",$manager_theme)); - break; - case 56: - // get the sort menuindex action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_menuindex_sort.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 85: + // get the mutate page for adding a folder + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_content.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 27: + // get the mutate page for changing content + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_content.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 4: + // get the mutate page for adding content + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_content.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 5: + // get the save processor + include_once(includeFileProcessor("processors/save_content.processor.php", $manager_theme)); + break; + case 6: + // get the delete processor + include_once(includeFileProcessor("processors/delete_content.processor.php", $manager_theme)); + break; + case 63: + // get the undelete processor + include_once(includeFileProcessor("processors/undelete_content.processor.php", $manager_theme)); + break; + case 51: + // get the move action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/move_document.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 52: + // get the move document processor + include_once(includeFileProcessor("processors/move_document.processor.php", $manager_theme)); + break; + case 61: + // get the processor for publishing content + include_once(includeFileProcessor("processors/publish_content.processor.php", $manager_theme)); + break; + case 62: + // get the processor for publishing content + include_once(includeFileProcessor("processors/unpublish_content.processor.php", $manager_theme)); + break; + case 56: + // get the sort menuindex action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_menuindex_sort.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* show the wait page - gives the tree time to refresh (hopefully) */ /********************************************************************/ - case 7: - // get the wait page (so the tree can reload) - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/wait.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 7: + // get the wait page (so the tree can reload) + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/wait.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* let the user log out */ /********************************************************************/ - case 8: - // get the logout processor - include_once(includeFileProcessor("processors/logout.processor.php",$manager_theme)); - break; + case 8: + // get the logout processor + include_once(includeFileProcessor("processors/logout.processor.php", $manager_theme)); + break; /********************************************************************/ /* user management */ /********************************************************************/ - case 87: - // get the new web user page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 88: - // get the edit web user page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 89: - // get the save web user processor - include_once(includeFileProcessor("processors/save_web_user.processor.php",$manager_theme)); - break; - case 90: - // get the delete web user page - include_once(includeFileProcessor("processors/delete_web_user.processor.php",$manager_theme)); - break; - case 11: - // get the new user page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_user.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 12: - // get the edit user page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_user.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 32: - // get the save user processor - include_once(includeFileProcessor("processors/save_user.processor.php",$manager_theme)); - break; - case 28: - // get the change password page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_password.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 34: - // get the save new password page - include_once(includeFileProcessor("processors/save_password.processor.php",$manager_theme)); - break; - case 33: - // get the delete user page - include_once(includeFileProcessor("processors/delete_user.processor.php",$manager_theme)); - break; + case 87: + // get the new web user page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 88: + // get the edit web user page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 89: + // get the save web user processor + include_once(includeFileProcessor("processors/save_web_user.processor.php", $manager_theme)); + break; + case 90: + // get the delete web user page + include_once(includeFileProcessor("processors/delete_web_user.processor.php", $manager_theme)); + break; + case 11: + // get the new user page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_user.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 12: + // get the edit user page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_user.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 32: + // get the save user processor + include_once(includeFileProcessor("processors/save_user.processor.php", $manager_theme)); + break; + case 28: + // get the change password page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_password.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 34: + // get the save new password page + include_once(includeFileProcessor("processors/save_password.processor.php", $manager_theme)); + break; + case 33: + // get the delete user page + include_once(includeFileProcessor("processors/delete_user.processor.php", $manager_theme)); + break; /********************************************************************/ /* role management */ /********************************************************************/ - case 38: - // get the new role page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_role.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 35: - // get the edit role page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_role.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 36: - // get the save role page - include_once(includeFileProcessor("processors/save_role.processor.php",$manager_theme)); - break; - case 37: - // get the delete role page - include_once(includeFileProcessor("processors/delete_role.processor.php",$manager_theme)); - break; + case 38: + // get the new role page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_role.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 35: + // get the edit role page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_role.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 36: + // get the save role page + include_once(includeFileProcessor("processors/save_role.processor.php", $manager_theme)); + break; + case 37: + // get the delete role page + include_once(includeFileProcessor("processors/delete_role.processor.php", $manager_theme)); + break; /********************************************************************/ /* category management */ /********************************************************************/ - case 120: - // get the edit category page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_categories.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 121: - // for ajax-requests - include_once(includeFileProcessor("actions/mutate_categories.dynamic.php",$manager_theme)); - break; + case 120: + // get the edit category page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_categories.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 121: + // for ajax-requests + include_once(includeFileProcessor("actions/mutate_categories.dynamic.php", $manager_theme)); + break; /********************************************************************/ /* template management */ /********************************************************************/ - case 16: - // get the edit template action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_templates.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 19: - // get the new template action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_templates.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 20: - // get the save processor - include_once(includeFileProcessor("processors/save_template.processor.php",$manager_theme)); - break; - case 21: - // get the delete processor - include_once(includeFileProcessor("processors/delete_template.processor.php",$manager_theme)); - break; - case 96: - // get the duplicate template processor - include_once(includeFileProcessor("processors/duplicate_template.processor.php",$manager_theme)); - break; - case 117: - // change the tv rank for selected template - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_template_tv_rank.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 16: + // get the edit template action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_templates.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 19: + // get the new template action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_templates.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 20: + // get the save processor + include_once(includeFileProcessor("processors/save_template.processor.php", $manager_theme)); + break; + case 21: + // get the delete processor + include_once(includeFileProcessor("processors/delete_template.processor.php", $manager_theme)); + break; + case 96: + // get the duplicate template processor + include_once(includeFileProcessor("processors/duplicate_template.processor.php", $manager_theme)); + break; + case 117: + // change the tv rank for selected template + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_template_tv_rank.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* snippet management */ /********************************************************************/ - case 22: - // get the edit snippet action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 23: - // get the new snippet action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 24: - // get the save processor - include_once(includeFileProcessor("processors/save_snippet.processor.php",$manager_theme)); - break; - case 25: - // get the delete processor - include_once(includeFileProcessor("processors/delete_snippet.processor.php",$manager_theme)); - break; - case 98: - // get the duplicate processor - include_once(includeFileProcessor("processors/duplicate_snippet.processor.php",$manager_theme)); - break; + case 22: + // get the edit snippet action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 23: + // get the new snippet action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 24: + // get the save processor + include_once(includeFileProcessor("processors/save_snippet.processor.php", $manager_theme)); + break; + case 25: + // get the delete processor + include_once(includeFileProcessor("processors/delete_snippet.processor.php", $manager_theme)); + break; + case 98: + // get the duplicate processor + include_once(includeFileProcessor("processors/duplicate_snippet.processor.php", $manager_theme)); + break; /********************************************************************/ /* htmlsnippet management */ /********************************************************************/ - case 78: - // get the edit snippet action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 77: - // get the new snippet action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 79: - // get the save processor - include_once(includeFileProcessor("processors/save_htmlsnippet.processor.php",$manager_theme)); - break; - case 80: - // get the delete processor - include_once(includeFileProcessor("processors/delete_htmlsnippet.processor.php",$manager_theme)); - break; - case 97: - // get the duplicate processor - include_once(includeFileProcessor("processors/duplicate_htmlsnippet.processor.php",$manager_theme)); - break; + case 78: + // get the edit snippet action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 77: + // get the new snippet action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 79: + // get the save processor + include_once(includeFileProcessor("processors/save_htmlsnippet.processor.php", $manager_theme)); + break; + case 80: + // get the delete processor + include_once(includeFileProcessor("processors/delete_htmlsnippet.processor.php", $manager_theme)); + break; + case 97: + // get the duplicate processor + include_once(includeFileProcessor("processors/duplicate_htmlsnippet.processor.php", $manager_theme)); + break; /********************************************************************/ /* show the credits page */ /********************************************************************/ - case 18: - // get the credits page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/credits.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 18: + // get the credits page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/credits.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* empty cache & synchronisation */ /********************************************************************/ - case 26: - // get the cache emptying processor - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/refresh_site.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 26: + // get the cache emptying processor + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/refresh_site.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* Module management */ /********************************************************************/ - case 106: - // get module management - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/modules.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 107: - // get the new module action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_module.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 108: - // get the edit module action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_module.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 109: - // get the save processor - include_once(includeFileProcessor("processors/save_module.processor.php",$manager_theme)); - break; - case 110: - // get the delete processor - include_once(includeFileProcessor("processors/delete_module.processor.php",$manager_theme)); - break; - case 111: - // get the duplicate processor - include_once(includeFileProcessor("processors/duplicate_module.processor.php",$manager_theme)); - break; - case 112: - // execute/run the module - //include_once "header.inc.php"; - include_once(includeFileProcessor("processors/execute_module.processor.php",$manager_theme)); - //include_once "footer.inc.php"; - break; - case 113: - // get the module resources (dependencies) action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_module_resources.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 106: + // get module management + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/modules.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 107: + // get the new module action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_module.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 108: + // get the edit module action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_module.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 109: + // get the save processor + include_once(includeFileProcessor("processors/save_module.processor.php", $manager_theme)); + break; + case 110: + // get the delete processor + include_once(includeFileProcessor("processors/delete_module.processor.php", $manager_theme)); + break; + case 111: + // get the duplicate processor + include_once(includeFileProcessor("processors/duplicate_module.processor.php", $manager_theme)); + break; + case 112: + // execute/run the module + //include_once "header.inc.php"; + include_once(includeFileProcessor("processors/execute_module.processor.php", $manager_theme)); + //include_once "footer.inc.php"; + break; + case 113: + // get the module resources (dependencies) action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_module_resources.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* plugin management */ /********************************************************************/ - case 100: - // change the plugin priority - //include_once "header.inc.php"; - in action file - include_once(includeFileProcessor("actions/mutate_plugin_priority.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 101: - // get the new plugin action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 102: - // get the edit plugin action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 103: - // get the save processor - include_once(includeFileProcessor("processors/save_plugin.processor.php",$manager_theme)); - break; - case 104: - // get the delete processor - include_once(includeFileProcessor("processors/delete_plugin.processor.php",$manager_theme)); - break; - case 105: - // get the duplicate processor - include_once(includeFileProcessor("processors/duplicate_plugin.processor.php",$manager_theme)); - break; - case 119: - // get the purge processor - include_once(includeFileProcessor("processors/purge_plugin.processor.php",$manager_theme)); - break; + case 100: + // change the plugin priority + //include_once "header.inc.php"; - in action file + include_once(includeFileProcessor("actions/mutate_plugin_priority.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 101: + // get the new plugin action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 102: + // get the edit plugin action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 103: + // get the save processor + include_once(includeFileProcessor("processors/save_plugin.processor.php", $manager_theme)); + break; + case 104: + // get the delete processor + include_once(includeFileProcessor("processors/delete_plugin.processor.php", $manager_theme)); + break; + case 105: + // get the duplicate processor + include_once(includeFileProcessor("processors/duplicate_plugin.processor.php", $manager_theme)); + break; + case 119: + // get the purge processor + include_once(includeFileProcessor("processors/purge_plugin.processor.php", $manager_theme)); + break; /********************************************************************/ /* view phpinfo */ /********************************************************************/ - case 200: - // show phpInfo - if($modx->hasPermission('logs')) { - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/phpinfo.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - } - break; + case 200: + // show phpInfo + if ($modx->hasPermission('logs')) { + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/phpinfo.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + } + break; /********************************************************************/ /* errorpage */ /********************************************************************/ - case 29: - // get the error page - include_once(includeFileProcessor("actions/error_dialog.static.php",$manager_theme)); - break; + case 29: + // get the error page + include_once(includeFileProcessor("actions/error_dialog.static.php", $manager_theme)); + break; /********************************************************************/ /* file manager */ /********************************************************************/ - case 31: - // get the page to manage files - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/files.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 31: + // get the page to manage files + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/files.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* access permissions */ /********************************************************************/ - case 40: - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/access_permissions.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 91: - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/web_access_permissions.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 40: + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/access_permissions.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 91: + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/web_access_permissions.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* access groups processor */ /********************************************************************/ - case 41: - include_once(includeFileProcessor("processors/access_groups.processor.php",$manager_theme)); - break; - case 92: - include_once(includeFileProcessor("processors/web_access_groups.processor.php",$manager_theme)); - break; + case 41: + include_once(includeFileProcessor("processors/access_groups.processor.php", $manager_theme)); + break; + case 92: + include_once(includeFileProcessor("processors/web_access_groups.processor.php", $manager_theme)); + break; /********************************************************************/ /* settings editor */ /********************************************************************/ - case 17: - // get the settings editor - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_settings.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 118: - // call settings ajax include - ob_clean(); - include_once(includeFileProcessor("includes/mutate_settings.ajax.php",$manager_theme)); - break; + case 17: + // get the settings editor + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_settings.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 118: + // call settings ajax include + ob_clean(); + include_once(includeFileProcessor("includes/mutate_settings.ajax.php", $manager_theme)); + break; /********************************************************************/ /* save settings */ /********************************************************************/ - case 30: - // get the save settings processor - include_once(includeFileProcessor("processors/save_settings.processor.php",$manager_theme)); - break; + case 30: + // get the save settings processor + include_once(includeFileProcessor("processors/save_settings.processor.php", $manager_theme)); + break; /********************************************************************/ /* system information */ /********************************************************************/ - case 53: - // get the settings editor - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/sysinfo.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 53: + // get the settings editor + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/sysinfo.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* optimise table */ /********************************************************************/ - case 54: - // get the table optimizer/truncate processor - include_once(includeFileProcessor("processors/optimize_table.processor.php",$manager_theme)); - break; + case 54: + // get the table optimizer/truncate processor + include_once(includeFileProcessor("processors/optimize_table.processor.php", $manager_theme)); + break; /********************************************************************/ /* view logging */ /********************************************************************/ - case 13: - // view logging - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/logging.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 13: + // view logging + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/logging.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* empty logs */ /********************************************************************/ - case 55: - // get the settings editor - include_once(includeFileProcessor("processors/empty_table.processor.php",$manager_theme)); - break; + case 55: + // get the settings editor + include_once(includeFileProcessor("processors/empty_table.processor.php", $manager_theme)); + break; /********************************************************************/ /* calls test page */ /********************************************************************/ - case 999: - // get the test page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("test_page.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 999: + // get the test page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("test_page.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* Empty recycle bin */ /********************************************************************/ - case 64: - // get the Recycle bin emptier - include_once(includeFileProcessor("processors/remove_content.processor.php",$manager_theme)); - break; + case 64: + // get the Recycle bin emptier + include_once(includeFileProcessor("processors/remove_content.processor.php", $manager_theme)); + break; /********************************************************************/ /* Messages */ /********************************************************************/ - case 10: - // get the messages page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/messages.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 10: + // get the messages page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/messages.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* Delete a message */ /********************************************************************/ - case 65: - // get the message deleter - include_once(includeFileProcessor("processors/delete_message.processor.php",$manager_theme)); - break; + case 65: + // get the message deleter + include_once(includeFileProcessor("processors/delete_message.processor.php", $manager_theme)); + break; /********************************************************************/ /* Send a message */ /********************************************************************/ - case 66: - // get the message deleter - include_once(includeFileProcessor("processors/send_message.processor.php",$manager_theme)); - break; + case 66: + // get the message deleter + include_once(includeFileProcessor("processors/send_message.processor.php", $manager_theme)); + break; /********************************************************************/ /* Remove locks */ /********************************************************************/ - case 67: - // get the lock remover - include_once(includeFileProcessor("processors/remove_locks.processor.php",$manager_theme)); - break; + case 67: + // get the lock remover + include_once(includeFileProcessor("processors/remove_locks.processor.php", $manager_theme)); + break; /********************************************************************/ /* Site schedule */ /********************************************************************/ - case 70: - // get the schedule page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/site_schedule.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 70: + // get the schedule page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/site_schedule.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* Search */ /********************************************************************/ - case 71: - // get the search page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/search.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 71: + // get the search page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/search.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* About */ /********************************************************************/ - case 59: - // get the about page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/about.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 59: + // get the about page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/about.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* Add weblink */ /********************************************************************/ - case 72: - // get the weblink page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 72: + // get the weblink page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_content.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* User management */ /********************************************************************/ - case 75: - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/user_management.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 99: - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/web_user_management.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 86: - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/role_management.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 75: + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/user_management.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 99: + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/web_user_management.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 86: + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/role_management.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* template/ snippet management */ /********************************************************************/ - case 76: - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/resources.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 76: + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/resources.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* Export to file */ /********************************************************************/ - case 83: - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/export_site.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 83: + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/export_site.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* Resource Selector */ /********************************************************************/ - case 84: - include_once(includeFileProcessor("actions/resource_selector.static.php",$manager_theme)); - break; + case 84: + include_once(includeFileProcessor("actions/resource_selector.static.php", $manager_theme)); + break; /********************************************************************/ /* Backup Manager */ /********************************************************************/ - case 93: - # header and footer will be handled interally - include_once(includeFileProcessor("actions/bkmanager.static.php",$manager_theme)); - break; + case 93: + # header and footer will be handled interally + include_once(includeFileProcessor("actions/bkmanager.static.php", $manager_theme)); + break; /********************************************************************/ /* Duplicate Document */ /********************************************************************/ - case 94: - // get the duplicate processor - include_once(includeFileProcessor("processors/duplicate_content.processor.php",$manager_theme)); - break; + case 94: + // get the duplicate processor + include_once(includeFileProcessor("processors/duplicate_content.processor.php", $manager_theme)); + break; /********************************************************************/ /* Import Document from file */ /********************************************************************/ - case 95: - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/import_site.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 95: + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/import_site.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* Help */ /********************************************************************/ - case 9: - // get the help page - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/help.static.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 9: + // get the help page + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/help.static.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* Template Variables - Based on Apodigm's Docvars */ /********************************************************************/ - case 300: - // get the new document variable action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 301: - // get the edit document variable action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 302: - // get the save processor - include_once(includeFileProcessor("processors/save_tmplvars.processor.php",$manager_theme)); - break; - case 303: - // get the delete processor - include_once(includeFileProcessor("processors/delete_tmplvars.processor.php",$manager_theme)); - break; - case 304: - // get the duplicate processor - include_once(includeFileProcessor("processors/duplicate_tmplvars.processor.php",$manager_theme)); - break; - case 305: - // get the tv-rank action - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/mutate_tv_rank.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; + case 300: + // get the new document variable action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 301: + // get the edit document variable action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 302: + // get the save processor + include_once(includeFileProcessor("processors/save_tmplvars.processor.php", $manager_theme)); + break; + case 303: + // get the delete processor + include_once(includeFileProcessor("processors/delete_tmplvars.processor.php", $manager_theme)); + break; + case 304: + // get the duplicate processor + include_once(includeFileProcessor("processors/duplicate_tmplvars.processor.php", $manager_theme)); + break; + case 305: + // get the tv-rank action + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/mutate_tv_rank.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; /********************************************************************/ /* Event viewer: show event message log */ /********************************************************************/ - case 114: - // get event logs - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/eventlog.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 115: - // get event log details viewer - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - include_once(includeFileProcessor("actions/eventlog_details.dynamic.php",$manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); - break; - case 116: - // get the event log delete processor - include_once(includeFileProcessor("processors/delete_eventlog.processor.php",$manager_theme)); - break; - - case 501: - //delete category - include_once(includeFileProcessor("processors/delete_category.processor.php",$manager_theme)); - break; + case 114: + // get event logs + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/eventlog.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 115: + // get event log details viewer + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + include_once(includeFileProcessor("actions/eventlog_details.dynamic.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + break; + case 116: + // get the event log delete processor + include_once(includeFileProcessor("processors/delete_eventlog.processor.php", $manager_theme)); + break; + + case 501: + //delete category + include_once(includeFileProcessor("processors/delete_category.processor.php", $manager_theme)); + break; /********************************************************************/ /* default action: show not implemented message */ /********************************************************************/ - default : - // say that what was requested doesn't do anything yet - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); - echo " -
    ".$_lang['functionnotimpl']."
    + default: + // say that what was requested doesn't do anything yet + include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); + echo " +
    " . $_lang['functionnotimpl'] . "
    -

    ".$_lang['functionnotimpl_message']."

    +

    " . $_lang['functionnotimpl_message'] . "

    "; - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); } /********************************************************************/ // log action, unless it's a frame request -if($action!=1 && $action!=7 && $action!=2) { - include_once "log.class.inc.php"; - $log = new logHandler; - $log->initAndWriteLog(); +if ($action!=1 && $action!=7 && $action!=2) { + include_once "log.class.inc.php"; + $log = new logHandler; + $log->initAndWriteLog(); } /********************************************************************/ // show debug diff --git a/manager/media/browser/mcpuk/browse.php b/manager/media/browser/mcpuk/browse.php index 0f0e308919..a89e141a4e 100755 --- a/manager/media/browser/mcpuk/browse.php +++ b/manager/media/browser/mcpuk/browse.php @@ -14,14 +14,19 @@ require "core/autoload.php"; // Init MODX -function returnNoPermissionsMessage($role) { - global $_lang; - echo sprintf($_lang['files_management_no_permission'], $role); - exit; +function returnNoPermissionsMessage($role) +{ + global $_lang; + echo sprintf($_lang['files_management_no_permission'], $role); + exit; } -if( $_GET['type'] == 'images' && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_images')) returnNoPermissionsMessage('assets_images'); -if( $_GET['type'] == 'files' && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_files')) returnNoPermissionsMessage('assets_files'); +if ($_GET['type'] == 'images' && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_images')) { + returnNoPermissionsMessage('assets_images'); +} +if ($_GET['type'] == 'files' && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_files')) { + returnNoPermissionsMessage('assets_files'); +} $browser = new browser($modx); $browser->action(); diff --git a/manager/media/browser/mcpuk/browser.php b/manager/media/browser/mcpuk/browser.php index 7ed522bbbf..0e76c21c27 100755 --- a/manager/media/browser/mcpuk/browser.php +++ b/manager/media/browser/mcpuk/browser.php @@ -10,14 +10,20 @@ } }; window.location.href = "browse.php?"; diff --git a/manager/media/browser/mcpuk/config.php b/manager/media/browser/mcpuk/config.php index 6bb2648559..eff680bb65 100755 --- a/manager/media/browser/mcpuk/config.php +++ b/manager/media/browser/mcpuk/config.php @@ -26,12 +26,12 @@ 'theme' => "evo", - 'uploadURL' => rtrim($modx->config['rb_base_url'],'/'), - 'uploadDir' => rtrim($modx->config['rb_base_dir'],'/'), + 'uploadURL' => rtrim($modx->config['rb_base_url'], '/'), + 'uploadDir' => rtrim($modx->config['rb_base_dir'], '/'), 'siteURL' => $modx->config['site_url'], - 'assetsURL' => rtrim($modx->config['rb_base_url'],'/'), - 'dirPerms' => intval($modx->config['new_folder_permissions'],8), - 'filePerms' => intval($modx->config['new_file_permissions'],8), + 'assetsURL' => rtrim($modx->config['rb_base_url'], '/'), + 'dirPerms' => intval($modx->config['new_folder_permissions'], 8), + 'filePerms' => intval($modx->config['new_file_permissions'], 8), 'maxfilesize' => $settings['upload_maxsize'], 'denyUpdateCheck' => true, @@ -58,14 +58,14 @@ 'types' => array( // CKEditor & FCKEditor types - 'files' => str_replace(',',' ',$modx->config['upload_files']), - 'flash' => str_replace(',',' ',$modx->config['upload_flash']), - 'images' => str_replace(',',' ',$modx->config['upload_images']), + 'files' => str_replace(',', ' ', $modx->config['upload_files']), + 'flash' => str_replace(',', ' ', $modx->config['upload_flash']), + 'images' => str_replace(',', ' ', $modx->config['upload_images']), // TinyMCE types - 'file' => str_replace(',',' ',$modx->config['upload_files']), - 'media' => str_replace(',',' ',$modx->config['upload_media']), - 'image' => str_replace(',',' ',$modx->config['upload_images']), + 'file' => str_replace(',', ' ', $modx->config['upload_files']), + 'media' => str_replace(',', ' ', $modx->config['upload_media']), + 'image' => str_replace(',', ' ', $modx->config['upload_images']), ), 'dirnameChangeChars' => array( ' ' => "_", diff --git a/manager/media/browser/mcpuk/core/autoload.php b/manager/media/browser/mcpuk/core/autoload.php index 8f910cad63..bcb37f83c2 100755 --- a/manager/media/browser/mcpuk/core/autoload.php +++ b/manager/media/browser/mcpuk/core/autoload.php @@ -19,39 +19,42 @@ * here, they can be accessed in config.php via $GLOBALS array. * It's recommended to use constants instead. */ -include_once(dirname(__FILE__)."/../../../../../assets/cache/siteManager.php"); +include_once(dirname(__FILE__) . "/../../../../../assets/cache/siteManager.php"); require_once('../../../includes/protect.inc.php'); include_once('../../../includes/config.inc.php'); include_once('../../../includes/document.parser.class.inc.php'); $modx = evolutionCMS(); $modx->db->connect(); startCMSSession(); -if(!isset($_SESSION['mgrValidated'])) { - die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (!isset($_SESSION['mgrValidated'])) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } define('IN_MANAGER_MODE', true); $modx->getSettings(); $manager_language = $modx->config['manager_language']; // Pass language code from MODX to KCFinder -if(!file_exists("../../../includes/lang/".$manager_language.".inc.php")) { +if (!file_exists("../../../includes/lang/" . $manager_language . ".inc.php")) { $manager_language = "english"; // if not set, get the english language file. } -include_once "../../../includes/lang/".$manager_language.".inc.php"; +include_once "../../../includes/lang/" . $manager_language . ".inc.php"; $_GET['langCode'] = $modx_lang_attribute; // PHP VERSION CHECK -if (substr(PHP_VERSION, 0, strpos(PHP_VERSION, '.')) < 5) +if (substr(PHP_VERSION, 0, strpos(PHP_VERSION, '.')) < 5) { die("You are using PHP " . PHP_VERSION . " when KCFinder require at least version 5! Some systems has an option to change the active PHP version. Please refer to your hosting provider or upgrade your PHP distribution."); +} // SAFE MODE CHECK -if (ini_get("safe_mode")) +if (ini_get("safe_mode")) { die("The \"safe_mode\" PHP ini setting is turned on! You cannot run KCFinder in safe mode."); +} // MAGIC AUTOLOAD CLASSES FUNCTION -function autoloadda9d06472ccb71b84928677ce2a6ca89($class) { +function autoloadda9d06472ccb71b84928677ce2a6ca89($class) +{ static $classes = null; if ($classes === null) { $classes = array( @@ -83,8 +86,8 @@ function autoloadda9d06472ccb71b84928677ce2a6ca89($class) { // json_encode() IMPLEMENTATION IF JSON EXTENSION IS MISSING if (!function_exists("json_encode")) { - - function kcfinder_json_string_encode($string) { + function kcfinder_json_string_encode($string) + { return '"' . str_replace('/', "\\/", str_replace("\t", "\\t", @@ -95,37 +98,42 @@ function kcfinder_json_string_encode($string) { $string)))))) . '"'; } - function json_encode($data) { - + function json_encode($data) + { if (is_array($data)) { $ret = array(); // OBJECT if (array_keys($data) !== range(0, count($data) - 1)) { - foreach ($data as $key => $val) + foreach ($data as $key => $val) { $ret[] = kcfinder_json_string_encode($key) . ':' . json_encode($val); + } return "{" . implode(",", $ret) . "}"; // ARRAY } else { - foreach ($data as $val) + foreach ($data as $val) { $ret[] = json_encode($val); + } return "[" . implode(",", $ret) . "]"; } - // BOOLEAN OR NULL - } elseif (is_bool($data) || ($data === null)) + // BOOLEAN OR NULL + } elseif (is_bool($data) || ($data === null)) { return ($data === null) ? "null" : ($data ? "true" : "false"); + } // FLOAT - elseif (is_float($data)) + elseif (is_float($data)) { return rtrim(rtrim(number_format($data, 14, ".", ""), "0"), "."); + } // INTEGER - elseif (is_int($data)) + elseif (is_int($data)) { return $data; + } // STRING return kcfinder_json_string_encode($data); diff --git a/manager/media/browser/mcpuk/core/browser.php b/manager/media/browser/mcpuk/core/browser.php index a978b321b1..79d61b8f07 100755 --- a/manager/media/browser/mcpuk/core/browser.php +++ b/manager/media/browser/mcpuk/core/browser.php @@ -12,23 +12,29 @@ * @link http://kcfinder.sunhater.com */ -class browser extends uploader { +class browser extends uploader +{ protected $action; protected $thumbsDir; protected $thumbsTypeDir; - public function __construct($modx) { + public function __construct($modx) + { parent::__construct($modx); if (isset($this->post['dir'])) { $dir = $this->checkInputDir($this->post['dir'], true, false); - if ($dir === false) unset($this->post['dir']); + if ($dir === false) { + unset($this->post['dir']); + } $this->post['dir'] = $dir; } if (isset($this->get['dir'])) { $dir = $this->checkInputDir($this->get['dir'], true, false); - if ($dir === false) unset($this->get['dir']); + if ($dir === false) { + unset($this->get['dir']); + } $this->get['dir'] = $dir; } @@ -44,8 +50,9 @@ public function __construct($modx) { !is_dir("$thumbsDir/{$this->type}") && !@mkdir("$thumbsDir/{$this->type}", $this->config['dirPerms']) ) - ) + ) { $this->errorMsg("Cannot access or create thumbnails folder."); + } $this->thumbsDir = $thumbsDir; $this->thumbsTypeDir = "$thumbsDir/{$this->type}"; @@ -58,23 +65,30 @@ public function __construct($modx) { if (is_array($files) && count($files)) { $time = time(); - foreach ($files as $file) - if (is_file($file) && ($time - filemtime($file) > 3600)) + foreach ($files as $file) { + if (is_file($file) && ($time - filemtime($file) > 3600)) { unlink($file); + } + } } if (isset($this->get['theme']) && ($this->get['theme'] == basename($this->get['theme'])) && is_dir("themes/{$this->get['theme']}") - ) + ) { $this->config['theme'] = $this->get['theme']; + } } - public function action() { + public function action() + { $act = isset($this->get['act']) ? $this->get['act'] : "browser"; - if(!preg_match('@^[0-9a-zA-Z_]+$@', $act)) $this->errorMsg("Unknown error."); - if (!method_exists($this, "act_$act")) + if (!preg_match('@^[0-9a-zA-Z_]+$@', $act)) { + $this->errorMsg("Unknown error."); + } + if (!method_exists($this, "act_$act")) { $act = "browser"; + } $this->action = $act; $method = "act_$act"; @@ -82,21 +96,22 @@ public function action() { $message = $this->label("You don't have permissions to browse server."); if (in_array($act, array("browser", "upload")) || (substr($act, 0, 8) == "download") - ) + ) { $this->backMsg($message); - else { + } else { header("Content-Type: text/plain; charset={$this->charset}"); die(json_encode(array('error' => $message))); } } - if (!isset($this->session['dir'])) + if (!isset($this->session['dir'])) { $this->session['dir'] = $this->type; - else { + } else { $type = $this->getTypeFromPath($this->session['dir']); $dir = $this->config['uploadDir'] . "/" . $this->session['dir']; - if (($type != $this->type) || !is_dir($dir) || !is_readable($dir)) + if (($type != $this->type) || !is_dir($dir) || !is_readable($dir)) { $this->session['dir'] = $this->type; + } } $this->session['dir'] = path::normalize($this->session['dir']); @@ -106,8 +121,9 @@ public function action() { } elseif ( (substr($act, 0, 8) != "download") && !in_array($act, array("thumb", "upload")) - ) + ) { header("Content-Type: text/plain; charset={$this->charset}"); + } $return = $this->$method(); echo ($return === true) @@ -115,21 +131,25 @@ public function action() { : $return; } - protected function act_browser() { + protected function act_browser() + { if (isset($this->get['dir']) && is_dir("{$this->typeDir}/{$this->get['dir']}") && is_readable("{$this->typeDir}/{$this->get['dir']}") - ) + ) { $this->session['dir'] = path::normalize("{$this->type}/{$this->get['dir']}"); + } return $this->output(); } - protected function act_init() { + protected function act_init() + { $tree = $this->getDirInfo($this->typeDir); $tree['dirs'] = $this->getTree($this->session['dir']); - if (!is_array($tree['dirs']) || !count($tree['dirs'])) + if (!is_array($tree['dirs']) || !count($tree['dirs'])) { unset($tree['dirs']); + } $files = $this->getFiles($this->session['dir']); $dirWritable = dir::isWritable("{$this->config['uploadDir']}/{$this->session['dir']}"); $data = array( @@ -140,21 +160,26 @@ protected function act_init() { return json_encode($data); } - protected function act_thumb() { + protected function act_thumb() + { $this->getDir($this->get['dir'], true); - if (!isset($this->get['file']) || !isset($this->get['dir'])) + if (!isset($this->get['file']) || !isset($this->get['dir'])) { $this->sendDefaultThumb(); + } $file = $this->get['file']; - if (basename($file) != $file) + if (basename($file) != $file) { $this->sendDefaultThumb(); + } $file = "{$this->thumbsDir}/{$this->type}/{$this->get['dir']}/$file"; if (!is_file($file) || !is_readable($file)) { $file = "{$this->config['uploadDir']}/{$this->type}/{$this->get['dir']}/" . basename($file); - if (!is_file($file) || !is_readable($file)) + if (!is_file($file) || !is_readable($file)) { $this->sendDefaultThumb($file); + } $image = image::factory($this->imageDriver, $file); - if ($image->initError) + if ($image->initError) { $this->sendDefaultThumb($file); + } list($tmp, $tmp, $type) = getimagesize($file); if (in_array($type, array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG)) && ($image->width <= $this->config['thumbWidth']) && @@ -165,17 +190,20 @@ protected function act_thumb() { ($type == IMAGETYPE_PNG) ? "png" : "jpeg"); $mime = "image/$mime"; httpCache::file($file, $mime); - } else + } else { $this->sendDefaultThumb($file); + } } httpCache::file($file, "image/jpeg"); } - protected function act_expand() { + protected function act_expand() + { return json_encode(array('dirs' => $this->getDirs($this->postDir()))); } - protected function act_chDir() { + protected function act_chDir() + { $this->postDir(); // Just for existing check $this->session['dir'] = $this->type . "/" . $this->post['dir']; $dirWritable = dir::isWritable("{$this->config['uploadDir']}/{$this->session['dir']}"); @@ -185,81 +213,104 @@ protected function act_chDir() { )); } - protected function act_newDir() { + protected function act_newDir() + { if (!$this->config['access']['dirs']['create'] || !isset($this->post['dir']) || !isset($this->post['newDir']) - ) + ) { $this->errorMsg("Unknown error."); + } $dir = $this->postDir(); $newDir = $this->normalizeDirname(trim($this->post['newDir'])); - if (!strlen($newDir)) + if (!strlen($newDir)) { $this->errorMsg("Please enter new folder name."); - if (preg_match('/[\/\\\\]/s', $newDir)) + } + if (preg_match('/[\/\\\\]/s', $newDir)) { $this->errorMsg("Unallowable characters in folder name."); - if (substr($newDir, 0, 1) == ".") + } + if (substr($newDir, 0, 1) == ".") { $this->errorMsg("Folder name shouldn't begins with '.'"); - if (file_exists("$dir/$newDir")) + } + if (file_exists("$dir/$newDir")) { $this->errorMsg("A file or folder with that name already exists."); - if (!@mkdir("$dir/$newDir", $this->config['dirPerms'])) + } + if (!@mkdir("$dir/$newDir", $this->config['dirPerms'])) { $this->errorMsg("Cannot create {dir} folder.", array('dir' => $newDir)); + } return true; } - protected function act_renameDir() { + protected function act_renameDir() + { if (!$this->config['access']['dirs']['rename'] || !isset($this->post['dir']) || !isset($this->post['newName']) - ) + ) { $this->errorMsg("Unknown error."); + } $dir = $this->postDir(); $newName = $this->normalizeDirname(trim($this->post['newName'])); - if (!strlen($newName)) + if (!strlen($newName)) { $this->errorMsg("Please enter new folder name."); - if (preg_match('/[\/\\\\]/s', $newName)) + } + if (preg_match('/[\/\\\\]/s', $newName)) { $this->errorMsg("Unallowable characters in folder name."); - if (substr($newName, 0, 1) == ".") + } + if (substr($newName, 0, 1) == ".") { $this->errorMsg("Folder name shouldn't begins with '.'"); - if (!@rename($dir, dirname($dir) . "/$newName")) + } + if (!@rename($dir, dirname($dir) . "/$newName")) { $this->errorMsg("Cannot rename the folder."); + } $thumbDir = "$this->thumbsTypeDir/{$this->post['dir']}"; - if (is_dir($thumbDir)) + if (is_dir($thumbDir)) { @rename($thumbDir, dirname($thumbDir) . "/$newName"); + } return json_encode(array('name' => $newName)); } - protected function act_deleteDir() { + protected function act_deleteDir() + { if (!$this->config['access']['dirs']['delete'] || !isset($this->post['dir']) || !strlen(trim($this->post['dir'])) - ) + ) { $this->errorMsg("Unknown error."); + } $dir = $this->postDir(); - if (!dir::isWritable($dir)) + if (!dir::isWritable($dir)) { $this->errorMsg("Cannot delete the folder."); + } $result = !dir::prune($dir, false); - if (is_array($result) && count($result)) + if (is_array($result) && count($result)) { $this->errorMsg("Failed to delete {count} files/folders.", array('count' => count($result))); + } $thumbDir = "$this->thumbsTypeDir/{$this->post['dir']}"; - if (is_dir($thumbDir)) dir::prune($thumbDir); + if (is_dir($thumbDir)) { + dir::prune($thumbDir); + } return true; } - protected function act_upload() { + protected function act_upload() + { if (!$this->config['access']['files']['upload'] || !isset($this->post['dir']) - ) + ) { $this->errorMsg("Unknown error."); + } $dir = $this->postDir(); - if (!dir::isWritable($dir)) + if (!dir::isWritable($dir)) { $this->errorMsg("Cannot access or write to upload folder."); + } if (is_array($this->file['name'])) { $return = array(); @@ -271,19 +322,22 @@ protected function act_upload() { ), $dir); } return implode("\n", $return); - } else + } else { return $this->moveUploadFile($this->file, $dir); + } } - protected function act_download() { + protected function act_download() + { $dir = $this->postDir(); if (!isset($this->post['dir']) || !isset($this->post['file']) || - strpos($this->post['file'],'../')!==false || + strpos($this->post['file'], '../')!==false || (false === ($file = "$dir/{$this->post['file']}")) || !file_exists($file) || !is_readable($file) - ) + ) { $this->errorMsg("Unknown error."); + } header("Pragma: public"); header("Expires: 0"); @@ -297,205 +351,248 @@ protected function act_download() { die; } - protected function act_rename() { + protected function act_rename() + { $dir = $this->postDir(); if (!$this->config['access']['files']['rename'] || !isset($this->post['dir']) || !isset($this->post['file']) || - strpos($this->post['file'],'../')!==false || + strpos($this->post['file'], '../')!==false || !isset($this->post['newName']) || (false === ($file = "$dir/{$this->post['file']}")) || !file_exists($file) || !is_readable($file) || !file::isWritable($file) - ) + ) { $this->errorMsg("Unknown error."); + } if (isset($this->config['denyExtensionRename']) && $this->config['denyExtensionRename'] && (file::getExtension($this->post['file'], true) !== file::getExtension($this->post['newName'], true) ) - ) + ) { $this->errorMsg("You cannot rename the extension of files!"); + } $newName = $this->normalizeFilename(trim($this->post['newName'])); - if (!strlen($newName)) + if (!strlen($newName)) { $this->errorMsg("Please enter new file name."); - if (preg_match('/[\/\\\\]/s', $newName)) + } + if (preg_match('/[\/\\\\]/s', $newName)) { $this->errorMsg("Unallowable characters in file name."); - if (substr($newName, 0, 1) == ".") + } + if (substr($newName, 0, 1) == ".") { $this->errorMsg("File name shouldn't begins with '.'"); + } $newName = "$dir/$newName"; - if (file_exists($newName)) + if (file_exists($newName)) { $this->errorMsg("A file or folder with that name already exists."); + } $ext = file::getExtension($newName); - if (!$this->validateExtension($ext, $this->type)) + if (!$this->validateExtension($ext, $this->type)) { $this->errorMsg("Denied file extension."); - if (!@rename($file, $newName)) + } + if (!@rename($file, $newName)) { $this->errorMsg("Unknown error."); + } $thumbDir = "{$this->thumbsTypeDir}/{$this->post['dir']}"; $thumbFile = "$thumbDir/{$this->post['file']}"; - if (file_exists($thumbFile)) + if (file_exists($thumbFile)) { @rename($thumbFile, "$thumbDir/" . basename($newName)); + } return true; } - protected function act_delete() { + protected function act_delete() + { $dir = $this->postDir(); if (!$this->config['access']['files']['delete'] || !isset($this->post['dir']) || !isset($this->post['file']) || - strpos($this->post['file'],'../')!==false || + strpos($this->post['file'], '../')!==false || (false === ($file = "$dir/{$this->post['file']}")) || !file_exists($file) || !is_readable($file) || !file::isWritable($file) || !@unlink($file) - ) + ) { $this->errorMsg("Unknown error."); + } $thumb = "{$this->thumbsTypeDir}/{$this->post['dir']}/{$this->post['file']}"; - if (file_exists($thumb)) @unlink($thumb); + if (file_exists($thumb)) { + @unlink($thumb); + } return true; } - protected function act_cp_cbd() { + protected function act_cp_cbd() + { $dir = $this->postDir(); if (!$this->config['access']['files']['copy'] || !isset($this->post['dir']) || !is_dir($dir) || !is_readable($dir) || !dir::isWritable($dir) || !isset($this->post['files']) || !is_array($this->post['files']) || !count($this->post['files']) - ) + ) { $this->errorMsg("Unknown error."); + } $error = array(); - foreach($this->post['files'] as $file) { + foreach ($this->post['files'] as $file) { $file = path::normalize($file); - if (substr($file, 0, 1) == ".") continue; + if (substr($file, 0, 1) == ".") { + continue; + } $type = explode("/", $file); $type = $type[0]; - if ($type != $this->type) continue; + if ($type != $this->type) { + continue; + } $path = "{$this->config['uploadDir']}/$file"; $base = basename($file); $replace = array('file' => $base); $ext = file::getExtension($base); - if (!file_exists($path)) + if (!file_exists($path)) { $error[] = $this->label("The file '{file}' does not exist.", $replace); - elseif (substr($base, 0, 1) == ".") + } elseif (substr($base, 0, 1) == ".") { $error[] = "$base: " . $this->label("File name shouldn't begins with '.'"); - elseif (!$this->validateExtension($ext, $type)) + } elseif (!$this->validateExtension($ext, $type)) { $error[] = "$base: " . $this->label("Denied file extension."); - elseif (file_exists("$dir/$base")) + } elseif (file_exists("$dir/$base")) { $error[] = "$base: " . $this->label("A file or folder with that name already exists."); - elseif (!is_readable($path) || !is_file($path)) + } elseif (!is_readable($path) || !is_file($path)) { $error[] = $this->label("Cannot read '{file}'.", $replace); - elseif (!@copy($path, "$dir/$base")) + } elseif (!@copy($path, "$dir/$base")) { $error[] = $this->label("Cannot copy '{file}'.", $replace); - else { - if (function_exists("chmod")) + } else { + if (function_exists("chmod")) { @chmod("$dir/$base", $this->config['filePerms']); + } $fromThumb = "{$this->thumbsDir}/$file"; if (is_file($fromThumb) && is_readable($fromThumb)) { $toThumb = "{$this->thumbsTypeDir}/{$this->post['dir']}"; - if (!is_dir($toThumb)) + if (!is_dir($toThumb)) { @mkdir($toThumb, $this->config['dirPerms'], true); + } $toThumb .= "/$base"; @copy($fromThumb, $toThumb); } } } - if (count($error)) + if (count($error)) { return json_encode(array('error' => $error)); + } return true; } - protected function act_mv_cbd() { + protected function act_mv_cbd() + { $dir = $this->postDir(); if (!$this->config['access']['files']['move'] || !isset($this->post['dir']) || !is_dir($dir) || !is_readable($dir) || !dir::isWritable($dir) || !isset($this->post['files']) || !is_array($this->post['files']) || !count($this->post['files']) - ) + ) { $this->errorMsg("Unknown error."); + } $error = array(); - foreach($this->post['files'] as $file) { + foreach ($this->post['files'] as $file) { $file = path::normalize($file); - if (substr($file, 0, 1) == ".") continue; + if (substr($file, 0, 1) == ".") { + continue; + } $type = explode("/", $file); $type = $type[0]; - if ($type != $this->type) continue; + if ($type != $this->type) { + continue; + } $path = "{$this->config['uploadDir']}/$file"; $base = basename($file); $replace = array('file' => $base); $ext = file::getExtension($base); - if (!file_exists($path)) + if (!file_exists($path)) { $error[] = $this->label("The file '{file}' does not exist.", $replace); - elseif (substr($base, 0, 1) == ".") + } elseif (substr($base, 0, 1) == ".") { $error[] = "$base: " . $this->label("File name shouldn't begins with '.'"); - elseif (!$this->validateExtension($ext, $type)) + } elseif (!$this->validateExtension($ext, $type)) { $error[] = "$base: " . $this->label("Denied file extension."); - elseif (file_exists("$dir/$base")) + } elseif (file_exists("$dir/$base")) { $error[] = "$base: " . $this->label("A file or folder with that name already exists."); - elseif (!is_readable($path) || !is_file($path)) + } elseif (!is_readable($path) || !is_file($path)) { $error[] = $this->label("Cannot read '{file}'.", $replace); - elseif (!file::isWritable($path) || !@rename($path, "$dir/$base")) + } elseif (!file::isWritable($path) || !@rename($path, "$dir/$base")) { $error[] = $this->label("Cannot move '{file}'.", $replace); - else { - if (function_exists("chmod")) + } else { + if (function_exists("chmod")) { @chmod("$dir/$base", $this->config['filePerms']); + } $fromThumb = "{$this->thumbsDir}/$file"; if (is_file($fromThumb) && is_readable($fromThumb)) { $toThumb = "{$this->thumbsTypeDir}/{$this->post['dir']}"; - if (!is_dir($toThumb)) + if (!is_dir($toThumb)) { @mkdir($toThumb, $this->config['dirPerms'], true); + } $toThumb .= "/$base"; @rename($fromThumb, $toThumb); } } } - if (count($error)) + if (count($error)) { return json_encode(array('error' => $error)); + } return true; } - protected function act_rm_cbd() { + protected function act_rm_cbd() + { if (!$this->config['access']['files']['delete'] || !isset($this->post['files']) || !is_array($this->post['files']) || !count($this->post['files']) - ) + ) { $this->errorMsg("Unknown error."); + } $error = array(); - foreach($this->post['files'] as $file) { + foreach ($this->post['files'] as $file) { $file = path::normalize($file); - if (substr($file, 0, 1) == ".") continue; + if (substr($file, 0, 1) == ".") { + continue; + } $type = explode("/", $file); $type = $type[0]; - if ($type != $this->type) continue; + if ($type != $this->type) { + continue; + } $path = "{$this->config['uploadDir']}/$file"; $base = basename($file); $replace = array('file' => $base); - if (!is_file($path)) + if (!is_file($path)) { $error[] = $this->label("The file '{file}' does not exist.", $replace); - elseif (!@unlink($path)) + } elseif (!@unlink($path)) { $error[] = $this->label("Cannot delete '{file}'.", $replace); - else { + } else { $thumb = "{$this->thumbsDir}/$file"; - if (is_file($thumb)) @unlink($thumb); + if (is_file($thumb)) { + @unlink($thumb); + } } } - if (count($error)) + if (count($error)) { return json_encode(array('error' => $error)); + } return true; } - protected function act_downloadDir() { + protected function act_downloadDir() + { $dir = $this->postDir(); - if (!isset($this->post['dir']) || $this->config['denyZipDownload']) + if (!isset($this->post['dir']) || $this->config['denyZipDownload']) { $this->errorMsg("Unknown error."); + } $filename = basename($dir) . ".zip"; do { $file = md5(time() . session_id()); @@ -510,23 +607,27 @@ protected function act_downloadDir() { die; } - protected function act_downloadSelected() { + protected function act_downloadSelected() + { $dir = $this->postDir(); if (!isset($this->post['dir']) || !isset($this->post['files']) || !is_array($this->post['files']) || $this->config['denyZipDownload'] - ) + ) { $this->errorMsg("Unknown error."); + } $zipFiles = array(); foreach ($this->post['files'] as $file) { $file = path::normalize($file); - if ((substr($file, 0, 1) == ".") || (strpos($file, '/') !== false)) + if ((substr($file, 0, 1) == ".") || (strpos($file, '/') !== false)) { continue; + } $file = "$dir/$file"; - if (!is_file($file) || !is_readable($file)) + if (!is_file($file) || !is_readable($file)) { continue; + } $zipFiles[] = $file; } @@ -537,9 +638,10 @@ protected function act_downloadSelected() { $zip = new ZipArchive(); $res = $zip->open($file, ZipArchive::CREATE); - if ($res === TRUE) { - foreach ($zipFiles as $cfile) + if ($res === true) { + foreach ($zipFiles as $cfile) { $zip->addFile($cfile, basename($cfile)); + } $zip->close(); } header("Content-Type: application/x-zip"); @@ -550,25 +652,30 @@ protected function act_downloadSelected() { die; } - protected function act_downloadClipboard() { + protected function act_downloadClipboard() + { if (!isset($this->post['files']) || !is_array($this->post['files']) || $this->config['denyZipDownload'] - ) + ) { $this->errorMsg("Unknown error."); + } $zipFiles = array(); foreach ($this->post['files'] as $file) { $file = path::normalize($file); - if ((substr($file, 0, 1) == ".")) + if ((substr($file, 0, 1) == ".")) { continue; + } $type = explode("/", $file); $type = $type[0]; - if ($type != $this->type) + if ($type != $this->type) { continue; + } $file = $this->config['uploadDir'] . "/$file"; - if (!is_file($file) || !is_readable($file)) + if (!is_file($file) || !is_readable($file)) { continue; + } $zipFiles[] = $file; } @@ -579,9 +686,10 @@ protected function act_downloadClipboard() { $zip = new ZipArchive(); $res = $zip->open($file, ZipArchive::CREATE); - if ($res === TRUE) { - foreach ($zipFiles as $cfile) + if ($res === true) { + foreach ($zipFiles as $cfile) { $zip->addFile($cfile, basename($cfile)); + } $zip->close(); } header("Content-Type: application/x-zip"); @@ -592,16 +700,19 @@ protected function act_downloadClipboard() { die; } - protected function act_check4Update() { - if ($this->config['denyUpdateCheck']) + protected function act_check4Update() + { + if ($this->config['denyUpdateCheck']) { return json_encode(array('version' => false)); + } // Caching HTTP request for 6 hours if (isset($this->session['checkVersion']) && isset($this->session['checkVersionTime']) && ((time() - $this->session['checkVersionTime']) < 21600) - ) + ) { return json_encode(array('version' => $this->session['checkVersion'])); + } $protocol = "http"; $host = "kcfinder.sunhater.com"; @@ -618,7 +729,8 @@ protected function act_check4Update() { preg_match($pattern, $ver) // HTTP extension - ) {} elseif ( + ) { + } elseif ( function_exists("http_get") && (false !== ($ver = @http_get($url))) && ( @@ -630,48 +742,55 @@ function_exists("http_get") && preg_match($pattern, $ver) // Curl extension - ) {} elseif ( + ) { + } elseif ( function_exists("curl_init") && - (false !== ( $curl = @curl_init($url) )) && - ( @ob_start() || (@curl_close($curl) && false)) && - ( @curl_exec($curl) || (@curl_close($curl) && false)) && - ((false !== ( $ver = @ob_get_clean() )) || (@curl_close($curl) && false)) && - ( @curl_close($curl) || true ) && + (false !== ($curl = @curl_init($url))) && + (@ob_start() || (@curl_close($curl) && false)) && + (@curl_exec($curl) || (@curl_close($curl) && false)) && + ((false !== ($ver = @ob_get_clean())) || (@curl_close($curl) && false)) && + (@curl_close($curl) || true) && preg_match($pattern, $ver) // Socket extension - ) {} elseif (function_exists('socket_create')) { + ) { + } elseif (function_exists('socket_create')) { $cmd = "GET $path " . strtoupper($protocol) . "/1.1\r\n" . "Host: $host\r\n" . "Connection: Close\r\n\r\n"; - if ((false !== ( $socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP) )) && - (false !== @socket_connect($socket, $host, $port) ) && - (false !== @socket_write($socket, $cmd, strlen($cmd)) ) && - (false !== ( $ver = @socket_read($socket, 2048) )) && + if ((false !== ($socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) && + (false !== @socket_connect($socket, $host, $port)) && + (false !== @socket_write($socket, $cmd, strlen($cmd))) && + (false !== ($ver = @socket_read($socket, 2048))) && preg_match($responsePattern, $ver, $match) - ) + ) { $ver = $match[2]; + } - if (isset($socket) && is_resource($socket)) + if (isset($socket) && is_resource($socket)) { @socket_close($socket); + } } if (isset($ver) && preg_match($pattern, $ver)) { $this->session['checkVersion'] = $ver; $this->session['checkVersionTime'] = time(); return json_encode(array('version' => $ver)); - } else + } else { return json_encode(array('version' => false)); + } } - protected function moveUploadFile($file, $dir) { + protected function moveUploadFile($file, $dir) + { $message = $this->checkUploadedFile($file); if ($message !== true) { - if (isset($file['tmp_name'])) + if (isset($file['tmp_name'])) { @unlink($file['tmp_name']); + } return "{$file['name']}: $message"; } @@ -684,12 +803,13 @@ protected function moveUploadFile($file, $dir) { ) { @unlink($file['tmp_name']); return "{$file['name']}: " . $this->label("Cannot move uploaded file to target folder."); - } elseif (function_exists('chmod')) + } elseif (function_exists('chmod')) { chmod($target, $this->config['filePerms']); + } - $this->modx->invokeEvent('OnFileBrowserUpload',array( + $this->modx->invokeEvent('OnFileBrowserUpload', array( 'filepath'=>realpath($dir), - 'filename'=>str_replace("/","",str_replace($dir,"",realpath($target))) + 'filename'=>str_replace("/", "", str_replace($dir, "", realpath($target))) )); $this->makeThumb($target); @@ -697,82 +817,95 @@ protected function moveUploadFile($file, $dir) { return "/" . basename($target); } - protected function sendDefaultThumb($file=null) { + protected function sendDefaultThumb($file=null) + { if ($file !== null) { $ext = file::getExtension($file); $thumb = "themes/{$this->config['theme']}/img/files/big/$ext.png"; } - if (!isset($thumb) || !file_exists($thumb)) + if (!isset($thumb) || !file_exists($thumb)) { $thumb = "themes/{$this->config['theme']}/img/files/big/..png"; + } header("Content-Type: image/png"); readfile($thumb); die; } - protected function getFiles($dir) { - $thumbDir = "{$this->config['uploadDir']}/{$this->config['thumbsDir']}/$dir"; - $dir = "{$this->config['uploadDir']}/$dir"; - $return = array(); - $files = dir::content($dir, array('types' => "file")); - if ($files === false) - return $return; - - foreach ($files as $file) { - $ext = file::getExtension($file); - $smallThumb = false; - if (in_array(strtolower($ext), array('png', 'jpg', 'gif', 'jpeg' )) ) { - $size = @getimagesize($file); - if (is_array($size) && count($size)) { - $thumb_file = "$thumbDir/" . basename($file); - if (!is_file($thumb_file) || filemtime($file) > filemtime($thumb_file)) - $this->makeThumb($file); - $smallThumb = - ($size[0] <= $this->config['thumbWidth']) && - ($size[1] <= $this->config['thumbHeight']) && - in_array($size[2], array(IMAGETYPE_GIF, IMAGETYPE_PNG, IMAGETYPE_JPEG)); - } - } - $stat = stat($file); - if ($stat === false) continue; - $name = basename($file); - $types = $this->config['types']; - $types = explode(' ',$types['images'].' '.$types['image']); - if (substr($name,0,1) == '.' && !$this->config['showHiddenFiles']) continue; - if ($this->type == 'images' && !in_array(strtolower($ext),$types)) continue; - $bigIcon = file_exists("themes/{$this->config['theme']}/img/files/big/$ext.png"); - $smallIcon = file_exists("themes/{$this->config['theme']}/img/files/small/$ext.png"); - $thumb = file_exists("$thumbDir/$name"); - $return[] = array( - 'name' => stripcslashes($name), - 'size' => $stat['size'], - 'mtime' => $stat['mtime'], - 'date' => @strftime($this->dateTimeSmall, $stat['mtime']), - 'readable' => is_readable($file), - 'writable' => file::isWritable($file), - 'bigIcon' => $bigIcon, - 'smallIcon' => $smallIcon, - 'thumb' => $thumb, - 'smallThumb' => $smallThumb - ); - } - return $return; - } - - protected function getTree($dir, $index=0) { + protected function getFiles($dir) + { + $thumbDir = "{$this->config['uploadDir']}/{$this->config['thumbsDir']}/$dir"; + $dir = "{$this->config['uploadDir']}/$dir"; + $return = array(); + $files = dir::content($dir, array('types' => "file")); + if ($files === false) { + return $return; + } + + foreach ($files as $file) { + $ext = file::getExtension($file); + $smallThumb = false; + if (in_array(strtolower($ext), array('png', 'jpg', 'gif', 'jpeg' ))) { + $size = @getimagesize($file); + if (is_array($size) && count($size)) { + $thumb_file = "$thumbDir/" . basename($file); + if (!is_file($thumb_file) || filemtime($file) > filemtime($thumb_file)) { + $this->makeThumb($file); + } + $smallThumb = + ($size[0] <= $this->config['thumbWidth']) && + ($size[1] <= $this->config['thumbHeight']) && + in_array($size[2], array(IMAGETYPE_GIF, IMAGETYPE_PNG, IMAGETYPE_JPEG)); + } + } + $stat = stat($file); + if ($stat === false) { + continue; + } + $name = basename($file); + $types = $this->config['types']; + $types = explode(' ', $types['images'] . ' ' . $types['image']); + if (substr($name, 0, 1) == '.' && !$this->config['showHiddenFiles']) { + continue; + } + if ($this->type == 'images' && !in_array(strtolower($ext), $types)) { + continue; + } + $bigIcon = file_exists("themes/{$this->config['theme']}/img/files/big/$ext.png"); + $smallIcon = file_exists("themes/{$this->config['theme']}/img/files/small/$ext.png"); + $thumb = file_exists("$thumbDir/$name"); + $return[] = array( + 'name' => stripcslashes($name), + 'size' => $stat['size'], + 'mtime' => $stat['mtime'], + 'date' => @strftime($this->dateTimeSmall, $stat['mtime']), + 'readable' => is_readable($file), + 'writable' => file::isWritable($file), + 'bigIcon' => $bigIcon, + 'smallIcon' => $smallIcon, + 'thumb' => $thumb, + 'smallThumb' => $smallThumb + ); + } + return $return; + } + + protected function getTree($dir, $index=0) + { $path = explode("/", $dir); $pdir = ""; - for ($i = 0; ($i <= $index && $i < count($path)); $i++) + for ($i = 0; ($i <= $index && $i < count($path)); $i++) { $pdir .= "/{$path[$i]}"; - if (strlen($pdir)) + } + if (strlen($pdir)) { $pdir = substr($pdir, 1); + } $fdir = "{$this->config['uploadDir']}/$pdir"; $dirs = $this->getDirs($fdir); if (is_array($dirs) && count($dirs) && ($index <= count($path) - 1)) { - foreach ($dirs as $i => $cdir) { if ($cdir['hasDirs'] && ( @@ -787,38 +920,48 @@ protected function getTree($dir, $index=0) { } } } - } else + } else { return false; + } return $dirs; } - protected function postDir($existent=true) { + protected function postDir($existent=true) + { $dir = $this->typeDir; - if (isset($this->post['dir'])) + if (isset($this->post['dir'])) { $dir .= "/" . $this->post['dir']; - if ($existent && (!is_dir($dir) || !is_readable($dir))) + } + if ($existent && (!is_dir($dir) || !is_readable($dir))) { $this->errorMsg("Inexistant or inaccessible folder."); + } return $dir; } - protected function getDir($existent=true) { + protected function getDir($existent=true) + { $dir = $this->typeDir; - if (isset($this->get['dir'])) + if (isset($this->get['dir'])) { $dir .= "/" . $this->get['dir']; - if ($existent && (!is_dir($dir) || !is_readable($dir))) + } + if ($existent && (!is_dir($dir) || !is_readable($dir))) { $this->errorMsg("Inexistant or inaccessible folder."); + } return $dir; } - protected function getDirs($dir) { + protected function getDirs($dir) + { $dirs = dir::content($dir, array('types' => "dir")); $return = array(); if (is_array($dirs)) { $writable = dir::isWritable($dir); foreach ($dirs as $cdir) { $info = $this->getDirInfo($cdir); - if ($info === false) continue; + if ($info === false) { + continue; + } $info['removable'] = $writable && $info['writable']; $return[] = $info; } @@ -826,17 +969,22 @@ protected function getDirs($dir) { return $return; } - protected function getDirInfo($dir, $removable=false) { - if ((substr(basename($dir), 0, 1) == ".") || !is_dir($dir) || !is_readable($dir)) + protected function getDirInfo($dir, $removable=false) + { + if ((substr(basename($dir), 0, 1) == ".") || !is_dir($dir) || !is_readable($dir)) { return false; + } $dirs = dir::content($dir, array('types' => "dir")); if (is_array($dirs)) { - foreach ($dirs as $key => $cdir) - if (substr(basename($cdir), 0, 1) == ".") + foreach ($dirs as $key => $cdir) { + if (substr(basename($cdir), 0, 1) == ".") { unset($dirs[$key]); + } + } $hasDirs = count($dirs) ? true : false; - } else + } else { $hasDirs = false; + } $writable = dir::isWritable($dir); $info = array( @@ -847,24 +995,31 @@ protected function getDirInfo($dir, $removable=false) { 'hasDirs' => $hasDirs ); - if ($dir == "{$this->config['uploadDir']}/{$this->session['dir']}") + if ($dir == "{$this->config['uploadDir']}/{$this->session['dir']}") { $info['current'] = true; + } return $info; } - protected function output($data=null, $template=null) { - if (!is_array($data)) $data = array(); - if ($template === null) + protected function output($data=null, $template=null) + { + if (!is_array($data)) { + $data = array(); + } + if ($template === null) { $template = $this->action; + } if (file_exists("tpl/tpl_$template.php")) { ob_start(); $eval = "unset(\$data);unset(\$template);unset(\$eval);"; $_ = $data; - foreach (array_keys($data) as $key) - if (preg_match('/^[a-z\d_]+$/i', $key)) + foreach (array_keys($data) as $key) { + if (preg_match('/^[a-z\d_]+$/i', $key)) { $eval .= "\$$key=\$_['$key'];"; + } + } $eval .= "unset(\$_);require \"tpl/tpl_$template.php\";"; eval($eval); return ob_get_clean(); @@ -873,12 +1028,14 @@ protected function output($data=null, $template=null) { return ""; } - protected function errorMsg($message, array $data=null) { - if (in_array($this->action, array("thumb", "upload", "download", "downloadDir"))) + protected function errorMsg($message, array $data=null) + { + if (in_array($this->action, array("thumb", "upload", "download", "downloadDir"))) { die($this->label($message, $data)); - if (($this->action === null) || ($this->action == "browser")) + } + if (($this->action === null) || ($this->action == "browser")) { $this->backMsg($message, $data); - else { + } else { $message = $this->label($message, $data); die(json_encode(array('error' => $message))); } diff --git a/manager/media/browser/mcpuk/core/types/type_img.php b/manager/media/browser/mcpuk/core/types/type_img.php index 158e81b21a..15a7feda94 100755 --- a/manager/media/browser/mcpuk/core/types/type_img.php +++ b/manager/media/browser/mcpuk/core/types/type_img.php @@ -12,17 +12,18 @@ * @link http://kcfinder.sunhater.com */ -class type_img { - - public function checkFile($file, array $config) { - +class type_img +{ + public function checkFile($file, array $config) + { $driver = isset($config['imageDriversPriority']) ? image::getDriver(explode(" ", $config['imageDriversPriority'])) : "gd"; $img = image::factory($driver, $file); - if ($img->initError) + if ($img->initError) { return "Unknown image format/encoding."; + } return true; } diff --git a/manager/media/browser/mcpuk/core/types/type_mime.php b/manager/media/browser/mcpuk/core/types/type_mime.php index ec4a2eaa5c..b11f826ded 100755 --- a/manager/media/browser/mcpuk/core/types/type_mime.php +++ b/manager/media/browser/mcpuk/core/types/type_mime.php @@ -12,20 +12,24 @@ * @link http://kcfinder.sunhater.com */ -class type_mime { - - public function checkFile($file, array $config) { - if (!class_exists("finfo")) +class type_mime +{ + public function checkFile($file, array $config) + { + if (!class_exists("finfo")) { return "Fileinfo PECL extension is missing."; + } - if (!isset($config['params'])) + if (!isset($config['params'])) { return "Undefined MIME types."; + } $finfo = strlen($config['mime_magic']) ? new finfo(FILEINFO_MIME, $config['mime_magic']) : new finfo(FILEINFO_MIME); - if (!$finfo) + if (!$finfo) { return "Opening fileinfo database failed."; + } $type = $finfo->file($file); $type = substr($type, 0, strrpos($type, ";")); @@ -33,12 +37,12 @@ public function checkFile($file, array $config) { $mimes = $config['params']; if (substr($mimes, 0, 1) == "!") { $mimes = trim(substr($mimes, 1)); - return in_array($type , explode(" ", $mimes)) + return in_array($type, explode(" ", $mimes)) ? "You can't upload such files." : true; } - return !in_array($type , explode(" ", $mimes)) + return !in_array($type, explode(" ", $mimes)) ? "You can't upload such files." : true; } diff --git a/manager/media/browser/mcpuk/core/uploader.php b/manager/media/browser/mcpuk/core/uploader.php index 5db404e622..6e13c7b3e6 100755 --- a/manager/media/browser/mcpuk/core/uploader.php +++ b/manager/media/browser/mcpuk/core/uploader.php @@ -12,109 +12,114 @@ * @link http://kcfinder.sunhater.com */ -class uploader { +class uploader +{ /** Release version */ const VERSION = "2.54"; -/** Config session-overrided settings - * @var array */ + /** Config session-overrided settings + * @var array */ protected $config = array(); -/** Default image driver - * @var string */ + /** Default image driver + * @var string */ protected $imageDriver = "gd"; -/** Opener applocation properties - * $opener['name'] Got from $_GET['opener']; - * $opener['CKEditor']['funcNum'] CKEditor function number (got from $_GET) - * $opener['TinyMCE'] Boolean - * @var array */ + /** Opener applocation properties + * $opener['name'] Got from $_GET['opener']; + * $opener['CKEditor']['funcNum'] CKEditor function number (got from $_GET) + * $opener['TinyMCE'] Boolean + * @var array */ protected $opener = array(); -/** Got from $_GET['type'] or first one $config['types'] array key, if inexistant - * @var string */ + /** Got from $_GET['type'] or first one $config['types'] array key, if inexistant + * @var string */ protected $type; -/** Helper property. Local filesystem path to the Type Directory - * Equivalent: $config['uploadDir'] . "/" . $type - * @var string */ + /** Helper property. Local filesystem path to the Type Directory + * Equivalent: $config['uploadDir'] . "/" . $type + * @var string */ protected $typeDir; -/** Helper property. Web URL to the Type Directory - * Equivalent: $config['uploadURL'] . "/" . $type - * @var string */ + /** Helper property. Web URL to the Type Directory + * Equivalent: $config['uploadURL'] . "/" . $type + * @var string */ protected $typeURL; -/** Linked to $config['types'] - * @var array */ + /** Linked to $config['types'] + * @var array */ protected $types = array(); -/** Settings which can override default settings if exists as keys in $config['types'][$type] array - * @var array */ + /** Settings which can override default settings if exists as keys in $config['types'][$type] array + * @var array */ protected $typeSettings = array('disabled', 'theme', 'dirPerms', 'filePerms', 'denyZipDownload', 'maxImageWidth', 'maxImageHeight', 'thumbWidth', 'thumbHeight', 'jpegQuality', 'access', 'filenameChangeChars', 'dirnameChangeChars', 'denyExtensionRename', 'deniedExts', 'watermark'); -/** Got from language file - * @var string */ + /** Got from language file + * @var string */ protected $charset; -/** The language got from $_GET['lng'] or $_GET['lang'] or... Please see next property - * @var string */ + /** The language got from $_GET['lng'] or $_GET['lang'] or... Please see next property + * @var string */ protected $lang = 'en'; -/** Possible language $_GET keys - * @var array */ + /** Possible language $_GET keys + * @var array */ protected $langInputNames = array('lang', 'langCode', 'lng', 'language', 'lang_code'); -/** Uploaded file(s) info. Linked to first $_FILES element - * @var array */ + /** Uploaded file(s) info. Linked to first $_FILES element + * @var array */ protected $file; -/** Next three properties are got from the current language file - * @var string */ + /** Next three properties are got from the current language file + * @var string */ protected $dateTimeFull; // Currently not used protected $dateTimeMid; // Currently not used protected $dateTimeSmall; -/** Contain Specified language labels - * @var array */ + /** Contain Specified language labels + * @var array */ protected $labels = array(); -/** Contain unprocessed $_GET array. Please use this instead of $_GET - * @var array */ + /** Contain unprocessed $_GET array. Please use this instead of $_GET + * @var array */ protected $get; -/** Contain unprocessed $_POST array. Please use this instead of $_POST - * @var array */ + /** Contain unprocessed $_POST array. Please use this instead of $_POST + * @var array */ protected $post; -/** Contain unprocessed $_COOKIE array. Please use this instead of $_COOKIE - * @var array */ + /** Contain unprocessed $_COOKIE array. Please use this instead of $_COOKIE + * @var array */ protected $cookie; -/** Session array. Please use this property instead of $_SESSION - * @var array */ + /** Session array. Please use this property instead of $_SESSION + * @var array */ protected $session; -/** CMS integration attribute (got from $_GET['cms']) - * @var string */ + /** CMS integration attribute (got from $_GET['cms']) + * @var string */ protected $cms = ""; protected $modx = null; -/** Magic method which allows read-only access to protected or private class properties - * @param string $property - * @return mixed */ - public function __get($property) { + /** Magic method which allows read-only access to protected or private class properties + * @param string $property + * @return mixed */ + public function __get($property) + { return property_exists($this, $property) ? $this->$property : null; } - public function __construct($modx) { + public function __construct($modx) + { //MODX try { if ($modx instanceof DocumentParser) { $this->modx = $modx; - } else throw new Exception('MODX should be instance of DocumentParser'); + } else { + throw new Exception('MODX should be instance of DocumentParser'); + } } catch (Exception $e) { die($e->getMessage()); } @@ -129,26 +134,33 @@ public function __construct($modx) { // SET CMS INTEGRATION ATTRIBUTE if (isset($this->get['cms']) && in_array($this->get['cms'], array("drupal")) - ) + ) { $this->cms = $this->get['cms']; + } - // LINKING UPLOADED FILE - if (count($_FILES)) + // LINKING UPLOADED FILE + if (count($_FILES)) { $this->file = &$_FILES[key($_FILES)]; + } // LOAD DEFAULT CONFIGURATION require "config.php"; // SETTING UP SESSION - if (isset($_CONFIG['_sessionLifetime'])) + if (isset($_CONFIG['_sessionLifetime'])) { ini_set('session.gc_maxlifetime', $_CONFIG['_sessionLifetime'] * 60); - if (isset($_CONFIG['_sessionDir'])) + } + if (isset($_CONFIG['_sessionDir'])) { ini_set('session.save_path', $_CONFIG['_sessionDir']); - if (isset($_CONFIG['_sessionDomain'])) + } + if (isset($_CONFIG['_sessionDomain'])) { ini_set('session.cookie_domain', $_CONFIG['_sessionDomain']); + } switch ($this->cms) { case "drupal": break; - default: if (!session_id()) session_start(); break; + default: if (!session_id()) { + session_start(); + } break; } // RELOAD DEFAULT CONFIGURATION @@ -159,31 +171,38 @@ public function __construct($modx) { if (isset($_CONFIG['_sessionVar']) && is_array($_CONFIG['_sessionVar']) ) { - foreach ($_CONFIG['_sessionVar'] as $key => $val) - if ((substr($key, 0, 1) != "_") && isset($_CONFIG[$key])) + foreach ($_CONFIG['_sessionVar'] as $key => $val) { + if ((substr($key, 0, 1) != "_") && isset($_CONFIG[$key])) { $this->config[$key] = $val; - if (!isset($this->config['_sessionVar']['self'])) + } + } + if (!isset($this->config['_sessionVar']['self'])) { $this->config['_sessionVar']['self'] = array(); + } $this->session = &$this->config['_sessionVar']['self']; - } else + } else { $this->session = &$_SESSION; + } // IMAGE DRIVER INIT if (isset($this->config['imageDriversPriority'])) { $this->config['imageDriversPriority'] = text::clearWhitespaces($this->config['imageDriversPriority']); $driver = image::getDriver(explode(' ', $this->config['imageDriversPriority'])); - if ($driver !== false) + if ($driver !== false) { $this->imageDriver = $driver; + } } if ((!isset($driver) || ($driver === false)) && (image::getDriver(array($this->imageDriver)) === false) - ) + ) { die("Cannot find any of the supported PHP image extensions!"); + } // WATERMARK INIT - if (isset($this->config['watermark']) && is_string($this->config['watermark'])) + if (isset($this->config['watermark']) && is_string($this->config['watermark'])) { $this->config['watermark'] = array('file' => $this->config['watermark']); + } // GET TYPE DIRECTORY $this->types = &$this->config['types']; @@ -197,9 +216,11 @@ public function __construct($modx) { // LOAD TYPE DIRECTORY SPECIFIC CONFIGURATION IF EXISTS if (is_array($this->types[$this->type])) { - foreach ($this->types[$this->type] as $key => $val) - if (in_array($key, $this->typeSettings)) + foreach ($this->types[$this->type] as $key => $val) { + if (in_array($key, $this->typeSettings)) { $this->config[$key] = $val; + } + } $this->types[$this->type] = isset($this->types[$this->type]['type']) ? $this->types[$this->type]['type'] : ""; } @@ -209,12 +230,14 @@ public function __construct($modx) { $ip = '/^' . implode('\.', array($ip, $ip, $ip, $ip)) . '$/'; if (preg_match($ip, $_SERVER['HTTP_HOST']) || preg_match('/^[^\.]+$/', $_SERVER['HTTP_HOST']) - ) + ) { $this->config['cookieDomain'] = ""; - elseif (!strlen($this->config['cookieDomain'])) + } elseif (!strlen($this->config['cookieDomain'])) { $this->config['cookieDomain'] = $_SERVER['HTTP_HOST']; - if (!strlen($this->config['cookiePath'])) + } + if (!strlen($this->config['cookiePath'])) { $this->config['cookiePath'] = "/"; + } // UPLOAD FOLDER INIT @@ -228,8 +251,8 @@ public function __construct($modx) { $this->config['uploadDir'] = strlen($this->config['uploadDir']) ? path::normalize($this->config['uploadDir']) : path::url2fullPath("/$path"); - $this->typeDir = "{$this->config['uploadDir']}/{$this->type}"; - $this->typeURL = "{$this->config['siteURL']}/{$this->config['uploadURL']}/{$this->type}"; + $this->typeDir = "{$this->config['uploadDir']}/{$this->type}"; + $this->typeURL = "{$this->config['siteURL']}/{$this->config['uploadURL']}/{$this->type}"; // SITE ROOT } elseif ($this->config['uploadURL'] == "/") { @@ -250,21 +273,24 @@ public function __construct($modx) { $this->typeDir = "{$this->config['uploadDir']}/{$this->type}"; $this->typeURL = "{$this->config['uploadURL']}/{$this->type}"; } - if (!is_dir($this->config['uploadDir'])) + if (!is_dir($this->config['uploadDir'])) { @mkdir($this->config['uploadDir'], $this->config['dirPerms']); + } // HOST APPLICATIONS INIT - if (isset($this->get['CKEditorFuncNum'])) + if (isset($this->get['CKEditorFuncNum'])) { $this->opener['CKEditor']['funcNum'] = $this->get['CKEditorFuncNum']; + } if (isset($this->get['opener']) && (strtolower($this->get['opener']) == "tinymce") && isset($this->config['_tinyMCEPath']) && strlen($this->config['_tinyMCEPath']) - ) + ) { $this->opener['TinyMCE'] = true; + } // LOCALIZATION - foreach ($this->langInputNames as $key) + foreach ($this->langInputNames as $key) { if (isset($this->get[$key]) && preg_match('/^[a-z][a-z\._\-]*$/i', $this->get[$key]) && file_exists("lang/" . strtolower($this->get[$key]) . ".php") @@ -272,6 +298,7 @@ public function __construct($modx) { $this->lang = $this->get[$key]; break; } + } $this->localize($this->lang); // CHECK & MAKE DEFAULT .htaccess @@ -280,33 +307,40 @@ public function __construct($modx) { ) { $htaccess = "{$this->config['uploadDir']}/.htaccess"; if (!file_exists($htaccess)) { - if (!@file_put_contents($htaccess, $this->get_htaccess())) + if (!@file_put_contents($htaccess, $this->get_htaccess())) { $this->backMsg("Cannot write to upload folder. {$this->config['uploadDir']}"); + } } else { - if (false === ($data = @file_get_contents($htaccess))) + if (false === ($data = @file_get_contents($htaccess))) { $this->backMsg("Cannot read .htaccess"); - if (($data != $this->get_htaccess()) && !@file_put_contents($htaccess, $data)) + } + if (($data != $this->get_htaccess()) && !@file_put_contents($htaccess, $data)) { $this->backMsg("Incorrect .htaccess file. Cannot rewrite it!"); + } } } // CHECK & CREATE UPLOAD FOLDER if (!is_dir($this->typeDir)) { - if (!mkdir($this->typeDir, $this->config['dirPerms'])) + if (!mkdir($this->typeDir, $this->config['dirPerms'])) { $this->backMsg("Cannot create {dir} folder.", array('dir' => $this->type)); - } elseif (!is_readable($this->typeDir)) + } + } elseif (!is_readable($this->typeDir)) { $this->backMsg("Cannot read upload folder."); + } } - public function upload() { + public function upload() + { $config = &$this->config; $file = &$this->file; $url = $message = ""; if ($config['disabled'] || !$config['access']['files']['upload']) { - if (isset($file['tmp_name'])) @unlink($file['tmp_name']); + if (isset($file['tmp_name'])) { + @unlink($file['tmp_name']); + } $message = $this->label("You don't have permissions to upload files."); - } elseif (true === ($message = $this->checkUploadedFile())) { $message = ""; @@ -315,9 +349,9 @@ public function upload() { (false !== ($gdir = $this->checkInputDir($this->get['dir']))) ) { $udir = path::normalize("$dir$gdir"); - if (substr($udir, 0, strlen($dir)) !== $dir) + if (substr($udir, 0, strlen($dir)) !== $dir) { $message = $this->label("Unknown error."); - else { + } else { $l = strlen($dir); $dir = "$udir/"; $udir = substr($udir, $l); @@ -325,8 +359,9 @@ public function upload() { } if (!strlen($message)) { - if (!is_dir(path::normalize($dir))) + if (!is_dir(path::normalize($dir))) { @mkdir(path::normalize($dir), $this->config['dirPerms'], true); + } $filename = $this->normalizeFilename($file['name']); $target = file::getInexistantFilename($dir . $filename); @@ -334,21 +369,25 @@ public function upload() { if (!@move_uploaded_file($file['tmp_name'], $target) && !@rename($file['tmp_name'], $target) && !@copy($file['tmp_name'], $target) - ) + ) { $message = $this->label("Cannot move uploaded file to target folder."); - else { - if (function_exists('chmod')) + } else { + if (function_exists('chmod')) { @chmod($target, $this->config['filePerms']); + } $this->makeThumb($target); $url = $this->typeURL; - if (isset($udir)) $url .= "/$udir"; + if (isset($udir)) { + $url .= "/$udir"; + } $url .= "/" . basename($target); if (preg_match('/^([a-z]+)\:\/\/([^\/^\:]+)(\:(\d+))?\/(.+)$/', $url, $patt)) { list($unused, $protocol, $domain, $unused, $port, $path) = $patt; $base = "$protocol://$domain" . (strlen($port) ? ":$port" : "") . "/"; $url = $base . path::urlPathEncode($path); - } else + } else { $url = path::urlPathEncode($url); + } } } } @@ -356,54 +395,61 @@ public function upload() { if (strlen($message) && isset($this->file['tmp_name']) && file_exists($this->file['tmp_name']) - ) + ) { @unlink($this->file['tmp_name']); + } - if (strlen($message) && method_exists($this, 'errorMsg')) + if (strlen($message) && method_exists($this, 'errorMsg')) { $this->errorMsg($message); + } $this->callBack($url, $message); } - protected function getTransaliasSettings() { - $modx = evolutionCMS(); - - // Cleaning uploaded filename? - $setting = $modx->db->select('count(*)', $modx->getFullTableName('system_settings'), 'setting_name="clean_uploaded_filename" AND setting_value=1'); - if ($modx->db->getValue($setting)>0) { - // Transalias plugin active? - $res = $modx->db->select('properties', $modx->getFullTableName('site_plugins'), 'name="TransAlias" AND disabled=0'); - if ($properties = $modx->db->getValue($res)) { - $properties = $modx->parseProperties($properties, 'TransAlias', 'plugin'); - } else { - $properties = NULL; - } - } else { - $properties = NULL; - } - return $properties; - } - - - protected function normalizeFilename($filename) { - if ($this->getTransaliasSettings()) { - $format = strrchr($filename, "."); - $filename = str_replace($format, "", $filename); - $filename = $this->modx->stripAlias($filename).$format; - } - return $filename; - } - - protected function normalizeDirname($dirname) { + protected function getTransaliasSettings() + { + $modx = evolutionCMS(); + + // Cleaning uploaded filename? + $setting = $modx->db->select('count(*)', $modx->getFullTableName('system_settings'), 'setting_name="clean_uploaded_filename" AND setting_value=1'); + if ($modx->db->getValue($setting)>0) { + // Transalias plugin active? + $res = $modx->db->select('properties', $modx->getFullTableName('site_plugins'), 'name="TransAlias" AND disabled=0'); + if ($properties = $modx->db->getValue($res)) { + $properties = $modx->parseProperties($properties, 'TransAlias', 'plugin'); + } else { + $properties = null; + } + } else { + $properties = null; + } + return $properties; + } + + + protected function normalizeFilename($filename) + { + if ($this->getTransaliasSettings()) { + $format = strrchr($filename, "."); + $filename = str_replace($format, "", $filename); + $filename = $this->modx->stripAlias($filename) . $format; + } + return $filename; + } + + protected function normalizeDirname($dirname) + { return $this->modx->stripAlias($dirname); } - protected function checkUploadedFile(array $aFile=null) { + protected function checkUploadedFile(array $aFile=null) + { $config = &$this->config; $file = ($aFile === null) ? $this->file : $aFile; - if (!is_array($file) || !isset($file['name'])) + if (!is_array($file) || !isset($file['name'])) { return $this->label("Unknown error"); + } if (is_array($file['name'])) { foreach ($file['name'] as $i => $name) { @@ -412,8 +458,9 @@ protected function checkUploadedFile(array $aFile=null) { 'tmp_name' => $file['tmp_name'][$i], 'error' => $file['error'][$i] )); - if ($return !== true) + if ($return !== true) { return "$name: $return"; + } } return true; } @@ -422,7 +469,7 @@ protected function checkUploadedFile(array $aFile=null) { $typePatt = strtolower(text::clearWhitespaces($this->types[$this->type])); // CHECK FOR UPLOAD ERRORS - if ($file['error']) + if ($file['error']) { return ($file['error'] == UPLOAD_ERR_INI_SIZE) ? $this->label("The uploaded file exceeds {size} bytes.", @@ -440,14 +487,17 @@ protected function checkUploadedFile(array $aFile=null) { $this->label("Failed to write file.") : $this->label("Unknown error.") ))))); + } // HIDDEN FILENAMES CHECK - elseif (substr($file['name'], 0, 1) == ".") + elseif (substr($file['name'], 0, 1) == ".") { return $this->label("File name shouldn't begins with '.'"); + } // EXTENSION CHECK - elseif (!$this->validateExtension($extension, $this->type)) + elseif (!$this->validateExtension($extension, $this->type)) { return $this->label("Denied file extension."); + } // SPECIAL DIRECTORY TYPES CHECK (e.g. *img) elseif (preg_match('/^\*([^ ]+)(.*)?$/s', $typePatt, $patt)) { @@ -457,70 +507,84 @@ protected function checkUploadedFile(array $aFile=null) { $type = new $class(); $cfg = $config; $cfg['filename'] = $file['name']; - if (strlen($params)) + if (strlen($params)) { $cfg['params'] = trim($params); + } $response = $type->checkFile($file['tmp_name'], $cfg); - if ($response !== true) + if ($response !== true) { return $this->label($response); - } else + } + } else { return $this->label("Non-existing directory type."); + } } // IMAGE RESIZE $img = image::factory($this->imageDriver, $file['tmp_name']); - if (!$img->initError && !$this->imageResize($img, $file['tmp_name'])) + if (!$img->initError && !$this->imageResize($img, $file['tmp_name'])) { return $this->label("The image is too big and/or cannot be resized."); + } - // CHECK FOR MODX MAX FILE SIZE - $actualfilesize=filesize($file['tmp_name']); - if (isset($this->config['maxfilesize']) && $actualfilesize > $this->config['maxfilesize']) - return $this->label("File is too big: ".$actualfilesize." Bytes. (max ".$this->config['maxfilesize']." Bytes)"); + // CHECK FOR MODX MAX FILE SIZE + $actualfilesize=filesize($file['tmp_name']); + if (isset($this->config['maxfilesize']) && $actualfilesize > $this->config['maxfilesize']) { + return $this->label("File is too big: " . $actualfilesize . " Bytes. (max " . $this->config['maxfilesize'] . " Bytes)"); + } return true; } - protected function checkInputDir($dir, $inclType=true, $existing=true) { + protected function checkInputDir($dir, $inclType=true, $existing=true) + { $dir = path::normalize($dir); - if (substr($dir, 0, 1) == "/") + if (substr($dir, 0, 1) == "/") { $dir = substr($dir, 1); + } - if ((substr($dir, 0, 1) == ".") || (substr(basename($dir), 0, 1) == ".")) + if ((substr($dir, 0, 1) == ".") || (substr(basename($dir), 0, 1) == ".")) { return false; + } if ($inclType) { $first = explode("/", $dir); $first = $first[0]; - if ($first != $this->type) + if ($first != $this->type) { return false; + } $return = $this->removeTypeFromPath($dir); } else { $return = $dir; $dir = "{$this->type}/$dir"; } - if (!$existing) + if (!$existing) { return $return; + } $path = "{$this->config['uploadDir']}/$dir"; return (is_dir($path) && is_readable($path)) ? $return : false; } - protected function validateExtension($ext, $type) { + protected function validateExtension($ext, $type) + { $ext = trim(strtolower($ext)); - if (!isset($this->types[$type])) + if (!isset($this->types[$type])) { return false; + } $exts = strtolower(text::clearWhitespaces($this->config['deniedExts'])); if (strlen($exts)) { $exts = explode(" ", $exts); - if (in_array($ext, $exts)) + if (in_array($ext, $exts)) { return false; + } } $exts = trim($this->types[$type]); - if (!strlen($exts) || substr($exts, 0, 1) == "*") + if (!strlen($exts) || substr($exts, 0, 1) == "*") { return true; + } if (substr($exts, 0, 1) == "!") { $exts = explode(" ", trim(strtolower(substr($exts, 1)))); @@ -531,26 +595,31 @@ protected function validateExtension($ext, $type) { return in_array($ext, $exts); } - protected function getTypeFromPath($path) { + protected function getTypeFromPath($path) + { return preg_match('/^([^\/]*)\/.*$/', $path, $patt) ? $patt[1] : $path; } - protected function removeTypeFromPath($path) { + protected function removeTypeFromPath($path) + { return preg_match('/^[^\/]*\/(.*)$/', $path, $patt) ? $patt[1] : ""; } - protected function imageResize($image, $file=null) { - + protected function imageResize($image, $file=null) + { if (!($image instanceof image)) { $img = image::factory($this->imageDriver, $image); - if ($img->initError) return false; + if ($img->initError) { + return false; + } $file = $image; - } elseif ($file === null) + } elseif ($file === null) { return false; - else + } else { $img = $image; + } $orientation = 1; if (function_exists("exif_read_data")) { @@ -572,19 +641,18 @@ protected function imageResize($image, $file=null) { ) ) && ($orientation == 1) - ) + ) { return true; + } // PROPORTIONAL RESIZE if ((!$this->config['maxImageWidth'] || !$this->config['maxImageHeight'])) { - if ($this->config['maxImageWidth'] && ($this->config['maxImageWidth'] < $img->width) ) { $width = $this->config['maxImageWidth']; $height = $img->getPropHeight($width); - } elseif ( $this->config['maxImageHeight'] && ($this->config['maxImageHeight'] < $img->height) @@ -593,15 +661,17 @@ protected function imageResize($image, $file=null) { $width = $img->getPropWidth($height); } - if (isset($width) && isset($height) && !$img->resize($width, $height)) + if (isset($width) && isset($height) && !$img->resize($width, $height)) { return false; + } - // RESIZE TO FIT + // RESIZE TO FIT } elseif ( $this->config['maxImageWidth'] && $this->config['maxImageHeight'] && !$img->resizeFit($this->config['maxImageWidth'], $this->config['maxImageHeight']) - ) + ) { return false; + } // AUTO FLIP AND ROTATE FROM EXIF if ((($orientation == 2) && !$img->flipHorizontal()) || @@ -611,12 +681,15 @@ protected function imageResize($image, $file=null) { (($orientation == 6) && !$img->rotate(90)) || (($orientation == 7) && (!$img->flipHorizontal() || !$img->rotate(90))) || (($orientation == 8) && !$img->rotate(270)) - ) + ) { return false; - if (($orientation >= 2) && ($orientation <= 8) && ($this->imageDriver == "imagick")) + } + if (($orientation >= 2) && ($orientation <= 8) && ($this->imageDriver == "imagick")) { try { $img->image->setImageProperty('exif:Orientation', "1"); - } catch (Exception $e) {} + } catch (Exception $e) { + } + } // WATERMARK if (isset($this->config['watermark']['file']) && @@ -627,41 +700,44 @@ protected function imageResize($image, $file=null) { $top = isset($this->config['watermark']['top']) ? $this->config['watermark']['top'] : false; $img->watermark($this->config['watermark']['file'], $left, $top); - } + } $options = array( 'file' => $file ); - $type = exif_imagetype( $file ); + $type = exif_imagetype($file); - switch ( $type ) { + switch ($type) { case IMAGETYPE_GIF: - return $img->output( 'gif', $options ); + return $img->output('gif', $options); case IMAGETYPE_PNG: - return $img->output( 'png', $options ); + return $img->output('png', $options); default: - return $img->output( 'jpeg', array_merge( $options, array( 'quality' => $this->config['jpegQuality'] ) ) ); + return $img->output('jpeg', array_merge($options, array( 'quality' => $this->config['jpegQuality'] ))); } - } - protected function makeThumb($file, $overwrite=true) { + protected function makeThumb($file, $overwrite=true) + { $img = image::factory($this->imageDriver, $file); // Drop files which are not images - if ($img->initError) + if ($img->initError) { return true; + } $thumb = substr($file, strlen($this->config['uploadDir'])); $thumb = $this->config['uploadDir'] . "/" . $this->config['thumbsDir'] . "/" . $thumb; $thumb = path::normalize($thumb); $thumbDir = dirname($thumb); - if (!is_dir($thumbDir) && !@mkdir($thumbDir, $this->config['dirPerms'], true)) + if (!is_dir($thumbDir) && !@mkdir($thumbDir, $this->config['dirPerms'], true)) { return false; + } - if (!$overwrite && is_file($thumb)) + if (!$overwrite && is_file($thumb)) { return true; + } // Images with smaller resolutions than thumbnails /*if (($img->width <= $this->config['thumbWidth']) && @@ -674,18 +750,19 @@ protected function makeThumb($file, $overwrite=true) { // Resize image } else */ - if (!$img->resizeFit($this->config['thumbWidth'], $this->config['thumbHeight'])) + if (!$img->resizeFit($this->config['thumbWidth'], $this->config['thumbHeight'])) { return false; + } - if ( $this->imageDriver == 'gd' ) { - $width = imagesx( $img->image ); - $height = imagesy( $img->image ); - $back = image::factory( $this->imageDriver, array( $width, $height ) ); - $tile = image::factory( $this->imageDriver, __DIR__ . '/../themes/' . $this->config['theme'] . '/img/bg_transparent.png' ); + if ($this->imageDriver == 'gd') { + $width = imagesx($img->image); + $height = imagesy($img->image); + $back = image::factory($this->imageDriver, array( $width, $height )); + $tile = image::factory($this->imageDriver, __DIR__ . '/../themes/' . $this->config['theme'] . '/img/bg_transparent.png'); - imagesettile( $back->image, $tile->image ); - imagefilledrectangle( $back->image, 0, 0, $width, $height, IMG_COLOR_TILED ); - imagecopy( $back->image, $img->image, 0, 0, 0, 0, $width, $height ); + imagesettile($back->image, $tile->image); + imagefilledrectangle($back->image, 0, 0, $width, $height, IMG_COLOR_TILED); + imagecopy($back->image, $img->image, 0, 0, 0, 0, $width, $height); $img = $back; } @@ -697,7 +774,8 @@ protected function makeThumb($file, $overwrite=true) { )); } - protected function localize($langCode) { + protected function localize($langCode) + { require "lang/{$langCode}.php"; setlocale(LC_ALL, $lang['_locale']); $this->charset = $lang['_charset']; @@ -712,30 +790,36 @@ protected function localize($langCode) { $this->labels = $lang; } - protected function label($string, array $data=null) { + protected function label($string, array $data=null) + { $return = isset($this->labels[$string]) ? $this->labels[$string] : $string; - if (is_array($data)) - foreach ($data as $key => $val) + if (is_array($data)) { + foreach ($data as $key => $val) { $return = str_replace("{{$key}}", $val, $return); + } + } return $return; } - protected function backMsg($message, array $data=null) { + protected function backMsg($message, array $data=null) + { $message = $this->label($message, $data); - if (isset($this->file['tmp_name']) && file_exists($this->file['tmp_name'])) + if (isset($this->file['tmp_name']) && file_exists($this->file['tmp_name'])) { @unlink($this->file['tmp_name']); + } $this->callBack("", $message); die; } - protected function callBack($url, $message="") { + protected function callBack($url, $message="") + { $message = text::jsValue($message); $CKfuncNum = isset($this->opener['CKEditor']['funcNum']) ? $this->opener['CKEditor']['funcNum'] : 0; - if (!$CKfuncNum) $CKfuncNum = 0; - header("Content-Type: text/html; charset={$this->charset}"); - -?> + if (!$CKfuncNum) { + $CKfuncNum = 0; + } + header("Content-Type: text/html; charset={$this->charset}"); ?> php_value engine off diff --git a/manager/media/browser/mcpuk/css.php b/manager/media/browser/mcpuk/css.php index 225f918e48..6e441b0eee 100755 --- a/manager/media/browser/mcpuk/css.php +++ b/manager/media/browser/mcpuk/css.php @@ -14,7 +14,9 @@ require "core/autoload.php"; $mtime = @filemtime(__FILE__); -if ($mtime) httpCache::checkMTime($mtime); +if ($mtime) { + httpCache::checkMTime($mtime); +} $browser = new browser($modx); $config = $browser->config; ob_start(); @@ -254,4 +256,4 @@ } $mtime)) + if (!isset($mtime) || ($fmtime > $mtime)) { $mtime = $fmtime; + } } httpCache::checkMTime($mtime); header("Content-Type: text/javascript"); -foreach ($files as $file) +foreach ($files as $file) { require $file; +} diff --git a/manager/media/browser/mcpuk/js_localize.php b/manager/media/browser/mcpuk/js_localize.php index 1fb386cd96..5aff27a157 100755 --- a/manager/media/browser/mcpuk/js_localize.php +++ b/manager/media/browser/mcpuk/js_localize.php @@ -28,9 +28,13 @@ die; } $mtime = @filemtime($file); -if ($mtime) httpCache::checkMTime($mtime); +if ($mtime) { + httpCache::checkMTime($mtime); +} require $file; header("Content-Type: text/javascript; charset={$lang['_charset']}"); -foreach ($lang as $english => $native) - if (substr($english, 0, 1) != "_") +foreach ($lang as $english => $native) { + if (substr($english, 0, 1) != "_") { echo "browser.labels['" . text::jsValue($english) . "']=\"" . text::jsValue($native) . "\";"; + } +} diff --git a/manager/media/browser/mcpuk/lang/af.php b/manager/media/browser/mcpuk/lang/af.php index 1eccc0add2..a5e5823887 100755 --- a/manager/media/browser/mcpuk/lang/af.php +++ b/manager/media/browser/mcpuk/lang/af.php @@ -241,5 +241,3 @@ "Select Thumbnails" => "Kies duimnaels", "Download files" => "Laai lêers af", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/bg.php b/manager/media/browser/mcpuk/lang/bg.php index c1a3ee387d..ba72a1d852 100755 --- a/manager/media/browser/mcpuk/lang/bg.php +++ b/manager/media/browser/mcpuk/lang/bg.php @@ -258,5 +258,3 @@ "Failed to upload {filename}!" => "Несполучливо качване на {filename}!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/ca.php b/manager/media/browser/mcpuk/lang/ca.php index 9e9c6c2f56..bdc414fc74 100755 --- a/manager/media/browser/mcpuk/lang/ca.php +++ b/manager/media/browser/mcpuk/lang/ca.php @@ -124,5 +124,3 @@ "Uploading file {number} of {count}... {progress}" => "Carregant arxiu {number} de {count}... {progress}", "Failed to upload {filename}!" => "Error al carregar {filename}", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/cs.php b/manager/media/browser/mcpuk/lang/cs.php index 8cd858cbe6..5167dfe041 100755 --- a/manager/media/browser/mcpuk/lang/cs.php +++ b/manager/media/browser/mcpuk/lang/cs.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "Nahrávám soubor {number} z {count}... {progress}", "Failed to upload {filename}!" => "Nepodařilo se nahrát soubor {filename}!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/da.php b/manager/media/browser/mcpuk/lang/da.php index c9ad9e5c9b..843bde90a3 100755 --- a/manager/media/browser/mcpuk/lang/da.php +++ b/manager/media/browser/mcpuk/lang/da.php @@ -12,7 +12,7 @@ '_dateTimeMid' => "%a %e %b %Y %H:%M", '_dateTimeSmall' => "%d/%m/%Y %H:%M", - "You don't have permissions to upload files." => + "You don't have permissions to upload files." => "Du har ikke tilladelser til at uploade filer.", "You don't have permissions to browse server." => @@ -238,5 +238,3 @@ "Select Thumbnails" => "V�lg Miniaturer", "Download files" => "Download filer", ); - -?> diff --git a/manager/media/browser/mcpuk/lang/de.php b/manager/media/browser/mcpuk/lang/de.php index 7318de10a2..2b6952e298 100755 --- a/manager/media/browser/mcpuk/lang/de.php +++ b/manager/media/browser/mcpuk/lang/de.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "Lade Datei {number} von {count} hinauf ... {progress}", "Failed to upload {filename}!" => "Upload von {filename} fehlgeschlagen!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/el.php b/manager/media/browser/mcpuk/lang/el.php index c8eb9ab6ae..375b48a1f8 100755 --- a/manager/media/browser/mcpuk/lang/el.php +++ b/manager/media/browser/mcpuk/lang/el.php @@ -249,5 +249,3 @@ "Yes" => "Ναι", "No" => "Όχι", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/en.php b/manager/media/browser/mcpuk/lang/en.php index ba12dcf369..e6c1dedfb2 100755 --- a/manager/media/browser/mcpuk/lang/en.php +++ b/manager/media/browser/mcpuk/lang/en.php @@ -21,5 +21,3 @@ '_dateTimeMid' => "%a %b %e %Y %I:%M %p", '_dateTimeSmall' => "%m/%d/%Y %I:%M %p", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/es.php b/manager/media/browser/mcpuk/lang/es.php index a86f22efc3..311c4a6cf4 100755 --- a/manager/media/browser/mcpuk/lang/es.php +++ b/manager/media/browser/mcpuk/lang/es.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "Cargando archivo {number} de {count}... {progress}", "Failed to upload {filename}!" => "¡No se pudo cargar el archivo {filename}!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/et.php b/manager/media/browser/mcpuk/lang/et.php index 3553b16b7e..59e450c9f1 100755 --- a/manager/media/browser/mcpuk/lang/et.php +++ b/manager/media/browser/mcpuk/lang/et.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "Laen üles faili {number} {count}-st... {progress}", "Failed to upload {filename}!" => "{filename} üleslaadimine ebaõnnestus!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/fa.php b/manager/media/browser/mcpuk/lang/fa.php index 09481e590b..6b39dddad5 100755 --- a/manager/media/browser/mcpuk/lang/fa.php +++ b/manager/media/browser/mcpuk/lang/fa.php @@ -263,5 +263,3 @@ "Failed to upload {filename}!" => "! {filename} خطا در ارسال" ); - -?> diff --git a/manager/media/browser/mcpuk/lang/fi.php b/manager/media/browser/mcpuk/lang/fi.php index ab17048a50..48907be9b7 100755 --- a/manager/media/browser/mcpuk/lang/fi.php +++ b/manager/media/browser/mcpuk/lang/fi.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "Siirretään tiedostoa {number}/{count} ... {progress}", "Failed to upload {filename}!" => "Siirto epäonnistui {filename}!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/fr.php b/manager/media/browser/mcpuk/lang/fr.php index ac33d22d14..56104ad5f8 100755 --- a/manager/media/browser/mcpuk/lang/fr.php +++ b/manager/media/browser/mcpuk/lang/fr.php @@ -124,5 +124,3 @@ "Uploading file {number} of {count}... {progress}" => "Envoi du fichier {number} sur {count}... {progress}", "Failed to upload {filename}!" => "Échec du téléchargement du fichier {filename} !", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/he.php b/manager/media/browser/mcpuk/lang/he.php index 56b31a23d0..7f680ac5b8 100755 --- a/manager/media/browser/mcpuk/lang/he.php +++ b/manager/media/browser/mcpuk/lang/he.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "מעלה קובץ {number} מתוך {count}... {progress}", "Failed to upload {filename}!" => "העלאת הקובץ נכשלה!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/hu.php b/manager/media/browser/mcpuk/lang/hu.php index 3539f4a5b4..e90afe939b 100755 --- a/manager/media/browser/mcpuk/lang/hu.php +++ b/manager/media/browser/mcpuk/lang/hu.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "A(z) {number}. fájl feltöltése (összesen {count}) ... {progress}", "Failed to upload {filename}!" => "Nem sikerült feltölteni a '{filename}' fájlt.", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/id.php b/manager/media/browser/mcpuk/lang/id.php index 2eebd4726d..cc54698900 100755 --- a/manager/media/browser/mcpuk/lang/id.php +++ b/manager/media/browser/mcpuk/lang/id.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "Mengunggah file {nomor} of {jumlah}... {progress)", "Failed to upload {filename}!" => "Gagal untuk mengunggah {nama file}", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/it.php b/manager/media/browser/mcpuk/lang/it.php index 557e5b9d02..bb7bd2090d 100755 --- a/manager/media/browser/mcpuk/lang/it.php +++ b/manager/media/browser/mcpuk/lang/it.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "Caricmento del file {number} di {count}... {progress}", "Failed to upload {filename}!" => "Il caricamento del file {filename} è fallito ", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/ja.php b/manager/media/browser/mcpuk/lang/ja.php index 19b7d79535..4ec58a2f88 100755 --- a/manager/media/browser/mcpuk/lang/ja.php +++ b/manager/media/browser/mcpuk/lang/ja.php @@ -128,5 +128,3 @@ "Uploading file {number} of {count}... {progress}" => "ファイルをアップロード中({number}/{count})... {progress}", "Failed to upload {filename}!" => "{filename}のアップロードに失敗しました!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/lt.php b/manager/media/browser/mcpuk/lang/lt.php index 22174d27a4..0a2cad029d 100755 --- a/manager/media/browser/mcpuk/lang/lt.php +++ b/manager/media/browser/mcpuk/lang/lt.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "Įkeliamas {number} failas iš {count}... {progress}", "Failed to upload {filename}!" => "Nepavyko įkelti {filename}!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/nl.php b/manager/media/browser/mcpuk/lang/nl.php index 37d2f0854d..de72b571b8 100755 --- a/manager/media/browser/mcpuk/lang/nl.php +++ b/manager/media/browser/mcpuk/lang/nl.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "Bestand {number} van de {count} aan het uploaden... {progress}", "Failed to upload {filename}!" => "Uploaden van {filename} mislukt!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/no.php b/manager/media/browser/mcpuk/lang/no.php index 80aaf6a6ee..ae785334d6 100755 --- a/manager/media/browser/mcpuk/lang/no.php +++ b/manager/media/browser/mcpuk/lang/no.php @@ -238,5 +238,3 @@ "Select Thumbnails" => "Velg miniatyrbilde", "Download files" => "Last ned filer", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/pl.php b/manager/media/browser/mcpuk/lang/pl.php index 413b5f92c6..ed6b70a346 100755 --- a/manager/media/browser/mcpuk/lang/pl.php +++ b/manager/media/browser/mcpuk/lang/pl.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "Wysyłanie pliku nr {number} spośród {count} ... {progress}", "Failed to upload {filename}!" => "Wysyłanie pliku {filename} nie powiodło się!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/pt-br.php b/manager/media/browser/mcpuk/lang/pt-br.php index 8d6095353e..4ba0636816 100755 --- a/manager/media/browser/mcpuk/lang/pt-br.php +++ b/manager/media/browser/mcpuk/lang/pt-br.php @@ -126,5 +126,3 @@ "Uploading file {number} of {count}... {progress}" => "Enviando arquivo {number} de {count}... {progress}", "Failed to upload {filename}!" => "Falha no envio do arquivo {filename}!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/pt.php b/manager/media/browser/mcpuk/lang/pt.php index dfcd2dd677..6b35ea926d 100755 --- a/manager/media/browser/mcpuk/lang/pt.php +++ b/manager/media/browser/mcpuk/lang/pt.php @@ -239,5 +239,3 @@ "Select Thumbnails" => "Seleccionar miniaturas", "Download files" => "Sacar ficheiros", ); - -?> diff --git a/manager/media/browser/mcpuk/lang/ro.php b/manager/media/browser/mcpuk/lang/ro.php index ecbe6ac2a0..248b01263c 100755 --- a/manager/media/browser/mcpuk/lang/ro.php +++ b/manager/media/browser/mcpuk/lang/ro.php @@ -122,5 +122,3 @@ "Uploading file {number} of {count}... {progress}" => "Încărcare fișier {number} din {count}... {progress}", "Failed to upload {filename}!" => "Încărcare {filename} eșuată!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/ru.php b/manager/media/browser/mcpuk/lang/ru.php index 13c6a55865..59e4683aaf 100755 --- a/manager/media/browser/mcpuk/lang/ru.php +++ b/manager/media/browser/mcpuk/lang/ru.php @@ -124,5 +124,3 @@ "Uploading file {number} of {count}... {progress}" => "Загрузка {number} файла из {count}... {progress}", "Failed to upload {filename}!" => "Неудачная попытка загрузки {filename}!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/sk.php b/manager/media/browser/mcpuk/lang/sk.php index 330fb7fc35..85fa04103f 100755 --- a/manager/media/browser/mcpuk/lang/sk.php +++ b/manager/media/browser/mcpuk/lang/sk.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "Nahrávam súbor {number} z {count}... {progress}", "Failed to upload {filename}!" => "Nepodarilo sa nahrať súbor {filename}!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/sv.php b/manager/media/browser/mcpuk/lang/sv.php index 7a5f806a0d..7d82f9e1d9 100755 --- a/manager/media/browser/mcpuk/lang/sv.php +++ b/manager/media/browser/mcpuk/lang/sv.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "Ladda upp fil {number} av {count} ... {progress}", "Failed to upload {filename}!" => "Uppladdning misslyckad {filename}!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/tr.php b/manager/media/browser/mcpuk/lang/tr.php index b36345d6a7..e228013a14 100755 --- a/manager/media/browser/mcpuk/lang/tr.php +++ b/manager/media/browser/mcpuk/lang/tr.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "{number} / {count} dosya yükleniyor... {progress}", "Failed to upload {filename}!" => "{filename} dosyası yüklenemedi!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/uk.php b/manager/media/browser/mcpuk/lang/uk.php index 5caa120c6e..ea0c0a8242 100755 --- a/manager/media/browser/mcpuk/lang/uk.php +++ b/manager/media/browser/mcpuk/lang/uk.php @@ -1,8 +1,8 @@ "Завантаження файлу {number} з {count}... {progress}", "Failed to upload {filename}!" => "Помилка завантаження {filename}!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/vi.php b/manager/media/browser/mcpuk/lang/vi.php index 0119121cf5..30fa3e8b62 100755 --- a/manager/media/browser/mcpuk/lang/vi.php +++ b/manager/media/browser/mcpuk/lang/vi.php @@ -123,5 +123,3 @@ "Uploading file {number} of {count}... {progress}" => "Đang tải tập tin thứ {number} của {count}... {progress}", "Failed to upload {filename}!" => "Tải lên thất bại {filename}!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/zh-cn.php b/manager/media/browser/mcpuk/lang/zh-cn.php index ac68e2ea13..9aa0dc0c85 100755 --- a/manager/media/browser/mcpuk/lang/zh-cn.php +++ b/manager/media/browser/mcpuk/lang/zh-cn.php @@ -126,5 +126,3 @@ "Uploading file {number} of {count}... {progress}" => "正在上传文件{number} / {count}... {progress}", "Failed to upload {filename}!" => "上传失败{filename}!", ); - -?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lib/class_fastImage.php b/manager/media/browser/mcpuk/lib/class_fastImage.php index ec12ef40cc..08cf2af557 100755 --- a/manager/media/browser/mcpuk/lib/class_fastImage.php +++ b/manager/media/browser/mcpuk/lib/class_fastImage.php @@ -13,227 +13,217 @@ class fastImage { - private $strpos = 0; - private $str; - private $uri; - private $type; - private $handle; + private $strpos = 0; + private $str; + private $uri; + private $type; + private $handle; + + public function __construct($uri = null) + { + if ($uri) { + $this->load($uri); + } + } - public function __construct($uri = null) - { - if ($uri) $this->load($uri); - } + public function load($uri) + { + if ($this->handle) { + $this->close(); + } + + $this->uri = $uri; + $this->handle = fopen($uri, 'r'); + } + + + public function close() + { + if (is_resource($this->handle)) { + fclose($this->handle); + } + } + + + public function getSize() + { + $this->strpos = 0; + if ($this->getType()) { + return array_values($this->parseSize()); + } + + return false; + } + + + public function getType() + { + $this->strpos = 0; + + if (!$this->type) { + switch ($this->getChars(2)) { + case "BM": + return $this->type = 'bmp'; + case "GI": + return $this->type = 'gif'; + case chr(0xFF) . chr(0xd8): + return $this->type = 'jpeg'; + case chr(0x89) . 'P': + return $this->type = 'png'; + default: + return false; + } + } + + return $this->type; + } + + + private function parseSize() + { + $this->strpos = 0; + + switch ($this->type) { + case 'png': + return $this->parseSizeForPNG(); + case 'gif': + return $this->parseSizeForGIF(); + case 'bmp': + return $this->parseSizeForBMP(); + case 'jpeg': + return $this->parseSizeForJPEG(); + } + + return null; + } + + + private function parseSizeForPNG() + { + $chars = $this->getChars(25); + + return unpack("N*", substr($chars, 16, 8)); + } + + + private function parseSizeForGIF() + { + $chars = $this->getChars(11); + + return unpack("S*", substr($chars, 6, 4)); + } + + + private function parseSizeForBMP() + { + $chars = $this->getChars(29); + $chars = substr($chars, 14, 14); + $type = unpack('C', $chars); + + return (reset($type) == 40) ? unpack('L*', substr($chars, 4)) : unpack('L*', substr($chars, 4, 8)); + } - public function load($uri) - { - if ($this->handle) $this->close(); - - $this->uri = $uri; - $this->handle = fopen($uri, 'r'); - } - - - public function close() - { - if (is_resource($this->handle)) fclose($this->handle); - } + private function parseSizeForJPEG() + { + $state = null; + + while (true) { + switch ($state) { + default: + $this->getChars(2); + $state = 'started'; + break; - public function getSize() - { - $this->strpos = 0; - if ($this->getType()) - { - return array_values($this->parseSize()); - } - - return false; - } - - - public function getType() - { - $this->strpos = 0; - - if (!$this->type) - { - switch ($this->getChars(2)) - { - case "BM": - return $this->type = 'bmp'; - case "GI": - return $this->type = 'gif'; - case chr(0xFF).chr(0xd8): - return $this->type = 'jpeg'; - case chr(0x89).'P': - return $this->type = 'png'; - default: - return false; - } - } - - return $this->type; - } - - - private function parseSize() - { - $this->strpos = 0; - - switch ($this->type) - { - case 'png': - return $this->parseSizeForPNG(); - case 'gif': - return $this->parseSizeForGIF(); - case 'bmp': - return $this->parseSizeForBMP(); - case 'jpeg': - return $this->parseSizeForJPEG(); - } - - return null; - } - - - private function parseSizeForPNG() - { - $chars = $this->getChars(25); - - return unpack("N*", substr($chars, 16, 8)); - } - - - private function parseSizeForGIF() - { - $chars = $this->getChars(11); - - return unpack("S*", substr($chars, 6, 4)); - } - - - private function parseSizeForBMP() - { - $chars = $this->getChars(29); - $chars = substr($chars, 14, 14); - $type = unpack('C', $chars); - - return (reset($type) == 40) ? unpack('L*', substr($chars, 4)) : unpack('L*', substr($chars, 4, 8)); - } - - - private function parseSizeForJPEG() - { - $state = null; - - while (true) - { - switch ($state) - { - default: - $this->getChars(2); - $state = 'started'; - break; - - case 'started': - $b = $this->getByte(); - if ($b === false) return false; - - $state = $b == 0xFF ? 'sof' : 'started'; - break; - - case 'sof': - $b = $this->getByte(); - if (in_array($b, range(0xe0, 0xef))) - { - $state = 'skipframe'; - } - elseif (in_array($b, array_merge(range(0xC0,0xC3), range(0xC5,0xC7), range(0xC9,0xCB), range(0xCD,0xCF)))) - { - $state = 'readsize'; - } - elseif ($b == 0xFF) - { - $state = 'sof'; - } - else - { - $state = 'skipframe'; - } - break; - - case 'skipframe': - $skip = $this->readInt($this->getChars(2)) - 2; - $state = 'doskip'; - break; - - case 'doskip': - $this->getChars($skip); - $state = 'started'; - break; - - case 'readsize': - $c = $this->getChars(7); - - return array($this->readInt(substr($c, 5, 2)), $this->readInt(substr($c, 3, 2))); - } - } - } - - - private function getChars($n) - { - $response = null; - - // do we need more data? - if ($this->strpos + $n -1 >= strlen($this->str)) - { - $end = ($this->strpos + $n); - - while (strlen($this->str) < $end && $response !== false) - { - // read more from the file handle - $need = $end - ftell($this->handle); - - if ($response = fread($this->handle, $need)) - { - $this->str .= $response; - } - else - { - return false; - } - } - } - - $result = substr($this->str, $this->strpos, $n); - $this->strpos += $n; - - // we are dealing with bytes here, so force the encoding - return mb_convert_encoding($result, "8BIT"); - } - - - private function getByte() - { - $c = $this->getChars(1); - $b = unpack("C", $c); - - return reset($b); - } - - - private function readInt($str) - { - $size = unpack("C*", $str); - - return ($size[1] << 8) + $size[2]; - } - - - public function __destruct() - { - $this->close(); - } + case 'started': + $b = $this->getByte(); + if ($b === false) { + return false; + } + + $state = $b == 0xFF ? 'sof' : 'started'; + break; + + case 'sof': + $b = $this->getByte(); + if (in_array($b, range(0xe0, 0xef))) { + $state = 'skipframe'; + } elseif (in_array($b, array_merge(range(0xC0, 0xC3), range(0xC5, 0xC7), range(0xC9, 0xCB), range(0xCD, 0xCF)))) { + $state = 'readsize'; + } elseif ($b == 0xFF) { + $state = 'sof'; + } else { + $state = 'skipframe'; + } + break; + + case 'skipframe': + $skip = $this->readInt($this->getChars(2)) - 2; + $state = 'doskip'; + break; + + case 'doskip': + $this->getChars($skip); + $state = 'started'; + break; + + case 'readsize': + $c = $this->getChars(7); + + return array($this->readInt(substr($c, 5, 2)), $this->readInt(substr($c, 3, 2))); + } + } + } + + + private function getChars($n) + { + $response = null; + + // do we need more data? + if ($this->strpos + $n -1 >= strlen($this->str)) { + $end = ($this->strpos + $n); + + while (strlen($this->str) < $end && $response !== false) { + // read more from the file handle + $need = $end - ftell($this->handle); + + if ($response = fread($this->handle, $need)) { + $this->str .= $response; + } else { + return false; + } + } + } + + $result = substr($this->str, $this->strpos, $n); + $this->strpos += $n; + + // we are dealing with bytes here, so force the encoding + return mb_convert_encoding($result, "8BIT"); + } + + + private function getByte() + { + $c = $this->getChars(1); + $b = unpack("C", $c); + + return reset($b); + } + + + private function readInt($str) + { + $size = unpack("C*", $str); + + return ($size[1] << 8) + $size[2]; + } + + + public function __destruct() + { + $this->close(); + } } diff --git a/manager/media/browser/mcpuk/lib/class_gd.php b/manager/media/browser/mcpuk/lib/class_gd.php index c9ed6f04af..0b7df86033 100755 --- a/manager/media/browser/mcpuk/lib/class_gd.php +++ b/manager/media/browser/mcpuk/lib/class_gd.php @@ -12,50 +12,48 @@ * @link http://kcfinder.sunhater.com */ -class gd { +class gd +{ /** GD resource * @var resource */ protected $image; - /** Image width - * @var integer */ + /** Image width + * @var integer */ protected $width; - /** Image height - * @var integer */ + /** Image height + * @var integer */ protected $height; - /** Init error - * @var bool */ + /** Init error + * @var bool */ public $init_error = false; - /** Last builded image type constant (IMAGETYPE_XXX) - * @var integer */ + /** Last builded image type constant (IMAGETYPE_XXX) + * @var integer */ public $type; - /** Returns an array. Element 0 - GD resource. Element 1 - width. Element 2 - height. - * Returns FALSE on failure. The only one parameter $image can be an instance of this class, - * a GD resource, an array(width, height) or path to image file. - * @param mixed $image - * @return array */ - - protected function build_image($image) { + /** Returns an array. Element 0 - GD resource. Element 1 - width. Element 2 - height. + * Returns FALSE on failure. The only one parameter $image can be an instance of this class, + * a GD resource, an array(width, height) or path to image file. + * @param mixed $image + * @return array */ + protected function build_image($image) + { if ($image instanceof gd) { $width = $image->get_width(); $height = $image->get_height(); $image = $image->get_image(); - } elseif (is_resource($image) && (get_resource_type($image) == "gd")) { $width = @imagesx($image); $height = @imagesy($image); - } elseif (is_array($image)) { list($key, $width) = each($image); list($key, $height) = each($image); $image = imagecreatetruecolor($width, $height); - } elseif (false !== (list($width, $height, $type) = @getimagesize($image))) { $image = ($type == IMAGETYPE_GIF) ? @imagecreatefromgif($image) : ( @@ -66,8 +64,9 @@ protected function build_image($image) { ($type == IMAGETYPE_XBM) ? @imagecreatefromxbm($image) : false ))))); - if ($type == IMAGETYPE_PNG) + if ($type == IMAGETYPE_PNG) { imagealphablending($image, false); + } } $return = ( @@ -81,32 +80,35 @@ protected function build_image($image) { ? array($image, $width, $height) : false; - if (($return !== false) && isset($type)) + if (($return !== false) && isset($type)) { $this->type = $type; + } return $return; } - /** Parameter $image can be: - * 1. An instance of this class (copy instance). - * 2. A GD resource. - * 3. An array with two elements. First - width, second - height. Create a blank image. - * 4. A filename string. Get image form file. - * The non-required parameter $bigger_size is the bigger dimension (width or height) the image - * will be resized to. The other dimension (height or width) will be calculated autamaticaly - * @param mixed $image - * @param integer $bigger_size - * @return gd */ - - public function __construct($image, $bigger_size=null) { + /** Parameter $image can be: + * 1. An instance of this class (copy instance). + * 2. A GD resource. + * 3. An array with two elements. First - width, second - height. Create a blank image. + * 4. A filename string. Get image form file. + * The non-required parameter $bigger_size is the bigger dimension (width or height) the image + * will be resized to. The other dimension (height or width) will be calculated autamaticaly + * @param mixed $image + * @param integer $bigger_size + * @return gd */ + + public function __construct($image, $bigger_size=null) + { $this->image = $this->width = $this->height = null; $image_details = $this->build_image($image); - if ($image_details !== false) + if ($image_details !== false) { list($this->image, $this->width, $this->height) = $image_details; - else + } else { $this->init_error = true; + } if (!is_null($this->image) && !is_null($bigger_size) && @@ -115,85 +117,98 @@ public function __construct($image, $bigger_size=null) { $image = $this->image; list($width, $height) = $this->get_prop_size($bigger_size); $this->image = imagecreatetruecolor($width, $height); - imagealphablending($this->image, false); - imagesavealpha($this->image, true); + imagealphablending($this->image, false); + imagesavealpha($this->image, true); $this->width = $width; $this->height = $height; $this->imagecopyresampled($image); } } - /** Returns the GD resource - * @return resource */ + /** Returns the GD resource + * @return resource */ - public function get_image() { + public function get_image() + { return $this->image; } - /** Returns the image width - * @return integer */ + /** Returns the image width + * @return integer */ - public function get_width() { + public function get_width() + { return $this->width; } - /** Returns the image height - * @return integer */ + /** Returns the image height + * @return integer */ - public function get_height() { + public function get_height() + { return $this->height; } - /** Returns calculated proportional width from the given height - * @param integer $resized_height - * @return integer */ + /** Returns calculated proportional width from the given height + * @param integer $resized_height + * @return integer */ - public function get_prop_width($resized_height) { + public function get_prop_width($resized_height) + { $width = intval(($this->width * $resized_height) / $this->height); - if (!$width) $width = 1; + if (!$width) { + $width = 1; + } return $width; } - /** Returns calculated proportional height from the given width - * @param integer $resized_width - * @return integer */ + /** Returns calculated proportional height from the given width + * @param integer $resized_width + * @return integer */ - public function get_prop_height($resized_width) { + public function get_prop_height($resized_width) + { $height = intval(($this->height * $resized_width) / $this->width); - if (!$height) $height = 1; + if (!$height) { + $height = 1; + } return $height; } - /** Returns an array with calculated proportional width & height. - * The parameter $bigger_size is the bigger dimension (width or height) of calculated sizes. - * The other dimension (height or width) will be calculated autamaticaly - * @param integer $bigger_size - * @return array */ - - public function get_prop_size($bigger_size) { + /** Returns an array with calculated proportional width & height. + * The parameter $bigger_size is the bigger dimension (width or height) of calculated sizes. + * The other dimension (height or width) will be calculated autamaticaly + * @param integer $bigger_size + * @return array */ + public function get_prop_size($bigger_size) + { if ($this->width > $this->height) { $width = $bigger_size; $height = $this->get_prop_height($width); - } elseif ($this->height > $this->width) { $height = $bigger_size; $width = $this->get_prop_width($height); - - } else + } else { $width = $height = $bigger_size; + } return array($width, $height); } - /** Resize image. Returns TRUE on success or FALSE on failure - * @param integer $width - * @param integer $height - * @return bool */ + /** Resize image. Returns TRUE on success or FALSE on failure + * @param integer $width + * @param integer $height + * @return bool */ - public function resize($width, $height) { - if (!$width) $width = 1; - if (!$height) $height = 1; + public function resize($width, $height) + { + if (!$width) { + $width = 1; + } + if (!$height) { + $height = 1; + } return ( (false !== ($img = new gd(array($width, $height)))) && $img->imagecopyresampled($this) && @@ -203,12 +218,13 @@ public function resize($width, $height) { ); } - /** Resize the given image source (GD, gd object or image file path) to fit in the own image. - * The outside ares will be cropped out. Returns TRUE on success or FALSE on failure - * @param mixed $src - * @return bool */ + /** Resize the given image source (GD, gd object or image file path) to fit in the own image. + * The outside ares will be cropped out. Returns TRUE on success or FALSE on failure + * @param mixed $src + * @return bool */ - public function resize_crop($src) { + public function resize_crop($src) + { $image_details = $this->build_image($src); if ($image_details !== false) { @@ -219,7 +235,6 @@ public function resize_crop($src) { $src_h = $src_height; $src_x = intval(($src_width - $src_w) / 2); $src_y = 0; - } else { $src_w = $src_width; $src_h = $this->get_prop_height($src_width); @@ -228,37 +243,44 @@ public function resize_crop($src) { } return imagecopyresampled($this->image, $src, 0, 0, $src_x, $src_y, $this->width, $this->height, $src_w, $src_h); - - } else + } else { return false; + } } - /** Resize image to fit in given resolution. Returns TRUE on success or FALSE on failure - * @param integer $width - * @param integer $height - * @return bool */ + /** Resize image to fit in given resolution. Returns TRUE on success or FALSE on failure + * @param integer $width + * @param integer $height + * @return bool */ - public function resize_fit($width, $height) { - if ((!$width && !$height) || (($width == $this->width) && ($height == $this->height))) + public function resize_fit($width, $height) + { + if ((!$width && !$height) || (($width == $this->width) && ($height == $this->height))) { return true; - if (!$width || (($height / $width) < ($this->height / $this->width))) + } + if (!$width || (($height / $width) < ($this->height / $this->width))) { $width = intval(($this->width * $height) / $this->height); - elseif (!$height || (($width / $height) < ($this->width / $this->height))) + } elseif (!$height || (($width / $height) < ($this->width / $this->height))) { $height = intval(($this->height * $width) / $this->width); - if (!$width) $width = 1; - if (!$height) $height = 1; + } + if (!$width) { + $width = 1; + } + if (!$height) { + $height = 1; + } return $this->resize($width, $height); } - /** Neka si predstavim vyobrazhaem pravoygylnik s razmeri $width i $height. - * Izobrazhenieto shte se preorazmeri taka che to shte izliza ot tozi pravoygylnik, - * no samo po edno (x ili y) izmerenie - * @param integer $width - * @param integer $height - * @return bool */ - - public function resize_overflow($width, $height) { + /** Neka si predstavim vyobrazhaem pravoygylnik s razmeri $width i $height. + * Izobrazhenieto shte se preorazmeri taka che to shte izliza ot tozi pravoygylnik, + * no samo po edno (x ili y) izmerenie + * @param integer $width + * @param integer $height + * @return bool */ + public function resize_overflow($width, $height) + { $big = (($this->width / $this->height) > ($width / $height)) ? ($this->width * $height) / $this->height : ($this->height * $width) / $this->width; @@ -275,7 +297,8 @@ public function resize_overflow($width, $height) { return $return; } - public function gd_color() { + public function gd_color() + { $args = func_get_args(); $expr_rgb = '/^rgb\(\s*(\d{1,3})\s*\,\s*(\d{1,3})\s*\,\s*(\d{1,3})\s*\)$/i'; @@ -283,46 +306,44 @@ public function gd_color() { $expr_hex2 = '/^\#?([0-9a-f])([0-9a-f])([0-9a-f])$/i'; $expr_byte = '/^([01]?\d?\d|2[0-4]\d|25[0-5])$/'; - if (!isset($args[0])) + if (!isset($args[0])) { return false; + } if (count($args[0]) == 3) { list($r, $g, $b) = $args[0]; - } elseif (preg_match($expr_rgb, $args[0])) { list($r, $g, $b) = explode(" ", preg_replace($expr_rgb, "$1 $2 $3", $args[0])); - } elseif (preg_match($expr_hex1, $args[0])) { list($r, $g, $b) = explode(" ", preg_replace($expr_hex1, "$1 $2 $3", $args[0])); $r = hexdec($r); $g = hexdec($g); $b = hexdec($b); - } elseif (preg_match($expr_hex2, $args[0])) { list($r, $g, $b) = explode(" ", preg_replace($expr_hex2, "$1$1 $2$2 $3$3", $args[0])); $r = hexdec($r); $g = hexdec($g); $b = hexdec($b); - } elseif ((count($args) == 3) && preg_match($expr_byte, $args[0]) && preg_match($expr_byte, $args[1]) && preg_match($expr_byte, $args[2]) ) { list($r, $g, $b) = $args; - - } else + } else { return false; + } return imagecolorallocate($this->image, $r, $g, $b); } - public function fill_color($color) { + public function fill_color($color) + { return $this->imagefilledrectangle(0, 0, $this->width - 1, $this->height - 1, $color); } -/* G D M E T H O D S */ + /* G D M E T H O D S */ public function imagecopy( $src, @@ -336,14 +357,22 @@ public function imagecopy( if ($image_details !== false) { list($src, $src_width, $src_height) = $image_details; - if (is_null($dst_w)) $dst_w = $this->width - $dst_x; - if (is_null($dst_h)) $dst_h = $this->height - $dst_y; - if (is_null($src_w)) $src_w = $src_width - $src_x; - if (is_null($src_h)) $src_h = $src_height - $src_y; + if (is_null($dst_w)) { + $dst_w = $this->width - $dst_x; + } + if (is_null($dst_h)) { + $dst_h = $this->height - $dst_y; + } + if (is_null($src_w)) { + $src_w = $src_width - $src_x; + } + if (is_null($src_h)) { + $src_h = $src_height - $src_y; + } return imagecopy($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h); - - } else + } else { return false; + } } public function imagecopyresampled( @@ -358,68 +387,88 @@ public function imagecopyresampled( if ($image_details !== false) { list($src, $src_width, $src_height) = $image_details; - if (is_null($dst_w)) $dst_w = $this->width - $dst_x; - if (is_null($dst_h)) $dst_h = $this->height - $dst_y; - if (is_null($src_w)) $src_w = $src_width - $src_x; - if (is_null($src_h)) $src_h = $src_height - $src_y; + if (is_null($dst_w)) { + $dst_w = $this->width - $dst_x; + } + if (is_null($dst_h)) { + $dst_h = $this->height - $dst_y; + } + if (is_null($src_w)) { + $src_w = $src_width - $src_x; + } + if (is_null($src_h)) { + $src_h = $src_height - $src_y; + } imagealphablending($this->image, false); - imagesavealpha($this->image,true); - + imagesavealpha($this->image, true); - /*** gif transparent fix - 1.10.2013 ***/ - $transindex = imagecolortransparent($src); - $palletsize = imagecolorstotal($src); - if($transindex >= 0 && $transindex < $palletsize) { - $transcol = imagecolorsforindex($src, $transindex); + /*** gif transparent fix - 1.10.2013 ***/ - /*** end gif transparent fix ***/ + $transindex = imagecolortransparent($src); + $palletsize = imagecolorstotal($src); + if ($transindex >= 0 && $transindex < $palletsize) { + $transcol = imagecolorsforindex($src, $transindex); - $transindex = imagecolorallocatealpha($this->image, $transcol['red'], $transcol['green'], $transcol['blue'], 127); - imagefilledrectangle($this->image, 0, 0, $dst_w, $dst_h, $transindex); - imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); - imagecolortransparent($this->image, $transindex); - for($y=0; $y<$dst_h; ++$y) - for($x=0; $x<$dst_w; ++$x) - if(((imagecolorat($this->image, $x, $y)>>24) & 0x7F) >= 100) imagesetpixel($this->image, $x, $y, $transindex); - imagetruecolortopalette($this->image, true, 255); - } - else { - $transparent = imagecolorallocatealpha($this->image, 255, 255, 255, 127); - imagefilledrectangle($this->image, 0, 0, $dst_w, $dst_h, $transparent); - imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); - } - return $this->image; + /*** end gif transparent fix ***/ - } else + $transindex = imagecolorallocatealpha($this->image, $transcol['red'], $transcol['green'], $transcol['blue'], 127); + imagefilledrectangle($this->image, 0, 0, $dst_w, $dst_h, $transindex); + imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); + imagecolortransparent($this->image, $transindex); + for ($y=0; $y<$dst_h; ++$y) { + for ($x=0; $x<$dst_w; ++$x) { + if (((imagecolorat($this->image, $x, $y)>>24) & 0x7F) >= 100) { + imagesetpixel($this->image, $x, $y, $transindex); + } + } + } + imagetruecolortopalette($this->image, true, 255); + } else { + $transparent = imagecolorallocatealpha($this->image, 255, 255, 255, 127); + imagefilledrectangle($this->image, 0, 0, $dst_w, $dst_h, $transparent); + imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); + } + return $this->image; + } else { return false; + } } - public function imagefilledrectangle($x1, $y1, $x2, $y2, $color) { + public function imagefilledrectangle($x1, $y1, $x2, $y2, $color) + { $color = $this->gd_color($color); - if ($color === false) return false; + if ($color === false) { + return false; + } return imagefilledrectangle($this->image, $x1, $y1, $x2, $y2, $color); } - public function imagepng($filename=null, $quality=null, $filters=null) { - if (is_null($filename) && !headers_sent()) + public function imagepng($filename=null, $quality=null, $filters=null) + { + if (is_null($filename) && !headers_sent()) { header("Content-Type: image/png"); + } @imagesavealpha($this->image, true); return imagepng($this->image, $filename, $quality, $filters); } - public function imagejpeg($filename=null, $quality=75) { - if (is_null($filename) && !headers_sent()) + public function imagejpeg($filename=null, $quality=75) + { + if (is_null($filename) && !headers_sent()) { header("Content-Type: image/jpeg"); + } return imagejpeg($this->image, $filename, $quality); } - public function imagegif($filename=null) { - if (is_null($filename) && !headers_sent()) + public function imagegif($filename=null) + { + if (is_null($filename) && !headers_sent()) { header("Content-Type: image/gif"); - @imagesavealpha($this->image, true); + } + @imagesavealpha($this->image, true); return imagegif($this->image, $filename); } } diff --git a/manager/media/browser/mcpuk/lib/class_image.php b/manager/media/browser/mcpuk/lib/class_image.php index 79918a49b2..09985d7f27 100755 --- a/manager/media/browser/mcpuk/lib/class_image.php +++ b/manager/media/browser/mcpuk/lib/class_image.php @@ -12,114 +12,123 @@ * @link http://kcfinder.sunhater.com */ -abstract class image { +abstract class image +{ const DEFAULT_JPEG_QUALITY = 75; -/** Image resource or object - * @var mixed */ + /** Image resource or object + * @var mixed */ protected $image; -/** Image width in pixels - * @var integer */ + /** Image width in pixels + * @var integer */ protected $width; -/** Image height in pixels - * @var integer */ + /** Image height in pixels + * @var integer */ protected $height; -/** Init error - * @var bool */ + /** Init error + * @var bool */ protected $initError = false; -/** Driver specific options - * @var array */ + /** Driver specific options + * @var array */ protected $options = array(); -/** Magic method which allows read-only access to all protected or private - * class properties - * @param string $property - * @return mixed */ + /** Magic method which allows read-only access to all protected or private + * class properties + * @param string $property + * @return mixed */ - final public function __get($property) { + final public function __get($property) + { return property_exists($this, $property) ? $this->$property : null; } -/** Constructor. Parameter $image should be: - * 1. An instance of image driver class (copy instance). - * 2. An image represented by the type of the $image property - * (resource or object). - * 3. An array with two elements. First - width, second - height. - * Creates a blank image. - * 4. A filename string. Get image form file. - * Second paramaeter is used by pass some specific image driver options - * @param mixed $image - * @param array $options */ + /** Constructor. Parameter $image should be: + * 1. An instance of image driver class (copy instance). + * 2. An image represented by the type of the $image property + * (resource or object). + * 3. An array with two elements. First - width, second - height. + * Creates a blank image. + * 4. A filename string. Get image form file. + * Second paramaeter is used by pass some specific image driver options + * @param mixed $image + * @param array $options */ - public function __construct($image, array $options=array()) { + public function __construct($image, array $options=array()) + { $this->image = $this->width = $this->height = null; $imageDetails = $this->buildImage($image); - if ($imageDetails !== false) + if ($imageDetails !== false) { list($this->image, $this->width, $this->height) = $imageDetails; - else + } else { $this->initError = true; + } $this->options = $options; } -/** Factory pattern to load selected driver. $image and $options are passed - * to the constructor of the image driver - * @param string $driver - * @param mixed $image - * @return object */ + /** Factory pattern to load selected driver. $image and $options are passed + * to the constructor of the image driver + * @param string $driver + * @param mixed $image + * @return object */ - final static function factory($driver, $image, array $options=array()) { + final public static function factory($driver, $image, array $options=array()) + { $class = "image_$driver"; return new $class($image, $options); } -/** Checks if the drivers in the array parameter could be used. Returns first - * found one - * @param array $drivers - * @return string */ + /** Checks if the drivers in the array parameter could be used. Returns first + * found one + * @param array $drivers + * @return string */ - final static function getDriver(array $drivers=array('gd')) { + final public static function getDriver(array $drivers=array('gd')) + { foreach ($drivers as $driver) { - if (!preg_match('/^[a-z0-9\_]+$/i', $driver)) + if (!preg_match('/^[a-z0-9\_]+$/i', $driver)) { continue; + } $class = "image_$driver"; if (class_exists($class) && method_exists($class, "available")) { eval("\$avail = $class::available();"); - if ($avail) return $driver; + if ($avail) { + return $driver; + } } } return false; } -/** Returns an array. Element 0 - image resource. Element 1 - width. Element 2 - height. - * Returns FALSE on failure. - * @param mixed $image - * @return array */ + /** Returns an array. Element 0 - image resource. Element 1 - width. Element 2 - height. + * Returns FALSE on failure. + * @param mixed $image + * @return array */ - final protected function buildImage($image) { + final protected function buildImage($image) + { $class = get_class($this); if ($image instanceof $class) { $width = $image->width; $height = $image->height; $img = $image->image; - } elseif (is_array($image)) { list($key, $width) = each($image); list($key, $height) = each($image); $img = $this->getBlankImage($width, $height); - - } else + } else { $img = $this->getImage($image, $width, $height); + } return ($img !== false) ? array($img, $width, $height) @@ -127,113 +136,124 @@ final protected function buildImage($image) { } -/** Returns calculated proportional width from the given height - * @param integer $resizedHeight - * @return integer */ + /** Returns calculated proportional width from the given height + * @param integer $resizedHeight + * @return integer */ - final public function getPropWidth($resizedHeight) { + final public function getPropWidth($resizedHeight) + { $width = round(($this->width * $resizedHeight) / $this->height); - if (!$width) $width = 1; + if (!$width) { + $width = 1; + } return $width; } -/** Returns calculated proportional height from the given width - * @param integer $resizedWidth - * @return integer */ + /** Returns calculated proportional height from the given width + * @param integer $resizedWidth + * @return integer */ - final public function getPropHeight($resizedWidth) { + final public function getPropHeight($resizedWidth) + { $height = round(($this->height * $resizedWidth) / $this->width); - if (!$height) $height = 1; + if (!$height) { + $height = 1; + } return $height; } -/** Checks if PHP needs some extra extensions to use the image driver. This - * static method should be implemented into driver classes like abstract - * methods - * @return bool */ - static function available() { return false; } + /** Checks if PHP needs some extra extensions to use the image driver. This + * static method should be implemented into driver classes like abstract + * methods + * @return bool */ + public static function available() + { + return false; + } -/** Checks if file is an image. This static method should be implemented into - * driver classes like abstract methods - * @param string $file - * @return bool */ - static function checkImage($file) { return false; } + /** Checks if file is an image. This static method should be implemented into + * driver classes like abstract methods + * @param string $file + * @return bool */ + public static function checkImage($file) + { + return false; + } -/** Resize image. Should return TRUE on success or FALSE on failure - * @param integer $width - * @param integer $height - * @return bool */ + /** Resize image. Should return TRUE on success or FALSE on failure + * @param integer $width + * @param integer $height + * @return bool */ abstract public function resize($width, $height); -/** Resize image to fit in given resolution. Should returns TRUE on success - * or FALSE on failure. If $background is set, the image size will be - * $width x $height and the empty spaces (if any) will be filled with defined - * color. Background color examples: "#5f5", "#ff67ca", array(255, 255, 255) - * @param integer $width - * @param integer $height - * @param mixed $background - * @return bool */ + /** Resize image to fit in given resolution. Should returns TRUE on success + * or FALSE on failure. If $background is set, the image size will be + * $width x $height and the empty spaces (if any) will be filled with defined + * color. Background color examples: "#5f5", "#ff67ca", array(255, 255, 255) + * @param integer $width + * @param integer $height + * @param mixed $background + * @return bool */ abstract public function resizeFit($width, $height, $background=false); -/** Resize and crop the image to fit in given resolution. Returns TRUE on - * success or FALSE on failure - * @param mixed $src - * @param integer $offset - * @return bool */ + /** Resize and crop the image to fit in given resolution. Returns TRUE on + * success or FALSE on failure + * @param mixed $src + * @param integer $offset + * @return bool */ abstract public function resizeCrop($width, $height, $offset=false); -/** Rotate image - * @param integer $angle - * @param string $background - * @return bool */ + /** Rotate image + * @param integer $angle + * @param string $background + * @return bool */ abstract public function rotate($angle, $background="#000000"); abstract public function flipHorizontal(); abstract public function flipVertical(); -/** Apply a PNG or GIF watermark to the image. $top and $left parameters sets - * the offset of the watermark in pixels. Boolean and NULL values are possible - * too. In default case (FALSE, FALSE) the watermark should be applyed to - * the bottom right corner. NULL values means center aligning. If the - * watermark is bigger than the image or it's partialy or fully outside the - * image, it shoudn't be applied - * @param string $file - * @param mixed $top - * @param mixed $left - * @return bool */ + /** Apply a PNG or GIF watermark to the image. $top and $left parameters sets + * the offset of the watermark in pixels. Boolean and NULL values are possible + * too. In default case (FALSE, FALSE) the watermark should be applyed to + * the bottom right corner. NULL values means center aligning. If the + * watermark is bigger than the image or it's partialy or fully outside the + * image, it shoudn't be applied + * @param string $file + * @param mixed $top + * @param mixed $left + * @return bool */ abstract public function watermark($file, $left=false, $top=false); -/** Should output the image. Second parameter is used to pass some options like - * 'file' - if is set, the output will be written to a file - * 'quality' - compression quality - * It's possible to use extra specific options required by image type ($type) - * @param string $type - * @param array $options - * @return bool */ + /** Should output the image. Second parameter is used to pass some options like + * 'file' - if is set, the output will be written to a file + * 'quality' - compression quality + * It's possible to use extra specific options required by image type ($type) + * @param string $type + * @param array $options + * @return bool */ abstract public function output($type='jpeg', array $options=array()); -/** This method should create a blank image with selected size. Should returns - * resource or object related to the created image, which will be passed to - * $image property - * @param integer $width - * @param integer $height - * @return mixed */ + /** This method should create a blank image with selected size. Should returns + * resource or object related to the created image, which will be passed to + * $image property + * @param integer $width + * @param integer $height + * @return mixed */ abstract protected function getBlankImage($width, $height); -/** This method should create an image from source image. Only first parameter - * ($image) is input. Its type should be filename string or a type of the - * $image property. See the constructor reference for details. The - * parametters $width and $height are output only. Should returns resource or - * object related to the created image, which will be passed to $image - * property - * @param mixed $image - * @param integer $width - * @param integer $height - * @return mixed */ + /** This method should create an image from source image. Only first parameter + * ($image) is input. Its type should be filename string or a type of the + * $image property. See the constructor reference for details. The + * parametters $width and $height are output only. Should returns resource or + * object related to the created image, which will be passed to $image + * property + * @param mixed $image + * @param integer $width + * @param integer $height + * @return mixed */ abstract protected function getImage($image, &$width, &$height); - } diff --git a/manager/media/browser/mcpuk/lib/class_image_gd.php b/manager/media/browser/mcpuk/lib/class_image_gd.php index c564ce8e43..55426518ea 100755 --- a/manager/media/browser/mcpuk/lib/class_image_gd.php +++ b/manager/media/browser/mcpuk/lib/class_image_gd.php @@ -12,14 +12,20 @@ * @link http://kcfinder.sunhater.com */ -class image_gd extends image { +class image_gd extends image +{ // ABSTRACT PUBLIC METHODS - public function resize($width, $height) { - if (!$width) $width = 1; - if (!$height) $height = 1; + public function resize($width, $height) + { + if (!$width) { + $width = 1; + } + if (!$height) { + $height = 1; + } return ( (false !== ($img = new image_gd(array($width, $height)))) && $img->imageCopyResampled($this) && @@ -29,9 +35,11 @@ public function resize($width, $height) { ); } - public function resizeFit($width, $height, $background=false) { - if ((!$width && !$height) || (($width == $this->width) && ($height == $this->height))) + public function resizeFit($width, $height, $background=false) + { + if ((!$width && !$height) || (($width == $this->width) && ($height == $this->height))) { return true; + } if (!$width || (($height / $width) < ($this->height / $this->width))) { $h = $height; $w = round(($this->width * $h) / $this->height); @@ -42,13 +50,16 @@ public function resizeFit($width, $height, $background=false) { $w = $width; $h = $height; } - if (!$w) $w = 1; - if (!$h) $h = 1; + if (!$w) { + $w = 1; + } + if (!$h) { + $h = 1; + } - if ($background === false) + if ($background === false) { return $this->resize($w, $h); - - else { + } else { $img = new image_gd(array($width, $height)); $x = round(($width - $w) / 2); $y = round(($height - $h) / 2); @@ -56,8 +67,9 @@ public function resizeFit($width, $height, $background=false) { if ((false === $this->resize($w, $h)) || (false === $img->imageFilledRectangle(0, 0, $width, $height, $background)) || (false === $img->imageCopyResampled($this->image, $x, $y, 0, 0, $w, $h)) - ) + ) { return false; + } $this->image = $img->image; $this->width = $width; @@ -67,41 +79,50 @@ public function resizeFit($width, $height, $background=false) { } } - public function resizeCrop($width, $height, $offset=false) { - + public function resizeCrop($width, $height, $offset=false) + { if (($this->width / $this->height) > ($width / $height)) { $h = $height; $w = ($this->width * $h) / $this->height; $y = 0; if ($offset !== false) { - if ($offset > 0) + if ($offset > 0) { $offset = -$offset; - if (($w + $offset) <= $width) + } + if (($w + $offset) <= $width) { $offset = $width - $w; + } $x = $offset; - } else + } else { $x = ($width - $w) / 2; - + } } else { $w = $width; $h = ($this->height * $w) / $this->width; $x = 0; if ($offset !== false) { - if ($offset > 0) + if ($offset > 0) { $offset = -$offset; - if (($h + $offset) <= $height) + } + if (($h + $offset) <= $height) { $offset = $height - $h; + } $y = $offset; - } else + } else { $y = ($height - $h) / 2; + } } $x = round($x); $y = round($y); $w = round($w); $h = round($h); - if (!$w) $w = 1; - if (!$h) $h = 1; + if (!$w) { + $w = 1; + } + if (!$h) { + $h = 1; + } $return = ( (false !== ($img = new image_gd(array($width, $height))))) && @@ -117,50 +138,59 @@ public function resizeCrop($width, $height, $offset=false) { return $return; } - public function rotate($angle, $background="#000000") { + public function rotate($angle, $background="#000000") + { $angle = -$angle; $img = @imagerotate($this->image, $angle, $this->gdColor($background)); - if ($img === false) + if ($img === false) { return false; + } $this->width = imagesx($img); $this->height = imagesy($img); $this->image = $img; return true; } - public function flipHorizontal() { + public function flipHorizontal() + { $img = imagecreatetruecolor($this->width, $this->height); - imagealphablending($img, false); - imagesavealpha($img, true); - if (imagecopyresampled($img, $this->image, 0, 0, ($this->width - 1), 0, $this->width, $this->height, -$this->width, $this->height)) + imagealphablending($img, false); + imagesavealpha($img, true); + if (imagecopyresampled($img, $this->image, 0, 0, ($this->width - 1), 0, $this->width, $this->height, -$this->width, $this->height)) { $this->image = $img; - else + } else { return false; + } return true; } - public function flipVertical() { + public function flipVertical() + { $img = imagecreatetruecolor($this->width, $this->height); - imagealphablending($img, false); - imagesavealpha($img, true); - if (imagecopyresampled($img, $this->image, 0, 0, 0, ($this->height - 1), $this->width, $this->height, $this->width, -$this->height)) + imagealphablending($img, false); + imagesavealpha($img, true); + if (imagecopyresampled($img, $this->image, 0, 0, 0, ($this->height - 1), $this->width, $this->height, $this->width, -$this->height)) { $this->image = $img; - else + } else { return false; + } return true; } - public function watermark($file, $left=false, $top=false) { + public function watermark($file, $left=false, $top=false) + { $info = getimagesize($file); list($w, $h, $t) = $info; - if (!in_array($t, array(IMAGETYPE_PNG, IMAGETYPE_GIF))) + if (!in_array($t, array(IMAGETYPE_PNG, IMAGETYPE_GIF))) { return false; + } $imagecreate = ($t == IMAGETYPE_PNG) ? "imagecreatefrompng" : "imagecreatefromgif"; if (!@imagealphablending($this->image, true) || (false === ($wm = @$imagecreate($file))) - ) + ) { return false; + } $w = imagesx($wm); $h = imagesy($wm); @@ -176,28 +206,33 @@ public function watermark($file, $left=false, $top=false) { if ((($x + $w) > $this->width) || (($y + $h) > $this->height) || ($x < 0) || ($y < 0) - ) + ) { return false; + } - if (($wm === false) || !@imagecopy($this->image, $wm, $x, $y, 0, 0, $w, $h)) + if (($wm === false) || !@imagecopy($this->image, $wm, $x, $y, 0, 0, $w, $h)) { return false; + } @imagealphablending($this->image, false); @imagesavealpha($this->image, true); return true; } - public function output($type='jpeg', array $options=array()) { + public function output($type='jpeg', array $options=array()) + { $method = "output_$type"; - if (!method_exists($this, $method)) + if (!method_exists($this, $method)) { return false; + } return $this->$method($options); } // ABSTRACT PROTECTED METHODS - protected function getBlankImage($width, $height) { + protected function getBlankImage($width, $height) + { $img = @imagecreatetruecolor($width, $height); // imagealphablending($img, false); // imagesavealpha($img, true); @@ -207,13 +242,12 @@ protected function getBlankImage($width, $height) { return $img; } - protected function getImage($image, &$width, &$height) { - + protected function getImage($image, &$width, &$height) + { if (is_resource($image) && (get_resource_type($image) == "gd")) { $width = @imagesx($image); $height = @imagesy($image); return $image; - } elseif (is_string($image) && (false !== (list($width, $height, $t) = @getimagesize($image))) ) { @@ -226,23 +260,26 @@ protected function getImage($image, &$width, &$height) { )))); return $image; - - } else + } else { return false; + } } // PSEUDO-ABSTRACT STATIC METHODS - static function available() { + public static function available() + { return function_exists("imagecreatefromjpeg"); } - static function checkImage($file) { + public static function checkImage($file) + { if (!is_string($file) || ((false === (list($width, $height, $t) = @getimagesize($file)))) - ) + ) { return false; + } $img = ($t == IMAGETYPE_GIF) ? @imagecreatefromgif($file) : ( @@ -258,34 +295,41 @@ static function checkImage($file) { // OWN METHODS - protected function output_png(array $options=array()) { + protected function output_png(array $options=array()) + { $file = isset($options['file']) ? $options['file'] : null; $quality = isset($options['quality']) ? $options['quality'] : null; $filters = isset($options['filters']) ? $options['filters'] : null; - if (($file === null) && !headers_sent()) + if (($file === null) && !headers_sent()) { header("Content-Type: image/png"); + } @imagesavealpha($this->image, true); return imagepng($this->image, $file, $quality, $filters); } - protected function output_jpeg(array $options=array()) { + protected function output_jpeg(array $options=array()) + { $file = isset($options['file']) ? $options['file'] : null; $quality = isset($options['quality']) ? $options['quality'] : self::DEFAULT_JPEG_QUALITY; - if (($file === null) && !headers_sent()) + if (($file === null) && !headers_sent()) { header("Content-Type: image/jpeg"); + } return imagejpeg($this->image, $file, $quality); } - protected function output_gif(array $options=array()) { + protected function output_gif(array $options=array()) + { $file = isset($options['file']) ? $options['file'] : null; - if (isset($options['file']) && !headers_sent()) + if (isset($options['file']) && !headers_sent()) { header("Content-Type: image/gif"); + } return imagegif($this->image, $file); } - protected function gdColor() { + protected function gdColor() + { $args = func_get_args(); $exprRGB = '/^rgb\(\s*(\d{1,3})\s*\,\s*(\d{1,3})\s*\,\s*(\d{1,3})\s*\)$/i'; @@ -293,43 +337,43 @@ protected function gdColor() { $exprHex2 = '/^\#?([0-9a-f])([0-9a-f])([0-9a-f])$/i'; $exprByte = '/^([01]?\d?\d|2[0-4]\d|25[0-5])$/'; - if (!isset($args[0])) + if (!isset($args[0])) { return false; + } if (count($args[0]) == 3) { list($r, $g, $b) = $args[0]; - } elseif (preg_match($exprRGB, $args[0], $match)) { list($tmp, $r, $g, $b) = $match; - } elseif (preg_match($exprHex1, $args[0], $match)) { list($tmp, $r, $g, $b) = $match; $r = hexdec($r); $g = hexdec($g); $b = hexdec($b); - } elseif (preg_match($exprHex2, $args[0], $match)) { list($tmp, $r, $g, $b) = $match; $r = hexdec("$r$r"); $g = hexdec("$g$g"); $b = hexdec("$b$b"); - } elseif ((count($args) == 3) && preg_match($exprByte, $args[0]) && preg_match($exprByte, $args[1]) && preg_match($exprByte, $args[2]) ) { list($r, $g, $b) = $args; - - } else + } else { return false; + } return imagecolorallocate($this->image, $r, $g, $b); } - protected function imageFilledRectangle($x1, $y1, $x2, $y2, $color) { + protected function imageFilledRectangle($x1, $y1, $x2, $y2, $color) + { $color = $this->gdColor($color); - if ($color === false) return false; + if ($color === false) { + return false; + } return imageFilledRectangle($this->image, $x1, $y1, $x2, $y2, $color); } @@ -338,15 +382,24 @@ protected function imageCopyResampled( ) { $imageDetails = $this->buildImage($src); - if ($imageDetails === false) + if ($imageDetails === false) { return false; + } list($src, $srcWidth, $srcHeight) = $imageDetails; - if (is_null($dstW)) $dstW = $this->width - $dstW; - if (is_null($dstH)) $dstH = $this->height - $dstY; - if (is_null($srcW)) $srcW = $srcWidth - $srcX; - if (is_null($srcH)) $srcH = $srcHeight - $srcY; + if (is_null($dstW)) { + $dstW = $this->width - $dstW; + } + if (is_null($dstH)) { + $dstH = $this->height - $dstY; + } + if (is_null($srcW)) { + $srcW = $srcWidth - $srcX; + } + if (is_null($srcH)) { + $srcH = $srcHeight - $srcY; + } return imageCopyResampled($this->image, $src, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH); } } diff --git a/manager/media/browser/mcpuk/lib/class_image_gmagick.php b/manager/media/browser/mcpuk/lib/class_image_gmagick.php index f67691f99b..c2cb3726f0 100755 --- a/manager/media/browser/mcpuk/lib/class_image_gmagick.php +++ b/manager/media/browser/mcpuk/lib/class_image_gmagick.php @@ -12,18 +12,23 @@ * @link http://kcfinder.sunhater.com */ -class image_gmagick extends image { - - static $MIMES = array( +class image_gmagick extends image +{ + public static $MIMES = array( //'tif' => "image/tiff" ); // ABSTRACT PUBLIC METHODS - public function resize($width, $height) {// - if (!$width) $width = 1; - if (!$height) $height = 1; + public function resize($width, $height) + {// + if (!$width) { + $width = 1; + } + if (!$height) { + $height = 1; + } try { $this->image->scaleImage($width, $height); } catch (Exception $e) { @@ -34,9 +39,14 @@ public function resize($width, $height) {// return true; } - public function resizeFit($width, $height, $background=false) {// - if (!$width) $width = 1; - if (!$height) $height = 1; + public function resizeFit($width, $height, $background=false) + {// + if (!$width) { + $width = 1; + } + if (!$height) { + $height = 1; + } try { $this->image->scaleImage($width, $height, true); @@ -50,7 +60,6 @@ public function resizeFit($width, $height, $background=false) {// $this->width = $w; $this->height = $h; return true; - } else { try { $this->image->setImageBackgroundColor($background); @@ -69,43 +78,57 @@ public function resizeFit($width, $height, $background=false) {// } } - public function resizeCrop($width, $height, $offset=false) { - if (!$width) $width = 1; - if (!$height) $height = 1; + public function resizeCrop($width, $height, $offset=false) + { + if (!$width) { + $width = 1; + } + if (!$height) { + $height = 1; + } if (($this->width / $this->height) > ($width / $height)) { $h = $height; $w = ($this->width * $h) / $this->height; $y = 0; if ($offset !== false) { - if ($offset > 0) + if ($offset > 0) { $offset = -$offset; - if (($w + $offset) <= $width) + } + if (($w + $offset) <= $width) { $offset = $width - $w; + } $x = $offset; - } else + } else { $x = ($width - $w) / 2; - + } } else { $w = $width; $h = ($this->height * $w) / $this->width; $x = 0; if ($offset !== false) { - if ($offset > 0) + if ($offset > 0) { $offset = -$offset; - if (($h + $offset) <= $height) + } + if (($h + $offset) <= $height) { $offset = $height - $h; + } $y = $offset; - } else + } else { $y = ($height - $h) / 2; + } } $x = round($x); $y = round($y); $w = round($w); $h = round($h); - if (!$w) $w = 1; - if (!$h) $h = 1; + if (!$w) { + $w = 1; + } + if (!$h) { + $h = 1; + } try { $this->image->scaleImage($w, $h); @@ -119,7 +142,8 @@ public function resizeCrop($width, $height, $offset=false) { return true; } - public function rotate($angle, $background="#000000") { + public function rotate($angle, $background="#000000") + { try { $this->image->rotateImage($background, $angle); $w = $this->image->getImageWidth(); @@ -132,7 +156,8 @@ public function rotate($angle, $background="#000000") { return true; } - public function flipHorizontal() { + public function flipHorizontal() + { try { $this->image->flopImage(); } catch (Exception $e) { @@ -141,7 +166,8 @@ public function flipHorizontal() { return true; } - public function flipVertical() { + public function flipVertical() + { try { $this->image->flipImage(); } catch (Exception $e) { @@ -150,7 +176,8 @@ public function flipVertical() { return true; } - public function watermark($file, $left=false, $top=false) { + public function watermark($file, $left=false, $top=false) + { try { $wm = new Gmagick($file); $w = $wm->getImageWidth(); @@ -171,8 +198,9 @@ public function watermark($file, $left=false, $top=false) { if ((($x + $w) > $this->width) || (($y + $h) > $this->height) || ($x < 0) || ($y < 0) - ) + ) { return false; + } try { $this->image->compositeImage($wm, 1, $x, $y); @@ -185,7 +213,8 @@ public function watermark($file, $left=false, $top=false) { // ABSTRACT PROTECTED METHODS - protected function getBlankImage($width, $height) { + protected function getBlankImage($width, $height) + { try { $img = new Gmagick(); $img->newImage($width, $height, "none"); @@ -195,13 +224,12 @@ protected function getBlankImage($width, $height) { return $img; } - protected function getImage($image, &$width, &$height) { - + protected function getImage($image, &$width, &$height) + { if (is_object($image) && ($image instanceof image_gmagick)) { $width = $image->width; $height = $image->height; return $image->image; - } elseif (is_object($image) && ($image instanceof Gmagick)) { try { $w = $image->getImageWidth(); @@ -212,7 +240,6 @@ protected function getImage($image, &$width, &$height) { $width = $w; $height = $h; return $image; - } elseif (is_string($image)) { try { $image = new Gmagick($image); @@ -224,19 +251,21 @@ protected function getImage($image, &$width, &$height) { $width = $w; $height = $h; return $image; - - } else + } else { return false; + } } // PSEUDO-ABSTRACT STATIC METHODS - static function available() { + public static function available() + { return class_exists("Gmagick"); } - static function checkImage($file) { + public static function checkImage($file) + { try { new Gmagick($file); } catch (Exception $e) { @@ -248,7 +277,8 @@ static function checkImage($file) { // INHERIT METHODS - public function output($type="jpeg", array $options=array()) { + public function output($type="jpeg", array $options=array()) + { $type = strtolower($type); try { $this->image->setImageFormat($type); @@ -256,8 +286,9 @@ public function output($type="jpeg", array $options=array()) { return false; } $method = "optimize_$type"; - if (method_exists($this, $method) && !$this->$method($options)) + if (method_exists($this, $method) && !$this->$method($options)) { return false; + } if (!isset($options['file'])) { if (!headers_sent()) { @@ -265,7 +296,6 @@ public function output($type="jpeg", array $options=array()) { header("Content-Type: $mime"); } echo $this->image; - } else { $file = $options['file'] . ".$type"; try { @@ -287,7 +317,8 @@ public function output($type="jpeg", array $options=array()) { // OWN METHODS - protected function optimize_jpeg(array $options=array()) { + protected function optimize_jpeg(array $options=array()) + { $quality = isset($options['quality']) ? $options['quality'] : self::DEFAULT_JPEG_QUALITY; try { $this->image->setCompressionQuality($quality); @@ -296,5 +327,4 @@ protected function optimize_jpeg(array $options=array()) { } return true; } - } diff --git a/manager/media/browser/mcpuk/lib/class_image_imagick.php b/manager/media/browser/mcpuk/lib/class_image_imagick.php index 0d576fa345..a64863f52c 100755 --- a/manager/media/browser/mcpuk/lib/class_image_imagick.php +++ b/manager/media/browser/mcpuk/lib/class_image_imagick.php @@ -12,18 +12,23 @@ * @link http://kcfinder.sunhater.com */ -class image_imagick extends image { - - static $MIMES = array( +class image_imagick extends image +{ + public static $MIMES = array( //'tif' => "image/tiff" ); // ABSTRACT PUBLIC METHODS - public function resize($width, $height) {// - if (!$width) $width = 1; - if (!$height) $height = 1; + public function resize($width, $height) + {// + if (!$width) { + $width = 1; + } + if (!$height) { + $height = 1; + } try { $this->image->scaleImage($width, $height); } catch (Exception $e) { @@ -34,9 +39,14 @@ public function resize($width, $height) {// return true; } - public function resizeFit($width, $height, $background=false) {// - if (!$width) $width = 1; - if (!$height) $height = 1; + public function resizeFit($width, $height, $background=false) + {// + if (!$width) { + $width = 1; + } + if (!$height) { + $height = 1; + } try { $this->image->scaleImage($width, $height, true); @@ -49,7 +59,6 @@ public function resizeFit($width, $height, $background=false) {// $this->width = $size['width']; $this->height = $size['height']; return true; - } else { try { $this->image->setImageBackgroundColor($background); @@ -65,43 +74,57 @@ public function resizeFit($width, $height, $background=false) {// } } - public function resizeCrop($width, $height, $offset=false) { - if (!$width) $width = 1; - if (!$height) $height = 1; + public function resizeCrop($width, $height, $offset=false) + { + if (!$width) { + $width = 1; + } + if (!$height) { + $height = 1; + } if (($this->width / $this->height) > ($width / $height)) { $h = $height; $w = ($this->width * $h) / $this->height; $y = 0; if ($offset !== false) { - if ($offset > 0) + if ($offset > 0) { $offset = -$offset; - if (($w + $offset) <= $width) + } + if (($w + $offset) <= $width) { $offset = $width - $w; + } $x = $offset; - } else + } else { $x = ($width - $w) / 2; - + } } else { $w = $width; $h = ($this->height * $w) / $this->width; $x = 0; if ($offset !== false) { - if ($offset > 0) + if ($offset > 0) { $offset = -$offset; - if (($h + $offset) <= $height) + } + if (($h + $offset) <= $height) { $offset = $height - $h; + } $y = $offset; - } else + } else { $y = ($height - $h) / 2; + } } $x = round($x); $y = round($y); $w = round($w); $h = round($h); - if (!$w) $w = 1; - if (!$h) $h = 1; + if (!$w) { + $w = 1; + } + if (!$h) { + $h = 1; + } try { $this->image->scaleImage($w, $h); @@ -115,7 +138,8 @@ public function resizeCrop($width, $height, $offset=false) { return true; } - public function rotate($angle, $background="#000000") { + public function rotate($angle, $background="#000000") + { try { $this->image->rotateImage(new ImagickPixel($background), $angle); $size = $this->image->getImageGeometry(); @@ -127,7 +151,8 @@ public function rotate($angle, $background="#000000") { return true; } - public function flipHorizontal() { + public function flipHorizontal() + { try { $this->image->flopImage(); } catch (Exception $e) { @@ -136,7 +161,8 @@ public function flipHorizontal() { return true; } - public function flipVertical() { + public function flipVertical() + { try { $this->image->flipImage(); } catch (Exception $e) { @@ -145,7 +171,8 @@ public function flipVertical() { return true; } - public function watermark($file, $left=false, $top=false) { + public function watermark($file, $left=false, $top=false) + { try { $wm = new Imagick($file); $size = $wm->getImageGeometry(); @@ -167,8 +194,9 @@ public function watermark($file, $left=false, $top=false) { if ((($x + $w) > $this->width) || (($y + $h) > $this->height) || ($x < 0) || ($y < 0) - ) + ) { return false; + } try { $this->image->compositeImage($wm, Imagick::COMPOSITE_DEFAULT, $x, $y); @@ -181,7 +209,8 @@ public function watermark($file, $left=false, $top=false) { // ABSTRACT PROTECTED METHODS - protected function getBlankImage($width, $height) { + protected function getBlankImage($width, $height) + { try { $img = new Imagick(); $img->newImage($width, $height, "none"); @@ -192,8 +221,8 @@ protected function getBlankImage($width, $height) { return $img; } - protected function getImage($image, &$width, &$height) { - + protected function getImage($image, &$width, &$height) + { if (is_object($image) && ($image instanceof image_imagick)) { try { $image->image->setImageCompressionQuality(100); @@ -203,7 +232,6 @@ protected function getImage($image, &$width, &$height) { $width = $image->width; $height = $image->height; return $image->image; - } elseif (is_object($image) && ($image instanceof Imagick)) { try { $image->setImageCompressionQuality(100); @@ -214,7 +242,6 @@ protected function getImage($image, &$width, &$height) { $width = $size['width']; $height = $size['height']; return $image; - } elseif (is_string($image)) { try { $image = new Imagick($image); @@ -226,19 +253,21 @@ protected function getImage($image, &$width, &$height) { $width = $size['width']; $height = $size['height']; return $image; - - } else + } else { return false; + } } // PSEUDO-ABSTRACT STATIC METHODS - static function available() { + public static function available() + { return class_exists("Imagick"); } - static function checkImage($file) { + public static function checkImage($file) + { try { new Imagick($file); } catch (Exception $e) { @@ -250,7 +279,8 @@ static function checkImage($file) { // INHERIT METHODS - public function output($type="jpeg", array $options=array()) { + public function output($type="jpeg", array $options=array()) + { $type = strtolower($type); try { $this->image->setImageFormat($type); @@ -258,8 +288,9 @@ public function output($type="jpeg", array $options=array()) { return false; } $method = "optimize_$type"; - if (method_exists($this, $method) && !$this->$method($options)) + if (method_exists($this, $method) && !$this->$method($options)) { return false; + } if (!isset($options['file'])) { if (!headers_sent()) { @@ -267,7 +298,6 @@ public function output($type="jpeg", array $options=array()) { header("Content-Type: $mime"); } echo $this->image; - } else { $file = $options['file'] . ".$type"; try { @@ -289,7 +319,8 @@ public function output($type="jpeg", array $options=array()) { // OWN METHODS - protected function optimize_jpeg(array $options=array()) { + protected function optimize_jpeg(array $options=array()) + { $quality = isset($options['quality']) ? $options['quality'] : self::DEFAULT_JPEG_QUALITY; try { $this->image->setImageCompression(Imagick::COMPRESSION_JPEG); @@ -299,5 +330,4 @@ protected function optimize_jpeg(array $options=array()) { } return true; } - } diff --git a/manager/media/browser/mcpuk/lib/class_input.php b/manager/media/browser/mcpuk/lib/class_input.php index 36917217ad..84f20b0721 100755 --- a/manager/media/browser/mcpuk/lib/class_input.php +++ b/manager/media/browser/mcpuk/lib/class_input.php @@ -12,31 +12,34 @@ * @link http://kcfinder.sunhater.com */ -class input { +class input +{ /** Filtered $_GET array * @var array */ public $get; - /** Filtered $_POST array - * @var array */ + /** Filtered $_POST array + * @var array */ public $post; - /** Filtered $_COOKIE array - * @var array */ + /** Filtered $_COOKIE array + * @var array */ public $cookie; - public function __construct() { + public function __construct() + { $this->get = &$_GET; $this->post = &$_POST; $this->cookie = &$_COOKIE; } - /** Magic method to get non-public properties like public. - * @param string $property - * @return mixed */ + /** Magic method to get non-public properties like public. + * @param string $property + * @return mixed */ - public function __get($property) { + public function __get($property) + { return property_exists($this, $property) ? $this->$property : null; } } diff --git a/manager/media/browser/mcpuk/lib/class_zipFolder.php b/manager/media/browser/mcpuk/lib/class_zipFolder.php index a5d469f7ab..87f17f3b0a 100755 --- a/manager/media/browser/mcpuk/lib/class_zipFolder.php +++ b/manager/media/browser/mcpuk/lib/class_zipFolder.php @@ -13,20 +13,23 @@ * @link http://kcfinder.sunhater.com */ -class zipFolder { +class zipFolder +{ protected $zip; protected $root; protected $ignored; - function __construct($file, $folder, $ignored=null) { + public function __construct($file, $folder, $ignored=null) + { $this->zip = new ZipArchive(); $this->ignored = is_array($ignored) ? $ignored : ($ignored ? array($ignored) : array()); - if ($this->zip->open($file, ZIPARCHIVE::CREATE) !== TRUE) + if ($this->zip->open($file, ZIPARCHIVE::CREATE) !== true) { throw new Exception("cannot open <$file>\n"); + } $folder = rtrim($folder, '/'); @@ -39,20 +42,23 @@ function __construct($file, $folder, $ignored=null) { $this->zip->close(); } - function zip($folder, $parent=null) { + public function zip($folder, $parent=null) + { $full_path = "{$this->root}$parent$folder"; $zip_path = "$parent$folder"; $this->zip->addEmptyDir($zip_path); $dir = new DirectoryIterator($full_path); - foreach ($dir as $file) + foreach ($dir as $file) { if (!$file->isDot()) { $filename = $file->getFilename(); if (!in_array($filename, $this->ignored)) { - if ($file->isDir()) + if ($file->isDir()) { $this->zip($filename, "$zip_path/"); - else + } else { $this->zip->addFile("$full_path/$filename", "$zip_path/$filename"); + } } } + } } } diff --git a/manager/media/browser/mcpuk/lib/helper_dir.php b/manager/media/browser/mcpuk/lib/helper_dir.php index 2f61f2ebe8..800535f990 100755 --- a/manager/media/browser/mcpuk/lib/helper_dir.php +++ b/manager/media/browser/mcpuk/lib/helper_dir.php @@ -12,44 +12,52 @@ * @link http://kcfinder.sunhater.com */ -class dir { +class dir +{ /** Checks if the given directory is really writable. The standard PHP * function is_writable() does not work properly on Windows servers * @param string $dir * @return bool */ - static function isWritable($dir) { + public static function isWritable($dir) + { $dir = path::normalize($dir); - if (!is_dir($dir)) + if (!is_dir($dir)) { return false; + } $i = 0; do { $file = "$dir/is_writable_" . md5($i++); } while (file_exists($file)); - if (!@touch($file)) + if (!@touch($file)) { return false; + } unlink($file); return true; } - /** Recursively delete the given directory. Returns TRUE on success. - * If $firstFailExit parameter is true (default), the method returns the - * path to the first failed file or directory which cannot be deleted. - * If $firstFailExit is false, the method returns an array with failed - * files and directories which cannot be deleted. The third parameter - * $failed is used for internal use only. - * @param string $dir - * @param bool $firstFailExit - * @param array $failed - * @return mixed */ - - static function prune($dir, $firstFailExit=true, array $failed=null) { - if ($failed === null) $failed = array(); + /** Recursively delete the given directory. Returns TRUE on success. + * If $firstFailExit parameter is true (default), the method returns the + * path to the first failed file or directory which cannot be deleted. + * If $firstFailExit is false, the method returns an array with failed + * files and directories which cannot be deleted. The third parameter + * $failed is used for internal use only. + * @param string $dir + * @param bool $firstFailExit + * @param array $failed + * @return mixed */ + + public static function prune($dir, $firstFailExit=true, array $failed=null) + { + if ($failed === null) { + $failed = array(); + } $files = self::content($dir); if ($files === false) { - if ($firstFailExit) + if ($firstFailExit) { return $dir; + } $failed[] = $dir; return $failed; } @@ -58,37 +66,41 @@ static function prune($dir, $firstFailExit=true, array $failed=null) { if (is_dir($file)) { $failed_in = self::prune($file, $firstFailExit, $failed); if ($failed_in !== true) { - if ($firstFailExit) + if ($firstFailExit) { return $failed_in; - if (is_array($failed_in)) + } + if (is_array($failed_in)) { $failed = array_merge($failed, $failed_in); - else + } else { $failed[] = $failed_in; + } } } elseif (!@unlink($file)) { - if ($firstFailExit) + if ($firstFailExit) { return $file; + } $failed[] = $file; } } if (!@rmdir($dir)) { - if ($firstFailExit) + if ($firstFailExit) { return $dir; + } $failed[] = $dir; } return count($failed) ? $failed : true; } - /** Get the content of the given directory. Returns an array with filenames - * or FALSE on failure - * @param string $dir - * @param array $options - * @return mixed */ - - static function content($dir, array $options=null) { + /** Get the content of the given directory. Returns an array with filenames + * or FALSE on failure + * @param string $dir + * @param array $options + * @return mixed */ + public static function content($dir, array $options=null) + { $defaultOptions = array( 'types' => "all", // Allowed: "all" or possible return values // of filetype(), or an array with them @@ -97,23 +109,29 @@ static function content($dir, array $options=null) { 'followLinks' => true ); - if (!is_dir($dir) || !is_readable($dir)) + if (!is_dir($dir) || !is_readable($dir)) { return false; + } - if (strtoupper(substr(PHP_OS, 0, 3)) == "WIN") + if (strtoupper(substr(PHP_OS, 0, 3)) == "WIN") { $dir = str_replace("\\", "/", $dir); + } $dir = rtrim($dir, "/"); $dh = @opendir($dir); - if ($dh === false) + if ($dh === false) { return false; + } - if ($options === null) + if ($options === null) { $options = $defaultOptions; + } - foreach ($defaultOptions as $key => $val) - if (!isset($options[$key])) + foreach ($defaultOptions as $key => $val) { + if (!isset($options[$key])) { $options[$key] = $val; + } + } $files = array(); while (($file = @readdir($dh)) !== false) { @@ -124,28 +142,32 @@ static function content($dir, array $options=null) { do { $ldir = dirname($lfile); $lfile = @readlink($lfile); - if (substr($lfile, 0, 1) != "/") + if (substr($lfile, 0, 1) != "/") { $lfile = "$ldir/$lfile"; + } $type = filetype($lfile); } while ($type == "link"); } if ((($type === "dir") && (($file == ".") || ($file == ".."))) || !preg_match($options['pattern'], $file) - ) + ) { continue; + } if (($options['types'] === "all") || ($type === $options['types']) || ((is_array($options['types'])) && in_array($type, $options['types'])) - ) + ) { $files[] = $options['addPath'] ? "$dir/$file" : $file; + } } closedir($dh); usort($files, array("dir", "fileSort")); return $files; } - static function fileSort($a, $b) { + public static function fileSort($a, $b) + { if (function_exists("mb_strtolower")) { $a = mb_strtolower($a); $b = mb_strtolower($b); @@ -153,7 +175,9 @@ static function fileSort($a, $b) { $a = strtolower($a); $b = strtolower($b); } - if ($a == $b) return 0; + if ($a == $b) { + return 0; + } return ($a < $b) ? -1 : 1; } } diff --git a/manager/media/browser/mcpuk/lib/helper_file.php b/manager/media/browser/mcpuk/lib/helper_file.php index 1f0200bcd7..73ef8b5fb0 100755 --- a/manager/media/browser/mcpuk/lib/helper_file.php +++ b/manager/media/browser/mcpuk/lib/helper_file.php @@ -12,9 +12,9 @@ * @link http://kcfinder.sunhater.com */ -class file { - - static $MIME = array( +class file +{ + public static $MIME = array( 'ai' => 'application/postscript', 'aif' => 'audio/x-aiff', 'aifc' => 'audio/x-aiff', @@ -100,41 +100,45 @@ class file { 'zip' => 'application/x-zip' ); - /** Checks if the given file is really writable. The standard PHP function - * is_writable() does not work properly on Windows servers. - * @param string $dir - * @return bool */ + /** Checks if the given file is really writable. The standard PHP function + * is_writable() does not work properly on Windows servers. + * @param string $dir + * @return bool */ - static function isWritable($filename) { + public static function isWritable($filename) + { $filename = path::normalize($filename); - if (!is_file($filename) || (false === ($fp = @fopen($filename, 'a+')))) + if (!is_file($filename) || (false === ($fp = @fopen($filename, 'a+')))) { return false; + } fclose($fp); return true; } - /** Get the extension from filename - * @param string $file - * @param bool $toLower - * @return string */ + /** Get the extension from filename + * @param string $file + * @param bool $toLower + * @return string */ - static function getExtension($filename, $toLower=true) { + public static function getExtension($filename, $toLower=true) + { return preg_match('/^.*\.([^\.]*)$/s', $filename, $patt) ? ($toLower ? strtolower($patt[1]) : $patt[1]) : ""; } - /** Get MIME type of the given filename. If Fileinfo PHP extension is - * available the MIME type will be fetched by the file's content. The - * second parameter is optional and defines the magic file path. If you - * skip it, the default one will be loaded. - * If Fileinfo PHP extension is not available the MIME type will be fetched - * by filename extension regarding $MIME property. If the file extension - * does not exist there, returned type will be application/octet-stream - * @param string $filename - * @param string $magic - * @return string */ + /** Get MIME type of the given filename. If Fileinfo PHP extension is + * available the MIME type will be fetched by the file's content. The + * second parameter is optional and defines the magic file path. If you + * skip it, the default one will be loaded. + * If Fileinfo PHP extension is not available the MIME type will be fetched + * by filename extension regarding $MIME property. If the file extension + * does not exist there, returned type will be application/octet-stream + * @param string $filename + * @param string $magic + * @return string */ - static function getMimeType($filename, $magic=null) { + public static function getMimeType($filename, $magic=null) + { if (class_exists("finfo")) { $finfo = ($magic === null) ? new finfo(FILEINFO_MIME) @@ -149,33 +153,36 @@ static function getMimeType($filename, $magic=null) { return isset(self::$MIME[$ext]) ? self::$MIME[$ext] : "application/octet-stream"; } - /** Get inexistant filename based on the given filename. If you skip $dir - * parameter the directory will be fetched from $filename and returned - * value will be full filename path. The third parameter is optional and - * defines the template, the filename will be renamed to. Default template - * is {name}({sufix}){ext}. Examples: - * - * file::getInexistantFilename("/my/directory/myfile.txt"); - * If myfile.txt does not exist - returns the same path to the file - * otherwise returns "/my/directory/myfile(1).txt" - * - * file::getInexistantFilename("myfile.txt", "/my/directory"); - * returns "myfile.txt" or "myfile(1).txt" or "myfile(2).txt" etc... - * - * file::getInexistantFilename("myfile.txt", "/dir", "{name}[{sufix}]{ext}"); - * returns "myfile.txt" or "myfile[1].txt" or "myfile[2].txt" etc... - * - * @param string $filename - * @param string $dir - * @param string $tpl - * @return string */ + /** Get inexistant filename based on the given filename. If you skip $dir + * parameter the directory will be fetched from $filename and returned + * value will be full filename path. The third parameter is optional and + * defines the template, the filename will be renamed to. Default template + * is {name}({sufix}){ext}. Examples: + * + * file::getInexistantFilename("/my/directory/myfile.txt"); + * If myfile.txt does not exist - returns the same path to the file + * otherwise returns "/my/directory/myfile(1).txt" + * + * file::getInexistantFilename("myfile.txt", "/my/directory"); + * returns "myfile.txt" or "myfile(1).txt" or "myfile(2).txt" etc... + * + * file::getInexistantFilename("myfile.txt", "/dir", "{name}[{sufix}]{ext}"); + * returns "myfile.txt" or "myfile[1].txt" or "myfile[2].txt" etc... + * + * @param string $filename + * @param string $dir + * @param string $tpl + * @return string */ - static function getInexistantFilename($filename, $dir=null, $tpl=null) { - if ($tpl === null) $tpl = "{name}({sufix}){ext}"; + public static function getInexistantFilename($filename, $dir=null, $tpl=null) + { + if ($tpl === null) { + $tpl = "{name}({sufix}){ext}"; + } $fullPath = ($dir === null); - if ($fullPath) + if ($fullPath) { $dir = path::normalize(dirname($filename)); - else { + } else { $fdir = dirname($filename); $dir = strlen($fdir) ? path::normalize("$dir/$fdir") @@ -186,9 +193,11 @@ static function getInexistantFilename($filename, $dir=null, $tpl=null) { $name = strlen($ext) ? substr($filename, 0, -strlen($ext) - 1) : $filename; $tpl = str_replace('{name}', $name, $tpl); $tpl = str_replace('{ext}', (strlen($ext) ? ".$ext" : ""), $tpl); - $i = 1; $file = "$dir/$filename"; - while (file_exists($file)) + $i = 1; + $file = "$dir/$filename"; + while (file_exists($file)) { $file = "$dir/" . str_replace('{sufix}', $i++, $tpl); + } return $fullPath ? $file @@ -196,5 +205,4 @@ static function getInexistantFilename($filename, $dir=null, $tpl=null) { ? "$fdir/" . basename($file) : basename($file)); } - } diff --git a/manager/media/browser/mcpuk/lib/helper_httpCache.php b/manager/media/browser/mcpuk/lib/helper_httpCache.php index 2dd660c6d0..fcb864451a 100755 --- a/manager/media/browser/mcpuk/lib/helper_httpCache.php +++ b/manager/media/browser/mcpuk/lib/helper_httpCache.php @@ -12,45 +12,58 @@ * @link http://kcfinder.sunhater.com */ -class httpCache { +class httpCache +{ const DEFAULT_TYPE = "text/html"; const DEFAULT_EXPIRE = 604800; // in seconds - /** Cache a file. The $type parameter might define the MIME type of the file - * or path to magic file to autodetect the MIME type. If you skip $type - * parameter the method will try with the default magic file. Autodetection - * of MIME type requires Fileinfo PHP extension used in file::getMimeType() - * @param string $file - * @param string $type - * @param integer $expire - * @param array $headers */ + /** Cache a file. The $type parameter might define the MIME type of the file + * or path to magic file to autodetect the MIME type. If you skip $type + * parameter the method will try with the default magic file. Autodetection + * of MIME type requires Fileinfo PHP extension used in file::getMimeType() + * @param string $file + * @param string $type + * @param integer $expire + * @param array $headers */ - static function file($file, $type=null, $expire=null, array $headers=null) { + public static function file($file, $type=null, $expire=null, array $headers=null) + { $mtime = @filemtime($file); - if ($mtime !== false) self::checkMTime($mtime); + if ($mtime !== false) { + self::checkMTime($mtime); + } if ($type === null) { $magic = ((substr($type, 0, 1) == "/") || preg_match('/^[a-z]\:/i', $type)) ? $type : null; $type = file::getMimeType($file, $magic); - if (!$type) $type = null; + if (!$type) { + $type = null; + } } self::content(@file_get_contents($file), $mtime, $type, $expire, $headers, false); } - /** Cache the given $content with $mtime modification time. - * @param binary $content - * @param integer $mtime - * @param string $type - * @param integer $expire - * @param array $headers - * @param bool $checkMTime */ + /** Cache the given $content with $mtime modification time. + * @param binary $content + * @param integer $mtime + * @param string $type + * @param integer $expire + * @param array $headers + * @param bool $checkMTime */ - static function content($content, $mtime, $type=null, $expire=null, array $headers=null, $checkMTime=true) { - if ($checkMTime) self::checkMTime($mtime); - if ($type === null) $type = self::DEFAULT_TYPE; - if ($expire === null) $expire = self::DEFAULT_EXPIRE; + public static function content($content, $mtime, $type=null, $expire=null, array $headers=null, $checkMTime=true) + { + if ($checkMTime) { + self::checkMTime($mtime); + } + if ($type === null) { + $type = self::DEFAULT_TYPE; + } + if ($expire === null) { + $expire = self::DEFAULT_EXPIRE; + } $size = strlen($content); $expires = gmdate("D, d M Y H:i:s", time() + $expire) . " GMT"; header("Content-Type: $type"); @@ -58,17 +71,22 @@ static function content($content, $mtime, $type=null, $expire=null, array $heade header("Cache-Control: max-age=$expire"); header("Pragma: !invalid"); header("Content-Length: $size"); - if ($headers !== null) foreach ($headers as $header) header($header); + if ($headers !== null) { + foreach ($headers as $header) { + header($header); + } + } echo $content; } - /** Check if given modification time is newer than client-side one. If not, - * the method will tell the client to get the content from its own cache. - * Afterwards the script process will be terminated. This feature requires - * the PHP to be configured as Apache module. - * @param integer $mtime */ + /** Check if given modification time is newer than client-side one. If not, + * the method will tell the client to get the content from its own cache. + * Afterwards the script process will be terminated. This feature requires + * the PHP to be configured as Apache module. + * @param integer $mtime */ - static function checkMTime($mtime, $sendHeaders=null) { + public static function checkMTime($mtime, $sendHeaders=null) + { header("Last-Modified: " . gmdate("D, d M Y H:i:s", $mtime) . " GMT"); $headers = function_exists("getallheaders") @@ -82,11 +100,13 @@ static function checkMTime($mtime, $sendHeaders=null) { $client_mtime = @strtotime($client_mtime[0]); if ($client_mtime >= $mtime) { header('HTTP/1.1 304 Not Modified'); - if (is_array($sendHeaders) && count($sendHeaders)) - foreach ($sendHeaders as $header) + if (is_array($sendHeaders) && count($sendHeaders)) { + foreach ($sendHeaders as $header) { header($header); - elseif ($sendHeaders !== null) + } + } elseif ($sendHeaders !== null) { header($sendHeaders); + } die; diff --git a/manager/media/browser/mcpuk/lib/helper_path.php b/manager/media/browser/mcpuk/lib/helper_path.php index 04e9de087b..7e5078f5bd 100755 --- a/manager/media/browser/mcpuk/lib/helper_path.php +++ b/manager/media/browser/mcpuk/lib/helper_path.php @@ -12,39 +12,47 @@ * @link http://kcfinder.sunhater.com */ -class path { +class path +{ /** Get the absolute URL path of the given one. Returns FALSE if the URL * is not valid or the current directory cannot be resolved (getcwd()) * @param string $path * @return string */ - static function rel2abs_url($path) { - if (substr($path, 0, 1) == "/") return $path; + public static function rel2abs_url($path) + { + if (substr($path, 0, 1) == "/") { + return $path; + } $dir = @getcwd(); - if (!isset($_SERVER['DOCUMENT_ROOT']) || ($dir === false)) + if (!isset($_SERVER['DOCUMENT_ROOT']) || ($dir === false)) { return false; + } $dir = self::normalize($dir); $doc_root = self::normalize($_SERVER['DOCUMENT_ROOT']); - if (substr($dir, 0, strlen($doc_root)) != $doc_root) + if (substr($dir, 0, strlen($doc_root)) != $doc_root) { return false; + } $return = self::normalize(substr($dir, strlen($doc_root)) . "/$path"); - if (substr($return, 0, 1) !== "/") + if (substr($return, 0, 1) !== "/") { $return = "/$return"; + } return $return; } - /** Resolve full filesystem path of given URL. Returns FALSE if the URL - * cannot be resolved - * @param string $url - * @return string */ + /** Resolve full filesystem path of given URL. Returns FALSE if the URL + * cannot be resolved + * @param string $url + * @return string */ - static function url2fullPath($url) { + public static function url2fullPath($url) + { $url = self::normalize($url); $uri = isset($_SERVER['SCRIPT_NAME']) @@ -55,15 +63,18 @@ static function url2fullPath($url) { $uri = self::normalize($uri); if (substr($url, 0, 1) !== "/") { - if ($uri === false) return false; + if ($uri === false) { + return false; + } $url = dirname($uri) . "/$url"; } if (isset($_SERVER['DOCUMENT_ROOT'])) { return self::normalize($_SERVER['DOCUMENT_ROOT'] . "/$url"); - } else { - if ($uri === false) return false; + if ($uri === false) { + return false; + } if (isset($_SERVER['SCRIPT_FILENAME'])) { $scr_filename = self::normalize($_SERVER['SCRIPT_FILENAME']); @@ -71,71 +82,84 @@ static function url2fullPath($url) { } $count = count(explode('/', $uri)) - 1; - for ($i = 0, $chdir = ""; $i < $count; $i++) + for ($i = 0, $chdir = ""; $i < $count; $i++) { $chdir .= "../"; + } $chdir = self::normalize($chdir); $dir = getcwd(); - if (($dir === false) || !@chdir($chdir)) + if (($dir === false) || !@chdir($chdir)) { return false; + } $rdir = getcwd(); chdir($dir); return ($rdir !== false) ? self::normalize($rdir . "/$url") : false; } } - /** Normalize the given path. On Windows servers backslash will be replaced - * with slash. Remobes unnecessary doble slashes and double dots. Removes - * last slash if it exists. Examples: - * path::normalize("C:\\any\\path\\") returns "C:/any/path" - * path::normalize("/your/path/..//home/") returns "/your/home" - * @param string $path - * @return string */ + /** Normalize the given path. On Windows servers backslash will be replaced + * with slash. Remobes unnecessary doble slashes and double dots. Removes + * last slash if it exists. Examples: + * path::normalize("C:\\any\\path\\") returns "C:/any/path" + * path::normalize("/your/path/..//home/") returns "/your/home" + * @param string $path + * @return string */ - static function normalize($path) { + public static function normalize($path) + { if (strtoupper(substr(PHP_OS, 0, 3)) == "WIN") { $path = preg_replace('/([^\\\])\\\([^\\\])/', "$1/$2", $path); - if (substr($path, -1) == "\\") $path = substr($path, 0, -1); - if (substr($path, 0, 1) == "\\") $path = "/" . substr($path, 1); + if (substr($path, -1) == "\\") { + $path = substr($path, 0, -1); + } + if (substr($path, 0, 1) == "\\") { + $path = "/" . substr($path, 1); + } } $path = preg_replace('/\/+/s', "/", $path); $path = "/$path"; - if (substr($path, -1) != "/") + if (substr($path, -1) != "/") { $path .= "/"; + } $expr = '/\/([^\/]{1}|[^\.\/]{2}|[^\/]{3,})\/\.\.\//s'; - while (preg_match($expr, $path)) + while (preg_match($expr, $path)) { $path = preg_replace($expr, "/", $path); + } $path = substr($path, 0, -1); $path = substr($path, 1); return $path; } - /** Encode URL Path - * @param string $path - * @return string */ + /** Encode URL Path + * @param string $path + * @return string */ - static function urlPathEncode($path) { + public static function urlPathEncode($path) + { $path = self::normalize($path); $encoded = ""; - foreach (explode("/", $path) as $dir) + foreach (explode("/", $path) as $dir) { $encoded .= rawurlencode($dir) . "/"; + } $encoded = substr($encoded, 0, -1); return $encoded; } - /** Decode URL Path - * @param string $path - * @return string */ + /** Decode URL Path + * @param string $path + * @return string */ - static function urlPathDecode($path) { + public static function urlPathDecode($path) + { $path = self::normalize($path); $decoded = ""; - foreach (explode("/", $path) as $dir) + foreach (explode("/", $path) as $dir) { $decoded .= rawurldecode($dir) . "/"; + } $decoded = substr($decoded, 0, -1); return $decoded; } diff --git a/manager/media/browser/mcpuk/lib/helper_text.php b/manager/media/browser/mcpuk/lib/helper_text.php index 8cecc353d1..0d03082554 100755 --- a/manager/media/browser/mcpuk/lib/helper_text.php +++ b/manager/media/browser/mcpuk/lib/helper_text.php @@ -12,21 +12,24 @@ * @link http://kcfinder.sunhater.com */ -class text { +class text +{ /** Replace repeated white spaces to single space * @param string $string * @return string */ - static function clearWhitespaces($string) { + public static function clearWhitespaces($string) + { return trim(preg_replace('/\s+/s', " ", $string)); } - /** Normalize the string for HTML attribute value - * @param string $string - * @return string */ + /** Normalize the string for HTML attribute value + * @param string $string + * @return string */ - static function htmlValue($string) { + public static function htmlValue($string) + { return str_replace('"', """, str_replace("'", ''', @@ -35,11 +38,12 @@ static function htmlValue($string) { $string)))); } - /** Normalize the string for JavaScript string value - * @param string $string - * @return string */ + /** Normalize the string for JavaScript string value + * @param string $string + * @return string */ - static function jsValue($string) { + public static function jsValue($string) + { return preg_replace('/\r?\n/', "\\n", str_replace('"', "\\\"", @@ -48,22 +52,25 @@ static function jsValue($string) { $string)))); } - /** Normalize the string for XML tag content data - * @param string $string - * @param bool $cdata */ + /** Normalize the string for XML tag content data + * @param string $string + * @param bool $cdata */ - static function xmlData($string, $cdata=false) { + public static function xmlData($string, $cdata=false) + { $string = str_replace("]]>", "]]]]>", $string); - if (!$cdata) + if (!$cdata) { $string = ""; + } return $string; } - /** Returns compressed content of given CSS code - * @param string $code - * @return string */ + /** Returns compressed content of given CSS code + * @param string $code + * @return string */ - static function compressCSS($code) { + public static function compressCSS($code) + { $code = self::clearWhitespaces($code); $code = preg_replace('/ ?\{ ?/', "{", $code); $code = preg_replace('/ ?\} ?/', "}", $code); diff --git a/manager/media/browser/mcpuk/tpl/tpl_browser.php b/manager/media/browser/mcpuk/tpl/tpl_browser.php index e16bcfb396..caa1560b53 100755 --- a/manager/media/browser/mcpuk/tpl/tpl_browser.php +++ b/manager/media/browser/mcpuk/tpl/tpl_browser.php @@ -4,8 +4,8 @@ KCFinder: / <?php echo $this->session['dir'] ?> - - + + diff --git a/manager/media/browser/mcpuk/tpl/tpl_css.php b/manager/media/browser/mcpuk/tpl/tpl_css.php index dbf5d58e97..baf4171682 100755 --- a/manager/media/browser/mcpuk/tpl/tpl_css.php +++ b/manager/media/browser/mcpuk/tpl/tpl_css.php @@ -1,2 +1,2 @@ -cms}" : "" ) ?>" rel="stylesheet" type="text/css" /> +cms}" : "") ?>" rel="stylesheet" type="text/css" /> diff --git a/manager/media/browser/mcpuk/tpl/tpl_javascript.php b/manager/media/browser/mcpuk/tpl/tpl_javascript.php index d43aa8f8b7..b90a26b1c9 100755 --- a/manager/media/browser/mcpuk/tpl/tpl_javascript.php +++ b/manager/media/browser/mcpuk/tpl/tpl_javascript.php @@ -4,12 +4,12 @@ -opener['TinyMCE']) && $this->opener['TinyMCE']): ?> +opener['TinyMCE']) && $this->opener['TinyMCE']): ?> - -config['theme']}/init.js")): ?> + +config['theme']}/init.js")): ?> - + "; - } else { - echo $msg . "\n"; - } +function jsAlert($msg) +{ + $modx = evolutionCMS(); + if ($_POST['ajax'] != 1) { + echo ""; + } else { + echo $msg . "\n"; + } } /** @@ -311,9 +312,10 @@ function jsAlert($msg) { * @param string $dbasePassword * @return bool */ -function login($username, $givenPassword, $dbasePassword) { - $modx = evolutionCMS(); - return $modx->phpass->CheckPassword($givenPassword, $dbasePassword); +function login($username, $givenPassword, $dbasePassword) +{ + $modx = evolutionCMS(); + return $modx->phpass->CheckPassword($givenPassword, $dbasePassword); } /** @@ -323,27 +325,28 @@ function login($username, $givenPassword, $dbasePassword) { * @param string $username * @return bool */ -function loginV1($internalKey, $givenPassword, $dbasePassword, $username) { - $modx = evolutionCMS(); +function loginV1($internalKey, $givenPassword, $dbasePassword, $username) +{ + $modx = evolutionCMS(); - $user_algo = $modx->manager->getV1UserHashAlgorithm($internalKey); + $user_algo = $modx->manager->getV1UserHashAlgorithm($internalKey); - if(!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) { - $modx->config['pwd_hash_algo'] = 'UNCRYPT'; - } + if (!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) { + $modx->config['pwd_hash_algo'] = 'UNCRYPT'; + } - if($user_algo !== $modx->config['pwd_hash_algo']) { - $bk_pwd_hash_algo = $modx->config['pwd_hash_algo']; - $modx->config['pwd_hash_algo'] = $user_algo; - } + if ($user_algo !== $modx->config['pwd_hash_algo']) { + $bk_pwd_hash_algo = $modx->config['pwd_hash_algo']; + $modx->config['pwd_hash_algo'] = $user_algo; + } - if($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) { - return false; - } + if ($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) { + return false; + } - updateNewHash($username, $givenPassword); + updateNewHash($username, $givenPassword); - return true; + return true; } /** @@ -353,26 +356,28 @@ function loginV1($internalKey, $givenPassword, $dbasePassword, $username) { * @param string $username * @return bool */ -function loginMD5($internalKey, $givenPassword, $dbasePassword, $username) { - $modx = evolutionCMS(); - - if($dbasePassword != md5($givenPassword)) { - return false; - } - updateNewHash($username, $givenPassword); - return true; +function loginMD5($internalKey, $givenPassword, $dbasePassword, $username) +{ + $modx = evolutionCMS(); + + if ($dbasePassword != md5($givenPassword)) { + return false; + } + updateNewHash($username, $givenPassword); + return true; } /** * @param string $username * @param string $password */ -function updateNewHash($username, $password) { - $modx = evolutionCMS(); +function updateNewHash($username, $password) +{ + $modx = evolutionCMS(); - $field = array(); - $field['password'] = $modx->phpass->HashPassword($password); - $modx->db->update($field, '[+prefix+]manager_users', "username='{$username}'"); + $field = array(); + $field['password'] = $modx->phpass->HashPassword($password); + $modx->db->update($field, '[+prefix+]manager_users', "username='{$username}'"); } /** @@ -381,28 +386,29 @@ function updateNewHash($username, $password) { * @param int $failed_allowed * @param int $blocked_minutes */ -function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes) { - $modx = evolutionCMS(); - - $failedlogins += 1; - - $fields = array('failedlogincount' => $failedlogins); - if($failedlogins >= $failed_allowed) //block user for too many fail attempts - { - $fields['blockeduntil'] = time() + ($blocked_minutes * 60); - } - - $modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'"); - - if($failedlogins < $failed_allowed) { - //sleep to help prevent brute force attacks - $sleep = (int) $failedlogins / 2; - if($sleep > 5) { - $sleep = 5; - } - sleep($sleep); - } - @session_destroy(); - session_unset(); - return; +function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes) +{ + $modx = evolutionCMS(); + + $failedlogins += 1; + + $fields = array('failedlogincount' => $failedlogins); + if ($failedlogins >= $failed_allowed) { //block user for too many fail attempts + + $fields['blockeduntil'] = time() + ($blocked_minutes * 60); + } + + $modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'"); + + if ($failedlogins < $failed_allowed) { + //sleep to help prevent brute force attacks + $sleep = (int) $failedlogins / 2; + if ($sleep > 5) { + $sleep = 5; + } + sleep($sleep); + } + @session_destroy(); + session_unset(); + return; } diff --git a/manager/processors/logout.processor.php b/manager/processors/logout.processor.php index 7af6ff4518..d69b6d6900 100755 --- a/manager/processors/logout.processor.php +++ b/manager/processors/logout.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } @@ -9,10 +9,10 @@ // invoke OnBeforeManagerLogout event $modx->invokeEvent("OnBeforeManagerLogout", - array( - "userid" => $internalKey, - "username" => $username - )); + array( + "userid" => $internalKey, + "username" => $username + )); //// Unset all of the session variables. //$_SESSION = array(); @@ -35,10 +35,10 @@ // invoke OnManagerLogout event $modx->invokeEvent("OnManagerLogout", - array( - "userid" => $internalKey, - "username" => $username - )); + array( + "userid" => $internalKey, + "username" => $username + )); // show login screen header('Location: ' . MODX_MANAGER_URL); diff --git a/manager/processors/move_document.processor.php b/manager/processors/move_document.processor.php index c0a8c390fd..d7fb93b55e 100755 --- a/manager/processors/move_document.processor.php +++ b/manager/processors/move_document.processor.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('edit_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('edit_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $newParentID = isset($_REQUEST['new_parent']) ? (int)$_REQUEST['new_parent'] : 0; @@ -12,12 +12,20 @@ // ok, two things to check. // first, document cannot be moved to itself // second, new parent must be a folder. If not, set it to folder. -if($documentID==$newParentID) $modx->webAlertAndQuit($_lang["error_movedocument1"]); -if($documentID <= 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]); -if($newParentID < 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]); +if ($documentID==$newParentID) { + $modx->webAlertAndQuit($_lang["error_movedocument1"]); +} +if ($documentID <= 0) { + $modx->webAlertAndQuit($_lang["error_movedocument2"]); +} +if ($newParentID < 0) { + $modx->webAlertAndQuit($_lang["error_movedocument2"]); +} $parents = $modx->getParentIds($newParentID); -if (in_array($documentID, $parents)) $modx->webAlertAndQuit($_lang["error_movedocument2"]); +if (in_array($documentID, $parents)) { + $modx->webAlertAndQuit($_lang["error_movedocument2"]); +} $rs = $modx->db->select('parent', $modx->getFullTableName('site_content'), "id='{$documentID}'"); $oldparent = $modx->db->getValue($rs); @@ -25,85 +33,86 @@ // check user has permission to move document to chosen location if ($use_udperms == 1) { - if ($oldparent != $newParentID) { - include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php"; - $udperms = new udperms(); - $udperms->user = $modx->getLoginUserID(); - $udperms->document = $newParentID; - $udperms->role = $_SESSION['mgrRole']; - - if (!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_parent_denied"]); - } - } + if ($oldparent != $newParentID) { + include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php"; + $udperms = new udperms(); + $udperms->user = $modx->getLoginUserID(); + $udperms->document = $newParentID; + $udperms->role = $_SESSION['mgrRole']; + + if (!$udperms->checkPermissions()) { + $modx->webAlertAndQuit($_lang["access_permission_parent_denied"]); + } + } } /** * @param int $currDocID * @return array */ -function allChildren($currDocID) { - $modx = evolutionCMS(); - $children= array(); - $currDocID = $modx->db->escape($currDocID); - $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent = '{$currDocID}'"); - while ($child= $modx->db->getRow($rs)) { - $children[]= $child['id']; - $children= array_merge($children, allChildren($child['id'])); - } - return $children; +function allChildren($currDocID) +{ + $modx = evolutionCMS(); + $children= array(); + $currDocID = $modx->db->escape($currDocID); + $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent = '{$currDocID}'"); + while ($child= $modx->db->getRow($rs)) { + $children[]= $child['id']; + $children= array_merge($children, allChildren($child['id'])); + } + return $children; } -$evtOut = $modx->invokeEvent("onBeforeMoveDocument", array ( - "id_document" => $documentID, - "old_parent" => $oldparent, - "new_parent" => $newParentID +$evtOut = $modx->invokeEvent("onBeforeMoveDocument", array( + "id_document" => $documentID, + "old_parent" => $oldparent, + "new_parent" => $newParentID )); -if (is_array($evtOut) && count($evtOut) > 0){ - $newParent = array_pop($evtOut); - if($newParent == $oldparent) { - $modx->webAlertAndQuit($_lang["error_movedocument2"]); - }else{ - $newParentID = $newParent; - } +if (is_array($evtOut) && count($evtOut) > 0) { + $newParent = array_pop($evtOut); + if ($newParent == $oldparent) { + $modx->webAlertAndQuit($_lang["error_movedocument2"]); + } else { + $newParentID = $newParent; + } } $children = allChildren($documentID); if (!array_search($newParentID, $children)) { - $modx->db->update(array( - 'isfolder' => 1, - ), $modx->getFullTableName('site_content'), "id='{$newParentID}'"); - - $modx->db->update(array( - 'parent' => $newParentID, - 'editedby' => $modx->getLoginUserID(), - 'editedon' => time(), - ), $modx->getFullTableName('site_content'), "id='{$documentID}'"); - - // finished moving the document, now check to see if the old_parent should no longer be a folder. - $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('site_content'), "parent='{$oldparent}'"); - $limit = $modx->db->getValue($rs); - - if(!$limit>0) { - $modx->db->update(array( - 'isfolder' => 0, - ), $modx->getFullTableName('site_content'), "id='{$oldparent}'"); - } - // Set the item name for logger - $pagetitle = $modx->db->getValue($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "id='{$documentID}'")); - $_SESSION['itemname'] = $pagetitle; - - $modx->invokeEvent("onAfterMoveDocument", array ( - "id_document" => $documentID, - "old_parent" => $oldparent, - "new_parent" => $newParentID - )); - - // empty cache & sync site - $modx->clearCache('full'); - - $header="Location: index.php?a=3&id={$documentID}&r=9"; - header($header); + $modx->db->update(array( + 'isfolder' => 1, + ), $modx->getFullTableName('site_content'), "id='{$newParentID}'"); + + $modx->db->update(array( + 'parent' => $newParentID, + 'editedby' => $modx->getLoginUserID(), + 'editedon' => time(), + ), $modx->getFullTableName('site_content'), "id='{$documentID}'"); + + // finished moving the document, now check to see if the old_parent should no longer be a folder. + $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('site_content'), "parent='{$oldparent}'"); + $limit = $modx->db->getValue($rs); + + if (!$limit>0) { + $modx->db->update(array( + 'isfolder' => 0, + ), $modx->getFullTableName('site_content'), "id='{$oldparent}'"); + } + // Set the item name for logger + $pagetitle = $modx->db->getValue($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "id='{$documentID}'")); + $_SESSION['itemname'] = $pagetitle; + + $modx->invokeEvent("onAfterMoveDocument", array( + "id_document" => $documentID, + "old_parent" => $oldparent, + "new_parent" => $newParentID + )); + + // empty cache & sync site + $modx->clearCache('full'); + + $header="Location: index.php?a=3&id={$documentID}&r=9"; + header($header); } else { - $modx->webAlertAndQuit("You cannot move a document to a child document!"); + $modx->webAlertAndQuit("You cannot move a document to a child document!"); } diff --git a/manager/processors/optimize_table.processor.php b/manager/processors/optimize_table.processor.php index 4a971a7e4a..ddcc8755ea 100755 --- a/manager/processors/optimize_table.processor.php +++ b/manager/processors/optimize_table.processor.php @@ -1,35 +1,31 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!($modx->hasPermission('settings') && ($modx->hasPermission('logs')||$modx->hasPermission('bk_manager')))) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!($modx->hasPermission('settings') && ($modx->hasPermission('logs')||$modx->hasPermission('bk_manager')))) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } if (isset($_REQUEST['t'])) { + if (empty($_REQUEST['t'])) { + $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]); + } - if (empty($_REQUEST['t'])) { - $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]); - } - - // Set the item name for logger - $_SESSION['itemname'] = $_REQUEST['t']; - - $modx->db->optimize($_REQUEST['t']); + // Set the item name for logger + $_SESSION['itemname'] = $_REQUEST['t']; + $modx->db->optimize($_REQUEST['t']); } elseif (isset($_REQUEST['u'])) { + if (empty($_REQUEST['u'])) { + $modx->webAlertAndQuit($_lang["error_no_truncate_tablename"]); + } - if (empty($_REQUEST['u'])) { - $modx->webAlertAndQuit($_lang["error_no_truncate_tablename"]); - } - - // Set the item name for logger - $_SESSION['itemname'] = $_REQUEST['u']; - - $modx->db->truncate($_REQUEST['u']); + // Set the item name for logger + $_SESSION['itemname'] = $_REQUEST['u']; + $modx->db->truncate($_REQUEST['u']); } else { - $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]); + $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]); } $mode = (int)$_REQUEST['mode']; diff --git a/manager/processors/publish_content.processor.php b/manager/processors/publish_content.processor.php index 87e66c07f7..235d39e791 100755 --- a/manager/processors/publish_content.processor.php +++ b/manager/processors/publish_content.processor.php @@ -1,14 +1,14 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('save_document')||!$modx->hasPermission('publish_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('save_document')||!$modx->hasPermission('publish_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id'])? (int)$_REQUEST['id'] : 0; -if($id==0) { - $modx->webAlertAndQuit($_lang["error_no_id"]); +if ($id==0) { + $modx->webAlertAndQuit($_lang["error_no_id"]); } /************webber ********/ @@ -16,10 +16,10 @@ $pid=($content['parent']==0?$id:$content['parent']); /************** webber *************/ -$sd=isset($_REQUEST['dir'])?'&dir='.$_REQUEST['dir']:'&dir=DESC'; -$sb=isset($_REQUEST['sort'])?'&sort='.$_REQUEST['sort']:'&sort=createdon'; -$pg=isset($_REQUEST['page'])?'&page='.(int)$_REQUEST['page']:''; -$add_path=$sd.$sb.$pg; +$sd=isset($_REQUEST['dir'])?'&dir=' . $_REQUEST['dir']:'&dir=DESC'; +$sb=isset($_REQUEST['sort'])?'&sort=' . $_REQUEST['sort']:'&sort=createdon'; +$pg=isset($_REQUEST['page'])?'&page=' . (int)$_REQUEST['page']:''; +$add_path=$sd . $sb . $pg; /***********************************/ @@ -32,24 +32,24 @@ $udperms->document = $id; $udperms->role = $_SESSION['mgrRole']; -if(!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); +if (!$udperms->checkPermissions()) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); } // update the document $modx->db->update( - array( - 'published' => 1, - 'pub_date' => 0, - 'unpub_date' => 0, - 'editedby' => $modx->getLoginUserID(), - 'editedon' => time(), - 'publishedby' => $modx->getLoginUserID(), - 'publishedon' => time(), - ), $modx->getFullTableName('site_content'), "id='{$id}'"); + array( + 'published' => 1, + 'pub_date' => 0, + 'unpub_date' => 0, + 'editedby' => $modx->getLoginUserID(), + 'editedon' => time(), + 'publishedby' => $modx->getLoginUserID(), + 'publishedon' => time(), + ), $modx->getFullTableName('site_content'), "id='{$id}'"); // invoke OnDocPublished event -$modx->invokeEvent("OnDocPublished",array("docid"=>$id)); +$modx->invokeEvent("OnDocPublished", array("docid"=>$id)); // Set the item name for logger $_SESSION['itemname'] = $content['pagetitle']; @@ -57,6 +57,6 @@ // empty cache $modx->clearCache('full'); -$header="Location: index.php?a=3&id=$pid&r=1".$add_path; +$header="Location: index.php?a=3&id=$pid&r=1" . $add_path; header($header); diff --git a/manager/processors/purge_plugin.processor.php b/manager/processors/purge_plugin.processor.php index 2e31e0092a..7df736a632 100755 --- a/manager/processors/purge_plugin.processor.php +++ b/manager/processors/purge_plugin.processor.php @@ -1,11 +1,11 @@ hasPermission('delete_plugin')) { - $e->setError(3); - $e->dumpError(); +if (!$modx->hasPermission('delete_plugin')) { + $e->setError(3); + $e->dumpError(); } $tbl_site_plugins = $modx->getFullTablename('site_plugins'); @@ -14,18 +14,19 @@ // Get unique list of latest added plugins by highest sql-id $rs = $modx->db->query("SELECT t1.id FROM {$tbl_site_plugins} t1 LEFT JOIN {$tbl_site_plugins} t2 ON (t1.name = t2.name AND t1.id < t2.id) WHERE t2.id IS NULL;"); $latestIds = array(); -while($row = $modx->db->getRow($rs)) { +while ($row = $modx->db->getRow($rs)) { $latestIds[] = $row['id']; } // Get list of plugins with disabled and enabled versions $rs = $modx->db->query("SELECT id FROM {$tbl_site_plugins} t1 WHERE disabled = 1 AND name IN (SELECT name FROM {$tbl_site_plugins} t2 WHERE t1.name = t2.name AND t1.id != t2.id)"); -while($row = $modx->db->getRow($rs)) { - +while ($row = $modx->db->getRow($rs)) { $id = $row['id']; - if(in_array($id,$latestIds)) continue; // Keep latest version of disabled plugins + if (in_array($id, $latestIds)) { + continue; + } // Keep latest version of disabled plugins // invoke OnBeforePluginFormDelete event $modx->invokeEvent('OnBeforePluginFormDelete', array('id'=> $id)); diff --git a/manager/processors/remove_content.processor.php b/manager/processors/remove_content.processor.php index d55584c60f..495568b41d 100755 --- a/manager/processors/remove_content.processor.php +++ b/manager/processors/remove_content.processor.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('delete_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('delete_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "deleted=1"); @@ -11,36 +11,36 @@ // invoke OnBeforeEmptyTrash event $modx->invokeEvent("OnBeforeEmptyTrash", - array( - "ids"=>$ids - )); + array( + "ids"=>$ids + )); // remove the document groups link. $sql = "DELETE document_groups - FROM ".$modx->getFullTableName('document_groups')." AS document_groups - INNER JOIN ".$modx->getFullTableName('site_content')." AS site_content ON site_content.id = document_groups.document + FROM " . $modx->getFullTableName('document_groups') . " AS document_groups + INNER JOIN " . $modx->getFullTableName('site_content') . " AS site_content ON site_content.id = document_groups.document WHERE site_content.deleted=1"; $modx->db->query($sql); // remove the TV content values. $sql = "DELETE site_tmplvar_contentvalues - FROM ".$modx->getFullTableName('site_tmplvar_contentvalues')." AS site_tmplvar_contentvalues - INNER JOIN ".$modx->getFullTableName('site_content')." AS site_content ON site_content.id = site_tmplvar_contentvalues.contentid + FROM " . $modx->getFullTableName('site_tmplvar_contentvalues') . " AS site_tmplvar_contentvalues + INNER JOIN " . $modx->getFullTableName('site_content') . " AS site_content ON site_content.id = site_tmplvar_contentvalues.contentid WHERE site_content.deleted=1"; $modx->db->query($sql); //'undelete' the document. $modx->db->delete($modx->getFullTableName('site_content'), "deleted=1"); - // invoke OnEmptyTrash event - $modx->invokeEvent("OnEmptyTrash", - array( - "ids"=>$ids - )); + // invoke OnEmptyTrash event + $modx->invokeEvent("OnEmptyTrash", + array( + "ids"=>$ids + )); - // empty cache - $modx->clearCache('full'); + // empty cache + $modx->clearCache('full'); - // finished emptying cache - redirect - $header="Location: index.php?a=2&r=1"; - header($header); + // finished emptying cache - redirect + $header="Location: index.php?a=2&r=1"; + header($header); diff --git a/manager/processors/remove_installer.processor.php b/manager/processors/remove_installer.processor.php index c2d758d84d..519f8f7958 100755 --- a/manager/processors/remove_installer.processor.php +++ b/manager/processors/remove_installer.processor.php @@ -13,14 +13,18 @@ */ $msg =''; -$pth = dirname(dirname(dirname(__FILE__)))."/install/"; -$pth = str_replace("\\","/",$pth); -if(isset($_GET["rminstall"])) { - if(is_dir($pth)) { - if(!rmdirRecursive($pth)) $msg="An error occured while attempting to remove the install folder"; - } +$pth = dirname(dirname(dirname(__FILE__))) . "/install/"; +$pth = str_replace("\\", "/", $pth); +if (isset($_GET["rminstall"])) { + if (is_dir($pth)) { + if (!rmdirRecursive($pth)) { + $msg="An error occured while attempting to remove the install folder"; + } + } +} +if ($msg) { + echo ""; } -if($msg) echo ""; echo ""; /** @@ -30,16 +34,16 @@ * @param bool $followLinks * @return bool */ -function rmdirRecursive($path, $followLinks=false) { - $dir = opendir($path) ; - while ($entry = readdir($dir)) { - if (is_file("$path/$entry") || ((!$followLinks) && is_link("$path/$entry"))) { - @unlink( "$path/$entry" ); - } - elseif (is_dir("$path/$entry") && $entry!='.' && $entry!='..') { - rmdirRecursive("$path/$entry"); // recursive - } - } - closedir($dir); - return @rmdir($path); +function rmdirRecursive($path, $followLinks=false) +{ + $dir = opendir($path) ; + while ($entry = readdir($dir)) { + if (is_file("$path/$entry") || ((!$followLinks) && is_link("$path/$entry"))) { + @unlink("$path/$entry"); + } elseif (is_dir("$path/$entry") && $entry!='.' && $entry!='..') { + rmdirRecursive("$path/$entry"); // recursive + } + } + closedir($dir); + return @rmdir($path); } diff --git a/manager/processors/remove_locks.processor.php b/manager/processors/remove_locks.processor.php index 5808378f9e..0b4d3218ea 100755 --- a/manager/processors/remove_locks.processor.php +++ b/manager/processors/remove_locks.processor.php @@ -1,26 +1,28 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!isset($_GET['id'])) { - if(!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!isset($_GET['id'])) { + if (!$modx->hasPermission('remove_locks')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } - // Remove all locks - $modx->db->truncate($modx->getFullTableName('active_user_locks')); + // Remove all locks + $modx->db->truncate($modx->getFullTableName('active_user_locks')); - $header = "Location: index.php?a=2"; - header($header); + $header = "Location: index.php?a=2"; + header($header); } else { - // Remove single locks via AJAX / window.onbeforeunload - $type = (int)$_GET['type']; - $id = (int)$_GET['id']; - $includeAllUsers = $modx->hasPermission('remove_locks'); // Enables usage of "unlock"-ajax-button - if($type && $id) { - $modx->unlockElement($type, $id, $includeAllUsers); - echo '1'; - exit; - } else { - echo 'No type or id sent with request.'; - } + // Remove single locks via AJAX / window.onbeforeunload + $type = (int)$_GET['type']; + $id = (int)$_GET['id']; + $includeAllUsers = $modx->hasPermission('remove_locks'); // Enables usage of "unlock"-ajax-button + if ($type && $id) { + $modx->unlockElement($type, $id, $includeAllUsers); + echo '1'; + exit; + } else { + echo 'No type or id sent with request.'; + } } diff --git a/manager/processors/save_content.processor.php b/manager/processors/save_content.processor.php index 942e2dbc18..e311e6505d 100755 --- a/manager/processors/save_content.processor.php +++ b/manager/processors/save_content.processor.php @@ -36,10 +36,10 @@ $aliasvisible = $_POST['alias_visible']; /************* webber ********/ -$sd = isset($_POST['dir']) ? '&dir='.$_POST['dir'] : '&dir=DESC'; -$sb = isset($_POST['sort']) ? '&sort='.$_POST['sort'] : '&sort=pub_date'; -$pg = isset($_POST['page']) ? '&page='.(int) $_POST['page'] : ''; -$add_path = $sd.$sb.$pg; +$sd = isset($_POST['dir']) ? '&dir=' . $_POST['dir'] : '&dir=DESC'; +$sb = isset($_POST['sort']) ? '&sort=' . $_POST['sort'] : '&sort=pub_date'; +$pg = isset($_POST['page']) ? '&page=' . (int) $_POST['page'] : ''; +$add_path = $sd . $sb . $pg; @@ -134,28 +134,26 @@ } //end webber } -} -elseif ($alias) { +} elseif ($alias) { $alias = $modx->stripAlias($alias); } // determine published status $currentdate = $_SERVER['REQUEST_TIME'] + $modx->config['server_offset_time']; -if (empty ($pub_date)) { +if (empty($pub_date)) { $pub_date = 0; } else { $pub_date = $modx->toTimeStamp($pub_date); if ($pub_date < $currentdate) { $published = 1; - } - elseif ($pub_date > $currentdate) { + } elseif ($pub_date > $currentdate) { $published = 0; } } -if (empty ($unpub_date)) { +if (empty($unpub_date)) { $unpub_date = 0; } else { $unpub_date = $modx->toTimeStamp($unpub_date); @@ -195,15 +193,15 @@ INNER JOIN {$tbl_site_tmplvar_templates} AS tvtpl ON tvtpl.tmplvarid = tv.id LEFT JOIN {$tbl_site_tmplvar_contentvalues} AS tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$id}' LEFT JOIN {$tbl_site_tmplvar_access} AS tva ON tva.tmplvarid=tv.id", - "tvtpl.templateid = '{$template}' AND (1='{$_SESSION['mgrRole']}' OR ISNULL(tva.documentgroup)".((!$docgrp) ? "" : " OR tva.documentgroup IN ($docgrp)").")", + "tvtpl.templateid = '{$template}' AND (1='{$_SESSION['mgrRole']}' OR ISNULL(tva.documentgroup)" . ((!$docgrp) ? "" : " OR tva.documentgroup IN ($docgrp)") . ")", "tv.rank" ); while ($row = $modx->db->getRow($rs)) { $tmplvar = ''; switch ($row['type']) { case 'url': - $tmplvar = $_POST["tv".$row['id']]; - if ($_POST["tv".$row['id'].'_prefix'] != '--') { + $tmplvar = $_POST["tv" . $row['id']]; + if ($_POST["tv" . $row['id'] . '_prefix'] != '--') { $tmplvar = str_replace(array( "feed://", "ftp://", @@ -211,23 +209,23 @@ "https://", "mailto:" ), "", $tmplvar); - $tmplvar = $_POST["tv".$row['id'].'_prefix'].$tmplvar; + $tmplvar = $_POST["tv" . $row['id'] . '_prefix'] . $tmplvar; } break; case 'file': - $tmplvar = $_POST["tv".$row['id']]; + $tmplvar = $_POST["tv" . $row['id']]; break; default: - if (is_array($_POST["tv".$row['id']])) { + if (is_array($_POST["tv" . $row['id']])) { // handles checkboxes & multiple selects elements $feature_insert = array(); - $lst = $_POST["tv".$row['id']]; - while (list ($featureValue, $feature_item) = each($lst)) { + $lst = $_POST["tv" . $row['id']]; + while (list($featureValue, $feature_item) = each($lst)) { $feature_insert[count($feature_insert)] = $feature_item; } $tmplvar = implode("||", $feature_insert); } else { - $tmplvar = $_POST["tv".$row['id']]; + $tmplvar = $_POST["tv" . $row['id']]; } break; } @@ -250,13 +248,12 @@ if (!$existingDocument) { $modx->webAlertAndQuit($_lang["error_no_results"]); } - } // check to see if the user is allowed to save the document in the place he wants to save it in if ($use_udperms == 1) { if ($existingDocument['parent'] != $parent) { - include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php"; + include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php"; $udperms = new udperms(); $udperms->user = $modx->getLoginUserID(); $udperms->document = $parent; @@ -275,11 +272,10 @@ } switch ($actionToTake) { - case 'new' : + case 'new': // invoke OnBeforeDocFormSave event - switch($modx->config['docid_incrmnt_method']) - { + switch ($modx->config['docid_incrmnt_method']) { case '1': $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id"; $where = "T1.id IS NULL"; @@ -347,8 +343,9 @@ "alias_visible" => $aliasvisible ); - if ($id != '') + if ($id != '') { $dbInsert["id"] = $id; + } $key = $modx->db->insert($dbInsert, $tbl_site_content); @@ -372,11 +369,11 @@ foreach ($document_groups as $value_pair) { // first, split the pair (this is a new document, so ignore the second value list($group) = explode(',', $value_pair); // @see actions/mutate_content.dynamic.php @ line 1138 (permissions list) - $new_groups[] = '('.(int) $group.','.$key.')'; + $new_groups[] = '(' . (int) $group . ',' . $key . ')'; } $saved = true; if (!empty($new_groups)) { - $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES ".implode(',', $new_groups)); + $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES " . implode(',', $new_groups)); } } else { $isManager = $modx->hasPermission('access_permissions'); @@ -406,11 +403,11 @@ )); // secure web documents - flag as private - include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php"; + include MODX_MANAGER_PATH . "includes/secure_web_documents.inc.php"; secureWebDocument($key); // secure manager documents - flag as private - include MODX_MANAGER_PATH."includes/secure_mgr_documents.inc.php"; + include MODX_MANAGER_PATH . "includes/secure_mgr_documents.inc.php"; secureMgrDocument($key); // Set the item name for logger @@ -424,12 +421,14 @@ // redirect/stay options if ($_POST['stay'] != '') { // weblink - if ($_POST['mode'] == "72") + if ($_POST['mode'] == "72") { $a = ($_POST['stay'] == '2') ? "27&id=$key" : "72&pid=$parent"; + } // document - if ($_POST['mode'] == "4") + if ($_POST['mode'] == "4") { $a = ($_POST['stay'] == '2') ? "27&id=$key" : "4&pid=$parent"; - $header = "Location: index.php?a=".$a."&r=1&stay=".$_POST['stay']; + } + $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay']; } else { $header = "Location: index.php?a=3&id=$key&r=1"; } @@ -443,7 +442,7 @@ break; - case 'edit' : + case 'edit': // get the document's current parent $oldparent = $existingDocument['parent']; @@ -489,10 +488,10 @@ if (!$was_published && $published) { $publishedon = $currentdate; $publishedby = $modx->getLoginUserID(); - }elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { + } elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { $publishedon = $pub_date; $publishedby = $modx->getLoginUserID(); - }elseif ($was_published && !$published) { + } elseif ($was_published && !$published) { $publishedon = 0; $publishedby = 0; } else { @@ -501,7 +500,7 @@ } // invoke OnBeforeDocFormSave event - $modx->invokeEvent("OnBeforeDocFormSave", array ( + $modx->invokeEvent("OnBeforeDocFormSave", array( "mode" => "upd", "id" => $id )); @@ -535,12 +534,11 @@ . "donthit={$donthit}, " . "menutitle='{$menutitle}', " . "hidemenu={$hidemenu}, " - . "alias_visible={$aliasvisible}" - , $tbl_site_content, "id='{$id}'"); + . "alias_visible={$aliasvisible}", $tbl_site_content, "id='{$id}'"); // update template variables $rs = $modx->db->select('id, tmplvarid', $tbl_site_tmplvar_contentvalues, "contentid='{$id}'"); - $tvIds = array (); + $tvIds = array(); while ($row = $modx->db->getRow($rs)) { $tvIds[$row['tmplvarid']] = $row['id']; } @@ -548,7 +546,9 @@ $tvChanges = array(); foreach ($tmplvars as $field => $value) { if (!is_array($value)) { - if (isset($tvIds[$value])) $tvDeletions[] = $tvIds[$value]; + if (isset($tvIds[$value])) { + $tvDeletions[] = $tvIds[$value]; + } } else { $tvId = $value[0]; $tvVal = $value[1]; @@ -562,7 +562,7 @@ } if (!empty($tvDeletions)) { - $modx->db->delete($tbl_site_tmplvar_contentvalues, 'id IN('.implode(',', $tvDeletions).')'); + $modx->db->delete($tbl_site_tmplvar_contentvalues, 'id IN(' . implode(',', $tvDeletions) . ')'); } if (!empty($tvAdded)) { @@ -593,10 +593,12 @@ 'groups.id, groups.document_group', "{$tbl_document_groups} AS groups LEFT JOIN {$tbl_documentgroup_names} AS dgn ON dgn.id = groups.document_group", - "((1=".(int)$isManager." AND dgn.private_memgroup) OR (1=".(int)$isWeb." AND dgn.private_webgroup)) AND groups.document = '{$id}'" + "((1=" . (int)$isManager . " AND dgn.private_memgroup) OR (1=" . (int)$isWeb . " AND dgn.private_webgroup)) AND groups.document = '{$id}'" ); $old_groups = array(); - while ($row = $modx->db->getRow($rs)) $old_groups[$row['document_group']] = $row['id']; + while ($row = $modx->db->getRow($rs)) { + $old_groups[$row['document_group']] = $row['id']; + } // update the permissions in the database $insertions = $deletions = array(); @@ -605,14 +607,14 @@ unset($old_groups[$group]); continue; } elseif ($link_id == 'new') { - $insertions[] = '('.(int)$group.','.$id.')'; + $insertions[] = '(' . (int)$group . ',' . $id . ')'; } } if (!empty($insertions)) { - $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES ".implode(',', $insertions)); + $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES " . implode(',', $insertions)); } if (!empty($old_groups)) { - $modx->db->delete($tbl_document_groups, "id IN (".implode(',', $old_groups).")"); + $modx->db->delete($tbl_document_groups, "id IN (" . implode(',', $old_groups) . ")"); } // necessary to remove all permissions as document is public if ((isset($_POST['chkalldocs']) && $_POST['chkalldocs'] == 'on')) { @@ -637,7 +639,7 @@ // invoke OnDocFormSave event - $modx->invokeEvent("OnDocFormSave", array ( + $modx->invokeEvent("OnDocFormSave", array( "mode" => "upd", "id" => $id )); @@ -658,9 +660,9 @@ $modx->clearCache('full'); } - if ($_POST['refresh_preview'] == '1') - $header = "Location: ".MODX_SITE_URL."index.php?id=$id&z=manprev"; - else { + if ($_POST['refresh_preview'] == '1') { + $header = "Location: " . MODX_SITE_URL . "index.php?id=$id&z=manprev"; + } else { if ($_POST['stay'] != '2' && $id > 0) { $modx->unlockElement(7, $id); } @@ -673,18 +675,18 @@ // document $a = ($_POST['stay'] == '2') ? "27&id=$id" : "4&pid=$parent"; } - $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay'].$add_path; + $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay'] . $add_path; } else { - $header = "Location: index.php?a=3&id=$id&r=1".$add_path; + $header = "Location: index.php?a=3&id=$id&r=1" . $add_path; } } if (headers_sent()) { - $header = str_replace('Location: ','',$header); + $header = str_replace('Location: ', '', $header); echo "\n"; } else { header($header); } break; - default : + default: $modx->webAlertAndQuit("No operation set in request."); } diff --git a/manager/processors/save_htmlsnippet.processor.php b/manager/processors/save_htmlsnippet.processor.php index f23421ba90..ff40879a34 100755 --- a/manager/processors/save_htmlsnippet.processor.php +++ b/manager/processors/save_htmlsnippet.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_chunk')) { diff --git a/manager/processors/save_module.processor.php b/manager/processors/save_module.processor.php index ada5f818de..1e12674098 100755 --- a/manager/processors/save_module.processor.php +++ b/manager/processors/save_module.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_module')) { diff --git a/manager/processors/save_password.processor.php b/manager/processors/save_password.processor.php index c9db342473..a99d264c83 100755 --- a/manager/processors/save_password.processor.php +++ b/manager/processors/save_password.processor.php @@ -1,36 +1,36 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('save_password')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('save_password')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = $_POST['id']; $pass1 = $_POST['pass1']; $pass2 = $_POST['pass2']; -if($pass1!=$pass2){ - $modx->webAlertAndQuit("Passwords don't match!"); +if ($pass1!=$pass2) { + $modx->webAlertAndQuit("Passwords don't match!"); } -if(strlen($pass1)<6){ - $modx->webAlertAndQuit("Password is too short. Please specify a password of at least 6 characters."); +if (strlen($pass1)<6) { + $modx->webAlertAndQuit("Password is too short. Please specify a password of at least 6 characters."); } $pass1 = $modx->htmlspecialchars($pass1, ENT_NOQUOTES); - $tbl_manager_users = $modx->getFullTableName('manager_users'); - $uid = $modx->getLoginUserID(); - $modx->loadExtension('phpass'); - $f['password'] = $modx->phpass->HashPassword($pass1); - $modx->db->update($f,$tbl_manager_users,"id='{$uid}'"); + $tbl_manager_users = $modx->getFullTableName('manager_users'); + $uid = $modx->getLoginUserID(); + $modx->loadExtension('phpass'); + $f['password'] = $modx->phpass->HashPassword($pass1); + $modx->db->update($f, $tbl_manager_users, "id='{$uid}'"); - // invoke OnManagerChangePassword event - $modx->invokeEvent('OnManagerChangePassword', array ( - 'userid' => $uid, - 'username' => $_SESSION['mgrShortname'], - 'userpassword' => $pass1 - )); + // invoke OnManagerChangePassword event + $modx->invokeEvent('OnManagerChangePassword', array( + 'userid' => $uid, + 'username' => $_SESSION['mgrShortname'], + 'userpassword' => $pass1 + )); $header="Location: index.php?a=2"; header($header); diff --git a/manager/processors/save_plugin.processor.php b/manager/processors/save_plugin.processor.php index 1d25a72b8e..e0edf20e1b 100755 --- a/manager/processors/save_plugin.processor.php +++ b/manager/processors/save_plugin.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly.'); } if (!$modx->hasPermission('save_plugin')) { @@ -177,7 +177,9 @@ function saveEventListeners($id, $sysevents, $mode) // save selected system events $formEventList = array(); foreach ($sysevents as $evtId) { - if(!preg_match('@^[1-9][0-9]*$@',$evtId)) $evtId = getEventIdByName($evtId); + if (!preg_match('@^[1-9][0-9]*$@', $evtId)) { + $evtId = getEventIdByName($evtId); + } if ($mode == '101') { $rs = $modx->db->select('max(priority) as priority', '[+prefix+]site_plugin_events', "evtid='{$evtId}'"); } else { @@ -202,13 +204,17 @@ function saveEventListeners($id, $sysevents, $mode) $rs = $modx->db->select('*', '[+prefix+]site_plugin_events', sprintf("pluginid='%s'", $id)); $dbEventList = array(); $del = array(); - while($row = $modx->db->getRow($rs)) { - if(!in_array($row['evtid'], $evtids)) $del[] = $row['evtid']; + while ($row = $modx->db->getRow($rs)) { + if (!in_array($row['evtid'], $evtids)) { + $del[] = $row['evtid']; + } } - if(empty($del)) return; + if (empty($del)) { + return; + } - foreach($del as $delid) { + foreach ($del as $delid) { $modx->db->delete('[+prefix+]site_plugin_events', sprintf("evtid='%s' AND pluginid='%s'", $delid, $id)); } } @@ -222,7 +228,9 @@ function getEventIdByName($name) $modx = evolutionCMS(); static $eventIds=array(); - if(isset($eventIds[$name])) return $eventIds[$name]; + if (isset($eventIds[$name])) { + return $eventIds[$name]; + } $rs = $modx->db->select('id, name', '[+prefix+]system_eventnames'); while ($row = $modx->db->getRow($rs)) { @@ -231,4 +239,3 @@ function getEventIdByName($name) return $eventIds[$name]; } - diff --git a/manager/processors/save_role.processor.php b/manager/processors/save_role.processor.php index 1d4f55c83a..45c6398b35 100755 --- a/manager/processors/save_role.processor.php +++ b/manager/processors/save_role.processor.php @@ -1,135 +1,135 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('save_role')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('save_role')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } extract($_POST); -if($name == '' || !isset ($name)) { - $modx->webAlertAndQuit("Please enter a name for this role!", "index.php?a={$mode}" . ($mode = 35 ? "&id={$id}" : "")); +if ($name == '' || !isset($name)) { + $modx->webAlertAndQuit("Please enter a name for this role!", "index.php?a={$mode}" . ($mode = 35 ? "&id={$id}" : "")); } // setup fields $fields = array( - 'name' => $name, - 'description' => $description, - 'frames' => $frames, - 'home' => $home, - 'view_document' => $view_document, - 'new_document' => $new_document, - 'save_document' => $save_document, - 'publish_document' => $publish_document, - 'delete_document' => $delete_document, - 'empty_trash' => $empty_trash, - 'action_ok' => $action_ok, - 'logout' => $logout, - 'help' => $help, - 'messages' => $messages, - 'new_user' => $new_user, - 'edit_user' => $edit_user, - 'logs' => $logs, - 'edit_parser' => (isset ($edit_parser)) ? $edit_parser : '0', - 'save_parser' => (isset ($save_parser)) ? $save_parser : '0', - 'edit_template' => $edit_template, - 'settings' => $settings, - 'credits' => $credits, - 'new_template' => $new_template, - 'save_template' => $save_template, - 'delete_template' => $delete_template, - 'edit_snippet' => $edit_snippet, - 'new_snippet' => $new_snippet, - 'save_snippet' => $save_snippet, - 'delete_snippet' => $delete_snippet, - 'edit_chunk' => $edit_chunk, - 'new_chunk' => $new_chunk, - 'save_chunk' => $save_chunk, - 'delete_chunk' => $delete_chunk, - 'empty_cache' => $empty_cache, - 'edit_document' => $edit_document, - 'change_password' => $change_password, - 'error_dialog' => $error_dialog, - 'about' => $about, - 'file_manager' => $file_manager, - 'assets_files' => $assets_files, - 'assets_images' => $assets_images, - 'save_user' => $save_user, - 'delete_user' => $delete_user, - 'save_password' => $save_password, - 'edit_role' => $edit_role, - 'save_role' => $save_role, - 'delete_role' => $delete_role, - 'new_role' => $new_role, - 'access_permissions' => $access_permissions, - 'bk_manager' => $bk_manager, - 'new_plugin' => $new_plugin, - 'edit_plugin' => $edit_plugin, - 'save_plugin' => $save_plugin, - 'delete_plugin' => $delete_plugin, - 'new_module' => $new_module, - 'edit_module' => $edit_module, - 'save_module' => $save_module, - 'delete_module' => $delete_module, - 'exec_module' => $exec_module, - 'view_eventlog' => $view_eventlog, - 'delete_eventlog' => $delete_eventlog, - 'new_web_user' => $new_web_user, - 'edit_web_user' => $edit_web_user, - 'save_web_user' => $save_web_user, - 'delete_web_user' => $delete_web_user, - 'web_access_permissions' => $web_access_permissions, - 'view_unpublished' => $view_unpublished, - 'import_static' => $import_static, - 'export_static' => $export_static, - 'remove_locks' => $remove_locks, - 'display_locks' => $display_locks, - 'change_resourcetype' => $change_resourcetype, - 'category_manager' => $category_manager + 'name' => $name, + 'description' => $description, + 'frames' => $frames, + 'home' => $home, + 'view_document' => $view_document, + 'new_document' => $new_document, + 'save_document' => $save_document, + 'publish_document' => $publish_document, + 'delete_document' => $delete_document, + 'empty_trash' => $empty_trash, + 'action_ok' => $action_ok, + 'logout' => $logout, + 'help' => $help, + 'messages' => $messages, + 'new_user' => $new_user, + 'edit_user' => $edit_user, + 'logs' => $logs, + 'edit_parser' => (isset($edit_parser)) ? $edit_parser : '0', + 'save_parser' => (isset($save_parser)) ? $save_parser : '0', + 'edit_template' => $edit_template, + 'settings' => $settings, + 'credits' => $credits, + 'new_template' => $new_template, + 'save_template' => $save_template, + 'delete_template' => $delete_template, + 'edit_snippet' => $edit_snippet, + 'new_snippet' => $new_snippet, + 'save_snippet' => $save_snippet, + 'delete_snippet' => $delete_snippet, + 'edit_chunk' => $edit_chunk, + 'new_chunk' => $new_chunk, + 'save_chunk' => $save_chunk, + 'delete_chunk' => $delete_chunk, + 'empty_cache' => $empty_cache, + 'edit_document' => $edit_document, + 'change_password' => $change_password, + 'error_dialog' => $error_dialog, + 'about' => $about, + 'file_manager' => $file_manager, + 'assets_files' => $assets_files, + 'assets_images' => $assets_images, + 'save_user' => $save_user, + 'delete_user' => $delete_user, + 'save_password' => $save_password, + 'edit_role' => $edit_role, + 'save_role' => $save_role, + 'delete_role' => $delete_role, + 'new_role' => $new_role, + 'access_permissions' => $access_permissions, + 'bk_manager' => $bk_manager, + 'new_plugin' => $new_plugin, + 'edit_plugin' => $edit_plugin, + 'save_plugin' => $save_plugin, + 'delete_plugin' => $delete_plugin, + 'new_module' => $new_module, + 'edit_module' => $edit_module, + 'save_module' => $save_module, + 'delete_module' => $delete_module, + 'exec_module' => $exec_module, + 'view_eventlog' => $view_eventlog, + 'delete_eventlog' => $delete_eventlog, + 'new_web_user' => $new_web_user, + 'edit_web_user' => $edit_web_user, + 'save_web_user' => $save_web_user, + 'delete_web_user' => $delete_web_user, + 'web_access_permissions' => $web_access_permissions, + 'view_unpublished' => $view_unpublished, + 'import_static' => $import_static, + 'export_static' => $export_static, + 'remove_locks' => $remove_locks, + 'display_locks' => $display_locks, + 'change_resourcetype' => $change_resourcetype, + 'category_manager' => $category_manager ); $fields = $modx->db->escape($fields); -switch($_POST['mode']) { - case '38' : - $tbl = $modx->getFullTableName("user_roles"); +switch ($_POST['mode']) { + case '38': + $tbl = $modx->getFullTableName("user_roles"); - // disallow duplicate names for role - $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}'"); - if($modx->db->getValue($rs) > 0) { - $modx->manager->saveFormValues(38); - $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=38"); - } + // disallow duplicate names for role + $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}'"); + if ($modx->db->getValue($rs) > 0) { + $modx->manager->saveFormValues(38); + $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=38"); + } - $modx->db->insert($fields, $tbl); + $modx->db->insert($fields, $tbl); - // Set the item name for logger - $_SESSION['itemname'] = $_POST['name']; + // Set the item name for logger + $_SESSION['itemname'] = $_POST['name']; - $header = "Location: index.php?a=86&r=2"; - header($header); - break; - case '35' : - $tbl = $modx->getFullTableName("user_roles"); + $header = "Location: index.php?a=86&r=2"; + header($header); + break; + case '35': + $tbl = $modx->getFullTableName("user_roles"); - // disallow duplicate names for role - $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}' AND id!='{$id}'"); - if($modx->db->getValue($rs) > 0) { - $modx->manager->saveFormValues(35); - $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=35&id={$id}"); - } + // disallow duplicate names for role + $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}' AND id!='{$id}'"); + if ($modx->db->getValue($rs) > 0) { + $modx->manager->saveFormValues(35); + $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=35&id={$id}"); + } - $modx->db->update($fields, $tbl, "id='{$id}'"); + $modx->db->update($fields, $tbl, "id='{$id}'"); - // Set the item name for logger - $_SESSION['itemname'] = $_POST['name']; + // Set the item name for logger + $_SESSION['itemname'] = $_POST['name']; - $header = "Location: index.php?a=86&r=2"; - header($header); - break; - default : - $modx->webAlertAndQuit("No operation set in request."); + $header = "Location: index.php?a=86&r=2"; + header($header); + break; + default: + $modx->webAlertAndQuit("No operation set in request."); } $modx->unlockElement(8, $id); diff --git a/manager/processors/save_settings.processor.php b/manager/processors/save_settings.processor.php index ebe7c6f654..ee4316e82f 100755 --- a/manager/processors/save_settings.processor.php +++ b/manager/processors/save_settings.processor.php @@ -1,159 +1,152 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('settings')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('settings')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $data = $_POST; // lose the POST now, gets rid of quirky issue with Safari 3 - see FS#972 unset($_POST); -if($data['friendly_urls']==='1' && strpos($_SERVER['SERVER_SOFTWARE'],'IIS')===false) -{ - $htaccess = $modx->config['base_path'] . '.htaccess'; - $sample_htaccess = $modx->config['base_path'] . 'ht.access'; - $dir = '/' . trim($modx->config['base_url'],'/'); - if(is_file($htaccess)) - { - $_ = file_get_contents($htaccess); - if(strpos($_,'RewriteBase')===false) - { - $warnings[] = $_lang["settings_friendlyurls_alert2"]; - } - elseif(is_writable($htaccess)) - { - $_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_); - if(!@file_put_contents($htaccess,$_)) - { - $warnings[] = $_lang["settings_friendlyurls_alert2"]; - } - } - } - elseif(is_file($sample_htaccess)) - { - if(!@rename($sample_htaccess,$htaccess)) - { - $warnings[] = $_lang["settings_friendlyurls_alert"]; - } - elseif($modx->config['base_url']!=='/') - { - $_ = file_get_contents($htaccess); - $_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_); - if(!@file_put_contents($htaccess,$_)) - { - $warnings[] = $_lang["settings_friendlyurls_alert2"]; - } - } - } +if ($data['friendly_urls']==='1' && strpos($_SERVER['SERVER_SOFTWARE'], 'IIS')===false) { + $htaccess = $modx->config['base_path'] . '.htaccess'; + $sample_htaccess = $modx->config['base_path'] . 'ht.access'; + $dir = '/' . trim($modx->config['base_url'], '/'); + if (is_file($htaccess)) { + $_ = file_get_contents($htaccess); + if (strpos($_, 'RewriteBase')===false) { + $warnings[] = $_lang["settings_friendlyurls_alert2"]; + } elseif (is_writable($htaccess)) { + $_ = preg_replace('@RewriteBase.+@', "RewriteBase {$dir}", $_); + if (!@file_put_contents($htaccess, $_)) { + $warnings[] = $_lang["settings_friendlyurls_alert2"]; + } + } + } elseif (is_file($sample_htaccess)) { + if (!@rename($sample_htaccess, $htaccess)) { + $warnings[] = $_lang["settings_friendlyurls_alert"]; + } elseif ($modx->config['base_url']!=='/') { + $_ = file_get_contents($htaccess); + $_ = preg_replace('@RewriteBase.+@', "RewriteBase {$dir}", $_); + if (!@file_put_contents($htaccess, $_)) { + $warnings[] = $_lang["settings_friendlyurls_alert2"]; + } + } + } } if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { unlink(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css'); } -$data['filemanager_path'] = str_replace('[(base_path)]',MODX_BASE_PATH,$data['filemanager_path']); -$data['rb_base_dir'] = str_replace('[(base_path)]',MODX_BASE_PATH,$data['rb_base_dir']); +$data['filemanager_path'] = str_replace('[(base_path)]', MODX_BASE_PATH, $data['filemanager_path']); +$data['rb_base_dir'] = str_replace('[(base_path)]', MODX_BASE_PATH, $data['rb_base_dir']); if (isset($data) && count($data) > 0) { - if(isset($data['manager_language'])) { - $lang_path = MODX_MANAGER_PATH . 'includes/lang/' . $data['manager_language'] . '.inc.php'; - if(is_file($lang_path)) { - include($lang_path); + if (isset($data['manager_language'])) { + $lang_path = MODX_MANAGER_PATH . 'includes/lang/' . $data['manager_language'] . '.inc.php'; + if (is_file($lang_path)) { + include($lang_path); global $modx_lang_attribute; $data['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute; - } - } - $savethese = array(); - $data['sys_files_checksum'] = $modx->manager->getSystemChecksum($data['check_files_onlogin']); - $data['mail_check_timeperiod'] = (int)$data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute - foreach ($data as $k => $v) { - switch ($k) { - case 'site_name': - $v = htmlspecialchars($v); - break; + } + } + $savethese = array(); + $data['sys_files_checksum'] = $modx->manager->getSystemChecksum($data['check_files_onlogin']); + $data['mail_check_timeperiod'] = (int)$data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute + foreach ($data as $k => $v) { + switch ($k) { + case 'site_name': + $v = htmlspecialchars($v); + break; case 'settings_version':{ - if($modx->getVersionData('version')!=$data['settings_version']){ - $modx->logEvent(17,2,'
    '.var_export($data['settings_version'],true).'
    ','fake settings_version'); + if ($modx->getVersionData('version')!=$data['settings_version']) { + $modx->logEvent(17, 2, '
    ' . var_export($data['settings_version'], true) . '
    ', 'fake settings_version'); $v = $modx->getVersionData('version'); } break; } - case 'error_page': - case 'unauthorized_page': - if (trim($v) == '' || !is_numeric($v)) { - $v = $data['site_start']; - } - break; + case 'error_page': + case 'unauthorized_page': + if (trim($v) == '' || !is_numeric($v)) { + $v = $data['site_start']; + } + break; - case 'lst_custom_contenttype': - case 'txt_custom_contenttype': - // Skip these - $k = ''; - break; - case 'rb_base_dir': - case 'rb_base_url': - case 'filemanager_path': - $v = trim($v); - $v = rtrim($v,'/') . '/'; - break; + case 'lst_custom_contenttype': + case 'txt_custom_contenttype': + // Skip these + $k = ''; + break; + case 'rb_base_dir': + case 'rb_base_url': + case 'filemanager_path': + $v = trim($v); + $v = rtrim($v, '/') . '/'; + break; case 'manager_language': $langDir = realpath(MODX_MANAGER_PATH . 'includes/lang'); $langFile = realpath(MODX_MANAGER_PATH . 'includes/lang/' . $v . '.inc.php'); $langFileDir = dirname($langFile); - if($langDir !== $langFileDir || !file_exists($langFile)) { + if ($langDir !== $langFileDir || !file_exists($langFile)) { $v = 'english'; } - break; - case 'smtppw': - if ($v !== '********************' && $v !== '') { - $v = trim($v); - $v = base64_encode($v) . substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7); - $v = str_replace('=','%',$v); - } elseif ($v === '********************') { - $k = ''; - } - break; + break; + case 'smtppw': + if ($v !== '********************' && $v !== '') { + $v = trim($v); + $v = base64_encode($v) . substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7); + $v = str_replace('=', '%', $v); + } elseif ($v === '********************') { + $k = ''; + } + break; case 'valid_hostnames': - $v = str_replace(array(' ,', ', '), ',', $v); - if ($v !== ',') { - $v = ($v != 'MODX_SITE_HOSTNAMES') ? $v : ''; - $configString = 'config[$k] = $v; + $modx->config[$k] = $v; - if(!empty($k)) $savethese[] = '(\''.$modx->db->escape($k).'\', \''.$modx->db->escape($v).'\')'; - } + if (!empty($k)) { + $savethese[] = '(\'' . $modx->db->escape($k) . '\', \'' . $modx->db->escape($v) . '\')'; + } + } - // Run a single query to save all the values - $sql = "REPLACE INTO ".$modx->getFullTableName("system_settings")." (setting_name, setting_value) - VALUES ".implode(', ', $savethese); - $modx->db->query($sql); + // Run a single query to save all the values + $sql = "REPLACE INTO " . $modx->getFullTableName("system_settings") . " (setting_name, setting_value) + VALUES " . implode(', ', $savethese); + $modx->db->query($sql); - // Reset Template Pages - if (isset($data['reset_template'])) { - $newtemplate = (int)$data['default_template']; - $oldtemplate = (int)$data['old_template']; - $tbl = $modx->getFullTableName('site_content'); - $reset = $data['reset_template']; - if($reset==1) $modx->db->update(array('template' => $newtemplate), $tbl, "type='document'"); - else if($reset==2) $modx->db->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'"); - } + // Reset Template Pages + if (isset($data['reset_template'])) { + $newtemplate = (int)$data['default_template']; + $oldtemplate = (int)$data['old_template']; + $tbl = $modx->getFullTableName('site_content'); + $reset = $data['reset_template']; + if ($reset==1) { + $modx->db->update(array('template' => $newtemplate), $tbl, "type='document'"); + } elseif ($reset==2) { + $modx->db->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'"); + } + } - // empty cache - $modx->clearCache('full'); + // empty cache + $modx->clearCache('full'); } $header="Location: index.php?a=7&r=10"; header($header); diff --git a/manager/processors/save_snippet.processor.php b/manager/processors/save_snippet.processor.php index 28bdfe12a0..e681e48f40 100755 --- a/manager/processors/save_snippet.processor.php +++ b/manager/processors/save_snippet.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_snippet')) { diff --git a/manager/processors/save_template.processor.php b/manager/processors/save_template.processor.php index ed4dca716c..0a6d6cc6ef 100755 --- a/manager/processors/save_template.processor.php +++ b/manager/processors/save_template.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_template')) { diff --git a/manager/processors/save_tmplvars.processor.php b/manager/processors/save_tmplvars.processor.php index 8d05b975e0..74c365afa2 100755 --- a/manager/processors/save_tmplvars.processor.php +++ b/manager/processors/save_tmplvars.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_template')) { @@ -13,7 +13,7 @@ $type = $modx->db->escape($_POST['type']); $elements = $modx->db->escape($_POST['elements']); $default_text = $modx->db->escape($_POST['default_text']); -$rank = isset ($_POST['rank']) ? $modx->db->escape($_POST['rank']) : 0; +$rank = isset($_POST['rank']) ? $modx->db->escape($_POST['rank']) : 0; $display = $modx->db->escape($_POST['display']); $params = $modx->db->escape($_POST['params']); $locked = $_POST['locked'] == 'on' ? 1 : 0; @@ -213,7 +213,8 @@ function saveTemplateVarAccess() function saveDocumentAccessPermissons() { global $id, $newid; - $modx = evolutionCMS(); global $use_udperms; + $modx = evolutionCMS(); + global $use_udperms; $tbl_site_tmplvar_templates = $modx->getFullTableName('site_tmplvar_access'); diff --git a/manager/processors/save_user.processor.php b/manager/processors/save_user.processor.php index b853ee0b06..daf650acee 100755 --- a/manager/processors/save_user.processor.php +++ b/manager/processors/save_user.processor.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('save_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('save_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $modx->loadExtension('phpass'); @@ -16,7 +16,7 @@ $id = (int)$input['id']; $oldusername = $input['oldusername']; -$newusername = !empty ($input['newusername']) ? trim($input['newusername']) : "New User"; +$newusername = !empty($input['newusername']) ? trim($input['newusername']) : "New User"; $fullname = $input['fullname']; $genpassword = $input['newpassword']; $passwordgenmethod = $input['passwordgenmethod']; @@ -27,7 +27,7 @@ $phone = $input['phone']; $mobilephone = $input['mobilephone']; $fax = $input['fax']; -$dob = !empty ($input['dob']) ? $modx->toTimeStamp($input['dob']) : 0; +$dob = !empty($input['dob']) ? $modx->toTimeStamp($input['dob']) : 0; $country = $input['country']; $street = $input['street']; $city = $input['city']; @@ -44,135 +44,133 @@ $user_groups = $input['user_groups']; // verify password -if($passwordgenmethod == "spec" && $input['specifiedpassword'] != $input['confirmpassword']) { - webAlertAndQuit("Password typed is mismatched"); +if ($passwordgenmethod == "spec" && $input['specifiedpassword'] != $input['confirmpassword']) { + webAlertAndQuit("Password typed is mismatched"); } // verify email -if($email == '' || !preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,24}$/i", $email)) { - webAlertAndQuit("E-mail address doesn't seem to be valid!"); +if ($email == '' || !preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,24}$/i", $email)) { + webAlertAndQuit("E-mail address doesn't seem to be valid!"); } // verify admin security -if($_SESSION['mgrRole'] != 1) { - // Check to see if user tried to spoof a "1" (admin) role - if(!$modx->hasPermission('save_role')) { - webAlertAndQuit("Illegal attempt to create/modify administrator by non-administrator!"); - } - // Verify that the user being edited wasn't an admin and the user ID got spoofed - $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, "internalKey='{$id}' AND role=1"); - $limit = $modx->db->getValue($rs); - if($limit > 0) { - webAlertAndQuit("You cannot alter an administrative user."); - } - +if ($_SESSION['mgrRole'] != 1) { + // Check to see if user tried to spoof a "1" (admin) role + if (!$modx->hasPermission('save_role')) { + webAlertAndQuit("Illegal attempt to create/modify administrator by non-administrator!"); + } + // Verify that the user being edited wasn't an admin and the user ID got spoofed + $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, "internalKey='{$id}' AND role=1"); + $limit = $modx->db->getValue($rs); + if ($limit > 0) { + webAlertAndQuit("You cannot alter an administrative user."); + } } -switch($input['mode']) { - case '11' : // new user - // check if this user name already exist - $rs = $modx->db->select('count(id)', $tbl_manager_users, sprintf("username='%s'", $modx->db->escape($newusername))); - $limit = $modx->db->getValue($rs); - if($limit > 0) { - webAlertAndQuit("User name is already in use!"); - } - - // check if the email address already exist - $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, sprintf("email='%s' AND id!='%s'", $modx->db->escape($email), $id)); - $limit = $modx->db->getValue($rs); - if($limit > 0) { - webAlertAndQuit("Email is already in use!"); - } - - // generate a new password for this user - if($specifiedpassword != "" && $passwordgenmethod == "spec") { - if(strlen($specifiedpassword) < 6) { - webAlertAndQuit("Password is too short!"); - } else { - $newpassword = $specifiedpassword; - } - } elseif($specifiedpassword == "" && $passwordgenmethod == "spec") { - webAlertAndQuit("You didn't specify a password for this user!"); - } elseif($passwordgenmethod == 'g') { - $newpassword = generate_password(8); - } else { - webAlertAndQuit("No password generation method specified!"); - } - - // invoke OnBeforeUserFormSave event - $modx->invokeEvent("OnBeforeUserFormSave", array( - "mode" => "new", - )); - - // create the user account - $internalKey = $modx->db->insert(array('username' => $modx->db->escape($newusername)), $tbl_manager_users); - - $field = array(); - $field['password'] = $modx->phpass->HashPassword($newpassword); - $modx->db->update($field, $tbl_manager_users, "id='{$internalKey}'"); - - $field = compact('internalKey', 'fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'blocked', 'blockeduntil', 'blockedafter'); - $field = $modx->db->escape($field); - $modx->db->insert($field, $tbl_user_attributes); - - // Save user settings - saveUserSettings($internalKey); - - // invoke OnManagerSaveUser event - $modx->invokeEvent("OnManagerSaveUser", array( - "mode" => "new", - "userid" => $internalKey, - "username" => $newusername, - "userpassword" => $newpassword, - "useremail" => $email, - "userfullname" => $fullname, - "userroleid" => $role - )); - - // invoke OnUserFormSave event - $modx->invokeEvent("OnUserFormSave", array( - "mode" => "new", - "id" => $internalKey - )); - - // Set the item name for logger - $_SESSION['itemname'] = $newusername; - - /*******************************************************************************/ - // put the user in the user_groups he/ she should be in - // first, check that up_perms are switched on! - if($use_udperms == 1) { - if(!empty($user_groups)) { - for($i = 0; $i < count($user_groups); $i++) { - $f = array(); - $f['user_group'] = (int)$user_groups[$i]; - $f['member'] = $internalKey; - $modx->db->insert($f, $tbl_member_groups); - } - } - } - // end of user_groups stuff! - - if($passwordnotifymethod == 'e') { - sendMailMessage($email, $newusername, $newpassword, $fullname); - if($input['stay'] != '') { - $a = ($input['stay'] == '2') ? "12&id={$internalKey}" : "11"; - $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay']; - header($header); - } else { - $header = "Location: index.php?a=75&r=2"; - header($header); - } - } else { - if($input['stay'] != '') { - $a = ($input['stay'] == '2') ? "12&id={$internalKey}" : "11"; - $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; - } else { - $stayUrl = "index.php?a=75&r=2"; - } - - include_once "header.inc.php"; - ?> +switch ($input['mode']) { + case '11': // new user + // check if this user name already exist + $rs = $modx->db->select('count(id)', $tbl_manager_users, sprintf("username='%s'", $modx->db->escape($newusername))); + $limit = $modx->db->getValue($rs); + if ($limit > 0) { + webAlertAndQuit("User name is already in use!"); + } + + // check if the email address already exist + $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, sprintf("email='%s' AND id!='%s'", $modx->db->escape($email), $id)); + $limit = $modx->db->getValue($rs); + if ($limit > 0) { + webAlertAndQuit("Email is already in use!"); + } + + // generate a new password for this user + if ($specifiedpassword != "" && $passwordgenmethod == "spec") { + if (strlen($specifiedpassword) < 6) { + webAlertAndQuit("Password is too short!"); + } else { + $newpassword = $specifiedpassword; + } + } elseif ($specifiedpassword == "" && $passwordgenmethod == "spec") { + webAlertAndQuit("You didn't specify a password for this user!"); + } elseif ($passwordgenmethod == 'g') { + $newpassword = generate_password(8); + } else { + webAlertAndQuit("No password generation method specified!"); + } + + // invoke OnBeforeUserFormSave event + $modx->invokeEvent("OnBeforeUserFormSave", array( + "mode" => "new", + )); + + // create the user account + $internalKey = $modx->db->insert(array('username' => $modx->db->escape($newusername)), $tbl_manager_users); + + $field = array(); + $field['password'] = $modx->phpass->HashPassword($newpassword); + $modx->db->update($field, $tbl_manager_users, "id='{$internalKey}'"); + + $field = compact('internalKey', 'fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'blocked', 'blockeduntil', 'blockedafter'); + $field = $modx->db->escape($field); + $modx->db->insert($field, $tbl_user_attributes); + + // Save user settings + saveUserSettings($internalKey); + + // invoke OnManagerSaveUser event + $modx->invokeEvent("OnManagerSaveUser", array( + "mode" => "new", + "userid" => $internalKey, + "username" => $newusername, + "userpassword" => $newpassword, + "useremail" => $email, + "userfullname" => $fullname, + "userroleid" => $role + )); + + // invoke OnUserFormSave event + $modx->invokeEvent("OnUserFormSave", array( + "mode" => "new", + "id" => $internalKey + )); + + // Set the item name for logger + $_SESSION['itemname'] = $newusername; + + /*******************************************************************************/ + // put the user in the user_groups he/ she should be in + // first, check that up_perms are switched on! + if ($use_udperms == 1) { + if (!empty($user_groups)) { + for ($i = 0; $i < count($user_groups); $i++) { + $f = array(); + $f['user_group'] = (int)$user_groups[$i]; + $f['member'] = $internalKey; + $modx->db->insert($f, $tbl_member_groups); + } + } + } + // end of user_groups stuff! + + if ($passwordnotifymethod == 'e') { + sendMailMessage($email, $newusername, $newpassword, $fullname); + if ($input['stay'] != '') { + $a = ($input['stay'] == '2') ? "12&id={$internalKey}" : "11"; + $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay']; + header($header); + } else { + $header = "Location: index.php?a=75&r=2"; + header($header); + } + } else { + if ($input['stay'] != '') { + $a = ($input['stay'] == '2') ? "12&id={$internalKey}" : "11"; + $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; + } else { + $stayUrl = "index.php?a=75&r=2"; + } + + include_once "header.inc.php"; ?>

    @@ -194,125 +192,124 @@
    db->select('count(id)', $tbl_manager_users, sprintf("username='%s' AND id!='%s'", $modx->db->escape($newusername), $id)); - $limit = $modx->db->getValue($rs); - if($limit > 0) { - webAlertAndQuit("User name is already in use!"); - } - - // check if the email address already exists - $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, sprintf("email='%s' AND internalKey!='%s'", $modx->db->escape($email), $id)); - $limit = $modx->db->getValue($rs); - if($limit > 0) { - webAlertAndQuit("Email is already in use!"); - } - - // invoke OnBeforeUserFormSave event - $modx->invokeEvent("OnBeforeUserFormSave", array( - "mode" => "upd", - "id" => $id - )); - - // update user name and password - $field = array(); - $field['username'] = $modx->db->escape($newusername); - if($genpassword == 1) { - $field['password'] = $modx->phpass->HashPassword($newpassword); - } - $modx->db->update($field, $tbl_manager_users, "id='{$id}'"); - $field = compact('fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'failedlogincount', 'blocked', 'blockeduntil', 'blockedafter'); - $field = $modx->db->escape($field); - $modx->db->update($field, $tbl_user_attributes, "internalKey='{$id}'"); - - // Save user settings - saveUserSettings($id); - - // Set the item name for logger - $_SESSION['itemname'] = $newusername; - - // invoke OnManagerSaveUser event - $modx->invokeEvent("OnManagerSaveUser", array( - "mode" => "upd", - "userid" => $id, - "username" => $newusername, - "userpassword" => $newpassword, - "useremail" => $email, - "userfullname" => $fullname, - "userroleid" => $role, - "oldusername" => (($oldusername != $newusername) ? $oldusername : ""), - "olduseremail" => (($oldemail != $email) ? $oldemail : "") - )); - - // invoke OnManagerChangePassword event - if($genpassword == 1) { - $modx->invokeEvent("OnManagerChangePassword", array( - "userid" => $id, - "username" => $newusername, - "userpassword" => $newpassword - )); - } - - // invoke OnUserFormSave event - $modx->invokeEvent("OnUserFormSave", array( - "mode" => "upd", - "id" => $id - )); - - /*******************************************************************************/ - // put the user in the user_groups he/ she should be in - // first, check that up_perms are switched on! - if($use_udperms == 1) { - // as this is an existing user, delete his/ her entries in the groups before saving the new groups - $modx->db->delete($tbl_member_groups, "member='{$id}'"); - if(!empty($user_groups)) { - for($i = 0; $i < count($user_groups); $i++) { - $field = array(); - $field['user_group'] = (int)$user_groups[$i]; - $field['member'] = $id; - $modx->db->insert($field, $tbl_member_groups); - } - } - } - // end of user_groups stuff! - /*******************************************************************************/ - if($id == $modx->getLoginUserID() && ($genpassword !== 1 && $passwordnotifymethod != 's')) { - $modx->webAlertAndQuit($_lang["user_changeddata"], 'javascript:top.location.href="index.php?a=8";'); - } - if($genpassword == 1 && $passwordnotifymethod == 's') { - if($input['stay'] != '') { - $a = ($input['stay'] == '2') ? "12&id={$id}" : "11"; - $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; - } else { - $stayUrl = "index.php?a=75&r=2"; - } - - include_once "header.inc.php"; - ?> + include_once "footer.inc.php"; + } + break; + case '12': // edit user + // generate a new password for this user + if ($genpassword == 1) { + if ($specifiedpassword != "" && $passwordgenmethod == "spec") { + if (strlen($specifiedpassword) < 6) { + webAlertAndQuit("Password is too short!"); + } else { + $newpassword = $specifiedpassword; + } + } elseif ($specifiedpassword == "" && $passwordgenmethod == "spec") { + webAlertAndQuit("You didn't specify a password for this user!"); + } elseif ($passwordgenmethod == 'g') { + $newpassword = generate_password(8); + } else { + webAlertAndQuit("No password generation method specified!"); + } + } + if ($passwordnotifymethod == 'e') { + sendMailMessage($email, $newusername, $newpassword, $fullname); + } + + // check if the username already exist + $rs = $modx->db->select('count(id)', $tbl_manager_users, sprintf("username='%s' AND id!='%s'", $modx->db->escape($newusername), $id)); + $limit = $modx->db->getValue($rs); + if ($limit > 0) { + webAlertAndQuit("User name is already in use!"); + } + + // check if the email address already exists + $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, sprintf("email='%s' AND internalKey!='%s'", $modx->db->escape($email), $id)); + $limit = $modx->db->getValue($rs); + if ($limit > 0) { + webAlertAndQuit("Email is already in use!"); + } + + // invoke OnBeforeUserFormSave event + $modx->invokeEvent("OnBeforeUserFormSave", array( + "mode" => "upd", + "id" => $id + )); + + // update user name and password + $field = array(); + $field['username'] = $modx->db->escape($newusername); + if ($genpassword == 1) { + $field['password'] = $modx->phpass->HashPassword($newpassword); + } + $modx->db->update($field, $tbl_manager_users, "id='{$id}'"); + $field = compact('fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'failedlogincount', 'blocked', 'blockeduntil', 'blockedafter'); + $field = $modx->db->escape($field); + $modx->db->update($field, $tbl_user_attributes, "internalKey='{$id}'"); + + // Save user settings + saveUserSettings($id); + + // Set the item name for logger + $_SESSION['itemname'] = $newusername; + + // invoke OnManagerSaveUser event + $modx->invokeEvent("OnManagerSaveUser", array( + "mode" => "upd", + "userid" => $id, + "username" => $newusername, + "userpassword" => $newpassword, + "useremail" => $email, + "userfullname" => $fullname, + "userroleid" => $role, + "oldusername" => (($oldusername != $newusername) ? $oldusername : ""), + "olduseremail" => (($oldemail != $email) ? $oldemail : "") + )); + + // invoke OnManagerChangePassword event + if ($genpassword == 1) { + $modx->invokeEvent("OnManagerChangePassword", array( + "userid" => $id, + "username" => $newusername, + "userpassword" => $newpassword + )); + } + + // invoke OnUserFormSave event + $modx->invokeEvent("OnUserFormSave", array( + "mode" => "upd", + "id" => $id + )); + + /*******************************************************************************/ + // put the user in the user_groups he/ she should be in + // first, check that up_perms are switched on! + if ($use_udperms == 1) { + // as this is an existing user, delete his/ her entries in the groups before saving the new groups + $modx->db->delete($tbl_member_groups, "member='{$id}'"); + if (!empty($user_groups)) { + for ($i = 0; $i < count($user_groups); $i++) { + $field = array(); + $field['user_group'] = (int)$user_groups[$i]; + $field['member'] = $id; + $modx->db->insert($field, $tbl_member_groups); + } + } + } + // end of user_groups stuff! + /*******************************************************************************/ + if ($id == $modx->getLoginUserID() && ($genpassword !== 1 && $passwordnotifymethod != 's')) { + $modx->webAlertAndQuit($_lang["user_changeddata"], 'javascript:top.location.href="index.php?a=8";'); + } + if ($genpassword == 1 && $passwordnotifymethod == 's') { + if ($input['stay'] != '') { + $a = ($input['stay'] == '2') ? "12&id={$id}" : "11"; + $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; + } else { + $stayUrl = "index.php?a=75&r=2"; + } + + include_once "header.inc.php"; ?>

    @@ -332,20 +329,20 @@ "; - $param['subject'] = $emailsubject; - $param['body'] = $message; - $param['to'] = $email; - $param['type'] = 'text'; - $rs = $modx->sendmail($param); - if(!$rs) { - $modx->manager->saveFormValues(); - $modx->messageQuit("{$email} - {$_lang['error_sending_email']}"); - } +function sendMailMessage($email, $uid, $pwd, $ufn) +{ + $modx = evolutionCMS(); + global $_lang, $signupemail_message; + global $emailsubject, $emailsender; + global $site_name; + $manager_url = MODX_MANAGER_URL; + $message = sprintf($signupemail_message, $uid, $pwd); // use old method + // replace placeholders + $message = str_replace("[+uid+]", $uid, $message); + $message = str_replace("[+pwd+]", $pwd, $message); + $message = str_replace("[+ufn+]", $ufn, $message); + $message = str_replace("[+sname+]", $site_name, $message); + $message = str_replace("[+saddr+]", $emailsender, $message); + $message = str_replace("[+semail+]", $emailsender, $message); + $message = str_replace("[+surl+]", $manager_url, $message); + + $param = array(); + $param['from'] = "{$site_name}<{$emailsender}>"; + $param['subject'] = $emailsubject; + $param['body'] = $message; + $param['to'] = $email; + $param['type'] = 'text'; + $rs = $modx->sendmail($param); + if (!$rs) { + $modx->manager->saveFormValues(); + $modx->messageQuit("{$email} - {$_lang['error_sending_email']}"); + } } /** @@ -389,87 +388,88 @@ function sendMailMessage($email, $uid, $pwd, $ufn) { * * @param int $id */ -function saveUserSettings($id) { - $modx = evolutionCMS(); - $tbl_user_settings = $modx->getFullTableName('user_settings'); - - $ignore = array( - 'id', - 'oldusername', - 'oldemail', - 'newusername', - 'fullname', - 'newpassword', - 'newpasswordcheck', - 'passwordgenmethod', - 'passwordnotifymethod', - 'specifiedpassword', - 'confirmpassword', - 'email', - 'phone', - 'mobilephone', - 'fax', - 'dob', - 'country', - 'street', - 'city', - 'state', - 'zip', - 'gender', - 'photo', - 'comment', - 'role', - 'failedlogincount', - 'blocked', - 'blockeduntil', - 'blockedafter', - 'user_groups', - 'mode', - 'blockedmode', - 'stay', - 'save', - 'theme_refresher' - ); - - // determine which settings can be saved blank (based on 'default_{settingname}' POST checkbox values) - $defaults = array( - 'upload_images', - 'upload_media', - 'upload_flash', - 'upload_files' - ); - - // get user setting field names - $settings = array(); - foreach($_POST as $n => $v) { - if(in_array($n, $ignore) || (!in_array($n, $defaults) && is_scalar($v) && trim($v) == '') || (!in_array($n, $defaults) && is_array($v) && empty($v))) { - continue; - } // ignore blacklist and empties - $settings[$n] = $v; // this value should be saved - } - - foreach($defaults as $k) { - if(isset($settings['default_' . $k]) && $settings['default_' . $k] == '1') { - unset($settings[$k]); - } - unset($settings['default_' . $k]); - } - - $modx->db->delete($tbl_user_settings, "user='{$id}'"); - - foreach($settings as $n => $vl) { - if(is_array($vl)) { - $vl = implode(",", $vl); - } - if($vl != '') { - $f = array(); - $f['user'] = $id; - $f['setting_name'] = $n; - $f['setting_value'] = $vl; - $f = $modx->db->escape($f); - $modx->db->insert($f, $tbl_user_settings); - } - } +function saveUserSettings($id) +{ + $modx = evolutionCMS(); + $tbl_user_settings = $modx->getFullTableName('user_settings'); + + $ignore = array( + 'id', + 'oldusername', + 'oldemail', + 'newusername', + 'fullname', + 'newpassword', + 'newpasswordcheck', + 'passwordgenmethod', + 'passwordnotifymethod', + 'specifiedpassword', + 'confirmpassword', + 'email', + 'phone', + 'mobilephone', + 'fax', + 'dob', + 'country', + 'street', + 'city', + 'state', + 'zip', + 'gender', + 'photo', + 'comment', + 'role', + 'failedlogincount', + 'blocked', + 'blockeduntil', + 'blockedafter', + 'user_groups', + 'mode', + 'blockedmode', + 'stay', + 'save', + 'theme_refresher' + ); + + // determine which settings can be saved blank (based on 'default_{settingname}' POST checkbox values) + $defaults = array( + 'upload_images', + 'upload_media', + 'upload_flash', + 'upload_files' + ); + + // get user setting field names + $settings = array(); + foreach ($_POST as $n => $v) { + if (in_array($n, $ignore) || (!in_array($n, $defaults) && is_scalar($v) && trim($v) == '') || (!in_array($n, $defaults) && is_array($v) && empty($v))) { + continue; + } // ignore blacklist and empties + $settings[$n] = $v; // this value should be saved + } + + foreach ($defaults as $k) { + if (isset($settings['default_' . $k]) && $settings['default_' . $k] == '1') { + unset($settings[$k]); + } + unset($settings['default_' . $k]); + } + + $modx->db->delete($tbl_user_settings, "user='{$id}'"); + + foreach ($settings as $n => $vl) { + if (is_array($vl)) { + $vl = implode(",", $vl); + } + if ($vl != '') { + $f = array(); + $f['user'] = $id; + $f['setting_name'] = $n; + $f['setting_value'] = $vl; + $f = $modx->db->escape($f); + $modx->db->insert($f, $tbl_user_settings); + } + } } /** @@ -477,11 +477,12 @@ function saveUserSettings($id) { * * @param $msg */ -function webAlertAndQuit($msg) { - global $id, $modx; - $mode = $_POST['mode']; - $modx->manager->saveFormValues($mode); - $modx->webAlertAndQuit($msg, "index.php?a={$mode}" . ($mode == '12' ? "&id={$id}" : '')); +function webAlertAndQuit($msg) +{ + global $id, $modx; + $mode = $_POST['mode']; + $modx->manager->saveFormValues($mode); + $modx->webAlertAndQuit($msg, "index.php?a={$mode}" . ($mode == '12' ? "&id={$id}" : '')); } /** @@ -490,13 +491,14 @@ function webAlertAndQuit($msg) { * @param int $length * @return string */ -function generate_password($length = 10) { - $allowable_characters = "abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"; - $ps_len = strlen($allowable_characters); - mt_srand((double) microtime() * 1000000); - $pass = ""; - for($i = 0; $i < $length; $i++) { - $pass .= $allowable_characters[mt_rand(0, $ps_len - 1)]; - } - return $pass; +function generate_password($length = 10) +{ + $allowable_characters = "abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"; + $ps_len = strlen($allowable_characters); + mt_srand((double) microtime() * 1000000); + $pass = ""; + for ($i = 0; $i < $length; $i++) { + $pass .= $allowable_characters[mt_rand(0, $ps_len - 1)]; + } + return $pass; } diff --git a/manager/processors/save_web_user.processor.php b/manager/processors/save_web_user.processor.php index f1d1e7a98e..9414759856 100755 --- a/manager/processors/save_web_user.processor.php +++ b/manager/processors/save_web_user.processor.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('save_web_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('save_web_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $tbl_web_users = $modx->getFullTableName('web_users'); @@ -11,16 +11,16 @@ $tbl_web_groups = $modx->getFullTableName('web_groups'); $input = $_POST; -foreach($input as $k => $v) { - if($k !== 'comment') { - $v = sanitize($v); - } - $input[$k] = $v; +foreach ($input as $k => $v) { + if ($k !== 'comment') { + $v = sanitize($v); + } + $input[$k] = $v; } $id = (int)$input['id']; $oldusername = $input['oldusername']; -$newusername = !empty ($input['newusername']) ? trim($input['newusername']) : "New User"; +$newusername = !empty($input['newusername']) ? trim($input['newusername']) : "New User"; $esc_newusername = $modx->db->escape($newusername); $fullname = $input['fullname']; $genpassword = $input['newpassword']; @@ -33,7 +33,7 @@ $phone = $input['phone']; $mobilephone = $input['mobilephone']; $fax = $input['fax']; -$dob = !empty ($input['dob']) ? $modx->toTimeStamp($input['dob']) : 0; +$dob = !empty($input['dob']) ? $modx->toTimeStamp($input['dob']) : 0; $country = $input['country']; $street = $input['street']; $city = $input['city']; @@ -50,83 +50,83 @@ $user_groups = $input['user_groups']; // verify password -if($passwordgenmethod == "spec" && $input['specifiedpassword'] != $input['confirmpassword']) { - webAlertAndQuit("Password typed is mismatched"); +if ($passwordgenmethod == "spec" && $input['specifiedpassword'] != $input['confirmpassword']) { + webAlertAndQuit("Password typed is mismatched"); } // verify email -if($email == '' || !preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,24}$/i", $email)) { - webAlertAndQuit("E-mail address doesn't seem to be valid!"); +if ($email == '' || !preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,24}$/i", $email)) { + webAlertAndQuit("E-mail address doesn't seem to be valid!"); } -switch($input['mode']) { - case '87' : // new user - // check if this user name already exist - $rs = $modx->db->select('count(id)', $tbl_web_users, "username='{$esc_newusername}'"); - $limit = $modx->db->getValue($rs); - if($limit > 0) { - webAlertAndQuit("User name is already in use!"); - } - - // check if the email address already exist - if ($modx->config['allow_multiple_emails'] != 1) { - $rs = $modx->db->select('count(id)', $tbl_web_user_attributes, "email='{$esc_email}' AND id!='{$id}'"); - $limit = $modx->db->getValue($rs); - if($limit > 0) { - webAlertAndQuit("Email is already in use!"); - } - } - - // generate a new password for this user - if($specifiedpassword != "" && $passwordgenmethod == "spec") { - if(strlen($specifiedpassword) < 6) { - webAlertAndQuit("Password is too short!"); - } else { - $newpassword = $specifiedpassword; - } - } elseif($specifiedpassword == "" && $passwordgenmethod == "spec") { - webAlertAndQuit("You didn't specify a password for this user!"); - } elseif($passwordgenmethod == 'g') { - $newpassword = generate_password(8); - } else { - webAlertAndQuit("No password generation method specified!"); - } - - // invoke OnBeforeWUsrFormSave event - $modx->invokeEvent("OnBeforeWUsrFormSave", array( - "mode" => "new", - )); - - // create the user account - $field = array(); - $field['username'] = $esc_newusername; - $field['password'] = md5($newpassword); - $internalKey = $modx->db->insert($field, $tbl_web_users); - - $field = compact('internalKey', 'fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'blocked', 'blockeduntil', 'blockedafter'); - $field = $modx->db->escape($field); - $modx->db->insert($field, $tbl_web_user_attributes); - - // Save User Settings - saveUserSettings($internalKey); - - // Set the item name for logger - $_SESSION['itemname'] = $newusername; - - /*******************************************************************************/ - // put the user in the user_groups he/ she should be in - // first, check that up_perms are switched on! - if($use_udperms == 1) { - if(!empty($user_groups)) { - for($i = 0; $i < count($user_groups); $i++) { - $f = array(); - $f['webgroup'] = (int)$user_groups[$i]; - $f['webuser'] = $internalKey; - $modx->db->insert($f, $tbl_web_groups); - } - } - } - // end of user_groups stuff! +switch ($input['mode']) { + case '87': // new user + // check if this user name already exist + $rs = $modx->db->select('count(id)', $tbl_web_users, "username='{$esc_newusername}'"); + $limit = $modx->db->getValue($rs); + if ($limit > 0) { + webAlertAndQuit("User name is already in use!"); + } + + // check if the email address already exist + if ($modx->config['allow_multiple_emails'] != 1) { + $rs = $modx->db->select('count(id)', $tbl_web_user_attributes, "email='{$esc_email}' AND id!='{$id}'"); + $limit = $modx->db->getValue($rs); + if ($limit > 0) { + webAlertAndQuit("Email is already in use!"); + } + } + + // generate a new password for this user + if ($specifiedpassword != "" && $passwordgenmethod == "spec") { + if (strlen($specifiedpassword) < 6) { + webAlertAndQuit("Password is too short!"); + } else { + $newpassword = $specifiedpassword; + } + } elseif ($specifiedpassword == "" && $passwordgenmethod == "spec") { + webAlertAndQuit("You didn't specify a password for this user!"); + } elseif ($passwordgenmethod == 'g') { + $newpassword = generate_password(8); + } else { + webAlertAndQuit("No password generation method specified!"); + } + + // invoke OnBeforeWUsrFormSave event + $modx->invokeEvent("OnBeforeWUsrFormSave", array( + "mode" => "new", + )); + + // create the user account + $field = array(); + $field['username'] = $esc_newusername; + $field['password'] = md5($newpassword); + $internalKey = $modx->db->insert($field, $tbl_web_users); + + $field = compact('internalKey', 'fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'blocked', 'blockeduntil', 'blockedafter'); + $field = $modx->db->escape($field); + $modx->db->insert($field, $tbl_web_user_attributes); + + // Save User Settings + saveUserSettings($internalKey); + + // Set the item name for logger + $_SESSION['itemname'] = $newusername; + + /*******************************************************************************/ + // put the user in the user_groups he/ she should be in + // first, check that up_perms are switched on! + if ($use_udperms == 1) { + if (!empty($user_groups)) { + for ($i = 0; $i < count($user_groups); $i++) { + $f = array(); + $f['webgroup'] = (int)$user_groups[$i]; + $f['webuser'] = $internalKey; + $modx->db->insert($f, $tbl_web_groups); + } + } + } + // end of user_groups stuff! // invoke OnWebSaveUser event $modx->invokeEvent("OnWebSaveUser", array( @@ -144,26 +144,25 @@ "id" => $internalKey )); - if($passwordnotifymethod == 'e') { - sendMailMessage($email, $newusername, $newpassword, $fullname); - if($input['stay'] != '') { - $a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87"; - $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay']; - header($header); - } else { - $header = "Location: index.php?a=99&r=2"; - header($header); - } - } else { - if($input['stay'] != '') { - $a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87"; - $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; - } else { - $stayUrl = "index.php?a=99&r=2"; - } - - include_once "header.inc.php"; - ?> + if ($passwordnotifymethod == 'e') { + sendMailMessage($email, $newusername, $newpassword, $fullname); + if ($input['stay'] != '') { + $a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87"; + $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay']; + header($header); + } else { + $header = "Location: index.php?a=99&r=2"; + header($header); + } + } else { + if ($input['stay'] != '') { + $a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87"; + $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; + } else { + $stayUrl = "index.php?a=99&r=2"; + } + + include_once "header.inc.php"; ?>

    @@ -185,86 +184,86 @@ db->select('count(id)', $tbl_web_users, "username='{$esc_newusername}' AND id!='{$id}'"); - $limit = $modx->db->getValue($rs); - if($limit > 0) { - webAlertAndQuit("User name is already in use!"); - } - - // check if the email address already exists - if ($modx->config['allow_multiple_emails'] != 1) { - $rs = $modx->db->select('count(internalKey)', $tbl_web_user_attributes, "email='{$esc_email}' AND internalKey!='{$id}'"); - $limit = $modx->db->getValue($rs); - if($limit > 0) { - webAlertAndQuit("Email is already in use!"); - } - } - - // invoke OnBeforeWUsrFormSave event - $modx->invokeEvent("OnBeforeWUsrFormSave", array( - "mode" => "upd", - "id" => $id - )); - - // update user name and password - $field = array(); - $field['username'] = $esc_newusername; - if($genpassword == 1) { - $field['password'] = md5($newpassword); - } - $modx->db->update($field, $tbl_web_users, "id='{$id}'"); - $field = compact('fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'failedlogincount', 'blocked', 'blockeduntil', 'blockedafter'); - $field = $modx->db->escape($field); - $modx->db->update($field, $tbl_web_user_attributes, "internalKey='{$id}'"); - - // Save User Settings - saveUserSettings($id); - - // Set the item name for logger - $_SESSION['itemname'] = $newusername; - - /*******************************************************************************/ - // put the user in the user_groups he/ she should be in - // first, check that up_perms are switched on! - if($use_udperms == 1) { - // as this is an existing user, delete his/ her entries in the groups before saving the new groups - $modx->db->delete($tbl_web_groups, "webuser='{$id}'"); - if(!empty($user_groups)) { - for($i = 0; $i < count($user_groups); $i++) { - $field = array(); - $field['webgroup'] = (int)$user_groups[$i]; - $field['webuser'] = $id; - $modx->db->insert($field, $tbl_web_groups); - } - } - } - // end of user_groups stuff! - /*******************************************************************************/ + include_once "footer.inc.php"; + } + break; + case '88': // edit user + // generate a new password for this user + if ($genpassword == 1) { + if ($specifiedpassword != "" && $passwordgenmethod == "spec") { + if (strlen($specifiedpassword) < 6) { + webAlertAndQuit("Password is too short!"); + } else { + $newpassword = $specifiedpassword; + } + } elseif ($specifiedpassword == "" && $passwordgenmethod == "spec") { + webAlertAndQuit("You didn't specify a password for this user!"); + } elseif ($passwordgenmethod == 'g') { + $newpassword = generate_password(8); + } else { + webAlertAndQuit("No password generation method specified!"); + } + } + if ($passwordnotifymethod == 'e') { + sendMailMessage($email, $newusername, $newpassword, $fullname); + } + + // check if the username already exist + $rs = $modx->db->select('count(id)', $tbl_web_users, "username='{$esc_newusername}' AND id!='{$id}'"); + $limit = $modx->db->getValue($rs); + if ($limit > 0) { + webAlertAndQuit("User name is already in use!"); + } + + // check if the email address already exists + if ($modx->config['allow_multiple_emails'] != 1) { + $rs = $modx->db->select('count(internalKey)', $tbl_web_user_attributes, "email='{$esc_email}' AND internalKey!='{$id}'"); + $limit = $modx->db->getValue($rs); + if ($limit > 0) { + webAlertAndQuit("Email is already in use!"); + } + } + + // invoke OnBeforeWUsrFormSave event + $modx->invokeEvent("OnBeforeWUsrFormSave", array( + "mode" => "upd", + "id" => $id + )); + + // update user name and password + $field = array(); + $field['username'] = $esc_newusername; + if ($genpassword == 1) { + $field['password'] = md5($newpassword); + } + $modx->db->update($field, $tbl_web_users, "id='{$id}'"); + $field = compact('fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'failedlogincount', 'blocked', 'blockeduntil', 'blockedafter'); + $field = $modx->db->escape($field); + $modx->db->update($field, $tbl_web_user_attributes, "internalKey='{$id}'"); + + // Save User Settings + saveUserSettings($id); + + // Set the item name for logger + $_SESSION['itemname'] = $newusername; + + /*******************************************************************************/ + // put the user in the user_groups he/ she should be in + // first, check that up_perms are switched on! + if ($use_udperms == 1) { + // as this is an existing user, delete his/ her entries in the groups before saving the new groups + $modx->db->delete($tbl_web_groups, "webuser='{$id}'"); + if (!empty($user_groups)) { + for ($i = 0; $i < count($user_groups); $i++) { + $field = array(); + $field['webgroup'] = (int)$user_groups[$i]; + $field['webuser'] = $id; + $modx->db->insert($field, $tbl_web_groups); + } + } + } + // end of user_groups stuff! + /*******************************************************************************/ // invoke OnWebSaveUser event $modx->invokeEvent("OnWebSaveUser", array( @@ -279,7 +278,7 @@ )); // invoke OnWebChangePassword event - if($genpassword == 1) { + if ($genpassword == 1) { $modx->invokeEvent("OnWebChangePassword", array( "userid" => $id, "username" => $newusername, @@ -293,16 +292,15 @@ "id" => $id )); - if($genpassword == 1 && $passwordnotifymethod == 's') { - if($input['stay'] != '') { - $a = ($input['stay'] == '2') ? "88&id={$id}" : "87"; - $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; - } else { - $stayUrl = "index.php?a=99&r=2"; - } + if ($genpassword == 1 && $passwordnotifymethod == 's') { + if ($input['stay'] != '') { + $a = ($input['stay'] == '2') ? "88&id={$id}" : "87"; + $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; + } else { + $stayUrl = "index.php?a=99&r=2"; + } - include_once "header.inc.php"; - ?> + include_once "header.inc.php"; ?>

    @@ -322,20 +320,20 @@ "; - $param['subject'] = $emailsubject; - $param['body'] = $message; - $param['to'] = $email; - $param['type'] = 'text'; - $rs = $modx->sendmail($param); - if(!$rs) { - $modx->manager->saveFormValues(); - $modx->messageQuit("{$email} - {$_lang['error_sending_email']}"); - } +function sendMailMessage($email, $uid, $pwd, $ufn) +{ + $modx = evolutionCMS(); + global $_lang, $websignupemail_message; + global $emailsubject, $emailsender; + global $site_name, $site_url; + $message = sprintf($websignupemail_message, $uid, $pwd); // use old method + // replace placeholders + $message = str_replace("[+uid+]", $uid, $message); + $message = str_replace("[+pwd+]", $pwd, $message); + $message = str_replace("[+ufn+]", $ufn, $message); + $message = str_replace("[+sname+]", $site_name, $message); + $message = str_replace("[+saddr+]", $emailsender, $message); + $message = str_replace("[+semail+]", $emailsender, $message); + $message = str_replace("[+surl+]", $site_url, $message); + + $param = array(); + $param['from'] = "{$site_name}<{$emailsender}>"; + $param['subject'] = $emailsubject; + $param['body'] = $message; + $param['to'] = $email; + $param['type'] = 'text'; + $rs = $modx->sendmail($param); + if (!$rs) { + $modx->manager->saveFormValues(); + $modx->messageQuit("{$email} - {$_lang['error_sending_email']}"); + } } // Save User Settings -function saveUserSettings($id) { - $modx = evolutionCMS(); - $tbl_web_user_settings = $modx->getFullTableName('web_user_settings'); - - $settings = array( - "login_home", - "allowed_ip", - "allowed_days" - ); - - $modx->db->delete($tbl_web_user_settings, "webuser='{$id}'"); - - foreach($settings as $n) { - $vl = $_POST[$n]; - if(is_array($vl)) { - $vl = implode(",", $vl); - } - if($vl != '') { - $f = array(); - $f['webuser'] = $id; - $f['setting_name'] = $n; - $f['setting_value'] = $vl; - $f = $modx->db->escape($f); - $modx->db->insert($f, $tbl_web_user_settings); - } - } +function saveUserSettings($id) +{ + $modx = evolutionCMS(); + $tbl_web_user_settings = $modx->getFullTableName('web_user_settings'); + + $settings = array( + "login_home", + "allowed_ip", + "allowed_days" + ); + + $modx->db->delete($tbl_web_user_settings, "webuser='{$id}'"); + + foreach ($settings as $n) { + $vl = $_POST[$n]; + if (is_array($vl)) { + $vl = implode(",", $vl); + } + if ($vl != '') { + $f = array(); + $f['webuser'] = $id; + $f['setting_name'] = $n; + $f['setting_value'] = $vl; + $f = $modx->db->escape($f); + $modx->db->insert($f, $tbl_web_user_settings); + } + } } // Web alert - sends an alert to web browser -function webAlertAndQuit($msg) { - global $id, $modx; - $mode = $_POST['mode']; - $modx->manager->saveFormValues($mode); - $modx->webAlertAndQuit($msg, "index.php?a={$mode}" . ($mode == '88' ? "&id={$id}" : '')); +function webAlertAndQuit($msg) +{ + global $id, $modx; + $mode = $_POST['mode']; + $modx->manager->saveFormValues($mode); + $modx->webAlertAndQuit($msg, "index.php?a={$mode}" . ($mode == '88' ? "&id={$id}" : '')); } // Generate password -function generate_password($length = 10) { - $allowable_characters = "abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"; - $ps_len = strlen($allowable_characters); - mt_srand((double) microtime() * 1000000); - $pass = ""; - for($i = 0; $i < $length; $i++) { - $pass .= $allowable_characters[mt_rand(0, $ps_len - 1)]; - } - return $pass; +function generate_password($length = 10) +{ + $allowable_characters = "abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"; + $ps_len = strlen($allowable_characters); + mt_srand((double) microtime() * 1000000); + $pass = ""; + for ($i = 0; $i < $length; $i++) { + $pass .= $allowable_characters[mt_rand(0, $ps_len - 1)]; + } + return $pass; } -function sanitize($str = '', $safecount = 0) { - $modx = evolutionCMS(); - $safecount++; - if(1000 < $safecount) { - exit("error too many loops '{$safecount}'"); - } - if(is_array($str)) { - foreach($str as $i => $v) { - $str[$i] = sanitize($v, $safecount); - } - } else { - // $str = strip_tags($str); // LEAVE < and > intact - $str = htmlspecialchars($str, ENT_NOQUOTES, $modx->config['modx_charset']); - } - return $str; +function sanitize($str = '', $safecount = 0) +{ + $modx = evolutionCMS(); + $safecount++; + if (1000 < $safecount) { + exit("error too many loops '{$safecount}'"); + } + if (is_array($str)) { + foreach ($str as $i => $v) { + $str[$i] = sanitize($v, $safecount); + } + } else { + // $str = strip_tags($str); // LEAVE < and > intact + $str = htmlspecialchars($str, ENT_NOQUOTES, $modx->config['modx_charset']); + } + return $str; } diff --git a/manager/processors/send_message.processor.php b/manager/processors/send_message.processor.php index 868f1ab8d1..7ddd362ec5 100755 --- a/manager/processors/send_message.processor.php +++ b/manager/processors/send_message.processor.php @@ -1,70 +1,74 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('messages')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('messages')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $sendto = $_REQUEST['sendto']; $userid = $_REQUEST['user']; $groupid = $_REQUEST['group']; $subject = $modx->db->escape($_REQUEST['messagesubject']); -if($subject=="") $subject="(no subject)"; +if ($subject=="") { + $subject="(no subject)"; +} $message = $modx->db->escape($_REQUEST['messagebody']); -if($message=="") $message="(no message)"; +if ($message=="") { + $message="(no message)"; +} $postdate = time(); -if($sendto=='u') { - if($userid==0) { - $modx->webAlertAndQuit($_lang["error_no_user_selected"]); - } - $modx->db->insert( - array( - 'recipient' => $userid, - 'sender' => $modx->getLoginUserID(), - 'subject' => $subject, - 'message' => $message, - 'postdate' => $postdate, - 'type' => 'Message', - 'private' => 1, - ), $modx->getFullTableName('user_messages')); +if ($sendto=='u') { + if ($userid==0) { + $modx->webAlertAndQuit($_lang["error_no_user_selected"]); + } + $modx->db->insert( + array( + 'recipient' => $userid, + 'sender' => $modx->getLoginUserID(), + 'subject' => $subject, + 'message' => $message, + 'postdate' => $postdate, + 'type' => 'Message', + 'private' => 1, + ), $modx->getFullTableName('user_messages')); } -if($sendto=='g') { - if($groupid==0) { - $modx->webAlertAndQuit($_lang["error_no_group_selected"]); - } - $rs = $modx->db->select('internalKey', $modx->getFullTableName('user_attributes'), "role='{$groupid}' AND internalKey!='".$modx->getLoginUserID()."'"); - while ($row=$modx->db->getRow($rs)) { - $modx->db->insert( - array( - 'recipient' => $row['internalKey'], - 'sender' => $modx->getLoginUserID(), - 'subject' => $subject, - 'message' => $message, - 'postdate' => $postdate, - 'type' => 'Message', - 'private' => 0, - ), $modx->getFullTableName('user_messages')); - } +if ($sendto=='g') { + if ($groupid==0) { + $modx->webAlertAndQuit($_lang["error_no_group_selected"]); + } + $rs = $modx->db->select('internalKey', $modx->getFullTableName('user_attributes'), "role='{$groupid}' AND internalKey!='" . $modx->getLoginUserID() . "'"); + while ($row=$modx->db->getRow($rs)) { + $modx->db->insert( + array( + 'recipient' => $row['internalKey'], + 'sender' => $modx->getLoginUserID(), + 'subject' => $subject, + 'message' => $message, + 'postdate' => $postdate, + 'type' => 'Message', + 'private' => 0, + ), $modx->getFullTableName('user_messages')); + } } -if($sendto=='a') { - $rs = $modx->db->select('id', $modx->getFullTableName('manager_users'), "id!='".$modx->getLoginUserID()."'"); - while ($row=$modx->db->getRow($rs)) { - $modx->db->insert( - array( - 'recipient' => $row['id'], - 'sender' => $modx->getLoginUserID(), - 'subject' => $subject, - 'message' => $message, - 'postdate' => $postdate, - 'type' => 'Message', - 'private' => 0, - ), $modx->getFullTableName('user_messages')); - } +if ($sendto=='a') { + $rs = $modx->db->select('id', $modx->getFullTableName('manager_users'), "id!='" . $modx->getLoginUserID() . "'"); + while ($row=$modx->db->getRow($rs)) { + $modx->db->insert( + array( + 'recipient' => $row['id'], + 'sender' => $modx->getLoginUserID(), + 'subject' => $subject, + 'message' => $message, + 'postdate' => $postdate, + 'type' => 'Message', + 'private' => 0, + ), $modx->getFullTableName('user_messages')); + } } $header = "Location: index.php?a=10"; diff --git a/manager/processors/undelete_content.processor.php b/manager/processors/undelete_content.processor.php index 84cdc95f72..928ad54133 100755 --- a/manager/processors/undelete_content.processor.php +++ b/manager/processors/undelete_content.processor.php @@ -1,14 +1,14 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('delete_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('delete_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id'])? (int)$_REQUEST['id'] : 0; -if($id==0) { - $modx->webAlertAndQuit($_lang["error_no_id"]); +if ($id==0) { + $modx->webAlertAndQuit($_lang["error_no_id"]); } /************ webber ********/ @@ -16,10 +16,10 @@ $pid=($content['parent']==0?$id:$content['parent']); /************** webber *************/ -$sd=isset($_REQUEST['dir'])?'&dir='.$_REQUEST['dir']:'&dir=DESC'; -$sb=isset($_REQUEST['sort'])?'&sort='.$_REQUEST['sort']:'&sort=createdon'; -$pg=isset($_REQUEST['page'])?'&page='.(int)$_REQUEST['page']:''; -$add_path=$sd.$sb.$pg; +$sd=isset($_REQUEST['dir'])?'&dir=' . $_REQUEST['dir']:'&dir=DESC'; +$sb=isset($_REQUEST['sort'])?'&sort=' . $_REQUEST['sort']:'&sort=createdon'; +$pg=isset($_REQUEST['page'])?'&page=' . (int)$_REQUEST['page']:''; +$add_path=$sd . $sb . $pg; /***********************************/ @@ -31,15 +31,15 @@ $udperms->document = $id; $udperms->role = $_SESSION['mgrRole']; -if(!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); +if (!$udperms->checkPermissions()) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); } // get the timestamp on which the document was deleted. $rs = $modx->db->select('deletedon', $modx->getFullTableName('site_content'), "id='{$id}' AND deleted=1"); $deltime = $modx->db->getValue($rs); -if(!$deltime) { - $modx->webAlertAndQuit("Couldn't find document to determine it's date of deletion!"); +if (!$deltime) { + $modx->webAlertAndQuit("Couldn't find document to determine it's date of deletion!"); } $children = array(); @@ -47,38 +47,38 @@ /** * @param int $parent */ -function getChildren($parent) { - - $modx = evolutionCMS(); - global $children; - global $deltime; - - $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent='".(int)$parent."' AND deleted=1 AND deletedon='".(int)$deltime."'"); - // the document has children documents, we'll need to delete those too - while ($row=$modx->db->getRow($rs)) { - $children[] = $row['id']; - getChildren($row['id']); - //echo "Found childNode of parentNode $parent: ".$row['id']."
    "; - } +function getChildren($parent) +{ + $modx = evolutionCMS(); + global $children; + global $deltime; + + $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent='" . (int)$parent . "' AND deleted=1 AND deletedon='" . (int)$deltime . "'"); + // the document has children documents, we'll need to delete those too + while ($row=$modx->db->getRow($rs)) { + $children[] = $row['id']; + getChildren($row['id']); + //echo "Found childNode of parentNode $parent: ".$row['id']."
    "; + } } getChildren($id); -if(count($children)>0) { - $modx->db->update( - array( - 'deleted' => 0, - 'deletedby' => 0, - 'deletedon' => 0, - ), $modx->getFullTableName('site_content'), "id IN(".implode(", ", $children).")"); +if (count($children)>0) { + $modx->db->update( + array( + 'deleted' => 0, + 'deletedby' => 0, + 'deletedon' => 0, + ), $modx->getFullTableName('site_content'), "id IN(" . implode(", ", $children) . ")"); } //'undelete' the document. $modx->db->update( - array( - 'deleted' => 0, - 'deletedby' => 0, - 'deletedon' => 0, - ), $modx->getFullTableName('site_content'), "id='{$id}'"); + array( + 'deleted' => 0, + 'deletedby' => 0, + 'deletedon' => 0, + ), $modx->getFullTableName('site_content'), "id='{$id}'"); $modx->invokeEvent("OnDocFormUnDelete", array( @@ -93,5 +93,5 @@ function getChildren($parent) { $modx->clearCache('full'); // finished emptying cache - redirect -$header="Location: index.php?a=3&id=$pid&r=1".$add_path; +$header="Location: index.php?a=3&id=$pid&r=1" . $add_path; header($header); diff --git a/manager/processors/unpublish_content.processor.php b/manager/processors/unpublish_content.processor.php index 43b5b72ff8..1de6b8cec3 100755 --- a/manager/processors/unpublish_content.processor.php +++ b/manager/processors/unpublish_content.processor.php @@ -1,14 +1,14 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('save_document')||!$modx->hasPermission('publish_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('save_document')||!$modx->hasPermission('publish_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id'])? (int)$_REQUEST['id'] : 0; -if($id==0) { - $modx->webAlertAndQuit($_lang["error_no_id"]); +if ($id==0) { + $modx->webAlertAndQuit($_lang["error_no_id"]); } /************webber ********/ @@ -16,10 +16,10 @@ $pid=($content['parent']==0?$id:$content['parent']); /************** webber *************/ -$sd=isset($_REQUEST['dir'])?'&dir='.$_REQUEST['dir']:'&dir=DESC'; -$sb=isset($_REQUEST['sort'])?'&sort='.$_REQUEST['sort']:'&sort=createdon'; -$pg=isset($_REQUEST['page'])?'&page='.(int)$_REQUEST['page']:''; -$add_path=$sd.$sb.$pg; +$sd=isset($_REQUEST['dir'])?'&dir=' . $_REQUEST['dir']:'&dir=DESC'; +$sb=isset($_REQUEST['sort'])?'&sort=' . $_REQUEST['sort']:'&sort=createdon'; +$pg=isset($_REQUEST['page'])?'&page=' . (int)$_REQUEST['page']:''; +$add_path=$sd . $sb . $pg; /***********************************/ @@ -32,24 +32,24 @@ $udperms->document = $id; $udperms->role = $_SESSION['mgrRole']; -if(!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); +if (!$udperms->checkPermissions()) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); } // update the document $modx->db->update( - array( - 'published' => 0, - 'pub_date' => 0, - 'unpub_date' => 0, - 'editedby' => $modx->getLoginUserID(), - 'editedon' => time(), - 'publishedby' => 0, - 'publishedon' => 0, - ), $modx->getFullTableName('site_content'), "id='{$id}'"); + array( + 'published' => 0, + 'pub_date' => 0, + 'unpub_date' => 0, + 'editedby' => $modx->getLoginUserID(), + 'editedon' => time(), + 'publishedby' => 0, + 'publishedon' => 0, + ), $modx->getFullTableName('site_content'), "id='{$id}'"); // invoke OnDocUnPublished event -$modx->invokeEvent("OnDocUnPublished",array("docid"=>$id)); +$modx->invokeEvent("OnDocUnPublished", array("docid"=>$id)); // Set the item name for logger $_SESSION['itemname'] = $content['pagetitle']; @@ -57,6 +57,6 @@ // empty cache $modx->clearCache('full'); -$header="Location: index.php?a=3&id=$pid&r=1".$add_path; +$header="Location: index.php?a=3&id=$pid&r=1" . $add_path; header($header); diff --git a/manager/processors/user_documents_permissions.class.php b/manager/processors/user_documents_permissions.class.php index 50fdf27bbe..7fbf82d6a0 100755 --- a/manager/processors/user_documents_permissions.class.php +++ b/manager/processors/user_documents_permissions.class.php @@ -24,7 +24,6 @@ class udperms */ public function checkPermissions() { - global $udperms_allowroot; $modx = evolutionCMS(); diff --git a/manager/processors/web_access_groups.processor.php b/manager/processors/web_access_groups.processor.php index 477bff505f..82c1aa24e0 100755 --- a/manager/processors/web_access_groups.processor.php +++ b/manager/processors/web_access_groups.processor.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if(!$modx->hasPermission('web_access_permissions')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if (!$modx->hasPermission('web_access_permissions')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // web access group processor. @@ -20,111 +20,111 @@ $operation = $_REQUEST['operation']; switch ($operation) { - case "add_user_group" : - $newgroup = $_REQUEST['newusergroup']; - if(empty($newgroup)) { - $modx->webAlertAndQuit("No group name specified."); - } else { - $id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_webgroup_names); + case "add_user_group": + $newgroup = $_REQUEST['newusergroup']; + if (empty($newgroup)) { + $modx->webAlertAndQuit("No group name specified."); + } else { + $id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_webgroup_names); - // invoke OnWebCreateGroup event - $modx->invokeEvent('OnWebCreateGroup', array( - 'groupid' => $id, - 'groupname' => $newgroup, - )); - } - break; - case "add_document_group" : - $newgroup = $_REQUEST['newdocgroup']; - if(empty($newgroup)) { - $modx->webAlertAndQuit("No group name specified."); - } else { - $id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_documentgroup_names); + // invoke OnWebCreateGroup event + $modx->invokeEvent('OnWebCreateGroup', array( + 'groupid' => $id, + 'groupname' => $newgroup, + )); + } + break; + case "add_document_group": + $newgroup = $_REQUEST['newdocgroup']; + if (empty($newgroup)) { + $modx->webAlertAndQuit("No group name specified."); + } else { + $id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_documentgroup_names); - // invoke OnCreateDocGroup event - $modx->invokeEvent('OnCreateDocGroup', array( - 'groupid' => $id, - 'groupname' => $newgroup, - )); - } - break; - case "delete_user_group" : - $updategroupaccess = true; - $usergroup = (int)$_REQUEST['usergroup']; - if(empty($usergroup)) { - $modx->webAlertAndQuit("No user group id specified for deletion."); - } else { - $modx->db->delete($tbl_webgroup_names, "id='{$usergroup}'"); + // invoke OnCreateDocGroup event + $modx->invokeEvent('OnCreateDocGroup', array( + 'groupid' => $id, + 'groupname' => $newgroup, + )); + } + break; + case "delete_user_group": + $updategroupaccess = true; + $usergroup = (int)$_REQUEST['usergroup']; + if (empty($usergroup)) { + $modx->webAlertAndQuit("No user group id specified for deletion."); + } else { + $modx->db->delete($tbl_webgroup_names, "id='{$usergroup}'"); - $modx->db->delete($tbl_webgroup_access, "webgroup='{$usergroup}'"); + $modx->db->delete($tbl_webgroup_access, "webgroup='{$usergroup}'"); - $modx->db->delete($tbl_web_groups, "webuser='{$usergroup}'"); - } - break; - case "delete_document_group" : - $group = (int)$_REQUEST['documentgroup']; - if(empty($group)) { - $modx->webAlertAndQuit("No document group id specified for deletion."); - } else { - $modx->db->delete($tbl_documentgroup_names, "id='{$group}'"); + $modx->db->delete($tbl_web_groups, "webuser='{$usergroup}'"); + } + break; + case "delete_document_group": + $group = (int)$_REQUEST['documentgroup']; + if (empty($group)) { + $modx->webAlertAndQuit("No document group id specified for deletion."); + } else { + $modx->db->delete($tbl_documentgroup_names, "id='{$group}'"); - $modx->db->delete($tbl_webgroup_access, "documentgroup='{$group}'"); + $modx->db->delete($tbl_webgroup_access, "documentgroup='{$group}'"); - $modx->db->delete($tbl_document_groups, "document_group='{$group}'"); - } - break; - case "rename_user_group" : - $newgroupname = $_REQUEST['newgroupname']; - if(empty($newgroupname)) { - $modx->webAlertAndQuit("No group name specified."); - } - $groupid = (int)$_REQUEST['groupid']; - if(empty($groupid)) { - $modx->webAlertAndQuit("No user group id specified for rename."); - } - $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_webgroup_names, "id='{$groupid}'"); - break; - case "rename_document_group" : - $newgroupname = $_REQUEST['newgroupname']; - if(empty($newgroupname)) { - $modx->webAlertAndQuit("No group name specified."); - } - $groupid = (int)$_REQUEST['groupid']; - if(empty($groupid)) { - $modx->webAlertAndQuit("No document group id specified for rename."); - } - $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_documentgroup_names, "id='{$groupid}'"); - break; - case "add_document_group_to_user_group" : - $updategroupaccess = true; - $usergroup = (int)$_REQUEST['usergroup']; - $docgroup = (int)$_REQUEST['docgroup']; - $rs = $modx->db->select('COUNT(*)', $tbl_webgroup_access, "webgroup='{$usergroup}' AND documentgroup='{$docgroup}'"); - $limit = $modx->db->getValue($rs); - if($limit<=0) { - $modx->db->insert(array('webgroup'=>$usergroup, 'documentgroup'=>$docgroup), $tbl_webgroup_access); - } else { - //alert user that coupling already exists? - } - break; - case "remove_document_group_from_user_group" : - $updategroupaccess = true; - $coupling = (int)$_REQUEST['coupling']; - $modx->db->delete($tbl_webgroup_access, "id='{$coupling}'"); - break; - default : - $modx->webAlertAndQuit("No operation set in request."); + $modx->db->delete($tbl_document_groups, "document_group='{$group}'"); + } + break; + case "rename_user_group": + $newgroupname = $_REQUEST['newgroupname']; + if (empty($newgroupname)) { + $modx->webAlertAndQuit("No group name specified."); + } + $groupid = (int)$_REQUEST['groupid']; + if (empty($groupid)) { + $modx->webAlertAndQuit("No user group id specified for rename."); + } + $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_webgroup_names, "id='{$groupid}'"); + break; + case "rename_document_group": + $newgroupname = $_REQUEST['newgroupname']; + if (empty($newgroupname)) { + $modx->webAlertAndQuit("No group name specified."); + } + $groupid = (int)$_REQUEST['groupid']; + if (empty($groupid)) { + $modx->webAlertAndQuit("No document group id specified for rename."); + } + $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_documentgroup_names, "id='{$groupid}'"); + break; + case "add_document_group_to_user_group": + $updategroupaccess = true; + $usergroup = (int)$_REQUEST['usergroup']; + $docgroup = (int)$_REQUEST['docgroup']; + $rs = $modx->db->select('COUNT(*)', $tbl_webgroup_access, "webgroup='{$usergroup}' AND documentgroup='{$docgroup}'"); + $limit = $modx->db->getValue($rs); + if ($limit<=0) { + $modx->db->insert(array('webgroup'=>$usergroup, 'documentgroup'=>$docgroup), $tbl_webgroup_access); + } else { + //alert user that coupling already exists? + } + break; + case "remove_document_group_from_user_group": + $updategroupaccess = true; + $coupling = (int)$_REQUEST['coupling']; + $modx->db->delete($tbl_webgroup_access, "id='{$coupling}'"); + break; + default: + $modx->webAlertAndQuit("No operation set in request."); } // secure web documents - flag as private -if($updategroupaccess==true){ - include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php"; - secureWebDocument(); +if ($updategroupaccess==true) { + include MODX_MANAGER_PATH . "includes/secure_web_documents.inc.php"; + secureWebDocument(); - // Update the private group column - $modx->db->update( - 'dgn.private_webgroup = (wga.webgroup IS NOT NULL)', - "{$tbl_documentgroup_names} AS dgn LEFT JOIN {$tbl_webgroup_access} AS wga ON wga.documentgroup = dgn.id"); + // Update the private group column + $modx->db->update( + 'dgn.private_webgroup = (wga.webgroup IS NOT NULL)', + "{$tbl_documentgroup_names} AS dgn LEFT JOIN {$tbl_webgroup_access} AS wga ON wga.documentgroup = dgn.id"); } $header = "Location: index.php?a=91"; From c463ba651b8c5b09c4b4f97f29e92b8d3be6df6c Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Fri, 1 Jun 2018 00:38:30 +0300 Subject: [PATCH 247/274] revert --- index.php | 112 +- .../actions/access_permissions.dynamic.php | 181 +-- manager/actions/bkmanager.static.php | 65 +- .../inc/Module_Categories_Manager.php | 1 + .../category_mgr/inc/request_trigger.inc.php | 142 +- manager/actions/document_data.static.php | 338 ++-- manager/actions/eventlog.dynamic.php | 74 +- manager/actions/eventlog_details.dynamic.php | 32 +- manager/actions/export_site.static.php | 24 +- manager/actions/files.dynamic.php | 34 +- manager/actions/help.static.php | 63 +- manager/actions/import_site.static.php | 690 ++++----- manager/actions/logging.static.php | 167 +- manager/actions/messages.static.php | 67 +- manager/actions/modules.static.php | 4 +- manager/actions/move_document.dynamic.php | 2 +- manager/actions/mutate_categories.dynamic.php | 48 +- manager/actions/mutate_content.dynamic.php | 1197 +++++++------- .../actions/mutate_htmlsnippet.dynamic.php | 4 +- .../actions/mutate_menuindex_sort.dynamic.php | 4 +- manager/actions/mutate_module.dynamic.php | 207 ++- .../mutate_module_resources.dynamic.php | 184 +-- manager/actions/mutate_password.dynamic.php | 8 +- manager/actions/mutate_plugin.dynamic.php | 2 +- .../mutate_plugin_priority.dynamic.php | 4 +- manager/actions/mutate_role.dynamic.php | 264 ++-- manager/actions/mutate_settings.dynamic.php | 56 +- .../mutate_settings/snippet_smtp.inc.php | 12 +- .../tab1_site_settings.inc.php | 122 +- .../tab2_furl_settings.inc.php | 36 +- .../tab3_user_settings.inc.php | 14 +- .../tab4_manager_settings.inc.php | 4 +- .../tab5_security_settings.inc.php | 58 +- .../tab6_filemanager_settings.inc.php | 4 +- .../tab7_filebrowser_settings.inc.php | 6 +- manager/actions/mutate_snippet.dynamic.php | 4 +- .../mutate_template_tv_rank.dynamic.php | 4 +- manager/actions/mutate_templates.dynamic.php | 263 ++-- manager/actions/mutate_tmplvars.dynamic.php | 262 ++-- manager/actions/mutate_tv_rank.dynamic.php | 4 +- manager/actions/mutate_user.dynamic.php | 799 ++++++++++ manager/actions/mutate_web_user.dynamic.php | 209 ++- manager/actions/phpinfo.static.php | 2 +- manager/actions/refresh_site.dynamic.php | 20 +- manager/actions/resource_selector.static.php | 2 +- manager/actions/resources.static.php | 132 +- manager/actions/resources/functions.inc.php | 352 ++--- .../actions/resources/mgrResources.class.php | 226 ++- .../actions/resources/tab1_templates.inc.php | 8 +- .../resources/tab2_templatevars.inc.php | 8 +- manager/actions/resources/tab3_chunks.inc.php | 8 +- .../actions/resources/tab4_snippets.inc.php | 8 +- .../actions/resources/tab5_plugins.inc.php | 23 +- .../resources/tab6_categoryview.inc.php | 2 +- manager/actions/role_management.static.php | 38 +- manager/actions/search.static.php | 105 +- manager/actions/site_schedule.static.php | 77 +- manager/actions/sysinfo.static.php | 33 +- manager/actions/user_management.static.php | 114 +- .../web_access_permissions.dynamic.php | 179 ++- .../actions/web_user_management.static.php | 64 +- manager/actions/welcome.static.php | 550 ++++--- manager/frames/1.php | 134 +- manager/frames/mainmenu.php | 702 +++++---- manager/frames/nodes.functions.inc.php | 16 +- manager/frames/tree.php | 70 +- manager/includes/SystemEvent.class.php | 70 - manager/includes/accesscontrol.inc.php | 11 +- manager/includes/actionlist.inc.php | 265 ++-- manager/includes/active_user_locks.inc.php | 4 +- manager/includes/charsets.php | 48 +- manager/includes/config_check.inc.php | 140 +- manager/includes/controls/contextmenu.php | 94 +- manager/includes/controls/datagrid.class.php | 475 +++--- .../includes/controls/datasetpager.class.php | 344 ++-- manager/includes/controls/phpmailer/OAuth.php | 2 +- .../includes/controls/phpmailer/PHPMailer.php | 182 ++- manager/includes/controls/phpmailer/POP3.php | 6 +- manager/includes/controls/phpmailer/SMTP.php | 44 +- manager/includes/debug.inc.php | 15 +- manager/includes/default_config.php | 3 + .../includes/document.parser.class.inc.php | 296 ++-- manager/includes/error.class.inc.php | 1 + .../extenders/dbapi.mysql.class.inc.php | 20 +- .../extenders/dbapi.mysqli.class.inc.php | 37 +- .../extenders/deprecated.functions.inc.php | 6 +- manager/includes/extenders/ex_dbapi.inc.php | 8 +- .../includes/extenders/export.class.inc.php | 7 +- .../includes/extenders/maketable.class.php | 8 +- .../extenders/manager.api.class.inc.php | 1 + .../includes/extenders/message.quit.inc.php | 77 +- .../extenders/modifiers.class.inc.php | 1089 +++++-------- .../extenders/modifiers/mdf_addbreak.inc.php | 17 +- .../extenders/modifiers/mdf_getimage.inc.php | 23 +- .../extenders/modifiers/mdf_memberof.inc.php | 25 +- .../extenders/modifiers/mdf_moduser.inc.php | 7 +- .../extenders/modifiers/mdf_summary.inc.php | 57 +- .../extenders/modifiers/mdf_wordwrap.inc.php | 4 +- manager/includes/footer.inc.php | 30 +- manager/includes/header.inc.php | 12 +- manager/includes/log.class.inc.php | 10 +- manager/includes/manager.lockout.inc.php | 99 +- manager/includes/menu.class.inc.php | 3 +- manager/includes/preload.functions.inc.php | 16 +- manager/includes/protect.inc.php | 4 +- manager/includes/sysalert.display.inc.php | 45 +- .../includes/template.parser.class.inc.php | 285 ++-- manager/includes/tmplvars.commands.inc.php | 97 +- manager/includes/tmplvars.format.inc.php | 661 ++++---- manager/includes/tmplvars.inc.php | 504 +++--- manager/includes/user_settings.inc.php | 2 +- manager/includes/veriword.php | 61 +- manager/index.php | 1377 ++++++++--------- manager/media/browser/mcpuk/browse.php | 17 +- manager/media/browser/mcpuk/browser.php | 18 +- manager/media/browser/mcpuk/config.php | 22 +- manager/media/browser/mcpuk/core/autoload.php | 44 +- manager/media/browser/mcpuk/core/browser.php | 611 +++----- .../browser/mcpuk/core/types/type_img.php | 11 +- .../browser/mcpuk/core/types/type_mime.php | 20 +- manager/media/browser/mcpuk/core/uploader.php | 474 +++--- manager/media/browser/mcpuk/css.php | 6 +- .../media/browser/mcpuk/js/browser/joiner.php | 6 +- manager/media/browser/mcpuk/js_localize.php | 10 +- manager/media/browser/mcpuk/lang/af.php | 2 + manager/media/browser/mcpuk/lang/bg.php | 2 + manager/media/browser/mcpuk/lang/ca.php | 2 + manager/media/browser/mcpuk/lang/cs.php | 2 + manager/media/browser/mcpuk/lang/da.php | 4 +- manager/media/browser/mcpuk/lang/de.php | 2 + manager/media/browser/mcpuk/lang/el.php | 2 + manager/media/browser/mcpuk/lang/en.php | 2 + manager/media/browser/mcpuk/lang/es.php | 2 + manager/media/browser/mcpuk/lang/et.php | 2 + manager/media/browser/mcpuk/lang/fa.php | 2 + manager/media/browser/mcpuk/lang/fi.php | 2 + manager/media/browser/mcpuk/lang/fr.php | 2 + manager/media/browser/mcpuk/lang/he.php | 2 + manager/media/browser/mcpuk/lang/hu.php | 2 + manager/media/browser/mcpuk/lang/id.php | 2 + manager/media/browser/mcpuk/lang/it.php | 2 + manager/media/browser/mcpuk/lang/ja.php | 2 + manager/media/browser/mcpuk/lang/lt.php | 2 + manager/media/browser/mcpuk/lang/nl.php | 2 + manager/media/browser/mcpuk/lang/no.php | 2 + manager/media/browser/mcpuk/lang/pl.php | 2 + manager/media/browser/mcpuk/lang/pt-br.php | 2 + manager/media/browser/mcpuk/lang/pt.php | 2 + manager/media/browser/mcpuk/lang/ro.php | 2 + manager/media/browser/mcpuk/lang/ru.php | 2 + manager/media/browser/mcpuk/lang/sk.php | 2 + manager/media/browser/mcpuk/lang/sv.php | 2 + manager/media/browser/mcpuk/lang/tr.php | 2 + manager/media/browser/mcpuk/lang/uk.php | 6 +- manager/media/browser/mcpuk/lang/vi.php | 2 + manager/media/browser/mcpuk/lang/zh-cn.php | 2 + .../browser/mcpuk/lib/class_fastImage.php | 426 ++--- manager/media/browser/mcpuk/lib/class_gd.php | 353 ++--- .../media/browser/mcpuk/lib/class_image.php | 270 ++-- .../browser/mcpuk/lib/class_image_gd.php | 197 +-- .../browser/mcpuk/lib/class_image_gmagick.php | 112 +- .../browser/mcpuk/lib/class_image_imagick.php | 112 +- .../media/browser/mcpuk/lib/class_input.php | 23 +- .../browser/mcpuk/lib/class_zipFolder.php | 20 +- .../media/browser/mcpuk/lib/helper_dir.php | 106 +- .../media/browser/mcpuk/lib/helper_file.php | 112 +- .../browser/mcpuk/lib/helper_httpCache.php | 86 +- .../media/browser/mcpuk/lib/helper_path.php | 100 +- .../media/browser/mcpuk/lib/helper_text.php | 45 +- .../media/browser/mcpuk/tpl/tpl_browser.php | 4 +- manager/media/browser/mcpuk/tpl/tpl_css.php | 2 +- .../browser/mcpuk/tpl/tpl_javascript.php | 24 +- manager/media/calendar/datepicker.inc.php | 20 +- .../script/air-datepicker/datepicker.inc.php | 30 +- .../common/moo-datepicker/datepicker.inc.php | 16 +- manager/media/style/default/ajax.php | 19 +- manager/media/style/default/style.php | 242 +-- manager/media/style/default/welcome.php | 14 +- .../processors/access_groups.processor.php | 196 +-- .../processors/cache_sync.class.processor.php | 19 +- .../processors/delete_category.processor.php | 4 +- .../processors/delete_content.processor.php | 48 +- .../processors/delete_eventlog.processor.php | 18 +- .../delete_htmlsnippet.processor.php | 22 +- .../processors/delete_message.processor.php | 2 +- .../processors/delete_module.processor.php | 22 +- .../processors/delete_plugin.processor.php | 22 +- manager/processors/delete_role.processor.php | 18 +- .../processors/delete_snippet.processor.php | 22 +- .../processors/delete_template.processor.php | 40 +- .../processors/delete_tmplvars.processor.php | 40 +- manager/processors/delete_user.processor.php | 34 +- .../processors/delete_web_user.processor.php | 30 +- .../duplicate_content.processor.php | 225 ++- .../duplicate_htmlsnippet.processor.php | 31 +- .../processors/duplicate_module.processor.php | 86 +- .../processors/duplicate_plugin.processor.php | 49 +- .../duplicate_snippet.processor.php | 33 +- .../duplicate_template.processor.php | 43 +- .../duplicate_tmplvars.processor.php | 65 +- manager/processors/empty_table.processor.php | 6 +- .../processors/execute_module.processor.php | 141 +- manager/processors/export_site.processor.php | 32 +- manager/processors/login.processor.php | 418 +++-- manager/processors/logout.processor.php | 18 +- .../processors/move_document.processor.php | 157 +- .../processors/optimize_table.processor.php | 36 +- .../processors/publish_content.processor.php | 44 +- manager/processors/purge_plugin.processor.php | 17 +- .../processors/remove_content.processor.php | 40 +- .../processors/remove_installer.processor.php | 42 +- manager/processors/remove_locks.processor.php | 38 +- manager/processors/save_content.processor.php | 110 +- .../processors/save_htmlsnippet.processor.php | 2 +- manager/processors/save_module.processor.php | 2 +- .../processors/save_password.processor.php | 36 +- manager/processors/save_plugin.processor.php | 23 +- manager/processors/save_role.processor.php | 220 +-- .../processors/save_settings.processor.php | 233 +-- manager/processors/save_snippet.processor.php | 2 +- .../processors/save_template.processor.php | 2 +- .../processors/save_tmplvars.processor.php | 7 +- manager/processors/save_user.processor.php | 764 +++++---- .../processors/save_web_user.processor.php | 597 ++++--- manager/processors/send_message.processor.php | 104 +- .../processors/undelete_content.processor.php | 78 +- .../unpublish_content.processor.php | 44 +- .../user_documents_permissions.class.php | 1 + .../web_access_groups.processor.php | 196 +-- 229 files changed, 11568 insertions(+), 11793 deletions(-) delete mode 100644 manager/includes/SystemEvent.class.php diff --git a/index.php b/index.php index 3d2e2beef2..5322472776 100644 --- a/index.php +++ b/index.php @@ -1,42 +1,42 @@ stopOnNotice = false; // Don't show PHP errors to the public -if (!isset($_SESSION['mgrValidated']) || !$_SESSION['mgrValidated']) { - @ini_set("display_errors", "0"); +if(!isset($_SESSION['mgrValidated']) || !$_SESSION['mgrValidated']) { + @ini_set("display_errors","0"); } -if (MODX_CLI) { +if(MODX_CLI){ @set_time_limit(0); - @ini_set('max_execution_time', 0); + @ini_set('max_execution_time',0); } // execute the parser if index.php was not included diff --git a/manager/actions/access_permissions.dynamic.php b/manager/actions/access_permissions.dynamic.php index a354a2e9fc..0450f6ad9a 100755 --- a/manager/actions/access_permissions.dynamic.php +++ b/manager/actions/access_permissions.dynamic.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('access_permissions')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('access_permissions')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // Get table names (alphabetical) @@ -17,25 +17,25 @@ // find all document groups, for the select :) $rs = $modx->db->select('*', $tbl_documentgroup_names, '', 'name'); -if ($modx->db->getRecordCount($rs) < 1) { - $docgroupselector = '[no groups to add]'; +if($modx->db->getRecordCount($rs) < 1) { + $docgroupselector = '[no groups to add]'; } else { - $docgroupselector = '\n"; + $docgroupselector = '\n"; } $rs = $modx->db->select('*', $tbl_membergroup_names, '', 'name'); -if ($modx->db->getRecordCount($rs) < 1) { - $usrgroupselector = '[no user groups]'; +if($modx->db->getRecordCount($rs) < 1) { + $usrgroupselector = '[no user groups]'; } else { - $usrgroupselector = '\n"; + $usrgroupselector = '\n"; } ?> @@ -96,23 +96,24 @@ function deletegroup(groupid, type) { db->select('groupnames.*, users.id AS user_id, users.username user_name', $tbl_membergroup_names . ' AS groupnames + $rs = $modx->db->select('groupnames.*, users.id AS user_id, users.username user_name', $tbl_membergroup_names . ' AS groupnames LEFT JOIN ' . $tbl_member_groups . ' AS groups ON groups.user_group = groupnames.id LEFT JOIN ' . $tbl_manager_users . ' AS users ON users.id = groups.member', '', 'groupnames.name, user_name'); - if ($modx->db->getRecordCount($rs) < 1) { - ?> + if($modx->db->getRecordCount($rs) < 1) { + ?>
    + } else { + ?>
    db->getRow($rs)) { - if ($pid != $row['id']) { - if ($pid != '') { - echo '
    '; - } ?> + $pid = ''; + while($row = $modx->db->getRow($rs)) { + if($pid != $row['id']) { + if($pid != '') { + echo '
    '; + } + ?>
    @@ -127,20 +128,21 @@ function deletegroup(groupid, type) {
    + } + if(!$row['user_id']) { + ?> + $pid = $row['id']; + continue; + } + ?> + $pid = $row['id']; + } + } + ?>
    @@ -165,23 +167,24 @@ function deletegroup(groupid, type) { db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $tbl_documentgroup_names . ' AS dgnames + $rs = $modx->db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $tbl_documentgroup_names . ' AS dgnames LEFT JOIN ' . $tbl_document_groups . ' AS dg ON dg.document_group = dgnames.id LEFT JOIN ' . $tbl_site_content . ' AS sc ON sc.id = dg.document', '', 'dgnames.name, sc.id'); - if ($modx->db->getRecordCount($rs) < 1) { - ?> + if($modx->db->getRecordCount($rs) < 1) { + ?>
    + } else { + ?>
    db->getRow($rs)) { - if ($pid != $row['id']) { - if ($pid != '') { - echo '
    '; - } ?> + $pid = ''; + while($row = $modx->db->getRow($rs)) { + if($pid != $row['id']) { + if($pid != '') { + echo '
    '; + } + ?>
    @@ -196,20 +199,21 @@ function deletegroup(groupid, type) {
    + } + if(!$row['doc_id']) { + ?> + $pid = $row['id']; + continue; + } + ?> + $pid = $row['id']; + } + } + ?>
    @@ -221,16 +225,16 @@ function deletegroup(groupid, type) {

    db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $tbl_membergroup_names . ' AS groupnames + // User/Document Group Links + $rs = $modx->db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $tbl_membergroup_names . ' AS groupnames LEFT JOIN ' . $tbl_membergroup_access . ' AS groupacc ON groupacc.membergroup = groupnames.id LEFT JOIN ' . $tbl_documentgroup_names . ' AS dgnames ON dgnames.id = groupacc.documentgroup', '', 'name, dg_name'); - if ($modx->db->getRecordCount($rs) < 1) { - ?> + if($modx->db->getRecordCount($rs) < 1) { + ?>
    + } else { + ?>
    @@ -246,35 +250,38 @@ function deletegroup(groupid, type) {
      db->getRow($rs)) { - if ($row['id'] != $pid) { - if ($pid != '') { - echo '
    '; - } // close previous one ?> + $pid = ''; + while($row = $modx->db->getRow($rs)) { + if($row['id'] != $pid) { + if($pid != '') { + echo ''; + } // close previous one + ?>
  • ' . $_lang['no_groups_found'] . ''; - $pid = ''; - continue; - } else { - echo '
      '; - } - } - if (!$row['dg_id']) { - continue; - } ?> + if(!$row['dg_id']) { + echo '' . $_lang['no_groups_found'] . ''; + $pid = ''; + continue; + } else { + echo '
        '; + } + } + if(!$row['dg_id']) { + continue; + } + ?>
      • ()
      • + $pid = $row['id']; + } + ?>
      + } + ?>
    diff --git a/manager/actions/bkmanager.static.php b/manager/actions/bkmanager.static.php index 64b910ac50..6927c17d53 100755 --- a/manager/actions/bkmanager.static.php +++ b/manager/actions/bkmanager.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('bk_manager')) { @@ -274,12 +274,10 @@ function showhide(a) - 0) { - ?> + 0) { ?>

    - + @@ -425,33 +423,34 @@ function checked($cond) nicesize(filesize($file)); - - $file = fopen($file, "r"); - $count = 0; - $details = array(); - while ($count < 11) { - $line = fgets($file); - foreach ($detailFields as $label) { - $fileLabel = '# ' . $label; - if (strpos($line, $fileLabel) !== false) { - $details[$label] = htmlentities(trim(str_replace(array( + while ($file = array_shift($files)) { + $filename = substr($file, strrpos($file, '/') + 1); + $filesize = $modx->nicesize(filesize($file)); + + $file = fopen($file, "r"); + $count = 0; + $details = array(); + while ($count < 11) { + $line = fgets($file); + foreach ($detailFields as $label) { + $fileLabel = '# ' . $label; + if (strpos($line, $fileLabel) !== false) { + $details[$label] = htmlentities(trim(str_replace(array( $fileLabel, ':', '`' ), '', $line)), ENT_QUOTES, $modx_manager_charset); - } - } - $count++; - }; - fclose($file); - - $tooltip = "Generation Time: " . $details["Generation Time"] . "\n"; - $tooltip .= "Server version: " . $details["Server version"] . "\n"; - $tooltip .= "PHP Version: " . $details["PHP Version"] . "\n"; - $tooltip .= "Host: " . $details["Host"] . "\n"; ?> + } + } + $count++; + }; + fclose($file); + + $tooltip = "Generation Time: " . $details["Generation Time"] . "\n"; + $tooltip .= "Server version: " . $details["Server version"] . "\n"; + $tooltip .= "PHP Version: " . $details["PHP Version"] . "\n"; + $tooltip .= "Host: " . $details["Host"] . "\n"; + ?> @@ -462,7 +461,8 @@ function checked($cond) + } + ?> @@ -623,9 +623,7 @@ public function createDump($callBack) $insertdump = $lf; $insertdump .= "INSERT INTO `{$tblval}` VALUES ("; $arr = $this->object2Array($row); - if (! is_array($arr)) { - $arr = array(); - } + if( ! is_array($arr)) $arr = array(); foreach ($arr as $key => $value) { if (is_null($value)) { $value = 'NULL'; @@ -736,8 +734,7 @@ public function object2Array($obj) */ function import_sql($source, $result_code = 'import_ok') { - $modx = evolutionCMS(); - global $e; + $modx = evolutionCMS(); global $e; $rs = null; if ($modx->getLockedElements() !== array()) { diff --git a/manager/actions/category_mgr/inc/Module_Categories_Manager.php b/manager/actions/category_mgr/inc/Module_Categories_Manager.php index e5a5e7628b..ef43029465 100755 --- a/manager/actions/category_mgr/inc/Module_Categories_Manager.php +++ b/manager/actions/category_mgr/inc/Module_Categories_Manager.php @@ -118,6 +118,7 @@ public function renderView($view_name, $data = array()) */ public function updateElement($element, $element_id, $category_id) { + $_update = array( 'id' => (int)$element_id, 'category' => (int)$category_id diff --git a/manager/actions/category_mgr/inc/request_trigger.inc.php b/manager/actions/category_mgr/inc/request_trigger.inc.php index d8bda1eb62..d95f86fd55 100755 --- a/manager/actions/category_mgr/inc/request_trigger.inc.php +++ b/manager/actions/category_mgr/inc/request_trigger.inc.php @@ -2,32 +2,36 @@ /** * Ajax Requests */ -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (isset($_REQUEST[$cm->get('request_key')]['ajax'])) { +if( isset( $_REQUEST[$cm->get('request_key')]['ajax'] ) ) +{ $_data = $_REQUEST[$cm->get('request_key')]; $output = ''; $task = $_data['task']; - switch ($task) { + switch( $task ) + { /** * get categories */ case 'categorize_load_elements': $elements = $_data['elements']; - if ($uncategorized_elements = $cm->getAssignedElements(0, $_data['elements'])) { - $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements); + if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) ) + { + $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements); } - foreach ($cm->getCategories() as $category) { - $category['elements'] = $cm->getAssignedElements($category['id'], $_data['elements']); + foreach( $cm->getCategories() as $category ) + { + $category['elements'] = $cm->getAssignedElements( $category['id'], $_data['elements'] ); $output .= $cm->renderView('chunks/categorize/category', $category); } break; } - exit($output); + exit( $output ); } /** * Categorize elements @@ -37,7 +41,8 @@ * @see http://modxcms.com/forums/index.php/topic,40430.msg251476.html#msg251476 * */ -if (isset($_POST[$cm->get('request_key')]['categorize']['submit'])) { +if( isset( $_POST[$cm->get('request_key')]['categorize']['submit'] ) ) +{ $_data = $_POST[$cm->get('request_key')]['categorize']; $_changes = 0; @@ -49,13 +54,16 @@ 'categorize' ); - if (!isset($_data['elements'])) { - $cm->addMessage($cm->txt('cm_unknown_error'), 'categorize'); + if( !isset( $_data['elements'] ) ) + { + $cm->addMessage( $cm->txt('cm_unknown_error'), 'categorize' ); return; } - foreach ($_data['elements'] as $element_id => $data) { - if ($cm->updateElement($_data['elementsgroup'], $element_id, $data['category_id'])) { + foreach( $_data['elements'] as $element_id => $data ) + { + if( $cm->updateElement( $_data['elementsgroup'], $element_id, $data['category_id'] ) ) + { $cm->addMessage( sprintf( $cm->txt('cm_x_assigned_to_category_y'), @@ -70,10 +78,13 @@ } } - if ($_changes === 0) { - $cm->addMessage($cm->txt('cm_no_categorization'), 'categorize'); + if( $_changes === 0 ) + { + $cm->addMessage( $cm->txt('cm_no_categorization'), 'categorize' ); return; - } else { + } + else + { $cm->addMessage( sprintf( $cm->txt('cm_x_changes_made'), @@ -87,49 +98,58 @@ /** * Add a new category */ -if (isset($_POST[$cm->get('request_key')]['add']['submit'])) { +if( isset( $_POST[$cm->get('request_key')]['add']['submit'] ) ) +{ $_data = $_POST[$cm->get('request_key')]['add']['data']; - $category = trim(html_entity_decode($_data['name'])); + $category = trim( html_entity_decode($_data['name']) ); $rank = (int) $_data['rank']; - if (empty($category)) { - $cm->addMessage($cm->txt('cm_enter_name_for_category'), 'add'); - return; + if( empty( $category ) ) + { + $cm->addMessage( $cm->txt('cm_enter_name_for_category'), 'add' ); + return; } - if ($cm->isCategoryExists($category)) { - $cm->addMessage(sprintf($cm->txt('cm_category_x_exists'), $category), 'add'); - return; + if( $cm->isCategoryExists( $category ) ) + { + $cm->addMessage( sprintf( $cm->txt('cm_category_x_exists'), $category ), 'add' ); + return; } - if ($cm->addCategory($category, $rank) !== 0) { + if( $cm->addCategory( $category, $rank ) !== 0 ) + { $cm->addMessage( sprintf( - $cm->txt('cm_category_x_saved_at_position_y'), + $cm->txt( 'cm_category_x_saved_at_position_y' ), $category, $rank ), 'add' ); - } else { - $cm->addMessage($cm->txt('cm_unknown_error'), 'add'); + } + else + { + $cm->addMessage( $cm->txt('cm_unknown_error'), 'add' ); } } /** * Sort categories */ -if (isset($_POST[$cm->get('request_key')]['sort']['submit'])) { +if( isset( $_POST[$cm->get('request_key')]['sort']['submit'] ) ) +{ $categories = $_POST[$cm->get('request_key')]['sort']['data']; $_changes = 0; - foreach ($categories as $category_id => $_data) { + foreach( $categories as $category_id => $_data ) + { $data = array( - 'category' => urldecode($_data['category']), + 'category' => urldecode( $_data['category'] ), 'rank' => $_data['rank'] ); - if ($cm->updateCategory($category_id, $data)) { + if( $cm->updateCategory( $category_id, $data ) ) + { $cm->addMessage( sprintf( $cm->txt('cm_category_x_moved_to_position_y'), @@ -142,9 +162,12 @@ } } - if ($_changes === 0) { - $cm->addMessage($cm->txt('cm_no_changes'), 'sort'); - } else { + if( $_changes === 0 ) + { + $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'sort'); + } + else + { $cm->addMessage( sprintf( $cm->txt('cm_x_changes_made'), @@ -158,17 +181,21 @@ /** * Edit categories */ -if (isset($_POST[$cm->get('request_key')]['edit']['submit'])) { +if( isset( $_POST[$cm->get('request_key')]['edit']['submit'] ) ) +{ $categories = $_POST[$cm->get('request_key')]['edit']['data']; $_changes = 0; - foreach ($categories as $category_id => $_data) { - if (isset($_data['delete'])) { - if ($cm->deleteCategory($category_id)) { + foreach( $categories as $category_id => $_data ) + { + if( isset( $_data['delete'] ) ) + { + if( $cm->deleteCategory( $category_id ) ) + { $cm->addMessage( sprintf( $cm->txt('cm_category_x_deleted'), - urldecode($_data['origin']) + urldecode( $_data['origin'] ) ), 'edit' ); @@ -178,15 +205,16 @@ } $data = array( - 'category' => trim(html_entity_decode($_data['category'])), + 'category' => trim( html_entity_decode( $_data['category'] ) ), 'rank' => $_data['rank'] ); - if ($cm->updateCategory($category_id, $data)) { + if( $cm->updateCategory( $category_id, $data ) ) + { $cm->addMessage( sprintf( $cm->txt('cm_category_x_renamed_to_y'), - urldecode($_data['origin']), + urldecode( $_data['origin'] ), $data['category'] ), 'edit' @@ -195,23 +223,26 @@ } } - if ($_changes === 0) { - $cm->addMessage($cm->txt('cm_no_changes'), 'edit'); + if( $_changes === 0 ) + { + $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'edit'); } } /** * Delete singel category by $_GET */ -if (isset($_GET[$cm->get('request_key')]['delete']) - && !empty($_GET[$cm->get('request_key')]['delete'])) { +if( isset( $_GET[$cm->get('request_key')]['delete'] ) + && !empty( $_GET[$cm->get('request_key')]['delete'] ) ) +{ $category_id = (int)$_GET[$cm->get('request_key')]['delete']; - if ($cm->deleteCategory($category_id)) { + if( $cm->deleteCategory( $category_id ) ) + { $cm->addMessage( sprintf( $cm->txt('cm_category_x_deleted'), - urldecode($_GET[$cm->get('request_key')]['category']) + urldecode( $_GET[$cm->get('request_key')]['category'] ) ), 'edit' ); @@ -220,13 +251,16 @@ /** * Translate phrases */ -if (isset($_POST[$cm->get('request_key')]['translate']['submit'])) { +if( isset( $_POST[$cm->get('request_key')]['translate']['submit'] ) ) +{ $translations = $_POST[$cm->get('request_key')]['translate']['data']; - foreach ($translations as $native_phrase => $translation) { - $native_phrase = urldecode($native_phrase); + foreach( $translations as $native_phrase => $translation ) + { + $native_phrase = urldecode( $native_phrase ); - if (empty($translation)) { + if( empty( $translation ) ) + { $translation = $native_phrase; $cm->addMessage( @@ -238,7 +272,7 @@ ); } - $cm->c('Translator')->addTranslation($native_phrase, $translation, 'phrase'); + $cm->c('Translator')->addTranslation( $native_phrase, $translation, 'phrase' ); $cm->addMessage( sprintf( diff --git a/manager/actions/document_data.static.php b/manager/actions/document_data.static.php index c11565e2ab..84b7e291ee 100755 --- a/manager/actions/document_data.static.php +++ b/manager/actions/document_data.static.php @@ -1,16 +1,16 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (isset($_REQUEST['id'])) { - $id = (int) $_REQUEST['id']; +if(isset($_REQUEST['id'])) { + $id = (int) $_REQUEST['id']; } else { - $id = 0; + $id = 0; } -if (isset($_GET['opened'])) { - $_SESSION['openedArray'] = $_GET['opened']; +if(isset($_GET['opened'])) { + $_SESSION['openedArray'] = $_GET['opened']; } $url = $modx->config['site_url']; @@ -22,26 +22,26 @@ $tbl_site_templates = $modx->getFullTableName('site_templates'); // Get access permissions -if ($_SESSION['mgrDocgroups']) { - $docgrp = implode(",", $_SESSION['mgrDocgroups']); +if($_SESSION['mgrDocgroups']) { + $docgrp = implode(",", $_SESSION['mgrDocgroups']); } $access = "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0" . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); // -if ($_SESSION['tree_show_only_folders']) { - $parent = $id ? ($modx->db->getValue("SELECT parent FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1")) : 0; - $isfolder = $modx->db->getValue("SELECT isfolder FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1"); - if (!$isfolder && $parent != 0) { - $id = $_REQUEST['id'] = $parent; - } +if($_SESSION['tree_show_only_folders']) { + $parent = $id ? ($modx->db->getValue("SELECT parent FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1")) : 0; + $isfolder = $modx->db->getValue("SELECT isfolder FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1"); + if(!$isfolder && $parent != 0) { + $id = $_REQUEST['id'] = $parent; + } } // Get the document content $rs = $modx->db->select('DISTINCT sc.*', "{$tbl_site_content} AS sc LEFT JOIN {$tbl_document_groups} AS dg ON dg.document = sc.id", "sc.id ='{$id}' AND ({$access})"); $content = $modx->db->getRow($rs); -if (!$content) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); +if(!$content) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); } /** @@ -84,134 +84,135 @@ ); $filter_sort = ''; $filter_dir = ''; -if ($numRecords > 0) { - $filter_sort = ''; - $filter_dir = ''; - $resource = $modx->db->makeArray($rs); - - // CSS style for table - // $tableClass = 'grid'; - // $rowHeaderClass = 'gridHeader'; - // $rowRegularClass = 'gridItem'; - // $rowAlternateClass = 'gridAltItem'; - $tableClass = 'table data nowrap'; - $columnHeaderClass = array( - 'text-center', - 'text-left', - 'text-center', - 'text-center', - 'text-center', - 'text-center' - ); - - - $modx->table->setTableClass($tableClass); - $modx->table->setColumnHeaderClass($columnHeaderClass); - // $modx->table->setRowHeaderClass($rowHeaderClass); - // $modx->table->setRowRegularClass($rowRegularClass); - // $modx->table->setRowAlternateClass($rowAlternateClass); - - // Table header - $listTableHeader = array( - 'docid' => $_lang['id'], - 'title' => $_lang['resource_title'], - 'createdon' => $_lang['createdon'], - 'pub_date' => $_lang['page_data_publishdate'], - 'status' => $_lang['page_data_status'], - 'edit' => $_lang['mgrlog_action'], - ); - $tbWidth = array( - '1%', - '', - '1%', - '1%', - '1%', - '1%' - ); - $modx->table->setColumnWidths($tbWidth); - - $sd = isset($_REQUEST['dir']) ? '&dir=' . $_REQUEST['dir'] : '&dir=DESC'; - $sb = isset($_REQUEST['sort']) ? '&sort=' . $_REQUEST['sort'] : '&sort=createdon'; - $pg = isset($_REQUEST['page']) ? '&page=' . (int) $_REQUEST['page'] : ''; - $add_path = $sd . $sb . $pg; - - $icons = array( - 'text/html' => $_style['tree_page_html'], - 'text/plain' => $_style['tree_page'], - 'text/xml' => $_style['tree_page_xml'], - 'text/css' => $_style['tree_page_css'], - 'text/javascript' => $_style['tree_page_js'], - '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'], - 'image/gif' => $_style['tree_page_gif'], - 'image/jpg' => $_style['tree_page_jpg'], - 'image/png' => $_style['tree_page_png'] - ); - - $listDocs = array(); - foreach ($resource as $k => $children) { - switch ($children['id']) { - case $modx->config['site_start']: - $icon = $_style['tree_page_home']; - break; - case $modx->config['error_page']: - $icon = $_style['tree_page_404']; - break; - case $modx->config['site_unavailable_page']: - $icon = $_style['tree_page_hourglass']; - break; - case $modx->config['unauthorized_page']: - $icon = $_style['tree_page_info']; - break; - default: - if ($children['isfolder']) { - $icon = $_style['tree_folder_new']; - } else { - if (isset($icons[$children['contentType']])) { - $icon = $icons[$children['contentType']]; - } else { - $icon = $_style['tree_page']; - } - } - } - - $private = ($children['privateweb'] || $children['privatemgr'] ? ' private' : ''); - - // дописываем в заголовок класс для неопубликованных плюс по всем ссылкам обратный путь - // для сохранения сортировки - $class = ($children['deleted'] ? 'text-danger text-decoration-through' : (!$children['published'] ? ' font-italic text-muted' : ' publish')); - //$class .= ($children['hidemenu'] ? ' text-muted' : ' text-primary'); - //$class .= ($children['isfolder'] ? ' font-weight-bold' : ''); - if ($modx->hasPermission('edit_document')) { - $title = '' . $icon . '' . '' . $children['pagetitle'] . ''; - } else { - $title = '' . $icon . '' . $children['pagetitle'] . ''; - } - - $icon_pub_unpub = (!$children['published']) ? '' : ''; - - $icon_del_undel = (!$children['deleted']) ? '' : ''; - - $listDocs[] = array( - 'docid' => '
    ' . $children['id'] . '
    ', - 'title' => $title, - 'createdon' => '
    ' . ($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')) . '
    ', - 'pub_date' => '
    ' . ($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '') . '
    ', - 'status' => '
    ' . ($children['published'] == 0 ? '' . $_lang['page_data_unpublished'] . '' : '' . $_lang['page_data_published'] . '') . '
    ', - 'edit' => '
    ' . ($modx->hasPermission('edit_document') ? ' 0) { + $filter_sort = ''; + $filter_dir = ''; + $resource = $modx->db->makeArray($rs); + + // CSS style for table + // $tableClass = 'grid'; + // $rowHeaderClass = 'gridHeader'; + // $rowRegularClass = 'gridItem'; + // $rowAlternateClass = 'gridAltItem'; + $tableClass = 'table data nowrap'; + $columnHeaderClass = array( + 'text-center', + 'text-left', + 'text-center', + 'text-center', + 'text-center', + 'text-center' + ); + + + $modx->table->setTableClass($tableClass); + $modx->table->setColumnHeaderClass($columnHeaderClass); + // $modx->table->setRowHeaderClass($rowHeaderClass); + // $modx->table->setRowRegularClass($rowRegularClass); + // $modx->table->setRowAlternateClass($rowAlternateClass); + + // Table header + $listTableHeader = array( + 'docid' => $_lang['id'], + 'title' => $_lang['resource_title'], + 'createdon' => $_lang['createdon'], + 'pub_date' => $_lang['page_data_publishdate'], + 'status' => $_lang['page_data_status'], + 'edit' => $_lang['mgrlog_action'], + ); + $tbWidth = array( + '1%', + '', + '1%', + '1%', + '1%', + '1%' + ); + $modx->table->setColumnWidths($tbWidth); + + $sd = isset($_REQUEST['dir']) ? '&dir=' . $_REQUEST['dir'] : '&dir=DESC'; + $sb = isset($_REQUEST['sort']) ? '&sort=' . $_REQUEST['sort'] : '&sort=createdon'; + $pg = isset($_REQUEST['page']) ? '&page=' . (int) $_REQUEST['page'] : ''; + $add_path = $sd . $sb . $pg; + + $icons = array( + 'text/html' => $_style['tree_page_html'], + 'text/plain' => $_style['tree_page'], + 'text/xml' => $_style['tree_page_xml'], + 'text/css' => $_style['tree_page_css'], + 'text/javascript' => $_style['tree_page_js'], + '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'], + 'image/gif' => $_style['tree_page_gif'], + 'image/jpg' => $_style['tree_page_jpg'], + 'image/png' => $_style['tree_page_png'] + ); + + $listDocs = array(); + foreach($resource as $k => $children) { + + switch($children['id']) { + case $modx->config['site_start'] : + $icon = $_style['tree_page_home']; + break; + case $modx->config['error_page'] : + $icon = $_style['tree_page_404']; + break; + case $modx->config['site_unavailable_page'] : + $icon = $_style['tree_page_hourglass']; + break; + case $modx->config['unauthorized_page'] : + $icon = $_style['tree_page_info']; + break; + default: + if($children['isfolder']) { + $icon = $_style['tree_folder_new']; + } else { + if(isset($icons[$children['contentType']])) { + $icon = $icons[$children['contentType']]; + } else { + $icon = $_style['tree_page']; + } + } + } + + $private = ($children['privateweb'] || $children['privatemgr'] ? ' private' : ''); + + // дописываем в заголовок класс для неопубликованных плюс по всем ссылкам обратный путь + // для сохранения сортировки + $class = ($children['deleted'] ? 'text-danger text-decoration-through' : (!$children['published'] ? ' font-italic text-muted' : ' publish')); + //$class .= ($children['hidemenu'] ? ' text-muted' : ' text-primary'); + //$class .= ($children['isfolder'] ? ' font-weight-bold' : ''); + if($modx->hasPermission('edit_document')) { + $title = '' . $icon . '' . '' . $children['pagetitle'] . ''; + } else { + $title = '' . $icon . '' . $children['pagetitle'] . ''; + } + + $icon_pub_unpub = (!$children['published']) ? '' : ''; + + $icon_del_undel = (!$children['deleted']) ? '' : ''; + + $listDocs[] = array( + 'docid' => '
    ' . $children['id'] . '
    ', + 'title' => $title, + 'createdon' => '
    ' . ($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')) . '
    ', + 'pub_date' => '
    ' . ($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '') . '
    ', + 'status' => '
    ' . ($children['published'] == 0 ? '' . $_lang['page_data_unpublished'] . '' : '' . $_lang['page_data_published'] . '') . '
    ', + 'edit' => '
    ' . ($modx->hasPermission('edit_document') ? '' . $icon_pub_unpub : '') . ($modx->hasPermission('delete_document') ? $icon_del_undel : '') . '
    ' - ); - } + ); + } - $modx->table->createPagingNavigation($numRecords, 'a=3&id=' . $content['id'] . '&dir=' . $dir . '&sort=' . $sort); - $children_output = $modx->table->create($listDocs, $listTableHeader, 'index.php?a=3&id=' . $content['id']); + $modx->table->createPagingNavigation($numRecords, 'a=3&id=' . $content['id'] . '&dir=' . $dir . '&sort=' . $sort); + $children_output = $modx->table->create($listDocs, $listTableHeader, 'index.php?a=3&id=' . $content['id']); } else { - // No Child documents - $children_output = '

    ' . $_lang['resources_in_container_no'] . '

    '; + // No Child documents + $children_output = '

    ' . $_lang['resources_in_container_no'] . '

    '; } ?>
    - 0) : ?> + 0) : ?>
    ()
    @@ -408,43 +407,40 @@ class="' . $_style["icons_move_document"] . '">
    ' . $icon_pub_unpub : '')
    - config['cache_type'] != 2) { - ?> + config['cache_type'] != 2) { ?>

    config['base_path'] . "assets/cache/docid_" . $id . ".pageCache.php"; - $handle = @fopen($filename, "r"); - if (!$handle) { - $buffer = '
    ' . $_lang['page_data_notcached'] . '
    '; - } else { - while (!feof($handle)) { - $buffer .= fgets($handle, 4096); - } - fclose($handle); - $buffer = '
    \n"; - } - echo $buffer; ?> + $buffer = ""; + $filename = $modx->config['base_path'] . "assets/cache/docid_" . $id . ".pageCache.php"; + $handle = @fopen($filename, "r"); + if(!$handle) { + $buffer = '
    ' . $_lang['page_data_notcached'] . '
    '; + } else { + while(!feof($handle)) { + $buffer .= fgets($handle, 4096); + } + fclose($handle); + $buffer = '
    \n"; + } + echo $buffer; + ?>
    - +
    docSettings.setSelectedIndex( ' . $_GET['tab'] . ' );'; - } +if(isset($_GET['tab']) && is_numeric($_GET['tab'])) { + echo ''; +} ?> - +
    -INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('view_eventlog')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('view_eventlog')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // Get table Names (alphabetical) @@ -15,15 +15,15 @@ $modx->manager->initPageViewState(); // get and save search string -if ($_REQUEST['op'] == 'reset') { - $sqlQuery = $query = ''; - $_PAGE['vs']['search'] = ''; +if($_REQUEST['op'] == 'reset') { + $sqlQuery = $query = ''; + $_PAGE['vs']['search'] = ''; } else { - $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; - if (!is_numeric($sqlQuery)) { - $sqlQuery = $modx->db->escape($query); - } - $_PAGE['vs']['search'] = $query; + $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; + if(!is_numeric($sqlQuery)) { + $sqlQuery = $modx->db->escape($query); + } + $_PAGE['vs']['search'] = $query; } // get & save listmode @@ -125,33 +125,33 @@ function menuAction(a) {
    db->select("el.id, ELT(el.type , 'text-info {$_style['actions_info']}' , 'text-warning {$_style['actions_triangle']}' , 'text-danger {$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el + $ds = $modx->db->select("el.id, ELT(el.type , 'text-info {$_style['actions_info']}' , 'text-warning {$_style['actions_triangle']}' , 'text-danger {$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el LEFT JOIN {$tbl_manager_users} AS mu ON mu.id=el.user AND el.usertype=0 LEFT JOIN {$tbl_web_users} AS wu ON wu.id=el.user AND el.usertype=1", ($sqlQuery ? "" . (is_numeric($sqlQuery) ? "(eventid='{$sqlQuery}') OR " : '') . "(source LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "createdon DESC"); - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items - $grd->pagerClass = ''; - $grd->pageClass = 'page-item'; - $grd->selPageClass = 'page-item active'; - $grd->noRecordMsg = $_lang['no_records_found']; - $grd->cssClass = "table data nowrap"; - $grd->columnHeaderClass = "tableHeader"; - $grd->itemClass = "tableItem"; - $grd->altItemClass = "tableAltItem"; - $grd->fields = "type,source,createdon,eventid,username"; - $grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid']; - $grd->colWidths = "1%,,1%,1%,1%"; - $grd->colAligns = "center,,,center,center"; - $grd->colTypes = "template:||template:[+source+]||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p'; - if ($listmode == '1') { - $grd->pageSize = 0; - } - if ($_REQUEST['op'] == 'reset') { - $grd->pageNumber = 1; - } - // render grid - echo $grd->render(); - ?> + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items + $grd->pagerClass = ''; + $grd->pageClass = 'page-item'; + $grd->selPageClass = 'page-item active'; + $grd->noRecordMsg = $_lang['no_records_found']; + $grd->cssClass = "table data nowrap"; + $grd->columnHeaderClass = "tableHeader"; + $grd->itemClass = "tableItem"; + $grd->altItemClass = "tableAltItem"; + $grd->fields = "type,source,createdon,eventid,username"; + $grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid']; + $grd->colWidths = "1%,,1%,1%,1%"; + $grd->colAligns = "center,,,center,center"; + $grd->colTypes = "template:||template:[+source+]||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p'; + if($listmode == '1') { + $grd->pageSize = 0; + } + if($_REQUEST['op'] == 'reset') { + $grd->pageNumber = 1; + } + // render grid + echo $grd->render(); + ?>
    diff --git a/manager/actions/eventlog_details.dynamic.php b/manager/actions/eventlog_details.dynamic.php index 7270f330ab..d72e0c394c 100755 --- a/manager/actions/eventlog_details.dynamic.php +++ b/manager/actions/eventlog_details.dynamic.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('view_eventlog')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('view_eventlog')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // get id @@ -41,18 +41,18 @@
    toDateFormat($content["createdon"]); - if ($content["type"] == 1) { - $icon = $_style['actions_info'] . ' text-info'; - $msgtype = $_lang["information"]; - } elseif ($content["type"] == 2) { - $icon = $_style['actions_triangle'] . ' text-warning'; - $msgtype = $_lang["warning"]; - } elseif ($content["type"] == 3) { - $icon = $_style['actions_error'] . ' text-danger'; - $msgtype = $_lang["error"]; - } - ?> + $date = $modx->toDateFormat($content["createdon"]); + if($content["type"] == 1) { + $icon = $_style['actions_info'] . ' text-info'; + $msgtype = $_lang["information"]; + } else if($content["type"] == 2) { + $icon = $_style['actions_triangle'] . ' text-warning'; + $msgtype = $_lang["warning"]; + } else if($content["type"] == 3) { + $icon = $_style['actions_error'] . ' text-danger'; + $msgtype = $_lang["error"]; + } + ?>

    diff --git a/manager/actions/export_site.static.php b/manager/actions/export_site.static.php index cbb83cb9f2..878cad704f 100755 --- a/manager/actions/export_site.static.php +++ b/manager/actions/export_site.static.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('export_static')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('export_static')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // figure out the base of the server, so we know where to get the documents in order to export them @@ -35,11 +35,11 @@

    + if(isset($_POST['export'])) { + $rs = include_once(MODX_MANAGER_PATH . 'processors/export_site.processor.php'); + echo $rs; + } else { + ?>
    @@ -76,13 +76,13 @@ ">
    + } + ?>
    diff --git a/manager/actions/files.dynamic.php b/manager/actions/files.dynamic.php index 3d6cd1c866..0b9bae5166 100755 --- a/manager/actions/files.dynamic.php +++ b/manager/actions/files.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('file_manager')) { @@ -407,7 +407,7 @@ function renameFile (file) if (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newDirname) !== 0) { echo $_lang['files.dynamic.php3']; - } elseif (!rename($dirname, $_REQUEST['path'] . '/' . $newDirname)) { + } else if (!rename($dirname, $_REQUEST['path'] . '/' . $newDirname)) { echo '', $_lang['file_folder_not_created'], '

    '; } umask($old_umask); @@ -482,7 +482,8 @@ function renameFile (file) + @ini_set("upload_max_filesize", $upload_maxsize); // modified by raymond + ?>
    @@ -490,8 +491,8 @@ function renameFile (file) + echo $information; + } ?>
    @@ -516,12 +517,13 @@ function renameFile (file) webAlertAndQuit("Error opening file for reading."); - } ?> + $buffer = file_get_contents($filename); + // Log the change + logFileChange('view', $filename); + if ($buffer === false) { + $modx->webAlertAndQuit("Error opening file for reading."); + } + ?> @@ -564,6 +566,7 @@ function renameFile (file) if (is_array($evtOut)) { echo implode('', $evtOut); } + } /** @@ -846,7 +849,7 @@ function unzip($file, $path) $complete_name = $path . str_replace('\\', '/', $zip_entry_name); if (!file_exists($complete_path)) { $tmp = ''; - foreach (explode('/', $complete_path) as $k) { + foreach (explode('/', $complete_path) AS $k) { $tmp .= $k . '/'; if (!is_dir($tmp)) { mkdir($tmp, 0777); @@ -887,13 +890,10 @@ function rrmdir($dir) */ function fileupload() { - $modx = evolutionCMS(); - global $_lang, $startpath, $filemanager_path, $uploadablefiles, $new_file_permissions; + $modx = evolutionCMS(); global $_lang, $startpath, $filemanager_path, $uploadablefiles, $new_file_permissions; $msg = ''; foreach ($_FILES['userfile']['name'] as $i => $name) { - if (empty($_FILES['userfile']['tmp_name'][$i])) { - continue; - } + if (empty($_FILES['userfile']['tmp_name'][$i])) continue; $userfile= array(); $userfile['tmp_name'] = $_FILES['userfile']['tmp_name'][$i]; diff --git a/manager/actions/help.static.php b/manager/actions/help.static.php index c46668939a..1978dc5f54 100755 --- a/manager/actions/help.static.php +++ b/manager/actions/help.static.php @@ -1,6 +1,6 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } $helpBasePath = "actions/help/"; ?> @@ -16,35 +16,36 @@ $v) { - $helpname = substr($v, 0, strrpos($v, '.')); - - $prefix = substr($helpname, 0, 2); - if (is_numeric($prefix)) { - $helpname = substr($helpname, 2, strlen($helpname) - 1); - } - - $hnLower = strtolower($helpname); - $helpname = isset($_lang[$hnLower]) ? $_lang[$hnLower] : str_replace('_', ' ', $helpname); - - echo '
    '; - echo '

    ' . $helpname . '

    '; - echo ''; - include_once($helpBasePath . "{$v}"); - echo '
    '; - } - ?> + if($handle = opendir('actions/help')) { + while(false !== ($file = readdir($handle))) { + if($file != "." && $file != ".." && $file != ".svn" && $file != 'index.html' && !is_dir($helpBasePath . $file)) { + $help[] = $file; + } + } + closedir($handle); + } + + natcasesort($help); + + foreach($help as $k => $v) { + + $helpname = substr($v, 0, strrpos($v, '.')); + + $prefix = substr($helpname, 0, 2); + if(is_numeric($prefix)) { + $helpname = substr($helpname, 2, strlen($helpname) - 1); + } + + $hnLower = strtolower($helpname); + $helpname = isset($_lang[$hnLower]) ? $_lang[$hnLower] : str_replace('_', ' ', $helpname); + + echo '
    '; + echo '

    ' . $helpname . '

    '; + echo ''; + include_once($helpBasePath . "{$v}"); + echo '
    '; + } + ?>
    + } + ?> @@ -102,67 +104,65 @@ function setParent(pId, pName) { /** * @return string */ -function run() -{ - $modx = evolutionCMS(); - global $_lang; +function run() { + $modx = evolutionCMS(); global $_lang; - $tbl_site_content = $modx->getFullTableName('site_content'); - $output = ''; - $maxtime = $_POST['maxtime']; + $tbl_site_content = $modx->getFullTableName('site_content'); + $output = ''; + $maxtime = $_POST['maxtime']; - if (!is_numeric($maxtime)) { - $maxtime = 30; - } + if(!is_numeric($maxtime)) { + $maxtime = 30; + } - @set_time_limit($maxtime); + @set_time_limit($maxtime); - $mtime = microtime(); - $mtime = explode(' ', $mtime); - $mtime = $mtime[1] + $mtime[0]; - $importstart = $mtime; + $mtime = microtime(); + $mtime = explode(' ', $mtime); + $mtime = $mtime[1] + $mtime[0]; + $importstart = $mtime; - if ($_POST['reset'] == 'on') { - $modx->db->truncate($tbl_site_content); - $modx->db->query("ALTER TABLE {$tbl_site_content} AUTO_INCREMENT = 1"); - } + if($_POST['reset'] == 'on') { + $modx->db->truncate($tbl_site_content); + $modx->db->query("ALTER TABLE {$tbl_site_content} AUTO_INCREMENT = 1"); + } - $parent = (int)$_POST['parent']; + $parent = (int)$_POST['parent']; - if (is_dir(MODX_BASE_PATH . 'temp/import')) { - $filedir = MODX_BASE_PATH . 'temp/import/'; - } elseif (is_dir(MODX_BASE_PATH . 'assets/import')) { - $filedir = MODX_BASE_PATH . 'assets/import/'; - } else { + if(is_dir(MODX_BASE_PATH . 'temp/import')) { + $filedir = MODX_BASE_PATH . 'temp/import/'; + } elseif(is_dir(MODX_BASE_PATH . 'assets/import')) { + $filedir = MODX_BASE_PATH . 'assets/import/'; + } else { $filedir = ''; } - $filesfound = 0; + $filesfound = 0; - $files = getFiles($filedir); - $files = pop_index($files); + $files = getFiles($filedir); + $files = pop_index($files); - // no. of files to import - $output .= sprintf('

    ' . $_lang['import_files_found'] . '

    ', $filesfound); + // no. of files to import + $output .= sprintf('

    ' . $_lang['import_files_found'] . '

    ', $filesfound); - // import files - if (0 < count($files)) { - $modx->db->update(array('isfolder' => 1), $tbl_site_content, "id='{$parent}'"); - importFiles($parent, $filedir, $files, 'root'); - } + // import files + if(0 < count($files)) { + $modx->db->update(array('isfolder' => 1), $tbl_site_content, "id='{$parent}'"); + importFiles($parent, $filedir, $files, 'root'); + } - $mtime = microtime(); - $mtime = explode(' ', $mtime); - $mtime = $mtime[1] + $mtime[0]; - $importend = $mtime; - $totaltime = ($importend - $importstart); - $output .= sprintf('

    ' . $_lang['import_site_time'] . '

    ', round($totaltime, 3)); + $mtime = microtime(); + $mtime = explode(' ', $mtime); + $mtime = $mtime[1] + $mtime[0]; + $importend = $mtime; + $totaltime = ($importend - $importstart); + $output .= sprintf('

    ' . $_lang['import_site_time'] . '

    ', round($totaltime, 3)); - if ($_POST['convert_link'] == 'on') { - convertLink(); - } + if($_POST['convert_link'] == 'on') { + convertLink(); + } - return $output; + return $output; } /** @@ -171,146 +171,145 @@ function run() * @param array $files * @param string $mode */ -function importFiles($parent, $filedir, $files, $mode) -{ - $modx = evolutionCMS(); - global $_lang, $allowedfiles; - global $search_default, $cache_default, $publish_default; - - $tbl_site_content = $modx->getFullTableName('site_content'); - $tbl_system_settings = $modx->getFullTableName('system_settings'); - - $createdby = $modx->getLoginUserID(); - if (!is_array($files)) { - return; - } - if ($_POST['object'] === 'all') { - $modx->config['default_template'] = '0'; - $richtext = '0'; - } else { - $richtext = '1'; - } - - foreach ($files as $id => $value) { - if (is_array($value)) { - // create folder - $alias = $id; - printf('' . $_lang['import_site_importing_document'] . '', $alias); - $field = array(); - $field['type'] = 'document'; - $field['contentType'] = 'text/html'; - $field['published'] = $publish_default; - $field['parent'] = $parent; - $field['alias'] = $modx->stripAlias($alias); - $field['richtext'] = $richtext; - $field['template'] = $modx->config['default_template']; - $field['searchable'] = $search_default; - $field['cacheable'] = $cache_default; - $field['createdby'] = $createdby; - $field['isfolder'] = 1; - $field['menuindex'] = 1; - $find = false; - foreach (array( - 'index.html', - 'index.htm' - ) as $filename) { - $filepath = $filedir . $alias . '/' . $filename; - if ($find === false && file_exists($filepath)) { - $file = getFileContent($filepath); - list($pagetitle, $content, $description) = treatContent($file, $filename, $alias); - - $date = filemtime($filepath); - $field['pagetitle'] = $pagetitle; - $field['longtitle'] = $pagetitle; - $field['description'] = $description; - $field['content'] = $modx->db->escape($content); - $field['createdon'] = $date; - $field['editedon'] = $date; - $newid = $modx->db->insert($field, $tbl_site_content); - if ($newid) { - $find = true; - echo ' - ' . $_lang['import_site_success'] . '
    ' . "\n"; - importFiles($newid, $filedir . $alias . '/', $value, 'sub'); - } else { - echo '' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError(); - exit; - } - } - } - if ($find === false) { - $date = time(); - $field['pagetitle'] = '---'; - $field['content'] = ''; - $field['createdon'] = $date; - $field['editedon'] = $date; - $field['hidemenu'] = '1'; - $newid = $modx->db->insert($field, $tbl_site_content); - if ($newid) { - $find = true; - echo ' - ' . $_lang['import_site_success'] . '
    ' . "\n"; - importFiles($newid, $filedir . $alias . '/', $value, 'sub'); - } else { - echo '' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError(); - exit; - } - } - } else { - // create document - if ($mode == 'sub' && $value == 'index.html') { - continue; - } - $filename = $value; - $fparts = explode('.', $value); - $alias = $fparts[0]; - $ext = (count($fparts) > 1) ? $fparts[count($fparts) - 1] : ""; - printf("" . $_lang['import_site_importing_document'] . "", $filename); - - if (!in_array($ext, $allowedfiles)) { - echo ' - ' . $_lang["import_site_skip"] . '
    ' . "\n"; - } else { - $filepath = $filedir . $filename; - $file = getFileContent($filepath); - list($pagetitle, $content, $description) = treatContent($file, $filename, $alias); - - $date = filemtime($filepath); - $field = array(); - $field['type'] = 'document'; - $field['contentType'] = 'text/html'; - $field['pagetitle'] = $pagetitle; - $field['longtitle'] = $pagetitle; - $field['description'] = $description; - $field['alias'] = $modx->stripAlias($alias); - $field['published'] = $publish_default; - $field['parent'] = $parent; - $field['content'] = $modx->db->escape($content); - $field['richtext'] = $richtext; - $field['template'] = $modx->config['default_template']; - $field['searchable'] = $search_default; - $field['cacheable'] = $cache_default; - $field['createdby'] = $createdby; - $field['createdon'] = $date; - $field['editedon'] = $date; - $field['isfolder'] = 0; - $field['menuindex'] = ($alias == 'index') ? 0 : 2; - $newid = $modx->db->insert($field, $tbl_site_content); - if ($newid) { - echo ' - ' . $_lang['import_site_success'] . '
    ' . "\n"; - } else { - echo '' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError(); - exit; - } - - $is_site_start = false; - if ($filename == 'index.html') { - $is_site_start = true; - } - if ($is_site_start == true && $_POST['reset'] == 'on') { - $modx->db->update(array('setting_value' => $newid), $tbl_system_settings, "setting_name='site_start'"); - $modx->db->update(array('menuindex' => 0), $tbl_site_content, "id='{$newid}'"); - } - } - } - } +function importFiles($parent, $filedir, $files, $mode) { + $modx = evolutionCMS(); + global $_lang, $allowedfiles; + global $search_default, $cache_default, $publish_default; + + $tbl_site_content = $modx->getFullTableName('site_content'); + $tbl_system_settings = $modx->getFullTableName('system_settings'); + + $createdby = $modx->getLoginUserID(); + if(!is_array($files)) { + return; + } + if($_POST['object'] === 'all') { + $modx->config['default_template'] = '0'; + $richtext = '0'; + } else { + $richtext = '1'; + } + + foreach($files as $id => $value) { + if(is_array($value)) { + // create folder + $alias = $id; + printf('' . $_lang['import_site_importing_document'] . '', $alias); + $field = array(); + $field['type'] = 'document'; + $field['contentType'] = 'text/html'; + $field['published'] = $publish_default; + $field['parent'] = $parent; + $field['alias'] = $modx->stripAlias($alias); + $field['richtext'] = $richtext; + $field['template'] = $modx->config['default_template']; + $field['searchable'] = $search_default; + $field['cacheable'] = $cache_default; + $field['createdby'] = $createdby; + $field['isfolder'] = 1; + $field['menuindex'] = 1; + $find = false; + foreach(array( + 'index.html', + 'index.htm' + ) as $filename) { + $filepath = $filedir . $alias . '/' . $filename; + if($find === false && file_exists($filepath)) { + $file = getFileContent($filepath); + list($pagetitle, $content, $description) = treatContent($file, $filename, $alias); + + $date = filemtime($filepath); + $field['pagetitle'] = $pagetitle; + $field['longtitle'] = $pagetitle; + $field['description'] = $description; + $field['content'] = $modx->db->escape($content); + $field['createdon'] = $date; + $field['editedon'] = $date; + $newid = $modx->db->insert($field, $tbl_site_content); + if($newid) { + $find = true; + echo ' - ' . $_lang['import_site_success'] . '
    ' . "\n"; + importFiles($newid, $filedir . $alias . '/', $value, 'sub'); + } else { + echo '' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError(); + exit; + } + } + } + if($find === false) { + $date = time(); + $field['pagetitle'] = '---'; + $field['content'] = ''; + $field['createdon'] = $date; + $field['editedon'] = $date; + $field['hidemenu'] = '1'; + $newid = $modx->db->insert($field, $tbl_site_content); + if($newid) { + $find = true; + echo ' - ' . $_lang['import_site_success'] . '
    ' . "\n"; + importFiles($newid, $filedir . $alias . '/', $value, 'sub'); + } else { + echo '' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError(); + exit; + } + } + } else { + // create document + if($mode == 'sub' && $value == 'index.html') { + continue; + } + $filename = $value; + $fparts = explode('.', $value); + $alias = $fparts[0]; + $ext = (count($fparts) > 1) ? $fparts[count($fparts) - 1] : ""; + printf("" . $_lang['import_site_importing_document'] . "", $filename); + + if(!in_array($ext, $allowedfiles)) { + echo ' - ' . $_lang["import_site_skip"] . '
    ' . "\n"; + } else { + $filepath = $filedir . $filename; + $file = getFileContent($filepath); + list($pagetitle, $content, $description) = treatContent($file, $filename, $alias); + + $date = filemtime($filepath); + $field = array(); + $field['type'] = 'document'; + $field['contentType'] = 'text/html'; + $field['pagetitle'] = $pagetitle; + $field['longtitle'] = $pagetitle; + $field['description'] = $description; + $field['alias'] = $modx->stripAlias($alias); + $field['published'] = $publish_default; + $field['parent'] = $parent; + $field['content'] = $modx->db->escape($content); + $field['richtext'] = $richtext; + $field['template'] = $modx->config['default_template']; + $field['searchable'] = $search_default; + $field['cacheable'] = $cache_default; + $field['createdby'] = $createdby; + $field['createdon'] = $date; + $field['editedon'] = $date; + $field['isfolder'] = 0; + $field['menuindex'] = ($alias == 'index') ? 0 : 2; + $newid = $modx->db->insert($field, $tbl_site_content); + if($newid) { + echo ' - ' . $_lang['import_site_success'] . '
    ' . "\n"; + } else { + echo '' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError(); + exit; + } + + $is_site_start = false; + if($filename == 'index.html') { + $is_site_start = true; + } + if($is_site_start == true && $_POST['reset'] == 'on') { + $modx->db->update(array('setting_value' => $newid), $tbl_system_settings, "setting_name='site_start'"); + $modx->db->update(array('menuindex' => 0), $tbl_site_content, "id='{$newid}'"); + } + } + } + } } /** @@ -319,66 +318,63 @@ function importFiles($parent, $filedir, $files, $mode) * @param int $count * @return array */ -function getFiles($directory, $listing = array(), $count = 0) -{ - global $_lang; - global $filesfound; - $dummy = $count; - if (! empty($directory) && $files = scandir($directory)) { - foreach ($files as $file) { - if ($file == '.' || $file == '..') { - continue; - } elseif ($h = @opendir($directory . $file . "/")) { - closedir($h); - $count = -1; - $listing[$file] = getFiles($directory . $file . "/", array(), $count + 1); - } elseif (strpos($file, '.htm') !== false) { - $listing[$dummy] = $file; - $dummy = $dummy + 1; - $filesfound++; - } - } - } else { - echo '

    ' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_no_open_dir"] . $directory . ".

    "; - } - return ($listing); +function getFiles($directory, $listing = array(), $count = 0) { + global $_lang; + global $filesfound; + $dummy = $count; + if( ! empty($directory) && $files = scandir($directory)) { + foreach($files as $file) { + if($file == '.' || $file == '..') { + continue; + } elseif($h = @opendir($directory . $file . "/")) { + closedir($h); + $count = -1; + $listing[$file] = getFiles($directory . $file . "/", array(), $count + 1); + } elseif(strpos($file, '.htm') !== false) { + $listing[$dummy] = $file; + $dummy = $dummy + 1; + $filesfound++; + } + } + } else { + echo '

    ' . $_lang["import_site_failed"] . " " . $_lang["import_site_failed_no_open_dir"] . $directory . ".

    "; + } + return ($listing); } /** * @param string $filepath * @return bool|string */ -function getFileContent($filepath) -{ - global $_lang; - // get the file - if (!$buffer = file_get_contents($filepath)) { - echo '

    ' . $_lang['import_site_failed'] . " " . $_lang["import_site_failed_no_retrieve_file"] . $filepath . ".

    "; - } else { - return $buffer; - } +function getFileContent($filepath) { + global $_lang; + // get the file + if(!$buffer = file_get_contents($filepath)) { + echo '

    ' . $_lang['import_site_failed'] . " " . $_lang["import_site_failed_no_retrieve_file"] . $filepath . ".

    "; + } else { + return $buffer; + } } /** * @param array $array * @return array */ -function pop_index($array) -{ - $new_array = array(); - foreach ($array as $k => $v) { - if ($v !== 'index.html' && $v !== 'index.htm') { - $new_array[$k] = $v; - } else { - array_unshift($new_array, $v); - } - } - foreach ($array as $k => $v) { - if (is_array($v)) { - $new_array[$k] = $v; - } - } - return $new_array; +function pop_index($array) { + $new_array = array(); + foreach($array as $k => $v) { + if($v !== 'index.html' && $v !== 'index.htm') { + $new_array[$k] = $v; + } else { + array_unshift($new_array, $v); + } + } + foreach($array as $k => $v) { + if(is_array($v)) { + $new_array[$k] = $v; + } + } + return $new_array; } /** @@ -387,111 +383,109 @@ function pop_index($array) * @param string $alias * @return array */ -function treatContent($src, $filename, $alias) -{ - $modx = evolutionCMS(); - - $src = mb_convert_encoding($src, $modx->config['modx_charset'], 'UTF-8,SJIS-win,eucJP-win,SJIS,EUC-JP,ASCII'); - - if (preg_match("@(.*)@i", $src, $matches)) { - $pagetitle = ($matches[1] !== '') ? $matches[1] : $filename; - $pagetitle = str_replace('[*pagetitle*]', '', $pagetitle); - } else { - $pagetitle = $alias; - } - if (!$pagetitle) { - $pagetitle = $alias; - } - - if (preg_match('@]+"description"[^>]+content=[\'"](.*)[\'"].+>@i', $src, $matches)) { - $description = ($matches[1] !== '') ? $matches[1] : $filename; - $description = str_replace('[*description*]', '', $description); - } else { - $description = ''; - } - - if ((preg_match("@]*>(.*)[^<]+@is", $src, $matches)) && $_POST['object'] == 'body') { - $content = $matches[1]; - } else { - $content = $src; - $s = '/(]+charset\s*=)[^>"\'=]+(.+>)/i'; - $r = '$1' . $modx->config['modx_charset'] . '$2'; - $content = preg_replace($s, $r, $content); - $content = preg_replace('@.*@i', "[*pagetitle*]", $content); - } - $content = str_replace('[*content*]', '[ *content* ]', $content); - $content = trim($content); - $pagetitle = $modx->db->escape($pagetitle); - return array( - $pagetitle, - $content, - $description - ); +function treatContent($src, $filename, $alias) { + $modx = evolutionCMS(); + + $src = mb_convert_encoding($src, $modx->config['modx_charset'], 'UTF-8,SJIS-win,eucJP-win,SJIS,EUC-JP,ASCII'); + + if(preg_match("@(.*)@i", $src, $matches)) { + $pagetitle = ($matches[1] !== '') ? $matches[1] : $filename; + $pagetitle = str_replace('[*pagetitle*]', '', $pagetitle); + } else { + $pagetitle = $alias; + } + if(!$pagetitle) { + $pagetitle = $alias; + } + + if(preg_match('@]+"description"[^>]+content=[\'"](.*)[\'"].+>@i', $src, $matches)) { + $description = ($matches[1] !== '') ? $matches[1] : $filename; + $description = str_replace('[*description*]', '', $description); + } else { + $description = ''; + } + + if((preg_match("@]*>(.*)[^<]+@is", $src, $matches)) && $_POST['object'] == 'body') { + $content = $matches[1]; + } else { + $content = $src; + $s = '/(]+charset\s*=)[^>"\'=]+(.+>)/i'; + $r = '$1' . $modx->config['modx_charset'] . '$2'; + $content = preg_replace($s, $r, $content); + $content = preg_replace('@.*@i', "[*pagetitle*]", $content); + } + $content = str_replace('[*content*]', '[ *content* ]', $content); + $content = trim($content); + $pagetitle = $modx->db->escape($pagetitle); + return array( + $pagetitle, + $content, + $description + ); } /** * @return void */ -function convertLink() -{ - $modx = evolutionCMS(); - $tbl_site_content = $modx->getFullTableName('site_content'); +function convertLink() { + $modx = evolutionCMS(); + $tbl_site_content = $modx->getFullTableName('site_content'); - $rs = $modx->db->select('id,content', $tbl_site_content); - $p = array(); + $rs = $modx->db->select('id,content', $tbl_site_content); + $p = array(); $target = array(); - $dir = ''; - while ($row = $modx->db->getRow($rs)) { - $id = $row['id']; - $array = explode('config['site_url']) !== false) { - $_ = $modx->config['base_url'] . str_replace($modx->config['site_url'], '', $_); - } - if ($_[0] === '/') { - $_ = substr($_, 1); - } - $_ = str_replace('/index.html', '.html', $_); - $level = substr_count($_, '../'); - if (1 < $level) { - if (!isset($p[$id])) { - $p[$id] = $modx->getParentIds($id); - } - $k = array_keys($p[$id]); - while (0 < $level) { - $dir = array_shift($k); - $level--; - } - if ($dir != '') { - $dir .= '/'; - } - } else { - $dir = ''; - } - - $_ = trim($_, './'); - if (strpos($_, '/') !== false) { - $_ = substr($_, strrpos($_, '/')); - } - $_ = $dir . str_replace('.html', '', $_); - if (!isset($target[$_])) { - $target[$_] = $modx->getIdFromAlias($_); - } - $target[$_] = trim($target[$_]); - if (!empty($target[$_])) { - $href = '[~' . $target[$_] . '~]'; - } - $array[$c] = 'db->escape($content); - $modx->db->update($f, $tbl_site_content, "id='{$id}'"); - } + $dir = ''; + while($row = $modx->db->getRow($rs)) { + $id = $row['id']; + $array = explode('config['site_url']) !== false) { + $_ = $modx->config['base_url'] . str_replace($modx->config['site_url'], '', $_); + } + if($_[0] === '/') { + $_ = substr($_, 1); + } + $_ = str_replace('/index.html', '.html', $_); + $level = substr_count($_, '../'); + if(1 < $level) { + if(!isset($p[$id])) { + $p[$id] = $modx->getParentIds($id); + } + $k = array_keys($p[$id]); + while(0 < $level) { + $dir = array_shift($k); + $level--; + } + if($dir != '') { + $dir .= '/'; + } + } else { + $dir = ''; + } + + $_ = trim($_, './'); + if(strpos($_, '/') !== false) { + $_ = substr($_, strrpos($_, '/')); + } + $_ = $dir . str_replace('.html', '', $_); + if(!isset($target[$_])) { + $target[$_] = $modx->getIdFromAlias($_); + } + $target[$_] = trim($target[$_]); + if(!empty($target[$_])) { + $href = '[~' . $target[$_] . '~]'; + } + $array[$c] = 'db->escape($content); + $modx->db->update($f, $tbl_site_content, "id='{$id}'"); + } } diff --git a/manager/actions/logging.static.php b/manager/actions/logging.static.php index e763c659e7..26f678b7ad 100755 --- a/manager/actions/logging.static.php +++ b/manager/actions/logging.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('logs')) { @@ -183,83 +183,83 @@ function record_sort($array, $key) db->escape($_REQUEST['itemname']) . "'"; - } - if ($_REQUEST['message'] != "") { - $sqladd[] = "message LIKE '%" . $modx->db->escape($_REQUEST['message']) . "%'"; - } - // date stuff - if ($_REQUEST['datefrom'] != "") { - $sqladd[] = "timestamp>" . $modx->toTimeStamp($_REQUEST['datefrom']); - } - if ($_REQUEST['dateto'] != "") { - $sqladd[] = "timestamp<" . $modx->toTimeStamp($_REQUEST['dateto']); - } + // get the selections the user made. + $sqladd = array(); + if ($_REQUEST['searchuser'] != 0) { + $sqladd[] = "internalKey='" . (int)$_REQUEST['searchuser'] . "'"; + } + if ($_REQUEST['action'] != 0) { + $sqladd[] = "action=" . (int)$_REQUEST['action']; + } + if ($_REQUEST['itemid'] != 0 || $_REQUEST['itemid'] == "-") { + $sqladd[] = "itemid='" . $_REQUEST['itemid'] . "'"; + } + if ($_REQUEST['itemname'] != '0') { + $sqladd[] = "itemname='" . $modx->db->escape($_REQUEST['itemname']) . "'"; + } + if ($_REQUEST['message'] != "") { + $sqladd[] = "message LIKE '%" . $modx->db->escape($_REQUEST['message']) . "%'"; + } + // date stuff + if ($_REQUEST['datefrom'] != "") { + $sqladd[] = "timestamp>" . $modx->toTimeStamp($_REQUEST['datefrom']); + } + if ($_REQUEST['dateto'] != "") { + $sqladd[] = "timestamp<" . $modx->toTimeStamp($_REQUEST['dateto']); + } - // If current position is not set, set it to zero - if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) { - $int_cur_position = 0; - } else { - $int_cur_position = $_REQUEST['int_cur_position']; - } + // If current position is not set, set it to zero + if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) { + $int_cur_position = 0; + } else { + $int_cur_position = $_REQUEST['int_cur_position']; + } - // Number of result to display on the page, will be in the LIMIT of the sql query also - $int_num_result = is_numeric($_REQUEST['nrresults']) ? $_REQUEST['nrresults'] : $number_of_logs; + // Number of result to display on the page, will be in the LIMIT of the sql query also + $int_num_result = is_numeric($_REQUEST['nrresults']) ? $_REQUEST['nrresults'] : $number_of_logs; - $extargv = "&a=13&searchuser=" . $_REQUEST['searchuser'] . "&action=" . $_REQUEST['action'] . "&itemid=" . $_REQUEST['itemid'] . "&itemname=" . $_REQUEST['itemname'] . "&message=" . $_REQUEST['message'] . "&dateto=" . $_REQUEST['dateto'] . "&datefrom=" . $_REQUEST['datefrom'] . "&nrresults=" . $int_num_result . "&log_submit=" . $_REQUEST['log_submit']; // extra argv here (could be anything depending on your page) + $extargv = "&a=13&searchuser=" . $_REQUEST['searchuser'] . "&action=" . $_REQUEST['action'] . "&itemid=" . $_REQUEST['itemid'] . "&itemname=" . $_REQUEST['itemname'] . "&message=" . $_REQUEST['message'] . "&dateto=" . $_REQUEST['dateto'] . "&datefrom=" . $_REQUEST['datefrom'] . "&nrresults=" . $int_num_result . "&log_submit=" . $_REQUEST['log_submit']; // extra argv here (could be anything depending on your page) - // build the sql - $limit = $num_rows = $modx->db->getValue($modx->db->select('COUNT(*)', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''))); + // build the sql + $limit = $num_rows = $modx->db->getValue($modx->db->select('COUNT(*)', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''))); - $rs = $modx->db->select('*', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''), 'timestamp DESC, id DESC', "{$int_cur_position}, {$int_num_result}"); + $rs = $modx->db->select('*', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''), 'timestamp DESC, id DESC', "{$int_cur_position}, {$int_num_result}"); - if ($limit < 1) { - echo '

    ' . $_lang["mgrlog_emptysrch"] . '

    '; - } else { - echo '

    ' . $_lang["mgrlog_sortinst"] . '

    '; +if ($limit < 1) { + echo '

    ' . $_lang["mgrlog_emptysrch"] . '

    '; +} else { + echo '

    ' . $_lang["mgrlog_sortinst"] . '

    '; - include_once "paginate.inc.php"; - // New instance of the Paging class, you can modify the color and the width of the html table - $p = new Paging($num_rows, $int_cur_position, $int_num_result, $extargv); + include_once "paginate.inc.php"; + // New instance of the Paging class, you can modify the color and the width of the html table + $p = new Paging($num_rows, $int_cur_position, $int_num_result, $extargv); - // Load up the 2 array in order to display result - $array_paging = $p->getPagingArray(); - $array_row_paging = $p->getPagingRowArray(); - $current_row = $int_cur_position / $int_num_result; + // Load up the 2 array in order to display result + $array_paging = $p->getPagingArray(); + $array_row_paging = $p->getPagingRowArray(); + $current_row = $int_cur_position / $int_num_result; - // Display the result as you like... - print "

    " . $_lang["paging_showing"] . " " . $array_paging['lower']; - print " " . $_lang["paging_to"] . " " . $array_paging['upper']; - print " (" . $array_paging['total'] . " " . $_lang["paging_total"] . ")
    "; - $paging = $array_paging['first_link'] . $_lang["paging_first"] . (isset($array_paging['first_link']) ? "
    " : " "); - $paging .= $array_paging['previous_link'] . $_lang["paging_prev"] . (isset($array_paging['previous_link']) ? " " : " "); - $pagesfound = sizeof($array_row_paging); - if ($pagesfound > 6) { - $paging .= $array_row_paging[$current_row - 2]; // ." "; + // Display the result as you like... + print "

    " . $_lang["paging_showing"] . " " . $array_paging['lower']; + print " " . $_lang["paging_to"] . " " . $array_paging['upper']; + print " (" . $array_paging['total'] . " " . $_lang["paging_total"] . ")
    "; + $paging = $array_paging['first_link'] . $_lang["paging_first"] . (isset($array_paging['first_link']) ? " " : " "); + $paging .= $array_paging['previous_link'] . $_lang["paging_prev"] . (isset($array_paging['previous_link']) ? " " : " "); + $pagesfound = sizeof($array_row_paging); + if ($pagesfound > 6) { + $paging .= $array_row_paging[$current_row - 2]; // ." "; $paging .= $array_row_paging[$current_row - 1]; // ." "; $paging .= $array_row_paging[$current_row]; // ." "; $paging .= $array_row_paging[$current_row + 1]; // ." "; $paging .= $array_row_paging[$current_row + 2]; // ." "; - } else { - for ($i = 0; $i < $pagesfound; $i++) { - $paging .= $array_row_paging[$i] . " "; - } - } - $paging .= $array_paging['next_link'] . $_lang["paging_next"] . (isset($array_paging['next_link']) ? " " : " ") . " "; - $paging .= $array_paging['last_link'] . $_lang["paging_last"] . (isset($array_paging['last_link']) ? " " : " ") . " "; - // The above exemple print somethings like: + } else { + for ($i = 0; $i < $pagesfound; $i++) { + $paging .= $array_row_paging[$i] . " "; + } + } + $paging .= $array_paging['next_link'] . $_lang["paging_next"] . (isset($array_paging['next_link']) ? " " : " ") . " "; + $paging .= $array_paging['last_link'] . $_lang["paging_last"] . (isset($array_paging['last_link']) ? " " : " ") . " "; + // The above exemple print somethings like: // Results 1 to 20 of 597 <<< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 >>> // Of course you can now play with array_row_paging in order to print // only the results you would like... @@ -289,17 +289,18 @@ function record_sort($array, $key) db->getRow($rs)) { - if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) { - $item = '

    -
    '; - } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) { - $item = '' . $logentry['itemname'] . ''; - } else { - $item = $logentry['itemname']; - } - //index.php?a=13&searchuser=' . $logentry['internalKey'] . '&action=' . $logentry['action'] . '&itemname=' . $logentry['itemname'] . '&log_submit=true' - $user_drill = 'index.php?a=13&searchuser=' . $logentry['internalKey'] . '&itemname=0&log_submit=true'; ?> + $i = 0; + while ($logentry = $modx->db->getRow($rs)) { + if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) { + $item = '
    -
    '; + } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) { + $item = '' . $logentry['itemname'] . ''; + } else { + $item = $logentry['itemname']; + } + //index.php?a=13&searchuser=' . $logentry['internalKey'] . '&action=' . $logentry['action'] . '&itemname=' . $logentry['itemname'] . '&log_submit=true' + $user_drill = 'index.php?a=13&searchuser=' . $logentry['internalKey'] . '&itemname=0&log_submit=true'; + ?> ' . $logentry['username'] . '' ?> @@ -311,7 +312,8 @@ function record_sort($array, $key) + } + ?> @@ -321,14 +323,15 @@ function record_sort($array, $key) +} +?> INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('messages')) { @@ -11,29 +11,29 @@ - +
    db->select('*', $modx->getFullTableName('user_messages'), "id='" . (int)$_REQUEST['id'] . "'"); - $message = $modx->db->getRow($rs); - if (!$message) { - echo "Wrong number of messages returned!"; - } else { - if ($message['recipient'] != $modx->getLoginUserID()) { - echo $_lang['messages_not_allowed_to_read']; - } else { - // output message! - // get the name of the sender - $sender = $message['sender']; - if ($sender == 0) { - $sendername = $_lang['messages_system_user']; + $message = $modx->db->getRow($rs); + if (!$message) { + echo "Wrong number of messages returned!"; } else { - $rs2 = $modx->db->select('username', $modx->getFullTableName('manager_users'), "id='{$sender}'"); - $sendername = $modx->db->getValue($rs2); - } ?> + if ($message['recipient'] != $modx->getLoginUserID()) { + echo $_lang['messages_not_allowed_to_read']; + } else { + // output message! + // get the name of the sender + $sender = $message['sender']; + if ($sender == 0) { + $sendername = $_lang['messages_system_user']; + } else { + $rs2 = $modx->db->select('username', $modx->getFullTableName('manager_users'), "id='{$sender}'"); + $sendername = $modx->db->getValue($rs2); + } + ?>
    @@ -63,23 +63,24 @@ ', $message['message']); - $dashcount = substr_count($message, '-----'); - $message = str_replace('-----', '', $message); - for ($i = 0; $i < $dashcount; $i++) { - $message .= ''; - } ?> + $dashcount = substr_count($message, '-----'); + $message = str_replace('-----', '', $message); + for ($i = 0; $i < $dashcount; $i++) { + $message .= ''; + } + ?>
    db->update(array('messageread' => 1), $modx->getFullTableName('user_messages'), "id='{$_REQUEST['id']}'"); - } - } ?> + } + } + ?>

    - +
    @@ -135,7 +136,8 @@ if ($limit < 1) { echo $_lang['messages_no_messages']; } else { - $dotablestuff = 1; ?> + $dotablestuff = 1; + ?>
    @@ -160,7 +162,8 @@ $rs2 = $modx->db->select('username', $modx->getFullTableName('manager_users'), "id='{$sender}'"); $sendername = $modx->db->getValue($rs2); } - $messagestyle = $message['messageread'] == 0 ? "text-primary" : ""; ?> + $messagestyle = $message['messageread'] == 0 ? "text-primary" : ""; + ?> ' : "" ?> @@ -169,13 +172,13 @@ toDateFormat($message['postdate'] + $server_offset_time) ?> + } + ?>
    - +
    diff --git a/manager/actions/modules.static.php b/manager/actions/modules.static.php index 829941e32d..a5257e8cfc 100755 --- a/manager/actions/modules.static.php +++ b/manager/actions/modules.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('exec_module'))) { @@ -116,7 +116,7 @@ function menuAction(a) ORDER BY sm.name'); if ($modx->hasPermission('edit_module')) { $title = "[+value+]"; - } elseif ($modx->hasPermission('exec_module')) { + } else if ($modx->hasPermission('exec_module')) { $title = "[+value+]"; } else { $title = '[+value+]'; diff --git a/manager/actions/move_document.dynamic.php b/manager/actions/move_document.dynamic.php index 5f9b6c0002..435f7b2625 100755 --- a/manager/actions/move_document.dynamic.php +++ b/manager/actions/move_document.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_document')) { diff --git a/manager/actions/mutate_categories.dynamic.php b/manager/actions/mutate_categories.dynamic.php index f98e83a47c..f58cede882 100755 --- a/manager/actions/mutate_categories.dynamic.php +++ b/manager/actions/mutate_categories.dynamic.php @@ -1,44 +1,46 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('category_manager')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('category_manager')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $_module_params = array( - 'module_version' => '1.0.0', - 'module_params' => '', - 'module_id' => $_GET['id'], - 'package_name' => 'Module_Categories_Manager', - 'native_language' => 'de', - 'name' => 'Categories Manager', - 'dirname' => $site_manager_url, - 'url' => 'index.php?a=120&id=' . $_GET['id'], - 'path' => realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR, - 'inc_dir' => realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR, - 'languages_dir' => realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR, - 'views_dir' => realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'skin' . DIRECTORY_SEPARATOR, - 'request_key' => 'module_categories_manager', - 'messages' => array() + 'module_version' => '1.0.0', + 'module_params' => '', + 'module_id' => $_GET['id'], + 'package_name' => 'Module_Categories_Manager', + 'native_language' => 'de', + 'name' => 'Categories Manager', + 'dirname' => $site_manager_url, + 'url' => 'index.php?a=120&id=' . $_GET['id'], + 'path' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR, + 'inc_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR, + 'languages_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR, + 'views_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'skin' . DIRECTORY_SEPARATOR, + 'request_key' => 'module_categories_manager', + 'messages' => array() ); require_once $_module_params['inc_dir'] . 'Module_Categories_Manager.php'; $cm = new Module_Categories_Manager(); // assign module_params to internal params -foreach ($_module_params as $param => $value) { - $cm->set($param, $value); +foreach( $_module_params as $param => $value ) +{ + $cm->set( $param, $value ); } // catch the request actions include_once $cm->get('inc_dir') . 'request_trigger.inc.php'; -if (!$categories = $cm->getCategories()) { - setcookie('webfxtab_manage-categories-pane', 0); - $cm->addMessage($cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global'); +if( !$categories = $cm->getCategories() ) +{ + setcookie('webfxtab_manage-categories-pane', 0 ); + $cm->addMessage( $cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global' ); } -$cm->renderView('main', $categories); +$cm->renderView('main', $categories ); return; diff --git a/manager/actions/mutate_content.dynamic.php b/manager/actions/mutate_content.dynamic.php index 8d9b770d32..55c2714d57 100755 --- a/manager/actions/mutate_content.dynamic.php +++ b/manager/actions/mutate_content.dynamic.php @@ -1,6 +1,6 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } /********************/ @@ -11,31 +11,31 @@ /*******************/ // check permissions -switch ($modx->manager->action) { - case 27: - if (!$modx->hasPermission('edit_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 85: - case 72: - case 4: - if (!$modx->hasPermission('new_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '0') { - // check user has permissions for parent - include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php'); - $udperms = new udperms(); - $udperms->user = $modx->getLoginUserID(); - $udperms->document = empty($_REQUEST['pid']) ? 0 : $_REQUEST['pid']; - $udperms->role = $_SESSION['mgrRole']; - if (!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); - } - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +switch($modx->manager->action) { + case 27: + if(!$modx->hasPermission('edit_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 85: + case 72: + case 4: + if(!$modx->hasPermission('new_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } elseif(isset($_REQUEST['pid']) && $_REQUEST['pid'] != '0') { + // check user has permissions for parent + include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php'); + $udperms = new udperms(); + $udperms->user = $modx->getLoginUserID(); + $udperms->document = empty($_REQUEST['pid']) ? 0 : $_REQUEST['pid']; + $udperms->role = $_SESSION['mgrRole']; + if(!$udperms->checkPermissions()) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); + } + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; @@ -53,23 +53,23 @@ $tbl_site_tmplvar_templates = $modx->getFullTableName('site_tmplvar_templates'); $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); -if ($modx->manager->action == 27) { - //editing an existing document - // check permissions on the document - include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php'); - $udperms = new udperms(); - $udperms->user = $modx->getLoginUserID(); - $udperms->document = $id; - $udperms->role = $_SESSION['mgrRole']; - - if (!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); - } +if($modx->manager->action == 27) { + //editing an existing document + // check permissions on the document + include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php'); + $udperms = new udperms(); + $udperms->user = $modx->getLoginUserID(); + $udperms->document = $id; + $udperms->role = $_SESSION['mgrRole']; + + if(!$udperms->checkPermissions()) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); + } } // check to see if resource isn't locked -if ($lockedEl = $modx->elementIsLocked(7, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['resource'])); +if($lockedEl = $modx->elementIsLocked(7, $id)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['resource'])); } // end check for lock @@ -77,75 +77,75 @@ $modx->lockElement(7, $id); // get document groups for current user -if ($_SESSION['mgrDocgroups']) { - $docgrp = implode(',', $_SESSION['mgrDocgroups']); +if($_SESSION['mgrDocgroups']) { + $docgrp = implode(',', $_SESSION['mgrDocgroups']); } -if (!empty($id)) { - $access = sprintf("1='%s' OR sc.privatemgr=0", $_SESSION['mgrRole']); - if ($docgrp) { - $access .= " OR dg.document_group IN ({$docgrp})"; - } - $rs = $modx->db->select('sc.*', "{$tbl_site_content} AS sc LEFT JOIN {$tbl_document_groups} AS dg ON dg.document=sc.id", "sc.id='{$id}' AND ({$access})"); - $content = array(); - $content = $modx->db->getRow($rs); - $modx->documentObject = &$content; - if (!$content) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); - } - $_SESSION['itemname'] = $content['pagetitle']; +if(!empty ($id)) { + $access = sprintf("1='%s' OR sc.privatemgr=0", $_SESSION['mgrRole']); + if($docgrp) { + $access .= " OR dg.document_group IN ({$docgrp})"; + } + $rs = $modx->db->select('sc.*', "{$tbl_site_content} AS sc LEFT JOIN {$tbl_document_groups} AS dg ON dg.document=sc.id", "sc.id='{$id}' AND ({$access})"); + $content = array(); + $content = $modx->db->getRow($rs); + $modx->documentObject = &$content; + if(!$content) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); + } + $_SESSION['itemname'] = $content['pagetitle']; } else { - $content = array(); + $content = array(); - if (isset($_REQUEST['newtemplate'])) { - $content['template'] = $_REQUEST['newtemplate']; - } else { - $content['template'] = getDefaultTemplate(); - } + if(isset($_REQUEST['newtemplate'])) { + $content['template'] = $_REQUEST['newtemplate']; + } else { + $content['template'] = getDefaultTemplate(); + } - $_SESSION['itemname'] = $_lang["new_resource"]; + $_SESSION['itemname'] = $_lang["new_resource"]; } // restore saved form $formRestored = $modx->manager->loadFormValues(); -if (isset($_REQUEST['newtemplate'])) { - $formRestored = true; +if(isset($_REQUEST['newtemplate'])) { + $formRestored = true; } // retain form values if template was changed // edited to convert pub_date and unpub_date // sottwell 02-09-2006 -if ($formRestored == true) { - $content = array_merge($content, $_POST); - $content['content'] = $_POST['ta']; - if (empty($content['pub_date'])) { - unset($content['pub_date']); - } else { - $content['pub_date'] = $modx->toTimeStamp($content['pub_date']); - } - if (empty($content['unpub_date'])) { - unset($content['unpub_date']); - } else { - $content['unpub_date'] = $modx->toTimeStamp($content['unpub_date']); - } +if($formRestored == true) { + $content = array_merge($content, $_POST); + $content['content'] = $_POST['ta']; + if(empty ($content['pub_date'])) { + unset ($content['pub_date']); + } else { + $content['pub_date'] = $modx->toTimeStamp($content['pub_date']); + } + if(empty ($content['unpub_date'])) { + unset ($content['unpub_date']); + } else { + $content['unpub_date'] = $modx->toTimeStamp($content['unpub_date']); + } } // increase menu index if this is a new document -if (!isset($_REQUEST['id'])) { - if (!isset($modx->config['auto_menuindex'])) { - $modx->config['auto_menuindex'] = 1; - } - if ($modx->config['auto_menuindex']) { - $pid = (int)$_REQUEST['pid']; - $rs = $modx->db->select('count(*)', $tbl_site_content, "parent='{$pid}'"); - $content['menuindex'] = $modx->db->getValue($rs); - } else { - $content['menuindex'] = 0; - } +if(!isset ($_REQUEST['id'])) { + if(!isset ($modx->config['auto_menuindex'])) { + $modx->config['auto_menuindex'] = 1; + } + if($modx->config['auto_menuindex']) { + $pid = (int)$_REQUEST['pid']; + $rs = $modx->db->select('count(*)', $tbl_site_content, "parent='{$pid}'"); + $content['menuindex'] = $modx->db->getValue($rs); + } else { + $content['menuindex'] = 0; + } } -if (isset($_POST['which_editor'])) { - $modx->config['which_editor'] = $_POST['which_editor']; +if(isset ($_POST['which_editor'])) { + $modx->config['which_editor'] = $_POST['which_editor']; } // Add lock-element JS-Script @@ -478,7 +478,7 @@ function decode(s) { return s; } - manager->action == '72') { // Web Link specific?> + manager->action == '72') { // Web Link specific ?> var lastImageCtrl; var lastFileCtrl; @@ -539,30 +539,29 @@ function SetUrl(url, width, height, alt) { } } - + /* ]]> */ invokeEvent('OnDocFormPrerender', array( - 'id' => $id, - 'template' => $content['template'] - )); - - if (is_array($evtOut)) { - echo implode('', $evtOut); - } - - /*************************/ - $dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : ''; - $sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : 'createdon'; - $page = isset($_REQUEST['page']) ? (int) $_REQUEST['page'] : ''; - /*************************/ - - ?> + // invoke OnDocFormPrerender event + $evtOut = $modx->invokeEvent('OnDocFormPrerender', array( + 'id' => $id, + 'template' => $content['template'] + )); + + if(is_array($evtOut)) { + echo implode('', $evtOut); + } + + /*************************/ + $dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : ''; + $sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : 'createdon'; + $page = isset($_REQUEST['page']) ? (int) $_REQUEST['page'] : ''; + /*************************/ + + ?> @@ -576,55 +575,55 @@ function SetUrl(url, width, height, alt) {

    - config['modx_charset']) . (iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '') . '(' . $_REQUEST['id'] . ')'; - } else { - if ($modx->manager->action == '4') { - echo $_lang['add_resource']; - } elseif ($modx->manager->action == '72') { - echo $_lang['add_weblink']; - } else { - echo $_lang['create_resource_title']; - } - } ?> + config['modx_charset']) . (iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '') . '(' . $_REQUEST['id'] . ')'; + } else { + if ($modx->manager->action == '4') { + echo $_lang['add_resource']; + } else if ($modx->manager->action == '72') { + echo $_lang['add_weblink']; + } else { + echo $_lang['create_resource_title']; + } + } ?>

    config['use_breadcrumbs']) { - $temp = array(); - $title = isset($content['pagetitle']) ? $content['pagetitle'] : $_lang['create_resource_title']; - - if (isset($_REQUEST['id']) && $content['parent'] != 0) { - $bID = (int) $_REQUEST['id']; - $temp = $modx->getParentIds($bID); - } elseif (isset($_REQUEST['pid'])) { - $bID = (int) $_REQUEST['pid']; - $temp = $modx->getParentIds($bID); - array_unshift($temp, $bID); - } - - if ($temp) { - $parents = implode(',', $temp); - - if (!empty($parents)) { - $where = "FIND_IN_SET(id,'{$parents}') DESC"; - $rs = $modx->db->select('id, pagetitle', $tbl_site_content, "id IN ({$parents})", $where); - while ($row = $modx->db->getRow($rs)) { - $out .= ''; - } - } - } + } + } + } - $out .= ''; - echo ''; - } - ?> + $out .= ''; + echo ''; + } + ?>
    @@ -636,13 +635,13 @@ function SetUrl(url, width, height, alt) { invokeEvent('OnDocFormTemplateRender', array( - 'id' => $id - )); - if (is_array($evtOut)) { - echo implode('', $evtOut); - } else { - ?> + $evtOut = $modx->invokeEvent('OnDocFormTemplateRender', array( + 'id' => $id + )); + if(is_array($evtOut)) { + echo implode('', $evtOut); + } else { + ?>

    @@ -695,7 +694,7 @@ function SetUrl(url, width, height, alt) { - manager->action == '72') { // Web Link specific?> + manager->action == '72') { // Web Link specific ?> @@ -707,8 +706,7 @@ function SetUrl(url, width, height, alt) { - + @@ -728,35 +726,36 @@ function SetUrl(url, width, height, alt) { @@ -796,36 +795,37 @@ function SetUrl(url, width, height, alt) { db->select('pagetitle', $tbl_site_content, "id='{$parentlookup}'"); - $parentname = $modx->db->getValue($rs); - if (!$parentname) { - $modx->webAlertAndQuit($_lang["error_no_parent"]); - } - } ?> + $parentlookup = false; + if(isset ($_REQUEST['id'])) { + if($content['parent'] == 0) { + $parentname = $site_name; + } else { + $parentlookup = $content['parent']; + } + } elseif(isset ($_REQUEST['pid'])) { + if($_REQUEST['pid'] == 0) { + $parentname = $site_name; + } else { + $parentlookup = $_REQUEST['pid']; + } + } elseif(isset($_POST['parent'])) { + if($_POST['parent'] == 0) { + $parentname = $site_name; + } else { + $parentlookup = $_POST['parent']; + } + } else { + $parentname = $site_name; + $content['parent'] = 0; + } + if($parentlookup !== false && is_numeric($parentlookup)) { + $rs = $modx->db->select('pagetitle', $tbl_site_content, "id='{$parentlookup}'"); + $parentname = $modx->db->getValue($rs); + if(!$parentname) { + $modx->webAlertAndQuit($_lang["error_no_parent"]); + } + } + ?> " onclick="enableParentSelection(!allowParentSelection);"> () @@ -833,38 +833,37 @@ function SetUrl(url, width, height, alt) { manager->action == '72') { - ?> - - -
    - - - - - - - - - - - - manager->action == '4') { - ?> + /* + if($content['type'] == 'reference' || $modx->manager->action == '72') { + ?> + + +
    + + + + + + + + + + + + manager->action == '4') { ?>
    @@ -875,105 +874,107 @@ function SetUrl(url, width, height, alt) {
    manager->action == '4') && $use_editor == 1) { - $htmlContent = $content['content']; ?> + if(($content['richtext'] == 1 || $modx->manager->action == '4') && $use_editor == 1) { + $htmlContent = $content['content']; + ?>
    config['which_editor']][] = 'ta'; - $richtexteditorOptions[$modx->config['which_editor']]['ta'] = ''; - } else { - echo "\t" . '
    ' . "\n"; - } ?> + // Richtext-[*content*] + $richtexteditorIds = array(); + $richtexteditorOptions = array(); + $richtexteditorIds[$modx->config['which_editor']][] = 'ta'; + $richtexteditorOptions[$modx->config['which_editor']]['ta'] = ''; + } else { + echo "\t" . '
    ' . "\n"; + } + ?>
    - + manager->action == '4') || ($content['type'] == 'reference' || $modx->manager->action == 72)) { - $template = $default_template; - $group_tvs = empty($modx->config['group_tvs']) ? 0 : (int)$modx->config['group_tvs']; - if (isset($_REQUEST['newtemplate'])) { - $template = $_REQUEST['newtemplate']; - } else { - if (isset($content['template'])) { - $template = $content['template']; + if (($content['type'] == 'document' || $modx->manager->action == '4') || ($content['type'] == 'reference' || $modx->manager->action == 72)) { + $template = $default_template; + $group_tvs = empty($modx->config['group_tvs']) ? 0 : (int)$modx->config['group_tvs']; + if (isset ($_REQUEST['newtemplate'])) { + $template = $_REQUEST['newtemplate']; + } else { + if (isset ($content['template'])) { + $template = $content['template']; + } } - } - $field = "DISTINCT tv.*, IF(tvc.value!='',tvc.value,tv.default_text) as value, tvtpl.rank as tvrank"; - $vs = array( + $field = "DISTINCT tv.*, IF(tvc.value!='',tvc.value,tv.default_text) as value, tvtpl.rank as tvrank"; + $vs = array( $tbl_site_tmplvars, $tbl_site_tmplvar_templates, $tbl_site_tmplvar_contentvalues, $id, $tbl_site_tmplvar_access ); - $from = vsprintf("%s AS tv INNER JOIN %s AS tvtpl ON tvtpl.tmplvarid = tv.id + $from = vsprintf("%s AS tv INNER JOIN %s AS tvtpl ON tvtpl.tmplvarid = tv.id LEFT JOIN %s AS tvc ON tvc.tmplvarid=tv.id AND tvc.contentid='%s' LEFT JOIN %s AS tva ON tva.tmplvarid=tv.id", $vs); - $dgs = $docgrp ? " OR tva.documentgroup IN ({$docgrp})" : ''; - $vs = array( + $dgs = $docgrp ? " OR tva.documentgroup IN ({$docgrp})" : ''; + $vs = array( $template, $_SESSION['mgrRole'], $dgs ); - $sort = 'tvtpl.rank,tv.rank, tv.id'; - if ($group_tvs) { - $field .= ', IFNULL(tv.category,0) as category_id, IFNULL(cat.category,"' . $_lang['no_category'] . '") AS category, IFNULL(cat.rank,0) AS category_rank'; - $from .= ' + $sort = 'tvtpl.rank,tv.rank, tv.id'; + if ($group_tvs) { + $field .= ', IFNULL(tv.category,0) as category_id, IFNULL(cat.category,"' . $_lang['no_category'] . '") AS category, IFNULL(cat.rank,0) AS category_rank'; + $from .= ' LEFT JOIN ' . $tbl_categories . ' AS cat ON cat.id=tv.category'; - $sort = 'cat.rank,cat.id,' . $sort; - } - $where = vsprintf("tvtpl.templateid='%s' AND (1='%s' OR ISNULL(tva.documentgroup) %s)", $vs); - $rs = $modx->db->select($field, $from, $where, $sort); - if ($modx->db->getRecordCount($rs)) { - $tvsArray = $modx->db->makeArray($rs, 'name'); - require_once(MODX_MANAGER_PATH . 'includes/tmplvars.inc.php'); - require_once(MODX_MANAGER_PATH . 'includes/tmplvars.commands.inc.php'); - - $templateVariablesOutput = ''; - $templateVariablesGeneral = ''; - - $i = $ii = 0; - $tab = ''; - foreach ($tvsArray as $row) { - if ($group_tvs && $row['category_id'] != 0) { - $ii = 0; - if ($tab !== $row['category_id']) { - if ($group_tvs == 1 || $group_tvs == 3) { - if ($i === 0) { - $templateVariablesOutput .= ' + $sort = 'cat.rank,cat.id,' . $sort; + } + $where = vsprintf("tvtpl.templateid='%s' AND (1='%s' OR ISNULL(tva.documentgroup) %s)", $vs); + $rs = $modx->db->select($field, $from, $where, $sort); + if ($modx->db->getRecordCount($rs)) { + $tvsArray = $modx->db->makeArray($rs, 'name'); + require_once(MODX_MANAGER_PATH . 'includes/tmplvars.inc.php'); + require_once(MODX_MANAGER_PATH . 'includes/tmplvars.commands.inc.php'); + + $templateVariablesOutput = ''; + $templateVariablesGeneral = ''; + + $i = $ii = 0; + $tab = ''; + foreach ($tvsArray as $row) { + if ($group_tvs && $row['category_id'] != 0) { + $ii = 0; + if ($tab !== $row['category_id']) { + if ($group_tvs == 1 || $group_tvs == 3) { + if ($i === 0) { + $templateVariablesOutput .= '
    ' . $row['category'] . '
    ' . "\n"; - } else { - $templateVariablesOutput .= ' + } else { + $templateVariablesOutput .= '
    @@ -982,18 +983,18 @@ function SetUrl(url, width, height, alt) {
    ' . $row['category'] . '
    '; - } - } elseif ($group_tvs == 2 || $group_tvs == 4) { - if ($i === 0) { - $templateVariablesOutput .= ' + } + } else if ($group_tvs == 2 || $group_tvs == 4) { + if ($i === 0) { + $templateVariablesOutput .= '

    ' . $row['category'] . '

    '; - } else { - $templateVariablesOutput .= ' + } else { + $templateVariablesOutput .= '
    @@ -1004,16 +1005,16 @@ function SetUrl(url, width, height, alt) {
    '; - } - } elseif ($group_tvs == 5) { - if ($i === 0) { - $templateVariablesOutput .= ' + } + } else if ($group_tvs == 5) { + if ($i === 0) { + $templateVariablesOutput .= '

    ' . $row['category'] . '

    '; - } else { - $templateVariablesOutput .= ' + } else { + $templateVariablesOutput .= '
    @@ -1022,97 +1023,97 @@ function SetUrl(url, width, height, alt) { '; + } } + $split = 0; + } else { + $split = 1; } - $split = 0; - } else { - $split = 1; } - } - // Go through and display all Template Variables - if ($row['type'] == 'richtext' || $row['type'] == 'htmlarea') { - // determine TV-options - $tvOptions = $modx->parseProperties($row['elements']); - if (!empty($tvOptions)) { - // Allow different Editor with TV-option {"editor":"CKEditor4"} or &editor=Editor;text;CKEditor4 - $editor = isset($tvOptions['editor']) ? $tvOptions['editor'] : $modx->config['which_editor']; - }; - // Add richtext editor to the list - $richtexteditorIds[$editor][] = "tv" . $row['id']; - $richtexteditorOptions[$editor]["tv" . $row['id']] = $tvOptions; - } + // Go through and display all Template Variables + if ($row['type'] == 'richtext' || $row['type'] == 'htmlarea') { + // determine TV-options + $tvOptions = $modx->parseProperties($row['elements']); + if (!empty($tvOptions)) { + // Allow different Editor with TV-option {"editor":"CKEditor4"} or &editor=Editor;text;CKEditor4 + $editor = isset($tvOptions['editor']) ? $tvOptions['editor'] : $modx->config['which_editor']; + }; + // Add richtext editor to the list + $richtexteditorIds[$editor][] = "tv" . $row['id']; + $richtexteditorOptions[$editor]["tv" . $row['id']] = $tvOptions; + } - $templateVariablesTmp = ''; + $templateVariablesTmp = ''; - // splitter - if ($group_tvs) { - if (($split && $i) || $ii) { - $templateVariablesTmp .= ' + // splitter + if ($group_tvs) { + if (($split && $i) || $ii) { + $templateVariablesTmp .= ' ' . "\n"; - } - } elseif ($i) { - $templateVariablesTmp .= ' + } + } else if ($i) { + $templateVariablesTmp .= ' ' . "\n"; - } + } - // post back value - if (array_key_exists('tv' . $row['id'], $_POST)) { - if (is_array($_POST['tv' . $row['id']])) { - $tvPBV = implode('||', $_POST['tv' . $row['id']]); + // post back value + if (array_key_exists('tv' . $row['id'], $_POST)) { + if (is_array($_POST['tv' . $row['id']])) { + $tvPBV = implode('||', $_POST['tv' . $row['id']]); + } else { + $tvPBV = $_POST['tv' . $row['id']]; + } } else { - $tvPBV = $_POST['tv' . $row['id']]; + $tvPBV = $row['value']; } - } else { - $tvPBV = $row['value']; - } - $tvDescription = (!empty($row['description'])) ? '
    ' . $row['description'] . '' : ''; - $tvInherited = (substr($tvPBV, 0, 8) == '@INHERIT') ? '
    (' . $_lang['tmplvars_inherited'] . ')' : ''; - $tvName = $modx->hasPermission('edit_template') ? '
    [*' . $row['name'] . '*]' : ''; + $tvDescription = (!empty($row['description'])) ? '
    ' . $row['description'] . '' : ''; + $tvInherited = (substr($tvPBV, 0, 8) == '@INHERIT') ? '
    (' . $_lang['tmplvars_inherited'] . ')' : ''; + $tvName = $modx->hasPermission('edit_template') ? '
    [*' . $row['name'] . '*]' : ''; - $templateVariablesTmp .= ' + $templateVariablesTmp .= ' '; - if ($group_tvs && $row['category_id'] == 0) { - $templateVariablesGeneral .= $templateVariablesTmp; - $ii++; - } else { - $templateVariablesOutput .= $templateVariablesTmp; - $tab = $row['category_id']; - $i++; + if ($group_tvs && $row['category_id'] == 0) { + $templateVariablesGeneral .= $templateVariablesTmp; + $ii++; + } else { + $templateVariablesOutput .= $templateVariablesTmp; + $tab = $row['category_id']; + $i++; + } } - } - if ($templateVariablesGeneral) { - echo '
    ' . $row['caption'] . $tvName . '' . $tvDescription . $tvInherited . '
    ' . renderFormElement($row['type'], $row['id'], $row['default_text'], $row['elements'], $tvPBV, '', $row, $tvsArray) . '
    ' . $templateVariablesGeneral . '
    '; - } + if ($templateVariablesGeneral) { + echo '' . $templateVariablesGeneral . '
    '; + } - $templateVariables .= ' - ' . "\n"; - if (!$group_tvs) { $templateVariables .= ' + ' . "\n"; + if (!$group_tvs) { + $templateVariables .= '
    ' . $_lang['settings_templvars'] . '
    '; - } elseif ($group_tvs == 2) { - $templateVariables .= ' + } else if ($group_tvs == 2) { + $templateVariables .= '
    ' . $_lang['settings_templvars'] . '
    '; - } elseif ($group_tvs == 3) { - $templateVariables .= ' + } else if ($group_tvs == 3) { + $templateVariables .= '

    ' . $_lang['settings_templvars'] . '

    '; - } elseif ($group_tvs == 4) { - $templateVariables .= ' + } else if ($group_tvs == 4) { + $templateVariables .= '

    ' . $_lang['settings_templvars'] . '

    @@ -1121,33 +1122,34 @@ function SetUrl(url, width, height, alt) { '; - } - $templateVariables .= $templateVariablesOutput; - $templateVariables .= ' + } + $templateVariables .= $templateVariablesOutput; + $templateVariables .= '
    ' . "\n"; - if ($group_tvs == 1) { - $templateVariables .= ' + if ($group_tvs == 1) { + $templateVariables .= ' ' . "\n"; - } elseif ($group_tvs == 2 || $group_tvs == 4) { - $templateVariables .= ' + } else if ($group_tvs == 2 || $group_tvs == 4) { + $templateVariables .= ' ' . "\n"; - } elseif ($group_tvs == 3) { - $templateVariables .= ' + } else if ($group_tvs == 3) { + $templateVariables .= ' ' . "\n"; - } - $templateVariables .= ' + } + $templateVariables .= ' ' . "\n"; + } } - } - // Template Variables - if ($modx->config['group_tvs'] < 3) { - echo $templateVariables; - } ?> + // Template Variables + if ($modx->config['group_tvs'] < 3) { + echo $templateVariables; + } + ?> @@ -1210,8 +1212,8 @@ function SetUrl(url, width, height, alt) { manager->action != '27' || $_SESSION['mgrInternalKey'] == $content['createdby'] || $modx->hasPermission('change_resourcetype')) { - ?> + if($_SESSION['mgrRole'] == 1 || $modx->manager->action != '27' || $_SESSION['mgrInternalKey'] == $content['createdby'] || $modx->hasPermission('change_resourcetype')) { + ?> @@ -1233,14 +1235,15 @@ function SetUrl(url, width, height, alt) { @@ -1263,23 +1266,23 @@ function SetUrl(url, width, height, alt) { manager->action != '72') { - // non-admin managers creating or editing a document resource - ?> + } else { + if($content['type'] != 'reference' && $modx->manager->action != '72') { + // non-admin managers creating or editing a document resource + ?> " /> + } else { + // non-admin managers creating or editing a reference (weblink) resource + ?> + } + }//if mgrRole + ?> @@ -1352,8 +1355,7 @@ function SetUrl(url, width, height, alt) { - + manager->action == '27' ? $id : (!empty($_REQUEST['pid']) ? $_REQUEST['pid'] : $content['parent'])); - if ($documentId > 0) { - // Load up, the permissions from the parent (if new document) or existing document - $rs = $modx->db->select('id, document_group', $tbl_document_groups, "document='{$documentId}'"); - while ($currentgroup = $modx->db->getRow($rs)) { - $groupsarray[] = $currentgroup['document_group'] . ',' . $currentgroup['id']; - } - - // Load up the current permissions and names - $vs = array( - $tbl_document_group_names, - $tbl_document_groups, - $documentId - ); - $from = vsprintf("%s AS dgn LEFT JOIN %s AS groups ON groups.document_group=dgn.id AND groups.document='%s'", $vs); - $rs = $modx->db->select('dgn.*, groups.id AS link_id', $from, '', 'name'); - } else { - // Just load up the names, we're starting clean - $rs = $modx->db->select('*, NULL AS link_id', $tbl_document_group_names, '', 'name'); - } - - // retain selected doc groups between post - if (isset($_POST['docgroups'])) { - $groupsarray = array_merge($groupsarray, $_POST['docgroups']); - } - - $isManager = $modx->hasPermission('access_permissions'); - $isWeb = $modx->hasPermission('web_access_permissions'); - - // Setup Basic attributes for each Input box - $inputAttributes = array( - 'type' => 'checkbox', - 'class' => 'checkbox', - 'name' => 'docgroups[]', - 'onclick' => 'makePublic(false);', - ); - $permissions = array(); // New Permissions array list (this contains the HTML) - $permissions_yes = 0; // count permissions the current mgr user has - $permissions_no = 0; // count permissions the current mgr user doesn't have - - // Loop through the permissions list - while ($row = $modx->db->getRow($rs)) { - - // Create an inputValue pair (group ID and group link (if it exists)) - $inputValue = $row['id'] . ',' . ($row['link_id'] ? $row['link_id'] : 'new'); - $inputId = 'group-' . $row['id']; - - $checked = in_array($inputValue, $groupsarray); - if ($checked) { - $notPublic = true; - } // Mark as private access (either web or manager) - - // Skip the access permission if the user doesn't have access... - if ((!$isManager && $row['private_memgroup'] == '1') || (!$isWeb && $row['private_webgroup'] == '1')) { - continue; - } + /******************************* + * Document Access Permissions */ + if($use_udperms == 1) { + $groupsarray = array(); + $sql = ''; + + $documentId = ($modx->manager->action == '27' ? $id : (!empty($_REQUEST['pid']) ? $_REQUEST['pid'] : $content['parent'])); + if($documentId > 0) { + // Load up, the permissions from the parent (if new document) or existing document + $rs = $modx->db->select('id, document_group', $tbl_document_groups, "document='{$documentId}'"); + while($currentgroup = $modx->db->getRow($rs)) $groupsarray[] = $currentgroup['document_group'] . ',' . $currentgroup['id']; + + // Load up the current permissions and names + $vs = array( + $tbl_document_group_names, + $tbl_document_groups, + $documentId + ); + $from = vsprintf("%s AS dgn LEFT JOIN %s AS groups ON groups.document_group=dgn.id AND groups.document='%s'", $vs); + $rs = $modx->db->select('dgn.*, groups.id AS link_id', $from, '', 'name'); + } else { + // Just load up the names, we're starting clean + $rs = $modx->db->select('*, NULL AS link_id', $tbl_document_group_names, '', 'name'); + } - // Setup attributes for this Input box - $inputAttributes['id'] = $inputId; - $inputAttributes['value'] = $inputValue; - if ($checked) { - $inputAttributes['checked'] = 'checked'; - } else { - unset($inputAttributes['checked']); - } + // retain selected doc groups between post + if(isset($_POST['docgroups'])) { + $groupsarray = array_merge($groupsarray, $_POST['docgroups']); + } - // Create attribute string list - $inputString = array(); - foreach ($inputAttributes as $k => $v) { - $inputString[] = $k . '="' . $v . '"'; - } + $isManager = $modx->hasPermission('access_permissions'); + $isWeb = $modx->hasPermission('web_access_permissions'); + + // Setup Basic attributes for each Input box + $inputAttributes = array( + 'type' => 'checkbox', + 'class' => 'checkbox', + 'name' => 'docgroups[]', + 'onclick' => 'makePublic(false);', + ); + $permissions = array(); // New Permissions array list (this contains the HTML) + $permissions_yes = 0; // count permissions the current mgr user has + $permissions_no = 0; // count permissions the current mgr user doesn't have + + // Loop through the permissions list + while($row = $modx->db->getRow($rs)) { + + // Create an inputValue pair (group ID and group link (if it exists)) + $inputValue = $row['id'] . ',' . ($row['link_id'] ? $row['link_id'] : 'new'); + $inputId = 'group-' . $row['id']; + + $checked = in_array($inputValue, $groupsarray); + if($checked) { + $notPublic = true; + } // Mark as private access (either web or manager) + + // Skip the access permission if the user doesn't have access... + if((!$isManager && $row['private_memgroup'] == '1') || (!$isWeb && $row['private_webgroup'] == '1')) { + continue; + } + + // Setup attributes for this Input box + $inputAttributes['id'] = $inputId; + $inputAttributes['value'] = $inputValue; + if($checked) { + $inputAttributes['checked'] = 'checked'; + } else { + unset($inputAttributes['checked']); + } + + // Create attribute string list + $inputString = array(); + foreach($inputAttributes as $k => $v) $inputString[] = $k . '="' . $v . '"'; + + // Make the HTML + $inputHTML = ''; + + // does user have this permission? + $from = "{$tbl_membergroup_access} AS mga, {$tbl_member_groups} AS mg"; + $vs = array( + $row['id'], + $_SESSION['mgrInternalKey'] + ); + $where = vsprintf("mga.membergroup=mg.user_group AND mga.documentgroup=%s AND mg.member=%s", $vs); + $rsp = $modx->db->select('COUNT(mg.id)', $from, $where); + $count = $modx->db->getValue($rsp); + if($count > 0) { + ++$permissions_yes; + } else { + ++$permissions_no; + } + $permissions[] = "\t\t" . '
  • ' . $inputHTML . '
  • '; + } + // if mgr user doesn't have access to any of the displayable permissions, forget about them and make doc public + if($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0)) { + $permissions = array(); + } - // Make the HTML - $inputHTML = ''; - - // does user have this permission? - $from = "{$tbl_membergroup_access} AS mga, {$tbl_member_groups} AS mg"; - $vs = array( - $row['id'], - $_SESSION['mgrInternalKey'] - ); - $where = vsprintf("mga.membergroup=mg.user_group AND mga.documentgroup=%s AND mg.member=%s", $vs); - $rsp = $modx->db->select('COUNT(mg.id)', $from, $where); - $count = $modx->db->getValue($rsp); - if ($count > 0) { - ++$permissions_yes; - } else { - ++$permissions_no; - } - $permissions[] = "\t\t" . '
  • ' . $inputHTML . '
  • '; - } - // if mgr user doesn't have access to any of the displayable permissions, forget about them and make doc public - if ($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0)) { - $permissions = array(); - } - - // See if the Access Permissions section is worth displaying... - if (!empty($permissions)) { - // Add the "All Document Groups" item if we have rights in both contexts - if ($isManager && $isWeb) { - array_unshift($permissions, "\t\t" . '
  • '); - } - // Output the permissions list... - ?> + // See if the Access Permissions section is worth displaying... + if(!empty($permissions)) { + // Add the "All Document Groups" item if we have rights in both contexts + if($isManager && $isWeb) { + array_unshift($permissions, "\t\t" . '
  • '); + } + // Output the permissions list... + ?>

    @@ -1506,30 +1504,31 @@ function makePublic(b) {
    0) && ($_SESSION['mgrPermissions']['access_permissions'] == 1 || $_SESSION['mgrPermissions']['web_access_permissions'] == 1)) { - ?> + } // !empty($permissions) + elseif($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0) && ($_SESSION['mgrPermissions']['access_permissions'] == 1 || $_SESSION['mgrPermissions']['web_access_permissions'] == 1)) { + ?>

    + + } + } + /* End Document Access Permissions * + ***********************************/ + ?> invokeEvent('OnDocFormRender', array( - 'id' => $id, - 'template' => $content['template'] - )); + // invoke OnDocFormRender event + $evtOut = $modx->invokeEvent('OnDocFormRender', array( + 'id' => $id, + 'template' => $content['template'] + )); - if (is_array($evtOut)) { - echo implode('', $evtOut); - } - ?> + if(is_array($evtOut)) { + echo implode('', $evtOut); + } + ?>
    @@ -1539,66 +1538,64 @@ function makePublic(b) { storeCurTemplate(); manager->action == '4' || $modx->manager->action == '72') && $use_editor == 1) { - if (is_array($richtexteditorIds)) { - foreach ($richtexteditorIds as $editor => $elements) { - // invoke OnRichTextEditorInit event - $evtOut = $modx->invokeEvent('OnRichTextEditorInit', array( - 'editor' => $editor, - 'elements' => $elements, - 'options' => $richtexteditorOptions[$editor] - )); - if (is_array($evtOut)) { - echo implode('', $evtOut); - } - } - } - } +if(($content['richtext'] == 1 || $modx->manager->action == '4' || $modx->manager->action == '72') && $use_editor == 1) { + if(is_array($richtexteditorIds)) { + foreach($richtexteditorIds as $editor => $elements) { + // invoke OnRichTextEditorInit event + $evtOut = $modx->invokeEvent('OnRichTextEditorInit', array( + 'editor' => $editor, + 'elements' => $elements, + 'options' => $richtexteditorOptions[$editor] + )); + if(is_array($evtOut)) { + echo implode('', $evtOut); + } + } + } +} /** * @return string */ -function getDefaultTemplate() -{ - $modx = evolutionCMS(); +function getDefaultTemplate() { + $modx = evolutionCMS(); $default_template = ''; - switch ($modx->config['auto_template_logic']) { - case 'sibling': - if (!isset($_GET['pid']) || empty($_GET['pid'])) { - $site_start = $modx->config['site_start']; - $where = "sc.isfolder=0 AND sc.id!='{$site_start}'"; - $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 1, 0, 'template', $where, 'menuindex', 'ASC', 1); - if (isset($sibl[0]['template']) && $sibl[0]['template'] !== '') { - $default_template = $sibl[0]['template']; - } - } else { - $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 1, 0, 'template', 'isfolder=0', 'menuindex', 'ASC', 1); - if (isset($sibl[0]['template']) && $sibl[0]['template'] !== '') { - $default_template = $sibl[0]['template']; - } else { - $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 0, 0, 'template', 'isfolder=0', 'menuindex', 'ASC', 1); - if (isset($sibl[0]['template']) && $sibl[0]['template'] !== '') { - $default_template = $sibl[0]['template']; - } - } - } - if (isset($default_template)) { - break; - } // If $default_template could not be determined, fall back / through to "parent"-mode - // no break - case 'parent': - if (isset($_REQUEST['pid']) && !empty($_REQUEST['pid'])) { - $parent = $modx->getPageInfo($_REQUEST['pid'], 0, 'template'); - if (isset($parent['template'])) { - $default_template = $parent['template']; - } - } - break; - case 'system': - default: // default_template is already set - $default_template = $modx->config['default_template']; - } - - return empty($default_template) ? $modx->config['default_template'] : $default_template; + switch($modx->config['auto_template_logic']) { + case 'sibling': + if(!isset($_GET['pid']) || empty($_GET['pid'])) { + $site_start = $modx->config['site_start']; + $where = "sc.isfolder=0 AND sc.id!='{$site_start}'"; + $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 1, 0, 'template', $where, 'menuindex', 'ASC', 1); + if(isset($sibl[0]['template']) && $sibl[0]['template'] !== '') { + $default_template = $sibl[0]['template']; + } + } else { + $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 1, 0, 'template', 'isfolder=0', 'menuindex', 'ASC', 1); + if(isset($sibl[0]['template']) && $sibl[0]['template'] !== '') { + $default_template = $sibl[0]['template']; + } else { + $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 0, 0, 'template', 'isfolder=0', 'menuindex', 'ASC', 1); + if(isset($sibl[0]['template']) && $sibl[0]['template'] !== '') { + $default_template = $sibl[0]['template']; + } + } + } + if(isset($default_template)) { + break; + } // If $default_template could not be determined, fall back / through to "parent"-mode + case 'parent': + if(isset($_REQUEST['pid']) && !empty($_REQUEST['pid'])) { + $parent = $modx->getPageInfo($_REQUEST['pid'], 0, 'template'); + if(isset($parent['template'])) { + $default_template = $parent['template']; + } + } + break; + case 'system': + default: // default_template is already set + $default_template = $modx->config['default_template']; + } + + return empty($default_template) ? $modx->config['default_template'] : $default_template; } diff --git a/manager/actions/mutate_htmlsnippet.dynamic.php b/manager/actions/mutate_htmlsnippet.dynamic.php index 25e1ebcc28..9305315b5c 100755 --- a/manager/actions/mutate_htmlsnippet.dynamic.php +++ b/manager/actions/mutate_htmlsnippet.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } @@ -43,7 +43,7 @@ if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { $modx->webAlertAndQuit($_lang["error_no_privileges"]); } -} elseif (isset($_REQUEST['itemname'])) { +} else if (isset($_REQUEST['itemname'])) { $content['name'] = $_REQUEST['itemname']; } else { $_SESSION['itemname'] = $_lang["new_htmlsnippet"]; diff --git a/manager/actions/mutate_menuindex_sort.dynamic.php b/manager/actions/mutate_menuindex_sort.dynamic.php index 64f823e562..989eedeada 100755 --- a/manager/actions/mutate_menuindex_sort.dynamic.php +++ b/manager/actions/mutate_menuindex_sort.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('edit_document') || !$modx->hasPermission('save_document')) { @@ -49,7 +49,7 @@ $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; $docgrp_cond = $docgrp ? "OR dg.document_group IN ({$docgrp})" : ''; - $mgrRole = (isset($_SESSION['mgrRole']) && (string)$_SESSION['mgrRole'] === '1') ? '1' : '0'; + $mgrRole = (isset ($_SESSION['mgrRole']) && (string)$_SESSION['mgrRole'] === '1') ? '1' : '0'; $access = " AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); $rs = $modx->db->select('sc.id, sc.pagetitle, sc.parent, sc.menuindex, sc.published, sc.hidemenu, sc.deleted, sc.isfolder', $tblsc . 'AS sc LEFT JOIN ' . $tbldg . ' dg ON dg.document=sc.id', 'sc.parent=' . $id . $access . ' GROUP BY sc.id', 'menuindex ASC'); diff --git a/manager/actions/mutate_module.dynamic.php b/manager/actions/mutate_module.dynamic.php index a4f6ab0d40..38694b9403 100755 --- a/manager/actions/mutate_module.dynamic.php +++ b/manager/actions/mutate_module.dynamic.php @@ -1,20 +1,20 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -switch ($modx->manager->action) { - case 107: - if (!$modx->hasPermission('new_module')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 108: - if (!$modx->hasPermission('edit_module')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +switch($modx->manager->action) { + case 107: + if(!$modx->hasPermission('new_module')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 108: + if(!$modx->hasPermission('edit_module')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; // Get table names (alphabetical) @@ -33,41 +33,40 @@ * * @return string */ -function createGUID() -{ - srand((double) microtime() * 1000000); - $r = rand(); - $u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1); - $m = md5($u); - return $m; +function createGUID() { + srand((double) microtime() * 1000000); + $r = rand(); + $u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1); + $m = md5($u); + return $m; } // check to see the module editor isn't locked -if ($lockedEl = $modx->elementIsLocked(6, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); +if($lockedEl = $modx->elementIsLocked(6, $id)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); } // end check for lock // Lock snippet for other users to edit $modx->lockElement(6, $id); -if (isset($_GET['id'])) { - $rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'"); - $content = $modx->db->getRow($rs); - if (!$content) { - $modx->webAlertAndQuit("Module not found for id '{$id}'."); - } - $content['properties'] = str_replace("&", "&", $content['properties']); - $_SESSION['itemname'] = $content['name']; - if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } +if(isset($_GET['id'])) { + $rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'"); + $content = $modx->db->getRow($rs); + if(!$content) { + $modx->webAlertAndQuit("Module not found for id '{$id}'."); + } + $content['properties'] = str_replace("&", "&", $content['properties']); + $_SESSION['itemname'] = $content['name']; + if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } } else { - $_SESSION['itemname'] = $_lang["new_module"]; - $content['wrap'] = '1'; + $_SESSION['itemname'] = $_lang["new_module"]; + $content['wrap'] = '1'; } -if ($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); +if($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); } // Add lock-element JS-Script @@ -438,18 +437,18 @@ function SetUrl(url, width, height, alt) { invokeEvent('OnModFormPrerender', array('id' => $id)); - if (is_array($evtOut)) { - echo implode('', $evtOut); - } - - // Prepare internal params & info-tab via parseDocBlock - $modulecode = isset($content['modulecode']) ? $modx->db->escape($content['modulecode']) : ''; - $docBlock = $modx->parseDocBlockFromString($modulecode); - $docBlockList = $modx->convertDocBlockIntoList($docBlock); - $internal = array(); - ?> + // invoke OnModFormPrerender event + $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id)); + if(is_array($evtOut)) { + echo implode('', $evtOut); + } + + // Prepare internal params & info-tab via parseDocBlock + $modulecode = isset($content['modulecode']) ? $modx->db->escape($content['modulecode']) : ''; + $docBlock = $modx->parseDocBlockFromString($modulecode); + $docBlockList = $modx->convertDocBlockIntoList($docBlock); + $internal = array(); + ?> @@ -479,7 +478,7 @@ function SetUrl(url, width, height, alt) {
    - hasPermission('save_role')): ?> + hasPermission('save_role')): ?>
    @@ -601,7 +600,7 @@ function SetUrl(url, width, height, alt) { - manager->action == '108'): ?> + manager->action == '108'): ?>

    @@ -613,7 +612,7 @@ function SetUrl(url, width, height, alt) { ">
    db->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, + $ds = $modx->db->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, CASE smd.type WHEN 10 THEN 'Chunk' WHEN 20 THEN 'Document' @@ -629,17 +628,17 @@ function SetUrl(url, width, height, alt) { LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = 50 LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = 60", "smd.module='{$id}'", 'smd.type,name'); - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items - $grd->noRecordMsg = $_lang['no_records_found']; - $grd->cssClass = 'grid'; - $grd->columnHeaderClass = 'gridHeader'; - $grd->itemClass = 'gridItem'; - $grd->altItemClass = 'gridAltItem'; - $grd->columns = $_lang['element_name'] . " ," . $_lang['type']; - $grd->fields = "name,type"; - echo $grd->render(); - ?> + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items + $grd->noRecordMsg = $_lang['no_records_found']; + $grd->cssClass = 'grid'; + $grd->columnHeaderClass = 'gridHeader'; + $grd->itemClass = 'gridItem'; + $grd->altItemClass = 'gridAltItem'; + $grd->columns = $_lang['element_name'] . " ," . $_lang['type']; + $grd->fields = "name,type"; + echo $grd->render(); + ?> @@ -649,14 +648,14 @@ function SetUrl(url, width, height, alt) {

    - + db->select('usergroup', $tbl_site_module_access, "module='{$id}'"); - $groupsarray = $modx->db->getColumn('usergroup', $rs); + // fetch user access permissions for the module + $rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'"); + $groupsarray = $modx->db->getColumn('usergroup', $rs); - if ($modx->hasPermission('access_permissions')) { - ?> + if($modx->hasPermission('access_permissions')) { + ?>

    db->select('name, id', $tbl_membergroup_names, '', 'name'); - while ($row = $modx->db->getRow($rs)) { - $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); - $checked = in_array($row['id'], $groupsarray); - if ($modx->hasPermission('access_permissions')) { - if ($checked) { - $notPublic = true; - } - $chks .= '
    \n"; - } else { - if ($checked) { - $chks = '' . "\n" . $chks; - } - } - } - if ($modx->hasPermission('access_permissions')) { - $chks = '
    ' . "\n" . $chks; - } - echo $chks; - ?> + } + $chk = ''; + $rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name'); + while($row = $modx->db->getRow($rs)) { + $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); + $checked = in_array($row['id'], $groupsarray); + if($modx->hasPermission('access_permissions')) { + if($checked) { + $notPublic = true; + } + $chks .= '
    \n"; + } else { + if($checked) { + $chks = '' . "\n" . $chks; + } + } + } + if($modx->hasPermission('access_permissions')) { + $chks = '
    ' . "\n" . $chks; + } + echo $chks; + ?>
    @@ -717,11 +716,11 @@ function makePublic(b) { invokeEvent('OnModFormRender', array('id' => $id)); - if (is_array($evtOut)) { - echo implode('', $evtOut); - } - ?> + // invoke OnModFormRender event + $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id)); + if(is_array($evtOut)) { + echo implode('', $evtOut); + } + ?> diff --git a/manager/actions/mutate_module_resources.dynamic.php b/manager/actions/mutate_module_resources.dynamic.php index 61ffcbb973..c7afe8e1ac 100755 --- a/manager/actions/mutate_module_resources.dynamic.php +++ b/manager/actions/mutate_module_resources.dynamic.php @@ -1,10 +1,10 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('edit_module')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('edit_module')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; @@ -25,92 +25,92 @@ // check to see the editor isn't locked $rs = $modx->db->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='" . $modx->getLoginUserID() . "'"); -if ($username = $modx->db->getValue($rs)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $username, 'module')); +if($username = $modx->db->getValue($rs)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $username, 'module')); } // end check for lock // take action -switch ($_REQUEST['op']) { - case 'add': - // convert ids to numbers - $opids = array_filter(array_map('intval', explode(',', $_REQUEST['newids']))); - - if (count($opids) > 0) { - // 1-snips, 2-tpls, 3-tvs, 4-chunks, 5-plugins, 6-docs - $rt = strtolower($_REQUEST["rt"]); - if ($rt == 'chunk') { - $type = 10; - } - if ($rt == 'doc') { - $type = 20; - } - if ($rt == 'plug') { - $type = 30; - } - if ($rt == 'snip') { - $type = 40; - } - if ($rt == 'tpl') { - $type = 50; - } - if ($rt == 'tv') { - $type = 60; - } - $modx->db->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'"); - foreach ($opids as $opid) { - $modx->db->insert(array( - 'module' => $id, - 'resource' => $opid, - 'type' => $type, - ), $tbl_site_module_depobj); - } - } - break; - case 'del': - // convert ids to numbers - $opids = array_filter(array_map('intval', $_REQUEST['depid'])); - - // get resources that needs to be removed - $ds = $modx->db->select('*', $tbl_site_module_depobj, "id IN (" . implode(",", $opids) . ")"); - // loop through resources and look for plugins and snippets - $plids = array(); - $snid = array(); - while ($row = $modx->db->getRow($ds)) { - if ($row['type'] == '30') { - $plids[$i] = $row['resource']; - } - if ($row['type'] == '40') { - $snids[$i] = $row['resource']; - } - } - // get guid - $ds = $modx->db->select('guid', $tbl_site_modules, "id='{$id}'"); - $guid = $modx->db->getValue($ds); - // reset moduleguid for deleted resources - if (($cp = count($plids)) || ($cs = count($snids))) { - if ($cp) { - $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $plids) . ") AND moduleguid='{$guid}'"); - } - if ($cs) { - $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'"); - } - // reset cache - $modx->clearCache('full'); - } - $modx->db->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")"); - break; +switch($_REQUEST['op']) { + case 'add': + // convert ids to numbers + $opids = array_filter(array_map('intval', explode(',', $_REQUEST['newids']))); + + if(count($opids) > 0) { + // 1-snips, 2-tpls, 3-tvs, 4-chunks, 5-plugins, 6-docs + $rt = strtolower($_REQUEST["rt"]); + if($rt == 'chunk') { + $type = 10; + } + if($rt == 'doc') { + $type = 20; + } + if($rt == 'plug') { + $type = 30; + } + if($rt == 'snip') { + $type = 40; + } + if($rt == 'tpl') { + $type = 50; + } + if($rt == 'tv') { + $type = 60; + } + $modx->db->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'"); + foreach($opids as $opid) { + $modx->db->insert(array( + 'module' => $id, + 'resource' => $opid, + 'type' => $type, + ), $tbl_site_module_depobj); + } + } + break; + case 'del': + // convert ids to numbers + $opids = array_filter(array_map('intval', $_REQUEST['depid'])); + + // get resources that needs to be removed + $ds = $modx->db->select('*', $tbl_site_module_depobj, "id IN (" . implode(",", $opids) . ")"); + // loop through resources and look for plugins and snippets + $plids = array(); + $snid = array(); + while($row = $modx->db->getRow($ds)) { + if($row['type'] == '30') { + $plids[$i] = $row['resource']; + } + if($row['type'] == '40') { + $snids[$i] = $row['resource']; + } + } + // get guid + $ds = $modx->db->select('guid', $tbl_site_modules, "id='{$id}'"); + $guid = $modx->db->getValue($ds); + // reset moduleguid for deleted resources + if(($cp = count($plids)) || ($cs = count($snids))) { + if($cp) { + $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $plids) . ") AND moduleguid='{$guid}'"); + } + if($cs) { + $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'"); + } + // reset cache + $modx->clearCache('full'); + } + $modx->db->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")"); + break; } // load record $rs = $modx->db->select('*', $tbl_site_modules, "id = '{$id}'"); $content = $modx->db->getRow($rs); -if (!$content) { - $modx->webAlertAndQuit("Module not found for id '{$id}'."); +if(!$content) { + $modx->webAlertAndQuit("Module not found for id '{$id}'."); } $_SESSION['itemname'] = $content['name']; -if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } ?> @@ -203,7 +203,7 @@ function openSelector(resource, mode, callback, w, h) { db->select("smd.id,COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) as name, + $ds = $modx->db->select("smd.id,COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) as name, CASE smd.type WHEN 10 THEN 'Chunk' WHEN 20 THEN 'Document' @@ -218,18 +218,18 @@ function openSelector(resource, mode, callback, w, h) { LEFT JOIN {$tbl_site_snippets} AS ss ON ss.id = smd.resource AND smd.type = '40' LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = '50' LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = '60'", "smd.module={$id}", "smd.type,name"); - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items - $grd->noRecordMsg = $_lang["no_records_found"]; - $grd->cssClass = "grid"; - $grd->columnHeaderClass = "gridHeader"; - $grd->itemClass = "gridItem"; - $grd->altItemClass = "gridAltItem"; - $grd->columns = $_lang["element_name"] . " ," . $_lang["type"]; - $grd->colTypes = "template: [+value+]"; - $grd->fields = "name,type"; - echo $grd->render(); - ?> + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items + $grd->noRecordMsg = $_lang["no_records_found"]; + $grd->cssClass = "grid"; + $grd->columnHeaderClass = "gridHeader"; + $grd->itemClass = "gridItem"; + $grd->altItemClass = "gridAltItem"; + $grd->columns = $_lang["element_name"] . " ," . $_lang["type"]; + $grd->colTypes = "template: [+value+]"; + $grd->fields = "name,type"; + echo $grd->render(); + ?> "> diff --git a/manager/actions/mutate_password.dynamic.php b/manager/actions/mutate_password.dynamic.php index f2483a4ddb..44ed413422 100755 --- a/manager/actions/mutate_password.dynamic.php +++ b/manager/actions/mutate_password.dynamic.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('change_password')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('change_password')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } ?> diff --git a/manager/actions/mutate_plugin.dynamic.php b/manager/actions/mutate_plugin.dynamic.php index 3fd35f4b3c..84c6b357b5 100755 --- a/manager/actions/mutate_plugin.dynamic.php +++ b/manager/actions/mutate_plugin.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } diff --git a/manager/actions/mutate_plugin_priority.dynamic.php b/manager/actions/mutate_plugin_priority.dynamic.php index 91756906a9..0811873b13 100755 --- a/manager/actions/mutate_plugin_priority.dynamic.php +++ b/manager/actions/mutate_plugin_priority.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_plugin')) { @@ -103,7 +103,7 @@ + ?> INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -switch ((int) $modx->manager->action) { - case 35: - if (!$modx->hasPermission('edit_role')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 38: - if (!$modx->hasPermission('new_role')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +switch((int) $modx->manager->action) { + case 35: + if(!$modx->hasPermission('edit_role')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 38: + if(!$modx->hasPermission('new_role')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $role = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; @@ -23,24 +23,24 @@ $tbl_user_roles = $modx->getFullTableName('user_roles'); // check to see the snippet editor isn't locked -if ($lockedEl = $modx->elementIsLocked(8, $role)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['role'])); +if($lockedEl = $modx->elementIsLocked(8, $role)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['role'])); } // end check for lock // Lock snippet for other users to edit $modx->lockElement(8, $role); -if ($modx->manager->action == '35') { - $rs = $modx->db->select('*', $tbl_user_roles, "id='{$role}'"); - $roledata = $modx->db->getRow($rs); - if (!$roledata) { - $modx->webAlertAndQuit("No role returned!"); - } - $_SESSION['itemname'] = $roledata['name']; +if($modx->manager->action == '35') { + $rs = $modx->db->select('*', $tbl_user_roles, "id='{$role}'"); + $roledata = $modx->db->getRow($rs); + if(!$roledata) { + $modx->webAlertAndQuit("No role returned!"); + } + $_SESSION['itemname'] = $roledata['name']; } else { - $roledata = 0; - $_SESSION['itemname'] = $_lang["new_role"]; + $roledata = 0; + $_SESSION['itemname'] = $_lang["new_role"]; } // Add lock-element JS-Script @@ -107,63 +107,63 @@ function changestate(element) {

    + echo render_form('frames', $_lang['role_frames'], 'disabled'); + echo render_form('home', $_lang['role_home'], 'disabled'); + echo render_form('messages', $_lang['role_messages']); + echo render_form('logout', $_lang['role_logout'], 'disabled'); + echo render_form('help', $_lang['role_help']); + echo render_form('action_ok', $_lang['role_actionok'], 'disabled'); + echo render_form('error_dialog', $_lang['role_errors'], 'disabled'); + echo render_form('about', $_lang['role_about'], 'disabled'); + echo render_form('credits', $_lang['role_credits'], 'disabled'); + echo render_form('change_password', $_lang['role_change_password']); + echo render_form('save_password', $_lang['role_save_password']); + ?>

    + echo render_form('view_document', $_lang['role_view_docdata'], 'disabled'); + echo render_form('new_document', $_lang['role_create_doc']); + echo render_form('edit_document', $_lang['role_edit_doc']); + echo render_form('change_resourcetype', $_lang['role_change_resourcetype']); + echo render_form('save_document', $_lang['role_save_doc']); + echo render_form('publish_document', $_lang['role_publish_doc']); + echo render_form('delete_document', $_lang['role_delete_doc']); + echo render_form('empty_trash', $_lang['role_empty_trash']); + echo render_form('empty_cache', $_lang['role_cache_refresh']); + echo render_form('view_unpublished', $_lang['role_view_unpublished']); + ?>

    + echo render_form('file_manager', $_lang['role_file_manager']); + echo render_form('assets_files', $_lang['role_assets_files']); + echo render_form('assets_images', $_lang['role_assets_images']); + ?>

    + echo render_form('category_manager', $_lang['role_category_manager']); + ?>

    + echo render_form('new_module', $_lang['role_new_module']); + echo render_form('edit_module', $_lang['role_edit_module']); + echo render_form('save_module', $_lang['role_save_module']); + echo render_form('delete_module', $_lang['role_delete_module']); + echo render_form('exec_module', $_lang['role_run_module']); + ?>
    @@ -173,44 +173,44 @@ function changestate(element) {

    + echo render_form('new_template', $_lang['role_create_template']); + echo render_form('edit_template', $_lang['role_edit_template']); + echo render_form('save_template', $_lang['role_save_template']); + echo render_form('delete_template', $_lang['role_delete_template']); + ?>

    + echo render_form('new_snippet', $_lang['role_create_snippet']); + echo render_form('edit_snippet', $_lang['role_edit_snippet']); + echo render_form('save_snippet', $_lang['role_save_snippet']); + echo render_form('delete_snippet', $_lang['role_delete_snippet']); + ?>

    + echo render_form('new_chunk', $_lang['role_create_chunk']); + echo render_form('edit_chunk', $_lang['role_edit_chunk']); + echo render_form('save_chunk', $_lang['role_save_chunk']); + echo render_form('delete_chunk', $_lang['role_delete_chunk']); + ?>

    + echo render_form('new_plugin', $_lang['role_create_plugin']); + echo render_form('edit_plugin', $_lang['role_edit_plugin']); + echo render_form('save_plugin', $_lang['role_save_plugin']); + echo render_form('delete_plugin', $_lang['role_delete_plugin']); + ?>
    @@ -220,42 +220,42 @@ function changestate(element) {

    + echo render_form('new_user', $_lang['role_new_user']); + echo render_form('edit_user', $_lang['role_edit_user']); + echo render_form('save_user', $_lang['role_save_user']); + echo render_form('delete_user', $_lang['role_delete_user']); + ?>

    + echo render_form('new_web_user', $_lang['role_new_web_user']); + echo render_form('edit_web_user', $_lang['role_edit_web_user']); + echo render_form('save_web_user', $_lang['role_save_web_user']); + echo render_form('delete_web_user', $_lang['role_delete_web_user']); + ?>

    + echo render_form('access_permissions', $_lang['role_access_persmissions']); + echo render_form('web_access_permissions', $_lang['role_web_access_persmissions']); + ?>

    + echo render_form('new_role', $_lang['role_new_role']); + echo render_form('edit_role', $_lang['role_edit_role']); + echo render_form('save_role', $_lang['role_save_role']); + echo render_form('delete_role', $_lang['role_delete_role']); + ?>
    @@ -265,23 +265,23 @@ function changestate(element) {

    + echo render_form('view_eventlog', $_lang['role_view_eventlog']); + echo render_form('delete_eventlog', $_lang['role_delete_eventlog']); + ?>

    + echo render_form('logs', $_lang['role_view_logs']); + echo render_form('settings', $_lang['role_edit_settings']); + echo render_form('bk_manager', $_lang['role_bk_manager']); + echo render_form('import_static', $_lang['role_import_static']); + echo render_form('export_static', $_lang['role_export_static']); + echo render_form('remove_locks', $_lang['role_remove_locks']); + echo render_form('display_locks', $_lang['role_display_locks']); + ?>
    @@ -299,35 +299,33 @@ function changestate(element) { * @param string $status * @return string */ -function render_form($name, $label, $status = '') -{ - $modx = evolutionCMS(); - global $roledata; +function render_form($name, $label, $status = '') { + $modx = evolutionCMS(); global $roledata; - $tpl = '
    - +
    @@ -124,15 +124,9 @@
    [(auto_template_logic)]

    -
    -
    -
    +
    +
    +
    @@ -141,17 +135,16 @@ db->getRecordCount( - $modx->db->select('id', '[+prefix+]site_plugins', + $modx->db->select('id', '[+prefix+]site_plugins', "plugincode LIKE '%phx.parser.class.inc.php%OnParseDocument();%' AND disabled != 1") ); - if ($count) { + if($count) { $disabledFilters = 1; - echo '' . $_lang['enable_filter_phx_warning'] . '
    '; - } else { - $disabledFilters = false; + echo ''.$_lang['enable_filter_phx_warning'].'
    '; } + else $disabledFilters = false; ?> -
    +
    @@ -159,7 +152,7 @@
    [(enable_at_syntax)] -
    +
    @@ -174,8 +167,8 @@
    [(publish_default)] -
    - +
    +
    @@ -183,24 +176,24 @@
    [(cache_default)] -
    - +
    +

    [(search_default)] -
    - +
    +

    [(auto_menuindex)] -
    - +
    +
    @@ -210,9 +203,9 @@ @@ -249,14 +242,14 @@ @@ -266,9 +259,10 @@ @@ -294,8 +288,8 @@ @@ -307,9 +301,7 @@ invokeEvent('OnSiteSettingsRender'); - if (is_array($evtOut)) { - echo implode("", $evtOut); - } + if(is_array($evtOut)) echo implode("",$evtOut); ?> diff --git a/manager/actions/mutate_settings/tab2_furl_settings.inc.php b/manager/actions/mutate_settings/tab2_furl_settings.inc.php index 526bc44333..2269244e37 100755 --- a/manager/actions/mutate_settings/tab2_furl_settings.inc.php +++ b/manager/actions/mutate_settings/tab2_furl_settings.inc.php @@ -6,7 +6,7 @@ @@ -20,7 +20,7 @@ @@ -56,8 +56,8 @@ > > @@ -71,8 +71,8 @@ > > @@ -86,8 +86,8 @@ > > @@ -101,8 +101,8 @@ > > @@ -115,8 +115,8 @@ > > @@ -129,8 +129,8 @@ > > @@ -143,8 +143,8 @@ > > @@ -159,9 +159,7 @@ invokeEvent('OnFriendlyURLSettingsRender'); - if (is_array($evtOut)) { - echo implode("", $evtOut); - } + if(is_array($evtOut)) echo implode("",$evtOut); ?> diff --git a/manager/actions/mutate_settings/tab3_user_settings.inc.php b/manager/actions/mutate_settings/tab3_user_settings.inc.php index 201b087a32..c190b78fb6 100755 --- a/manager/actions/mutate_settings/tab3_user_settings.inc.php +++ b/manager/actions/mutate_settings/tab3_user_settings.inc.php @@ -6,7 +6,7 @@ @@ -55,8 +55,8 @@ @@ -157,9 +157,7 @@ invokeEvent('OnUserSettingsRender'); - if (is_array($evtOut)) { - echo implode("", $evtOut); - } + if(is_array($evtOut)) echo implode("",$evtOut); ?> diff --git a/manager/actions/mutate_settings/tab4_manager_settings.inc.php b/manager/actions/mutate_settings/tab4_manager_settings.inc.php index 190c709708..4fac9f68b2 100755 --- a/manager/actions/mutate_settings/tab4_manager_settings.inc.php +++ b/manager/actions/mutate_settings/tab4_manager_settings.inc.php @@ -180,7 +180,7 @@ function SetUrl(url, width, height, alt) { @@ -194,7 +194,7 @@ function SetUrl(url, width, height, alt) { diff --git a/manager/actions/mutate_settings/tab5_security_settings.inc.php b/manager/actions/mutate_settings/tab5_security_settings.inc.php index 97d5143f15..78c039a8a3 100755 --- a/manager/actions/mutate_settings/tab5_security_settings.inc.php +++ b/manager/actions/mutate_settings/tab5_security_settings.inc.php @@ -1,6 +1,6 @@ @@ -89,10 +89,10 @@ @@ -103,11 +103,11 @@ +
    +
    +
    +
    +$modx->config['emailsender']));?> @@ -115,8 +115,8 @@ @@ -157,9 +157,7 @@ @@ -188,9 +186,7 @@ ?> @@ -230,9 +226,7 @@ invokeEvent('OnSecuritySettingsRender'); - if (is_array($evtOut)) { - echo implode("", $evtOut); - } + if(is_array($evtOut)) echo implode("",$evtOut); ?> diff --git a/manager/actions/mutate_settings/tab6_filemanager_settings.inc.php b/manager/actions/mutate_settings/tab6_filemanager_settings.inc.php index e38e020fb8..67a5059a2c 100755 --- a/manager/actions/mutate_settings/tab6_filemanager_settings.inc.php +++ b/manager/actions/mutate_settings/tab6_filemanager_settings.inc.php @@ -113,9 +113,7 @@ invokeEvent('OnFileManagerSettingsRender'); - if (is_array($evtOut)) { - echo implode("", $evtOut); - } + if(is_array($evtOut)) echo implode("",$evtOut); ?> diff --git a/manager/actions/mutate_settings/tab7_filebrowser_settings.inc.php b/manager/actions/mutate_settings/tab7_filebrowser_settings.inc.php index 198f385bad..2534a2de5d 100755 --- a/manager/actions/mutate_settings/tab7_filebrowser_settings.inc.php +++ b/manager/actions/mutate_settings/tab7_filebrowser_settings.inc.php @@ -6,7 +6,7 @@ @@ -235,9 +235,7 @@ invokeEvent('OnMiscSettingsRender'); - if (is_array($evtOut)) { - echo implode("", $evtOut); - } + if(is_array($evtOut)) echo implode("",$evtOut); ?> diff --git a/manager/actions/mutate_snippet.dynamic.php b/manager/actions/mutate_snippet.dynamic.php index 70bf425c41..75bd9b9c88 100755 --- a/manager/actions/mutate_snippet.dynamic.php +++ b/manager/actions/mutate_snippet.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } @@ -46,7 +46,7 @@ $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $content['properties'] = str_replace("&", "&", $content['properties']); -} elseif (isset($_REQUEST['itemname'])) { +} else if (isset($_REQUEST['itemname'])) { $content['name'] = $_REQUEST['itemname']; } else { $_SESSION['itemname'] = $_lang["new_snippet"]; diff --git a/manager/actions/mutate_template_tv_rank.dynamic.php b/manager/actions/mutate_template_tv_rank.dynamic.php index d0933b3a01..70518f964d 100755 --- a/manager/actions/mutate_template_tv_rank.dynamic.php +++ b/manager/actions/mutate_template_tv_rank.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_template')) { @@ -137,7 +137,7 @@ function resetSortOrder()
    + ?>

    diff --git a/manager/actions/mutate_templates.dynamic.php b/manager/actions/mutate_templates.dynamic.php index 8dc46bb62e..4b46fa9ac0 100755 --- a/manager/actions/mutate_templates.dynamic.php +++ b/manager/actions/mutate_templates.dynamic.php @@ -1,21 +1,21 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -switch ($modx->manager->action) { - case 16: - if (!$modx->hasPermission('edit_template')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 19: - if (!$modx->hasPermission('new_template')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +switch($modx->manager->action) { + case 16: + if(!$modx->hasPermission('edit_template')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 19: + if(!$modx->hasPermission('new_template')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; @@ -23,8 +23,8 @@ $tbl_site_templates = $modx->getFullTableName('site_templates'); // check to see the snippet editor isn't locked -if ($lockedEl = $modx->elementIsLocked(1, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['template'])); +if($lockedEl = $modx->elementIsLocked(1, $id)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['template'])); } // end check for lock @@ -32,24 +32,24 @@ $modx->lockElement(1, $id); $content = array(); -if (!empty($id)) { - $rs = $modx->db->select('*', $tbl_site_templates, "id='{$id}'"); - $content = $modx->db->getRow($rs); - if (!$content) { - $modx->webAlertAndQuit("No database record has been found for this template."); - } - - $_SESSION['itemname'] = $content['templatename']; - if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } +if(!empty($id)) { + $rs = $modx->db->select('*', $tbl_site_templates, "id='{$id}'"); + $content = $modx->db->getRow($rs); + if(!$content) { + $modx->webAlertAndQuit("No database record has been found for this template."); + } + + $_SESSION['itemname'] = $content['templatename']; + if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } } else { - $_SESSION['itemname'] = $_lang["new_template"]; - $content['category'] = (int)$_REQUEST['catid']; + $_SESSION['itemname'] = $_lang["new_template"]; + $content['category'] = (int)$_REQUEST['catid']; } -if ($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); +if($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); } $content = array_merge($content, $_POST); @@ -98,12 +98,12 @@
    invokeEvent("OnTempFormPrerender", array("id" => $id)); - if (is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> + // invoke OnTempFormPrerender event + $evtOut = $modx->invokeEvent("OnTempFormPrerender", array("id" => $id)); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> @@ -132,14 +132,14 @@

    - hasPermission('save_role')): ?> + hasPermission('save_role')): ?>
    @@ -177,7 +177,7 @@
    - hasPermission('save_role')): ?> + hasPermission('save_role')): ?>
    @@ -197,38 +197,38 @@ db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category", $_lang['no_category']), sprintf("%s tv + $selectedTvs = array(); + if(!isset($_POST['assignedTv'])) { + $rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category", $_lang['no_category']), sprintf("%s tv LEFT JOIN %s tr ON tv.id=tr.tmplvarid LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "templateid='{$id}'", "tr.rank DESC, tv.rank DESC, tvcaption DESC, tvid DESC" // workaround for correct sort of none-existing ranks - ); - while ($row = $modx->db->getRow($rs)) { - $selectedTvs[$row['tvid']] = $row; - } - $selectedTvs = array_reverse($selectedTvs, true); // reverse ORDERBY DESC - } - - $unselectedTvs = array(); - $rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category, cat.id as catid", $_lang['no_category']), sprintf("%s tv + ); + while($row = $modx->db->getRow($rs)) { + $selectedTvs[$row['tvid']] = $row; + } + $selectedTvs = array_reverse($selectedTvs, true); // reverse ORDERBY DESC + } + + $unselectedTvs = array(); + $rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category, cat.id as catid", $_lang['no_category']), sprintf("%s tv LEFT JOIN %s tr ON tv.id=tr.tmplvarid LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "", "category, tvcaption"); - while ($row = $modx->db->getRow($rs)) { - $unselectedTvs[$row['tvid']] = $row; - } - - // Catch checkboxes if form not validated - if (isset($_POST['assignedTv'])) { - $selectedTvs = array(); - foreach ($_POST['assignedTv'] as $tvid) { - if (isset($unselectedTvs[$tvid])) { - $selectedTvs[$tvid] = $unselectedTvs[$tvid]; - } - }; - } - - $total = count($selectedTvs); - ?> + while($row = $modx->db->getRow($rs)) { + $unselectedTvs[$row['tvid']] = $row; + } + + // Catch checkboxes if form not validated + if(isset($_POST['assignedTv'])) { + $selectedTvs = array(); + foreach($_POST['assignedTv'] as $tvid) { + if(isset($unselectedTvs[$tvid])) { + $selectedTvs[$tvid] = $unselectedTvs[$tvid]; + } + }; + } + + $total = count($selectedTvs); + ?>
    @@ -238,64 +238,65 @@
    0) { - echo '

    ' . $_lang['template_tv_msg'] . '

    '; - } - if ($modx->hasPermission('save_template') && $total > 1 && $id) { - echo sprintf('', $id, $_lang['template_tv_edit']); - } - - // Selected TVs - $tvList = ''; - if ($total > 0) { - $tvList .= '
      '; - foreach ($selectedTvs as $row) { - $desc = !empty($row['tvdescription']) ? '  (' . $row['tvdescription'] . ')' : ''; - $locked = $row['tvlocked'] ? ' (' . $_lang['locked'] . ')' : ""; - $tvList .= sprintf('
    • %s %s
    • ', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); - } - $tvList .= '
    '; - } else { - echo $_lang['template_no_tv']; - } - echo $tvList; - - // Unselected TVs - $tvList = '

    ' . $_lang['template_notassigned_tv'] . '

      '; - $preCat = ''; - $insideUl = 0; - while ($row = array_shift($unselectedTvs)) { - if (isset($selectedTvs[$row['tvid']])) { - continue; - } // Skip selected - $row['category'] = stripslashes($row['category']); //pixelchutes - if ($preCat !== $row['category']) { - $tvList .= $insideUl ? '
    ' : ''; - $tvList .= '
  • ' . $row['category'] . ($row['catid'] != '' ? ' (' . $row['catid'] . ')' : '') . '
      '; - $insideUl = 1; - } - - $desc = !empty($row['tvdescription']) ? '  (' . $row['tvdescription'] . ')' : ''; - $locked = $row['tvlocked'] ? ' (' . $_lang['locked'] . ')' : ""; - $tvList .= sprintf('
    • %s %s
    • ', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); - $tvList .= ''; - - $preCat = $row['category']; - } - $tvList .= $insideUl ? '
    ' : ''; - $tvList .= ''; - echo $tvList; - - ?> + if($total > 0) { + echo '

    ' . $_lang['template_tv_msg'] . '

    '; + } + if($modx->hasPermission('save_template') && $total > 1 && $id) { + echo sprintf('', $id, $_lang['template_tv_edit']); + } + + // Selected TVs + $tvList = ''; + if($total > 0) { + $tvList .= '
      '; + foreach($selectedTvs as $row) { + $desc = !empty($row['tvdescription']) ? '  (' . $row['tvdescription'] . ')' : ''; + $locked = $row['tvlocked'] ? ' (' . $_lang['locked'] . ')' : ""; + $tvList .= sprintf('
    • %s %s
    • ', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); + } + $tvList .= '
    '; + + } else { + echo $_lang['template_no_tv']; + } + echo $tvList; + + // Unselected TVs + $tvList = '

    ' . $_lang['template_notassigned_tv'] . '

      '; + $preCat = ''; + $insideUl = 0; + while($row = array_shift($unselectedTvs)) { + if(isset($selectedTvs[$row['tvid']])) { + continue; + } // Skip selected + $row['category'] = stripslashes($row['category']); //pixelchutes + if($preCat !== $row['category']) { + $tvList .= $insideUl ? '
    ' : ''; + $tvList .= '
  • ' . $row['category'] . ($row['catid'] != '' ? ' (' . $row['catid'] . ')' : '') . '
      '; + $insideUl = 1; + } + + $desc = !empty($row['tvdescription']) ? '  (' . $row['tvdescription'] . ')' : ''; + $locked = $row['tvlocked'] ? ' (' . $_lang['locked'] . ')' : ""; + $tvList .= sprintf('
    • %s %s
    • ', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); + $tvList .= ''; + + $preCat = $row['category']; + } + $tvList .= $insideUl ? '
    ' : ''; + $tvList .= ''; + echo $tvList; + + ?>
  • invokeEvent("OnTempFormRender", array("id" => $id)); - if (is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> + // invoke OnTempFormRender event + $evtOut = $modx->invokeEvent("OnTempFormRender", array("id" => $id)); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> diff --git a/manager/actions/mutate_tmplvars.dynamic.php b/manager/actions/mutate_tmplvars.dynamic.php index bc780011c8..895b0e125a 100755 --- a/manager/actions/mutate_tmplvars.dynamic.php +++ b/manager/actions/mutate_tmplvars.dynamic.php @@ -1,17 +1,17 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('edit_template') && $modx->manager->action == '301') { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('edit_template') && $modx->manager->action == '301') { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } -if (!$modx->hasPermission('new_template') && $modx->manager->action == '300') { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('new_template') && $modx->manager->action == '300') { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; $origin = isset($_REQUEST['or']) ? (int)$_REQUEST['or'] : 76; -$originId = isset($_REQUEST['oid']) ? (int)$_REQUEST['oid'] : null; +$originId = isset($_REQUEST['oid']) ? (int)$_REQUEST['oid'] : NULL; $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); $tbl_site_templates = $modx->getFullTableName('site_templates'); @@ -19,8 +19,8 @@ $tbl_documentgroup_names = $modx->getFullTableName('documentgroup_names'); // check to see the snippet editor isn't locked -if ($lockedEl = $modx->elementIsLocked(2, $id)) { - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar'])); +if($lockedEl = $modx->elementIsLocked(2, $id)) { + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar'])); } // end check for lock @@ -29,26 +29,26 @@ global $content; $content = array(); -if (isset($_GET['id'])) { - $rs = $modx->db->select('*', $tbl_site_tmplvars, "id='{$id}'"); - $content = $modx->db->getRow($rs); - if (!$content) { - header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}"); - } - - $_SESSION['itemname'] = $content['caption']; - if ($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } -} elseif (isset($_REQUEST['itemname'])) { - $content['name'] = $_REQUEST['itemname']; +if(isset($_GET['id'])) { + $rs = $modx->db->select('*', $tbl_site_tmplvars, "id='{$id}'"); + $content = $modx->db->getRow($rs); + if(!$content) { + header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}"); + } + + $_SESSION['itemname'] = $content['caption']; + if($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } +} else if(isset($_REQUEST['itemname'])) { + $content['name'] = $_REQUEST['itemname']; } else { - $_SESSION['itemname'] = $_lang["new_tmplvars"]; - $content['category'] = (int)$_REQUEST['catid']; + $_SESSION['itemname'] = $_lang["new_tmplvars"]; + $content['category'] = (int)$_REQUEST['catid']; } -if ($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); +if($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); } $content = array_merge($content, $_POST); @@ -61,8 +61,8 @@ // get available RichText Editors $RTEditors = ''; $evtOut = $modx->invokeEvent('OnRichTextEditorRegister', array('forfrontend' => 1)); -if (is_array($evtOut)) { - $RTEditors = implode(',', $evtOut); +if(is_array($evtOut)) { + $RTEditors = implode(',', $evtOut); } ?> @@ -277,12 +277,12 @@ function decode(s) { invokeEvent('OnTVFormPrerender', array('id' => $id)); - if (is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> + // invoke OnTVFormPrerender event + $evtOut = $modx->invokeEvent('OnTVFormPrerender', array('id' => $id)); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> @@ -314,7 +314,7 @@ function decode(s) {
    - hasPermission('save_role')): ?> + hasPermission('save_role')): ?>
    @@ -383,14 +383,14 @@ function decode(s) { ' . $ctv . ''; - } - } - ?> + $custom_tvs = scandir(MODX_BASE_PATH . 'assets/tvs'); + foreach($custom_tvs as $ctv) { + if(strpos($ctv, '.') !== 0 && $ctv != 'index.html') { + $selected = ($content['type'] == 'custom_tv:' . $ctv ? "selected='selected'" : ""); + echo ''; + } + } + ?> @@ -455,63 +455,64 @@ function decode(s) { db->select(sprintf("tpl.id AS id, templatename, tpl.description AS tpldescription, tpl.locked AS tpllocked, tpl.selectable AS selectable, tmplvarid, if(isnull(cat.category),'%s',cat.category) AS category, cat.id AS catid", $_lang['no_category']), sprintf("%s as tpl + $rs = $modx->db->select(sprintf("tpl.id AS id, templatename, tpl.description AS tpldescription, tpl.locked AS tpllocked, tpl.selectable AS selectable, tmplvarid, if(isnull(cat.category),'%s',cat.category) AS category, cat.id AS catid", $_lang['no_category']), sprintf("%s as tpl LEFT JOIN %s as stt ON stt.templateid=tpl.id AND stt.tmplvarid='%s' LEFT JOIN %s as cat ON tpl.category=cat.id", $modx->getFullTableName('site_templates'), $modx->getFullTableName('site_tmplvar_templates'), $id, $modx->getFullTableName('categories')), '', "category, templatename"); - $tplList = '
      '; - $preCat = ''; - $insideUl = 0; - while ($row = $modx->db->getRow($rs)) { - $row['category'] = stripslashes($row['category']); //pixelchutes - if ($preCat !== $row['category']) { - $tplList .= $insideUl ? '
    ' : ''; - $tplList .= '
  • ' . $row['category'] . ($row['catid'] != '' ? ' (' . $row['catid'] . ')' : '') . '
      '; - $insideUl = 1; - } - - if ($modx->manager->action == '300' && $modx->config['default_template'] == $row['id']) { - $checked = true; - } elseif (isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) { - $checked = true; - } elseif ($id == 0 && is_array($_POST['template'])) { - $checked = in_array($row['id'], $_POST['template']); - } else { - $checked = $row['tmplvarid']; - } - $selectable = !$row['selectable'] ? ' class="disabled"' : ''; - $checked = $checked ? ' checked="checked"' : ''; - $tplId = ' (' . $row['id'] . ')'; - $desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : ''; - - $tplInfo = array(); - if ($row['tpllocked']) { - $tplInfo[] = $_lang['locked']; - } - if ($row['id'] == $modx->config['default_template']) { - $tplInfo[] = $_lang['defaulttemplate_title']; - } - $tplInfo = !empty($tplInfo) ? ' (' . implode(', ', $tplInfo) . ')' : ''; - - $tplList .= sprintf('
    • %s%s%s%s
    • ', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo); - $tplList .= ''; - - $preCat = $row['category']; - } - $tplList .= $insideUl ? '
    ' : ''; - $tplList .= ''; - echo $tplList; - - ?> + $tplList = '
      '; + $preCat = ''; + $insideUl = 0; + while($row = $modx->db->getRow($rs)) { + $row['category'] = stripslashes($row['category']); //pixelchutes + if($preCat !== $row['category']) { + $tplList .= $insideUl ? '
    ' : ''; + $tplList .= '
  • ' . $row['category'] . ($row['catid'] != '' ? ' (' . $row['catid'] . ')' : '') . '
      '; + $insideUl = 1; + } + + if($modx->manager->action == '300' && $modx->config['default_template'] == $row['id']) { + $checked = true; + } elseif(isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) { + $checked = true; + } elseif($id == 0 && is_array($_POST['template'])) { + $checked = in_array($row['id'], $_POST['template']); + } else { + $checked = $row['tmplvarid']; + } + $selectable = !$row['selectable'] ? ' class="disabled"' : ''; + $checked = $checked ? ' checked="checked"' : ''; + $tplId = ' (' . $row['id'] . ')'; + $desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : ''; + + $tplInfo = array(); + if($row['tpllocked']) { + $tplInfo[] = $_lang['locked']; + } + if($row['id'] == $modx->config['default_template']) { + $tplInfo[] = $_lang['defaulttemplate_title']; + } + $tplInfo = !empty($tplInfo) ? ' (' . implode(', ', $tplInfo) . ')' : ''; + + $tplList .= sprintf('
    • %s%s%s%s
    • ', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo); + $tplList .= ''; + + $preCat = $row['category']; + } + $tplList .= $insideUl ? '
    ' : ''; + $tplList .= ''; + echo $tplList; + + ?> db->select('documentgroup', $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); - $groupsarray = $modx->db->getColumn('documentgroup', $rs); ?> - hasPermission('access_permissions')) { - ?> + if($use_udperms == 1) { + // fetch permissions for the variable + $rs = $modx->db->select('documentgroup', $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); + $groupsarray = $modx->db->getColumn('documentgroup', $rs); + + ?> + hasPermission('access_permissions')) { ?> diff --git a/manager/actions/mutate_tv_rank.dynamic.php b/manager/actions/mutate_tv_rank.dynamic.php index ce8500f81d..46dd598245 100755 --- a/manager/actions/mutate_tv_rank.dynamic.php +++ b/manager/actions/mutate_tv_rank.dynamic.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_template')) { @@ -130,7 +130,7 @@ function resetSortOrder()
    + ?>

    diff --git a/manager/actions/mutate_user.dynamic.php b/manager/actions/mutate_user.dynamic.php index e69de29bb2..cd01ac1009 100755 --- a/manager/actions/mutate_user.dynamic.php +++ b/manager/actions/mutate_user.dynamic.php @@ -0,0 +1,799 @@ +INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +} + +switch($modx->manager->action) { + case 12: + if(!$modx->hasPermission('edit_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 11: + if(!$modx->hasPermission('new_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); +} + +$user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; + +// check to see the snippet editor isn't locked +$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); +if($username = $modx->db->getValue($rs)) { + $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user")); +} +// end check for lock + +if($modx->manager->action == '12') { + // get user attribute + $rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'"); + $userdata = $modx->db->getRow($rs); + if(!$userdata) { + $modx->webAlertAndQuit("No user returned!"); + } + + + // get user settings + $rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'"); + $usersettings = array(); + while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; + // manually extract so that user display settings are not overwritten + foreach($usersettings as $k => $v) { + if($k != 'manager_language' && $k != 'manager_theme') { + ${$k} = $v; + } + } + + // get user name + $rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'"); + $usernamedata = $modx->db->getRow($rs); + if(!$usernamedata) { + $modx->webAlertAndQuit("No user returned while getting username!"); + } + $_SESSION['itemname'] = $usernamedata['username']; +} else { + $userdata = array(); + $usersettings = array(); + $usernamedata = array(); + $_SESSION['itemname'] = $_lang["new_user"]; +} + +// avoid doubling htmlspecialchars (already encoded in DB) +foreach($userdata as $key => $val) { + $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); +}; +$usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); + +// restore saved form +$formRestored = false; +if($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); + // restore post values + $userdata = array_merge($userdata, $_POST); + $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); + $usernamedata['username'] = $userdata['newusername']; + $usernamedata['oldusername'] = $_POST['oldusername']; + $usersettings = array_merge($usersettings, $userdata); + $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; + extract($usersettings, EXTR_OVERWRITE); +} + +// include the country list language file +$_country_lang = array(); +include_once "lang/country/english_country.inc.php"; +if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { + include_once "lang/country/" . $manager_language . "_country.inc.php"; +} +asort($_country_lang); + +$displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; +if($which_browser == 'default') { + $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser']; +} +?> + + + + invokeEvent("OnUserFormPrerender", array( + "id" => $user + )); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> + + + " /> + +

    + (' . $usernamedata['id'] . ')' : $_lang['user_title']) ?> +

    + + + + +
    + +
    + +
    +

    + +
  • @@ -240,7 +233,7 @@

    [(enable_cache)]
    -
    +


    [(cache_type)]
    -
    +

    [(minifyphp_incache)]
    -
    +

    [(server_offset_time)]

    [(server_protocol)]
    -
    +

    [(track_visitors)]
    -
    - +
    +

    [(friendly_urls)]
    -
    +

    [(xhtml_urls)]
    -
    +

    [(make_folders)]
    -
    - +
    +

    [(seostrict)]
    -
    - +
    +

    [(aliaslistingfolder)]
    -
    - +
    +

    [(friendly_alias_urls)]
    -
    - +
    +

    [(use_alias_path)]
    -
    - +
    +

    [(allow_duplicate_alias)]
    -
    - +
    +

    [(automatic_alias)]
    -
    - +
    +

    [(use_udperms)]
    -
    +

    [(email_method)]
    -
    - +
    +
    >
    @@ -144,8 +144,8 @@

    [(allow_multiple_emails)]
    -
    - +
    +

    [(login_form_position)]
    -
    +


    [(manager_menu_position)]
    -
    +


    [(allow_eval)]
    -
    -
    -
    - +
    +
    +
    +
    @@ -53,7 +53,7 @@

    [(validate_referer)]
    -
    +

    [(error_reporting)]
    -
    -
    -
    - +
    +
    +
    +

    [(send_errormail)]
    -
    -
    -
    -
    -$modx->config['emailsender']));?>

    [(enable_bindings)]
    -
    - +
    +

    [(pwd_hash_algo)]
    manager->checkHashAlgorithm('BLOWFISH_Y') ? 0:1; $phm['e']['BLOWFISH_A'] = $modx->manager->checkHashAlgorithm('BLOWFISH_A') ? 0:1; $phm['e']['SHA512'] = $modx->manager->checkHashAlgorithm('SHA512') ? 0:1; @@ -167,12 +165,12 @@ $phm['e']['MD5'] = $modx->manager->checkHashAlgorithm('MD5') ? 0:1; $phm['e']['UNCRYPT'] = $modx->manager->checkHashAlgorithm('UNCRYPT') ? 0:1; ?> -
    -
    -
    -
    -
    - +
    +
    +
    +
    +
    +

    [(use_captcha)]

    [(use_browser)]
    -
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + manager->action == '12') { ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?> + + + +
    "> htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?> - + +
    : 
    manager->action == '11' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?> manager->action == "11" ? " checked disabled" : ""; ?>> + " onChange="documentDirty=true;" /> +
    + " id="passwordBlock"> +
    + + /> + +
    + > + +
    +
    + + +
    + + +
    +
    +
    +
    +
    + + /> + +
    + /> + +
    +
    : 
    :  +
    : db->select('name, id', '[+prefix+]user_roles', ($modx->hasPermission('save_role')) ? '' : 'id != 1'); + ?> +
    : 
    : 
    : 
    : 
    : 
    : 
    : 
    : 
    : " onBlur='documentDirty=true;'> + " data-tooltip="">
    : 
    : 
    : 
    : toDateFormat($userdata['lastlogin'] + $server_offset_time) ?>
    :  +    []
    :  time() && $userdata['blockeduntil'] != 0)) ? " checked" : ""; ?>> +
    : " onBlur='documentDirty=true;' readonly> + " data-tooltip="">
    : " onBlur='documentDirty=true;' readonly> + " data-tooltip="">
    + getLoginUserID()) { ?> +

    + +
    + + +
    +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
     
     
    /> + +
    + /> +
     
     
    +
    + +
    + +
    + +
    + +
    + +
    + +
     
    +
     

    + [(manager_theme_mode)] +
    + +
    + + +
    + +
    + +
    + +
     
    ">
     
    "> +    + /> + +
     
    "> +    + /> + +
     
    "> +    + /> + +
     
    "> +    + /> + +
     
    ">
     
     
    " />
     
    " />
     
    " />
     
    + invokeEvent("OnInterfaceSettingsRender"); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> +
    + + +
    +

    + + + + + + + + + + + + + + +
    +
     
    +
    + manager->action == '12') { // only do this bit if the user is being edited + $rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'"); + $groupsarray = $modx->db->getColumn('user_group', $rs); + } + // retain selected doc groups between post + if(is_array($_POST['user_groups'])) { + foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; + } + ?> +
    +

    + +

    + db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name'); + while($row = $modx->db->getRow($rs)) { + echo "
    "; + } + } + ?> +
    + + + + invokeEvent("OnUserFormRender", array( + "id" => $user + )); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> + diff --git a/manager/actions/mutate_web_user.dynamic.php b/manager/actions/mutate_web_user.dynamic.php index 1c2dc7103e..c070b64b76 100755 --- a/manager/actions/mutate_web_user.dynamic.php +++ b/manager/actions/mutate_web_user.dynamic.php @@ -1,21 +1,21 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -switch ($modx->manager->action) { - case 88: - if (!$modx->hasPermission('edit_web_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - case 87: - if (!$modx->hasPermission('new_web_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } - break; - default: - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +switch($modx->manager->action) { + case 88: + if(!$modx->hasPermission('edit_web_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + case 87: + if(!$modx->hasPermission('new_web_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); + } + break; + default: + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; @@ -23,67 +23,65 @@ // check to see the snippet editor isn't locked $rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); -if ($username = $modx->db->getValue($rs)) { - $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user")); +if($username = $modx->db->getValue($rs)) { + $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user")); } // end check for lock -if ($modx->manager->action == '88') { - // get user attributes - $rs = $modx->db->select('*', $modx->getFullTableName('web_user_attributes'), "internalKey = '{$user}'"); - $userdata = $modx->db->getRow($rs); - if (!$userdata) { - $modx->webAlertAndQuit("No user returned!"); - } - - // get user settings - $rs = $modx->db->select('*', $modx->getFullTableName('web_user_settings'), "webuser = '{$user}'"); - $usersettings = array(); - while ($row = $modx->db->getRow($rs)) { - $usersettings[$row['setting_name']] = $row['setting_value']; - } - extract($usersettings, EXTR_OVERWRITE); - - // get user name - $rs = $modx->db->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'"); - $usernamedata = $modx->db->getRow($rs); - if (!$usernamedata) { - $modx->webAlertAndQuit("No user returned while getting username!"); - } - $_SESSION['itemname'] = $usernamedata['username']; +if($modx->manager->action == '88') { + // get user attributes + $rs = $modx->db->select('*', $modx->getFullTableName('web_user_attributes'), "internalKey = '{$user}'"); + $userdata = $modx->db->getRow($rs); + if(!$userdata) { + $modx->webAlertAndQuit("No user returned!"); + } + + // get user settings + $rs = $modx->db->select('*', $modx->getFullTableName('web_user_settings'), "webuser = '{$user}'"); + $usersettings = array(); + while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; + extract($usersettings, EXTR_OVERWRITE); + + // get user name + $rs = $modx->db->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'"); + $usernamedata = $modx->db->getRow($rs); + if(!$usernamedata) { + $modx->webAlertAndQuit("No user returned while getting username!"); + } + $_SESSION['itemname'] = $usernamedata['username']; } else { - $userdata = array(); - $usersettings = array(); - $usernamedata = array(); - $_SESSION['itemname'] = $_lang["new_web_user"]; + $userdata = array(); + $usersettings = array(); + $usernamedata = array(); + $_SESSION['itemname'] = $_lang["new_web_user"]; } // avoid doubling htmlspecialchars (already encoded in DB) -foreach ($userdata as $key => $val) { - $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); +foreach($userdata as $key => $val) { + $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); }; $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); // restore saved form $formRestored = false; -if ($modx->manager->hasFormValues()) { - $modx->manager->loadFormValues(); - // restore post values - $userdata = array_merge($userdata, $_POST); - $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); - $usernamedata['username'] = $userdata['newusername']; - $usernamedata['oldusername'] = $_POST['oldusername']; - $usersettings = array_merge($usersettings, $userdata); - $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; - extract($usersettings, EXTR_OVERWRITE); +if($modx->manager->hasFormValues()) { + $modx->manager->loadFormValues(); + // restore post values + $userdata = array_merge($userdata, $_POST); + $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); + $usernamedata['username'] = $userdata['newusername']; + $usernamedata['oldusername'] = $_POST['oldusername']; + $usersettings = array_merge($usersettings, $userdata); + $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; + extract($usersettings, EXTR_OVERWRITE); } // include the country list language file $_country_lang = array(); -if ($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { - include_once "lang/country/" . $manager_language . "_country.inc.php"; +if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { + include_once "lang/country/" . $manager_language . "_country.inc.php"; } else { - include_once "lang/country/english_country.inc.php"; + include_once "lang/country/english_country.inc.php"; } asort($_country_lang); @@ -191,12 +189,12 @@ function showHide(what, onoff) {
    invokeEvent("OnWUsrFormPrerender", array("id" => $user)); - if (is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> + // invoke OnWUsrFormPrerender event + $evtOut = $modx->invokeEvent("OnWUsrFormPrerender", array("id" => $user)); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> " /> @@ -220,23 +218,19 @@ function showHide(what, onoff) { - + - + @@ -330,10 +324,10 @@ function showHide(what, onoff) { $country) { - echo ""; - } - ?> + foreach($_country_lang as $key => $country) { + echo ""; + } + ?> @@ -357,8 +351,7 @@ function showHide(what, onoff) { - manager->action == '88') { - ?> + manager->action == '88') { ?> @@ -394,8 +387,8 @@ function showHide(what, onoff) { " data-tooltip=""> + } + ?>
    - time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) { - ?> + time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) { ?> - +
    "> htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?> -
    :  
     
    :  
    @@ -503,40 +496,40 @@ function SetUrl(url, width, height, alt) { manager->action == '88') { // only do this bit if the user is being edited - $rs = $modx->db->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'"); - $groupsarray = $modx->db->getColumn('webgroup', $rs); - } - // retain selected user groups between post - if (is_array($_POST['user_groups'])) { - foreach ($_POST['user_groups'] as $n => $v) { - $groupsarray[] = $v; - } - } ?> + if($use_udperms == 1) { + + $groupsarray = array(); + + if($modx->manager->action == '88') { // only do this bit if the user is being edited + $rs = $modx->db->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'"); + $groupsarray = $modx->db->getColumn('webgroup', $rs); + } + // retain selected user groups between post + if(is_array($_POST['user_groups'])) { + foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; + } + ?>

    db->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name'); - while ($row = $modx->db->getRow($rs)) { - echo '
    '; - } - } - ?> + $rs = $modx->db->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name'); + while($row = $modx->db->getRow($rs)) { + echo '
    '; + } + } + ?>
    invokeEvent("OnWUsrFormRender", array( - "id" => $user - )); - if (is_array($evtOut)) { - echo implode("", $evtOut); - } - ?> + // invoke OnWUsrFormRender event + $evtOut = $modx->invokeEvent("OnWUsrFormRender", array( + "id" => $user + )); + if(is_array($evtOut)) { + echo implode("", $evtOut); + } + ?> diff --git a/manager/actions/phpinfo.static.php b/manager/actions/phpinfo.static.php index 1bc0356c99..5729512f85 100755 --- a/manager/actions/phpinfo.static.php +++ b/manager/actions/phpinfo.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } ?> diff --git a/manager/actions/refresh_site.dynamic.php b/manager/actions/refresh_site.dynamic.php index 0ec740137f..a73ea46e2b 100755 --- a/manager/actions/refresh_site.dynamic.php +++ b/manager/actions/refresh_site.dynamic.php @@ -1,6 +1,6 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } // (un)publishing of documents, version 2! @@ -29,16 +29,12 @@
    - ' . $_lang["refresh_published"] . '

    ', $num_rows_pub); -} ?> - ' . $_lang["refresh_unpublished"] . '

    ', $num_rows_unpub); -} ?> + ' . $_lang["refresh_published"] . '

    ', $num_rows_pub) ?> + ' . $_lang["refresh_unpublished"] . '

    ', $num_rows_unpub) ?> clearCache('full', true); - // invoke OnSiteRefresh event - $modx->invokeEvent("OnSiteRefresh"); - ?> + $modx->clearCache('full', true); + // invoke OnSiteRefresh event + $modx->invokeEvent("OnSiteRefresh"); + ?>
    diff --git a/manager/actions/resource_selector.static.php b/manager/actions/resource_selector.static.php index 068bb21295..065cb0666e 100755 --- a/manager/actions/resource_selector.static.php +++ b/manager/actions/resource_selector.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('edit_module')) { diff --git a/manager/actions/resources.static.php b/manager/actions/resources.static.php index 18e1491e82..7899784644 100755 --- a/manager/actions/resources.static.php +++ b/manager/actions/resources.static.php @@ -1,54 +1,50 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/functions.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/functions.inc.php'); +if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/functions.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/functions.inc.php'); } else { - include_once(MODX_MANAGER_PATH . 'actions/resources/functions.inc.php'); + include_once(MODX_MANAGER_PATH . 'actions/resources/functions.inc.php'); } -if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/mgrResources.class.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/mgrResources.class.php'); +if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/mgrResources.class.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/mgrResources.class.php'); } else { - include_once(MODX_MANAGER_PATH . 'actions/resources/mgrResources.class.php'); + include_once(MODX_MANAGER_PATH . 'actions/resources/mgrResources.class.php'); } $resources = new mgrResources(); // Prepare lang-strings for "Lock Elements" $unlockTranslations = array( - 'msg' => $_lang["unlock_element_id_warning"], - 'type1' => $_lang["lock_element_type_1"], - 'type2' => $_lang["lock_element_type_2"], - 'type3' => $_lang["lock_element_type_3"], - 'type4' => $_lang["lock_element_type_4"], - 'type5' => $_lang["lock_element_type_5"], - 'type6' => $_lang["lock_element_type_6"], - 'type7' => $_lang["lock_element_type_7"], - 'type8' => $_lang["lock_element_type_8"] + 'msg' => $_lang["unlock_element_id_warning"], + 'type1' => $_lang["lock_element_type_1"], + 'type2' => $_lang["lock_element_type_2"], + 'type3' => $_lang["lock_element_type_3"], + 'type4' => $_lang["lock_element_type_4"], + 'type5' => $_lang["lock_element_type_5"], + 'type6' => $_lang["lock_element_type_6"], + 'type7' => $_lang["lock_element_type_7"], + 'type8' => $_lang["lock_element_type_8"] ); -foreach ($unlockTranslations as $key => $value) { - $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); -} +foreach($unlockTranslations as $key => $value) $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); // Prepare lang-strings for mgrResAction() $mraTranslations = array( - 'create_new' => $_lang["create_new"], - 'edit' => $_lang["edit"], - 'duplicate' => $_lang["duplicate"], - 'remove' => $_lang["remove"], - 'confirm_duplicate_record' => $_lang["confirm_duplicate_record"], - 'confirm_delete_template' => $_lang["confirm_delete_template"], - 'confirm_delete_tmplvars' => $_lang["confirm_delete_tmplvars"], - 'confirm_delete_htmlsnippet' => $_lang["confirm_delete_htmlsnippet"], - 'confirm_delete_snippet' => $_lang["confirm_delete_htmlsnippet"], - 'confirm_delete_plugin' => $_lang["confirm_delete_plugin"], - 'confirm_delete_module' => $_lang["confirm_delete_module"], + 'create_new' => $_lang["create_new"], + 'edit' => $_lang["edit"], + 'duplicate' => $_lang["duplicate"], + 'remove' => $_lang["remove"], + 'confirm_duplicate_record' => $_lang["confirm_duplicate_record"], + 'confirm_delete_template' => $_lang["confirm_delete_template"], + 'confirm_delete_tmplvars' => $_lang["confirm_delete_tmplvars"], + 'confirm_delete_htmlsnippet' => $_lang["confirm_delete_htmlsnippet"], + 'confirm_delete_snippet' => $_lang["confirm_delete_htmlsnippet"], + 'confirm_delete_plugin' => $_lang["confirm_delete_plugin"], + 'confirm_delete_module' => $_lang["confirm_delete_module"], ); -foreach ($mraTranslations as $key => $value) { - $mraTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); -} +foreach($mraTranslations as $key => $value) $mraTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); ?> @@ -69,46 +65,46 @@ config['manager_theme'] . '/actions/resources/tab1_templates.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab1_templates.inc.php'); - } else { - include_once(MODX_MANAGER_PATH . '/actions/resources/tab1_templates.inc.php'); - } + if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab1_templates.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab1_templates.inc.php'); + } else { + include_once(MODX_MANAGER_PATH . '/actions/resources/tab1_templates.inc.php'); + } - if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab2_templatevars.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab2_templatevars.inc.php'); - } else { - include_once(MODX_MANAGER_PATH . '/actions/resources/tab2_templatevars.inc.php'); - } + if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab2_templatevars.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab2_templatevars.inc.php'); + } else { + include_once(MODX_MANAGER_PATH . '/actions/resources/tab2_templatevars.inc.php'); + } - if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab3_chunks.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab3_chunks.inc.php'); - } else { - include_once(MODX_MANAGER_PATH . '/actions/resources/tab3_chunks.inc.php'); - } + if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab3_chunks.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab3_chunks.inc.php'); + } else { + include_once(MODX_MANAGER_PATH . '/actions/resources/tab3_chunks.inc.php'); + } - if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab4_snippets.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab4_snippets.inc.php'); - } else { - include_once(MODX_MANAGER_PATH . '/actions/resources/tab4_snippets.inc.php'); - } + if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab4_snippets.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab4_snippets.inc.php'); + } else { + include_once(MODX_MANAGER_PATH . '/actions/resources/tab4_snippets.inc.php'); + } - if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab5_plugins.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab5_plugins.inc.php'); - } else { - include_once(MODX_MANAGER_PATH . '/actions/resources/tab5_plugins.inc.php'); - } + if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab5_plugins.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab5_plugins.inc.php'); + } else { + include_once(MODX_MANAGER_PATH . '/actions/resources/tab5_plugins.inc.php'); + } - if (file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab6_categoryview.inc.php')) { - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab6_categoryview.inc.php'); - } else { - include_once(MODX_MANAGER_PATH . '/actions/resources/tab6_categoryview.inc.php'); - } + if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab6_categoryview.inc.php')) { + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab6_categoryview.inc.php'); + } else { + include_once(MODX_MANAGER_PATH . '/actions/resources/tab6_categoryview.inc.php'); + } - if (is_numeric($_GET['tab'])) { - echo ''; - } - ?> + if(is_numeric($_GET['tab'])) { + echo ''; + } + ?> diff --git a/manager/actions/resources/functions.inc.php b/manager/actions/resources/functions.inc.php index 680e0e3236..0c52eaa27f 100755 --- a/manager/actions/resources/functions.inc.php +++ b/manager/actions/resources/functions.inc.php @@ -1,14 +1,14 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } $tpl = array( - 'viewForm' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_viewForm.tpl'), - 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), - 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), - 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), - 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl') + 'viewForm' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_viewForm.tpl'), + 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), + 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), + 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), + 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl') ); /** @@ -16,26 +16,22 @@ * @param array $ph * @return string */ -function parsePh($tpl, $ph) -{ - $modx = evolutionCMS(); - global $_lang; - $tpl = $modx->parseText($tpl, $_lang, '[%', '%]'); - return $modx->parseText($tpl, $ph); +function parsePh($tpl, $ph) { + $modx = evolutionCMS(); global $_lang; + $tpl = $modx->parseText($tpl, $_lang, '[%', '%]'); + return $modx->parseText($tpl, $ph); } /** * @param string|int $cssId * @return string */ -function renderViewSwitchButtons($cssId) -{ - $modx = evolutionCMS(); - global $_lang, $tpl; +function renderViewSwitchButtons($cssId) { + $modx = evolutionCMS(); global $_lang, $tpl; - return parsePh($tpl['viewForm'], array( - 'cssId' => $cssId - )); + return parsePh($tpl['viewForm'], array( + 'cssId' => $cssId + )); } /** @@ -43,112 +39,108 @@ function renderViewSwitchButtons($cssId) * @param mgrResources $resources * @return string */ -function createResourceList($resourceTable, $resources) -{ - $modx = evolutionCMS(); - global $_lang, $_style, $modx_textdir, $tpl; +function createResourceList($resourceTable, $resources) { + $modx = evolutionCMS(); global $_lang, $_style, $modx_textdir, $tpl; - $items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false; + $items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false; - if (! is_array($items) || empty($items)) { - return $_lang['no_results']; - } + if( ! is_array($items) || empty($items)) { + return $_lang['no_results']; + } - // Prepare elements- and categories-list - $elements = array(); - $categories = array(); - foreach ($items as $row) { - $catid = $row['catid'] ? $row['catid'] : 0; - $categories[$catid] = array('name' => stripslashes($row['category'])); - $elements[$catid][] = prepareElementRowPh($row, $resourceTable, $resources); - } + // Prepare elements- and categories-list + $elements = array(); + $categories = array(); + foreach($items as $row) { + $catid = $row['catid'] ? $row['catid'] : 0; + $categories[$catid] = array('name' => stripslashes($row['category'])); + $elements[$catid][] = prepareElementRowPh($row, $resourceTable, $resources); + } - // Now render categories / panel-collapse - $panelGroup = ''; - foreach ($elements as $catid => $elList) { - // Add panel-heading / category-collapse to output - $panelGroup .= parsePh($tpl['panelHeading'], array( - 'tab' => $resourceTable, - 'category' => $categories[$catid]['name'], - 'categoryid' => $catid != '' ? ' (' . $catid . ')' : '', - 'catid' => $catid, - )); + // Now render categories / panel-collapse + $panelGroup = ''; + foreach($elements as $catid => $elList) { + // Add panel-heading / category-collapse to output + $panelGroup .= parsePh($tpl['panelHeading'], array( + 'tab' => $resourceTable, + 'category' => $categories[$catid]['name'], + 'categoryid' => $catid != '' ? ' (' . $catid . ')' : '', + 'catid' => $catid, + )); - // Prepare content for panel-collapse - $panelCollapse = ''; - foreach ($elList as $el) { - $panelCollapse .= parsePh($tpl['elementsRow'], $el); - } + // Prepare content for panel-collapse + $panelCollapse = ''; + foreach($elList as $el) { + $panelCollapse .= parsePh($tpl['elementsRow'], $el); + } - // Add panel-collapse with elements to output - $panelGroup .= parsePh($tpl['panelCollapse'], array( - 'tab' => $resourceTable, - 'catid' => $catid, - 'wrapper' => $panelCollapse, - )); - } + // Add panel-collapse with elements to output + $panelGroup .= parsePh($tpl['panelCollapse'], array( + 'tab' => $resourceTable, + 'catid' => $catid, + 'wrapper' => $panelCollapse, + )); + } - return parsePh($tpl['panelGroup'], array( - 'resourceTable' => $resourceTable, - 'wrapper' => $panelGroup - )); + return parsePh($tpl['panelGroup'], array( + 'resourceTable' => $resourceTable, + 'wrapper' => $panelGroup + )); } /** * @param mgrResources $resources * @return string */ -function createCombinedView($resources) -{ - $modx = evolutionCMS(); - global $_lang, $_style, $modx_textdir; +function createCombinedView($resources) { + $modx = evolutionCMS(); global $_lang, $_style, $modx_textdir; - $itemsPerCategory = isset($resources->itemsPerCategory) ? $resources->itemsPerCategory : false; - $types = isset($resources->types) ? $resources->types : false; - $categories = isset($resources->categories) ? $resources->categories : false; + $itemsPerCategory = isset($resources->itemsPerCategory) ? $resources->itemsPerCategory : false; + $types = isset($resources->types) ? $resources->types : false; + $categories = isset($resources->categories) ? $resources->categories : false; - if (!$itemsPerCategory) { - return $_lang['no_results']; - } + if(!$itemsPerCategory) { + return $_lang['no_results']; + } - $tpl = array( - 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), - 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), - 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), - 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl'), - ); + $tpl = array( + 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), + 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), + 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), + 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl'), + ); - // Easily loop through $itemsPerCategory-Array - $panelGroup = ''; - foreach ($categories as $catid => $category) { - // Prepare collapse content / elements-list - $panelCollapse = ''; - foreach ($itemsPerCategory[$catid] as $el) { - $resourceTable = $el['type']; - $ph = prepareElementRowPh($el, $resourceTable, $resources); - $panelCollapse .= parsePh($tpl['elementsRow'], $ph); - } + // Easily loop through $itemsPerCategory-Array + $panelGroup = ''; + foreach($categories as $catid => $category) { + // Prepare collapse content / elements-list + $panelCollapse = ''; + foreach($itemsPerCategory[$catid] as $el) { + $resourceTable = $el['type']; + $ph = prepareElementRowPh($el, $resourceTable, $resources); + $panelCollapse .= parsePh($tpl['elementsRow'], $ph); + } - // Add panel-heading / button - $panelGroup .= parsePh($tpl['panelHeading'], array( - 'tab' => 'categories_list', - 'category' => $categories[$catid], - 'categoryid' => $catid != '' ? ' (' . $catid . ')' : '', - 'catid' => $catid, - )); + // Add panel-heading / button + $panelGroup .= parsePh($tpl['panelHeading'], array( + 'tab' => 'categories_list', + 'category' => $categories[$catid], + 'categoryid' => $catid != '' ? ' (' . $catid . ')' : '', + 'catid' => $catid, + )); - // Add panel - $panelGroup .= parsePh($tpl['panelCollapse'], array( - 'tab' => 'categories_list', - 'catid' => $catid, - 'wrapper' => $panelCollapse, - )); - } + // Add panel + $panelGroup .= parsePh($tpl['panelCollapse'], array( + 'tab' => 'categories_list', + 'catid' => $catid, + 'wrapper' => $panelCollapse, + )); + } - return parsePh($tpl['panelGroup'], array( - 'resourceTable' => 'categories_list', - 'wrapper' => $panelGroup - )); + return parsePh($tpl['panelGroup'], array( + 'resourceTable' => 'categories_list', + 'wrapper' => $panelGroup + )); } /** @@ -157,16 +149,14 @@ function createCombinedView($resources) * @param mgrResources $resources * @return array */ -function prepareElementRowPh($row, $resourceTable, $resources) -{ - $modx = evolutionCMS(); - global $modx_textdir, $_style, $_lang; +function prepareElementRowPh($row, $resourceTable, $resources) { + $modx = evolutionCMS(); global $modx_textdir, $_style, $_lang; - $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false; + $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false; - $_lang["confirm_delete"] = $_lang["delete"]; + $_lang["confirm_delete"] = $_lang["delete"]; - switch ($resourceTable) { + switch($resourceTable){ case 'site_templates': $class = $row['selectable'] ? '' : 'disabledPlugin'; $lockElementType = 1; @@ -200,77 +190,77 @@ function prepareElementRowPh($row, $resourceTable, $resources) return array(); } - // Prepare displaying user-locks - $lockedByUser = ''; - $rowLock = $modx->elementIsLocked($lockElementType, $row['id'], true); - if ($rowLock && $modx->hasPermission('display_locks')) { - if ($rowLock['sid'] == $modx->sid) { - $title = $modx->parseText($_lang["lock_element_editing"], array( - 'element_type' => $_lang["lock_element_type_" . $lockElementType], - 'lasthit_df' => $rowLock['lasthit_df'] - )); - $lockedByUser = '' . $_style['tree_preview_resource'] . ' '; - } else { - $title = $modx->parseText($_lang["lock_element_locked_by"], array( - 'element_type' => $_lang["lock_element_type_" . $lockElementType], - 'username' => $rowLock['username'], - 'lasthit_df' => $rowLock['lasthit_df'] - )); - if ($modx->hasPermission('remove_locks')) { - $lockedByUser = ''; - } else { - $lockedByUser = ''; - } - } - } - if ($lockedByUser) { - $lockedByUser = '
    ' . $lockedByUser . '
    '; - } + // Prepare displaying user-locks + $lockedByUser = ''; + $rowLock = $modx->elementIsLocked($lockElementType, $row['id'], true); + if($rowLock && $modx->hasPermission('display_locks')) { + if($rowLock['sid'] == $modx->sid) { + $title = $modx->parseText($_lang["lock_element_editing"], array( + 'element_type' => $_lang["lock_element_type_" . $lockElementType], + 'lasthit_df' => $rowLock['lasthit_df'] + )); + $lockedByUser = '' . $_style['tree_preview_resource'] . ' '; + } else { + $title = $modx->parseText($_lang["lock_element_locked_by"], array( + 'element_type' => $_lang["lock_element_type_" . $lockElementType], + 'username' => $rowLock['username'], + 'lasthit_df' => $rowLock['lasthit_df'] + )); + if($modx->hasPermission('remove_locks')) { + $lockedByUser = ''; + } else { + $lockedByUser = ''; + } + } + } + if($lockedByUser) { + $lockedByUser = '
    ' . $lockedByUser . '
    '; + } - // Caption - if ($resourceTable == 'site_tmplvars') { - $caption = !empty($row['description']) ? ' ' . $row['caption'] . '   (' . $row['description'] . ')' : ' ' . $row['caption']; - } else { - $caption = !empty($row['description']) ? ' ' . $row['description'] : ''; - } + // Caption + if($resourceTable == 'site_tmplvars') { + $caption = !empty($row['description']) ? ' ' . $row['caption'] . '   (' . $row['description'] . ')' : ' ' . $row['caption']; + } else { + $caption = !empty($row['description']) ? ' ' . $row['description'] : ''; + } - // Special marks - $tplInfo = array(); - if ($row['locked']) { - $tplInfo[] = $_lang['locked']; - } - if ($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') { - $tplInfo[] = $_lang['defaulttemplate_title']; - } - $marks = !empty($tplInfo) ? ' (' . implode(', ', $tplInfo) . ')' : ''; + // Special marks + $tplInfo = array(); + if($row['locked']) { + $tplInfo[] = $_lang['locked']; + } + if($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') { + $tplInfo[] = $_lang['defaulttemplate_title']; + } + $marks = !empty($tplInfo) ? ' (' . implode(', ', $tplInfo) . ')' : ''; - /* row buttons */ - $buttons = ''; - if ($modx->hasPermission($types['actions']['edit'][1])) { - $buttons .= '
  • '; - } - if ($modx->hasPermission($types['actions']['duplicate'][1])) { - $buttons .= '
  • '; - } - if ($modx->hasPermission($types['actions']['remove'][1])) { - $buttons .= '
  • '; - } - $buttons = $buttons ? '
      ' . $buttons . '
    ' : ''; + /* row buttons */ + $buttons = ''; + if($modx->hasPermission($types['actions']['edit'][1])) { + $buttons .= '
  • '; + } + if($modx->hasPermission($types['actions']['duplicate'][1])) { + $buttons .= '
  • '; + } + if($modx->hasPermission($types['actions']['remove'][1])) { + $buttons .= '
  • '; + } + $buttons = $buttons ? '
      ' . $buttons . '
    ' : ''; - $catid = $row['catid'] ? $row['catid'] : 0; + $catid = $row['catid'] ? $row['catid'] : 0; - // Placeholders for elements-row - return array( - 'class' => $class ? ' class="' . $class . '"' : '', - 'lockedByUser' => $lockedByUser, - 'name' => $row['name'], - 'caption' => $caption, - 'buttons' => $buttons, - 'marks' => $marks, - 'id' => $row['id'], - 'resourceTable' => $resourceTable, - 'actionEdit' => $types['actions']['edit'][0], - 'catid' => $catid, - 'textdir' => $modx_textdir ? '‏' : '', - ); + // Placeholders for elements-row + return array( + 'class' => $class ? ' class="' . $class . '"' : '', + 'lockedByUser' => $lockedByUser, + 'name' => $row['name'], + 'caption' => $caption, + 'buttons' => $buttons, + 'marks' => $marks, + 'id' => $row['id'], + 'resourceTable' => $resourceTable, + 'actionEdit' => $types['actions']['edit'][0], + 'catid' => $catid, + 'textdir' => $modx_textdir ? '‏' : '', + ); } diff --git a/manager/actions/resources/mgrResources.class.php b/manager/actions/resources/mgrResources.class.php index 54b7473345..2b34adb3c3 100755 --- a/manager/actions/resources/mgrResources.class.php +++ b/manager/actions/resources/mgrResources.class.php @@ -1,14 +1,13 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -class mgrResources -{ +class mgrResources { /** * @var array */ - public $types = array(); + public $types = array(); /** * @var array */ @@ -25,91 +24,82 @@ class mgrResources /** * mgrResources constructor. */ - public function __construct() - { - $this->setTypes(); - $this->queryItemsFromDB(); - $this->prepareCategoryArrays(); - } + public function __construct() { + $this->setTypes(); + $this->queryItemsFromDB(); + $this->prepareCategoryArrays(); + } /** * @return void */ - public function setTypes() - { - global $_lang; - $this->types['site_templates'] = array( - 'title'=>$_lang["manage_templates"], - 'actions'=>array( 'edit'=>array(16,'edit_template'), 'duplicate'=>array(96,'new_template'), 'remove'=>array(21,'delete_template') ), - 'permissions'=>array('new_template','edit_template'), - 'name'=>'templatename' - ); - $this->types['site_tmplvars'] = array( - 'title'=>$_lang["tmplvars"], - 'actions'=>array('edit'=>array(301,'edit_template'), 'duplicate'=>array(304,'edit_template'), 'remove'=>array(303,'edit_template')), - 'permissions'=>array('new_template','edit_template'), - ); - $this->types['site_htmlsnippets'] = array( - 'title'=>$_lang["manage_htmlsnippets"], - 'actions'=>array('edit'=>array(78,'edit_chunk'), 'duplicate'=>array(97,'new_chunk'), 'remove'=>array(80,'delete_chunk')), - 'permissions'=>array('new_chunk','edit_chunk'), - ); - $this->types['site_snippets'] = array( - 'title'=>$_lang["manage_snippets"], - 'actions'=>array('edit'=>array(22,'edit_snippet'), 'duplicate'=>array(98,'new_snippet'), 'remove'=>array(25,'delete_snippet')), - 'permissions'=>array('new_snippet','edit_snippet'), - ); - $this->types['site_plugins'] = array( - 'title'=>$_lang["manage_plugins"], - 'actions'=>array('edit'=>array(102,'edit_plugin'), 'duplicate'=>array(105,'new_plugin'), 'remove'=>array(104,'delete_plugin')), - 'permissions'=>array('new_plugin','edit_plugin'), - ); - $this->types['site_modules'] = array( - 'title'=>$_lang["manage_modules"], - 'actions'=>array('edit'=>array(108,'edit_module'), 'duplicate'=>array(111,'new_module'), 'remove'=>array(110,'delete_module')), - 'permissions'=>array('new_module','edit_module'), - ); - } + public function setTypes() { + global $_lang; + $this->types['site_templates'] = array( + 'title'=>$_lang["manage_templates"], + 'actions'=>array( 'edit'=>array(16,'edit_template'), 'duplicate'=>array(96,'new_template'), 'remove'=>array(21,'delete_template') ), + 'permissions'=>array('new_template','edit_template'), + 'name'=>'templatename' + ); + $this->types['site_tmplvars'] = array( + 'title'=>$_lang["tmplvars"], + 'actions'=>array('edit'=>array(301,'edit_template'), 'duplicate'=>array(304,'edit_template'), 'remove'=>array(303,'edit_template')), + 'permissions'=>array('new_template','edit_template'), + ); + $this->types['site_htmlsnippets'] = array( + 'title'=>$_lang["manage_htmlsnippets"], + 'actions'=>array('edit'=>array(78,'edit_chunk'), 'duplicate'=>array(97,'new_chunk'), 'remove'=>array(80,'delete_chunk')), + 'permissions'=>array('new_chunk','edit_chunk'), + ); + $this->types['site_snippets'] = array( + 'title'=>$_lang["manage_snippets"], + 'actions'=>array('edit'=>array(22,'edit_snippet'), 'duplicate'=>array(98,'new_snippet'), 'remove'=>array(25,'delete_snippet')), + 'permissions'=>array('new_snippet','edit_snippet'), + ); + $this->types['site_plugins'] = array( + 'title'=>$_lang["manage_plugins"], + 'actions'=>array('edit'=>array(102,'edit_plugin'), 'duplicate'=>array(105,'new_plugin'), 'remove'=>array(104,'delete_plugin')), + 'permissions'=>array('new_plugin','edit_plugin'), + ); + $this->types['site_modules'] = array( + 'title'=>$_lang["manage_modules"], + 'actions'=>array('edit'=>array(108,'edit_module'), 'duplicate'=>array(111,'new_module'), 'remove'=>array(110,'delete_module')), + 'permissions'=>array('new_module','edit_module'), + ); + } /** * @return void */ - public function queryItemsFromDB() - { - foreach ($this->types as $resourceTable=>$type) { - if ($this->hasAnyPermissions($type['permissions'])) { - $nameField = isset($type['name']) ? $type['name'] : 'name'; - $this->items[$resourceTable] = $this->queryResources($resourceTable, $nameField); - } - } - } + public function queryItemsFromDB() { + foreach($this->types as $resourceTable=>$type) { + if($this->hasAnyPermissions($type['permissions'])) { + $nameField = isset($type['name']) ? $type['name'] : 'name'; + $this->items[$resourceTable] = $this->queryResources($resourceTable, $nameField); + } + } + } /** * @param array $permissions * @return bool */ - public function hasAnyPermissions($permissions) - { - $modx = evolutionCMS(); + public function hasAnyPermissions($permissions) { + $modx = evolutionCMS(); - foreach ($permissions as $p) { - if ($modx->hasPermission($p)) { - return true; - } - } + foreach($permissions as $p) + if($modx->hasPermission($p)) return true; - return false; - } + return false; + } /** * @param string $resourceTable * @param string $nameField * @return array|bool */ - public function queryResources($resourceTable, $nameField = 'name') - { - $modx = evolutionCMS(); - global $_lang; + public function queryResources($resourceTable, $nameField = 'name') { + $modx = evolutionCMS(); global $_lang; $allowed = array( 'site_htmlsnippets', @@ -117,63 +107,59 @@ public function queryResources($resourceTable, $nameField = 'name') 'site_plugins', 'site_modules' ); - $pluginsql = !empty($resourceTable) && in_array($resourceTable, $allowed) ? $resourceTable . '.disabled, ' : ''; - - $tvsql = ''; - $tvjoin = ''; - if ($resourceTable === 'site_tmplvars') { - $tvsql = 'site_tmplvars.caption, '; - $tvjoin = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl', $modx->getFullTableName('site_tmplvar_templates')); - $sttfield = 'IF(stt.templateid,1,0) AS reltpl,'; - } else { - $sttfield = ''; - } - - $selectableTemplates = $resourceTable === 'site_templates' ? "{$resourceTable}.selectable, " : ""; - - $rs = $modx->db->select( - "{$sttfield} {$pluginsql} {$tvsql} {$resourceTable}.{$nameField} as name, {$resourceTable}.id, {$resourceTable}.description, {$resourceTable}.locked, {$selectableTemplates}IF(isnull(categories.category),'{$_lang['no_category']}',categories.category) as category, categories.id as catid", - $modx->getFullTableName($resourceTable) . " AS {$resourceTable} + $pluginsql = !empty($resourceTable) && in_array($resourceTable, $allowed) ? $resourceTable . '.disabled, ' : ''; + + $tvsql = ''; + $tvjoin = ''; + if ($resourceTable === 'site_tmplvars') { + $tvsql = 'site_tmplvars.caption, '; + $tvjoin = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl', $modx->getFullTableName('site_tmplvar_templates')); + $sttfield = 'IF(stt.templateid,1,0) AS reltpl,'; + } + else $sttfield = ''; + + $selectableTemplates = $resourceTable === 'site_templates' ? "{$resourceTable}.selectable, " : ""; + + $rs = $modx->db->select( + "{$sttfield} {$pluginsql} {$tvsql} {$resourceTable}.{$nameField} as name, {$resourceTable}.id, {$resourceTable}.description, {$resourceTable}.locked, {$selectableTemplates}IF(isnull(categories.category),'{$_lang['no_category']}',categories.category) as category, categories.id as catid", + $modx->getFullTableName($resourceTable) . " AS {$resourceTable} LEFT JOIN " . $modx->getFullTableName('categories') . " AS categories ON {$resourceTable}.category = categories.id {$tvjoin}", - "", - "category,name" - ); - $limit = $modx->db->getRecordCount($rs); + "", + "category,name" + ); + $limit = $modx->db->getRecordCount($rs); - if ($limit < 1) { - return false; - } + if($limit < 1) return false; - $result = array(); - while ($row = $modx->db->getRow($rs)) { - $result[] = $row; - } - return $result; - } + $result = array(); + while ($row = $modx->db->getRow($rs)) { + $result[] = $row; + } + return $result; + } /** * @return void */ - public function prepareCategoryArrays() - { - foreach ($this->items as $type=>$items) { - foreach ((array)$items as $item) { - $catid = $item['catid'] ? $item['catid'] : 0; - $this->categories[$catid] = $item['category']; - - $item['type'] = $type; - $this->itemsPerCategory[$catid][] = $item; - } - } - - // Sort categories by name - natcasesort($this->categories); - - // Now sort by name - foreach ($this->itemsPerCategory as $catid=>$items) { - usort($this->itemsPerCategory[$catid], function ($a, $b) { - return strcasecmp($a['name'], $b['name']); - }); - } - } + public function prepareCategoryArrays() { + foreach($this->items as $type=>$items) { + foreach((array)$items as $item) { + $catid = $item['catid'] ? $item['catid'] : 0; + $this->categories[$catid] = $item['category']; + + $item['type'] = $type; + $this->itemsPerCategory[$catid][] = $item; + } + } + + // Sort categories by name + natcasesort($this->categories); + + // Now sort by name + foreach($this->itemsPerCategory as $catid=>$items) { + usort($this->itemsPerCategory[$catid], function ($a, $b) { + return strcasecmp($a['name'], $b['name']); + }); + } + } } diff --git a/manager/actions/resources/tab1_templates.inc.php b/manager/actions/resources/tab1_templates.inc.php index 59a41c2a2f..23b0758e87 100755 --- a/manager/actions/resources/tab1_templates.inc.php +++ b/manager/actions/resources/tab1_templates.inc.php @@ -1,11 +1,10 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (isset($resources->items['site_templates'])) { - ?> +if (isset($resources->items['site_templates'])) { ?>

    @@ -36,5 +35,4 @@ initViews('tmp', 'template', 'site_templates')
    - + diff --git a/manager/actions/resources/tab2_templatevars.inc.php b/manager/actions/resources/tab2_templatevars.inc.php index 667d3542ce..72d8f8d4e7 100755 --- a/manager/actions/resources/tab2_templatevars.inc.php +++ b/manager/actions/resources/tab2_templatevars.inc.php @@ -1,11 +1,10 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (isset($resources->items['site_tmplvars'])) { - ?> +if (isset($resources->items['site_tmplvars'])) { ?>

    @@ -41,5 +40,4 @@ initViews('tv', 'tv', 'site_tmplvars')
    - + diff --git a/manager/actions/resources/tab3_chunks.inc.php b/manager/actions/resources/tab3_chunks.inc.php index fda510755b..6183b1afb9 100755 --- a/manager/actions/resources/tab3_chunks.inc.php +++ b/manager/actions/resources/tab3_chunks.inc.php @@ -1,11 +1,10 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (isset($resources->items['site_htmlsnippets'])) { - ?> +if (isset($resources->items['site_htmlsnippets'])) { ?>

    @@ -37,5 +36,4 @@ initViews('ch', 'chunks', 'site_htmlsnippets')
    - + diff --git a/manager/actions/resources/tab4_snippets.inc.php b/manager/actions/resources/tab4_snippets.inc.php index 68190d5948..921b4e4089 100755 --- a/manager/actions/resources/tab4_snippets.inc.php +++ b/manager/actions/resources/tab4_snippets.inc.php @@ -1,11 +1,10 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (isset($resources->items['site_snippets'])) { - ?> +if (isset($resources->items['site_snippets'])) { ?>

    @@ -37,5 +36,4 @@ initViews('sn', 'snippets', 'site_snippets')
    - + diff --git a/manager/actions/resources/tab5_plugins.inc.php b/manager/actions/resources/tab5_plugins.inc.php index 198deb4aac..b07db5ab55 100755 --- a/manager/actions/resources/tab5_plugins.inc.php +++ b/manager/actions/resources/tab5_plugins.inc.php @@ -1,11 +1,10 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (isset($resources->items['site_plugins'])) { - ?> +if (isset($resources->items['site_plugins'])) { ?>

    @@ -20,21 +19,16 @@
    - hasPermission('new_plugin')) { - ?> + hasPermission('new_plugin')) { ?> "> - - hasPermission('save_plugin')) { - ?> + + hasPermission('save_plugin')) { ?> "> - + hasPermission('delete_plugin') && $_SESSION['mgrRole'] == 1) { $tbl_site_plugins = $modx->getFullTableName('site_plugins'); - if ($modx->db->getRecordCount($modx->db->query("SELECT id FROM {$tbl_site_plugins} t1 WHERE disabled = 1 AND name IN (SELECT name FROM {$tbl_site_plugins} t2 WHERE t1.name = t2.name AND t1.id != t2.id)"))) { - ?> + if ($modx->db->getRecordCount($modx->db->query("SELECT id FROM {$tbl_site_plugins} t1 WHERE disabled = 1 AND name IN (SELECT name FROM {$tbl_site_plugins} t2 WHERE t1.name = t2.name AND t1.id != t2.id)"))) { ?>
    - + diff --git a/manager/actions/resources/tab6_categoryview.inc.php b/manager/actions/resources/tab6_categoryview.inc.php index 9c7263ad9f..2f118d79d9 100755 --- a/manager/actions/resources/tab6_categoryview.inc.php +++ b/manager/actions/resources/tab6_categoryview.inc.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } ?> diff --git a/manager/actions/role_management.static.php b/manager/actions/role_management.static.php index 41504d52a6..bd6adb1dce 100755 --- a/manager/actions/role_management.static.php +++ b/manager/actions/role_management.static.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('edit_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('edit_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } ?> @@ -18,14 +18,14 @@
    db->select('name, id, description', $modx->getFullTableName('user_roles'), '', 'name'); - $limit = $modx->db->getRecordCount($rs); - if ($limit < 1) { - ?> + $rs = $modx->db->select('name, id, description', $modx->getFullTableName('user_roles'), '', 'name'); + $limit = $modx->db->getRecordCount($rs); + if($limit < 1) { + ?>

    + } else { + ?>
    @@ -37,29 +37,29 @@ db->getRow($rs)) { - if ($row['id'] == 1) { - ?> + while($row = $modx->db->getRow($rs)) { + if($row['id'] == 1) { + ?> + } else { + ?> + } + } + ?>
    - +
    diff --git a/manager/actions/search.static.php b/manager/actions/search.static.php index e640556c4d..86f76bafcd 100755 --- a/manager/actions/search.static.php +++ b/manager/actions/search.static.php @@ -1,5 +1,5 @@ getFullTableName('site_tmplvar_contentvalues'); - $articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'"; - $articul_result = $modx->db->query($articul_query); - $articul_id_array = $modx->db->makeArray($articul_result); - if (count($articul_id_array)>0) { - $articul_id = ''; - $i = 1; - foreach ($articul_id_array as $articul) { - $articul_id.=$articul['contentid']; - if ($i !== count($articul_id_array)) { - $articul_id.=','; - } - $i++; - } - $articul_id_query = " OR sc.id IN ({$articul_id})"; - } else { - $articul_id_query = ''; - } - /*end search by TV*/ + /*start search by TV. Added Rising13*/ + $tbl_site_tmplvar_contentvalues = $modx->getFullTableName('site_tmplvar_contentvalues'); + $articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'"; + $articul_result = $modx->db->query($articul_query); + $articul_id_array = $modx->db->makeArray($articul_result); + if(count($articul_id_array)>0){ + $articul_id = ''; + $i = 1; + foreach( $articul_id_array as $articul ) { + $articul_id.=$articul['contentid']; + if($i !== count($articul_id_array)){ + $articul_id.=','; + } + $i++; + } + $articul_id_query = " OR sc.id IN ({$articul_id})"; + }else{ + $articul_id_query = ''; + } + /*end search by TV*/ if (ctype_digit($searchfields)) { $sqladd .= "sc.id='{$searchfields}'"; if (strlen($searchfields) > 3) { - $sqladd .= $articul_id_query;//search by TV + $sqladd .= $articul_id_query;//search by TV $sqladd .= " OR sc.pagetitle LIKE '%{$searchfields}%'"; } } if ($idFromAlias) { $sqladd .= $sqladd != '' ? ' OR ' : ''; $sqladd .= "sc.id='{$idFromAlias}'"; + } $sqladd = $sqladd ? "({$sqladd})" : $sqladd; @@ -159,7 +160,7 @@ $sqladd .= $articul_id_query;//search by TV $sqladd .= ")"; } - } elseif ($idFromAlias) { + } else if ($idFromAlias) { $sqladd .= " sc.id='{$idFromAlias}'"; } @@ -178,7 +179,7 @@ // get document groups for current user if (!empty($modx->config['use_udperms']) && $sqladd) { $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; - $mgrRole = (isset($_SESSION['mgrRole']) && $_SESSION['mgrRole'] == 1) ? 1 : 0; + $mgrRole = (isset ($_SESSION['mgrRole']) && $_SESSION['mgrRole'] == 1) ? 1 : 0; $docgrp_cond = $docgrp ? " OR dg.document_group IN ({$docgrp})" : ''; $fields .= ', MAX(IF(1=' . $mgrRole . ' OR sc.privatemgr=0' . $docgrp_cond . ',1,0)) AS hasAccess'; $sqladd = '(' . $sqladd . ") AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); @@ -195,7 +196,9 @@ $limit = $modx->db->getRecordCount($rs); } else { $limit = 0; - } ?> + } + + ?> @@ -204,10 +207,12 @@
    ' . $_lang['search_results_returned_msg'] . '

    ', $limit); ?> + printf('

    ' . $_lang['search_results_returned_msg'] . '

    ', $limit); + ?> @@ -237,24 +242,25 @@ 'image/png' => $_style["tree_page_png"] ); - while ($row = $modx->db->getRow($rs)) { - // figure out the icon for the document... - $icon = ""; - if ($row['type'] == 'reference') { - $icon .= $_style["tree_linkgo"]; - } elseif ($row['isfolder'] == 0) { - $icon .= isset($icons[$row['contenttype']]) ? $icons[$row['contenttype']] : $_style["tree_page_html"]; - } else { - $icon .= $_style['tree_folder_new']; - } - - $tdClass = ""; - if ($row['published'] == 0) { - $tdClass .= ' class="unpublishedNode"'; - } - if ($row['deleted'] == 1) { - $tdClass .= ' class="deletedNode"'; - } ?> + while ($row = $modx->db->getRow($rs)) { + // figure out the icon for the document... + $icon = ""; + if ($row['type'] == 'reference') { + $icon .= $_style["tree_linkgo"]; + } elseif ($row['isfolder'] == 0) { + $icon .= isset($icons[$row['contenttype']]) ? $icons[$row['contenttype']] : $_style["tree_page_html"]; + } else { + $icon .= $_style['tree_folder_new']; + } + + $tdClass = ""; + if ($row['published'] == 0) { + $tdClass .= ' class="unpublishedNode"'; + } + if ($row['deleted'] == 1) { + $tdClass .= ' class="deletedNode"'; + } + ?> > 35 ? substr($row['description'], 0, 35) . '...' : $row['description'] ?> + } + ?> + } + ?>
    @@ -274,13 +280,16 @@ > 20 ? substr($row['pagetitle'], 0, 20) . '...' : $row['pagetitle'] ?>
      ' . $output . '
    ' : '1'; - } ?> + } + + ?> INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('view_eventlog')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('view_eventlog')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } ?> @@ -17,14 +17,14 @@
    db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC'); - $limit = $modx->db->getRecordCount($rs); - if ($limit < 1) { - ?> + $rs = $modx->db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC'); + $limit = $modx->db->getRecordCount($rs); + if($limit < 1) { + ?>

    + } else { + ?>
    @@ -36,33 +36,34 @@ db->getRow($rs)) { - ?> + while($row = $modx->db->getRow($rs)) { + ?> + } + ?>
    toDateFormat($row['pub_date'] + $server_offset_time) ?>
    + } + ?>
    db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC'); - $limit = $modx->db->getRecordCount($rs); - if ($limit < 1) { - ?> + $rs = $modx->db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC'); + $limit = $modx->db->getRecordCount($rs); + if($limit < 1) { + ?>

    + } else { + ?>
    @@ -74,33 +75,34 @@ db->getRow($rs)) { - ?> + while($row = $modx->db->getRow($rs)) { + ?> + } + ?>
    toDateFormat($row['unpub_date'] + $server_offset_time) ?>
    + } + ?>
    db->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC"); - $limit = $modx->db->getRecordCount($rs); - if ($limit < 1) { - ?> + $rs = $modx->db->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC"); + $limit = $modx->db->getRecordCount($rs); + if($limit < 1) { + ?>

    + } else { + ?>
    @@ -113,8 +115,8 @@ db->getRow($rs)) { - ?> + while($row = $modx->db->getRow($rs)) { + ?> @@ -122,13 +124,14 @@ + } + ?>
    toDateFormat($row['unpub_date'] + $server_offset_time) ?>
    + } + ?>
    diff --git a/manager/actions/sysinfo.static.php b/manager/actions/sysinfo.static.php index a12908da6d..6ac4cab6fd 100755 --- a/manager/actions/sysinfo.static.php +++ b/manager/actions/sysinfo.static.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('logs')) { @@ -110,19 +110,20 @@ function viewPHPInfo() $modx->db->config['table_prefix'] . 'event_log', $modx->db->config['table_prefix'] . 'manager_log', ); - if ($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) { - echo ""; - echo "" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . ""; - echo ""; - } else { - echo "" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . ""; - } + if ($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) { + echo ""; + echo "" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . ""; + echo ""; + } else { + echo "" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . ""; + } - if ($modx->hasPermission('settings')) { - echo "" . ($log_status['Data_free'] > 0 ? "" . $modx->nicesize($log_status['Data_free']) . "" : "-") . ""; - } else { - echo "" . ($log_status['Data_free'] > 0 ? $modx->nicesize($log_status['Data_free']) : "-") . ""; - } ?> + if ($modx->hasPermission('settings')) { + echo "" . ($log_status['Data_free'] > 0 ? "" . $modx->nicesize($log_status['Data_free']) . "" : "-") . ""; + } else { + echo "" . ($log_status['Data_free'] > 0 ? $modx->nicesize($log_status['Data_free']) : "-") . ""; + } + ?> nicesize($log_status['Data_length'] - $log_status['Data_free']) ?> nicesize($log_status['Index_length']) ?> nicesize($log_status['Index_length'] + $log_status['Data_length'] + $log_status['Data_free']) ?> @@ -143,11 +144,9 @@ function viewPHPInfo() - 0) { - ?> + 0) { ?>

    - + diff --git a/manager/actions/user_management.static.php b/manager/actions/user_management.static.php index 4e26c6b077..8402d14429 100755 --- a/manager/actions/user_management.static.php +++ b/manager/actions/user_management.static.php @@ -1,22 +1,22 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('edit_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('edit_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // initialize page view state - the $_PAGE object $modx->manager->initPageViewState(); // get and save search string -if ($_REQUEST['op'] == 'reset') { - $query = ''; - $_PAGE['vs']['search'] = ''; +if($_REQUEST['op'] == 'reset') { + $query = ''; + $_PAGE['vs']['search'] = ''; } else { - $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; - $sqlQuery = $modx->db->escape($query); - $_PAGE['vs']['search'] = $query; + $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; + $sqlQuery = $modx->db->escape($query); + $_PAGE['vs']['search'] = $query; } // get & save listmode @@ -120,55 +120,55 @@ function menuAction(a) {
    hasPermission('save_role')) { - $where .= (empty($where) ? "" : " AND ") . "mua.role != 1"; - } - if (!empty($sqlQuery)) { - $where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))"; - } - $ds = $modx->db->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, ELT(mua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin", $modx->getFullTableName('manager_users') . " AS mu + $where = ""; + if(!$modx->hasPermission('save_role')) { + $where .= (empty($where) ? "" : " AND ") . "mua.role != 1"; + } + if(!empty($sqlQuery)) { + $where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))"; + } + $ds = $modx->db->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, ELT(mua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin", $modx->getFullTableName('manager_users') . " AS mu INNER JOIN " . $modx->getFullTableName('user_attributes') . " AS mua ON mua.internalKey=mu.id LEFT JOIN " . $modx->getFullTableName('user_roles') . " AS rname ON mua.role=rname.id", $where, 'mua.blocked ASC, mua.thislogin DESC'); - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items - $grd->noRecordMsg = $_lang["no_records_found"]; - $grd->cssClass = "table data"; - $grd->columnHeaderClass = "tableHeader"; - $grd->itemClass = "tableItem"; - $grd->altItemClass = "tableAltItem"; - $grd->fields = "id,username,fullname,role,email,gender,blocked,thislogin"; - $grd->columns = implode(',', array( - $_lang["icon"], - $_lang["name"], - $_lang["user_full_name"], - $_lang['role'], - $_lang["email"], - $_lang["user_gender"], - $_lang["user_block"], - $_lang["login_button"] - )); - $grd->colWidths = "1%,,,,,,1%,1%"; - $grd->colAligns = "center,,,,,center,center,right' nowrap='nowrap"; - $grd->colTypes = implode('||', array( - 'template:', - 'template:[+value+]', - 'template:[+fullname+]', - 'template:[+role+]', - 'template:[+email+]', - 'template:[+gender+]', - 'template:[+blocked+]', - 'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M' - )); - if ($listmode == '1') { - $grd->pageSize = 0; - } - if ($_REQUEST['op'] == 'reset') { - $grd->pageNumber = 1; - } - // render grid - echo $grd->render(); - ?> + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items + $grd->noRecordMsg = $_lang["no_records_found"]; + $grd->cssClass = "table data"; + $grd->columnHeaderClass = "tableHeader"; + $grd->itemClass = "tableItem"; + $grd->altItemClass = "tableAltItem"; + $grd->fields = "id,username,fullname,role,email,gender,blocked,thislogin"; + $grd->columns = implode(',', array( + $_lang["icon"], + $_lang["name"], + $_lang["user_full_name"], + $_lang['role'], + $_lang["email"], + $_lang["user_gender"], + $_lang["user_block"], + $_lang["login_button"] + )); + $grd->colWidths = "1%,,,,,,1%,1%"; + $grd->colAligns = "center,,,,,center,center,right' nowrap='nowrap"; + $grd->colTypes = implode('||', array( + 'template:', + 'template:[+value+]', + 'template:[+fullname+]', + 'template:[+role+]', + 'template:[+email+]', + 'template:[+gender+]', + 'template:[+blocked+]', + 'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M' + )); + if($listmode == '1') { + $grd->pageSize = 0; + } + if($_REQUEST['op'] == 'reset') { + $grd->pageNumber = 1; + } + // render grid + echo $grd->render(); + ?>
    diff --git a/manager/actions/web_access_permissions.dynamic.php b/manager/actions/web_access_permissions.dynamic.php index 4c0659b4f7..38e71fd698 100755 --- a/manager/actions/web_access_permissions.dynamic.php +++ b/manager/actions/web_access_permissions.dynamic.php @@ -1,32 +1,32 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('web_access_permissions')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('web_access_permissions')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // find all document groups, for the select :) $rs = $modx->db->select('*', $modx->getFullTableName('documentgroup_names'), '', 'name'); -if ($modx->db->getRecordCount($rs) < 1) { - $docgroupselector = "[no groups to add]"; +if($modx->db->getRecordCount($rs) < 1) { + $docgroupselector = "[no groups to add]"; } else { - $docgroupselector = '\n"; + $docgroupselector = '\n"; } $rs = $modx->db->select('*', $modx->getFullTableName('webgroup_names'), '', 'name'); -if ($modx->db->getRecordCount($rs) < 1) { - $usrgroupselector = '[no user groups]'; +if($modx->db->getRecordCount($rs) < 1) { + $usrgroupselector = '[no user groups]'; } else { - $usrgroupselector = '\n"; + $usrgroupselector = '\n"; } ?> @@ -88,23 +88,24 @@ function deletegroup(groupid, type) {
    db->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getFullTableName('webgroup_names') . " AS groupnames + $rs = $modx->db->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getFullTableName('webgroup_names') . " AS groupnames LEFT JOIN " . $modx->getFullTableName('web_groups') . " AS groups ON groups.webgroup = groupnames.id LEFT JOIN " . $modx->getFullTableName('web_users') . " AS users ON users.id = groups.webuser", '', 'groupnames.name, user_name'); - if ($modx->db->getRecordCount($rs) < 1) { - ?> + if($modx->db->getRecordCount($rs) < 1) { + ?>
    + } else { + ?>
    db->getRow($rs)) { - if ($pid != $row['id']) { - if ($pid != '') { - echo '
    '; - } ?> + $pid = ''; + while($row = $modx->db->getRow($rs)) { + if($pid != $row['id']) { + if($pid != '') { + echo '
    '; + } + ?>
    @@ -119,20 +120,21 @@ function deletegroup(groupid, type) {
    + } + if(!$row['user_id']) { + ?> + $pid = $row['id']; + continue; + } + ?> + $pid = $row['id']; + } + } + ?>
    @@ -157,23 +159,24 @@ function deletegroup(groupid, type) { db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getFullTableName('documentgroup_names') . " AS dgnames + $rs = $modx->db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getFullTableName('documentgroup_names') . " AS dgnames LEFT JOIN " . $modx->getFullTableName('document_groups') . " AS dg ON dg.document_group = dgnames.id LEFT JOIN " . $modx->getFullTableName('site_content') . " AS sc ON sc.id = dg.document", '', 'dgnames.name, sc.id'); - if ($modx->db->getRecordCount($rs) < 1) { - ?> + if($modx->db->getRecordCount($rs) < 1) { + ?>
    + } else { + ?>
    db->getRow($rs)) { - if ($pid != $row['id']) { - if ($pid != '') { - echo '
    '; - } ?> + $pid = ''; + while($row = $modx->db->getRow($rs)) { + if($pid != $row['id']) { + if($pid != '') { + echo '
    '; + } + ?>
    @@ -188,20 +191,21 @@ function deletegroup(groupid, type) {
    + } + if(!$row['doc_id']) { + ?> + $pid = $row['id']; + continue; + } + ?> + $pid = $row['id']; + } + } + ?>
    @@ -213,15 +217,15 @@ function deletegroup(groupid, type) {

    db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getFullTableName('webgroup_names') . " AS groupnames + $rs = $modx->db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getFullTableName('webgroup_names') . " AS groupnames LEFT JOIN " . $modx->getFullTableName('webgroup_access') . " AS groupacc ON groupacc.webgroup = groupnames.id LEFT JOIN " . $modx->getFullTableName('documentgroup_names') . " AS dgnames ON dgnames.id = groupacc.documentgroup", '', 'name, dg_name'); - if ($modx->db->getRecordCount($rs) < 1) { - ?> + if($modx->db->getRecordCount($rs) < 1) { + ?>
    + } else { + ?>
    @@ -237,35 +241,38 @@ function deletegroup(groupid, type) {
      db->getRow($rs)) { - if ($row['id'] != $pid) { - if ($pid != '') { - echo '
    '; - } // close previous one ?> + $pid = ''; + while($row = $modx->db->getRow($rs)) { + if($row['id'] != $pid) { + if($pid != '') { + echo ''; + } // close previous one + ?>
  • ' . $_lang['no_groups_found'] . ''; - $pid = ''; - continue; - } else { - echo '
      '; - } - } - if (!$row['dg_id']) { - continue; - } ?> + if(!$row['dg_id']) { + echo '' . $_lang['no_groups_found'] . ''; + $pid = ''; + continue; + } else { + echo '
        '; + } + } + if(!$row['dg_id']) { + continue; + } + ?>
      • ()
      • + $pid = $row['id']; + } + ?>
      + } + ?>
    diff --git a/manager/actions/web_user_management.static.php b/manager/actions/web_user_management.static.php index 9eba4565b5..013a88a38d 100755 --- a/manager/actions/web_user_management.static.php +++ b/manager/actions/web_user_management.static.php @@ -1,22 +1,22 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('edit_web_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('edit_web_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // initialize page view state - the $_PAGE object $modx->manager->initPageViewState(); // get and save search string -if ($_REQUEST['op'] == 'reset') { - $query = ''; - $_PAGE['vs']['search'] = ''; +if($_REQUEST['op'] == 'reset') { + $query = ''; + $_PAGE['vs']['search'] = ''; } else { - $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; - $sqlQuery = $modx->db->escape($query); - $_PAGE['vs']['search'] = $query; + $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; + $sqlQuery = $modx->db->escape($query); + $_PAGE['vs']['search'] = $query; } // get & save listmode @@ -120,29 +120,29 @@ function menuAction(a) {
    db->select("wu.id, wu.username, wua.fullname, wua.email, ELT(wua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu + $ds = $modx->db->select("wu.id, wu.username, wua.fullname, wua.email, ELT(wua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu INNER JOIN " . $modx->getFullTableName("web_user_attributes") . " wua ON wua.internalKey=wu.id", ($sqlQuery ? "(wu.username LIKE '{$sqlQuery}%') OR (wua.fullname LIKE '%{$sqlQuery}%') OR (wua.email LIKE '%{$sqlQuery}%')" : ""), 'username'); - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items - $grd->noRecordMsg = $_lang["no_records_found"]; - $grd->cssClass = "table data"; - $grd->columnHeaderClass = "tableHeader"; - $grd->itemClass = "tableItem"; - $grd->altItemClass = "tableAltItem"; - $grd->fields = "id,username,fullname,email,gender,blocked"; - $grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["user_full_name"] . " ," . $_lang["email"] . " ," . $_lang["user_gender"] . " ," . $_lang["user_block"]; - $grd->colWidths = "1%,,,,1%,1%"; - $grd->colAligns = "center,,,,center,right' nowrap='nowrap"; - $grd->colTypes = "template:||template:[+value+]"; - if ($listmode == '1') { - $grd->pageSize = 0; - } - if ($_REQUEST['op'] == 'reset') { - $grd->pageNumber = 1; - } - // render grid - echo $grd->render(); - ?> + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items + $grd->noRecordMsg = $_lang["no_records_found"]; + $grd->cssClass = "table data"; + $grd->columnHeaderClass = "tableHeader"; + $grd->itemClass = "tableItem"; + $grd->altItemClass = "tableAltItem"; + $grd->fields = "id,username,fullname,email,gender,blocked"; + $grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["user_full_name"] . " ," . $_lang["email"] . " ," . $_lang["user_gender"] . " ," . $_lang["user_block"]; + $grd->colWidths = "1%,,,,1%,1%"; + $grd->colAligns = "center,,,,center,right' nowrap='nowrap"; + $grd->colTypes = "template:||template:[+value+]"; + if($listmode == '1') { + $grd->pageSize = 0; + } + if($_REQUEST['op'] == 'reset') { + $grd->pageNumber = 1; + } + // render grid + echo $grd->render(); + ?>
    diff --git a/manager/actions/welcome.static.php b/manager/actions/welcome.static.php index 4c657f8c59..f36d7f58c2 100755 --- a/manager/actions/welcome.static.php +++ b/manager/actions/welcome.static.php @@ -1,13 +1,13 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly.'); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die('INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly.'); } unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes -if ($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) { - // seems to be a new install - send the user to the configuration page - exit(''); +if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) { + // seems to be a new install - send the user to the configuration page + exit(''); } // set placeholders @@ -16,93 +16,93 @@ $_SESSION['nrnewmessages'] = 0; // setup message info -if ($modx->hasPermission('messages')) { - include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); - $_SESSION['nrtotalmessages'] = $nrtotalmessages; - $_SESSION['nrnewmessages'] = $nrnewmessages; - - $msg = array(); - $msg[] = sprintf('', $_style['icons_mail_large']); - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (' . $_SESSION['nrnewmessages'] . ')' : ''; - $msg[] = sprintf(' [%%inbox%%]%s
    ', $nrnewmessages); - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '' . $_SESSION['nrnewmessages'] . '' : '0'; - $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); - $msg[] = sprintf('%s', $welcome_messages); - $ph['MessageInfo'] = implode("\n", $msg); +if($modx->hasPermission('messages')) { + include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); + $_SESSION['nrtotalmessages'] = $nrtotalmessages; + $_SESSION['nrnewmessages'] = $nrnewmessages; + + $msg = array(); + $msg[] = sprintf('', $_style['icons_mail_large']); + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (' . $_SESSION['nrnewmessages'] . ')' : ''; + $msg[] = sprintf(' [%%inbox%%]%s
    ', $nrnewmessages); + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '' . $_SESSION['nrnewmessages'] . '' : '0'; + $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); + $msg[] = sprintf('%s', $welcome_messages); + $ph['MessageInfo'] = implode("\n", $msg); } // setup icons -if ($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { - $icon = ' [%user_management_title%]'; - $ph['SecurityIcon'] = wrapIcon($icon, 75); +if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { + $icon = ' [%user_management_title%]'; + $ph['SecurityIcon'] = wrapIcon($icon, 75); } -if ($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { - $icon = ' [%web_user_management_title%]'; - $ph['WebUserIcon'] = wrapIcon($icon, 99); +if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { + $icon = ' [%web_user_management_title%]'; + $ph['WebUserIcon'] = wrapIcon($icon, 99); } -if ($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { - $icon = ' [%modules%]'; - $ph['ModulesIcon'] = wrapIcon($icon, 106); +if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { + $icon = ' [%modules%]'; + $ph['ModulesIcon'] = wrapIcon($icon, 106); } -if ($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) { - $icon = ' [%elements%]'; - $ph['ResourcesIcon'] = wrapIcon($icon, 76); +if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) { + $icon = ' [%elements%]'; + $ph['ResourcesIcon'] = wrapIcon($icon, 76); } -if ($modx->hasPermission('bk_manager')) { - $icon = ' [%backup%]'; - $ph['BackupIcon'] = wrapIcon($icon, 93); +if($modx->hasPermission('bk_manager')) { + $icon = ' [%backup%]'; + $ph['BackupIcon'] = wrapIcon($icon, 93); } -if ($modx->hasPermission('help')) { - $icon = ' [%help%]'; - $ph['HelpIcon'] = wrapIcon($icon, 9); +if($modx->hasPermission('help')) { + $icon = ' [%help%]'; + $ph['HelpIcon'] = wrapIcon($icon, 9); } -if ($modx->hasPermission('new_document')) { - $icon = '[%add_resource%]'; - $ph['ResourceIcon'] = wrapIcon($icon, 4); - $icon = '[%add_weblink%]'; - $ph['WeblinkIcon'] = wrapIcon($icon, 72); +if($modx->hasPermission('new_document')) { + $icon = '[%add_resource%]'; + $ph['ResourceIcon'] = wrapIcon($icon, 4); + $icon = '[%add_weblink%]'; + $ph['WeblinkIcon'] = wrapIcon($icon, 72); } -if ($modx->hasPermission('assets_images')) { - $icon = '[%images_management%]'; - $ph['ImagesIcon'] = wrapIcon($icon, 72); +if($modx->hasPermission('assets_images')) { + $icon = '[%images_management%]'; + $ph['ImagesIcon'] = wrapIcon($icon, 72); } -if ($modx->hasPermission('assets_files')) { - $icon = '[%files_management%]'; - $ph['FilesIcon'] = wrapIcon($icon, 72); +if($modx->hasPermission('assets_files')) { + $icon = '[%files_management%]'; + $ph['FilesIcon'] = wrapIcon($icon, 72); } -if ($modx->hasPermission('change_password')) { - $icon = '[%change_password%]'; - $ph['PasswordIcon'] = wrapIcon($icon, 28); +if($modx->hasPermission('change_password')) { + $icon = '[%change_password%]'; + $ph['PasswordIcon'] = wrapIcon($icon, 28); } $icon = '[%logout%]'; $ph['LogoutIcon'] = wrapIcon($icon, 8); // do some config checks -if (($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { - include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); - if ($config_check_results != $_lang['configcheck_ok']) { - $ph['config_check_results'] = $config_check_results; - $ph['config_display'] = 'block'; - } else { - $ph['config_display'] = 'none'; - } +if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { + include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); + if($config_check_results != $_lang['configcheck_ok']) { + $ph['config_check_results'] = $config_check_results; + $ph['config_display'] = 'block'; + } else { + $ph['config_display'] = 'none'; + } } else { - $ph['config_display'] = 'none'; + $ph['config_display'] = 'none'; } // Check logout-reminder -if (isset($_SESSION['show_logout_reminder'])) { - switch ($_SESSION['show_logout_reminder']['type']) { - case 'logout_reminder': - $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); - $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']); - break; - } - $ph['show_logout_reminder'] = 'block'; - unset($_SESSION['show_logout_reminder']); +if(isset($_SESSION['show_logout_reminder'])) { + switch($_SESSION['show_logout_reminder']['type']) { + case 'logout_reminder': + $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); + $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']); + break; + } + $ph['show_logout_reminder'] = 'block'; + unset($_SESSION['show_logout_reminder']); } else { - $ph['show_logout_reminder'] = 'none'; + $ph['show_logout_reminder'] = 'none'; } // Check multiple sessions @@ -111,13 +111,13 @@ //$count = $modx->db->getValue($rs); /* if($count > 1) { - $ph['multiple_sessions_msg'] = $modx->parseText($_lang['multiple_sessions_msg'], array( - 'username' => $_SESSION['mgrShortname'], - 'total' => $count - )); - $ph['show_multiple_sessions'] = 'block'; + $ph['multiple_sessions_msg'] = $modx->parseText($_lang['multiple_sessions_msg'], array( + 'username' => $_SESSION['mgrShortname'], + 'total' => $count + )); + $ph['show_multiple_sessions'] = 'block'; } else { - $ph['show_multiple_sessions'] = 'none'; + $ph['show_multiple_sessions'] = 'none'; }*/ $ph['show_multiple_sessions'] = 'none'; @@ -150,11 +150,11 @@ $nrnewmessages = '' . $_SESSION['nrnewmessages'] . ''; $ph['UserInfo'] = $modx->parseText($tpl, array( - 'username' => $modx->getLoginUserName(), - 'role' => $_SESSION['mgrPermissions']['name'], - 'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time), - 'logincount' => $_SESSION['mgrLogincount'] + 1, - 'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages) + 'username' => $modx->getLoginUserName(), + 'role' => $_SESSION['mgrPermissions']['name'], + 'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time), + 'logincount' => $_SESSION['mgrLogincount'] + 1, + 'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages) )); $from = array(); @@ -162,14 +162,14 @@ $from[] = " us LEFT JOIN [+prefix+]active_users au ON au.sid=us.sid WHERE au.action <> '8'"; $rs = $modx->db->select('*', $from, '', 'username ASC, au.sid ASC'); -if ($modx->db->getRecordCount($rs) < 1) { - $html = '

    [%no_active_users_found%]

    '; +if($modx->db->getRecordCount($rs) < 1) { + $html = '

    [%no_active_users_found%]

    '; } else { - include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); - $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; - $ph['now'] = strftime('%H:%M:%S', $now); - $timetocheck = ($now - (60 * 20)); //+$server_offset_time; - $html = ' + include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); + $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; + $ph['now'] = strftime('%H:%M:%S', $now); + $timetocheck = ($now - (60 * 20)); //+$server_offset_time; + $html = '
    [%onlineusers_message%] [+now+]): @@ -187,33 +187,33 @@ '; - $userList = array(); - $userCount = array(); - // Create userlist with session-count first before output - while ($activeusers = $modx->db->getRow($rs)) { - $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; - - $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; - $webicon = $activeusers['internalKey'] < 0 ? 'Web user ' : ''; - $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip']; - $currentaction = getAction($activeusers['action'], $activeusers['id']); - $userList[] = array( - $idle, - '', - $activeusers['username'], - $webicon, - abs($activeusers['internalKey']), - $ip, - strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time), - $currentaction - ); - } - foreach ($userList as $params) { - $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; - $html .= "\n\t\t" . vsprintf('%s%s%s%s%s%s', $params); - } - - $html .= ' + $userList = array(); + $userCount = array(); + // Create userlist with session-count first before output + while($activeusers = $modx->db->getRow($rs)) { + $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; + + $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; + $webicon = $activeusers['internalKey'] < 0 ? 'Web user ' : ''; + $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip']; + $currentaction = getAction($activeusers['action'], $activeusers['id']); + $userList[] = array( + $idle, + '', + $activeusers['username'], + $webicon, + abs($activeusers['internalKey']), + $ip, + strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time), + $currentaction + ); + } + foreach($userList as $params) { + $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; + $html .= "\n\t\t" . vsprintf('%s%s%s%s%s%s', $params); + } + + $html .= '
    @@ -253,18 +253,18 @@ // invoke event OnManagerWelcomePrerender $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender'); -if (is_array($evtOut)) { - $output = implode('', $evtOut); - $ph['OnManagerWelcomePrerender'] = $output; +if(is_array($evtOut)) { + $output = implode('', $evtOut); + $ph['OnManagerWelcomePrerender'] = $output; } $widgets['welcome'] = array( - 'menuindex' => '10', - 'id' => 'welcome', - 'cols' => 'col-lg-6', - 'icon' => 'fa-home', - 'title' => '[%welcome_title%]', - 'body' => ' + 'menuindex' => '10', + 'id' => 'welcome', + 'cols' => 'col-lg-6', + 'icon' => 'fa-home', + 'title' => '[%welcome_title%]', + 'body' => '
    @@ -338,25 +338,25 @@
    ', - 'hide'=>'0' + 'hide'=>'0' ); $widgets['onlineinfo'] = array( - 'menuindex' => '20', - 'id' => 'onlineinfo', - 'cols' => 'col-lg-6', - 'icon' => 'fa-user', - 'title' => '[%onlineusers_title%]', - 'body' => '
    [+OnlineInfo+]
    ', - 'hide'=>'0' + 'menuindex' => '20', + 'id' => 'onlineinfo', + 'cols' => 'col-lg-6', + 'icon' => 'fa-user', + 'title' => '[%onlineusers_title%]', + 'body' => '
    [+OnlineInfo+]
    ', + 'hide'=>'0' ); $widgets['recentinfo'] = array( - 'menuindex' => '30', - 'id' => 'modxrecent_widget', - 'cols' => 'col-sm-12', - 'icon' => 'fa-pencil-square-o', - 'title' => '[%activity_title%]', - 'body' => '
    [+RecentInfo+]
    ', - 'hide'=>'0' + 'menuindex' => '30', + 'id' => 'modxrecent_widget', + 'cols' => 'col-sm-12', + 'icon' => 'fa-pencil-square-o', + 'title' => '[%activity_title%]', + 'body' => '
    [+RecentInfo+]
    ', + 'hide'=>'0' ); if ($modx->config['rss_url_news']) { $widgets['news'] = array( @@ -383,75 +383,75 @@ // invoke OnManagerWelcomeHome event $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets)); -if (is_array($sitewidgets)) { - $newwidgets = array(); - foreach ($sitewidgets as $widget) { +if(is_array($sitewidgets)) { + $newwidgets = array(); + foreach($sitewidgets as $widget){ $newwidgets = array_merge($newwidgets, unserialize($widget)); } $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets; } usort($widgets, function ($a, $b) { - return $a['menuindex'] - $b['menuindex']; + return $a['menuindex'] - $b['menuindex']; }); $tpl = getTplWidget(); $output = ''; -foreach ($widgets as $widget) { - if ($widget['hide'] != '1') { - $output .= $modx->parseText($tpl, $widget); - } +foreach($widgets as $widget) { + if ($widget['hide'] != '1'){ + $output .= $modx->parseText($tpl, $widget); + } } $ph['widgets'] = $output; // load template -if (!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { - $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; +if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { + $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; } $target = $modx->config['manager_welcome_tpl']; $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target); $target = $modx->mergeSettingsContent($target); -if (substr($target, 0, 1) === '@') { - if (substr($target, 0, 6) === '@CHUNK') { - $content = $modx->getChunk(trim(substr($target, 7))); - } elseif (substr($target, 0, 5) === '@FILE') { - $content = file_get_contents(trim(substr($target, 6))); - } else { - $content = ''; - } +if(substr($target, 0, 1) === '@') { + if(substr($target, 0, 6) === '@CHUNK') { + $content = $modx->getChunk(trim(substr($target, 7))); + } elseif(substr($target, 0, 5) === '@FILE') { + $content = file_get_contents(trim(substr($target, 6))); + } else { + $content = ''; + } } else { - $chunk = $modx->getChunk($target); - if ($chunk !== false && !empty($chunk)) { - $content = $chunk; - } elseif (is_file(MODX_BASE_PATH . $target)) { - $content = file_get_contents(MODX_BASE_PATH . $target); - } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); - } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) { // ClipperCMS compatible - - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); - } else { - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); - } + $chunk = $modx->getChunk($target); + if($chunk !== false && !empty($chunk)) { + $content = $chunk; + } elseif(is_file(MODX_BASE_PATH . $target)) { + $content = file_get_contents(MODX_BASE_PATH . $target); + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible + { + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); + } else { + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); + } } // merge placeholders $content = $modx->mergeConditionalTagsContent($content); $content = $modx->mergeSettingsContent($content); $content = $modx->parseText($content, $ph); -if (strpos($content, '[+') !== false) { - $modx->toPlaceholders($ph); - $content = $modx->mergePlaceholderContent($content); +if(strpos($content, '[+') !== false) { + $modx->toPlaceholders($ph); + $content = $modx->mergePlaceholderContent($content); } $content = $modx->parseDocumentSource($content); $content = $modx->parseText($content, $_lang, '[%', '%]'); $content = $modx->parseText($content, $_style, '[&', '&]'); $content = $modx->cleanUpMODXTags($content); //cleanup -if ($js = $modx->getRegisteredClientScripts()) { - $content .= $js; +if($js = $modx->getRegisteredClientScripts()) { + $content .= $js; } echo $content; @@ -460,9 +460,8 @@ // // // -function getTplWidget() -{ // recent document info - return ' +function getTplWidget() { // recent document info + return '
    [+title+]
    @@ -472,13 +471,12 @@ function getTplWidget() '; } -function getRecentInfo() -{ // recent document info - $modx = evolutionCMS(); +function getRecentInfo() { // recent document info + $modx = evolutionCMS(); - $modx->addSnippet('recentInfoList', 'getRecentInfoList'); + $modx->addSnippet('recentInfoList', 'getRecentInfoList'); - $html = ' + $html = '
    @@ -496,98 +494,96 @@ function getRecentInfo()
    '; - return $html; + return $html; } -function getRecentInfoList() -{ - $modx = evolutionCMS(); - - $rs = $modx->db->select('*', '[+prefix+]site_content', '', 'editedon DESC', 10); - - if ($modx->db->getRecordCount($rs) < 1) { - return '[%no_activity_message%]'; - } - - $tpl = getRecentInfoRowTpl(); - - $btntpl['edit'] = ' '; - $btntpl['preview_btn'] = ' '; - - $output = array(); - while ($ph = $modx->db->getRow($rs)) { - $docid = $ph['id']; - $_ = $modx->getUserInfo($ph['editedby']); - $ph['username'] = $_['username']; - - if ($ph['deleted'] == 1) { - $ph['status'] = 'deleted text-danger'; - } elseif ($ph['published'] == 0) { - $ph['status'] = 'unpublished font-italic text-muted'; - } else { - $ph['status'] = 'published'; - } - - if ($modx->hasPermission('edit_document')) { - $ph['edit_btn'] = str_replace('[+id+]', $docid, $btntpl['edit']); - } else { - $ph['edit_btn'] = ''; - } - - $preview_disabled = ($ph['deleted'] == 1) ? 'disabled' : ''; - $ph['preview_btn'] = str_replace(array( - '[+id+]', - '[+preview_disabled+]' - ), array( - $docid, - $preview_disabled - ), $btntpl['preview_btn']); - - if ($modx->hasPermission('delete_document')) { - if ($ph['deleted'] == 0) { - $delete_btn = ' '; - } else { - $delete_btn = ' '; - } - $ph['delete_btn'] = str_replace('[+id+]', $docid, $delete_btn); - } else { - $ph['delete_btn'] = ''; - } - - if ($ph['deleted'] == 1 && $ph['published'] == 0) { - $publish_btn = ' '; - } elseif ($ph['deleted'] == 1 && $ph['published'] == 1) { - $publish_btn = ' '; - } elseif ($ph['deleted'] == 0 && $ph['published'] == 0) { - $publish_btn = ' '; - } else { - $publish_btn = ' '; - } - $ph['publish_btn'] = str_replace('[+id+]', $docid, $publish_btn); - - $ph['info_btn'] = str_replace('[+id+]', $docid, ''); - - if ($ph['longtitle'] == '') { - $ph['longtitle'] = '([%not_set%])'; - } - if ($ph['description'] == '') { - $ph['description'] = '([%not_set%])'; - } - if ($ph['introtext'] == '') { - $ph['introtext'] = '([%not_set%])'; - } - if ($ph['alias'] == '') { - $ph['alias'] = '([%not_set%])'; - } - - $output[] = $modx->parseText($tpl, $ph); - } - return implode("\n", $output); +function getRecentInfoList() { + $modx = evolutionCMS(); + + $rs = $modx->db->select('*', '[+prefix+]site_content', '', 'editedon DESC', 10); + + if($modx->db->getRecordCount($rs) < 1) { + return '[%no_activity_message%]'; + } + + $tpl = getRecentInfoRowTpl(); + + $btntpl['edit'] = ' '; + $btntpl['preview_btn'] = ' '; + + $output = array(); + while($ph = $modx->db->getRow($rs)) { + $docid = $ph['id']; + $_ = $modx->getUserInfo($ph['editedby']); + $ph['username'] = $_['username']; + + if($ph['deleted'] == 1) { + $ph['status'] = 'deleted text-danger'; + } elseif($ph['published'] == 0) { + $ph['status'] = 'unpublished font-italic text-muted'; + } else { + $ph['status'] = 'published'; + } + + if($modx->hasPermission('edit_document')) { + $ph['edit_btn'] = str_replace('[+id+]', $docid, $btntpl['edit']); + } else { + $ph['edit_btn'] = ''; + } + + $preview_disabled = ($ph['deleted'] == 1) ? 'disabled' : ''; + $ph['preview_btn'] = str_replace(array( + '[+id+]', + '[+preview_disabled+]' + ), array( + $docid, + $preview_disabled + ), $btntpl['preview_btn']); + + if($modx->hasPermission('delete_document')) { + if($ph['deleted'] == 0) { + $delete_btn = ' '; + } else { + $delete_btn = ' '; + } + $ph['delete_btn'] = str_replace('[+id+]', $docid, $delete_btn); + } else { + $ph['delete_btn'] = ''; + } + + if($ph['deleted'] == 1 && $ph['published'] == 0) { + $publish_btn = ' '; + } elseif($ph['deleted'] == 1 && $ph['published'] == 1) { + $publish_btn = ' '; + } elseif($ph['deleted'] == 0 && $ph['published'] == 0) { + $publish_btn = ' '; + } else { + $publish_btn = ' '; + } + $ph['publish_btn'] = str_replace('[+id+]', $docid, $publish_btn); + + $ph['info_btn'] = str_replace('[+id+]', $docid, ''); + + if($ph['longtitle'] == '') { + $ph['longtitle'] = '([%not_set%])'; + } + if($ph['description'] == '') { + $ph['description'] = '([%not_set%])'; + } + if($ph['introtext'] == '') { + $ph['introtext'] = '([%not_set%])'; + } + if($ph['alias'] == '') { + $ph['alias'] = '([%not_set%])'; + } + + $output[] = $modx->parseText($tpl, $ph); + } + return implode("\n", $output); } -function getRecentInfoRowTpl() -{ - $tpl = ' +function getRecentInfoRowTpl() { + $tpl = ' [+id+] [+pagetitle+] @@ -611,18 +607,16 @@ function getRecentInfoRowTpl()
    '; - return $tpl; + return $tpl; } // setup icons -function wrapIcon($i, $action) -{ - return sprintf('%s', $action, $i); +function wrapIcon($i, $action) { + return sprintf('%s', $action, $i); } -function getStartUpScript() -{ - $script = ' +function getStartUpScript() { + $script = ' '; - return $script; + return $script; } diff --git a/manager/frames/1.php b/manager/frames/1.php index 5a6015b09e..a34aa16e55 100755 --- a/manager/frames/1.php +++ b/manager/frames/1.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } header("X-XSS-Protection: 0"); @@ -119,12 +119,10 @@ - config['show_picker'] != "0") { - ?> + config['show_picker'] != "0") { ?> - + + $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $tend = $mtime; $totaltime = ($tend - $tstart); + ?>
    @@ -47,7 +44,7 @@ function removeDebugDiv() { - +
    Time taken
    diff --git a/manager/includes/default_config.php b/manager/includes/default_config.php index 72b9fabc18..e002f11942 100755 --- a/manager/includes/default_config.php +++ b/manager/includes/default_config.php @@ -111,3 +111,6 @@ $c['login_form_position'] = 'left'; $c['manager_menu_position'] = 'top'; $c['tinymce4_skin'] = 'lightgray'; + + + diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index 3b69061896..20f88fa6c4 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -11,8 +11,6 @@ define('E_USER_DEPRECATED', 16384); } -require_once 'SystemEvent.class.php'; - class DocumentParser { /** @@ -225,7 +223,7 @@ public static function getInstance() * @param $arguments * @return mixed */ - public function __call($method_name, $arguments) + function __call($method_name, $arguments) { include_once(MODX_MANAGER_PATH . 'includes/extenders/deprecated.functions.inc.php'); if (method_exists($this->old, $method_name)) { @@ -310,7 +308,7 @@ public function loadExtension($extname, $reload = true) */ public function getMicroTime() { - list($usec, $sec) = explode(' ', microtime()); + list ($usec, $sec) = explode(' ', microtime()); return ((float)$usec + (float)$sec); } @@ -328,12 +326,12 @@ public function getMicroTime() public function sendRedirect($url, $count_attempts = 0, $type = '', $responseCode = '') { $header = ''; - if (empty($url)) { + if (empty ($url)) { return false; } if ($count_attempts == 1) { // append the redirect count string to the url - $currentNumberOfRedirects = isset($_REQUEST['err']) ? $_REQUEST['err'] : 0; + $currentNumberOfRedirects = isset ($_REQUEST['err']) ? $_REQUEST['err'] : 0; if ($currentNumberOfRedirects > 3) { $this->messageQuit('Redirection attempt failed - please ensure the document you\'re trying to redirect to exists.

    Redirection URL: ' . $url . '

    '); } else { @@ -351,7 +349,7 @@ public function sendRedirect($url, $count_attempts = 0, $type = '', $responseCod $header = ''; echo $header; exit; - } elseif ($type == 'REDIRECT_HEADER' || empty($type)) { + } elseif ($type == 'REDIRECT_HEADER' || empty ($type)) { // check if url has /$base_url global $base_url, $site_url; if (substr($url, 0, strlen($base_url)) == $base_url) { @@ -368,7 +366,7 @@ public function sendRedirect($url, $count_attempts = 0, $type = '', $responseCod header($responseCode); } - if (!empty($header)) { + if(!empty($header)) { header($header); } @@ -526,7 +524,7 @@ public function getUserSettings() $usrSettings = array(); if ($id = $this->getLoginUserID()) { $usrType = $this->getLoginUserType(); - if (isset($usrType) && $usrType == 'manager') { + if (isset ($usrType) && $usrType == 'manager') { $usrType = 'mgr'; } @@ -535,7 +533,7 @@ public function getUserSettings() $this->invokeEvent("OnBeforeManagerPageInit"); } - if (isset($_SESSION[$usrType . 'UsrConfigSet'])) { + if (isset ($_SESSION[$usrType . 'UsrConfigSet'])) { $usrSettings = &$_SESSION[$usrType . 'UsrConfigSet']; } else { if ($usrType == 'web') { @@ -555,14 +553,14 @@ public function getUserSettings() } $usrSettings[$row['setting_name']] = $row['setting_value']; } - if (isset($usrType)) { + if (isset ($usrType)) { $_SESSION[$usrType . 'UsrConfigSet'] = $usrSettings; } // store user settings in session } } if ($this->isFrontend() && $mgrid = $this->getLoginUserID('mgr')) { $musrSettings = array(); - if (isset($_SESSION['mgrUsrConfigSet'])) { + if (isset ($_SESSION['mgrUsrConfigSet'])) { $musrSettings = &$_SESSION['mgrUsrConfigSet']; } else { if ($result = $this->db->select('setting_name, setting_value', $tbl_user_settings, "user='{$mgrid}'")) { @@ -572,7 +570,7 @@ public function getUserSettings() $_SESSION['mgrUsrConfigSet'] = $musrSettings; // store user settings in session } } - if (!empty($musrSettings)) { + if (!empty ($musrSettings)) { $usrSettings = array_merge($musrSettings, $usrSettings); } } @@ -656,7 +654,7 @@ public function checkSession() public function checkPreview() { if ($this->isLoggedIn() == true) { - if (isset($_REQUEST['z']) && $_REQUEST['z'] == 'manprev') { + if (isset ($_REQUEST['z']) && $_REQUEST['z'] == 'manprev') { return true; } else { return false; @@ -767,23 +765,22 @@ public function getHashFile($key) * @param $id * @return array|mixed|null|string */ - public function makePageCacheKey($id) - { + public function makePageCacheKey($id){ $hash = $id; $tmp = null; $params = array(); - if (!empty($this->systemCacheKey)) { + if(!empty($this->systemCacheKey)){ $hash = $this->systemCacheKey; - } else { + }else { if (!empty($_GET)) { // Sort GET parameters so that the order of parameters on the HTTP request don't affect the generated cache ID. $params = $_GET; ksort($params); - $hash .= '_' . md5(http_build_query($params)); + $hash .= '_'.md5(http_build_query($params)); } } - $evtOut = $this->invokeEvent("OnMakePageCacheKey", array("hash" => $hash, "id" => $id, 'params' => $params)); - if (is_array($evtOut) && count($evtOut) > 0) { + $evtOut = $this->invokeEvent("OnMakePageCacheKey", array ("hash" => $hash, "id" => $id, 'params' => $params)); + if (is_array($evtOut) && count($evtOut) > 0){ $tmp = array_pop($evtOut); } return empty($tmp) ? $hash : $tmp; @@ -830,7 +827,7 @@ public function getDocumentObjectFromCache($id, $loading = false) else { $docObj = unserialize($a[0]); // rebuild document object // check page security - if ($docObj['privateweb'] && isset($docObj['__MODxDocGroups__'])) { + if ($docObj['privateweb'] && isset ($docObj['__MODxDocGroups__'])) { $pass = false; $usrGrps = $this->getUserDocGroups(); $docGrps = explode(',', $docObj['__MODxDocGroups__']); @@ -940,7 +937,7 @@ public function outputContent($noEvent = false) // send out content-type and content-disposition headers if (IN_PARSER_MODE == "true") { - $type = !empty($this->contentTypes[$this->documentIdentifier]) ? $this->contentTypes[$this->documentIdentifier] : "text/html"; + $type = !empty ($this->contentTypes[$this->documentIdentifier]) ? $this->contentTypes[$this->documentIdentifier] : "text/html"; header('Content-Type: ' . $type . '; charset=' . $this->config['modx_charset']); // if (($this->documentIdentifier == $this->config['error_page']) || $redirect_error) // header('HTTP/1.0 404 Not Found'); @@ -1063,7 +1060,7 @@ public function getTimerStats($tstart) $stats['totalTime'] = sprintf("%2.4f s", $stats['totalTime']); $stats['phpTime'] = sprintf("%2.4f s", $stats['phpTime']); $stats['source'] = $this->documentGenerated == 1 ? "database" : "cache"; - $stats['queries'] = isset($this->executedQueries) ? $this->executedQueries : 0; + $stats['queries'] = isset ($this->executedQueries) ? $this->executedQueries : 0; $stats['phpMemory'] = (memory_get_peak_usage(true) / 1024 / 1024) . " mb"; return $stats; @@ -1108,7 +1105,7 @@ public function updatePubStatus() // now, check for documents that need publishing $field = array('published' => 1, 'publishedon' => $timeNow); $where = "pub_date <= {$timeNow} AND pub_date!=0 AND published=0"; - $result_pub = $this->db->select('id', '[+prefix+]site_content', $where); + $result_pub = $this->db->select( 'id', '[+prefix+]site_content', $where); $this->db->update($field, '[+prefix+]site_content', $where); if ($this->db->getRecordCount($result_pub) >= 1) { //Event unPublished doc while ($row_pub = $this->db->getRow($result_pub)) { @@ -1121,7 +1118,7 @@ public function updatePubStatus() // now, check for documents that need un-publishing $field = array('published' => 0, 'publishedon' => 0); $where = "unpub_date <= {$timeNow} AND unpub_date!=0 AND published=1"; - $result_unpub = $this->db->select('id', '[+prefix+]site_content', $where); + $result_unpub = $this->db->select( 'id', '[+prefix+]site_content', $where); $this->db->update($field, '[+prefix+]site_content', $where); if ($this->db->getRecordCount($result_unpub) >= 1) { //Event unPublished doc while ($row_unpub = $this->db->getRow($result_unpub)) { @@ -1210,18 +1207,10 @@ public function _getTagsFromContent($content, $left = '[+', $right = '+]') return array(); } $spacer = md5('<<>>'); - if ($left==='{{' && strpos($content, ';}}')!==false) { - $content = str_replace(';}}', sprintf(';}%s}', $spacer), $content); - } - if ($left==='{{' && strpos($content, '{{}}')!==false) { - $content = str_replace('{{}}', sprintf('{%$1s{}%$1s}', $spacer), $content); - } - if ($left==='[[' && strpos($content, ']]]]')!==false) { - $content = str_replace(']]]]', sprintf(']]%s]]', $spacer), $content); - } - if ($left==='[[' && strpos($content, ']]]')!==false) { - $content = str_replace(']]]', sprintf(']%s]]', $spacer), $content); - } + if($left==='{{' && strpos($content,';}}')!==false) $content = str_replace(';}}', sprintf(';}%s}', $spacer),$content); + if($left==='{{' && strpos($content,'{{}}')!==false) $content = str_replace('{{}}',sprintf('{%$1s{}%$1s}',$spacer),$content); + if($left==='[[' && strpos($content,']]]]')!==false) $content = str_replace(']]]]',sprintf(']]%s]]', $spacer),$content); + if($left==='[[' && strpos($content,']]]')!==false) $content = str_replace(']]]', sprintf(']%s]]', $spacer),$content); $pos[''] = strpos($content, ']]>'); @@ -1291,10 +1280,8 @@ public function _getTagsFromContent($content, $left = '[+', $right = '+]') } } } - foreach ($tags as $i=>$tag) { - if (strpos($tag, $spacer)!==false) { - $tags[$i] = str_replace($spacer, '', $tag); - } + foreach($tags as $i=>$tag) { + if(strpos($tag,$spacer)!==false) $tags[$i] = str_replace($spacer, '', $tag); } return $tags; } @@ -1334,9 +1321,7 @@ public function mergeDocumentContent($content, $ph = false) } foreach ($matches[1] as $i => $key) { - if (strpos($key, '[+')!==false) { - continue; - } // Allow chunk {{chunk?¶m=`xxx`}} with [*tv_name_[+param+]*] as content + if(strpos($key,'[+')!==false) continue; // Allow chunk {{chunk?¶m=`xxx`}} with [*tv_name_[+param+]*] as content if (substr($key, 0, 1) == '#') { $key = substr($key, 1); } // remove # for QuickEdit format @@ -1368,7 +1353,7 @@ public function mergeDocumentContent($content, $ph = false) if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('mergeDocumentContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -1536,7 +1521,7 @@ public function mergeSettingsContent($content, $ph = false) $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('mergeSettingsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -1605,7 +1590,7 @@ public function mergeChunkContent($content, $ph = false) $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('mergeChunkContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -1621,6 +1606,7 @@ public function mergeChunkContent($content, $ph = false) */ public function mergePlaceholderContent($content, $ph = false) { + if ($this->config['enable_at_syntax']) { if (stripos($content, '<@LITERAL>') !== false) { $content = $this->escapeLiteralTagsContent($content); @@ -1645,6 +1631,7 @@ public function mergePlaceholderContent($content, $ph = false) return $content; } foreach ($matches[1] as $i => $key) { + list($key, $modifiers) = $this->splitKeyAndFilter($key); if (isset($ph[$key])) { @@ -1662,7 +1649,7 @@ public function mergePlaceholderContent($content, $ph = false) $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('mergePlaceholderContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -1831,7 +1818,7 @@ private function _parseCTagCMD($cmd) * @param string $right * @return mixed */ - public function ignoreCommentedTagsContent($content, $left = '') + function ignoreCommentedTagsContent($content, $left = '') { if (strpos($content, $left) === false) { return $content; @@ -1873,7 +1860,7 @@ public function escapeLiteralTagsContent($content, $left = '<@LITERAL>', $right $s = &$matches[0][$i]; if (strpos($content, $s) !== false) { $content = str_replace($s, $v, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('ignoreCommentedTagsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -2030,7 +2017,7 @@ public function evalSnippets($content) } if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('evalSnippetsSGVar parse error', $_SERVER['REQUEST_URI'] . $s, 2); } continue; @@ -2042,7 +2029,7 @@ public function evalSnippets($content) if (strpos($content, $s) !== false) { $content = str_replace($s, $value, $content); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('evalSnippets parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -2510,6 +2497,7 @@ public function rewriteUrls($documentSource) } return $out; }, $documentSource); + } else { $in = '!\[\~([0-9]+)\~\]!is'; $out = "index.php?id=" . '\1'; @@ -2594,6 +2582,7 @@ public function sendStrictURI() */ public function getDocumentObject($method, $identifier, $isPrepareResponse = false) { + $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { return $this->tmpCache[__FUNCTION__][$cacheKey]; @@ -2696,8 +2685,8 @@ public function getDocumentObject($method, $identifier, $isPrepareResponse = fal public function parseDocumentSource($source) { // set the number of times we are to parse the document source - $this->minParserPasses = empty($this->minParserPasses) ? 2 : $this->minParserPasses; - $this->maxParserPasses = empty($this->maxParserPasses) ? 10 : $this->maxParserPasses; + $this->minParserPasses = empty ($this->minParserPasses) ? 2 : $this->minParserPasses; + $this->maxParserPasses = empty ($this->maxParserPasses) ? 10 : $this->maxParserPasses; $passes = $this->minParserPasses; for ($i = 0; $i < $passes; $i++) { // get source length if this is the final pass @@ -2747,7 +2736,7 @@ public function parseDocumentSource($source) */ public function executeParser() { - if (MODX_CLI) { + if(MODX_CLI) { throw new RuntimeException('Call DocumentParser::executeParser on CLI mode'); } @@ -2759,7 +2748,7 @@ public function executeParser() $this->db->connect(); // get the settings - if (empty($this->config)) { + if (empty ($this->config)) { $this->getSettings(); } @@ -2901,11 +2890,11 @@ public function _IIS_furl_fix() } $k = array_keys($_GET); - unset($_GET[$k[0]]); - unset($_REQUEST[$k[0]]); // remove 404,405 entry + unset ($_GET[$k[0]]); + unset ($_REQUEST[$k[0]]); // remove 404,405 entry $qp = parse_url(str_replace($this->config['site_url'], '', substr($url, 4))); $_SERVER['QUERY_STRING'] = $qp['query']; - if (!empty($qp['query'])) { + if (!empty ($qp['query'])) { parse_str($qp['query'], $qv); foreach ($qv as $n => $v) { $_REQUEST[$n] = $_GET[$n] = $v; @@ -3102,12 +3091,14 @@ public function getUltimateParentId($id, $top = 0) */ public function getChildIds($id, $depth = 10, $children = array()) { + $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { return $this->tmpCache[__FUNCTION__][$cacheKey]; } if ($this->config['aliaslistingfolder'] == 1) { + $res = $this->db->select("id,alias,isfolder,parent", $this->getFullTableName('site_content'), "parent IN (" . $id . ") AND deleted = '0'"); $idx = array(); while ($row = $this->db->getRow($res)) { @@ -3130,6 +3121,7 @@ public function getChildIds($id, $depth = 10, $children = array()) } $this->tmpCache[__FUNCTION__][$cacheKey] = $children; return $children; + } else { // Initialise a static array to index parents->children @@ -3160,6 +3152,7 @@ public function getChildIds($id, $depth = 10, $children = array()) } $this->tmpCache[__FUNCTION__][$cacheKey] = $children; return $children; + } } @@ -3330,6 +3323,7 @@ public function cleanupExpiredLocks() } else { $this->db->delete($this->getFullTableName('active_user_locks')); } + } /** @@ -3365,11 +3359,13 @@ public function cleanupMultipleActiveUsers() $deleteSids .= $deleteSids == '' ? '' : ' OR '; $deleteSids .= "sid='{$row['sid']}'"; }; + } if ($deleteSids) { $this->db->delete($this->getFullTableName('active_users'), $deleteSids); } } + } /** @@ -3670,6 +3666,7 @@ public function isFrontend() */ public function getAllChildren($id = 0, $sort = 'menuindex', $dir = 'ASC', $fields = 'id, pagetitle, description, parent, alias, menutitle') { + $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { return $this->tmpCache[__FUNCTION__][$cacheKey]; @@ -3751,6 +3748,7 @@ public function getActiveChildren($id = 0, $sort = 'menuindex', $dir = 'ASC', $f */ public function getDocumentChildren($parentid = 0, $published = 1, $deleted = 0, $fields = '*', $where = '', $sort = 'menuindex', $dir = 'ASC', $limit = '') { + $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { return $this->tmpCache[__FUNCTION__][$cacheKey]; @@ -3807,6 +3805,7 @@ public function getDocumentChildren($parentid = 0, $published = 1, $deleted = 0, */ public function getDocuments($ids = array(), $published = 1, $deleted = 0, $fields = '*', $where = '', $sort = 'menuindex', $dir = 'ASC', $limit = '') { + $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { return $this->tmpCache[__FUNCTION__][$cacheKey]; @@ -3936,6 +3935,7 @@ public function getField($field = 'content', $docid = '') */ public function getPageInfo($pageid = -1, $active = 1, $fields = 'id, pagetitle, description, alias') { + $cacheKey = md5(print_r(func_get_args(), true)); if (isset($this->tmpCache[__FUNCTION__][$cacheKey])) { return $this->tmpCache[__FUNCTION__][$cacheKey]; @@ -3980,7 +3980,7 @@ public function getParent($pid = -1, $active = 1, $fields = 'id, pagetitle, desc if ($pid == -1) { $pid = $this->documentObject['parent']; return ($pid == 0) ? false : $this->getPageInfo($pid, $active, $fields); - } elseif ($pid == 0) { + } else if ($pid == 0) { return false; } else { // first get the child document @@ -4109,6 +4109,7 @@ public function makeUrl($id, $alias = '', $args = '', $scheme = '') $alPath = ''; if ($this->config['friendly_alias_urls'] == 1) { + if ($this->config['aliaslistingfolder'] == 1) { $al = $this->getAliasListing($id); } else { @@ -4119,11 +4120,12 @@ public function makeUrl($id, $alias = '', $args = '', $scheme = '') $f_url_suffix = '/'; } - $alPath = !empty($al['path']) ? $al['path'] . '/' : ''; + $alPath = !empty ($al['path']) ? $al['path'] . '/' : ''; if ($al && $al['alias']) { $alias = $al['alias']; } + } $alias = $alPath . $f_url_prefix . $alias . $f_url_suffix; @@ -4216,7 +4218,7 @@ public function getAliasListing($id) */ public function getConfig($name = '') { - if (!empty($this->config[$name])) { + if (!empty ($this->config[$name])) { return $this->config[$name]; } else { return false; @@ -4255,7 +4257,7 @@ public function getVersionData($data = null) */ public function runSnippet($snippetName, $params = array()) { - if (isset($this->snippetCache[$snippetName])) { + if (isset ($this->snippetCache[$snippetName])) { $snippet = $this->snippetCache[$snippetName]; $properties = !empty($this->snippetCache[$snippetName . "Props"]) ? $this->snippetCache[$snippetName . "Props"] : ''; } else { // not in cache so let's check the db @@ -4291,9 +4293,9 @@ public function getChunk($chunkName) if (empty($chunkName)) { return $out; } - if (isset($this->chunkCache[$chunkName])) { + if (isset ($this->chunkCache[$chunkName])) { $out = $this->chunkCache[$chunkName]; - } elseif (stripos($chunkName, '@FILE') === 0) { + } else if (stripos($chunkName, '@FILE') === 0) { $out = $this->chunkCache[$chunkName] = $this->atBindFileContent($chunkName); } else { $where = sprintf("`name`='%s' AND disabled=0", $this->db->escape($chunkName)); @@ -4345,6 +4347,7 @@ public function parseText($tpl = '', $ph = array(), $left = '[+', $right = '+]', } foreach ($matches[1] as $i => $key) { + if (strpos($key, ':') !== false && $execModifier) { list($key, $modifiers) = $this->splitKeyAndFilter($key); } else { @@ -4367,7 +4370,7 @@ public function parseText($tpl = '', $ph = array(), $left = '[+', $right = '+]', } if (strpos($tpl, $s) !== false) { $tpl = str_replace($s, $value, $tpl); - } elseif ($this->debug) { + } elseif($this->debug) { $this->addLog('parseText parse error', $_SERVER['REQUEST_URI'] . $s, 2); } } @@ -4497,19 +4500,19 @@ public function toTimeStamp($str) if (!preg_match('/^[0-9]{4}\/[0-9]{2}\/[0-9]{2}[0-9 :]*$/', $str)) { return ''; } - list($Y, $m, $d, $H, $M, $S) = sscanf($str, '%4d/%2d/%2d %2d:%2d:%2d'); + list ($Y, $m, $d, $H, $M, $S) = sscanf($str, '%4d/%2d/%2d %2d:%2d:%2d'); break; case 'dd-mm-YYYY': if (!preg_match('/^[0-9]{2}-[0-9]{2}-[0-9]{4}[0-9 :]*$/', $str)) { return ''; } - list($d, $m, $Y, $H, $M, $S) = sscanf($str, '%2d-%2d-%4d %2d:%2d:%2d'); + list ($d, $m, $Y, $H, $M, $S) = sscanf($str, '%2d-%2d-%4d %2d:%2d:%2d'); break; case 'mm/dd/YYYY': if (!preg_match('/^[0-9]{2}\/[0-9]{2}\/[0-9]{4}[0-9 :]*$/', $str)) { return ''; } - list($m, $d, $Y, $H, $M, $S) = sscanf($str, '%2d/%2d/%4d %2d:%2d:%2d'); + list ($m, $d, $Y, $H, $M, $S) = sscanf($str, '%2d/%2d/%4d %2d:%2d:%2d'); break; /* case 'dd-mmm-YYYY': @@ -4586,6 +4589,7 @@ public function getDocumentChildrenTVars($parentid = 0, $tvidnames = array(), $p $this->getUserDocGroups(); foreach ($docs as $doc) { + $docid = $doc['id']; $rs = $this->db->select("{$fields}, IF(tvc.value!='',tvc.value,tv.default_text) as value ", "[+prefix+]site_tmplvars tv @@ -4648,7 +4652,7 @@ public function getDocumentChildrenTVarOutput($parentid = 0, $tvidnames = array( $tvidnames[] = $resultKey; $unsetResultKey = true; } - } elseif ($tvidnames != '*' && $tvidnames != $resultKey) { + } else if ($tvidnames != '*' && $tvidnames != $resultKey) { $tvidnames = array($tvidnames, $resultKey); $unsetResultKey = true; } @@ -4723,7 +4727,7 @@ public function getTemplateVars($idnames = array(), $fields = '*', $docid = '', return $this->tmpCache[__FUNCTION__][$cacheKey]; } - if (($idnames != '*' && !is_array($idnames)) || empty($idnames)) { + if (($idnames != '*' && !is_array($idnames)) || empty($idnames) ) { return false; } else { @@ -4757,7 +4761,7 @@ public function getTemplateVars($idnames = array(), $fields = '*', $docid = '', $result = $this->db->makeArray($rs); // get default/built-in template variables - if (is_array($docRow)) { + if(is_array($docRow)){ ksort($docRow); foreach ($docRow as $key => $value) { @@ -4795,7 +4799,7 @@ public function getTemplateVars($idnames = array(), $fields = '*', $docid = '', */ public function getTemplateVarOutput($idnames = array(), $docid = '', $published = 1, $sep = '') { - if (is_array($idnames) && empty($idnames)) { + if (is_array($idnames) && empty($idnames) ) { return false; } else { $output = array(); @@ -4971,11 +4975,11 @@ public function getLoginUserID($context = '') } } else { switch (true) { - case ($this->isFrontend() && isset($_SESSION['webValidated'])): { + case ($this->isFrontend() && isset ($_SESSION['webValidated'])): { $out = $_SESSION['webInternalKey']; break; } - case ($this->isBackend() && isset($_SESSION['mgrValidated'])): { + case ($this->isBackend() && isset ($_SESSION['mgrValidated'])): { $out = $_SESSION['mgrInternalKey']; break; } @@ -5000,11 +5004,11 @@ public function getLoginUserName($context = '') } } else { switch (true) { - case ($this->isFrontend() && isset($_SESSION['webValidated'])): { + case ($this->isFrontend() && isset ($_SESSION['webValidated'])): { $out = $_SESSION['webShortname']; break; } - case ($this->isBackend() && isset($_SESSION['mgrValidated'])): { + case ($this->isBackend() && isset ($_SESSION['mgrValidated'])): { $out = $_SESSION['mgrShortname']; break; } @@ -5020,9 +5024,9 @@ public function getLoginUserName($context = '') */ public function getLoginUserType() { - if ($this->isFrontend() && isset($_SESSION['webValidated'])) { + if ($this->isFrontend() && isset ($_SESSION['webValidated'])) { return 'web'; - } elseif ($this->isBackend() && isset($_SESSION['mgrValidated'])) { + } elseif ($this->isBackend() && isset ($_SESSION['mgrValidated'])) { return 'manager'; } else { return ''; @@ -5091,7 +5095,7 @@ public function getUserDocGroups($resolveIds = false) if ($this->isFrontend() && isset($_SESSION['webDocgroups']) && isset($_SESSION['webValidated'])) { $dg = $_SESSION['webDocgroups']; $dgn = isset($_SESSION['webDocgrpNames']) ? $_SESSION['webDocgrpNames'] : false; - } elseif ($this->isBackend() && isset($_SESSION['mgrDocgroups']) && isset($_SESSION['mgrValidated'])) { + } else if ($this->isBackend() && isset($_SESSION['mgrDocgroups']) && isset($_SESSION['mgrValidated'])) { $dg = $_SESSION['mgrDocgroups']; $dgn = isset($_SESSION['mgrDocgrpNames']) ? $_SESSION['mgrDocgrpNames'] : false; } else { @@ -5099,9 +5103,9 @@ public function getUserDocGroups($resolveIds = false) } if (!$resolveIds) { return $dg; - } elseif (is_array($dgn)) { + } else if (is_array($dgn)) { return $dgn; - } elseif (is_array($dg)) { + } else if (is_array($dg)) { // resolve ids to names $dgn = array(); $ds = $this->db->select('name', $this->getFullTableName("documentgroup_names"), "id IN (" . implode(",", $dg) . ")"); @@ -5171,7 +5175,7 @@ public function isMemberOfWebGroup($groupNames = array()) return false; } // check cache - $grpNames = isset($_SESSION['webUserGroupNames']) ? $_SESSION['webUserGroupNames'] : false; + $grpNames = isset ($_SESSION['webUserGroupNames']) ? $_SESSION['webUserGroupNames'] : false; if (!is_array($grpNames)) { $rs = $this->db->select('wgn.name', $this->getFullTableName("webgroup_names") . " wgn INNER JOIN " . $this->getFullTableName("web_groups") . " wg ON wg.webgroup=wgn.id AND wg.webuser='" . $this->getLoginUserID() . "'"); @@ -5197,7 +5201,7 @@ public function isMemberOfWebGroup($groupNames = array()) */ public function regClientCSS($src, $media = '') { - if (empty($src) || isset($this->loadedjscripts[$src])) { + if (empty($src) || isset ($this->loadedjscripts[$src])) { return ''; } $nextpos = max(array_merge(array(0), array_keys($this->sjscripts))) + 1; @@ -5236,11 +5240,11 @@ public function regClientScript($src, $options = array('name' => '', 'version' = return ''; } // nothing to register if (!is_array($options)) { - if (is_bool($options)) { // backward compatibility with old plaintext parameter - + if (is_bool($options)) // backward compatibility with old plaintext parameter + { $options = array('plaintext' => $options); - } elseif (is_string($options)) { // Also allow script name as 2nd param - + } elseif (is_string($options)) // Also allow script name as 2nd param + { $options = array('name' => $options); } else { $options = array(); @@ -5369,7 +5373,7 @@ public function removeEventListener($evtName) if (!$evtName) { return false; } - unset($this->pluginEvent[$evtName]); + unset ($this->pluginEvent[$evtName]); } /** @@ -5377,7 +5381,7 @@ public function removeEventListener($evtName) */ public function removeAllEventListener() { - unset($this->pluginEvent); + unset ($this->pluginEvent); $this->pluginEvent = array(); } @@ -5393,7 +5397,7 @@ public function invokeEvent($evtName, $extParams = array()) if (!$evtName) { return false; } - if (!isset($this->pluginEvent[$evtName])) { + if (!isset ($this->pluginEvent[$evtName])) { return false; } @@ -5459,7 +5463,7 @@ public function invokeEvent($evtName, $extParams = array()) public function getPluginCode($pluginName) { $plugin = array(); - if (isset($this->pluginCache[$pluginName])) { + if (isset ($this->pluginCache[$pluginName])) { $pluginCode = $this->pluginCache[$pluginName]; $pluginProperties = isset($this->pluginCache[$pluginName . "Props"]) ? $this->pluginCache[$pluginName . "Props"] : ''; } else { @@ -5499,6 +5503,7 @@ public function parseProperties($propertyString, $elementName = null, $elementTy if ($jsonFormat === false) { $props = explode('&', $propertyString); foreach ($props as $prop) { + if (empty($prop)) { continue; } elseif (strpos($prop, '=') === false) { @@ -5524,7 +5529,7 @@ public function parseProperties($propertyString, $elementName = null, $elementTy } } // new json-format - } elseif (!empty($jsonFormat)) { + } else if (!empty($jsonFormat)) { foreach ($jsonFormat as $key => $row) { if (!empty($key)) { if (is_array($row)) { @@ -5901,17 +5906,17 @@ public function safeEval($phpcode = '', $evalmode = '', $safe_functions = '') modx_sanitize_gpc($phpcode); switch ($evalmode) { - case 'with_scan': + case 'with_scan' : $isSafe = $this->isSafeCode($phpcode, $safe_functions); break; - case 'with_scan_at_post': + case 'with_scan_at_post' : $isSafe = $_POST ? $this->isSafeCode($phpcode, $safe_functions) : true; break; - case 'everytime_eval': + case 'everytime_eval' : $isSafe = true; break; // Should debug only - case 'dont_eval': - default: + case 'dont_eval' : + default : return $phpcode; } @@ -5984,6 +5989,7 @@ public function isSafeCode($phpcode = '', $safe_functions = '') */ public function atBindFileContent($str = '') { + $search_path = array('assets/tvs/', 'assets/chunks/', 'assets/templates/', $this->config['rb_base_url'] . 'files/', ''); if (stripos($str, '@FILE') !== 0) { @@ -6115,6 +6121,7 @@ public function phpError($nr, $text, $file, $line) */ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = true, $nr = '', $file = '', $source = '', $text = '', $line = '', $output = '') { + if (0 < $this->messageQuitCount) { return; } @@ -6131,8 +6138,8 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = $table = array(); - $version = isset($GLOBALS['modx_version']) ? $GLOBALS['modx_version'] : ''; - $release_date = isset($GLOBALS['release_date']) ? $GLOBALS['release_date'] : ''; + $version = isset ($GLOBALS['modx_version']) ? $GLOBALS['modx_version'] : ''; + $release_date = isset ($GLOBALS['release_date']) ? $GLOBALS['release_date'] : ''; $request_uri = "http://" . $_SERVER['HTTP_HOST'] . ($_SERVER["SERVER_PORT"] == 80 ? "" : (":" . $_SERVER["SERVER_PORT"])) . $_SERVER['REQUEST_URI']; $request_uri = $this->htmlspecialchars($request_uri, ENT_QUOTES, $this->config['modx_charset']); $ua = $this->htmlspecialchars($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, $this->config['modx_charset']); @@ -6147,7 +6154,7 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = $str .= '

    ' . $msg . '

    '; } - if (!empty($query)) { + if (!empty ($query)) { $str .= '
    SQL > ' . $query . '
    '; } @@ -6185,6 +6192,7 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = if ($line) { $table[] = array('Line', $line); } + } if ($source != '') { @@ -6241,7 +6249,7 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = $queryTime = $this->queryTime; $phpTime = $totalTime - $queryTime; - $queries = isset($this->executedQueries) ? $this->executedQueries : 0; + $queries = isset ($this->executedQueries) ? $this->executedQueries : 0; $queryTime = sprintf("%2.4f s", $queryTime); $totalTime = sprintf("%2.4f s", $totalTime); $phpTime = sprintf("%2.4f s", $phpTime); @@ -6275,11 +6283,11 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = $source .= $actionName; } switch ($nr) { - case E_DEPRECATED: - case E_USER_DEPRECATED: - case E_STRICT: - case E_NOTICE: - case E_USER_NOTICE: + case E_DEPRECATED : + case E_USER_DEPRECATED : + case E_STRICT : + case E_NOTICE : + case E_USER_NOTICE : $error_level = 2; break; default: @@ -6307,6 +6315,7 @@ public function messageQuit($msg = 'unspecified error', $query = '', $is_error = ' . $str . ''; + } else { echo 'Error'; } @@ -6685,4 +6694,75 @@ public function addLog($title = 'no title', $msg = '', $type = 1) } $this->logEvent(0, $type, $msg, $title); } + +} + +/** + * System Event Class + */ +class SystemEvent +{ + public $name = ''; + public $_propagate = true; + public $_output = ''; + public $activated = false; + public $activePlugin = ''; + public $params = array(); + + /** + * @param string $name Name of the event + */ + public function __construct($name = "") + { + $this->_resetEventObject(); + $this->name = $name; + } + + /** + * Display a message to the user + * + * @global array $SystemAlertMsgQueque + * @param string $msg The message + */ + public function alert($msg) + { + global $SystemAlertMsgQueque; + if ($msg == "") { + return; + } + if (is_array($SystemAlertMsgQueque)) { + $title = ''; + if ($this->name && $this->activePlugin) { + $title = "
    " . $this->activePlugin . " - " . $this->name . "
    "; + } + $SystemAlertMsgQueque[] = "$title
    $msg
    "; + } + } + + /** + * Output + * + * @param string $msg + */ + public function output($msg) + { + $this->_output .= $msg; + } + + /** + * Stop event propogation + */ + public function stopPropagation() + { + $this->_propagate = false; + } + + public function _resetEventObject() + { + unset ($this->returnedValues); + $this->name = ""; + $this->_output = ""; + $this->_propagate = true; + $this->activated = false; + } } diff --git a/manager/includes/error.class.inc.php b/manager/includes/error.class.inc.php index 42dd3abc3c..f82cd17d1a 100755 --- a/manager/includes/error.class.inc.php +++ b/manager/includes/error.class.inc.php @@ -22,6 +22,7 @@ class errorHandler */ public function __construct() { + $_lang = $this->include_lang('errormsg'); $this->errors = array( diff --git a/manager/includes/extenders/dbapi.mysql.class.inc.php b/manager/includes/extenders/dbapi.mysql.class.inc.php index 5172d7f252..6f5b60b78a 100755 --- a/manager/includes/extenders/dbapi.mysql.class.inc.php +++ b/manager/includes/extenders/dbapi.mysql.class.inc.php @@ -7,6 +7,7 @@ class DBAPI { + public $conn; public $config; public $lastQuery; @@ -171,12 +172,13 @@ public function disconnect() public function escape($s, $safecount = 0) { + $safecount++; if (1000 < $safecount) { exit("Too many loops '{$safecount}'"); } - if (empty($this->conn) || !is_resource($this->conn)) { + if (empty ($this->conn) || !is_resource($this->conn)) { $this->connect(); } @@ -203,7 +205,7 @@ public function escape($s, $safecount = 0) public function query($sql, $watchError = true) { $modx = evolutionCMS(); - if (empty($this->conn) || !is_resource($this->conn)) { + if (empty ($this->conn) || !is_resource($this->conn)) { $this->connect(); } $tstart = $modx->getMicroTime(); @@ -414,6 +416,7 @@ public function insert($fields, $intotable, $fromfields = "*", $fromtable = "", public function save($fields, $table, $where = '') { + if ($where === '') { $mode = 'insert'; } elseif ($this->getRecordCount($this->select('*', $table, $where)) == 0) { @@ -614,7 +617,7 @@ public function getValue($dsq) public function getTableMetaData($table) { $metadata = false; - if (!empty($table)) { + if (!empty ($table)) { $sql = "SHOW FIELDS FROM $table"; if ($ds = $this->query($sql)) { while ($row = $this->getRow($ds)) { @@ -640,16 +643,16 @@ public function prepareDate($timestamp, $fieldType = 'DATETIME') $date = ''; if (!$timestamp === false && $timestamp > 0) { switch ($fieldType) { - case 'DATE': + case 'DATE' : $date = date('Y-m-d', $timestamp); break; - case 'TIME': + case 'TIME' : $date = date('H:i:s', $timestamp); break; - case 'YEAR': + case 'YEAR' : $date = date('Y', $timestamp); break; - default: + default : $date = date('Y-m-d H:i:s', $timestamp); break; } @@ -702,6 +705,7 @@ public function getVersion() */ public function replaceFullTableName($str, $force = null) { + $str = trim($str); $dbase = trim($this->config['dbase'], '`'); $prefix = $this->config['table_prefix']; @@ -740,6 +744,7 @@ public function dataSeek($result, $row_number) public function _getFieldsStringFromArray($fields = array()) { + if (empty($fields)) { return '*'; } @@ -766,3 +771,4 @@ public function _getFromStringFromArray($tables = array()) return implode(' ', $_); } } + diff --git a/manager/includes/extenders/dbapi.mysqli.class.inc.php b/manager/includes/extenders/dbapi.mysqli.class.inc.php index b9a9b0136a..8596b6f091 100755 --- a/manager/includes/extenders/dbapi.mysqli.class.inc.php +++ b/manager/includes/extenders/dbapi.mysqli.class.inc.php @@ -119,7 +119,7 @@ public function escape($s, $safeCount = 0) if (1000 < $safeCount) { exit("Too many loops '{$safeCount}'"); } - if (! ($this->conn instanceof mysqli)) { + if ( ! ($this->conn instanceof mysqli)) { $this->connect(); } if (is_array($s)) { @@ -145,7 +145,7 @@ public function escape($s, $safeCount = 0) public function query($sql, $watchError = true) { $modx = evolutionCMS(); - if (! ($this->conn instanceof mysqli)) { + if ( ! ($this->conn instanceof mysqli)) { $this->connect(); } $tStart = $modx->getMicroTime(); @@ -295,7 +295,7 @@ public function update($fields, $table, $where = "") $modx = evolutionCMS(); $out = false; if (!$table) { - $modx->messageQuit('Empty ' . $table . ' parameter in DBAPI::update().'); + $modx->messageQuit('Empty '.$table.' parameter in DBAPI::update().'); } else { $table = $this->replaceFullTableName($table); if (is_array($fields)) { @@ -311,10 +311,10 @@ public function update($fields, $table, $where = "") } $where = trim($where); if ($where !== '' && stripos($where, 'WHERE') !== 0) { - $where = 'WHERE ' . $where; + $where = 'WHERE '.$where; } - return $this->query('UPDATE ' . $table . ' SET ' . $fields . ' ' . $where); + return $this->query('UPDATE '.$table.' SET '.$fields.' '.$where); } return $out; } @@ -490,7 +490,7 @@ public function getRow($ds, $mode = 'assoc') { $out = false; if ($ds instanceof mysqli_result) { - switch ($mode) { + switch($mode){ case 'assoc': $out = $ds->fetch_assoc(); break; @@ -520,7 +520,7 @@ public function getRow($ds, $mode = 'assoc') public function getColumn($name, $dsq) { $col = array(); - if (! ($dsq instanceof mysqli_result)) { + if ( ! ($dsq instanceof mysqli_result)) { $dsq = $this->query($dsq); } if ($dsq) { @@ -539,7 +539,7 @@ public function getColumn($name, $dsq) public function getColumnNames($dsq) { $names = array(); - if (! ($dsq instanceof mysqli_result)) { + if ( ! ($dsq instanceof mysqli_result)) { $dsq = $this->query($dsq); } if ($dsq) { @@ -559,7 +559,7 @@ public function getColumnNames($dsq) public function getValue($dsq) { $out = false; - if (! ($dsq instanceof mysqli_result)) { + if ( ! ($dsq instanceof mysqli_result)) { $dsq = $this->query($dsq); } if ($dsq) { @@ -578,7 +578,7 @@ public function getTableMetaData($table) { $metadata = array(); if (!empty($table) && is_scalar($table)) { - $sql = 'SHOW FIELDS FROM ' . $table; + $sql = 'SHOW FIELDS FROM '.$table; if ($ds = $this->query($sql)) { while ($row = $this->getRow($ds)) { $fieldName = $row['Field']; @@ -600,16 +600,16 @@ public function prepareDate($timestamp, $fieldType = 'DATETIME') $date = false; if (!$timestamp === false && $timestamp > 0) { switch ($fieldType) { - case 'DATE': + case 'DATE' : $date = date('Y-m-d', $timestamp); break; - case 'TIME': + case 'TIME' : $date = date('H:i:s', $timestamp); break; - case 'YEAR': + case 'YEAR' : $date = date('Y', $timestamp); break; - default: + default : $date = date('Y-m-d H:i:s', $timestamp); break; } @@ -674,9 +674,9 @@ public function replaceFullTableName($tableName, $force = false) */ public function optimize($table_name) { - $rs = $this->query('OPTIMIZE TABLE ' . $table_name); + $rs = $this->query('OPTIMIZE TABLE '.$table_name); if ($rs) { - $rs = $this->query('ALTER TABLE ' . $table_name); + $rs = $this->query('ALTER TABLE '.$table_name); } return $rs; @@ -688,7 +688,7 @@ public function optimize($table_name) */ public function truncate($table_name) { - return $this->query('TRUNCATE ' . $table_name); + return $this->query('TRUNCATE '.$table_name); } /** @@ -707,6 +707,7 @@ public function dataSeek($result, $row_number) */ public function _getFieldsStringFromArray($fields = array()) { + if (empty($fields)) { return '*'; } @@ -714,7 +715,7 @@ public function _getFieldsStringFromArray($fields = array()) $_ = array(); foreach ($fields as $k => $v) { if ($k !== $v) { - $_[] = $v . ' as ' . $k; + $_[] = $v.' as '.$k; } else { $_[] = $v; } diff --git a/manager/includes/extenders/deprecated.functions.inc.php b/manager/includes/extenders/deprecated.functions.inc.php index 5e8c8d138e..42b91290f2 100755 --- a/manager/includes/extenders/deprecated.functions.inc.php +++ b/manager/includes/extenders/deprecated.functions.inc.php @@ -109,7 +109,7 @@ public function makeList($array, $ulroot = 'root', $ulprefix = 'sub_', $type = ' if (!is_array($array)) { return "
    • Bad list
    "; } - if (!empty($type)) { + if (!empty ($type)) { $typestr = " style='list-style-type: $type'"; } else { $typestr = ""; @@ -218,7 +218,7 @@ public function userLoggedIn() { $modx = evolutionCMS(); $userdetails = array(); - if ($modx->isFrontend() && isset($_SESSION['webValidated'])) { + if ($modx->isFrontend() && isset ($_SESSION['webValidated'])) { // web user $userdetails['loggedIn'] = true; $userdetails['id'] = $_SESSION['webInternalKey']; @@ -227,7 +227,7 @@ public function userLoggedIn() return $userdetails; } else { - if ($modx->isBackend() && isset($_SESSION['mgrValidated'])) { + if ($modx->isBackend() && isset ($_SESSION['mgrValidated'])) { // manager user $userdetails['loggedIn'] = true; $userdetails['id'] = $_SESSION['mgrInternalKey']; diff --git a/manager/includes/extenders/ex_dbapi.inc.php b/manager/includes/extenders/ex_dbapi.inc.php index bebeda3af1..949109de89 100755 --- a/manager/includes/extenders/ex_dbapi.inc.php +++ b/manager/includes/extenders/ex_dbapi.inc.php @@ -7,17 +7,15 @@ global $database_type; -if (empty($database_type)) { - $database_type = 'mysql'; -} +if (empty($database_type)) $database_type = 'mysql'; $out = false; $class = 'DBAPI'; -if (! class_exists($class)) { +if( ! class_exists($class)){ include_once MODX_MANAGER_PATH . 'includes/extenders/dbapi.' . $database_type . '.class.inc.php'; } -if (class_exists($class)) { +if(class_exists($class)){ $this->db= new $class; $out = true; } diff --git a/manager/includes/extenders/export.class.inc.php b/manager/includes/extenders/export.class.inc.php index adc689163e..42e7b98850 100755 --- a/manager/includes/extenders/export.class.inc.php +++ b/manager/includes/extenders/export.class.inc.php @@ -172,8 +172,7 @@ public function removeDirectoryAll($directory = '') */ public function makeFile($docid, $filepath) { - $modx = evolutionCMS(); - global $_lang; + $modx = evolutionCMS(); global $_lang; $file_permission = octdec($modx->config['new_file_permissions']); if ($this->generate_mode === 'direct') { $back_lang = $_lang; @@ -287,7 +286,7 @@ public function run($parent = 0) if ($row['published'] === '1') { $status = $this->makeFile($row['id'], $filename); switch ($status) { - case 'failed_no_write': + case 'failed_no_write' : $row['status'] = $msg_failed_no_write; break; case 'failed_no_retrieve': @@ -320,6 +319,7 @@ public function run($parent = 0) } mkdir($dir_path); @chmod($dir_path, $folder_permission); + } @@ -370,4 +370,5 @@ public function parsePlaceholder($tpl, $ph = array()) return $tpl; } + } diff --git a/manager/includes/extenders/maketable.class.php b/manager/includes/extenders/maketable.class.php index 2a9f4034b8..ccd716197b 100755 --- a/manager/includes/extenders/maketable.class.php +++ b/manager/includes/extenders/maketable.class.php @@ -332,10 +332,10 @@ public function getColumnWidth($columnPosition) public function determineRowClass($position) { switch ($this->rowAlternatingScheme) { - case 'ODD': + case 'ODD' : $modRemainder = 1; break; - case 'EVEN': + case 'EVEN' : default: $modRemainder = 0; break; @@ -441,7 +441,7 @@ public function create($fieldsArray, $fieldHeadersArray = array(), $linkpage = " $table .= $this->createCellText($currentActionFieldValue, $value); $table .= "\n"; if ($i == 0) { - if (empty($header) && $this->formElementType) { + if (empty ($header) && $this->formElementType) { $header .= "\t\tthClass ? 'class="' . $this->thClass . '"' : '') . ">" . ($this->allOption ? 'all' : '') . "\n"; } $headerText = array_key_exists($key, $fieldHeadersArray) ? $fieldHeadersArray[$key] : $key; @@ -471,6 +471,7 @@ public function create($fieldsArray, $fieldHeadersArray = array(), $linkpage = " */ $table .= ''; //$table .= ''; + } if ($this->allOption) { $table .= ' @@ -643,4 +644,5 @@ public function prepareOrderByLink($key, $text, $qs = '') return '' . $text . ''; } + } diff --git a/manager/includes/extenders/manager.api.class.inc.php b/manager/includes/extenders/manager.api.class.inc.php index 323e2a0d5a..b1643f1605 100755 --- a/manager/includes/extenders/manager.api.class.inc.php +++ b/manager/includes/extenders/manager.api.class.inc.php @@ -86,6 +86,7 @@ public function saveFormValues($id = 0) */ public function loadFormValues() { + if (!$this->hasFormValues()) { return false; } diff --git a/manager/includes/extenders/message.quit.inc.php b/manager/includes/extenders/message.quit.inc.php index 3830fa14c4..e076ce04c2 100755 --- a/manager/includes/extenders/message.quit.inc.php +++ b/manager/includes/extenders/message.quit.inc.php @@ -3,7 +3,7 @@ * Message Quit Template * */ -if ((! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) && IN_PARSER_MODE!="true") { +if(( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) && IN_PARSER_MODE!="true") { die("INCLUDE ACCESS ERROR

    Direct access to this file prohibited."); } @@ -20,60 +20,61 @@ function copyToClip() "; -if ($is_error) { - $parsedMessageString .= "

     MODX Parse Error

    +if($is_error) { + $parsedMessageString .= "

     MODX Parse Error

    "; } else { - $parsedMessageString .= "

     MODX Debug/ stop message

    + $parsedMessageString .= "

     MODX Debug/ stop message

    MODX encountered the following error while attempting to parse the requested resource:
    « $msg »
    "; } -if (!empty($query)) { - $parsedMessageString .= ""; } -if ($text!='') { - $errortype = array( - E_ERROR => "Error", - E_WARNING => "Warning", - E_PARSE => "Parsing Error", - E_NOTICE => "Notice", - E_CORE_ERROR => "Core Error", - E_CORE_WARNING => "Core Warning", - E_COMPILE_ERROR => "Compile Error", - E_COMPILE_WARNING => "Compile Warning", - E_USER_ERROR => "User Error", - E_USER_WARNING => "User Warning", - E_USER_NOTICE => "User Notice", - ); +if($text!='') { - $parsedMessageString .= ""; + $errortype = array ( + E_ERROR => "Error", + E_WARNING => "Warning", + E_PARSE => "Parsing Error", + E_NOTICE => "Notice", + E_CORE_ERROR => "Core Error", + E_CORE_WARNING => "Core Warning", + E_COMPILE_ERROR => "Compile Error", + E_COMPILE_WARNING => "Compile Warning", + E_USER_ERROR => "User Error", + E_USER_WARNING => "User Warning", + E_USER_NOTICE => "User Notice", + ); - $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; + $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; - if ($source!='') { - $parsedMessageString .= ""; - $parsedMessageString .= ""; - $parsedMessageString .= ""; - } + $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; + + $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; + if($source!='') { + $parsedMessageString .= ""; + $parsedMessageString .= ""; + $parsedMessageString .= ""; + } } $parsedMessageString .= ""; diff --git a/manager/includes/extenders/modifiers.class.inc.php b/manager/includes/extenders/modifiers.class.inc.php index 082f34e90e..da6e862edd 100755 --- a/manager/includes/extenders/modifiers.class.inc.php +++ b/manager/includes/extenders/modifiers.class.inc.php @@ -1,11 +1,8 @@ config['modx_charset']); - } + if (function_exists('mb_internal_encoding')) mb_internal_encoding($modx->config['modx_charset']); $this->condModifiers = '=,is,eq,equals,ne,neq,notequals,isnot,isnt,not,%,isempty,isnotempty,isntempty,>=,gte,eg,gte,greaterthan,>,gt,isgreaterthan,isgt,lowerthan,<,lt,<=,lte,islte,islowerthan,islt,el,find,in,inarray,in_array,fnmatch,wcard,wcard_match,wildcard,wildcard_match,is_file,is_dir,file_exists,is_readable,is_writable,is_image,regex,preg,preg_match,memberof,mo,isinrole,ir'; } @@ -75,15 +70,13 @@ public function __construct() * @param string $modifiers * @return bool|mixed|string */ - public function phxFilter($key, $value, $modifiers) + public function phxFilter($key,$value,$modifiers) { $modx = evolutionCMS(); - if (substr($modifiers, 0, 3)!=='id(') { - $value = $this->parseDocumentSource($value); - } + if(substr($modifiers,0,3)!=='id(') $value = $this->parseDocumentSource($value); $this->srcValue = $value; $modifiers = trim($modifiers); - $modifiers = ':' . trim($modifiers, ':'); + $modifiers = ':'.trim($modifiers,':'); $modifiers = str_replace(array("\r\n","\r"), "\n", $modifiers); $modifiers = $this->splitEachModifiers($modifiers); @@ -93,7 +86,7 @@ public function phxFilter($key, $value, $modifiers) $this->condition = array(); $this->vars = array(); $this->vars['name'] = & $key; - $value = $this->parsePhx($key, $value, $modifiers); + $value = $this->parsePhx($key,$value,$modifiers); $this->vars = array(); return $value; } @@ -103,18 +96,13 @@ public function phxFilter($key, $value, $modifiers) * @param string $modifiers * @return bool|string */ - public function _getDelim($mode, $modifiers) - { - $c = substr($modifiers, 0, 1); - if (!in_array($c, array('"', "'", '`'))) { - return false; - } + public function _getDelim($mode,$modifiers) { + $c = substr($modifiers,0,1); + if(!in_array($c, array('"', "'", '`')) ) return false; - $modifiers = substr($modifiers, 1); + $modifiers = substr($modifiers,1); $closure = $mode=='(' ? "{$c})" : $c; - if (strpos($modifiers, $closure)===false) { - return false; - } + if(strpos($modifiers, $closure)===false) return false; return $c; } @@ -125,157 +113,142 @@ public function _getDelim($mode, $modifiers) * @param string $modifiers * @return bool|string */ - public function _getOpt($mode, $delim, $modifiers) - { - if ($delim) { - if ($mode=='(') { - return substr($modifiers, 1, strpos($modifiers, $delim . ')')-1); - } + public function _getOpt($mode,$delim,$modifiers) { + if($delim) { + if($mode=='(') return substr($modifiers,1,strpos($modifiers, $delim . ')' )-1); - return substr($modifiers, 1, strpos($modifiers, $delim, 1)-1); - } else { - if ($mode=='(') { - return substr($modifiers, 0, strpos($modifiers, ')')); - } + return substr($modifiers,1,strpos($modifiers,$delim,1)-1); + } + else { + if($mode=='(') return substr($modifiers,0,strpos($modifiers, ')') ); $chars = str_split($modifiers); $opt=''; - foreach ($chars as $c) { - if ($c==':' || $c==')') { - break; - } + foreach($chars as $c) { + if($c==':' || $c==')') break; $opt .=$c; } return $opt; } } - public function _getRemainModifiers($mode, $delim, $modifiers) - { - if ($delim) { - if ($mode=='(') { + public function _getRemainModifiers($mode,$delim,$modifiers) { + if($delim) { + if($mode=='(') return $this->_fetchContent($modifiers, $delim . ')'); - } else { + else { $modifiers = trim($modifiers); - $modifiers = substr($modifiers, 1); + $modifiers = substr($modifiers,1); return $this->_fetchContent($modifiers, $delim); } - } else { - if ($mode=='(') { - return $this->_fetchContent($modifiers, ')'); - } + } + else { + if($mode=='(') return $this->_fetchContent($modifiers, ')'); $chars = str_split($modifiers); - foreach ($chars as $c) { - if ($c==':') { - return $modifiers; - } else { - $modifiers = substr($modifiers, 1); - } + foreach($chars as $c) { + if($c==':') return $modifiers; + else $modifiers = substr($modifiers,1); } return $modifiers; } } - public function _fetchContent($string, $delim) - { + public function _fetchContent($string,$delim) { $len = strlen($delim); $string = $this->parseDocumentSource($string); - return substr($string, strpos($string, $delim)+$len); + return substr($string,strpos($string, $delim)+$len); } - public function splitEachModifiers($modifiers) - { + public function splitEachModifiers($modifiers) { $modx = evolutionCMS(); $cmd = ''; $bt = ''; $result = array(); - while ($bt!==$modifiers) { + while($bt!==$modifiers) { $bt = $modifiers; - $c = substr($modifiers, 0, 1); - $modifiers = substr($modifiers, 1); + $c = substr($modifiers,0,1); + $modifiers = substr($modifiers,1); - if ($c===':' && preg_match('@^(!?[<>=]{1,2})@', $modifiers, $match)) { // :=, :!=, :<=, :>=, :!<=, :!>= - $c = substr($modifiers, strlen($match[1]), 1); + if($c===':' && preg_match('@^(!?[<>=]{1,2})@', $modifiers, $match)) { // :=, :!=, :<=, :>=, :!<=, :!>= + $c = substr($modifiers,strlen($match[1]),1); $debuginfo = "#i=0 #c=[{$c}] #m=[{$modifiers}]"; - if ($c==='(') { - $modifiers = substr($modifiers, strlen($match[1])+1); - } else { - $modifiers = substr($modifiers, strlen($match[1])); - } + if($c==='(') $modifiers = substr($modifiers,strlen($match[1])+1); + else $modifiers = substr($modifiers,strlen($match[1])); - $delim = $this->_getDelim($c, $modifiers); - $opt = $this->_getOpt($c, $delim, $modifiers); - $modifiers = trim($this->_getRemainModifiers($c, $delim, $modifiers)); + $delim = $this->_getDelim($c,$modifiers); + $opt = $this->_getOpt($c,$delim,$modifiers); + $modifiers = trim($this->_getRemainModifiers($c,$delim,$modifiers)); $result[]=array('cmd'=>trim($match[1]),'opt'=>$opt,'debuginfo'=>$debuginfo); $cmd = ''; - } elseif (in_array($c, array('+','-','*','/')) && preg_match('@^[0-9]+@', $modifiers, $match)) { // :+3, :-3, :*3 ... - $modifiers = substr($modifiers, strlen($match[0])); - $result[]=array('cmd'=>'math','opt'=>'%s' . $c . $match[0]); + } + elseif(in_array($c,array('+','-','*','/')) && preg_match('@^[0-9]+@', $modifiers, $match)) { // :+3, :-3, :*3 ... + $modifiers = substr($modifiers,strlen($match[0])); + $result[]=array('cmd'=>'math','opt'=>'%s'.$c.$match[0]); $cmd = ''; - } elseif ($c==='(' || $c==='=') { + } + elseif($c==='(' || $c==='=') { $modifiers = $m1 = trim($modifiers); - $delim = $this->_getDelim($c, $modifiers); - $opt = $this->_getOpt($c, $delim, $modifiers); - $modifiers = trim($this->_getRemainModifiers($c, $delim, $modifiers)); + $delim = $this->_getDelim($c,$modifiers); + $opt = $this->_getOpt($c,$delim,$modifiers); + $modifiers = trim($this->_getRemainModifiers($c,$delim,$modifiers)); $debuginfo = "#i=1 #c=[{$c}] #delim=[{$delim}] #m1=[{$m1}] remainMdf=[{$modifiers}]"; $result[]=array('cmd'=>trim($cmd),'opt'=>$opt,'debuginfo'=>$debuginfo); $cmd = ''; - } elseif ($c==':') { + } + elseif($c==':') { $debuginfo = "#i=2 #c=[{$c}] #m=[{$modifiers}]"; - if ($cmd!=='') { - $result[]=array('cmd'=>trim($cmd),'opt'=>'','debuginfo'=>$debuginfo); - } + if($cmd!=='') $result[]=array('cmd'=>trim($cmd),'opt'=>'','debuginfo'=>$debuginfo); $cmd = ''; - } elseif (trim($modifiers)=='' && trim($cmd)!=='') { + } + elseif(trim($modifiers)=='' && trim($cmd)!=='') { $debuginfo = "#i=3 #c=[{$c}] #m=[{$modifiers}]"; $cmd .= $c; $result[]=array('cmd'=>trim($cmd),'opt'=>'','debuginfo'=>$debuginfo); break; - } else { + } + else { $cmd .= $c; } } - if (empty($result)) { - return array(); - } + if(empty($result)) return array(); - foreach ($result as $i=>$a) { + foreach($result as $i=>$a) + { $a['opt'] = $this->parseDocumentSource($a['opt']); - $result[$i]['opt'] = $modx->mergePlaceholderContent($a['opt'], $this->placeholders); + $result[$i]['opt'] = $modx->mergePlaceholderContent($a['opt'],$this->placeholders); } return $result; } - public function parsePhx($key, $value, $modifiers) + public function parsePhx($key,$value,$modifiers) { $modx = evolutionCMS(); $lastKey = ''; - $cacheKey = md5(sprintf('parsePhx#%s#%s#%s', $key, $value, print_r($modifiers, true))); - if (isset($this->tmpCache[$cacheKey])) { - return $this->tmpCache[$cacheKey]; - } - if (empty($modifiers)) { - return ''; - } + $cacheKey = md5(sprintf('parsePhx#%s#%s#%s',$key,$value,print_r($modifiers,true))); + if(isset($this->tmpCache[$cacheKey])) return $this->tmpCache[$cacheKey]; + if(empty($modifiers)) return ''; - foreach ($modifiers as $m) { + foreach($modifiers as $m) + { $lastKey = strtolower($m['cmd']); } - $_ = explode(',', $this->condModifiers); - if (in_array($lastKey, $_)) { + $_ = explode(',',$this->condModifiers); + if(in_array($lastKey,$_)) + { $modifiers[] = array('cmd'=>'then','opt'=>'1'); $modifiers[] = array('cmd'=>'else','opt'=>'0'); } - foreach ($modifiers as $i=>$a) { - $value = $this->Filter($key, $value, $a['cmd'], $a['opt']); + foreach($modifiers as $i=>$a) + { + $value = $this->Filter($key,$value, $a['cmd'], $a['opt']); } $this->tmpCache[$cacheKey] = $value; return $value; @@ -286,71 +259,56 @@ public function Filter($key, $value, $cmd, $opt='') { $modx = evolutionCMS(); - if ($key==='documentObject') { - $value = $modx->documentIdentifier; - } + if($key==='documentObject') $value = $modx->documentIdentifier; $cmd = $this->parseDocumentSource($cmd); - if (preg_match('@^[1-9][/0-9]*$@', $cmd)) { - if (strpos($cmd, '/')!==false) { - $cmd = $this->substr($cmd, strrpos($cmd, '/')+1); - } + if(preg_match('@^[1-9][/0-9]*$@',$cmd)) + { + if(strpos($cmd,'/')!==false) + $cmd = $this->substr($cmd,strrpos($cmd,'/')+1); $opt = $cmd; $cmd = 'id'; } - if (isset($modx->snippetCache["phx:{$cmd}"])) { - $this->elmName = "phx:{$cmd}"; - } elseif (isset($modx->chunkCache["phx:{$cmd}"])) { - $this->elmName = "phx:{$cmd}"; - } else { - $this->elmName = ''; - } + if(isset($modx->snippetCache["phx:{$cmd}"])) $this->elmName = "phx:{$cmd}"; + elseif(isset($modx->chunkCache["phx:{$cmd}"])) $this->elmName = "phx:{$cmd}"; + else $this->elmName = ''; $cmd = strtolower($cmd); - if ($this->elmName!=='') { + if($this->elmName!=='') $value = $this->getValueFromElement($key, $value, $cmd, $opt); - } else { + else $value = $this->getValueFromPreset($key, $value, $cmd, $opt); - } $value = str_replace('[+key+]', $key, $value); return $value; } - public function isEmpty($cmd, $value) + public function isEmpty($cmd,$value) { - if ($value!=='') { - return false; - } + if($value!=='') return false; $_ = explode(',', $this->condModifiers . ',_default,default,if,input,or,and,show,this,select,switch,then,else,id,ifempty,smart_desc,smart_description,summary'); - if (in_array($cmd, $_)) { - return false; - } else { - return true; - } + if(in_array($cmd,$_)) return false; + else return true; } public function getValueFromPreset($key, $value, $cmd, $opt) { $modx = evolutionCMS(); - if ($this->isEmpty($cmd, $value)) { - return ''; - } + if($this->isEmpty($cmd,$value)) return ''; $this->key = $key; $this->value = $value; $this->opt = $opt; - switch ($cmd) { + switch ($cmd) + { ##### Conditional Modifiers case 'input': case 'if': - if (!$opt) { - return $value; - } + if(!$opt) return $value; return $opt; case '=': case 'eq': @@ -411,35 +369,22 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'file_exists': case 'is_readable': case 'is_writable': - if (!$opt) { - $path = $value; - } else { - $path = $opt; - } - if (strpos($path, MODX_MANAGER_PATH)!==false) { - exit('Can not read core path'); - } - if (strpos($path, $modx->config['base_path'])===false) { - $path = ltrim($path, '/'); - } + if(!$opt) $path = $value; + else $path = $opt; + if(strpos($path,MODX_MANAGER_PATH)!==false) exit('Can not read core path'); + if(strpos($path,$modx->config['base_path'])===false) $path = ltrim($path,'/'); $this->condition[] = (int)($cmd($path)!==false);break; case 'is_image': - if (!$opt) { - $path = $value; - } else { - $path = $opt; - } - if (!is_file($path)) { - $this->condition[]='0'; - break; - } + if(!$opt) $path = $value; + else $path = $opt; + if(!is_file($path)) {$this->condition[]='0';break;} $_ = getimagesize($path); $this->condition[] = (int)($_[0]);break; case 'regex': case 'preg': case 'preg_match': case 'isinrole': - $this->condition[] = (int)(preg_match($opt, $value));break; + $this->condition[] = (int)(preg_match($opt,$value));break; case 'ir': case 'memberof': case 'mo': @@ -452,55 +397,45 @@ public function getValueFromPreset($key, $value, $cmd, $opt) $this->condition[] = '&&';break; case 'show': case 'this': - $conditional = implode(' ', $this->condition); + $conditional = implode(' ',$this->condition); $isvalid = (int)(eval("return ({$conditional});")); - if ($isvalid) { - return $this->srcValue; - } - return null; + if ($isvalid) return $this->srcValue; + return NULL; case 'then': - $conditional = implode(' ', $this->condition); + $conditional = implode(' ',$this->condition); $isvalid = (int)eval("return ({$conditional});"); - if ($isvalid) { - return $opt; - } + if ($isvalid) return $opt; return null; case 'else': - $conditional = implode(' ', $this->condition); + $conditional = implode(' ',$this->condition); $isvalid = (int)eval("return ({$conditional});"); - if (!$isvalid) { - return $opt; - } + if (!$isvalid) return $opt; break; case 'select': case 'switch': - $raw = explode('&', $opt); + $raw = explode('&',$opt); $map = array(); $c = count($raw); - for ($m=0; $m<$c; $m++) { - $mi = explode('=', $raw[$m], 2); + for($m=0; $m<$c; $m++) { + $mi = explode('=',$raw[$m],2); $map[$mi[0]] = $mi[1]; } - if (isset($map[$value])) { - return $map[$value]; - } else { - return ''; - } + if(isset($map[$value])) return $map[$value]; + else return ''; ##### End of Conditional Modifiers ##### Encode / Decode / Hash / Escape - // no break case 'htmlent': case 'htmlentities': - return htmlentities($value, ENT_QUOTES, $modx->config['modx_charset']); + return htmlentities($value,ENT_QUOTES,$modx->config['modx_charset']); case 'html_entity_decode': case 'decode_html': case 'html_decode': - return html_entity_decode($value, ENT_QUOTES, $modx->config['modx_charset']); + return html_entity_decode($value,ENT_QUOTES,$modx->config['modx_charset']); case 'esc': case 'escape': $value = preg_replace('/&(#[0-9]+|[a-z]+);/i', '&$1;', htmlspecialchars($value, ENT_QUOTES, $modx->config['modx_charset'])); - return str_replace(array('[', ']', '`'), array('[', ']', '`'), $value); + return str_replace(array('[', ']', '`'),array('[', ']', '`'),$value); case 'sql_escape': case 'encode_js': return $modx->db->escape($value); @@ -510,45 +445,40 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'html_encode': return preg_replace('/&(#[0-9]+|[a-z]+);/i', '&$1;', htmlspecialchars($value, ENT_QUOTES, $modx->config['modx_charset'])); case 'spam_protect': - return str_replace(array('@','.'), array('@','.'), $value); + return str_replace(array('@','.'),array('@','.'),$value); case 'strip': - if ($opt==='') { - $opt = ' '; - } + if($opt==='') $opt = ' '; return preg_replace('/[\n\r\t\s]+/', $opt, $value); case 'strip_linefeeds': return str_replace(array("\n","\r"), '', $value); case 'notags': case 'strip_tags': case 'remove_html': - if ($opt!=='') { + if($opt!=='') + { $param = array(); - foreach (explode(',', $opt) as $v) { - $v = trim($v, ' '); + foreach(explode(',',$opt) as $v) + { + $v = trim($v,' '); $param[] = "<{$v}>"; } - $params = implode(',', $param); - } else { - $params = ''; + $params = implode(',',$param); } - if (!strpos($params, '
    ')===false) { - $value = preg_replace('@()\n@', '$1', $value); - $value = preg_replace('@@', "\n", $value); + else $params = ''; + if(!strpos($params,'
    ')===false) { + $value = preg_replace('@()\n@','$1',$value); + $value = preg_replace('@@',"\n",$value); } - return $this->strip_tags($value, $params); + return $this->strip_tags($value,$params); case 'urlencode': case 'url_encode': case 'encode_url': return urlencode($value); case 'base64_decode': - if ($opt!=='false') { - $opt = true; - } else { - $opt = false; - } - return base64_decode($value, $opt); + if($opt!=='false') $opt = true; + else $opt = false; + return base64_decode($value,$opt); case 'encode_sha1': $cmd = 'sha1'; - // no break case 'addslashes': case 'urldecode': case 'url_decode': @@ -571,21 +501,18 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'upper_case': return $this->strtoupper($value); case 'capitalize': - $_ = explode(' ', $value); - foreach ($_ as $i=>$v) { + $_ = explode(' ',$value); + foreach($_ as $i=>$v) + { $_[$i] = ucfirst($v); } - return implode(' ', $_); + return implode(' ',$_); case 'zenhan': - if (empty($opt)) { - $opt='VKas'; - } - return mb_convert_kana($value, $opt, $modx->config['modx_charset']); + if(empty($opt)) $opt='VKas'; + return mb_convert_kana($value,$opt,$modx->config['modx_charset']); case 'hanzen': - if (empty($opt)) { - $opt='VKAS'; - } - return mb_convert_kana($value, $opt, $modx->config['modx_charset']); + if(empty($opt)) $opt='VKAS'; + return mb_convert_kana($value,$opt,$modx->config['modx_charset']); case 'str_shuffle': case 'shuffle': return $this->str_shuffle($value); @@ -599,7 +526,7 @@ public function getValueFromPreset($key, $value, $cmd, $opt) return $this->strlen($value); case 'count_words': $value = trim($value); - return count(preg_split('/\s+/', $value)); + return count(preg_split('/\s+/',$value)); case 'str_word_count': case 'word_count': case 'wordcount': @@ -607,69 +534,55 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'count_paragraphs': $value = trim($value); $value = preg_replace('/\r/', '', $value); - return count(preg_split('/\n+/', $value)); + return count(preg_split('/\n+/',$value)); case 'strpos': - if ($opt!=0&&empty($opt)) { - return $value; - } - return $this->strpos($value, $opt); + if($opt!=0&&empty($opt)) return $value; + return $this->strpos($value,$opt); case 'wordwrap': // default: 70 $wrapat = (int)$opt > 0 ? (int)$opt : 70; - if (version_compare(PHP_VERSION, '5.3.0') >= 0) { - return $this->includeMdfFile('wordwrap'); - } else { - return preg_replace("@(\b\w+\b)@e", "wordwrap('\\1',\$wrapat,' ',1)", $value); - } - // no break + if (version_compare(PHP_VERSION, '5.3.0') >= 0) return $this->includeMdfFile('wordwrap'); + else return preg_replace("@(\b\w+\b)@e","wordwrap('\\1',\$wrapat,' ',1)",$value); case 'wrap_text': - $width = preg_match('/^[1-9][0-9]*$/', $opt) ? $opt : 70; - if ($modx->config['manager_language']==='japanese-utf8') { + $width = preg_match('/^[1-9][0-9]*$/',$opt) ? $opt : 70; + if($modx->config['manager_language']==='japanese-utf8') { $chunk = array(); $bt=''; - while ($bt!=$value) { + while($bt!=$value) { $bt = $value; - if ($this->strlen($value)<$width) { + if($this->strlen($value)<$width) { $chunk[] = $value; break; } - $chunk[] = $this->substr($value, 0, $width); - $value = $this->substr($value, $width); + $chunk[] = $this->substr($value,0,$width); + $value = $this->substr($value,$width); } - return implode("\n", $chunk); - } else { - return wordwrap($value, $width, "\n", true); + return implode("\n",$chunk); } - // no break + else + return wordwrap($value,$width,"\n",true); case 'substr': - if (empty($opt)) { - break; + if(empty($opt)) break; + if(strpos($opt,',')!==false) { + list($b,$e) = explode(',',$opt,2); + return $this->substr($value,$b,(int)$e); } - if (strpos($opt, ',')!==false) { - list($b, $e) = explode(',', $opt, 2); - return $this->substr($value, $b, (int)$e); - } else { - return $this->substr($value, $opt); - } - // no break + else return $this->substr($value,$opt); case 'limit': case 'trim_to': // http://www.movabletype.jp/documentation/appendices/modifiers/trim_to.html - if (strpos($opt, '+')!==false) { - list($len, $str) = explode('+', $opt, 2); - } else { + if(strpos($opt,'+')!==false) + list($len,$str) = explode('+',$opt,2); + else { $len = $opt; $str = ''; } - if ($len==='') { - $len = 100; - } - if (abs($len) > $this->strlen($value)) { - $str =''; + if($len==='') $len = 100; + if(abs($len) > $this->strlen($value)) $str =''; + if(preg_match('/^[1-9][0-9]*$/',$len)) { + return $this->substr($value,0,$len) . $str; } - if (preg_match('/^[1-9][0-9]*$/', $len)) { - return $this->substr($value, 0, $len) . $str; - } elseif (preg_match('/^\-[1-9][0-9]*$/', $len)) { - return $str . $this->substr($value, $len); + elseif(preg_match('/^\-[1-9][0-9]*$/',$len)) { + return $str . $this->substr($value,$len); } break; case 'summary': @@ -678,119 +591,82 @@ public function getValueFromPreset($key, $value, $cmd, $opt) return $this->includeMdfFile('summary'); case 'replace': case 'str_replace': - if (empty($opt) || strpos($opt, ',')===false) { - break; - } - if (substr_count($opt, ',') ==1) { - $delim = ','; - } elseif (substr_count($opt, '|') ==1) { - $delim = '|'; - } elseif (substr_count($opt, '=>')==1) { - $delim = '=>'; - } elseif (substr_count($opt, '/') ==1) { - $delim = '/'; - } else { - break; - } - list($s, $r) = explode($delim, $opt); - if ($value!=='') { - return str_replace($s, $r, $value); - } + if(empty($opt) || strpos($opt,',')===false) break; + if (substr_count($opt, ',') ==1) $delim = ','; + elseif(substr_count($opt, '|') ==1) $delim = '|'; + elseif(substr_count($opt, '=>')==1) $delim = '=>'; + elseif(substr_count($opt, '/') ==1) $delim = '/'; + else break; + list($s,$r) = explode($delim,$opt); + if($value!=='') return str_replace($s,$r,$value); break; case 'replace_to': case 'tpl': - if ($value!=='') { - return str_replace(array('[+value+]','[+output+]','{value}','%s'), $value, $opt); - } + if($value!=='') return str_replace(array('[+value+]','[+output+]','{value}','%s'),$value,$opt); break; case 'eachtpl': - $value = explode('||', $value); + $value = explode('||',$value); $_ = array(); - foreach ($value as $v) { - $_[] = str_replace(array('[+value+]','[+output+]','{value}','%s'), $v, $opt); + foreach($value as $v) { + $_[] = str_replace(array('[+value+]','[+output+]','{value}','%s'),$v,$opt); } return implode("\n", $_); case 'array_pop': case 'array_shift': - if (strpos($value, '||')!==false) { - $delim = '||'; - } else { - $delim = ','; - } - return $cmd(explode($delim, $value)); + if(strpos($value,'||')!==false) $delim = '||'; + else $delim = ','; + return $cmd(explode($delim,$value)); case 'preg_replace': case 'regex_replace': - if (empty($opt) || strpos($opt, ',')===false) { - break; - } - list($s, $r) = explode(',', $opt, 2); - if ($value!=='') { - return preg_replace($s, $r, $value); - } + if(empty($opt) || strpos($opt,',')===false) break; + list($s,$r) = explode(',',$opt,2); + if($value!=='') return preg_replace($s,$r,$value); break; case 'cat': case 'concatenate': case '.': - if ($value!=='') { - return $value . $opt; - } + if($value!=='') return $value . $opt; break; case 'sprintf': case 'string_format': - if ($value!=='') { - return sprintf($opt, $value); - } + if($value!=='') return sprintf($opt,$value); break; case 'number_format': - if ($opt=='') { - $opt = 0; - } - return number_format($value, $opt); + if($opt=='') $opt = 0; + return number_format($value,$opt); case 'money_format': - setlocale(LC_MONETARY, setlocale(LC_TIME, 0)); - if ($value!=='') { - return money_format($opt, (double)$value); - } + setlocale(LC_MONETARY,setlocale(LC_TIME,0)); + if($value!=='') return money_format($opt,(double)$value); break; case 'tobool': return boolval($value); case 'nl2lf': - if ($value!=='') { - return str_replace(array("\r\n","\n", "\r"), '\n', $value); - } + if($value!=='') return str_replace(array("\r\n","\n", "\r"), '\n', $value); break; case 'br2nl': return preg_replace('@@i', "\n", $value); case 'nl2br': - if (version_compare(PHP_VERSION, '5.3.0', '<')) { + if (version_compare(PHP_VERSION, '5.3.0', '<')) return nl2br($value); - } - if ($opt!=='') { + if($opt!=='') + { $opt = trim($opt); $opt = strtolower($opt); - if ($opt==='false') { - $opt = false; - } elseif ($opt==='0') { - $opt = false; - } else { - $opt = true; - } - } elseif (isset($modx->config['mce_element_format'])&&$modx->config['mce_element_format']==='html') { - $opt = false; - } else { - $opt = true; - } - return nl2br($value, $opt); + if($opt==='false') $opt = false; + elseif($opt==='0') $opt = false; + else $opt = true; + } + elseif(isset($modx->config['mce_element_format'])&&$modx->config['mce_element_format']==='html') + $opt = false; + else $opt = true; + return nl2br($value,$opt); case 'ltrim': case 'rtrim': case 'trim': // ref http://mblo.info/modifiers/custom-modifiers/rtrim_opt.html - if ($opt==='') { + if($opt==='') return $cmd($value); - } else { - return $cmd($value, $opt); - } + else return $cmd($value,$opt); // These are all straight wrappers for PHP functions - // no break case 'ucfirst': case 'lcfirst': case 'ucwords': @@ -800,26 +676,16 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'strftime': case 'date': case 'dateformat': - if (empty($opt)) { - $opt = $modx->toDateFormat(null, 'formatOnly'); - } - if (!preg_match('@^[0-9]+$@', $value)) { - $value = strtotime($value); - } - if (strpos($opt, '%')!==false) { - return strftime($opt, 0+$value); - } else { - return date($opt, 0+$value); - } - // no break + if(empty($opt)) $opt = $modx->toDateFormat(null, 'formatOnly'); + if(!preg_match('@^[0-9]+$@',$value)) $value = strtotime($value); + if(strpos($opt,'%')!==false) + return strftime($opt,0+$value); + else + return date($opt,0+$value); case 'time': - if (empty($opt)) { - $opt = '%H:%M'; - } - if (!preg_match('@^[0-9]+$@', $value)) { - $value = strtotime($value); - } - return strftime($opt, 0+$value); + if(empty($opt)) $opt = '%H:%M'; + if(!preg_match('@^[0-9]+$@',$value)) $value = strtotime($value); + return strftime($opt,0+$value); case 'strtotime': return strtotime($value); ##### mathematical function @@ -828,13 +694,11 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'tofloat': return floatval($value); case 'round': - if (!$opt) { - $opt = 0; - } - return $cmd($value, $opt); + if(!$opt) $opt = 0; + return $cmd($value,$opt); case 'max': case 'min': - return $cmd(explode(',', $value)); + return $cmd(explode(',',$value)); case 'floor': case 'ceil': case 'abs': @@ -842,42 +706,28 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'math': case 'calc': $value = (int)$value; - if (empty($value)) { - $value = '0'; - } - $filter = str_replace(array('[+value+]','[+output+]','{value}','%s'), '?', $opt); - $filter = preg_replace('@([a-zA-Z\n\r\t\s])@', '', $filter); - if (strpos($filter, '?')===false) { - $filter = "?{$filter}"; - } - $filter = str_replace('?', $value, $filter); + if(empty($value)) $value = '0'; + $filter = str_replace(array('[+value+]','[+output+]','{value}','%s'),'?',$opt); + $filter = preg_replace('@([a-zA-Z\n\r\t\s])@','',$filter); + if(strpos($filter,'?')===false) $filter = "?{$filter}"; + $filter = str_replace('?',$value,$filter); return eval("return {$filter};"); case 'count': - if ($value=='') { - return 0; - } - $value = explode(',', $value); + if($value=='') return 0; + $value = explode(',',$value); return count($value); case 'sort': case 'rsort': - if (strpos($value, "\n")!==false) { - $delim="\n"; - } else { - $delim = ','; - } - $swap = explode($delim, $value); - if (!$opt) { - $opt = SORT_REGULAR; - } else { - $opt = constant($opt); - } - $cmd($swap, $opt); - return implode($delim, $swap); + if(strpos($value,"\n")!==false) $delim="\n"; + else $delim = ','; + $swap = explode($delim,$value); + if(!$opt) $opt = SORT_REGULAR; + else $opt = constant($opt); + $cmd($swap,$opt); + return implode($delim,$swap); ##### Resource fields case 'id': - if ($opt) { - return $this->getDocumentObject($opt, $key); - } + if($opt) return $this->getDocumentObject($opt,$key); break; case 'type': case 'contenttype': @@ -914,44 +764,36 @@ public function getValueFromPreset($key, $value, $cmd, $opt) case 'privatemgr': case 'content_dispo': case 'hidemenu': - if ($cmd==='contenttype') { - $cmd = 'contentType'; - } - return $this->getDocumentObject($value, $cmd); + if($cmd==='contenttype') $cmd = 'contentType'; + return $this->getDocumentObject($value,$cmd); case 'title': - $pagetitle = $this->getDocumentObject($value, 'pagetitle'); - $longtitle = $this->getDocumentObject($value, 'longtitle'); + $pagetitle = $this->getDocumentObject($value,'pagetitle'); + $longtitle = $this->getDocumentObject($value,'longtitle'); return $longtitle ? $longtitle : $pagetitle; case 'shorttitle': - $pagetitle = $this->getDocumentObject($value, 'pagetitle'); - $menutitle = $this->getDocumentObject($value, 'menutitle'); + $pagetitle = $this->getDocumentObject($value,'pagetitle'); + $menutitle = $this->getDocumentObject($value,'menutitle'); return $menutitle ? $menutitle : $pagetitle; case 'templatename': - $rs = $modx->db->select('templatename', '[+prefix+]site_templates', "id='{$value}'"); + $rs = $modx->db->select('templatename','[+prefix+]site_templates',"id='{$value}'"); $templateName = $modx->db->getValue($rs); return !$templateName ? '(blank)' : $templateName; case 'getfield': - if (!$opt) { - $opt = 'content'; - } - return $modx->getField($opt, $value); + if(!$opt) $opt = 'content'; + return $modx->getField($opt,$value); case 'children': case 'childids': - if ($value=='') { - $value = 0; - } // 値がない場合はルートと見なす + if($value=='') $value = 0; // 値がない場合はルートと見なす $published = 1; - if ($opt=='') { - $opt = 'page'; - } - $_ = explode(',', $opt); + if($opt=='') $opt = 'page'; + $_ = explode(',',$opt); $where = array(); - foreach ($_ as $opt) { - switch (trim($opt)) { - case 'page': case '!folder': case '!isfolder': $where[] = 'sc.isfolder=0'; break; - case 'folder': case 'isfolder': $where[] = 'sc.isfolder=1'; break; - case 'menu': case 'show_menu': $where[] = 'sc.hidemenu=0'; break; - case '!menu': case '!show_menu': $where[] = 'sc.hidemenu=1'; break; + foreach($_ as $opt) { + switch(trim($opt)) { + case 'page'; case '!folder'; case '!isfolder': $where[] = 'sc.isfolder=0'; break; + case 'folder'; case 'isfolder': $where[] = 'sc.isfolder=1'; break; + case 'menu'; case 'show_menu': $where[] = 'sc.hidemenu=0'; break; + case '!menu'; case '!show_menu': $where[] = 'sc.hidemenu=1'; break; case 'published': $published = 1; break; case '!published': $published = 0; break; } @@ -959,105 +801,75 @@ public function getValueFromPreset($key, $value, $cmd, $opt) $where = implode(' AND ', $where); $children = $modx->getDocumentChildren($value, $published, '0', 'id', $where); $result = array(); - foreach ((array)$children as $child) { + foreach((array)$children as $child){ $result[] = $child['id']; } return implode(',', $result); case 'fullurl': - if (!is_numeric($value)) { - return $value; - } + if(!is_numeric($value)) return $value; return $modx->makeUrl($value); case 'makeurl': - if (!is_numeric($value)) { - return $value; - } - if (!$opt) { - $opt = 'full'; - } - return $modx->makeUrl($value, '', '', $opt); + if(!is_numeric($value)) return $value; + if(!$opt) $opt = 'full'; + return $modx->makeUrl($value,'','',$opt); ##### File system case 'getimageinfo': case 'imageinfo': - if (!is_file($value)) { - return ''; - } + if(!is_file($value)) return ''; $_ = getimagesize($value); - if (!$_[0]) { - return ''; - } + if(!$_[0]) return ''; $info['width'] = $_[0]; $info['height'] = $_[1]; - if ($_[0] > $_[1]) { - $info['aspect'] = 'landscape'; - } elseif ($_[0] < $_[1]) { - $info['aspect'] = 'portrait'; - } else { - $info['aspect'] = 'square'; - } - switch ($_[2]) { - case IMAGETYPE_GIF: $info['type'] = 'gif'; break; - case IMAGETYPE_JPEG: $info['type'] = 'jpg'; break; - case IMAGETYPE_PNG: $info['type'] = 'png'; break; - default: $info['type'] = 'unknown'; + if ($_[0] > $_[1]) $info['aspect'] = 'landscape'; + elseif($_[0] < $_[1]) $info['aspect'] = 'portrait'; + else $info['aspect'] = 'square'; + switch($_[2]) { + case IMAGETYPE_GIF : $info['type'] = 'gif'; break; + case IMAGETYPE_JPEG : $info['type'] = 'jpg'; break; + case IMAGETYPE_PNG : $info['type'] = 'png'; break; + default : $info['type'] = 'unknown'; } $info['attrib'] = $_[3]; - switch ($opt) { - case 'width': return $info['width']; + switch($opt) { + case 'width' : return $info['width']; case 'height': return $info['height']; case 'aspect': return $info['aspect']; - case 'type': return $info['type']; + case 'type' : return $info['type']; case 'attrib': return $info['attrib']; - default: return print_r($info, true); + default : return print_r($info,true); } - // no break case 'file_get_contents': case 'readfile': - if (!is_file($value)) { - return $value; - } + if(!is_file($value)) return $value; $value = realpath($value); - if (strpos($value, MODX_MANAGER_PATH)!==false) { - exit('Can not read core file'); - } - $ext = strtolower(substr($value, -4)); - if ($ext==='.php') { - exit('Can not read php file'); - } - if ($ext==='.cgi') { - exit('Can not read cgi file'); - } + if(strpos($value,MODX_MANAGER_PATH)!==false) exit('Can not read core file'); + $ext = strtolower(substr($value,-4)); + if($ext==='.php') exit('Can not read php file'); + if($ext==='.cgi') exit('Can not read cgi file'); return file_get_contents($value); case 'filesize': - if ($value == '') { - return ''; - } + if($value == '') return ''; $filename = $value; $site_url = $modx->config['site_url']; - if (strpos($filename, $site_url) === 0) { - $filename = substr($filename, 0, strlen($site_url)); - } - $filename = trim($filename, '/'); + if(strpos($filename,$site_url) === 0) + $filename = substr($filename,0,strlen($site_url)); + $filename = trim($filename,'/'); - $opt = trim($opt, '/'); - if ($opt!=='') { - $opt .= '/'; - } + $opt = trim($opt,'/'); + if($opt!=='') $opt .= '/'; - $filename = MODX_BASE_PATH . $opt . $filename; + $filename = MODX_BASE_PATH.$opt.$filename; - if (is_file($filename)) { + if(is_file($filename)){ clearstatcache(); $size = filesize($filename); return $size; - } else { - return ''; } + else return ''; ##### User info - // no break case 'username': case 'fullname': case 'role': @@ -1084,56 +896,41 @@ public function getValueFromPreset($key, $value, $cmd, $opt) $this->opt = $cmd; return $this->includeMdfFile('moduser'); case 'userinfo': - if (empty($opt)) { - $this->opt = 'username'; - } + if(empty($opt)) $this->opt = 'username'; return $this->includeMdfFile('moduser'); case 'webuserinfo': - if (empty($opt)) { - $this->opt = 'username'; - } + if(empty($opt)) $this->opt = 'username'; $this->value = -$value; return $this->includeMdfFile('moduser'); ##### Special functions case 'ifempty': case '_default': case 'default': - if (empty($value)) { - return $opt; - } break; + if (empty($value)) return $opt; break; case 'ifnotempty': - if (!empty($value)) { - return $opt; - } break; + if (!empty($value)) return $opt; break; case 'datagrid': include_once(MODX_CORE_PATH . 'controls/datagrid.class.php'); $grd = new DataGrid(null, trim($value)); $grd->itemStyle = ''; $grd->altItemStyle = ''; - $pos = strpos($value, "\n"); - if ($pos) { - $_ = substr($value, 0, $pos); - } else { - $_ = $pos; - } - $grd->cdelim = strpos($_, "\t")!==false ? 'tab' : ','; + $pos = strpos($value,"\n"); + if($pos) $_ = substr($value,0,$pos); + else $_ = $pos; + $grd->cdelim = strpos($_,"\t")!==false ? 'tab' : ','; return $grd->render(); case 'rotate': case 'evenodd': - if (strpos($opt, ',')===false) { - $opt = 'odd,even'; - } + if(strpos($opt,',')===false) $opt = 'odd,even'; $_ = explode(',', $opt); $c = count($_); $i = $value + $c; $i = $i % $c; return $_[$i]; case 'takeval': - $arr = explode(",", $opt); + $arr = explode(",",$opt); $idx = $value; - if (!is_numeric($idx)) { - return $value; - } + if(!is_numeric($idx)) return $value; return $arr[$idx]; case 'getimage': return $this->includeMdfFile('getimage'); @@ -1141,21 +938,17 @@ public function getValueFromPreset($key, $value, $cmd, $opt) return $modx->nicesize($value); case 'googlemap': case 'googlemaps': - if (empty($opt)) { - $opt = 'border:none;width:500px;height:350px;'; - } + if(empty($opt)) $opt = 'border:none;width:500px;height:350px;'; $tpl = ''; $ph['style'] = $opt; $ph['value'] = $value; - return $modx->parseText($tpl, $ph); + return $modx->parseText($tpl,$ph); case 'youtube': case 'youtube16x9': - if (empty($opt)) { - $opt = 560; - } + if(empty($opt)) $opt = 560; $h = round($opt*0.5625); $tpl = ''; - return sprintf($tpl, $opt, $h, $value); + return sprintf($tpl,$opt,$h,$value); //case 'youtube4x3':%s*0.75+25 case 'setvar': $modx->placeholders[$opt] = $value; @@ -1185,77 +978,66 @@ public function getValueFromPreset($key, $value, $cmd, $opt) return $value; } - public function includeMdfFile($cmd) - { + public function includeMdfFile($cmd) { $modx = evolutionCMS(); $key = $this->key; $value = $this->value; $opt = $this->opt; - return include(MODX_CORE_PATH . "extenders/modifiers/mdf_{$cmd}.inc.php"); + return include(MODX_CORE_PATH."extenders/modifiers/mdf_{$cmd}.inc.php"); } public function getValueFromElement($key, $value, $cmd, $opt) { $modx = evolutionCMS(); - if (isset($modx->snippetCache[$this->elmName])) { + if( isset($modx->snippetCache[$this->elmName]) ) + { $php = $modx->snippetCache[$this->elmName]; - } else { + } + else + { $esc_elmName = $modx->db->escape($this->elmName); - $result = $modx->db->select('snippet', '[+prefix+]site_snippets', "name='{$esc_elmName}'"); + $result = $modx->db->select('snippet','[+prefix+]site_snippets',"name='{$esc_elmName}'"); $total = $modx->db->getRecordCount($result); - if ($total == 1) { + if($total == 1) + { $row = $modx->db->getRow($result); $php = $row['snippet']; - } elseif ($total == 0) { - $assets_path = MODX_BASE_PATH . 'assets/'; - if (is_file($assets_path . "modifiers/mdf_{$cmd}.inc.php")) { - $modifiers_path = $assets_path . "modifiers/mdf_{$cmd}.inc.php"; - } elseif (is_file($assets_path . "plugins/phx/modifiers/{$cmd}.phx.php")) { - $modifiers_path = $assets_path . "plugins/phx/modifiers/{$cmd}.phx.php"; - } elseif (is_file(MODX_CORE_PATH . "extenders/modifiers/mdf_{$cmd}.inc.php")) { - $modifiers_path = MODX_CORE_PATH . "extenders/modifiers/mdf_{$cmd}.inc.php"; - } else { - $modifiers_path = false; - } - - if ($modifiers_path !== false) { + } + elseif($total == 0) + { + $assets_path = MODX_BASE_PATH.'assets/'; + if(is_file($assets_path."modifiers/mdf_{$cmd}.inc.php")) + $modifiers_path = $assets_path."modifiers/mdf_{$cmd}.inc.php"; + elseif(is_file($assets_path."plugins/phx/modifiers/{$cmd}.phx.php")) + $modifiers_path = $assets_path."plugins/phx/modifiers/{$cmd}.phx.php"; + elseif(is_file(MODX_CORE_PATH."extenders/modifiers/mdf_{$cmd}.inc.php")) + $modifiers_path = MODX_CORE_PATH."extenders/modifiers/mdf_{$cmd}.inc.php"; + else $modifiers_path = false; + + if($modifiers_path !== false) { $php = @file_get_contents($modifiers_path); $php = trim($php); - if (substr($php, 0, 5)==='') { - $php = substr($php, 0, -2); - } - if ($this->elmName!=='') { - $modx->snippetCache[$this->elmName . 'Props'] = ''; - } - } else { - $php = false; + if(substr($php,0,5)==='') $php = substr($php,0,-2); + if($this->elmName!=='') + $modx->snippetCache[$this->elmName.'Props'] = ''; } - } else { - $php = false; - } - if ($this->elmName!=='') { - $modx->snippetCache[$this->elmName]= $php; + else + $php = false; } + else $php = false; + if($this->elmName!=='') $modx->snippetCache[$this->elmName]= $php; } - if ($php==='') { - $php=false; - } + if($php==='') $php=false; - if ($php===false) { - $html = $modx->getChunk($this->elmName); - } else { - $html = false; - } + if($php===false) $html = $modx->getChunk($this->elmName); + else $html = false; $self = '[+output+]'; - if ($php !== false) { + if($php !== false) + { ob_start(); $options = $opt; $output = $value; @@ -1267,20 +1049,20 @@ public function getValueFromElement($key, $value, $cmd, $opt) $this->vars['options'] = & $opt; $custom = eval($php); $msg = ob_get_contents(); - if ($value===$this->bt) { - $value = $msg . $custom; - } + if($value===$this->bt) $value = $msg . $custom; ob_end_clean(); - } elseif ($html!==false && isset($value) && $value!=='') { + } + elseif($html!==false && isset($value) && $value!=='') + { $html = str_replace(array($self,'[+value+]'), $value, $html); $value = str_replace(array('[+options+]','[+param+]'), $opt, $html); - } else { - return false; } + else return false; - if ($php===false && $html===false && $value!=='' - && (strpos($cmd, '[+value+]')!==false || strpos($cmd, $self)!==false)) { - $value = str_replace(array('[+value+]',$self), $value, $cmd); + if($php===false && $html===false && $value!=='' + && (strpos($cmd,'[+value+]')!==false || strpos($cmd,$self)!==false)) + { + $value = str_replace(array('[+value+]',$self),$value,$cmd); } return $value; } @@ -1289,190 +1071,139 @@ public function parseDocumentSource($content='') { $modx = evolutionCMS(); - if (strpos($content, '[')===false && strpos($content, '{')===false) { - return $content; - } + if(strpos($content,'[')===false && strpos($content,'{')===false) return $content; - if (!$modx->maxParserPasses) { - $modx->maxParserPasses = 10; - } + if(!$modx->maxParserPasses) $modx->maxParserPasses = 10; $bt=''; $i=0; - while ($bt!==$content) { + while($bt!==$content) + { $bt = $content; - if (strpos($content, '[*')!==false && $modx->documentIdentifier) { - $content = $modx->mergeDocumentContent($content); - } - if (strpos($content, '[(')!==false) { - $content = $modx->mergeSettingsContent($content); - } - if (strpos($content, '{{')!==false) { - $content = $modx->mergeChunkContent($content); - } - if (strpos($content, '[!')!==false) { - $content = str_replace(array('[!','!]'), array('[[',']]'), $content); - } - if (strpos($content, '[[')!==false) { - $content = $modx->evalSnippets($content); - } - - if ($content===$bt) { - break; - } - if ($modx->maxParserPasses < $i) { - break; - } + if(strpos($content,'[*')!==false && $modx->documentIdentifier) + $content = $modx->mergeDocumentContent($content); + if(strpos($content,'[(')!==false) $content = $modx->mergeSettingsContent($content); + if(strpos($content,'{{')!==false) $content = $modx->mergeChunkContent($content); + if(strpos($content,'[!')!==false) $content = str_replace(array('[!','!]'),array('[[',']]'),$content); + if(strpos($content,'[[')!==false) $content = $modx->evalSnippets($content); + + if($content===$bt) break; + if($modx->maxParserPasses < $i) break; $i++; } return $content; } - public function getDocumentObject($target='', $field='pagetitle') + public function getDocumentObject($target='',$field='pagetitle') { $modx = evolutionCMS(); $target = trim($target); - if (empty($target)) { - $target = $modx->config['site_start']; - } - if (preg_match('@^[1-9][0-9]*$@', $target)) { - $method='id'; - } else { - $method = 'alias'; - } + if(empty($target)) $target = $modx->config['site_start']; + if(preg_match('@^[1-9][0-9]*$@',$target)) $method='id'; + else $method = 'alias'; - if (!isset($this->documentObject[$target])) { - $this->documentObject[$target] = $modx->getDocumentObject($method, $target, 'direct'); + if(!isset($this->documentObject[$target])) + { + $this->documentObject[$target] = $modx->getDocumentObject($method,$target,'direct'); } - if ($this->documentObject[$target]['publishedon']==='0') { + if($this->documentObject[$target]['publishedon']==='0') return ''; - } elseif (isset($this->documentObject[$target][$field])) { - if (is_array($this->documentObject[$target][$field])) { - $a = $modx->getTemplateVarOutput($field, $target); + elseif(isset($this->documentObject[$target][$field])) + { + if(is_array($this->documentObject[$target][$field])) + { + $a = $modx->getTemplateVarOutput($field,$target); $this->documentObject[$target][$field] = $a[$field]; } - } else { - $this->documentObject[$target][$field] = false; } + else $this->documentObject[$target][$field] = false; return $this->documentObject[$target][$field]; } - public function setPlaceholders($value = '', $key = '', $path = '') - { - if ($path!=='') { - $key = "{$path}.{$key}"; - } + public function setPlaceholders($value = '', $key = '', $path = '') { + if($path!=='') $key = "{$path}.{$key}"; if (is_array($value)) { foreach ($value as $subkey => $subval) { $this->setPlaceholders($subval, $subkey, $key); } - } else { - $this->setModifiersVariable($key, $value); } + else $this->setModifiersVariable($key, $value); } // Sets a placeholder variable which can only be access by Modifiers - public function setModifiersVariable($key, $value) - { - if ($key != 'phx' && $key != 'dummy') { - $this->placeholders[$key] = $value; - } + public function setModifiersVariable($key, $value) { + if ($key != 'phx' && $key != 'dummy') $this->placeholders[$key] = $value; } //mbstring - public function substr($str, $s, $l = null) - { + public function substr($str, $s, $l = null) { $modx = evolutionCMS(); - if (is_null($l)) { - $l = $this->strlen($str); - } - if (function_exists('mb_substr')) { - if (strpos($str, "\r")!==false) { + if(is_null($l)) $l = $this->strlen($str); + if (function_exists('mb_substr')) + { + if(strpos($str,"\r")!==false) $str = str_replace(array("\r\n","\r"), "\n", $str); - } return mb_substr($str, $s, $l, $modx->config['modx_charset']); } return substr($str, $s, $l); } - public function strpos($haystack, $needle, $offset=0) - { + public function strpos($haystack,$needle,$offset=0) { $modx = evolutionCMS(); - if (function_exists('mb_strpos')) { - return mb_strpos($haystack, $needle, $offset, $modx->config['modx_charset']); - } - return strpos($haystack, $needle, $offset); + if (function_exists('mb_strpos')) return mb_strpos($haystack,$needle,$offset,$modx->config['modx_charset']); + return strpos($haystack,$needle,$offset); } - public function strlen($str) - { + public function strlen($str) { $modx = evolutionCMS(); - if (function_exists('mb_strlen')) { - return mb_strlen(str_replace("\r\n", "\n", $str), $modx->config['modx_charset']); - } + if (function_exists('mb_strlen')) return mb_strlen(str_replace("\r\n", "\n", $str),$modx->config['modx_charset']); return strlen($str); } - public function strtolower($str) - { - if (function_exists('mb_strtolower')) { - return mb_strtolower($str); - } + public function strtolower($str) { + if (function_exists('mb_strtolower')) return mb_strtolower($str); return strtolower($str); } - public function strtoupper($str) - { - if (function_exists('mb_strtoupper')) { - return mb_strtoupper($str); - } + public function strtoupper($str) { + if (function_exists('mb_strtoupper')) return mb_strtoupper($str); return strtoupper($str); } - public function ucfirst($str) - { - if (function_exists('mb_strtoupper')) { - return mb_strtoupper($this->substr($str, 0, 1)) . $this->substr($str, 1, $this->strlen($str)); - } + public function ucfirst($str) { + if (function_exists('mb_strtoupper')) + return mb_strtoupper($this->substr($str, 0, 1)).$this->substr($str, 1, $this->strlen($str)); return ucfirst($str); } - public function lcfirst($str) - { - if (function_exists('mb_strtolower')) { - return mb_strtolower($this->substr($str, 0, 1)) . $this->substr($str, 1, $this->strlen($str)); - } + public function lcfirst($str) { + if (function_exists('mb_strtolower')) + return mb_strtolower($this->substr($str, 0, 1)).$this->substr($str, 1, $this->strlen($str)); return lcfirst($str); } - public function ucwords($str) - { - if (function_exists('mb_convert_case')) { + public function ucwords($str) { + if (function_exists('mb_convert_case')) return mb_convert_case($str, MB_CASE_TITLE); - } return ucwords($str); } - public function strrev($str) - { + public function strrev($str) { preg_match_all('/./us', $str, $ar); return implode(array_reverse($ar[0])); } - public function str_shuffle($str) - { + public function str_shuffle($str) { preg_match_all('/./us', $str, $ar); shuffle($ar[0]); return implode($ar[0]); } - public function str_word_count($str) - { - return count(preg_split('~[^\p{L}\p{N}\']+~u', $str)); + public function str_word_count($str) { + return count(preg_split('~[^\p{L}\p{N}\']+~u',$str)); } - public function strip_tags($value, $params='') - { + public function strip_tags($value,$params='') { $modx = evolutionCMS(); - if (stripos($params, 'style')===false && stripos($value, '')!==false) { + if(stripos($params,'style')===false && stripos($value,'')!==false) { $value = preg_replace('@.*?@is', '', $value); } - if (stripos($params, 'script')===false && stripos($value, '')!==false) { + if(stripos($params,'script')===false && stripos($value,'')!==false) { $value = preg_replace('@.*?@is', '', $value); } - return trim(strip_tags($value, $params)); + return trim(strip_tags($value,$params)); } } diff --git a/manager/includes/extenders/modifiers/mdf_addbreak.inc.php b/manager/includes/extenders/modifiers/mdf_addbreak.inc.php index 8568eb5f9a..03c3a1abff 100755 --- a/manager/includes/extenders/modifiers/mdf_addbreak.inc.php +++ b/manager/includes/extenders/modifiers/mdf_addbreak.inc.php @@ -1,23 +1,22 @@ filter->parseDocumentSource($value); -$text = str_replace(array("\r\n","\r"), "\n", $text); +$text = str_replace(array("\r\n","\r"),"\n",$text); $blockElms = 'br,table,tbody,tr,td,th,thead,tfoot,caption,colgroup,div'; $blockElms .= ',dl,dd,dt,ul,ol,li,pre,select,option,form,map,area,blockquote'; $blockElms .= ',address,math,style,input,p,h1,h2,h3,h4,h5,h6,hr,object,param,embed'; $blockElms .= ',noframes,noscript,section,article,aside,hgroup,footer,address,code'; $blockElms = explode(',', $blockElms); -$lines = explode("\n", $text); +$lines = explode("\n",$text); $c = count($lines); -foreach ($lines as $i=>$line) { +foreach($lines as $i=>$line) +{ $line = rtrim($line); - if ($i===$c-1) { - break; - } - foreach ($blockElms as $block) { - if (preg_match("@]*>$@', $line)) { + if($i===$c-1) break; + foreach($blockElms as $block) + { + if(preg_match("@]*>$@',$line)) continue 2; - } } $lines[$i] = "{$line}
    "; } diff --git a/manager/includes/extenders/modifiers/mdf_getimage.inc.php b/manager/includes/extenders/modifiers/mdf_getimage.inc.php index dce110774c..9f68f3ce0b 100755 --- a/manager/includes/extenders/modifiers/mdf_getimage.inc.php +++ b/manager/includes/extenders/modifiers/mdf_getimage.inc.php @@ -1,17 +1,16 @@ ]+>/i'; -preg_match_all($pattern, $value, $images); -if ($opt==='') { - if ($images[1][0]) { - return $images[1][0]; - } else { - return ''; - } -} else { - foreach ($images[0] as $i=>$image) { - if (strpos($image, $opt)!==false) { - return $images[1][$i]; - } +preg_match_all($pattern , $value , $images); +if($opt==='') +{ + if($images[1][0]) return $images[1][0]; + else return ''; +} +else +{ + foreach($images[0] as $i=>$image) + { + if(strpos($image,$opt)!==false) return $images[1][$i]; } } diff --git a/manager/includes/extenders/modifiers/mdf_memberof.inc.php b/manager/includes/extenders/modifiers/mdf_memberof.inc.php index c2105bd668..011b882534 100755 --- a/manager/includes/extenders/modifiers/mdf_memberof.inc.php +++ b/manager/includes/extenders/modifiers/mdf_memberof.inc.php @@ -1,28 +1,23 @@ getLoginUserID('web')); -$modx->qs_hash = md5($modx->qs_hash . "^{$userID}^"); +$modx->qs_hash = md5($modx->qs_hash."^{$userID}^"); -$groupNames = ($this->strlen($opt) > 0) ? explode(',', $opt) : array(); +$groupNames = ($this->strlen($opt) > 0 ) ? explode(',',$opt) : array(); // if $groupNames is not an array return false -if (!is_array($groupNames)) { - return 0; -} +if(!is_array($groupNames)) return 0; // Creates an array with all webgroups the user id is in -if (isset($modx->filter->cache['mo'][$userID])) { - $grpNames = $modx->filter->cache['mo'][$userID]; -} else { - $from = sprintf("[+prefix+]webgroup_names wgn INNER JOIN [+prefix+]web_groups wg ON wg.webgroup=wgn.id AND wg.webuser='%s'", $userID); - $rs = $modx->db->select('wgn.name', $from); - $modx->filter->cache['mo'][$userID] = $grpNames = $modx->db->getColumn('name', $rs); +if (isset($modx->filter->cache['mo'][$userID])) $grpNames = $modx->filter->cache['mo'][$userID]; +else { + $from = sprintf("[+prefix+]webgroup_names wgn INNER JOIN [+prefix+]web_groups wg ON wg.webgroup=wgn.id AND wg.webuser='%s'",$userID); + $rs = $modx->db->select('wgn.name',$from); + $modx->filter->cache['mo'][$userID] = $grpNames = $modx->db->getColumn('name',$rs); } // Check if a supplied group matches a webgroup from the array we just created -foreach ($groupNames as $k=>$v) { - if (in_array(trim($v), $grpNames)) { - return 1; - } +foreach($groupNames as $k=>$v) { + if(in_array(trim($v),$grpNames)) return 1; } // If we get here the above logic did not find a match, so return false diff --git a/manager/includes/extenders/modifiers/mdf_moduser.inc.php b/manager/includes/extenders/modifiers/mdf_moduser.inc.php index 3cb23bbb44..1349964cef 100755 --- a/manager/includes/extenders/modifiers/mdf_moduser.inc.php +++ b/manager/includes/extenders/modifiers/mdf_moduser.inc.php @@ -1,11 +1,8 @@ filter->cache['ui'][$userid])) { - if ($userid < 0) { - $user = $modx->getWebUserInfo(abs($userid)); - } else { - $user = $modx->getUserInfo($userid); - } + if ($userid < 0) $user = $modx->getWebUserInfo(abs($userid)); + else $user = $modx->getUserInfo($userid); $modx->filter->cache['ui'][$userid] = $user; } else { $user = $modx->filter->cache['ui'][$userid]; diff --git a/manager/includes/extenders/modifiers/mdf_summary.inc.php b/manager/includes/extenders/modifiers/mdf_summary.inc.php index f40a7c57cb..4cb0dd703b 100755 --- a/manager/includes/extenders/modifiers/mdf_summary.inc.php +++ b/manager/includes/extenders/modifiers/mdf_summary.inc.php @@ -1,64 +1,43 @@ config['manager_language']==='japanese-utf8' ? '。' : '.'; -} +if($delim==='') $delim = $modx->config['manager_language']==='japanese-utf8' ? '。' : '.'; $limit = (int)$limit; $content = $modx->filter->parseDocumentSource($value); $content = strip_tags($content); -$content = str_replace(array("\r\n","\r","\n","\t",' '), ' ', $content); -if (preg_match('/\s+/', $content)) { - $content = preg_replace('/\s+/', ' ', $content); -} +$content = str_replace(array("\r\n","\r","\n","\t",' '),' ',$content); +if(preg_match('/\s+/',$content)) + $content = preg_replace('/\s+/',' ',$content); $content = trim($content); $pos = $modx->filter->strpos($content, $delim); -if ($pos!==false && $pos<$limit) { +if($pos!==false && $pos<$limit) { $_ = explode($delim, $content); $text = ''; - foreach ($_ as $v) { - if ($limit <= $modx->filter->strlen($text . $v . $delim)) { - break; - } - $text .= $v . $delim; - } - if ($text) { - $content = $text; + foreach($_ as $v) { + if($limit <= $modx->filter->strlen($text.$v.$delim)) break; + $text .= $v.$delim; } + if($text) $content = $text; } -if ($limit<$modx->filter->strlen($content) && strpos($content, ' ')!==false) { +if($limit<$modx->filter->strlen($content) && strpos($content,' ')!==false) { $_ = explode(' ', $content); $text = ''; - foreach ($_ as $v) { - if ($limit <= $modx->filter->strlen($text . $v . ' ')) { - break; - } + foreach($_ as $v) { + if($limit <= $modx->filter->strlen($text.$v.' ')) break; $text .= $v . ' '; } - if ($text!=='') { - $content = $text; - } + if($text!=='') $content = $text; } -if ($limit < $modx->filter->strlen($content)) { - $content = $modx->filter->substr($content, 0, $limit); -} -if ($modx->filter->substr($content, -1)==$delim) { - $content = rtrim($content, $delim) . $delim; -} +if($limit < $modx->filter->strlen($content)) $content = $modx->filter->substr($content, 0, $limit); +if($modx->filter->substr($content,-1)==$delim) $content = rtrim($content,$delim) . $delim; return $content; diff --git a/manager/includes/extenders/modifiers/mdf_wordwrap.inc.php b/manager/includes/extenders/modifiers/mdf_wordwrap.inc.php index 5afbd2a85a..2613e8094b 100755 --- a/manager/includes/extenders/modifiers/mdf_wordwrap.inc.php +++ b/manager/includes/extenders/modifiers/mdf_wordwrap.inc.php @@ -1,4 +1,2 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } global $SystemAlertMsgQueque; // display system alert window if messages are available -if (count($SystemAlertMsgQueque) > 0) { - include "sysalert.display.inc.php"; +if(count($SystemAlertMsgQueque) > 0) { + include "sysalert.display.inc.php"; } ?> manager->action, array( - 85, - 27, - 4, - 72, - 13, - 11, - 12, - 87, - 88 +if(in_array($modx->manager->action, array( + 85, + 27, + 4, + 72, + 13, + 11, + 12, + 87, + 88 ))) { - echo $modx->manager->loadDatePicker($modx->config['mgr_date_picker_path']); + echo $modx->manager->loadDatePicker($modx->config['mgr_date_picker_path']); } ?> diff --git a/manager/includes/header.inc.php b/manager/includes/header.inc.php index a3b92dfb05..147c0f6e04 100755 --- a/manager/includes/header.inc.php +++ b/manager/includes/header.inc.php @@ -66,20 +66,16 @@ ' . "\n", $modx->config['mgr_jquery_path']) ?> - config['show_picker'] != "0") { - ?> + config['show_picker'] != "0") { ?> - + + if (!in_array($_REQUEST['a'], $aArr)) { ?> - + diff --git a/manager/includes/log.class.inc.php b/manager/includes/log.class.inc.php index 42cd407691..c6855d14c3 100755 --- a/manager/includes/log.class.inc.php +++ b/manager/includes/log.class.inc.php @@ -106,16 +106,16 @@ public function writeToLog() } } - private function getUserIP() - { - if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER) && !empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { + private function getUserIP() { + if( array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER) && !empty($_SERVER['HTTP_X_FORWARDED_FOR']) ) { if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',')>0) { - $addr = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']); + $addr = explode(",",$_SERVER['HTTP_X_FORWARDED_FOR']); return trim($addr[0]); } else { return $_SERVER['HTTP_X_FORWARDED_FOR']; } - } else { + } + else { return $_SERVER['REMOTE_ADDR']; } } diff --git a/manager/includes/manager.lockout.inc.php b/manager/includes/manager.lockout.inc.php index 02e179df9e..400371a225 100755 --- a/manager/includes/manager.lockout.inc.php +++ b/manager/includes/manager.lockout.inc.php @@ -1,68 +1,75 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if ($modx->manager->action!='8' && isset($_SESSION['mgrValidated'])) { +if($modx->manager->action!='8' && isset($_SESSION['mgrValidated'])){ + $homeurl = $modx->makeUrl($manager_login_startup>0 ? $manager_login_startup:$site_start); - $logouturl = MODX_MANAGER_URL . 'index.php?a=8'; + $logouturl = MODX_MANAGER_URL.'index.php?a=8'; - $modx->setPlaceholder('modx_charset', $modx_manager_charset); - $modx->setPlaceholder('theme', $manager_theme); + $modx->setPlaceholder('modx_charset',$modx_manager_charset); + $modx->setPlaceholder('theme',$manager_theme); - $modx->setPlaceholder('site_name', $site_name); - $modx->setPlaceholder('logo_slogan', $_lang["logo_slogan"]); - $modx->setPlaceholder('manager_lockout_message', $_lang["manager_lockout_message"]); + $modx->setPlaceholder('site_name',$site_name); + $modx->setPlaceholder('logo_slogan',$_lang["logo_slogan"]); + $modx->setPlaceholder('manager_lockout_message',$_lang["manager_lockout_message"]); - $modx->setPlaceholder('home', $_lang["home"]); - $modx->setPlaceholder('homeurl', $homeurl); - $modx->setPlaceholder('logout', $_lang["logout"]); - $modx->setPlaceholder('logouturl', $logouturl); - $modx->setPlaceholder('manager_theme_url', MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/'); - $modx->setPlaceholder('year', date('Y')); + $modx->setPlaceholder('home',$_lang["home"]); + $modx->setPlaceholder('homeurl',$homeurl); + $modx->setPlaceholder('logout',$_lang["logout"]); + $modx->setPlaceholder('logouturl',$logouturl); + $modx->setPlaceholder('manager_theme_url',MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/'); + $modx->setPlaceholder('year',date('Y')); // load template - if (!isset($modx->config['manager_lockout_tpl']) || empty($modx->config['manager_lockout_tpl'])) { - $modx->config['manager_lockout_tpl'] = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; + if(!isset($modx->config['manager_lockout_tpl']) || empty($modx->config['manager_lockout_tpl'])) { + $modx->config['manager_lockout_tpl'] = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; } $target = $modx->config['manager_lockout_tpl']; $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target); $target = $modx->mergeSettingsContent($target); - if (substr($target, 0, 1)==='@') { - if (substr($target, 0, 6)==='@CHUNK') { - $target = trim(substr($target, 7)); - $lockout_tpl = $modx->getChunk($target); - } elseif (substr($target, 0, 5)==='@FILE') { - $target = trim(substr($target, 6)); - $lockout_tpl = file_get_contents($target); - } - } else { - $chunk = $modx->getChunk($target); - if ($chunk!==false && !empty($chunk)) { - $lockout_tpl = $chunk; - } elseif (is_file(MODX_BASE_PATH . $target)) { - $target = MODX_BASE_PATH . $target; - $lockout_tpl = file_get_contents($target); - } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl')) { - $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl'; - $lockout_tpl = file_get_contents($target); - } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl')) { - $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl'; - $login_tpl = file_get_contents($target); - } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html')) { // ClipperCMS compatible - $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html'; - $lockout_tpl = file_get_contents($target); - } else { - $target = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; - $lockout_tpl = file_get_contents($target); - } - } + if(substr($target,0,1)==='@') { + if(substr($target,0,6)==='@CHUNK') { + $target = trim(substr($target,7)); + $lockout_tpl = $modx->getChunk($target); + } + elseif(substr($target,0,5)==='@FILE') { + $target = trim(substr($target,6)); + $lockout_tpl = file_get_contents($target); + } + } else { + $chunk = $modx->getChunk($target); + if($chunk!==false && !empty($chunk)) { + $lockout_tpl = $chunk; + } + elseif(is_file(MODX_BASE_PATH . $target)) { + $target = MODX_BASE_PATH . $target; + $lockout_tpl = file_get_contents($target); + } + elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl')) { + $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl'; + $lockout_tpl = file_get_contents($target); + } + elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl')) { + $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl'; + $login_tpl = file_get_contents($target); + } + elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html')) { // ClipperCMS compatible + $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html'; + $lockout_tpl = file_get_contents($target); + } + else { + $target = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; + $lockout_tpl = file_get_contents($target); + } + } // merge placeholders $lockout_tpl = $modx->mergePlaceholderContent($lockout_tpl); - $regx = strpos($lockout_tpl, '[[+')!==false ? '~\[\[\+(.*?)\]\]~' : '~\[\+(.*?)\+\]~'; // little tweak for newer parsers + $regx = strpos($lockout_tpl,'[[+')!==false ? '~\[\[\+(.*?)\]\]~' : '~\[\+(.*?)\+\]~'; // little tweak for newer parsers $lockout_tpl = preg_replace($regx, '', $lockout_tpl); //cleanup echo $lockout_tpl; diff --git a/manager/includes/menu.class.inc.php b/manager/includes/menu.class.inc.php index 438d6bedbe..d131fc79f7 100755 --- a/manager/includes/menu.class.inc.php +++ b/manager/includes/menu.class.inc.php @@ -68,6 +68,7 @@ public function DrawSub($parentid, $level) $output = ''; if (isset($this->menu[$parentid])) { + $ph = array(); $countChild = 0; $itemTpl = ' @@ -101,7 +102,7 @@ public function DrawSub($parentid, $level) $level++; $ph['DrawSub'] = $this->DrawSub($id, $level); $level--; - // Optional buttons + // Optional buttons } else { if (isset($value[11]) && !empty($value[11])) { $optionalButton = ''; diff --git a/manager/includes/preload.functions.inc.php b/manager/includes/preload.functions.inc.php index a2494134af..e348415912 100755 --- a/manager/includes/preload.functions.inc.php +++ b/manager/includes/preload.functions.inc.php @@ -4,14 +4,14 @@ $site_sessionname = genEvoSessionName(); // For legacy extras not using startCMSSession -if (! function_exists('evolutionCMS')) { +if( ! function_exists('evolutionCMS')) { /** * @return DocumentParser */ function evolutionCMS() { - if (! defined('MODX_CLASS')) { - if (! class_exists('DocumentParser')) { + if( ! defined('MODX_CLASS')) { + if( ! class_exists('DocumentParser')) { throw new RuntimeException('MODX_CLASS not defined and DocumentParser class not exists'); } define('MODX_CLASS', 'DocumentParser'); @@ -38,14 +38,12 @@ function genEvoSessionName() function startCMSSession() { global $site_sessionname, $https_port, $session_cookie_path, $session_cookie_domain; - if (MODX_CLI) { - return; - } + if(MODX_CLI) return; session_name($site_sessionname); removeInvalidCmsSessionIds($site_sessionname); $cookieExpiration = 0; - $secure = ((isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port); + $secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port); $cookiePath = !empty($session_cookie_path) ? $session_cookie_path : MODX_BASE_URL; $cookieDomain = !empty($session_cookie_domain) ? $session_cookie_domain : ''; session_set_cookie_params($cookieExpiration, $cookiePath, $cookieDomain, $secure, true); @@ -81,9 +79,7 @@ function removeInvalidCmsSessionFromStorage(&$storage, $session_name) */ function removeInvalidCmsSessionIds($session_name) { - if (MODX_CLI) { - return; - } + if(MODX_CLI) return; // session ids is invalid iff it is empty string // storage priorioty can see in PHP source ext/session/session.c removeInvalidCmsSessionFromStorage($_COOKIE, $session_name); diff --git a/manager/includes/protect.inc.php b/manager/includes/protect.inc.php index 968e76eff1..f868ed98b8 100755 --- a/manager/includes/protect.inc.php +++ b/manager/includes/protect.inc.php @@ -77,8 +77,8 @@ function getSanitizedValue($value = '') modx_sanitize_gpc($_REQUEST); foreach (array('PHP_SELF', 'HTTP_USER_AGENT', 'HTTP_REFERER', 'QUERY_STRING') as $key) { - $_SERVER[$key] = isset($_SERVER[$key]) ? htmlspecialchars($_SERVER[$key], ENT_QUOTES) : null; + $_SERVER[$key] = isset ($_SERVER[$key]) ? htmlspecialchars($_SERVER[$key], ENT_QUOTES) : null; } // Unset vars -unset($key, $value); +unset ($key, $value); diff --git a/manager/includes/sysalert.display.inc.php b/manager/includes/sysalert.display.inc.php index 8300f08e49..0b97e73b96 100755 --- a/manager/includes/sysalert.display.inc.php +++ b/manager/includes/sysalert.display.inc.php @@ -1,37 +1,38 @@ "; - } - // reset message queque - unset($_SESSION['SystemAlertMsgQueque']); - $_SESSION['SystemAlertMsgQueque'] = array(); - $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque']; + $sysMsgs = ""; + $limit = count($SystemAlertMsgQueque); + for($i=0;$i<$limit;$i++) { + $sysMsgs .= $SystemAlertMsgQueque[$i]."
    "; + } + // reset message queque + unset($_SESSION['SystemAlertMsgQueque']); + $_SESSION['SystemAlertMsgQueque'] = array(); + $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque']; - if ($sysMsgs!="") { - ?> + if($sysMsgs!="") { +?> '; ?> + echo ''; +?> \ No newline at end of file diff --git a/manager/includes/template.parser.class.inc.php b/manager/includes/template.parser.class.inc.php index 8cf3029481..cc999700ad 100755 --- a/manager/includes/template.parser.class.inc.php +++ b/manager/includes/template.parser.class.inc.php @@ -7,185 +7,182 @@ * */ -class TemplateParser -{ +Class TemplateParser { /** - * @param array $config [action, tabs, toArray] - * @param array $data - * @return string - */ - public function output($config = array(), $data = array()) - { + * @param array $config [action, tabs, toArray] + * @param array $data + * @return string + */ + public function output($config = array(), $data = array()) { $modx = evolutionCMS(); - $output = ''; - $action = !empty($config['action']) ? $config['action'] : (!empty($_REQUEST['a']) ? $_REQUEST['a'] : ''); - $tab = isset($config['tab']) ? ' AND tab IN(' . $config['tab'] . ')' : ''; + $output = ''; + $action = !empty($config['action']) ? $config['action'] : (!empty($_REQUEST['a']) ? $_REQUEST['a'] : ''); + $tab = isset($config['tab']) ? ' AND tab IN(' . $config['tab'] . ')' : ''; - if ($action) { - $sql = $modx->db->query('SELECT t1.*, IF(t1.alias=\'\',t1.name,t1.alias) AS alias, t2.category AS category_name + if($action) { + $sql = $modx->db->query('SELECT t1.*, IF(t1.alias=\'\',t1.name,t1.alias) AS alias, t2.category AS category_name FROM ' . $modx->getFullTableName('system_templates') . ' AS t1 INNER JOIN ' . $modx->getFullTableName('categories') . ' AS t2 ON t2.id=t1.category WHERE t1.action IN(' . $action . ') ' . $tab . ' ORDER BY t1.tab ASC, t1.rank ASC'); - if ($modx->db->getRecordCount($sql)) { - $tabs = array(); - while ($row = $modx->db->getRow($sql)) { - if (!$row['value'] && !empty($data[$row['name']])) { - $row['value'] = $data[$row['name']]; - } - $tabs[$row['tab']]['category_name'] = $row['category_name']; - $tabs[$row['tab']][$row['name']] = TemplateParser::render($row); - } - - if (!empty($config['toArray'])) { - $output = $tabs; - } else { - $output .= '
    '; - $output .= ' + if($modx->db->getRecordCount($sql)) { + $tabs = array(); + while($row = $modx->db->getRow($sql)) { + if(!$row['value'] && !empty($data[$row['name']])) { + $row['value'] = $data[$row['name']]; + } + $tabs[$row['tab']]['category_name'] = $row['category_name']; + $tabs[$row['tab']][$row['name']] = TemplateParser::render($row); + } + + if(!empty($config['toArray'])) { + $output = $tabs; + } else { + $output .= '
    '; + $output .= ' '; - foreach ($tabs as $idTab => $tab) { - $output .= '
    '; - $output .= ' + foreach($tabs as $idTab => $tab) { + $output .= '
    '; + $output .= '

    ' . (!empty($config['tabs'][$idTab]) ? $config['tabs'][$idTab] : $tab['category_name']) . '

    '; - unset($tab['category_name']); - foreach ($tab as $item) { - $output .= $item; - } - $output .= '
    '; - } - $output .= '
    '; - } - } - } - - return $output; - } + unset($tab['category_name']); + foreach($tab as $item) { + $output .= $item; + } + $output .= '
    '; + } + $output .= '
    '; + } + } + } + + return $output; + } /** * @param array $data * @return string */ - private function render($data) - { - $modx = evolutionCMS(); - global $_lang, $_country_lang; + private function render($data) { + $modx = evolutionCMS(); global $_lang, $_country_lang; - $data['lang.name'] = (isset($_lang[$data['alias']]) ? $_lang[$data['alias']] : $data['alias']); - $data['value'] = (isset($_POST[$data['name']][$data['value']]) ? $_POST[$data['name']][$data['value']] : (isset($data['value']) ? $modx->htmlspecialchars($data['value']) : '')); - $data['readonly'] = ($data['readonly'] ? ' readonly' : ''); + $data['lang.name'] = (isset($_lang[$data['alias']]) ? $_lang[$data['alias']] : $data['alias']); + $data['value'] = (isset($_POST[$data['name']][$data['value']]) ? $_POST[$data['name']][$data['value']] : (isset($data['value']) ? $modx->htmlspecialchars($data['value']) : '')); + $data['readonly'] = ($data['readonly'] ? ' readonly' : ''); - $output = ''; - $output .= '
    '; + $output = ''; + $output .= '
    '; - switch ($data['type']) { + switch($data['type']) { - case 'text': - $output .= ' + case 'text': + $output .= '
    '; - $output .= $data['content']; - $output .= '
    '; + $output .= $data['content']; + $output .= '
    '; - break; + break; - case 'textarea': - $output .= ' + case 'textarea': + $output .= '
    '; - $output .= $data['content']; - $output .= '
    '; + $output .= $data['content']; + $output .= '
    '; - break; + break; - case 'date': - $data['value'] = (isset($_POST[$data['name']][$data['value']]) ? $modx->toDateFormat($_POST[$data['name']][$data['value']]) : (isset($data['value']) ? $modx->toDateFormat($data['value']) : '')); - $output .= ' + case 'date': + $data['value'] = (isset($_POST[$data['name']][$data['value']]) ? $modx->toDateFormat($_POST[$data['name']][$data['value']]) : (isset($data['value']) ? $modx->toDateFormat($data['value']) : '')); + $output .= '
    '; - $output .= $data['content']; - $output .= '
    '; - - break; - - case 'select': - $output .= ''; - $output .= '
    '; - $output .= ''; - $output .= $data['content']; - $output .= '
    '; - - break; - - case 'checkbox': - $output .= ''; - $output .= '
    '; - $output .= ''; - if ($data['elements']) { - $elements = explode('||', $data['elements']); - foreach ($elements as $key => $value) { - $value = explode('==', $value); - $output .= '
    ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); - } - } - $output .= $data['content']; - $output .= '
    '; - - break; - - case 'radio': - $output .= ''; - $output .= '
    '; - $output .= ''; - if ($data['elements']) { - $elements = explode('||', $data['elements']); - foreach ($elements as $key => $value) { - $value = explode('==', $value); - $output .= '
    ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); - } - } - $output .= $data['content']; - $output .= '
    '; - - break; - - case 'custom': - $output .= ''; - $output .= '
    '; - $output .= $data['content']; - $output .= '
    '; - - break; - } - - $output .= ''; - - $output = $modx->parseText($output, $data); - - return $output; - } + $output .= $data['content']; + $output .= ''; + + break; + + case 'select': + $output .= ''; + $output .= '
    '; + $output .= ''; + $output .= $data['content']; + $output .= '
    '; + + break; + + case 'checkbox': + $output .= ''; + $output .= '
    '; + $output .= ''; + if($data['elements']) { + $elements = explode('||', $data['elements']); + foreach($elements as $key => $value) { + $value = explode('==', $value); + $output .= '
    ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); + } + } + $output .= $data['content']; + $output .= '
    '; + + break; + + case 'radio': + $output .= ''; + $output .= '
    '; + $output .= ''; + if($data['elements']) { + $elements = explode('||', $data['elements']); + foreach($elements as $key => $value) { + $value = explode('==', $value); + $output .= '
    ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); + } + } + $output .= $data['content']; + $output .= '
    '; + + break; + + case 'custom': + $output .= ''; + $output .= '
    '; + $output .= $data['content']; + $output .= '
    '; + + break; + } + + $output .= ''; + + $output = $modx->parseText($output, $data); + + return $output; + } + } ?> diff --git a/manager/includes/tmplvars.commands.inc.php b/manager/includes/tmplvars.commands.inc.php index dd49967362..8137692b9d 100755 --- a/manager/includes/tmplvars.commands.inc.php +++ b/manager/includes/tmplvars.commands.inc.php @@ -4,7 +4,7 @@ * Created by Raymond Irving Feb, 2005 */ global $BINDINGS; // Array of supported bindings. must be upper case -$BINDINGS = array( +$BINDINGS = array ( 'FILE', 'CHUNK', 'DOCUMENT', @@ -22,41 +22,40 @@ * @param array $tvsArray * @return string */ -function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsArray = array()) -{ +function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsArray = array()) { $modx = evolutionCMS(); $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier; $nvalue = trim($value); - if (substr($nvalue, 0, 1) != '@') { + if (substr($nvalue, 0, 1) != '@') return $value; - } elseif (isset($modx->config['enable_bindings']) && $modx->config['enable_bindings']!=1 && $src==='docform') { + elseif(isset($modx->config['enable_bindings']) && $modx->config['enable_bindings']!=1 && $src==='docform') { return '@Bindings is disabled.'; - } else { - list($cmd, $param) = ParseCommand($nvalue); + } + else { + list ($cmd, $param) = ParseCommand($nvalue); $cmd = trim($cmd); $param = parseTvValues($param, $tvsArray); switch ($cmd) { - case "FILE": + case "FILE" : $output = $modx->atBindFileContent($nvalue); break; - case "CHUNK": // retrieve a chunk and process it's content + case "CHUNK" : // retrieve a chunk and process it's content $chunk = $modx->getChunk(trim($param)); $output = $chunk; break; - case "DOCUMENT": // retrieve a document and process it's content + case "DOCUMENT" : // retrieve a document and process it's content $rs = $modx->getDocument($param); - if (is_array($rs)) { + if (is_array($rs)) $output = $rs['content']; - } else { + else $output = "Unable to locate document $param"; - } break; - case "SELECT": // selects a record from the cms database - $rt = array(); - $replacementVars = array( + case "SELECT" : // selects a record from the cms database + $rt = array (); + $replacementVars = array ( 'DBASE' => $modx->db->config['dbase'], 'PREFIX' => $modx->db->config['table_prefix'] ); @@ -68,11 +67,11 @@ function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsA $output = $rs; break; - case "EVAL": // evaluates text as php codes return the results - $output = eval($param); + case "EVAL" : // evaluates text as php codes return the results + $output = eval ($param); break; - case "INHERIT": + case "INHERIT" : $output = $param; // Default to param value if no content from parents $doc = $modx->getPageInfo($docid, 0, 'id,parent'); @@ -81,9 +80,8 @@ function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsA // Grab document regardless of publish status $doc = $modx->getPageInfo($parent_id, 0, 'id,parent,published'); - if ($doc['parent'] != 0 && !$doc['published']) { - continue; - } // hide unpublished docs if we're not at the top + if ($doc['parent'] != 0 && !$doc['published']) + continue; // hide unpublished docs if we're not at the top $tv = $modx->getTemplateVar($name, '*', $doc['id'], $doc['published']); @@ -97,8 +95,8 @@ function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsA } break; - case 'DIRECTORY': - $files = array(); + case 'DIRECTORY' : + $files = array (); $path = $modx->config['base_path'] . $param; if (substr($path, -1, 1) != '/') { $path .= '/'; @@ -117,7 +115,7 @@ function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsA $output = implode('||', $files); break; - default: + default : $output = $value; break; @@ -131,13 +129,10 @@ function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsA * @param $file * @return string */ -function ProcessFile($file) -{ +function ProcessFile($file) { // get the file - $buffer = @file_get_contents($file); - if ($buffer === false) { - $buffer = " Could not retrieve document '$file'."; - } + $buffer = @file_get_contents($file); + if ($buffer === false) $buffer = " Could not retrieve document '$file'."; return $buffer; } @@ -151,9 +146,11 @@ function ParseCommand($binding_string) { global $BINDINGS; $binding_array = array(); - foreach ($BINDINGS as $cmd) { - if (strpos($binding_string, '@' . $cmd)===0) { - $code = substr($binding_string, strlen($cmd)+1); + foreach($BINDINGS as $cmd) + { + if(strpos($binding_string,'@'.$cmd)===0) + { + $code = substr($binding_string,strlen($cmd)+1); $binding_array = array($cmd,trim($code)); break; } @@ -171,20 +168,20 @@ function ParseCommand($binding_string) function parseTvValues($param, $tvsArray) { $modx = evolutionCMS(); - $tvsArray = is_array($modx->documentObject) ? array_merge($tvsArray, $modx->documentObject) : $tvsArray; - if (strpos($param, '[*') !== false) { - $matches = $modx->getTagsFromContent($param, '[*', '*]'); - foreach ($matches[0] as $i=>$match) { - if (isset($tvsArray[ $matches[1][$i] ])) { - if (is_array($tvsArray[ $matches[1][$i] ])) { - $value = $tvsArray[$matches[1][$i]]['value']; - $value = $value === '' ? $tvsArray[$matches[1][$i]]['default_text'] : $value; - } else { - $value = $tvsArray[ $matches[1][$i] ]; - } - $param = str_replace($match, $value, $param); - } - } - } - return $param; + $tvsArray = is_array($modx->documentObject) ? array_merge($tvsArray, $modx->documentObject) : $tvsArray; + if (strpos($param, '[*') !== false) { + $matches = $modx->getTagsFromContent($param, '[*', '*]'); + foreach ($matches[0] as $i=>$match) { + if(isset($tvsArray[ $matches[1][$i] ])) { + if(is_array($tvsArray[ $matches[1][$i] ])) { + $value = $tvsArray[$matches[1][$i]]['value']; + $value = $value === '' ? $tvsArray[$matches[1][$i]]['default_text'] : $value; + } else { + $value = $tvsArray[ $matches[1][$i] ]; + } + $param = str_replace($match, $value, $param); + } + } + } + return $param; } diff --git a/manager/includes/tmplvars.format.inc.php b/manager/includes/tmplvars.format.inc.php index 141c2a6a5b..edd050bd85 100755 --- a/manager/includes/tmplvars.format.inc.php +++ b/manager/includes/tmplvars.format.inc.php @@ -15,342 +15,335 @@ * @param string $sep * @return mixed|string */ -function getTVDisplayFormat($name, $value, $format, $paramstring = "", $tvtype = "", $docid = "", $sep = '') -{ +function getTVDisplayFormat($name, $value, $format, $paramstring = "", $tvtype = "", $docid = "", $sep = '') { + $modx = evolutionCMS(); $o = ''; // process any TV commands in value - $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier; - $value = ProcessTVCommand($value, $name, $docid); + $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier; + $value = ProcessTVCommand($value, $name, $docid); - $params = array(); - if ($paramstring) { - $cp = explode("&", $paramstring); - foreach ($cp as $p => $v) { - $v = trim($v); // trim - $ar = explode("=", $v); - if (is_array($ar) && count($ar) == 2) { - $params[$ar[0]] = decodeParamValue($ar[1]); - } - } - } + $params = array(); + if($paramstring) { + $cp = explode("&", $paramstring); + foreach($cp as $p => $v) { + $v = trim($v); // trim + $ar = explode("=", $v); + if(is_array($ar) && count($ar) == 2) { + $params[$ar[0]] = decodeParamValue($ar[1]); + } + } + } - $id = "tv$name"; - switch ($format) { - case 'image': - $images = parseInput($value, '||', 'array'); - foreach ($images as $image) { - if (!is_array($image)) { - $image = explode('==', $image); - } - $src = $image[0]; + $id = "tv$name"; + switch($format) { + case 'image': + $images = parseInput($value, '||', 'array'); + foreach($images as $image) { + if(!is_array($image)) { + $image = explode('==', $image); + } + $src = $image[0]; - if ($src) { - // We have a valid source - $attributes = ''; - $attr = array( - 'class' => $params['class'], - 'src' => $src, - 'id' => ($params['id'] ? $params['id'] : ''), - 'alt' => $modx->htmlspecialchars($params['alttext']), - 'style' => $params['style'] - ); - if (isset($params['align']) && $params['align'] != 'none') { - $attr['align'] = $params['align']; - } - foreach ($attr as $k => $v) { - $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); - } - $attributes .= ' ' . $params['attrib']; + if($src) { + // We have a valid source + $attributes = ''; + $attr = array( + 'class' => $params['class'], + 'src' => $src, + 'id' => ($params['id'] ? $params['id'] : ''), + 'alt' => $modx->htmlspecialchars($params['alttext']), + 'style' => $params['style'] + ); + if(isset($params['align']) && $params['align'] != 'none') { + $attr['align'] = $params['align']; + } + foreach($attr as $k => $v) $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); + $attributes .= ' ' . $params['attrib']; - // Output the image with attributes - $o .= ''; - } - } - break; + // Output the image with attributes + $o .= ''; + } + } + break; - case "delim": // display as delimitted list - $value = parseInput($value, "||"); - $p = $params['format'] ? $params['format'] : " "; - if ($p == "\\n") { - $p = "\n"; - } - $o = str_replace("||", $p, $value); - break; + case "delim": // display as delimitted list + $value = parseInput($value, "||"); + $p = $params['format'] ? $params['format'] : " "; + if($p == "\\n") { + $p = "\n"; + } + $o = str_replace("||", $p, $value); + break; - case "string": - $value = parseInput($value); - $format = strtolower($params['format']); - if ($format == 'upper case') { - $o = strtoupper($value); - } elseif ($format == 'lower case') { - $o = strtolower($value); - } elseif ($format == 'sentence case') { - $o = ucfirst($value); - } elseif ($format == 'capitalize') { - $o = ucwords($value); - } else { - $o = $value; - } - break; + case "string": + $value = parseInput($value); + $format = strtolower($params['format']); + if($format == 'upper case') { + $o = strtoupper($value); + } else if($format == 'lower case') { + $o = strtolower($value); + } else if($format == 'sentence case') { + $o = ucfirst($value); + } else if($format == 'capitalize') { + $o = ucwords($value); + } else { + $o = $value; + } + break; - case "date": - if ($value != '' || $params['default'] == 'Yes') { - if (empty($value)) { - $value = 'now'; - } - $timestamp = getUnixtimeFromDateString($value); - $p = $params['format'] ? $params['format'] : "%A %d, %B %Y"; - $o = strftime($p, $timestamp); - } else { - $value = ''; - } - break; + case "date": + if($value != '' || $params['default'] == 'Yes') { + if(empty($value)) { + $value = 'now'; + } + $timestamp = getUnixtimeFromDateString($value); + $p = $params['format'] ? $params['format'] : "%A %d, %B %Y"; + $o = strftime($p, $timestamp); + } else { + $value = ''; + } + break; - case "hyperlink": - $value = parseInput($value, "||", "array"); - $o = ''; - $countValue = count($value); - for ($i = 0; $i < $countValue; $i++) { - list($name, $url) = is_array($value[$i]) ? $value[$i] : explode("==", $value[$i]); - if (!$url) { - $url = $name; - } - if ($url) { - if ($o) { - $o .= '
    '; - } - $attributes = ''; - // setup the link attributes - $attr = array( - 'href' => $url, - 'title' => $params['title'] ? $modx->htmlspecialchars($params['title']) : $name, - 'class' => $params['class'], - 'style' => $params['style'], - 'target' => $params['target'], - ); - foreach ($attr as $k => $v) { - $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); - } - $attributes .= ' ' . $params['attrib']; // add extra + case "hyperlink": + $value = parseInput($value, "||", "array"); + $o = ''; + $countValue = count($value); + for($i = 0; $i < $countValue; $i++) { + list($name, $url) = is_array($value[$i]) ? $value[$i] : explode("==", $value[$i]); + if(!$url) { + $url = $name; + } + if($url) { + if($o) { + $o .= '
    '; + } + $attributes = ''; + // setup the link attributes + $attr = array( + 'href' => $url, + 'title' => $params['title'] ? $modx->htmlspecialchars($params['title']) : $name, + 'class' => $params['class'], + 'style' => $params['style'], + 'target' => $params['target'], + ); + foreach($attr as $k => $v) $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); + $attributes .= ' ' . $params['attrib']; // add extra - // Output the link - $o .= '' . ($params['text'] ? $modx->htmlspecialchars($params['text']) : $name) . ''; - } - } - break; + // Output the link + $o .= '' . ($params['text'] ? $modx->htmlspecialchars($params['text']) : $name) . ''; + } + } + break; - case "htmltag": - $value = parseInput($value, "||", "array"); - $tagid = $params['tagid']; - $tagname = ($params['tagname']) ? $params['tagname'] : 'div'; - $o = ''; - // Loop through a list of tags + case "htmltag": + $value = parseInput($value, "||", "array"); + $tagid = $params['tagid']; + $tagname = ($params['tagname']) ? $params['tagname'] : 'div'; + $o = ''; + // Loop through a list of tags $countValue = count($value); - for ($i = 0; $i < $countValue; $i++) { - $tagvalue = is_array($value[$i]) ? implode(' ', $value[$i]) : $value[$i]; - if (!$tagvalue) { - continue; - } + for($i = 0; $i < $countValue; $i++) { + $tagvalue = is_array($value[$i]) ? implode(' ', $value[$i]) : $value[$i]; + if(!$tagvalue) { + continue; + } - $attributes = ''; - $attr = array( - 'id' => ($tagid ? $tagid : $id), - // 'tv' already added to id - 'class' => $params['class'], - 'style' => $params['style'], - ); - foreach ($attr as $k => $v) { - $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); - } - $attributes .= ' ' . $params['attrib']; // add extra + $attributes = ''; + $attr = array( + 'id' => ($tagid ? $tagid : $id), + // 'tv' already added to id + 'class' => $params['class'], + 'style' => $params['style'], + ); + foreach($attr as $k => $v) $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); + $attributes .= ' ' . $params['attrib']; // add extra - // Output the HTML Tag - $o .= '<' . $tagname . rtrim($attributes) . '>' . $tagvalue . ''; - } - break; + // Output the HTML Tag + $o .= '<' . $tagname . rtrim($attributes) . '>' . $tagvalue . ''; + } + break; - case "richtext": - $value = parseInput($value); - $w = $params['w'] ? $params['w'] : '100%'; - $h = $params['h'] ? $params['h'] : '400px'; - $richtexteditor = $params['edt'] ? $params['edt'] : ""; - $o = '
    '; - $replace_richtext = array($id); - // setup editors - if (!empty($replace_richtext) && !empty($richtexteditor)) { - // invoke OnRichTextEditorInit event - $evtOut = $modx->invokeEvent("OnRichTextEditorInit", array( - 'editor' => $richtexteditor, - 'elements' => $replace_richtext, - 'forfrontend' => 1, - 'width' => $w, - 'height' => $h - )); - if (is_array($evtOut)) { - $o .= implode("", $evtOut); - } - } - break; + case "richtext": + $value = parseInput($value); + $w = $params['w'] ? $params['w'] : '100%'; + $h = $params['h'] ? $params['h'] : '400px'; + $richtexteditor = $params['edt'] ? $params['edt'] : ""; + $o = '
    '; + $replace_richtext = array($id); + // setup editors + if(!empty($replace_richtext) && !empty($richtexteditor)) { + // invoke OnRichTextEditorInit event + $evtOut = $modx->invokeEvent("OnRichTextEditorInit", array( + 'editor' => $richtexteditor, + 'elements' => $replace_richtext, + 'forfrontend' => 1, + 'width' => $w, + 'height' => $h + )); + if(is_array($evtOut)) { + $o .= implode("", $evtOut); + } + } + break; - case "unixtime": - $value = parseInput($value); - $o = getUnixtimeFromDateString($value); - break; + case "unixtime": + $value = parseInput($value); + $o = getUnixtimeFromDateString($value); + break; - case "viewport": - $value = parseInput($value); - $id = '_' . time(); - if (!$params['vpid']) { - $params['vpid'] = $id; - } - $sTag = "regClientStartupScript(MODX_MANAGER_URL . "media/script/bin/viewport.js", array( - 'name' => 'viewport', - 'version' => '0', - 'plaintext' => false - )); - $o = $sTag . " id='" . $params['vpid'] . "' name='" . $params['vpid'] . "' "; - if ($params['class']) { - $o .= " class='" . $params['class'] . "' "; - } - if ($params['style']) { - $o .= " style='" . $params['style'] . "' "; - } - if ($params['attrib']) { - $o .= $params['attrib'] . " "; - } - $o .= "scrolling='" . ($params['sbar'] == 'No' ? "no" : ($params['sbar'] == 'Yes' ? "yes" : "auto")) . "' "; - $o .= "src='" . $value . "' frameborder='" . $params['borsize'] . "' "; - $o .= "onload=\"window.setTimeout('ResizeViewPort(\\'" . $params['vpid'] . "\\'," . $autoMode . ")',100);\" width='" . $w . "' height='" . $h . "' "; - $o .= ">"; - $o .= $eTag; - break; + $modx->regClientStartupScript(MODX_MANAGER_URL . "media/script/bin/viewport.js", array( + 'name' => 'viewport', + 'version' => '0', + 'plaintext' => false + )); + $o = $sTag . " id='" . $params['vpid'] . "' name='" . $params['vpid'] . "' "; + if($params['class']) { + $o .= " class='" . $params['class'] . "' "; + } + if($params['style']) { + $o .= " style='" . $params['style'] . "' "; + } + if($params['attrib']) { + $o .= $params['attrib'] . " "; + } + $o .= "scrolling='" . ($params['sbar'] == 'No' ? "no" : ($params['sbar'] == 'Yes' ? "yes" : "auto")) . "' "; + $o .= "src='" . $value . "' frameborder='" . $params['borsize'] . "' "; + $o .= "onload=\"window.setTimeout('ResizeViewPort(\\'" . $params['vpid'] . "\\'," . $autoMode . ")',100);\" width='" . $w . "' height='" . $h . "' "; + $o .= ">"; + $o .= $eTag; + break; - case "datagrid": - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; - $grd = new DataGrid('', $value); + case "datagrid": + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; + $grd = new DataGrid('', $value); - $grd->noRecordMsg = $params['egmsg']; + $grd->noRecordMsg = $params['egmsg']; - $grd->columnHeaderClass = $params['chdrc']; - $grd->cssClass = $params['tblc']; - $grd->itemClass = $params['itmc']; - $grd->altItemClass = $params['aitmc']; + $grd->columnHeaderClass = $params['chdrc']; + $grd->cssClass = $params['tblc']; + $grd->itemClass = $params['itmc']; + $grd->altItemClass = $params['aitmc']; - $grd->columnHeaderStyle = $params['chdrs']; - $grd->cssStyle = $params['tbls']; - $grd->itemStyle = $params['itms']; - $grd->altItemStyle = $params['aitms']; + $grd->columnHeaderStyle = $params['chdrs']; + $grd->cssStyle = $params['tbls']; + $grd->itemStyle = $params['itms']; + $grd->altItemStyle = $params['aitms']; - $grd->columns = $params['cols']; - $grd->fields = $params['flds']; - $grd->colWidths = $params['cwidth']; - $grd->colAligns = $params['calign']; - $grd->colColors = $params['ccolor']; - $grd->colTypes = $params['ctype']; + $grd->columns = $params['cols']; + $grd->fields = $params['flds']; + $grd->colWidths = $params['cwidth']; + $grd->colAligns = $params['calign']; + $grd->colColors = $params['ccolor']; + $grd->colTypes = $params['ctype']; - $grd->cellPadding = $params['cpad']; - $grd->cellSpacing = $params['cspace']; - $grd->header = $params['head']; - $grd->footer = $params['foot']; - $grd->pageSize = $params['psize']; - $grd->pagerLocation = $params['ploc']; - $grd->pagerClass = $params['pclass']; - $grd->pagerStyle = $params['pstyle']; - $o = $grd->render(); - break; + $grd->cellPadding = $params['cpad']; + $grd->cellSpacing = $params['cspace']; + $grd->header = $params['head']; + $grd->footer = $params['foot']; + $grd->pageSize = $params['psize']; + $grd->pagerLocation = $params['ploc']; + $grd->pagerClass = $params['pclass']; + $grd->pagerStyle = $params['pstyle']; + $o = $grd->render(); + break; - case 'htmlentities': - $value = parseInput($value); - if ($tvtype == 'checkbox' || $tvtype == 'listbox-multiple') { - // remove delimiter from checkbox and listbox-multiple TVs - $value = str_replace('||', '', $value); - } - $o = htmlentities($value, ENT_NOQUOTES, $modx->config['modx_charset']); - break; + case 'htmlentities': + $value = parseInput($value); + if($tvtype == 'checkbox' || $tvtype == 'listbox-multiple') { + // remove delimiter from checkbox and listbox-multiple TVs + $value = str_replace('||', '', $value); + } + $o = htmlentities($value, ENT_NOQUOTES, $modx->config['modx_charset']); + break; - case 'custom_widget': - $widget_output = ''; - $o = ''; - /* If we are loading a file */ - if (substr($params['output'], 0, 5) == "@FILE") { - $file_name = MODX_BASE_PATH . trim(substr($params['output'], 6)); - if (!file_exists($file_name)) { - $widget_output = $file_name . ' does not exist'; - } else { - $widget_output = file_get_contents($file_name); - } - } elseif (substr($params['output'], 0, 8) == '@INCLUDE') { - $file_name = MODX_BASE_PATH . trim(substr($params['output'], 9)); - if (!file_exists($file_name)) { - $widget_output = $file_name . ' does not exist'; - } else { - /* The included file needs to set $widget_output. Can be string, array, object */ - include $file_name; - } - } elseif (substr($params['output'], 0, 6) == '@CHUNK' && $value !== '') { - $chunk_name = trim(substr($params['output'], 7)); - $widget_output = $modx->getChunk($chunk_name); - } elseif (substr($params['output'], 0, 5) == '@EVAL' && $value !== '') { - $eval_str = trim(substr($params['output'], 6)); - $widget_output = eval($eval_str); - } elseif ($value !== '') { - $widget_output = $params['output']; - } else { - $widget_output = ''; - } - if (is_string($widget_output)) { - $_ = $modx->config['enable_filter']; - $modx->config['enable_filter'] = 1; - $widget_output = $modx->parseText($widget_output, array('value' => $value)); - $modx->config['enable_filter'] = $_; - $o = $modx->parseDocumentSource($widget_output); - } else { - $o = $widget_output; - } - break; + case 'custom_widget': + $widget_output = ''; + $o = ''; + /* If we are loading a file */ + if(substr($params['output'], 0, 5) == "@FILE") { + $file_name = MODX_BASE_PATH . trim(substr($params['output'], 6)); + if(!file_exists($file_name)) { + $widget_output = $file_name . ' does not exist'; + } else { + $widget_output = file_get_contents($file_name); + } + } elseif(substr($params['output'], 0, 8) == '@INCLUDE') { + $file_name = MODX_BASE_PATH . trim(substr($params['output'], 9)); + if(!file_exists($file_name)) { + $widget_output = $file_name . ' does not exist'; + } else { + /* The included file needs to set $widget_output. Can be string, array, object */ + include $file_name; + } + } elseif(substr($params['output'], 0, 6) == '@CHUNK' && $value !== '') { + $chunk_name = trim(substr($params['output'], 7)); + $widget_output = $modx->getChunk($chunk_name); + } elseif(substr($params['output'], 0, 5) == '@EVAL' && $value !== '') { + $eval_str = trim(substr($params['output'], 6)); + $widget_output = eval($eval_str); + } elseif($value !== '') { + $widget_output = $params['output']; + } else { + $widget_output = ''; + } + if(is_string($widget_output)) { + $_ = $modx->config['enable_filter']; + $modx->config['enable_filter'] = 1; + $widget_output = $modx->parseText($widget_output, array('value' => $value)); + $modx->config['enable_filter'] = $_; + $o = $modx->parseDocumentSource($widget_output); + } else { + $o = $widget_output; + } + break; - default: - $value = parseInput($value); - if ($tvtype == 'checkbox' || $tvtype == 'listbox-multiple') { - // add separator - $value = explode('||', $value); - $value = implode($sep, $value); - } - $o = $value; - break; - } - return $o; + default: + $value = parseInput($value); + if($tvtype == 'checkbox' || $tvtype == 'listbox-multiple') { + // add separator + $value = explode('||', $value); + $value = implode($sep, $value); + } + $o = $value; + break; + } + return $o; } /** * @param string $s * @return string */ -function decodeParamValue($s) -{ - $s = str_replace("%3D", '=', $s); // = - return str_replace("%26", '&', $s); // & +function decodeParamValue($s) { + $s = str_replace("%3D", '=', $s); // = + return str_replace("%26", '&', $s); // & } /** @@ -362,47 +355,43 @@ function decodeParamValue($s) * @param bool $columns * @return array|string */ -function parseInput($src, $delim = "||", $type = "string", $columns = true) -{ // type can be: string, array +function parseInput($src, $delim = "||", $type = "string", $columns = true) { // type can be: string, array $modx = evolutionCMS(); - if ($modx->db->isResult($src)) { - // must be a recordset - $rows = array(); - while ($cols = $modx->db->getRow($src, 'num')) { - $rows[] = ($columns) ? $cols : implode(" ", $cols); - } - return ($type == "array") ? $rows : implode($delim, $rows); - } else { - // must be a text - if ($type == "array") { - return explode($delim, $src); - } else { - return $src; - } - } + if($modx->db->isResult($src)) { + // must be a recordset + $rows = array(); + while($cols = $modx->db->getRow($src, 'num')) $rows[] = ($columns) ? $cols : implode(" ", $cols); + return ($type == "array") ? $rows : implode($delim, $rows); + } else { + // must be a text + if($type == "array") { + return explode($delim, $src); + } else { + return $src; + } + } } /** * @param string $value * @return bool|false|int */ -function getUnixtimeFromDateString($value) -{ - $timestamp = false; - // Check for MySQL or legacy style date - $date_match_1 = '/^([0-9]{2})-([0-9]{2})-([0-9]{4})\ ([0-9]{2}):([0-9]{2}):([0-9]{2})$/'; - $date_match_2 = '/^([0-9]{4})-([0-9]{2})-([0-9]{2})\ ([0-9]{2}):([0-9]{2}):([0-9]{2})$/'; - $matches = array(); - if (strpos($value, '-') !== false) { - if (preg_match($date_match_1, $value, $matches)) { - $timestamp = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[1], $matches[3]); - } elseif (preg_match($date_match_2, $value, $matches)) { - $timestamp = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]); - } - } - // If those didn't work, use strtotime to figure out the date - if ($timestamp === false || $timestamp === -1) { - $timestamp = strtotime($value); - } - return $timestamp; +function getUnixtimeFromDateString($value) { + $timestamp = false; + // Check for MySQL or legacy style date + $date_match_1 = '/^([0-9]{2})-([0-9]{2})-([0-9]{4})\ ([0-9]{2}):([0-9]{2}):([0-9]{2})$/'; + $date_match_2 = '/^([0-9]{4})-([0-9]{2})-([0-9]{2})\ ([0-9]{2}):([0-9]{2}):([0-9]{2})$/'; + $matches = array(); + if(strpos($value, '-') !== false) { + if(preg_match($date_match_1, $value, $matches)) { + $timestamp = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[1], $matches[3]); + } elseif(preg_match($date_match_2, $value, $matches)) { + $timestamp = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]); + } + } + // If those didn't work, use strtotime to figure out the date + if($timestamp === false || $timestamp === -1) { + $timestamp = strtotime($value); + } + return $timestamp; } diff --git a/manager/includes/tmplvars.inc.php b/manager/includes/tmplvars.inc.php index 725d66def2..98dad01b12 100755 --- a/manager/includes/tmplvars.inc.php +++ b/manager/includes/tmplvars.inc.php @@ -12,161 +12,160 @@ * @param array $tvsArray * @return string */ -function renderFormElement($field_type, $field_id, $default_text = '', $field_elements = '', $field_value = '', $field_style = '', $row = array(), $tvsArray = array()) -{ +function renderFormElement($field_type, $field_id, $default_text = '', $field_elements = '', $field_value = '', $field_style = '', $row = array(), $tvsArray = array()) { $modx = evolutionCMS(); - global $_style; - global $_lang; - global $content; - global $which_browser; + global $_style; + global $_lang; + global $content; + global $which_browser; - if (substr($default_text, 0, 6) === '@@EVAL' && $field_value === $default_text) { - $eval_str = trim(substr($default_text, 7)); - $default_text = eval($eval_str); - $field_value = $default_text; - } + if(substr($default_text, 0, 6) === '@@EVAL' && $field_value === $default_text) { + $eval_str = trim(substr($default_text, 7)); + $default_text = eval($eval_str); + $field_value = $default_text; + } - $field_html = ''; - $cimode = strpos($field_type, ':'); - if ($cimode === false) { - switch ($field_type) { + $field_html = ''; + $cimode = strpos($field_type, ':'); + if($cimode === false) { + switch($field_type) { - case "text": // handler for regular text boxes - case "rawtext": // non-htmlentity converted text boxes - $field_html .= ''; - break; - case "email": // handles email input fields - $field_html .= ''; - break; - case "number": // handles the input of numbers - $field_html .= ''; - break; - case "textareamini": // handler for textarea mini boxes - $field_html .= ''; - break; - case "textarea": // handler for textarea boxes - case "rawtextarea": // non-htmlentity convertex textarea boxes - case "htmlarea": // handler for textarea boxes (deprecated) - case "richtext": // handler for textarea boxes - $field_html .= ''; - break; - case "date": - $field_id = str_replace(array( - '-', - '.' - ), '_', urldecode($field_id)); - if ($field_value == '') { - $field_value = 0; - } - $field_html .= ''; - $field_html .= ' '; + case "text": // handler for regular text boxes + case "rawtext"; // non-htmlentity converted text boxes + $field_html .= ''; + break; + case "email": // handles email input fields + $field_html .= ''; + break; + case "number": // handles the input of numbers + $field_html .= ''; + break; + case "textareamini": // handler for textarea mini boxes + $field_html .= ''; + break; + case "textarea": // handler for textarea boxes + case "rawtextarea": // non-htmlentity convertex textarea boxes + case "htmlarea": // handler for textarea boxes (deprecated) + case "richtext": // handler for textarea boxes + $field_html .= ''; + break; + case "date": + $field_id = str_replace(array( + '-', + '.' + ), '_', urldecode($field_id)); + if($field_value == '') { + $field_value = 0; + } + $field_html .= ''; + $field_html .= ' '; - break; - case "dropdown": // handler for select boxes - $field_html .= '"; - break; - case "listbox": // handler for select boxes - $field_html .= '"; - break; - case "listbox-multiple": // handler for select boxes where you can choose multiple items - $field_value = explode("||", $field_value); - $field_html .= '"; - break; - case "url": // handles url input fields - $urls = array( - '' => '--', - 'http://' => 'http://', - 'https://' => 'https://', - 'ftp://' => 'ftp://', - 'mailto:' => 'mailto:' - ); - $field_html = '
    The MODX parser recieved the following debug/ stop message:
    « $msg »

          SQL: $query
    +if(!empty($query)) { + $parsedMessageString .= "

          SQL: $query
          [Copy SQL to ClipBoard]
     
    PHP error debug
      Error: $text 
     
    PHP error debug
      Error type/ Nr.: " . $errortype[$nr] . " - $nr 
      Error: $text 
      File: $file 
      Error type/ Nr.: ".$errortype[$nr]." - $nr 
      Line: $line 
      Line $line source: $source 
      File: $file 
      Line: $line 
      Line $line source: $source 
     
    Parser timing
    '; - $field_html .= '
    '; - break; - case 'checkbox': // handles check boxes - $values = !is_array($field_value) ? explode('||', $field_value) : $field_value; - $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); - $tpl = '
    '; - static $i = 0; - $_ = array(); - foreach ($index_list as $c => $item) { - if (is_array($item)) { - $name = trim($item[0]); - $value = isset($item[1]) ? $item[1] : $name; - } else { - $item = trim($item); - list($name, $value) = (strpos($item, '==') !== false) ? explode('==', $item, 2) : array( - $item, - $item - ); - } - $checked = in_array($value, $values) ? ' checked="checked"' : ''; - $param = array( - $modx->htmlspecialchars($value), - $i, - $field_id, - $checked, - $name - ); - $_[] = vsprintf($tpl, $param); - $i++; - } - $field_html = implode("\n", $_); - break; - case "option": // handles radio buttons - $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); - static $i = 0; - while (list($item, $itemvalue) = each($index_list)) { - list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue); - if (strlen($itemvalue) == 0) { - $itemvalue = $item; - } - $field_html .= '
    '; - $i++; - } - break; - case "image": // handles image fields using htmlarea image manager - global $_lang; - global $ResourceManagerLoaded; - global $content, $use_editor, $which_editor; - if (!$ResourceManagerLoaded && !(($content['richtext'] == 1 || $modx->manager->action == 4) && $use_editor == 1 && $which_editor == 3)) { - $field_html .= " + break; + case "dropdown": // handler for select boxes + $field_html .= '"; + break; + case "listbox": // handler for select boxes + $field_html .= '"; + break; + case "listbox-multiple": // handler for select boxes where you can choose multiple items + $field_value = explode("||", $field_value); + $field_html .= '"; + break; + case "url": // handles url input fields + $urls = array( + '' => '--', + 'http://' => 'http://', + 'https://' => 'https://', + 'ftp://' => 'ftp://', + 'mailto:' => 'mailto:' + ); + $field_html = '
    '; + $field_html .= '
    '; + break; + case 'checkbox': // handles check boxes + $values = !is_array($field_value) ? explode('||', $field_value) : $field_value; + $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); + $tpl = '
    '; + static $i = 0; + $_ = array(); + foreach($index_list as $c => $item) { + if(is_array($item)) { + $name = trim($item[0]); + $value = isset($item[1]) ? $item[1] : $name; + } else { + $item = trim($item); + list($name, $value) = (strpos($item, '==') !== false) ? explode('==', $item, 2) : array( + $item, + $item + ); + } + $checked = in_array($value, $values) ? ' checked="checked"' : ''; + $param = array( + $modx->htmlspecialchars($value), + $i, + $field_id, + $checked, + $name + ); + $_[] = vsprintf($tpl, $param); + $i++; + } + $field_html = implode("\n", $_); + break; + case "option": // handles radio buttons + $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); + static $i = 0; + while(list($item, $itemvalue) = each($index_list)) { + list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue); + if(strlen($itemvalue) == 0) { + $itemvalue = $item; + } + $field_html .= '
    '; + $i++; + } + break; + case "image": // handles image fields using htmlarea image manager + global $_lang; + global $ResourceManagerLoaded; + global $content, $use_editor, $which_editor; + if(!$ResourceManagerLoaded && !(($content['richtext'] == 1 || $modx->manager->action == 4) && $use_editor == 1 && $which_editor == 3)) { + $field_html .= " "; - $ResourceManagerLoaded = true; - } - $field_html .= ''; - break; - case "file": // handles the input of file uploads - /* Modified by Timon for use with resource browser */ - global $_lang; - global $ResourceManagerLoaded; - global $content, $use_editor, $which_editor; - if (!$ResourceManagerLoaded && !(($content['richtext'] == 1 || $modx->manager->action == 4) && $use_editor == 1 && $which_editor == 3)) { - /* I didn't understand the meaning of the condition above, so I left it untouched ;-) */ - $field_html .= " + $ResourceManagerLoaded = true; + } + $field_html .= ''; + break; + case "file": // handles the input of file uploads + /* Modified by Timon for use with resource browser */ + global $_lang; + global $ResourceManagerLoaded; + global $content, $use_editor, $which_editor; + if(!$ResourceManagerLoaded && !(($content['richtext'] == 1 || $modx->manager->action == 4) && $use_editor == 1 && $which_editor == 3)) { + /* I didn't understand the meaning of the condition above, so I left it untouched ;-) */ + $field_html .= " "; - $ResourceManagerLoaded = true; - } - $field_html .= ''; + $ResourceManagerLoaded = true; + } + $field_html .= ''; - break; + break; - case 'custom_tv': - $custom_output = ''; - /* If we are loading a file */ - if (substr($field_elements, 0, 5) == "@FILE") { - $file_name = MODX_BASE_PATH . trim(substr($field_elements, 6)); - if (!file_exists($file_name)) { - $custom_output = $file_name . ' does not exist'; - } else { - $custom_output = file_get_contents($file_name); - } - } elseif (substr($field_elements, 0, 8) == '@INCLUDE') { - $file_name = MODX_BASE_PATH . trim(substr($field_elements, 9)); - if (!file_exists($file_name)) { - $custom_output = $file_name . ' does not exist'; - } else { - ob_start(); - include $file_name; - $custom_output = ob_get_contents(); - ob_end_clean(); - } - } elseif (substr($field_elements, 0, 6) == "@CHUNK") { - $chunk_name = trim(substr($field_elements, 7)); - $chunk_body = $modx->getChunk($chunk_name); - if ($chunk_body == false) { - $custom_output = $_lang['chunk_no_exist'] . '(' . $_lang['htmlsnippet_name'] . ':' . $chunk_name . ')'; - } else { - $custom_output = $chunk_body; - } - } elseif (substr($field_elements, 0, 5) == "@EVAL") { - $eval_str = trim(substr($field_elements, 6)); - $custom_output = eval($eval_str); - } else { - $custom_output = $field_elements; - } - $replacements = array( - '[+field_type+]' => $field_type, - '[+field_id+]' => $field_id, - '[+default_text+]' => $default_text, - '[+field_value+]' => $modx->htmlspecialchars($field_value), - '[+field_style+]' => $field_style, - ); - $custom_output = str_replace(array_keys($replacements), $replacements, $custom_output); - $modx->documentObject = $content; - $modx->documentIdentifier = $content['id']; - $custom_output = $modx->parseDocumentSource($custom_output); - $field_html .= $custom_output; - break; + case 'custom_tv': + $custom_output = ''; + /* If we are loading a file */ + if(substr($field_elements, 0, 5) == "@FILE") { + $file_name = MODX_BASE_PATH . trim(substr($field_elements, 6)); + if(!file_exists($file_name)) { + $custom_output = $file_name . ' does not exist'; + } else { + $custom_output = file_get_contents($file_name); + } + } elseif(substr($field_elements, 0, 8) == '@INCLUDE') { + $file_name = MODX_BASE_PATH . trim(substr($field_elements, 9)); + if(!file_exists($file_name)) { + $custom_output = $file_name . ' does not exist'; + } else { + ob_start(); + include $file_name; + $custom_output = ob_get_contents(); + ob_end_clean(); + } + } elseif(substr($field_elements, 0, 6) == "@CHUNK") { + $chunk_name = trim(substr($field_elements, 7)); + $chunk_body = $modx->getChunk($chunk_name); + if($chunk_body == false) { + $custom_output = $_lang['chunk_no_exist'] . '(' . $_lang['htmlsnippet_name'] . ':' . $chunk_name . ')'; + } else { + $custom_output = $chunk_body; + } + } elseif(substr($field_elements, 0, 5) == "@EVAL") { + $eval_str = trim(substr($field_elements, 6)); + $custom_output = eval($eval_str); + } else { + $custom_output = $field_elements; + } + $replacements = array( + '[+field_type+]' => $field_type, + '[+field_id+]' => $field_id, + '[+default_text+]' => $default_text, + '[+field_value+]' => $modx->htmlspecialchars($field_value), + '[+field_style+]' => $field_style, + ); + $custom_output = str_replace(array_keys($replacements), $replacements, $custom_output); + $modx->documentObject = $content; + $modx->documentIdentifier = $content['id']; + $custom_output = $modx->parseDocumentSource($custom_output); + $field_html .= $custom_output; + break; - default: // the default handler -- for errors, mostly - $field_html .= ''; + default: // the default handler -- for errors, mostly + $field_html .= ''; - } // end switch statement - } else { - $custom = explode(":", $field_type); - $custom_output = ''; - $file_name = MODX_BASE_PATH . 'assets/tvs/' . $custom['1'] . '/' . $custom['1'] . '.customtv.php'; - if (!file_exists($file_name)) { - $custom_output = $file_name . ' does not exist'; - } else { - ob_start(); - include $file_name; - $custom_output = ob_get_contents(); - ob_end_clean(); - } - $replacements = array( - '[+field_type+]' => $field_type, - '[+field_id+]' => $field_id, - '[+default_text+]' => $default_text, - '[+field_value+]' => $modx->htmlspecialchars($field_value), - '[+field_style+]' => $field_style, - ); - $custom_output = str_replace(array_keys($replacements), $replacements, $custom_output); - $modx->documentObject = $content; - $custom_output = $modx->parseDocumentSource($custom_output); - $field_html .= $custom_output; - } + } // end switch statement + } else { + $custom = explode(":", $field_type); + $custom_output = ''; + $file_name = MODX_BASE_PATH . 'assets/tvs/' . $custom['1'] . '/' . $custom['1'] . '.customtv.php'; + if(!file_exists($file_name)) { + $custom_output = $file_name . ' does not exist'; + } else { + ob_start(); + include $file_name; + $custom_output = ob_get_contents(); + ob_end_clean(); + } + $replacements = array( + '[+field_type+]' => $field_type, + '[+field_id+]' => $field_id, + '[+default_text+]' => $default_text, + '[+field_value+]' => $modx->htmlspecialchars($field_value), + '[+field_style+]' => $field_style, + ); + $custom_output = str_replace(array_keys($replacements), $replacements, $custom_output); + $modx->documentObject = $content; + $custom_output = $modx->parseDocumentSource($custom_output); + $field_html .= $custom_output; + } - return $field_html; + return $field_html; } // end renderFormElement function /** * @param string|array|mysqli_result $v * @return array */ -function ParseIntputOptions($v) -{ +function ParseIntputOptions($v) { $modx = evolutionCMS(); - $a = array(); - if (is_array($v)) { - return $v; - } elseif ($modx->db->isResult($v)) { - while ($cols = $modx->db->getRow($v, 'num')) { - $a[] = $cols; - } - } else { - $a = explode("||", $v); - } - return $a; + $a = array(); + if(is_array($v)) { + return $v; + } else if($modx->db->isResult($v)) { + while($cols = $modx->db->getRow($v, 'num')) $a[] = $cols; + } else { + $a = explode("||", $v); + } + return $a; } diff --git a/manager/includes/user_settings.inc.php b/manager/includes/user_settings.inc.php index 78848257fc..81ae5c37c6 100755 --- a/manager/includes/user_settings.inc.php +++ b/manager/includes/user_settings.inc.php @@ -4,7 +4,7 @@ } // START HACK -if (isset($modx)) { +if (isset ($modx)) { $user_id = $modx->getLoginUserID(); } else { $user_id = $_SESSION['mgrInternalKey']; diff --git a/manager/includes/veriword.php b/manager/includes/veriword.php index 4c438bada0..c33556b14f 100755 --- a/manager/includes/veriword.php +++ b/manager/includes/veriword.php @@ -5,7 +5,7 @@ $modx->getSettings(); $modx->invokeEvent('OnWebPageInit'); -$vword = new VeriWord(148, 60); +$vword = new VeriWord(148,60); $vword->output_image(); $vword->destroy_image(); @@ -41,8 +41,7 @@ ## see sample.php for test and usage ## sample URL: http://www.program-ruti.org/veriword/ #### -class VeriWord -{ +class VeriWord { /* path to font directory*/ public $dir_font = "ttf/"; @@ -53,8 +52,7 @@ class VeriWord public $im_height = 0; public $im; - public function __construct($w=200, $h=80) - { + public function __construct($w=200, $h=80) { /* create session to set word for verification */ $this->set_veriword(); $this->dir_font = dirname(__FILE__) . '/' . $this->dir_font; @@ -62,24 +60,21 @@ public function __construct($w=200, $h=80) $this->im_height = $h; } - public function set_veriword() - { + public function set_veriword() { /* create session variable for verification, you may change the session variable name */ $this->word = $this->pick_word(); $_SESSION['veriword'] = $this->word; } - public function output_image() - { + public function output_image() { /* output the image as jpeg */ $this->draw_image(); header("Content-type: image/jpeg"); imagejpeg($this->im); } - public function pick_word() - { + public function pick_word() { $modx = evolutionCMS(); // set default words $words="MODX,Access,Better,BitCode,Chunk,Cache,Desc,Design,Excell,Enjoy,URLs,TechView,Gerald,Griff,Humphrey,Holiday,Intel,Integration,Joystick,Join(),Oscope,Genetic,Light,Likeness,Marit,Maaike,Niche,Netherlands,Ordinance,Oscillo,Parser,Phusion,Query,Question,Regalia,Righteous,Snippet,Sentinel,Template,Thespian,Unity,Enterprise,Verily,Veri,Website,WideWeb,Yap,Yellow,Zebra,Zygote"; @@ -87,27 +82,26 @@ public function pick_word() $arr_words = array_filter(array_map('trim', explode(',', $words))); /* pick one randomly for text verification */ - return (string) $arr_words[array_rand($arr_words)] . rand(10, 999); + return (string) $arr_words[array_rand($arr_words)].rand(10,999); } - public function draw_text() - { + public function draw_text() { $dir = dir($this->dir_font); $fontstmp = array(); while (false !== ($file = $dir->read())) { - if (substr($file, -4) == '.ttf') { - $fontstmp[] = $this->dir_font . $file; + if(substr($file, -4) == '.ttf') { + $fontstmp[] = $this->dir_font.$file; } } $dir->close(); $text_font = (string) $fontstmp[array_rand($fontstmp)]; /* angle for text inclination */ - $text_angle = rand(-9, 9); + $text_angle = rand(-9,9); /* initial text size */ $text_size = 30; /* calculate text width and height */ - $box = imagettfbbox($text_size, $text_angle, $text_font, $this->word); + $box = imagettfbbox ( $text_size, $text_angle, $text_font, $this->word); $text_width = $box[2]-$box[0]; //text width $text_height= $box[5]-$box[3]; //text height @@ -115,7 +109,7 @@ public function draw_text() $text_size = round((20 * $this->im_width)/$text_width); /* recalculate text width and height */ - $box = imagettfbbox($text_size, $text_angle, $text_font, $this->word); + $box = imagettfbbox ( $text_size, $text_angle, $text_font, $this->word); $text_width = $box[2]-$box[0]; //text width $text_height= $box[5]-$box[3]; //text height @@ -124,14 +118,14 @@ public function draw_text() $text_y = ($this->im_height - $text_height)/2; /* create canvas for text drawing */ - $im_text = imagecreate($this->im_width, $this->im_height); - $bg_color = imagecolorallocate($im_text, 255, 255, 255); + $im_text = imagecreate ($this->im_width, $this->im_height); + $bg_color = imagecolorallocate ($im_text, 255, 255, 255); /* pick color for text */ - $text_color = imagecolorallocate($im_text, 0, 51, 153); + $text_color = imagecolorallocate ($im_text, 0, 51, 153); /* draw text into canvas */ - imagettftext($im_text, + imagettftext ( $im_text, $text_size, $text_angle, $text_x, @@ -146,20 +140,19 @@ public function draw_text() } - public function draw_image() - { + public function draw_image() { /* pick one background image randomly from image directory */ - $img_file = $this->dir_noise . "noise" . rand(1, 4) . ".jpg"; + $img_file = $this->dir_noise."noise".rand(1,4).".jpg"; /* create "noise" background image from your image stock*/ - $noise_img = @imagecreatefromjpeg($img_file); + $noise_img = @imagecreatefromjpeg ($img_file); $noise_width = imagesx($noise_img); $noise_height = imagesy($noise_img); /* resize the background image to fit the size of image output */ - $this->im = imagecreatetruecolor($this->im_width, $this->im_height); - imagecopyresampled($this->im, + $this->im = imagecreatetruecolor($this->im_width,$this->im_height); + imagecopyresampled ($this->im, $noise_img, 0, 0, 0, 0, $this->im_width, @@ -168,18 +161,20 @@ public function draw_image() $noise_height); /* put text image into background image */ - imagecopymerge($this->im, + imagecopymerge ( $this->im, $this->draw_text(), 0, 0, 0, 0, $this->im_width, $this->im_height, - 70); + 70 ); return $this->im; } - public function destroy_image() - { + public function destroy_image() { + imagedestroy($this->im); + } + } diff --git a/manager/index.php b/manager/index.php index 921bbf7f22..2d134aefe9 100755 --- a/manager/index.php +++ b/manager/index.php @@ -1,42 +1,42 @@ Unable to load configuration settings"; - echo "Please run the EVO install utility"; - exit; + echo "

    Unable to load configuration settings

    "; + echo "Please run the EVO install utility"; + exit; } // include the database configuration file @@ -149,11 +139,11 @@ // initiate the content manager class if (isset($coreClass) && class_exists($coreClass)) { - $modx = new $coreClass; + $modx = new $coreClass; } if (!isset($modx) || !($modx instanceof DocumentParser)) { - include_once(MODX_MANAGER_PATH . 'includes/document.parser.class.inc.php'); - $modx = evolutionCMS(); + include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php'); + $modx = evolutionCMS(); } $modx->loadExtension("ManagerAPI"); @@ -175,31 +165,30 @@ extract($modx->config, EXTR_OVERWRITE); // now include_once different language file as english -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. +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. } // $length_eng_lang = count($_lang); // Not used for now, required for difference-check with other languages than english (i.e. inside installer) -if ($manager_language!="english" && file_exists(MODX_MANAGER_PATH . "includes/lang/" . $manager_language . ".inc.php")) { - include_once "lang/" . $manager_language . ".inc.php"; +if($manager_language!="english" && file_exists(MODX_MANAGER_PATH."includes/lang/".$manager_language.".inc.php")) { + include_once "lang/".$manager_language.".inc.php"; } // allow custom language overrides not altered by future EVO-updates -if (file_exists(MODX_MANAGER_PATH . "includes/lang/override/" . $manager_language . ".inc.php")) { - include_once "lang/override/" . $manager_language . ".inc.php"; +if(file_exists(MODX_MANAGER_PATH."includes/lang/override/".$manager_language.".inc.php")) { + include_once "lang/override/".$manager_language.".inc.php"; } $s = array('[+MGR_DIR+]'); $r = array(MGR_DIR); -foreach ($_lang as $k=>$v) { - if (strpos($v, '[+')!==false) { - $_lang[$k] = str_replace($s, $r, $v); - } +foreach($_lang as $k=>$v) +{ + if(strpos($v,'[+')!==false) $_lang[$k] = str_replace($s, $r, $v); } // send the charset header -header('Content-Type: text/html; charset=' . $modx_manager_charset); +header('Content-Type: text/html; charset='.$modx_manager_charset); /* * include_once "version.inc.php"; //include version info. Use $modx->getVersionData() @@ -209,53 +198,46 @@ include_once "accesscontrol.inc.php"; // double check the session -if (!isset($_SESSION['mgrValidated'])) { - echo "Not Logged In!"; - exit; +if(!isset($_SESSION['mgrValidated'])){ + echo "Not Logged In!"; + exit; } // include_once the style variables file -if (isset($manager_theme) && !isset($_style)) { - $_style = array(); - include_once "media/style/" . $manager_theme . "/style.php"; +if(isset($manager_theme) && !isset($_style)) { + $_style = array(); + include_once "media/style/".$manager_theme."/style.php"; } // check if user is allowed to access manager interface -if (isset($allow_manager_access) && $allow_manager_access==0) { - include_once "manager.lockout.inc.php"; +if(isset($allow_manager_access) && $allow_manager_access==0) { + include_once "manager.lockout.inc.php"; } // Initialize System Alert Message Queque -if (!isset($_SESSION['SystemAlertMsgQueque'])) { - $_SESSION['SystemAlertMsgQueque'] = array(); -} +if (!isset($_SESSION['SystemAlertMsgQueque'])) $_SESSION['SystemAlertMsgQueque'] = array(); $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque']; // first we check to see if this is a frameset request -if (!isset($_POST['a']) && !isset($_GET['a']) && !isset($_POST['updateMsgCount'])) { - // this looks to be a top-level frameset request, so let's serve up a frameset - if (is_file(MODX_MANAGER_PATH . "media/style/" . $manager_theme . "/frames/1.php")) { - include_once "media/style/" . $manager_theme . "/frames/1.php"; - } else { - include_once "frames/1.php"; - } - exit; +if(!isset($_POST['a']) && !isset($_GET['a']) && !isset($_POST['updateMsgCount'])) { + // this looks to be a top-level frameset request, so let's serve up a frameset + if(is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/frames/1.php")) { + include_once "media/style/".$manager_theme."/frames/1.php"; + }else{ + include_once "frames/1.php"; + } + exit; } // OK, let's retrieve the action directive from the request $option = array('min_range'=>1,'max_range'=>2000); -if (isset($_GET['a']) && isset($_POST['a'])) { - $modx->webAlertAndQuit($_lang['error_double_action']); -} elseif (isset($_GET['a'])) { - $action = filter_input(INPUT_GET, 'a', FILTER_VALIDATE_INT, $option); -} elseif (isset($_POST['a'])) { - $action = filter_input(INPUT_POST, 'a', FILTER_VALIDATE_INT, $option); -} else { - $action = null; -} +if(isset($_GET['a']) && isset($_POST['a'])) $modx->webAlertAndQuit($_lang['error_double_action']); +elseif(isset($_GET['a'])) $action = filter_input(INPUT_GET, 'a',FILTER_VALIDATE_INT,$option); +elseif(isset($_POST['a'])) $action = filter_input(INPUT_POST,'a',FILTER_VALIDATE_INT,$option); +else $action = null; if (isset($_POST['updateMsgCount']) && $modx->hasPermission('messages')) { - include_once 'messageCount.inc.php'; + include_once 'messageCount.inc.php'; } // save page to manager object @@ -263,34 +245,33 @@ // attempt to foil some simple types of CSRF attacks if (isset($modx->config['validate_referer']) && (int)$modx->config['validate_referer']) { - if (isset($_SERVER['HTTP_REFERER'])) { - $referer = $_SERVER['HTTP_REFERER']; - - if (!empty($referer)) { - if (!preg_match('/^' . preg_quote(MODX_SITE_URL, '/') . '/i', $referer)) { - $modx->webAlertAndQuit("A possible CSRF attempt was detected from referer: {$referer}.", "index.php"); - } - } else { - $modx->webAlertAndQuit("A possible CSRF attempt was detected. No referer was provided by the client.", "index.php"); - } - } else { - $modx->webAlertAndQuit("A possible CSRF attempt was detected. No referer was provided by the server.", "index.php"); - } + if (isset($_SERVER['HTTP_REFERER'])) { + $referer = $_SERVER['HTTP_REFERER']; + + if (!empty($referer)) { + if (!preg_match('/^'.preg_quote(MODX_SITE_URL, '/').'/i', $referer)) { + $modx->webAlertAndQuit("A possible CSRF attempt was detected from referer: {$referer}.", "index.php"); + } + } else { + $modx->webAlertAndQuit("A possible CSRF attempt was detected. No referer was provided by the client.", "index.php"); + } + } else { + $modx->webAlertAndQuit("A possible CSRF attempt was detected. No referer was provided by the server.", "index.php"); + } } // invoke OnManagerPageInit event $modx->invokeEvent("OnManagerPageInit", array("action" => $action)); // return element filepath -function includeFileProcessor($filepath, $manager_theme) -{ - $element = ""; - if (is_file(MODX_MANAGER_PATH . "media/style/" . $manager_theme . "/" . $filepath)) { - $element = MODX_MANAGER_PATH . "media/style/" . $manager_theme . "/" . $filepath; - } else { - $element = $filepath; - } - return $element; +function includeFileProcessor ($filepath,$manager_theme) { + $element = ""; + if(is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath)) { + $element = MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath; + }else{ + $element = $filepath; + } + return $element; } // Now we decide what to do according to the action request. This is a BIG list :) @@ -298,714 +279,714 @@ function includeFileProcessor($filepath, $manager_theme) /********************************************************************/ /* frame management - show the requested frame */ /********************************************************************/ - case 1: - // get the requested frame - $frame = preg_replace('/[^a-z0-9]/i', '', $_REQUEST['f']); - if ($frame>9) { - $enable_debug=false; // this is to stop the debug thingy being attached to the framesets - } - include_once(includeFileProcessor("frames/" . $frame . ".php", $manager_theme)); - break; + case 1 : + // get the requested frame + $frame = preg_replace('/[^a-z0-9]/i','',$_REQUEST['f']); + if($frame>9) { + $enable_debug=false; // this is to stop the debug thingy being attached to the framesets + } + include_once(includeFileProcessor("frames/".$frame.".php",$manager_theme)); + break; /********************************************************************/ /* show the homepage */ /********************************************************************/ - case 2: - // get the home page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/welcome.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 2: + // get the home page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/welcome.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* document data */ /********************************************************************/ - case 3: - // get the page to show document's data - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/document_data.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 3: + // get the page to show document's data + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/document_data.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* content management */ /********************************************************************/ - case 85: - // get the mutate page for adding a folder - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_content.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 27: - // get the mutate page for changing content - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_content.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 4: - // get the mutate page for adding content - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_content.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 5: - // get the save processor - include_once(includeFileProcessor("processors/save_content.processor.php", $manager_theme)); - break; - case 6: - // get the delete processor - include_once(includeFileProcessor("processors/delete_content.processor.php", $manager_theme)); - break; - case 63: - // get the undelete processor - include_once(includeFileProcessor("processors/undelete_content.processor.php", $manager_theme)); - break; - case 51: - // get the move action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/move_document.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 52: - // get the move document processor - include_once(includeFileProcessor("processors/move_document.processor.php", $manager_theme)); - break; - case 61: - // get the processor for publishing content - include_once(includeFileProcessor("processors/publish_content.processor.php", $manager_theme)); - break; - case 62: - // get the processor for publishing content - include_once(includeFileProcessor("processors/unpublish_content.processor.php", $manager_theme)); - break; - case 56: - // get the sort menuindex action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_menuindex_sort.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 85: + // get the mutate page for adding a folder + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 27: + // get the mutate page for changing content + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 4: + // get the mutate page for adding content + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 5: + // get the save processor + include_once(includeFileProcessor("processors/save_content.processor.php",$manager_theme)); + break; + case 6: + // get the delete processor + include_once(includeFileProcessor("processors/delete_content.processor.php",$manager_theme)); + break; + case 63: + // get the undelete processor + include_once(includeFileProcessor("processors/undelete_content.processor.php",$manager_theme)); + break; + case 51: + // get the move action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/move_document.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 52: + // get the move document processor + include_once(includeFileProcessor("processors/move_document.processor.php",$manager_theme)); + break; + case 61: + // get the processor for publishing content + include_once(includeFileProcessor("processors/publish_content.processor.php",$manager_theme)); + break; + case 62: + // get the processor for publishing content + include_once(includeFileProcessor("processors/unpublish_content.processor.php",$manager_theme)); + break; + case 56: + // get the sort menuindex action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_menuindex_sort.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* show the wait page - gives the tree time to refresh (hopefully) */ /********************************************************************/ - case 7: - // get the wait page (so the tree can reload) - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/wait.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 7: + // get the wait page (so the tree can reload) + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/wait.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* let the user log out */ /********************************************************************/ - case 8: - // get the logout processor - include_once(includeFileProcessor("processors/logout.processor.php", $manager_theme)); - break; + case 8: + // get the logout processor + include_once(includeFileProcessor("processors/logout.processor.php",$manager_theme)); + break; /********************************************************************/ /* user management */ /********************************************************************/ - case 87: - // get the new web user page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 88: - // get the edit web user page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 89: - // get the save web user processor - include_once(includeFileProcessor("processors/save_web_user.processor.php", $manager_theme)); - break; - case 90: - // get the delete web user page - include_once(includeFileProcessor("processors/delete_web_user.processor.php", $manager_theme)); - break; - case 11: - // get the new user page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_user.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 12: - // get the edit user page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_user.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 32: - // get the save user processor - include_once(includeFileProcessor("processors/save_user.processor.php", $manager_theme)); - break; - case 28: - // get the change password page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_password.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 34: - // get the save new password page - include_once(includeFileProcessor("processors/save_password.processor.php", $manager_theme)); - break; - case 33: - // get the delete user page - include_once(includeFileProcessor("processors/delete_user.processor.php", $manager_theme)); - break; + case 87: + // get the new web user page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 88: + // get the edit web user page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 89: + // get the save web user processor + include_once(includeFileProcessor("processors/save_web_user.processor.php",$manager_theme)); + break; + case 90: + // get the delete web user page + include_once(includeFileProcessor("processors/delete_web_user.processor.php",$manager_theme)); + break; + case 11: + // get the new user page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_user.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 12: + // get the edit user page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_user.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 32: + // get the save user processor + include_once(includeFileProcessor("processors/save_user.processor.php",$manager_theme)); + break; + case 28: + // get the change password page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_password.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 34: + // get the save new password page + include_once(includeFileProcessor("processors/save_password.processor.php",$manager_theme)); + break; + case 33: + // get the delete user page + include_once(includeFileProcessor("processors/delete_user.processor.php",$manager_theme)); + break; /********************************************************************/ /* role management */ /********************************************************************/ - case 38: - // get the new role page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_role.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 35: - // get the edit role page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_role.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 36: - // get the save role page - include_once(includeFileProcessor("processors/save_role.processor.php", $manager_theme)); - break; - case 37: - // get the delete role page - include_once(includeFileProcessor("processors/delete_role.processor.php", $manager_theme)); - break; + case 38: + // get the new role page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_role.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 35: + // get the edit role page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_role.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 36: + // get the save role page + include_once(includeFileProcessor("processors/save_role.processor.php",$manager_theme)); + break; + case 37: + // get the delete role page + include_once(includeFileProcessor("processors/delete_role.processor.php",$manager_theme)); + break; /********************************************************************/ /* category management */ /********************************************************************/ - case 120: - // get the edit category page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_categories.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 121: - // for ajax-requests - include_once(includeFileProcessor("actions/mutate_categories.dynamic.php", $manager_theme)); - break; + case 120: + // get the edit category page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_categories.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 121: + // for ajax-requests + include_once(includeFileProcessor("actions/mutate_categories.dynamic.php",$manager_theme)); + break; /********************************************************************/ /* template management */ /********************************************************************/ - case 16: - // get the edit template action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_templates.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 19: - // get the new template action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_templates.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 20: - // get the save processor - include_once(includeFileProcessor("processors/save_template.processor.php", $manager_theme)); - break; - case 21: - // get the delete processor - include_once(includeFileProcessor("processors/delete_template.processor.php", $manager_theme)); - break; - case 96: - // get the duplicate template processor - include_once(includeFileProcessor("processors/duplicate_template.processor.php", $manager_theme)); - break; - case 117: - // change the tv rank for selected template - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_template_tv_rank.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 16: + // get the edit template action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_templates.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 19: + // get the new template action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_templates.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 20: + // get the save processor + include_once(includeFileProcessor("processors/save_template.processor.php",$manager_theme)); + break; + case 21: + // get the delete processor + include_once(includeFileProcessor("processors/delete_template.processor.php",$manager_theme)); + break; + case 96: + // get the duplicate template processor + include_once(includeFileProcessor("processors/duplicate_template.processor.php",$manager_theme)); + break; + case 117: + // change the tv rank for selected template + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_template_tv_rank.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* snippet management */ /********************************************************************/ - case 22: - // get the edit snippet action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 23: - // get the new snippet action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 24: - // get the save processor - include_once(includeFileProcessor("processors/save_snippet.processor.php", $manager_theme)); - break; - case 25: - // get the delete processor - include_once(includeFileProcessor("processors/delete_snippet.processor.php", $manager_theme)); - break; - case 98: - // get the duplicate processor - include_once(includeFileProcessor("processors/duplicate_snippet.processor.php", $manager_theme)); - break; + case 22: + // get the edit snippet action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 23: + // get the new snippet action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 24: + // get the save processor + include_once(includeFileProcessor("processors/save_snippet.processor.php",$manager_theme)); + break; + case 25: + // get the delete processor + include_once(includeFileProcessor("processors/delete_snippet.processor.php",$manager_theme)); + break; + case 98: + // get the duplicate processor + include_once(includeFileProcessor("processors/duplicate_snippet.processor.php",$manager_theme)); + break; /********************************************************************/ /* htmlsnippet management */ /********************************************************************/ - case 78: - // get the edit snippet action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 77: - // get the new snippet action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 79: - // get the save processor - include_once(includeFileProcessor("processors/save_htmlsnippet.processor.php", $manager_theme)); - break; - case 80: - // get the delete processor - include_once(includeFileProcessor("processors/delete_htmlsnippet.processor.php", $manager_theme)); - break; - case 97: - // get the duplicate processor - include_once(includeFileProcessor("processors/duplicate_htmlsnippet.processor.php", $manager_theme)); - break; + case 78: + // get the edit snippet action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 77: + // get the new snippet action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 79: + // get the save processor + include_once(includeFileProcessor("processors/save_htmlsnippet.processor.php",$manager_theme)); + break; + case 80: + // get the delete processor + include_once(includeFileProcessor("processors/delete_htmlsnippet.processor.php",$manager_theme)); + break; + case 97: + // get the duplicate processor + include_once(includeFileProcessor("processors/duplicate_htmlsnippet.processor.php",$manager_theme)); + break; /********************************************************************/ /* show the credits page */ /********************************************************************/ - case 18: - // get the credits page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/credits.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 18: + // get the credits page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/credits.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* empty cache & synchronisation */ /********************************************************************/ - case 26: - // get the cache emptying processor - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/refresh_site.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 26: + // get the cache emptying processor + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/refresh_site.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* Module management */ /********************************************************************/ - case 106: - // get module management - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/modules.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 107: - // get the new module action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_module.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 108: - // get the edit module action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_module.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 109: - // get the save processor - include_once(includeFileProcessor("processors/save_module.processor.php", $manager_theme)); - break; - case 110: - // get the delete processor - include_once(includeFileProcessor("processors/delete_module.processor.php", $manager_theme)); - break; - case 111: - // get the duplicate processor - include_once(includeFileProcessor("processors/duplicate_module.processor.php", $manager_theme)); - break; - case 112: - // execute/run the module - //include_once "header.inc.php"; - include_once(includeFileProcessor("processors/execute_module.processor.php", $manager_theme)); - //include_once "footer.inc.php"; - break; - case 113: - // get the module resources (dependencies) action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_module_resources.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 106: + // get module management + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/modules.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 107: + // get the new module action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_module.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 108: + // get the edit module action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_module.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 109: + // get the save processor + include_once(includeFileProcessor("processors/save_module.processor.php",$manager_theme)); + break; + case 110: + // get the delete processor + include_once(includeFileProcessor("processors/delete_module.processor.php",$manager_theme)); + break; + case 111: + // get the duplicate processor + include_once(includeFileProcessor("processors/duplicate_module.processor.php",$manager_theme)); + break; + case 112: + // execute/run the module + //include_once "header.inc.php"; + include_once(includeFileProcessor("processors/execute_module.processor.php",$manager_theme)); + //include_once "footer.inc.php"; + break; + case 113: + // get the module resources (dependencies) action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_module_resources.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* plugin management */ /********************************************************************/ - case 100: - // change the plugin priority - //include_once "header.inc.php"; - in action file - include_once(includeFileProcessor("actions/mutate_plugin_priority.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 101: - // get the new plugin action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 102: - // get the edit plugin action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 103: - // get the save processor - include_once(includeFileProcessor("processors/save_plugin.processor.php", $manager_theme)); - break; - case 104: - // get the delete processor - include_once(includeFileProcessor("processors/delete_plugin.processor.php", $manager_theme)); - break; - case 105: - // get the duplicate processor - include_once(includeFileProcessor("processors/duplicate_plugin.processor.php", $manager_theme)); - break; - case 119: - // get the purge processor - include_once(includeFileProcessor("processors/purge_plugin.processor.php", $manager_theme)); - break; + case 100: + // change the plugin priority + //include_once "header.inc.php"; - in action file + include_once(includeFileProcessor("actions/mutate_plugin_priority.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 101: + // get the new plugin action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 102: + // get the edit plugin action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 103: + // get the save processor + include_once(includeFileProcessor("processors/save_plugin.processor.php",$manager_theme)); + break; + case 104: + // get the delete processor + include_once(includeFileProcessor("processors/delete_plugin.processor.php",$manager_theme)); + break; + case 105: + // get the duplicate processor + include_once(includeFileProcessor("processors/duplicate_plugin.processor.php",$manager_theme)); + break; + case 119: + // get the purge processor + include_once(includeFileProcessor("processors/purge_plugin.processor.php",$manager_theme)); + break; /********************************************************************/ /* view phpinfo */ /********************************************************************/ - case 200: - // show phpInfo - if ($modx->hasPermission('logs')) { - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/phpinfo.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - } - break; + case 200: + // show phpInfo + if($modx->hasPermission('logs')) { + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/phpinfo.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + } + break; /********************************************************************/ /* errorpage */ /********************************************************************/ - case 29: - // get the error page - include_once(includeFileProcessor("actions/error_dialog.static.php", $manager_theme)); - break; + case 29: + // get the error page + include_once(includeFileProcessor("actions/error_dialog.static.php",$manager_theme)); + break; /********************************************************************/ /* file manager */ /********************************************************************/ - case 31: - // get the page to manage files - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/files.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 31: + // get the page to manage files + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/files.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* access permissions */ /********************************************************************/ - case 40: - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/access_permissions.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 91: - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/web_access_permissions.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 40: + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/access_permissions.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 91: + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/web_access_permissions.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* access groups processor */ /********************************************************************/ - case 41: - include_once(includeFileProcessor("processors/access_groups.processor.php", $manager_theme)); - break; - case 92: - include_once(includeFileProcessor("processors/web_access_groups.processor.php", $manager_theme)); - break; + case 41: + include_once(includeFileProcessor("processors/access_groups.processor.php",$manager_theme)); + break; + case 92: + include_once(includeFileProcessor("processors/web_access_groups.processor.php",$manager_theme)); + break; /********************************************************************/ /* settings editor */ /********************************************************************/ - case 17: - // get the settings editor - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_settings.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 118: - // call settings ajax include - ob_clean(); - include_once(includeFileProcessor("includes/mutate_settings.ajax.php", $manager_theme)); - break; + case 17: + // get the settings editor + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_settings.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 118: + // call settings ajax include + ob_clean(); + include_once(includeFileProcessor("includes/mutate_settings.ajax.php",$manager_theme)); + break; /********************************************************************/ /* save settings */ /********************************************************************/ - case 30: - // get the save settings processor - include_once(includeFileProcessor("processors/save_settings.processor.php", $manager_theme)); - break; + case 30: + // get the save settings processor + include_once(includeFileProcessor("processors/save_settings.processor.php",$manager_theme)); + break; /********************************************************************/ /* system information */ /********************************************************************/ - case 53: - // get the settings editor - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/sysinfo.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 53: + // get the settings editor + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/sysinfo.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* optimise table */ /********************************************************************/ - case 54: - // get the table optimizer/truncate processor - include_once(includeFileProcessor("processors/optimize_table.processor.php", $manager_theme)); - break; + case 54: + // get the table optimizer/truncate processor + include_once(includeFileProcessor("processors/optimize_table.processor.php",$manager_theme)); + break; /********************************************************************/ /* view logging */ /********************************************************************/ - case 13: - // view logging - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/logging.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 13: + // view logging + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/logging.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* empty logs */ /********************************************************************/ - case 55: - // get the settings editor - include_once(includeFileProcessor("processors/empty_table.processor.php", $manager_theme)); - break; + case 55: + // get the settings editor + include_once(includeFileProcessor("processors/empty_table.processor.php",$manager_theme)); + break; /********************************************************************/ /* calls test page */ /********************************************************************/ - case 999: - // get the test page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("test_page.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 999: + // get the test page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("test_page.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* Empty recycle bin */ /********************************************************************/ - case 64: - // get the Recycle bin emptier - include_once(includeFileProcessor("processors/remove_content.processor.php", $manager_theme)); - break; + case 64: + // get the Recycle bin emptier + include_once(includeFileProcessor("processors/remove_content.processor.php",$manager_theme)); + break; /********************************************************************/ /* Messages */ /********************************************************************/ - case 10: - // get the messages page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/messages.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 10: + // get the messages page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/messages.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* Delete a message */ /********************************************************************/ - case 65: - // get the message deleter - include_once(includeFileProcessor("processors/delete_message.processor.php", $manager_theme)); - break; + case 65: + // get the message deleter + include_once(includeFileProcessor("processors/delete_message.processor.php",$manager_theme)); + break; /********************************************************************/ /* Send a message */ /********************************************************************/ - case 66: - // get the message deleter - include_once(includeFileProcessor("processors/send_message.processor.php", $manager_theme)); - break; + case 66: + // get the message deleter + include_once(includeFileProcessor("processors/send_message.processor.php",$manager_theme)); + break; /********************************************************************/ /* Remove locks */ /********************************************************************/ - case 67: - // get the lock remover - include_once(includeFileProcessor("processors/remove_locks.processor.php", $manager_theme)); - break; + case 67: + // get the lock remover + include_once(includeFileProcessor("processors/remove_locks.processor.php",$manager_theme)); + break; /********************************************************************/ /* Site schedule */ /********************************************************************/ - case 70: - // get the schedule page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/site_schedule.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 70: + // get the schedule page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/site_schedule.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* Search */ /********************************************************************/ - case 71: - // get the search page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/search.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 71: + // get the search page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/search.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* About */ /********************************************************************/ - case 59: - // get the about page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/about.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 59: + // get the about page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/about.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* Add weblink */ /********************************************************************/ - case 72: - // get the weblink page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_content.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 72: + // get the weblink page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* User management */ /********************************************************************/ - case 75: - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/user_management.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 99: - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/web_user_management.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 86: - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/role_management.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 75: + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/user_management.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 99: + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/web_user_management.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 86: + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/role_management.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* template/ snippet management */ /********************************************************************/ - case 76: - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/resources.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 76: + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/resources.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* Export to file */ /********************************************************************/ - case 83: - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/export_site.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 83: + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/export_site.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* Resource Selector */ /********************************************************************/ - case 84: - include_once(includeFileProcessor("actions/resource_selector.static.php", $manager_theme)); - break; + case 84: + include_once(includeFileProcessor("actions/resource_selector.static.php",$manager_theme)); + break; /********************************************************************/ /* Backup Manager */ /********************************************************************/ - case 93: - # header and footer will be handled interally - include_once(includeFileProcessor("actions/bkmanager.static.php", $manager_theme)); - break; + case 93: + # header and footer will be handled interally + include_once(includeFileProcessor("actions/bkmanager.static.php",$manager_theme)); + break; /********************************************************************/ /* Duplicate Document */ /********************************************************************/ - case 94: - // get the duplicate processor - include_once(includeFileProcessor("processors/duplicate_content.processor.php", $manager_theme)); - break; + case 94: + // get the duplicate processor + include_once(includeFileProcessor("processors/duplicate_content.processor.php",$manager_theme)); + break; /********************************************************************/ /* Import Document from file */ /********************************************************************/ - case 95: - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/import_site.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 95: + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/import_site.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* Help */ /********************************************************************/ - case 9: - // get the help page - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/help.static.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 9: + // get the help page + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/help.static.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* Template Variables - Based on Apodigm's Docvars */ /********************************************************************/ - case 300: - // get the new document variable action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 301: - // get the edit document variable action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 302: - // get the save processor - include_once(includeFileProcessor("processors/save_tmplvars.processor.php", $manager_theme)); - break; - case 303: - // get the delete processor - include_once(includeFileProcessor("processors/delete_tmplvars.processor.php", $manager_theme)); - break; - case 304: - // get the duplicate processor - include_once(includeFileProcessor("processors/duplicate_tmplvars.processor.php", $manager_theme)); - break; - case 305: - // get the tv-rank action - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/mutate_tv_rank.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; + case 300: + // get the new document variable action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 301: + // get the edit document variable action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 302: + // get the save processor + include_once(includeFileProcessor("processors/save_tmplvars.processor.php",$manager_theme)); + break; + case 303: + // get the delete processor + include_once(includeFileProcessor("processors/delete_tmplvars.processor.php",$manager_theme)); + break; + case 304: + // get the duplicate processor + include_once(includeFileProcessor("processors/duplicate_tmplvars.processor.php",$manager_theme)); + break; + case 305: + // get the tv-rank action + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/mutate_tv_rank.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; /********************************************************************/ /* Event viewer: show event message log */ /********************************************************************/ - case 114: - // get event logs - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/eventlog.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 115: - // get event log details viewer - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - include_once(includeFileProcessor("actions/eventlog_details.dynamic.php", $manager_theme)); - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); - break; - case 116: - // get the event log delete processor - include_once(includeFileProcessor("processors/delete_eventlog.processor.php", $manager_theme)); - break; - - case 501: - //delete category - include_once(includeFileProcessor("processors/delete_category.processor.php", $manager_theme)); - break; + case 114: + // get event logs + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/eventlog.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 115: + // get event log details viewer + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + include_once(includeFileProcessor("actions/eventlog_details.dynamic.php",$manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); + break; + case 116: + // get the event log delete processor + include_once(includeFileProcessor("processors/delete_eventlog.processor.php",$manager_theme)); + break; + + case 501: + //delete category + include_once(includeFileProcessor("processors/delete_category.processor.php",$manager_theme)); + break; /********************************************************************/ /* default action: show not implemented message */ /********************************************************************/ - default: - // say that what was requested doesn't do anything yet - include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); - echo " -
    " . $_lang['functionnotimpl'] . "
    + default : + // say that what was requested doesn't do anything yet + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); + echo " +
    ".$_lang['functionnotimpl']."
    -

    " . $_lang['functionnotimpl_message'] . "

    +

    ".$_lang['functionnotimpl_message']."

    "; - include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); } /********************************************************************/ // log action, unless it's a frame request -if ($action!=1 && $action!=7 && $action!=2) { - include_once "log.class.inc.php"; - $log = new logHandler; - $log->initAndWriteLog(); +if($action!=1 && $action!=7 && $action!=2) { + include_once "log.class.inc.php"; + $log = new logHandler; + $log->initAndWriteLog(); } /********************************************************************/ // show debug diff --git a/manager/media/browser/mcpuk/browse.php b/manager/media/browser/mcpuk/browse.php index a89e141a4e..0f0e308919 100755 --- a/manager/media/browser/mcpuk/browse.php +++ b/manager/media/browser/mcpuk/browse.php @@ -14,19 +14,14 @@ require "core/autoload.php"; // Init MODX -function returnNoPermissionsMessage($role) -{ - global $_lang; - echo sprintf($_lang['files_management_no_permission'], $role); - exit; +function returnNoPermissionsMessage($role) { + global $_lang; + echo sprintf($_lang['files_management_no_permission'], $role); + exit; } -if ($_GET['type'] == 'images' && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_images')) { - returnNoPermissionsMessage('assets_images'); -} -if ($_GET['type'] == 'files' && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_files')) { - returnNoPermissionsMessage('assets_files'); -} +if( $_GET['type'] == 'images' && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_images')) returnNoPermissionsMessage('assets_images'); +if( $_GET['type'] == 'files' && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_files')) returnNoPermissionsMessage('assets_files'); $browser = new browser($modx); $browser->action(); diff --git a/manager/media/browser/mcpuk/browser.php b/manager/media/browser/mcpuk/browser.php index 0e76c21c27..7ed522bbbf 100755 --- a/manager/media/browser/mcpuk/browser.php +++ b/manager/media/browser/mcpuk/browser.php @@ -10,20 +10,14 @@ } }; window.location.href = "browse.php?"; diff --git a/manager/media/browser/mcpuk/config.php b/manager/media/browser/mcpuk/config.php index eff680bb65..6bb2648559 100755 --- a/manager/media/browser/mcpuk/config.php +++ b/manager/media/browser/mcpuk/config.php @@ -26,12 +26,12 @@ 'theme' => "evo", - 'uploadURL' => rtrim($modx->config['rb_base_url'], '/'), - 'uploadDir' => rtrim($modx->config['rb_base_dir'], '/'), + 'uploadURL' => rtrim($modx->config['rb_base_url'],'/'), + 'uploadDir' => rtrim($modx->config['rb_base_dir'],'/'), 'siteURL' => $modx->config['site_url'], - 'assetsURL' => rtrim($modx->config['rb_base_url'], '/'), - 'dirPerms' => intval($modx->config['new_folder_permissions'], 8), - 'filePerms' => intval($modx->config['new_file_permissions'], 8), + 'assetsURL' => rtrim($modx->config['rb_base_url'],'/'), + 'dirPerms' => intval($modx->config['new_folder_permissions'],8), + 'filePerms' => intval($modx->config['new_file_permissions'],8), 'maxfilesize' => $settings['upload_maxsize'], 'denyUpdateCheck' => true, @@ -58,14 +58,14 @@ 'types' => array( // CKEditor & FCKEditor types - 'files' => str_replace(',', ' ', $modx->config['upload_files']), - 'flash' => str_replace(',', ' ', $modx->config['upload_flash']), - 'images' => str_replace(',', ' ', $modx->config['upload_images']), + 'files' => str_replace(',',' ',$modx->config['upload_files']), + 'flash' => str_replace(',',' ',$modx->config['upload_flash']), + 'images' => str_replace(',',' ',$modx->config['upload_images']), // TinyMCE types - 'file' => str_replace(',', ' ', $modx->config['upload_files']), - 'media' => str_replace(',', ' ', $modx->config['upload_media']), - 'image' => str_replace(',', ' ', $modx->config['upload_images']), + 'file' => str_replace(',',' ',$modx->config['upload_files']), + 'media' => str_replace(',',' ',$modx->config['upload_media']), + 'image' => str_replace(',',' ',$modx->config['upload_images']), ), 'dirnameChangeChars' => array( ' ' => "_", diff --git a/manager/media/browser/mcpuk/core/autoload.php b/manager/media/browser/mcpuk/core/autoload.php index bcb37f83c2..8f910cad63 100755 --- a/manager/media/browser/mcpuk/core/autoload.php +++ b/manager/media/browser/mcpuk/core/autoload.php @@ -19,42 +19,39 @@ * here, they can be accessed in config.php via $GLOBALS array. * It's recommended to use constants instead. */ -include_once(dirname(__FILE__) . "/../../../../../assets/cache/siteManager.php"); +include_once(dirname(__FILE__)."/../../../../../assets/cache/siteManager.php"); require_once('../../../includes/protect.inc.php'); include_once('../../../includes/config.inc.php'); include_once('../../../includes/document.parser.class.inc.php'); $modx = evolutionCMS(); $modx->db->connect(); startCMSSession(); -if (!isset($_SESSION['mgrValidated'])) { - die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if(!isset($_SESSION['mgrValidated'])) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } define('IN_MANAGER_MODE', true); $modx->getSettings(); $manager_language = $modx->config['manager_language']; // Pass language code from MODX to KCFinder -if (!file_exists("../../../includes/lang/" . $manager_language . ".inc.php")) { +if(!file_exists("../../../includes/lang/".$manager_language.".inc.php")) { $manager_language = "english"; // if not set, get the english language file. } -include_once "../../../includes/lang/" . $manager_language . ".inc.php"; +include_once "../../../includes/lang/".$manager_language.".inc.php"; $_GET['langCode'] = $modx_lang_attribute; // PHP VERSION CHECK -if (substr(PHP_VERSION, 0, strpos(PHP_VERSION, '.')) < 5) { +if (substr(PHP_VERSION, 0, strpos(PHP_VERSION, '.')) < 5) die("You are using PHP " . PHP_VERSION . " when KCFinder require at least version 5! Some systems has an option to change the active PHP version. Please refer to your hosting provider or upgrade your PHP distribution."); -} // SAFE MODE CHECK -if (ini_get("safe_mode")) { +if (ini_get("safe_mode")) die("The \"safe_mode\" PHP ini setting is turned on! You cannot run KCFinder in safe mode."); -} // MAGIC AUTOLOAD CLASSES FUNCTION -function autoloadda9d06472ccb71b84928677ce2a6ca89($class) -{ +function autoloadda9d06472ccb71b84928677ce2a6ca89($class) { static $classes = null; if ($classes === null) { $classes = array( @@ -86,8 +83,8 @@ function autoloadda9d06472ccb71b84928677ce2a6ca89($class) // json_encode() IMPLEMENTATION IF JSON EXTENSION IS MISSING if (!function_exists("json_encode")) { - function kcfinder_json_string_encode($string) - { + + function kcfinder_json_string_encode($string) { return '"' . str_replace('/', "\\/", str_replace("\t", "\\t", @@ -98,42 +95,37 @@ function kcfinder_json_string_encode($string) $string)))))) . '"'; } - function json_encode($data) - { + function json_encode($data) { + if (is_array($data)) { $ret = array(); // OBJECT if (array_keys($data) !== range(0, count($data) - 1)) { - foreach ($data as $key => $val) { + foreach ($data as $key => $val) $ret[] = kcfinder_json_string_encode($key) . ':' . json_encode($val); - } return "{" . implode(",", $ret) . "}"; // ARRAY } else { - foreach ($data as $val) { + foreach ($data as $val) $ret[] = json_encode($val); - } return "[" . implode(",", $ret) . "]"; } - // BOOLEAN OR NULL - } elseif (is_bool($data) || ($data === null)) { + // BOOLEAN OR NULL + } elseif (is_bool($data) || ($data === null)) return ($data === null) ? "null" : ($data ? "true" : "false"); - } // FLOAT - elseif (is_float($data)) { + elseif (is_float($data)) return rtrim(rtrim(number_format($data, 14, ".", ""), "0"), "."); - } // INTEGER - elseif (is_int($data)) { + elseif (is_int($data)) return $data; - } // STRING return kcfinder_json_string_encode($data); diff --git a/manager/media/browser/mcpuk/core/browser.php b/manager/media/browser/mcpuk/core/browser.php index 79d61b8f07..a978b321b1 100755 --- a/manager/media/browser/mcpuk/core/browser.php +++ b/manager/media/browser/mcpuk/core/browser.php @@ -12,29 +12,23 @@ * @link http://kcfinder.sunhater.com */ -class browser extends uploader -{ +class browser extends uploader { protected $action; protected $thumbsDir; protected $thumbsTypeDir; - public function __construct($modx) - { + public function __construct($modx) { parent::__construct($modx); if (isset($this->post['dir'])) { $dir = $this->checkInputDir($this->post['dir'], true, false); - if ($dir === false) { - unset($this->post['dir']); - } + if ($dir === false) unset($this->post['dir']); $this->post['dir'] = $dir; } if (isset($this->get['dir'])) { $dir = $this->checkInputDir($this->get['dir'], true, false); - if ($dir === false) { - unset($this->get['dir']); - } + if ($dir === false) unset($this->get['dir']); $this->get['dir'] = $dir; } @@ -50,9 +44,8 @@ public function __construct($modx) !is_dir("$thumbsDir/{$this->type}") && !@mkdir("$thumbsDir/{$this->type}", $this->config['dirPerms']) ) - ) { + ) $this->errorMsg("Cannot access or create thumbnails folder."); - } $this->thumbsDir = $thumbsDir; $this->thumbsTypeDir = "$thumbsDir/{$this->type}"; @@ -65,30 +58,23 @@ public function __construct($modx) if (is_array($files) && count($files)) { $time = time(); - foreach ($files as $file) { - if (is_file($file) && ($time - filemtime($file) > 3600)) { + foreach ($files as $file) + if (is_file($file) && ($time - filemtime($file) > 3600)) unlink($file); - } - } } if (isset($this->get['theme']) && ($this->get['theme'] == basename($this->get['theme'])) && is_dir("themes/{$this->get['theme']}") - ) { + ) $this->config['theme'] = $this->get['theme']; - } } - public function action() - { + public function action() { $act = isset($this->get['act']) ? $this->get['act'] : "browser"; - if (!preg_match('@^[0-9a-zA-Z_]+$@', $act)) { - $this->errorMsg("Unknown error."); - } - if (!method_exists($this, "act_$act")) { + if(!preg_match('@^[0-9a-zA-Z_]+$@', $act)) $this->errorMsg("Unknown error."); + if (!method_exists($this, "act_$act")) $act = "browser"; - } $this->action = $act; $method = "act_$act"; @@ -96,22 +82,21 @@ public function action() $message = $this->label("You don't have permissions to browse server."); if (in_array($act, array("browser", "upload")) || (substr($act, 0, 8) == "download") - ) { + ) $this->backMsg($message); - } else { + else { header("Content-Type: text/plain; charset={$this->charset}"); die(json_encode(array('error' => $message))); } } - if (!isset($this->session['dir'])) { + if (!isset($this->session['dir'])) $this->session['dir'] = $this->type; - } else { + else { $type = $this->getTypeFromPath($this->session['dir']); $dir = $this->config['uploadDir'] . "/" . $this->session['dir']; - if (($type != $this->type) || !is_dir($dir) || !is_readable($dir)) { + if (($type != $this->type) || !is_dir($dir) || !is_readable($dir)) $this->session['dir'] = $this->type; - } } $this->session['dir'] = path::normalize($this->session['dir']); @@ -121,9 +106,8 @@ public function action() } elseif ( (substr($act, 0, 8) != "download") && !in_array($act, array("thumb", "upload")) - ) { + ) header("Content-Type: text/plain; charset={$this->charset}"); - } $return = $this->$method(); echo ($return === true) @@ -131,25 +115,21 @@ public function action() : $return; } - protected function act_browser() - { + protected function act_browser() { if (isset($this->get['dir']) && is_dir("{$this->typeDir}/{$this->get['dir']}") && is_readable("{$this->typeDir}/{$this->get['dir']}") - ) { + ) $this->session['dir'] = path::normalize("{$this->type}/{$this->get['dir']}"); - } return $this->output(); } - protected function act_init() - { + protected function act_init() { $tree = $this->getDirInfo($this->typeDir); $tree['dirs'] = $this->getTree($this->session['dir']); - if (!is_array($tree['dirs']) || !count($tree['dirs'])) { + if (!is_array($tree['dirs']) || !count($tree['dirs'])) unset($tree['dirs']); - } $files = $this->getFiles($this->session['dir']); $dirWritable = dir::isWritable("{$this->config['uploadDir']}/{$this->session['dir']}"); $data = array( @@ -160,26 +140,21 @@ protected function act_init() return json_encode($data); } - protected function act_thumb() - { + protected function act_thumb() { $this->getDir($this->get['dir'], true); - if (!isset($this->get['file']) || !isset($this->get['dir'])) { + if (!isset($this->get['file']) || !isset($this->get['dir'])) $this->sendDefaultThumb(); - } $file = $this->get['file']; - if (basename($file) != $file) { + if (basename($file) != $file) $this->sendDefaultThumb(); - } $file = "{$this->thumbsDir}/{$this->type}/{$this->get['dir']}/$file"; if (!is_file($file) || !is_readable($file)) { $file = "{$this->config['uploadDir']}/{$this->type}/{$this->get['dir']}/" . basename($file); - if (!is_file($file) || !is_readable($file)) { + if (!is_file($file) || !is_readable($file)) $this->sendDefaultThumb($file); - } $image = image::factory($this->imageDriver, $file); - if ($image->initError) { + if ($image->initError) $this->sendDefaultThumb($file); - } list($tmp, $tmp, $type) = getimagesize($file); if (in_array($type, array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG)) && ($image->width <= $this->config['thumbWidth']) && @@ -190,20 +165,17 @@ protected function act_thumb() ($type == IMAGETYPE_PNG) ? "png" : "jpeg"); $mime = "image/$mime"; httpCache::file($file, $mime); - } else { + } else $this->sendDefaultThumb($file); - } } httpCache::file($file, "image/jpeg"); } - protected function act_expand() - { + protected function act_expand() { return json_encode(array('dirs' => $this->getDirs($this->postDir()))); } - protected function act_chDir() - { + protected function act_chDir() { $this->postDir(); // Just for existing check $this->session['dir'] = $this->type . "/" . $this->post['dir']; $dirWritable = dir::isWritable("{$this->config['uploadDir']}/{$this->session['dir']}"); @@ -213,104 +185,81 @@ protected function act_chDir() )); } - protected function act_newDir() - { + protected function act_newDir() { if (!$this->config['access']['dirs']['create'] || !isset($this->post['dir']) || !isset($this->post['newDir']) - ) { + ) $this->errorMsg("Unknown error."); - } $dir = $this->postDir(); $newDir = $this->normalizeDirname(trim($this->post['newDir'])); - if (!strlen($newDir)) { + if (!strlen($newDir)) $this->errorMsg("Please enter new folder name."); - } - if (preg_match('/[\/\\\\]/s', $newDir)) { + if (preg_match('/[\/\\\\]/s', $newDir)) $this->errorMsg("Unallowable characters in folder name."); - } - if (substr($newDir, 0, 1) == ".") { + if (substr($newDir, 0, 1) == ".") $this->errorMsg("Folder name shouldn't begins with '.'"); - } - if (file_exists("$dir/$newDir")) { + if (file_exists("$dir/$newDir")) $this->errorMsg("A file or folder with that name already exists."); - } - if (!@mkdir("$dir/$newDir", $this->config['dirPerms'])) { + if (!@mkdir("$dir/$newDir", $this->config['dirPerms'])) $this->errorMsg("Cannot create {dir} folder.", array('dir' => $newDir)); - } return true; } - protected function act_renameDir() - { + protected function act_renameDir() { if (!$this->config['access']['dirs']['rename'] || !isset($this->post['dir']) || !isset($this->post['newName']) - ) { + ) $this->errorMsg("Unknown error."); - } $dir = $this->postDir(); $newName = $this->normalizeDirname(trim($this->post['newName'])); - if (!strlen($newName)) { + if (!strlen($newName)) $this->errorMsg("Please enter new folder name."); - } - if (preg_match('/[\/\\\\]/s', $newName)) { + if (preg_match('/[\/\\\\]/s', $newName)) $this->errorMsg("Unallowable characters in folder name."); - } - if (substr($newName, 0, 1) == ".") { + if (substr($newName, 0, 1) == ".") $this->errorMsg("Folder name shouldn't begins with '.'"); - } - if (!@rename($dir, dirname($dir) . "/$newName")) { + if (!@rename($dir, dirname($dir) . "/$newName")) $this->errorMsg("Cannot rename the folder."); - } $thumbDir = "$this->thumbsTypeDir/{$this->post['dir']}"; - if (is_dir($thumbDir)) { + if (is_dir($thumbDir)) @rename($thumbDir, dirname($thumbDir) . "/$newName"); - } return json_encode(array('name' => $newName)); } - protected function act_deleteDir() - { + protected function act_deleteDir() { if (!$this->config['access']['dirs']['delete'] || !isset($this->post['dir']) || !strlen(trim($this->post['dir'])) - ) { + ) $this->errorMsg("Unknown error."); - } $dir = $this->postDir(); - if (!dir::isWritable($dir)) { + if (!dir::isWritable($dir)) $this->errorMsg("Cannot delete the folder."); - } $result = !dir::prune($dir, false); - if (is_array($result) && count($result)) { + if (is_array($result) && count($result)) $this->errorMsg("Failed to delete {count} files/folders.", array('count' => count($result))); - } $thumbDir = "$this->thumbsTypeDir/{$this->post['dir']}"; - if (is_dir($thumbDir)) { - dir::prune($thumbDir); - } + if (is_dir($thumbDir)) dir::prune($thumbDir); return true; } - protected function act_upload() - { + protected function act_upload() { if (!$this->config['access']['files']['upload'] || !isset($this->post['dir']) - ) { + ) $this->errorMsg("Unknown error."); - } $dir = $this->postDir(); - if (!dir::isWritable($dir)) { + if (!dir::isWritable($dir)) $this->errorMsg("Cannot access or write to upload folder."); - } if (is_array($this->file['name'])) { $return = array(); @@ -322,22 +271,19 @@ protected function act_upload() ), $dir); } return implode("\n", $return); - } else { + } else return $this->moveUploadFile($this->file, $dir); - } } - protected function act_download() - { + protected function act_download() { $dir = $this->postDir(); if (!isset($this->post['dir']) || !isset($this->post['file']) || - strpos($this->post['file'], '../')!==false || + strpos($this->post['file'],'../')!==false || (false === ($file = "$dir/{$this->post['file']}")) || !file_exists($file) || !is_readable($file) - ) { + ) $this->errorMsg("Unknown error."); - } header("Pragma: public"); header("Expires: 0"); @@ -351,248 +297,205 @@ protected function act_download() die; } - protected function act_rename() - { + protected function act_rename() { $dir = $this->postDir(); if (!$this->config['access']['files']['rename'] || !isset($this->post['dir']) || !isset($this->post['file']) || - strpos($this->post['file'], '../')!==false || + strpos($this->post['file'],'../')!==false || !isset($this->post['newName']) || (false === ($file = "$dir/{$this->post['file']}")) || !file_exists($file) || !is_readable($file) || !file::isWritable($file) - ) { + ) $this->errorMsg("Unknown error."); - } if (isset($this->config['denyExtensionRename']) && $this->config['denyExtensionRename'] && (file::getExtension($this->post['file'], true) !== file::getExtension($this->post['newName'], true) ) - ) { + ) $this->errorMsg("You cannot rename the extension of files!"); - } $newName = $this->normalizeFilename(trim($this->post['newName'])); - if (!strlen($newName)) { + if (!strlen($newName)) $this->errorMsg("Please enter new file name."); - } - if (preg_match('/[\/\\\\]/s', $newName)) { + if (preg_match('/[\/\\\\]/s', $newName)) $this->errorMsg("Unallowable characters in file name."); - } - if (substr($newName, 0, 1) == ".") { + if (substr($newName, 0, 1) == ".") $this->errorMsg("File name shouldn't begins with '.'"); - } $newName = "$dir/$newName"; - if (file_exists($newName)) { + if (file_exists($newName)) $this->errorMsg("A file or folder with that name already exists."); - } $ext = file::getExtension($newName); - if (!$this->validateExtension($ext, $this->type)) { + if (!$this->validateExtension($ext, $this->type)) $this->errorMsg("Denied file extension."); - } - if (!@rename($file, $newName)) { + if (!@rename($file, $newName)) $this->errorMsg("Unknown error."); - } $thumbDir = "{$this->thumbsTypeDir}/{$this->post['dir']}"; $thumbFile = "$thumbDir/{$this->post['file']}"; - if (file_exists($thumbFile)) { + if (file_exists($thumbFile)) @rename($thumbFile, "$thumbDir/" . basename($newName)); - } return true; } - protected function act_delete() - { + protected function act_delete() { $dir = $this->postDir(); if (!$this->config['access']['files']['delete'] || !isset($this->post['dir']) || !isset($this->post['file']) || - strpos($this->post['file'], '../')!==false || + strpos($this->post['file'],'../')!==false || (false === ($file = "$dir/{$this->post['file']}")) || !file_exists($file) || !is_readable($file) || !file::isWritable($file) || !@unlink($file) - ) { + ) $this->errorMsg("Unknown error."); - } $thumb = "{$this->thumbsTypeDir}/{$this->post['dir']}/{$this->post['file']}"; - if (file_exists($thumb)) { - @unlink($thumb); - } + if (file_exists($thumb)) @unlink($thumb); return true; } - protected function act_cp_cbd() - { + protected function act_cp_cbd() { $dir = $this->postDir(); if (!$this->config['access']['files']['copy'] || !isset($this->post['dir']) || !is_dir($dir) || !is_readable($dir) || !dir::isWritable($dir) || !isset($this->post['files']) || !is_array($this->post['files']) || !count($this->post['files']) - ) { + ) $this->errorMsg("Unknown error."); - } $error = array(); - foreach ($this->post['files'] as $file) { + foreach($this->post['files'] as $file) { $file = path::normalize($file); - if (substr($file, 0, 1) == ".") { - continue; - } + if (substr($file, 0, 1) == ".") continue; $type = explode("/", $file); $type = $type[0]; - if ($type != $this->type) { - continue; - } + if ($type != $this->type) continue; $path = "{$this->config['uploadDir']}/$file"; $base = basename($file); $replace = array('file' => $base); $ext = file::getExtension($base); - if (!file_exists($path)) { + if (!file_exists($path)) $error[] = $this->label("The file '{file}' does not exist.", $replace); - } elseif (substr($base, 0, 1) == ".") { + elseif (substr($base, 0, 1) == ".") $error[] = "$base: " . $this->label("File name shouldn't begins with '.'"); - } elseif (!$this->validateExtension($ext, $type)) { + elseif (!$this->validateExtension($ext, $type)) $error[] = "$base: " . $this->label("Denied file extension."); - } elseif (file_exists("$dir/$base")) { + elseif (file_exists("$dir/$base")) $error[] = "$base: " . $this->label("A file or folder with that name already exists."); - } elseif (!is_readable($path) || !is_file($path)) { + elseif (!is_readable($path) || !is_file($path)) $error[] = $this->label("Cannot read '{file}'.", $replace); - } elseif (!@copy($path, "$dir/$base")) { + elseif (!@copy($path, "$dir/$base")) $error[] = $this->label("Cannot copy '{file}'.", $replace); - } else { - if (function_exists("chmod")) { + else { + if (function_exists("chmod")) @chmod("$dir/$base", $this->config['filePerms']); - } $fromThumb = "{$this->thumbsDir}/$file"; if (is_file($fromThumb) && is_readable($fromThumb)) { $toThumb = "{$this->thumbsTypeDir}/{$this->post['dir']}"; - if (!is_dir($toThumb)) { + if (!is_dir($toThumb)) @mkdir($toThumb, $this->config['dirPerms'], true); - } $toThumb .= "/$base"; @copy($fromThumb, $toThumb); } } } - if (count($error)) { + if (count($error)) return json_encode(array('error' => $error)); - } return true; } - protected function act_mv_cbd() - { + protected function act_mv_cbd() { $dir = $this->postDir(); if (!$this->config['access']['files']['move'] || !isset($this->post['dir']) || !is_dir($dir) || !is_readable($dir) || !dir::isWritable($dir) || !isset($this->post['files']) || !is_array($this->post['files']) || !count($this->post['files']) - ) { + ) $this->errorMsg("Unknown error."); - } $error = array(); - foreach ($this->post['files'] as $file) { + foreach($this->post['files'] as $file) { $file = path::normalize($file); - if (substr($file, 0, 1) == ".") { - continue; - } + if (substr($file, 0, 1) == ".") continue; $type = explode("/", $file); $type = $type[0]; - if ($type != $this->type) { - continue; - } + if ($type != $this->type) continue; $path = "{$this->config['uploadDir']}/$file"; $base = basename($file); $replace = array('file' => $base); $ext = file::getExtension($base); - if (!file_exists($path)) { + if (!file_exists($path)) $error[] = $this->label("The file '{file}' does not exist.", $replace); - } elseif (substr($base, 0, 1) == ".") { + elseif (substr($base, 0, 1) == ".") $error[] = "$base: " . $this->label("File name shouldn't begins with '.'"); - } elseif (!$this->validateExtension($ext, $type)) { + elseif (!$this->validateExtension($ext, $type)) $error[] = "$base: " . $this->label("Denied file extension."); - } elseif (file_exists("$dir/$base")) { + elseif (file_exists("$dir/$base")) $error[] = "$base: " . $this->label("A file or folder with that name already exists."); - } elseif (!is_readable($path) || !is_file($path)) { + elseif (!is_readable($path) || !is_file($path)) $error[] = $this->label("Cannot read '{file}'.", $replace); - } elseif (!file::isWritable($path) || !@rename($path, "$dir/$base")) { + elseif (!file::isWritable($path) || !@rename($path, "$dir/$base")) $error[] = $this->label("Cannot move '{file}'.", $replace); - } else { - if (function_exists("chmod")) { + else { + if (function_exists("chmod")) @chmod("$dir/$base", $this->config['filePerms']); - } $fromThumb = "{$this->thumbsDir}/$file"; if (is_file($fromThumb) && is_readable($fromThumb)) { $toThumb = "{$this->thumbsTypeDir}/{$this->post['dir']}"; - if (!is_dir($toThumb)) { + if (!is_dir($toThumb)) @mkdir($toThumb, $this->config['dirPerms'], true); - } $toThumb .= "/$base"; @rename($fromThumb, $toThumb); } } } - if (count($error)) { + if (count($error)) return json_encode(array('error' => $error)); - } return true; } - protected function act_rm_cbd() - { + protected function act_rm_cbd() { if (!$this->config['access']['files']['delete'] || !isset($this->post['files']) || !is_array($this->post['files']) || !count($this->post['files']) - ) { + ) $this->errorMsg("Unknown error."); - } $error = array(); - foreach ($this->post['files'] as $file) { + foreach($this->post['files'] as $file) { $file = path::normalize($file); - if (substr($file, 0, 1) == ".") { - continue; - } + if (substr($file, 0, 1) == ".") continue; $type = explode("/", $file); $type = $type[0]; - if ($type != $this->type) { - continue; - } + if ($type != $this->type) continue; $path = "{$this->config['uploadDir']}/$file"; $base = basename($file); $replace = array('file' => $base); - if (!is_file($path)) { + if (!is_file($path)) $error[] = $this->label("The file '{file}' does not exist.", $replace); - } elseif (!@unlink($path)) { + elseif (!@unlink($path)) $error[] = $this->label("Cannot delete '{file}'.", $replace); - } else { + else { $thumb = "{$this->thumbsDir}/$file"; - if (is_file($thumb)) { - @unlink($thumb); - } + if (is_file($thumb)) @unlink($thumb); } } - if (count($error)) { + if (count($error)) return json_encode(array('error' => $error)); - } return true; } - protected function act_downloadDir() - { + protected function act_downloadDir() { $dir = $this->postDir(); - if (!isset($this->post['dir']) || $this->config['denyZipDownload']) { + if (!isset($this->post['dir']) || $this->config['denyZipDownload']) $this->errorMsg("Unknown error."); - } $filename = basename($dir) . ".zip"; do { $file = md5(time() . session_id()); @@ -607,27 +510,23 @@ protected function act_downloadDir() die; } - protected function act_downloadSelected() - { + protected function act_downloadSelected() { $dir = $this->postDir(); if (!isset($this->post['dir']) || !isset($this->post['files']) || !is_array($this->post['files']) || $this->config['denyZipDownload'] - ) { + ) $this->errorMsg("Unknown error."); - } $zipFiles = array(); foreach ($this->post['files'] as $file) { $file = path::normalize($file); - if ((substr($file, 0, 1) == ".") || (strpos($file, '/') !== false)) { + if ((substr($file, 0, 1) == ".") || (strpos($file, '/') !== false)) continue; - } $file = "$dir/$file"; - if (!is_file($file) || !is_readable($file)) { + if (!is_file($file) || !is_readable($file)) continue; - } $zipFiles[] = $file; } @@ -638,10 +537,9 @@ protected function act_downloadSelected() $zip = new ZipArchive(); $res = $zip->open($file, ZipArchive::CREATE); - if ($res === true) { - foreach ($zipFiles as $cfile) { + if ($res === TRUE) { + foreach ($zipFiles as $cfile) $zip->addFile($cfile, basename($cfile)); - } $zip->close(); } header("Content-Type: application/x-zip"); @@ -652,30 +550,25 @@ protected function act_downloadSelected() die; } - protected function act_downloadClipboard() - { + protected function act_downloadClipboard() { if (!isset($this->post['files']) || !is_array($this->post['files']) || $this->config['denyZipDownload'] - ) { + ) $this->errorMsg("Unknown error."); - } $zipFiles = array(); foreach ($this->post['files'] as $file) { $file = path::normalize($file); - if ((substr($file, 0, 1) == ".")) { + if ((substr($file, 0, 1) == ".")) continue; - } $type = explode("/", $file); $type = $type[0]; - if ($type != $this->type) { + if ($type != $this->type) continue; - } $file = $this->config['uploadDir'] . "/$file"; - if (!is_file($file) || !is_readable($file)) { + if (!is_file($file) || !is_readable($file)) continue; - } $zipFiles[] = $file; } @@ -686,10 +579,9 @@ protected function act_downloadClipboard() $zip = new ZipArchive(); $res = $zip->open($file, ZipArchive::CREATE); - if ($res === true) { - foreach ($zipFiles as $cfile) { + if ($res === TRUE) { + foreach ($zipFiles as $cfile) $zip->addFile($cfile, basename($cfile)); - } $zip->close(); } header("Content-Type: application/x-zip"); @@ -700,19 +592,16 @@ protected function act_downloadClipboard() die; } - protected function act_check4Update() - { - if ($this->config['denyUpdateCheck']) { + protected function act_check4Update() { + if ($this->config['denyUpdateCheck']) return json_encode(array('version' => false)); - } // Caching HTTP request for 6 hours if (isset($this->session['checkVersion']) && isset($this->session['checkVersionTime']) && ((time() - $this->session['checkVersionTime']) < 21600) - ) { + ) return json_encode(array('version' => $this->session['checkVersion'])); - } $protocol = "http"; $host = "kcfinder.sunhater.com"; @@ -729,8 +618,7 @@ protected function act_check4Update() preg_match($pattern, $ver) // HTTP extension - ) { - } elseif ( + ) {} elseif ( function_exists("http_get") && (false !== ($ver = @http_get($url))) && ( @@ -742,55 +630,48 @@ function_exists("http_get") && preg_match($pattern, $ver) // Curl extension - ) { - } elseif ( + ) {} elseif ( function_exists("curl_init") && - (false !== ($curl = @curl_init($url))) && - (@ob_start() || (@curl_close($curl) && false)) && - (@curl_exec($curl) || (@curl_close($curl) && false)) && - ((false !== ($ver = @ob_get_clean())) || (@curl_close($curl) && false)) && - (@curl_close($curl) || true) && + (false !== ( $curl = @curl_init($url) )) && + ( @ob_start() || (@curl_close($curl) && false)) && + ( @curl_exec($curl) || (@curl_close($curl) && false)) && + ((false !== ( $ver = @ob_get_clean() )) || (@curl_close($curl) && false)) && + ( @curl_close($curl) || true ) && preg_match($pattern, $ver) // Socket extension - ) { - } elseif (function_exists('socket_create')) { + ) {} elseif (function_exists('socket_create')) { $cmd = "GET $path " . strtoupper($protocol) . "/1.1\r\n" . "Host: $host\r\n" . "Connection: Close\r\n\r\n"; - if ((false !== ($socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) && - (false !== @socket_connect($socket, $host, $port)) && - (false !== @socket_write($socket, $cmd, strlen($cmd))) && - (false !== ($ver = @socket_read($socket, 2048))) && + if ((false !== ( $socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP) )) && + (false !== @socket_connect($socket, $host, $port) ) && + (false !== @socket_write($socket, $cmd, strlen($cmd)) ) && + (false !== ( $ver = @socket_read($socket, 2048) )) && preg_match($responsePattern, $ver, $match) - ) { + ) $ver = $match[2]; - } - if (isset($socket) && is_resource($socket)) { + if (isset($socket) && is_resource($socket)) @socket_close($socket); - } } if (isset($ver) && preg_match($pattern, $ver)) { $this->session['checkVersion'] = $ver; $this->session['checkVersionTime'] = time(); return json_encode(array('version' => $ver)); - } else { + } else return json_encode(array('version' => false)); - } } - protected function moveUploadFile($file, $dir) - { + protected function moveUploadFile($file, $dir) { $message = $this->checkUploadedFile($file); if ($message !== true) { - if (isset($file['tmp_name'])) { + if (isset($file['tmp_name'])) @unlink($file['tmp_name']); - } return "{$file['name']}: $message"; } @@ -803,13 +684,12 @@ protected function moveUploadFile($file, $dir) ) { @unlink($file['tmp_name']); return "{$file['name']}: " . $this->label("Cannot move uploaded file to target folder."); - } elseif (function_exists('chmod')) { + } elseif (function_exists('chmod')) chmod($target, $this->config['filePerms']); - } - $this->modx->invokeEvent('OnFileBrowserUpload', array( + $this->modx->invokeEvent('OnFileBrowserUpload',array( 'filepath'=>realpath($dir), - 'filename'=>str_replace("/", "", str_replace($dir, "", realpath($target))) + 'filename'=>str_replace("/","",str_replace($dir,"",realpath($target))) )); $this->makeThumb($target); @@ -817,95 +697,82 @@ protected function moveUploadFile($file, $dir) return "/" . basename($target); } - protected function sendDefaultThumb($file=null) - { + protected function sendDefaultThumb($file=null) { if ($file !== null) { $ext = file::getExtension($file); $thumb = "themes/{$this->config['theme']}/img/files/big/$ext.png"; } - if (!isset($thumb) || !file_exists($thumb)) { + if (!isset($thumb) || !file_exists($thumb)) $thumb = "themes/{$this->config['theme']}/img/files/big/..png"; - } header("Content-Type: image/png"); readfile($thumb); die; } - protected function getFiles($dir) - { - $thumbDir = "{$this->config['uploadDir']}/{$this->config['thumbsDir']}/$dir"; - $dir = "{$this->config['uploadDir']}/$dir"; - $return = array(); - $files = dir::content($dir, array('types' => "file")); - if ($files === false) { - return $return; - } - - foreach ($files as $file) { - $ext = file::getExtension($file); - $smallThumb = false; - if (in_array(strtolower($ext), array('png', 'jpg', 'gif', 'jpeg' ))) { - $size = @getimagesize($file); - if (is_array($size) && count($size)) { - $thumb_file = "$thumbDir/" . basename($file); - if (!is_file($thumb_file) || filemtime($file) > filemtime($thumb_file)) { - $this->makeThumb($file); - } - $smallThumb = - ($size[0] <= $this->config['thumbWidth']) && - ($size[1] <= $this->config['thumbHeight']) && - in_array($size[2], array(IMAGETYPE_GIF, IMAGETYPE_PNG, IMAGETYPE_JPEG)); - } - } - $stat = stat($file); - if ($stat === false) { - continue; - } - $name = basename($file); - $types = $this->config['types']; - $types = explode(' ', $types['images'] . ' ' . $types['image']); - if (substr($name, 0, 1) == '.' && !$this->config['showHiddenFiles']) { - continue; - } - if ($this->type == 'images' && !in_array(strtolower($ext), $types)) { - continue; - } - $bigIcon = file_exists("themes/{$this->config['theme']}/img/files/big/$ext.png"); - $smallIcon = file_exists("themes/{$this->config['theme']}/img/files/small/$ext.png"); - $thumb = file_exists("$thumbDir/$name"); - $return[] = array( - 'name' => stripcslashes($name), - 'size' => $stat['size'], - 'mtime' => $stat['mtime'], - 'date' => @strftime($this->dateTimeSmall, $stat['mtime']), - 'readable' => is_readable($file), - 'writable' => file::isWritable($file), - 'bigIcon' => $bigIcon, - 'smallIcon' => $smallIcon, - 'thumb' => $thumb, - 'smallThumb' => $smallThumb - ); - } - return $return; - } - - protected function getTree($dir, $index=0) - { + protected function getFiles($dir) { + $thumbDir = "{$this->config['uploadDir']}/{$this->config['thumbsDir']}/$dir"; + $dir = "{$this->config['uploadDir']}/$dir"; + $return = array(); + $files = dir::content($dir, array('types' => "file")); + if ($files === false) + return $return; + + foreach ($files as $file) { + $ext = file::getExtension($file); + $smallThumb = false; + if (in_array(strtolower($ext), array('png', 'jpg', 'gif', 'jpeg' )) ) { + $size = @getimagesize($file); + if (is_array($size) && count($size)) { + $thumb_file = "$thumbDir/" . basename($file); + if (!is_file($thumb_file) || filemtime($file) > filemtime($thumb_file)) + $this->makeThumb($file); + $smallThumb = + ($size[0] <= $this->config['thumbWidth']) && + ($size[1] <= $this->config['thumbHeight']) && + in_array($size[2], array(IMAGETYPE_GIF, IMAGETYPE_PNG, IMAGETYPE_JPEG)); + } + } + $stat = stat($file); + if ($stat === false) continue; + $name = basename($file); + $types = $this->config['types']; + $types = explode(' ',$types['images'].' '.$types['image']); + if (substr($name,0,1) == '.' && !$this->config['showHiddenFiles']) continue; + if ($this->type == 'images' && !in_array(strtolower($ext),$types)) continue; + $bigIcon = file_exists("themes/{$this->config['theme']}/img/files/big/$ext.png"); + $smallIcon = file_exists("themes/{$this->config['theme']}/img/files/small/$ext.png"); + $thumb = file_exists("$thumbDir/$name"); + $return[] = array( + 'name' => stripcslashes($name), + 'size' => $stat['size'], + 'mtime' => $stat['mtime'], + 'date' => @strftime($this->dateTimeSmall, $stat['mtime']), + 'readable' => is_readable($file), + 'writable' => file::isWritable($file), + 'bigIcon' => $bigIcon, + 'smallIcon' => $smallIcon, + 'thumb' => $thumb, + 'smallThumb' => $smallThumb + ); + } + return $return; + } + + protected function getTree($dir, $index=0) { $path = explode("/", $dir); $pdir = ""; - for ($i = 0; ($i <= $index && $i < count($path)); $i++) { + for ($i = 0; ($i <= $index && $i < count($path)); $i++) $pdir .= "/{$path[$i]}"; - } - if (strlen($pdir)) { + if (strlen($pdir)) $pdir = substr($pdir, 1); - } $fdir = "{$this->config['uploadDir']}/$pdir"; $dirs = $this->getDirs($fdir); if (is_array($dirs) && count($dirs) && ($index <= count($path) - 1)) { + foreach ($dirs as $i => $cdir) { if ($cdir['hasDirs'] && ( @@ -920,48 +787,38 @@ protected function getTree($dir, $index=0) } } } - } else { + } else return false; - } return $dirs; } - protected function postDir($existent=true) - { + protected function postDir($existent=true) { $dir = $this->typeDir; - if (isset($this->post['dir'])) { + if (isset($this->post['dir'])) $dir .= "/" . $this->post['dir']; - } - if ($existent && (!is_dir($dir) || !is_readable($dir))) { + if ($existent && (!is_dir($dir) || !is_readable($dir))) $this->errorMsg("Inexistant or inaccessible folder."); - } return $dir; } - protected function getDir($existent=true) - { + protected function getDir($existent=true) { $dir = $this->typeDir; - if (isset($this->get['dir'])) { + if (isset($this->get['dir'])) $dir .= "/" . $this->get['dir']; - } - if ($existent && (!is_dir($dir) || !is_readable($dir))) { + if ($existent && (!is_dir($dir) || !is_readable($dir))) $this->errorMsg("Inexistant or inaccessible folder."); - } return $dir; } - protected function getDirs($dir) - { + protected function getDirs($dir) { $dirs = dir::content($dir, array('types' => "dir")); $return = array(); if (is_array($dirs)) { $writable = dir::isWritable($dir); foreach ($dirs as $cdir) { $info = $this->getDirInfo($cdir); - if ($info === false) { - continue; - } + if ($info === false) continue; $info['removable'] = $writable && $info['writable']; $return[] = $info; } @@ -969,22 +826,17 @@ protected function getDirs($dir) return $return; } - protected function getDirInfo($dir, $removable=false) - { - if ((substr(basename($dir), 0, 1) == ".") || !is_dir($dir) || !is_readable($dir)) { + protected function getDirInfo($dir, $removable=false) { + if ((substr(basename($dir), 0, 1) == ".") || !is_dir($dir) || !is_readable($dir)) return false; - } $dirs = dir::content($dir, array('types' => "dir")); if (is_array($dirs)) { - foreach ($dirs as $key => $cdir) { - if (substr(basename($cdir), 0, 1) == ".") { + foreach ($dirs as $key => $cdir) + if (substr(basename($cdir), 0, 1) == ".") unset($dirs[$key]); - } - } $hasDirs = count($dirs) ? true : false; - } else { + } else $hasDirs = false; - } $writable = dir::isWritable($dir); $info = array( @@ -995,31 +847,24 @@ protected function getDirInfo($dir, $removable=false) 'hasDirs' => $hasDirs ); - if ($dir == "{$this->config['uploadDir']}/{$this->session['dir']}") { + if ($dir == "{$this->config['uploadDir']}/{$this->session['dir']}") $info['current'] = true; - } return $info; } - protected function output($data=null, $template=null) - { - if (!is_array($data)) { - $data = array(); - } - if ($template === null) { + protected function output($data=null, $template=null) { + if (!is_array($data)) $data = array(); + if ($template === null) $template = $this->action; - } if (file_exists("tpl/tpl_$template.php")) { ob_start(); $eval = "unset(\$data);unset(\$template);unset(\$eval);"; $_ = $data; - foreach (array_keys($data) as $key) { - if (preg_match('/^[a-z\d_]+$/i', $key)) { + foreach (array_keys($data) as $key) + if (preg_match('/^[a-z\d_]+$/i', $key)) $eval .= "\$$key=\$_['$key'];"; - } - } $eval .= "unset(\$_);require \"tpl/tpl_$template.php\";"; eval($eval); return ob_get_clean(); @@ -1028,14 +873,12 @@ protected function output($data=null, $template=null) return ""; } - protected function errorMsg($message, array $data=null) - { - if (in_array($this->action, array("thumb", "upload", "download", "downloadDir"))) { + protected function errorMsg($message, array $data=null) { + if (in_array($this->action, array("thumb", "upload", "download", "downloadDir"))) die($this->label($message, $data)); - } - if (($this->action === null) || ($this->action == "browser")) { + if (($this->action === null) || ($this->action == "browser")) $this->backMsg($message, $data); - } else { + else { $message = $this->label($message, $data); die(json_encode(array('error' => $message))); } diff --git a/manager/media/browser/mcpuk/core/types/type_img.php b/manager/media/browser/mcpuk/core/types/type_img.php index 15a7feda94..158e81b21a 100755 --- a/manager/media/browser/mcpuk/core/types/type_img.php +++ b/manager/media/browser/mcpuk/core/types/type_img.php @@ -12,18 +12,17 @@ * @link http://kcfinder.sunhater.com */ -class type_img -{ - public function checkFile($file, array $config) - { +class type_img { + + public function checkFile($file, array $config) { + $driver = isset($config['imageDriversPriority']) ? image::getDriver(explode(" ", $config['imageDriversPriority'])) : "gd"; $img = image::factory($driver, $file); - if ($img->initError) { + if ($img->initError) return "Unknown image format/encoding."; - } return true; } diff --git a/manager/media/browser/mcpuk/core/types/type_mime.php b/manager/media/browser/mcpuk/core/types/type_mime.php index b11f826ded..ec4a2eaa5c 100755 --- a/manager/media/browser/mcpuk/core/types/type_mime.php +++ b/manager/media/browser/mcpuk/core/types/type_mime.php @@ -12,24 +12,20 @@ * @link http://kcfinder.sunhater.com */ -class type_mime -{ - public function checkFile($file, array $config) - { - if (!class_exists("finfo")) { +class type_mime { + + public function checkFile($file, array $config) { + if (!class_exists("finfo")) return "Fileinfo PECL extension is missing."; - } - if (!isset($config['params'])) { + if (!isset($config['params'])) return "Undefined MIME types."; - } $finfo = strlen($config['mime_magic']) ? new finfo(FILEINFO_MIME, $config['mime_magic']) : new finfo(FILEINFO_MIME); - if (!$finfo) { + if (!$finfo) return "Opening fileinfo database failed."; - } $type = $finfo->file($file); $type = substr($type, 0, strrpos($type, ";")); @@ -37,12 +33,12 @@ public function checkFile($file, array $config) $mimes = $config['params']; if (substr($mimes, 0, 1) == "!") { $mimes = trim(substr($mimes, 1)); - return in_array($type, explode(" ", $mimes)) + return in_array($type , explode(" ", $mimes)) ? "You can't upload such files." : true; } - return !in_array($type, explode(" ", $mimes)) + return !in_array($type , explode(" ", $mimes)) ? "You can't upload such files." : true; } diff --git a/manager/media/browser/mcpuk/core/uploader.php b/manager/media/browser/mcpuk/core/uploader.php index 6e13c7b3e6..5db404e622 100755 --- a/manager/media/browser/mcpuk/core/uploader.php +++ b/manager/media/browser/mcpuk/core/uploader.php @@ -12,114 +12,109 @@ * @link http://kcfinder.sunhater.com */ -class uploader -{ +class uploader { /** Release version */ const VERSION = "2.54"; - /** Config session-overrided settings - * @var array */ +/** Config session-overrided settings + * @var array */ protected $config = array(); - /** Default image driver - * @var string */ +/** Default image driver + * @var string */ protected $imageDriver = "gd"; - /** Opener applocation properties - * $opener['name'] Got from $_GET['opener']; - * $opener['CKEditor']['funcNum'] CKEditor function number (got from $_GET) - * $opener['TinyMCE'] Boolean - * @var array */ +/** Opener applocation properties + * $opener['name'] Got from $_GET['opener']; + * $opener['CKEditor']['funcNum'] CKEditor function number (got from $_GET) + * $opener['TinyMCE'] Boolean + * @var array */ protected $opener = array(); - /** Got from $_GET['type'] or first one $config['types'] array key, if inexistant - * @var string */ +/** Got from $_GET['type'] or first one $config['types'] array key, if inexistant + * @var string */ protected $type; - /** Helper property. Local filesystem path to the Type Directory - * Equivalent: $config['uploadDir'] . "/" . $type - * @var string */ +/** Helper property. Local filesystem path to the Type Directory + * Equivalent: $config['uploadDir'] . "/" . $type + * @var string */ protected $typeDir; - /** Helper property. Web URL to the Type Directory - * Equivalent: $config['uploadURL'] . "/" . $type - * @var string */ +/** Helper property. Web URL to the Type Directory + * Equivalent: $config['uploadURL'] . "/" . $type + * @var string */ protected $typeURL; - /** Linked to $config['types'] - * @var array */ +/** Linked to $config['types'] + * @var array */ protected $types = array(); - /** Settings which can override default settings if exists as keys in $config['types'][$type] array - * @var array */ +/** Settings which can override default settings if exists as keys in $config['types'][$type] array + * @var array */ protected $typeSettings = array('disabled', 'theme', 'dirPerms', 'filePerms', 'denyZipDownload', 'maxImageWidth', 'maxImageHeight', 'thumbWidth', 'thumbHeight', 'jpegQuality', 'access', 'filenameChangeChars', 'dirnameChangeChars', 'denyExtensionRename', 'deniedExts', 'watermark'); - /** Got from language file - * @var string */ +/** Got from language file + * @var string */ protected $charset; - /** The language got from $_GET['lng'] or $_GET['lang'] or... Please see next property - * @var string */ +/** The language got from $_GET['lng'] or $_GET['lang'] or... Please see next property + * @var string */ protected $lang = 'en'; - /** Possible language $_GET keys - * @var array */ +/** Possible language $_GET keys + * @var array */ protected $langInputNames = array('lang', 'langCode', 'lng', 'language', 'lang_code'); - /** Uploaded file(s) info. Linked to first $_FILES element - * @var array */ +/** Uploaded file(s) info. Linked to first $_FILES element + * @var array */ protected $file; - /** Next three properties are got from the current language file - * @var string */ +/** Next three properties are got from the current language file + * @var string */ protected $dateTimeFull; // Currently not used protected $dateTimeMid; // Currently not used protected $dateTimeSmall; - /** Contain Specified language labels - * @var array */ +/** Contain Specified language labels + * @var array */ protected $labels = array(); - /** Contain unprocessed $_GET array. Please use this instead of $_GET - * @var array */ +/** Contain unprocessed $_GET array. Please use this instead of $_GET + * @var array */ protected $get; - /** Contain unprocessed $_POST array. Please use this instead of $_POST - * @var array */ +/** Contain unprocessed $_POST array. Please use this instead of $_POST + * @var array */ protected $post; - /** Contain unprocessed $_COOKIE array. Please use this instead of $_COOKIE - * @var array */ +/** Contain unprocessed $_COOKIE array. Please use this instead of $_COOKIE + * @var array */ protected $cookie; - /** Session array. Please use this property instead of $_SESSION - * @var array */ +/** Session array. Please use this property instead of $_SESSION + * @var array */ protected $session; - /** CMS integration attribute (got from $_GET['cms']) - * @var string */ +/** CMS integration attribute (got from $_GET['cms']) + * @var string */ protected $cms = ""; protected $modx = null; - /** Magic method which allows read-only access to protected or private class properties - * @param string $property - * @return mixed */ - public function __get($property) - { +/** Magic method which allows read-only access to protected or private class properties + * @param string $property + * @return mixed */ + public function __get($property) { return property_exists($this, $property) ? $this->$property : null; } - public function __construct($modx) - { + public function __construct($modx) { //MODX try { if ($modx instanceof DocumentParser) { $this->modx = $modx; - } else { - throw new Exception('MODX should be instance of DocumentParser'); - } + } else throw new Exception('MODX should be instance of DocumentParser'); } catch (Exception $e) { die($e->getMessage()); } @@ -134,33 +129,26 @@ public function __construct($modx) // SET CMS INTEGRATION ATTRIBUTE if (isset($this->get['cms']) && in_array($this->get['cms'], array("drupal")) - ) { + ) $this->cms = $this->get['cms']; - } - // LINKING UPLOADED FILE - if (count($_FILES)) { + // LINKING UPLOADED FILE + if (count($_FILES)) $this->file = &$_FILES[key($_FILES)]; - } // LOAD DEFAULT CONFIGURATION require "config.php"; // SETTING UP SESSION - if (isset($_CONFIG['_sessionLifetime'])) { + if (isset($_CONFIG['_sessionLifetime'])) ini_set('session.gc_maxlifetime', $_CONFIG['_sessionLifetime'] * 60); - } - if (isset($_CONFIG['_sessionDir'])) { + if (isset($_CONFIG['_sessionDir'])) ini_set('session.save_path', $_CONFIG['_sessionDir']); - } - if (isset($_CONFIG['_sessionDomain'])) { + if (isset($_CONFIG['_sessionDomain'])) ini_set('session.cookie_domain', $_CONFIG['_sessionDomain']); - } switch ($this->cms) { case "drupal": break; - default: if (!session_id()) { - session_start(); - } break; + default: if (!session_id()) session_start(); break; } // RELOAD DEFAULT CONFIGURATION @@ -171,38 +159,31 @@ public function __construct($modx) if (isset($_CONFIG['_sessionVar']) && is_array($_CONFIG['_sessionVar']) ) { - foreach ($_CONFIG['_sessionVar'] as $key => $val) { - if ((substr($key, 0, 1) != "_") && isset($_CONFIG[$key])) { + foreach ($_CONFIG['_sessionVar'] as $key => $val) + if ((substr($key, 0, 1) != "_") && isset($_CONFIG[$key])) $this->config[$key] = $val; - } - } - if (!isset($this->config['_sessionVar']['self'])) { + if (!isset($this->config['_sessionVar']['self'])) $this->config['_sessionVar']['self'] = array(); - } $this->session = &$this->config['_sessionVar']['self']; - } else { + } else $this->session = &$_SESSION; - } // IMAGE DRIVER INIT if (isset($this->config['imageDriversPriority'])) { $this->config['imageDriversPriority'] = text::clearWhitespaces($this->config['imageDriversPriority']); $driver = image::getDriver(explode(' ', $this->config['imageDriversPriority'])); - if ($driver !== false) { + if ($driver !== false) $this->imageDriver = $driver; - } } if ((!isset($driver) || ($driver === false)) && (image::getDriver(array($this->imageDriver)) === false) - ) { + ) die("Cannot find any of the supported PHP image extensions!"); - } // WATERMARK INIT - if (isset($this->config['watermark']) && is_string($this->config['watermark'])) { + if (isset($this->config['watermark']) && is_string($this->config['watermark'])) $this->config['watermark'] = array('file' => $this->config['watermark']); - } // GET TYPE DIRECTORY $this->types = &$this->config['types']; @@ -216,11 +197,9 @@ public function __construct($modx) // LOAD TYPE DIRECTORY SPECIFIC CONFIGURATION IF EXISTS if (is_array($this->types[$this->type])) { - foreach ($this->types[$this->type] as $key => $val) { - if (in_array($key, $this->typeSettings)) { + foreach ($this->types[$this->type] as $key => $val) + if (in_array($key, $this->typeSettings)) $this->config[$key] = $val; - } - } $this->types[$this->type] = isset($this->types[$this->type]['type']) ? $this->types[$this->type]['type'] : ""; } @@ -230,14 +209,12 @@ public function __construct($modx) $ip = '/^' . implode('\.', array($ip, $ip, $ip, $ip)) . '$/'; if (preg_match($ip, $_SERVER['HTTP_HOST']) || preg_match('/^[^\.]+$/', $_SERVER['HTTP_HOST']) - ) { + ) $this->config['cookieDomain'] = ""; - } elseif (!strlen($this->config['cookieDomain'])) { + elseif (!strlen($this->config['cookieDomain'])) $this->config['cookieDomain'] = $_SERVER['HTTP_HOST']; - } - if (!strlen($this->config['cookiePath'])) { + if (!strlen($this->config['cookiePath'])) $this->config['cookiePath'] = "/"; - } // UPLOAD FOLDER INIT @@ -251,8 +228,8 @@ public function __construct($modx) $this->config['uploadDir'] = strlen($this->config['uploadDir']) ? path::normalize($this->config['uploadDir']) : path::url2fullPath("/$path"); - $this->typeDir = "{$this->config['uploadDir']}/{$this->type}"; - $this->typeURL = "{$this->config['siteURL']}/{$this->config['uploadURL']}/{$this->type}"; + $this->typeDir = "{$this->config['uploadDir']}/{$this->type}"; + $this->typeURL = "{$this->config['siteURL']}/{$this->config['uploadURL']}/{$this->type}"; // SITE ROOT } elseif ($this->config['uploadURL'] == "/") { @@ -273,24 +250,21 @@ public function __construct($modx) $this->typeDir = "{$this->config['uploadDir']}/{$this->type}"; $this->typeURL = "{$this->config['uploadURL']}/{$this->type}"; } - if (!is_dir($this->config['uploadDir'])) { + if (!is_dir($this->config['uploadDir'])) @mkdir($this->config['uploadDir'], $this->config['dirPerms']); - } // HOST APPLICATIONS INIT - if (isset($this->get['CKEditorFuncNum'])) { + if (isset($this->get['CKEditorFuncNum'])) $this->opener['CKEditor']['funcNum'] = $this->get['CKEditorFuncNum']; - } if (isset($this->get['opener']) && (strtolower($this->get['opener']) == "tinymce") && isset($this->config['_tinyMCEPath']) && strlen($this->config['_tinyMCEPath']) - ) { + ) $this->opener['TinyMCE'] = true; - } // LOCALIZATION - foreach ($this->langInputNames as $key) { + foreach ($this->langInputNames as $key) if (isset($this->get[$key]) && preg_match('/^[a-z][a-z\._\-]*$/i', $this->get[$key]) && file_exists("lang/" . strtolower($this->get[$key]) . ".php") @@ -298,7 +272,6 @@ public function __construct($modx) $this->lang = $this->get[$key]; break; } - } $this->localize($this->lang); // CHECK & MAKE DEFAULT .htaccess @@ -307,40 +280,33 @@ public function __construct($modx) ) { $htaccess = "{$this->config['uploadDir']}/.htaccess"; if (!file_exists($htaccess)) { - if (!@file_put_contents($htaccess, $this->get_htaccess())) { + if (!@file_put_contents($htaccess, $this->get_htaccess())) $this->backMsg("Cannot write to upload folder. {$this->config['uploadDir']}"); - } } else { - if (false === ($data = @file_get_contents($htaccess))) { + if (false === ($data = @file_get_contents($htaccess))) $this->backMsg("Cannot read .htaccess"); - } - if (($data != $this->get_htaccess()) && !@file_put_contents($htaccess, $data)) { + if (($data != $this->get_htaccess()) && !@file_put_contents($htaccess, $data)) $this->backMsg("Incorrect .htaccess file. Cannot rewrite it!"); - } } } // CHECK & CREATE UPLOAD FOLDER if (!is_dir($this->typeDir)) { - if (!mkdir($this->typeDir, $this->config['dirPerms'])) { + if (!mkdir($this->typeDir, $this->config['dirPerms'])) $this->backMsg("Cannot create {dir} folder.", array('dir' => $this->type)); - } - } elseif (!is_readable($this->typeDir)) { + } elseif (!is_readable($this->typeDir)) $this->backMsg("Cannot read upload folder."); - } } - public function upload() - { + public function upload() { $config = &$this->config; $file = &$this->file; $url = $message = ""; if ($config['disabled'] || !$config['access']['files']['upload']) { - if (isset($file['tmp_name'])) { - @unlink($file['tmp_name']); - } + if (isset($file['tmp_name'])) @unlink($file['tmp_name']); $message = $this->label("You don't have permissions to upload files."); + } elseif (true === ($message = $this->checkUploadedFile())) { $message = ""; @@ -349,9 +315,9 @@ public function upload() (false !== ($gdir = $this->checkInputDir($this->get['dir']))) ) { $udir = path::normalize("$dir$gdir"); - if (substr($udir, 0, strlen($dir)) !== $dir) { + if (substr($udir, 0, strlen($dir)) !== $dir) $message = $this->label("Unknown error."); - } else { + else { $l = strlen($dir); $dir = "$udir/"; $udir = substr($udir, $l); @@ -359,9 +325,8 @@ public function upload() } if (!strlen($message)) { - if (!is_dir(path::normalize($dir))) { + if (!is_dir(path::normalize($dir))) @mkdir(path::normalize($dir), $this->config['dirPerms'], true); - } $filename = $this->normalizeFilename($file['name']); $target = file::getInexistantFilename($dir . $filename); @@ -369,25 +334,21 @@ public function upload() if (!@move_uploaded_file($file['tmp_name'], $target) && !@rename($file['tmp_name'], $target) && !@copy($file['tmp_name'], $target) - ) { + ) $message = $this->label("Cannot move uploaded file to target folder."); - } else { - if (function_exists('chmod')) { + else { + if (function_exists('chmod')) @chmod($target, $this->config['filePerms']); - } $this->makeThumb($target); $url = $this->typeURL; - if (isset($udir)) { - $url .= "/$udir"; - } + if (isset($udir)) $url .= "/$udir"; $url .= "/" . basename($target); if (preg_match('/^([a-z]+)\:\/\/([^\/^\:]+)(\:(\d+))?\/(.+)$/', $url, $patt)) { list($unused, $protocol, $domain, $unused, $port, $path) = $patt; $base = "$protocol://$domain" . (strlen($port) ? ":$port" : "") . "/"; $url = $base . path::urlPathEncode($path); - } else { + } else $url = path::urlPathEncode($url); - } } } } @@ -395,61 +356,54 @@ public function upload() if (strlen($message) && isset($this->file['tmp_name']) && file_exists($this->file['tmp_name']) - ) { + ) @unlink($this->file['tmp_name']); - } - if (strlen($message) && method_exists($this, 'errorMsg')) { + if (strlen($message) && method_exists($this, 'errorMsg')) $this->errorMsg($message); - } $this->callBack($url, $message); } - protected function getTransaliasSettings() - { - $modx = evolutionCMS(); - - // Cleaning uploaded filename? - $setting = $modx->db->select('count(*)', $modx->getFullTableName('system_settings'), 'setting_name="clean_uploaded_filename" AND setting_value=1'); - if ($modx->db->getValue($setting)>0) { - // Transalias plugin active? - $res = $modx->db->select('properties', $modx->getFullTableName('site_plugins'), 'name="TransAlias" AND disabled=0'); - if ($properties = $modx->db->getValue($res)) { - $properties = $modx->parseProperties($properties, 'TransAlias', 'plugin'); - } else { - $properties = null; - } - } else { - $properties = null; - } - return $properties; - } - - - protected function normalizeFilename($filename) - { - if ($this->getTransaliasSettings()) { - $format = strrchr($filename, "."); - $filename = str_replace($format, "", $filename); - $filename = $this->modx->stripAlias($filename) . $format; - } - return $filename; - } - - protected function normalizeDirname($dirname) - { + protected function getTransaliasSettings() { + $modx = evolutionCMS(); + + // Cleaning uploaded filename? + $setting = $modx->db->select('count(*)', $modx->getFullTableName('system_settings'), 'setting_name="clean_uploaded_filename" AND setting_value=1'); + if ($modx->db->getValue($setting)>0) { + // Transalias plugin active? + $res = $modx->db->select('properties', $modx->getFullTableName('site_plugins'), 'name="TransAlias" AND disabled=0'); + if ($properties = $modx->db->getValue($res)) { + $properties = $modx->parseProperties($properties, 'TransAlias', 'plugin'); + } else { + $properties = NULL; + } + } else { + $properties = NULL; + } + return $properties; + } + + + protected function normalizeFilename($filename) { + if ($this->getTransaliasSettings()) { + $format = strrchr($filename, "."); + $filename = str_replace($format, "", $filename); + $filename = $this->modx->stripAlias($filename).$format; + } + return $filename; + } + + protected function normalizeDirname($dirname) { return $this->modx->stripAlias($dirname); } - protected function checkUploadedFile(array $aFile=null) - { + protected function checkUploadedFile(array $aFile=null) { $config = &$this->config; $file = ($aFile === null) ? $this->file : $aFile; - if (!is_array($file) || !isset($file['name'])) { + if (!is_array($file) || !isset($file['name'])) return $this->label("Unknown error"); - } if (is_array($file['name'])) { foreach ($file['name'] as $i => $name) { @@ -458,9 +412,8 @@ protected function checkUploadedFile(array $aFile=null) 'tmp_name' => $file['tmp_name'][$i], 'error' => $file['error'][$i] )); - if ($return !== true) { + if ($return !== true) return "$name: $return"; - } } return true; } @@ -469,7 +422,7 @@ protected function checkUploadedFile(array $aFile=null) $typePatt = strtolower(text::clearWhitespaces($this->types[$this->type])); // CHECK FOR UPLOAD ERRORS - if ($file['error']) { + if ($file['error']) return ($file['error'] == UPLOAD_ERR_INI_SIZE) ? $this->label("The uploaded file exceeds {size} bytes.", @@ -487,17 +440,14 @@ protected function checkUploadedFile(array $aFile=null) $this->label("Failed to write file.") : $this->label("Unknown error.") ))))); - } // HIDDEN FILENAMES CHECK - elseif (substr($file['name'], 0, 1) == ".") { + elseif (substr($file['name'], 0, 1) == ".") return $this->label("File name shouldn't begins with '.'"); - } // EXTENSION CHECK - elseif (!$this->validateExtension($extension, $this->type)) { + elseif (!$this->validateExtension($extension, $this->type)) return $this->label("Denied file extension."); - } // SPECIAL DIRECTORY TYPES CHECK (e.g. *img) elseif (preg_match('/^\*([^ ]+)(.*)?$/s', $typePatt, $patt)) { @@ -507,84 +457,70 @@ protected function checkUploadedFile(array $aFile=null) $type = new $class(); $cfg = $config; $cfg['filename'] = $file['name']; - if (strlen($params)) { + if (strlen($params)) $cfg['params'] = trim($params); - } $response = $type->checkFile($file['tmp_name'], $cfg); - if ($response !== true) { + if ($response !== true) return $this->label($response); - } - } else { + } else return $this->label("Non-existing directory type."); - } } // IMAGE RESIZE $img = image::factory($this->imageDriver, $file['tmp_name']); - if (!$img->initError && !$this->imageResize($img, $file['tmp_name'])) { + if (!$img->initError && !$this->imageResize($img, $file['tmp_name'])) return $this->label("The image is too big and/or cannot be resized."); - } - // CHECK FOR MODX MAX FILE SIZE - $actualfilesize=filesize($file['tmp_name']); - if (isset($this->config['maxfilesize']) && $actualfilesize > $this->config['maxfilesize']) { - return $this->label("File is too big: " . $actualfilesize . " Bytes. (max " . $this->config['maxfilesize'] . " Bytes)"); - } + // CHECK FOR MODX MAX FILE SIZE + $actualfilesize=filesize($file['tmp_name']); + if (isset($this->config['maxfilesize']) && $actualfilesize > $this->config['maxfilesize']) + return $this->label("File is too big: ".$actualfilesize." Bytes. (max ".$this->config['maxfilesize']." Bytes)"); return true; } - protected function checkInputDir($dir, $inclType=true, $existing=true) - { + protected function checkInputDir($dir, $inclType=true, $existing=true) { $dir = path::normalize($dir); - if (substr($dir, 0, 1) == "/") { + if (substr($dir, 0, 1) == "/") $dir = substr($dir, 1); - } - if ((substr($dir, 0, 1) == ".") || (substr(basename($dir), 0, 1) == ".")) { + if ((substr($dir, 0, 1) == ".") || (substr(basename($dir), 0, 1) == ".")) return false; - } if ($inclType) { $first = explode("/", $dir); $first = $first[0]; - if ($first != $this->type) { + if ($first != $this->type) return false; - } $return = $this->removeTypeFromPath($dir); } else { $return = $dir; $dir = "{$this->type}/$dir"; } - if (!$existing) { + if (!$existing) return $return; - } $path = "{$this->config['uploadDir']}/$dir"; return (is_dir($path) && is_readable($path)) ? $return : false; } - protected function validateExtension($ext, $type) - { + protected function validateExtension($ext, $type) { $ext = trim(strtolower($ext)); - if (!isset($this->types[$type])) { + if (!isset($this->types[$type])) return false; - } $exts = strtolower(text::clearWhitespaces($this->config['deniedExts'])); if (strlen($exts)) { $exts = explode(" ", $exts); - if (in_array($ext, $exts)) { + if (in_array($ext, $exts)) return false; - } } $exts = trim($this->types[$type]); - if (!strlen($exts) || substr($exts, 0, 1) == "*") { + if (!strlen($exts) || substr($exts, 0, 1) == "*") return true; - } if (substr($exts, 0, 1) == "!") { $exts = explode(" ", trim(strtolower(substr($exts, 1)))); @@ -595,31 +531,26 @@ protected function validateExtension($ext, $type) return in_array($ext, $exts); } - protected function getTypeFromPath($path) - { + protected function getTypeFromPath($path) { return preg_match('/^([^\/]*)\/.*$/', $path, $patt) ? $patt[1] : $path; } - protected function removeTypeFromPath($path) - { + protected function removeTypeFromPath($path) { return preg_match('/^[^\/]*\/(.*)$/', $path, $patt) ? $patt[1] : ""; } - protected function imageResize($image, $file=null) - { + protected function imageResize($image, $file=null) { + if (!($image instanceof image)) { $img = image::factory($this->imageDriver, $image); - if ($img->initError) { - return false; - } + if ($img->initError) return false; $file = $image; - } elseif ($file === null) { + } elseif ($file === null) return false; - } else { + else $img = $image; - } $orientation = 1; if (function_exists("exif_read_data")) { @@ -641,18 +572,19 @@ protected function imageResize($image, $file=null) ) ) && ($orientation == 1) - ) { + ) return true; - } // PROPORTIONAL RESIZE if ((!$this->config['maxImageWidth'] || !$this->config['maxImageHeight'])) { + if ($this->config['maxImageWidth'] && ($this->config['maxImageWidth'] < $img->width) ) { $width = $this->config['maxImageWidth']; $height = $img->getPropHeight($width); + } elseif ( $this->config['maxImageHeight'] && ($this->config['maxImageHeight'] < $img->height) @@ -661,17 +593,15 @@ protected function imageResize($image, $file=null) $width = $img->getPropWidth($height); } - if (isset($width) && isset($height) && !$img->resize($width, $height)) { + if (isset($width) && isset($height) && !$img->resize($width, $height)) return false; - } - // RESIZE TO FIT + // RESIZE TO FIT } elseif ( $this->config['maxImageWidth'] && $this->config['maxImageHeight'] && !$img->resizeFit($this->config['maxImageWidth'], $this->config['maxImageHeight']) - ) { + ) return false; - } // AUTO FLIP AND ROTATE FROM EXIF if ((($orientation == 2) && !$img->flipHorizontal()) || @@ -681,15 +611,12 @@ protected function imageResize($image, $file=null) (($orientation == 6) && !$img->rotate(90)) || (($orientation == 7) && (!$img->flipHorizontal() || !$img->rotate(90))) || (($orientation == 8) && !$img->rotate(270)) - ) { + ) return false; - } - if (($orientation >= 2) && ($orientation <= 8) && ($this->imageDriver == "imagick")) { + if (($orientation >= 2) && ($orientation <= 8) && ($this->imageDriver == "imagick")) try { $img->image->setImageProperty('exif:Orientation', "1"); - } catch (Exception $e) { - } - } + } catch (Exception $e) {} // WATERMARK if (isset($this->config['watermark']['file']) && @@ -700,44 +627,41 @@ protected function imageResize($image, $file=null) $top = isset($this->config['watermark']['top']) ? $this->config['watermark']['top'] : false; $img->watermark($this->config['watermark']['file'], $left, $top); - } + } $options = array( 'file' => $file ); - $type = exif_imagetype($file); + $type = exif_imagetype( $file ); - switch ($type) { + switch ( $type ) { case IMAGETYPE_GIF: - return $img->output('gif', $options); + return $img->output( 'gif', $options ); case IMAGETYPE_PNG: - return $img->output('png', $options); + return $img->output( 'png', $options ); default: - return $img->output('jpeg', array_merge($options, array( 'quality' => $this->config['jpegQuality'] ))); + return $img->output( 'jpeg', array_merge( $options, array( 'quality' => $this->config['jpegQuality'] ) ) ); } + } - protected function makeThumb($file, $overwrite=true) - { + protected function makeThumb($file, $overwrite=true) { $img = image::factory($this->imageDriver, $file); // Drop files which are not images - if ($img->initError) { + if ($img->initError) return true; - } $thumb = substr($file, strlen($this->config['uploadDir'])); $thumb = $this->config['uploadDir'] . "/" . $this->config['thumbsDir'] . "/" . $thumb; $thumb = path::normalize($thumb); $thumbDir = dirname($thumb); - if (!is_dir($thumbDir) && !@mkdir($thumbDir, $this->config['dirPerms'], true)) { + if (!is_dir($thumbDir) && !@mkdir($thumbDir, $this->config['dirPerms'], true)) return false; - } - if (!$overwrite && is_file($thumb)) { + if (!$overwrite && is_file($thumb)) return true; - } // Images with smaller resolutions than thumbnails /*if (($img->width <= $this->config['thumbWidth']) && @@ -750,19 +674,18 @@ protected function makeThumb($file, $overwrite=true) // Resize image } else */ - if (!$img->resizeFit($this->config['thumbWidth'], $this->config['thumbHeight'])) { + if (!$img->resizeFit($this->config['thumbWidth'], $this->config['thumbHeight'])) return false; - } - if ($this->imageDriver == 'gd') { - $width = imagesx($img->image); - $height = imagesy($img->image); - $back = image::factory($this->imageDriver, array( $width, $height )); - $tile = image::factory($this->imageDriver, __DIR__ . '/../themes/' . $this->config['theme'] . '/img/bg_transparent.png'); + if ( $this->imageDriver == 'gd' ) { + $width = imagesx( $img->image ); + $height = imagesy( $img->image ); + $back = image::factory( $this->imageDriver, array( $width, $height ) ); + $tile = image::factory( $this->imageDriver, __DIR__ . '/../themes/' . $this->config['theme'] . '/img/bg_transparent.png' ); - imagesettile($back->image, $tile->image); - imagefilledrectangle($back->image, 0, 0, $width, $height, IMG_COLOR_TILED); - imagecopy($back->image, $img->image, 0, 0, 0, 0, $width, $height); + imagesettile( $back->image, $tile->image ); + imagefilledrectangle( $back->image, 0, 0, $width, $height, IMG_COLOR_TILED ); + imagecopy( $back->image, $img->image, 0, 0, 0, 0, $width, $height ); $img = $back; } @@ -774,8 +697,7 @@ protected function makeThumb($file, $overwrite=true) )); } - protected function localize($langCode) - { + protected function localize($langCode) { require "lang/{$langCode}.php"; setlocale(LC_ALL, $lang['_locale']); $this->charset = $lang['_charset']; @@ -790,36 +712,30 @@ protected function localize($langCode) $this->labels = $lang; } - protected function label($string, array $data=null) - { + protected function label($string, array $data=null) { $return = isset($this->labels[$string]) ? $this->labels[$string] : $string; - if (is_array($data)) { - foreach ($data as $key => $val) { + if (is_array($data)) + foreach ($data as $key => $val) $return = str_replace("{{$key}}", $val, $return); - } - } return $return; } - protected function backMsg($message, array $data=null) - { + protected function backMsg($message, array $data=null) { $message = $this->label($message, $data); - if (isset($this->file['tmp_name']) && file_exists($this->file['tmp_name'])) { + if (isset($this->file['tmp_name']) && file_exists($this->file['tmp_name'])) @unlink($this->file['tmp_name']); - } $this->callBack("", $message); die; } - protected function callBack($url, $message="") - { + protected function callBack($url, $message="") { $message = text::jsValue($message); $CKfuncNum = isset($this->opener['CKEditor']['funcNum']) ? $this->opener['CKEditor']['funcNum'] : 0; - if (!$CKfuncNum) { - $CKfuncNum = 0; - } - header("Content-Type: text/html; charset={$this->charset}"); ?> + if (!$CKfuncNum) $CKfuncNum = 0; + header("Content-Type: text/html; charset={$this->charset}"); + +?> php_value engine off diff --git a/manager/media/browser/mcpuk/css.php b/manager/media/browser/mcpuk/css.php index 6e441b0eee..225f918e48 100755 --- a/manager/media/browser/mcpuk/css.php +++ b/manager/media/browser/mcpuk/css.php @@ -14,9 +14,7 @@ require "core/autoload.php"; $mtime = @filemtime(__FILE__); -if ($mtime) { - httpCache::checkMTime($mtime); -} +if ($mtime) httpCache::checkMTime($mtime); $browser = new browser($modx); $config = $browser->config; ob_start(); @@ -256,4 +254,4 @@ } $mtime)) { + if (!isset($mtime) || ($fmtime > $mtime)) $mtime = $fmtime; - } } httpCache::checkMTime($mtime); header("Content-Type: text/javascript"); -foreach ($files as $file) { +foreach ($files as $file) require $file; -} diff --git a/manager/media/browser/mcpuk/js_localize.php b/manager/media/browser/mcpuk/js_localize.php index 5aff27a157..1fb386cd96 100755 --- a/manager/media/browser/mcpuk/js_localize.php +++ b/manager/media/browser/mcpuk/js_localize.php @@ -28,13 +28,9 @@ die; } $mtime = @filemtime($file); -if ($mtime) { - httpCache::checkMTime($mtime); -} +if ($mtime) httpCache::checkMTime($mtime); require $file; header("Content-Type: text/javascript; charset={$lang['_charset']}"); -foreach ($lang as $english => $native) { - if (substr($english, 0, 1) != "_") { +foreach ($lang as $english => $native) + if (substr($english, 0, 1) != "_") echo "browser.labels['" . text::jsValue($english) . "']=\"" . text::jsValue($native) . "\";"; - } -} diff --git a/manager/media/browser/mcpuk/lang/af.php b/manager/media/browser/mcpuk/lang/af.php index a5e5823887..1eccc0add2 100755 --- a/manager/media/browser/mcpuk/lang/af.php +++ b/manager/media/browser/mcpuk/lang/af.php @@ -241,3 +241,5 @@ "Select Thumbnails" => "Kies duimnaels", "Download files" => "Laai lêers af", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/bg.php b/manager/media/browser/mcpuk/lang/bg.php index ba72a1d852..c1a3ee387d 100755 --- a/manager/media/browser/mcpuk/lang/bg.php +++ b/manager/media/browser/mcpuk/lang/bg.php @@ -258,3 +258,5 @@ "Failed to upload {filename}!" => "Несполучливо качване на {filename}!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/ca.php b/manager/media/browser/mcpuk/lang/ca.php index bdc414fc74..9e9c6c2f56 100755 --- a/manager/media/browser/mcpuk/lang/ca.php +++ b/manager/media/browser/mcpuk/lang/ca.php @@ -124,3 +124,5 @@ "Uploading file {number} of {count}... {progress}" => "Carregant arxiu {number} de {count}... {progress}", "Failed to upload {filename}!" => "Error al carregar {filename}", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/cs.php b/manager/media/browser/mcpuk/lang/cs.php index 5167dfe041..8cd858cbe6 100755 --- a/manager/media/browser/mcpuk/lang/cs.php +++ b/manager/media/browser/mcpuk/lang/cs.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "Nahrávám soubor {number} z {count}... {progress}", "Failed to upload {filename}!" => "Nepodařilo se nahrát soubor {filename}!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/da.php b/manager/media/browser/mcpuk/lang/da.php index 843bde90a3..c9ad9e5c9b 100755 --- a/manager/media/browser/mcpuk/lang/da.php +++ b/manager/media/browser/mcpuk/lang/da.php @@ -12,7 +12,7 @@ '_dateTimeMid' => "%a %e %b %Y %H:%M", '_dateTimeSmall' => "%d/%m/%Y %H:%M", - "You don't have permissions to upload files." => + "You don't have permissions to upload files." => "Du har ikke tilladelser til at uploade filer.", "You don't have permissions to browse server." => @@ -238,3 +238,5 @@ "Select Thumbnails" => "V�lg Miniaturer", "Download files" => "Download filer", ); + +?> diff --git a/manager/media/browser/mcpuk/lang/de.php b/manager/media/browser/mcpuk/lang/de.php index 2b6952e298..7318de10a2 100755 --- a/manager/media/browser/mcpuk/lang/de.php +++ b/manager/media/browser/mcpuk/lang/de.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "Lade Datei {number} von {count} hinauf ... {progress}", "Failed to upload {filename}!" => "Upload von {filename} fehlgeschlagen!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/el.php b/manager/media/browser/mcpuk/lang/el.php index 375b48a1f8..c8eb9ab6ae 100755 --- a/manager/media/browser/mcpuk/lang/el.php +++ b/manager/media/browser/mcpuk/lang/el.php @@ -249,3 +249,5 @@ "Yes" => "Ναι", "No" => "Όχι", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/en.php b/manager/media/browser/mcpuk/lang/en.php index e6c1dedfb2..ba12dcf369 100755 --- a/manager/media/browser/mcpuk/lang/en.php +++ b/manager/media/browser/mcpuk/lang/en.php @@ -21,3 +21,5 @@ '_dateTimeMid' => "%a %b %e %Y %I:%M %p", '_dateTimeSmall' => "%m/%d/%Y %I:%M %p", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/es.php b/manager/media/browser/mcpuk/lang/es.php index 311c4a6cf4..a86f22efc3 100755 --- a/manager/media/browser/mcpuk/lang/es.php +++ b/manager/media/browser/mcpuk/lang/es.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "Cargando archivo {number} de {count}... {progress}", "Failed to upload {filename}!" => "¡No se pudo cargar el archivo {filename}!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/et.php b/manager/media/browser/mcpuk/lang/et.php index 59e450c9f1..3553b16b7e 100755 --- a/manager/media/browser/mcpuk/lang/et.php +++ b/manager/media/browser/mcpuk/lang/et.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "Laen üles faili {number} {count}-st... {progress}", "Failed to upload {filename}!" => "{filename} üleslaadimine ebaõnnestus!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/fa.php b/manager/media/browser/mcpuk/lang/fa.php index 6b39dddad5..09481e590b 100755 --- a/manager/media/browser/mcpuk/lang/fa.php +++ b/manager/media/browser/mcpuk/lang/fa.php @@ -263,3 +263,5 @@ "Failed to upload {filename}!" => "! {filename} خطا در ارسال" ); + +?> diff --git a/manager/media/browser/mcpuk/lang/fi.php b/manager/media/browser/mcpuk/lang/fi.php index 48907be9b7..ab17048a50 100755 --- a/manager/media/browser/mcpuk/lang/fi.php +++ b/manager/media/browser/mcpuk/lang/fi.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "Siirretään tiedostoa {number}/{count} ... {progress}", "Failed to upload {filename}!" => "Siirto epäonnistui {filename}!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/fr.php b/manager/media/browser/mcpuk/lang/fr.php index 56104ad5f8..ac33d22d14 100755 --- a/manager/media/browser/mcpuk/lang/fr.php +++ b/manager/media/browser/mcpuk/lang/fr.php @@ -124,3 +124,5 @@ "Uploading file {number} of {count}... {progress}" => "Envoi du fichier {number} sur {count}... {progress}", "Failed to upload {filename}!" => "Échec du téléchargement du fichier {filename} !", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/he.php b/manager/media/browser/mcpuk/lang/he.php index 7f680ac5b8..56b31a23d0 100755 --- a/manager/media/browser/mcpuk/lang/he.php +++ b/manager/media/browser/mcpuk/lang/he.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "מעלה קובץ {number} מתוך {count}... {progress}", "Failed to upload {filename}!" => "העלאת הקובץ נכשלה!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/hu.php b/manager/media/browser/mcpuk/lang/hu.php index e90afe939b..3539f4a5b4 100755 --- a/manager/media/browser/mcpuk/lang/hu.php +++ b/manager/media/browser/mcpuk/lang/hu.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "A(z) {number}. fájl feltöltése (összesen {count}) ... {progress}", "Failed to upload {filename}!" => "Nem sikerült feltölteni a '{filename}' fájlt.", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/id.php b/manager/media/browser/mcpuk/lang/id.php index cc54698900..2eebd4726d 100755 --- a/manager/media/browser/mcpuk/lang/id.php +++ b/manager/media/browser/mcpuk/lang/id.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "Mengunggah file {nomor} of {jumlah}... {progress)", "Failed to upload {filename}!" => "Gagal untuk mengunggah {nama file}", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/it.php b/manager/media/browser/mcpuk/lang/it.php index bb7bd2090d..557e5b9d02 100755 --- a/manager/media/browser/mcpuk/lang/it.php +++ b/manager/media/browser/mcpuk/lang/it.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "Caricmento del file {number} di {count}... {progress}", "Failed to upload {filename}!" => "Il caricamento del file {filename} è fallito ", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/ja.php b/manager/media/browser/mcpuk/lang/ja.php index 4ec58a2f88..19b7d79535 100755 --- a/manager/media/browser/mcpuk/lang/ja.php +++ b/manager/media/browser/mcpuk/lang/ja.php @@ -128,3 +128,5 @@ "Uploading file {number} of {count}... {progress}" => "ファイルをアップロード中({number}/{count})... {progress}", "Failed to upload {filename}!" => "{filename}のアップロードに失敗しました!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/lt.php b/manager/media/browser/mcpuk/lang/lt.php index 0a2cad029d..22174d27a4 100755 --- a/manager/media/browser/mcpuk/lang/lt.php +++ b/manager/media/browser/mcpuk/lang/lt.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "Įkeliamas {number} failas iš {count}... {progress}", "Failed to upload {filename}!" => "Nepavyko įkelti {filename}!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/nl.php b/manager/media/browser/mcpuk/lang/nl.php index de72b571b8..37d2f0854d 100755 --- a/manager/media/browser/mcpuk/lang/nl.php +++ b/manager/media/browser/mcpuk/lang/nl.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "Bestand {number} van de {count} aan het uploaden... {progress}", "Failed to upload {filename}!" => "Uploaden van {filename} mislukt!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/no.php b/manager/media/browser/mcpuk/lang/no.php index ae785334d6..80aaf6a6ee 100755 --- a/manager/media/browser/mcpuk/lang/no.php +++ b/manager/media/browser/mcpuk/lang/no.php @@ -238,3 +238,5 @@ "Select Thumbnails" => "Velg miniatyrbilde", "Download files" => "Last ned filer", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/pl.php b/manager/media/browser/mcpuk/lang/pl.php index ed6b70a346..413b5f92c6 100755 --- a/manager/media/browser/mcpuk/lang/pl.php +++ b/manager/media/browser/mcpuk/lang/pl.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "Wysyłanie pliku nr {number} spośród {count} ... {progress}", "Failed to upload {filename}!" => "Wysyłanie pliku {filename} nie powiodło się!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/pt-br.php b/manager/media/browser/mcpuk/lang/pt-br.php index 4ba0636816..8d6095353e 100755 --- a/manager/media/browser/mcpuk/lang/pt-br.php +++ b/manager/media/browser/mcpuk/lang/pt-br.php @@ -126,3 +126,5 @@ "Uploading file {number} of {count}... {progress}" => "Enviando arquivo {number} de {count}... {progress}", "Failed to upload {filename}!" => "Falha no envio do arquivo {filename}!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/pt.php b/manager/media/browser/mcpuk/lang/pt.php index 6b35ea926d..dfcd2dd677 100755 --- a/manager/media/browser/mcpuk/lang/pt.php +++ b/manager/media/browser/mcpuk/lang/pt.php @@ -239,3 +239,5 @@ "Select Thumbnails" => "Seleccionar miniaturas", "Download files" => "Sacar ficheiros", ); + +?> diff --git a/manager/media/browser/mcpuk/lang/ro.php b/manager/media/browser/mcpuk/lang/ro.php index 248b01263c..ecbe6ac2a0 100755 --- a/manager/media/browser/mcpuk/lang/ro.php +++ b/manager/media/browser/mcpuk/lang/ro.php @@ -122,3 +122,5 @@ "Uploading file {number} of {count}... {progress}" => "Încărcare fișier {number} din {count}... {progress}", "Failed to upload {filename}!" => "Încărcare {filename} eșuată!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/ru.php b/manager/media/browser/mcpuk/lang/ru.php index 59e4683aaf..13c6a55865 100755 --- a/manager/media/browser/mcpuk/lang/ru.php +++ b/manager/media/browser/mcpuk/lang/ru.php @@ -124,3 +124,5 @@ "Uploading file {number} of {count}... {progress}" => "Загрузка {number} файла из {count}... {progress}", "Failed to upload {filename}!" => "Неудачная попытка загрузки {filename}!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/sk.php b/manager/media/browser/mcpuk/lang/sk.php index 85fa04103f..330fb7fc35 100755 --- a/manager/media/browser/mcpuk/lang/sk.php +++ b/manager/media/browser/mcpuk/lang/sk.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "Nahrávam súbor {number} z {count}... {progress}", "Failed to upload {filename}!" => "Nepodarilo sa nahrať súbor {filename}!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/sv.php b/manager/media/browser/mcpuk/lang/sv.php index 7d82f9e1d9..7a5f806a0d 100755 --- a/manager/media/browser/mcpuk/lang/sv.php +++ b/manager/media/browser/mcpuk/lang/sv.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "Ladda upp fil {number} av {count} ... {progress}", "Failed to upload {filename}!" => "Uppladdning misslyckad {filename}!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/tr.php b/manager/media/browser/mcpuk/lang/tr.php index e228013a14..b36345d6a7 100755 --- a/manager/media/browser/mcpuk/lang/tr.php +++ b/manager/media/browser/mcpuk/lang/tr.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "{number} / {count} dosya yükleniyor... {progress}", "Failed to upload {filename}!" => "{filename} dosyası yüklenemedi!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/uk.php b/manager/media/browser/mcpuk/lang/uk.php index ea0c0a8242..5caa120c6e 100755 --- a/manager/media/browser/mcpuk/lang/uk.php +++ b/manager/media/browser/mcpuk/lang/uk.php @@ -1,8 +1,8 @@ "Завантаження файлу {number} з {count}... {progress}", "Failed to upload {filename}!" => "Помилка завантаження {filename}!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/vi.php b/manager/media/browser/mcpuk/lang/vi.php index 30fa3e8b62..0119121cf5 100755 --- a/manager/media/browser/mcpuk/lang/vi.php +++ b/manager/media/browser/mcpuk/lang/vi.php @@ -123,3 +123,5 @@ "Uploading file {number} of {count}... {progress}" => "Đang tải tập tin thứ {number} của {count}... {progress}", "Failed to upload {filename}!" => "Tải lên thất bại {filename}!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lang/zh-cn.php b/manager/media/browser/mcpuk/lang/zh-cn.php index 9aa0dc0c85..ac68e2ea13 100755 --- a/manager/media/browser/mcpuk/lang/zh-cn.php +++ b/manager/media/browser/mcpuk/lang/zh-cn.php @@ -126,3 +126,5 @@ "Uploading file {number} of {count}... {progress}" => "正在上传文件{number} / {count}... {progress}", "Failed to upload {filename}!" => "上传失败{filename}!", ); + +?> \ No newline at end of file diff --git a/manager/media/browser/mcpuk/lib/class_fastImage.php b/manager/media/browser/mcpuk/lib/class_fastImage.php index 08cf2af557..ec12ef40cc 100755 --- a/manager/media/browser/mcpuk/lib/class_fastImage.php +++ b/manager/media/browser/mcpuk/lib/class_fastImage.php @@ -13,217 +13,227 @@ class fastImage { - private $strpos = 0; - private $str; - private $uri; - private $type; - private $handle; - - public function __construct($uri = null) - { - if ($uri) { - $this->load($uri); - } - } + private $strpos = 0; + private $str; + private $uri; + private $type; + private $handle; + public function __construct($uri = null) + { + if ($uri) $this->load($uri); + } - public function load($uri) - { - if ($this->handle) { - $this->close(); - } - - $this->uri = $uri; - $this->handle = fopen($uri, 'r'); - } - - - public function close() - { - if (is_resource($this->handle)) { - fclose($this->handle); - } - } - - - public function getSize() - { - $this->strpos = 0; - if ($this->getType()) { - return array_values($this->parseSize()); - } - - return false; - } - - - public function getType() - { - $this->strpos = 0; - - if (!$this->type) { - switch ($this->getChars(2)) { - case "BM": - return $this->type = 'bmp'; - case "GI": - return $this->type = 'gif'; - case chr(0xFF) . chr(0xd8): - return $this->type = 'jpeg'; - case chr(0x89) . 'P': - return $this->type = 'png'; - default: - return false; - } - } - - return $this->type; - } - - - private function parseSize() - { - $this->strpos = 0; - - switch ($this->type) { - case 'png': - return $this->parseSizeForPNG(); - case 'gif': - return $this->parseSizeForGIF(); - case 'bmp': - return $this->parseSizeForBMP(); - case 'jpeg': - return $this->parseSizeForJPEG(); - } - - return null; - } - - - private function parseSizeForPNG() - { - $chars = $this->getChars(25); - - return unpack("N*", substr($chars, 16, 8)); - } - - - private function parseSizeForGIF() - { - $chars = $this->getChars(11); - - return unpack("S*", substr($chars, 6, 4)); - } - - - private function parseSizeForBMP() - { - $chars = $this->getChars(29); - $chars = substr($chars, 14, 14); - $type = unpack('C', $chars); - - return (reset($type) == 40) ? unpack('L*', substr($chars, 4)) : unpack('L*', substr($chars, 4, 8)); - } + public function load($uri) + { + if ($this->handle) $this->close(); + + $this->uri = $uri; + $this->handle = fopen($uri, 'r'); + } + + + public function close() + { + if (is_resource($this->handle)) fclose($this->handle); + } - private function parseSizeForJPEG() - { - $state = null; - - while (true) { - switch ($state) { - default: - $this->getChars(2); - $state = 'started'; - break; - case 'started': - $b = $this->getByte(); - if ($b === false) { - return false; - } - - $state = $b == 0xFF ? 'sof' : 'started'; - break; - - case 'sof': - $b = $this->getByte(); - if (in_array($b, range(0xe0, 0xef))) { - $state = 'skipframe'; - } elseif (in_array($b, array_merge(range(0xC0, 0xC3), range(0xC5, 0xC7), range(0xC9, 0xCB), range(0xCD, 0xCF)))) { - $state = 'readsize'; - } elseif ($b == 0xFF) { - $state = 'sof'; - } else { - $state = 'skipframe'; - } - break; - - case 'skipframe': - $skip = $this->readInt($this->getChars(2)) - 2; - $state = 'doskip'; - break; - - case 'doskip': - $this->getChars($skip); - $state = 'started'; - break; - - case 'readsize': - $c = $this->getChars(7); - - return array($this->readInt(substr($c, 5, 2)), $this->readInt(substr($c, 3, 2))); - } - } - } - - - private function getChars($n) - { - $response = null; - - // do we need more data? - if ($this->strpos + $n -1 >= strlen($this->str)) { - $end = ($this->strpos + $n); - - while (strlen($this->str) < $end && $response !== false) { - // read more from the file handle - $need = $end - ftell($this->handle); - - if ($response = fread($this->handle, $need)) { - $this->str .= $response; - } else { - return false; - } - } - } - - $result = substr($this->str, $this->strpos, $n); - $this->strpos += $n; - - // we are dealing with bytes here, so force the encoding - return mb_convert_encoding($result, "8BIT"); - } - - - private function getByte() - { - $c = $this->getChars(1); - $b = unpack("C", $c); - - return reset($b); - } - - - private function readInt($str) - { - $size = unpack("C*", $str); - - return ($size[1] << 8) + $size[2]; - } - - - public function __destruct() - { - $this->close(); - } + public function getSize() + { + $this->strpos = 0; + if ($this->getType()) + { + return array_values($this->parseSize()); + } + + return false; + } + + + public function getType() + { + $this->strpos = 0; + + if (!$this->type) + { + switch ($this->getChars(2)) + { + case "BM": + return $this->type = 'bmp'; + case "GI": + return $this->type = 'gif'; + case chr(0xFF).chr(0xd8): + return $this->type = 'jpeg'; + case chr(0x89).'P': + return $this->type = 'png'; + default: + return false; + } + } + + return $this->type; + } + + + private function parseSize() + { + $this->strpos = 0; + + switch ($this->type) + { + case 'png': + return $this->parseSizeForPNG(); + case 'gif': + return $this->parseSizeForGIF(); + case 'bmp': + return $this->parseSizeForBMP(); + case 'jpeg': + return $this->parseSizeForJPEG(); + } + + return null; + } + + + private function parseSizeForPNG() + { + $chars = $this->getChars(25); + + return unpack("N*", substr($chars, 16, 8)); + } + + + private function parseSizeForGIF() + { + $chars = $this->getChars(11); + + return unpack("S*", substr($chars, 6, 4)); + } + + + private function parseSizeForBMP() + { + $chars = $this->getChars(29); + $chars = substr($chars, 14, 14); + $type = unpack('C', $chars); + + return (reset($type) == 40) ? unpack('L*', substr($chars, 4)) : unpack('L*', substr($chars, 4, 8)); + } + + + private function parseSizeForJPEG() + { + $state = null; + + while (true) + { + switch ($state) + { + default: + $this->getChars(2); + $state = 'started'; + break; + + case 'started': + $b = $this->getByte(); + if ($b === false) return false; + + $state = $b == 0xFF ? 'sof' : 'started'; + break; + + case 'sof': + $b = $this->getByte(); + if (in_array($b, range(0xe0, 0xef))) + { + $state = 'skipframe'; + } + elseif (in_array($b, array_merge(range(0xC0,0xC3), range(0xC5,0xC7), range(0xC9,0xCB), range(0xCD,0xCF)))) + { + $state = 'readsize'; + } + elseif ($b == 0xFF) + { + $state = 'sof'; + } + else + { + $state = 'skipframe'; + } + break; + + case 'skipframe': + $skip = $this->readInt($this->getChars(2)) - 2; + $state = 'doskip'; + break; + + case 'doskip': + $this->getChars($skip); + $state = 'started'; + break; + + case 'readsize': + $c = $this->getChars(7); + + return array($this->readInt(substr($c, 5, 2)), $this->readInt(substr($c, 3, 2))); + } + } + } + + + private function getChars($n) + { + $response = null; + + // do we need more data? + if ($this->strpos + $n -1 >= strlen($this->str)) + { + $end = ($this->strpos + $n); + + while (strlen($this->str) < $end && $response !== false) + { + // read more from the file handle + $need = $end - ftell($this->handle); + + if ($response = fread($this->handle, $need)) + { + $this->str .= $response; + } + else + { + return false; + } + } + } + + $result = substr($this->str, $this->strpos, $n); + $this->strpos += $n; + + // we are dealing with bytes here, so force the encoding + return mb_convert_encoding($result, "8BIT"); + } + + + private function getByte() + { + $c = $this->getChars(1); + $b = unpack("C", $c); + + return reset($b); + } + + + private function readInt($str) + { + $size = unpack("C*", $str); + + return ($size[1] << 8) + $size[2]; + } + + + public function __destruct() + { + $this->close(); + } } diff --git a/manager/media/browser/mcpuk/lib/class_gd.php b/manager/media/browser/mcpuk/lib/class_gd.php index 0b7df86033..c9ed6f04af 100755 --- a/manager/media/browser/mcpuk/lib/class_gd.php +++ b/manager/media/browser/mcpuk/lib/class_gd.php @@ -12,48 +12,50 @@ * @link http://kcfinder.sunhater.com */ -class gd -{ +class gd { /** GD resource * @var resource */ protected $image; - /** Image width - * @var integer */ + /** Image width + * @var integer */ protected $width; - /** Image height - * @var integer */ + /** Image height + * @var integer */ protected $height; - /** Init error - * @var bool */ + /** Init error + * @var bool */ public $init_error = false; - /** Last builded image type constant (IMAGETYPE_XXX) - * @var integer */ + /** Last builded image type constant (IMAGETYPE_XXX) + * @var integer */ public $type; - /** Returns an array. Element 0 - GD resource. Element 1 - width. Element 2 - height. - * Returns FALSE on failure. The only one parameter $image can be an instance of this class, - * a GD resource, an array(width, height) or path to image file. - * @param mixed $image - * @return array */ + /** Returns an array. Element 0 - GD resource. Element 1 - width. Element 2 - height. + * Returns FALSE on failure. The only one parameter $image can be an instance of this class, + * a GD resource, an array(width, height) or path to image file. + * @param mixed $image + * @return array */ + + protected function build_image($image) { - protected function build_image($image) - { if ($image instanceof gd) { $width = $image->get_width(); $height = $image->get_height(); $image = $image->get_image(); + } elseif (is_resource($image) && (get_resource_type($image) == "gd")) { $width = @imagesx($image); $height = @imagesy($image); + } elseif (is_array($image)) { list($key, $width) = each($image); list($key, $height) = each($image); $image = imagecreatetruecolor($width, $height); + } elseif (false !== (list($width, $height, $type) = @getimagesize($image))) { $image = ($type == IMAGETYPE_GIF) ? @imagecreatefromgif($image) : ( @@ -64,9 +66,8 @@ protected function build_image($image) ($type == IMAGETYPE_XBM) ? @imagecreatefromxbm($image) : false ))))); - if ($type == IMAGETYPE_PNG) { + if ($type == IMAGETYPE_PNG) imagealphablending($image, false); - } } $return = ( @@ -80,35 +81,32 @@ protected function build_image($image) ? array($image, $width, $height) : false; - if (($return !== false) && isset($type)) { + if (($return !== false) && isset($type)) $this->type = $type; - } return $return; } - /** Parameter $image can be: - * 1. An instance of this class (copy instance). - * 2. A GD resource. - * 3. An array with two elements. First - width, second - height. Create a blank image. - * 4. A filename string. Get image form file. - * The non-required parameter $bigger_size is the bigger dimension (width or height) the image - * will be resized to. The other dimension (height or width) will be calculated autamaticaly - * @param mixed $image - * @param integer $bigger_size - * @return gd */ - - public function __construct($image, $bigger_size=null) - { + /** Parameter $image can be: + * 1. An instance of this class (copy instance). + * 2. A GD resource. + * 3. An array with two elements. First - width, second - height. Create a blank image. + * 4. A filename string. Get image form file. + * The non-required parameter $bigger_size is the bigger dimension (width or height) the image + * will be resized to. The other dimension (height or width) will be calculated autamaticaly + * @param mixed $image + * @param integer $bigger_size + * @return gd */ + + public function __construct($image, $bigger_size=null) { $this->image = $this->width = $this->height = null; $image_details = $this->build_image($image); - if ($image_details !== false) { + if ($image_details !== false) list($this->image, $this->width, $this->height) = $image_details; - } else { + else $this->init_error = true; - } if (!is_null($this->image) && !is_null($bigger_size) && @@ -117,98 +115,85 @@ public function __construct($image, $bigger_size=null) $image = $this->image; list($width, $height) = $this->get_prop_size($bigger_size); $this->image = imagecreatetruecolor($width, $height); - imagealphablending($this->image, false); - imagesavealpha($this->image, true); + imagealphablending($this->image, false); + imagesavealpha($this->image, true); $this->width = $width; $this->height = $height; $this->imagecopyresampled($image); } } - /** Returns the GD resource - * @return resource */ + /** Returns the GD resource + * @return resource */ - public function get_image() - { + public function get_image() { return $this->image; } - /** Returns the image width - * @return integer */ + /** Returns the image width + * @return integer */ - public function get_width() - { + public function get_width() { return $this->width; } - /** Returns the image height - * @return integer */ + /** Returns the image height + * @return integer */ - public function get_height() - { + public function get_height() { return $this->height; } - /** Returns calculated proportional width from the given height - * @param integer $resized_height - * @return integer */ + /** Returns calculated proportional width from the given height + * @param integer $resized_height + * @return integer */ - public function get_prop_width($resized_height) - { + public function get_prop_width($resized_height) { $width = intval(($this->width * $resized_height) / $this->height); - if (!$width) { - $width = 1; - } + if (!$width) $width = 1; return $width; } - /** Returns calculated proportional height from the given width - * @param integer $resized_width - * @return integer */ + /** Returns calculated proportional height from the given width + * @param integer $resized_width + * @return integer */ - public function get_prop_height($resized_width) - { + public function get_prop_height($resized_width) { $height = intval(($this->height * $resized_width) / $this->width); - if (!$height) { - $height = 1; - } + if (!$height) $height = 1; return $height; } - /** Returns an array with calculated proportional width & height. - * The parameter $bigger_size is the bigger dimension (width or height) of calculated sizes. - * The other dimension (height or width) will be calculated autamaticaly - * @param integer $bigger_size - * @return array */ + /** Returns an array with calculated proportional width & height. + * The parameter $bigger_size is the bigger dimension (width or height) of calculated sizes. + * The other dimension (height or width) will be calculated autamaticaly + * @param integer $bigger_size + * @return array */ + + public function get_prop_size($bigger_size) { - public function get_prop_size($bigger_size) - { if ($this->width > $this->height) { $width = $bigger_size; $height = $this->get_prop_height($width); + } elseif ($this->height > $this->width) { $height = $bigger_size; $width = $this->get_prop_width($height); - } else { + + } else $width = $height = $bigger_size; - } return array($width, $height); } - /** Resize image. Returns TRUE on success or FALSE on failure - * @param integer $width - * @param integer $height - * @return bool */ + /** Resize image. Returns TRUE on success or FALSE on failure + * @param integer $width + * @param integer $height + * @return bool */ - public function resize($width, $height) - { - if (!$width) { - $width = 1; - } - if (!$height) { - $height = 1; - } + public function resize($width, $height) { + if (!$width) $width = 1; + if (!$height) $height = 1; return ( (false !== ($img = new gd(array($width, $height)))) && $img->imagecopyresampled($this) && @@ -218,13 +203,12 @@ public function resize($width, $height) ); } - /** Resize the given image source (GD, gd object or image file path) to fit in the own image. - * The outside ares will be cropped out. Returns TRUE on success or FALSE on failure - * @param mixed $src - * @return bool */ + /** Resize the given image source (GD, gd object or image file path) to fit in the own image. + * The outside ares will be cropped out. Returns TRUE on success or FALSE on failure + * @param mixed $src + * @return bool */ - public function resize_crop($src) - { + public function resize_crop($src) { $image_details = $this->build_image($src); if ($image_details !== false) { @@ -235,6 +219,7 @@ public function resize_crop($src) $src_h = $src_height; $src_x = intval(($src_width - $src_w) / 2); $src_y = 0; + } else { $src_w = $src_width; $src_h = $this->get_prop_height($src_width); @@ -243,44 +228,37 @@ public function resize_crop($src) } return imagecopyresampled($this->image, $src, 0, 0, $src_x, $src_y, $this->width, $this->height, $src_w, $src_h); - } else { + + } else return false; - } } - /** Resize image to fit in given resolution. Returns TRUE on success or FALSE on failure - * @param integer $width - * @param integer $height - * @return bool */ + /** Resize image to fit in given resolution. Returns TRUE on success or FALSE on failure + * @param integer $width + * @param integer $height + * @return bool */ - public function resize_fit($width, $height) - { - if ((!$width && !$height) || (($width == $this->width) && ($height == $this->height))) { + public function resize_fit($width, $height) { + if ((!$width && !$height) || (($width == $this->width) && ($height == $this->height))) return true; - } - if (!$width || (($height / $width) < ($this->height / $this->width))) { + if (!$width || (($height / $width) < ($this->height / $this->width))) $width = intval(($this->width * $height) / $this->height); - } elseif (!$height || (($width / $height) < ($this->width / $this->height))) { + elseif (!$height || (($width / $height) < ($this->width / $this->height))) $height = intval(($this->height * $width) / $this->width); - } - if (!$width) { - $width = 1; - } - if (!$height) { - $height = 1; - } + if (!$width) $width = 1; + if (!$height) $height = 1; return $this->resize($width, $height); } - /** Neka si predstavim vyobrazhaem pravoygylnik s razmeri $width i $height. - * Izobrazhenieto shte se preorazmeri taka che to shte izliza ot tozi pravoygylnik, - * no samo po edno (x ili y) izmerenie - * @param integer $width - * @param integer $height - * @return bool */ + /** Neka si predstavim vyobrazhaem pravoygylnik s razmeri $width i $height. + * Izobrazhenieto shte se preorazmeri taka che to shte izliza ot tozi pravoygylnik, + * no samo po edno (x ili y) izmerenie + * @param integer $width + * @param integer $height + * @return bool */ + + public function resize_overflow($width, $height) { - public function resize_overflow($width, $height) - { $big = (($this->width / $this->height) > ($width / $height)) ? ($this->width * $height) / $this->height : ($this->height * $width) / $this->width; @@ -297,8 +275,7 @@ public function resize_overflow($width, $height) return $return; } - public function gd_color() - { + public function gd_color() { $args = func_get_args(); $expr_rgb = '/^rgb\(\s*(\d{1,3})\s*\,\s*(\d{1,3})\s*\,\s*(\d{1,3})\s*\)$/i'; @@ -306,44 +283,46 @@ public function gd_color() $expr_hex2 = '/^\#?([0-9a-f])([0-9a-f])([0-9a-f])$/i'; $expr_byte = '/^([01]?\d?\d|2[0-4]\d|25[0-5])$/'; - if (!isset($args[0])) { + if (!isset($args[0])) return false; - } if (count($args[0]) == 3) { list($r, $g, $b) = $args[0]; + } elseif (preg_match($expr_rgb, $args[0])) { list($r, $g, $b) = explode(" ", preg_replace($expr_rgb, "$1 $2 $3", $args[0])); + } elseif (preg_match($expr_hex1, $args[0])) { list($r, $g, $b) = explode(" ", preg_replace($expr_hex1, "$1 $2 $3", $args[0])); $r = hexdec($r); $g = hexdec($g); $b = hexdec($b); + } elseif (preg_match($expr_hex2, $args[0])) { list($r, $g, $b) = explode(" ", preg_replace($expr_hex2, "$1$1 $2$2 $3$3", $args[0])); $r = hexdec($r); $g = hexdec($g); $b = hexdec($b); + } elseif ((count($args) == 3) && preg_match($expr_byte, $args[0]) && preg_match($expr_byte, $args[1]) && preg_match($expr_byte, $args[2]) ) { list($r, $g, $b) = $args; - } else { + + } else return false; - } return imagecolorallocate($this->image, $r, $g, $b); } - public function fill_color($color) - { + public function fill_color($color) { return $this->imagefilledrectangle(0, 0, $this->width - 1, $this->height - 1, $color); } - /* G D M E T H O D S */ +/* G D M E T H O D S */ public function imagecopy( $src, @@ -357,22 +336,14 @@ public function imagecopy( if ($image_details !== false) { list($src, $src_width, $src_height) = $image_details; - if (is_null($dst_w)) { - $dst_w = $this->width - $dst_x; - } - if (is_null($dst_h)) { - $dst_h = $this->height - $dst_y; - } - if (is_null($src_w)) { - $src_w = $src_width - $src_x; - } - if (is_null($src_h)) { - $src_h = $src_height - $src_y; - } + if (is_null($dst_w)) $dst_w = $this->width - $dst_x; + if (is_null($dst_h)) $dst_h = $this->height - $dst_y; + if (is_null($src_w)) $src_w = $src_width - $src_x; + if (is_null($src_h)) $src_h = $src_height - $src_y; return imagecopy($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h); - } else { + + } else return false; - } } public function imagecopyresampled( @@ -387,88 +358,68 @@ public function imagecopyresampled( if ($image_details !== false) { list($src, $src_width, $src_height) = $image_details; - if (is_null($dst_w)) { - $dst_w = $this->width - $dst_x; - } - if (is_null($dst_h)) { - $dst_h = $this->height - $dst_y; - } - if (is_null($src_w)) { - $src_w = $src_width - $src_x; - } - if (is_null($src_h)) { - $src_h = $src_height - $src_y; - } + if (is_null($dst_w)) $dst_w = $this->width - $dst_x; + if (is_null($dst_h)) $dst_h = $this->height - $dst_y; + if (is_null($src_w)) $src_w = $src_width - $src_x; + if (is_null($src_h)) $src_h = $src_height - $src_y; imagealphablending($this->image, false); - imagesavealpha($this->image, true); + imagesavealpha($this->image,true); - /*** gif transparent fix - 1.10.2013 ***/ + /*** gif transparent fix - 1.10.2013 ***/ - $transindex = imagecolortransparent($src); - $palletsize = imagecolorstotal($src); - if ($transindex >= 0 && $transindex < $palletsize) { - $transcol = imagecolorsforindex($src, $transindex); + $transindex = imagecolortransparent($src); + $palletsize = imagecolorstotal($src); + if($transindex >= 0 && $transindex < $palletsize) { + $transcol = imagecolorsforindex($src, $transindex); - /*** end gif transparent fix ***/ + /*** end gif transparent fix ***/ - $transindex = imagecolorallocatealpha($this->image, $transcol['red'], $transcol['green'], $transcol['blue'], 127); - imagefilledrectangle($this->image, 0, 0, $dst_w, $dst_h, $transindex); - imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); - imagecolortransparent($this->image, $transindex); - for ($y=0; $y<$dst_h; ++$y) { - for ($x=0; $x<$dst_w; ++$x) { - if (((imagecolorat($this->image, $x, $y)>>24) & 0x7F) >= 100) { - imagesetpixel($this->image, $x, $y, $transindex); - } - } - } - imagetruecolortopalette($this->image, true, 255); - } else { - $transparent = imagecolorallocatealpha($this->image, 255, 255, 255, 127); - imagefilledrectangle($this->image, 0, 0, $dst_w, $dst_h, $transparent); - imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); - } - return $this->image; - } else { + $transindex = imagecolorallocatealpha($this->image, $transcol['red'], $transcol['green'], $transcol['blue'], 127); + imagefilledrectangle($this->image, 0, 0, $dst_w, $dst_h, $transindex); + imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); + imagecolortransparent($this->image, $transindex); + for($y=0; $y<$dst_h; ++$y) + for($x=0; $x<$dst_w; ++$x) + if(((imagecolorat($this->image, $x, $y)>>24) & 0x7F) >= 100) imagesetpixel($this->image, $x, $y, $transindex); + imagetruecolortopalette($this->image, true, 255); + } + else { + $transparent = imagecolorallocatealpha($this->image, 255, 255, 255, 127); + imagefilledrectangle($this->image, 0, 0, $dst_w, $dst_h, $transparent); + imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); + } + return $this->image; + + } else return false; - } } - public function imagefilledrectangle($x1, $y1, $x2, $y2, $color) - { + public function imagefilledrectangle($x1, $y1, $x2, $y2, $color) { $color = $this->gd_color($color); - if ($color === false) { - return false; - } + if ($color === false) return false; return imagefilledrectangle($this->image, $x1, $y1, $x2, $y2, $color); } - public function imagepng($filename=null, $quality=null, $filters=null) - { - if (is_null($filename) && !headers_sent()) { + public function imagepng($filename=null, $quality=null, $filters=null) { + if (is_null($filename) && !headers_sent()) header("Content-Type: image/png"); - } @imagesavealpha($this->image, true); return imagepng($this->image, $filename, $quality, $filters); } - public function imagejpeg($filename=null, $quality=75) - { - if (is_null($filename) && !headers_sent()) { + public function imagejpeg($filename=null, $quality=75) { + if (is_null($filename) && !headers_sent()) header("Content-Type: image/jpeg"); - } return imagejpeg($this->image, $filename, $quality); } - public function imagegif($filename=null) - { - if (is_null($filename) && !headers_sent()) { + public function imagegif($filename=null) { + if (is_null($filename) && !headers_sent()) header("Content-Type: image/gif"); - } - @imagesavealpha($this->image, true); + @imagesavealpha($this->image, true); return imagegif($this->image, $filename); } } diff --git a/manager/media/browser/mcpuk/lib/class_image.php b/manager/media/browser/mcpuk/lib/class_image.php index 09985d7f27..79918a49b2 100755 --- a/manager/media/browser/mcpuk/lib/class_image.php +++ b/manager/media/browser/mcpuk/lib/class_image.php @@ -12,123 +12,114 @@ * @link http://kcfinder.sunhater.com */ -abstract class image -{ +abstract class image { const DEFAULT_JPEG_QUALITY = 75; - /** Image resource or object - * @var mixed */ +/** Image resource or object + * @var mixed */ protected $image; - /** Image width in pixels - * @var integer */ +/** Image width in pixels + * @var integer */ protected $width; - /** Image height in pixels - * @var integer */ +/** Image height in pixels + * @var integer */ protected $height; - /** Init error - * @var bool */ +/** Init error + * @var bool */ protected $initError = false; - /** Driver specific options - * @var array */ +/** Driver specific options + * @var array */ protected $options = array(); - /** Magic method which allows read-only access to all protected or private - * class properties - * @param string $property - * @return mixed */ +/** Magic method which allows read-only access to all protected or private + * class properties + * @param string $property + * @return mixed */ - final public function __get($property) - { + final public function __get($property) { return property_exists($this, $property) ? $this->$property : null; } - /** Constructor. Parameter $image should be: - * 1. An instance of image driver class (copy instance). - * 2. An image represented by the type of the $image property - * (resource or object). - * 3. An array with two elements. First - width, second - height. - * Creates a blank image. - * 4. A filename string. Get image form file. - * Second paramaeter is used by pass some specific image driver options - * @param mixed $image - * @param array $options */ +/** Constructor. Parameter $image should be: + * 1. An instance of image driver class (copy instance). + * 2. An image represented by the type of the $image property + * (resource or object). + * 3. An array with two elements. First - width, second - height. + * Creates a blank image. + * 4. A filename string. Get image form file. + * Second paramaeter is used by pass some specific image driver options + * @param mixed $image + * @param array $options */ - public function __construct($image, array $options=array()) - { + public function __construct($image, array $options=array()) { $this->image = $this->width = $this->height = null; $imageDetails = $this->buildImage($image); - if ($imageDetails !== false) { + if ($imageDetails !== false) list($this->image, $this->width, $this->height) = $imageDetails; - } else { + else $this->initError = true; - } $this->options = $options; } - /** Factory pattern to load selected driver. $image and $options are passed - * to the constructor of the image driver - * @param string $driver - * @param mixed $image - * @return object */ +/** Factory pattern to load selected driver. $image and $options are passed + * to the constructor of the image driver + * @param string $driver + * @param mixed $image + * @return object */ - final public static function factory($driver, $image, array $options=array()) - { + final static function factory($driver, $image, array $options=array()) { $class = "image_$driver"; return new $class($image, $options); } - /** Checks if the drivers in the array parameter could be used. Returns first - * found one - * @param array $drivers - * @return string */ +/** Checks if the drivers in the array parameter could be used. Returns first + * found one + * @param array $drivers + * @return string */ - final public static function getDriver(array $drivers=array('gd')) - { + final static function getDriver(array $drivers=array('gd')) { foreach ($drivers as $driver) { - if (!preg_match('/^[a-z0-9\_]+$/i', $driver)) { + if (!preg_match('/^[a-z0-9\_]+$/i', $driver)) continue; - } $class = "image_$driver"; if (class_exists($class) && method_exists($class, "available")) { eval("\$avail = $class::available();"); - if ($avail) { - return $driver; - } + if ($avail) return $driver; } } return false; } - /** Returns an array. Element 0 - image resource. Element 1 - width. Element 2 - height. - * Returns FALSE on failure. - * @param mixed $image - * @return array */ +/** Returns an array. Element 0 - image resource. Element 1 - width. Element 2 - height. + * Returns FALSE on failure. + * @param mixed $image + * @return array */ - final protected function buildImage($image) - { + final protected function buildImage($image) { $class = get_class($this); if ($image instanceof $class) { $width = $image->width; $height = $image->height; $img = $image->image; + } elseif (is_array($image)) { list($key, $width) = each($image); list($key, $height) = each($image); $img = $this->getBlankImage($width, $height); - } else { + + } else $img = $this->getImage($image, $width, $height); - } return ($img !== false) ? array($img, $width, $height) @@ -136,124 +127,113 @@ final protected function buildImage($image) } - /** Returns calculated proportional width from the given height - * @param integer $resizedHeight - * @return integer */ +/** Returns calculated proportional width from the given height + * @param integer $resizedHeight + * @return integer */ - final public function getPropWidth($resizedHeight) - { + final public function getPropWidth($resizedHeight) { $width = round(($this->width * $resizedHeight) / $this->height); - if (!$width) { - $width = 1; - } + if (!$width) $width = 1; return $width; } - /** Returns calculated proportional height from the given width - * @param integer $resizedWidth - * @return integer */ +/** Returns calculated proportional height from the given width + * @param integer $resizedWidth + * @return integer */ - final public function getPropHeight($resizedWidth) - { + final public function getPropHeight($resizedWidth) { $height = round(($this->height * $resizedWidth) / $this->width); - if (!$height) { - $height = 1; - } + if (!$height) $height = 1; return $height; } - /** Checks if PHP needs some extra extensions to use the image driver. This - * static method should be implemented into driver classes like abstract - * methods - * @return bool */ - public static function available() - { - return false; - } +/** Checks if PHP needs some extra extensions to use the image driver. This + * static method should be implemented into driver classes like abstract + * methods + * @return bool */ + static function available() { return false; } - /** Checks if file is an image. This static method should be implemented into - * driver classes like abstract methods - * @param string $file - * @return bool */ - public static function checkImage($file) - { - return false; - } +/** Checks if file is an image. This static method should be implemented into + * driver classes like abstract methods + * @param string $file + * @return bool */ + static function checkImage($file) { return false; } - /** Resize image. Should return TRUE on success or FALSE on failure - * @param integer $width - * @param integer $height - * @return bool */ +/** Resize image. Should return TRUE on success or FALSE on failure + * @param integer $width + * @param integer $height + * @return bool */ abstract public function resize($width, $height); - /** Resize image to fit in given resolution. Should returns TRUE on success - * or FALSE on failure. If $background is set, the image size will be - * $width x $height and the empty spaces (if any) will be filled with defined - * color. Background color examples: "#5f5", "#ff67ca", array(255, 255, 255) - * @param integer $width - * @param integer $height - * @param mixed $background - * @return bool */ +/** Resize image to fit in given resolution. Should returns TRUE on success + * or FALSE on failure. If $background is set, the image size will be + * $width x $height and the empty spaces (if any) will be filled with defined + * color. Background color examples: "#5f5", "#ff67ca", array(255, 255, 255) + * @param integer $width + * @param integer $height + * @param mixed $background + * @return bool */ abstract public function resizeFit($width, $height, $background=false); - /** Resize and crop the image to fit in given resolution. Returns TRUE on - * success or FALSE on failure - * @param mixed $src - * @param integer $offset - * @return bool */ +/** Resize and crop the image to fit in given resolution. Returns TRUE on + * success or FALSE on failure + * @param mixed $src + * @param integer $offset + * @return bool */ abstract public function resizeCrop($width, $height, $offset=false); - /** Rotate image - * @param integer $angle - * @param string $background - * @return bool */ +/** Rotate image + * @param integer $angle + * @param string $background + * @return bool */ abstract public function rotate($angle, $background="#000000"); abstract public function flipHorizontal(); abstract public function flipVertical(); - /** Apply a PNG or GIF watermark to the image. $top and $left parameters sets - * the offset of the watermark in pixels. Boolean and NULL values are possible - * too. In default case (FALSE, FALSE) the watermark should be applyed to - * the bottom right corner. NULL values means center aligning. If the - * watermark is bigger than the image or it's partialy or fully outside the - * image, it shoudn't be applied - * @param string $file - * @param mixed $top - * @param mixed $left - * @return bool */ +/** Apply a PNG or GIF watermark to the image. $top and $left parameters sets + * the offset of the watermark in pixels. Boolean and NULL values are possible + * too. In default case (FALSE, FALSE) the watermark should be applyed to + * the bottom right corner. NULL values means center aligning. If the + * watermark is bigger than the image or it's partialy or fully outside the + * image, it shoudn't be applied + * @param string $file + * @param mixed $top + * @param mixed $left + * @return bool */ abstract public function watermark($file, $left=false, $top=false); - /** Should output the image. Second parameter is used to pass some options like - * 'file' - if is set, the output will be written to a file - * 'quality' - compression quality - * It's possible to use extra specific options required by image type ($type) - * @param string $type - * @param array $options - * @return bool */ +/** Should output the image. Second parameter is used to pass some options like + * 'file' - if is set, the output will be written to a file + * 'quality' - compression quality + * It's possible to use extra specific options required by image type ($type) + * @param string $type + * @param array $options + * @return bool */ abstract public function output($type='jpeg', array $options=array()); - /** This method should create a blank image with selected size. Should returns - * resource or object related to the created image, which will be passed to - * $image property - * @param integer $width - * @param integer $height - * @return mixed */ +/** This method should create a blank image with selected size. Should returns + * resource or object related to the created image, which will be passed to + * $image property + * @param integer $width + * @param integer $height + * @return mixed */ abstract protected function getBlankImage($width, $height); - /** This method should create an image from source image. Only first parameter - * ($image) is input. Its type should be filename string or a type of the - * $image property. See the constructor reference for details. The - * parametters $width and $height are output only. Should returns resource or - * object related to the created image, which will be passed to $image - * property - * @param mixed $image - * @param integer $width - * @param integer $height - * @return mixed */ +/** This method should create an image from source image. Only first parameter + * ($image) is input. Its type should be filename string or a type of the + * $image property. See the constructor reference for details. The + * parametters $width and $height are output only. Should returns resource or + * object related to the created image, which will be passed to $image + * property + * @param mixed $image + * @param integer $width + * @param integer $height + * @return mixed */ abstract protected function getImage($image, &$width, &$height); + } diff --git a/manager/media/browser/mcpuk/lib/class_image_gd.php b/manager/media/browser/mcpuk/lib/class_image_gd.php index 55426518ea..c564ce8e43 100755 --- a/manager/media/browser/mcpuk/lib/class_image_gd.php +++ b/manager/media/browser/mcpuk/lib/class_image_gd.php @@ -12,20 +12,14 @@ * @link http://kcfinder.sunhater.com */ -class image_gd extends image -{ +class image_gd extends image { // ABSTRACT PUBLIC METHODS - public function resize($width, $height) - { - if (!$width) { - $width = 1; - } - if (!$height) { - $height = 1; - } + public function resize($width, $height) { + if (!$width) $width = 1; + if (!$height) $height = 1; return ( (false !== ($img = new image_gd(array($width, $height)))) && $img->imageCopyResampled($this) && @@ -35,11 +29,9 @@ public function resize($width, $height) ); } - public function resizeFit($width, $height, $background=false) - { - if ((!$width && !$height) || (($width == $this->width) && ($height == $this->height))) { + public function resizeFit($width, $height, $background=false) { + if ((!$width && !$height) || (($width == $this->width) && ($height == $this->height))) return true; - } if (!$width || (($height / $width) < ($this->height / $this->width))) { $h = $height; $w = round(($this->width * $h) / $this->height); @@ -50,16 +42,13 @@ public function resizeFit($width, $height, $background=false) $w = $width; $h = $height; } - if (!$w) { - $w = 1; - } - if (!$h) { - $h = 1; - } + if (!$w) $w = 1; + if (!$h) $h = 1; - if ($background === false) { + if ($background === false) return $this->resize($w, $h); - } else { + + else { $img = new image_gd(array($width, $height)); $x = round(($width - $w) / 2); $y = round(($height - $h) / 2); @@ -67,9 +56,8 @@ public function resizeFit($width, $height, $background=false) if ((false === $this->resize($w, $h)) || (false === $img->imageFilledRectangle(0, 0, $width, $height, $background)) || (false === $img->imageCopyResampled($this->image, $x, $y, 0, 0, $w, $h)) - ) { + ) return false; - } $this->image = $img->image; $this->width = $width; @@ -79,50 +67,41 @@ public function resizeFit($width, $height, $background=false) } } - public function resizeCrop($width, $height, $offset=false) - { + public function resizeCrop($width, $height, $offset=false) { + if (($this->width / $this->height) > ($width / $height)) { $h = $height; $w = ($this->width * $h) / $this->height; $y = 0; if ($offset !== false) { - if ($offset > 0) { + if ($offset > 0) $offset = -$offset; - } - if (($w + $offset) <= $width) { + if (($w + $offset) <= $width) $offset = $width - $w; - } $x = $offset; - } else { + } else $x = ($width - $w) / 2; - } + } else { $w = $width; $h = ($this->height * $w) / $this->width; $x = 0; if ($offset !== false) { - if ($offset > 0) { + if ($offset > 0) $offset = -$offset; - } - if (($h + $offset) <= $height) { + if (($h + $offset) <= $height) $offset = $height - $h; - } $y = $offset; - } else { + } else $y = ($height - $h) / 2; - } } $x = round($x); $y = round($y); $w = round($w); $h = round($h); - if (!$w) { - $w = 1; - } - if (!$h) { - $h = 1; - } + if (!$w) $w = 1; + if (!$h) $h = 1; $return = ( (false !== ($img = new image_gd(array($width, $height))))) && @@ -138,59 +117,50 @@ public function resizeCrop($width, $height, $offset=false) return $return; } - public function rotate($angle, $background="#000000") - { + public function rotate($angle, $background="#000000") { $angle = -$angle; $img = @imagerotate($this->image, $angle, $this->gdColor($background)); - if ($img === false) { + if ($img === false) return false; - } $this->width = imagesx($img); $this->height = imagesy($img); $this->image = $img; return true; } - public function flipHorizontal() - { + public function flipHorizontal() { $img = imagecreatetruecolor($this->width, $this->height); - imagealphablending($img, false); - imagesavealpha($img, true); - if (imagecopyresampled($img, $this->image, 0, 0, ($this->width - 1), 0, $this->width, $this->height, -$this->width, $this->height)) { + imagealphablending($img, false); + imagesavealpha($img, true); + if (imagecopyresampled($img, $this->image, 0, 0, ($this->width - 1), 0, $this->width, $this->height, -$this->width, $this->height)) $this->image = $img; - } else { + else return false; - } return true; } - public function flipVertical() - { + public function flipVertical() { $img = imagecreatetruecolor($this->width, $this->height); - imagealphablending($img, false); - imagesavealpha($img, true); - if (imagecopyresampled($img, $this->image, 0, 0, 0, ($this->height - 1), $this->width, $this->height, $this->width, -$this->height)) { + imagealphablending($img, false); + imagesavealpha($img, true); + if (imagecopyresampled($img, $this->image, 0, 0, 0, ($this->height - 1), $this->width, $this->height, $this->width, -$this->height)) $this->image = $img; - } else { + else return false; - } return true; } - public function watermark($file, $left=false, $top=false) - { + public function watermark($file, $left=false, $top=false) { $info = getimagesize($file); list($w, $h, $t) = $info; - if (!in_array($t, array(IMAGETYPE_PNG, IMAGETYPE_GIF))) { + if (!in_array($t, array(IMAGETYPE_PNG, IMAGETYPE_GIF))) return false; - } $imagecreate = ($t == IMAGETYPE_PNG) ? "imagecreatefrompng" : "imagecreatefromgif"; if (!@imagealphablending($this->image, true) || (false === ($wm = @$imagecreate($file))) - ) { + ) return false; - } $w = imagesx($wm); $h = imagesy($wm); @@ -206,33 +176,28 @@ public function watermark($file, $left=false, $top=false) if ((($x + $w) > $this->width) || (($y + $h) > $this->height) || ($x < 0) || ($y < 0) - ) { + ) return false; - } - if (($wm === false) || !@imagecopy($this->image, $wm, $x, $y, 0, 0, $w, $h)) { + if (($wm === false) || !@imagecopy($this->image, $wm, $x, $y, 0, 0, $w, $h)) return false; - } @imagealphablending($this->image, false); @imagesavealpha($this->image, true); return true; } - public function output($type='jpeg', array $options=array()) - { + public function output($type='jpeg', array $options=array()) { $method = "output_$type"; - if (!method_exists($this, $method)) { + if (!method_exists($this, $method)) return false; - } return $this->$method($options); } // ABSTRACT PROTECTED METHODS - protected function getBlankImage($width, $height) - { + protected function getBlankImage($width, $height) { $img = @imagecreatetruecolor($width, $height); // imagealphablending($img, false); // imagesavealpha($img, true); @@ -242,12 +207,13 @@ protected function getBlankImage($width, $height) return $img; } - protected function getImage($image, &$width, &$height) - { + protected function getImage($image, &$width, &$height) { + if (is_resource($image) && (get_resource_type($image) == "gd")) { $width = @imagesx($image); $height = @imagesy($image); return $image; + } elseif (is_string($image) && (false !== (list($width, $height, $t) = @getimagesize($image))) ) { @@ -260,26 +226,23 @@ protected function getImage($image, &$width, &$height) )))); return $image; - } else { + + } else return false; - } } // PSEUDO-ABSTRACT STATIC METHODS - public static function available() - { + static function available() { return function_exists("imagecreatefromjpeg"); } - public static function checkImage($file) - { + static function checkImage($file) { if (!is_string($file) || ((false === (list($width, $height, $t) = @getimagesize($file)))) - ) { + ) return false; - } $img = ($t == IMAGETYPE_GIF) ? @imagecreatefromgif($file) : ( @@ -295,41 +258,34 @@ public static function checkImage($file) // OWN METHODS - protected function output_png(array $options=array()) - { + protected function output_png(array $options=array()) { $file = isset($options['file']) ? $options['file'] : null; $quality = isset($options['quality']) ? $options['quality'] : null; $filters = isset($options['filters']) ? $options['filters'] : null; - if (($file === null) && !headers_sent()) { + if (($file === null) && !headers_sent()) header("Content-Type: image/png"); - } @imagesavealpha($this->image, true); return imagepng($this->image, $file, $quality, $filters); } - protected function output_jpeg(array $options=array()) - { + protected function output_jpeg(array $options=array()) { $file = isset($options['file']) ? $options['file'] : null; $quality = isset($options['quality']) ? $options['quality'] : self::DEFAULT_JPEG_QUALITY; - if (($file === null) && !headers_sent()) { + if (($file === null) && !headers_sent()) header("Content-Type: image/jpeg"); - } return imagejpeg($this->image, $file, $quality); } - protected function output_gif(array $options=array()) - { + protected function output_gif(array $options=array()) { $file = isset($options['file']) ? $options['file'] : null; - if (isset($options['file']) && !headers_sent()) { + if (isset($options['file']) && !headers_sent()) header("Content-Type: image/gif"); - } return imagegif($this->image, $file); } - protected function gdColor() - { + protected function gdColor() { $args = func_get_args(); $exprRGB = '/^rgb\(\s*(\d{1,3})\s*\,\s*(\d{1,3})\s*\,\s*(\d{1,3})\s*\)$/i'; @@ -337,43 +293,43 @@ protected function gdColor() $exprHex2 = '/^\#?([0-9a-f])([0-9a-f])([0-9a-f])$/i'; $exprByte = '/^([01]?\d?\d|2[0-4]\d|25[0-5])$/'; - if (!isset($args[0])) { + if (!isset($args[0])) return false; - } if (count($args[0]) == 3) { list($r, $g, $b) = $args[0]; + } elseif (preg_match($exprRGB, $args[0], $match)) { list($tmp, $r, $g, $b) = $match; + } elseif (preg_match($exprHex1, $args[0], $match)) { list($tmp, $r, $g, $b) = $match; $r = hexdec($r); $g = hexdec($g); $b = hexdec($b); + } elseif (preg_match($exprHex2, $args[0], $match)) { list($tmp, $r, $g, $b) = $match; $r = hexdec("$r$r"); $g = hexdec("$g$g"); $b = hexdec("$b$b"); + } elseif ((count($args) == 3) && preg_match($exprByte, $args[0]) && preg_match($exprByte, $args[1]) && preg_match($exprByte, $args[2]) ) { list($r, $g, $b) = $args; - } else { + + } else return false; - } return imagecolorallocate($this->image, $r, $g, $b); } - protected function imageFilledRectangle($x1, $y1, $x2, $y2, $color) - { + protected function imageFilledRectangle($x1, $y1, $x2, $y2, $color) { $color = $this->gdColor($color); - if ($color === false) { - return false; - } + if ($color === false) return false; return imageFilledRectangle($this->image, $x1, $y1, $x2, $y2, $color); } @@ -382,24 +338,15 @@ protected function imageCopyResampled( ) { $imageDetails = $this->buildImage($src); - if ($imageDetails === false) { + if ($imageDetails === false) return false; - } list($src, $srcWidth, $srcHeight) = $imageDetails; - if (is_null($dstW)) { - $dstW = $this->width - $dstW; - } - if (is_null($dstH)) { - $dstH = $this->height - $dstY; - } - if (is_null($srcW)) { - $srcW = $srcWidth - $srcX; - } - if (is_null($srcH)) { - $srcH = $srcHeight - $srcY; - } + if (is_null($dstW)) $dstW = $this->width - $dstW; + if (is_null($dstH)) $dstH = $this->height - $dstY; + if (is_null($srcW)) $srcW = $srcWidth - $srcX; + if (is_null($srcH)) $srcH = $srcHeight - $srcY; return imageCopyResampled($this->image, $src, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH); } } diff --git a/manager/media/browser/mcpuk/lib/class_image_gmagick.php b/manager/media/browser/mcpuk/lib/class_image_gmagick.php index c2cb3726f0..f67691f99b 100755 --- a/manager/media/browser/mcpuk/lib/class_image_gmagick.php +++ b/manager/media/browser/mcpuk/lib/class_image_gmagick.php @@ -12,23 +12,18 @@ * @link http://kcfinder.sunhater.com */ -class image_gmagick extends image -{ - public static $MIMES = array( +class image_gmagick extends image { + + static $MIMES = array( //'tif' => "image/tiff" ); // ABSTRACT PUBLIC METHODS - public function resize($width, $height) - {// - if (!$width) { - $width = 1; - } - if (!$height) { - $height = 1; - } + public function resize($width, $height) {// + if (!$width) $width = 1; + if (!$height) $height = 1; try { $this->image->scaleImage($width, $height); } catch (Exception $e) { @@ -39,14 +34,9 @@ public function resize($width, $height) return true; } - public function resizeFit($width, $height, $background=false) - {// - if (!$width) { - $width = 1; - } - if (!$height) { - $height = 1; - } + public function resizeFit($width, $height, $background=false) {// + if (!$width) $width = 1; + if (!$height) $height = 1; try { $this->image->scaleImage($width, $height, true); @@ -60,6 +50,7 @@ public function resizeFit($width, $height, $background=false) $this->width = $w; $this->height = $h; return true; + } else { try { $this->image->setImageBackgroundColor($background); @@ -78,57 +69,43 @@ public function resizeFit($width, $height, $background=false) } } - public function resizeCrop($width, $height, $offset=false) - { - if (!$width) { - $width = 1; - } - if (!$height) { - $height = 1; - } + public function resizeCrop($width, $height, $offset=false) { + if (!$width) $width = 1; + if (!$height) $height = 1; if (($this->width / $this->height) > ($width / $height)) { $h = $height; $w = ($this->width * $h) / $this->height; $y = 0; if ($offset !== false) { - if ($offset > 0) { + if ($offset > 0) $offset = -$offset; - } - if (($w + $offset) <= $width) { + if (($w + $offset) <= $width) $offset = $width - $w; - } $x = $offset; - } else { + } else $x = ($width - $w) / 2; - } + } else { $w = $width; $h = ($this->height * $w) / $this->width; $x = 0; if ($offset !== false) { - if ($offset > 0) { + if ($offset > 0) $offset = -$offset; - } - if (($h + $offset) <= $height) { + if (($h + $offset) <= $height) $offset = $height - $h; - } $y = $offset; - } else { + } else $y = ($height - $h) / 2; - } } $x = round($x); $y = round($y); $w = round($w); $h = round($h); - if (!$w) { - $w = 1; - } - if (!$h) { - $h = 1; - } + if (!$w) $w = 1; + if (!$h) $h = 1; try { $this->image->scaleImage($w, $h); @@ -142,8 +119,7 @@ public function resizeCrop($width, $height, $offset=false) return true; } - public function rotate($angle, $background="#000000") - { + public function rotate($angle, $background="#000000") { try { $this->image->rotateImage($background, $angle); $w = $this->image->getImageWidth(); @@ -156,8 +132,7 @@ public function rotate($angle, $background="#000000") return true; } - public function flipHorizontal() - { + public function flipHorizontal() { try { $this->image->flopImage(); } catch (Exception $e) { @@ -166,8 +141,7 @@ public function flipHorizontal() return true; } - public function flipVertical() - { + public function flipVertical() { try { $this->image->flipImage(); } catch (Exception $e) { @@ -176,8 +150,7 @@ public function flipVertical() return true; } - public function watermark($file, $left=false, $top=false) - { + public function watermark($file, $left=false, $top=false) { try { $wm = new Gmagick($file); $w = $wm->getImageWidth(); @@ -198,9 +171,8 @@ public function watermark($file, $left=false, $top=false) if ((($x + $w) > $this->width) || (($y + $h) > $this->height) || ($x < 0) || ($y < 0) - ) { + ) return false; - } try { $this->image->compositeImage($wm, 1, $x, $y); @@ -213,8 +185,7 @@ public function watermark($file, $left=false, $top=false) // ABSTRACT PROTECTED METHODS - protected function getBlankImage($width, $height) - { + protected function getBlankImage($width, $height) { try { $img = new Gmagick(); $img->newImage($width, $height, "none"); @@ -224,12 +195,13 @@ protected function getBlankImage($width, $height) return $img; } - protected function getImage($image, &$width, &$height) - { + protected function getImage($image, &$width, &$height) { + if (is_object($image) && ($image instanceof image_gmagick)) { $width = $image->width; $height = $image->height; return $image->image; + } elseif (is_object($image) && ($image instanceof Gmagick)) { try { $w = $image->getImageWidth(); @@ -240,6 +212,7 @@ protected function getImage($image, &$width, &$height) $width = $w; $height = $h; return $image; + } elseif (is_string($image)) { try { $image = new Gmagick($image); @@ -251,21 +224,19 @@ protected function getImage($image, &$width, &$height) $width = $w; $height = $h; return $image; - } else { + + } else return false; - } } // PSEUDO-ABSTRACT STATIC METHODS - public static function available() - { + static function available() { return class_exists("Gmagick"); } - public static function checkImage($file) - { + static function checkImage($file) { try { new Gmagick($file); } catch (Exception $e) { @@ -277,8 +248,7 @@ public static function checkImage($file) // INHERIT METHODS - public function output($type="jpeg", array $options=array()) - { + public function output($type="jpeg", array $options=array()) { $type = strtolower($type); try { $this->image->setImageFormat($type); @@ -286,9 +256,8 @@ public function output($type="jpeg", array $options=array()) return false; } $method = "optimize_$type"; - if (method_exists($this, $method) && !$this->$method($options)) { + if (method_exists($this, $method) && !$this->$method($options)) return false; - } if (!isset($options['file'])) { if (!headers_sent()) { @@ -296,6 +265,7 @@ public function output($type="jpeg", array $options=array()) header("Content-Type: $mime"); } echo $this->image; + } else { $file = $options['file'] . ".$type"; try { @@ -317,8 +287,7 @@ public function output($type="jpeg", array $options=array()) // OWN METHODS - protected function optimize_jpeg(array $options=array()) - { + protected function optimize_jpeg(array $options=array()) { $quality = isset($options['quality']) ? $options['quality'] : self::DEFAULT_JPEG_QUALITY; try { $this->image->setCompressionQuality($quality); @@ -327,4 +296,5 @@ protected function optimize_jpeg(array $options=array()) } return true; } + } diff --git a/manager/media/browser/mcpuk/lib/class_image_imagick.php b/manager/media/browser/mcpuk/lib/class_image_imagick.php index a64863f52c..0d576fa345 100755 --- a/manager/media/browser/mcpuk/lib/class_image_imagick.php +++ b/manager/media/browser/mcpuk/lib/class_image_imagick.php @@ -12,23 +12,18 @@ * @link http://kcfinder.sunhater.com */ -class image_imagick extends image -{ - public static $MIMES = array( +class image_imagick extends image { + + static $MIMES = array( //'tif' => "image/tiff" ); // ABSTRACT PUBLIC METHODS - public function resize($width, $height) - {// - if (!$width) { - $width = 1; - } - if (!$height) { - $height = 1; - } + public function resize($width, $height) {// + if (!$width) $width = 1; + if (!$height) $height = 1; try { $this->image->scaleImage($width, $height); } catch (Exception $e) { @@ -39,14 +34,9 @@ public function resize($width, $height) return true; } - public function resizeFit($width, $height, $background=false) - {// - if (!$width) { - $width = 1; - } - if (!$height) { - $height = 1; - } + public function resizeFit($width, $height, $background=false) {// + if (!$width) $width = 1; + if (!$height) $height = 1; try { $this->image->scaleImage($width, $height, true); @@ -59,6 +49,7 @@ public function resizeFit($width, $height, $background=false) $this->width = $size['width']; $this->height = $size['height']; return true; + } else { try { $this->image->setImageBackgroundColor($background); @@ -74,57 +65,43 @@ public function resizeFit($width, $height, $background=false) } } - public function resizeCrop($width, $height, $offset=false) - { - if (!$width) { - $width = 1; - } - if (!$height) { - $height = 1; - } + public function resizeCrop($width, $height, $offset=false) { + if (!$width) $width = 1; + if (!$height) $height = 1; if (($this->width / $this->height) > ($width / $height)) { $h = $height; $w = ($this->width * $h) / $this->height; $y = 0; if ($offset !== false) { - if ($offset > 0) { + if ($offset > 0) $offset = -$offset; - } - if (($w + $offset) <= $width) { + if (($w + $offset) <= $width) $offset = $width - $w; - } $x = $offset; - } else { + } else $x = ($width - $w) / 2; - } + } else { $w = $width; $h = ($this->height * $w) / $this->width; $x = 0; if ($offset !== false) { - if ($offset > 0) { + if ($offset > 0) $offset = -$offset; - } - if (($h + $offset) <= $height) { + if (($h + $offset) <= $height) $offset = $height - $h; - } $y = $offset; - } else { + } else $y = ($height - $h) / 2; - } } $x = round($x); $y = round($y); $w = round($w); $h = round($h); - if (!$w) { - $w = 1; - } - if (!$h) { - $h = 1; - } + if (!$w) $w = 1; + if (!$h) $h = 1; try { $this->image->scaleImage($w, $h); @@ -138,8 +115,7 @@ public function resizeCrop($width, $height, $offset=false) return true; } - public function rotate($angle, $background="#000000") - { + public function rotate($angle, $background="#000000") { try { $this->image->rotateImage(new ImagickPixel($background), $angle); $size = $this->image->getImageGeometry(); @@ -151,8 +127,7 @@ public function rotate($angle, $background="#000000") return true; } - public function flipHorizontal() - { + public function flipHorizontal() { try { $this->image->flopImage(); } catch (Exception $e) { @@ -161,8 +136,7 @@ public function flipHorizontal() return true; } - public function flipVertical() - { + public function flipVertical() { try { $this->image->flipImage(); } catch (Exception $e) { @@ -171,8 +145,7 @@ public function flipVertical() return true; } - public function watermark($file, $left=false, $top=false) - { + public function watermark($file, $left=false, $top=false) { try { $wm = new Imagick($file); $size = $wm->getImageGeometry(); @@ -194,9 +167,8 @@ public function watermark($file, $left=false, $top=false) if ((($x + $w) > $this->width) || (($y + $h) > $this->height) || ($x < 0) || ($y < 0) - ) { + ) return false; - } try { $this->image->compositeImage($wm, Imagick::COMPOSITE_DEFAULT, $x, $y); @@ -209,8 +181,7 @@ public function watermark($file, $left=false, $top=false) // ABSTRACT PROTECTED METHODS - protected function getBlankImage($width, $height) - { + protected function getBlankImage($width, $height) { try { $img = new Imagick(); $img->newImage($width, $height, "none"); @@ -221,8 +192,8 @@ protected function getBlankImage($width, $height) return $img; } - protected function getImage($image, &$width, &$height) - { + protected function getImage($image, &$width, &$height) { + if (is_object($image) && ($image instanceof image_imagick)) { try { $image->image->setImageCompressionQuality(100); @@ -232,6 +203,7 @@ protected function getImage($image, &$width, &$height) $width = $image->width; $height = $image->height; return $image->image; + } elseif (is_object($image) && ($image instanceof Imagick)) { try { $image->setImageCompressionQuality(100); @@ -242,6 +214,7 @@ protected function getImage($image, &$width, &$height) $width = $size['width']; $height = $size['height']; return $image; + } elseif (is_string($image)) { try { $image = new Imagick($image); @@ -253,21 +226,19 @@ protected function getImage($image, &$width, &$height) $width = $size['width']; $height = $size['height']; return $image; - } else { + + } else return false; - } } // PSEUDO-ABSTRACT STATIC METHODS - public static function available() - { + static function available() { return class_exists("Imagick"); } - public static function checkImage($file) - { + static function checkImage($file) { try { new Imagick($file); } catch (Exception $e) { @@ -279,8 +250,7 @@ public static function checkImage($file) // INHERIT METHODS - public function output($type="jpeg", array $options=array()) - { + public function output($type="jpeg", array $options=array()) { $type = strtolower($type); try { $this->image->setImageFormat($type); @@ -288,9 +258,8 @@ public function output($type="jpeg", array $options=array()) return false; } $method = "optimize_$type"; - if (method_exists($this, $method) && !$this->$method($options)) { + if (method_exists($this, $method) && !$this->$method($options)) return false; - } if (!isset($options['file'])) { if (!headers_sent()) { @@ -298,6 +267,7 @@ public function output($type="jpeg", array $options=array()) header("Content-Type: $mime"); } echo $this->image; + } else { $file = $options['file'] . ".$type"; try { @@ -319,8 +289,7 @@ public function output($type="jpeg", array $options=array()) // OWN METHODS - protected function optimize_jpeg(array $options=array()) - { + protected function optimize_jpeg(array $options=array()) { $quality = isset($options['quality']) ? $options['quality'] : self::DEFAULT_JPEG_QUALITY; try { $this->image->setImageCompression(Imagick::COMPRESSION_JPEG); @@ -330,4 +299,5 @@ protected function optimize_jpeg(array $options=array()) } return true; } + } diff --git a/manager/media/browser/mcpuk/lib/class_input.php b/manager/media/browser/mcpuk/lib/class_input.php index 84f20b0721..36917217ad 100755 --- a/manager/media/browser/mcpuk/lib/class_input.php +++ b/manager/media/browser/mcpuk/lib/class_input.php @@ -12,34 +12,31 @@ * @link http://kcfinder.sunhater.com */ -class input -{ +class input { /** Filtered $_GET array * @var array */ public $get; - /** Filtered $_POST array - * @var array */ + /** Filtered $_POST array + * @var array */ public $post; - /** Filtered $_COOKIE array - * @var array */ + /** Filtered $_COOKIE array + * @var array */ public $cookie; - public function __construct() - { + public function __construct() { $this->get = &$_GET; $this->post = &$_POST; $this->cookie = &$_COOKIE; } - /** Magic method to get non-public properties like public. - * @param string $property - * @return mixed */ + /** Magic method to get non-public properties like public. + * @param string $property + * @return mixed */ - public function __get($property) - { + public function __get($property) { return property_exists($this, $property) ? $this->$property : null; } } diff --git a/manager/media/browser/mcpuk/lib/class_zipFolder.php b/manager/media/browser/mcpuk/lib/class_zipFolder.php index 87f17f3b0a..a5d469f7ab 100755 --- a/manager/media/browser/mcpuk/lib/class_zipFolder.php +++ b/manager/media/browser/mcpuk/lib/class_zipFolder.php @@ -13,23 +13,20 @@ * @link http://kcfinder.sunhater.com */ -class zipFolder -{ +class zipFolder { protected $zip; protected $root; protected $ignored; - public function __construct($file, $folder, $ignored=null) - { + function __construct($file, $folder, $ignored=null) { $this->zip = new ZipArchive(); $this->ignored = is_array($ignored) ? $ignored : ($ignored ? array($ignored) : array()); - if ($this->zip->open($file, ZIPARCHIVE::CREATE) !== true) { + if ($this->zip->open($file, ZIPARCHIVE::CREATE) !== TRUE) throw new Exception("cannot open <$file>\n"); - } $folder = rtrim($folder, '/'); @@ -42,23 +39,20 @@ public function __construct($file, $folder, $ignored=null) $this->zip->close(); } - public function zip($folder, $parent=null) - { + function zip($folder, $parent=null) { $full_path = "{$this->root}$parent$folder"; $zip_path = "$parent$folder"; $this->zip->addEmptyDir($zip_path); $dir = new DirectoryIterator($full_path); - foreach ($dir as $file) { + foreach ($dir as $file) if (!$file->isDot()) { $filename = $file->getFilename(); if (!in_array($filename, $this->ignored)) { - if ($file->isDir()) { + if ($file->isDir()) $this->zip($filename, "$zip_path/"); - } else { + else $this->zip->addFile("$full_path/$filename", "$zip_path/$filename"); - } } } - } } } diff --git a/manager/media/browser/mcpuk/lib/helper_dir.php b/manager/media/browser/mcpuk/lib/helper_dir.php index 800535f990..2f61f2ebe8 100755 --- a/manager/media/browser/mcpuk/lib/helper_dir.php +++ b/manager/media/browser/mcpuk/lib/helper_dir.php @@ -12,52 +12,44 @@ * @link http://kcfinder.sunhater.com */ -class dir -{ +class dir { /** Checks if the given directory is really writable. The standard PHP * function is_writable() does not work properly on Windows servers * @param string $dir * @return bool */ - public static function isWritable($dir) - { + static function isWritable($dir) { $dir = path::normalize($dir); - if (!is_dir($dir)) { + if (!is_dir($dir)) return false; - } $i = 0; do { $file = "$dir/is_writable_" . md5($i++); } while (file_exists($file)); - if (!@touch($file)) { + if (!@touch($file)) return false; - } unlink($file); return true; } - /** Recursively delete the given directory. Returns TRUE on success. - * If $firstFailExit parameter is true (default), the method returns the - * path to the first failed file or directory which cannot be deleted. - * If $firstFailExit is false, the method returns an array with failed - * files and directories which cannot be deleted. The third parameter - * $failed is used for internal use only. - * @param string $dir - * @param bool $firstFailExit - * @param array $failed - * @return mixed */ - - public static function prune($dir, $firstFailExit=true, array $failed=null) - { - if ($failed === null) { - $failed = array(); - } + /** Recursively delete the given directory. Returns TRUE on success. + * If $firstFailExit parameter is true (default), the method returns the + * path to the first failed file or directory which cannot be deleted. + * If $firstFailExit is false, the method returns an array with failed + * files and directories which cannot be deleted. The third parameter + * $failed is used for internal use only. + * @param string $dir + * @param bool $firstFailExit + * @param array $failed + * @return mixed */ + + static function prune($dir, $firstFailExit=true, array $failed=null) { + if ($failed === null) $failed = array(); $files = self::content($dir); if ($files === false) { - if ($firstFailExit) { + if ($firstFailExit) return $dir; - } $failed[] = $dir; return $failed; } @@ -66,41 +58,37 @@ public static function prune($dir, $firstFailExit=true, array $failed=null) if (is_dir($file)) { $failed_in = self::prune($file, $firstFailExit, $failed); if ($failed_in !== true) { - if ($firstFailExit) { + if ($firstFailExit) return $failed_in; - } - if (is_array($failed_in)) { + if (is_array($failed_in)) $failed = array_merge($failed, $failed_in); - } else { + else $failed[] = $failed_in; - } } } elseif (!@unlink($file)) { - if ($firstFailExit) { + if ($firstFailExit) return $file; - } $failed[] = $file; } } if (!@rmdir($dir)) { - if ($firstFailExit) { + if ($firstFailExit) return $dir; - } $failed[] = $dir; } return count($failed) ? $failed : true; } - /** Get the content of the given directory. Returns an array with filenames - * or FALSE on failure - * @param string $dir - * @param array $options - * @return mixed */ + /** Get the content of the given directory. Returns an array with filenames + * or FALSE on failure + * @param string $dir + * @param array $options + * @return mixed */ + + static function content($dir, array $options=null) { - public static function content($dir, array $options=null) - { $defaultOptions = array( 'types' => "all", // Allowed: "all" or possible return values // of filetype(), or an array with them @@ -109,29 +97,23 @@ public static function content($dir, array $options=null) 'followLinks' => true ); - if (!is_dir($dir) || !is_readable($dir)) { + if (!is_dir($dir) || !is_readable($dir)) return false; - } - if (strtoupper(substr(PHP_OS, 0, 3)) == "WIN") { + if (strtoupper(substr(PHP_OS, 0, 3)) == "WIN") $dir = str_replace("\\", "/", $dir); - } $dir = rtrim($dir, "/"); $dh = @opendir($dir); - if ($dh === false) { + if ($dh === false) return false; - } - if ($options === null) { + if ($options === null) $options = $defaultOptions; - } - foreach ($defaultOptions as $key => $val) { - if (!isset($options[$key])) { + foreach ($defaultOptions as $key => $val) + if (!isset($options[$key])) $options[$key] = $val; - } - } $files = array(); while (($file = @readdir($dh)) !== false) { @@ -142,32 +124,28 @@ public static function content($dir, array $options=null) do { $ldir = dirname($lfile); $lfile = @readlink($lfile); - if (substr($lfile, 0, 1) != "/") { + if (substr($lfile, 0, 1) != "/") $lfile = "$ldir/$lfile"; - } $type = filetype($lfile); } while ($type == "link"); } if ((($type === "dir") && (($file == ".") || ($file == ".."))) || !preg_match($options['pattern'], $file) - ) { + ) continue; - } if (($options['types'] === "all") || ($type === $options['types']) || ((is_array($options['types'])) && in_array($type, $options['types'])) - ) { + ) $files[] = $options['addPath'] ? "$dir/$file" : $file; - } } closedir($dh); usort($files, array("dir", "fileSort")); return $files; } - public static function fileSort($a, $b) - { + static function fileSort($a, $b) { if (function_exists("mb_strtolower")) { $a = mb_strtolower($a); $b = mb_strtolower($b); @@ -175,9 +153,7 @@ public static function fileSort($a, $b) $a = strtolower($a); $b = strtolower($b); } - if ($a == $b) { - return 0; - } + if ($a == $b) return 0; return ($a < $b) ? -1 : 1; } } diff --git a/manager/media/browser/mcpuk/lib/helper_file.php b/manager/media/browser/mcpuk/lib/helper_file.php index 73ef8b5fb0..1f0200bcd7 100755 --- a/manager/media/browser/mcpuk/lib/helper_file.php +++ b/manager/media/browser/mcpuk/lib/helper_file.php @@ -12,9 +12,9 @@ * @link http://kcfinder.sunhater.com */ -class file -{ - public static $MIME = array( +class file { + + static $MIME = array( 'ai' => 'application/postscript', 'aif' => 'audio/x-aiff', 'aifc' => 'audio/x-aiff', @@ -100,45 +100,41 @@ class file 'zip' => 'application/x-zip' ); - /** Checks if the given file is really writable. The standard PHP function - * is_writable() does not work properly on Windows servers. - * @param string $dir - * @return bool */ + /** Checks if the given file is really writable. The standard PHP function + * is_writable() does not work properly on Windows servers. + * @param string $dir + * @return bool */ - public static function isWritable($filename) - { + static function isWritable($filename) { $filename = path::normalize($filename); - if (!is_file($filename) || (false === ($fp = @fopen($filename, 'a+')))) { + if (!is_file($filename) || (false === ($fp = @fopen($filename, 'a+')))) return false; - } fclose($fp); return true; } - /** Get the extension from filename - * @param string $file - * @param bool $toLower - * @return string */ + /** Get the extension from filename + * @param string $file + * @param bool $toLower + * @return string */ - public static function getExtension($filename, $toLower=true) - { + static function getExtension($filename, $toLower=true) { return preg_match('/^.*\.([^\.]*)$/s', $filename, $patt) ? ($toLower ? strtolower($patt[1]) : $patt[1]) : ""; } - /** Get MIME type of the given filename. If Fileinfo PHP extension is - * available the MIME type will be fetched by the file's content. The - * second parameter is optional and defines the magic file path. If you - * skip it, the default one will be loaded. - * If Fileinfo PHP extension is not available the MIME type will be fetched - * by filename extension regarding $MIME property. If the file extension - * does not exist there, returned type will be application/octet-stream - * @param string $filename - * @param string $magic - * @return string */ + /** Get MIME type of the given filename. If Fileinfo PHP extension is + * available the MIME type will be fetched by the file's content. The + * second parameter is optional and defines the magic file path. If you + * skip it, the default one will be loaded. + * If Fileinfo PHP extension is not available the MIME type will be fetched + * by filename extension regarding $MIME property. If the file extension + * does not exist there, returned type will be application/octet-stream + * @param string $filename + * @param string $magic + * @return string */ - public static function getMimeType($filename, $magic=null) - { + static function getMimeType($filename, $magic=null) { if (class_exists("finfo")) { $finfo = ($magic === null) ? new finfo(FILEINFO_MIME) @@ -153,36 +149,33 @@ public static function getMimeType($filename, $magic=null) return isset(self::$MIME[$ext]) ? self::$MIME[$ext] : "application/octet-stream"; } - /** Get inexistant filename based on the given filename. If you skip $dir - * parameter the directory will be fetched from $filename and returned - * value will be full filename path. The third parameter is optional and - * defines the template, the filename will be renamed to. Default template - * is {name}({sufix}){ext}. Examples: - * - * file::getInexistantFilename("/my/directory/myfile.txt"); - * If myfile.txt does not exist - returns the same path to the file - * otherwise returns "/my/directory/myfile(1).txt" - * - * file::getInexistantFilename("myfile.txt", "/my/directory"); - * returns "myfile.txt" or "myfile(1).txt" or "myfile(2).txt" etc... - * - * file::getInexistantFilename("myfile.txt", "/dir", "{name}[{sufix}]{ext}"); - * returns "myfile.txt" or "myfile[1].txt" or "myfile[2].txt" etc... - * - * @param string $filename - * @param string $dir - * @param string $tpl - * @return string */ + /** Get inexistant filename based on the given filename. If you skip $dir + * parameter the directory will be fetched from $filename and returned + * value will be full filename path. The third parameter is optional and + * defines the template, the filename will be renamed to. Default template + * is {name}({sufix}){ext}. Examples: + * + * file::getInexistantFilename("/my/directory/myfile.txt"); + * If myfile.txt does not exist - returns the same path to the file + * otherwise returns "/my/directory/myfile(1).txt" + * + * file::getInexistantFilename("myfile.txt", "/my/directory"); + * returns "myfile.txt" or "myfile(1).txt" or "myfile(2).txt" etc... + * + * file::getInexistantFilename("myfile.txt", "/dir", "{name}[{sufix}]{ext}"); + * returns "myfile.txt" or "myfile[1].txt" or "myfile[2].txt" etc... + * + * @param string $filename + * @param string $dir + * @param string $tpl + * @return string */ - public static function getInexistantFilename($filename, $dir=null, $tpl=null) - { - if ($tpl === null) { - $tpl = "{name}({sufix}){ext}"; - } + static function getInexistantFilename($filename, $dir=null, $tpl=null) { + if ($tpl === null) $tpl = "{name}({sufix}){ext}"; $fullPath = ($dir === null); - if ($fullPath) { + if ($fullPath) $dir = path::normalize(dirname($filename)); - } else { + else { $fdir = dirname($filename); $dir = strlen($fdir) ? path::normalize("$dir/$fdir") @@ -193,11 +186,9 @@ public static function getInexistantFilename($filename, $dir=null, $tpl=null) $name = strlen($ext) ? substr($filename, 0, -strlen($ext) - 1) : $filename; $tpl = str_replace('{name}', $name, $tpl); $tpl = str_replace('{ext}', (strlen($ext) ? ".$ext" : ""), $tpl); - $i = 1; - $file = "$dir/$filename"; - while (file_exists($file)) { + $i = 1; $file = "$dir/$filename"; + while (file_exists($file)) $file = "$dir/" . str_replace('{sufix}', $i++, $tpl); - } return $fullPath ? $file @@ -205,4 +196,5 @@ public static function getInexistantFilename($filename, $dir=null, $tpl=null) ? "$fdir/" . basename($file) : basename($file)); } + } diff --git a/manager/media/browser/mcpuk/lib/helper_httpCache.php b/manager/media/browser/mcpuk/lib/helper_httpCache.php index fcb864451a..2dd660c6d0 100755 --- a/manager/media/browser/mcpuk/lib/helper_httpCache.php +++ b/manager/media/browser/mcpuk/lib/helper_httpCache.php @@ -12,58 +12,45 @@ * @link http://kcfinder.sunhater.com */ -class httpCache -{ +class httpCache { const DEFAULT_TYPE = "text/html"; const DEFAULT_EXPIRE = 604800; // in seconds - /** Cache a file. The $type parameter might define the MIME type of the file - * or path to magic file to autodetect the MIME type. If you skip $type - * parameter the method will try with the default magic file. Autodetection - * of MIME type requires Fileinfo PHP extension used in file::getMimeType() - * @param string $file - * @param string $type - * @param integer $expire - * @param array $headers */ + /** Cache a file. The $type parameter might define the MIME type of the file + * or path to magic file to autodetect the MIME type. If you skip $type + * parameter the method will try with the default magic file. Autodetection + * of MIME type requires Fileinfo PHP extension used in file::getMimeType() + * @param string $file + * @param string $type + * @param integer $expire + * @param array $headers */ - public static function file($file, $type=null, $expire=null, array $headers=null) - { + static function file($file, $type=null, $expire=null, array $headers=null) { $mtime = @filemtime($file); - if ($mtime !== false) { - self::checkMTime($mtime); - } + if ($mtime !== false) self::checkMTime($mtime); if ($type === null) { $magic = ((substr($type, 0, 1) == "/") || preg_match('/^[a-z]\:/i', $type)) ? $type : null; $type = file::getMimeType($file, $magic); - if (!$type) { - $type = null; - } + if (!$type) $type = null; } self::content(@file_get_contents($file), $mtime, $type, $expire, $headers, false); } - /** Cache the given $content with $mtime modification time. - * @param binary $content - * @param integer $mtime - * @param string $type - * @param integer $expire - * @param array $headers - * @param bool $checkMTime */ + /** Cache the given $content with $mtime modification time. + * @param binary $content + * @param integer $mtime + * @param string $type + * @param integer $expire + * @param array $headers + * @param bool $checkMTime */ - public static function content($content, $mtime, $type=null, $expire=null, array $headers=null, $checkMTime=true) - { - if ($checkMTime) { - self::checkMTime($mtime); - } - if ($type === null) { - $type = self::DEFAULT_TYPE; - } - if ($expire === null) { - $expire = self::DEFAULT_EXPIRE; - } + static function content($content, $mtime, $type=null, $expire=null, array $headers=null, $checkMTime=true) { + if ($checkMTime) self::checkMTime($mtime); + if ($type === null) $type = self::DEFAULT_TYPE; + if ($expire === null) $expire = self::DEFAULT_EXPIRE; $size = strlen($content); $expires = gmdate("D, d M Y H:i:s", time() + $expire) . " GMT"; header("Content-Type: $type"); @@ -71,22 +58,17 @@ public static function content($content, $mtime, $type=null, $expire=null, array header("Cache-Control: max-age=$expire"); header("Pragma: !invalid"); header("Content-Length: $size"); - if ($headers !== null) { - foreach ($headers as $header) { - header($header); - } - } + if ($headers !== null) foreach ($headers as $header) header($header); echo $content; } - /** Check if given modification time is newer than client-side one. If not, - * the method will tell the client to get the content from its own cache. - * Afterwards the script process will be terminated. This feature requires - * the PHP to be configured as Apache module. - * @param integer $mtime */ + /** Check if given modification time is newer than client-side one. If not, + * the method will tell the client to get the content from its own cache. + * Afterwards the script process will be terminated. This feature requires + * the PHP to be configured as Apache module. + * @param integer $mtime */ - public static function checkMTime($mtime, $sendHeaders=null) - { + static function checkMTime($mtime, $sendHeaders=null) { header("Last-Modified: " . gmdate("D, d M Y H:i:s", $mtime) . " GMT"); $headers = function_exists("getallheaders") @@ -100,13 +82,11 @@ public static function checkMTime($mtime, $sendHeaders=null) $client_mtime = @strtotime($client_mtime[0]); if ($client_mtime >= $mtime) { header('HTTP/1.1 304 Not Modified'); - if (is_array($sendHeaders) && count($sendHeaders)) { - foreach ($sendHeaders as $header) { + if (is_array($sendHeaders) && count($sendHeaders)) + foreach ($sendHeaders as $header) header($header); - } - } elseif ($sendHeaders !== null) { + elseif ($sendHeaders !== null) header($sendHeaders); - } die; diff --git a/manager/media/browser/mcpuk/lib/helper_path.php b/manager/media/browser/mcpuk/lib/helper_path.php index 7e5078f5bd..04e9de087b 100755 --- a/manager/media/browser/mcpuk/lib/helper_path.php +++ b/manager/media/browser/mcpuk/lib/helper_path.php @@ -12,47 +12,39 @@ * @link http://kcfinder.sunhater.com */ -class path -{ +class path { /** Get the absolute URL path of the given one. Returns FALSE if the URL * is not valid or the current directory cannot be resolved (getcwd()) * @param string $path * @return string */ - public static function rel2abs_url($path) - { - if (substr($path, 0, 1) == "/") { - return $path; - } + static function rel2abs_url($path) { + if (substr($path, 0, 1) == "/") return $path; $dir = @getcwd(); - if (!isset($_SERVER['DOCUMENT_ROOT']) || ($dir === false)) { + if (!isset($_SERVER['DOCUMENT_ROOT']) || ($dir === false)) return false; - } $dir = self::normalize($dir); $doc_root = self::normalize($_SERVER['DOCUMENT_ROOT']); - if (substr($dir, 0, strlen($doc_root)) != $doc_root) { + if (substr($dir, 0, strlen($doc_root)) != $doc_root) return false; - } $return = self::normalize(substr($dir, strlen($doc_root)) . "/$path"); - if (substr($return, 0, 1) !== "/") { + if (substr($return, 0, 1) !== "/") $return = "/$return"; - } return $return; } - /** Resolve full filesystem path of given URL. Returns FALSE if the URL - * cannot be resolved - * @param string $url - * @return string */ + /** Resolve full filesystem path of given URL. Returns FALSE if the URL + * cannot be resolved + * @param string $url + * @return string */ - public static function url2fullPath($url) - { + static function url2fullPath($url) { $url = self::normalize($url); $uri = isset($_SERVER['SCRIPT_NAME']) @@ -63,18 +55,15 @@ public static function url2fullPath($url) $uri = self::normalize($uri); if (substr($url, 0, 1) !== "/") { - if ($uri === false) { - return false; - } + if ($uri === false) return false; $url = dirname($uri) . "/$url"; } if (isset($_SERVER['DOCUMENT_ROOT'])) { return self::normalize($_SERVER['DOCUMENT_ROOT'] . "/$url"); + } else { - if ($uri === false) { - return false; - } + if ($uri === false) return false; if (isset($_SERVER['SCRIPT_FILENAME'])) { $scr_filename = self::normalize($_SERVER['SCRIPT_FILENAME']); @@ -82,84 +71,71 @@ public static function url2fullPath($url) } $count = count(explode('/', $uri)) - 1; - for ($i = 0, $chdir = ""; $i < $count; $i++) { + for ($i = 0, $chdir = ""; $i < $count; $i++) $chdir .= "../"; - } $chdir = self::normalize($chdir); $dir = getcwd(); - if (($dir === false) || !@chdir($chdir)) { + if (($dir === false) || !@chdir($chdir)) return false; - } $rdir = getcwd(); chdir($dir); return ($rdir !== false) ? self::normalize($rdir . "/$url") : false; } } - /** Normalize the given path. On Windows servers backslash will be replaced - * with slash. Remobes unnecessary doble slashes and double dots. Removes - * last slash if it exists. Examples: - * path::normalize("C:\\any\\path\\") returns "C:/any/path" - * path::normalize("/your/path/..//home/") returns "/your/home" - * @param string $path - * @return string */ + /** Normalize the given path. On Windows servers backslash will be replaced + * with slash. Remobes unnecessary doble slashes and double dots. Removes + * last slash if it exists. Examples: + * path::normalize("C:\\any\\path\\") returns "C:/any/path" + * path::normalize("/your/path/..//home/") returns "/your/home" + * @param string $path + * @return string */ - public static function normalize($path) - { + static function normalize($path) { if (strtoupper(substr(PHP_OS, 0, 3)) == "WIN") { $path = preg_replace('/([^\\\])\\\([^\\\])/', "$1/$2", $path); - if (substr($path, -1) == "\\") { - $path = substr($path, 0, -1); - } - if (substr($path, 0, 1) == "\\") { - $path = "/" . substr($path, 1); - } + if (substr($path, -1) == "\\") $path = substr($path, 0, -1); + if (substr($path, 0, 1) == "\\") $path = "/" . substr($path, 1); } $path = preg_replace('/\/+/s', "/", $path); $path = "/$path"; - if (substr($path, -1) != "/") { + if (substr($path, -1) != "/") $path .= "/"; - } $expr = '/\/([^\/]{1}|[^\.\/]{2}|[^\/]{3,})\/\.\.\//s'; - while (preg_match($expr, $path)) { + while (preg_match($expr, $path)) $path = preg_replace($expr, "/", $path); - } $path = substr($path, 0, -1); $path = substr($path, 1); return $path; } - /** Encode URL Path - * @param string $path - * @return string */ + /** Encode URL Path + * @param string $path + * @return string */ - public static function urlPathEncode($path) - { + static function urlPathEncode($path) { $path = self::normalize($path); $encoded = ""; - foreach (explode("/", $path) as $dir) { + foreach (explode("/", $path) as $dir) $encoded .= rawurlencode($dir) . "/"; - } $encoded = substr($encoded, 0, -1); return $encoded; } - /** Decode URL Path - * @param string $path - * @return string */ + /** Decode URL Path + * @param string $path + * @return string */ - public static function urlPathDecode($path) - { + static function urlPathDecode($path) { $path = self::normalize($path); $decoded = ""; - foreach (explode("/", $path) as $dir) { + foreach (explode("/", $path) as $dir) $decoded .= rawurldecode($dir) . "/"; - } $decoded = substr($decoded, 0, -1); return $decoded; } diff --git a/manager/media/browser/mcpuk/lib/helper_text.php b/manager/media/browser/mcpuk/lib/helper_text.php index 0d03082554..8cecc353d1 100755 --- a/manager/media/browser/mcpuk/lib/helper_text.php +++ b/manager/media/browser/mcpuk/lib/helper_text.php @@ -12,24 +12,21 @@ * @link http://kcfinder.sunhater.com */ -class text -{ +class text { /** Replace repeated white spaces to single space * @param string $string * @return string */ - public static function clearWhitespaces($string) - { + static function clearWhitespaces($string) { return trim(preg_replace('/\s+/s', " ", $string)); } - /** Normalize the string for HTML attribute value - * @param string $string - * @return string */ + /** Normalize the string for HTML attribute value + * @param string $string + * @return string */ - public static function htmlValue($string) - { + static function htmlValue($string) { return str_replace('"', """, str_replace("'", ''', @@ -38,12 +35,11 @@ public static function htmlValue($string) $string)))); } - /** Normalize the string for JavaScript string value - * @param string $string - * @return string */ + /** Normalize the string for JavaScript string value + * @param string $string + * @return string */ - public static function jsValue($string) - { + static function jsValue($string) { return preg_replace('/\r?\n/', "\\n", str_replace('"', "\\\"", @@ -52,25 +48,22 @@ public static function jsValue($string) $string)))); } - /** Normalize the string for XML tag content data - * @param string $string - * @param bool $cdata */ + /** Normalize the string for XML tag content data + * @param string $string + * @param bool $cdata */ - public static function xmlData($string, $cdata=false) - { + static function xmlData($string, $cdata=false) { $string = str_replace("]]>", "]]]]>", $string); - if (!$cdata) { + if (!$cdata) $string = ""; - } return $string; } - /** Returns compressed content of given CSS code - * @param string $code - * @return string */ + /** Returns compressed content of given CSS code + * @param string $code + * @return string */ - public static function compressCSS($code) - { + static function compressCSS($code) { $code = self::clearWhitespaces($code); $code = preg_replace('/ ?\{ ?/', "{", $code); $code = preg_replace('/ ?\} ?/', "}", $code); diff --git a/manager/media/browser/mcpuk/tpl/tpl_browser.php b/manager/media/browser/mcpuk/tpl/tpl_browser.php index caa1560b53..e16bcfb396 100755 --- a/manager/media/browser/mcpuk/tpl/tpl_browser.php +++ b/manager/media/browser/mcpuk/tpl/tpl_browser.php @@ -4,8 +4,8 @@ KCFinder: / <?php echo $this->session['dir'] ?> - - + + diff --git a/manager/media/browser/mcpuk/tpl/tpl_css.php b/manager/media/browser/mcpuk/tpl/tpl_css.php index baf4171682..dbf5d58e97 100755 --- a/manager/media/browser/mcpuk/tpl/tpl_css.php +++ b/manager/media/browser/mcpuk/tpl/tpl_css.php @@ -1,2 +1,2 @@ -cms}" : "") ?>" rel="stylesheet" type="text/css" /> +cms}" : "" ) ?>" rel="stylesheet" type="text/css" /> diff --git a/manager/media/browser/mcpuk/tpl/tpl_javascript.php b/manager/media/browser/mcpuk/tpl/tpl_javascript.php index b90a26b1c9..d43aa8f8b7 100755 --- a/manager/media/browser/mcpuk/tpl/tpl_javascript.php +++ b/manager/media/browser/mcpuk/tpl/tpl_javascript.php @@ -4,12 +4,12 @@ -opener['TinyMCE']) && $this->opener['TinyMCE']): ?> +opener['TinyMCE']) && $this->opener['TinyMCE']): ?> - -config['theme']}/init.js")): ?> + +config['theme']}/init.js")): ?> - + "; - } else { - echo $msg . "\n"; - } +function jsAlert($msg) { + $modx = evolutionCMS(); + if($_POST['ajax'] != 1) { + echo ""; + } else { + echo $msg . "\n"; + } } /** @@ -312,10 +311,9 @@ function jsAlert($msg) * @param string $dbasePassword * @return bool */ -function login($username, $givenPassword, $dbasePassword) -{ - $modx = evolutionCMS(); - return $modx->phpass->CheckPassword($givenPassword, $dbasePassword); +function login($username, $givenPassword, $dbasePassword) { + $modx = evolutionCMS(); + return $modx->phpass->CheckPassword($givenPassword, $dbasePassword); } /** @@ -325,28 +323,27 @@ function login($username, $givenPassword, $dbasePassword) * @param string $username * @return bool */ -function loginV1($internalKey, $givenPassword, $dbasePassword, $username) -{ - $modx = evolutionCMS(); +function loginV1($internalKey, $givenPassword, $dbasePassword, $username) { + $modx = evolutionCMS(); - $user_algo = $modx->manager->getV1UserHashAlgorithm($internalKey); + $user_algo = $modx->manager->getV1UserHashAlgorithm($internalKey); - if (!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) { - $modx->config['pwd_hash_algo'] = 'UNCRYPT'; - } + if(!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) { + $modx->config['pwd_hash_algo'] = 'UNCRYPT'; + } - if ($user_algo !== $modx->config['pwd_hash_algo']) { - $bk_pwd_hash_algo = $modx->config['pwd_hash_algo']; - $modx->config['pwd_hash_algo'] = $user_algo; - } + if($user_algo !== $modx->config['pwd_hash_algo']) { + $bk_pwd_hash_algo = $modx->config['pwd_hash_algo']; + $modx->config['pwd_hash_algo'] = $user_algo; + } - if ($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) { - return false; - } + if($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) { + return false; + } - updateNewHash($username, $givenPassword); + updateNewHash($username, $givenPassword); - return true; + return true; } /** @@ -356,28 +353,26 @@ function loginV1($internalKey, $givenPassword, $dbasePassword, $username) * @param string $username * @return bool */ -function loginMD5($internalKey, $givenPassword, $dbasePassword, $username) -{ - $modx = evolutionCMS(); - - if ($dbasePassword != md5($givenPassword)) { - return false; - } - updateNewHash($username, $givenPassword); - return true; +function loginMD5($internalKey, $givenPassword, $dbasePassword, $username) { + $modx = evolutionCMS(); + + if($dbasePassword != md5($givenPassword)) { + return false; + } + updateNewHash($username, $givenPassword); + return true; } /** * @param string $username * @param string $password */ -function updateNewHash($username, $password) -{ - $modx = evolutionCMS(); +function updateNewHash($username, $password) { + $modx = evolutionCMS(); - $field = array(); - $field['password'] = $modx->phpass->HashPassword($password); - $modx->db->update($field, '[+prefix+]manager_users', "username='{$username}'"); + $field = array(); + $field['password'] = $modx->phpass->HashPassword($password); + $modx->db->update($field, '[+prefix+]manager_users', "username='{$username}'"); } /** @@ -386,29 +381,28 @@ function updateNewHash($username, $password) * @param int $failed_allowed * @param int $blocked_minutes */ -function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes) -{ - $modx = evolutionCMS(); - - $failedlogins += 1; - - $fields = array('failedlogincount' => $failedlogins); - if ($failedlogins >= $failed_allowed) { //block user for too many fail attempts - - $fields['blockeduntil'] = time() + ($blocked_minutes * 60); - } - - $modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'"); - - if ($failedlogins < $failed_allowed) { - //sleep to help prevent brute force attacks - $sleep = (int) $failedlogins / 2; - if ($sleep > 5) { - $sleep = 5; - } - sleep($sleep); - } - @session_destroy(); - session_unset(); - return; +function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes) { + $modx = evolutionCMS(); + + $failedlogins += 1; + + $fields = array('failedlogincount' => $failedlogins); + if($failedlogins >= $failed_allowed) //block user for too many fail attempts + { + $fields['blockeduntil'] = time() + ($blocked_minutes * 60); + } + + $modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'"); + + if($failedlogins < $failed_allowed) { + //sleep to help prevent brute force attacks + $sleep = (int) $failedlogins / 2; + if($sleep > 5) { + $sleep = 5; + } + sleep($sleep); + } + @session_destroy(); + session_unset(); + return; } diff --git a/manager/processors/logout.processor.php b/manager/processors/logout.processor.php index d69b6d6900..7af6ff4518 100755 --- a/manager/processors/logout.processor.php +++ b/manager/processors/logout.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } @@ -9,10 +9,10 @@ // invoke OnBeforeManagerLogout event $modx->invokeEvent("OnBeforeManagerLogout", - array( - "userid" => $internalKey, - "username" => $username - )); + array( + "userid" => $internalKey, + "username" => $username + )); //// Unset all of the session variables. //$_SESSION = array(); @@ -35,10 +35,10 @@ // invoke OnManagerLogout event $modx->invokeEvent("OnManagerLogout", - array( - "userid" => $internalKey, - "username" => $username - )); + array( + "userid" => $internalKey, + "username" => $username + )); // show login screen header('Location: ' . MODX_MANAGER_URL); diff --git a/manager/processors/move_document.processor.php b/manager/processors/move_document.processor.php index d7fb93b55e..c0a8c390fd 100755 --- a/manager/processors/move_document.processor.php +++ b/manager/processors/move_document.processor.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('edit_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('edit_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $newParentID = isset($_REQUEST['new_parent']) ? (int)$_REQUEST['new_parent'] : 0; @@ -12,20 +12,12 @@ // ok, two things to check. // first, document cannot be moved to itself // second, new parent must be a folder. If not, set it to folder. -if ($documentID==$newParentID) { - $modx->webAlertAndQuit($_lang["error_movedocument1"]); -} -if ($documentID <= 0) { - $modx->webAlertAndQuit($_lang["error_movedocument2"]); -} -if ($newParentID < 0) { - $modx->webAlertAndQuit($_lang["error_movedocument2"]); -} +if($documentID==$newParentID) $modx->webAlertAndQuit($_lang["error_movedocument1"]); +if($documentID <= 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]); +if($newParentID < 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]); $parents = $modx->getParentIds($newParentID); -if (in_array($documentID, $parents)) { - $modx->webAlertAndQuit($_lang["error_movedocument2"]); -} +if (in_array($documentID, $parents)) $modx->webAlertAndQuit($_lang["error_movedocument2"]); $rs = $modx->db->select('parent', $modx->getFullTableName('site_content'), "id='{$documentID}'"); $oldparent = $modx->db->getValue($rs); @@ -33,86 +25,85 @@ // check user has permission to move document to chosen location if ($use_udperms == 1) { - if ($oldparent != $newParentID) { - include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php"; - $udperms = new udperms(); - $udperms->user = $modx->getLoginUserID(); - $udperms->document = $newParentID; - $udperms->role = $_SESSION['mgrRole']; - - if (!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_parent_denied"]); - } - } + if ($oldparent != $newParentID) { + include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php"; + $udperms = new udperms(); + $udperms->user = $modx->getLoginUserID(); + $udperms->document = $newParentID; + $udperms->role = $_SESSION['mgrRole']; + + if (!$udperms->checkPermissions()) { + $modx->webAlertAndQuit($_lang["access_permission_parent_denied"]); + } + } } /** * @param int $currDocID * @return array */ -function allChildren($currDocID) -{ - $modx = evolutionCMS(); - $children= array(); - $currDocID = $modx->db->escape($currDocID); - $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent = '{$currDocID}'"); - while ($child= $modx->db->getRow($rs)) { - $children[]= $child['id']; - $children= array_merge($children, allChildren($child['id'])); - } - return $children; +function allChildren($currDocID) { + $modx = evolutionCMS(); + $children= array(); + $currDocID = $modx->db->escape($currDocID); + $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent = '{$currDocID}'"); + while ($child= $modx->db->getRow($rs)) { + $children[]= $child['id']; + $children= array_merge($children, allChildren($child['id'])); + } + return $children; } -$evtOut = $modx->invokeEvent("onBeforeMoveDocument", array( - "id_document" => $documentID, - "old_parent" => $oldparent, - "new_parent" => $newParentID +$evtOut = $modx->invokeEvent("onBeforeMoveDocument", array ( + "id_document" => $documentID, + "old_parent" => $oldparent, + "new_parent" => $newParentID )); -if (is_array($evtOut) && count($evtOut) > 0) { - $newParent = array_pop($evtOut); - if ($newParent == $oldparent) { - $modx->webAlertAndQuit($_lang["error_movedocument2"]); - } else { - $newParentID = $newParent; - } +if (is_array($evtOut) && count($evtOut) > 0){ + $newParent = array_pop($evtOut); + if($newParent == $oldparent) { + $modx->webAlertAndQuit($_lang["error_movedocument2"]); + }else{ + $newParentID = $newParent; + } } $children = allChildren($documentID); if (!array_search($newParentID, $children)) { - $modx->db->update(array( - 'isfolder' => 1, - ), $modx->getFullTableName('site_content'), "id='{$newParentID}'"); - - $modx->db->update(array( - 'parent' => $newParentID, - 'editedby' => $modx->getLoginUserID(), - 'editedon' => time(), - ), $modx->getFullTableName('site_content'), "id='{$documentID}'"); - - // finished moving the document, now check to see if the old_parent should no longer be a folder. - $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('site_content'), "parent='{$oldparent}'"); - $limit = $modx->db->getValue($rs); - - if (!$limit>0) { - $modx->db->update(array( - 'isfolder' => 0, - ), $modx->getFullTableName('site_content'), "id='{$oldparent}'"); - } - // Set the item name for logger - $pagetitle = $modx->db->getValue($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "id='{$documentID}'")); - $_SESSION['itemname'] = $pagetitle; - - $modx->invokeEvent("onAfterMoveDocument", array( - "id_document" => $documentID, - "old_parent" => $oldparent, - "new_parent" => $newParentID - )); - - // empty cache & sync site - $modx->clearCache('full'); - - $header="Location: index.php?a=3&id={$documentID}&r=9"; - header($header); + $modx->db->update(array( + 'isfolder' => 1, + ), $modx->getFullTableName('site_content'), "id='{$newParentID}'"); + + $modx->db->update(array( + 'parent' => $newParentID, + 'editedby' => $modx->getLoginUserID(), + 'editedon' => time(), + ), $modx->getFullTableName('site_content'), "id='{$documentID}'"); + + // finished moving the document, now check to see if the old_parent should no longer be a folder. + $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('site_content'), "parent='{$oldparent}'"); + $limit = $modx->db->getValue($rs); + + if(!$limit>0) { + $modx->db->update(array( + 'isfolder' => 0, + ), $modx->getFullTableName('site_content'), "id='{$oldparent}'"); + } + // Set the item name for logger + $pagetitle = $modx->db->getValue($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "id='{$documentID}'")); + $_SESSION['itemname'] = $pagetitle; + + $modx->invokeEvent("onAfterMoveDocument", array ( + "id_document" => $documentID, + "old_parent" => $oldparent, + "new_parent" => $newParentID + )); + + // empty cache & sync site + $modx->clearCache('full'); + + $header="Location: index.php?a=3&id={$documentID}&r=9"; + header($header); } else { - $modx->webAlertAndQuit("You cannot move a document to a child document!"); + $modx->webAlertAndQuit("You cannot move a document to a child document!"); } diff --git a/manager/processors/optimize_table.processor.php b/manager/processors/optimize_table.processor.php index ddcc8755ea..4a971a7e4a 100755 --- a/manager/processors/optimize_table.processor.php +++ b/manager/processors/optimize_table.processor.php @@ -1,31 +1,35 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!($modx->hasPermission('settings') && ($modx->hasPermission('logs')||$modx->hasPermission('bk_manager')))) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!($modx->hasPermission('settings') && ($modx->hasPermission('logs')||$modx->hasPermission('bk_manager')))) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } if (isset($_REQUEST['t'])) { - if (empty($_REQUEST['t'])) { - $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]); - } - // Set the item name for logger - $_SESSION['itemname'] = $_REQUEST['t']; + if (empty($_REQUEST['t'])) { + $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]); + } + + // Set the item name for logger + $_SESSION['itemname'] = $_REQUEST['t']; + + $modx->db->optimize($_REQUEST['t']); - $modx->db->optimize($_REQUEST['t']); } elseif (isset($_REQUEST['u'])) { - if (empty($_REQUEST['u'])) { - $modx->webAlertAndQuit($_lang["error_no_truncate_tablename"]); - } - // Set the item name for logger - $_SESSION['itemname'] = $_REQUEST['u']; + if (empty($_REQUEST['u'])) { + $modx->webAlertAndQuit($_lang["error_no_truncate_tablename"]); + } + + // Set the item name for logger + $_SESSION['itemname'] = $_REQUEST['u']; + + $modx->db->truncate($_REQUEST['u']); - $modx->db->truncate($_REQUEST['u']); } else { - $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]); + $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]); } $mode = (int)$_REQUEST['mode']; diff --git a/manager/processors/publish_content.processor.php b/manager/processors/publish_content.processor.php index 235d39e791..87e66c07f7 100755 --- a/manager/processors/publish_content.processor.php +++ b/manager/processors/publish_content.processor.php @@ -1,14 +1,14 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('save_document')||!$modx->hasPermission('publish_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('save_document')||!$modx->hasPermission('publish_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id'])? (int)$_REQUEST['id'] : 0; -if ($id==0) { - $modx->webAlertAndQuit($_lang["error_no_id"]); +if($id==0) { + $modx->webAlertAndQuit($_lang["error_no_id"]); } /************webber ********/ @@ -16,10 +16,10 @@ $pid=($content['parent']==0?$id:$content['parent']); /************** webber *************/ -$sd=isset($_REQUEST['dir'])?'&dir=' . $_REQUEST['dir']:'&dir=DESC'; -$sb=isset($_REQUEST['sort'])?'&sort=' . $_REQUEST['sort']:'&sort=createdon'; -$pg=isset($_REQUEST['page'])?'&page=' . (int)$_REQUEST['page']:''; -$add_path=$sd . $sb . $pg; +$sd=isset($_REQUEST['dir'])?'&dir='.$_REQUEST['dir']:'&dir=DESC'; +$sb=isset($_REQUEST['sort'])?'&sort='.$_REQUEST['sort']:'&sort=createdon'; +$pg=isset($_REQUEST['page'])?'&page='.(int)$_REQUEST['page']:''; +$add_path=$sd.$sb.$pg; /***********************************/ @@ -32,24 +32,24 @@ $udperms->document = $id; $udperms->role = $_SESSION['mgrRole']; -if (!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); +if(!$udperms->checkPermissions()) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); } // update the document $modx->db->update( - array( - 'published' => 1, - 'pub_date' => 0, - 'unpub_date' => 0, - 'editedby' => $modx->getLoginUserID(), - 'editedon' => time(), - 'publishedby' => $modx->getLoginUserID(), - 'publishedon' => time(), - ), $modx->getFullTableName('site_content'), "id='{$id}'"); + array( + 'published' => 1, + 'pub_date' => 0, + 'unpub_date' => 0, + 'editedby' => $modx->getLoginUserID(), + 'editedon' => time(), + 'publishedby' => $modx->getLoginUserID(), + 'publishedon' => time(), + ), $modx->getFullTableName('site_content'), "id='{$id}'"); // invoke OnDocPublished event -$modx->invokeEvent("OnDocPublished", array("docid"=>$id)); +$modx->invokeEvent("OnDocPublished",array("docid"=>$id)); // Set the item name for logger $_SESSION['itemname'] = $content['pagetitle']; @@ -57,6 +57,6 @@ // empty cache $modx->clearCache('full'); -$header="Location: index.php?a=3&id=$pid&r=1" . $add_path; +$header="Location: index.php?a=3&id=$pid&r=1".$add_path; header($header); diff --git a/manager/processors/purge_plugin.processor.php b/manager/processors/purge_plugin.processor.php index 7df736a632..2e31e0092a 100755 --- a/manager/processors/purge_plugin.processor.php +++ b/manager/processors/purge_plugin.processor.php @@ -1,11 +1,11 @@ hasPermission('delete_plugin')) { - $e->setError(3); - $e->dumpError(); +if(!$modx->hasPermission('delete_plugin')) { + $e->setError(3); + $e->dumpError(); } $tbl_site_plugins = $modx->getFullTablename('site_plugins'); @@ -14,19 +14,18 @@ // Get unique list of latest added plugins by highest sql-id $rs = $modx->db->query("SELECT t1.id FROM {$tbl_site_plugins} t1 LEFT JOIN {$tbl_site_plugins} t2 ON (t1.name = t2.name AND t1.id < t2.id) WHERE t2.id IS NULL;"); $latestIds = array(); -while ($row = $modx->db->getRow($rs)) { +while($row = $modx->db->getRow($rs)) { $latestIds[] = $row['id']; } // Get list of plugins with disabled and enabled versions $rs = $modx->db->query("SELECT id FROM {$tbl_site_plugins} t1 WHERE disabled = 1 AND name IN (SELECT name FROM {$tbl_site_plugins} t2 WHERE t1.name = t2.name AND t1.id != t2.id)"); -while ($row = $modx->db->getRow($rs)) { +while($row = $modx->db->getRow($rs)) { + $id = $row['id']; - if (in_array($id, $latestIds)) { - continue; - } // Keep latest version of disabled plugins + if(in_array($id,$latestIds)) continue; // Keep latest version of disabled plugins // invoke OnBeforePluginFormDelete event $modx->invokeEvent('OnBeforePluginFormDelete', array('id'=> $id)); diff --git a/manager/processors/remove_content.processor.php b/manager/processors/remove_content.processor.php index 495568b41d..d55584c60f 100755 --- a/manager/processors/remove_content.processor.php +++ b/manager/processors/remove_content.processor.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('delete_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('delete_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "deleted=1"); @@ -11,36 +11,36 @@ // invoke OnBeforeEmptyTrash event $modx->invokeEvent("OnBeforeEmptyTrash", - array( - "ids"=>$ids - )); + array( + "ids"=>$ids + )); // remove the document groups link. $sql = "DELETE document_groups - FROM " . $modx->getFullTableName('document_groups') . " AS document_groups - INNER JOIN " . $modx->getFullTableName('site_content') . " AS site_content ON site_content.id = document_groups.document + FROM ".$modx->getFullTableName('document_groups')." AS document_groups + INNER JOIN ".$modx->getFullTableName('site_content')." AS site_content ON site_content.id = document_groups.document WHERE site_content.deleted=1"; $modx->db->query($sql); // remove the TV content values. $sql = "DELETE site_tmplvar_contentvalues - FROM " . $modx->getFullTableName('site_tmplvar_contentvalues') . " AS site_tmplvar_contentvalues - INNER JOIN " . $modx->getFullTableName('site_content') . " AS site_content ON site_content.id = site_tmplvar_contentvalues.contentid + FROM ".$modx->getFullTableName('site_tmplvar_contentvalues')." AS site_tmplvar_contentvalues + INNER JOIN ".$modx->getFullTableName('site_content')." AS site_content ON site_content.id = site_tmplvar_contentvalues.contentid WHERE site_content.deleted=1"; $modx->db->query($sql); //'undelete' the document. $modx->db->delete($modx->getFullTableName('site_content'), "deleted=1"); - // invoke OnEmptyTrash event - $modx->invokeEvent("OnEmptyTrash", - array( - "ids"=>$ids - )); + // invoke OnEmptyTrash event + $modx->invokeEvent("OnEmptyTrash", + array( + "ids"=>$ids + )); - // empty cache - $modx->clearCache('full'); + // empty cache + $modx->clearCache('full'); - // finished emptying cache - redirect - $header="Location: index.php?a=2&r=1"; - header($header); + // finished emptying cache - redirect + $header="Location: index.php?a=2&r=1"; + header($header); diff --git a/manager/processors/remove_installer.processor.php b/manager/processors/remove_installer.processor.php index 519f8f7958..c2d758d84d 100755 --- a/manager/processors/remove_installer.processor.php +++ b/manager/processors/remove_installer.processor.php @@ -13,18 +13,14 @@ */ $msg =''; -$pth = dirname(dirname(dirname(__FILE__))) . "/install/"; -$pth = str_replace("\\", "/", $pth); -if (isset($_GET["rminstall"])) { - if (is_dir($pth)) { - if (!rmdirRecursive($pth)) { - $msg="An error occured while attempting to remove the install folder"; - } - } -} -if ($msg) { - echo ""; +$pth = dirname(dirname(dirname(__FILE__)))."/install/"; +$pth = str_replace("\\","/",$pth); +if(isset($_GET["rminstall"])) { + if(is_dir($pth)) { + if(!rmdirRecursive($pth)) $msg="An error occured while attempting to remove the install folder"; + } } +if($msg) echo ""; echo ""; /** @@ -34,16 +30,16 @@ * @param bool $followLinks * @return bool */ -function rmdirRecursive($path, $followLinks=false) -{ - $dir = opendir($path) ; - while ($entry = readdir($dir)) { - if (is_file("$path/$entry") || ((!$followLinks) && is_link("$path/$entry"))) { - @unlink("$path/$entry"); - } elseif (is_dir("$path/$entry") && $entry!='.' && $entry!='..') { - rmdirRecursive("$path/$entry"); // recursive - } - } - closedir($dir); - return @rmdir($path); +function rmdirRecursive($path, $followLinks=false) { + $dir = opendir($path) ; + while ($entry = readdir($dir)) { + if (is_file("$path/$entry") || ((!$followLinks) && is_link("$path/$entry"))) { + @unlink( "$path/$entry" ); + } + elseif (is_dir("$path/$entry") && $entry!='.' && $entry!='..') { + rmdirRecursive("$path/$entry"); // recursive + } + } + closedir($dir); + return @rmdir($path); } diff --git a/manager/processors/remove_locks.processor.php b/manager/processors/remove_locks.processor.php index 0b4d3218ea..5808378f9e 100755 --- a/manager/processors/remove_locks.processor.php +++ b/manager/processors/remove_locks.processor.php @@ -1,28 +1,26 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!isset($_GET['id'])) { - if (!$modx->hasPermission('remove_locks')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); - } +if(!isset($_GET['id'])) { + if(!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]); - // Remove all locks - $modx->db->truncate($modx->getFullTableName('active_user_locks')); + // Remove all locks + $modx->db->truncate($modx->getFullTableName('active_user_locks')); - $header = "Location: index.php?a=2"; - header($header); + $header = "Location: index.php?a=2"; + header($header); } else { - // Remove single locks via AJAX / window.onbeforeunload - $type = (int)$_GET['type']; - $id = (int)$_GET['id']; - $includeAllUsers = $modx->hasPermission('remove_locks'); // Enables usage of "unlock"-ajax-button - if ($type && $id) { - $modx->unlockElement($type, $id, $includeAllUsers); - echo '1'; - exit; - } else { - echo 'No type or id sent with request.'; - } + // Remove single locks via AJAX / window.onbeforeunload + $type = (int)$_GET['type']; + $id = (int)$_GET['id']; + $includeAllUsers = $modx->hasPermission('remove_locks'); // Enables usage of "unlock"-ajax-button + if($type && $id) { + $modx->unlockElement($type, $id, $includeAllUsers); + echo '1'; + exit; + } else { + echo 'No type or id sent with request.'; + } } diff --git a/manager/processors/save_content.processor.php b/manager/processors/save_content.processor.php index e311e6505d..942e2dbc18 100755 --- a/manager/processors/save_content.processor.php +++ b/manager/processors/save_content.processor.php @@ -36,10 +36,10 @@ $aliasvisible = $_POST['alias_visible']; /************* webber ********/ -$sd = isset($_POST['dir']) ? '&dir=' . $_POST['dir'] : '&dir=DESC'; -$sb = isset($_POST['sort']) ? '&sort=' . $_POST['sort'] : '&sort=pub_date'; -$pg = isset($_POST['page']) ? '&page=' . (int) $_POST['page'] : ''; -$add_path = $sd . $sb . $pg; +$sd = isset($_POST['dir']) ? '&dir='.$_POST['dir'] : '&dir=DESC'; +$sb = isset($_POST['sort']) ? '&sort='.$_POST['sort'] : '&sort=pub_date'; +$pg = isset($_POST['page']) ? '&page='.(int) $_POST['page'] : ''; +$add_path = $sd.$sb.$pg; @@ -134,26 +134,28 @@ } //end webber } -} elseif ($alias) { +} +elseif ($alias) { $alias = $modx->stripAlias($alias); } // determine published status $currentdate = $_SERVER['REQUEST_TIME'] + $modx->config['server_offset_time']; -if (empty($pub_date)) { +if (empty ($pub_date)) { $pub_date = 0; } else { $pub_date = $modx->toTimeStamp($pub_date); if ($pub_date < $currentdate) { $published = 1; - } elseif ($pub_date > $currentdate) { + } + elseif ($pub_date > $currentdate) { $published = 0; } } -if (empty($unpub_date)) { +if (empty ($unpub_date)) { $unpub_date = 0; } else { $unpub_date = $modx->toTimeStamp($unpub_date); @@ -193,15 +195,15 @@ INNER JOIN {$tbl_site_tmplvar_templates} AS tvtpl ON tvtpl.tmplvarid = tv.id LEFT JOIN {$tbl_site_tmplvar_contentvalues} AS tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$id}' LEFT JOIN {$tbl_site_tmplvar_access} AS tva ON tva.tmplvarid=tv.id", - "tvtpl.templateid = '{$template}' AND (1='{$_SESSION['mgrRole']}' OR ISNULL(tva.documentgroup)" . ((!$docgrp) ? "" : " OR tva.documentgroup IN ($docgrp)") . ")", + "tvtpl.templateid = '{$template}' AND (1='{$_SESSION['mgrRole']}' OR ISNULL(tva.documentgroup)".((!$docgrp) ? "" : " OR tva.documentgroup IN ($docgrp)").")", "tv.rank" ); while ($row = $modx->db->getRow($rs)) { $tmplvar = ''; switch ($row['type']) { case 'url': - $tmplvar = $_POST["tv" . $row['id']]; - if ($_POST["tv" . $row['id'] . '_prefix'] != '--') { + $tmplvar = $_POST["tv".$row['id']]; + if ($_POST["tv".$row['id'].'_prefix'] != '--') { $tmplvar = str_replace(array( "feed://", "ftp://", @@ -209,23 +211,23 @@ "https://", "mailto:" ), "", $tmplvar); - $tmplvar = $_POST["tv" . $row['id'] . '_prefix'] . $tmplvar; + $tmplvar = $_POST["tv".$row['id'].'_prefix'].$tmplvar; } break; case 'file': - $tmplvar = $_POST["tv" . $row['id']]; + $tmplvar = $_POST["tv".$row['id']]; break; default: - if (is_array($_POST["tv" . $row['id']])) { + if (is_array($_POST["tv".$row['id']])) { // handles checkboxes & multiple selects elements $feature_insert = array(); - $lst = $_POST["tv" . $row['id']]; - while (list($featureValue, $feature_item) = each($lst)) { + $lst = $_POST["tv".$row['id']]; + while (list ($featureValue, $feature_item) = each($lst)) { $feature_insert[count($feature_insert)] = $feature_item; } $tmplvar = implode("||", $feature_insert); } else { - $tmplvar = $_POST["tv" . $row['id']]; + $tmplvar = $_POST["tv".$row['id']]; } break; } @@ -248,12 +250,13 @@ if (!$existingDocument) { $modx->webAlertAndQuit($_lang["error_no_results"]); } + } // check to see if the user is allowed to save the document in the place he wants to save it in if ($use_udperms == 1) { if ($existingDocument['parent'] != $parent) { - include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php"; + include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php"; $udperms = new udperms(); $udperms->user = $modx->getLoginUserID(); $udperms->document = $parent; @@ -272,10 +275,11 @@ } switch ($actionToTake) { - case 'new': + case 'new' : // invoke OnBeforeDocFormSave event - switch ($modx->config['docid_incrmnt_method']) { + switch($modx->config['docid_incrmnt_method']) + { case '1': $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id"; $where = "T1.id IS NULL"; @@ -343,9 +347,8 @@ "alias_visible" => $aliasvisible ); - if ($id != '') { + if ($id != '') $dbInsert["id"] = $id; - } $key = $modx->db->insert($dbInsert, $tbl_site_content); @@ -369,11 +372,11 @@ foreach ($document_groups as $value_pair) { // first, split the pair (this is a new document, so ignore the second value list($group) = explode(',', $value_pair); // @see actions/mutate_content.dynamic.php @ line 1138 (permissions list) - $new_groups[] = '(' . (int) $group . ',' . $key . ')'; + $new_groups[] = '('.(int) $group.','.$key.')'; } $saved = true; if (!empty($new_groups)) { - $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES " . implode(',', $new_groups)); + $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES ".implode(',', $new_groups)); } } else { $isManager = $modx->hasPermission('access_permissions'); @@ -403,11 +406,11 @@ )); // secure web documents - flag as private - include MODX_MANAGER_PATH . "includes/secure_web_documents.inc.php"; + include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php"; secureWebDocument($key); // secure manager documents - flag as private - include MODX_MANAGER_PATH . "includes/secure_mgr_documents.inc.php"; + include MODX_MANAGER_PATH."includes/secure_mgr_documents.inc.php"; secureMgrDocument($key); // Set the item name for logger @@ -421,14 +424,12 @@ // redirect/stay options if ($_POST['stay'] != '') { // weblink - if ($_POST['mode'] == "72") { + if ($_POST['mode'] == "72") $a = ($_POST['stay'] == '2') ? "27&id=$key" : "72&pid=$parent"; - } // document - if ($_POST['mode'] == "4") { + if ($_POST['mode'] == "4") $a = ($_POST['stay'] == '2') ? "27&id=$key" : "4&pid=$parent"; - } - $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay']; + $header = "Location: index.php?a=".$a."&r=1&stay=".$_POST['stay']; } else { $header = "Location: index.php?a=3&id=$key&r=1"; } @@ -442,7 +443,7 @@ break; - case 'edit': + case 'edit' : // get the document's current parent $oldparent = $existingDocument['parent']; @@ -488,10 +489,10 @@ if (!$was_published && $published) { $publishedon = $currentdate; $publishedby = $modx->getLoginUserID(); - } elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { + }elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { $publishedon = $pub_date; $publishedby = $modx->getLoginUserID(); - } elseif ($was_published && !$published) { + }elseif ($was_published && !$published) { $publishedon = 0; $publishedby = 0; } else { @@ -500,7 +501,7 @@ } // invoke OnBeforeDocFormSave event - $modx->invokeEvent("OnBeforeDocFormSave", array( + $modx->invokeEvent("OnBeforeDocFormSave", array ( "mode" => "upd", "id" => $id )); @@ -534,11 +535,12 @@ . "donthit={$donthit}, " . "menutitle='{$menutitle}', " . "hidemenu={$hidemenu}, " - . "alias_visible={$aliasvisible}", $tbl_site_content, "id='{$id}'"); + . "alias_visible={$aliasvisible}" + , $tbl_site_content, "id='{$id}'"); // update template variables $rs = $modx->db->select('id, tmplvarid', $tbl_site_tmplvar_contentvalues, "contentid='{$id}'"); - $tvIds = array(); + $tvIds = array (); while ($row = $modx->db->getRow($rs)) { $tvIds[$row['tmplvarid']] = $row['id']; } @@ -546,9 +548,7 @@ $tvChanges = array(); foreach ($tmplvars as $field => $value) { if (!is_array($value)) { - if (isset($tvIds[$value])) { - $tvDeletions[] = $tvIds[$value]; - } + if (isset($tvIds[$value])) $tvDeletions[] = $tvIds[$value]; } else { $tvId = $value[0]; $tvVal = $value[1]; @@ -562,7 +562,7 @@ } if (!empty($tvDeletions)) { - $modx->db->delete($tbl_site_tmplvar_contentvalues, 'id IN(' . implode(',', $tvDeletions) . ')'); + $modx->db->delete($tbl_site_tmplvar_contentvalues, 'id IN('.implode(',', $tvDeletions).')'); } if (!empty($tvAdded)) { @@ -593,12 +593,10 @@ 'groups.id, groups.document_group', "{$tbl_document_groups} AS groups LEFT JOIN {$tbl_documentgroup_names} AS dgn ON dgn.id = groups.document_group", - "((1=" . (int)$isManager . " AND dgn.private_memgroup) OR (1=" . (int)$isWeb . " AND dgn.private_webgroup)) AND groups.document = '{$id}'" + "((1=".(int)$isManager." AND dgn.private_memgroup) OR (1=".(int)$isWeb." AND dgn.private_webgroup)) AND groups.document = '{$id}'" ); $old_groups = array(); - while ($row = $modx->db->getRow($rs)) { - $old_groups[$row['document_group']] = $row['id']; - } + while ($row = $modx->db->getRow($rs)) $old_groups[$row['document_group']] = $row['id']; // update the permissions in the database $insertions = $deletions = array(); @@ -607,14 +605,14 @@ unset($old_groups[$group]); continue; } elseif ($link_id == 'new') { - $insertions[] = '(' . (int)$group . ',' . $id . ')'; + $insertions[] = '('.(int)$group.','.$id.')'; } } if (!empty($insertions)) { - $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES " . implode(',', $insertions)); + $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES ".implode(',', $insertions)); } if (!empty($old_groups)) { - $modx->db->delete($tbl_document_groups, "id IN (" . implode(',', $old_groups) . ")"); + $modx->db->delete($tbl_document_groups, "id IN (".implode(',', $old_groups).")"); } // necessary to remove all permissions as document is public if ((isset($_POST['chkalldocs']) && $_POST['chkalldocs'] == 'on')) { @@ -639,7 +637,7 @@ // invoke OnDocFormSave event - $modx->invokeEvent("OnDocFormSave", array( + $modx->invokeEvent("OnDocFormSave", array ( "mode" => "upd", "id" => $id )); @@ -660,9 +658,9 @@ $modx->clearCache('full'); } - if ($_POST['refresh_preview'] == '1') { - $header = "Location: " . MODX_SITE_URL . "index.php?id=$id&z=manprev"; - } else { + if ($_POST['refresh_preview'] == '1') + $header = "Location: ".MODX_SITE_URL."index.php?id=$id&z=manprev"; + else { if ($_POST['stay'] != '2' && $id > 0) { $modx->unlockElement(7, $id); } @@ -675,18 +673,18 @@ // document $a = ($_POST['stay'] == '2') ? "27&id=$id" : "4&pid=$parent"; } - $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay'] . $add_path; + $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay'].$add_path; } else { - $header = "Location: index.php?a=3&id=$id&r=1" . $add_path; + $header = "Location: index.php?a=3&id=$id&r=1".$add_path; } } if (headers_sent()) { - $header = str_replace('Location: ', '', $header); + $header = str_replace('Location: ','',$header); echo "\n"; } else { header($header); } break; - default: + default : $modx->webAlertAndQuit("No operation set in request."); } diff --git a/manager/processors/save_htmlsnippet.processor.php b/manager/processors/save_htmlsnippet.processor.php index ff40879a34..f23421ba90 100755 --- a/manager/processors/save_htmlsnippet.processor.php +++ b/manager/processors/save_htmlsnippet.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_chunk')) { diff --git a/manager/processors/save_module.processor.php b/manager/processors/save_module.processor.php index 1e12674098..ada5f818de 100755 --- a/manager/processors/save_module.processor.php +++ b/manager/processors/save_module.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_module')) { diff --git a/manager/processors/save_password.processor.php b/manager/processors/save_password.processor.php index a99d264c83..c9db342473 100755 --- a/manager/processors/save_password.processor.php +++ b/manager/processors/save_password.processor.php @@ -1,36 +1,36 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('save_password')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('save_password')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = $_POST['id']; $pass1 = $_POST['pass1']; $pass2 = $_POST['pass2']; -if ($pass1!=$pass2) { - $modx->webAlertAndQuit("Passwords don't match!"); +if($pass1!=$pass2){ + $modx->webAlertAndQuit("Passwords don't match!"); } -if (strlen($pass1)<6) { - $modx->webAlertAndQuit("Password is too short. Please specify a password of at least 6 characters."); +if(strlen($pass1)<6){ + $modx->webAlertAndQuit("Password is too short. Please specify a password of at least 6 characters."); } $pass1 = $modx->htmlspecialchars($pass1, ENT_NOQUOTES); - $tbl_manager_users = $modx->getFullTableName('manager_users'); - $uid = $modx->getLoginUserID(); - $modx->loadExtension('phpass'); - $f['password'] = $modx->phpass->HashPassword($pass1); - $modx->db->update($f, $tbl_manager_users, "id='{$uid}'"); + $tbl_manager_users = $modx->getFullTableName('manager_users'); + $uid = $modx->getLoginUserID(); + $modx->loadExtension('phpass'); + $f['password'] = $modx->phpass->HashPassword($pass1); + $modx->db->update($f,$tbl_manager_users,"id='{$uid}'"); - // invoke OnManagerChangePassword event - $modx->invokeEvent('OnManagerChangePassword', array( - 'userid' => $uid, - 'username' => $_SESSION['mgrShortname'], - 'userpassword' => $pass1 - )); + // invoke OnManagerChangePassword event + $modx->invokeEvent('OnManagerChangePassword', array ( + 'userid' => $uid, + 'username' => $_SESSION['mgrShortname'], + 'userpassword' => $pass1 + )); $header="Location: index.php?a=2"; header($header); diff --git a/manager/processors/save_plugin.processor.php b/manager/processors/save_plugin.processor.php index e0edf20e1b..1d25a72b8e 100755 --- a/manager/processors/save_plugin.processor.php +++ b/manager/processors/save_plugin.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly.'); } if (!$modx->hasPermission('save_plugin')) { @@ -177,9 +177,7 @@ function saveEventListeners($id, $sysevents, $mode) // save selected system events $formEventList = array(); foreach ($sysevents as $evtId) { - if (!preg_match('@^[1-9][0-9]*$@', $evtId)) { - $evtId = getEventIdByName($evtId); - } + if(!preg_match('@^[1-9][0-9]*$@',$evtId)) $evtId = getEventIdByName($evtId); if ($mode == '101') { $rs = $modx->db->select('max(priority) as priority', '[+prefix+]site_plugin_events', "evtid='{$evtId}'"); } else { @@ -204,17 +202,13 @@ function saveEventListeners($id, $sysevents, $mode) $rs = $modx->db->select('*', '[+prefix+]site_plugin_events', sprintf("pluginid='%s'", $id)); $dbEventList = array(); $del = array(); - while ($row = $modx->db->getRow($rs)) { - if (!in_array($row['evtid'], $evtids)) { - $del[] = $row['evtid']; - } + while($row = $modx->db->getRow($rs)) { + if(!in_array($row['evtid'], $evtids)) $del[] = $row['evtid']; } - if (empty($del)) { - return; - } + if(empty($del)) return; - foreach ($del as $delid) { + foreach($del as $delid) { $modx->db->delete('[+prefix+]site_plugin_events', sprintf("evtid='%s' AND pluginid='%s'", $delid, $id)); } } @@ -228,9 +222,7 @@ function getEventIdByName($name) $modx = evolutionCMS(); static $eventIds=array(); - if (isset($eventIds[$name])) { - return $eventIds[$name]; - } + if(isset($eventIds[$name])) return $eventIds[$name]; $rs = $modx->db->select('id, name', '[+prefix+]system_eventnames'); while ($row = $modx->db->getRow($rs)) { @@ -239,3 +231,4 @@ function getEventIdByName($name) return $eventIds[$name]; } + diff --git a/manager/processors/save_role.processor.php b/manager/processors/save_role.processor.php index 45c6398b35..1d4f55c83a 100755 --- a/manager/processors/save_role.processor.php +++ b/manager/processors/save_role.processor.php @@ -1,135 +1,135 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('save_role')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('save_role')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } extract($_POST); -if ($name == '' || !isset($name)) { - $modx->webAlertAndQuit("Please enter a name for this role!", "index.php?a={$mode}" . ($mode = 35 ? "&id={$id}" : "")); +if($name == '' || !isset ($name)) { + $modx->webAlertAndQuit("Please enter a name for this role!", "index.php?a={$mode}" . ($mode = 35 ? "&id={$id}" : "")); } // setup fields $fields = array( - 'name' => $name, - 'description' => $description, - 'frames' => $frames, - 'home' => $home, - 'view_document' => $view_document, - 'new_document' => $new_document, - 'save_document' => $save_document, - 'publish_document' => $publish_document, - 'delete_document' => $delete_document, - 'empty_trash' => $empty_trash, - 'action_ok' => $action_ok, - 'logout' => $logout, - 'help' => $help, - 'messages' => $messages, - 'new_user' => $new_user, - 'edit_user' => $edit_user, - 'logs' => $logs, - 'edit_parser' => (isset($edit_parser)) ? $edit_parser : '0', - 'save_parser' => (isset($save_parser)) ? $save_parser : '0', - 'edit_template' => $edit_template, - 'settings' => $settings, - 'credits' => $credits, - 'new_template' => $new_template, - 'save_template' => $save_template, - 'delete_template' => $delete_template, - 'edit_snippet' => $edit_snippet, - 'new_snippet' => $new_snippet, - 'save_snippet' => $save_snippet, - 'delete_snippet' => $delete_snippet, - 'edit_chunk' => $edit_chunk, - 'new_chunk' => $new_chunk, - 'save_chunk' => $save_chunk, - 'delete_chunk' => $delete_chunk, - 'empty_cache' => $empty_cache, - 'edit_document' => $edit_document, - 'change_password' => $change_password, - 'error_dialog' => $error_dialog, - 'about' => $about, - 'file_manager' => $file_manager, - 'assets_files' => $assets_files, - 'assets_images' => $assets_images, - 'save_user' => $save_user, - 'delete_user' => $delete_user, - 'save_password' => $save_password, - 'edit_role' => $edit_role, - 'save_role' => $save_role, - 'delete_role' => $delete_role, - 'new_role' => $new_role, - 'access_permissions' => $access_permissions, - 'bk_manager' => $bk_manager, - 'new_plugin' => $new_plugin, - 'edit_plugin' => $edit_plugin, - 'save_plugin' => $save_plugin, - 'delete_plugin' => $delete_plugin, - 'new_module' => $new_module, - 'edit_module' => $edit_module, - 'save_module' => $save_module, - 'delete_module' => $delete_module, - 'exec_module' => $exec_module, - 'view_eventlog' => $view_eventlog, - 'delete_eventlog' => $delete_eventlog, - 'new_web_user' => $new_web_user, - 'edit_web_user' => $edit_web_user, - 'save_web_user' => $save_web_user, - 'delete_web_user' => $delete_web_user, - 'web_access_permissions' => $web_access_permissions, - 'view_unpublished' => $view_unpublished, - 'import_static' => $import_static, - 'export_static' => $export_static, - 'remove_locks' => $remove_locks, - 'display_locks' => $display_locks, - 'change_resourcetype' => $change_resourcetype, - 'category_manager' => $category_manager + 'name' => $name, + 'description' => $description, + 'frames' => $frames, + 'home' => $home, + 'view_document' => $view_document, + 'new_document' => $new_document, + 'save_document' => $save_document, + 'publish_document' => $publish_document, + 'delete_document' => $delete_document, + 'empty_trash' => $empty_trash, + 'action_ok' => $action_ok, + 'logout' => $logout, + 'help' => $help, + 'messages' => $messages, + 'new_user' => $new_user, + 'edit_user' => $edit_user, + 'logs' => $logs, + 'edit_parser' => (isset ($edit_parser)) ? $edit_parser : '0', + 'save_parser' => (isset ($save_parser)) ? $save_parser : '0', + 'edit_template' => $edit_template, + 'settings' => $settings, + 'credits' => $credits, + 'new_template' => $new_template, + 'save_template' => $save_template, + 'delete_template' => $delete_template, + 'edit_snippet' => $edit_snippet, + 'new_snippet' => $new_snippet, + 'save_snippet' => $save_snippet, + 'delete_snippet' => $delete_snippet, + 'edit_chunk' => $edit_chunk, + 'new_chunk' => $new_chunk, + 'save_chunk' => $save_chunk, + 'delete_chunk' => $delete_chunk, + 'empty_cache' => $empty_cache, + 'edit_document' => $edit_document, + 'change_password' => $change_password, + 'error_dialog' => $error_dialog, + 'about' => $about, + 'file_manager' => $file_manager, + 'assets_files' => $assets_files, + 'assets_images' => $assets_images, + 'save_user' => $save_user, + 'delete_user' => $delete_user, + 'save_password' => $save_password, + 'edit_role' => $edit_role, + 'save_role' => $save_role, + 'delete_role' => $delete_role, + 'new_role' => $new_role, + 'access_permissions' => $access_permissions, + 'bk_manager' => $bk_manager, + 'new_plugin' => $new_plugin, + 'edit_plugin' => $edit_plugin, + 'save_plugin' => $save_plugin, + 'delete_plugin' => $delete_plugin, + 'new_module' => $new_module, + 'edit_module' => $edit_module, + 'save_module' => $save_module, + 'delete_module' => $delete_module, + 'exec_module' => $exec_module, + 'view_eventlog' => $view_eventlog, + 'delete_eventlog' => $delete_eventlog, + 'new_web_user' => $new_web_user, + 'edit_web_user' => $edit_web_user, + 'save_web_user' => $save_web_user, + 'delete_web_user' => $delete_web_user, + 'web_access_permissions' => $web_access_permissions, + 'view_unpublished' => $view_unpublished, + 'import_static' => $import_static, + 'export_static' => $export_static, + 'remove_locks' => $remove_locks, + 'display_locks' => $display_locks, + 'change_resourcetype' => $change_resourcetype, + 'category_manager' => $category_manager ); $fields = $modx->db->escape($fields); -switch ($_POST['mode']) { - case '38': - $tbl = $modx->getFullTableName("user_roles"); +switch($_POST['mode']) { + case '38' : + $tbl = $modx->getFullTableName("user_roles"); - // disallow duplicate names for role - $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}'"); - if ($modx->db->getValue($rs) > 0) { - $modx->manager->saveFormValues(38); - $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=38"); - } + // disallow duplicate names for role + $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}'"); + if($modx->db->getValue($rs) > 0) { + $modx->manager->saveFormValues(38); + $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=38"); + } - $modx->db->insert($fields, $tbl); + $modx->db->insert($fields, $tbl); - // Set the item name for logger - $_SESSION['itemname'] = $_POST['name']; + // Set the item name for logger + $_SESSION['itemname'] = $_POST['name']; - $header = "Location: index.php?a=86&r=2"; - header($header); - break; - case '35': - $tbl = $modx->getFullTableName("user_roles"); + $header = "Location: index.php?a=86&r=2"; + header($header); + break; + case '35' : + $tbl = $modx->getFullTableName("user_roles"); - // disallow duplicate names for role - $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}' AND id!='{$id}'"); - if ($modx->db->getValue($rs) > 0) { - $modx->manager->saveFormValues(35); - $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=35&id={$id}"); - } + // disallow duplicate names for role + $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}' AND id!='{$id}'"); + if($modx->db->getValue($rs) > 0) { + $modx->manager->saveFormValues(35); + $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=35&id={$id}"); + } - $modx->db->update($fields, $tbl, "id='{$id}'"); + $modx->db->update($fields, $tbl, "id='{$id}'"); - // Set the item name for logger - $_SESSION['itemname'] = $_POST['name']; + // Set the item name for logger + $_SESSION['itemname'] = $_POST['name']; - $header = "Location: index.php?a=86&r=2"; - header($header); - break; - default: - $modx->webAlertAndQuit("No operation set in request."); + $header = "Location: index.php?a=86&r=2"; + header($header); + break; + default : + $modx->webAlertAndQuit("No operation set in request."); } $modx->unlockElement(8, $id); diff --git a/manager/processors/save_settings.processor.php b/manager/processors/save_settings.processor.php index ee4316e82f..ebe7c6f654 100755 --- a/manager/processors/save_settings.processor.php +++ b/manager/processors/save_settings.processor.php @@ -1,152 +1,159 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('settings')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('settings')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $data = $_POST; // lose the POST now, gets rid of quirky issue with Safari 3 - see FS#972 unset($_POST); -if ($data['friendly_urls']==='1' && strpos($_SERVER['SERVER_SOFTWARE'], 'IIS')===false) { - $htaccess = $modx->config['base_path'] . '.htaccess'; - $sample_htaccess = $modx->config['base_path'] . 'ht.access'; - $dir = '/' . trim($modx->config['base_url'], '/'); - if (is_file($htaccess)) { - $_ = file_get_contents($htaccess); - if (strpos($_, 'RewriteBase')===false) { - $warnings[] = $_lang["settings_friendlyurls_alert2"]; - } elseif (is_writable($htaccess)) { - $_ = preg_replace('@RewriteBase.+@', "RewriteBase {$dir}", $_); - if (!@file_put_contents($htaccess, $_)) { - $warnings[] = $_lang["settings_friendlyurls_alert2"]; - } - } - } elseif (is_file($sample_htaccess)) { - if (!@rename($sample_htaccess, $htaccess)) { - $warnings[] = $_lang["settings_friendlyurls_alert"]; - } elseif ($modx->config['base_url']!=='/') { - $_ = file_get_contents($htaccess); - $_ = preg_replace('@RewriteBase.+@', "RewriteBase {$dir}", $_); - if (!@file_put_contents($htaccess, $_)) { - $warnings[] = $_lang["settings_friendlyurls_alert2"]; - } - } - } +if($data['friendly_urls']==='1' && strpos($_SERVER['SERVER_SOFTWARE'],'IIS')===false) +{ + $htaccess = $modx->config['base_path'] . '.htaccess'; + $sample_htaccess = $modx->config['base_path'] . 'ht.access'; + $dir = '/' . trim($modx->config['base_url'],'/'); + if(is_file($htaccess)) + { + $_ = file_get_contents($htaccess); + if(strpos($_,'RewriteBase')===false) + { + $warnings[] = $_lang["settings_friendlyurls_alert2"]; + } + elseif(is_writable($htaccess)) + { + $_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_); + if(!@file_put_contents($htaccess,$_)) + { + $warnings[] = $_lang["settings_friendlyurls_alert2"]; + } + } + } + elseif(is_file($sample_htaccess)) + { + if(!@rename($sample_htaccess,$htaccess)) + { + $warnings[] = $_lang["settings_friendlyurls_alert"]; + } + elseif($modx->config['base_url']!=='/') + { + $_ = file_get_contents($htaccess); + $_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_); + if(!@file_put_contents($htaccess,$_)) + { + $warnings[] = $_lang["settings_friendlyurls_alert2"]; + } + } + } } if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { unlink(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css'); } -$data['filemanager_path'] = str_replace('[(base_path)]', MODX_BASE_PATH, $data['filemanager_path']); -$data['rb_base_dir'] = str_replace('[(base_path)]', MODX_BASE_PATH, $data['rb_base_dir']); +$data['filemanager_path'] = str_replace('[(base_path)]',MODX_BASE_PATH,$data['filemanager_path']); +$data['rb_base_dir'] = str_replace('[(base_path)]',MODX_BASE_PATH,$data['rb_base_dir']); if (isset($data) && count($data) > 0) { - if (isset($data['manager_language'])) { - $lang_path = MODX_MANAGER_PATH . 'includes/lang/' . $data['manager_language'] . '.inc.php'; - if (is_file($lang_path)) { - include($lang_path); + if(isset($data['manager_language'])) { + $lang_path = MODX_MANAGER_PATH . 'includes/lang/' . $data['manager_language'] . '.inc.php'; + if(is_file($lang_path)) { + include($lang_path); global $modx_lang_attribute; $data['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute; - } - } - $savethese = array(); - $data['sys_files_checksum'] = $modx->manager->getSystemChecksum($data['check_files_onlogin']); - $data['mail_check_timeperiod'] = (int)$data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute - foreach ($data as $k => $v) { - switch ($k) { - case 'site_name': - $v = htmlspecialchars($v); - break; + } + } + $savethese = array(); + $data['sys_files_checksum'] = $modx->manager->getSystemChecksum($data['check_files_onlogin']); + $data['mail_check_timeperiod'] = (int)$data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute + foreach ($data as $k => $v) { + switch ($k) { + case 'site_name': + $v = htmlspecialchars($v); + break; case 'settings_version':{ - if ($modx->getVersionData('version')!=$data['settings_version']) { - $modx->logEvent(17, 2, '
    ' . var_export($data['settings_version'], true) . '
    ', 'fake settings_version'); + if($modx->getVersionData('version')!=$data['settings_version']){ + $modx->logEvent(17,2,'
    '.var_export($data['settings_version'],true).'
    ','fake settings_version'); $v = $modx->getVersionData('version'); } break; } - case 'error_page': - case 'unauthorized_page': - if (trim($v) == '' || !is_numeric($v)) { - $v = $data['site_start']; - } - break; + case 'error_page': + case 'unauthorized_page': + if (trim($v) == '' || !is_numeric($v)) { + $v = $data['site_start']; + } + break; - case 'lst_custom_contenttype': - case 'txt_custom_contenttype': - // Skip these - $k = ''; - break; - case 'rb_base_dir': - case 'rb_base_url': - case 'filemanager_path': - $v = trim($v); - $v = rtrim($v, '/') . '/'; - break; + case 'lst_custom_contenttype': + case 'txt_custom_contenttype': + // Skip these + $k = ''; + break; + case 'rb_base_dir': + case 'rb_base_url': + case 'filemanager_path': + $v = trim($v); + $v = rtrim($v,'/') . '/'; + break; case 'manager_language': $langDir = realpath(MODX_MANAGER_PATH . 'includes/lang'); $langFile = realpath(MODX_MANAGER_PATH . 'includes/lang/' . $v . '.inc.php'); $langFileDir = dirname($langFile); - if ($langDir !== $langFileDir || !file_exists($langFile)) { + if($langDir !== $langFileDir || !file_exists($langFile)) { $v = 'english'; } - break; - case 'smtppw': - if ($v !== '********************' && $v !== '') { - $v = trim($v); - $v = base64_encode($v) . substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7); - $v = str_replace('=', '%', $v); - } elseif ($v === '********************') { - $k = ''; - } - break; + break; + case 'smtppw': + if ($v !== '********************' && $v !== '') { + $v = trim($v); + $v = base64_encode($v) . substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7); + $v = str_replace('=','%',$v); + } elseif ($v === '********************') { + $k = ''; + } + break; case 'valid_hostnames': - $v = str_replace(array(' ,', ', '), ',', $v); - if ($v !== ',') { - $v = ($v != 'MODX_SITE_HOSTNAMES') ? $v : ''; - $configString = 'config[$k] = $v; + $modx->config[$k] = $v; - if (!empty($k)) { - $savethese[] = '(\'' . $modx->db->escape($k) . '\', \'' . $modx->db->escape($v) . '\')'; - } - } + if(!empty($k)) $savethese[] = '(\''.$modx->db->escape($k).'\', \''.$modx->db->escape($v).'\')'; + } - // Run a single query to save all the values - $sql = "REPLACE INTO " . $modx->getFullTableName("system_settings") . " (setting_name, setting_value) - VALUES " . implode(', ', $savethese); - $modx->db->query($sql); + // Run a single query to save all the values + $sql = "REPLACE INTO ".$modx->getFullTableName("system_settings")." (setting_name, setting_value) + VALUES ".implode(', ', $savethese); + $modx->db->query($sql); - // Reset Template Pages - if (isset($data['reset_template'])) { - $newtemplate = (int)$data['default_template']; - $oldtemplate = (int)$data['old_template']; - $tbl = $modx->getFullTableName('site_content'); - $reset = $data['reset_template']; - if ($reset==1) { - $modx->db->update(array('template' => $newtemplate), $tbl, "type='document'"); - } elseif ($reset==2) { - $modx->db->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'"); - } - } + // Reset Template Pages + if (isset($data['reset_template'])) { + $newtemplate = (int)$data['default_template']; + $oldtemplate = (int)$data['old_template']; + $tbl = $modx->getFullTableName('site_content'); + $reset = $data['reset_template']; + if($reset==1) $modx->db->update(array('template' => $newtemplate), $tbl, "type='document'"); + else if($reset==2) $modx->db->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'"); + } - // empty cache - $modx->clearCache('full'); + // empty cache + $modx->clearCache('full'); } $header="Location: index.php?a=7&r=10"; header($header); diff --git a/manager/processors/save_snippet.processor.php b/manager/processors/save_snippet.processor.php index e681e48f40..28bdfe12a0 100755 --- a/manager/processors/save_snippet.processor.php +++ b/manager/processors/save_snippet.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_snippet')) { diff --git a/manager/processors/save_template.processor.php b/manager/processors/save_template.processor.php index 0a6d6cc6ef..ed4dca716c 100755 --- a/manager/processors/save_template.processor.php +++ b/manager/processors/save_template.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_template')) { diff --git a/manager/processors/save_tmplvars.processor.php b/manager/processors/save_tmplvars.processor.php index 74c365afa2..8d05b975e0 100755 --- a/manager/processors/save_tmplvars.processor.php +++ b/manager/processors/save_tmplvars.processor.php @@ -1,5 +1,5 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } if (!$modx->hasPermission('save_template')) { @@ -13,7 +13,7 @@ $type = $modx->db->escape($_POST['type']); $elements = $modx->db->escape($_POST['elements']); $default_text = $modx->db->escape($_POST['default_text']); -$rank = isset($_POST['rank']) ? $modx->db->escape($_POST['rank']) : 0; +$rank = isset ($_POST['rank']) ? $modx->db->escape($_POST['rank']) : 0; $display = $modx->db->escape($_POST['display']); $params = $modx->db->escape($_POST['params']); $locked = $_POST['locked'] == 'on' ? 1 : 0; @@ -213,8 +213,7 @@ function saveTemplateVarAccess() function saveDocumentAccessPermissons() { global $id, $newid; - $modx = evolutionCMS(); - global $use_udperms; + $modx = evolutionCMS(); global $use_udperms; $tbl_site_tmplvar_templates = $modx->getFullTableName('site_tmplvar_access'); diff --git a/manager/processors/save_user.processor.php b/manager/processors/save_user.processor.php index daf650acee..b853ee0b06 100755 --- a/manager/processors/save_user.processor.php +++ b/manager/processors/save_user.processor.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('save_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('save_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $modx->loadExtension('phpass'); @@ -16,7 +16,7 @@ $id = (int)$input['id']; $oldusername = $input['oldusername']; -$newusername = !empty($input['newusername']) ? trim($input['newusername']) : "New User"; +$newusername = !empty ($input['newusername']) ? trim($input['newusername']) : "New User"; $fullname = $input['fullname']; $genpassword = $input['newpassword']; $passwordgenmethod = $input['passwordgenmethod']; @@ -27,7 +27,7 @@ $phone = $input['phone']; $mobilephone = $input['mobilephone']; $fax = $input['fax']; -$dob = !empty($input['dob']) ? $modx->toTimeStamp($input['dob']) : 0; +$dob = !empty ($input['dob']) ? $modx->toTimeStamp($input['dob']) : 0; $country = $input['country']; $street = $input['street']; $city = $input['city']; @@ -44,133 +44,135 @@ $user_groups = $input['user_groups']; // verify password -if ($passwordgenmethod == "spec" && $input['specifiedpassword'] != $input['confirmpassword']) { - webAlertAndQuit("Password typed is mismatched"); +if($passwordgenmethod == "spec" && $input['specifiedpassword'] != $input['confirmpassword']) { + webAlertAndQuit("Password typed is mismatched"); } // verify email -if ($email == '' || !preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,24}$/i", $email)) { - webAlertAndQuit("E-mail address doesn't seem to be valid!"); +if($email == '' || !preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,24}$/i", $email)) { + webAlertAndQuit("E-mail address doesn't seem to be valid!"); } // verify admin security -if ($_SESSION['mgrRole'] != 1) { - // Check to see if user tried to spoof a "1" (admin) role - if (!$modx->hasPermission('save_role')) { - webAlertAndQuit("Illegal attempt to create/modify administrator by non-administrator!"); - } - // Verify that the user being edited wasn't an admin and the user ID got spoofed - $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, "internalKey='{$id}' AND role=1"); - $limit = $modx->db->getValue($rs); - if ($limit > 0) { - webAlertAndQuit("You cannot alter an administrative user."); - } +if($_SESSION['mgrRole'] != 1) { + // Check to see if user tried to spoof a "1" (admin) role + if(!$modx->hasPermission('save_role')) { + webAlertAndQuit("Illegal attempt to create/modify administrator by non-administrator!"); + } + // Verify that the user being edited wasn't an admin and the user ID got spoofed + $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, "internalKey='{$id}' AND role=1"); + $limit = $modx->db->getValue($rs); + if($limit > 0) { + webAlertAndQuit("You cannot alter an administrative user."); + } + } -switch ($input['mode']) { - case '11': // new user - // check if this user name already exist - $rs = $modx->db->select('count(id)', $tbl_manager_users, sprintf("username='%s'", $modx->db->escape($newusername))); - $limit = $modx->db->getValue($rs); - if ($limit > 0) { - webAlertAndQuit("User name is already in use!"); - } - - // check if the email address already exist - $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, sprintf("email='%s' AND id!='%s'", $modx->db->escape($email), $id)); - $limit = $modx->db->getValue($rs); - if ($limit > 0) { - webAlertAndQuit("Email is already in use!"); - } - - // generate a new password for this user - if ($specifiedpassword != "" && $passwordgenmethod == "spec") { - if (strlen($specifiedpassword) < 6) { - webAlertAndQuit("Password is too short!"); - } else { - $newpassword = $specifiedpassword; - } - } elseif ($specifiedpassword == "" && $passwordgenmethod == "spec") { - webAlertAndQuit("You didn't specify a password for this user!"); - } elseif ($passwordgenmethod == 'g') { - $newpassword = generate_password(8); - } else { - webAlertAndQuit("No password generation method specified!"); - } - - // invoke OnBeforeUserFormSave event - $modx->invokeEvent("OnBeforeUserFormSave", array( - "mode" => "new", - )); - - // create the user account - $internalKey = $modx->db->insert(array('username' => $modx->db->escape($newusername)), $tbl_manager_users); - - $field = array(); - $field['password'] = $modx->phpass->HashPassword($newpassword); - $modx->db->update($field, $tbl_manager_users, "id='{$internalKey}'"); - - $field = compact('internalKey', 'fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'blocked', 'blockeduntil', 'blockedafter'); - $field = $modx->db->escape($field); - $modx->db->insert($field, $tbl_user_attributes); - - // Save user settings - saveUserSettings($internalKey); - - // invoke OnManagerSaveUser event - $modx->invokeEvent("OnManagerSaveUser", array( - "mode" => "new", - "userid" => $internalKey, - "username" => $newusername, - "userpassword" => $newpassword, - "useremail" => $email, - "userfullname" => $fullname, - "userroleid" => $role - )); - - // invoke OnUserFormSave event - $modx->invokeEvent("OnUserFormSave", array( - "mode" => "new", - "id" => $internalKey - )); - - // Set the item name for logger - $_SESSION['itemname'] = $newusername; - - /*******************************************************************************/ - // put the user in the user_groups he/ she should be in - // first, check that up_perms are switched on! - if ($use_udperms == 1) { - if (!empty($user_groups)) { - for ($i = 0; $i < count($user_groups); $i++) { - $f = array(); - $f['user_group'] = (int)$user_groups[$i]; - $f['member'] = $internalKey; - $modx->db->insert($f, $tbl_member_groups); - } - } - } - // end of user_groups stuff! - - if ($passwordnotifymethod == 'e') { - sendMailMessage($email, $newusername, $newpassword, $fullname); - if ($input['stay'] != '') { - $a = ($input['stay'] == '2') ? "12&id={$internalKey}" : "11"; - $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay']; - header($header); - } else { - $header = "Location: index.php?a=75&r=2"; - header($header); - } - } else { - if ($input['stay'] != '') { - $a = ($input['stay'] == '2') ? "12&id={$internalKey}" : "11"; - $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; - } else { - $stayUrl = "index.php?a=75&r=2"; - } - - include_once "header.inc.php"; ?> +switch($input['mode']) { + case '11' : // new user + // check if this user name already exist + $rs = $modx->db->select('count(id)', $tbl_manager_users, sprintf("username='%s'", $modx->db->escape($newusername))); + $limit = $modx->db->getValue($rs); + if($limit > 0) { + webAlertAndQuit("User name is already in use!"); + } + + // check if the email address already exist + $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, sprintf("email='%s' AND id!='%s'", $modx->db->escape($email), $id)); + $limit = $modx->db->getValue($rs); + if($limit > 0) { + webAlertAndQuit("Email is already in use!"); + } + + // generate a new password for this user + if($specifiedpassword != "" && $passwordgenmethod == "spec") { + if(strlen($specifiedpassword) < 6) { + webAlertAndQuit("Password is too short!"); + } else { + $newpassword = $specifiedpassword; + } + } elseif($specifiedpassword == "" && $passwordgenmethod == "spec") { + webAlertAndQuit("You didn't specify a password for this user!"); + } elseif($passwordgenmethod == 'g') { + $newpassword = generate_password(8); + } else { + webAlertAndQuit("No password generation method specified!"); + } + + // invoke OnBeforeUserFormSave event + $modx->invokeEvent("OnBeforeUserFormSave", array( + "mode" => "new", + )); + + // create the user account + $internalKey = $modx->db->insert(array('username' => $modx->db->escape($newusername)), $tbl_manager_users); + + $field = array(); + $field['password'] = $modx->phpass->HashPassword($newpassword); + $modx->db->update($field, $tbl_manager_users, "id='{$internalKey}'"); + + $field = compact('internalKey', 'fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'blocked', 'blockeduntil', 'blockedafter'); + $field = $modx->db->escape($field); + $modx->db->insert($field, $tbl_user_attributes); + + // Save user settings + saveUserSettings($internalKey); + + // invoke OnManagerSaveUser event + $modx->invokeEvent("OnManagerSaveUser", array( + "mode" => "new", + "userid" => $internalKey, + "username" => $newusername, + "userpassword" => $newpassword, + "useremail" => $email, + "userfullname" => $fullname, + "userroleid" => $role + )); + + // invoke OnUserFormSave event + $modx->invokeEvent("OnUserFormSave", array( + "mode" => "new", + "id" => $internalKey + )); + + // Set the item name for logger + $_SESSION['itemname'] = $newusername; + + /*******************************************************************************/ + // put the user in the user_groups he/ she should be in + // first, check that up_perms are switched on! + if($use_udperms == 1) { + if(!empty($user_groups)) { + for($i = 0; $i < count($user_groups); $i++) { + $f = array(); + $f['user_group'] = (int)$user_groups[$i]; + $f['member'] = $internalKey; + $modx->db->insert($f, $tbl_member_groups); + } + } + } + // end of user_groups stuff! + + if($passwordnotifymethod == 'e') { + sendMailMessage($email, $newusername, $newpassword, $fullname); + if($input['stay'] != '') { + $a = ($input['stay'] == '2') ? "12&id={$internalKey}" : "11"; + $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay']; + header($header); + } else { + $header = "Location: index.php?a=75&r=2"; + header($header); + } + } else { + if($input['stay'] != '') { + $a = ($input['stay'] == '2') ? "12&id={$internalKey}" : "11"; + $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; + } else { + $stayUrl = "index.php?a=75&r=2"; + } + + include_once "header.inc.php"; + ?>

    @@ -192,124 +194,125 @@
    db->select('count(id)', $tbl_manager_users, sprintf("username='%s' AND id!='%s'", $modx->db->escape($newusername), $id)); - $limit = $modx->db->getValue($rs); - if ($limit > 0) { - webAlertAndQuit("User name is already in use!"); - } - - // check if the email address already exists - $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, sprintf("email='%s' AND internalKey!='%s'", $modx->db->escape($email), $id)); - $limit = $modx->db->getValue($rs); - if ($limit > 0) { - webAlertAndQuit("Email is already in use!"); - } - - // invoke OnBeforeUserFormSave event - $modx->invokeEvent("OnBeforeUserFormSave", array( - "mode" => "upd", - "id" => $id - )); - - // update user name and password - $field = array(); - $field['username'] = $modx->db->escape($newusername); - if ($genpassword == 1) { - $field['password'] = $modx->phpass->HashPassword($newpassword); - } - $modx->db->update($field, $tbl_manager_users, "id='{$id}'"); - $field = compact('fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'failedlogincount', 'blocked', 'blockeduntil', 'blockedafter'); - $field = $modx->db->escape($field); - $modx->db->update($field, $tbl_user_attributes, "internalKey='{$id}'"); - - // Save user settings - saveUserSettings($id); - - // Set the item name for logger - $_SESSION['itemname'] = $newusername; - - // invoke OnManagerSaveUser event - $modx->invokeEvent("OnManagerSaveUser", array( - "mode" => "upd", - "userid" => $id, - "username" => $newusername, - "userpassword" => $newpassword, - "useremail" => $email, - "userfullname" => $fullname, - "userroleid" => $role, - "oldusername" => (($oldusername != $newusername) ? $oldusername : ""), - "olduseremail" => (($oldemail != $email) ? $oldemail : "") - )); - - // invoke OnManagerChangePassword event - if ($genpassword == 1) { - $modx->invokeEvent("OnManagerChangePassword", array( - "userid" => $id, - "username" => $newusername, - "userpassword" => $newpassword - )); - } - - // invoke OnUserFormSave event - $modx->invokeEvent("OnUserFormSave", array( - "mode" => "upd", - "id" => $id - )); - - /*******************************************************************************/ - // put the user in the user_groups he/ she should be in - // first, check that up_perms are switched on! - if ($use_udperms == 1) { - // as this is an existing user, delete his/ her entries in the groups before saving the new groups - $modx->db->delete($tbl_member_groups, "member='{$id}'"); - if (!empty($user_groups)) { - for ($i = 0; $i < count($user_groups); $i++) { - $field = array(); - $field['user_group'] = (int)$user_groups[$i]; - $field['member'] = $id; - $modx->db->insert($field, $tbl_member_groups); - } - } - } - // end of user_groups stuff! - /*******************************************************************************/ - if ($id == $modx->getLoginUserID() && ($genpassword !== 1 && $passwordnotifymethod != 's')) { - $modx->webAlertAndQuit($_lang["user_changeddata"], 'javascript:top.location.href="index.php?a=8";'); - } - if ($genpassword == 1 && $passwordnotifymethod == 's') { - if ($input['stay'] != '') { - $a = ($input['stay'] == '2') ? "12&id={$id}" : "11"; - $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; - } else { - $stayUrl = "index.php?a=75&r=2"; - } - - include_once "header.inc.php"; ?> + include_once "footer.inc.php"; + } + break; + case '12' : // edit user + // generate a new password for this user + if($genpassword == 1) { + if($specifiedpassword != "" && $passwordgenmethod == "spec") { + if(strlen($specifiedpassword) < 6) { + webAlertAndQuit("Password is too short!"); + } else { + $newpassword = $specifiedpassword; + } + } elseif($specifiedpassword == "" && $passwordgenmethod == "spec") { + webAlertAndQuit("You didn't specify a password for this user!"); + } elseif($passwordgenmethod == 'g') { + $newpassword = generate_password(8); + } else { + webAlertAndQuit("No password generation method specified!"); + } + } + if($passwordnotifymethod == 'e') { + sendMailMessage($email, $newusername, $newpassword, $fullname); + } + + // check if the username already exist + $rs = $modx->db->select('count(id)', $tbl_manager_users, sprintf("username='%s' AND id!='%s'", $modx->db->escape($newusername), $id)); + $limit = $modx->db->getValue($rs); + if($limit > 0) { + webAlertAndQuit("User name is already in use!"); + } + + // check if the email address already exists + $rs = $modx->db->select('count(internalKey)', $tbl_user_attributes, sprintf("email='%s' AND internalKey!='%s'", $modx->db->escape($email), $id)); + $limit = $modx->db->getValue($rs); + if($limit > 0) { + webAlertAndQuit("Email is already in use!"); + } + + // invoke OnBeforeUserFormSave event + $modx->invokeEvent("OnBeforeUserFormSave", array( + "mode" => "upd", + "id" => $id + )); + + // update user name and password + $field = array(); + $field['username'] = $modx->db->escape($newusername); + if($genpassword == 1) { + $field['password'] = $modx->phpass->HashPassword($newpassword); + } + $modx->db->update($field, $tbl_manager_users, "id='{$id}'"); + $field = compact('fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'failedlogincount', 'blocked', 'blockeduntil', 'blockedafter'); + $field = $modx->db->escape($field); + $modx->db->update($field, $tbl_user_attributes, "internalKey='{$id}'"); + + // Save user settings + saveUserSettings($id); + + // Set the item name for logger + $_SESSION['itemname'] = $newusername; + + // invoke OnManagerSaveUser event + $modx->invokeEvent("OnManagerSaveUser", array( + "mode" => "upd", + "userid" => $id, + "username" => $newusername, + "userpassword" => $newpassword, + "useremail" => $email, + "userfullname" => $fullname, + "userroleid" => $role, + "oldusername" => (($oldusername != $newusername) ? $oldusername : ""), + "olduseremail" => (($oldemail != $email) ? $oldemail : "") + )); + + // invoke OnManagerChangePassword event + if($genpassword == 1) { + $modx->invokeEvent("OnManagerChangePassword", array( + "userid" => $id, + "username" => $newusername, + "userpassword" => $newpassword + )); + } + + // invoke OnUserFormSave event + $modx->invokeEvent("OnUserFormSave", array( + "mode" => "upd", + "id" => $id + )); + + /*******************************************************************************/ + // put the user in the user_groups he/ she should be in + // first, check that up_perms are switched on! + if($use_udperms == 1) { + // as this is an existing user, delete his/ her entries in the groups before saving the new groups + $modx->db->delete($tbl_member_groups, "member='{$id}'"); + if(!empty($user_groups)) { + for($i = 0; $i < count($user_groups); $i++) { + $field = array(); + $field['user_group'] = (int)$user_groups[$i]; + $field['member'] = $id; + $modx->db->insert($field, $tbl_member_groups); + } + } + } + // end of user_groups stuff! + /*******************************************************************************/ + if($id == $modx->getLoginUserID() && ($genpassword !== 1 && $passwordnotifymethod != 's')) { + $modx->webAlertAndQuit($_lang["user_changeddata"], 'javascript:top.location.href="index.php?a=8";'); + } + if($genpassword == 1 && $passwordnotifymethod == 's') { + if($input['stay'] != '') { + $a = ($input['stay'] == '2') ? "12&id={$id}" : "11"; + $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; + } else { + $stayUrl = "index.php?a=75&r=2"; + } + + include_once "header.inc.php"; + ?>

    @@ -329,20 +332,20 @@ "; - $param['subject'] = $emailsubject; - $param['body'] = $message; - $param['to'] = $email; - $param['type'] = 'text'; - $rs = $modx->sendmail($param); - if (!$rs) { - $modx->manager->saveFormValues(); - $modx->messageQuit("{$email} - {$_lang['error_sending_email']}"); - } +function sendMailMessage($email, $uid, $pwd, $ufn) { + $modx = evolutionCMS(); global $_lang, $signupemail_message; + global $emailsubject, $emailsender; + global $site_name; + $manager_url = MODX_MANAGER_URL; + $message = sprintf($signupemail_message, $uid, $pwd); // use old method + // replace placeholders + $message = str_replace("[+uid+]", $uid, $message); + $message = str_replace("[+pwd+]", $pwd, $message); + $message = str_replace("[+ufn+]", $ufn, $message); + $message = str_replace("[+sname+]", $site_name, $message); + $message = str_replace("[+saddr+]", $emailsender, $message); + $message = str_replace("[+semail+]", $emailsender, $message); + $message = str_replace("[+surl+]", $manager_url, $message); + + $param = array(); + $param['from'] = "{$site_name}<{$emailsender}>"; + $param['subject'] = $emailsubject; + $param['body'] = $message; + $param['to'] = $email; + $param['type'] = 'text'; + $rs = $modx->sendmail($param); + if(!$rs) { + $modx->manager->saveFormValues(); + $modx->messageQuit("{$email} - {$_lang['error_sending_email']}"); + } } /** @@ -388,88 +389,87 @@ function sendMailMessage($email, $uid, $pwd, $ufn) * * @param int $id */ -function saveUserSettings($id) -{ - $modx = evolutionCMS(); - $tbl_user_settings = $modx->getFullTableName('user_settings'); - - $ignore = array( - 'id', - 'oldusername', - 'oldemail', - 'newusername', - 'fullname', - 'newpassword', - 'newpasswordcheck', - 'passwordgenmethod', - 'passwordnotifymethod', - 'specifiedpassword', - 'confirmpassword', - 'email', - 'phone', - 'mobilephone', - 'fax', - 'dob', - 'country', - 'street', - 'city', - 'state', - 'zip', - 'gender', - 'photo', - 'comment', - 'role', - 'failedlogincount', - 'blocked', - 'blockeduntil', - 'blockedafter', - 'user_groups', - 'mode', - 'blockedmode', - 'stay', - 'save', - 'theme_refresher' - ); - - // determine which settings can be saved blank (based on 'default_{settingname}' POST checkbox values) - $defaults = array( - 'upload_images', - 'upload_media', - 'upload_flash', - 'upload_files' - ); - - // get user setting field names - $settings = array(); - foreach ($_POST as $n => $v) { - if (in_array($n, $ignore) || (!in_array($n, $defaults) && is_scalar($v) && trim($v) == '') || (!in_array($n, $defaults) && is_array($v) && empty($v))) { - continue; - } // ignore blacklist and empties - $settings[$n] = $v; // this value should be saved - } - - foreach ($defaults as $k) { - if (isset($settings['default_' . $k]) && $settings['default_' . $k] == '1') { - unset($settings[$k]); - } - unset($settings['default_' . $k]); - } - - $modx->db->delete($tbl_user_settings, "user='{$id}'"); - - foreach ($settings as $n => $vl) { - if (is_array($vl)) { - $vl = implode(",", $vl); - } - if ($vl != '') { - $f = array(); - $f['user'] = $id; - $f['setting_name'] = $n; - $f['setting_value'] = $vl; - $f = $modx->db->escape($f); - $modx->db->insert($f, $tbl_user_settings); - } - } +function saveUserSettings($id) { + $modx = evolutionCMS(); + $tbl_user_settings = $modx->getFullTableName('user_settings'); + + $ignore = array( + 'id', + 'oldusername', + 'oldemail', + 'newusername', + 'fullname', + 'newpassword', + 'newpasswordcheck', + 'passwordgenmethod', + 'passwordnotifymethod', + 'specifiedpassword', + 'confirmpassword', + 'email', + 'phone', + 'mobilephone', + 'fax', + 'dob', + 'country', + 'street', + 'city', + 'state', + 'zip', + 'gender', + 'photo', + 'comment', + 'role', + 'failedlogincount', + 'blocked', + 'blockeduntil', + 'blockedafter', + 'user_groups', + 'mode', + 'blockedmode', + 'stay', + 'save', + 'theme_refresher' + ); + + // determine which settings can be saved blank (based on 'default_{settingname}' POST checkbox values) + $defaults = array( + 'upload_images', + 'upload_media', + 'upload_flash', + 'upload_files' + ); + + // get user setting field names + $settings = array(); + foreach($_POST as $n => $v) { + if(in_array($n, $ignore) || (!in_array($n, $defaults) && is_scalar($v) && trim($v) == '') || (!in_array($n, $defaults) && is_array($v) && empty($v))) { + continue; + } // ignore blacklist and empties + $settings[$n] = $v; // this value should be saved + } + + foreach($defaults as $k) { + if(isset($settings['default_' . $k]) && $settings['default_' . $k] == '1') { + unset($settings[$k]); + } + unset($settings['default_' . $k]); + } + + $modx->db->delete($tbl_user_settings, "user='{$id}'"); + + foreach($settings as $n => $vl) { + if(is_array($vl)) { + $vl = implode(",", $vl); + } + if($vl != '') { + $f = array(); + $f['user'] = $id; + $f['setting_name'] = $n; + $f['setting_value'] = $vl; + $f = $modx->db->escape($f); + $modx->db->insert($f, $tbl_user_settings); + } + } } /** @@ -477,12 +477,11 @@ function saveUserSettings($id) * * @param $msg */ -function webAlertAndQuit($msg) -{ - global $id, $modx; - $mode = $_POST['mode']; - $modx->manager->saveFormValues($mode); - $modx->webAlertAndQuit($msg, "index.php?a={$mode}" . ($mode == '12' ? "&id={$id}" : '')); +function webAlertAndQuit($msg) { + global $id, $modx; + $mode = $_POST['mode']; + $modx->manager->saveFormValues($mode); + $modx->webAlertAndQuit($msg, "index.php?a={$mode}" . ($mode == '12' ? "&id={$id}" : '')); } /** @@ -491,14 +490,13 @@ function webAlertAndQuit($msg) * @param int $length * @return string */ -function generate_password($length = 10) -{ - $allowable_characters = "abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"; - $ps_len = strlen($allowable_characters); - mt_srand((double) microtime() * 1000000); - $pass = ""; - for ($i = 0; $i < $length; $i++) { - $pass .= $allowable_characters[mt_rand(0, $ps_len - 1)]; - } - return $pass; +function generate_password($length = 10) { + $allowable_characters = "abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"; + $ps_len = strlen($allowable_characters); + mt_srand((double) microtime() * 1000000); + $pass = ""; + for($i = 0; $i < $length; $i++) { + $pass .= $allowable_characters[mt_rand(0, $ps_len - 1)]; + } + return $pass; } diff --git a/manager/processors/save_web_user.processor.php b/manager/processors/save_web_user.processor.php index 9414759856..f1d1e7a98e 100755 --- a/manager/processors/save_web_user.processor.php +++ b/manager/processors/save_web_user.processor.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { + die("INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('save_web_user')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('save_web_user')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $tbl_web_users = $modx->getFullTableName('web_users'); @@ -11,16 +11,16 @@ $tbl_web_groups = $modx->getFullTableName('web_groups'); $input = $_POST; -foreach ($input as $k => $v) { - if ($k !== 'comment') { - $v = sanitize($v); - } - $input[$k] = $v; +foreach($input as $k => $v) { + if($k !== 'comment') { + $v = sanitize($v); + } + $input[$k] = $v; } $id = (int)$input['id']; $oldusername = $input['oldusername']; -$newusername = !empty($input['newusername']) ? trim($input['newusername']) : "New User"; +$newusername = !empty ($input['newusername']) ? trim($input['newusername']) : "New User"; $esc_newusername = $modx->db->escape($newusername); $fullname = $input['fullname']; $genpassword = $input['newpassword']; @@ -33,7 +33,7 @@ $phone = $input['phone']; $mobilephone = $input['mobilephone']; $fax = $input['fax']; -$dob = !empty($input['dob']) ? $modx->toTimeStamp($input['dob']) : 0; +$dob = !empty ($input['dob']) ? $modx->toTimeStamp($input['dob']) : 0; $country = $input['country']; $street = $input['street']; $city = $input['city']; @@ -50,83 +50,83 @@ $user_groups = $input['user_groups']; // verify password -if ($passwordgenmethod == "spec" && $input['specifiedpassword'] != $input['confirmpassword']) { - webAlertAndQuit("Password typed is mismatched"); +if($passwordgenmethod == "spec" && $input['specifiedpassword'] != $input['confirmpassword']) { + webAlertAndQuit("Password typed is mismatched"); } // verify email -if ($email == '' || !preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,24}$/i", $email)) { - webAlertAndQuit("E-mail address doesn't seem to be valid!"); +if($email == '' || !preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,24}$/i", $email)) { + webAlertAndQuit("E-mail address doesn't seem to be valid!"); } -switch ($input['mode']) { - case '87': // new user - // check if this user name already exist - $rs = $modx->db->select('count(id)', $tbl_web_users, "username='{$esc_newusername}'"); - $limit = $modx->db->getValue($rs); - if ($limit > 0) { - webAlertAndQuit("User name is already in use!"); - } - - // check if the email address already exist - if ($modx->config['allow_multiple_emails'] != 1) { - $rs = $modx->db->select('count(id)', $tbl_web_user_attributes, "email='{$esc_email}' AND id!='{$id}'"); - $limit = $modx->db->getValue($rs); - if ($limit > 0) { - webAlertAndQuit("Email is already in use!"); - } - } - - // generate a new password for this user - if ($specifiedpassword != "" && $passwordgenmethod == "spec") { - if (strlen($specifiedpassword) < 6) { - webAlertAndQuit("Password is too short!"); - } else { - $newpassword = $specifiedpassword; - } - } elseif ($specifiedpassword == "" && $passwordgenmethod == "spec") { - webAlertAndQuit("You didn't specify a password for this user!"); - } elseif ($passwordgenmethod == 'g') { - $newpassword = generate_password(8); - } else { - webAlertAndQuit("No password generation method specified!"); - } - - // invoke OnBeforeWUsrFormSave event - $modx->invokeEvent("OnBeforeWUsrFormSave", array( - "mode" => "new", - )); - - // create the user account - $field = array(); - $field['username'] = $esc_newusername; - $field['password'] = md5($newpassword); - $internalKey = $modx->db->insert($field, $tbl_web_users); - - $field = compact('internalKey', 'fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'blocked', 'blockeduntil', 'blockedafter'); - $field = $modx->db->escape($field); - $modx->db->insert($field, $tbl_web_user_attributes); - - // Save User Settings - saveUserSettings($internalKey); - - // Set the item name for logger - $_SESSION['itemname'] = $newusername; - - /*******************************************************************************/ - // put the user in the user_groups he/ she should be in - // first, check that up_perms are switched on! - if ($use_udperms == 1) { - if (!empty($user_groups)) { - for ($i = 0; $i < count($user_groups); $i++) { - $f = array(); - $f['webgroup'] = (int)$user_groups[$i]; - $f['webuser'] = $internalKey; - $modx->db->insert($f, $tbl_web_groups); - } - } - } - // end of user_groups stuff! +switch($input['mode']) { + case '87' : // new user + // check if this user name already exist + $rs = $modx->db->select('count(id)', $tbl_web_users, "username='{$esc_newusername}'"); + $limit = $modx->db->getValue($rs); + if($limit > 0) { + webAlertAndQuit("User name is already in use!"); + } + + // check if the email address already exist + if ($modx->config['allow_multiple_emails'] != 1) { + $rs = $modx->db->select('count(id)', $tbl_web_user_attributes, "email='{$esc_email}' AND id!='{$id}'"); + $limit = $modx->db->getValue($rs); + if($limit > 0) { + webAlertAndQuit("Email is already in use!"); + } + } + + // generate a new password for this user + if($specifiedpassword != "" && $passwordgenmethod == "spec") { + if(strlen($specifiedpassword) < 6) { + webAlertAndQuit("Password is too short!"); + } else { + $newpassword = $specifiedpassword; + } + } elseif($specifiedpassword == "" && $passwordgenmethod == "spec") { + webAlertAndQuit("You didn't specify a password for this user!"); + } elseif($passwordgenmethod == 'g') { + $newpassword = generate_password(8); + } else { + webAlertAndQuit("No password generation method specified!"); + } + + // invoke OnBeforeWUsrFormSave event + $modx->invokeEvent("OnBeforeWUsrFormSave", array( + "mode" => "new", + )); + + // create the user account + $field = array(); + $field['username'] = $esc_newusername; + $field['password'] = md5($newpassword); + $internalKey = $modx->db->insert($field, $tbl_web_users); + + $field = compact('internalKey', 'fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'blocked', 'blockeduntil', 'blockedafter'); + $field = $modx->db->escape($field); + $modx->db->insert($field, $tbl_web_user_attributes); + + // Save User Settings + saveUserSettings($internalKey); + + // Set the item name for logger + $_SESSION['itemname'] = $newusername; + + /*******************************************************************************/ + // put the user in the user_groups he/ she should be in + // first, check that up_perms are switched on! + if($use_udperms == 1) { + if(!empty($user_groups)) { + for($i = 0; $i < count($user_groups); $i++) { + $f = array(); + $f['webgroup'] = (int)$user_groups[$i]; + $f['webuser'] = $internalKey; + $modx->db->insert($f, $tbl_web_groups); + } + } + } + // end of user_groups stuff! // invoke OnWebSaveUser event $modx->invokeEvent("OnWebSaveUser", array( @@ -144,25 +144,26 @@ "id" => $internalKey )); - if ($passwordnotifymethod == 'e') { - sendMailMessage($email, $newusername, $newpassword, $fullname); - if ($input['stay'] != '') { - $a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87"; - $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay']; - header($header); - } else { - $header = "Location: index.php?a=99&r=2"; - header($header); - } - } else { - if ($input['stay'] != '') { - $a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87"; - $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; - } else { - $stayUrl = "index.php?a=99&r=2"; - } - - include_once "header.inc.php"; ?> + if($passwordnotifymethod == 'e') { + sendMailMessage($email, $newusername, $newpassword, $fullname); + if($input['stay'] != '') { + $a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87"; + $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay']; + header($header); + } else { + $header = "Location: index.php?a=99&r=2"; + header($header); + } + } else { + if($input['stay'] != '') { + $a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87"; + $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; + } else { + $stayUrl = "index.php?a=99&r=2"; + } + + include_once "header.inc.php"; + ?>

    @@ -184,86 +185,86 @@ db->select('count(id)', $tbl_web_users, "username='{$esc_newusername}' AND id!='{$id}'"); - $limit = $modx->db->getValue($rs); - if ($limit > 0) { - webAlertAndQuit("User name is already in use!"); - } - - // check if the email address already exists - if ($modx->config['allow_multiple_emails'] != 1) { - $rs = $modx->db->select('count(internalKey)', $tbl_web_user_attributes, "email='{$esc_email}' AND internalKey!='{$id}'"); - $limit = $modx->db->getValue($rs); - if ($limit > 0) { - webAlertAndQuit("Email is already in use!"); - } - } - - // invoke OnBeforeWUsrFormSave event - $modx->invokeEvent("OnBeforeWUsrFormSave", array( - "mode" => "upd", - "id" => $id - )); - - // update user name and password - $field = array(); - $field['username'] = $esc_newusername; - if ($genpassword == 1) { - $field['password'] = md5($newpassword); - } - $modx->db->update($field, $tbl_web_users, "id='{$id}'"); - $field = compact('fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'failedlogincount', 'blocked', 'blockeduntil', 'blockedafter'); - $field = $modx->db->escape($field); - $modx->db->update($field, $tbl_web_user_attributes, "internalKey='{$id}'"); - - // Save User Settings - saveUserSettings($id); - - // Set the item name for logger - $_SESSION['itemname'] = $newusername; - - /*******************************************************************************/ - // put the user in the user_groups he/ she should be in - // first, check that up_perms are switched on! - if ($use_udperms == 1) { - // as this is an existing user, delete his/ her entries in the groups before saving the new groups - $modx->db->delete($tbl_web_groups, "webuser='{$id}'"); - if (!empty($user_groups)) { - for ($i = 0; $i < count($user_groups); $i++) { - $field = array(); - $field['webgroup'] = (int)$user_groups[$i]; - $field['webuser'] = $id; - $modx->db->insert($field, $tbl_web_groups); - } - } - } - // end of user_groups stuff! - /*******************************************************************************/ + include_once "footer.inc.php"; + } + break; + case '88' : // edit user + // generate a new password for this user + if($genpassword == 1) { + if($specifiedpassword != "" && $passwordgenmethod == "spec") { + if(strlen($specifiedpassword) < 6) { + webAlertAndQuit("Password is too short!"); + } else { + $newpassword = $specifiedpassword; + } + } elseif($specifiedpassword == "" && $passwordgenmethod == "spec") { + webAlertAndQuit("You didn't specify a password for this user!"); + } elseif($passwordgenmethod == 'g') { + $newpassword = generate_password(8); + } else { + webAlertAndQuit("No password generation method specified!"); + } + } + if($passwordnotifymethod == 'e') { + sendMailMessage($email, $newusername, $newpassword, $fullname); + } + + // check if the username already exist + $rs = $modx->db->select('count(id)', $tbl_web_users, "username='{$esc_newusername}' AND id!='{$id}'"); + $limit = $modx->db->getValue($rs); + if($limit > 0) { + webAlertAndQuit("User name is already in use!"); + } + + // check if the email address already exists + if ($modx->config['allow_multiple_emails'] != 1) { + $rs = $modx->db->select('count(internalKey)', $tbl_web_user_attributes, "email='{$esc_email}' AND internalKey!='{$id}'"); + $limit = $modx->db->getValue($rs); + if($limit > 0) { + webAlertAndQuit("Email is already in use!"); + } + } + + // invoke OnBeforeWUsrFormSave event + $modx->invokeEvent("OnBeforeWUsrFormSave", array( + "mode" => "upd", + "id" => $id + )); + + // update user name and password + $field = array(); + $field['username'] = $esc_newusername; + if($genpassword == 1) { + $field['password'] = md5($newpassword); + } + $modx->db->update($field, $tbl_web_users, "id='{$id}'"); + $field = compact('fullname', 'role', 'email', 'phone', 'mobilephone', 'fax', 'zip', 'street', 'city', 'state', 'country', 'gender', 'dob', 'photo', 'comment', 'failedlogincount', 'blocked', 'blockeduntil', 'blockedafter'); + $field = $modx->db->escape($field); + $modx->db->update($field, $tbl_web_user_attributes, "internalKey='{$id}'"); + + // Save User Settings + saveUserSettings($id); + + // Set the item name for logger + $_SESSION['itemname'] = $newusername; + + /*******************************************************************************/ + // put the user in the user_groups he/ she should be in + // first, check that up_perms are switched on! + if($use_udperms == 1) { + // as this is an existing user, delete his/ her entries in the groups before saving the new groups + $modx->db->delete($tbl_web_groups, "webuser='{$id}'"); + if(!empty($user_groups)) { + for($i = 0; $i < count($user_groups); $i++) { + $field = array(); + $field['webgroup'] = (int)$user_groups[$i]; + $field['webuser'] = $id; + $modx->db->insert($field, $tbl_web_groups); + } + } + } + // end of user_groups stuff! + /*******************************************************************************/ // invoke OnWebSaveUser event $modx->invokeEvent("OnWebSaveUser", array( @@ -278,7 +279,7 @@ )); // invoke OnWebChangePassword event - if ($genpassword == 1) { + if($genpassword == 1) { $modx->invokeEvent("OnWebChangePassword", array( "userid" => $id, "username" => $newusername, @@ -292,15 +293,16 @@ "id" => $id )); - if ($genpassword == 1 && $passwordnotifymethod == 's') { - if ($input['stay'] != '') { - $a = ($input['stay'] == '2') ? "88&id={$id}" : "87"; - $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; - } else { - $stayUrl = "index.php?a=99&r=2"; - } + if($genpassword == 1 && $passwordnotifymethod == 's') { + if($input['stay'] != '') { + $a = ($input['stay'] == '2') ? "88&id={$id}" : "87"; + $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay']; + } else { + $stayUrl = "index.php?a=99&r=2"; + } - include_once "header.inc.php"; ?> + include_once "header.inc.php"; + ?>

    @@ -320,20 +322,20 @@ "; - $param['subject'] = $emailsubject; - $param['body'] = $message; - $param['to'] = $email; - $param['type'] = 'text'; - $rs = $modx->sendmail($param); - if (!$rs) { - $modx->manager->saveFormValues(); - $modx->messageQuit("{$email} - {$_lang['error_sending_email']}"); - } +function sendMailMessage($email, $uid, $pwd, $ufn) { + $modx = evolutionCMS(); global $_lang, $websignupemail_message; + global $emailsubject, $emailsender; + global $site_name, $site_url; + $message = sprintf($websignupemail_message, $uid, $pwd); // use old method + // replace placeholders + $message = str_replace("[+uid+]", $uid, $message); + $message = str_replace("[+pwd+]", $pwd, $message); + $message = str_replace("[+ufn+]", $ufn, $message); + $message = str_replace("[+sname+]", $site_name, $message); + $message = str_replace("[+saddr+]", $emailsender, $message); + $message = str_replace("[+semail+]", $emailsender, $message); + $message = str_replace("[+surl+]", $site_url, $message); + + $param = array(); + $param['from'] = "{$site_name}<{$emailsender}>"; + $param['subject'] = $emailsubject; + $param['body'] = $message; + $param['to'] = $email; + $param['type'] = 'text'; + $rs = $modx->sendmail($param); + if(!$rs) { + $modx->manager->saveFormValues(); + $modx->messageQuit("{$email} - {$_lang['error_sending_email']}"); + } } // Save User Settings -function saveUserSettings($id) -{ - $modx = evolutionCMS(); - $tbl_web_user_settings = $modx->getFullTableName('web_user_settings'); - - $settings = array( - "login_home", - "allowed_ip", - "allowed_days" - ); - - $modx->db->delete($tbl_web_user_settings, "webuser='{$id}'"); - - foreach ($settings as $n) { - $vl = $_POST[$n]; - if (is_array($vl)) { - $vl = implode(",", $vl); - } - if ($vl != '') { - $f = array(); - $f['webuser'] = $id; - $f['setting_name'] = $n; - $f['setting_value'] = $vl; - $f = $modx->db->escape($f); - $modx->db->insert($f, $tbl_web_user_settings); - } - } +function saveUserSettings($id) { + $modx = evolutionCMS(); + $tbl_web_user_settings = $modx->getFullTableName('web_user_settings'); + + $settings = array( + "login_home", + "allowed_ip", + "allowed_days" + ); + + $modx->db->delete($tbl_web_user_settings, "webuser='{$id}'"); + + foreach($settings as $n) { + $vl = $_POST[$n]; + if(is_array($vl)) { + $vl = implode(",", $vl); + } + if($vl != '') { + $f = array(); + $f['webuser'] = $id; + $f['setting_name'] = $n; + $f['setting_value'] = $vl; + $f = $modx->db->escape($f); + $modx->db->insert($f, $tbl_web_user_settings); + } + } } // Web alert - sends an alert to web browser -function webAlertAndQuit($msg) -{ - global $id, $modx; - $mode = $_POST['mode']; - $modx->manager->saveFormValues($mode); - $modx->webAlertAndQuit($msg, "index.php?a={$mode}" . ($mode == '88' ? "&id={$id}" : '')); +function webAlertAndQuit($msg) { + global $id, $modx; + $mode = $_POST['mode']; + $modx->manager->saveFormValues($mode); + $modx->webAlertAndQuit($msg, "index.php?a={$mode}" . ($mode == '88' ? "&id={$id}" : '')); } // Generate password -function generate_password($length = 10) -{ - $allowable_characters = "abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"; - $ps_len = strlen($allowable_characters); - mt_srand((double) microtime() * 1000000); - $pass = ""; - for ($i = 0; $i < $length; $i++) { - $pass .= $allowable_characters[mt_rand(0, $ps_len - 1)]; - } - return $pass; +function generate_password($length = 10) { + $allowable_characters = "abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"; + $ps_len = strlen($allowable_characters); + mt_srand((double) microtime() * 1000000); + $pass = ""; + for($i = 0; $i < $length; $i++) { + $pass .= $allowable_characters[mt_rand(0, $ps_len - 1)]; + } + return $pass; } -function sanitize($str = '', $safecount = 0) -{ - $modx = evolutionCMS(); - $safecount++; - if (1000 < $safecount) { - exit("error too many loops '{$safecount}'"); - } - if (is_array($str)) { - foreach ($str as $i => $v) { - $str[$i] = sanitize($v, $safecount); - } - } else { - // $str = strip_tags($str); // LEAVE < and > intact - $str = htmlspecialchars($str, ENT_NOQUOTES, $modx->config['modx_charset']); - } - return $str; +function sanitize($str = '', $safecount = 0) { + $modx = evolutionCMS(); + $safecount++; + if(1000 < $safecount) { + exit("error too many loops '{$safecount}'"); + } + if(is_array($str)) { + foreach($str as $i => $v) { + $str[$i] = sanitize($v, $safecount); + } + } else { + // $str = strip_tags($str); // LEAVE < and > intact + $str = htmlspecialchars($str, ENT_NOQUOTES, $modx->config['modx_charset']); + } + return $str; } diff --git a/manager/processors/send_message.processor.php b/manager/processors/send_message.processor.php index 7ddd362ec5..868f1ab8d1 100755 --- a/manager/processors/send_message.processor.php +++ b/manager/processors/send_message.processor.php @@ -1,74 +1,70 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('messages')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('messages')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $sendto = $_REQUEST['sendto']; $userid = $_REQUEST['user']; $groupid = $_REQUEST['group']; $subject = $modx->db->escape($_REQUEST['messagesubject']); -if ($subject=="") { - $subject="(no subject)"; -} +if($subject=="") $subject="(no subject)"; $message = $modx->db->escape($_REQUEST['messagebody']); -if ($message=="") { - $message="(no message)"; -} +if($message=="") $message="(no message)"; $postdate = time(); -if ($sendto=='u') { - if ($userid==0) { - $modx->webAlertAndQuit($_lang["error_no_user_selected"]); - } - $modx->db->insert( - array( - 'recipient' => $userid, - 'sender' => $modx->getLoginUserID(), - 'subject' => $subject, - 'message' => $message, - 'postdate' => $postdate, - 'type' => 'Message', - 'private' => 1, - ), $modx->getFullTableName('user_messages')); +if($sendto=='u') { + if($userid==0) { + $modx->webAlertAndQuit($_lang["error_no_user_selected"]); + } + $modx->db->insert( + array( + 'recipient' => $userid, + 'sender' => $modx->getLoginUserID(), + 'subject' => $subject, + 'message' => $message, + 'postdate' => $postdate, + 'type' => 'Message', + 'private' => 1, + ), $modx->getFullTableName('user_messages')); } -if ($sendto=='g') { - if ($groupid==0) { - $modx->webAlertAndQuit($_lang["error_no_group_selected"]); - } - $rs = $modx->db->select('internalKey', $modx->getFullTableName('user_attributes'), "role='{$groupid}' AND internalKey!='" . $modx->getLoginUserID() . "'"); - while ($row=$modx->db->getRow($rs)) { - $modx->db->insert( - array( - 'recipient' => $row['internalKey'], - 'sender' => $modx->getLoginUserID(), - 'subject' => $subject, - 'message' => $message, - 'postdate' => $postdate, - 'type' => 'Message', - 'private' => 0, - ), $modx->getFullTableName('user_messages')); - } +if($sendto=='g') { + if($groupid==0) { + $modx->webAlertAndQuit($_lang["error_no_group_selected"]); + } + $rs = $modx->db->select('internalKey', $modx->getFullTableName('user_attributes'), "role='{$groupid}' AND internalKey!='".$modx->getLoginUserID()."'"); + while ($row=$modx->db->getRow($rs)) { + $modx->db->insert( + array( + 'recipient' => $row['internalKey'], + 'sender' => $modx->getLoginUserID(), + 'subject' => $subject, + 'message' => $message, + 'postdate' => $postdate, + 'type' => 'Message', + 'private' => 0, + ), $modx->getFullTableName('user_messages')); + } } -if ($sendto=='a') { - $rs = $modx->db->select('id', $modx->getFullTableName('manager_users'), "id!='" . $modx->getLoginUserID() . "'"); - while ($row=$modx->db->getRow($rs)) { - $modx->db->insert( - array( - 'recipient' => $row['id'], - 'sender' => $modx->getLoginUserID(), - 'subject' => $subject, - 'message' => $message, - 'postdate' => $postdate, - 'type' => 'Message', - 'private' => 0, - ), $modx->getFullTableName('user_messages')); - } +if($sendto=='a') { + $rs = $modx->db->select('id', $modx->getFullTableName('manager_users'), "id!='".$modx->getLoginUserID()."'"); + while ($row=$modx->db->getRow($rs)) { + $modx->db->insert( + array( + 'recipient' => $row['id'], + 'sender' => $modx->getLoginUserID(), + 'subject' => $subject, + 'message' => $message, + 'postdate' => $postdate, + 'type' => 'Message', + 'private' => 0, + ), $modx->getFullTableName('user_messages')); + } } $header = "Location: index.php?a=10"; diff --git a/manager/processors/undelete_content.processor.php b/manager/processors/undelete_content.processor.php index 928ad54133..84cdc95f72 100755 --- a/manager/processors/undelete_content.processor.php +++ b/manager/processors/undelete_content.processor.php @@ -1,14 +1,14 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('delete_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('delete_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id'])? (int)$_REQUEST['id'] : 0; -if ($id==0) { - $modx->webAlertAndQuit($_lang["error_no_id"]); +if($id==0) { + $modx->webAlertAndQuit($_lang["error_no_id"]); } /************ webber ********/ @@ -16,10 +16,10 @@ $pid=($content['parent']==0?$id:$content['parent']); /************** webber *************/ -$sd=isset($_REQUEST['dir'])?'&dir=' . $_REQUEST['dir']:'&dir=DESC'; -$sb=isset($_REQUEST['sort'])?'&sort=' . $_REQUEST['sort']:'&sort=createdon'; -$pg=isset($_REQUEST['page'])?'&page=' . (int)$_REQUEST['page']:''; -$add_path=$sd . $sb . $pg; +$sd=isset($_REQUEST['dir'])?'&dir='.$_REQUEST['dir']:'&dir=DESC'; +$sb=isset($_REQUEST['sort'])?'&sort='.$_REQUEST['sort']:'&sort=createdon'; +$pg=isset($_REQUEST['page'])?'&page='.(int)$_REQUEST['page']:''; +$add_path=$sd.$sb.$pg; /***********************************/ @@ -31,15 +31,15 @@ $udperms->document = $id; $udperms->role = $_SESSION['mgrRole']; -if (!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); +if(!$udperms->checkPermissions()) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); } // get the timestamp on which the document was deleted. $rs = $modx->db->select('deletedon', $modx->getFullTableName('site_content'), "id='{$id}' AND deleted=1"); $deltime = $modx->db->getValue($rs); -if (!$deltime) { - $modx->webAlertAndQuit("Couldn't find document to determine it's date of deletion!"); +if(!$deltime) { + $modx->webAlertAndQuit("Couldn't find document to determine it's date of deletion!"); } $children = array(); @@ -47,38 +47,38 @@ /** * @param int $parent */ -function getChildren($parent) -{ - $modx = evolutionCMS(); - global $children; - global $deltime; - - $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent='" . (int)$parent . "' AND deleted=1 AND deletedon='" . (int)$deltime . "'"); - // the document has children documents, we'll need to delete those too - while ($row=$modx->db->getRow($rs)) { - $children[] = $row['id']; - getChildren($row['id']); - //echo "Found childNode of parentNode $parent: ".$row['id']."
    "; - } +function getChildren($parent) { + + $modx = evolutionCMS(); + global $children; + global $deltime; + + $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent='".(int)$parent."' AND deleted=1 AND deletedon='".(int)$deltime."'"); + // the document has children documents, we'll need to delete those too + while ($row=$modx->db->getRow($rs)) { + $children[] = $row['id']; + getChildren($row['id']); + //echo "Found childNode of parentNode $parent: ".$row['id']."
    "; + } } getChildren($id); -if (count($children)>0) { - $modx->db->update( - array( - 'deleted' => 0, - 'deletedby' => 0, - 'deletedon' => 0, - ), $modx->getFullTableName('site_content'), "id IN(" . implode(", ", $children) . ")"); +if(count($children)>0) { + $modx->db->update( + array( + 'deleted' => 0, + 'deletedby' => 0, + 'deletedon' => 0, + ), $modx->getFullTableName('site_content'), "id IN(".implode(", ", $children).")"); } //'undelete' the document. $modx->db->update( - array( - 'deleted' => 0, - 'deletedby' => 0, - 'deletedon' => 0, - ), $modx->getFullTableName('site_content'), "id='{$id}'"); + array( + 'deleted' => 0, + 'deletedby' => 0, + 'deletedon' => 0, + ), $modx->getFullTableName('site_content'), "id='{$id}'"); $modx->invokeEvent("OnDocFormUnDelete", array( @@ -93,5 +93,5 @@ function getChildren($parent) $modx->clearCache('full'); // finished emptying cache - redirect -$header="Location: index.php?a=3&id=$pid&r=1" . $add_path; +$header="Location: index.php?a=3&id=$pid&r=1".$add_path; header($header); diff --git a/manager/processors/unpublish_content.processor.php b/manager/processors/unpublish_content.processor.php index 1de6b8cec3..43b5b72ff8 100755 --- a/manager/processors/unpublish_content.processor.php +++ b/manager/processors/unpublish_content.processor.php @@ -1,14 +1,14 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('save_document')||!$modx->hasPermission('publish_document')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('save_document')||!$modx->hasPermission('publish_document')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } $id = isset($_REQUEST['id'])? (int)$_REQUEST['id'] : 0; -if ($id==0) { - $modx->webAlertAndQuit($_lang["error_no_id"]); +if($id==0) { + $modx->webAlertAndQuit($_lang["error_no_id"]); } /************webber ********/ @@ -16,10 +16,10 @@ $pid=($content['parent']==0?$id:$content['parent']); /************** webber *************/ -$sd=isset($_REQUEST['dir'])?'&dir=' . $_REQUEST['dir']:'&dir=DESC'; -$sb=isset($_REQUEST['sort'])?'&sort=' . $_REQUEST['sort']:'&sort=createdon'; -$pg=isset($_REQUEST['page'])?'&page=' . (int)$_REQUEST['page']:''; -$add_path=$sd . $sb . $pg; +$sd=isset($_REQUEST['dir'])?'&dir='.$_REQUEST['dir']:'&dir=DESC'; +$sb=isset($_REQUEST['sort'])?'&sort='.$_REQUEST['sort']:'&sort=createdon'; +$pg=isset($_REQUEST['page'])?'&page='.(int)$_REQUEST['page']:''; +$add_path=$sd.$sb.$pg; /***********************************/ @@ -32,24 +32,24 @@ $udperms->document = $id; $udperms->role = $_SESSION['mgrRole']; -if (!$udperms->checkPermissions()) { - $modx->webAlertAndQuit($_lang["access_permission_denied"]); +if(!$udperms->checkPermissions()) { + $modx->webAlertAndQuit($_lang["access_permission_denied"]); } // update the document $modx->db->update( - array( - 'published' => 0, - 'pub_date' => 0, - 'unpub_date' => 0, - 'editedby' => $modx->getLoginUserID(), - 'editedon' => time(), - 'publishedby' => 0, - 'publishedon' => 0, - ), $modx->getFullTableName('site_content'), "id='{$id}'"); + array( + 'published' => 0, + 'pub_date' => 0, + 'unpub_date' => 0, + 'editedby' => $modx->getLoginUserID(), + 'editedon' => time(), + 'publishedby' => 0, + 'publishedon' => 0, + ), $modx->getFullTableName('site_content'), "id='{$id}'"); // invoke OnDocUnPublished event -$modx->invokeEvent("OnDocUnPublished", array("docid"=>$id)); +$modx->invokeEvent("OnDocUnPublished",array("docid"=>$id)); // Set the item name for logger $_SESSION['itemname'] = $content['pagetitle']; @@ -57,6 +57,6 @@ // empty cache $modx->clearCache('full'); -$header="Location: index.php?a=3&id=$pid&r=1" . $add_path; +$header="Location: index.php?a=3&id=$pid&r=1".$add_path; header($header); diff --git a/manager/processors/user_documents_permissions.class.php b/manager/processors/user_documents_permissions.class.php index 7fbf82d6a0..50fdf27bbe 100755 --- a/manager/processors/user_documents_permissions.class.php +++ b/manager/processors/user_documents_permissions.class.php @@ -24,6 +24,7 @@ class udperms */ public function checkPermissions() { + global $udperms_allowroot; $modx = evolutionCMS(); diff --git a/manager/processors/web_access_groups.processor.php b/manager/processors/web_access_groups.processor.php index 82c1aa24e0..477bff505f 100755 --- a/manager/processors/web_access_groups.processor.php +++ b/manager/processors/web_access_groups.processor.php @@ -1,9 +1,9 @@ INCLUDE_ORDERING_ERROR

    Please use the EVO Content Manager instead of accessing this file directly."); } -if (!$modx->hasPermission('web_access_permissions')) { - $modx->webAlertAndQuit($_lang["error_no_privileges"]); +if(!$modx->hasPermission('web_access_permissions')) { + $modx->webAlertAndQuit($_lang["error_no_privileges"]); } // web access group processor. @@ -20,111 +20,111 @@ $operation = $_REQUEST['operation']; switch ($operation) { - case "add_user_group": - $newgroup = $_REQUEST['newusergroup']; - if (empty($newgroup)) { - $modx->webAlertAndQuit("No group name specified."); - } else { - $id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_webgroup_names); + case "add_user_group" : + $newgroup = $_REQUEST['newusergroup']; + if(empty($newgroup)) { + $modx->webAlertAndQuit("No group name specified."); + } else { + $id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_webgroup_names); - // invoke OnWebCreateGroup event - $modx->invokeEvent('OnWebCreateGroup', array( - 'groupid' => $id, - 'groupname' => $newgroup, - )); - } - break; - case "add_document_group": - $newgroup = $_REQUEST['newdocgroup']; - if (empty($newgroup)) { - $modx->webAlertAndQuit("No group name specified."); - } else { - $id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_documentgroup_names); + // invoke OnWebCreateGroup event + $modx->invokeEvent('OnWebCreateGroup', array( + 'groupid' => $id, + 'groupname' => $newgroup, + )); + } + break; + case "add_document_group" : + $newgroup = $_REQUEST['newdocgroup']; + if(empty($newgroup)) { + $modx->webAlertAndQuit("No group name specified."); + } else { + $id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_documentgroup_names); - // invoke OnCreateDocGroup event - $modx->invokeEvent('OnCreateDocGroup', array( - 'groupid' => $id, - 'groupname' => $newgroup, - )); - } - break; - case "delete_user_group": - $updategroupaccess = true; - $usergroup = (int)$_REQUEST['usergroup']; - if (empty($usergroup)) { - $modx->webAlertAndQuit("No user group id specified for deletion."); - } else { - $modx->db->delete($tbl_webgroup_names, "id='{$usergroup}'"); + // invoke OnCreateDocGroup event + $modx->invokeEvent('OnCreateDocGroup', array( + 'groupid' => $id, + 'groupname' => $newgroup, + )); + } + break; + case "delete_user_group" : + $updategroupaccess = true; + $usergroup = (int)$_REQUEST['usergroup']; + if(empty($usergroup)) { + $modx->webAlertAndQuit("No user group id specified for deletion."); + } else { + $modx->db->delete($tbl_webgroup_names, "id='{$usergroup}'"); - $modx->db->delete($tbl_webgroup_access, "webgroup='{$usergroup}'"); + $modx->db->delete($tbl_webgroup_access, "webgroup='{$usergroup}'"); - $modx->db->delete($tbl_web_groups, "webuser='{$usergroup}'"); - } - break; - case "delete_document_group": - $group = (int)$_REQUEST['documentgroup']; - if (empty($group)) { - $modx->webAlertAndQuit("No document group id specified for deletion."); - } else { - $modx->db->delete($tbl_documentgroup_names, "id='{$group}'"); + $modx->db->delete($tbl_web_groups, "webuser='{$usergroup}'"); + } + break; + case "delete_document_group" : + $group = (int)$_REQUEST['documentgroup']; + if(empty($group)) { + $modx->webAlertAndQuit("No document group id specified for deletion."); + } else { + $modx->db->delete($tbl_documentgroup_names, "id='{$group}'"); - $modx->db->delete($tbl_webgroup_access, "documentgroup='{$group}'"); + $modx->db->delete($tbl_webgroup_access, "documentgroup='{$group}'"); - $modx->db->delete($tbl_document_groups, "document_group='{$group}'"); - } - break; - case "rename_user_group": - $newgroupname = $_REQUEST['newgroupname']; - if (empty($newgroupname)) { - $modx->webAlertAndQuit("No group name specified."); - } - $groupid = (int)$_REQUEST['groupid']; - if (empty($groupid)) { - $modx->webAlertAndQuit("No user group id specified for rename."); - } - $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_webgroup_names, "id='{$groupid}'"); - break; - case "rename_document_group": - $newgroupname = $_REQUEST['newgroupname']; - if (empty($newgroupname)) { - $modx->webAlertAndQuit("No group name specified."); - } - $groupid = (int)$_REQUEST['groupid']; - if (empty($groupid)) { - $modx->webAlertAndQuit("No document group id specified for rename."); - } - $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_documentgroup_names, "id='{$groupid}'"); - break; - case "add_document_group_to_user_group": - $updategroupaccess = true; - $usergroup = (int)$_REQUEST['usergroup']; - $docgroup = (int)$_REQUEST['docgroup']; - $rs = $modx->db->select('COUNT(*)', $tbl_webgroup_access, "webgroup='{$usergroup}' AND documentgroup='{$docgroup}'"); - $limit = $modx->db->getValue($rs); - if ($limit<=0) { - $modx->db->insert(array('webgroup'=>$usergroup, 'documentgroup'=>$docgroup), $tbl_webgroup_access); - } else { - //alert user that coupling already exists? - } - break; - case "remove_document_group_from_user_group": - $updategroupaccess = true; - $coupling = (int)$_REQUEST['coupling']; - $modx->db->delete($tbl_webgroup_access, "id='{$coupling}'"); - break; - default: - $modx->webAlertAndQuit("No operation set in request."); + $modx->db->delete($tbl_document_groups, "document_group='{$group}'"); + } + break; + case "rename_user_group" : + $newgroupname = $_REQUEST['newgroupname']; + if(empty($newgroupname)) { + $modx->webAlertAndQuit("No group name specified."); + } + $groupid = (int)$_REQUEST['groupid']; + if(empty($groupid)) { + $modx->webAlertAndQuit("No user group id specified for rename."); + } + $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_webgroup_names, "id='{$groupid}'"); + break; + case "rename_document_group" : + $newgroupname = $_REQUEST['newgroupname']; + if(empty($newgroupname)) { + $modx->webAlertAndQuit("No group name specified."); + } + $groupid = (int)$_REQUEST['groupid']; + if(empty($groupid)) { + $modx->webAlertAndQuit("No document group id specified for rename."); + } + $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_documentgroup_names, "id='{$groupid}'"); + break; + case "add_document_group_to_user_group" : + $updategroupaccess = true; + $usergroup = (int)$_REQUEST['usergroup']; + $docgroup = (int)$_REQUEST['docgroup']; + $rs = $modx->db->select('COUNT(*)', $tbl_webgroup_access, "webgroup='{$usergroup}' AND documentgroup='{$docgroup}'"); + $limit = $modx->db->getValue($rs); + if($limit<=0) { + $modx->db->insert(array('webgroup'=>$usergroup, 'documentgroup'=>$docgroup), $tbl_webgroup_access); + } else { + //alert user that coupling already exists? + } + break; + case "remove_document_group_from_user_group" : + $updategroupaccess = true; + $coupling = (int)$_REQUEST['coupling']; + $modx->db->delete($tbl_webgroup_access, "id='{$coupling}'"); + break; + default : + $modx->webAlertAndQuit("No operation set in request."); } // secure web documents - flag as private -if ($updategroupaccess==true) { - include MODX_MANAGER_PATH . "includes/secure_web_documents.inc.php"; - secureWebDocument(); +if($updategroupaccess==true){ + include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php"; + secureWebDocument(); - // Update the private group column - $modx->db->update( - 'dgn.private_webgroup = (wga.webgroup IS NOT NULL)', - "{$tbl_documentgroup_names} AS dgn LEFT JOIN {$tbl_webgroup_access} AS wga ON wga.documentgroup = dgn.id"); + // Update the private group column + $modx->db->update( + 'dgn.private_webgroup = (wga.webgroup IS NOT NULL)', + "{$tbl_documentgroup_names} AS dgn LEFT JOIN {$tbl_webgroup_access} AS wga ON wga.documentgroup = dgn.id"); } $header = "Location: index.php?a=91"; From 2acc53fa8ec4a1a638227aeef2baf5166ac9021b Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Fri, 1 Jun 2018 00:54:40 +0300 Subject: [PATCH 248/274] Revert "Code style" This reverts commit d568f89d2847574442951ab39cdb4091ac5730e0. --- .gitignore | 2 -- .php_cs.dist | 27 --------------------------- composer.json | 12 ------------ phpcs.xml | 37 ------------------------------------- phpmd.xml | 24 ------------------------ 5 files changed, 102 deletions(-) delete mode 100644 .php_cs.dist delete mode 100644 phpcs.xml delete mode 100644 phpmd.xml diff --git a/.gitignore b/.gitignore index 49b1103bb9..adf28e291b 100644 --- a/.gitignore +++ b/.gitignore @@ -69,8 +69,6 @@ Desktop.ini .idea .vagrant .rocketeer -.php_cs -.php_cs.cache # except do not ignore .gitignore !.gitignore diff --git a/.php_cs.dist b/.php_cs.dist deleted file mode 100644 index eac63b1805..0000000000 --- a/.php_cs.dist +++ /dev/null @@ -1,27 +0,0 @@ -append(array( - 'index.php' - ))->exclude(array( - 'manager/actions/help/', - 'manager/includes/lang/' - ))->in(__DIR__ . '/manager/') - ->notName('*.phtml'); - -return PhpCsFixer\Config::create() - ->setRules([ - '@PSR2' => true, - '@Symfony:risky' => false, - 'concat_space' => array('spacing' => 'one'), - 'array_syntax' => array('syntax' => 'long'), - 'method_argument_space' => true, - 'no_unused_imports' => true, - 'protected_to_private' => false, - ]) - ->setIndent(" ") - ->setLineEnding("\r\n") - ->setFinder($finder); diff --git a/composer.json b/composer.json index a67e256663..390daaf71c 100644 --- a/composer.json +++ b/composer.json @@ -16,12 +16,6 @@ "email": "dmi3yy@gmail.com", "homepage": "http://dmi3yy.com", "role": "Developer" - }, - { - "name": "Evgeniy Borisov", - "email": "modx@agel-nash.ru", - "homepage": "https://agel-nash.ru", - "role": "Web security expert" } ], "support": { @@ -37,12 +31,6 @@ "require": { "php": ">=5.6" }, - "require-dev": { - "roave/security-advisories": "dev-master", - "phpmd/phpmd": "~2.0", - "friendsofphp/php-cs-fixer": "~2.11", - "squizlabs/php_codesniffer": "~3.0" - }, "minimum-stability": "dev", "prefer-stable": true } diff --git a/phpcs.xml b/phpcs.xml deleted file mode 100644 index 98b945ebce..0000000000 --- a/phpcs.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - The Evolution coding standard. - - - - - - - - manager/ - - */lang/* - - - - - - - - - - - - - - - - - - - - - - - diff --git a/phpmd.xml b/phpmd.xml deleted file mode 100644 index 5fb6440f05..0000000000 --- a/phpmd.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - From 0b7a4ba784385c3460a33321fc864085d16617c6 Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Fri, 1 Jun 2018 10:39:44 +0300 Subject: [PATCH 249/274] Update FormLister --- assets/snippets/FormLister/lib/FileValidator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/snippets/FormLister/lib/FileValidator.php b/assets/snippets/FormLister/lib/FileValidator.php index 993c5d6bb5..5576b64ee3 100644 --- a/assets/snippets/FormLister/lib/FileValidator.php +++ b/assets/snippets/FormLister/lib/FileValidator.php @@ -81,7 +81,7 @@ public static function allowed($value, $allowed) * @param $value * @return bool */ - public statuc function images($value) + public static function images($value) { return self::allowed($value, array("jpg", "jpeg", "png", "gif", "bmp")); } From 0c91f365ce2175bee5e6d55b2f47821529eb3921 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=91=D0=BE?= =?UTF-8?q?=D1=80=D0=B8=D1=81=D0=BE=D0=B2?= Date: Tue, 5 Jun 2018 00:51:07 +0500 Subject: [PATCH 250/274] Update preload.functions.inc.php --- manager/includes/preload.functions.inc.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/manager/includes/preload.functions.inc.php b/manager/includes/preload.functions.inc.php index e348415912..4f4a4eed13 100755 --- a/manager/includes/preload.functions.inc.php +++ b/manager/includes/preload.functions.inc.php @@ -16,8 +16,13 @@ function evolutionCMS() } define('MODX_CLASS', 'DocumentParser'); } - $obj = new ReflectionClass(MODX_CLASS); - return $obj->newInstanceWithoutConstructor()->getInstance(); + + global $modx; + if ($modx === null) { + $obj = new ReflectionClass(MODX_CLASS); + $modx = $obj->newInstanceWithoutConstructor()->getInstance(); + } + return $modx } } From 21b31569c4d68a6378a24650c55d4558ebdd6080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=91=D0=BE?= =?UTF-8?q?=D1=80=D0=B8=D1=81=D0=BE=D0=B2?= Date: Tue, 5 Jun 2018 00:53:05 +0500 Subject: [PATCH 251/274] Update preload.functions.inc.php --- manager/includes/preload.functions.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/includes/preload.functions.inc.php b/manager/includes/preload.functions.inc.php index 4f4a4eed13..68e4bdb714 100755 --- a/manager/includes/preload.functions.inc.php +++ b/manager/includes/preload.functions.inc.php @@ -22,7 +22,7 @@ function evolutionCMS() $obj = new ReflectionClass(MODX_CLASS); $modx = $obj->newInstanceWithoutConstructor()->getInstance(); } - return $modx + return $modx; } } From 0f0095dd733474781bfb35fb2b32c56fec337871 Mon Sep 17 00:00:00 2001 From: dmi3yy Date: Tue, 5 Jun 2018 00:01:47 +0300 Subject: [PATCH 252/274] fix style for 1200 - --- install/assets/plugins/OutdatedExtrasCheck.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/assets/plugins/OutdatedExtrasCheck.tpl b/install/assets/plugins/OutdatedExtrasCheck.tpl index faacb57ac1..e1fe43acb8 100755 --- a/install/assets/plugins/OutdatedExtrasCheck.tpl +++ b/install/assets/plugins/OutdatedExtrasCheck.tpl @@ -273,7 +273,7 @@ $wdgTitle = 'EVO '.$EVOversion.' - '.$_oec_lang['title'].''; $widgets['xtraCheck'] = array( 'menuindex' =>'0', 'id' => 'xtraCheck'.$pluginid.'', - 'cols' => 'col-md-12', + 'cols' => 'col-12', 'headAttr' => 'style="background-color:#B60205; color:#FFFFFF;"', 'bodyAttr' => '', 'icon' => 'fa-warning', From 0194621780532b2857581a37591bf2f1b7555e01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=91=D0=BE?= =?UTF-8?q?=D1=80=D0=B8=D1=81=D0=BE=D0=B2?= Date: Tue, 5 Jun 2018 03:29:46 +0500 Subject: [PATCH 253/274] Conflict with DLTemplate::renderDoc() --- manager/includes/document.parser.class.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index 20f88fa6c4..c73e063262 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -203,8 +203,8 @@ public function __construct() $this->q = self::_getCleanQueryString(); } - - final private function __clone() + + final public function __clone() { } /** From 81c160eea2724d3532a3f52ca723267620b8fc85 Mon Sep 17 00:00:00 2001 From: Agel_Nash Date: Wed, 6 Jun 2018 02:12:53 +0500 Subject: [PATCH 254/274] Native support mixed types in a output statement --- .../includes/document.parser.class.inc.php | 31 ++++++++++++++++--- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index c73e063262..b3e60f605b 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -203,7 +203,7 @@ public function __construct() $this->q = self::_getCleanQueryString(); } - + final public function __clone() { } @@ -5442,8 +5442,8 @@ public function invokeEvent($evtName, $extParams = array()) $this->pluginsCode .= '
    '; $this->pluginsTime["{$evtName} / {$pluginName}"] += $eventtime; } - if ($e->_output != '') { - $results[] = $e->_output; + if ($e->getOutput() != '') { + $results[] = $e->getOutput(); } if ($e->_propagate != true) { break; @@ -6704,7 +6704,11 @@ class SystemEvent { public $name = ''; public $_propagate = true; - public $_output = ''; + /** + * @deprecated use setOutput(), getOutput() + * @var string + */ + public $_output; public $activated = false; public $activePlugin = ''; public $params = array(); @@ -6743,12 +6747,29 @@ public function alert($msg) * Output * * @param string $msg + * @deprecated see addOutput */ public function output($msg) { $this->_output .= $msg; } + /** + * @param mixed $data + */ + public function setOutput($data) + { + $this->_output = $data; + } + + /** + * @return mixed + */ + public function getOutput() + { + return $this->_output; + } + /** * Stop event propogation */ @@ -6761,7 +6782,7 @@ public function _resetEventObject() { unset ($this->returnedValues); $this->name = ""; - $this->_output = ""; + $this->setOutput(null); $this->_propagate = true; $this->activated = false; } From c60c6a8e60a7c3961c22cb5f0b34cdc16037098e Mon Sep 17 00:00:00 2001 From: Agel_Nash Date: Wed, 6 Jun 2018 03:07:03 +0500 Subject: [PATCH 255/274] OnBeforeMinifyCss --- install/setup.sql | 1 + manager/includes/header.inc.php | 41 +++++++++++++++++++++++---------- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/install/setup.sql b/install/setup.sql index 18533f722d..bae0c3cb95 100755 --- a/install/setup.sql +++ b/install/setup.sql @@ -1102,6 +1102,7 @@ REPLACE INTO `{PREFIX}system_eventnames` ('214','OnManagerMenuPrerender','2',''), ('215','OnManagerTopPrerender','2',''), ('224','OnDocFormTemplateRender','1','Documents'), +('225','OnBeforeMinifyCss', '1', ''), ('999','OnPageUnauthorized','1',''), ('1000','OnPageNotFound','1',''), ('1001','OnFileBrowserUpload','1','File Browser Events'); diff --git a/manager/includes/header.inc.php b/manager/includes/header.inc.php index 147c0f6e04..048f0a17e0 100755 --- a/manager/includes/header.inc.php +++ b/manager/includes/header.inc.php @@ -30,19 +30,36 @@ if ($modx->config['manager_theme'] == 'default') { if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) { + $files = array( + 'bootstrap' => MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css', + 'font-awesome' => MODX_MANAGER_PATH . 'media/style/common/font-awesome/css/font-awesome.min.css', + 'fonts' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/fonts.css', + 'forms' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/forms.css', + 'mainmenu' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/mainmenu.css', + 'tree' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tree.css', + 'custom' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/custom.css', + 'tabpane' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tabpane.css', + 'contextmenu' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/contextmenu.css', + 'index' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/index.css', + 'main' => MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/main.css' + ); + $evtOut = $modx->invokeEvent('OnBeforeMinifyCss', array( + 'files' => $files, + 'source' => 'manager', + 'theme' => $modx->config['manager_theme'] + )); + switch (true) { + case empty($evtOut): + case is_array($evtOut) && count($evtOut) === 0: + break; + case is_array($evtOut) && count($evtOut) === 1: + $files = $evtOut[0]; + break; + default: + $modx->webAlertAndQuit(sprintf($_lang['invalid_event_response'], 'OnBeforeMinifyManagerCss')); + } require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php'; - $minifier = new Formatter\CSSMinify(); - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css'); - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/font-awesome/css/font-awesome.min.css'); - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/fonts.css'); - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/forms.css'); - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/mainmenu.css'); - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tree.css'); - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/custom.css'); - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tabpane.css'); - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/contextmenu.css'); - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/index.css'); - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/main.css'); + $minifier = new Formatter\CSSMinify($files); $css = $minifier->minify(); file_put_contents( MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', From bbefb5a284f42b3973d0d37ecf8d6a2ba24e6641 Mon Sep 17 00:00:00 2001 From: Agel_Nash Date: Wed, 6 Jun 2018 03:18:18 +0500 Subject: [PATCH 256/274] $_lang['invalid_event_response'] --- manager/includes/lang/english.inc.php | 2 ++ manager/includes/lang/russian-UTF8.inc.php | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/manager/includes/lang/english.inc.php b/manager/includes/lang/english.inc.php index 69432a70ad..3531f93db9 100755 --- a/manager/includes/lang/english.inc.php +++ b/manager/includes/lang/english.inc.php @@ -1503,3 +1503,5 @@ $_lang['manager_menu_position_title'] = 'Main menu position'; $_lang['manager_menu_position_top'] = 'top'; $_lang['manager_menu_position_left'] = 'left'; + +$_lang['invalid_event_response'] = 'The %s event has ivalid output'; diff --git a/manager/includes/lang/russian-UTF8.inc.php b/manager/includes/lang/russian-UTF8.inc.php index 6789971195..1da7dd9fd0 100755 --- a/manager/includes/lang/russian-UTF8.inc.php +++ b/manager/includes/lang/russian-UTF8.inc.php @@ -1474,4 +1474,6 @@ $_lang['manager_menu_position_title'] = 'Расположение основного меню'; $_lang['manager_menu_position_top'] = 'вверху'; -$_lang['manager_menu_position_left'] = 'слева'; \ No newline at end of file +$_lang['manager_menu_position_left'] = 'слева'; + +$_lang['invalid_event_response'] = 'Событие %s вернуло неверный результат'; \ No newline at end of file From a3fc8c57c9326028ed23913de7458dc90c402f82 Mon Sep 17 00:00:00 2001 From: Agel_Nash Date: Wed, 6 Jun 2018 03:42:40 +0500 Subject: [PATCH 257/274] refactoring webAlertAndQuit --- .../includes/document.parser.class.inc.php | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/manager/includes/document.parser.class.inc.php b/manager/includes/document.parser.class.inc.php index c73e063262..8f417d1f2e 100755 --- a/manager/includes/document.parser.class.inc.php +++ b/manager/includes/document.parser.class.inc.php @@ -203,7 +203,7 @@ public function __construct() $this->q = self::_getCleanQueryString(); } - + final public function __clone() { } @@ -3162,22 +3162,31 @@ public function getChildIds($id, $depth = 10, $children = array()) * @param string $msg Message to show * @param string $url URL to redirect to */ - public function webAlertAndQuit($msg, $url = "") + public function webAlertAndQuit($msg, $url = '') { global $modx_manager_charset; - if (substr(strtolower($url), 0, 11) == "javascript:") { - $fnc = substr($url, 11); - } elseif ($url) { - $fnc = "window.location.href='" . addslashes($url) . "';"; - } else { - $fnc = "history.back(-1);"; + switch (true) { + case (0 === stripos($url, 0, 'javascript:')): + $fnc = substr($url, 11); + break; + case $url === '#': + $fnc = ''; + break; + case empty($url): + $fnc = 'history.back(-1);'; + break; + default: + $fnc = "window.location.href='" . addslashes($url) . "';"; } + echo " MODX :: Alert