Completed
Pull Request — develop (#545)
by Agel_Nash
05:36
created
manager/actions/mutate_content.dynamic.php 1 patch
Indentation   +411 added lines, -411 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 
6 6
 /********************/
@@ -12,30 +12,30 @@  discard block
 block discarded – undo
12 12
 
13 13
 // check permissions
14 14
 switch($modx->manager->action) {
15
-	case 27:
16
-		if(!$modx->hasPermission('edit_document')) {
17
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
18
-		}
19
-		break;
20
-	case 85:
21
-	case 72:
22
-	case 4:
23
-		if(!$modx->hasPermission('new_document')) {
24
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
25
-		} elseif(isset($_REQUEST['pid']) && $_REQUEST['pid'] != '0') {
26
-			// check user has permissions for parent
27
-			include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php');
28
-			$udperms = new udperms();
29
-			$udperms->user = $modx->getLoginUserID();
30
-			$udperms->document = empty($_REQUEST['pid']) ? 0 : $_REQUEST['pid'];
31
-			$udperms->role = $_SESSION['mgrRole'];
32
-			if(!$udperms->checkPermissions()) {
33
-				$modx->webAlertAndQuit($_lang["access_permission_denied"]);
34
-			}
35
-		}
36
-		break;
37
-	default:
38
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
+    case 27:
16
+        if(!$modx->hasPermission('edit_document')) {
17
+            $modx->webAlertAndQuit($_lang["error_no_privileges"]);
18
+        }
19
+        break;
20
+    case 85:
21
+    case 72:
22
+    case 4:
23
+        if(!$modx->hasPermission('new_document')) {
24
+            $modx->webAlertAndQuit($_lang["error_no_privileges"]);
25
+        } elseif(isset($_REQUEST['pid']) && $_REQUEST['pid'] != '0') {
26
+            // check user has permissions for parent
27
+            include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php');
28
+            $udperms = new udperms();
29
+            $udperms->user = $modx->getLoginUserID();
30
+            $udperms->document = empty($_REQUEST['pid']) ? 0 : $_REQUEST['pid'];
31
+            $udperms->role = $_SESSION['mgrRole'];
32
+            if(!$udperms->checkPermissions()) {
33
+                $modx->webAlertAndQuit($_lang["access_permission_denied"]);
34
+            }
35
+        }
36
+        break;
37
+    default:
38
+        $modx->webAlertAndQuit($_lang["error_no_privileges"]);
39 39
 }
40 40
 
41 41
 $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
@@ -54,22 +54,22 @@  discard block
 block discarded – undo
54 54
 $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars');
55 55
 
56 56
 if($modx->manager->action == 27) {
57
-	//editing an existing document
58
-	// check permissions on the document
59
-	include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php');
60
-	$udperms = new udperms();
61
-	$udperms->user = $modx->getLoginUserID();
62
-	$udperms->document = $id;
63
-	$udperms->role = $_SESSION['mgrRole'];
64
-
65
-	if(!$udperms->checkPermissions()) {
66
-		$modx->webAlertAndQuit($_lang["access_permission_denied"]);
67
-	}
57
+    //editing an existing document
58
+    // check permissions on the document
59
+    include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php');
60
+    $udperms = new udperms();
61
+    $udperms->user = $modx->getLoginUserID();
62
+    $udperms->document = $id;
63
+    $udperms->role = $_SESSION['mgrRole'];
64
+
65
+    if(!$udperms->checkPermissions()) {
66
+        $modx->webAlertAndQuit($_lang["access_permission_denied"]);
67
+    }
68 68
 }
69 69
 
70 70
 // check to see if resource isn't locked
71 71
 if($lockedEl = $modx->elementIsLocked(7, $id)) {
72
-	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['resource']));
72
+    $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['resource']));
73 73
 }
74 74
 // end check for lock
75 75
 
@@ -78,74 +78,74 @@  discard block
 block discarded – undo
78 78
 
79 79
 // get document groups for current user
80 80
 if($_SESSION['mgrDocgroups']) {
81
-	$docgrp = implode(',', $_SESSION['mgrDocgroups']);
81
+    $docgrp = implode(',', $_SESSION['mgrDocgroups']);
82 82
 }
83 83
 
84 84
 if(!empty ($id)) {
85
-	$access = sprintf("1='%s' OR sc.privatemgr=0", $_SESSION['mgrRole']);
86
-	if($docgrp) {
87
-		$access .= " OR dg.document_group IN ({$docgrp})";
88
-	}
89
-	$rs = $modx->db->select('sc.*', "{$tbl_site_content} AS sc LEFT JOIN {$tbl_document_groups} AS dg ON dg.document=sc.id", "sc.id='{$id}' AND ({$access})");
90
-	$content = array();
91
-	$content = $modx->db->getRow($rs);
92
-	$modx->documentObject = &$content;
93
-	if(!$content) {
94
-		$modx->webAlertAndQuit($_lang["access_permission_denied"]);
95
-	}
96
-	$_SESSION['itemname'] = $content['pagetitle'];
85
+    $access = sprintf("1='%s' OR sc.privatemgr=0", $_SESSION['mgrRole']);
86
+    if($docgrp) {
87
+        $access .= " OR dg.document_group IN ({$docgrp})";
88
+    }
89
+    $rs = $modx->db->select('sc.*', "{$tbl_site_content} AS sc LEFT JOIN {$tbl_document_groups} AS dg ON dg.document=sc.id", "sc.id='{$id}' AND ({$access})");
90
+    $content = array();
91
+    $content = $modx->db->getRow($rs);
92
+    $modx->documentObject = &$content;
93
+    if(!$content) {
94
+        $modx->webAlertAndQuit($_lang["access_permission_denied"]);
95
+    }
96
+    $_SESSION['itemname'] = $content['pagetitle'];
97 97
 } else {
98
-	$content = array();
98
+    $content = array();
99 99
 
100
-	if(isset($_REQUEST['newtemplate'])) {
101
-		$content['template'] = $_REQUEST['newtemplate'];
102
-	} else {
103
-		$content['template'] = getDefaultTemplate();
104
-	}
100
+    if(isset($_REQUEST['newtemplate'])) {
101
+        $content['template'] = $_REQUEST['newtemplate'];
102
+    } else {
103
+        $content['template'] = getDefaultTemplate();
104
+    }
105 105
 
106
-	$_SESSION['itemname'] = $_lang["new_resource"];
106
+    $_SESSION['itemname'] = $_lang["new_resource"];
107 107
 }
108 108
 
109 109
 // restore saved form
110 110
 $formRestored = $modx->manager->loadFormValues();
111 111
 if(isset($_REQUEST['newtemplate'])) {
112
-	$formRestored = true;
112
+    $formRestored = true;
113 113
 }
114 114
 
115 115
 // retain form values if template was changed
116 116
 // edited to convert pub_date and unpub_date
117 117
 // sottwell 02-09-2006
118 118
 if($formRestored == true) {
119
-	$content = array_merge($content, $_POST);
120
-	$content['content'] = $_POST['ta'];
121
-	if(empty ($content['pub_date'])) {
122
-		unset ($content['pub_date']);
123
-	} else {
124
-		$content['pub_date'] = $modx->toTimeStamp($content['pub_date']);
125
-	}
126
-	if(empty ($content['unpub_date'])) {
127
-		unset ($content['unpub_date']);
128
-	} else {
129
-		$content['unpub_date'] = $modx->toTimeStamp($content['unpub_date']);
130
-	}
119
+    $content = array_merge($content, $_POST);
120
+    $content['content'] = $_POST['ta'];
121
+    if(empty ($content['pub_date'])) {
122
+        unset ($content['pub_date']);
123
+    } else {
124
+        $content['pub_date'] = $modx->toTimeStamp($content['pub_date']);
125
+    }
126
+    if(empty ($content['unpub_date'])) {
127
+        unset ($content['unpub_date']);
128
+    } else {
129
+        $content['unpub_date'] = $modx->toTimeStamp($content['unpub_date']);
130
+    }
131 131
 }
132 132
 
133 133
 // increase menu index if this is a new document
134 134
 if(!isset ($_REQUEST['id'])) {
135
-	if(!isset ($modx->config['auto_menuindex'])) {
136
-		$modx->config['auto_menuindex'] = 1;
137
-	}
138
-	if($modx->config['auto_menuindex']) {
139
-		$pid = (int)$_REQUEST['pid'];
140
-		$rs = $modx->db->select('count(*)', $tbl_site_content, "parent='{$pid}'");
141
-		$content['menuindex'] = $modx->db->getValue($rs);
142
-	} else {
143
-		$content['menuindex'] = 0;
144
-	}
135
+    if(!isset ($modx->config['auto_menuindex'])) {
136
+        $modx->config['auto_menuindex'] = 1;
137
+    }
138
+    if($modx->config['auto_menuindex']) {
139
+        $pid = (int)$_REQUEST['pid'];
140
+        $rs = $modx->db->select('count(*)', $tbl_site_content, "parent='{$pid}'");
141
+        $content['menuindex'] = $modx->db->getValue($rs);
142
+    } else {
143
+        $content['menuindex'] = 0;
144
+    }
145 145
 }
146 146
 
147 147
 if(isset ($_POST['which_editor'])) {
148
-	$modx->config['which_editor'] = $_POST['which_editor'];
148
+    $modx->config['which_editor'] = $_POST['which_editor'];
149 149
 }
150 150
 
151 151
 // Add lock-element JS-Script
@@ -545,23 +545,23 @@  discard block
 block discarded – undo
545 545
 
546 546
 	<form name="mutate" id="mutate" class="content" method="post" enctype="multipart/form-data" action="index.php" onsubmit="documentDirty=false;">
547 547
 		<?php
548
-		// invoke OnDocFormPrerender event
549
-		$evtOut = $modx->invokeEvent('OnDocFormPrerender', array(
550
-			'id' => $id,
551
-			'template' => $content['template']
552
-		));
553
-
554
-		if(is_array($evtOut)) {
555
-			echo implode('', $evtOut);
556
-		}
557
-
558
-		/*************************/
559
-		$dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : '';
560
-		$sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : 'createdon';
561
-		$page = isset($_REQUEST['page']) ? (int) $_REQUEST['page'] : '';
562
-		/*************************/
563
-
564
-		?>
548
+        // invoke OnDocFormPrerender event
549
+        $evtOut = $modx->invokeEvent('OnDocFormPrerender', array(
550
+            'id' => $id,
551
+            'template' => $content['template']
552
+        ));
553
+
554
+        if(is_array($evtOut)) {
555
+            echo implode('', $evtOut);
556
+        }
557
+
558
+        /*************************/
559
+        $dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : '';
560
+        $sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : 'createdon';
561
+        $page = isset($_REQUEST['page']) ? (int) $_REQUEST['page'] : '';
562
+        /*************************/
563
+
564
+        ?>
565 565
 		<input type="hidden" name="a" value="5" />
566 566
 		<input type="hidden" name="id" value="<?= $content['id'] ?>" />
567 567
 		<input type="hidden" name="mode" value="<?= $modx->manager->action ?>" />
@@ -576,54 +576,54 @@  discard block
 block discarded – undo
576 576
 
577 577
 			<h1>
578 578
 				<i class="fa fa-pencil-square-o"></i><?php if(isset($_REQUEST['id'])) {
579
-					echo iconv_substr($content['pagetitle'], 0, 50, $modx->config['modx_charset']) . (iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '') . '<small>(' . $_REQUEST['id'] . ')</small>';
580
-				} else {
581
-				    if ($modx->manager->action == '4') {
579
+                    echo iconv_substr($content['pagetitle'], 0, 50, $modx->config['modx_charset']) . (iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '') . '<small>(' . $_REQUEST['id'] . ')</small>';
580
+                } else {
581
+                    if ($modx->manager->action == '4') {
582 582
                         echo $_lang['add_resource'];
583 583
                     } else if ($modx->manager->action == '72') {
584 584
                         echo $_lang['add_weblink'];
585 585
                     } else {
586 586
                         echo $_lang['create_resource_title'];
587 587
                     }
588
-				} ?>
588
+                } ?>
589 589
 			</h1>
590 590
 
591 591
 			<?= $_style['actionbuttons']['dynamic']['document'] ?>
592 592
 
593 593
 			<?php
