@@ -2,13 +2,13 @@ discard block |
||
2 | 2 | /** |
3 | 3 | * Class for MODx Categories Manager |
4 | 4 | */ |
5 | -if( !is_object( $modx ) |
|
6 | - || $modx->isBackend() === false ) |
|
5 | +if (!is_object($modx) |
|
6 | + || $modx->isBackend() === false) |
|
7 | 7 | { |
8 | 8 | die('Please use the MODx Backend.'); |
9 | 9 | } |
10 | 10 | |
11 | -require_once realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'Categories.php'; |
|
11 | +require_once realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR.'Categories.php'; |
|
12 | 12 | |
13 | 13 | class Module_Categories_Manager extends Categories |
14 | 14 | { |
@@ -37,19 +37,19 @@ discard block |
||
37 | 37 | * @return mixed return the parameter value if exists, otherwise false |
38 | 38 | * @param string $key Paramter-key |
39 | 39 | */ |
40 | - public function get( $key ) |
|
40 | + public function get($key) |
|
41 | 41 | { |
42 | 42 | global $modx; |
43 | 43 | |
44 | - if( isset( $this->params[$key] ) ) |
|
44 | + if (isset($this->params[$key])) |
|
45 | 45 | { |
46 | 46 | return $this->params[$key]; |
47 | 47 | } |
48 | - elseif( isset( $modx->config[$key] ) ) |
|
48 | + elseif (isset($modx->config[$key])) |
|
49 | 49 | { |
50 | 50 | return $modx->config[$key]; |
51 | 51 | } |
52 | - elseif( isset( $modx->event->params[$key] ) ) |
|
52 | + elseif (isset($modx->event->params[$key])) |
|
53 | 53 | { |
54 | 54 | return $modx->event->params[$key]; |
55 | 55 | } |
@@ -57,15 +57,15 @@ discard block |
||
57 | 57 | } |
58 | 58 | |
59 | 59 | |
60 | - public function addMessage( $message, $namespace = 'default' ) |
|
60 | + public function addMessage($message, $namespace = 'default') |
|
61 | 61 | { |
62 | 62 | $this->params['messages'][$namespace][] = $message; |
63 | 63 | } |
64 | 64 | |
65 | 65 | |
66 | - public function getMessages( $namespace = 'default' ) |
|
66 | + public function getMessages($namespace = 'default') |
|
67 | 67 | { |
68 | - if( isset( $this->params['messages'][$namespace] ) ) |
|
68 | + if (isset($this->params['messages'][$namespace])) |
|
69 | 69 | { |
70 | 70 | return $this->params['messages'][$namespace]; |
71 | 71 | } |
@@ -73,16 +73,16 @@ discard block |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | |
76 | - public function renderView( $view_name, $data = array() ) |
|
76 | + public function renderView($view_name, $data = array()) |
|
77 | 77 | { |
78 | 78 | global $_lang, $_style; |
79 | 79 | |
80 | - $filename = trim( $view_name ) . '.tpl.phtml'; |
|
81 | - $file = self::get('views_dir') . $filename; |
|
80 | + $filename = trim($view_name).'.tpl.phtml'; |
|
81 | + $file = self::get('views_dir').$filename; |
|
82 | 82 | $view = & $this; |
83 | 83 | |
84 | - if( is_file( $file ) |
|
85 | - && is_readable( $file ) ) |
|
84 | + if (is_file($file) |
|
85 | + && is_readable($file)) |
|
86 | 86 | { |
87 | 87 | include $file; |
88 | 88 | } |
@@ -96,28 +96,28 @@ discard block |
||
96 | 96 | } |
97 | 97 | } |
98 | 98 | |
99 | - public function updateElement( $element, $element_id, $category_id ) |
|
99 | + public function updateElement($element, $element_id, $category_id) |
|
100 | 100 | { |
101 | 101 | |
102 | 102 | $_update = array( |
103 | - 'id' => (int)$element_id, |
|
104 | - 'category' => (int)$category_id |
|
103 | + 'id' => (int) $element_id, |
|
104 | + 'category' => (int) $category_id |
|
105 | 105 | ); |
106 | 106 | |
107 | 107 | $this->db->update( |
108 | 108 | $_update, |
109 | 109 | $this->db_tbl[$element], |
110 | - "`id` = '" . (int)$element_id . "'" |
|
110 | + "`id` = '".(int) $element_id."'" |
|
111 | 111 | ); |
112 | 112 | |
113 | 113 | return $this->db->getAffectedRows() === 1; |
114 | 114 | } |
115 | 115 | |
116 | 116 | |
117 | - public function txt( $txt ) |
|
117 | + public function txt($txt) |
|
118 | 118 | { |
119 | 119 | global $_lang; |
120 | - if(isset($_lang[$txt])) return $_lang[$txt]; |
|
120 | + if (isset($_lang[$txt])) return $_lang[$txt]; |
|
121 | 121 | return $txt; |
122 | 122 | } |
123 | 123 | } |
@@ -3,8 +3,7 @@ discard block |
||
3 | 3 | * Class for MODx Categories Manager |
4 | 4 | */ |
5 | 5 | if( !is_object( $modx ) |
6 | - || $modx->isBackend() === false ) |
|
7 | -{ |
|
6 | + || $modx->isBackend() === false ) { |
|
8 | 7 | die('Please use the MODx Backend.'); |
9 | 8 | } |
10 | 9 | |
@@ -41,16 +40,11 @@ discard block |
||
41 | 40 | { |
42 | 41 | global $modx; |
43 | 42 | |
44 | - if( isset( $this->params[$key] ) ) |
|
45 | - { |
|
43 | + if( isset( $this->params[$key] ) ) { |
|
46 | 44 | return $this->params[$key]; |
47 | - } |
|
48 | - elseif( isset( $modx->config[$key] ) ) |
|
49 | - { |
|
45 | + } elseif( isset( $modx->config[$key] ) ) { |
|
50 | 46 | return $modx->config[$key]; |
51 | - } |
|
52 | - elseif( isset( $modx->event->params[$key] ) ) |
|
53 | - { |
|
47 | + } elseif( isset( $modx->event->params[$key] ) ) { |
|
54 | 48 | return $modx->event->params[$key]; |
55 | 49 | } |
56 | 50 | return false; |
@@ -65,8 +59,7 @@ discard block |
||
65 | 59 | |
66 | 60 | public function getMessages( $namespace = 'default' ) |
67 | 61 | { |
68 | - if( isset( $this->params['messages'][$namespace] ) ) |
|
69 | - { |
|
62 | + if( isset( $this->params['messages'][$namespace] ) ) { |
|
70 | 63 | return $this->params['messages'][$namespace]; |
71 | 64 | } |
72 | 65 | return false; |
@@ -82,12 +75,9 @@ discard block |
||
82 | 75 | $view = & $this; |
83 | 76 | |
84 | 77 | if( is_file( $file ) |
85 | - && is_readable( $file ) ) |
|
86 | - { |
|
78 | + && is_readable( $file ) ) { |
|
87 | 79 | include $file; |
88 | - } |
|
89 | - else |
|
90 | - { |
|
80 | + } else { |
|
91 | 81 | echo sprintf( |
92 | 82 | 'View "%s<strong>%s</strong>" not found.', |
93 | 83 | self::get('views_dir'), |
@@ -117,7 +107,9 @@ discard block |
||
117 | 107 | public function txt( $txt ) |
118 | 108 | { |
119 | 109 | global $_lang; |
120 | - if(isset($_lang[$txt])) return $_lang[$txt]; |
|
110 | + if(isset($_lang[$txt])) { |
|
111 | + return $_lang[$txt]; |
|
112 | + } |
|
121 | 113 | return $txt; |
122 | 114 | } |
123 | 115 | } |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | { |
7 | 7 | public $db = ''; |
8 | 8 | public $db_tbl = array(); |
9 | - public $elements = array( 'templates', 'tmplvars', 'htmlsnippets', 'snippets', 'plugins', 'modules' ); |
|
9 | + public $elements = array('templates', 'tmplvars', 'htmlsnippets', 'snippets', 'plugins', 'modules'); |
|
10 | 10 | |
11 | 11 | public function __construct() |
12 | 12 | { |
@@ -15,9 +15,9 @@ discard block |
||
15 | 15 | $this->db = & $modx->db; |
16 | 16 | $this->db_tbl['categories'] = $modx->getFullTableName('categories'); |
17 | 17 | |
18 | - foreach( $this->elements as $element ) |
|
18 | + foreach ($this->elements as $element) |
|
19 | 19 | { |
20 | - $this->db_tbl[$element] = $modx->getFullTableName('site_' . $element ); |
|
20 | + $this->db_tbl[$element] = $modx->getFullTableName('site_'.$element); |
|
21 | 21 | } |
22 | 22 | } |
23 | 23 | |
@@ -37,54 +37,54 @@ discard block |
||
37 | 37 | ) |
38 | 38 | ); |
39 | 39 | |
40 | - if( !empty( $categories ) ) |
|
40 | + if (!empty($categories)) |
|
41 | 41 | { |
42 | 42 | return $categories; |
43 | 43 | } |
44 | 44 | return false; |
45 | 45 | } |
46 | 46 | |
47 | - public function getCategory( $search, $where = 'category' ) |
|
47 | + public function getCategory($search, $where = 'category') |
|
48 | 48 | { |
49 | 49 | $category = $this->db->getRow( |
50 | 50 | $this->db->select( |
51 | 51 | '*', |
52 | 52 | $this->db_tbl['categories'], |
53 | - "`" . $where . "` = '" . $search . "'" |
|
53 | + "`".$where."` = '".$search."'" |
|
54 | 54 | ) |
55 | 55 | ); |
56 | 56 | return $category; |
57 | 57 | } |
58 | 58 | |
59 | - public function getCategoryValue( $value, $search, $where = 'category' ) |
|
59 | + public function getCategoryValue($value, $search, $where = 'category') |
|
60 | 60 | { |
61 | 61 | $_value = $this->db->getValue( |
62 | 62 | $this->db->select( |
63 | - '`' . $value . '`', |
|
63 | + '`'.$value.'`', |
|
64 | 64 | $this->db_tbl['categories'], |
65 | - "`" . $where . "` = '" . $search . "'" |
|
65 | + "`".$where."` = '".$search."'" |
|
66 | 66 | ) |
67 | 67 | ); |
68 | 68 | return $_value; |
69 | 69 | } |
70 | 70 | |
71 | - public function getAssignedElements( $category_id, $element ) |
|
71 | + public function getAssignedElements($category_id, $element) |
|
72 | 72 | { |
73 | - if( in_array( $element, $this->elements, true ) ) |
|
73 | + if (in_array($element, $this->elements, true)) |
|
74 | 74 | { |
75 | 75 | $elements = $this->db->makeArray( |
76 | 76 | $this->db->select( |
77 | 77 | '*', |
78 | 78 | $this->db_tbl[$element], |
79 | - "`category` = '" . $category_id . "'" |
|
79 | + "`category` = '".$category_id."'" |
|
80 | 80 | ) |
81 | 81 | ); |
82 | 82 | |
83 | 83 | // correct the name of templates |
84 | - if( $element === 'templates' ) |
|
84 | + if ($element === 'templates') |
|
85 | 85 | { |
86 | 86 | $_elements_count = count($elements); |
87 | - for( $i=0; $i < $_elements_count; $i++ ) |
|
87 | + for ($i = 0; $i < $_elements_count; $i++) |
|
88 | 88 | { |
89 | 89 | $elements[$i]['name'] = $elements[$i]['templatename']; |
90 | 90 | } |
@@ -94,56 +94,56 @@ discard block |
||
94 | 94 | return false; |
95 | 95 | } |
96 | 96 | |
97 | - public function getAllAssignedElements( $category_id ) |
|
97 | + public function getAllAssignedElements($category_id) |
|
98 | 98 | { |
99 | 99 | $elements = array(); |
100 | - foreach( $this->elements as $element ) |
|
100 | + foreach ($this->elements as $element) |
|
101 | 101 | { |
102 | - $elements[$element] = $this->getAssignedElements( $category_id, $element ); |
|
102 | + $elements[$element] = $this->getAssignedElements($category_id, $element); |
|
103 | 103 | } |
104 | 104 | return $elements; |
105 | 105 | } |
106 | 106 | |
107 | - public function deleteCategory( $category_id ) |
|
107 | + public function deleteCategory($category_id) |
|
108 | 108 | { |
109 | 109 | $_update = array('category' => 0); |
110 | - foreach( $this->elements as $element ) |
|
110 | + foreach ($this->elements as $element) |
|
111 | 111 | { |
112 | 112 | $this->db->update( |
113 | 113 | $_update, |
114 | 114 | $this->db_tbl[$element], |
115 | - "`category` = '" . $category_id . "'" |
|
115 | + "`category` = '".$category_id."'" |
|
116 | 116 | ); |
117 | 117 | } |
118 | 118 | |
119 | 119 | $this->db->delete( |
120 | 120 | $this->db_tbl['categories'], |
121 | - "`id` = '" . $category_id . "'" |
|
121 | + "`id` = '".$category_id."'" |
|
122 | 122 | ); |
123 | 123 | |
124 | 124 | return $this->db->getAffectedRows() === 1; |
125 | 125 | } |
126 | 126 | |
127 | - public function updateCategory( $category_id, $data = array() ) |
|
127 | + public function updateCategory($category_id, $data = array()) |
|
128 | 128 | { |
129 | - if( empty( $data ) |
|
130 | - || empty( $category_id ) ) |
|
129 | + if (empty($data) |
|
130 | + || empty($category_id)) |
|
131 | 131 | { |
132 | 132 | return false; |
133 | 133 | } |
134 | 134 | |
135 | 135 | $_update = array( |
136 | - 'category' => $this->db->escape( $data['category'] ), |
|
137 | - 'rank' => (int)$data['rank'] |
|
136 | + 'category' => $this->db->escape($data['category']), |
|
137 | + 'rank' => (int) $data['rank'] |
|
138 | 138 | ); |
139 | 139 | |
140 | 140 | $this->db->update( |
141 | 141 | $_update, |
142 | 142 | $this->db_tbl['categories'], |
143 | - "`id` = '" . (int)$category_id . "'" |
|
143 | + "`id` = '".(int) $category_id."'" |
|
144 | 144 | ); |
145 | 145 | |
146 | - if( $this->db->getAffectedRows() === 1 ) |
|
146 | + if ($this->db->getAffectedRows() === 1) |
|
147 | 147 | { |
148 | 148 | return true; |
149 | 149 | } |
@@ -151,16 +151,16 @@ discard block |
||
151 | 151 | return false; |
152 | 152 | } |
153 | 153 | |
154 | - public function addCategory( $category_name, $category_rank ) |
|
154 | + public function addCategory($category_name, $category_rank) |
|
155 | 155 | { |
156 | - if( $this->isCategoryExists( $category_name ) ) |
|
156 | + if ($this->isCategoryExists($category_name)) |
|
157 | 157 | { |
158 | 158 | return false; |
159 | 159 | } |
160 | 160 | |
161 | 161 | $_insert = array( |
162 | - 'category' => $this->db->escape( $category_name ), |
|
163 | - 'rank' => (int)$category_rank |
|
162 | + 'category' => $this->db->escape($category_name), |
|
163 | + 'rank' => (int) $category_rank |
|
164 | 164 | ); |
165 | 165 | |
166 | 166 | $this->db->insert( |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $this->db_tbl['categories'] |
169 | 169 | ); |
170 | 170 | |
171 | - if( $this->db->getAffectedRows() === 1 ) |
|
171 | + if ($this->db->getAffectedRows() === 1) |
|
172 | 172 | { |
173 | 173 | return $this->db->getInsertId(); |
174 | 174 | } |
@@ -176,19 +176,19 @@ discard block |
||
176 | 176 | return false; |
177 | 177 | } |
178 | 178 | |
179 | - public function isCategoryExists( $category_name ) |
|
179 | + public function isCategoryExists($category_name) |
|
180 | 180 | { |
181 | - $category = $this->db->escape( $category_name ); |
|
181 | + $category = $this->db->escape($category_name); |
|
182 | 182 | |
183 | 183 | $category_id = $this->db->getValue( |
184 | 184 | $this->db->select( |
185 | 185 | '`id`', |
186 | 186 | $this->db_tbl['categories'], |
187 | - "`category` = '" . $category . "'" |
|
187 | + "`category` = '".$category."'" |
|
188 | 188 | ) |
189 | 189 | ); |
190 | 190 | |
191 | - if( $this->db->getAffectedRows() === 1 ) |
|
191 | + if ($this->db->getAffectedRows() === 1) |
|
192 | 192 | { |
193 | 193 | return $category_id; |
194 | 194 | } |
@@ -15,8 +15,7 @@ discard block |
||
15 | 15 | $this->db = & $modx->db; |
16 | 16 | $this->db_tbl['categories'] = $modx->getFullTableName('categories'); |
17 | 17 | |
18 | - foreach( $this->elements as $element ) |
|
19 | - { |
|
18 | + foreach( $this->elements as $element ) { |
|
20 | 19 | $this->db_tbl[$element] = $modx->getFullTableName('site_' . $element ); |
21 | 20 | } |
22 | 21 | } |
@@ -37,8 +36,7 @@ discard block |
||
37 | 36 | ) |
38 | 37 | ); |
39 | 38 | |
40 | - if( !empty( $categories ) ) |
|
41 | - { |
|
39 | + if( !empty( $categories ) ) { |
|
42 | 40 | return $categories; |
43 | 41 | } |
44 | 42 | return false; |
@@ -70,8 +68,7 @@ discard block |
||
70 | 68 | |
71 | 69 | public function getAssignedElements( $category_id, $element ) |
72 | 70 | { |
73 | - if( in_array( $element, $this->elements, true ) ) |
|
74 | - { |
|
71 | + if( in_array( $element, $this->elements, true ) ) { |
|
75 | 72 | $elements = $this->db->makeArray( |
76 | 73 | $this->db->select( |
77 | 74 | '*', |
@@ -81,11 +78,9 @@ discard block |
||
81 | 78 | ); |
82 | 79 | |
83 | 80 | // correct the name of templates |
84 | - if( $element === 'templates' ) |
|
85 | - { |
|
81 | + if( $element === 'templates' ) { |
|
86 | 82 | $_elements_count = count($elements); |
87 | - for( $i=0; $i < $_elements_count; $i++ ) |
|
88 | - { |
|
83 | + for( $i=0; $i < $_elements_count; $i++ ) { |
|
89 | 84 | $elements[$i]['name'] = $elements[$i]['templatename']; |
90 | 85 | } |
91 | 86 | } |
@@ -97,8 +92,7 @@ discard block |
||
97 | 92 | public function getAllAssignedElements( $category_id ) |
98 | 93 | { |
99 | 94 | $elements = array(); |
100 | - foreach( $this->elements as $element ) |
|
101 | - { |
|
95 | + foreach( $this->elements as $element ) { |
|
102 | 96 | $elements[$element] = $this->getAssignedElements( $category_id, $element ); |
103 | 97 | } |
104 | 98 | return $elements; |
@@ -107,8 +101,7 @@ discard block |
||
107 | 101 | public function deleteCategory( $category_id ) |
108 | 102 | { |
109 | 103 | $_update = array('category' => 0); |
110 | - foreach( $this->elements as $element ) |
|
111 | - { |
|
104 | + foreach( $this->elements as $element ) { |
|
112 | 105 | $this->db->update( |
113 | 106 | $_update, |
114 | 107 | $this->db_tbl[$element], |
@@ -127,8 +120,7 @@ discard block |
||
127 | 120 | public function updateCategory( $category_id, $data = array() ) |
128 | 121 | { |
129 | 122 | if( empty( $data ) |
130 | - || empty( $category_id ) ) |
|
131 | - { |
|
123 | + || empty( $category_id ) ) { |
|
132 | 124 | return false; |
133 | 125 | } |
134 | 126 | |
@@ -143,8 +135,7 @@ discard block |
||
143 | 135 | "`id` = '" . (int)$category_id . "'" |
144 | 136 | ); |
145 | 137 | |
146 | - if( $this->db->getAffectedRows() === 1 ) |
|
147 | - { |
|
138 | + if( $this->db->getAffectedRows() === 1 ) { |
|
148 | 139 | return true; |
149 | 140 | } |
150 | 141 | |
@@ -153,8 +144,7 @@ discard block |
||
153 | 144 | |
154 | 145 | public function addCategory( $category_name, $category_rank ) |
155 | 146 | { |
156 | - if( $this->isCategoryExists( $category_name ) ) |
|
157 | - { |
|
147 | + if( $this->isCategoryExists( $category_name ) ) { |
|
158 | 148 | return false; |
159 | 149 | } |
160 | 150 | |
@@ -168,8 +158,7 @@ discard block |
||
168 | 158 | $this->db_tbl['categories'] |
169 | 159 | ); |
170 | 160 | |
171 | - if( $this->db->getAffectedRows() === 1 ) |
|
172 | - { |
|
161 | + if( $this->db->getAffectedRows() === 1 ) { |
|
173 | 162 | return $this->db->getInsertId(); |
174 | 163 | } |
175 | 164 | |
@@ -188,8 +177,7 @@ discard block |
||
188 | 177 | ) |
189 | 178 | ); |
190 | 179 | |
191 | - if( $this->db->getAffectedRows() === 1 ) |
|
192 | - { |
|
180 | + if( $this->db->getAffectedRows() === 1 ) { |
|
193 | 181 | return $category_id; |
194 | 182 | } |
195 | 183 | return false; |
@@ -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('view_eventlog')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | // get id |
@@ -41,18 +41,18 @@ discard block |
||
41 | 41 | <div class="tab-page"> |
42 | 42 | <div class="container container-body"> |
43 | 43 | <?php |
44 | - $date = $modx->toDateFormat($content["createdon"]); |
|
45 | - if($content["type"] == 1) { |
|
46 | - $icon = $_style['actions_info'] . ' text-info'; |
|
47 | - $msgtype = $_lang["information"]; |
|
48 | - } else if($content["type"] == 2) { |
|
49 | - $icon = $_style['actions_triangle'] . ' text-warning'; |
|
50 | - $msgtype = $_lang["warning"]; |
|
51 | - } else if($content["type"] == 3) { |
|
52 | - $icon = $_style['actions_error'] . ' text-danger'; |
|
53 | - $msgtype = $_lang["error"]; |
|
54 | - } |
|
55 | - ?> |
|
44 | + $date = $modx->toDateFormat($content["createdon"]); |
|
45 | + if($content["type"] == 1) { |
|
46 | + $icon = $_style['actions_info'] . ' text-info'; |
|
47 | + $msgtype = $_lang["information"]; |
|
48 | + } else if($content["type"] == 2) { |
|
49 | + $icon = $_style['actions_triangle'] . ' text-warning'; |
|
50 | + $msgtype = $_lang["warning"]; |
|
51 | + } else if($content["type"] == 3) { |
|
52 | + $icon = $_style['actions_error'] . ' text-danger'; |
|
53 | + $msgtype = $_lang["error"]; |
|
54 | + } |
|
55 | + ?> |
|
56 | 56 | <p><b><?= $content['source'] . " - " . $_lang['eventlog_viewer'] ?></b></p> |
57 | 57 | <p> |
58 | 58 | <i class="<?= $icon ?>"></i> <?= $msgtype ?> |
@@ -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('view_eventlog')) { |
|
5 | +if (!$modx->hasPermission('view_eventlog')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | 9 | // get id |
10 | 10 | $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; |
11 | 11 | |
12 | -$ds = $modx->db->select('el.*, IFNULL(wu.username,mu.username) as username', $modx->getFullTableName("event_log") . " el |
|
13 | - LEFT JOIN " . $modx->getFullTableName("manager_users") . " mu ON mu.id=el.user AND el.usertype=0 |
|
14 | - LEFT JOIN " . $modx->getFullTableName("web_users") . " wu ON wu.id=el.user AND el.usertype=1", "el.id='{$id}'"); |
|
12 | +$ds = $modx->db->select('el.*, IFNULL(wu.username,mu.username) as username', $modx->getFullTableName("event_log")." el |
|
13 | + LEFT JOIN " . $modx->getFullTableName("manager_users")." mu ON mu.id=el.user AND el.usertype=0 |
|
14 | + LEFT JOIN " . $modx->getFullTableName("web_users")." wu ON wu.id=el.user AND el.usertype=1", "el.id='{$id}'"); |
|
15 | 15 | $content = $modx->db->getRow($ds); |
16 | 16 | |
17 | 17 | ?> |
@@ -42,18 +42,18 @@ discard block |
||
42 | 42 | <div class="container container-body"> |
43 | 43 | <?php |
44 | 44 | $date = $modx->toDateFormat($content["createdon"]); |
45 | - if($content["type"] == 1) { |
|
46 | - $icon = $_style['actions_info'] . ' text-info'; |
|
45 | + if ($content["type"] == 1) { |
|
46 | + $icon = $_style['actions_info'].' text-info'; |
|
47 | 47 | $msgtype = $_lang["information"]; |
48 | - } else if($content["type"] == 2) { |
|
49 | - $icon = $_style['actions_triangle'] . ' text-warning'; |
|
48 | + } else if ($content["type"] == 2) { |
|
49 | + $icon = $_style['actions_triangle'].' text-warning'; |
|
50 | 50 | $msgtype = $_lang["warning"]; |
51 | - } else if($content["type"] == 3) { |
|
52 | - $icon = $_style['actions_error'] . ' text-danger'; |
|
51 | + } else if ($content["type"] == 3) { |
|
52 | + $icon = $_style['actions_error'].' text-danger'; |
|
53 | 53 | $msgtype = $_lang["error"]; |
54 | 54 | } |
55 | 55 | ?> |
56 | - <p><b><?= $content['source'] . " - " . $_lang['eventlog_viewer'] ?></b></p> |
|
56 | + <p><b><?= $content['source']." - ".$_lang['eventlog_viewer'] ?></b></p> |
|
57 | 57 | <p> |
58 | 58 | <i class="<?= $icon ?>"></i> <?= $msgtype ?> |
59 | 59 | </p> |
@@ -5,140 +5,140 @@ |
||
5 | 5 | |
6 | 6 | // action list |
7 | 7 | $GLOBALS['action_list'] = array( |
8 | - '1' => 'Loading a frame(set)', |
|
9 | - '2' => 'Viewing home page/ online users', |
|
10 | - '3' => 'Viewing data for resource', |
|
11 | - '4' => 'Creating a resource', |
|
12 | - '5' => 'Saving resource', |
|
13 | - '6' => 'Deleting resource', |
|
14 | - '7' => 'Waiting while MODX cleans up', |
|
15 | - '8' => 'Logged out', |
|
16 | - '9' => 'Viewing help', |
|
17 | - '10' => 'Viewing/ composing messages', |
|
18 | - '11' => 'Creating a user', |
|
19 | - '12' => 'Editing user', |
|
20 | - '13' => 'Viewing logging', |
|
21 | - '14' => 'Editing a parser', |
|
22 | - '15' => 'Saving a parser', |
|
23 | - '16' => 'Editing template', |
|
24 | - '17' => 'Editing settings', |
|
25 | - '18' => 'Viewing Credits :)', |
|
26 | - '19' => 'Creating a new template', |
|
27 | - '20' => 'Saving template', |
|
28 | - '21' => 'Deleting template', |
|
29 | - '22' => 'Editing Snippet', |
|
30 | - '23' => 'Creating a new Snippet', |
|
31 | - '24' => 'Saving Snippet', |
|
32 | - '25' => 'Deleting Snippet', |
|
33 | - '26' => 'Refreshing site', |
|
34 | - '27' => 'Editing resource', |
|
35 | - '28' => 'Changing password', |
|
36 | - '29' => 'Error', |
|
37 | - '30' => 'Saving settings', |
|
38 | - '31' => 'Using file manager', |
|
39 | - '32' => 'Saving user', |
|
40 | - '33' => 'Deleting user', |
|
41 | - '34' => 'Saving new password', |
|
42 | - '35' => 'Editing role', |
|
43 | - '36' => 'Saving role', |
|
44 | - '37' => 'Deleting role', |
|
45 | - '38' => 'Creating new role', |
|
46 | - '40' => 'Editing Access Permissions', |
|
47 | - '41' => 'Editing Access Permissions', |
|
48 | - '42' => 'Editing Access Permissions', |
|
49 | - '43' => 'Editing Access Permissions', |
|
50 | - '44' => 'Editing Access Permissions', |
|
51 | - '45' => 'Idle', |
|
52 | - '46' => 'Editing Access Permissions', |
|
53 | - '47' => 'Editing Access Permissions', |
|
54 | - '48' => 'Editing Access Permissions', |
|
55 | - '49' => 'Editing Access Permissions', |
|
56 | - '50' => 'Editing Access Permissions', |
|
57 | - '51' => 'Moving resource', |
|
58 | - '52' => 'Moved resource', |
|
59 | - '53' => 'Viewing system info', |
|
60 | - '54' => 'Optimizing a table', |
|
61 | - '55' => 'Empty logs', |
|
62 | - '56' => 'Refresh resource tree', |
|
63 | - '57' => 'Refresh menu', |
|
64 | - '58' => 'Logged in', |
|
65 | - '59' => 'About MODX', |
|
66 | - '60' => 'Emptying Recycle Bin', |
|
67 | - '61' => 'Publishing a resource', |
|
68 | - '62' => 'Un-publishing a resource', |
|
69 | - '63' => 'Un-deleting a resource', |
|
70 | - '64' => 'Removing deleted content', |
|
71 | - '65' => 'Deleting a message', |
|
72 | - '66' => 'Sending a message', |
|
73 | - '67' => 'Removing locks', |
|
74 | - '68' => 'Viewing site logging', |
|
75 | - '69' => 'Viewing online visitors', |
|
76 | - '70' => 'Viewing site schedule', |
|
77 | - '71' => 'Searching', |
|
78 | - '72' => 'Adding a weblink', |
|
79 | - '73' => 'Editing a weblink', |
|
80 | - //case "74" : return "Changing personal preferences"; break; |
|
81 | - '75' => 'User/ role management', |
|
82 | - '76' => 'Element management', |
|
83 | - '77' => 'Creating a new Chunk (HTML Snippet)', |
|
84 | - '78' => 'Editing Chunk (HTML Snippet)', |
|
85 | - '79' => 'Saving Chunk (HTML Snippet)', |
|
86 | - '80' => 'Deleting Chunk (HTML Snippet)', |
|
87 | - '83' => 'Exporting a resource to HTML', |
|
88 | - '84' => 'Load Element Selector', |
|
89 | - '85' => 'Create Folder', |
|
90 | - '86' => 'Role management', |
|
91 | - '87' => 'Create new web user', |
|
92 | - '88' => 'Editing web user', |
|
93 | - '89' => 'Saving web user', |
|
94 | - '90' => 'Deleting web user', |
|
95 | - '91' => 'Editing Web Access Permissions', |
|
96 | - '92' => 'Editing Access Permissions', |
|
97 | - '93' => 'Backup Manager', |
|
98 | - '94' => 'Duplicate resource', |
|
99 | - '95' => 'Importing resources from HTML', |
|
100 | - '96' => 'Duplicate Template', |
|
101 | - '97' => 'Duplicate Chunk (HTML Snippet)', |
|
102 | - '98' => 'Duplicate Snippet', |
|
103 | - '99' => 'Manage Web Users', |
|
104 | - '100' => 'Previewing resource', |
|
105 | - '101' => 'Create new plugin', |
|
106 | - '102' => 'Edit plugin', |
|
107 | - '103' => 'Saving plugin', |
|
108 | - '104' => 'Delete plugin', |
|
109 | - '105' => 'Duplicate plugin', |
|
110 | - '106' => 'Viewing Modules', |
|
111 | - '107' => 'Create new module', |
|
112 | - '108' => 'Edit module', |
|
113 | - '109' => 'Saving module', |
|
114 | - '110' => 'Delete module', |
|
115 | - '111' => 'Duplicate module', |
|
116 | - '112' => 'Execute module', |
|
117 | - '113' => 'Manage module dependencies', |
|
118 | - '114' => 'View event log', |
|
119 | - '115' => 'View event log details', |
|
120 | - '116' => 'Delete event log', |
|
121 | - '117' => 'Editing tv rank', |
|
122 | - '118' => 'Call settings ajax include', |
|
123 | - '119' => 'Login Fail (Temporary Block)', |
|
8 | + '1' => 'Loading a frame(set)', |
|
9 | + '2' => 'Viewing home page/ online users', |
|
10 | + '3' => 'Viewing data for resource', |
|
11 | + '4' => 'Creating a resource', |
|
12 | + '5' => 'Saving resource', |
|
13 | + '6' => 'Deleting resource', |
|
14 | + '7' => 'Waiting while MODX cleans up', |
|
15 | + '8' => 'Logged out', |
|
16 | + '9' => 'Viewing help', |
|
17 | + '10' => 'Viewing/ composing messages', |
|
18 | + '11' => 'Creating a user', |
|
19 | + '12' => 'Editing user', |
|
20 | + '13' => 'Viewing logging', |
|
21 | + '14' => 'Editing a parser', |
|
22 | + '15' => 'Saving a parser', |
|
23 | + '16' => 'Editing template', |
|
24 | + '17' => 'Editing settings', |
|
25 | + '18' => 'Viewing Credits :)', |
|
26 | + '19' => 'Creating a new template', |
|
27 | + '20' => 'Saving template', |
|
28 | + '21' => 'Deleting template', |
|
29 | + '22' => 'Editing Snippet', |
|
30 | + '23' => 'Creating a new Snippet', |
|
31 | + '24' => 'Saving Snippet', |
|
32 | + '25' => 'Deleting Snippet', |
|
33 | + '26' => 'Refreshing site', |
|
34 | + '27' => 'Editing resource', |
|
35 | + '28' => 'Changing password', |
|
36 | + '29' => 'Error', |
|
37 | + '30' => 'Saving settings', |
|
38 | + '31' => 'Using file manager', |
|
39 | + '32' => 'Saving user', |
|
40 | + '33' => 'Deleting user', |
|
41 | + '34' => 'Saving new password', |
|
42 | + '35' => 'Editing role', |
|
43 | + '36' => 'Saving role', |
|
44 | + '37' => 'Deleting role', |
|
45 | + '38' => 'Creating new role', |
|
46 | + '40' => 'Editing Access Permissions', |
|
47 | + '41' => 'Editing Access Permissions', |
|
48 | + '42' => 'Editing Access Permissions', |
|
49 | + '43' => 'Editing Access Permissions', |
|
50 | + '44' => 'Editing Access Permissions', |
|
51 | + '45' => 'Idle', |
|
52 | + '46' => 'Editing Access Permissions', |
|
53 | + '47' => 'Editing Access Permissions', |
|
54 | + '48' => 'Editing Access Permissions', |
|
55 | + '49' => 'Editing Access Permissions', |
|
56 | + '50' => 'Editing Access Permissions', |
|
57 | + '51' => 'Moving resource', |
|
58 | + '52' => 'Moved resource', |
|
59 | + '53' => 'Viewing system info', |
|
60 | + '54' => 'Optimizing a table', |
|
61 | + '55' => 'Empty logs', |
|
62 | + '56' => 'Refresh resource tree', |
|
63 | + '57' => 'Refresh menu', |
|
64 | + '58' => 'Logged in', |
|
65 | + '59' => 'About MODX', |
|
66 | + '60' => 'Emptying Recycle Bin', |
|
67 | + '61' => 'Publishing a resource', |
|
68 | + '62' => 'Un-publishing a resource', |
|
69 | + '63' => 'Un-deleting a resource', |
|
70 | + '64' => 'Removing deleted content', |
|
71 | + '65' => 'Deleting a message', |
|
72 | + '66' => 'Sending a message', |
|
73 | + '67' => 'Removing locks', |
|
74 | + '68' => 'Viewing site logging', |
|
75 | + '69' => 'Viewing online visitors', |
|
76 | + '70' => 'Viewing site schedule', |
|
77 | + '71' => 'Searching', |
|
78 | + '72' => 'Adding a weblink', |
|
79 | + '73' => 'Editing a weblink', |
|
80 | + //case "74" : return "Changing personal preferences"; break; |
|
81 | + '75' => 'User/ role management', |
|
82 | + '76' => 'Element management', |
|
83 | + '77' => 'Creating a new Chunk (HTML Snippet)', |
|
84 | + '78' => 'Editing Chunk (HTML Snippet)', |
|
85 | + '79' => 'Saving Chunk (HTML Snippet)', |
|
86 | + '80' => 'Deleting Chunk (HTML Snippet)', |
|
87 | + '83' => 'Exporting a resource to HTML', |
|
88 | + '84' => 'Load Element Selector', |
|
89 | + '85' => 'Create Folder', |
|
90 | + '86' => 'Role management', |
|
91 | + '87' => 'Create new web user', |
|
92 | + '88' => 'Editing web user', |
|
93 | + '89' => 'Saving web user', |
|
94 | + '90' => 'Deleting web user', |
|
95 | + '91' => 'Editing Web Access Permissions', |
|
96 | + '92' => 'Editing Access Permissions', |
|
97 | + '93' => 'Backup Manager', |
|
98 | + '94' => 'Duplicate resource', |
|
99 | + '95' => 'Importing resources from HTML', |
|
100 | + '96' => 'Duplicate Template', |
|
101 | + '97' => 'Duplicate Chunk (HTML Snippet)', |
|
102 | + '98' => 'Duplicate Snippet', |
|
103 | + '99' => 'Manage Web Users', |
|
104 | + '100' => 'Previewing resource', |
|
105 | + '101' => 'Create new plugin', |
|
106 | + '102' => 'Edit plugin', |
|
107 | + '103' => 'Saving plugin', |
|
108 | + '104' => 'Delete plugin', |
|
109 | + '105' => 'Duplicate plugin', |
|
110 | + '106' => 'Viewing Modules', |
|
111 | + '107' => 'Create new module', |
|
112 | + '108' => 'Edit module', |
|
113 | + '109' => 'Saving module', |
|
114 | + '110' => 'Delete module', |
|
115 | + '111' => 'Duplicate module', |
|
116 | + '112' => 'Execute module', |
|
117 | + '113' => 'Manage module dependencies', |
|
118 | + '114' => 'View event log', |
|
119 | + '115' => 'View event log details', |
|
120 | + '116' => 'Delete event log', |
|
121 | + '117' => 'Editing tv rank', |
|
122 | + '118' => 'Call settings ajax include', |
|
123 | + '119' => 'Login Fail (Temporary Block)', |
|
124 | 124 | |
125 | - '300' => 'Create Template Variable', |
|
126 | - '301' => 'Edit Template Variable', |
|
127 | - '302' => 'Save Template Variable', |
|
128 | - '303' => 'Delete Template Variable', |
|
129 | - '304' => 'Duplicate Template Variable', |
|
125 | + '300' => 'Create Template Variable', |
|
126 | + '301' => 'Edit Template Variable', |
|
127 | + '302' => 'Save Template Variable', |
|
128 | + '303' => 'Delete Template Variable', |
|
129 | + '304' => 'Duplicate Template Variable', |
|
130 | 130 | |
131 | - '200' => 'Viewing phpInfo()', |
|
132 | - '501' => 'Delete category', |
|
133 | - '998' => 'Viewing web page', |
|
134 | - '999' => 'Viewing test page', |
|
131 | + '200' => 'Viewing phpInfo()', |
|
132 | + '501' => 'Delete category', |
|
133 | + '998' => 'Viewing web page', |
|
134 | + '999' => 'Viewing test page', |
|
135 | 135 | ); |
136 | 136 | |
137 | 137 | function getAction($actionId, $itemid='') { |
138 | - global $action_list; |
|
138 | + global $action_list; |
|
139 | 139 | |
140 | - $ret = sprintf($action_list[$actionId], $itemid); |
|
141 | - if (!$ret) $ret = "Idle (unknown)"; |
|
140 | + $ret = sprintf($action_list[$actionId], $itemid); |
|
141 | + if (!$ret) $ret = "Idle (unknown)"; |
|
142 | 142 | |
143 | - return $ret; |
|
143 | + return $ret; |
|
144 | 144 | } |
@@ -1,5 +1,5 @@ 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 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | '999' => 'Viewing test page', |
135 | 135 | ); |
136 | 136 | |
137 | -function getAction($actionId, $itemid='') { |
|
137 | +function getAction($actionId, $itemid = ''){ |
|
138 | 138 | global $action_list; |
139 | 139 | |
140 | 140 | $ret = sprintf($action_list[$actionId], $itemid); |
@@ -134,11 +134,14 @@ |
||
134 | 134 | '999' => 'Viewing test page', |
135 | 135 | ); |
136 | 136 | |
137 | -function getAction($actionId, $itemid='') { |
|
137 | +function getAction($actionId, $itemid='') |
|
138 | +{ |
|
138 | 139 | global $action_list; |
139 | 140 | |
140 | 141 | $ret = sprintf($action_list[$actionId], $itemid); |
141 | - if (!$ret) $ret = "Idle (unknown)"; |
|
142 | + if (!$ret) { |
|
143 | + $ret = "Idle (unknown)"; |
|
144 | + } |
|
142 | 145 | |
143 | 146 | return $ret; |
144 | 147 | } |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -if(( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) && IN_PARSER_MODE!="true") { |
|
2 | +if ((!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) && IN_PARSER_MODE != "true") { |
|
3 | 3 | die("<b>INCLUDE ACCESS ERROR</b><br /><br />Direct access to this file prohibited."); |
4 | 4 | } |
5 | 5 | $tmpArray = array(); |
@@ -53,7 +53,7 @@ |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | if($emptyCache) { |
56 | - $modx->clearCache('full'); |
|
56 | + $modx->clearCache('full'); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | echo $str; |
@@ -3,11 +3,11 @@ discard block |
||
3 | 3 | * mutate_settings.ajax.php |
4 | 4 | * |
5 | 5 | */ |
6 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
6 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
7 | 7 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
8 | 8 | } |
9 | 9 | |
10 | -require_once(dirname(__FILE__) . '/protect.inc.php'); |
|
10 | +require_once(dirname(__FILE__).'/protect.inc.php'); |
|
11 | 11 | |
12 | 12 | $action = preg_replace('/[^A-Za-z0-9_\-\.\/]/', '', $_POST['action']); |
13 | 13 | $lang = preg_replace('/[^A-Za-z0-9_\s\+\-\.\/]/', '', $_POST['lang']); |
@@ -22,10 +22,10 @@ discard block |
||
22 | 22 | $str = ''; |
23 | 23 | $emptyCache = false; |
24 | 24 | |
25 | -switch(true){ |
|
26 | - case ($action == 'get' && preg_match('/^[A-z0-9_-]+$/',$lang) && file_exists(dirname(__FILE__) . '/lang/'.$lang.'.inc.php')):{ |
|
27 | - include(dirname(__FILE__) . '/lang/'.$lang.'.inc.php'); |
|
28 | - $str = isset($key,$_lang,$_lang[$key]) ? $_lang[$key] : "" ; |
|
25 | +switch (true) { |
|
26 | + case ($action == 'get' && preg_match('/^[A-z0-9_-]+$/', $lang) && file_exists(dirname(__FILE__).'/lang/'.$lang.'.inc.php')):{ |
|
27 | + include(dirname(__FILE__).'/lang/'.$lang.'.inc.php'); |
|
28 | + $str = isset($key, $_lang, $_lang[$key]) ? $_lang[$key] : ""; |
|
29 | 29 | break; |
30 | 30 | } |
31 | 31 | case ($action == 'setsetting' && !empty($key) && !empty($value)):{ |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | } |
53 | 53 | } |
54 | 54 | |
55 | -if($emptyCache) { |
|
55 | +if ($emptyCache) { |
|
56 | 56 | $modx->clearCache('full'); |
57 | 57 | } |
58 | 58 |
@@ -22,7 +22,7 @@ |
||
22 | 22 | $str = ''; |
23 | 23 | $emptyCache = false; |
24 | 24 | |
25 | -switch(true){ |
|
25 | +switch(true) { |
|
26 | 26 | case ($action == 'get' && preg_match('/^[A-z0-9_-]+$/',$lang) && file_exists(dirname(__FILE__) . '/lang/'.$lang.'.inc.php')):{ |
27 | 27 | include(dirname(__FILE__) . '/lang/'.$lang.'.inc.php'); |
28 | 28 | $str = isset($key,$_lang,$_lang[$key]) ? $_lang[$key] : "" ; |
@@ -1,5 +1,5 @@ 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 | |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | var stay = document.getElementById('stay'); |
19 | 19 | // Trigger unlock |
20 | 20 | if ((stay && stay.value !== '2') || !form_save) { |
21 | - var url = '<?php echo MODX_MANAGER_URL; ?>?a=67&type=<?php echo $lockElementType;?>&id=<?php echo $lockElementId;?>&o=' + Math.random(); |
|
21 | + var url = '<?php echo MODX_MANAGER_URL; ?>?a=67&type=<?php echo $lockElementType; ?>&id=<?php echo $lockElementId; ?>&o=' + Math.random(); |
|
22 | 22 | if (navigator.sendBeacon) { |
23 | 23 | navigator.sendBeacon(url) |
24 | 24 | } else { |
@@ -1,11 +1,11 @@ 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 | global $SystemAlertMsgQueque; |
6 | 6 | // display system alert window if messages are available |
7 | 7 | if(count($SystemAlertMsgQueque) > 0) { |
8 | - include "sysalert.display.inc.php"; |
|
8 | + include "sysalert.display.inc.php"; |
|
9 | 9 | } |
10 | 10 | ?> |
11 | 11 | <script type='text/javascript'> |
@@ -19,17 +19,17 @@ discard block |
||
19 | 19 | </script> |
20 | 20 | <?php |
21 | 21 | if(in_array($modx->manager->action, array( |
22 | - 85, |
|
23 | - 27, |
|
24 | - 4, |
|
25 | - 72, |
|
26 | - 13, |
|
27 | - 11, |
|
28 | - 12, |
|
29 | - 87, |
|
30 | - 88 |
|
22 | + 85, |
|
23 | + 27, |
|
24 | + 4, |
|
25 | + 72, |
|
26 | + 13, |
|
27 | + 11, |
|
28 | + 12, |
|
29 | + 87, |
|
30 | + 88 |
|
31 | 31 | ))) { |
32 | - echo $modx->manager->loadDatePicker($modx->config['mgr_date_picker_path']); |
|
32 | + echo $modx->manager->loadDatePicker($modx->config['mgr_date_picker_path']); |
|
33 | 33 | } |
34 | 34 | ?> |
35 | 35 | </body> |
@@ -1,10 +1,10 @@ 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 | global $SystemAlertMsgQueque; |
6 | 6 | // display system alert window if messages are available |
7 | -if(count($SystemAlertMsgQueque) > 0) { |
|
7 | +if (count($SystemAlertMsgQueque) > 0) { |
|
8 | 8 | include "sysalert.display.inc.php"; |
9 | 9 | } |
10 | 10 | ?> |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | }); |
19 | 19 | </script> |
20 | 20 | <?php |
21 | -if(in_array($modx->manager->action, array( |
|
21 | +if (in_array($modx->manager->action, array( |
|
22 | 22 | 85, |
23 | 23 | 27, |
24 | 24 | 4, |
@@ -3,7 +3,7 @@ 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('export_static')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | $maxtime = (is_numeric($_POST['maxtime'])) ? $_POST['maxtime'] : 30; |
@@ -17,11 +17,11 @@ discard block |
||
17 | 17 | $modx->export->targetDir = $export_dir; |
18 | 18 | |
19 | 19 | if(strpos($modx->config['base_path'],"{$export_dir}/")===0 && 0 <= strlen(str_replace("{$export_dir}/",'',$modx->config['base_path']))) |
20 | - return $_lang['export_site.static.php6']; |
|
20 | + return $_lang['export_site.static.php6']; |
|
21 | 21 | elseif($modx->config['rb_base_dir'] === $export_dir . '/') |
22 | - return $modx->parsePlaceholder($_lang['export_site.static.php7'],'rb_base_url=' . $modx->config['base_url'] . $modx->config['rb_base_url']); |
|
22 | + return $modx->parsePlaceholder($_lang['export_site.static.php7'],'rb_base_url=' . $modx->config['base_url'] . $modx->config['rb_base_url']); |
|
23 | 23 | elseif(!is_writable($export_dir)) |
24 | - return $_lang['export_site_target_unwritable']; |
|
24 | + return $_lang['export_site_target_unwritable']; |
|
25 | 25 | |
26 | 26 | $modx->export->generate_mode = $_POST['generate_mode']; |
27 | 27 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | ||$includenoncache!==$_POST['includenoncache'] |
38 | 38 | ||$repl_before!==$_POST['repl_before'] |
39 | 39 | ||$repl_after !==$_POST['repl_after']) { |
40 | - $modx->clearCache('full'); |
|
40 | + $modx->clearCache('full'); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | $total = $modx->export->getTotal($_POST['ignore_ids'], $modx->config['export_includenoncache']); |
@@ -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('export_static')) { |
|
5 | +if (!$modx->hasPermission('export_static')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -12,15 +12,15 @@ discard block |
||
12 | 12 | $modx->loadExtension('EXPORT_SITE'); |
13 | 13 | |
14 | 14 | |
15 | -if(is_dir(MODX_BASE_PATH . 'temp')) $export_dir = MODX_BASE_PATH . 'temp/export'; |
|
16 | -elseif(is_dir(MODX_BASE_PATH . 'assets')) $export_dir = MODX_BASE_PATH . 'assets/export'; |
|
15 | +if (is_dir(MODX_BASE_PATH.'temp')) $export_dir = MODX_BASE_PATH.'temp/export'; |
|
16 | +elseif (is_dir(MODX_BASE_PATH.'assets')) $export_dir = MODX_BASE_PATH.'assets/export'; |
|
17 | 17 | $modx->export->targetDir = $export_dir; |
18 | 18 | |
19 | -if(strpos($modx->config['base_path'],"{$export_dir}/")===0 && 0 <= strlen(str_replace("{$export_dir}/",'',$modx->config['base_path']))) |
|
19 | +if (strpos($modx->config['base_path'], "{$export_dir}/") === 0 && 0 <= strlen(str_replace("{$export_dir}/", '', $modx->config['base_path']))) |
|
20 | 20 | return $_lang['export_site.static.php6']; |
21 | -elseif($modx->config['rb_base_dir'] === $export_dir . '/') |
|
22 | - return $modx->parsePlaceholder($_lang['export_site.static.php7'],'rb_base_url=' . $modx->config['base_url'] . $modx->config['rb_base_url']); |
|
23 | -elseif(!is_writable($export_dir)) |
|
21 | +elseif ($modx->config['rb_base_dir'] === $export_dir.'/') |
|
22 | + return $modx->parsePlaceholder($_lang['export_site.static.php7'], 'rb_base_url='.$modx->config['base_url'].$modx->config['rb_base_url']); |
|
23 | +elseif (!is_writable($export_dir)) |
|
24 | 24 | return $_lang['export_site_target_unwritable']; |
25 | 25 | |
26 | 26 | $modx->export->generate_mode = $_POST['generate_mode']; |
@@ -33,10 +33,10 @@ discard block |
||
33 | 33 | $repl_after = $_POST['repl_after']; |
34 | 34 | $includenoncache = $_POST['includenoncache']; |
35 | 35 | |
36 | -if($ignore_ids!==$_POST['ignore_ids'] |
|
37 | - ||$includenoncache!==$_POST['includenoncache'] |
|
38 | - ||$repl_before!==$_POST['repl_before'] |
|
39 | - ||$repl_after !==$_POST['repl_after']) { |
|
36 | +if ($ignore_ids !== $_POST['ignore_ids'] |
|
37 | + ||$includenoncache !== $_POST['includenoncache'] |
|
38 | + ||$repl_before !== $_POST['repl_before'] |
|
39 | + ||$repl_after !== $_POST['repl_after']) { |
|
40 | 40 | $modx->clearCache('full'); |
41 | 41 | } |
42 | 42 | |
@@ -52,5 +52,5 @@ discard block |
||
52 | 52 | |
53 | 53 | $exportend = $modx->export->get_mtime(); |
54 | 54 | $totaltime = ($exportend - $modx->export->exportstart); |
55 | -$output .= sprintf ('<p>'.$_lang["export_site_time"].'</p>', round($totaltime, 3)); |
|
55 | +$output .= sprintf('<p>'.$_lang["export_site_time"].'</p>', round($totaltime, 3)); |
|
56 | 56 | return $output; |
@@ -12,16 +12,20 @@ |
||
12 | 12 | $modx->loadExtension('EXPORT_SITE'); |
13 | 13 | |
14 | 14 | |
15 | -if(is_dir(MODX_BASE_PATH . 'temp')) $export_dir = MODX_BASE_PATH . 'temp/export'; |
|
16 | -elseif(is_dir(MODX_BASE_PATH . 'assets')) $export_dir = MODX_BASE_PATH . 'assets/export'; |
|
15 | +if(is_dir(MODX_BASE_PATH . 'temp')) { |
|
16 | + $export_dir = MODX_BASE_PATH . 'temp/export'; |
|
17 | +} elseif(is_dir(MODX_BASE_PATH . 'assets')) { |
|
18 | + $export_dir = MODX_BASE_PATH . 'assets/export'; |
|
19 | +} |
|
17 | 20 | $modx->export->targetDir = $export_dir; |
18 | 21 | |
19 | -if(strpos($modx->config['base_path'],"{$export_dir}/")===0 && 0 <= strlen(str_replace("{$export_dir}/",'',$modx->config['base_path']))) |
|
22 | +if(strpos($modx->config['base_path'],"{$export_dir}/")===0 && 0 <= strlen(str_replace("{$export_dir}/",'',$modx->config['base_path']))) { |
|
20 | 23 | return $_lang['export_site.static.php6']; |
21 | -elseif($modx->config['rb_base_dir'] === $export_dir . '/') |
|
24 | +} elseif($modx->config['rb_base_dir'] === $export_dir . '/') { |
|
22 | 25 | return $modx->parsePlaceholder($_lang['export_site.static.php7'],'rb_base_url=' . $modx->config['base_url'] . $modx->config['rb_base_url']); |
23 | -elseif(!is_writable($export_dir)) |
|
26 | +} elseif(!is_writable($export_dir)) { |
|
24 | 27 | return $_lang['export_site_target_unwritable']; |
28 | +} |
|
25 | 29 | |
26 | 30 | $modx->export->generate_mode = $_POST['generate_mode']; |
27 | 31 |