@@ -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_web_user')) { |
| 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 | // Set the item name for logger |
@@ -17,9 +17,9 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | // invoke OnBeforeWUsrFormDelete event |
| 19 | 19 | $modx->invokeEvent("OnBeforeWUsrFormDelete", |
| 20 | - array( |
|
| 21 | - "id" => $id |
|
| 22 | - )); |
|
| 20 | + array( |
|
| 21 | + "id" => $id |
|
| 22 | + )); |
|
| 23 | 23 | |
| 24 | 24 | // delete the user. |
| 25 | 25 | $modx->db->delete($modx->getFullTableName('web_users'), "id='{$id}'"); |
@@ -32,16 +32,16 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | // invoke OnWebDeleteUser event |
| 34 | 34 | $modx->invokeEvent("OnWebDeleteUser", |
| 35 | - array( |
|
| 36 | - "userid" => $id, |
|
| 37 | - "username" => $username |
|
| 38 | - )); |
|
| 35 | + array( |
|
| 36 | + "userid" => $id, |
|
| 37 | + "username" => $username |
|
| 38 | + )); |
|
| 39 | 39 | |
| 40 | 40 | // invoke OnWUsrFormDelete event |
| 41 | 41 | $modx->invokeEvent("OnWUsrFormDelete", |
| 42 | - array( |
|
| 43 | - "id" => $id |
|
| 44 | - )); |
|
| 42 | + array( |
|
| 43 | + "id" => $id |
|
| 44 | + )); |
|
| 45 | 45 | |
| 46 | 46 | $header="Location: index.php?a=99"; |
| 47 | 47 | header($header); |
@@ -3,17 +3,17 @@ |
||
| 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_eventlog')) { |
| 6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | if (isset($_GET['cls']) && $_GET['cls']==1) { |
| 10 | - $where = ''; |
|
| 10 | + $where = ''; |
|
| 11 | 11 | } else { |
| 12 | - $id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
|
| 13 | - if($id==0) { |
|
| 14 | - $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
| 15 | - } |
|
| 16 | - $where = "id='{$id}'"; |
|
| 12 | + $id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
|
| 13 | + if($id==0) { |
|
| 14 | + $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
| 15 | + } |
|
| 16 | + $where = "id='{$id}'"; |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | // delete event log |
@@ -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_plugin')) { |
| 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,25 +19,25 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | // duplicate Plugin |
| 21 | 21 | $newid = $modx->db->insert( |
| 22 | - array( |
|
| 23 | - 'name'=>'', |
|
| 24 | - 'description'=>'', |
|
| 25 | - 'disabled'=>'', |
|
| 26 | - 'moduleguid'=>'', |
|
| 27 | - 'plugincode'=>'', |
|
| 28 | - 'properties'=>'', |
|
| 29 | - 'category'=>'', |
|
| 30 | - ), $modx->getFullTableName('site_plugins'), // Insert into |
|
| 31 | - "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, '1' AS disabled, moduleguid, plugincode, properties, category", $modx->getFullTableName('site_plugins'), "id='{$id}'"); // Copy from |
|
| 22 | + array( |
|
| 23 | + 'name'=>'', |
|
| 24 | + 'description'=>'', |
|
| 25 | + 'disabled'=>'', |
|
| 26 | + 'moduleguid'=>'', |
|
| 27 | + 'plugincode'=>'', |
|
| 28 | + 'properties'=>'', |
|
| 29 | + 'category'=>'', |
|
| 30 | + ), $modx->getFullTableName('site_plugins'), // Insert into |
|
| 31 | + "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, '1' AS disabled, moduleguid, plugincode, properties, category", $modx->getFullTableName('site_plugins'), "id='{$id}'"); // Copy from |
|
| 32 | 32 | |
| 33 | 33 | // duplicate Plugin Event Listeners |
| 34 | 34 | $modx->db->insert( |
| 35 | - array( |
|
| 36 | - 'pluginid'=>'', |
|
| 37 | - 'evtid'=>'', |
|
| 38 | - 'priority'=>'', |
|
| 39 | - ), $modx->getFullTableName('site_plugin_events'), // Insert into |
|
| 40 | - "'{$newid}', evtid, priority", $modx->getFullTableName('site_plugin_events'), "pluginid='{$id}'"); // Copy from |
|
| 35 | + array( |
|
| 36 | + 'pluginid'=>'', |
|
| 37 | + 'evtid'=>'', |
|
| 38 | + 'priority'=>'', |
|
| 39 | + ), $modx->getFullTableName('site_plugin_events'), // Insert into |
|
| 40 | + "'{$newid}', evtid, priority", $modx->getFullTableName('site_plugin_events'), "pluginid='{$id}'"); // Copy from |
|
| 41 | 41 | |
| 42 | 42 | // Set the item name for logger |
| 43 | 43 | $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_plugins'), "id='{$newid}'")); |
@@ -3,17 +3,17 @@ 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_user')) { |
| 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 | // delete the user, but first check if we are deleting our own record |
| 15 | 15 | if($id==$modx->getLoginUserID()) { |
| 16 | - $modx->webAlertAndQuit("You can't delete yourself!"); |
|
| 16 | + $modx->webAlertAndQuit("You can't delete yourself!"); |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | // Set the item name for logger |
@@ -22,9 +22,9 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | // invoke OnBeforeUserFormDelete event |
| 24 | 24 | $modx->invokeEvent("OnBeforeUserFormDelete", |
| 25 | - array( |
|
| 26 | - "id" => $id |
|
| 27 | - )); |
|
| 25 | + array( |
|
| 26 | + "id" => $id |
|
| 27 | + )); |
|
| 28 | 28 | |
| 29 | 29 | // delete the user. |
| 30 | 30 | $modx->db->delete($modx->getFullTableName('manager_users'), "id='{$id}'"); |
@@ -39,16 +39,16 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | // invoke OnManagerDeleteUser event |
| 41 | 41 | $modx->invokeEvent("OnManagerDeleteUser", |
| 42 | - array( |
|
| 43 | - "userid" => $id, |
|
| 44 | - "username" => $username |
|
| 45 | - )); |
|
| 42 | + array( |
|
| 43 | + "userid" => $id, |
|
| 44 | + "username" => $username |
|
| 45 | + )); |
|
| 46 | 46 | |
| 47 | 47 | // invoke OnUserFormDelete event |
| 48 | 48 | $modx->invokeEvent("OnUserFormDelete", |
| 49 | - array( |
|
| 50 | - "id" => $id |
|
| 51 | - )); |
|
| 49 | + array( |
|
| 50 | + "id" => $id |
|
| 51 | + )); |
|
| 52 | 52 | |
| 53 | 53 | $header="Location: index.php?a=75"; |
| 54 | 54 | header($header); |
@@ -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->db->insert( |
| 22 | - array( |
|
| 23 | - 'name'=>'', |
|
| 24 | - 'description'=>'', |
|
| 25 | - 'snippet'=>'', |
|
| 26 | - 'properties'=>'', |
|
| 27 | - 'category'=>'', |
|
| 28 | - ), $modx->getFullTableName('site_snippets'), // Insert into |
|
| 29 | - "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, snippet, properties, category", $modx->getFullTableName('site_snippets'), "id='{$id}'"); // Copy from |
|
| 22 | + array( |
|
| 23 | + 'name'=>'', |
|
| 24 | + 'description'=>'', |
|
| 25 | + 'snippet'=>'', |
|
| 26 | + 'properties'=>'', |
|
| 27 | + 'category'=>'', |
|
| 28 | + ), $modx->getFullTableName('site_snippets'), // Insert into |
|
| 29 | + "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, snippet, properties, category", $modx->getFullTableName('site_snippets'), "id='{$id}'"); // Copy from |
|
| 30 | 30 | |
| 31 | 31 | // Set the item name for logger |
| 32 | 32 | $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_snippets'), "id='{$newid}'")); |
@@ -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('save_document')||!$modx->hasPermission('publish_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 ********/ |
@@ -33,20 +33,20 @@ discard block |
||
| 33 | 33 | $udperms->role = $_SESSION['mgrRole']; |
| 34 | 34 | |
| 35 | 35 | if(!$udperms->checkPermissions()) { |
| 36 | - $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
| 36 | + $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | // update the document |
| 40 | 40 | $modx->db->update( |
| 41 | - array( |
|
| 42 | - 'published' => 0, |
|
| 43 | - 'pub_date' => 0, |
|
| 44 | - 'unpub_date' => 0, |
|
| 45 | - 'editedby' => $modx->getLoginUserID(), |
|
| 46 | - 'editedon' => time(), |
|
| 47 | - 'publishedby' => 0, |
|
| 48 | - 'publishedon' => 0, |
|
| 49 | - ), $modx->getFullTableName('site_content'), "id='{$id}'"); |
|
| 41 | + array( |
|
| 42 | + 'published' => 0, |
|
| 43 | + 'pub_date' => 0, |
|
| 44 | + 'unpub_date' => 0, |
|
| 45 | + 'editedby' => $modx->getLoginUserID(), |
|
| 46 | + 'editedon' => time(), |
|
| 47 | + 'publishedby' => 0, |
|
| 48 | + 'publishedon' => 0, |
|
| 49 | + ), $modx->getFullTableName('site_content'), "id='{$id}'"); |
|
| 50 | 50 | |
| 51 | 51 | // invoke OnDocUnPublished event |
| 52 | 52 | $modx->invokeEvent("OnDocUnPublished",array("docid"=>$id)); |
@@ -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_module')) { |
| 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 | // Set the item name for logger |
@@ -17,9 +17,9 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | // invoke OnBeforeModFormDelete event |
| 19 | 19 | $modx->invokeEvent("OnBeforeModFormDelete", |
| 20 | - array( |
|
| 21 | - "id" => $id |
|
| 22 | - )); |
|
| 20 | + array( |
|
| 21 | + "id" => $id |
|
| 22 | + )); |
|
| 23 | 23 | |
| 24 | 24 | // delete the module. |
| 25 | 25 | $modx->db->delete($modx->getFullTableName('site_modules'), "id='{$id}'"); |
@@ -32,9 +32,9 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | // invoke OnModFormDelete event |
| 34 | 34 | $modx->invokeEvent("OnModFormDelete", |
| 35 | - array( |
|
| 36 | - "id" => $id |
|
| 37 | - )); |
|
| 35 | + array( |
|
| 36 | + "id" => $id |
|
| 37 | + )); |
|
| 38 | 38 | |
| 39 | 39 | // empty cache |
| 40 | 40 | $modx->clearCache('full'); |
@@ -170,70 +170,70 @@ |
||
| 170 | 170 | array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false |
| 171 | 171 | ); |
| 172 | 172 | } |
| 173 | - if ((int)$params['shareparams'] || !empty($params['dependencies'])) { |
|
| 174 | - $dependencies = explode(',', $params['dependencies']); |
|
| 175 | - foreach ($dependencies as $dependency) { |
|
| 176 | - $dependency = explode(':', $dependency); |
|
| 177 | - switch (trim($dependency[0])) { |
|
| 178 | - case 'template': |
|
| 179 | - $mdp[] = array( |
|
| 180 | - 'module' => $params['name'], |
|
| 181 | - 'table' => 'templates', |
|
| 182 | - 'column' => 'templatename', |
|
| 183 | - 'type' => 50, |
|
| 184 | - 'name' => trim($dependency[1]) |
|
| 185 | - ); |
|
| 186 | - break; |
|
| 187 | - case 'tv': |
|
| 188 | - case 'tmplvar': |
|
| 189 | - $mdp[] = array( |
|
| 190 | - 'module' => $params['name'], |
|
| 191 | - 'table' => 'tmplvars', |
|
| 192 | - 'column' => 'name', |
|
| 193 | - 'type' => 60, |
|
| 194 | - 'name' => trim($dependency[1]) |
|
| 195 | - ); |
|
| 196 | - break; |
|
| 197 | - case 'chunk': |
|
| 198 | - case 'htmlsnippet': |
|
| 199 | - $mdp[] = array( |
|
| 200 | - 'module' => $params['name'], |
|
| 201 | - 'table' => 'htmlsnippets', |
|
| 202 | - 'column' => 'name', |
|
| 203 | - 'type' => 10, |
|
| 204 | - 'name' => trim($dependency[1]) |
|
| 205 | - ); |
|
| 206 | - break; |
|
| 207 | - case 'snippet': |
|
| 208 | - $mdp[] = array( |
|
| 209 | - 'module' => $params['name'], |
|
| 210 | - 'table' => 'snippets', |
|
| 211 | - 'column' => 'name', |
|
| 212 | - 'type' => 40, |
|
| 213 | - 'name' => trim($dependency[1]) |
|
| 214 | - ); |
|
| 215 | - break; |
|
| 216 | - case 'plugin': |
|
| 217 | - $mdp[] = array( |
|
| 218 | - 'module' => $params['name'], |
|
| 219 | - 'table' => 'plugins', |
|
| 220 | - 'column' => 'name', |
|
| 221 | - 'type' => 30, |
|
| 222 | - 'name' => trim($dependency[1]) |
|
| 223 | - ); |
|
| 224 | - break; |
|
| 225 | - case 'resource': |
|
| 226 | - $mdp[] = array( |
|
| 227 | - 'module' => $params['name'], |
|
| 228 | - 'table' => 'content', |
|
| 229 | - 'column' => 'pagetitle', |
|
| 230 | - 'type' => 20, |
|
| 231 | - 'name' => trim($dependency[1]) |
|
| 232 | - ); |
|
| 233 | - break; |
|
| 234 | - } |
|
| 235 | - } |
|
| 236 | - } |
|
| 173 | + if ((int)$params['shareparams'] || !empty($params['dependencies'])) { |
|
| 174 | + $dependencies = explode(',', $params['dependencies']); |
|
| 175 | + foreach ($dependencies as $dependency) { |
|
| 176 | + $dependency = explode(':', $dependency); |
|
| 177 | + switch (trim($dependency[0])) { |
|
| 178 | + case 'template': |
|
| 179 | + $mdp[] = array( |
|
| 180 | + 'module' => $params['name'], |
|
| 181 | + 'table' => 'templates', |
|
| 182 | + 'column' => 'templatename', |
|
| 183 | + 'type' => 50, |
|
| 184 | + 'name' => trim($dependency[1]) |
|
| 185 | + ); |
|
| 186 | + break; |
|
| 187 | + case 'tv': |
|
| 188 | + case 'tmplvar': |
|
| 189 | + $mdp[] = array( |
|
| 190 | + 'module' => $params['name'], |
|
| 191 | + 'table' => 'tmplvars', |
|
| 192 | + 'column' => 'name', |
|
| 193 | + 'type' => 60, |
|
| 194 | + 'name' => trim($dependency[1]) |
|
| 195 | + ); |
|
| 196 | + break; |
|
| 197 | + case 'chunk': |
|
| 198 | + case 'htmlsnippet': |
|
| 199 | + $mdp[] = array( |
|
| 200 | + 'module' => $params['name'], |
|
| 201 | + 'table' => 'htmlsnippets', |
|
| 202 | + 'column' => 'name', |
|
| 203 | + 'type' => 10, |
|
| 204 | + 'name' => trim($dependency[1]) |
|
| 205 | + ); |
|
| 206 | + break; |
|
| 207 | + case 'snippet': |
|
| 208 | + $mdp[] = array( |
|
| 209 | + 'module' => $params['name'], |
|
| 210 | + 'table' => 'snippets', |
|
| 211 | + 'column' => 'name', |
|
| 212 | + 'type' => 40, |
|
| 213 | + 'name' => trim($dependency[1]) |
|
| 214 | + ); |
|
| 215 | + break; |
|
| 216 | + case 'plugin': |
|
| 217 | + $mdp[] = array( |
|
| 218 | + 'module' => $params['name'], |
|
| 219 | + 'table' => 'plugins', |
|
| 220 | + 'column' => 'name', |
|
| 221 | + 'type' => 30, |
|
| 222 | + 'name' => trim($dependency[1]) |
|
| 223 | + ); |
|
| 224 | + break; |
|
| 225 | + case 'resource': |
|
| 226 | + $mdp[] = array( |
|
| 227 | + 'module' => $params['name'], |
|
| 228 | + 'table' => 'content', |
|
| 229 | + 'column' => 'pagetitle', |
|
| 230 | + 'type' => 20, |
|
| 231 | + 'name' => trim($dependency[1]) |
|
| 232 | + ); |
|
| 233 | + break; |
|
| 234 | + } |
|
| 235 | + } |
|
| 236 | + } |
|
| 237 | 237 | } |
| 238 | 238 | $d->close(); |
| 239 | 239 | } |
@@ -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->manager->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->manager->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->db->select('*', $tbl_site_tmplvars, "id='{$id}'"); |
|
| 34 | - $content = $modx->db->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->db->select('*', $tbl_site_tmplvars, "id='{$id}'"); |
|
| 34 | + $content = $modx->db->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->manager->hasFormValues()) { |
| 51 | - $modx->manager->loadFormValues(); |
|
| 51 | + $modx->manager->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->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->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->db->select(sprintf("tpl.id AS id, templatename, tpl.description AS tpldescription, tpl.locked AS tpllocked, tpl.selectable AS selectable, tmplvarid, if(isnull(cat.category),'%s',cat.category) AS category, cat.id AS catid", $_lang['no_category']), sprintf("%s as tpl |
|
| 458 | + $rs = $modx->db->select(sprintf("tpl.id AS id, templatename, tpl.description AS tpldescription, tpl.locked AS tpllocked, tpl.selectable AS selectable, tmplvarid, if(isnull(cat.category),'%s',cat.category) AS category, cat.id AS catid", $_lang['no_category']), sprintf("%s as tpl |
|
| 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->getFullTableName('site_templates'), $modx->getFullTableName('site_tmplvar_templates'), $id, $modx->getFullTableName('categories')), '', "category, templatename"); |
| 461 | 461 | |
| 462 | - $tplList = '<ul>'; |
|
| 463 | - $preCat = ''; |
|
| 464 | - $insideUl = 0; |
|
| 465 | - while($row = $modx->db->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->manager->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->db->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->manager->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->db->select('documentgroup', $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); |
|
| 512 | - $groupsarray = $modx->db->getColumn('documentgroup', $rs); |
|
| 509 | + if($use_udperms == 1) { |
|
| 510 | + // fetch permissions for the variable |
|
| 511 | + $rs = $modx->db->select('documentgroup', $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); |
|
| 512 | + $groupsarray = $modx->db->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->db->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->db->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->db->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->db->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> |