594
-			// breadcrumbs
595
-			if($modx->config['use_breadcrumbs']) {
596
-				$temp = array();
597
-				$title = isset($content['pagetitle']) ? $content['pagetitle'] : $_lang['create_resource_title'];
598
-
599
-				if(isset($_REQUEST['id']) && $content['parent'] != 0) {
600
-					$bID = (int) $_REQUEST['id'];
601
-					$temp = $modx->getParentIds($bID);
602
-				} else if(isset($_REQUEST['pid'])) {
603
-					$bID = (int) $_REQUEST['pid'];
604
-					$temp = $modx->getParentIds($bID);
605
-					array_unshift($temp, $bID);
606
-				}
607
-
608
-				if($temp) {
609
-					$parents = implode(',', $temp);
610
-
611
-					if(!empty($parents)) {
612
-						$where = "FIND_IN_SET(id,'{$parents}') DESC";
613
-						$rs = $modx->db->select('id, pagetitle', $tbl_site_content, "id IN ({$parents})", $where);
614
-						while($row = $modx->db->getRow($rs)) {
615
-							$out .= '<li class="breadcrumbs__li">
594
+            // breadcrumbs
595
+            if($modx->config['use_breadcrumbs']) {
596
+                $temp = array();
597
+                $title = isset($content['pagetitle']) ? $content['pagetitle'] : $_lang['create_resource_title'];
598
+
599
+                if(isset($_REQUEST['id']) && $content['parent'] != 0) {
600
+                    $bID = (int) $_REQUEST['id'];
601
+                    $temp = $modx->getParentIds($bID);
602
+                } else if(isset($_REQUEST['pid'])) {
603
+                    $bID = (int) $_REQUEST['pid'];
604
+                    $temp = $modx->getParentIds($bID);
605
+                    array_unshift($temp, $bID);
606
+                }
607
+
608
+                if($temp) {
609
+                    $parents = implode(',', $temp);
610
+
611
+                    if(!empty($parents)) {
612
+                        $where = "FIND_IN_SET(id,'{$parents}') DESC";
613
+                        $rs = $modx->db->select('id, pagetitle', $tbl_site_content, "id IN ({$parents})", $where);
614
+                        while($row = $modx->db->getRow($rs)) {
615
+                            $out .= '<li class="breadcrumbs__li">
616 616
                                 <a href="index.php?a=27&id=' . $row['id'] . '" class="breadcrumbs__a">' . htmlspecialchars($row['pagetitle'], ENT_QUOTES, $modx->config['modx_charset']) . '</a>
617 617
                                 <span class="breadcrumbs__sep">&gt;</span>
618 618
                             </li>';
619
-						}
620
-					}
621
-				}
619
+                        }
620
+                    }
621
+                }
622 622
 
623
-				$out .= '<li class="breadcrumbs__li breadcrumbs__li_current">' . $title . '</li>';
624
-				echo '<ul class="breadcrumbs">' . $out . '</ul>';
625
-			}
626
-			?>
623
+                $out .= '<li class="breadcrumbs__li breadcrumbs__li_current">' . $title . '</li>';
624
+                echo '<ul class="breadcrumbs">' . $out . '</ul>';
625
+            }
626
+            ?>
627 627
 
628 628
 			<!-- start main wrapper -->
629 629
 			<div class="sectionBody">
@@ -635,13 +635,13 @@  discard block
 block discarded – undo
635 635
 
636 636
 					<!-- General -->
637 637
 					<?php
