@@ -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 ********/ |
@@ -32,20 +32,20 @@ discard block |
||
32 | 32 | $udperms->role = $_SESSION['mgrRole']; |
33 | 33 | |
34 | 34 | if(!$udperms->checkPermissions()) { |
35 | - $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
35 | + $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | // update the document |
39 | 39 | $modx->getDatabase()->update( |
40 | - array( |
|
41 | - 'published' => 1, |
|
42 | - 'pub_date' => 0, |
|
43 | - 'unpub_date' => 0, |
|
44 | - 'editedby' => $modx->getLoginUserID(), |
|
45 | - 'editedon' => time(), |
|
46 | - 'publishedby' => $modx->getLoginUserID(), |
|
47 | - 'publishedon' => time(), |
|
48 | - ), $modx->getDatabase()->getFullTableName('site_content'), "id='{$id}'"); |
|
40 | + array( |
|
41 | + 'published' => 1, |
|
42 | + 'pub_date' => 0, |
|
43 | + 'unpub_date' => 0, |
|
44 | + 'editedby' => $modx->getLoginUserID(), |
|
45 | + 'editedon' => time(), |
|
46 | + 'publishedby' => $modx->getLoginUserID(), |
|
47 | + 'publishedon' => time(), |
|
48 | + ), $modx->getDatabase()->getFullTableName('site_content'), "id='{$id}'"); |
|
49 | 49 | |
50 | 50 | // invoke OnDocPublished event |
51 | 51 | $modx->invokeEvent("OnDocPublished",array("docid"=>$id)); |
@@ -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('save_document')||!$modx->hasPermission('publish_document')) { |
|
5 | +if (!$modx->hasPermission('save_document') || !$modx->hasPermission('publish_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 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $udperms->document = $id; |
32 | 32 | $udperms->role = $_SESSION['mgrRole']; |
33 | 33 | |
34 | -if(!$udperms->checkPermissions()) { |
|
34 | +if (!$udperms->checkPermissions()) { |
|
35 | 35 | $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
36 | 36 | } |
37 | 37 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | ), $modx->getDatabase()->getFullTableName('site_content'), "id='{$id}'"); |
49 | 49 | |
50 | 50 | // invoke OnDocPublished event |
51 | -$modx->invokeEvent("OnDocPublished",array("docid"=>$id)); |
|
51 | +$modx->invokeEvent("OnDocPublished", array("docid"=>$id)); |
|
52 | 52 | |
53 | 53 | // Set the item name for logger |
54 | 54 | $_SESSION['itemname'] = $content['pagetitle']; |
@@ -56,6 +56,6 @@ discard block |
||
56 | 56 | // empty cache |
57 | 57 | $modx->clearCache('full'); |
58 | 58 | |
59 | -$header="Location: index.php?a=3&id=$pid&r=1".$add_path; |
|
59 | +$header = "Location: index.php?a=3&id=$pid&r=1".$add_path; |
|
60 | 60 | |
61 | 61 | header($header); |
@@ -1,22 +1,22 @@ 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('delete_template')) { |
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 template, but first check it doesn't have any documents using it |
15 | 15 | $rs = $modx->getDatabase()->select('id, pagetitle,introtext', $modx->getDatabase()->getFullTableName('site_content'), "template='{$id}' AND deleted=0"); |
16 | 16 | $limit = $modx->getDatabase()->getRecordCount($rs); |
17 | 17 | if($limit > 0) { |
18 | - include "header.inc.php"; |
|
19 | - ?> |
|
18 | + include "header.inc.php"; |
|
19 | + ?> |
|
20 | 20 | |
21 | 21 | <h1><?php echo $_lang['manage_templates']; ?></h1> |
22 | 22 | |
@@ -28,20 +28,20 @@ discard block |
||
28 | 28 | <p>Documents using this template:</p> |
29 | 29 | <ul> |
30 | 30 | <?php |
31 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
32 | - echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['introtext'] != '' ? ' - ' . $row['introtext'] : '') . '</li>'; |
|
33 | - } |
|
34 | - ?> |
|
31 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
32 | + echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['introtext'] != '' ? ' - ' . $row['introtext'] : '') . '</li>'; |
|
33 | + } |
|
34 | + ?> |
|
35 | 35 | </ul> |
36 | 36 | </div> |
37 | 37 | </div> |
38 | 38 | <?php |
39 | - include_once "footer.inc.php"; |
|
40 | - exit; |
|
39 | + include_once "footer.inc.php"; |
|
40 | + exit; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | if($id == $default_template) { |
44 | - $modx->webAlertAndQuit("This template is set as the default template. Please choose a different default template in the MODX configuration before deleting this template."); |
|
44 | + $modx->webAlertAndQuit("This template is set as the default template. Please choose a different default template in the MODX configuration before deleting this template."); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | // Set the item name for logger |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | |
51 | 51 | // invoke OnBeforeTempFormDelete event |
52 | 52 | $modx->invokeEvent("OnBeforeTempFormDelete", array( |
53 | - "id" => $id |
|
54 | - )); |
|
53 | + "id" => $id |
|
54 | + )); |
|
55 | 55 | |
56 | 56 | // delete the document. |
57 | 57 | $modx->getDatabase()->delete($modx->getDatabase()->getFullTableName('site_templates'), "id='{$id}'"); |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | |
61 | 61 | // invoke OnTempFormDelete event |
62 | 62 | $modx->invokeEvent("OnTempFormDelete", array( |
63 | - "id" => $id |
|
64 | - )); |
|
63 | + "id" => $id |
|
64 | + )); |
|
65 | 65 | |
66 | 66 | // empty cache |
67 | 67 | $modx->clearCache('full'); |
@@ -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('delete_template')) { |
|
5 | +if (!$modx->hasPermission('delete_template')) { |
|
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 | // delete the template, but first check it doesn't have any documents using it |
15 | 15 | $rs = $modx->getDatabase()->select('id, pagetitle,introtext', $modx->getDatabase()->getFullTableName('site_content'), "template='{$id}' AND deleted=0"); |
16 | 16 | $limit = $modx->getDatabase()->getRecordCount($rs); |
17 | -if($limit > 0) { |
|
17 | +if ($limit > 0) { |
|
18 | 18 | include "header.inc.php"; |
19 | 19 | ?> |
20 | 20 | |
@@ -28,8 +28,8 @@ discard block |
||
28 | 28 | <p>Documents using this template:</p> |
29 | 29 | <ul> |
30 | 30 | <?php |
31 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
32 | - echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['introtext'] != '' ? ' - ' . $row['introtext'] : '') . '</li>'; |
|
31 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
32 | + echo '<li><span style="width: 200px"><a href="index.php?id='.$row['id'].'&a=27">'.$row['pagetitle'].'</a></span>'.($row['introtext'] != '' ? ' - '.$row['introtext'] : '').'</li>'; |
|
33 | 33 | } |
34 | 34 | ?> |
35 | 35 | </ul> |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | exit; |
41 | 41 | } |
42 | 42 | |
43 | -if($id == $default_template) { |
|
43 | +if ($id == $default_template) { |
|
44 | 44 | $modx->webAlertAndQuit("This template is set as the default template. Please choose a different default template in the MODX configuration before deleting this template."); |
45 | 45 | } |
46 | 46 |
@@ -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('messages')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | $sendto = $_REQUEST['sendto']; |
@@ -16,55 +16,55 @@ discard block |
||
16 | 16 | $postdate = time(); |
17 | 17 | |
18 | 18 | if($sendto=='u') { |
19 | - if($userid==0) { |
|
20 | - $modx->webAlertAndQuit($_lang["error_no_user_selected"]); |
|
21 | - } |
|
22 | - $modx->getDatabase()->insert( |
|
23 | - array( |
|
24 | - 'recipient' => $userid, |
|
25 | - 'sender' => $modx->getLoginUserID(), |
|
26 | - 'subject' => $subject, |
|
27 | - 'message' => $message, |
|
28 | - 'postdate' => $postdate, |
|
29 | - 'type' => 'Message', |
|
30 | - 'private' => 1, |
|
31 | - ), $modx->getDatabase()->getFullTableName('user_messages')); |
|
19 | + if($userid==0) { |
|
20 | + $modx->webAlertAndQuit($_lang["error_no_user_selected"]); |
|
21 | + } |
|
22 | + $modx->getDatabase()->insert( |
|
23 | + array( |
|
24 | + 'recipient' => $userid, |
|
25 | + 'sender' => $modx->getLoginUserID(), |
|
26 | + 'subject' => $subject, |
|
27 | + 'message' => $message, |
|
28 | + 'postdate' => $postdate, |
|
29 | + 'type' => 'Message', |
|
30 | + 'private' => 1, |
|
31 | + ), $modx->getDatabase()->getFullTableName('user_messages')); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | if($sendto=='g') { |
35 | - if($groupid==0) { |
|
36 | - $modx->webAlertAndQuit($_lang["error_no_group_selected"]); |
|
37 | - } |
|
38 | - $rs = $modx->getDatabase()->select('internalKey', $modx->getDatabase()->getFullTableName('user_attributes'), "role='{$groupid}' AND internalKey!='".$modx->getLoginUserID()."'"); |
|
39 | - while ($row=$modx->getDatabase()->getRow($rs)) { |
|
40 | - $modx->getDatabase()->insert( |
|
41 | - array( |
|
42 | - 'recipient' => $row['internalKey'], |
|
43 | - 'sender' => $modx->getLoginUserID(), |
|
44 | - 'subject' => $subject, |
|
45 | - 'message' => $message, |
|
46 | - 'postdate' => $postdate, |
|
47 | - 'type' => 'Message', |
|
48 | - 'private' => 0, |
|
49 | - ), $modx->getDatabase()->getFullTableName('user_messages')); |
|
50 | - } |
|
35 | + if($groupid==0) { |
|
36 | + $modx->webAlertAndQuit($_lang["error_no_group_selected"]); |
|
37 | + } |
|
38 | + $rs = $modx->getDatabase()->select('internalKey', $modx->getDatabase()->getFullTableName('user_attributes'), "role='{$groupid}' AND internalKey!='".$modx->getLoginUserID()."'"); |
|
39 | + while ($row=$modx->getDatabase()->getRow($rs)) { |
|
40 | + $modx->getDatabase()->insert( |
|
41 | + array( |
|
42 | + 'recipient' => $row['internalKey'], |
|
43 | + 'sender' => $modx->getLoginUserID(), |
|
44 | + 'subject' => $subject, |
|
45 | + 'message' => $message, |
|
46 | + 'postdate' => $postdate, |
|
47 | + 'type' => 'Message', |
|
48 | + 'private' => 0, |
|
49 | + ), $modx->getDatabase()->getFullTableName('user_messages')); |
|
50 | + } |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | |
54 | 54 | if($sendto=='a') { |
55 | - $rs = $modx->getDatabase()->select('id', $modx->getDatabase()->getFullTableName('manager_users'), "id!='".$modx->getLoginUserID()."'"); |
|
56 | - while ($row=$modx->getDatabase()->getRow($rs)) { |
|
57 | - $modx->getDatabase()->insert( |
|
58 | - array( |
|
59 | - 'recipient' => $row['id'], |
|
60 | - 'sender' => $modx->getLoginUserID(), |
|
61 | - 'subject' => $subject, |
|
62 | - 'message' => $message, |
|
63 | - 'postdate' => $postdate, |
|
64 | - 'type' => 'Message', |
|
65 | - 'private' => 0, |
|
66 | - ), $modx->getDatabase()->getFullTableName('user_messages')); |
|
67 | - } |
|
55 | + $rs = $modx->getDatabase()->select('id', $modx->getDatabase()->getFullTableName('manager_users'), "id!='".$modx->getLoginUserID()."'"); |
|
56 | + while ($row=$modx->getDatabase()->getRow($rs)) { |
|
57 | + $modx->getDatabase()->insert( |
|
58 | + array( |
|
59 | + 'recipient' => $row['id'], |
|
60 | + 'sender' => $modx->getLoginUserID(), |
|
61 | + 'subject' => $subject, |
|
62 | + 'message' => $message, |
|
63 | + 'postdate' => $postdate, |
|
64 | + 'type' => 'Message', |
|
65 | + 'private' => 0, |
|
66 | + ), $modx->getDatabase()->getFullTableName('user_messages')); |
|
67 | + } |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $header = "Location: index.php?a=10"; |
@@ -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('messages')) { |
|
5 | +if (!$modx->hasPermission('messages')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -10,13 +10,13 @@ discard block |
||
10 | 10 | $userid = $_REQUEST['user']; |
11 | 11 | $groupid = $_REQUEST['group']; |
12 | 12 | $subject = $modx->getDatabase()->escape($_REQUEST['messagesubject']); |
13 | -if($subject=="") $subject="(no subject)"; |
|
13 | +if ($subject == "") $subject = "(no subject)"; |
|
14 | 14 | $message = $modx->getDatabase()->escape($_REQUEST['messagebody']); |
15 | -if($message=="") $message="(no message)"; |
|
15 | +if ($message == "") $message = "(no message)"; |
|
16 | 16 | $postdate = time(); |
17 | 17 | |
18 | -if($sendto=='u') { |
|
19 | - if($userid==0) { |
|
18 | +if ($sendto == 'u') { |
|
19 | + if ($userid == 0) { |
|
20 | 20 | $modx->webAlertAndQuit($_lang["error_no_user_selected"]); |
21 | 21 | } |
22 | 22 | $modx->getDatabase()->insert( |
@@ -31,12 +31,12 @@ discard block |
||
31 | 31 | ), $modx->getDatabase()->getFullTableName('user_messages')); |
32 | 32 | } |
33 | 33 | |
34 | -if($sendto=='g') { |
|
35 | - if($groupid==0) { |
|
34 | +if ($sendto == 'g') { |
|
35 | + if ($groupid == 0) { |
|
36 | 36 | $modx->webAlertAndQuit($_lang["error_no_group_selected"]); |
37 | 37 | } |
38 | 38 | $rs = $modx->getDatabase()->select('internalKey', $modx->getDatabase()->getFullTableName('user_attributes'), "role='{$groupid}' AND internalKey!='".$modx->getLoginUserID()."'"); |
39 | - while ($row=$modx->getDatabase()->getRow($rs)) { |
|
39 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
40 | 40 | $modx->getDatabase()->insert( |
41 | 41 | array( |
42 | 42 | 'recipient' => $row['internalKey'], |
@@ -51,9 +51,9 @@ discard block |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | |
54 | -if($sendto=='a') { |
|
54 | +if ($sendto == 'a') { |
|
55 | 55 | $rs = $modx->getDatabase()->select('id', $modx->getDatabase()->getFullTableName('manager_users'), "id!='".$modx->getLoginUserID()."'"); |
56 | - while ($row=$modx->getDatabase()->getRow($rs)) { |
|
56 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
57 | 57 | $modx->getDatabase()->insert( |
58 | 58 | array( |
59 | 59 | 'recipient' => $row['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('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 ********/ |
@@ -32,20 +32,20 @@ discard block |
||
32 | 32 | $udperms->role = $_SESSION['mgrRole']; |
33 | 33 | |
34 | 34 | if(!$udperms->checkPermissions()) { |
35 | - $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
35 | + $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | // update the document |
39 | 39 | $modx->getDatabase()->update( |
40 | - array( |
|
41 | - 'published' => 0, |
|
42 | - 'pub_date' => 0, |
|
43 | - 'unpub_date' => 0, |
|
44 | - 'editedby' => $modx->getLoginUserID(), |
|
45 | - 'editedon' => time(), |
|
46 | - 'publishedby' => 0, |
|
47 | - 'publishedon' => 0, |
|
48 | - ), $modx->getDatabase()->getFullTableName('site_content'), "id='{$id}'"); |
|
40 | + array( |
|
41 | + 'published' => 0, |
|
42 | + 'pub_date' => 0, |
|
43 | + 'unpub_date' => 0, |
|
44 | + 'editedby' => $modx->getLoginUserID(), |
|
45 | + 'editedon' => time(), |
|
46 | + 'publishedby' => 0, |
|
47 | + 'publishedon' => 0, |
|
48 | + ), $modx->getDatabase()->getFullTableName('site_content'), "id='{$id}'"); |
|
49 | 49 | |
50 | 50 | // invoke OnDocUnPublished event |
51 | 51 | $modx->invokeEvent("OnDocUnPublished",array("docid"=>$id)); |
@@ -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('save_document')||!$modx->hasPermission('publish_document')) { |
|
5 | +if (!$modx->hasPermission('save_document') || !$modx->hasPermission('publish_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 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $udperms->document = $id; |
32 | 32 | $udperms->role = $_SESSION['mgrRole']; |
33 | 33 | |
34 | -if(!$udperms->checkPermissions()) { |
|
34 | +if (!$udperms->checkPermissions()) { |
|
35 | 35 | $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
36 | 36 | } |
37 | 37 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | ), $modx->getDatabase()->getFullTableName('site_content'), "id='{$id}'"); |
49 | 49 | |
50 | 50 | // invoke OnDocUnPublished event |
51 | -$modx->invokeEvent("OnDocUnPublished",array("docid"=>$id)); |
|
51 | +$modx->invokeEvent("OnDocUnPublished", array("docid"=>$id)); |
|
52 | 52 | |
53 | 53 | // Set the item name for logger |
54 | 54 | $_SESSION['itemname'] = $content['pagetitle']; |
@@ -56,6 +56,6 @@ discard block |
||
56 | 56 | // empty cache |
57 | 57 | $modx->clearCache('full'); |
58 | 58 | |
59 | -$header="Location: index.php?a=3&id=$pid&r=1".$add_path; |
|
59 | +$header = "Location: index.php?a=3&id=$pid&r=1".$add_path; |
|
60 | 60 | |
61 | 61 | 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('delete_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 | // Set the item name for logger |
@@ -17,18 +17,18 @@ discard block |
||
17 | 17 | |
18 | 18 | // invoke OnBeforeChunkFormDelete event |
19 | 19 | $modx->invokeEvent("OnBeforeChunkFormDelete", |
20 | - array( |
|
21 | - "id" => $id |
|
22 | - )); |
|
20 | + array( |
|
21 | + "id" => $id |
|
22 | + )); |
|
23 | 23 | |
24 | 24 | // delete the chunk. |
25 | 25 | $modx->getDatabase()->delete($modx->getDatabase()->getFullTableName('site_htmlsnippets'), "id='{$id}'"); |
26 | 26 | |
27 | 27 | // invoke OnChunkFormDelete event |
28 | 28 | $modx->invokeEvent("OnChunkFormDelete", |
29 | - array( |
|
30 | - "id" => $id |
|
31 | - )); |
|
29 | + array( |
|
30 | + "id" => $id |
|
31 | + )); |
|
32 | 32 | |
33 | 33 | // empty cache |
34 | 34 | $modx->clearCache('full'); |
@@ -1,13 +1,13 @@ 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('messages')) { |
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 | |
@@ -18,12 +18,12 @@ discard block |
||
18 | 18 | $modx->webAlertAndQuit("Wrong number of messages returned!"); |
19 | 19 | } |
20 | 20 | |
21 | -if ($message['recipient']!=$modx->getLoginUserID()) { |
|
21 | +if ($message['recipient'] != $modx->getLoginUserID()) { |
|
22 | 22 | $modx->webAlertAndQuit("You are not allowed to delete this message!"); |
23 | 23 | } |
24 | 24 | |
25 | 25 | // delete message |
26 | 26 | $modx->getDatabase()->delete($modx->getDatabase()->getFullTableName('user_messages'), "id='{$id}'"); |
27 | 27 | |
28 | -$header="Location: index.php?a=10"; |
|
28 | +$header = "Location: index.php?a=10"; |
|
29 | 29 | 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('edit_template')) { |
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,37 +19,37 @@ discard block |
||
19 | 19 | |
20 | 20 | // duplicate TV |
21 | 21 | $newid = $modx->getDatabase()->insert( |
22 | - array( |
|
23 | - 'type'=>'', |
|
24 | - 'name'=>'', |
|
25 | - 'caption'=>'', |
|
26 | - 'description'=>'', |
|
27 | - 'default_text'=>'', |
|
28 | - 'elements'=>'', |
|
29 | - 'rank'=>'', |
|
30 | - 'display'=>'', |
|
31 | - 'display_params'=>'', |
|
32 | - 'category'=>'', |
|
33 | - ), $modx->getDatabase()->getFullTableName('site_tmplvars'), // Insert into |
|
34 | - "type, CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, CONCAT(caption, ' Duplicate{$count}') AS caption, description, default_text, elements, rank, display, display_params, category", $modx->getDatabase()->getFullTableName('site_tmplvars'), "id='{$id}'"); // Copy from |
|
22 | + array( |
|
23 | + 'type'=>'', |
|
24 | + 'name'=>'', |
|
25 | + 'caption'=>'', |
|
26 | + 'description'=>'', |
|
27 | + 'default_text'=>'', |
|
28 | + 'elements'=>'', |
|
29 | + 'rank'=>'', |
|
30 | + 'display'=>'', |
|
31 | + 'display_params'=>'', |
|
32 | + 'category'=>'', |
|
33 | + ), $modx->getDatabase()->getFullTableName('site_tmplvars'), // Insert into |
|
34 | + "type, CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, CONCAT(caption, ' Duplicate{$count}') AS caption, description, default_text, elements, rank, display, display_params, category", $modx->getDatabase()->getFullTableName('site_tmplvars'), "id='{$id}'"); // Copy from |
|
35 | 35 | |
36 | 36 | |
37 | 37 | // duplicate TV Template Access Permissions |
38 | 38 | $modx->getDatabase()->insert( |
39 | - array( |
|
40 | - 'tmplvarid'=>'', |
|
41 | - 'templateid'=>'', |
|
42 | - 'rank'=>'', |
|
43 | - ), $modx->getDatabase()->getFullTableName('site_tmplvar_templates'), // Insert into |
|
44 | - "'{$newid}', templateid, rank", $modx->getDatabase()->getFullTableName('site_tmplvar_templates'), "tmplvarid='{$id}'"); // Copy from |
|
39 | + array( |
|
40 | + 'tmplvarid'=>'', |
|
41 | + 'templateid'=>'', |
|
42 | + 'rank'=>'', |
|
43 | + ), $modx->getDatabase()->getFullTableName('site_tmplvar_templates'), // Insert into |
|
44 | + "'{$newid}', templateid, rank", $modx->getDatabase()->getFullTableName('site_tmplvar_templates'), "tmplvarid='{$id}'"); // Copy from |
|
45 | 45 | |
46 | 46 | // duplicate TV Access Permissions |
47 | 47 | $modx->getDatabase()->insert( |
48 | - array( |
|
49 | - 'tmplvarid'=>'', |
|
50 | - 'documentgroup'=>'', |
|
51 | - ), $modx->getDatabase()->getFullTableName('site_tmplvar_access'), // Insert into |
|
52 | - "'{$newid}', documentgroup", $modx->getDatabase()->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); // Copy from |
|
48 | + array( |
|
49 | + 'tmplvarid'=>'', |
|
50 | + 'documentgroup'=>'', |
|
51 | + ), $modx->getDatabase()->getFullTableName('site_tmplvar_access'), // Insert into |
|
52 | + "'{$newid}', documentgroup", $modx->getDatabase()->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); // Copy from |
|
53 | 53 | |
54 | 54 | // Set the item name for logger |
55 | 55 | $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_tmplvars'), "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('edit_template')) { |
|
5 | +if (!$modx->hasPermission('edit_template')) { |
|
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_tmplvars'), "id='{$id}'")); |
16 | 16 | $count = $modx->getDatabase()->getRecordCount($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_tmplvars'), "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 TV |
@@ -56,5 +56,5 @@ discard block |
||
56 | 56 | $_SESSION['itemname'] = $name; |
57 | 57 | |
58 | 58 | // finish duplicating - redirect to new variable |
59 | -$header="Location: index.php?r=2&a=301&id=$newid"; |
|
59 | +$header = "Location: index.php?r=2&a=301&id=$newid"; |
|
60 | 60 | header($header); |
@@ -14,8 +14,11 @@ |
||
14 | 14 | // count duplicates |
15 | 15 | $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_tmplvars'), "id='{$id}'")); |
16 | 16 | $count = $modx->getDatabase()->getRecordCount($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_tmplvars'), "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 TV |
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_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 | // Set the item name for logger |
@@ -17,18 +17,18 @@ discard block |
||
17 | 17 | |
18 | 18 | // invoke OnBeforeSnipFormDelete event |
19 | 19 | $modx->invokeEvent("OnBeforeSnipFormDelete", |
20 | - array( |
|
21 | - "id" => $id |
|
22 | - )); |
|
20 | + array( |
|
21 | + "id" => $id |
|
22 | + )); |
|
23 | 23 | |
24 | 24 | // delete the snippet. |
25 | 25 | $modx->getDatabase()->delete($modx->getDatabase()->getFullTableName('site_snippets'), "id='{$id}'"); |
26 | 26 | |
27 | 27 | // invoke OnSnipFormDelete event |
28 | 28 | $modx->invokeEvent("OnSnipFormDelete", |
29 | - array( |
|
30 | - "id" => $id |
|
31 | - )); |
|
29 | + array( |
|
30 | + "id" => $id |
|
31 | + )); |
|
32 | 32 | |
33 | 33 | // empty cache |
34 | 34 | $modx->clearCache('full'); |
@@ -4,23 +4,23 @@ |
||
4 | 4 | } |
5 | 5 | |
6 | 6 | if(!isset($_GET['id'])) { |
7 | - if(!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | + if(!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
8 | 8 | |
9 | - // Remove all locks |
|
10 | - $modx->getDatabase()->truncate($modx->getDatabase()->getFullTableName('active_user_locks')); |
|
9 | + // Remove all locks |
|
10 | + $modx->getDatabase()->truncate($modx->getDatabase()->getFullTableName('active_user_locks')); |
|
11 | 11 | |
12 | - $header = "Location: index.php?a=2"; |
|
13 | - header($header); |
|
12 | + $header = "Location: index.php?a=2"; |
|
13 | + header($header); |
|
14 | 14 | } else { |
15 | - // Remove single locks via AJAX / window.onbeforeunload |
|
16 | - $type = (int)$_GET['type']; |
|
17 | - $id = (int)$_GET['id']; |
|
18 | - $includeAllUsers = $modx->hasPermission('remove_locks'); // Enables usage of "unlock"-ajax-button |
|
19 | - if($type && $id) { |
|
20 | - $modx->unlockElement($type, $id, $includeAllUsers); |
|
21 | - echo '1'; |
|
22 | - exit; |
|
23 | - } else { |
|
24 | - echo 'No type or id sent with request.'; |
|
25 | - } |
|
15 | + // Remove single locks via AJAX / window.onbeforeunload |
|
16 | + $type = (int)$_GET['type']; |
|
17 | + $id = (int)$_GET['id']; |
|
18 | + $includeAllUsers = $modx->hasPermission('remove_locks'); // Enables usage of "unlock"-ajax-button |
|
19 | + if($type && $id) { |
|
20 | + $modx->unlockElement($type, $id, $includeAllUsers); |
|
21 | + echo '1'; |
|
22 | + exit; |
|
23 | + } else { |
|
24 | + echo 'No type or id sent with request.'; |
|
25 | + } |
|
26 | 26 | } |
@@ -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 | |
6 | -if(!isset($_GET['id'])) { |
|
7 | - if(!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | +if (!isset($_GET['id'])) { |
|
7 | + if (!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
8 | 8 | |
9 | 9 | // Remove all locks |
10 | 10 | $modx->getDatabase()->truncate($modx->getDatabase()->getFullTableName('active_user_locks')); |
@@ -13,10 +13,10 @@ discard block |
||
13 | 13 | header($header); |
14 | 14 | } else { |
15 | 15 | // Remove single locks via AJAX / window.onbeforeunload |
16 | - $type = (int)$_GET['type']; |
|
17 | - $id = (int)$_GET['id']; |
|
16 | + $type = (int) $_GET['type']; |
|
17 | + $id = (int) $_GET['id']; |
|
18 | 18 | $includeAllUsers = $modx->hasPermission('remove_locks'); // Enables usage of "unlock"-ajax-button |
19 | - if($type && $id) { |
|
19 | + if ($type && $id) { |
|
20 | 20 | $modx->unlockElement($type, $id, $includeAllUsers); |
21 | 21 | echo '1'; |
22 | 22 | exit; |
@@ -4,7 +4,9 @@ |
||
4 | 4 | } |
5 | 5 | |
6 | 6 | if(!isset($_GET['id'])) { |
7 | - if(!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | + if(!$modx->hasPermission('remove_locks')) { |
|
8 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
9 | + } |
|
8 | 10 | |
9 | 11 | // Remove all locks |
10 | 12 | $modx->getDatabase()->truncate($modx->getDatabase()->getFullTableName('active_user_locks')); |