@@ -3,12 +3,12 @@ discard block |
||
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | if(!$modx->hasPermission('new_snippet')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | $id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
10 | 10 | if($id==0) { |
11 | - $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
11 | + $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | // count duplicates |
@@ -19,14 +19,14 @@ discard block |
||
19 | 19 | |
20 | 20 | // duplicate Snippet |
21 | 21 | $newid = $modx->getDatabase()->insert( |
22 | - array( |
|
23 | - 'name'=>'', |
|
24 | - 'description'=>'', |
|
25 | - 'snippet'=>'', |
|
26 | - 'properties'=>'', |
|
27 | - 'category'=>'', |
|
28 | - ), $modx->getDatabase()->getFullTableName('site_snippets'), // Insert into |
|
29 | - "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, snippet, properties, category", $modx->getDatabase()->getFullTableName('site_snippets'), "id='{$id}'"); // Copy from |
|
22 | + array( |
|
23 | + 'name'=>'', |
|
24 | + 'description'=>'', |
|
25 | + 'snippet'=>'', |
|
26 | + 'properties'=>'', |
|
27 | + 'category'=>'', |
|
28 | + ), $modx->getDatabase()->getFullTableName('site_snippets'), // Insert into |
|
29 | + "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, snippet, properties, category", $modx->getDatabase()->getFullTableName('site_snippets'), "id='{$id}'"); // Copy from |
|
30 | 30 | |
31 | 31 | // Set the item name for logger |
32 | 32 | $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_snippets'), "id='{$newid}'")); |
@@ -1,20 +1,20 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if(!$modx->hasPermission('new_snippet')) { |
|
5 | +if (!$modx->hasPermission('new_snippet')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -$id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
|
10 | -if($id==0) { |
|
9 | +$id = isset($_GET['id']) ? (int) $_GET['id'] : 0; |
|
10 | +if ($id == 0) { |
|
11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
12 | 12 | } |
13 | 13 | |
14 | 14 | // count duplicates |
15 | 15 | $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_snippets'), "id='{$id}'")); |
16 | 16 | $count = $modx->getDatabase()->getRecordCount($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_snippets'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'")); |
17 | -if($count>=1) $count = ' '.($count+1); |
|
17 | +if ($count >= 1) $count = ' '.($count + 1); |
|
18 | 18 | else $count = ''; |
19 | 19 | |
20 | 20 | // duplicate Snippet |
@@ -33,5 +33,5 @@ discard block |
||
33 | 33 | $_SESSION['itemname'] = $name; |
34 | 34 | |
35 | 35 | // finish duplicating - redirect to new snippet |
36 | -$header="Location: index.php?r=2&a=22&id=$newid"; |
|
36 | +$header = "Location: index.php?r=2&a=22&id=$newid"; |
|
37 | 37 | header($header); |
@@ -14,8 +14,11 @@ |
||
14 | 14 | // count duplicates |
15 | 15 | $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_snippets'), "id='{$id}'")); |
16 | 16 | $count = $modx->getDatabase()->getRecordCount($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_snippets'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'")); |
17 | -if($count>=1) $count = ' '.($count+1); |
|
18 | -else $count = ''; |
|
17 | +if($count>=1) { |
|
18 | + $count = ' '.($count+1); |
|
19 | +} else { |
|
20 | + $count = ''; |
|
21 | +} |
|
19 | 22 | |
20 | 23 | // duplicate Snippet |
21 | 24 | $newid = $modx->getDatabase()->insert( |
@@ -3,12 +3,12 @@ discard block |
||
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | if(!$modx->hasPermission('delete_document')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | $id = isset($_REQUEST['id'])? (int)$_REQUEST['id'] : 0; |
10 | 10 | if($id==0) { |
11 | - $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
11 | + $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | /************ webber ********/ |
@@ -31,14 +31,14 @@ discard block |
||
31 | 31 | $udperms->role = $_SESSION['mgrRole']; |
32 | 32 | |
33 | 33 | if(!$udperms->checkPermissions()) { |
34 | - $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
34 | + $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | // get the timestamp on which the document was deleted. |
38 | 38 | $rs = $modx->getDatabase()->select('deletedon', $modx->getDatabase()->getFullTableName('site_content'), "id='{$id}' AND deleted=1"); |
39 | 39 | $deltime = $modx->getDatabase()->getValue($rs); |
40 | 40 | if(!$deltime) { |
41 | - $modx->webAlertAndQuit("Couldn't find document to determine it's date of deletion!"); |
|
41 | + $modx->webAlertAndQuit("Couldn't find document to determine it's date of deletion!"); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | $children = array(); |
@@ -46,20 +46,20 @@ discard block |
||
46 | 46 | getChildrenForUnDelete($id); |
47 | 47 | |
48 | 48 | if(count($children)>0) { |
49 | - $modx->getDatabase()->update( |
|
50 | - array( |
|
51 | - 'deleted' => 0, |
|
52 | - 'deletedby' => 0, |
|
53 | - 'deletedon' => 0, |
|
54 | - ), $modx->getDatabase()->getFullTableName('site_content'), "id IN(".implode(", ", $children).")"); |
|
49 | + $modx->getDatabase()->update( |
|
50 | + array( |
|
51 | + 'deleted' => 0, |
|
52 | + 'deletedby' => 0, |
|
53 | + 'deletedon' => 0, |
|
54 | + ), $modx->getDatabase()->getFullTableName('site_content'), "id IN(".implode(", ", $children).")"); |
|
55 | 55 | } |
56 | 56 | //'undelete' the document. |
57 | 57 | $modx->getDatabase()->update( |
58 | - array( |
|
59 | - 'deleted' => 0, |
|
60 | - 'deletedby' => 0, |
|
61 | - 'deletedon' => 0, |
|
62 | - ), $modx->getDatabase()->getFullTableName('site_content'), "id='{$id}'"); |
|
58 | + array( |
|
59 | + 'deleted' => 0, |
|
60 | + 'deletedby' => 0, |
|
61 | + 'deletedon' => 0, |
|
62 | + ), $modx->getDatabase()->getFullTableName('site_content'), "id='{$id}'"); |
|
63 | 63 | |
64 | 64 | $modx->invokeEvent("OnDocFormUnDelete", |
65 | 65 | array( |
@@ -1,25 +1,25 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if(!$modx->hasPermission('delete_document')) { |
|
5 | +if (!$modx->hasPermission('delete_document')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -$id = isset($_REQUEST['id'])? (int)$_REQUEST['id'] : 0; |
|
10 | -if($id==0) { |
|
9 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
10 | +if ($id == 0) { |
|
11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
12 | 12 | } |
13 | 13 | |
14 | 14 | /************ webber ********/ |
15 | -$content=$modx->getDatabase()->getRow($modx->getDatabase()->select('parent, pagetitle', $modx->getDatabase()->getFullTableName('site_content'), "id='{$id}'")); |
|
16 | -$pid=($content['parent']==0?$id:$content['parent']); |
|
15 | +$content = $modx->getDatabase()->getRow($modx->getDatabase()->select('parent, pagetitle', $modx->getDatabase()->getFullTableName('site_content'), "id='{$id}'")); |
|
16 | +$pid = ($content['parent'] == 0 ? $id : $content['parent']); |
|
17 | 17 | |
18 | 18 | /************** webber *************/ |
19 | -$sd=isset($_REQUEST['dir'])?'&dir='.$_REQUEST['dir']:'&dir=DESC'; |
|
20 | -$sb=isset($_REQUEST['sort'])?'&sort='.$_REQUEST['sort']:'&sort=createdon'; |
|
21 | -$pg=isset($_REQUEST['page'])?'&page='.(int)$_REQUEST['page']:''; |
|
22 | -$add_path=$sd.$sb.$pg; |
|
19 | +$sd = isset($_REQUEST['dir']) ? '&dir='.$_REQUEST['dir'] : '&dir=DESC'; |
|
20 | +$sb = isset($_REQUEST['sort']) ? '&sort='.$_REQUEST['sort'] : '&sort=createdon'; |
|
21 | +$pg = isset($_REQUEST['page']) ? '&page='.(int) $_REQUEST['page'] : ''; |
|
22 | +$add_path = $sd.$sb.$pg; |
|
23 | 23 | |
24 | 24 | /***********************************/ |
25 | 25 | |
@@ -30,14 +30,14 @@ discard block |
||
30 | 30 | $udperms->document = $id; |
31 | 31 | $udperms->role = $_SESSION['mgrRole']; |
32 | 32 | |
33 | -if(!$udperms->checkPermissions()) { |
|
33 | +if (!$udperms->checkPermissions()) { |
|
34 | 34 | $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
35 | 35 | } |
36 | 36 | |
37 | 37 | // get the timestamp on which the document was deleted. |
38 | 38 | $rs = $modx->getDatabase()->select('deletedon', $modx->getDatabase()->getFullTableName('site_content'), "id='{$id}' AND deleted=1"); |
39 | 39 | $deltime = $modx->getDatabase()->getValue($rs); |
40 | -if(!$deltime) { |
|
40 | +if (!$deltime) { |
|
41 | 41 | $modx->webAlertAndQuit("Couldn't find document to determine it's date of deletion!"); |
42 | 42 | } |
43 | 43 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | getChildrenForUnDelete($id); |
47 | 47 | |
48 | -if(count($children)>0) { |
|
48 | +if (count($children) > 0) { |
|
49 | 49 | $modx->getDatabase()->update( |
50 | 50 | array( |
51 | 51 | 'deleted' => 0, |
@@ -74,5 +74,5 @@ discard block |
||
74 | 74 | $modx->clearCache('full'); |
75 | 75 | |
76 | 76 | // finished emptying cache - redirect |
77 | -$header="Location: index.php?a=3&id=$pid&r=1".$add_path; |
|
77 | +$header = "Location: index.php?a=3&id=$pid&r=1".$add_path; |
|
78 | 78 | header($header); |
@@ -4,237 +4,237 @@ discard block |
||
4 | 4 | */ |
5 | 5 | |
6 | 6 | $sitemenu['bars'] = array( |
7 | - 'bars', |
|
8 | - 'main', |
|
9 | - '<i class="fa fa-bars"></i>', |
|
10 | - 'javascript:;', |
|
11 | - $_lang['home'], |
|
12 | - 'modx.resizer.toggle(); return false;', |
|
13 | - ' return false;', |
|
14 | - '', |
|
15 | - 0, |
|
16 | - 10, |
|
17 | - '' |
|
7 | + 'bars', |
|
8 | + 'main', |
|
9 | + '<i class="fa fa-bars"></i>', |
|
10 | + 'javascript:;', |
|
11 | + $_lang['home'], |
|
12 | + 'modx.resizer.toggle(); return false;', |
|
13 | + ' return false;', |
|
14 | + '', |
|
15 | + 0, |
|
16 | + 10, |
|
17 | + '' |
|
18 | 18 | ); |
19 | 19 | |
20 | 20 | //mainMenu |
21 | 21 | $sitemenu['site'] = array( |
22 | - 'site', |
|
23 | - 'main', |
|
24 | - '<i class="fa fa-tachometer"></i><span class="menu-item-text">' . $_lang['home'] . '</span>', |
|
25 | - 'index.php?a=2', |
|
26 | - $_lang['home'], |
|
27 | - '', |
|
28 | - '', |
|
29 | - 'main', |
|
30 | - 0, |
|
31 | - 10, |
|
32 | - 'active' |
|
22 | + 'site', |
|
23 | + 'main', |
|
24 | + '<i class="fa fa-tachometer"></i><span class="menu-item-text">' . $_lang['home'] . '</span>', |
|
25 | + 'index.php?a=2', |
|
26 | + $_lang['home'], |
|
27 | + '', |
|
28 | + '', |
|
29 | + 'main', |
|
30 | + 0, |
|
31 | + 10, |
|
32 | + 'active' |
|
33 | 33 | ); |
34 | 34 | |
35 | 35 | if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('file_manager')) { |
36 | - $sitemenu['elements'] = array( |
|
37 | - 'elements', |
|
38 | - 'main', |
|
39 | - '<i class="fa fa-th"></i><span class="menu-item-text">' . $_lang['elements'] . '</span>', |
|
40 | - 'javascript:;', |
|
41 | - $_lang['elements'], |
|
42 | - ' return false;', |
|
43 | - '', |
|
44 | - '', |
|
45 | - 0, |
|
46 | - 20, |
|
47 | - '' |
|
48 | - ); |
|
36 | + $sitemenu['elements'] = array( |
|
37 | + 'elements', |
|
38 | + 'main', |
|
39 | + '<i class="fa fa-th"></i><span class="menu-item-text">' . $_lang['elements'] . '</span>', |
|
40 | + 'javascript:;', |
|
41 | + $_lang['elements'], |
|
42 | + ' return false;', |
|
43 | + '', |
|
44 | + '', |
|
45 | + 0, |
|
46 | + 20, |
|
47 | + '' |
|
48 | + ); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | if($modx->hasPermission('exec_module')) { |
52 | - $sitemenu['modules'] = array( |
|
53 | - 'modules', |
|
54 | - 'main', |
|
55 | - '<i class="'.$_style['icons_modules'] .'"></i><span class="menu-item-text">' . $_lang['modules'] . '</span>', |
|
56 | - 'javascript:;', |
|
57 | - $_lang['modules'], |
|
58 | - ' return false;', |
|
59 | - '', |
|
60 | - '', |
|
61 | - 0, |
|
62 | - 30, |
|
63 | - '' |
|
64 | - ); |
|
52 | + $sitemenu['modules'] = array( |
|
53 | + 'modules', |
|
54 | + 'main', |
|
55 | + '<i class="'.$_style['icons_modules'] .'"></i><span class="menu-item-text">' . $_lang['modules'] . '</span>', |
|
56 | + 'javascript:;', |
|
57 | + $_lang['modules'], |
|
58 | + ' return false;', |
|
59 | + '', |
|
60 | + '', |
|
61 | + 0, |
|
62 | + 30, |
|
63 | + '' |
|
64 | + ); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | if($modx->hasPermission('edit_user') || $modx->hasPermission('edit_web_user') || $modx->hasPermission('edit_role') || $modx->hasPermission('access_permissions') || $modx->hasPermission('web_access_permissions')) { |
68 | - $sitemenu['users'] = array( |
|
69 | - 'users', |
|
70 | - 'main', |
|
71 | - '<i class="fa fa-users"></i><span class="menu-item-text">' . $_lang['users'] . '</span>', |
|
72 | - 'javascript:;', |
|
73 | - $_lang['users'], |
|
74 | - ' return false;', |
|
75 | - 'edit_user', |
|
76 | - '', |
|
77 | - 0, |
|
78 | - 40, |
|
79 | - '' |
|
80 | - ); |
|
68 | + $sitemenu['users'] = array( |
|
69 | + 'users', |
|
70 | + 'main', |
|
71 | + '<i class="fa fa-users"></i><span class="menu-item-text">' . $_lang['users'] . '</span>', |
|
72 | + 'javascript:;', |
|
73 | + $_lang['users'], |
|
74 | + ' return false;', |
|
75 | + 'edit_user', |
|
76 | + '', |
|
77 | + 0, |
|
78 | + 40, |
|
79 | + '' |
|
80 | + ); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | if($modx->hasPermission('empty_cache') || $modx->hasPermission('bk_manager') || $modx->hasPermission('remove_locks') || $modx->hasPermission('import_static') || $modx->hasPermission('export_static')) { |
84 | - $sitemenu['tools'] = array( |
|
85 | - 'tools', |
|
86 | - 'main', |
|
87 | - '<i class="fa fa-wrench"></i><span class="menu-item-text">' . $_lang['tools'] . '</span>', |
|
88 | - 'javascript:;', |
|
89 | - $_lang['tools'], |
|
90 | - ' return false;', |
|
91 | - '', |
|
92 | - '', |
|
93 | - 0, |
|
94 | - 50, |
|
95 | - '' |
|
96 | - ); |
|
84 | + $sitemenu['tools'] = array( |
|
85 | + 'tools', |
|
86 | + 'main', |
|
87 | + '<i class="fa fa-wrench"></i><span class="menu-item-text">' . $_lang['tools'] . '</span>', |
|
88 | + 'javascript:;', |
|
89 | + $_lang['tools'], |
|
90 | + ' return false;', |
|
91 | + '', |
|
92 | + '', |
|
93 | + 0, |
|
94 | + 50, |
|
95 | + '' |
|
96 | + ); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | $tab = 0; |
100 | 100 | if($modx->hasPermission('edit_template')) { |
101 | - $sitemenu['element_templates'] = array( |
|
102 | - 'element_templates', |
|
103 | - 'elements', |
|
104 | - '<i class="fa fa-newspaper-o"></i>' . $_lang['manage_templates'] . '<i class="fa fa-angle-right toggle"></i>', |
|
105 | - 'index.php?a=76&tab=' . $tab++, |
|
106 | - $_lang['manage_templates'], |
|
107 | - '', |
|
108 | - 'new_template,edit_template', |
|
109 | - 'main', |
|
110 | - 0, |
|
111 | - 10, |
|
112 | - 'dropdown-toggle' |
|
113 | - ); |
|
101 | + $sitemenu['element_templates'] = array( |
|
102 | + 'element_templates', |
|
103 | + 'elements', |
|
104 | + '<i class="fa fa-newspaper-o"></i>' . $_lang['manage_templates'] . '<i class="fa fa-angle-right toggle"></i>', |
|
105 | + 'index.php?a=76&tab=' . $tab++, |
|
106 | + $_lang['manage_templates'], |
|
107 | + '', |
|
108 | + 'new_template,edit_template', |
|
109 | + 'main', |
|
110 | + 0, |
|
111 | + 10, |
|
112 | + 'dropdown-toggle' |
|
113 | + ); |
|
114 | 114 | } |
115 | 115 | if($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
116 | - $sitemenu['element_tplvars'] = array( |
|
117 | - 'element_tplvars', |
|
118 | - 'elements', |
|
119 | - '<i class="fa fa-list-alt"></i>' . $_lang['tmplvars'] . '<i class="fa fa-angle-right toggle"></i>', |
|
120 | - 'index.php?a=76&tab=' . $tab++, |
|
121 | - $_lang['tmplvars'], |
|
122 | - '', |
|
123 | - 'new_template,edit_template', |
|
124 | - 'main', |
|
125 | - 0, |
|
126 | - 20, |
|
127 | - 'dropdown-toggle' |
|
128 | - ); |
|
116 | + $sitemenu['element_tplvars'] = array( |
|
117 | + 'element_tplvars', |
|
118 | + 'elements', |
|
119 | + '<i class="fa fa-list-alt"></i>' . $_lang['tmplvars'] . '<i class="fa fa-angle-right toggle"></i>', |
|
120 | + 'index.php?a=76&tab=' . $tab++, |
|
121 | + $_lang['tmplvars'], |
|
122 | + '', |
|
123 | + 'new_template,edit_template', |
|
124 | + 'main', |
|
125 | + 0, |
|
126 | + 20, |
|
127 | + 'dropdown-toggle' |
|
128 | + ); |
|
129 | 129 | } |
130 | 130 | if($modx->hasPermission('edit_chunk')) { |
131 | - $sitemenu['element_htmlsnippets'] = array( |
|
132 | - 'element_htmlsnippets', |
|
133 | - 'elements', |
|
134 | - '<i class="fa fa-th-large"></i>' . $_lang['manage_htmlsnippets'] . '<i class="fa fa-angle-right toggle"></i>', |
|
135 | - 'index.php?a=76&tab=' . $tab++, |
|
136 | - $_lang['manage_htmlsnippets'], |
|
137 | - '', |
|
138 | - 'new_chunk,edit_chunk', |
|
139 | - 'main', |
|
140 | - 0, |
|
141 | - 30, |
|
142 | - 'dropdown-toggle' |
|
143 | - ); |
|
131 | + $sitemenu['element_htmlsnippets'] = array( |
|
132 | + 'element_htmlsnippets', |
|
133 | + 'elements', |
|
134 | + '<i class="fa fa-th-large"></i>' . $_lang['manage_htmlsnippets'] . '<i class="fa fa-angle-right toggle"></i>', |
|
135 | + 'index.php?a=76&tab=' . $tab++, |
|
136 | + $_lang['manage_htmlsnippets'], |
|
137 | + '', |
|
138 | + 'new_chunk,edit_chunk', |
|
139 | + 'main', |
|
140 | + 0, |
|
141 | + 30, |
|
142 | + 'dropdown-toggle' |
|
143 | + ); |
|
144 | 144 | } |
145 | 145 | if($modx->hasPermission('edit_snippet')) { |
146 | - $sitemenu['element_snippets'] = array( |
|
147 | - 'element_snippets', |
|
148 | - 'elements', |
|
149 | - '<i class="fa fa-code"></i>' . $_lang['manage_snippets'] . '<i class="fa fa-angle-right toggle"></i>', |
|
150 | - 'index.php?a=76&tab=' . $tab++, |
|
151 | - $_lang['manage_snippets'], |
|
152 | - '', |
|
153 | - 'new_snippet,edit_snippet', |
|
154 | - 'main', |
|
155 | - 0, |
|
156 | - 40, |
|
157 | - 'dropdown-toggle' |
|
158 | - ); |
|
146 | + $sitemenu['element_snippets'] = array( |
|
147 | + 'element_snippets', |
|
148 | + 'elements', |
|
149 | + '<i class="fa fa-code"></i>' . $_lang['manage_snippets'] . '<i class="fa fa-angle-right toggle"></i>', |
|
150 | + 'index.php?a=76&tab=' . $tab++, |
|
151 | + $_lang['manage_snippets'], |
|
152 | + '', |
|
153 | + 'new_snippet,edit_snippet', |
|
154 | + 'main', |
|
155 | + 0, |
|
156 | + 40, |
|
157 | + 'dropdown-toggle' |
|
158 | + ); |
|
159 | 159 | } |
160 | 160 | if($modx->hasPermission('edit_plugin')) { |
161 | - $sitemenu['element_plugins'] = array( |
|
162 | - 'element_plugins', |
|
163 | - 'elements', |
|
164 | - '<i class="fa fa-plug"></i>' . $_lang['manage_plugins'] . '<i class="fa fa-angle-right toggle"></i>', |
|
165 | - 'index.php?a=76&tab=' . $tab++, |
|
166 | - $_lang['manage_plugins'], |
|
167 | - '', |
|
168 | - 'new_plugin,edit_plugin', |
|
169 | - 'main', |
|
170 | - 0, |
|
171 | - 50, |
|
172 | - 'dropdown-toggle' |
|
173 | - ); |
|
161 | + $sitemenu['element_plugins'] = array( |
|
162 | + 'element_plugins', |
|
163 | + 'elements', |
|
164 | + '<i class="fa fa-plug"></i>' . $_lang['manage_plugins'] . '<i class="fa fa-angle-right toggle"></i>', |
|
165 | + 'index.php?a=76&tab=' . $tab++, |
|
166 | + $_lang['manage_plugins'], |
|
167 | + '', |
|
168 | + 'new_plugin,edit_plugin', |
|
169 | + 'main', |
|
170 | + 0, |
|
171 | + 50, |
|
172 | + 'dropdown-toggle' |
|
173 | + ); |
|
174 | 174 | } |
175 | 175 | //$sitemenu['element_categories'] = array('element_categories','elements',$_lang['element_categories'],'index.php?a=76&tab=5',$_lang['element_categories'],'','new_template,edit_template,new_snippet,edit_snippet,new_chunk,edit_chunk,new_plugin,edit_plugin','main',1,60,''); |
176 | 176 | |
177 | 177 | if($modx->hasPermission('file_manager')) { |
178 | - $sitemenu['manage_files'] = array( |
|
179 | - 'manage_files', |
|
180 | - 'elements', |
|
181 | - '<i class="fa fa-folder-open-o"></i>' . $_lang['manage_files'], |
|
182 | - 'index.php?a=31', |
|
183 | - $_lang['manage_files'], |
|
184 | - '', |
|
185 | - 'file_manager', |
|
186 | - 'main', |
|
187 | - 0, |
|
188 | - 80, |
|
189 | - '' |
|
190 | - ); |
|
178 | + $sitemenu['manage_files'] = array( |
|
179 | + 'manage_files', |
|
180 | + 'elements', |
|
181 | + '<i class="fa fa-folder-open-o"></i>' . $_lang['manage_files'], |
|
182 | + 'index.php?a=31', |
|
183 | + $_lang['manage_files'], |
|
184 | + '', |
|
185 | + 'file_manager', |
|
186 | + 'main', |
|
187 | + 0, |
|
188 | + 80, |
|
189 | + '' |
|
190 | + ); |
|
191 | 191 | } |
192 | 192 | if($modx->hasPermission('category_manager')) { |
193 | - $sitemenu['manage_categories'] = array( |
|
194 | - 'manage_categories', |
|
195 | - 'elements', |
|
196 | - '<i class="fa fa-object-group"></i>' . $_lang['manage_categories'], |
|
197 | - 'index.php?a=120', |
|
198 | - $_lang['manage_categories'], |
|
199 | - '', |
|
200 | - 'category_manager', |
|
201 | - 'main', |
|
202 | - 0, |
|
203 | - 70, |
|
204 | - '' |
|
205 | - ); |
|
193 | + $sitemenu['manage_categories'] = array( |
|
194 | + 'manage_categories', |
|
195 | + 'elements', |
|
196 | + '<i class="fa fa-object-group"></i>' . $_lang['manage_categories'], |
|
197 | + 'index.php?a=120', |
|
198 | + $_lang['manage_categories'], |
|
199 | + '', |
|
200 | + 'category_manager', |
|
201 | + 'main', |
|
202 | + 0, |
|
203 | + 70, |
|
204 | + '' |
|
205 | + ); |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | // Modules Menu Items |
209 | 209 | if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('save_module')) { |
210 | - $sitemenu['new_module'] = array( |
|
211 | - 'new_module', |
|
212 | - 'modules', |
|
213 | - '<i class="'.$_style['icons_modules'] .'"></i>' . $_lang['module_management'], |
|
214 | - 'index.php?a=106', |
|
215 | - $_lang['module_management'], |
|
216 | - '', |
|
217 | - 'new_module,edit_module', |
|
218 | - 'main', |
|
219 | - 1, |
|
220 | - 0, |
|
221 | - '' |
|
222 | - ); |
|
210 | + $sitemenu['new_module'] = array( |
|
211 | + 'new_module', |
|
212 | + 'modules', |
|
213 | + '<i class="'.$_style['icons_modules'] .'"></i>' . $_lang['module_management'], |
|
214 | + 'index.php?a=106', |
|
215 | + $_lang['module_management'], |
|
216 | + '', |
|
217 | + 'new_module,edit_module', |
|
218 | + 'main', |
|
219 | + 1, |
|
220 | + 0, |
|
221 | + '' |
|
222 | + ); |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | if($modx->hasPermission('exec_module')) { |
226 | - if($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
227 | - $rs = $modx->getDatabase()->query('SELECT DISTINCT sm.id, sm.name, sm.icon, mg.member |
|
226 | + if($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
227 | + $rs = $modx->getDatabase()->query('SELECT DISTINCT sm.id, sm.name, sm.icon, mg.member |
|
228 | 228 | FROM ' . $modx->getDatabase()->getFullTableName('site_modules') . ' AS sm |
229 | 229 | LEFT JOIN ' . $modx->getDatabase()->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id |
230 | 230 | LEFT JOIN ' . $modx->getDatabase()->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group |
231 | 231 | WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1 |
232 | 232 | ORDER BY sm.name'); |
233 | - } else { |
|
234 | - $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('site_modules'), 'disabled != 1', 'name'); |
|
235 | - } |
|
236 | - if($modx->getDatabase()->getRecordCount($rs)) { |
|
237 | - while ($row = $modx->getDatabase()->getRow($rs)) { |
|
233 | + } else { |
|
234 | + $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('site_modules'), 'disabled != 1', 'name'); |
|
235 | + } |
|
236 | + if($modx->getDatabase()->getRecordCount($rs)) { |
|
237 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
238 | 238 | $sitemenu['module' . $row['id']] = array( |
239 | 239 | 'module' . $row['id'], |
240 | 240 | 'modules', |
@@ -255,83 +255,83 @@ discard block |
||
255 | 255 | // security menu items (users) |
256 | 256 | |
257 | 257 | if($modx->hasPermission('edit_user')) { |
258 | - $sitemenu['user_management_title'] = array( |
|
259 | - 'user_management_title', |
|
260 | - 'users', |
|
261 | - '<i class="fa fa fa-user"></i>' . $_lang['user_management_title'] . '<i class="fa fa-angle-right toggle"></i>', |
|
262 | - 'index.php?a=75', |
|
263 | - $_lang['user_management_title'], |
|
264 | - '', |
|
265 | - 'edit_user', |
|
266 | - 'main', |
|
267 | - 0, |
|
268 | - 10, |
|
269 | - 'dropdown-toggle' |
|
270 | - ); |
|
258 | + $sitemenu['user_management_title'] = array( |
|
259 | + 'user_management_title', |
|
260 | + 'users', |
|
261 | + '<i class="fa fa fa-user"></i>' . $_lang['user_management_title'] . '<i class="fa fa-angle-right toggle"></i>', |
|
262 | + 'index.php?a=75', |
|
263 | + $_lang['user_management_title'], |
|
264 | + '', |
|
265 | + 'edit_user', |
|
266 | + 'main', |
|
267 | + 0, |
|
268 | + 10, |
|
269 | + 'dropdown-toggle' |
|
270 | + ); |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | if($modx->hasPermission('edit_web_user')) { |
274 | - $sitemenu['web_user_management_title'] = array( |
|
275 | - 'web_user_management_title', |
|
276 | - 'users', |
|
277 | - '<i class="fa fa-users"></i>' . $_lang['web_user_management_title'] . '<i class="fa fa-angle-right toggle"></i>', |
|
278 | - 'index.php?a=99', |
|
279 | - $_lang['web_user_management_title'], |
|
280 | - '', |
|
281 | - 'edit_web_user', |
|
282 | - 'main', |
|
283 | - 0, |
|
284 | - 20, |
|
285 | - 'dropdown-toggle' |
|
286 | - ); |
|
274 | + $sitemenu['web_user_management_title'] = array( |
|
275 | + 'web_user_management_title', |
|
276 | + 'users', |
|
277 | + '<i class="fa fa-users"></i>' . $_lang['web_user_management_title'] . '<i class="fa fa-angle-right toggle"></i>', |
|
278 | + 'index.php?a=99', |
|
279 | + $_lang['web_user_management_title'], |
|
280 | + '', |
|
281 | + 'edit_web_user', |
|
282 | + 'main', |
|
283 | + 0, |
|
284 | + 20, |
|
285 | + 'dropdown-toggle' |
|
286 | + ); |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | if($modx->hasPermission('edit_role')) { |
290 | - $sitemenu['role_management_title'] = array( |
|
291 | - 'role_management_title', |
|
292 | - 'users', |
|
293 | - '<i class="fa fa-legal"></i>' . $_lang['role_management_title'], |
|
294 | - 'index.php?a=86', |
|
295 | - $_lang['role_management_title'], |
|
296 | - '', |
|
297 | - 'new_role,edit_role,delete_role', |
|
298 | - 'main', |
|
299 | - 0, |
|
300 | - 30, |
|
301 | - '' |
|
302 | - ); |
|
290 | + $sitemenu['role_management_title'] = array( |
|
291 | + 'role_management_title', |
|
292 | + 'users', |
|
293 | + '<i class="fa fa-legal"></i>' . $_lang['role_management_title'], |
|
294 | + 'index.php?a=86', |
|
295 | + $_lang['role_management_title'], |
|
296 | + '', |
|
297 | + 'new_role,edit_role,delete_role', |
|
298 | + 'main', |
|
299 | + 0, |
|
300 | + 30, |
|
301 | + '' |
|
302 | + ); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | if($modx->hasPermission('access_permissions')) { |
306 | - $sitemenu['manager_permissions'] = array( |
|
307 | - 'manager_permissions', |
|
308 | - 'users', |
|
309 | - '<i class="fa fa-male"></i>' . $_lang['manager_permissions'], |
|
310 | - 'index.php?a=40', |
|
311 | - $_lang['manager_permissions'], |
|
312 | - '', |
|
313 | - 'access_permissions', |
|
314 | - 'main', |
|
315 | - 0, |
|
316 | - 40, |
|
317 | - '' |
|
318 | - ); |
|
306 | + $sitemenu['manager_permissions'] = array( |
|
307 | + 'manager_permissions', |
|
308 | + 'users', |
|
309 | + '<i class="fa fa-male"></i>' . $_lang['manager_permissions'], |
|
310 | + 'index.php?a=40', |
|
311 | + $_lang['manager_permissions'], |
|
312 | + '', |
|
313 | + 'access_permissions', |
|
314 | + 'main', |
|
315 | + 0, |
|
316 | + 40, |
|
317 | + '' |
|
318 | + ); |
|
319 | 319 | } |
320 | 320 | |
321 | 321 | if($modx->hasPermission('web_access_permissions')) { |
322 | - $sitemenu['web_permissions'] = array( |
|
323 | - 'web_permissions', |
|
324 | - 'users', |
|
325 | - '<i class="fa fa-universal-access"></i>' . $_lang['web_permissions'], |
|
326 | - 'index.php?a=91', |
|
327 | - $_lang['web_permissions'], |
|
328 | - '', |
|
329 | - 'web_access_permissions', |
|
330 | - 'main', |
|
331 | - 0, |
|
332 | - 50, |
|
333 | - '' |
|
334 | - ); |
|
322 | + $sitemenu['web_permissions'] = array( |
|
323 | + 'web_permissions', |
|
324 | + 'users', |
|
325 | + '<i class="fa fa-universal-access"></i>' . $_lang['web_permissions'], |
|
326 | + 'index.php?a=91', |
|
327 | + $_lang['web_permissions'], |
|
328 | + '', |
|
329 | + 'web_access_permissions', |
|
330 | + 'main', |
|
331 | + 0, |
|
332 | + 50, |
|
333 | + '' |
|
334 | + ); |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | // Tools Menu |
@@ -361,104 +361,104 @@ discard block |
||
361 | 361 | ); |
362 | 362 | |
363 | 363 | $sitemenu['search'] = array( |
364 | - 'search', |
|
365 | - 'tools', |
|
366 | - '<i class="fa fa-search"></i>' . $_lang['search'], |
|
367 | - 'index.php?a=71', |
|
368 | - $_lang['search'], |
|
369 | - '', |
|
370 | - '', |
|
371 | - 'main', |
|
372 | - 1, |
|
373 | - 9, |
|
374 | - '' |
|
364 | + 'search', |
|
365 | + 'tools', |
|
366 | + '<i class="fa fa-search"></i>' . $_lang['search'], |
|
367 | + 'index.php?a=71', |
|
368 | + $_lang['search'], |
|
369 | + '', |
|
370 | + '', |
|
371 | + 'main', |
|
372 | + 1, |
|
373 | + 9, |
|
374 | + '' |
|
375 | 375 | ); |
376 | 376 | |
377 | 377 | if($modx->hasPermission('bk_manager')) { |
378 | - $sitemenu['bk_manager'] = array( |
|
379 | - 'bk_manager', |
|
380 | - 'tools', |
|
381 | - '<i class="fa fa-database"></i>' . $_lang['bk_manager'], |
|
382 | - 'index.php?a=93', |
|
383 | - $_lang['bk_manager'], |
|
384 | - '', |
|
385 | - 'bk_manager', |
|
386 | - 'main', |
|
387 | - 0, |
|
388 | - 10, |
|
389 | - '' |
|
390 | - ); |
|
378 | + $sitemenu['bk_manager'] = array( |
|
379 | + 'bk_manager', |
|
380 | + 'tools', |
|
381 | + '<i class="fa fa-database"></i>' . $_lang['bk_manager'], |
|
382 | + 'index.php?a=93', |
|
383 | + $_lang['bk_manager'], |
|
384 | + '', |
|
385 | + 'bk_manager', |
|
386 | + 'main', |
|
387 | + 0, |
|
388 | + 10, |
|
389 | + '' |
|
390 | + ); |
|
391 | 391 | } |
392 | 392 | |
393 | 393 | if($modx->hasPermission('remove_locks')) { |
394 | - $sitemenu['remove_locks'] = array( |
|
395 | - 'remove_locks', |
|
396 | - 'tools', |
|
397 | - '<i class="fa fa-hourglass"></i>' . $_lang['remove_locks'], |
|
398 | - 'javascript:modx.removeLocks();', |
|
399 | - $_lang['remove_locks'], |
|
400 | - '', |
|
401 | - 'remove_locks', |
|
402 | - '', |
|
403 | - 0, |
|
404 | - 20, |
|
405 | - '' |
|
406 | - ); |
|
394 | + $sitemenu['remove_locks'] = array( |
|
395 | + 'remove_locks', |
|
396 | + 'tools', |
|
397 | + '<i class="fa fa-hourglass"></i>' . $_lang['remove_locks'], |
|
398 | + 'javascript:modx.removeLocks();', |
|
399 | + $_lang['remove_locks'], |
|
400 | + '', |
|
401 | + 'remove_locks', |
|
402 | + '', |
|
403 | + 0, |
|
404 | + 20, |
|
405 | + '' |
|
406 | + ); |
|
407 | 407 | } |
408 | 408 | |
409 | 409 | if($modx->hasPermission('import_static')) { |
410 | - $sitemenu['import_site'] = array( |
|
411 | - 'import_site', |
|
412 | - 'tools', |
|
413 | - '<i class="fa fa-upload"></i>' . $_lang['import_site'], |
|
414 | - 'index.php?a=95', |
|
415 | - $_lang['import_site'], |
|
416 | - '', |
|
417 | - 'import_static', |
|
418 | - 'main', |
|
419 | - 0, |
|
420 | - 30, |
|
421 | - '' |
|
422 | - ); |
|
410 | + $sitemenu['import_site'] = array( |
|
411 | + 'import_site', |
|
412 | + 'tools', |
|
413 | + '<i class="fa fa-upload"></i>' . $_lang['import_site'], |
|
414 | + 'index.php?a=95', |
|
415 | + $_lang['import_site'], |
|
416 | + '', |
|
417 | + 'import_static', |
|
418 | + 'main', |
|
419 | + 0, |
|
420 | + 30, |
|
421 | + '' |
|
422 | + ); |
|
423 | 423 | } |
424 | 424 | |
425 | 425 | if($modx->hasPermission('export_static')) { |
426 | - $sitemenu['export_site'] = array( |
|
427 | - 'export_site', |
|
428 | - 'tools', |
|
429 | - '<i class="fa fa-download"></i>' . $_lang['export_site'], |
|
430 | - 'index.php?a=83', |
|
431 | - $_lang['export_site'], |
|
432 | - '', |
|
433 | - 'export_static', |
|
434 | - 'main', |
|
435 | - 1, |
|
436 | - 40, |
|
437 | - '' |
|
438 | - ); |
|
426 | + $sitemenu['export_site'] = array( |
|
427 | + 'export_site', |
|
428 | + 'tools', |
|
429 | + '<i class="fa fa-download"></i>' . $_lang['export_site'], |
|
430 | + 'index.php?a=83', |
|
431 | + $_lang['export_site'], |
|
432 | + '', |
|
433 | + 'export_static', |
|
434 | + 'main', |
|
435 | + 1, |
|
436 | + 40, |
|
437 | + '' |
|
438 | + ); |
|
439 | 439 | } |
440 | 440 | |
441 | 441 | $menu = $modx->invokeEvent("OnManagerMenuPrerender", array('menu' => $sitemenu)); |
442 | 442 | if(is_array($menu)) { |
443 | - $newmenu = array(); |
|
444 | - foreach($menu as $item){ |
|
445 | - if(is_array(unserialize($item))){ |
|
446 | - $newmenu = array_merge($newmenu, unserialize($item)); |
|
447 | - } |
|
448 | - } |
|
449 | - if(count($newmenu)> 0) $sitemenu = $newmenu; |
|
443 | + $newmenu = array(); |
|
444 | + foreach($menu as $item){ |
|
445 | + if(is_array(unserialize($item))){ |
|
446 | + $newmenu = array_merge($newmenu, unserialize($item)); |
|
447 | + } |
|
448 | + } |
|
449 | + if(count($newmenu)> 0) $sitemenu = $newmenu; |
|
450 | 450 | } |
451 | 451 | |
452 | 452 | if(file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php')) { |
453 | - include_once(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php'); |
|
453 | + include_once(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php'); |
|
454 | 454 | } else { |
455 | - include_once(MODX_MANAGER_PATH . 'includes/menu.class.inc.php'); |
|
455 | + include_once(MODX_MANAGER_PATH . 'includes/menu.class.inc.php'); |
|
456 | 456 | } |
457 | 457 | $menu = new EVOmenu(); |
458 | 458 | $menu->Build($sitemenu, array( |
459 | - 'outerClass' => 'nav', |
|
460 | - 'innerClass' => 'dropdown-menu', |
|
461 | - 'parentClass' => 'dropdown', |
|
459 | + 'outerClass' => 'nav', |
|
460 | + 'innerClass' => 'dropdown-menu', |
|
461 | + 'parentClass' => 'dropdown', |
|
462 | 462 | 'parentLinkClass' => 'dropdown-toggle', |
463 | 463 | 'parentLinkAttr' => '', |
464 | 464 | 'parentLinkIn' => '' |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | $sitemenu['site'] = array( |
22 | 22 | 'site', |
23 | 23 | 'main', |
24 | - '<i class="fa fa-tachometer"></i><span class="menu-item-text">' . $_lang['home'] . '</span>', |
|
24 | + '<i class="fa fa-tachometer"></i><span class="menu-item-text">'.$_lang['home'].'</span>', |
|
25 | 25 | 'index.php?a=2', |
26 | 26 | $_lang['home'], |
27 | 27 | '', |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | 'active' |
33 | 33 | ); |
34 | 34 | |
35 | -if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('file_manager')) { |
|
35 | +if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('file_manager')) { |
|
36 | 36 | $sitemenu['elements'] = array( |
37 | 37 | 'elements', |
38 | 38 | 'main', |
39 | - '<i class="fa fa-th"></i><span class="menu-item-text">' . $_lang['elements'] . '</span>', |
|
39 | + '<i class="fa fa-th"></i><span class="menu-item-text">'.$_lang['elements'].'</span>', |
|
40 | 40 | 'javascript:;', |
41 | 41 | $_lang['elements'], |
42 | 42 | ' return false;', |
@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | ); |
49 | 49 | } |
50 | 50 | |
51 | -if($modx->hasPermission('exec_module')) { |
|
51 | +if ($modx->hasPermission('exec_module')) { |
|
52 | 52 | $sitemenu['modules'] = array( |
53 | 53 | 'modules', |
54 | 54 | 'main', |
55 | - '<i class="'.$_style['icons_modules'] .'"></i><span class="menu-item-text">' . $_lang['modules'] . '</span>', |
|
55 | + '<i class="'.$_style['icons_modules'].'"></i><span class="menu-item-text">'.$_lang['modules'].'</span>', |
|
56 | 56 | 'javascript:;', |
57 | 57 | $_lang['modules'], |
58 | 58 | ' return false;', |
@@ -64,11 +64,11 @@ discard block |
||
64 | 64 | ); |
65 | 65 | } |
66 | 66 | |
67 | -if($modx->hasPermission('edit_user') || $modx->hasPermission('edit_web_user') || $modx->hasPermission('edit_role') || $modx->hasPermission('access_permissions') || $modx->hasPermission('web_access_permissions')) { |
|
67 | +if ($modx->hasPermission('edit_user') || $modx->hasPermission('edit_web_user') || $modx->hasPermission('edit_role') || $modx->hasPermission('access_permissions') || $modx->hasPermission('web_access_permissions')) { |
|
68 | 68 | $sitemenu['users'] = array( |
69 | 69 | 'users', |
70 | 70 | 'main', |
71 | - '<i class="fa fa-users"></i><span class="menu-item-text">' . $_lang['users'] . '</span>', |
|
71 | + '<i class="fa fa-users"></i><span class="menu-item-text">'.$_lang['users'].'</span>', |
|
72 | 72 | 'javascript:;', |
73 | 73 | $_lang['users'], |
74 | 74 | ' return false;', |
@@ -80,11 +80,11 @@ discard block |
||
80 | 80 | ); |
81 | 81 | } |
82 | 82 | |
83 | -if($modx->hasPermission('empty_cache') || $modx->hasPermission('bk_manager') || $modx->hasPermission('remove_locks') || $modx->hasPermission('import_static') || $modx->hasPermission('export_static')) { |
|
83 | +if ($modx->hasPermission('empty_cache') || $modx->hasPermission('bk_manager') || $modx->hasPermission('remove_locks') || $modx->hasPermission('import_static') || $modx->hasPermission('export_static')) { |
|
84 | 84 | $sitemenu['tools'] = array( |
85 | 85 | 'tools', |
86 | 86 | 'main', |
87 | - '<i class="fa fa-wrench"></i><span class="menu-item-text">' . $_lang['tools'] . '</span>', |
|
87 | + '<i class="fa fa-wrench"></i><span class="menu-item-text">'.$_lang['tools'].'</span>', |
|
88 | 88 | 'javascript:;', |
89 | 89 | $_lang['tools'], |
90 | 90 | ' return false;', |
@@ -97,12 +97,12 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | $tab = 0; |
100 | -if($modx->hasPermission('edit_template')) { |
|
100 | +if ($modx->hasPermission('edit_template')) { |
|
101 | 101 | $sitemenu['element_templates'] = array( |
102 | 102 | 'element_templates', |
103 | 103 | 'elements', |
104 | - '<i class="fa fa-newspaper-o"></i>' . $_lang['manage_templates'] . '<i class="fa fa-angle-right toggle"></i>', |
|
105 | - 'index.php?a=76&tab=' . $tab++, |
|
104 | + '<i class="fa fa-newspaper-o"></i>'.$_lang['manage_templates'].'<i class="fa fa-angle-right toggle"></i>', |
|
105 | + 'index.php?a=76&tab='.$tab++, |
|
106 | 106 | $_lang['manage_templates'], |
107 | 107 | '', |
108 | 108 | 'new_template,edit_template', |
@@ -112,12 +112,12 @@ discard block |
||
112 | 112 | 'dropdown-toggle' |
113 | 113 | ); |
114 | 114 | } |
115 | -if($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
|
115 | +if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
|
116 | 116 | $sitemenu['element_tplvars'] = array( |
117 | 117 | 'element_tplvars', |
118 | 118 | 'elements', |
119 | - '<i class="fa fa-list-alt"></i>' . $_lang['tmplvars'] . '<i class="fa fa-angle-right toggle"></i>', |
|
120 | - 'index.php?a=76&tab=' . $tab++, |
|
119 | + '<i class="fa fa-list-alt"></i>'.$_lang['tmplvars'].'<i class="fa fa-angle-right toggle"></i>', |
|
120 | + 'index.php?a=76&tab='.$tab++, |
|
121 | 121 | $_lang['tmplvars'], |
122 | 122 | '', |
123 | 123 | 'new_template,edit_template', |
@@ -127,12 +127,12 @@ discard block |
||
127 | 127 | 'dropdown-toggle' |
128 | 128 | ); |
129 | 129 | } |
130 | -if($modx->hasPermission('edit_chunk')) { |
|
130 | +if ($modx->hasPermission('edit_chunk')) { |
|
131 | 131 | $sitemenu['element_htmlsnippets'] = array( |
132 | 132 | 'element_htmlsnippets', |
133 | 133 | 'elements', |
134 | - '<i class="fa fa-th-large"></i>' . $_lang['manage_htmlsnippets'] . '<i class="fa fa-angle-right toggle"></i>', |
|
135 | - 'index.php?a=76&tab=' . $tab++, |
|
134 | + '<i class="fa fa-th-large"></i>'.$_lang['manage_htmlsnippets'].'<i class="fa fa-angle-right toggle"></i>', |
|
135 | + 'index.php?a=76&tab='.$tab++, |
|
136 | 136 | $_lang['manage_htmlsnippets'], |
137 | 137 | '', |
138 | 138 | 'new_chunk,edit_chunk', |
@@ -142,12 +142,12 @@ discard block |
||
142 | 142 | 'dropdown-toggle' |
143 | 143 | ); |
144 | 144 | } |
145 | -if($modx->hasPermission('edit_snippet')) { |
|
145 | +if ($modx->hasPermission('edit_snippet')) { |
|
146 | 146 | $sitemenu['element_snippets'] = array( |
147 | 147 | 'element_snippets', |
148 | 148 | 'elements', |
149 | - '<i class="fa fa-code"></i>' . $_lang['manage_snippets'] . '<i class="fa fa-angle-right toggle"></i>', |
|
150 | - 'index.php?a=76&tab=' . $tab++, |
|
149 | + '<i class="fa fa-code"></i>'.$_lang['manage_snippets'].'<i class="fa fa-angle-right toggle"></i>', |
|
150 | + 'index.php?a=76&tab='.$tab++, |
|
151 | 151 | $_lang['manage_snippets'], |
152 | 152 | '', |
153 | 153 | 'new_snippet,edit_snippet', |
@@ -157,12 +157,12 @@ discard block |
||
157 | 157 | 'dropdown-toggle' |
158 | 158 | ); |
159 | 159 | } |
160 | -if($modx->hasPermission('edit_plugin')) { |
|
160 | +if ($modx->hasPermission('edit_plugin')) { |
|
161 | 161 | $sitemenu['element_plugins'] = array( |
162 | 162 | 'element_plugins', |
163 | 163 | 'elements', |
164 | - '<i class="fa fa-plug"></i>' . $_lang['manage_plugins'] . '<i class="fa fa-angle-right toggle"></i>', |
|
165 | - 'index.php?a=76&tab=' . $tab++, |
|
164 | + '<i class="fa fa-plug"></i>'.$_lang['manage_plugins'].'<i class="fa fa-angle-right toggle"></i>', |
|
165 | + 'index.php?a=76&tab='.$tab++, |
|
166 | 166 | $_lang['manage_plugins'], |
167 | 167 | '', |
168 | 168 | 'new_plugin,edit_plugin', |
@@ -174,11 +174,11 @@ discard block |
||
174 | 174 | } |
175 | 175 | //$sitemenu['element_categories'] = array('element_categories','elements',$_lang['element_categories'],'index.php?a=76&tab=5',$_lang['element_categories'],'','new_template,edit_template,new_snippet,edit_snippet,new_chunk,edit_chunk,new_plugin,edit_plugin','main',1,60,''); |
176 | 176 | |
177 | -if($modx->hasPermission('file_manager')) { |
|
177 | +if ($modx->hasPermission('file_manager')) { |
|
178 | 178 | $sitemenu['manage_files'] = array( |
179 | 179 | 'manage_files', |
180 | 180 | 'elements', |
181 | - '<i class="fa fa-folder-open-o"></i>' . $_lang['manage_files'], |
|
181 | + '<i class="fa fa-folder-open-o"></i>'.$_lang['manage_files'], |
|
182 | 182 | 'index.php?a=31', |
183 | 183 | $_lang['manage_files'], |
184 | 184 | '', |
@@ -189,11 +189,11 @@ discard block |
||
189 | 189 | '' |
190 | 190 | ); |
191 | 191 | } |
192 | -if($modx->hasPermission('category_manager')) { |
|
192 | +if ($modx->hasPermission('category_manager')) { |
|
193 | 193 | $sitemenu['manage_categories'] = array( |
194 | 194 | 'manage_categories', |
195 | 195 | 'elements', |
196 | - '<i class="fa fa-object-group"></i>' . $_lang['manage_categories'], |
|
196 | + '<i class="fa fa-object-group"></i>'.$_lang['manage_categories'], |
|
197 | 197 | 'index.php?a=120', |
198 | 198 | $_lang['manage_categories'], |
199 | 199 | '', |
@@ -206,11 +206,11 @@ discard block |
||
206 | 206 | } |
207 | 207 | |
208 | 208 | // Modules Menu Items |
209 | -if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('save_module')) { |
|
209 | +if ($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('save_module')) { |
|
210 | 210 | $sitemenu['new_module'] = array( |
211 | 211 | 'new_module', |
212 | 212 | 'modules', |
213 | - '<i class="'.$_style['icons_modules'] .'"></i>' . $_lang['module_management'], |
|
213 | + '<i class="'.$_style['icons_modules'].'"></i>'.$_lang['module_management'], |
|
214 | 214 | 'index.php?a=106', |
215 | 215 | $_lang['module_management'], |
216 | 216 | '', |
@@ -222,24 +222,24 @@ discard block |
||
222 | 222 | ); |
223 | 223 | } |
224 | 224 | |
225 | -if($modx->hasPermission('exec_module')) { |
|
226 | - if($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
225 | +if ($modx->hasPermission('exec_module')) { |
|
226 | + if ($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
227 | 227 | $rs = $modx->getDatabase()->query('SELECT DISTINCT sm.id, sm.name, sm.icon, mg.member |
228 | - FROM ' . $modx->getDatabase()->getFullTableName('site_modules') . ' AS sm |
|
229 | - LEFT JOIN ' . $modx->getDatabase()->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id |
|
230 | - LEFT JOIN ' . $modx->getDatabase()->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group |
|
231 | - WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1 |
|
228 | + FROM ' . $modx->getDatabase()->getFullTableName('site_modules').' AS sm |
|
229 | + LEFT JOIN ' . $modx->getDatabase()->getFullTableName('site_module_access').' AS sma ON sma.module = sm.id |
|
230 | + LEFT JOIN ' . $modx->getDatabase()->getFullTableName('member_groups').' AS mg ON sma.usergroup = mg.user_group |
|
231 | + WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID().') AND sm.disabled != 1 AND sm.locked != 1 |
|
232 | 232 | ORDER BY sm.name'); |
233 | 233 | } else { |
234 | 234 | $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('site_modules'), 'disabled != 1', 'name'); |
235 | 235 | } |
236 | - if($modx->getDatabase()->getRecordCount($rs)) { |
|
236 | + if ($modx->getDatabase()->getRecordCount($rs)) { |
|
237 | 237 | while ($row = $modx->getDatabase()->getRow($rs)) { |
238 | - $sitemenu['module' . $row['id']] = array( |
|
239 | - 'module' . $row['id'], |
|
238 | + $sitemenu['module'.$row['id']] = array( |
|
239 | + 'module'.$row['id'], |
|
240 | 240 | 'modules', |
241 | - ($row['icon'] != '' ? '<i class="'.$row['icon'].'"></i>' : '<i class="'.$_style['icons_module'].'"></i>') . $row['name'], |
|
242 | - 'index.php?a=112&id=' . $row['id'], |
|
241 | + ($row['icon'] != '' ? '<i class="'.$row['icon'].'"></i>' : '<i class="'.$_style['icons_module'].'"></i>').$row['name'], |
|
242 | + 'index.php?a=112&id='.$row['id'], |
|
243 | 243 | $row['name'], |
244 | 244 | '', |
245 | 245 | '', |
@@ -254,11 +254,11 @@ discard block |
||
254 | 254 | |
255 | 255 | // security menu items (users) |
256 | 256 | |
257 | -if($modx->hasPermission('edit_user')) { |
|
257 | +if ($modx->hasPermission('edit_user')) { |
|
258 | 258 | $sitemenu['user_management_title'] = array( |
259 | 259 | 'user_management_title', |
260 | 260 | 'users', |
261 | - '<i class="fa fa fa-user"></i>' . $_lang['user_management_title'] . '<i class="fa fa-angle-right toggle"></i>', |
|
261 | + '<i class="fa fa fa-user"></i>'.$_lang['user_management_title'].'<i class="fa fa-angle-right toggle"></i>', |
|
262 | 262 | 'index.php?a=75', |
263 | 263 | $_lang['user_management_title'], |
264 | 264 | '', |
@@ -270,11 +270,11 @@ discard block |
||
270 | 270 | ); |
271 | 271 | } |
272 | 272 | |
273 | -if($modx->hasPermission('edit_web_user')) { |
|
273 | +if ($modx->hasPermission('edit_web_user')) { |
|
274 | 274 | $sitemenu['web_user_management_title'] = array( |
275 | 275 | 'web_user_management_title', |
276 | 276 | 'users', |
277 | - '<i class="fa fa-users"></i>' . $_lang['web_user_management_title'] . '<i class="fa fa-angle-right toggle"></i>', |
|
277 | + '<i class="fa fa-users"></i>'.$_lang['web_user_management_title'].'<i class="fa fa-angle-right toggle"></i>', |
|
278 | 278 | 'index.php?a=99', |
279 | 279 | $_lang['web_user_management_title'], |
280 | 280 | '', |
@@ -286,11 +286,11 @@ discard block |
||
286 | 286 | ); |
287 | 287 | } |
288 | 288 | |
289 | -if($modx->hasPermission('edit_role')) { |
|
289 | +if ($modx->hasPermission('edit_role')) { |
|
290 | 290 | $sitemenu['role_management_title'] = array( |
291 | 291 | 'role_management_title', |
292 | 292 | 'users', |
293 | - '<i class="fa fa-legal"></i>' . $_lang['role_management_title'], |
|
293 | + '<i class="fa fa-legal"></i>'.$_lang['role_management_title'], |
|
294 | 294 | 'index.php?a=86', |
295 | 295 | $_lang['role_management_title'], |
296 | 296 | '', |
@@ -302,11 +302,11 @@ discard block |
||
302 | 302 | ); |
303 | 303 | } |
304 | 304 | |
305 | -if($modx->hasPermission('access_permissions')) { |
|
305 | +if ($modx->hasPermission('access_permissions')) { |
|
306 | 306 | $sitemenu['manager_permissions'] = array( |
307 | 307 | 'manager_permissions', |
308 | 308 | 'users', |
309 | - '<i class="fa fa-male"></i>' . $_lang['manager_permissions'], |
|
309 | + '<i class="fa fa-male"></i>'.$_lang['manager_permissions'], |
|
310 | 310 | 'index.php?a=40', |
311 | 311 | $_lang['manager_permissions'], |
312 | 312 | '', |
@@ -318,11 +318,11 @@ discard block |
||
318 | 318 | ); |
319 | 319 | } |
320 | 320 | |
321 | -if($modx->hasPermission('web_access_permissions')) { |
|
321 | +if ($modx->hasPermission('web_access_permissions')) { |
|
322 | 322 | $sitemenu['web_permissions'] = array( |
323 | 323 | 'web_permissions', |
324 | 324 | 'users', |
325 | - '<i class="fa fa-universal-access"></i>' . $_lang['web_permissions'], |
|
325 | + '<i class="fa fa-universal-access"></i>'.$_lang['web_permissions'], |
|
326 | 326 | 'index.php?a=91', |
327 | 327 | $_lang['web_permissions'], |
328 | 328 | '', |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | $sitemenu['refresh_site'] = array( |
340 | 340 | 'refresh_site', |
341 | 341 | 'tools', |
342 | - '<i class="fa fa-recycle"></i>' . $_lang['refresh_site'], |
|
342 | + '<i class="fa fa-recycle"></i>'.$_lang['refresh_site'], |
|
343 | 343 | 'index.php?a=26', |
344 | 344 | $_lang['refresh_site'], |
345 | 345 | '', |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | 'a', // tag |
354 | 354 | 'javascript:;', // href |
355 | 355 | 'btn btn-secondary', // class or btn-success |
356 | - 'modx.popup({url:\'index.php?a=26\', title:\'' . $_lang['refresh_site'] . '\', icon: \'fa-recycle\', iframe: \'ajax\', selector: \'.tab-page>.container\', position: \'right top\', width: \'auto\', maxheight: \'50%\', wrap: \'body\' })', // onclick |
|
356 | + 'modx.popup({url:\'index.php?a=26\', title:\''.$_lang['refresh_site'].'\', icon: \'fa-recycle\', iframe: \'ajax\', selector: \'.tab-page>.container\', position: \'right top\', width: \'auto\', maxheight: \'50%\', wrap: \'body\' })', // onclick |
|
357 | 357 | $_lang['refresh_site'], // title |
358 | 358 | '<i class="fa fa-recycle"></i>' // innerHTML |
359 | 359 | ) |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | $sitemenu['search'] = array( |
364 | 364 | 'search', |
365 | 365 | 'tools', |
366 | - '<i class="fa fa-search"></i>' . $_lang['search'], |
|
366 | + '<i class="fa fa-search"></i>'.$_lang['search'], |
|
367 | 367 | 'index.php?a=71', |
368 | 368 | $_lang['search'], |
369 | 369 | '', |
@@ -374,11 +374,11 @@ discard block |
||
374 | 374 | '' |
375 | 375 | ); |
376 | 376 | |
377 | -if($modx->hasPermission('bk_manager')) { |
|
377 | +if ($modx->hasPermission('bk_manager')) { |
|
378 | 378 | $sitemenu['bk_manager'] = array( |
379 | 379 | 'bk_manager', |
380 | 380 | 'tools', |
381 | - '<i class="fa fa-database"></i>' . $_lang['bk_manager'], |
|
381 | + '<i class="fa fa-database"></i>'.$_lang['bk_manager'], |
|
382 | 382 | 'index.php?a=93', |
383 | 383 | $_lang['bk_manager'], |
384 | 384 | '', |
@@ -390,11 +390,11 @@ discard block |
||
390 | 390 | ); |
391 | 391 | } |
392 | 392 | |
393 | -if($modx->hasPermission('remove_locks')) { |
|
393 | +if ($modx->hasPermission('remove_locks')) { |
|
394 | 394 | $sitemenu['remove_locks'] = array( |
395 | 395 | 'remove_locks', |
396 | 396 | 'tools', |
397 | - '<i class="fa fa-hourglass"></i>' . $_lang['remove_locks'], |
|
397 | + '<i class="fa fa-hourglass"></i>'.$_lang['remove_locks'], |
|
398 | 398 | 'javascript:modx.removeLocks();', |
399 | 399 | $_lang['remove_locks'], |
400 | 400 | '', |
@@ -406,11 +406,11 @@ discard block |
||
406 | 406 | ); |
407 | 407 | } |
408 | 408 | |
409 | -if($modx->hasPermission('import_static')) { |
|
409 | +if ($modx->hasPermission('import_static')) { |
|
410 | 410 | $sitemenu['import_site'] = array( |
411 | 411 | 'import_site', |
412 | 412 | 'tools', |
413 | - '<i class="fa fa-upload"></i>' . $_lang['import_site'], |
|
413 | + '<i class="fa fa-upload"></i>'.$_lang['import_site'], |
|
414 | 414 | 'index.php?a=95', |
415 | 415 | $_lang['import_site'], |
416 | 416 | '', |
@@ -422,11 +422,11 @@ discard block |
||
422 | 422 | ); |
423 | 423 | } |
424 | 424 | |
425 | -if($modx->hasPermission('export_static')) { |
|
425 | +if ($modx->hasPermission('export_static')) { |
|
426 | 426 | $sitemenu['export_site'] = array( |
427 | 427 | 'export_site', |
428 | 428 | 'tools', |
429 | - '<i class="fa fa-download"></i>' . $_lang['export_site'], |
|
429 | + '<i class="fa fa-download"></i>'.$_lang['export_site'], |
|
430 | 430 | 'index.php?a=83', |
431 | 431 | $_lang['export_site'], |
432 | 432 | '', |
@@ -439,20 +439,20 @@ discard block |
||
439 | 439 | } |
440 | 440 | |
441 | 441 | $menu = $modx->invokeEvent("OnManagerMenuPrerender", array('menu' => $sitemenu)); |
442 | -if(is_array($menu)) { |
|
442 | +if (is_array($menu)) { |
|
443 | 443 | $newmenu = array(); |
444 | - foreach($menu as $item){ |
|
445 | - if(is_array(unserialize($item))){ |
|
444 | + foreach ($menu as $item) { |
|
445 | + if (is_array(unserialize($item))) { |
|
446 | 446 | $newmenu = array_merge($newmenu, unserialize($item)); |
447 | 447 | } |
448 | 448 | } |
449 | - if(count($newmenu)> 0) $sitemenu = $newmenu; |
|
449 | + if (count($newmenu) > 0) $sitemenu = $newmenu; |
|
450 | 450 | } |
451 | 451 | |
452 | -if(file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php')) { |
|
453 | - include_once(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php'); |
|
452 | +if (file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/includes/menu.class.inc.php')) { |
|
453 | + include_once(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/includes/menu.class.inc.php'); |
|
454 | 454 | } else { |
455 | - include_once(MODX_MANAGER_PATH . 'includes/menu.class.inc.php'); |
|
455 | + include_once(MODX_MANAGER_PATH.'includes/menu.class.inc.php'); |
|
456 | 456 | } |
457 | 457 | $menu = new EVOmenu(); |
458 | 458 | $menu->Build($sitemenu, array( |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | 'active' |
33 | 33 | ); |
34 | 34 | |
35 | -if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('file_manager')) { |
|
35 | +if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('file_manager')) { |
|
36 | 36 | $sitemenu['elements'] = array( |
37 | 37 | 'elements', |
38 | 38 | 'main', |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | ); |
49 | 49 | } |
50 | 50 | |
51 | -if($modx->hasPermission('exec_module')) { |
|
51 | +if($modx->hasPermission('exec_module')) { |
|
52 | 52 | $sitemenu['modules'] = array( |
53 | 53 | 'modules', |
54 | 54 | 'main', |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | ); |
65 | 65 | } |
66 | 66 | |
67 | -if($modx->hasPermission('edit_user') || $modx->hasPermission('edit_web_user') || $modx->hasPermission('edit_role') || $modx->hasPermission('access_permissions') || $modx->hasPermission('web_access_permissions')) { |
|
67 | +if($modx->hasPermission('edit_user') || $modx->hasPermission('edit_web_user') || $modx->hasPermission('edit_role') || $modx->hasPermission('access_permissions') || $modx->hasPermission('web_access_permissions')) { |
|
68 | 68 | $sitemenu['users'] = array( |
69 | 69 | 'users', |
70 | 70 | 'main', |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | ); |
81 | 81 | } |
82 | 82 | |
83 | -if($modx->hasPermission('empty_cache') || $modx->hasPermission('bk_manager') || $modx->hasPermission('remove_locks') || $modx->hasPermission('import_static') || $modx->hasPermission('export_static')) { |
|
83 | +if($modx->hasPermission('empty_cache') || $modx->hasPermission('bk_manager') || $modx->hasPermission('remove_locks') || $modx->hasPermission('import_static') || $modx->hasPermission('export_static')) { |
|
84 | 84 | $sitemenu['tools'] = array( |
85 | 85 | 'tools', |
86 | 86 | 'main', |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | $tab = 0; |
100 | -if($modx->hasPermission('edit_template')) { |
|
100 | +if($modx->hasPermission('edit_template')) { |
|
101 | 101 | $sitemenu['element_templates'] = array( |
102 | 102 | 'element_templates', |
103 | 103 | 'elements', |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | 'dropdown-toggle' |
113 | 113 | ); |
114 | 114 | } |
115 | -if($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
|
115 | +if($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
|
116 | 116 | $sitemenu['element_tplvars'] = array( |
117 | 117 | 'element_tplvars', |
118 | 118 | 'elements', |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | 'dropdown-toggle' |
128 | 128 | ); |
129 | 129 | } |
130 | -if($modx->hasPermission('edit_chunk')) { |
|
130 | +if($modx->hasPermission('edit_chunk')) { |
|
131 | 131 | $sitemenu['element_htmlsnippets'] = array( |
132 | 132 | 'element_htmlsnippets', |
133 | 133 | 'elements', |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | 'dropdown-toggle' |
143 | 143 | ); |
144 | 144 | } |
145 | -if($modx->hasPermission('edit_snippet')) { |
|
145 | +if($modx->hasPermission('edit_snippet')) { |
|
146 | 146 | $sitemenu['element_snippets'] = array( |
147 | 147 | 'element_snippets', |
148 | 148 | 'elements', |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | 'dropdown-toggle' |
158 | 158 | ); |
159 | 159 | } |
160 | -if($modx->hasPermission('edit_plugin')) { |
|
160 | +if($modx->hasPermission('edit_plugin')) { |
|
161 | 161 | $sitemenu['element_plugins'] = array( |
162 | 162 | 'element_plugins', |
163 | 163 | 'elements', |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | } |
175 | 175 | //$sitemenu['element_categories'] = array('element_categories','elements',$_lang['element_categories'],'index.php?a=76&tab=5',$_lang['element_categories'],'','new_template,edit_template,new_snippet,edit_snippet,new_chunk,edit_chunk,new_plugin,edit_plugin','main',1,60,''); |
176 | 176 | |
177 | -if($modx->hasPermission('file_manager')) { |
|
177 | +if($modx->hasPermission('file_manager')) { |
|
178 | 178 | $sitemenu['manage_files'] = array( |
179 | 179 | 'manage_files', |
180 | 180 | 'elements', |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | '' |
190 | 190 | ); |
191 | 191 | } |
192 | -if($modx->hasPermission('category_manager')) { |
|
192 | +if($modx->hasPermission('category_manager')) { |
|
193 | 193 | $sitemenu['manage_categories'] = array( |
194 | 194 | 'manage_categories', |
195 | 195 | 'elements', |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | } |
207 | 207 | |
208 | 208 | // Modules Menu Items |
209 | -if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('save_module')) { |
|
209 | +if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('save_module')) { |
|
210 | 210 | $sitemenu['new_module'] = array( |
211 | 211 | 'new_module', |
212 | 212 | 'modules', |
@@ -222,19 +222,19 @@ discard block |
||
222 | 222 | ); |
223 | 223 | } |
224 | 224 | |
225 | -if($modx->hasPermission('exec_module')) { |
|
226 | - if($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
225 | +if($modx->hasPermission('exec_module')) { |
|
226 | + if($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
227 | 227 | $rs = $modx->getDatabase()->query('SELECT DISTINCT sm.id, sm.name, sm.icon, mg.member |
228 | 228 | FROM ' . $modx->getDatabase()->getFullTableName('site_modules') . ' AS sm |
229 | 229 | LEFT JOIN ' . $modx->getDatabase()->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id |
230 | 230 | LEFT JOIN ' . $modx->getDatabase()->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group |
231 | 231 | WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1 |
232 | 232 | ORDER BY sm.name'); |
233 | - } else { |
|
233 | + } else { |
|
234 | 234 | $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('site_modules'), 'disabled != 1', 'name'); |
235 | 235 | } |
236 | - if($modx->getDatabase()->getRecordCount($rs)) { |
|
237 | - while ($row = $modx->getDatabase()->getRow($rs)) { |
|
236 | + if($modx->getDatabase()->getRecordCount($rs)) { |
|
237 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
238 | 238 | $sitemenu['module' . $row['id']] = array( |
239 | 239 | 'module' . $row['id'], |
240 | 240 | 'modules', |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | |
255 | 255 | // security menu items (users) |
256 | 256 | |
257 | -if($modx->hasPermission('edit_user')) { |
|
257 | +if($modx->hasPermission('edit_user')) { |
|
258 | 258 | $sitemenu['user_management_title'] = array( |
259 | 259 | 'user_management_title', |
260 | 260 | 'users', |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | ); |
271 | 271 | } |
272 | 272 | |
273 | -if($modx->hasPermission('edit_web_user')) { |
|
273 | +if($modx->hasPermission('edit_web_user')) { |
|
274 | 274 | $sitemenu['web_user_management_title'] = array( |
275 | 275 | 'web_user_management_title', |
276 | 276 | 'users', |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | ); |
287 | 287 | } |
288 | 288 | |
289 | -if($modx->hasPermission('edit_role')) { |
|
289 | +if($modx->hasPermission('edit_role')) { |
|
290 | 290 | $sitemenu['role_management_title'] = array( |
291 | 291 | 'role_management_title', |
292 | 292 | 'users', |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | ); |
303 | 303 | } |
304 | 304 | |
305 | -if($modx->hasPermission('access_permissions')) { |
|
305 | +if($modx->hasPermission('access_permissions')) { |
|
306 | 306 | $sitemenu['manager_permissions'] = array( |
307 | 307 | 'manager_permissions', |
308 | 308 | 'users', |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | ); |
319 | 319 | } |
320 | 320 | |
321 | -if($modx->hasPermission('web_access_permissions')) { |
|
321 | +if($modx->hasPermission('web_access_permissions')) { |
|
322 | 322 | $sitemenu['web_permissions'] = array( |
323 | 323 | 'web_permissions', |
324 | 324 | 'users', |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | '' |
375 | 375 | ); |
376 | 376 | |
377 | -if($modx->hasPermission('bk_manager')) { |
|
377 | +if($modx->hasPermission('bk_manager')) { |
|
378 | 378 | $sitemenu['bk_manager'] = array( |
379 | 379 | 'bk_manager', |
380 | 380 | 'tools', |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | ); |
391 | 391 | } |
392 | 392 | |
393 | -if($modx->hasPermission('remove_locks')) { |
|
393 | +if($modx->hasPermission('remove_locks')) { |
|
394 | 394 | $sitemenu['remove_locks'] = array( |
395 | 395 | 'remove_locks', |
396 | 396 | 'tools', |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | ); |
407 | 407 | } |
408 | 408 | |
409 | -if($modx->hasPermission('import_static')) { |
|
409 | +if($modx->hasPermission('import_static')) { |
|
410 | 410 | $sitemenu['import_site'] = array( |
411 | 411 | 'import_site', |
412 | 412 | 'tools', |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | ); |
423 | 423 | } |
424 | 424 | |
425 | -if($modx->hasPermission('export_static')) { |
|
425 | +if($modx->hasPermission('export_static')) { |
|
426 | 426 | $sitemenu['export_site'] = array( |
427 | 427 | 'export_site', |
428 | 428 | 'tools', |
@@ -439,19 +439,21 @@ discard block |
||
439 | 439 | } |
440 | 440 | |
441 | 441 | $menu = $modx->invokeEvent("OnManagerMenuPrerender", array('menu' => $sitemenu)); |
442 | -if(is_array($menu)) { |
|
442 | +if(is_array($menu)) { |
|
443 | 443 | $newmenu = array(); |
444 | - foreach($menu as $item){ |
|
445 | - if(is_array(unserialize($item))){ |
|
444 | + foreach($menu as $item) { |
|
445 | + if(is_array(unserialize($item))) { |
|
446 | 446 | $newmenu = array_merge($newmenu, unserialize($item)); |
447 | 447 | } |
448 | 448 | } |
449 | - if(count($newmenu)> 0) $sitemenu = $newmenu; |
|
450 | -} |
|
449 | + if(count($newmenu)> 0) { |
|
450 | + $sitemenu = $newmenu; |
|
451 | + } |
|
452 | + } |
|
451 | 453 | |
452 | -if(file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php')) { |
|
454 | +if(file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php')) { |
|
453 | 455 | include_once(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php'); |
454 | -} else { |
|
456 | +} else { |
|
455 | 457 | include_once(MODX_MANAGER_PATH . 'includes/menu.class.inc.php'); |
456 | 458 | } |
457 | 459 | $menu = new EVOmenu(); |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | if (!$modx->hasPermission('save_template')) { |
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
9 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
10 | 10 | $reset = isset($_POST['reset']) && $_POST['reset'] == 'true' ? 1 : 0; |
11 | 11 | |
12 | 12 | $tbl_site_templates = $modx->getDatabase()->getFullTableName('site_templates'); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $templatename = ''; |
20 | 20 | |
21 | 21 | if (isset($_POST['listSubmitted'])) { |
22 | - $updateMsg .= '<div class="text-success" id="updated">' . $_lang['sort_updated'] . '</div>'; |
|
22 | + $updateMsg .= '<div class="text-success" id="updated">'.$_lang['sort_updated'].'</div>'; |
|
23 | 23 | foreach ($_POST as $listName => $listValue) { |
24 | 24 | if ($listName == 'listSubmitted' || $listName == 'reset') { |
25 | 25 | continue; |
@@ -47,11 +47,11 @@ discard block |
||
47 | 47 | while ($row = $modx->getDatabase()->getRow($rs)) { |
48 | 48 | $templatename = $row['templatename']; |
49 | 49 | $caption = $row['caption'] != '' ? $row['caption'] : $row['name']; |
50 | - $sortableList .= '<li id="item_' . $row['id'] . '"><i class="fa fa-list-alt"></i> ' . $caption . ' <small class="protectedNode" style="float:right">[*' . $row['name'] . '*]</small></li>'; |
|
50 | + $sortableList .= '<li id="item_'.$row['id'].'"><i class="fa fa-list-alt"></i> '.$caption.' <small class="protectedNode" style="float:right">[*'.$row['name'].'*]</small></li>'; |
|
51 | 51 | } |
52 | 52 | $sortableList .= '</ul></div>'; |
53 | 53 | } else { |
54 | - $updateMsg = '<p class="text-danger">' . $_lang['tmplvars_novars'] . '</p>'; |
|
54 | + $updateMsg = '<p class="text-danger">'.$_lang['tmplvars_novars'].'</p>'; |
|
55 | 55 | } |
56 | 56 | ?> |
57 | 57 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | </script> |
129 | 129 | |
130 | 130 | <h1> |
131 | - <i class="fa fa-sort-numeric-asc"></i><?= ($templatename ? $templatename . '<small>(' . $id . ')</small>' : $_lang['template_tv_edit_title']) ?> |
|
131 | + <i class="fa fa-sort-numeric-asc"></i><?= ($templatename ? $templatename.'<small>('.$id.')</small>' : $_lang['template_tv_edit_title']) ?> |
|
132 | 132 | </h1> |
133 | 133 | |
134 | 134 | <?= $_style['actionbuttons']['dynamic']['save'] ?> |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | 4 | } |
5 | 5 | if(!$modx->hasPermission('edit_user')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | ?> |
@@ -18,14 +18,14 @@ discard block |
||
18 | 18 | <div class="form-group"><?= $_lang['role_management_msg'] ?> <a class="btn btn-secondary btn-sm" href="index.php?a=38"><i class="<?= $_style["actions_new"] ?> hide4desktop"></i> <?= $_lang['new_role'] ?></a></div> |
19 | 19 | <div class="form-group"> |
20 | 20 | <?php |
21 | - $rs = $modx->getDatabase()->select('name, id, description', $modx->getDatabase()->getFullTableName('user_roles'), '', 'name'); |
|
22 | - $limit = $modx->getDatabase()->getRecordCount($rs); |
|
23 | - if($limit < 1) { |
|
24 | - ?> |
|
21 | + $rs = $modx->getDatabase()->select('name, id, description', $modx->getDatabase()->getFullTableName('user_roles'), '', 'name'); |
|
22 | + $limit = $modx->getDatabase()->getRecordCount($rs); |
|
23 | + if($limit < 1) { |
|
24 | + ?> |
|
25 | 25 | <p><?= $_lang["no_records_found"] ?></p> |
26 | 26 | <?php |
27 | - } else { |
|
28 | - ?> |
|
27 | + } else { |
|
28 | + ?> |
|
29 | 29 | <div class="row"> |
30 | 30 | <div class="table-responsive"> |
31 | 31 | <table class="table data"> |
@@ -37,24 +37,24 @@ discard block |
||
37 | 37 | </thead> |
38 | 38 | <tbody> |
39 | 39 | <?php |
40 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
41 | - if($row['id'] == 1) { |
|
42 | - ?> |
|
40 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
41 | + if($row['id'] == 1) { |
|
42 | + ?> |
|
43 | 43 | <tr class="text-muted disabled"> |
44 | 44 | <td><b><?= $row['name'] ?></b></td> |
45 | 45 | <td><span><?= $_lang['administrator_role_message'] ?></span></td> |
46 | 46 | </tr> |
47 | 47 | <?php |
48 | - } else { |
|
49 | - ?> |
|
48 | + } else { |
|
49 | + ?> |
|
50 | 50 | <tr> |
51 | 51 | <td><a class="text-primary" href="index.php?id=<?= $row['id'] ?>&a=35"><?= $row['name'] ?></a></td> |
52 | 52 | <td><?= $row['description'] ?></td> |
53 | 53 | </tr> |
54 | 54 | <?php |
55 | - } |
|
56 | - } |
|
57 | - ?> |
|
55 | + } |
|
56 | + } |
|
57 | + ?> |
|
58 | 58 | </tbody> |
59 | 59 | </table> |
60 | 60 | </div> |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if(!$modx->hasPermission('edit_user')) { |
|
5 | +if (!$modx->hasPermission('edit_user')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | <?php |
21 | 21 | $rs = $modx->getDatabase()->select('name, id, description', $modx->getDatabase()->getFullTableName('user_roles'), '', 'name'); |
22 | 22 | $limit = $modx->getDatabase()->getRecordCount($rs); |
23 | - if($limit < 1) { |
|
23 | + if ($limit < 1) { |
|
24 | 24 | ?> |
25 | 25 | <p><?= $_lang["no_records_found"] ?></p> |
26 | 26 | <?php |
@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | </thead> |
38 | 38 | <tbody> |
39 | 39 | <?php |
40 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
41 | - if($row['id'] == 1) { |
|
40 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
41 | + if ($row['id'] == 1) { |
|
42 | 42 | ?> |
43 | 43 | <tr class="text-muted disabled"> |
44 | 44 | <td><b><?= $row['name'] ?></b></td> |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | 4 | } |
5 | 5 | if(!$modx->hasPermission('edit_template') && $modx->getManagerApi()->action == '301') { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | if(!$modx->hasPermission('new_template') && $modx->getManagerApi()->action == '300') { |
9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | |
21 | 21 | // check to see the snippet editor isn't locked |
22 | 22 | if($lockedEl = $modx->elementIsLocked(2, $id)) { |
23 | - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar'])); |
|
23 | + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar'])); |
|
24 | 24 | } |
25 | 25 | // end check for lock |
26 | 26 | |
@@ -30,25 +30,25 @@ discard block |
||
30 | 30 | global $content; |
31 | 31 | $content = array(); |
32 | 32 | if(isset($_GET['id'])) { |
33 | - $rs = $modx->getDatabase()->select('*', $tbl_site_tmplvars, "id='{$id}'"); |
|
34 | - $content = $modx->getDatabase()->getRow($rs); |
|
35 | - if(!$content) { |
|
36 | - header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}"); |
|
37 | - } |
|
38 | - |
|
39 | - $_SESSION['itemname'] = $content['caption']; |
|
40 | - if($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) { |
|
41 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
42 | - } |
|
33 | + $rs = $modx->getDatabase()->select('*', $tbl_site_tmplvars, "id='{$id}'"); |
|
34 | + $content = $modx->getDatabase()->getRow($rs); |
|
35 | + if(!$content) { |
|
36 | + header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}"); |
|
37 | + } |
|
38 | + |
|
39 | + $_SESSION['itemname'] = $content['caption']; |
|
40 | + if($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) { |
|
41 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
42 | + } |
|
43 | 43 | } else if(isset($_REQUEST['itemname'])) { |
44 | - $content['name'] = $_REQUEST['itemname']; |
|
44 | + $content['name'] = $_REQUEST['itemname']; |
|
45 | 45 | } else { |
46 | - $_SESSION['itemname'] = $_lang["new_tmplvars"]; |
|
47 | - $content['category'] = (int)$_REQUEST['catid']; |
|
46 | + $_SESSION['itemname'] = $_lang["new_tmplvars"]; |
|
47 | + $content['category'] = (int)$_REQUEST['catid']; |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | if($modx->getManagerApi()->hasFormValues()) { |
51 | - $modx->getManagerApi()->loadFormValues(); |
|
51 | + $modx->getManagerApi()->loadFormValues(); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | $content = array_merge($content, $_POST); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $RTEditors = ''; |
63 | 63 | $evtOut = $modx->invokeEvent('OnRichTextEditorRegister', array('forfrontend' => 1)); |
64 | 64 | if(is_array($evtOut)) { |
65 | - $RTEditors = implode(',', $evtOut); |
|
65 | + $RTEditors = implode(',', $evtOut); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | ?> |
@@ -277,12 +277,12 @@ discard block |
||
277 | 277 | |
278 | 278 | <form name="mutate" method="post" action="index.php" enctype="multipart/form-data"> |
279 | 279 | <?php |
280 | - // invoke OnTVFormPrerender event |
|
281 | - $evtOut = $modx->invokeEvent('OnTVFormPrerender', array('id' => $id)); |
|
282 | - if(is_array($evtOut)) { |
|
283 | - echo implode("", $evtOut); |
|
284 | - } |
|
285 | - ?> |
|
280 | + // invoke OnTVFormPrerender event |
|
281 | + $evtOut = $modx->invokeEvent('OnTVFormPrerender', array('id' => $id)); |
|
282 | + if(is_array($evtOut)) { |
|
283 | + echo implode("", $evtOut); |
|
284 | + } |
|
285 | + ?> |
|
286 | 286 | <input type="hidden" name="id" value="<?= $content['id'] ?>"> |
287 | 287 | <input type="hidden" name="a" value="302"> |
288 | 288 | <input type="hidden" name="or" value="<?= $origin ?>"> |
@@ -343,11 +343,11 @@ discard block |
||
343 | 343 | <select name="categoryid" class="form-control" onChange="documentDirty=true;"> |
344 | 344 | <option> </option> |
345 | 345 | <?php |
346 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
347 | - foreach(getCategories() as $n => $v) { |
|
348 | - echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->getPhpCompat()->htmlspecialchars($v["category"]) . "</option>"; |
|
349 | - } |
|
350 | - ?> |
|
346 | + include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
347 | + foreach(getCategories() as $n => $v) { |
|
348 | + echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->getPhpCompat()->htmlspecialchars($v["category"]) . "</option>"; |
|
349 | + } |
|
350 | + ?> |
|
351 | 351 | </select> |
352 | 352 | </div> |
353 | 353 | </div> |
@@ -383,14 +383,14 @@ discard block |
||
383 | 383 | <optgroup label="Custom Type"> |
384 | 384 | <option value="custom_tv" <?= ($content['type'] == 'custom_tv' ? "selected='selected'" : "") ?>>Custom Input</option> |
385 | 385 | <?php |
386 | - $custom_tvs = scandir(MODX_BASE_PATH . 'assets/tvs'); |
|
387 | - foreach($custom_tvs as $ctv) { |
|
388 | - if(strpos($ctv, '.') !== 0 && $ctv != 'index.html') { |
|
389 | - $selected = ($content['type'] == 'custom_tv:' . $ctv ? "selected='selected'" : ""); |
|
390 | - echo '<option value="custom_tv:' . $ctv . '" ' . $selected . '>' . $ctv . '</option>'; |
|
391 | - } |
|
392 | - } |
|
393 | - ?> |
|
386 | + $custom_tvs = scandir(MODX_BASE_PATH . 'assets/tvs'); |
|
387 | + foreach($custom_tvs as $ctv) { |
|
388 | + if(strpos($ctv, '.') !== 0 && $ctv != 'index.html') { |
|
389 | + $selected = ($content['type'] == 'custom_tv:' . $ctv ? "selected='selected'" : ""); |
|
390 | + echo '<option value="custom_tv:' . $ctv . '" ' . $selected . '>' . $ctv . '</option>'; |
|
391 | + } |
|
392 | + } |
|
393 | + ?> |
|
394 | 394 | </optgroup> |
395 | 395 | </select> |
396 | 396 | </div> |
@@ -455,63 +455,63 @@ discard block |
||
455 | 455 | <a class="btn btn-secondary btn-sm" href="javascript:;" onClick="check_toggle(); return false;"><?= $_lang['check_toggle'] ?></a> |
456 | 456 | </div> |
457 | 457 | <?php |
458 | - $rs = $modx->getDatabase()->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 |
|
458 | + $rs = $modx->getDatabase()->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 |
|
459 | 459 | LEFT JOIN %s as stt ON stt.templateid=tpl.id AND stt.tmplvarid='%s' |
460 | 460 | LEFT JOIN %s as cat ON tpl.category=cat.id", $modx->getDatabase()->getFullTableName('site_templates'), $modx->getDatabase()->getFullTableName('site_tmplvar_templates'), $id, $modx->getDatabase()->getFullTableName('categories')), '', "category, templatename"); |
461 | 461 | |
462 | - $tplList = '<ul>'; |
|
463 | - $preCat = ''; |
|
464 | - $insideUl = 0; |
|
465 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
466 | - $row['category'] = stripslashes($row['category']); //pixelchutes |
|
467 | - if($preCat !== $row['category']) { |
|
468 | - $tplList .= $insideUl ? '</ul>' : ''; |
|
469 | - $tplList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>'; |
|
470 | - $insideUl = 1; |
|
471 | - } |
|
472 | - |
|
473 | - if($modx->getManagerApi()->action == '300' && $modx->config['default_template'] == $row['id']) { |
|
474 | - $checked = true; |
|
475 | - } elseif(isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) { |
|
476 | - $checked = true; |
|
477 | - } elseif($id == 0 && is_array($_POST['template'])) { |
|
478 | - $checked = in_array($row['id'], $_POST['template']); |
|
479 | - } else { |
|
480 | - $checked = $row['tmplvarid']; |
|
481 | - } |
|
482 | - $selectable = !$row['selectable'] ? ' class="disabled"' : ''; |
|
483 | - $checked = $checked ? ' checked="checked"' : ''; |
|
484 | - $tplId = ' <small>(' . $row['id'] . ')</small>'; |
|
485 | - $desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : ''; |
|
486 | - |
|
487 | - $tplInfo = array(); |
|
488 | - if($row['tpllocked']) { |
|
489 | - $tplInfo[] = $_lang['locked']; |
|
490 | - } |
|
491 | - if($row['id'] == $modx->config['default_template']) { |
|
492 | - $tplInfo[] = $_lang['defaulttemplate_title']; |
|
493 | - } |
|
494 | - $tplInfo = !empty($tplInfo) ? ' <em>(' . implode(', ', $tplInfo) . ')</em>' : ''; |
|
495 | - |
|
496 | - $tplList .= sprintf('<li><label%s><input name="template[]" value="%s" type="checkbox" %s onchange="documentDirty=true;"> %s%s%s%s</label></li>', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo); |
|
497 | - $tplList .= '</li>'; |
|
498 | - |
|
499 | - $preCat = $row['category']; |
|
500 | - } |
|
501 | - $tplList .= $insideUl ? '</ul>' : ''; |
|
502 | - $tplList .= '</ul>'; |
|
503 | - echo $tplList; |
|
504 | - |
|
505 | - ?> |
|
462 | + $tplList = '<ul>'; |
|
463 | + $preCat = ''; |
|
464 | + $insideUl = 0; |
|
465 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
466 | + $row['category'] = stripslashes($row['category']); //pixelchutes |
|
467 | + if($preCat !== $row['category']) { |
|
468 | + $tplList .= $insideUl ? '</ul>' : ''; |
|
469 | + $tplList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>'; |
|
470 | + $insideUl = 1; |
|
471 | + } |
|
472 | + |
|
473 | + if($modx->getManagerApi()->action == '300' && $modx->config['default_template'] == $row['id']) { |
|
474 | + $checked = true; |
|
475 | + } elseif(isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) { |
|
476 | + $checked = true; |
|
477 | + } elseif($id == 0 && is_array($_POST['template'])) { |
|
478 | + $checked = in_array($row['id'], $_POST['template']); |
|
479 | + } else { |
|
480 | + $checked = $row['tmplvarid']; |
|
481 | + } |
|
482 | + $selectable = !$row['selectable'] ? ' class="disabled"' : ''; |
|
483 | + $checked = $checked ? ' checked="checked"' : ''; |
|
484 | + $tplId = ' <small>(' . $row['id'] . ')</small>'; |
|
485 | + $desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : ''; |
|
486 | + |
|
487 | + $tplInfo = array(); |
|
488 | + if($row['tpllocked']) { |
|
489 | + $tplInfo[] = $_lang['locked']; |
|
490 | + } |
|
491 | + if($row['id'] == $modx->config['default_template']) { |
|
492 | + $tplInfo[] = $_lang['defaulttemplate_title']; |
|
493 | + } |
|
494 | + $tplInfo = !empty($tplInfo) ? ' <em>(' . implode(', ', $tplInfo) . ')</em>' : ''; |
|
495 | + |
|
496 | + $tplList .= sprintf('<li><label%s><input name="template[]" value="%s" type="checkbox" %s onchange="documentDirty=true;"> %s%s%s%s</label></li>', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo); |
|
497 | + $tplList .= '</li>'; |
|
498 | + |
|
499 | + $preCat = $row['category']; |
|
500 | + } |
|
501 | + $tplList .= $insideUl ? '</ul>' : ''; |
|
502 | + $tplList .= '</ul>'; |
|
503 | + echo $tplList; |
|
504 | + |
|
505 | + ?> |
|
506 | 506 | |
507 | 507 | <!-- Access Permissions --> |
508 | 508 | <?php |
509 | - if($use_udperms == 1) { |
|
510 | - // fetch permissions for the variable |
|
511 | - $rs = $modx->getDatabase()->select('documentgroup', $modx->getDatabase()->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); |
|
512 | - $groupsarray = $modx->getDatabase()->getColumn('documentgroup', $rs); |
|
509 | + if($use_udperms == 1) { |
|
510 | + // fetch permissions for the variable |
|
511 | + $rs = $modx->getDatabase()->select('documentgroup', $modx->getDatabase()->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); |
|
512 | + $groupsarray = $modx->getDatabase()->getColumn('documentgroup', $rs); |
|
513 | 513 | |
514 | - ?> |
|
514 | + ?> |
|
515 | 515 | <?php if($modx->hasPermission('access_permissions')) { ?> |
516 | 516 | <script type="text/javascript"> |
517 | 517 | function makePublic(b) { |
@@ -539,29 +539,29 @@ discard block |
||
539 | 539 | <!--<b><?php /*echo $_lang['access_permissions']; */ ?></b>--> |
540 | 540 | <p><?= $_lang['tmplvar_access_msg'] ?></p> |
541 | 541 | <?php |
542 | - $chk = ''; |
|
543 | - $rs = $modx->getDatabase()->select('name, id', $tbl_documentgroup_names); |
|
544 | - if(empty($groupsarray) && is_array($_POST['docgroups']) && empty($_POST['id'])) { |
|
545 | - $groupsarray = $_POST['docgroups']; |
|
546 | - } |
|
547 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
548 | - $checked = in_array($row['id'], $groupsarray); |
|
549 | - if($modx->hasPermission('access_permissions')) { |
|
550 | - if($checked) { |
|
551 | - $notPublic = true; |
|
552 | - } |
|
553 | - $chks .= "<li><label><input type='checkbox' name='docgroups[]' value='" . $row['id'] . "' " . ($checked ? "checked='checked'" : '') . " onclick=\"makePublic(false)\" /> " . $row['name'] . "</label></li>"; |
|
554 | - } else { |
|
555 | - if($checked) { |
|
556 | - echo "<input type='hidden' name='docgroups[]' value='" . $row['id'] . "' />"; |
|
557 | - } |
|
558 | - } |
|
559 | - } |
|
560 | - if($modx->hasPermission('access_permissions')) { |
|
561 | - $chks = "<li><label><input type='checkbox' name='chkalldocs' " . (!$notPublic ? "checked='checked'" : '') . " onclick=\"makePublic(true)\" /> <span class='warning'>" . $_lang['all_doc_groups'] . "</span></label></li>" . $chks; |
|
562 | - } |
|
563 | - echo '<ul>' . $chks . '</ul>'; |
|
564 | - ?> |
|
542 | + $chk = ''; |
|
543 | + $rs = $modx->getDatabase()->select('name, id', $tbl_documentgroup_names); |
|
544 | + if(empty($groupsarray) && is_array($_POST['docgroups']) && empty($_POST['id'])) { |
|
545 | + $groupsarray = $_POST['docgroups']; |
|
546 | + } |
|
547 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
548 | + $checked = in_array($row['id'], $groupsarray); |
|
549 | + if($modx->hasPermission('access_permissions')) { |
|
550 | + if($checked) { |
|
551 | + $notPublic = true; |
|
552 | + } |
|
553 | + $chks .= "<li><label><input type='checkbox' name='docgroups[]' value='" . $row['id'] . "' " . ($checked ? "checked='checked'" : '') . " onclick=\"makePublic(false)\" /> " . $row['name'] . "</label></li>"; |
|
554 | + } else { |
|
555 | + if($checked) { |
|
556 | + echo "<input type='hidden' name='docgroups[]' value='" . $row['id'] . "' />"; |
|
557 | + } |
|
558 | + } |
|
559 | + } |
|
560 | + if($modx->hasPermission('access_permissions')) { |
|
561 | + $chks = "<li><label><input type='checkbox' name='chkalldocs' " . (!$notPublic ? "checked='checked'" : '') . " onclick=\"makePublic(true)\" /> <span class='warning'>" . $_lang['all_doc_groups'] . "</span></label></li>" . $chks; |
|
562 | + } |
|
563 | + echo '<ul>' . $chks . '</ul>'; |
|
564 | + ?> |
|
565 | 565 | <?php } ?> |
566 | 566 | <?php } ?> |
567 | 567 | |
@@ -571,12 +571,12 @@ discard block |
||
571 | 571 | <input type="submit" name="save" style="display:none"> |
572 | 572 | |
573 | 573 | <?php |
574 | - // invoke OnTVFormRender event |
|
575 | - $evtOut = $modx->invokeEvent('OnTVFormRender', array('id' => $id)); |
|
576 | - if(is_array($evtOut)) { |
|
577 | - echo implode('', $evtOut); |
|
578 | - } |
|
579 | - ?> |
|
574 | + // invoke OnTVFormRender event |
|
575 | + $evtOut = $modx->invokeEvent('OnTVFormRender', array('id' => $id)); |
|
576 | + if(is_array($evtOut)) { |
|
577 | + echo implode('', $evtOut); |
|
578 | + } |
|
579 | + ?> |
|
580 | 580 | </div> |
581 | 581 | </form> |
582 | 582 | <script type="text/javascript">setTimeout('showParameters()', 10);</script> |
@@ -1,17 +1,17 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if(!$modx->hasPermission('edit_template') && $modx->getManagerApi()->action == '301') { |
|
5 | +if (!$modx->hasPermission('edit_template') && $modx->getManagerApi()->action == '301') { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | -if(!$modx->hasPermission('new_template') && $modx->getManagerApi()->action == '300') { |
|
8 | +if (!$modx->hasPermission('new_template') && $modx->getManagerApi()->action == '300') { |
|
9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
10 | 10 | } |
11 | 11 | |
12 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
13 | -$origin = isset($_REQUEST['or']) ? (int)$_REQUEST['or'] : 76; |
|
14 | -$originId = isset($_REQUEST['oid']) ? (int)$_REQUEST['oid'] : NULL; |
|
12 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
13 | +$origin = isset($_REQUEST['or']) ? (int) $_REQUEST['or'] : 76; |
|
14 | +$originId = isset($_REQUEST['oid']) ? (int) $_REQUEST['oid'] : NULL; |
|
15 | 15 | |
16 | 16 | $tbl_site_tmplvars = $modx->getDatabase()->getFullTableName('site_tmplvars'); |
17 | 17 | $tbl_site_templates = $modx->getDatabase()->getFullTableName('site_templates'); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $tbl_documentgroup_names = $modx->getDatabase()->getFullTableName('documentgroup_names'); |
20 | 20 | |
21 | 21 | // check to see the snippet editor isn't locked |
22 | -if($lockedEl = $modx->elementIsLocked(2, $id)) { |
|
22 | +if ($lockedEl = $modx->elementIsLocked(2, $id)) { |
|
23 | 23 | $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar'])); |
24 | 24 | } |
25 | 25 | // end check for lock |
@@ -29,25 +29,25 @@ discard block |
||
29 | 29 | |
30 | 30 | global $content; |
31 | 31 | $content = array(); |
32 | -if(isset($_GET['id'])) { |
|
32 | +if (isset($_GET['id'])) { |
|
33 | 33 | $rs = $modx->getDatabase()->select('*', $tbl_site_tmplvars, "id='{$id}'"); |
34 | 34 | $content = $modx->getDatabase()->getRow($rs); |
35 | - if(!$content) { |
|
36 | - header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}"); |
|
35 | + if (!$content) { |
|
36 | + header("Location: ".MODX_SITE_URL."index.php?id={$site_start}"); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | $_SESSION['itemname'] = $content['caption']; |
40 | - if($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) { |
|
40 | + if ($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) { |
|
41 | 41 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
42 | 42 | } |
43 | -} else if(isset($_REQUEST['itemname'])) { |
|
43 | +} else if (isset($_REQUEST['itemname'])) { |
|
44 | 44 | $content['name'] = $_REQUEST['itemname']; |
45 | 45 | } else { |
46 | 46 | $_SESSION['itemname'] = $_lang["new_tmplvars"]; |
47 | - $content['category'] = (int)$_REQUEST['catid']; |
|
47 | + $content['category'] = (int) $_REQUEST['catid']; |
|
48 | 48 | } |
49 | 49 | |
50 | -if($modx->getManagerApi()->hasFormValues()) { |
|
50 | +if ($modx->getManagerApi()->hasFormValues()) { |
|
51 | 51 | $modx->getManagerApi()->loadFormValues(); |
52 | 52 | } |
53 | 53 | |
@@ -56,12 +56,12 @@ discard block |
||
56 | 56 | // Add lock-element JS-Script |
57 | 57 | $lockElementId = $id; |
58 | 58 | $lockElementType = 2; |
59 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
59 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
60 | 60 | |
61 | 61 | // get available RichText Editors |
62 | 62 | $RTEditors = ''; |
63 | 63 | $evtOut = $modx->invokeEvent('OnRichTextEditorRegister', array('forfrontend' => 1)); |
64 | -if(is_array($evtOut)) { |
|
64 | +if (is_array($evtOut)) { |
|
65 | 65 | $RTEditors = implode(',', $evtOut); |
66 | 66 | } |
67 | 67 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | }, |
108 | 108 | cancel: function() { |
109 | 109 | documentDirty = false; |
110 | - document.location.href = 'index.php?a=<?= $origin ?><?=(empty($originId) ? '' : '&id=' . $originId) ?>'; |
|
110 | + document.location.href = 'index.php?a=<?= $origin ?><?=(empty($originId) ? '' : '&id='.$originId) ?>'; |
|
111 | 111 | } |
112 | 112 | }; |
113 | 113 | |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | <?php |
280 | 280 | // invoke OnTVFormPrerender event |
281 | 281 | $evtOut = $modx->invokeEvent('OnTVFormPrerender', array('id' => $id)); |
282 | - if(is_array($evtOut)) { |
|
282 | + if (is_array($evtOut)) { |
|
283 | 283 | echo implode("", $evtOut); |
284 | 284 | } |
285 | 285 | ?> |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | <input type="hidden" name="params" value="<?= $modx->getPhpCompat()->htmlspecialchars($content['display_params']) ?>"> |
292 | 292 | |
293 | 293 | <h1> |
294 | - <i class="fa fa-list-alt"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_tmplvars']) ?><i class="fa fa-question-circle help"></i> |
|
294 | + <i class="fa fa-list-alt"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_tmplvars']) ?><i class="fa fa-question-circle help"></i> |
|
295 | 295 | </h1> |
296 | 296 | |
297 | 297 | <?= $_style['actionbuttons']['dynamic']['element'] ?> |
@@ -314,8 +314,8 @@ discard block |
||
314 | 314 | <div class="col-md-9 col-lg-10"> |
315 | 315 | <div class="form-control-name clearfix"> |
316 | 316 | <input name="name" type="text" maxlength="50" value="<?= $modx->getPhpCompat()->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" /> |
317 | - <?php if($modx->hasPermission('save_role')): ?> |
|
318 | - <label class="custom-control" title="<?= $_lang['lock_tmplvars'] . "\n" . $_lang['lock_tmplvars_msg'] ?>" tooltip> |
|
317 | + <?php if ($modx->hasPermission('save_role')): ?> |
|
318 | + <label class="custom-control" title="<?= $_lang['lock_tmplvars']."\n".$_lang['lock_tmplvars_msg'] ?>" tooltip> |
|
319 | 319 | <input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> /> |
320 | 320 | <i class="fa fa-lock"></i> |
321 | 321 | </label> |
@@ -343,9 +343,9 @@ discard block |
||
343 | 343 | <select name="categoryid" class="form-control" onChange="documentDirty=true;"> |
344 | 344 | <option> </option> |
345 | 345 | <?php |
346 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
347 | - foreach(getCategories() as $n => $v) { |
|
348 | - echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->getPhpCompat()->htmlspecialchars($v["category"]) . "</option>"; |
|
346 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
347 | + foreach (getCategories() as $n => $v) { |
|
348 | + echo "<option value='".$v['id']."'".($content["category"] == $v["id"] ? " selected='selected'" : "").">".$modx->getPhpCompat()->htmlspecialchars($v["category"])."</option>"; |
|
349 | 349 | } |
350 | 350 | ?> |
351 | 351 | </select> |
@@ -383,11 +383,11 @@ discard block |
||
383 | 383 | <optgroup label="Custom Type"> |
384 | 384 | <option value="custom_tv" <?= ($content['type'] == 'custom_tv' ? "selected='selected'" : "") ?>>Custom Input</option> |
385 | 385 | <?php |
386 | - $custom_tvs = scandir(MODX_BASE_PATH . 'assets/tvs'); |
|
387 | - foreach($custom_tvs as $ctv) { |
|
388 | - if(strpos($ctv, '.') !== 0 && $ctv != 'index.html') { |
|
389 | - $selected = ($content['type'] == 'custom_tv:' . $ctv ? "selected='selected'" : ""); |
|
390 | - echo '<option value="custom_tv:' . $ctv . '" ' . $selected . '>' . $ctv . '</option>'; |
|
386 | + $custom_tvs = scandir(MODX_BASE_PATH.'assets/tvs'); |
|
387 | + foreach ($custom_tvs as $ctv) { |
|
388 | + if (strpos($ctv, '.') !== 0 && $ctv != 'index.html') { |
|
389 | + $selected = ($content['type'] == 'custom_tv:'.$ctv ? "selected='selected'" : ""); |
|
390 | + echo '<option value="custom_tv:'.$ctv.'" '.$selected.'>'.$ctv.'</option>'; |
|
391 | 391 | } |
392 | 392 | } |
393 | 393 | ?> |
@@ -462,36 +462,36 @@ discard block |
||
462 | 462 | $tplList = '<ul>'; |
463 | 463 | $preCat = ''; |
464 | 464 | $insideUl = 0; |
465 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
465 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
466 | 466 | $row['category'] = stripslashes($row['category']); //pixelchutes |
467 | - if($preCat !== $row['category']) { |
|
467 | + if ($preCat !== $row['category']) { |
|
468 | 468 | $tplList .= $insideUl ? '</ul>' : ''; |
469 | - $tplList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>'; |
|
469 | + $tplList .= '<li><strong>'.$row['category'].($row['catid'] != '' ? ' <small>('.$row['catid'].')</small>' : '').'</strong><ul>'; |
|
470 | 470 | $insideUl = 1; |
471 | 471 | } |
472 | 472 | |
473 | - if($modx->getManagerApi()->action == '300' && $modx->config['default_template'] == $row['id']) { |
|
473 | + if ($modx->getManagerApi()->action == '300' && $modx->config['default_template'] == $row['id']) { |
|
474 | 474 | $checked = true; |
475 | - } elseif(isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) { |
|
475 | + } elseif (isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) { |
|
476 | 476 | $checked = true; |
477 | - } elseif($id == 0 && is_array($_POST['template'])) { |
|
477 | + } elseif ($id == 0 && is_array($_POST['template'])) { |
|
478 | 478 | $checked = in_array($row['id'], $_POST['template']); |
479 | 479 | } else { |
480 | 480 | $checked = $row['tmplvarid']; |
481 | 481 | } |
482 | 482 | $selectable = !$row['selectable'] ? ' class="disabled"' : ''; |
483 | 483 | $checked = $checked ? ' checked="checked"' : ''; |
484 | - $tplId = ' <small>(' . $row['id'] . ')</small>'; |
|
485 | - $desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : ''; |
|
484 | + $tplId = ' <small>('.$row['id'].')</small>'; |
|
485 | + $desc = !empty($row['tpldescription']) ? ' - '.$row['tpldescription'] : ''; |
|
486 | 486 | |
487 | 487 | $tplInfo = array(); |
488 | - if($row['tpllocked']) { |
|
488 | + if ($row['tpllocked']) { |
|
489 | 489 | $tplInfo[] = $_lang['locked']; |
490 | 490 | } |
491 | - if($row['id'] == $modx->config['default_template']) { |
|
491 | + if ($row['id'] == $modx->config['default_template']) { |
|
492 | 492 | $tplInfo[] = $_lang['defaulttemplate_title']; |
493 | 493 | } |
494 | - $tplInfo = !empty($tplInfo) ? ' <em>(' . implode(', ', $tplInfo) . ')</em>' : ''; |
|
494 | + $tplInfo = !empty($tplInfo) ? ' <em>('.implode(', ', $tplInfo).')</em>' : ''; |
|
495 | 495 | |
496 | 496 | $tplList .= sprintf('<li><label%s><input name="template[]" value="%s" type="checkbox" %s onchange="documentDirty=true;"> %s%s%s%s</label></li>', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo); |
497 | 497 | $tplList .= '</li>'; |
@@ -506,13 +506,13 @@ discard block |
||
506 | 506 | |
507 | 507 | <!-- Access Permissions --> |
508 | 508 | <?php |
509 | - if($use_udperms == 1) { |
|
509 | + if ($use_udperms == 1) { |
|
510 | 510 | // fetch permissions for the variable |
511 | 511 | $rs = $modx->getDatabase()->select('documentgroup', $modx->getDatabase()->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); |
512 | 512 | $groupsarray = $modx->getDatabase()->getColumn('documentgroup', $rs); |
513 | 513 | |
514 | 514 | ?> |
515 | - <?php if($modx->hasPermission('access_permissions')) { ?> |
|
515 | + <?php if ($modx->hasPermission('access_permissions')) { ?> |
|
516 | 516 | <script type="text/javascript"> |
517 | 517 | function makePublic(b) { |
518 | 518 | var notPublic = false; |
@@ -541,26 +541,26 @@ discard block |
||
541 | 541 | <?php |
542 | 542 | $chk = ''; |
543 | 543 | $rs = $modx->getDatabase()->select('name, id', $tbl_documentgroup_names); |
544 | - if(empty($groupsarray) && is_array($_POST['docgroups']) && empty($_POST['id'])) { |
|
544 | + if (empty($groupsarray) && is_array($_POST['docgroups']) && empty($_POST['id'])) { |
|
545 | 545 | $groupsarray = $_POST['docgroups']; |
546 | 546 | } |
547 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
547 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
548 | 548 | $checked = in_array($row['id'], $groupsarray); |
549 | - if($modx->hasPermission('access_permissions')) { |
|
550 | - if($checked) { |
|
549 | + if ($modx->hasPermission('access_permissions')) { |
|
550 | + if ($checked) { |
|
551 | 551 | $notPublic = true; |
552 | 552 | } |
553 | - $chks .= "<li><label><input type='checkbox' name='docgroups[]' value='" . $row['id'] . "' " . ($checked ? "checked='checked'" : '') . " onclick=\"makePublic(false)\" /> " . $row['name'] . "</label></li>"; |
|
553 | + $chks .= "<li><label><input type='checkbox' name='docgroups[]' value='".$row['id']."' ".($checked ? "checked='checked'" : '')." onclick=\"makePublic(false)\" /> ".$row['name']."</label></li>"; |
|
554 | 554 | } else { |
555 | - if($checked) { |
|
556 | - echo "<input type='hidden' name='docgroups[]' value='" . $row['id'] . "' />"; |
|
555 | + if ($checked) { |
|
556 | + echo "<input type='hidden' name='docgroups[]' value='".$row['id']."' />"; |
|
557 | 557 | } |
558 | 558 | } |
559 | 559 | } |
560 | - if($modx->hasPermission('access_permissions')) { |
|
561 | - $chks = "<li><label><input type='checkbox' name='chkalldocs' " . (!$notPublic ? "checked='checked'" : '') . " onclick=\"makePublic(true)\" /> <span class='warning'>" . $_lang['all_doc_groups'] . "</span></label></li>" . $chks; |
|
560 | + if ($modx->hasPermission('access_permissions')) { |
|
561 | + $chks = "<li><label><input type='checkbox' name='chkalldocs' ".(!$notPublic ? "checked='checked'" : '')." onclick=\"makePublic(true)\" /> <span class='warning'>".$_lang['all_doc_groups']."</span></label></li>".$chks; |
|
562 | 562 | } |
563 | - echo '<ul>' . $chks . '</ul>'; |
|
563 | + echo '<ul>'.$chks.'</ul>'; |
|
564 | 564 | ?> |
565 | 565 | <?php } ?> |
566 | 566 | <?php } ?> |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | <?php |
574 | 574 | // invoke OnTVFormRender event |
575 | 575 | $evtOut = $modx->invokeEvent('OnTVFormRender', array('id' => $id)); |
576 | - if(is_array($evtOut)) { |
|
576 | + if (is_array($evtOut)) { |
|
577 | 577 | echo implode('', $evtOut); |
578 | 578 | } |
579 | 579 | ?> |
@@ -11,7 +11,7 @@ |
||
11 | 11 | |
12 | 12 | $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
13 | 13 | $origin = isset($_REQUEST['or']) ? (int)$_REQUEST['or'] : 76; |
14 | -$originId = isset($_REQUEST['oid']) ? (int)$_REQUEST['oid'] : NULL; |
|
14 | +$originId = isset($_REQUEST['oid']) ? (int)$_REQUEST['oid'] : null; |
|
15 | 15 | |
16 | 16 | $tbl_site_tmplvars = $modx->getDatabase()->getFullTableName('site_tmplvars'); |
17 | 17 | $tbl_site_templates = $modx->getDatabase()->getFullTableName('site_templates'); |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | - $site_unavailable_message_view = isset($site_unavailable_message) ? $site_unavailable_message : $_lang['siteunavailable_message_default']; |
|
2 | + $site_unavailable_message_view = isset($site_unavailable_message) ? $site_unavailable_message : $_lang['siteunavailable_message_default']; |
|
3 | 3 | ?> |
4 | 4 | <style> |
5 | 5 | table.sysSettings > tbody td, table.sysSettings > tbody th {border-bottom:1px dotted #ccc;padding:10px;} |
@@ -135,8 +135,8 @@ discard block |
||
135 | 135 | <?php |
136 | 136 | // Check if PHX is enabled |
137 | 137 | $count = $modx->getDatabase()->getRecordCount( |
138 | - $modx->getDatabase()->select('id', $modx->getDatabase()->getFullTableName('site_plugins'), |
|
139 | - "plugincode LIKE '%phx.parser.class.inc.php%OnParseDocument();%' AND disabled != 1") |
|
138 | + $modx->getDatabase()->select('id', $modx->getDatabase()->getFullTableName('site_plugins'), |
|
139 | + "plugincode LIKE '%phx.parser.class.inc.php%OnParseDocument();%' AND disabled != 1") |
|
140 | 140 | ); |
141 | 141 | if($count) { |
142 | 142 | $disabledFilters = 1; |
@@ -259,14 +259,14 @@ discard block |
||
259 | 259 | <th><?php echo $_lang['serveroffset_title'] ?><br><small>[(server_offset_time)]</small></th> |
260 | 260 | <td> <select name="server_offset_time" size="1" class="inputBox"> |
261 | 261 | <?php |
262 | - for($i=-24; $i<25; $i++) { |
|
263 | - $seconds = $i*60*60; |
|
264 | - $selectedtext = $seconds==$server_offset_time ? "selected='selected'" : "" ; |
|
265 | - ?> |
|
262 | + for($i=-24; $i<25; $i++) { |
|
263 | + $seconds = $i*60*60; |
|
264 | + $selectedtext = $seconds==$server_offset_time ? "selected='selected'" : "" ; |
|
265 | + ?> |
|
266 | 266 | <option value="<?php echo $seconds; ?>" <?php echo $selectedtext; ?>><?php echo $i; ?></option> |
267 | 267 | <?php |
268 | - } |
|
269 | - ?> |
|
268 | + } |
|
269 | + ?> |
|
270 | 270 | </select> |
271 | 271 | <div class="comment"><?php printf($_lang['serveroffset_message'], strftime('%H:%M:%S', time()), strftime('%H:%M:%S', time()+$server_offset_time)); ?></div> |
272 | 272 | </td> |
@@ -13,8 +13,8 @@ discard block |
||
13 | 13 | <tr> |
14 | 14 | <th><?php echo $_lang['sitestatus_title'] ?><br><small>[(site_status)]</small></th> |
15 | 15 | <td> |
16 | - <?php echo wrap_label($_lang['online'], form_radio('site_status', 1));?><br /> |
|
17 | - <?php echo wrap_label($_lang['offline'], form_radio('site_status', 0));?> |
|
16 | + <?php echo wrap_label($_lang['online'], form_radio('site_status', 1)); ?><br /> |
|
17 | + <?php echo wrap_label($_lang['offline'], form_radio('site_status', 0)); ?> |
|
18 | 18 | </td> |
19 | 19 | </tr> |
20 | 20 | <tr> |
@@ -58,12 +58,12 @@ discard block |
||
58 | 58 | <br /> |
59 | 59 | <p><?php echo $_lang['update_settings_from_language']; ?></p> |
60 | 60 | <select name="reload_site_unavailable" id="reload_site_unavailable_select" onchange="confirmLangChange(this, 'siteunavailable_message_default', 'site_unavailable_message_textarea');"> |
61 | -<?php echo get_lang_options('siteunavailable_message_default');?> |
|
61 | +<?php echo get_lang_options('siteunavailable_message_default'); ?> |
|
62 | 62 | </select> |
63 | 63 | </th> |
64 | 64 | <td> <textarea name="site_unavailable_message" id="site_unavailable_message_textarea" style="width:100%; height: 120px;"><?php echo $site_unavailable_message_view; ?></textarea> |
65 | - <input type="hidden" name="siteunavailable_message_default" id="siteunavailable_message_default_hidden" value="<?php echo addslashes($_lang['siteunavailable_message_default']);?>" /> |
|
66 | - <div class="comment"><?php echo $_lang['siteunavailable_message'];?></div> |
|
65 | + <input type="hidden" name="siteunavailable_message_default" id="siteunavailable_message_default_hidden" value="<?php echo addslashes($_lang['siteunavailable_message_default']); ?>" /> |
|
66 | + <div class="comment"><?php echo $_lang['siteunavailable_message']; ?></div> |
|
67 | 67 | </td> |
68 | 68 | </tr> |
69 | 69 | <tr> |
@@ -78,17 +78,17 @@ discard block |
||
78 | 78 | 'c.category, t.templatename ASC' |
79 | 79 | ); |
80 | 80 | ?> |
81 | - <select name="default_template" class="inputBox" onchange="documentDirty=true;wrap=document.getElementById('template_reset_options_wrapper');if(this.options[this.selectedIndex].value != '<?php echo $default_template;?>'){wrap.style.display='block';}else{wrap.style.display='none';}" style="width:150px"> |
|
81 | + <select name="default_template" class="inputBox" onchange="documentDirty=true;wrap=document.getElementById('template_reset_options_wrapper');if(this.options[this.selectedIndex].value != '<?php echo $default_template; ?>'){wrap.style.display='block';}else{wrap.style.display='none';}" style="width:150px"> |
|
82 | 82 | <?php |
83 | 83 | |
84 | 84 | $currentCategory = ''; |
85 | 85 | while ($row = $modx->getDatabase()->getRow($rs)) { |
86 | 86 | $thisCategory = $row['category']; |
87 | - if($thisCategory == null) { |
|
87 | + if ($thisCategory == null) { |
|
88 | 88 | $thisCategory = $_lang['no_category']; |
89 | 89 | } |
90 | - if($thisCategory != $currentCategory) { |
|
91 | - if($closeOptGroup) { |
|
90 | + if ($thisCategory != $currentCategory) { |
|
91 | + if ($closeOptGroup) { |
|
92 | 92 | echo "\t\t\t\t\t</optgroup>\n"; |
93 | 93 | } |
94 | 94 | echo "\t\t\t\t\t<optgroup label=\"$thisCategory\">\n"; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | echo "\t\t\t\t\t".'<option value="'.$row['id'].'"'.$selectedtext.'>'.$row['templatename']."</option>\n"; |
107 | 107 | $currentCategory = $thisCategory; |
108 | 108 | } |
109 | - if($thisCategory != '') { |
|
109 | + if ($thisCategory != '') { |
|
110 | 110 | echo "\t\t\t\t\t</optgroup>\n"; |
111 | 111 | } |
112 | 112 | ?> |
@@ -114,19 +114,19 @@ discard block |
||
114 | 114 | <br /> |
115 | 115 | <div id="template_reset_options_wrapper" style="display:none;"> |
116 | 116 | <label><input type="radio" name="reset_template" value="1" /> <?php echo $_lang['template_reset_all']; ?></label><br /> |
117 | - <label><input type="radio" name="reset_template" value="2" /> <?php echo sprintf($_lang['template_reset_specific'],$oldTmpName); ?></label> |
|
117 | + <label><input type="radio" name="reset_template" value="2" /> <?php echo sprintf($_lang['template_reset_specific'], $oldTmpName); ?></label> |
|
118 | 118 | </div> |
119 | 119 | <input type="hidden" name="old_template" value="<?php echo $oldTmpId; ?>" /> |
120 | 120 | <div class="comment"><?php echo $_lang['defaulttemplate_message'] ?></div> |
121 | 121 | </td> |
122 | 122 | </tr> |
123 | 123 | <tr> |
124 | - <th><?php echo $_lang['defaulttemplate_logic_title'];?><br><small>[(auto_template_logic)]</small></th> |
|
124 | + <th><?php echo $_lang['defaulttemplate_logic_title']; ?><br><small>[(auto_template_logic)]</small></th> |
|
125 | 125 | <td> |
126 | - <p><?php echo $_lang['defaulttemplate_logic_general_message'];?></p> |
|
127 | - <label><input type="radio" name="auto_template_logic" value="system"<?php if($auto_template_logic == 'system') {echo " checked='checked'";}?>/> <?php echo $_lang['defaulttemplate_logic_system_message']; ?></label><br /> |
|
128 | - <label><input type="radio" name="auto_template_logic" value="parent"<?php if($auto_template_logic == 'parent') {echo " checked='checked'";}?>/> <?php echo $_lang['defaulttemplate_logic_parent_message']; ?></label><br /> |
|
129 | - <label><input type="radio" name="auto_template_logic" value="sibling"<?php if($auto_template_logic == 'sibling') {echo " checked='checked'";}?>/> <?php echo $_lang['defaulttemplate_logic_sibling_message']; ?></label><br /> |
|
126 | + <p><?php echo $_lang['defaulttemplate_logic_general_message']; ?></p> |
|
127 | + <label><input type="radio" name="auto_template_logic" value="system"<?php if ($auto_template_logic == 'system') {echo " checked='checked'"; }?>/> <?php echo $_lang['defaulttemplate_logic_system_message']; ?></label><br /> |
|
128 | + <label><input type="radio" name="auto_template_logic" value="parent"<?php if ($auto_template_logic == 'parent') {echo " checked='checked'"; }?>/> <?php echo $_lang['defaulttemplate_logic_parent_message']; ?></label><br /> |
|
129 | + <label><input type="radio" name="auto_template_logic" value="sibling"<?php if ($auto_template_logic == 'sibling') {echo " checked='checked'"; }?>/> <?php echo $_lang['defaulttemplate_logic_sibling_message']; ?></label><br /> |
|
130 | 130 | </td> |
131 | 131 | </tr> |
132 | 132 | <tr> |
@@ -138,22 +138,22 @@ discard block |
||
138 | 138 | $modx->getDatabase()->select('id', $modx->getDatabase()->getFullTableName('site_plugins'), |
139 | 139 | "plugincode LIKE '%phx.parser.class.inc.php%OnParseDocument();%' AND disabled != 1") |
140 | 140 | ); |
141 | - if($count) { |
|
141 | + if ($count) { |
|
142 | 142 | $disabledFilters = 1; |
143 | 143 | echo '<b>'.$_lang['enable_filter_phx_warning'].'</b><br/>'; |
144 | 144 | } |
145 | 145 | else $disabledFilters = false; |
146 | 146 | ?> |
147 | - <?php echo wrap_label($_lang['yes'],form_radio('enable_filter', 1, '', $disabledFilters));?><br /> |
|
148 | - <?php echo wrap_label($_lang['no'], form_radio('enable_filter', 0, '', $disabledFilters));?> |
|
147 | + <?php echo wrap_label($_lang['yes'], form_radio('enable_filter', 1, '', $disabledFilters)); ?><br /> |
|
148 | + <?php echo wrap_label($_lang['no'], form_radio('enable_filter', 0, '', $disabledFilters)); ?> |
|
149 | 149 | <div class="comment"><?php echo $_lang['enable_filter_message']; ?></div> |
150 | 150 | </td> |
151 | 151 | </tr> |
152 | 152 | <tr> |
153 | 153 | <th><?php echo $_lang['enable_at_syntax_title'] ?><br><small>[(enable_at_syntax)]</small></th> |
154 | 154 | <td > |
155 | - <?php echo wrap_label($_lang['yes'],form_radio('enable_at_syntax', 1));?><br /> |
|
156 | - <?php echo wrap_label($_lang['no'], form_radio('enable_at_syntax', 0));?> |
|
155 | + <?php echo wrap_label($_lang['yes'], form_radio('enable_at_syntax', 1)); ?><br /> |
|
156 | + <?php echo wrap_label($_lang['no'], form_radio('enable_at_syntax', 0)); ?> |
|
157 | 157 | <div class="comment"> |
158 | 158 | <?php echo $_lang['enable_at_syntax_message']; ?> |
159 | 159 | <ul> |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | <tr> |
168 | 168 | <th><?php echo $_lang['defaultpublish_title'] ?><br><small>[(publish_default)]</small></th> |
169 | 169 | <td> |
170 | - <?php echo wrap_label($_lang['yes'],form_radio('publish_default', 1));?><br /> |
|
171 | - <?php echo wrap_label($_lang['no'],form_radio('publish_default', 0));?> |
|
170 | + <?php echo wrap_label($_lang['yes'], form_radio('publish_default', 1)); ?><br /> |
|
171 | + <?php echo wrap_label($_lang['no'], form_radio('publish_default', 0)); ?> |
|
172 | 172 | <div class="comment"><?php echo $_lang['defaultpublish_message'] ?></div> |
173 | 173 | </td> |
174 | 174 | </tr> |
@@ -176,24 +176,24 @@ discard block |
||
176 | 176 | <tr> |
177 | 177 | <th><?php echo $_lang['defaultcache_title'] ?><br><small>[(cache_default)]</small></th> |
178 | 178 | <td> |
179 | - <?php echo wrap_label($_lang['yes'],form_radio('cache_default', 1));?><br /> |
|
180 | - <?php echo wrap_label($_lang['no'],form_radio('cache_default', 0));?> |
|
179 | + <?php echo wrap_label($_lang['yes'], form_radio('cache_default', 1)); ?><br /> |
|
180 | + <?php echo wrap_label($_lang['no'], form_radio('cache_default', 0)); ?> |
|
181 | 181 | <div class="comment"><?php echo $_lang['defaultcache_message'] ?></div> |
182 | 182 | </td> |
183 | 183 | </tr> |
184 | 184 | <tr> |
185 | 185 | <th><?php echo $_lang['defaultsearch_title'] ?><br><small>[(search_default)]</small></th> |
186 | 186 | <td> |
187 | - <?php echo wrap_label($_lang['yes'],form_radio('search_default', 1));?><br /> |
|
188 | - <?php echo wrap_label($_lang['no'],form_radio('search_default', 0));?> |
|
187 | + <?php echo wrap_label($_lang['yes'], form_radio('search_default', 1)); ?><br /> |
|
188 | + <?php echo wrap_label($_lang['no'], form_radio('search_default', 0)); ?> |
|
189 | 189 | <div class="comment"><?php echo $_lang['defaultsearch_message'] ?></div> |
190 | 190 | </td> |
191 | 191 | </tr> |
192 | 192 | <tr> |
193 | 193 | <th><?php echo $_lang['defaultmenuindex_title'] ?><br><small>[(auto_menuindex)]</small></th> |
194 | 194 | <td> |
195 | - <?php echo wrap_label($_lang['yes'],form_radio('auto_menuindex', 1));?><br /> |
|
196 | - <?php echo wrap_label($_lang['no'],form_radio('auto_menuindex', 0));?> |
|
195 | + <?php echo wrap_label($_lang['yes'], form_radio('auto_menuindex', 1)); ?><br /> |
|
196 | + <?php echo wrap_label($_lang['no'], form_radio('auto_menuindex', 0)); ?> |
|
197 | 197 | <div class="comment"><?php echo $_lang['defaultmenuindex_message'] ?></div> |
198 | 198 | </td> |
199 | 199 | </tr> |
@@ -203,8 +203,8 @@ discard block |
||
203 | 203 | <table border="0" cellspacing="0" cellpadding="0"><tr><td valign="top"> |
204 | 204 | <select name="lst_custom_contenttype" style="width:200px;height:100px;" size="5"> |
205 | 205 | <?php |
206 | - $ct = explode(",",$custom_contenttype); |
|
207 | - for($i=0;$i<count($ct);$i++) { |
|
206 | + $ct = explode(",", $custom_contenttype); |
|
207 | + for ($i = 0; $i < count($ct); $i++) { |
|
208 | 208 | echo "<option value=\"".$ct[$i]."\">".$ct[$i]."</option>"; |
209 | 209 | } |
210 | 210 | ?> |
@@ -218,14 +218,14 @@ discard block |
||
218 | 218 | <th><?php echo $_lang['docid_incrmnt_method_title'] ?><br><small>[(docid_incrmnt_method)]</small></th> |
219 | 219 | <td> |
220 | 220 | <label><input type="radio" name="docid_incrmnt_method" value="0" |
221 | - <?php echo ($docid_incrmnt_method=='0') ? 'checked="checked"' : "" ; ?> /> |
|
221 | + <?php echo ($docid_incrmnt_method == '0') ? 'checked="checked"' : ""; ?> /> |
|
222 | 222 | <?php echo $_lang['docid_incrmnt_method_0']?></label><br /> |
223 | 223 | |
224 | 224 | <label><input type="radio" name="docid_incrmnt_method" value="1" |
225 | - <?php echo ($docid_incrmnt_method=='1') ? 'checked="checked"' : "" ; ?> /> |
|
225 | + <?php echo ($docid_incrmnt_method == '1') ? 'checked="checked"' : ""; ?> /> |
|
226 | 226 | <?php echo $_lang['docid_incrmnt_method_1']?></label><br /> |
227 | 227 | <label><input type="radio" name="docid_incrmnt_method" value="2" |
228 | - <?php echo ($docid_incrmnt_method=='2') ? 'checked="checked"' : "" ; ?> /> |
|
228 | + <?php echo ($docid_incrmnt_method == '2') ? 'checked="checked"' : ""; ?> /> |
|
229 | 229 | <?php echo $_lang['docid_incrmnt_method_2']?></label><br /> |
230 | 230 | </td> |
231 | 231 | </tr> |
@@ -233,24 +233,24 @@ discard block |
||
233 | 233 | <tr> |
234 | 234 | <th><?php echo $_lang['enable_cache_title'] ?><br><small>[(enable_cache)]</small></th> |
235 | 235 | <td> |
236 | - <?php echo wrap_label($_lang['enabled'],form_radio('enable_cache', 1));?><br /> |
|
237 | - <?php echo wrap_label($_lang['disabled'], form_radio('enable_cache', 0));?><br /> |
|
238 | - <?php echo wrap_label($_lang['disabled_at_login'], form_radio('enable_cache', 2));?> |
|
236 | + <?php echo wrap_label($_lang['enabled'], form_radio('enable_cache', 1)); ?><br /> |
|
237 | + <?php echo wrap_label($_lang['disabled'], form_radio('enable_cache', 0)); ?><br /> |
|
238 | + <?php echo wrap_label($_lang['disabled_at_login'], form_radio('enable_cache', 2)); ?> |
|
239 | 239 | </td> |
240 | 240 | </tr> |
241 | 241 | |
242 | 242 | <tr> |
243 | 243 | <th><?php echo $_lang['cache_type_title'] ?><br><small>[(cache_type)]</small></th> |
244 | 244 | <td> |
245 | -<?php echo wrap_label($_lang['cache_type_1'],form_radio('cache_type', 1));?><br /> |
|
246 | -<?php echo wrap_label($_lang['cache_type_2'], form_radio('cache_type', 2));?> |
|
245 | +<?php echo wrap_label($_lang['cache_type_1'], form_radio('cache_type', 1)); ?><br /> |
|
246 | +<?php echo wrap_label($_lang['cache_type_2'], form_radio('cache_type', 2)); ?> |
|
247 | 247 | </td> |
248 | 248 | </tr> |
249 | 249 | <tr> |
250 | 250 | <th><?php echo $_lang['minifyphp_incache_title'] ?><br><small>[(minifyphp_incache)]</small></th> |
251 | 251 | <td> |
252 | -<?php echo wrap_label($_lang['enabled'],form_radio('minifyphp_incache', 1));?><br /> |
|
253 | -<?php echo wrap_label($_lang['disabled'], form_radio('minifyphp_incache', 0));?> |
|
252 | +<?php echo wrap_label($_lang['enabled'], form_radio('minifyphp_incache', 1)); ?><br /> |
|
253 | +<?php echo wrap_label($_lang['disabled'], form_radio('minifyphp_incache', 0)); ?> |
|
254 | 254 | <div class="comment"><?php echo $_lang['minifyphp_incache_message'] ?></div> |
255 | 255 | </td> |
256 | 256 | </tr> |
@@ -259,23 +259,23 @@ discard block |
||
259 | 259 | <th><?php echo $_lang['serveroffset_title'] ?><br><small>[(server_offset_time)]</small></th> |
260 | 260 | <td> <select name="server_offset_time" size="1" class="inputBox"> |
261 | 261 | <?php |
262 | - for($i=-24; $i<25; $i++) { |
|
263 | - $seconds = $i*60*60; |
|
264 | - $selectedtext = $seconds==$server_offset_time ? "selected='selected'" : "" ; |
|
262 | + for ($i = -24; $i < 25; $i++) { |
|
263 | + $seconds = $i * 60 * 60; |
|
264 | + $selectedtext = $seconds == $server_offset_time ? "selected='selected'" : ""; |
|
265 | 265 | ?> |
266 | 266 | <option value="<?php echo $seconds; ?>" <?php echo $selectedtext; ?>><?php echo $i; ?></option> |
267 | 267 | <?php |
268 | 268 | } |
269 | 269 | ?> |
270 | 270 | </select> |
271 | - <div class="comment"><?php printf($_lang['serveroffset_message'], strftime('%H:%M:%S', time()), strftime('%H:%M:%S', time()+$server_offset_time)); ?></div> |
|
271 | + <div class="comment"><?php printf($_lang['serveroffset_message'], strftime('%H:%M:%S', time()), strftime('%H:%M:%S', time() + $server_offset_time)); ?></div> |
|
272 | 272 | </td> |
273 | 273 | </tr> |
274 | 274 | <tr> |
275 | 275 | <th><?php echo $_lang['server_protocol_title'] ?><br><small>[(server_protocol)]</small></th> |
276 | 276 | <td> |
277 | - <?php echo wrap_label($_lang['server_protocol_http'],form_radio('server_protocol', 'http'));?><br /> |
|
278 | - <?php echo wrap_label($_lang['server_protocol_https'], form_radio('server_protocol', 'https'));?> |
|
277 | + <?php echo wrap_label($_lang['server_protocol_http'], form_radio('server_protocol', 'http')); ?><br /> |
|
278 | + <?php echo wrap_label($_lang['server_protocol_https'], form_radio('server_protocol', 'https')); ?> |
|
279 | 279 | <div class="comment"><?php echo $_lang['server_protocol_message'] ?></div> |
280 | 280 | </td> |
281 | 281 | </tr> |
@@ -288,8 +288,8 @@ discard block |
||
288 | 288 | <tr> |
289 | 289 | <th><?php echo $_lang['track_visitors_title'] ?><br><small>[(track_visitors)]</small></th> |
290 | 290 | <td> |
291 | - <?php echo wrap_label($_lang['yes'],form_radio('track_visitors', 1));?><br /> |
|
292 | - <?php echo wrap_label($_lang['no'],form_radio('track_visitors', 0));?> |
|
291 | + <?php echo wrap_label($_lang['yes'], form_radio('track_visitors', 1)); ?><br /> |
|
292 | + <?php echo wrap_label($_lang['no'], form_radio('track_visitors', 0)); ?> |
|
293 | 293 | <div class="comment"><?php echo $_lang['track_visitors_message'] ?></div> |
294 | 294 | </td> |
295 | 295 | </tr> |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | <?php |
302 | 302 | // invoke OnSiteSettingsRender event |
303 | 303 | $evtOut = $modx->invokeEvent('OnSiteSettingsRender'); |
304 | - if(is_array($evtOut)) echo implode("",$evtOut); |
|
304 | + if (is_array($evtOut)) echo implode("", $evtOut); |
|
305 | 305 | ?> |
306 | 306 | </td> |
307 | 307 | </tr> |
@@ -82,23 +82,23 @@ discard block |
||
82 | 82 | <?php |
83 | 83 | |
84 | 84 | $currentCategory = ''; |
85 | - while ($row = $modx->getDatabase()->getRow($rs)) { |
|
85 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
86 | 86 | $thisCategory = $row['category']; |
87 | - if($thisCategory == null) { |
|
87 | + if($thisCategory == null) { |
|
88 | 88 | $thisCategory = $_lang['no_category']; |
89 | 89 | } |
90 | - if($thisCategory != $currentCategory) { |
|
91 | - if($closeOptGroup) { |
|
90 | + if($thisCategory != $currentCategory) { |
|
91 | + if($closeOptGroup) { |
|
92 | 92 | echo "\t\t\t\t\t</optgroup>\n"; |
93 | 93 | } |
94 | 94 | echo "\t\t\t\t\t<optgroup label=\"$thisCategory\">\n"; |
95 | 95 | $closeOptGroup = true; |
96 | - } else { |
|
96 | + } else { |
|
97 | 97 | $closeOptGroup = false; |
98 | 98 | } |
99 | 99 | |
100 | 100 | $selectedtext = $row['id'] == $default_template ? ' selected="selected"' : ''; |
101 | - if ($selectedtext) { |
|
101 | + if ($selectedtext) { |
|
102 | 102 | $oldTmpId = $row['id']; |
103 | 103 | $oldTmpName = $row['templatename']; |
104 | 104 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | echo "\t\t\t\t\t".'<option value="'.$row['id'].'"'.$selectedtext.'>'.$row['templatename']."</option>\n"; |
107 | 107 | $currentCategory = $thisCategory; |
108 | 108 | } |
109 | - if($thisCategory != '') { |
|
109 | + if($thisCategory != '') { |
|
110 | 110 | echo "\t\t\t\t\t</optgroup>\n"; |
111 | 111 | } |
112 | 112 | ?> |
@@ -138,11 +138,12 @@ discard block |
||
138 | 138 | $modx->getDatabase()->select('id', $modx->getDatabase()->getFullTableName('site_plugins'), |
139 | 139 | "plugincode LIKE '%phx.parser.class.inc.php%OnParseDocument();%' AND disabled != 1") |
140 | 140 | ); |
141 | - if($count) { |
|
141 | + if($count) { |
|
142 | 142 | $disabledFilters = 1; |
143 | 143 | echo '<b>'.$_lang['enable_filter_phx_warning'].'</b><br/>'; |
144 | - } |
|
145 | - else $disabledFilters = false; |
|
144 | + } else { |
|
145 | + $disabledFilters = false; |
|
146 | + } |
|
146 | 147 | ?> |
147 | 148 | <?php echo wrap_label($_lang['yes'],form_radio('enable_filter', 1, '', $disabledFilters));?><br /> |
148 | 149 | <?php echo wrap_label($_lang['no'], form_radio('enable_filter', 0, '', $disabledFilters));?> |
@@ -204,7 +205,7 @@ discard block |
||
204 | 205 | <select name="lst_custom_contenttype" style="width:200px;height:100px;" size="5"> |
205 | 206 | <?php |
206 | 207 | $ct = explode(",",$custom_contenttype); |
207 | - for($i=0;$i<count($ct);$i++) { |
|
208 | + for($i=0;$i<count($ct);$i++) { |
|
208 | 209 | echo "<option value=\"".$ct[$i]."\">".$ct[$i]."</option>"; |
209 | 210 | } |
210 | 211 | ?> |
@@ -259,7 +260,7 @@ discard block |
||
259 | 260 | <th><?php echo $_lang['serveroffset_title'] ?><br><small>[(server_offset_time)]</small></th> |
260 | 261 | <td> <select name="server_offset_time" size="1" class="inputBox"> |
261 | 262 | <?php |
262 | - for($i=-24; $i<25; $i++) { |
|
263 | + for($i=-24; $i<25; $i++) { |
|
263 | 264 | $seconds = $i*60*60; |
264 | 265 | $selectedtext = $seconds==$server_offset_time ? "selected='selected'" : "" ; |
265 | 266 | ?> |
@@ -301,7 +302,9 @@ discard block |
||
301 | 302 | <?php |
302 | 303 | // invoke OnSiteSettingsRender event |
303 | 304 | $evtOut = $modx->invokeEvent('OnSiteSettingsRender'); |
304 | - if(is_array($evtOut)) echo implode("",$evtOut); |
|
305 | + if(is_array($evtOut)) { |
|
306 | + echo implode("",$evtOut); |
|
307 | + } |
|
305 | 308 | ?> |
306 | 309 | </td> |
307 | 310 | </tr> |
@@ -1,32 +1,32 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | 4 | } |
5 | 5 | if(!$modx->hasPermission('web_access_permissions')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | // find all document groups, for the select :) |
10 | 10 | $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('documentgroup_names'), '', 'name'); |
11 | 11 | if($modx->getDatabase()->getRecordCount($rs) < 1) { |
12 | - $docgroupselector = "[no groups to add]"; |
|
12 | + $docgroupselector = "[no groups to add]"; |
|
13 | 13 | } else { |
14 | - $docgroupselector = '<select name="docgroup">' . "\n"; |
|
15 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
16 | - $docgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
17 | - } |
|
18 | - $docgroupselector .= "</select>\n"; |
|
14 | + $docgroupselector = '<select name="docgroup">' . "\n"; |
|
15 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
16 | + $docgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
17 | + } |
|
18 | + $docgroupselector .= "</select>\n"; |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('webgroup_names'), '', 'name'); |
22 | 22 | if($modx->getDatabase()->getRecordCount($rs) < 1) { |
23 | - $usrgroupselector = '[no user groups]'; |
|
23 | + $usrgroupselector = '[no user groups]'; |
|
24 | 24 | } else { |
25 | - $usrgroupselector = '<select name="usergroup">' . "\n"; |
|
26 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
27 | - $usrgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
28 | - } |
|
29 | - $usrgroupselector .= "</select>\n"; |
|
25 | + $usrgroupselector = '<select name="usergroup">' . "\n"; |
|
26 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
27 | + $usrgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
28 | + } |
|
29 | + $usrgroupselector .= "</select>\n"; |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | ?> |
@@ -88,24 +88,24 @@ discard block |
||
88 | 88 | </form> |
89 | 89 | </div> |
90 | 90 | <?php |
91 | - $rs = $modx->getDatabase()->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getDatabase()->getFullTableName('webgroup_names') . " AS groupnames |
|
91 | + $rs = $modx->getDatabase()->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getDatabase()->getFullTableName('webgroup_names') . " AS groupnames |
|
92 | 92 | LEFT JOIN " . $modx->getDatabase()->getFullTableName('web_groups') . " AS groups ON groups.webgroup = groupnames.id |
93 | 93 | LEFT JOIN " . $modx->getDatabase()->getFullTableName('web_users') . " AS users ON users.id = groups.webuser", '', 'groupnames.name, user_name'); |
94 | - if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
95 | - ?> |
|
94 | + if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
95 | + ?> |
|
96 | 96 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
97 | 97 | <?php |
98 | - } else { |
|
99 | - ?> |
|
98 | + } else { |
|
99 | + ?> |
|
100 | 100 | <div class="form-group"> |
101 | 101 | <?php |
102 | - $pid = ''; |
|
103 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
104 | - if($pid != $row['id']) { |
|
105 | - if($pid != '') { |
|
106 | - echo '</div><div class="form-group">'; |
|
107 | - } |
|
108 | - ?> |
|
102 | + $pid = ''; |
|
103 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
104 | + if($pid != $row['id']) { |
|
105 | + if($pid != '') { |
|
106 | + echo '</div><div class="form-group">'; |
|
107 | + } |
|
108 | + ?> |
|
109 | 109 | <form method="post" action="index.php" name="accesspermissions"> |
110 | 110 | <input type="hidden" name="a" value="92" /> |
111 | 111 | <input type="hidden" name="groupid" value="<?= $row['id'] ?>" /> |
@@ -120,21 +120,21 @@ discard block |
||
120 | 120 | </form> |
121 | 121 | <?= $_lang['web_access_permissions_users_in_group'] ?> |
122 | 122 | <?php |
123 | - } |
|
124 | - if(!$row['user_id']) { |
|
125 | - ?> |
|
123 | + } |
|
124 | + if(!$row['user_id']) { |
|
125 | + ?> |
|
126 | 126 | <i><?= $_lang['access_permissions_no_users_in_group'] ?></i> |
127 | 127 | <?php |
128 | - $pid = $row['id']; |
|
129 | - continue; |
|
130 | - } |
|
131 | - ?> |
|
128 | + $pid = $row['id']; |
|
129 | + continue; |
|
130 | + } |
|
131 | + ?> |
|
132 | 132 | <?= ($pid == $row['id'] ? ', ' : '') ?><a href="index.php?a=88&id=<?= $row['user_id'] ?>"><?= $row['user_name'] ?></a> |
133 | 133 | <?php |
134 | - $pid = $row['id']; |
|
135 | - } |
|
136 | - } |
|
137 | - ?> |
|
134 | + $pid = $row['id']; |
|
135 | + } |
|
136 | + } |
|
137 | + ?> |
|
138 | 138 | </div> |
139 | 139 | </div> |
140 | 140 | </div> |
@@ -159,24 +159,24 @@ discard block |
||
159 | 159 | </form> |
160 | 160 | </div> |
161 | 161 | <?php |
162 | - $rs = $modx->getDatabase()->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getDatabase()->getFullTableName('documentgroup_names') . " AS dgnames |
|
162 | + $rs = $modx->getDatabase()->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getDatabase()->getFullTableName('documentgroup_names') . " AS dgnames |
|
163 | 163 | LEFT JOIN " . $modx->getDatabase()->getFullTableName('document_groups') . " AS dg ON dg.document_group = dgnames.id |
164 | 164 | LEFT JOIN " . $modx->getDatabase()->getFullTableName('site_content') . " AS sc ON sc.id = dg.document", '', 'dgnames.name, sc.id'); |
165 | - if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
166 | - ?> |
|
165 | + if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
166 | + ?> |
|
167 | 167 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
168 | 168 | <?php |
169 | - } else { |
|
170 | - ?> |
|
169 | + } else { |
|
170 | + ?> |
|
171 | 171 | <div class="form-group"> |
172 | 172 | <?php |
173 | - $pid = ''; |
|
174 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
175 | - if($pid != $row['id']) { |
|
176 | - if($pid != '') { |
|
177 | - echo '</div><div class="form-group">'; |
|
178 | - } |
|
179 | - ?> |
|
173 | + $pid = ''; |
|
174 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
175 | + if($pid != $row['id']) { |
|
176 | + if($pid != '') { |
|
177 | + echo '</div><div class="form-group">'; |
|
178 | + } |
|
179 | + ?> |
|
180 | 180 | <form method="post" action="index.php" name="accesspermissions"> |
181 | 181 | <input type="hidden" name="a" value="92" /> |
182 | 182 | <input type="hidden" name="groupid" value="<?= $row['id'] ?>" /> |
@@ -191,21 +191,21 @@ discard block |
||
191 | 191 | </form> |
192 | 192 | <?= $_lang['access_permissions_resources_in_group'] ?> |
193 | 193 | <?php |
194 | - } |
|
195 | - if(!$row['doc_id']) { |
|
196 | - ?> |
|
194 | + } |
|
195 | + if(!$row['doc_id']) { |
|
196 | + ?> |
|
197 | 197 | <i><?= $_lang['access_permissions_no_resources_in_group'] ?></i> |
198 | 198 | <?php |
199 | - $pid = $row['id']; |
|
200 | - continue; |
|
201 | - } |
|
202 | - ?> |
|
199 | + $pid = $row['id']; |
|
200 | + continue; |
|
201 | + } |
|
202 | + ?> |
|
203 | 203 | <?= ($pid == $row['id'] ? ', ' : '') ?><a href="index.php?a=3&id=<?= $row['doc_id'] ?>" title="<?= $modx->getPhpCompat()->htmlspecialchars($row['doc_title']) ?>"><?= $row['doc_id'] ?></a> |
204 | 204 | <?php |
205 | - $pid = $row['id']; |
|
206 | - } |
|
207 | - } |
|
208 | - ?> |
|
205 | + $pid = $row['id']; |
|
206 | + } |
|
207 | + } |
|
208 | + ?> |
|
209 | 209 | </div> |
210 | 210 | </div> |
211 | 211 | </div> |
@@ -217,15 +217,15 @@ discard block |
||
217 | 217 | <div class="container container-body"> |
218 | 218 | <p class="element-edit-message-tab alert alert-warning"><?= $_lang['access_permissions_links_tab'] ?></p> |
219 | 219 | <?php |
220 | - $rs = $modx->getDatabase()->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getDatabase()->getFullTableName('webgroup_names') . " AS groupnames |
|
220 | + $rs = $modx->getDatabase()->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getDatabase()->getFullTableName('webgroup_names') . " AS groupnames |
|
221 | 221 | LEFT JOIN " . $modx->getDatabase()->getFullTableName('webgroup_access') . " AS groupacc ON groupacc.webgroup = groupnames.id |
222 | 222 | LEFT JOIN " . $modx->getDatabase()->getFullTableName('documentgroup_names') . " AS dgnames ON dgnames.id = groupacc.documentgroup", '', 'name, dg_name'); |
223 | - if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
224 | - ?> |
|
223 | + if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
224 | + ?> |
|
225 | 225 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
226 | 226 | <?php |
227 | - } else { |
|
228 | - ?> |
|
227 | + } else { |
|
228 | + ?> |
|
229 | 229 | <div class="form-group"> |
230 | 230 | <b><?= $_lang["access_permissions_group_link"] ?></b> |
231 | 231 | <form method="post" action="index.php" name="accesspermissions"> |
@@ -241,38 +241,38 @@ discard block |
||
241 | 241 | <hr> |
242 | 242 | <ul> |
243 | 243 | <?php |
244 | - $pid = ''; |
|
245 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
246 | - if($row['id'] != $pid) { |
|
247 | - if($pid != '') { |
|
248 | - echo '</ul></li>'; |
|
249 | - } // close previous one |
|
250 | - ?> |
|
244 | + $pid = ''; |
|
245 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
246 | + if($row['id'] != $pid) { |
|
247 | + if($pid != '') { |
|
248 | + echo '</ul></li>'; |
|
249 | + } // close previous one |
|
250 | + ?> |
|
251 | 251 | <li><b><?= $row['name'] ?></b></li> |
252 | 252 | <?php |
253 | - if(!$row['dg_id']) { |
|
254 | - echo '<i>' . $_lang['no_groups_found'] . '</i></li>'; |
|
255 | - $pid = ''; |
|
256 | - continue; |
|
257 | - } else { |
|
258 | - echo '<ul>'; |
|
259 | - } |
|
260 | - } |
|
261 | - if(!$row['dg_id']) { |
|
262 | - continue; |
|
263 | - } |
|
264 | - ?> |
|
253 | + if(!$row['dg_id']) { |
|
254 | + echo '<i>' . $_lang['no_groups_found'] . '</i></li>'; |
|
255 | + $pid = ''; |
|
256 | + continue; |
|
257 | + } else { |
|
258 | + echo '<ul>'; |
|
259 | + } |
|
260 | + } |
|
261 | + if(!$row['dg_id']) { |
|
262 | + continue; |
|
263 | + } |
|
264 | + ?> |
|
265 | 265 | <li><?= $row['dg_name'] ?> |
266 | 266 | <small><i>(<a class="text-danger" href="index.php?a=92&coupling=<?= $row['link_id'] ?>&operation=remove_document_group_from_user_group"><?= $_lang['remove'] ?></a>)</i></small> |
267 | 267 | </li> |
268 | 268 | <?php |
269 | - $pid = $row['id']; |
|
270 | - } |
|
271 | - ?> |
|
269 | + $pid = $row['id']; |
|
270 | + } |
|
271 | + ?> |
|
272 | 272 | </ul> |
273 | 273 | <?php |
274 | - } |
|
275 | - ?> |
|
274 | + } |
|
275 | + ?> |
|
276 | 276 | </div> |
277 | 277 | </div> |
278 | 278 |
@@ -1,30 +1,30 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if(!$modx->hasPermission('web_access_permissions')) { |
|
5 | +if (!$modx->hasPermission('web_access_permissions')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | 9 | // find all document groups, for the select :) |
10 | 10 | $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('documentgroup_names'), '', 'name'); |
11 | -if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
11 | +if ($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
12 | 12 | $docgroupselector = "[no groups to add]"; |
13 | 13 | } else { |
14 | - $docgroupselector = '<select name="docgroup">' . "\n"; |
|
15 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
16 | - $docgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
14 | + $docgroupselector = '<select name="docgroup">'."\n"; |
|
15 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
16 | + $docgroupselector .= "\t".'<option value="'.$row['id'].'">'.$row['name']."</option>\n"; |
|
17 | 17 | } |
18 | 18 | $docgroupselector .= "</select>\n"; |
19 | 19 | } |
20 | 20 | |
21 | 21 | $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('webgroup_names'), '', 'name'); |
22 | -if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
22 | +if ($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
23 | 23 | $usrgroupselector = '[no user groups]'; |
24 | 24 | } else { |
25 | - $usrgroupselector = '<select name="usergroup">' . "\n"; |
|
26 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
27 | - $usrgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
25 | + $usrgroupselector = '<select name="usergroup">'."\n"; |
|
26 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
27 | + $usrgroupselector .= "\t".'<option value="'.$row['id'].'">'.$row['name']."</option>\n"; |
|
28 | 28 | } |
29 | 29 | $usrgroupselector .= "</select>\n"; |
30 | 30 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | <div class="alert alert-info"><?= $_lang['access_permissions_introtext'] ?></div> |
61 | 61 | </div> |
62 | 62 | |
63 | -<div class="container"><?= ($use_udperms != 1 ? '<div class="alert alert-danger">' . $_lang['access_permissions_off'] . '</div>' : '') ?></div> |
|
63 | +<div class="container"><?= ($use_udperms != 1 ? '<div class="alert alert-danger">'.$_lang['access_permissions_off'].'</div>' : '') ?></div> |
|
64 | 64 | |
65 | 65 | |
66 | 66 | <div class="tab-pane" id="wuapPane"> |
@@ -88,10 +88,10 @@ discard block |
||
88 | 88 | </form> |
89 | 89 | </div> |
90 | 90 | <?php |
91 | - $rs = $modx->getDatabase()->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getDatabase()->getFullTableName('webgroup_names') . " AS groupnames |
|
92 | - LEFT JOIN " . $modx->getDatabase()->getFullTableName('web_groups') . " AS groups ON groups.webgroup = groupnames.id |
|
93 | - LEFT JOIN " . $modx->getDatabase()->getFullTableName('web_users') . " AS users ON users.id = groups.webuser", '', 'groupnames.name, user_name'); |
|
94 | - if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
91 | + $rs = $modx->getDatabase()->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getDatabase()->getFullTableName('webgroup_names')." AS groupnames |
|
92 | + LEFT JOIN " . $modx->getDatabase()->getFullTableName('web_groups')." AS groups ON groups.webgroup = groupnames.id |
|
93 | + LEFT JOIN " . $modx->getDatabase()->getFullTableName('web_users')." AS users ON users.id = groups.webuser", '', 'groupnames.name, user_name'); |
|
94 | + if ($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
95 | 95 | ?> |
96 | 96 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
97 | 97 | <?php |
@@ -100,9 +100,9 @@ discard block |
||
100 | 100 | <div class="form-group"> |
101 | 101 | <?php |
102 | 102 | $pid = ''; |
103 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
104 | - if($pid != $row['id']) { |
|
105 | - if($pid != '') { |
|
103 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
104 | + if ($pid != $row['id']) { |
|
105 | + if ($pid != '') { |
|
106 | 106 | echo '</div><div class="form-group">'; |
107 | 107 | } |
108 | 108 | ?> |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | <?= $_lang['web_access_permissions_users_in_group'] ?> |
122 | 122 | <?php |
123 | 123 | } |
124 | - if(!$row['user_id']) { |
|
124 | + if (!$row['user_id']) { |
|
125 | 125 | ?> |
126 | 126 | <i><?= $_lang['access_permissions_no_users_in_group'] ?></i> |
127 | 127 | <?php |
@@ -159,10 +159,10 @@ discard block |
||
159 | 159 | </form> |
160 | 160 | </div> |
161 | 161 | <?php |
162 | - $rs = $modx->getDatabase()->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getDatabase()->getFullTableName('documentgroup_names') . " AS dgnames |
|
163 | - LEFT JOIN " . $modx->getDatabase()->getFullTableName('document_groups') . " AS dg ON dg.document_group = dgnames.id |
|
164 | - LEFT JOIN " . $modx->getDatabase()->getFullTableName('site_content') . " AS sc ON sc.id = dg.document", '', 'dgnames.name, sc.id'); |
|
165 | - if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
162 | + $rs = $modx->getDatabase()->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getDatabase()->getFullTableName('documentgroup_names')." AS dgnames |
|
163 | + LEFT JOIN " . $modx->getDatabase()->getFullTableName('document_groups')." AS dg ON dg.document_group = dgnames.id |
|
164 | + LEFT JOIN " . $modx->getDatabase()->getFullTableName('site_content')." AS sc ON sc.id = dg.document", '', 'dgnames.name, sc.id'); |
|
165 | + if ($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
166 | 166 | ?> |
167 | 167 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
168 | 168 | <?php |
@@ -171,9 +171,9 @@ discard block |
||
171 | 171 | <div class="form-group"> |
172 | 172 | <?php |
173 | 173 | $pid = ''; |
174 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
175 | - if($pid != $row['id']) { |
|
176 | - if($pid != '') { |
|
174 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
175 | + if ($pid != $row['id']) { |
|
176 | + if ($pid != '') { |
|
177 | 177 | echo '</div><div class="form-group">'; |
178 | 178 | } |
179 | 179 | ?> |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | <?= $_lang['access_permissions_resources_in_group'] ?> |
193 | 193 | <?php |
194 | 194 | } |
195 | - if(!$row['doc_id']) { |
|
195 | + if (!$row['doc_id']) { |
|
196 | 196 | ?> |
197 | 197 | <i><?= $_lang['access_permissions_no_resources_in_group'] ?></i> |
198 | 198 | <?php |
@@ -217,10 +217,10 @@ discard block |
||
217 | 217 | <div class="container container-body"> |
218 | 218 | <p class="element-edit-message-tab alert alert-warning"><?= $_lang['access_permissions_links_tab'] ?></p> |
219 | 219 | <?php |
220 | - $rs = $modx->getDatabase()->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getDatabase()->getFullTableName('webgroup_names') . " AS groupnames |
|
221 | - LEFT JOIN " . $modx->getDatabase()->getFullTableName('webgroup_access') . " AS groupacc ON groupacc.webgroup = groupnames.id |
|
222 | - LEFT JOIN " . $modx->getDatabase()->getFullTableName('documentgroup_names') . " AS dgnames ON dgnames.id = groupacc.documentgroup", '', 'name, dg_name'); |
|
223 | - if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
220 | + $rs = $modx->getDatabase()->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getDatabase()->getFullTableName('webgroup_names')." AS groupnames |
|
221 | + LEFT JOIN " . $modx->getDatabase()->getFullTableName('webgroup_access')." AS groupacc ON groupacc.webgroup = groupnames.id |
|
222 | + LEFT JOIN " . $modx->getDatabase()->getFullTableName('documentgroup_names')." AS dgnames ON dgnames.id = groupacc.documentgroup", '', 'name, dg_name'); |
|
223 | + if ($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
224 | 224 | ?> |
225 | 225 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
226 | 226 | <?php |
@@ -242,23 +242,23 @@ discard block |
||
242 | 242 | <ul> |
243 | 243 | <?php |
244 | 244 | $pid = ''; |
245 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
246 | - if($row['id'] != $pid) { |
|
247 | - if($pid != '') { |
|
245 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
246 | + if ($row['id'] != $pid) { |
|
247 | + if ($pid != '') { |
|
248 | 248 | echo '</ul></li>'; |
249 | 249 | } // close previous one |
250 | 250 | ?> |
251 | 251 | <li><b><?= $row['name'] ?></b></li> |
252 | 252 | <?php |
253 | - if(!$row['dg_id']) { |
|
254 | - echo '<i>' . $_lang['no_groups_found'] . '</i></li>'; |
|
253 | + if (!$row['dg_id']) { |
|
254 | + echo '<i>'.$_lang['no_groups_found'].'</i></li>'; |
|
255 | 255 | $pid = ''; |
256 | 256 | continue; |
257 | 257 | } else { |
258 | 258 | echo '<ul>'; |
259 | 259 | } |
260 | 260 | } |
261 | - if(!$row['dg_id']) { |
|
261 | + if (!$row['dg_id']) { |
|
262 | 262 | continue; |
263 | 263 | } |
264 | 264 | ?> |
@@ -1,15 +1,15 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | 4 | } |
5 | 5 | if(!$modx->hasPermission('settings')) { |
6 | - $modx->webAlertAndQuit($_lang['error_no_privileges']); |
|
6 | + $modx->webAlertAndQuit($_lang['error_no_privileges']); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | // check to see the edit settings page isn't locked |
10 | 10 | $rs = $modx->getDatabase()->select('username', $modx->getDatabase()->getFullTableName('active_users'), "action=17 AND internalKey!='" . $modx->getLoginUserID() . "'"); |
11 | 11 | if($username = $modx->getDatabase()->getValue($rs)) { |
12 | - $modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username)); |
|
12 | + $modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username)); |
|
13 | 13 | } |
14 | 14 | // end check for lock |
15 | 15 | |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | include_once(MODX_MANAGER_PATH . 'includes/default_config.php'); |
20 | 20 | $rs = $modx->getDatabase()->select('setting_name, setting_value', $modx->getDatabase()->getFullTableName('system_settings')); |
21 | 21 | while($row = $modx->getDatabase()->getRow($rs)) { |
22 | - $settings[$row['setting_name']] = $row['setting_value']; |
|
22 | + $settings[$row['setting_name']] = $row['setting_value']; |
|
23 | 23 | } |
24 | 24 | $settings['filemanager_path'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['filemanager_path']); |
25 | 25 | $settings['rb_base_dir'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['rb_base_dir']); |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | $lang_keys = array(); |
31 | 31 | $dir = dir('includes/lang'); |
32 | 32 | while($file = $dir->read()) { |
33 | - if(strpos($file, '.inc.php') > 0) { |
|
34 | - $endpos = strpos($file, '.'); |
|
35 | - $languagename = substr($file, 0, $endpos); |
|
36 | - $lang_keys[$languagename] = get_lang_keys($file); |
|
37 | - } |
|
33 | + if(strpos($file, '.inc.php') > 0) { |
|
34 | + $endpos = strpos($file, '.'); |
|
35 | + $languagename = substr($file, 0, $endpos); |
|
36 | + $lang_keys[$languagename] = get_lang_keys($file); |
|
37 | + } |
|
38 | 38 | } |
39 | 39 | $dir->close(); |
40 | 40 | $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; |
@@ -76,14 +76,14 @@ discard block |
||
76 | 76 | </script> |
77 | 77 | |
78 | 78 | <?php |
79 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab1_site_settings.inc.php'); |
|
80 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab2_furl_settings.inc.php'); |
|
81 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab3_user_settings.inc.php'); |
|
82 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab4_manager_settings.inc.php'); |
|
83 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab5_security_settings.inc.php'); |
|
84 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab6_filemanager_settings.inc.php'); |
|
85 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab7_filebrowser_settings.inc.php'); |
|
86 | - ?> |
|
79 | + include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab1_site_settings.inc.php'); |
|
80 | + include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab2_furl_settings.inc.php'); |
|
81 | + include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab3_user_settings.inc.php'); |
|
82 | + include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab4_manager_settings.inc.php'); |
|
83 | + include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab5_security_settings.inc.php'); |
|
84 | + include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab6_filemanager_settings.inc.php'); |
|
85 | + include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab7_filebrowser_settings.inc.php'); |
|
86 | + ?> |
|
87 | 87 | </div> |
88 | 88 | </div> |
89 | 89 | </form> |
@@ -130,5 +130,5 @@ discard block |
||
130 | 130 | </script> |
131 | 131 | <?php |
132 | 132 | if(is_numeric($_GET['tab'])) { |
133 | - echo '<script type="text/javascript">tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
|
133 | + echo '<script type="text/javascript">tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
|
134 | 134 | } |
@@ -1,14 +1,14 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if(!$modx->hasPermission('settings')) { |
|
5 | +if (!$modx->hasPermission('settings')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang['error_no_privileges']); |
7 | 7 | } |
8 | 8 | |
9 | 9 | // check to see the edit settings page isn't locked |
10 | -$rs = $modx->getDatabase()->select('username', $modx->getDatabase()->getFullTableName('active_users'), "action=17 AND internalKey!='" . $modx->getLoginUserID() . "'"); |
|
11 | -if($username = $modx->getDatabase()->getValue($rs)) { |
|
10 | +$rs = $modx->getDatabase()->select('username', $modx->getDatabase()->getFullTableName('active_users'), "action=17 AND internalKey!='".$modx->getLoginUserID()."'"); |
|
11 | +if ($username = $modx->getDatabase()->getValue($rs)) { |
|
12 | 12 | $modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username)); |
13 | 13 | } |
14 | 14 | // end check for lock |
@@ -16,21 +16,21 @@ discard block |
||
16 | 16 | // reload system settings from the database. |
17 | 17 | // this will prevent user-defined settings from being saved as system setting |
18 | 18 | $settings = array(); |
19 | -include_once(MODX_MANAGER_PATH . 'includes/default_config.php'); |
|
19 | +include_once(MODX_MANAGER_PATH.'includes/default_config.php'); |
|
20 | 20 | $rs = $modx->getDatabase()->select('setting_name, setting_value', $modx->getDatabase()->getFullTableName('system_settings')); |
21 | -while($row = $modx->getDatabase()->getRow($rs)) { |
|
21 | +while ($row = $modx->getDatabase()->getRow($rs)) { |
|
22 | 22 | $settings[$row['setting_name']] = $row['setting_value']; |
23 | 23 | } |
24 | -$settings['filemanager_path'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['filemanager_path']); |
|
25 | -$settings['rb_base_dir'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['rb_base_dir']); |
|
24 | +$settings['filemanager_path'] = preg_replace('@^'.preg_quote(MODX_BASE_PATH).'@', '[(base_path)]', $settings['filemanager_path']); |
|
25 | +$settings['rb_base_dir'] = preg_replace('@^'.preg_quote(MODX_BASE_PATH).'@', '[(base_path)]', $settings['rb_base_dir']); |
|
26 | 26 | |
27 | 27 | extract($settings, EXTR_OVERWRITE); |
28 | 28 | |
29 | 29 | // load languages and keys |
30 | 30 | $lang_keys = array(); |
31 | 31 | $dir = dir('includes/lang'); |
32 | -while($file = $dir->read()) { |
|
33 | - if(strpos($file, '.inc.php') > 0) { |
|
32 | +while ($file = $dir->read()) { |
|
33 | + if (strpos($file, '.inc.php') > 0) { |
|
34 | 34 | $endpos = strpos($file, '.'); |
35 | 35 | $languagename = substr($file, 0, $endpos); |
36 | 36 | $lang_keys[$languagename] = get_lang_keys($file); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | <input type="hidden" name="site_id" value="<?php echo $site_id; ?>" /> |
68 | 68 | <input type="hidden" name="settings_version" value="<?php echo $modx->getVersionData('version'); ?>" /> |
69 | 69 | <!-- this field is used to check site settings have been entered/ updated after install or upgrade --> |
70 | - <?php if(!isset($settings_version) || $settings_version != $modx->getVersionData('version')) { ?> |
|
70 | + <?php if (!isset($settings_version) || $settings_version != $modx->getVersionData('version')) { ?> |
|
71 | 71 | <div class='sectionBody'><p class='element-edit-message-tab alert alert-warning'><?php echo $_lang['settings_after_install']; ?></p></div> |
72 | 72 | <?php } ?> |
73 | 73 | <div class="tab-pane" id="settingsPane"> |
@@ -76,13 +76,13 @@ discard block |
||
76 | 76 | </script> |
77 | 77 | |
78 | 78 | <?php |
79 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab1_site_settings.inc.php'); |
|
80 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab2_furl_settings.inc.php'); |
|
81 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab3_user_settings.inc.php'); |
|
82 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab4_manager_settings.inc.php'); |
|
83 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab5_security_settings.inc.php'); |
|
84 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab6_filemanager_settings.inc.php'); |
|
85 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab7_filebrowser_settings.inc.php'); |
|
79 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab1_site_settings.inc.php'); |
|
80 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab2_furl_settings.inc.php'); |
|
81 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab3_user_settings.inc.php'); |
|
82 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab4_manager_settings.inc.php'); |
|
83 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab5_security_settings.inc.php'); |
|
84 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab6_filemanager_settings.inc.php'); |
|
85 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab7_filebrowser_settings.inc.php'); |
|
86 | 86 | ?> |
87 | 87 | </div> |
88 | 88 | </div> |
@@ -129,6 +129,6 @@ discard block |
||
129 | 129 | }); |
130 | 130 | </script> |
131 | 131 | <?php |
132 | -if(is_numeric($_GET['tab'])) { |
|
133 | - echo '<script type="text/javascript">tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
|
132 | +if (is_numeric($_GET['tab'])) { |
|
133 | + echo '<script type="text/javascript">tpSettings.setSelectedIndex( '.$_GET['tab'].' );</script>'; |
|
134 | 134 | } |
@@ -1,14 +1,14 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if(!$modx->hasPermission('settings')) { |
|
5 | +if(!$modx->hasPermission('settings')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang['error_no_privileges']); |
7 | 7 | } |
8 | 8 | |
9 | 9 | // check to see the edit settings page isn't locked |
10 | 10 | $rs = $modx->getDatabase()->select('username', $modx->getDatabase()->getFullTableName('active_users'), "action=17 AND internalKey!='" . $modx->getLoginUserID() . "'"); |
11 | -if($username = $modx->getDatabase()->getValue($rs)) { |
|
11 | +if($username = $modx->getDatabase()->getValue($rs)) { |
|
12 | 12 | $modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username)); |
13 | 13 | } |
14 | 14 | // end check for lock |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $settings = array(); |
19 | 19 | include_once(MODX_MANAGER_PATH . 'includes/default_config.php'); |
20 | 20 | $rs = $modx->getDatabase()->select('setting_name, setting_value', $modx->getDatabase()->getFullTableName('system_settings')); |
21 | -while($row = $modx->getDatabase()->getRow($rs)) { |
|
21 | +while($row = $modx->getDatabase()->getRow($rs)) { |
|
22 | 22 | $settings[$row['setting_name']] = $row['setting_value']; |
23 | 23 | } |
24 | 24 | $settings['filemanager_path'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['filemanager_path']); |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | // load languages and keys |
30 | 30 | $lang_keys = array(); |
31 | 31 | $dir = dir('includes/lang'); |
32 | -while($file = $dir->read()) { |
|
33 | - if(strpos($file, '.inc.php') > 0) { |
|
32 | +while($file = $dir->read()) { |
|
33 | + if(strpos($file, '.inc.php') > 0) { |
|
34 | 34 | $endpos = strpos($file, '.'); |
35 | 35 | $languagename = substr($file, 0, $endpos); |
36 | 36 | $lang_keys[$languagename] = get_lang_keys($file); |
@@ -129,6 +129,6 @@ discard block |
||
129 | 129 | }); |
130 | 130 | </script> |
131 | 131 | <?php |
132 | -if(is_numeric($_GET['tab'])) { |
|
132 | +if(is_numeric($_GET['tab'])) { |
|
133 | 133 | echo '<script type="text/javascript">tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
134 | 134 | } |