638
-					$evtOut = $modx->invokeEvent('OnDocFormTemplateRender', array(
639
-						'id' => $id
640
-					));
641
-					if(is_array($evtOut)) {
642
-						echo implode('', $evtOut);
643
-					} else {
644
-						?>
638
+                    $evtOut = $modx->invokeEvent('OnDocFormTemplateRender', array(
639
+                        'id' => $id
640
+                    ));
641
+                    if(is_array($evtOut)) {
642
+                        echo implode('', $evtOut);
643
+                    } else {
644
+                        ?>
645 645
 						<div class="tab-page" id="tabGeneral">
646 646
 							<h2 class="tab"><?= $_lang['settings_general'] ?></h2>
647 647
 							<script type="text/javascript">tpSettings.addTabPage(document.getElementById("tabGeneral"));</script>
@@ -726,36 +726,36 @@  discard block
 block discarded – undo
726 726
 										<select id="template" name="template" class="inputBox" onchange="templateWarning();">
727 727
 											<option value="0">(blank)</option>
728 728
 											<?php
729
-											$field = "t.templatename, t.selectable, t.id, c.category";
730
-											$from = "{$tbl_site_templates} AS t LEFT JOIN {$tbl_categories} AS c ON t.category = c.id";
731
-											$rs = $modx->db->select($field, $from, '', 'c.category, t.templatename ASC');
732
-											$currentCategory = '';
733
-											while($row = $modx->db->getRow($rs)) {
734
-												if($row['selectable'] != 1 && $row['id'] != $content['template']) {
735
-													continue;
736
-												};
737
-												// Skip if not selectable but show if selected!
738
-												$thisCategory = $row['category'];
739
-												if($thisCategory == null) {
740
-													$thisCategory = $_lang["no_category"];
741
-												}
742
-												if($thisCategory != $currentCategory) {
743
-													if($closeOptGroup) {
744
-														echo "\t\t\t\t\t</optgroup>\n";
745
-													}
746
-													echo "\t\t\t\t\t<optgroup label=\"$thisCategory\">\n";
747
-													$closeOptGroup = true;
748
-												}
729
+                                            $field = "t.templatename, t.selectable, t.id, c.category";
730
+                                            $from = "{$tbl_site_templates} AS t LEFT JOIN {$tbl_categories} AS c ON t.category = c.id";
731
+                                            $rs = $modx->db->select($field, $from, '', 'c.category, t.templatename ASC');
732
+                                            $currentCategory = '';
733
+                                            while($row = $modx->db->getRow($rs)) {
734
+                                                if($row['selectable'] != 1 && $row['id'] != $content['template']) {
735
+                                                    continue;
736
+                                                };
737
+                                                // Skip if not selectable but show if selected!
738
+                                                $thisCategory = $row['category'];
739
+                                                if($thisCategory == null) {
740
+                                                    $thisCategory = $_lang["no_category"];
741
+                                                }
742
+                                                if($thisCategory != $currentCategory) {
743
+                                                    if($closeOptGroup) {
744
+                                                        echo "\t\t\t\t\t</optgroup>\n";
745
+                                                    }
746
+                                                    echo "\t\t\t\t\t<optgroup label=\"$thisCategory\">\n";
747
+                                                    $closeOptGroup = true;
748
+                                                }
749 749
 
750
-												$selectedtext = ($row['id'] == $content['template']) ? ' selected="selected"' : '';
750
+                                                $selectedtext = ($row['id'] == $content['template']) ? ' selected="selected"' : '';
751 751
 
752
-												echo "\t\t\t\t\t" . '<option value="' . $row['id'] . '"' . $selectedtext . '>' . $row['templatename'] . "</option>\n";
753
-												$currentCategory = $thisCategory;
754
-											}
755
-											if($thisCategory != '') {
756
-												echo "\t\t\t\t\t</optgroup>\n";
757
-											}
758
-											?>
752
+                                                echo "\t\t\t\t\t" . '<option value="' . $row['id'] . '"' . $selectedtext . '>' . $row['templatename'] . "</option>\n";
753
+                                                $currentCategory = $thisCategory;
754
+                                            }
755
+                                            if($thisCategory != '') {
756
+                                                echo "\t\t\t\t\t</optgroup>\n";
757
+                                            }
758
+                                            ?>
759 759
 										</select>
760 760
 									</td>
761 761
 								</tr>
@@ -795,37 +795,37 @@  discard block
 block discarded – undo
795 795
 									</td>
796 796
 									<td valign="top">
797 797
 										<?php
798
-										$parentlookup = false;
799
-										if(isset ($_REQUEST['id'])) {
800
-											if($content['parent'] == 0) {
801
-												$parentname = $site_name;
802
-											} else {
803
-												$parentlookup = $content['parent'];
804
-											}
805
-										} elseif(isset ($_REQUEST['pid'])) {
806
-											if($_REQUEST['pid'] == 0) {
807
-												$parentname = $site_name;
808
-											} else {
809
-												$parentlookup = $_REQUEST['pid'];
810
-											}
811
-										} elseif(isset($_POST['parent'])) {
812
-											if($_POST['parent'] == 0) {
813
-												$parentname = $site_name;
814
-											} else {
815
-												$parentlookup = $_POST['parent'];
816
-											}
817
-										} else {
818
-											$parentname = $site_name;
819
-											$content['parent'] = 0;
820
-										}
821
-										if($parentlookup !== false && is_numeric($parentlookup)) {
822
-											$rs = $modx->db->select('pagetitle', $tbl_site_content, "id='{$parentlookup}'");
823
-											$parentname = $modx->db->getValue($rs);
824
-											if(!$parentname) {
825
-												$modx->webAlertAndQuit($_lang["error_no_parent"]);
826
-											}
827
-										}
828
-										?>
798
+                                        $parentlookup = false;
799
+                                        if(isset ($_REQUEST['id'])) {
800
+                                            if($content['parent'] == 0) {
801
+                                                $parentname = $site_name;
802
+                                            } else {
803
+                                                $parentlookup = $content['parent'];
804
+                                            }
805
+                                        } elseif(isset ($_REQUEST['pid'])) {
806
+                                            if($_REQUEST['pid'] == 0) {
807
+                                                $parentname = $site_name;
808
+                                            } else {
809
+                                                $parentlookup = $_REQUEST['pid'];
810
+                                            }
811
+                                        } elseif(isset($_POST['parent'])) {
812
+                                            if($_POST['parent'] == 0) {
813
+                                                $parentname = $site_name;
814
+                                            } else {
815
+                                                $parentlookup = $_POST['parent'];
816
+                                            }
817
+                                        } else {
818
+                                            $parentname = $site_name;
819
+                                            $content['parent'] = 0;
820
+                                        }
821
+                                        if($parentlookup !== false && is_numeric($parentlookup)) {
822
+                                            $rs = $modx->db->select('pagetitle', $tbl_site_content, "id='{$parentlookup}'");
823
+                                            $parentname = $modx->db->getValue($rs);
824
+                                            if(!$parentname) {
825
+                                                $modx->webAlertAndQuit($_lang["error_no_parent"]);
826
+                                            }
827
+                                        }
828
+                                        ?>
829 829
 										<i id="plock" class="<?= $_style["actions_folder"] ?>" onclick="enableParentSelection(!allowParentSelection);"></i>
830 830
 										<b><span id="parentName"><?= (isset($_REQUEST['pid']) ? $_REQUEST['pid'] : $content['parent']) ?> (<?= $parentname ?>)</span></b>
831 831
 										<input type="hidden" name="parent" value="<?= (isset($_REQUEST['pid']) ? $_REQUEST['pid'] : $content['parent']) ?>" onchange="documentDirty=true;" />
@@ -833,7 +833,7 @@  discard block
 block discarded – undo
833 833
 								</tr>
834 834
 								<tr></tr>
835 835
 								<?php
836
-								/*
836
+                                /*
837 837
 								if($content['type'] == 'reference' || $modx->manager->action == '72') {
838 838
 									?>
839 839
 									<tr>
@@ -861,7 +861,7 @@  discard block
 block discarded – undo
861 861
 									</tr>
862 862
 									<?php
863 863
 								}*/
864
-								?>
864
+                                ?>
865 865
 
866 866
 								<?php if($content['type'] == 'document' || $modx->manager->action == '4') { ?>
867 867
 									<tr>
@@ -874,36 +874,36 @@  discard block
 block discarded – undo
874 874
 													<select id="which_editor" class="form-control form-control-sm" size="1" name="which_editor" onchange="changeRTE();">
875 875
 													<option value="none"><?= $_lang['none'] ?></option>
876 876
 														<?php
877
-														// invoke OnRichTextEditorRegister event
878
-														$evtOut = $modx->invokeEvent("OnRichTextEditorRegister");
879
-														if(is_array($evtOut)) {
880
-															for($i = 0; $i < count($evtOut); $i++) {
881
-																$editor = $evtOut[$i];
882
-																echo "\t\t\t", '<option value="', $editor, '"', ($modx->config['which_editor'] == $editor ? ' selected="selected"' : ''), '>', $editor, "</option>\n";
883
-															}
884
-														}
885
-														?>
877
+                                                        // invoke OnRichTextEditorRegister event
878
+                                                        $evtOut = $modx->invokeEvent("OnRichTextEditorRegister");
879
+                                                        if(is_array($evtOut)) {
880
+                                                            for($i = 0; $i < count($evtOut); $i++) {
881
+                                                                $editor = $evtOut[$i];
882
+                                                                echo "\t\t\t", '<option value="', $editor, '"', ($modx->config['which_editor'] == $editor ? ' selected="selected"' : ''), '>', $editor, "</option>\n";
883
+                                                            }
884
+                                                        }
885
+                                                        ?>
886 886
 													</select>
887 887
 												</label>
888 888
 											</div>
889 889
 											<div id="content_body">
890 890
 												<?php
891
-												if(($content['richtext'] == 1 || $modx->manager->action == '4') && $use_editor == 1) {
892
-													$htmlContent = $content['content'];
893
-													?>
891
+                                                if(($content['richtext'] == 1 || $modx->manager->action == '4') && $use_editor == 1) {
892
+                                                    $htmlContent = $content['content'];
893
+                                                    ?>
894 894
 													<div class="section-editor clearfix">
895 895
 														<textarea id="ta" name="ta" onchange="documentDirty=true;"><?= $modx->htmlspecialchars($htmlContent) ?></textarea>
896 896
 													</div>
897 897
 													<?php
898
-													// Richtext-[*content*]
899
-													$richtexteditorIds = array();
900
-													$richtexteditorOptions = array();
901
-													$richtexteditorIds[$modx->config['which_editor']][] = 'ta';
902
-													$richtexteditorOptions[$modx->config['which_editor']]['ta'] = '';
903
-												} else {
904
-													echo "\t" . '<div><textarea class="phptextarea" id="ta" name="ta" rows="20" wrap="soft" onchange="documentDirty=true;">', $modx->htmlspecialchars($content['content']), '</textarea></div>' . "\n";
905
-												}
906
-												?>
898
+                                                    // Richtext-[*content*]
899
+                                                    $richtexteditorIds = array();
900
+                                                    $richtexteditorOptions = array();
901
+                                                    $richtexteditorIds[$modx->config['which_editor']][] = 'ta';
902
+                                                    $richtexteditorOptions[$modx->config['which_editor']]['ta'] = '';
903
+                                                } else {
904
+                                                    echo "\t" . '<div><textarea class="phptextarea" id="ta" name="ta" rows="20" wrap="soft" onchange="documentDirty=true;">', $modx->htmlspecialchars($content['content']), '</textarea></div>' . "\n";
905
+                                                }
906
+                                                ?>
907 907
 											</div>
908 908
 										</td>
909 909
 									</tr>
@@ -1190,8 +1190,8 @@  discard block
 block discarded – undo
1190 1190
 
1191 1191
 								<?php
1192 1192
 
1193
-								if($_SESSION['mgrRole'] == 1 || $modx->manager->action != '27' || $_SESSION['mgrInternalKey'] == $content['createdby'] || $modx->hasPermission('change_resourcetype')) {
1194
-									?>
1193
+                                if($_SESSION['mgrRole'] == 1 || $modx->manager->action != '27' || $_SESSION['mgrInternalKey'] == $content['createdby'] || $modx->hasPermission('change_resourcetype')) {
1194
+                                    ?>
1195 1195
 									<tr>
1196 1196
 										<td>
1197 1197
 											<span class="warning"><?= $_lang['resource_type'] ?></span>
@@ -1213,15 +1213,15 @@  discard block
 block discarded – undo
1213 1213
 										<td>
1214 1214
 											<select name="contentType" class="inputBox" onchange="documentDirty=true;">
1215 1215
 												<?php
1216
-												if(!$content['contentType']) {
1217
-													$content['contentType'] = 'text/html';
1218
-												}
1219
-												$custom_contenttype = (isset ($custom_contenttype) ? $custom_contenttype : "text/html,text/plain,text/xml");
1220
-												$ct = explode(",", $custom_contenttype);
1221
-												for($i = 0; $i < count($ct); $i++) {
1222
-													echo "\t\t\t\t\t" . '<option value="' . $ct[$i] . '"' . ($content['contentType'] == $ct[$i] ? ' selected="selected"' : '') . '>' . $ct[$i] . "</option>\n";
1223
-												}
1224
-												?>
1216
+                                                if(!$content['contentType']) {
1217
+                                                    $content['contentType'] = 'text/html';
1218
+                                                }
1219
+                                                $custom_contenttype = (isset ($custom_contenttype) ? $custom_contenttype : "text/html,text/plain,text/xml");
1220
+                                                $ct = explode(",", $custom_contenttype);
1221
+                                                for($i = 0; $i < count($ct); $i++) {
1222
+                                                    echo "\t\t\t\t\t" . '<option value="' . $ct[$i] . '"' . ($content['contentType'] == $ct[$i] ? ' selected="selected"' : '') . '>' . $ct[$i] . "</option>\n";
1223
+                                                }
1224
+                                                ?>
1225 1225
 											</select>
1226 1226
 										</td>
1227 1227
 									</tr>
@@ -1244,23 +1244,23 @@  discard block
 block discarded – undo
1244 1244
 										</td>
1245 1245
 									</tr>
1246 1246
 									<?php
1247
-								} else {
1248
-									if($content['type'] != 'reference' && $modx->manager->action != '72') {
1249
-										// non-admin managers creating or editing a document resource
1250
-										?>
1247
+                                } else {
1248
+                                    if($content['type'] != 'reference' && $modx->manager->action != '72') {
1249
+                                        // non-admin managers creating or editing a document resource
1250
+                                        ?>
1251 1251
 										<input type="hidden" name="contentType" value="<?= (isset($content['contentType']) ? $content['contentType'] : "text/html") ?>" />
1252 1252
 										<input type="hidden" name="type" value="document" />
1253 1253
 										<input type="hidden" name="content_dispo" value="<?= (isset($content['content_dispo']) ? $content['content_dispo'] : '0') ?>" />
1254 1254
 										<?php
1255
-									} else {
1256
-										// non-admin managers creating or editing a reference (weblink) resource
1257
-										?>
1255
+                                    } else {
1256
+                                        // non-admin managers creating or editing a reference (weblink) resource
1257
+                                        ?>
1258 1258
 										<input type="hidden" name="type" value="reference" />
1259 1259
 										<input type="hidden" name="contentType" value="text/html" />
1260 1260
 										<?php
1261
-									}
1262
-								}//if mgrRole
1263
-								?>
1261
+                                    }
1262
+                                }//if mgrRole
1263
+                                ?>
1264 1264
 
1265 1265
 								<tr>
1266 1266
 									<td>
@@ -1343,112 +1343,112 @@  discard block
 block discarded – undo
1343 1343
                     ?>
1344 1344
 
1345 1345
 						<?php
1346
-					/*******************************
1346
+                    /*******************************
1347 1347
 					 * Document Access Permissions */
1348
-					if($use_udperms == 1) {
1349
-						$groupsarray = array();
1350
-						$sql = '';
1351
-
1352
-						$documentId = ($modx->manager->action == '27' ? $id : (!empty($_REQUEST['pid']) ? $_REQUEST['pid'] : $content['parent']));
1353
-						if($documentId > 0) {
1354
-							// Load up, the permissions from the parent (if new document) or existing document
1355
-							$rs = $modx->db->select('id, document_group', $tbl_document_groups, "document='{$documentId}'");
1356
-							while($currentgroup = $modx->db->getRow($rs)) $groupsarray[] = $currentgroup['document_group'] . ',' . $currentgroup['id'];
1357
-
1358
-							// Load up the current permissions and names
1359
-							$vs = array(
1360
-								$tbl_document_group_names,
1361
-								$tbl_document_groups,
1362
-								$documentId
1363
-							);
1364
-							$from = vsprintf("%s AS dgn LEFT JOIN %s AS groups ON groups.document_group=dgn.id AND groups.document='%s'", $vs);
1365
-							$rs = $modx->db->select('dgn.*, groups.id AS link_id', $from, '', 'name');
1366
-						} else {
1367
-							// Just load up the names, we're starting clean
1368
-							$rs = $modx->db->select('*, NULL AS link_id', $tbl_document_group_names, '', 'name');
1369
-						}
1370
-
1371
-						// retain selected doc groups between post
1372
-						if(isset($_POST['docgroups'])) {
1373
-							$groupsarray = array_merge($groupsarray, $_POST['docgroups']);
1374
-						}
1348
+                    if($use_udperms == 1) {
1349
+                        $groupsarray = array();
1350
+                        $sql = '';
1351
+
1352
+                        $documentId = ($modx->manager->action == '27' ? $id : (!empty($_REQUEST['pid']) ? $_REQUEST['pid'] : $content['parent']));
1353
+                        if($documentId > 0) {
1354
+                            // Load up, the permissions from the parent (if new document) or existing document
1355
+                            $rs = $modx->db->select('id, document_group', $tbl_document_groups, "document='{$documentId}'");
1356
+                            while($currentgroup = $modx->db->getRow($rs)) $groupsarray[] = $currentgroup['document_group'] . ',' . $currentgroup['id'];
1357
+
1358
+                            // Load up the current permissions and names
1359
+                            $vs = array(
1360
+                                $tbl_document_group_names,
1361
+                                $tbl_document_groups,
1362
+                                $documentId
1363
+                            );
1364
+                            $from = vsprintf("%s AS dgn LEFT JOIN %s AS groups ON groups.document_group=dgn.id AND groups.document='%s'", $vs);
1365
+                            $rs = $modx->db->select('dgn.*, groups.id AS link_id', $from, '', 'name');
1366
+                        } else {
1367
+                            // Just load up the names, we're starting clean
1368
+                            $rs = $modx->db->select('*, NULL AS link_id', $tbl_document_group_names, '', 'name');
1369
+                        }
1370
+
1371
+                        // retain selected doc groups between post
1372
+                        if(isset($_POST['docgroups'])) {
1373
+                            $groupsarray = array_merge($groupsarray, $_POST['docgroups']);
1374
+                        }
1375
+
1376
+                        $isManager = $modx->hasPermission('access_permissions');
1377
+                        $isWeb = $modx->hasPermission('web_access_permissions');
1378
+
1379
+                        // Setup Basic attributes for each Input box
1380
+                        $inputAttributes = array(
1381
+                            'type' => 'checkbox',
1382
+                            'class' => 'checkbox',
1383
+                            'name' => 'docgroups[]',
1384
+                            'onclick' => 'makePublic(false);',
1385
+                        );
1386
+                        $permissions = array(); // New Permissions array list (this contains the HTML)
1387
+                        $permissions_yes = 0; // count permissions the current mgr user has
1388
+                        $permissions_no = 0; // count permissions the current mgr user doesn't have
1389
+
1390
+                        // Loop through the permissions list
1391
+                        while($row = $modx->db->getRow($rs)) {
1392
+
1393
+                            // Create an inputValue pair (group ID and group link (if it exists))
1394
+                            $inputValue = $row['id'] . ',' . ($row['link_id'] ? $row['link_id'] : 'new');
1395
+                            $inputId = 'group-' . $row['id'];
1396
+
1397
+                            $checked = in_array($inputValue, $groupsarray);
1398
+                            if($checked) {
1399
+                                $notPublic = true;
1400
+                            } // Mark as private access (either web or manager)
1401
+
1402
+                            // Skip the access permission if the user doesn't have access...
1403
+                            if((!$isManager && $row['private_memgroup'] == '1') || (!$isWeb && $row['private_webgroup'] == '1')) {
1404
+                                continue;
1405
+                            }
1375 1406
 
1376
-						$isManager = $modx->hasPermission('access_permissions');
1377
-						$isWeb = $modx->hasPermission('web_access_permissions');
1378
-
1379
-						// Setup Basic attributes for each Input box
1380
-						$inputAttributes = array(
1381
-							'type' => 'checkbox',
1382
-							'class' => 'checkbox',
1383
-							'name' => 'docgroups[]',
1384
-							'onclick' => 'makePublic(false);',
1385
-						);
1386
-						$permissions = array(); // New Permissions array list (this contains the HTML)
1387
-						$permissions_yes = 0; // count permissions the current mgr user has
1388
-						$permissions_no = 0; // count permissions the current mgr user doesn't have
1389
-
1390
-						// Loop through the permissions list
1391
-						while($row = $modx->db->getRow($rs)) {
1392
-
1393
-							// Create an inputValue pair (group ID and group link (if it exists))
1394
-							$inputValue = $row['id'] . ',' . ($row['link_id'] ? $row['link_id'] : 'new');
1395
-							$inputId = 'group-' . $row['id'];
1396
-
1397
-							$checked = in_array($inputValue, $groupsarray);
1398
-							if($checked) {
1399
-								$notPublic = true;
1400
-							} // Mark as private access (either web or manager)
1401
-
1402
-							// Skip the access permission if the user doesn't have access...
1403
-							if((!$isManager && $row['private_memgroup'] == '1') || (!$isWeb && $row['private_webgroup'] == '1')) {
1404
-								continue;
1405
-							}
1406
-
1407
-							// Setup attributes for this Input box
1408
-							$inputAttributes['id'] = $inputId;
1409
-							$inputAttributes['value'] = $inputValue;
1410
-							if($checked) {
1411
-								$inputAttributes['checked'] = 'checked';
1412
-							} else {
1413
-								unset($inputAttributes['checked']);
1414
-							}
1415
-
1416
-							// Create attribute string list
1417
-							$inputString = array();
1418
-							foreach($inputAttributes as $k => $v) $inputString[] = $k . '="' . $v . '"';
1419
-
1420
-							// Make the <input> HTML
1421
-							$inputHTML = '<input ' . implode(' ', $inputString) . ' />';
1422
-
1423
-							// does user have this permission?
1424
-							$from = "{$tbl_membergroup_access} AS mga, {$tbl_member_groups} AS mg";
1425
-							$vs = array(
1426
-								$row['id'],
1427
-								$_SESSION['mgrInternalKey']
1428
-							);
1429
-							$where = vsprintf("mga.membergroup=mg.user_group AND mga.documentgroup=%s AND mg.member=%s", $vs);
1430
-							$rsp = $modx->db->select('COUNT(mg.id)', $from, $where);
1431
-							$count = $modx->db->getValue($rsp);
1432
-							if($count > 0) {
1433
-								++$permissions_yes;
1434
-							} else {
1435
-								++$permissions_no;
1436
-							}
1437
-							$permissions[] = "\t\t" . '<li>' . $inputHTML . '<label for="' . $inputId . '">' . $row['name'] . '</label></li>';
1438
-						}
1439
-						// if mgr user doesn't have access to any of the displayable permissions, forget about them and make doc public
1440
-						if($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0)) {
1441
-							$permissions = array();
1442
-						}
1407
+                            // Setup attributes for this Input box
1408
+                            $inputAttributes['id'] = $inputId;
1409
+                            $inputAttributes['value'] = $inputValue;
1410
+                            if($checked) {
1411
+                                $inputAttributes['checked'] = 'checked';
1412
+                            } else {
1413
+                                unset($inputAttributes['checked']);
1414
+                            }
1443 1415
 
1444
-						// See if the Access Permissions section is worth displaying...
1445
-						if(!empty($permissions)) {
1446
-							// Add the "All Document Groups" item if we have rights in both contexts
1447
-							if($isManager && $isWeb) {
1448
-								array_unshift($permissions, "\t\t" . '<li><input type="checkbox" class="checkbox" name="chkalldocs" id="groupall"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true);" /><label for="groupall" class="warning">' . $_lang['all_doc_groups'] . '</label></li>');
1449
-							}
1450
-							// Output the permissions list...
1451
-							?>
1416
+                            // Create attribute string list
1417
+                            $inputString = array();
1418
+                            foreach($inputAttributes as $k => $v) $inputString[] = $k . '="' . $v . '"';
1419
+
1420
+                            // Make the <input> HTML
1421
+                            $inputHTML = '<input ' . implode(' ', $inputString) . ' />';
1422
+
1423
+                            // does user have this permission?
1424
+                            $from = "{$tbl_membergroup_access} AS mga, {$tbl_member_groups} AS mg";
1425
+                            $vs = array(
1426
+                                $row['id'],
1427
+                                $_SESSION['mgrInternalKey']
1428
+                            );
1429
+                            $where = vsprintf("mga.membergroup=mg.user_group AND mga.documentgroup=%s AND mg.member=%s", $vs);
1430
+                            $rsp = $modx->db->select('COUNT(mg.id)', $from, $where);
1431
+                            $count = $modx->db->getValue($rsp);
1432
+                            if($count > 0) {
1433
+                                ++$permissions_yes;
1434
+                            } else {
1435
+                                ++$permissions_no;
1436
+                            }
1437
+                            $permissions[] = "\t\t" . '<li>' . $inputHTML . '<label for="' . $inputId . '">' . $row['name'] . '</label></li>';
1438
+                        }
1439
+                        // if mgr user doesn't have access to any of the displayable permissions, forget about them and make doc public
1440
+                        if($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0)) {
1441
+                            $permissions = array();
1442
+                        }
1443
+
1444
+                        // See if the Access Permissions section is worth displaying...
1445
+                        if(!empty($permissions)) {
1446
+                            // Add the "All Document Groups" item if we have rights in both contexts
1447
+                            if($isManager && $isWeb) {
1448
+                                array_unshift($permissions, "\t\t" . '<li><input type="checkbox" class="checkbox" name="chkalldocs" id="groupall"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true);" /><label for="groupall" class="warning">' . $_lang['all_doc_groups'] . '</label></li>');
1449
+                            }
1450
+                            // Output the permissions list...
1451
+                            ?>
1452 1452
 							<!-- Access Permissions -->
1453 1453
 							<div class="tab-page" id="tabAccess">
1454 1454
 								<h2 class="tab" id="tab_access_header"><?= $_lang['access_permissions'] ?></h2>
@@ -1482,31 +1482,31 @@  discard block
 block discarded – undo
1482 1482
 								</ul>
1483 1483
 							</div><!--div class="tab-page" id="tabAccess"-->
1484 1484
 							<?php
1485
-						} // !empty($permissions)
1486
-						elseif($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0) && ($_SESSION['mgrPermissions']['access_permissions'] == 1 || $_SESSION['mgrPermissions']['web_access_permissions'] == 1)) {
1487
-							?>
1485
+                        } // !empty($permissions)
1486
+                        elseif($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0) && ($_SESSION['mgrPermissions']['access_permissions'] == 1 || $_SESSION['mgrPermissions']['web_access_permissions'] == 1)) {
1487
+                            ?>
1488 1488
 							<p><?= $_lang["access_permissions_docs_collision"] ?></p>
1489 1489
 							<?php
1490 1490
 
1491
-						}
1492
-					}
1493
-					/* End Document Access Permissions *
1491
+                        }
1492
+                    }
1493
+                    /* End Document Access Permissions *
1494 1494
 					 ***********************************/
1495
-					?>
1495
+                    ?>
1496 1496
 
1497 1497
 					<input type="submit" name="save" style="display:none" />
1498 1498
 					<?php
1499 1499
 
1500
-					// invoke OnDocFormRender event
1501
-					$evtOut = $modx->invokeEvent('OnDocFormRender', array(
1502
-						'id' => $id,
1503
-						'template' => $content['template']
1504
-					));
1500
+                    // invoke OnDocFormRender event
1501
+                    $evtOut = $modx->invokeEvent('OnDocFormRender', array(
1502
+                        'id' => $id,
1503
+                        'template' => $content['template']
1504
+                    ));
1505 1505
 
1506
-					if(is_array($evtOut)) {
1507
-						echo implode('', $evtOut);
1508
-					}
1509
-					?>
1506
+                    if(is_array($evtOut)) {
1507
+                        echo implode('', $evtOut);
1508
+                    }
1509
+                    ?>
1510 1510
 				</div><!--div class="tab-pane" id="documentPane"-->
1511 1511
 			</div><!--div class="sectionBody"-->
1512 1512
 		</fieldset>
@@ -1517,63 +1517,63 @@  discard block
 block discarded – undo
1517 1517
 	</script>
1518 1518
 <?php
1519 1519
 if(($content['richtext'] == 1 || $modx->manager->action == '4' || $modx->manager->action == '72') && $use_editor == 1) {
1520
-	if(is_array($richtexteditorIds)) {
1521
-		foreach($richtexteditorIds as $editor => $elements) {
1522
-			// invoke OnRichTextEditorInit event
1523
-			$evtOut = $modx->invokeEvent('OnRichTextEditorInit', array(
1524
-				'editor' => $editor,
1525
-				'elements' => $elements,
1526
-				'options' => $richtexteditorOptions[$editor]
1527
-			));
1528
-			if(is_array($evtOut)) {
1529
-				echo implode('', $evtOut);
1530
-			}
1531
-		}
1532
-	}
1520
+    if(is_array($richtexteditorIds)) {
1521
+        foreach($richtexteditorIds as $editor => $elements) {
1522
+            // invoke OnRichTextEditorInit event
1523
+            $evtOut = $modx->invokeEvent('OnRichTextEditorInit', array(
1524
+                'editor' => $editor,
1525
+                'elements' => $elements,
1526
+                'options' => $richtexteditorOptions[$editor]
1527
+            ));
1528
+            if(is_array($evtOut)) {
1529
+                echo implode('', $evtOut);
1530
+            }
1531
+        }
1532
+    }
1533 1533
 }
1534 1534
 
1535 1535
 /**
1536 1536
  * @return string
1537 1537
  */
1538 1538
 function getDefaultTemplate() {
1539
-	$modx = DocumentParser::getInstance();
1539
+    $modx = DocumentParser::getInstance();
1540 1540
 
1541 1541
     $default_template = '';
1542
-	switch($modx->config['auto_template_logic']) {
1543
-		case 'sibling':
1544
-			if(!isset($_GET['pid']) || empty($_GET['pid'])) {
1545
-				$site_start = $modx->config['site_start'];
1546
-				$where = "sc.isfolder=0 AND sc.id!='{$site_start}'";
1547
-				$sibl = $modx->getDocumentChildren($_REQUEST['pid'], 1, 0, 'template', $where, 'menuindex', 'ASC', 1);
1548
-				if(isset($sibl[0]['template']) && $sibl[0]['template'] !== '') {
1549
-					$default_template = $sibl[0]['template'];
1550
-				}
1551
-			} else {
1552
-				$sibl = $modx->getDocumentChildren($_REQUEST['pid'], 1, 0, 'template', 'isfolder=0', 'menuindex', 'ASC', 1);
1553
-				if(isset($sibl[0]['template']) && $sibl[0]['template'] !== '') {
1554
-					$default_template = $sibl[0]['template'];
1555
-				} else {
1556
-					$sibl = $modx->getDocumentChildren($_REQUEST['pid'], 0, 0, 'template', 'isfolder=0', 'menuindex', 'ASC', 1);
1557
-					if(isset($sibl[0]['template']) && $sibl[0]['template'] !== '') {
1558
-						$default_template = $sibl[0]['template'];
1559
-					}
1560
-				}
1561
-			}
1562
-			if(isset($default_template)) {
1563
-				break;
1564
-			} // If $default_template could not be determined, fall back / through to "parent"-mode
1565
-		case 'parent':
1566
-			if(isset($_REQUEST['pid']) && !empty($_REQUEST['pid'])) {
1567
-				$parent = $modx->getPageInfo($_REQUEST['pid'], 0, 'template');
1568
-				if(isset($parent['template'])) {
1569
-					$default_template = $parent['template'];
1570
-				}
1571
-			}
1572
-			break;
1573
-		case 'system':
1574
-		default: // default_template is already set
1575
-			$default_template = $modx->config['default_template'];
1576
-	}
1577
-
1578
-	return empty($default_template) ? $modx->config['default_template'] : $default_template;
1542
+    switch($modx->config['auto_template_logic']) {
1543
+        case 'sibling':
1544
+            if(!isset($_GET['pid']) || empty($_GET['pid'])) {
1545
+                $site_start = $modx->config['site_start'];
1546
+                $where = "sc.isfolder=0 AND sc.id!='{$site_start}'";
1547
+                $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 1, 0, 'template', $where, 'menuindex', 'ASC', 1);
1548
+                if(isset($sibl[0]['template']) && $sibl[0]['template'] !== '') {
1549
+                    $default_template = $sibl[0]['template'];
1550
+                }
1551
+            } else {
1552
+                $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 1, 0, 'template', 'isfolder=0', 'menuindex', 'ASC', 1);
1553
+                if(isset($sibl[0]['template']) && $sibl[0]['template'] !== '') {
1554
+                    $default_template = $sibl[0]['template'];
1555
+                } else {
1556
+                    $sibl = $modx->getDocumentChildren($_REQUEST['pid'], 0, 0, 'template', 'isfolder=0', 'menuindex', 'ASC', 1);
1557
+                    if(isset($sibl[0]['template']) && $sibl[0]['template'] !== '') {
1558
+                        $default_template = $sibl[0]['template'];
1559
+                    }
1560
+                }
1561
+            }
1562
+            if(isset($default_template)) {
1563
+                break;
1564
+            } // If $default_template could not be determined, fall back / through to "parent"-mode
1565
+        case 'parent':
1566
+            if(isset($_REQUEST['pid']) && !empty($_REQUEST['pid'])) {
1567
+                $parent = $modx->getPageInfo($_REQUEST['pid'], 0, 'template');
1568
+                if(isset($parent['template'])) {
1569
+                    $default_template = $parent['template'];
1570
+                }
1571
+            }
1572
+            break;
1573
+        case 'system':
1574
+        default: // default_template is already set
1575
+            $default_template = $modx->config['default_template'];
1576
+    }
1577
+
1578
+    return empty($default_template) ? $modx->config['default_template'] : $default_template;
1579 1579
 }
Please login to merge, or discard this patch.
manager/index.php 1 patch
Indentation   +618 added lines, -618 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
 $autoloader = realpath(__DIR__.'/../vendor/autoload.php');
52 52
 if (file_exists($autoloader) && is_readable($autoloader)) {
53
-	include_once($autoloader);
53
+    include_once($autoloader);
54 54
 }
55 55
 
56 56
 // get start time
@@ -65,22 +65,22 @@  discard block
 block discarded – undo
65 65
 $site_hostnames_path = $base_path . 'assets/cache/siteHostnames.php';
66 66
 if(is_file($site_hostnames_path)) include_once($site_hostnames_path);
67 67
 if(!defined('MGR_DIR') || MGR_DIR!==$mgr_dir) {
68
-	$src = "<?php\n";
69
-	$src .= "define('MGR_DIR', '{$mgr_dir}');\n";
70
-	$rs = file_put_contents($site_mgr_path,$src);
71
-	if(!$rs) {
72
-		echo 'siteManager.php write error';
73
-		exit;
74
-	}
75
-	sleep(1);
76
-	header('Location:' . $_SERVER['REQUEST_URI']);
77
-	exit;
68
+    $src = "<?php\n";
69
+    $src .= "define('MGR_DIR', '{$mgr_dir}');\n";
70
+    $rs = file_put_contents($site_mgr_path,$src);
71
+    if(!$rs) {
72
+        echo 'siteManager.php write error';
73
+        exit;
74
+    }
75
+    sleep(1);
76
+    header('Location:' . $_SERVER['REQUEST_URI']);
77
+    exit;
78 78
 }
79 79
 
80 80
 // we use this to make sure files are accessed through
81 81
 // the manager instead of seperately.
82 82
 if ( ! defined('IN_MANAGER_MODE')) {
83
-	define('IN_MANAGER_MODE', true);
83
+    define('IN_MANAGER_MODE', true);
84 84
 }
85 85
 
86 86
 // harden it
@@ -101,16 +101,16 @@  discard block
 block discarded – undo
101 101
 
102 102
 // check PHP version. EVO is compatible with php 5 (5.0.0+)
103 103
 $php_ver_comp =  version_compare(phpversion(), "5.0.0");
104
-		// -1 if left is less, 0 if equal, +1 if left is higher
104
+        // -1 if left is less, 0 if equal, +1 if left is higher
105 105
 if($php_ver_comp < 0) {
106
-	echo sprintf($_lang['php_version_check'], phpversion());
107
-	exit;
106
+    echo sprintf($_lang['php_version_check'], phpversion());
107
+    exit;
108 108
 }
109 109
 
110 110
 // check if iconv is installed
111 111
 if(!function_exists('iconv')) {
112
-	echo $_lang['iconv_not_available'];
113
-	exit;
112
+    echo $_lang['iconv_not_available'];
113
+    exit;
114 114
 }
115 115
 
116 116
 // set some runtime options
@@ -123,15 +123,15 @@  discard block
 block discarded – undo
123 123
 
124 124
 // set the document_root :|
125 125
 if(!isset($_SERVER['DOCUMENT_ROOT']) || empty($_SERVER['DOCUMENT_ROOT'])) {
126
-	$_SERVER['DOCUMENT_ROOT'] = str_replace($_SERVER['PATH_INFO'], "", preg_replace("/\\\\/", "/", $_SERVER['PATH_TRANSLATED']))."/";
126
+    $_SERVER['DOCUMENT_ROOT'] = str_replace($_SERVER['PATH_INFO'], "", preg_replace("/\\\\/", "/", $_SERVER['PATH_TRANSLATED']))."/";
127 127
 }
128 128
 
129 129
 // include_once config file
130 130
 $config_filename = "./includes/config.inc.php";
131 131
 if (!file_exists($config_filename)) {
132
-	echo "<h3>Unable to load configuration settings</h3>";
133
-	echo "Please run the EVO <a href='../install'>install utility</a>";
134
-	exit;
132
+    echo "<h3>Unable to load configuration settings</h3>";
133
+    echo "Please run the EVO <a href='../install'>install utility</a>";
134
+    exit;
135 135
 }
136 136
 
137 137
 // include the database configuration file
@@ -139,11 +139,11 @@  discard block
 block discarded – undo
139 139
 
140 140
 // initiate the content manager class
141 141
 if (isset($coreClass) && class_exists($coreClass)) {
142
-	$modx = new $coreClass;
142
+    $modx = new $coreClass;
143 143
 }
144 144
 if (!isset($modx) || !($modx instanceof DocumentParser)) {
145
-	include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php');
146
-	$modx = DocumentParser::getInstance();
145
+    include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php');
146
+    $modx = DocumentParser::getInstance();
147 147
 }
148 148
 
149 149
 $modx->loadExtension("ManagerAPI");
@@ -166,25 +166,25 @@  discard block
 block discarded – undo
166 166
 
167 167
 // now include_once different language file as english
168 168
 if(!isset($manager_language) || !file_exists(MODX_MANAGER_PATH."includes/lang/".$manager_language.".inc.php")) {
169
-	$manager_language = "english"; // if not set, get the english language file.
169
+    $manager_language = "english"; // if not set, get the english language file.
170 170
 }
171 171
 
172 172
 // $length_eng_lang = count($_lang); // Not used for now, required for difference-check with other languages than english (i.e. inside installer)
173 173
 
174 174
 if($manager_language!="english" && file_exists(MODX_MANAGER_PATH."includes/lang/".$manager_language.".inc.php")) {
175
-	include_once "lang/".$manager_language.".inc.php";
175
+    include_once "lang/".$manager_language.".inc.php";
176 176
 }
177 177
 
178 178
 // allow custom language overrides not altered by future EVO-updates
179 179
 if(file_exists(MODX_MANAGER_PATH."includes/lang/override/".$manager_language.".inc.php")) {
180
-	include_once "lang/override/".$manager_language.".inc.php";
180
+    include_once "lang/override/".$manager_language.".inc.php";
181 181
 }
182 182
 
183 183
 $s = array('[+MGR_DIR+]');
184 184
 $r = array(MGR_DIR);
185 185
 foreach($_lang as $k=>$v)
186 186
 {
187
-	if(strpos($v,'[+')!==false) $_lang[$k] = str_replace($s, $r, $v);
187
+    if(strpos($v,'[+')!==false) $_lang[$k] = str_replace($s, $r, $v);
188 188
 }
189 189
 
190 190
 // send the charset header
@@ -199,19 +199,19 @@  discard block
 block discarded – undo
199 199
 
200 200
 // double check the session
201 201
 if(!isset($_SESSION['mgrValidated'])){
202
-	echo "Not Logged In!";
203
-	exit;
202
+    echo "Not Logged In!";
203
+    exit;
204 204
 }
205 205
 
206 206
 // include_once the style variables file
207 207
 if(isset($manager_theme) && !isset($_style)) {
208
-	$_style = array();
209
-	include_once "media/style/".$manager_theme."/style.php";
208
+    $_style = array();
209
+    include_once "media/style/".$manager_theme."/style.php";
210 210
 }
211 211
 
212 212
 // check if user is allowed to access manager interface
213 213
 if(isset($allow_manager_access) && $allow_manager_access==0) {
214
-	include_once "manager.lockout.inc.php";
214
+    include_once "manager.lockout.inc.php";
215 215
 }
216 216
 
217 217
 // Initialize System Alert Message Queque
@@ -220,13 +220,13 @@  discard block
 block discarded – undo
220 220
 
221 221
 // first we check to see if this is a frameset request
222 222
 if(!isset($_POST['a']) && !isset($_GET['a']) && !isset($_POST['updateMsgCount'])) {
223
-	// this looks to be a top-level frameset request, so let's serve up a frameset
224
-	if(is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/frames/1.php")) {
225
-		include_once "media/style/".$manager_theme."/frames/1.php";
226
-	}else{
227
-		include_once "frames/1.php";
228
-	}
229
-	exit;
223
+    // this looks to be a top-level frameset request, so let's serve up a frameset
224
+    if(is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/frames/1.php")) {
225
+        include_once "media/style/".$manager_theme."/frames/1.php";
226
+    }else{
227
+        include_once "frames/1.php";
228
+    }
229
+    exit;
230 230
 }
231 231
 
232 232
 // OK, let's retrieve the action directive from the request
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 else                       $action = null;
238 238
 
239 239
 if (isset($_POST['updateMsgCount']) && $modx->hasPermission('messages')) {
240
-	include_once 'messageCount.inc.php';
240
+    include_once 'messageCount.inc.php';
241 241
 }
242 242
 
243 243
 // save page to manager object
@@ -245,19 +245,19 @@  discard block
 block discarded – undo
245 245
 
246 246
 // attempt to foil some simple types of CSRF attacks
247 247
 if (isset($modx->config['validate_referer']) && (int)$modx->config['validate_referer']) {
248
-	if (isset($_SERVER['HTTP_REFERER'])) {
249
-		$referer = $_SERVER['HTTP_REFERER'];
250
-
251
-		if (!empty($referer)) {
252
-			if (!preg_match('/^'.preg_quote(MODX_SITE_URL, '/').'/i', $referer)) {
253
-				$modx->webAlertAndQuit("A possible CSRF attempt was detected from referer: {$referer}.", "index.php");
254
-			}
255
-		} else {
256
-				$modx->webAlertAndQuit("A possible CSRF attempt was detected. No referer was provided by the client.", "index.php");
257
-		}
258
-	} else {
259
-		$modx->webAlertAndQuit("A possible CSRF attempt was detected. No referer was provided by the server.", "index.php");
260
-	}
248
+    if (isset($_SERVER['HTTP_REFERER'])) {
249
+        $referer = $_SERVER['HTTP_REFERER'];
250
+
251
+        if (!empty($referer)) {
252
+            if (!preg_match('/^'.preg_quote(MODX_SITE_URL, '/').'/i', $referer)) {
253
+                $modx->webAlertAndQuit("A possible CSRF attempt was detected from referer: {$referer}.", "index.php");
254
+            }
255
+        } else {
256
+                $modx->webAlertAndQuit("A possible CSRF attempt was detected. No referer was provided by the client.", "index.php");
257
+        }
258
+    } else {
259
+        $modx->webAlertAndQuit("A possible CSRF attempt was detected. No referer was provided by the server.", "index.php");
260
+    }
261 261
 }
262 262
 
263 263
 // invoke OnManagerPageInit event
@@ -265,13 +265,13 @@  discard block
 block discarded – undo
265 265
 
266 266
 // return element filepath
267 267
 function includeFileProcessor ($filepath,$manager_theme) {
268
-	$element = "";
269
-	if(is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath)) {
270
-		$element = MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath;
271
-	}else{
272
-		$element = $filepath;
273
-	}
274
-	return $element;
268
+    $element = "";
269
+    if(is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath)) {
270
+        $element = MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath;
271
+    }else{
272
+        $element = $filepath;
273
+    }
274
+    return $element;
275 275
 }
276 276
 
277 277
 // Now we decide what to do according to the action request. This is a BIG list :)
@@ -279,714 +279,714 @@  discard block
 block discarded – undo
279 279
 /********************************************************************/
280 280
 /* frame management - show the requested frame                      */
281 281
 /********************************************************************/
282
-	case 1 :
283
-		// get the requested frame
284
-		$frame = preg_replace('/[^a-z0-9]/i','',$_REQUEST['f']);
285
-		if($frame>9) {
286
-			$enable_debug=false;    // this is to stop the debug thingy being attached to the framesets
287
-		}
288
-		include_once(includeFileProcessor("frames/".$frame.".php",$manager_theme));
289
-	break;
282
+    case 1 :
283
+        // get the requested frame
284
+        $frame = preg_replace('/[^a-z0-9]/i','',$_REQUEST['f']);
285
+        if($frame>9) {
286
+            $enable_debug=false;    // this is to stop the debug thingy being attached to the framesets
287
+        }
288
+        include_once(includeFileProcessor("frames/".$frame.".php",$manager_theme));
289
+    break;
290 290
 /********************************************************************/
291 291
 /* show the homepage                                                */
292 292
 /********************************************************************/
293
-	case 2:
294
-		// get the home page
295
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
296
-		include_once(includeFileProcessor("actions/welcome.static.php",$manager_theme));
297
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
298
-	break;
293
+    case 2:
294
+        // get the home page
295
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
296
+        include_once(includeFileProcessor("actions/welcome.static.php",$manager_theme));
297
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
298
+    break;
299 299
 /********************************************************************/
300 300
 /* document data                                                    */
301 301
 /********************************************************************/
302
-	case 3:
303
-		// get the page to show document's data
304
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
305
-		include_once(includeFileProcessor("actions/document_data.static.php",$manager_theme));
306
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
307
-	break;
302
+    case 3:
303
+        // get the page to show document's data
304
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
305
+        include_once(includeFileProcessor("actions/document_data.static.php",$manager_theme));
306
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
307
+    break;
308 308
 /********************************************************************/
309 309
 /* content management                                               */
310 310
 /********************************************************************/
311
-	case 85:
312
-		// get the mutate page for adding a folder
313
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
314
-		include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme));
315
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
316
-	break;
317
-	case 27:
318
-		// get the mutate page for changing content
319
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
320
-		include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme));
321
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
322
-	break;
323
-	case 4:
324
-		// get the mutate page for adding content
325
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
326
-		include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme));
327
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
328
-	break;
329
-	case 5:
330
-		// get the save processor
331
-		include_once(includeFileProcessor("processors/save_content.processor.php",$manager_theme));
332
-	break;
333
-	case 6:
334
-		// get the delete processor
335
-		include_once(includeFileProcessor("processors/delete_content.processor.php",$manager_theme));
336
-	break;
337
-	case 63:
338
-		// get the undelete processor
339
-		include_once(includeFileProcessor("processors/undelete_content.processor.php",$manager_theme));
340
-	break;
341
-	case 51:
342
-		// get the move action
343
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
344
-		include_once(includeFileProcessor("actions/move_document.dynamic.php",$manager_theme));
345
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
346
-	break;
347
-	case 52:
348
-		// get the move document processor
349
-		include_once(includeFileProcessor("processors/move_document.processor.php",$manager_theme));
350
-	break;
351
-	case 61:
352
-		// get the processor for publishing content
353
-		include_once(includeFileProcessor("processors/publish_content.processor.php",$manager_theme));
354
-	break;
355
-	case 62:
356
-		// get the processor for publishing content
357
-		include_once(includeFileProcessor("processors/unpublish_content.processor.php",$manager_theme));
358
-	break;
359
-	case 56:
360
-		// get the sort menuindex action
361
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
362
-		include_once(includeFileProcessor("actions/mutate_menuindex_sort.dynamic.php",$manager_theme));
363
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
364
-		break;
311
+    case 85:
312
+        // get the mutate page for adding a folder
313
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
314
+        include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme));
315
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
316
+    break;
317
+    case 27:
318
+        // get the mutate page for changing content
319
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
320
+        include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme));
321
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
322
+    break;
323
+    case 4:
324
+        // get the mutate page for adding content
325
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
326
+        include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme));
327
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
328
+    break;
329
+    case 5:
330
+        // get the save processor
331
+        include_once(includeFileProcessor("processors/save_content.processor.php",$manager_theme));
332
+    break;
333
+    case 6:
334
+        // get the delete processor
335
+        include_once(includeFileProcessor("processors/delete_content.processor.php",$manager_theme));
336
+    break;
337
+    case 63:
338
+        // get the undelete processor
339
+        include_once(includeFileProcessor("processors/undelete_content.processor.php",$manager_theme));
340
+    break;
341
+    case 51:
342
+        // get the move action
343
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
344
+        include_once(includeFileProcessor("actions/move_document.dynamic.php",$manager_theme));
345
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
346
+    break;
347
+    case 52:
348
+        // get the move document processor
349
+        include_once(includeFileProcessor("processors/move_document.processor.php",$manager_theme));
350
+    break;
351
+    case 61:
352
+        // get the processor for publishing content
353
+        include_once(includeFileProcessor("processors/publish_content.processor.php",$manager_theme));
354
+    break;
355
+    case 62:
356
+        // get the processor for publishing content
357
+        include_once(includeFileProcessor("processors/unpublish_content.processor.php",$manager_theme));
358
+    break;
359
+    case 56:
360
+        // get the sort menuindex action
361
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
362
+        include_once(includeFileProcessor("actions/mutate_menuindex_sort.dynamic.php",$manager_theme));
363
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
364
+        break;
365 365
 /********************************************************************/
366 366
 /* show the wait page - gives the tree time to refresh (hopefully)  */
367 367
 /********************************************************************/
368
-	case 7:
369
-		// get the wait page (so the tree can reload)
370
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
371
-		include_once(includeFileProcessor("actions/wait.static.php",$manager_theme));
372
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
373
-	break;
368
+    case 7:
369
+        // get the wait page (so the tree can reload)
370
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
371
+        include_once(includeFileProcessor("actions/wait.static.php",$manager_theme));
372
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
373
+    break;
374 374
 /********************************************************************/
375 375
 /* let the user log out                                             */
376 376
 /********************************************************************/
377
-	case 8:
378
-		// get the logout processor
379
-		include_once(includeFileProcessor("processors/logout.processor.php",$manager_theme));
380
-	break;
377
+    case 8:
378
+        // get the logout processor
379
+        include_once(includeFileProcessor("processors/logout.processor.php",$manager_theme));
380
+    break;
381 381
 /********************************************************************/
382 382
 /* user management                                                  */
383 383
 /********************************************************************/
384
-	case 87:
385
-		// get the new web user page
386
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
387
-		include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php",$manager_theme));
388
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
389
-	break;
390
-	case 88:
391
-		// get the edit web user page
392
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
393
-		include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php",$manager_theme));
394
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
395
-	break;
396
-	case 89:
397
-		// get the save web user processor
398
-		include_once(includeFileProcessor("processors/save_web_user.processor.php",$manager_theme));
399
-	break;
400
-	case 90:
401
-		// get the delete web user page
402
-		include_once(includeFileProcessor("processors/delete_web_user.processor.php",$manager_theme));
403
-	break;
404
-	case 11:
405
-		// get the new user page
406
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
407
-		include_once(includeFileProcessor("actions/mutate_user.dynamic.php",$manager_theme));
408
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
409
-	break;
410
-	case 12:
411
-		// get the edit user page
412
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
413
-		include_once(includeFileProcessor("actions/mutate_user.dynamic.php",$manager_theme));
414
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
415
-	break;
416
-	case 32:
417
-		// get the save user processor
418
-		include_once(includeFileProcessor("processors/save_user.processor.php",$manager_theme));
419
-	break;
420
-	case 28:
421
-		// get the change password page
422
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
423
-		include_once(includeFileProcessor("actions/mutate_password.dynamic.php",$manager_theme));
424
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
425
-	break;
426
-	case 34:
427
-		// get the save new password page
428
-		include_once(includeFileProcessor("processors/save_password.processor.php",$manager_theme));
429
-	break;
430
-	case 33:
431
-		// get the delete user page
432
-		include_once(includeFileProcessor("processors/delete_user.processor.php",$manager_theme));
433
-	break;
384
+    case 87:
385
+        // get the new web user page
386
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
387
+        include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php",$manager_theme));
388
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
389
+    break;
390
+    case 88:
391
+        // get the edit web user page
392
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
393
+        include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php",$manager_theme));
394
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
395
+    break;
396
+    case 89:
397
+        // get the save web user processor
398
+        include_once(includeFileProcessor("processors/save_web_user.processor.php",$manager_theme));
399
+    break;
400
+    case 90:
401
+        // get the delete web user page
402
+        include_once(includeFileProcessor("processors/delete_web_user.processor.php",$manager_theme));
403
+    break;
404
+    case 11:
405
+        // get the new user page
406
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
407
+        include_once(includeFileProcessor("actions/mutate_user.dynamic.php",$manager_theme));
408
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
409
+    break;
410
+    case 12:
411
+        // get the edit user page
412
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
413
+        include_once(includeFileProcessor("actions/mutate_user.dynamic.php",$manager_theme));
414
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
415
+    break;
416
+    case 32:
417
+        // get the save user processor
418
+        include_once(includeFileProcessor("processors/save_user.processor.php",$manager_theme));
419
+    break;
420
+    case 28:
421
+        // get the change password page
422
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
423
+        include_once(includeFileProcessor("actions/mutate_password.dynamic.php",$manager_theme));
424
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
425
+    break;
426
+    case 34:
427
+        // get the save new password page
428
+        include_once(includeFileProcessor("processors/save_password.processor.php",$manager_theme));
429
+    break;
430
+    case 33:
431
+        // get the delete user page
432
+        include_once(includeFileProcessor("processors/delete_user.processor.php",$manager_theme));
433
+    break;
434 434
 /********************************************************************/
435 435
 /* role management                                                  */
436 436
 /********************************************************************/
437
-	case 38:
438
-		// get the new role page
439
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
440
-		include_once(includeFileProcessor("actions/mutate_role.dynamic.php",$manager_theme));
441
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
442
-	break;
443
-	case 35:
444
-		// get the edit role page
445
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
446
-		include_once(includeFileProcessor("actions/mutate_role.dynamic.php",$manager_theme));
447
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
448
-	break;
449
-	case 36:
450
-		// get the save role page
451
-		include_once(includeFileProcessor("processors/save_role.processor.php",$manager_theme));
452
-	break;
453
-	case 37:
454
-		// get the delete role page
455
-		include_once(includeFileProcessor("processors/delete_role.processor.php",$manager_theme));
456
-	break;
437
+    case 38:
438
+        // get the new role page
439
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
440
+        include_once(includeFileProcessor("actions/mutate_role.dynamic.php",$manager_theme));
441
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
442
+    break;
443
+    case 35:
444
+        // get the edit role page
445
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
446
+        include_once(includeFileProcessor("actions/mutate_role.dynamic.php",$manager_theme));
447
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
448
+    break;
449
+    case 36:
450
+        // get the save role page
451
+        include_once(includeFileProcessor("processors/save_role.processor.php",$manager_theme));
452
+    break;
453
+    case 37:
454
+        // get the delete role page
455
+        include_once(includeFileProcessor("processors/delete_role.processor.php",$manager_theme));
456
+    break;
457 457
 /********************************************************************/
458 458
 /* category management                                               */
459 459
 /********************************************************************/
460
-	case 120:
461
-		// get the edit category page
462
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
463
-		include_once(includeFileProcessor("actions/mutate_categories.dynamic.php",$manager_theme));
464
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
465
-	break;
466
-	case 121:
467
-		// for ajax-requests
468
-		include_once(includeFileProcessor("actions/mutate_categories.dynamic.php",$manager_theme));
469
-	break;
460
+    case 120:
461
+        // get the edit category page
462
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
463
+        include_once(includeFileProcessor("actions/mutate_categories.dynamic.php",$manager_theme));
464
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
465
+    break;
466
+    case 121:
467
+        // for ajax-requests
468
+        include_once(includeFileProcessor("actions/mutate_categories.dynamic.php",$manager_theme));
469
+    break;
470 470
 /********************************************************************/
471 471
 /* template management                                              */
472 472
 /********************************************************************/
473
-	case 16:
474
-		// get the edit template action
475
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
476
-		include_once(includeFileProcessor("actions/mutate_templates.dynamic.php",$manager_theme));
477
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
478
-	break;
479
-	case 19:
480
-		// get the new template action
481
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
482
-		include_once(includeFileProcessor("actions/mutate_templates.dynamic.php",$manager_theme));
483
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
484
-	break;
485
-	case 20:
486
-		// get the save processor
487
-		include_once(includeFileProcessor("processors/save_template.processor.php",$manager_theme));
488
-	break;
489
-	case 21:
490
-		// get the delete processor
491
-		include_once(includeFileProcessor("processors/delete_template.processor.php",$manager_theme));
492
-	break;
493
-	case 96:
494
-		// get the duplicate template processor
495
-		include_once(includeFileProcessor("processors/duplicate_template.processor.php",$manager_theme));
496
-	break;
497
-	case 117:
498
-		// change the tv rank for selected template
499
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
500
-		include_once(includeFileProcessor("actions/mutate_template_tv_rank.dynamic.php",$manager_theme));
501
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
502
-		break;
473
+    case 16:
474
+        // get the edit template action
475
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
476
+        include_once(includeFileProcessor("actions/mutate_templates.dynamic.php",$manager_theme));
477
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
478
+    break;
479
+    case 19:
480
+        // get the new template action
481
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
482
+        include_once(includeFileProcessor("actions/mutate_templates.dynamic.php",$manager_theme));
483
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
484
+    break;
485
+    case 20:
486
+        // get the save processor
487
+        include_once(includeFileProcessor("processors/save_template.processor.php",$manager_theme));
488
+    break;
489
+    case 21:
490
+        // get the delete processor
491
+        include_once(includeFileProcessor("processors/delete_template.processor.php",$manager_theme));
492
+    break;
493
+    case 96:
494
+        // get the duplicate template processor
495
+        include_once(includeFileProcessor("processors/duplicate_template.processor.php",$manager_theme));
496
+    break;
497
+    case 117:
498
+        // change the tv rank for selected template
499
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
500
+        include_once(includeFileProcessor("actions/mutate_template_tv_rank.dynamic.php",$manager_theme));
501
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
502
+        break;
503 503
 /********************************************************************/
504 504
 /* snippet management                                               */
505 505
 /********************************************************************/
506
-	case 22:
507
-		// get the edit snippet action
508
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
509
-		include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php",$manager_theme));
510
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
511
-	break;
512
-	case 23:
513
-		// get the new snippet action
514
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
515
-		include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php",$manager_theme));
516
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
517
-	break;
518
-	case 24:
519
-		// get the save processor
520
-		include_once(includeFileProcessor("processors/save_snippet.processor.php",$manager_theme));
521
-	break;
522
-	case 25:
523
-		// get the delete processor
524
-		include_once(includeFileProcessor("processors/delete_snippet.processor.php",$manager_theme));
525
-	break;
526
-	case 98:
527
-		// get the duplicate processor
528
-		include_once(includeFileProcessor("processors/duplicate_snippet.processor.php",$manager_theme));
529
-	break;
506
+    case 22:
507
+        // get the edit snippet action
508
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
509
+        include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php",$manager_theme));
510
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
511
+    break;
512
+    case 23:
513
+        // get the new snippet action
514
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
515
+        include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php",$manager_theme));
516
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
517
+    break;
518
+    case 24:
519
+        // get the save processor
520
+        include_once(includeFileProcessor("processors/save_snippet.processor.php",$manager_theme));
521
+    break;
522
+    case 25:
523
+        // get the delete processor
524
+        include_once(includeFileProcessor("processors/delete_snippet.processor.php",$manager_theme));
525
+    break;
526
+    case 98:
527
+        // get the duplicate processor
528
+        include_once(includeFileProcessor("processors/duplicate_snippet.processor.php",$manager_theme));
529
+    break;
530 530
 /********************************************************************/
531 531
 /* htmlsnippet management                                               */
532 532
 /********************************************************************/
533
-	case 78:
534
-		// get the edit snippet action
535
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
536
-		include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php",$manager_theme));
537
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
538
-	break;
539
-	case 77:
540
-		// get the new snippet action
541
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
542
-		include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php",$manager_theme));
543
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
544
-	break;
545
-	case 79:
546
-		// get the save processor
547
-		include_once(includeFileProcessor("processors/save_htmlsnippet.processor.php",$manager_theme));
548
-	break;
549
-	case 80:
550
-		// get the delete processor
551
-		include_once(includeFileProcessor("processors/delete_htmlsnippet.processor.php",$manager_theme));
552
-	break;
553
-	case 97:
554
-		// get the duplicate processor
555
-		include_once(includeFileProcessor("processors/duplicate_htmlsnippet.processor.php",$manager_theme));
556
-	break;
533
+    case 78:
534
+        // get the edit snippet action
535
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
536
+        include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php",$manager_theme));
537
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
538
+    break;
539
+    case 77:
540
+        // get the new snippet action
541
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
542
+        include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php",$manager_theme));
543
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
544
+    break;
545
+    case 79:
546
+        // get the save processor
547
+        include_once(includeFileProcessor("processors/save_htmlsnippet.processor.php",$manager_theme));
548
+    break;
549
+    case 80:
550
+        // get the delete processor
551
+        include_once(includeFileProcessor("processors/delete_htmlsnippet.processor.php",$manager_theme));
552
+    break;
553
+    case 97:
554
+        // get the duplicate processor
555
+        include_once(includeFileProcessor("processors/duplicate_htmlsnippet.processor.php",$manager_theme));
556
+    break;
557 557
 /********************************************************************/
558 558
 /* show the credits page                                            */
559 559
 /********************************************************************/
560
-	case 18:
561
-		// get the credits page
562
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
563
-		include_once(includeFileProcessor("actions/credits.static.php",$manager_theme));
564
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
565
-	break;
560
+    case 18:
561
+        // get the credits page
562
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
563
+        include_once(includeFileProcessor("actions/credits.static.php",$manager_theme));
564
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
565
+    break;
566 566
 /********************************************************************/
567 567
 /* empty cache & synchronisation                                    */
568 568
 /********************************************************************/
569
-	case 26:
570
-		// get the cache emptying processor
571
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
572
-		include_once(includeFileProcessor("actions/refresh_site.dynamic.php",$manager_theme));
573
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
574
-	break;
569
+    case 26:
570
+        // get the cache emptying processor
571
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
572
+        include_once(includeFileProcessor("actions/refresh_site.dynamic.php",$manager_theme));
573
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
574
+    break;
575 575
 /********************************************************************/
576 576
 /* Module management                                                */
577 577
 /********************************************************************/
578
-	case 106:
579
-		// get module management
580
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
581
-		include_once(includeFileProcessor("actions/modules.static.php",$manager_theme));
582
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
583
-	break;
584
-	case 107:
585
-		// get the new module action
586
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
587
-		include_once(includeFileProcessor("actions/mutate_module.dynamic.php",$manager_theme));
588
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
589
-	break;
590
-	case 108:
591
-		// get the edit module action
592
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
593
-		include_once(includeFileProcessor("actions/mutate_module.dynamic.php",$manager_theme));
594
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
595
-	break;
596
-	case 109:
597
-		// get the save processor
598
-		include_once(includeFileProcessor("processors/save_module.processor.php",$manager_theme));
599
-	break;
600
-	case 110:
601
-		// get the delete processor
602
-		include_once(includeFileProcessor("processors/delete_module.processor.php",$manager_theme));
603
-	break;
604
-	case 111:
605
-		// get the duplicate processor
606
-		include_once(includeFileProcessor("processors/duplicate_module.processor.php",$manager_theme));
607
-	break;
608
-	case 112:
609
-		// execute/run the module
610
-		//include_once "header.inc.php";
611
-		include_once(includeFileProcessor("processors/execute_module.processor.php",$manager_theme));
612
-		//include_once "footer.inc.php";
613
-		break;
614
-	case 113:
615
-		// get the module resources (dependencies) action
616
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
617
-		include_once(includeFileProcessor("actions/mutate_module_resources.dynamic.php",$manager_theme));
618
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
619
-	break;
578
+    case 106:
579
+        // get module management
580
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
581
+        include_once(includeFileProcessor("actions/modules.static.php",$manager_theme));
582
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
583
+    break;
584
+    case 107:
585
+        // get the new module action
586
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
587
+        include_once(includeFileProcessor("actions/mutate_module.dynamic.php",$manager_theme));
588
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
589
+    break;
590
+    case 108:
591
+        // get the edit module action
592
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
593
+        include_once(includeFileProcessor("actions/mutate_module.dynamic.php",$manager_theme));
594
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
595
+    break;
596
+    case 109:
597
+        // get the save processor
598
+        include_once(includeFileProcessor("processors/save_module.processor.php",$manager_theme));
599
+    break;
600
+    case 110:
601
+        // get the delete processor
602
+        include_once(includeFileProcessor("processors/delete_module.processor.php",$manager_theme));
603
+    break;
604
+    case 111:
605
+        // get the duplicate processor
606
+        include_once(includeFileProcessor("processors/duplicate_module.processor.php",$manager_theme));
607
+    break;
608
+    case 112:
609
+        // execute/run the module
610
+        //include_once "header.inc.php";
611
+        include_once(includeFileProcessor("processors/execute_module.processor.php",$manager_theme));
612
+        //include_once "footer.inc.php";
613
+        break;
614
+    case 113:
615
+        // get the module resources (dependencies) action
616
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
617
+        include_once(includeFileProcessor("actions/mutate_module_resources.dynamic.php",$manager_theme));
618
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
619
+    break;
620 620
 /********************************************************************/
621 621
 /* plugin management                                                */
622 622
 /********************************************************************/
623
-	case 100:
624
-		// change the plugin priority
625
-		//include_once "header.inc.php"; - in action file
626
-		include_once(includeFileProcessor("actions/mutate_plugin_priority.dynamic.php",$manager_theme));
627
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
628
-	break;
629
-	case 101:
630
-		// get the new plugin action
631
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
632
-		include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php",$manager_theme));
633
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
634
-	break;
635
-	case 102:
636
-		// get the edit plugin action
637
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
638
-		include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php",$manager_theme));
639
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
640
-	break;
641
-	case 103:
642
-		// get the save processor
643
-		include_once(includeFileProcessor("processors/save_plugin.processor.php",$manager_theme));
644
-	break;
645
-	case 104:
646
-		// get the delete processor
647
-		include_once(includeFileProcessor("processors/delete_plugin.processor.php",$manager_theme));
648
-	break;
649
-	case 105:
650
-		// get the duplicate processor
651
-		include_once(includeFileProcessor("processors/duplicate_plugin.processor.php",$manager_theme));
652
-	break;
653
-	case 119:
654
-		// get the purge processor
655
-		include_once(includeFileProcessor("processors/purge_plugin.processor.php",$manager_theme));
656
-	break;
623
+    case 100:
624
+        // change the plugin priority
625
+        //include_once "header.inc.php"; - in action file
626
+        include_once(includeFileProcessor("actions/mutate_plugin_priority.dynamic.php",$manager_theme));
627
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
628
+    break;
629
+    case 101:
630
+        // get the new plugin action
631
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
632
+        include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php",$manager_theme));
633
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
634
+    break;
635
+    case 102:
636
+        // get the edit plugin action
637
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
638
+        include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php",$manager_theme));
639
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
640
+    break;
641
+    case 103:
642
+        // get the save processor
643
+        include_once(includeFileProcessor("processors/save_plugin.processor.php",$manager_theme));
644
+    break;
645
+    case 104:
646
+        // get the delete processor
647
+        include_once(includeFileProcessor("processors/delete_plugin.processor.php",$manager_theme));
648
+    break;
649
+    case 105:
650
+        // get the duplicate processor
651
+        include_once(includeFileProcessor("processors/duplicate_plugin.processor.php",$manager_theme));
652
+    break;
653
+    case 119:
654
+        // get the purge processor
655
+        include_once(includeFileProcessor("processors/purge_plugin.processor.php",$manager_theme));
656
+    break;
657 657
 /********************************************************************/
658 658
 /* view phpinfo                                                     */
659 659
 /********************************************************************/
660
-	case 200:
661
-		// show phpInfo
662
-		if($modx->hasPermission('logs')) {
663
-			include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
664
-			include_once(includeFileProcessor("actions/phpinfo.static.php",$manager_theme));
665
-			include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
666
-		}
667
-	break;
660
+    case 200:
661
+        // show phpInfo
662
+        if($modx->hasPermission('logs')) {
663
+            include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
664
+            include_once(includeFileProcessor("actions/phpinfo.static.php",$manager_theme));
665
+            include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
666
+        }
667
+    break;
668 668
 /********************************************************************/
669 669
 /* errorpage                                            */
670 670
 /********************************************************************/
671
-	case 29:
672
-		// get the error page
673
-		include_once(includeFileProcessor("actions/error_dialog.static.php",$manager_theme));
674
-	break;
671
+    case 29:
672
+        // get the error page
673
+        include_once(includeFileProcessor("actions/error_dialog.static.php",$manager_theme));
674
+    break;
675 675
 /********************************************************************/
676 676
 /* file manager                                                     */
677 677
 /********************************************************************/
678
-	case 31:
679
-		// get the page to manage files
680
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
681
-		include_once(includeFileProcessor("actions/files.dynamic.php",$manager_theme));
682
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
683
-	break;
678
+    case 31:
679
+        // get the page to manage files
680
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
681
+        include_once(includeFileProcessor("actions/files.dynamic.php",$manager_theme));
682
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
683
+    break;
684 684
 /********************************************************************/
685 685
 /* access permissions                                               */
686 686
 /********************************************************************/
687
-	case 40:
688
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
689
-		include_once(includeFileProcessor("actions/access_permissions.dynamic.php",$manager_theme));
690
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
691
-	break;
692
-	case 91:
693
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
694
-		include_once(includeFileProcessor("actions/web_access_permissions.dynamic.php",$manager_theme));
695
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
696
-	break;
687
+    case 40:
688
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
689
+        include_once(includeFileProcessor("actions/access_permissions.dynamic.php",$manager_theme));
690
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
691
+    break;
692
+    case 91:
693
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
694
+        include_once(includeFileProcessor("actions/web_access_permissions.dynamic.php",$manager_theme));
695
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
696
+    break;
697 697
 /********************************************************************/
698 698
 /* access groups processor                                          */
699 699
 /********************************************************************/
700
-	case 41:
701
-		include_once(includeFileProcessor("processors/access_groups.processor.php",$manager_theme));
702
-	break;
703
-	case 92:
704
-		include_once(includeFileProcessor("processors/web_access_groups.processor.php",$manager_theme));
705
-	break;
700
+    case 41:
701
+        include_once(includeFileProcessor("processors/access_groups.processor.php",$manager_theme));
702
+    break;
703
+    case 92:
704
+        include_once(includeFileProcessor("processors/web_access_groups.processor.php",$manager_theme));
705
+    break;
706 706
 /********************************************************************/
707 707
 /* settings editor                                                  */
708 708
 /********************************************************************/
709
-	case 17:
710
-		// get the settings editor
711
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
712
-		include_once(includeFileProcessor("actions/mutate_settings.dynamic.php",$manager_theme));
713
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
714
-	break;
715
-	case 118:
716
-		// call settings ajax include
717
-		ob_clean();
718
-		include_once(includeFileProcessor("includes/mutate_settings.ajax.php",$manager_theme));
719
-	break;
709
+    case 17:
710
+        // get the settings editor
711
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
712
+        include_once(includeFileProcessor("actions/mutate_settings.dynamic.php",$manager_theme));
713
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
714
+    break;
715
+    case 118:
716
+        // call settings ajax include
717
+        ob_clean();
718
+        include_once(includeFileProcessor("includes/mutate_settings.ajax.php",$manager_theme));
719
+    break;
720 720
 /********************************************************************/
721 721
 /* save settings                                                    */
722 722
 /********************************************************************/
723
-	case 30:
724
-		// get the save settings processor
725
-		include_once(includeFileProcessor("processors/save_settings.processor.php",$manager_theme));
726
-	break;
723
+    case 30:
724
+        // get the save settings processor
725
+        include_once(includeFileProcessor("processors/save_settings.processor.php",$manager_theme));
726
+    break;
727 727
 /********************************************************************/
728 728
 /* system information                                               */
729 729
 /********************************************************************/
730
-	case 53:
731
-		// get the settings editor
732
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
733
-		include_once(includeFileProcessor("actions/sysinfo.static.php",$manager_theme));
734
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
735
-	break;
730
+    case 53:
731
+        // get the settings editor
732
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
733
+        include_once(includeFileProcessor("actions/sysinfo.static.php",$manager_theme));
734
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
735
+    break;
736 736
 /********************************************************************/
737 737
 /* optimise table                                               */
738 738
 /********************************************************************/
739
-	case 54:
740
-		// get the table optimizer/truncate processor
741
-		include_once(includeFileProcessor("processors/optimize_table.processor.php",$manager_theme));
742
-	break;
739
+    case 54:
740
+        // get the table optimizer/truncate processor
741
+        include_once(includeFileProcessor("processors/optimize_table.processor.php",$manager_theme));
742
+    break;
743 743
 /********************************************************************/
744 744
 /* view logging                                                     */
745 745
 /********************************************************************/
746
-	case 13:
747
-		// view logging
748
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
749
-		include_once(includeFileProcessor("actions/logging.static.php",$manager_theme));
750
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
751
-	break;
746
+    case 13:
747
+        // view logging
748
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
749
+        include_once(includeFileProcessor("actions/logging.static.php",$manager_theme));
750
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
751
+    break;
752 752
 /********************************************************************/
753 753
 /* empty logs                                                       */
754 754
 /********************************************************************/
755
-	case 55:
756
-		// get the settings editor
757
-		include_once(includeFileProcessor("processors/empty_table.processor.php",$manager_theme));
758
-	break;
755
+    case 55:
756
+        // get the settings editor
757
+        include_once(includeFileProcessor("processors/empty_table.processor.php",$manager_theme));
758
+    break;
759 759
 /********************************************************************/
760 760
 /* calls test page                                                      */
761 761
 /********************************************************************/
762
-	case 999:
763
-		// get the test page
764
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
765
-		include_once(includeFileProcessor("test_page.php",$manager_theme));
766
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
767
-	break;
762
+    case 999:
763
+        // get the test page
764
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
765
+        include_once(includeFileProcessor("test_page.php",$manager_theme));
766
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
767
+    break;
768 768
 /********************************************************************/
769 769
 /* Empty recycle bin                                                */
770 770
 /********************************************************************/
771
-	case 64:
772
-		// get the Recycle bin emptier
773
-		include_once(includeFileProcessor("processors/remove_content.processor.php",$manager_theme));
774
-	break;
771
+    case 64:
772
+        // get the Recycle bin emptier
773
+        include_once(includeFileProcessor("processors/remove_content.processor.php",$manager_theme));
774
+    break;
775 775
 /********************************************************************/
776 776
 /* Messages                                                     */
777 777
 /********************************************************************/
778
-	case 10:
779
-		// get the messages page
780
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
781
-		include_once(includeFileProcessor("actions/messages.static.php",$manager_theme));
782
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
783
-	break;
778
+    case 10:
779
+        // get the messages page
780
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
781
+        include_once(includeFileProcessor("actions/messages.static.php",$manager_theme));
782
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
783
+    break;
784 784
 /********************************************************************/
785 785
 /* Delete a message                                                 */
786 786
 /********************************************************************/
787
-	case 65:
788
-		// get the message deleter
789
-		include_once(includeFileProcessor("processors/delete_message.processor.php",$manager_theme));
790
-	break;
787
+    case 65:
788
+        // get the message deleter
789
+        include_once(includeFileProcessor("processors/delete_message.processor.php",$manager_theme));
790
+    break;
791 791
 /********************************************************************/
792 792
 /* Send a message                                                   */
793 793
 /********************************************************************/
794
-	case 66:
795
-		// get the message deleter
796
-		include_once(includeFileProcessor("processors/send_message.processor.php",$manager_theme));
797
-	break;
794
+    case 66:
795
+        // get the message deleter
796
+        include_once(includeFileProcessor("processors/send_message.processor.php",$manager_theme));
797
+    break;
798 798
 /********************************************************************/
799 799
 /* Remove locks                                                 */
800 800
 /********************************************************************/
801
-	case 67:
802
-		// get the lock remover
803
-		include_once(includeFileProcessor("processors/remove_locks.processor.php",$manager_theme));
804
-	break;
801
+    case 67:
802
+        // get the lock remover
803
+        include_once(includeFileProcessor("processors/remove_locks.processor.php",$manager_theme));
804
+    break;
805 805
 /********************************************************************/
806 806
 /* Site schedule                                                    */
807 807
 /********************************************************************/
808
-	case 70:
809
-		// get the schedule page
810
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
811
-		include_once(includeFileProcessor("actions/site_schedule.static.php",$manager_theme));
812
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
813
-	break;
808
+    case 70:
809
+        // get the schedule page
810
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
811
+        include_once(includeFileProcessor("actions/site_schedule.static.php",$manager_theme));
812
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
813
+    break;
814 814
 /********************************************************************/
815 815
 /* Search                                                           */
816 816
 /********************************************************************/
817
-	case 71:
818
-		// get the search page
819
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
820
-		include_once(includeFileProcessor("actions/search.static.php",$manager_theme));
821
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
822
-	break;
817
+    case 71:
818
+        // get the search page
819
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
820
+        include_once(includeFileProcessor("actions/search.static.php",$manager_theme));
821
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
822
+    break;
823 823
 /********************************************************************/
824 824
 /* About                                                            */
825 825
 /********************************************************************/
826
-	case 59:
827
-		// get the about page
828
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
829
-		include_once(includeFileProcessor("actions/about.static.php",$manager_theme));
830
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
831
-	break;
826
+    case 59:
827
+        // get the about page
828
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
829
+        include_once(includeFileProcessor("actions/about.static.php",$manager_theme));
830
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
831
+    break;
832 832
 /********************************************************************/
833 833
 /* Add weblink                                                          */
834 834
 /********************************************************************/
835
-	case 72:
836
-		// get the weblink page
837
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
838
-		include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme));
839
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
840
-	break;
835
+    case 72:
836
+        // get the weblink page
837
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
838
+        include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme));
839
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
840
+    break;
841 841
 /********************************************************************/
842 842
 /* User management                                                  */
843 843
 /********************************************************************/
844
-	case 75:
845
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
846
-		include_once(includeFileProcessor("actions/user_management.static.php",$manager_theme));
847
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
848
-	break;
849
-	case 99:
850
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
851
-		include_once(includeFileProcessor("actions/web_user_management.static.php",$manager_theme));
852
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
853
-	break;
854
-	case 86:
855
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
856
-		include_once(includeFileProcessor("actions/role_management.static.php",$manager_theme));
857
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
858
-	break;
844
+    case 75:
845
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
846
+        include_once(includeFileProcessor("actions/user_management.static.php",$manager_theme));
847
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
848
+    break;
849
+    case 99:
850
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
851
+        include_once(includeFileProcessor("actions/web_user_management.static.php",$manager_theme));
852
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
853
+    break;
854
+    case 86:
855
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
856
+        include_once(includeFileProcessor("actions/role_management.static.php",$manager_theme));
857
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
858
+    break;
859 859
 /********************************************************************/
860 860
 /* template/ snippet management                                                 */
861 861
 /********************************************************************/
862
-	case 76:
863
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
864
-		include_once(includeFileProcessor("actions/resources.static.php",$manager_theme));
865
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
866
-	break;
862
+    case 76:
863
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
864
+        include_once(includeFileProcessor("actions/resources.static.php",$manager_theme));
865
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
866
+    break;
867 867
 /********************************************************************/
868 868
 /* Export to file                                                   */
869 869
 /********************************************************************/
870
-	case 83:
871
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
872
-		include_once(includeFileProcessor("actions/export_site.static.php",$manager_theme));
873
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
874
-	break;
870
+    case 83:
871
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
872
+        include_once(includeFileProcessor("actions/export_site.static.php",$manager_theme));
873
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
874
+    break;
875 875
 /********************************************************************/
876 876
 /* Resource Selector                                                    */
877 877
 /********************************************************************/
878
-	case 84:
879
-		include_once(includeFileProcessor("actions/resource_selector.static.php",$manager_theme));
880
-	break;
878
+    case 84:
879
+        include_once(includeFileProcessor("actions/resource_selector.static.php",$manager_theme));
880
+    break;
881 881
 /********************************************************************/
882 882
 /* Backup Manager                                                   */
883 883
 /********************************************************************/
884
-	case 93:
885
-		# header and footer will be handled interally
886
-		include_once(includeFileProcessor("actions/bkmanager.static.php",$manager_theme));
887
-	break;
884
+    case 93:
885
+        # header and footer will be handled interally
886
+        include_once(includeFileProcessor("actions/bkmanager.static.php",$manager_theme));
887
+    break;
888 888
 /********************************************************************/
889 889
 /* Duplicate Document                                                   */
890 890
 /********************************************************************/
891
-	case 94:
892
-		// get the duplicate processor
893
-		include_once(includeFileProcessor("processors/duplicate_content.processor.php",$manager_theme));
894
-	break;
891
+    case 94:
892
+        // get the duplicate processor
893
+        include_once(includeFileProcessor("processors/duplicate_content.processor.php",$manager_theme));
894
+    break;
895 895
 /********************************************************************/
896 896
 /* Import Document from file                                        */
897 897
 /********************************************************************/
898
-	case 95:
899
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
900
-		include_once(includeFileProcessor("actions/import_site.static.php",$manager_theme));
901
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
902
-	break;
898
+    case 95:
899
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
900
+        include_once(includeFileProcessor("actions/import_site.static.php",$manager_theme));
901
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
902
+    break;
903 903
 /********************************************************************/
904 904
 /* Help                                                             */
905 905
 /********************************************************************/
906
-	case 9:
907
-		// get the help page
908
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
909
-		include_once(includeFileProcessor("actions/help.static.php",$manager_theme));
910
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
911
-	break;
906
+    case 9:
907
+        // get the help page
908
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
909
+        include_once(includeFileProcessor("actions/help.static.php",$manager_theme));
910
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
911
+    break;
912 912
 /********************************************************************/
913 913
 /* Template Variables - Based on Apodigm's Docvars                  */
914 914
 /********************************************************************/
915
-	case 300:
916
-		// get the new document variable action
917
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
918
-		include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php",$manager_theme));
919
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
920
-	break;
921
-	case 301:
922
-		// get the edit document variable action
923
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
924
-		include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php",$manager_theme));
925
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
926
-	break;
927
-	case 302:
928
-		// get the save processor
929
-		include_once(includeFileProcessor("processors/save_tmplvars.processor.php",$manager_theme));
930
-	break;
931
-	case 303:
932
-		// get the delete processor
933
-		include_once(includeFileProcessor("processors/delete_tmplvars.processor.php",$manager_theme));
934
-	break;
935
-	case 304:
936
-		// get the duplicate processor
937
-		include_once(includeFileProcessor("processors/duplicate_tmplvars.processor.php",$manager_theme));
938
-	break;
939
-	case 305:
940
-		// get the tv-rank action
941
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
942
-		include_once(includeFileProcessor("actions/mutate_tv_rank.dynamic.php",$manager_theme));
943
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
944
-	break;
915
+    case 300:
916
+        // get the new document variable action
917
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
918
+        include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php",$manager_theme));
919
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
920
+    break;
921
+    case 301:
922
+        // get the edit document variable action
923
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
924
+        include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php",$manager_theme));
925
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
926
+    break;
927
+    case 302:
928
+        // get the save processor
929
+        include_once(includeFileProcessor("processors/save_tmplvars.processor.php",$manager_theme));
930
+    break;
931
+    case 303:
932
+        // get the delete processor
933
+        include_once(includeFileProcessor("processors/delete_tmplvars.processor.php",$manager_theme));
934
+    break;
935
+    case 304:
936
+        // get the duplicate processor
937
+        include_once(includeFileProcessor("processors/duplicate_tmplvars.processor.php",$manager_theme));
938
+    break;
939
+    case 305:
940
+        // get the tv-rank action
941
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
942
+        include_once(includeFileProcessor("actions/mutate_tv_rank.dynamic.php",$manager_theme));
943
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
944
+    break;
945 945
 /********************************************************************/
946 946
 /* Event viewer: show event message log                             */
947 947
 /********************************************************************/
948
-	case 114:
949
-		// get event logs
950
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
951
-		include_once(includeFileProcessor("actions/eventlog.dynamic.php",$manager_theme));
952
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
953
-	break;
954
-	case 115:
955
-		// get event log details viewer
956
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
957
-		include_once(includeFileProcessor("actions/eventlog_details.dynamic.php",$manager_theme));
958
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
959
-	break;
960
-	case 116:
961
-		// get the event log delete processor
962
-		include_once(includeFileProcessor("processors/delete_eventlog.processor.php",$manager_theme));
963
-	break;
964
-
965
-	case 501:
966
-		//delete category
967
-		include_once(includeFileProcessor("processors/delete_category.processor.php",$manager_theme));
968
-	break;
948
+    case 114:
949
+        // get event logs
950
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
951
+        include_once(includeFileProcessor("actions/eventlog.dynamic.php",$manager_theme));
952
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
953
+    break;
954
+    case 115:
955
+        // get event log details viewer
956
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
957
+        include_once(includeFileProcessor("actions/eventlog_details.dynamic.php",$manager_theme));
958
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
959
+    break;
960
+    case 116:
961
+        // get the event log delete processor
962
+        include_once(includeFileProcessor("processors/delete_eventlog.processor.php",$manager_theme));
963
+    break;
964
+
965
+    case 501:
966
+        //delete category
967
+        include_once(includeFileProcessor("processors/delete_category.processor.php",$manager_theme));
968
+    break;
969 969
 /********************************************************************/
970 970
 /* default action: show not implemented message                     */
971 971
 /********************************************************************/
972
-	default :
973
-		// say that what was requested doesn't do anything yet
974
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
975
-		echo "
972
+    default :
973
+        // say that what was requested doesn't do anything yet
974
+        include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
975
+        echo "
976 976
 			<div class='sectionHeader'>".$_lang['functionnotimpl']."</div>
977 977
 			<div class='sectionBody'>
978 978
 				<p>".$_lang['functionnotimpl_message']."</p>
979 979
 			</div>
980 980
 		";
981
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
981
+        include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
982 982
 }
983 983
 
984 984
 /********************************************************************/
985 985
 // log action, unless it's a frame request
986 986
 if($action!=1 && $action!=7 && $action!=2) {
987
-	include_once "log.class.inc.php";
988
-	$log = new logHandler;
989
-	$log->initAndWriteLog();
987
+    include_once "log.class.inc.php";
988
+    $log = new logHandler;
989
+    $log->initAndWriteLog();
990 990
 }
991 991
 /********************************************************************/
992 992
 // show debug
Please login to merge, or discard this patch.
index.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 
48 48
 $autoloader = __DIR__.'/vendor/autoload.php';
49 49
 if (file_exists($autoloader) && is_readable($autoloader)) {
50
-	include_once($autoloader);
50
+    include_once($autoloader);
51 51
 }
52 52
 
53 53
 if(!isset($_SERVER['REQUEST_TIME_FLOAT'])) $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true);
@@ -56,11 +56,11 @@  discard block
 block discarded – undo
56 56
 if(is_file($base_path . 'assets/cache/siteManager.php'))
57 57
     include_once($base_path . 'assets/cache/siteManager.php');
58 58
 if(!defined('MGR_DIR') && is_dir("{$base_path}manager"))
59
-	define('MGR_DIR', 'manager');
59
+    define('MGR_DIR', 'manager');
60 60
 if(is_file($base_path . 'assets/cache/siteHostnames.php'))
61 61
     include_once($base_path . 'assets/cache/siteHostnames.php');
62 62
 if(!defined('MODX_SITE_HOSTNAMES'))
63
-	define('MODX_SITE_HOSTNAMES', '');
63
+    define('MODX_SITE_HOSTNAMES', '');
64 64
 
65 65
 // get start time
66 66
 $mstart = memory_get_usage();
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 
85 85
 define('IN_PARSER_MODE', true);
86 86
 if ( ! defined('IN_MANAGER_MODE')) {
87
-	define('IN_MANAGER_MODE', false);
87
+    define('IN_MANAGER_MODE', false);
88 88
 }
89 89
 if (!defined('MODX_API_MODE')) {
90 90
     define('MODX_API_MODE', false);
@@ -92,12 +92,12 @@  discard block
 block discarded – undo
92 92
 
93 93
 // get the required includes
94 94
 if(!isset($database_user) || $database_user=="") {
95
-	$rt = @include_once(dirname(__FILE__).'/'.MGR_DIR.'/includes/config.inc.php');
96
-	// Be sure config.inc.php is there and that it contains some important values
97
-	if(!$rt || !$database_type || !$database_server || !$database_user || !$dbase) {
98
-		readfile('install/not_installed.tpl');
99
-		exit;
100
-	}
95
+    $rt = @include_once(dirname(__FILE__).'/'.MGR_DIR.'/includes/config.inc.php');
96
+    // Be sure config.inc.php is there and that it contains some important values
97
+    if(!$rt || !$database_type || !$database_server || !$database_user || !$dbase) {
98
+        readfile('install/not_installed.tpl');
99
+        exit;
100
+    }
101 101
 }
102 102
 
103 103
 // start session
@@ -105,11 +105,11 @@  discard block
 block discarded – undo
105 105
 
106 106
 // initiate a new document parser
107 107
 if (isset($coreClass) && class_exists($coreClass)) {
108
-	$modx = new $coreClass;
108
+    $modx = new $coreClass;
109 109
 }
110 110
 if (!isset($modx) || !($modx instanceof \DocumentParser)) {
111
-	include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php');
112
-	$modx = DocumentParser::getInstance();
111
+    include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php');
112
+    $modx = DocumentParser::getInstance();
113 113
 }
114 114
 
115 115
 // set some parser options
Please login to merge, or discard this patch.