Completed
Push — develop ( 663a1f...4a4b5c )
by Agel_Nash
15s
created
manager/actions/mutate_tv_rank.dynamic.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if (!$modx->hasPermission('save_template')) {
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 $updateMsg = '';
16 16
 
17 17
 if (isset($_POST['listSubmitted'])) {
18
-    $updateMsg .= '<span class="text-success" id="updated">' . $_lang['sort_updated'] . '</span>';
18
+    $updateMsg .= '<span class="text-success" id="updated">'.$_lang['sort_updated'].'</span>';
19 19
     foreach ($_POST as $listName => $listValue) {
20 20
         if ($listName == 'listSubmitted' || $listName == 'reset') {
21 21
             continue;
@@ -40,11 +40,11 @@  discard block
 block discarded – undo
40 40
     $sortableList = '<div class="clearfix"><ul id="sortlist" class="sortableList">';
41 41
     while ($row = $modx->db->getRow($rs)) {
42 42
         $caption = $row['caption'] != '' ? $row['caption'] : $row['name'];
43
-        $sortableList .= '<li id="item_' . $row['id'] . '"><i class="fa fa-list-alt"></i> ' . $caption . ' <small class="protectedNode" style="float:right">[*' . $row['name'] . '*]</small></li>';
43
+        $sortableList .= '<li id="item_'.$row['id'].'"><i class="fa fa-list-alt"></i> '.$caption.' <small class="protectedNode" style="float:right">[*'.$row['name'].'*]</small></li>';
44 44
     }
45 45
     $sortableList .= '</ul></div>';
46 46
 } else {
47
-    $updateMsg = '<p class="text-danger">' . $_lang['tmplvars_novars'] . '</p>';
47
+    $updateMsg = '<p class="text-danger">'.$_lang['tmplvars_novars'].'</p>';
48 48
 }
49 49
 ?>
50 50
 
Please login to merge, or discard this patch.
manager/actions/help/03Version_Notices.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
     usort($notices, 'version_compare');
16 16
     $notices = array_reverse($notices);
17 17
 
18
-    foreach($notices as $v) {
18
+    foreach ($notices as $v) {
19 19
         if ($v >= '1.3.0') {
20 20
             $cms = 'EVO';
21 21
         }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,8 +18,7 @@
 block discarded – undo
18 18
     foreach($notices as $v) {
19 19
         if ($v >= '1.3.0') {
20 20
             $cms = 'EVO';
21
-        }
22
-        else {
21
+        } else {
23 22
             $cms = 'MODX EVO';
24 23
         }
25 24
         echo '<div class="sectionHeader"> '.$cms.' '.$v.'</div><div class="sectionBody">';
Please login to merge, or discard this patch.
manager/actions/help/01About_EVO.php 3 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -4,38 +4,38 @@
 block discarded – undo
4 4
 }
5 5
 $logo= '<img src="media/style/default/images/misc/login-logo.png" height="54" width="358" border="0">';
6 6
 $downloadLinks = array(
7
-	0=>array('title'=>$_lang["information"],'link'=>'https://evo.im/'),
8
-	1=>array('title'=>$_lang["download"],'link'=>'https://github.com/evolution-cms/evolution/releases'),
9
-	2=>array('title'=>$_lang["previous_releases"],'link'=>'https://modx.com/download/evolution/previous-releases.html'),
10
-	3=>array('title'=>$_lang["extras"],'link'=>array(
11
-		'http://extras.evolution-cms.com/',
12
-		'https://github.com/extras-evolution'
13
-	)),
7
+    0=>array('title'=>$_lang["information"],'link'=>'https://evo.im/'),
8
+    1=>array('title'=>$_lang["download"],'link'=>'https://github.com/evolution-cms/evolution/releases'),
9
+    2=>array('title'=>$_lang["previous_releases"],'link'=>'https://modx.com/download/evolution/previous-releases.html'),
10
+    3=>array('title'=>$_lang["extras"],'link'=>array(
11
+        'http://extras.evolution-cms.com/',
12
+        'https://github.com/extras-evolution'
13
+    )),
14 14
 );
15 15
 
16 16
 $translationLinks = array(
17
-	0=>array('title'=>'Evolution CMS','link'=>'https://www.transifex.com/evolutioncms/evolution/'),
18
-	1=>array('title'=>$_lang["extras"],'link'=>'https://www.transifex.com/evolutioncms/extras/'),
17
+    0=>array('title'=>'Evolution CMS','link'=>'https://www.transifex.com/evolutioncms/evolution/'),
18
+    1=>array('title'=>$_lang["extras"],'link'=>'https://www.transifex.com/evolutioncms/extras/'),
19 19
 );
20 20
 
21 21
 function createList($sectionHeader, $linkArr) {
22
-	$output = '<div class="sectionHeader">'.$sectionHeader.'</div><div class="sectionBody">'."\n";
23
-	$output .= '<table width="500"  border="0" cellspacing="0" cellpadding="0">'."\n";
24
-	$links = '';
25
-	foreach($linkArr as $row) {
26
-		if (!is_array($row['link'])) $row['link'] = array($row['link']);
27
-		foreach ($row['link'] as $link) {
28
-			$links .= $links != '' ? '<br/>' : '';
29
-			$links .= '<a href="' . $link . '" target="_blank">' . $link . '</a>';
30
-		}
31
-		$output .= '
22
+    $output = '<div class="sectionHeader">'.$sectionHeader.'</div><div class="sectionBody">'."\n";
23
+    $output .= '<table width="500"  border="0" cellspacing="0" cellpadding="0">'."\n";
24
+    $links = '';
25
+    foreach($linkArr as $row) {
26
+        if (!is_array($row['link'])) $row['link'] = array($row['link']);
27
+        foreach ($row['link'] as $link) {
28
+            $links .= $links != '' ? '<br/>' : '';
29
+            $links .= '<a href="' . $link . '" target="_blank">' . $link . '</a>';
30
+        }
31
+        $output .= '
32 32
 		<tr>
33 33
 			<td align="left"><strong>' . $row["title"] . '</strong></td>
34 34
 			<td align="left">' . $links . '</td>
35 35
 		</tr>';
36
-		$links = '';
37
-	}
38
-	$output .= '</table></div>'."\n";
36
+        $links = '';
37
+    }
38
+    $output .= '</table></div>'."\n";
39 39
     return $output;
40 40
 }
41 41
 echo $logo;
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,37 +1,37 @@
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-$logo= '<img src="media/style/default/images/misc/login-logo.png" height="54" width="358" border="0">';
5
+$logo = '<img src="media/style/default/images/misc/login-logo.png" height="54" width="358" border="0">';
6 6
 $downloadLinks = array(
7
-	0=>array('title'=>$_lang["information"],'link'=>'https://evo.im/'),
8
-	1=>array('title'=>$_lang["download"],'link'=>'https://github.com/evolution-cms/evolution/releases'),
9
-	2=>array('title'=>$_lang["previous_releases"],'link'=>'https://modx.com/download/evolution/previous-releases.html'),
10
-	3=>array('title'=>$_lang["extras"],'link'=>array(
7
+	0=>array('title'=>$_lang["information"], 'link'=>'https://evo.im/'),
8
+	1=>array('title'=>$_lang["download"], 'link'=>'https://github.com/evolution-cms/evolution/releases'),
9
+	2=>array('title'=>$_lang["previous_releases"], 'link'=>'https://modx.com/download/evolution/previous-releases.html'),
10
+	3=>array('title'=>$_lang["extras"], 'link'=>array(
11 11
 		'http://extras.evolution-cms.com/',
12 12
 		'https://github.com/extras-evolution'
13 13
 	)),
14 14
 );
15 15
 
16 16
 $translationLinks = array(
17
-	0=>array('title'=>'Evolution CMS','link'=>'https://www.transifex.com/evolutioncms/evolution/'),
18
-	1=>array('title'=>$_lang["extras"],'link'=>'https://www.transifex.com/evolutioncms/extras/'),
17
+	0=>array('title'=>'Evolution CMS', 'link'=>'https://www.transifex.com/evolutioncms/evolution/'),
18
+	1=>array('title'=>$_lang["extras"], 'link'=>'https://www.transifex.com/evolutioncms/extras/'),
19 19
 );
20 20
 
21
-function createList($sectionHeader, $linkArr) {
21
+function createList($sectionHeader, $linkArr){
22 22
 	$output = '<div class="sectionHeader">'.$sectionHeader.'</div><div class="sectionBody">'."\n";
23 23
 	$output .= '<table width="500"  border="0" cellspacing="0" cellpadding="0">'."\n";
24 24
 	$links = '';
25
-	foreach($linkArr as $row) {
25
+	foreach ($linkArr as $row) {
26 26
 		if (!is_array($row['link'])) $row['link'] = array($row['link']);
27 27
 		foreach ($row['link'] as $link) {
28 28
 			$links .= $links != '' ? '<br/>' : '';
29
-			$links .= '<a href="' . $link . '" target="_blank">' . $link . '</a>';
29
+			$links .= '<a href="'.$link.'" target="_blank">'.$link.'</a>';
30 30
 		}
31 31
 		$output .= '
32 32
 		<tr>
33
-			<td align="left"><strong>' . $row["title"] . '</strong></td>
34
-			<td align="left">' . $links . '</td>
33
+			<td align="left"><strong>' . $row["title"].'</strong></td>
34
+			<td align="left">' . $links.'</td>
35 35
 		</tr>';
36 36
 		$links = '';
37 37
 	}
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,12 +18,15 @@
 block discarded – undo
18 18
 	1=>array('title'=>$_lang["extras"],'link'=>'https://www.transifex.com/evolutioncms/extras/'),
19 19
 );
20 20
 
21
-function createList($sectionHeader, $linkArr) {
21
+function createList($sectionHeader, $linkArr)
22
+{
22 23
 	$output = '<div class="sectionHeader">'.$sectionHeader.'</div><div class="sectionBody">'."\n";
23 24
 	$output .= '<table width="500"  border="0" cellspacing="0" cellpadding="0">'."\n";
24 25
 	$links = '';
25 26
 	foreach($linkArr as $row) {
26
-		if (!is_array($row['link'])) $row['link'] = array($row['link']);
27
+		if (!is_array($row['link'])) {
28
+		    $row['link'] = array($row['link']);
29
+		}
27 30
 		foreach ($row['link'] as $link) {
28 31
 			$links .= $links != '' ? '<br/>' : '';
29 32
 			$links .= '<a href="' . $link . '" target="_blank">' . $link . '</a>';
Please login to merge, or discard this patch.
manager/actions/help/04Changelog.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@
 block discarded – undo
7 7
 <div class="sectionHeader">Changelog</div>
8 8
 <div class="sectionBody">
9 9
 <?php
10
-	$changeLog = MODX_BASE_PATH . 'assets/docs/changelog.txt';
11
-	if(is_readable($changeLog))
12
-		echo str_replace("\n",'<br>',file_get_contents($changeLog));
10
+    $changeLog = MODX_BASE_PATH . 'assets/docs/changelog.txt';
11
+    if(is_readable($changeLog))
12
+        echo str_replace("\n",'<br>',file_get_contents($changeLog));
13 13
 ?>
14 14
 </div>
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 ?>
@@ -7,8 +7,8 @@  discard block
 block discarded – undo
7 7
 <div class="sectionHeader">Changelog</div>
8 8
 <div class="sectionBody">
9 9
 <?php
10
-	$changeLog = MODX_BASE_PATH . 'assets/docs/changelog.txt';
11
-	if(is_readable($changeLog))
12
-		echo str_replace("\n",'<br>',file_get_contents($changeLog));
10
+	$changeLog = MODX_BASE_PATH.'assets/docs/changelog.txt';
11
+	if (is_readable($changeLog))
12
+		echo str_replace("\n", '<br>', file_get_contents($changeLog));
13 13
 ?>
14 14
 </div>
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,7 +8,8 @@
 block discarded – undo
8 8
 <div class="sectionBody">
9 9
 <?php
10 10
 	$changeLog = MODX_BASE_PATH . 'assets/docs/changelog.txt';
11
-	if(is_readable($changeLog))
12
-		echo str_replace("\n",'<br>',file_get_contents($changeLog));
13
-?>
11
+	if(is_readable($changeLog)) {
12
+			echo str_replace("\n",'<br>',file_get_contents($changeLog));
13
+	}
14
+	?>
14 15
 </div>
Please login to merge, or discard this patch.
manager/actions/resources/tab2_templatevars.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <!-- Template variables -->
2 2
 <?php
3
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
4 4
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
5 5
 }
6 6
 
Please login to merge, or discard this patch.
manager/actions/resources/tab3_chunks.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <!-- chunks -->
2 2
 <?php
3
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
4 4
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
5 5
 }
6 6
 
Please login to merge, or discard this patch.
manager/actions/resources/tab6_categoryview.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 } ?>
5 5
 
Please login to merge, or discard this patch.
manager/actions/resources/tab4_snippets.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <!-- snippets -->
2 2
 <?php
3
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
4 4
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
5 5
 }
6 6
 
Please login to merge, or discard this patch.
manager/actions/resources/functions.inc.php 3 patches
Indentation   +214 added lines, -214 removed lines patch added patch discarded remove patch
@@ -1,239 +1,239 @@
 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
 $tpl = array(
7
-	'viewForm' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_viewForm.tpl'),
8
-	'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'),
9
-	'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'),
10
-	'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'),
11
-	'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl')
7
+    'viewForm' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_viewForm.tpl'),
8
+    'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'),
9
+    'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'),
10
+    'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'),
11
+    'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl')
12 12
 );
13 13
 
14 14
 function parsePh($tpl, $ph) {
15
-	global $modx, $_lang;
16
-	$tpl = $modx->parseText($tpl, $_lang, '[%', '%]');
17
-	return $modx->parseText($tpl, $ph);
15
+    global $modx, $_lang;
16
+    $tpl = $modx->parseText($tpl, $_lang, '[%', '%]');
17
+    return $modx->parseText($tpl, $ph);
18 18
 }
19 19
 
20 20
 function renderViewSwitchButtons($cssId) {
21
-	global $modx, $_lang, $tpl;
21
+    global $modx, $_lang, $tpl;
22 22
 
23
-	return parsePh($tpl['viewForm'], array(
24
-		'cssId' => $cssId
25
-	));
23
+    return parsePh($tpl['viewForm'], array(
24
+        'cssId' => $cssId
25
+    ));
26 26
 }
27 27
 
28 28
 function createResourceList($resourceTable, $resources) {
29
-	global $modx, $_lang, $_style, $modx_textdir, $tpl;
30
-
31
-	$items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false;
32
-
33
-	if( ! is_array($items) || empty($items)) {
34
-		return $_lang['no_results'];
35
-	}
36
-
37
-	// Prepare elements- and categories-list
38
-	$elements = array();
39
-	$categories = array();
40
-	foreach($items as $row) {
41
-		$catid = $row['catid'] ? $row['catid'] : 0;
42
-		$categories[$catid] = array('name' => stripslashes($row['category']));
43
-		$elements[$catid][] = prepareElementRowPh($row, $resourceTable, $resources);
44
-	}
45
-
46
-	// Now render categories / panel-collapse
47
-	$panelGroup = '';
48
-	foreach($elements as $catid => $elList) {
49
-		// Add panel-heading / category-collapse to output
50
-		$panelGroup .= parsePh($tpl['panelHeading'], array(
51
-			'tab' => $resourceTable,
52
-			'category' => $categories[$catid]['name'],
53
-			'categoryid' => $catid != '' ? ' <small>(' . $catid . ')</small>' : '',
54
-			'catid' => $catid,
55
-		));
56
-
57
-		// Prepare content for panel-collapse
58
-		$panelCollapse = '';
59
-		foreach($elList as $el) {
60
-			$panelCollapse .= parsePh($tpl['elementsRow'], $el);
61
-		}
62
-
63
-		// Add panel-collapse with elements to output
64
-		$panelGroup .= parsePh($tpl['panelCollapse'], array(
65
-			'tab' => $resourceTable,
66
-			'catid' => $catid,
67
-			'wrapper' => $panelCollapse,
68
-		));
69
-	}
70
-
71
-	return parsePh($tpl['panelGroup'], array(
72
-		'resourceTable' => $resourceTable,
73
-		'wrapper' => $panelGroup
74
-	));
29
+    global $modx, $_lang, $_style, $modx_textdir, $tpl;
30
+
31
+    $items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false;
32
+
33
+    if( ! is_array($items) || empty($items)) {
34
+        return $_lang['no_results'];
35
+    }
36
+
37
+    // Prepare elements- and categories-list
38
+    $elements = array();
39
+    $categories = array();
40
+    foreach($items as $row) {
41
+        $catid = $row['catid'] ? $row['catid'] : 0;
42
+        $categories[$catid] = array('name' => stripslashes($row['category']));
43
+        $elements[$catid][] = prepareElementRowPh($row, $resourceTable, $resources);
44
+    }
45
+
46
+    // Now render categories / panel-collapse
47
+    $panelGroup = '';
48
+    foreach($elements as $catid => $elList) {
49
+        // Add panel-heading / category-collapse to output
50
+        $panelGroup .= parsePh($tpl['panelHeading'], array(
51
+            'tab' => $resourceTable,
52
+            'category' => $categories[$catid]['name'],
53
+            'categoryid' => $catid != '' ? ' <small>(' . $catid . ')</small>' : '',
54
+            'catid' => $catid,
55
+        ));
56
+
57
+        // Prepare content for panel-collapse
58
+        $panelCollapse = '';
59
+        foreach($elList as $el) {
60
+            $panelCollapse .= parsePh($tpl['elementsRow'], $el);
61
+        }
62
+
63
+        // Add panel-collapse with elements to output
64
+        $panelGroup .= parsePh($tpl['panelCollapse'], array(
65
+            'tab' => $resourceTable,
66
+            'catid' => $catid,
67
+            'wrapper' => $panelCollapse,
68
+        ));
69
+    }
70
+
71
+    return parsePh($tpl['panelGroup'], array(
72
+        'resourceTable' => $resourceTable,
73
+        'wrapper' => $panelGroup
74
+    ));
75 75
 }
76 76
 
77 77
 function createCombinedView($resources) {
78
-	global $modx, $_lang, $_style, $modx_textdir;
79
-
80
-	$itemsPerCategory = isset($resources->itemsPerCategory) ? $resources->itemsPerCategory : false;
81
-	$types = isset($resources->types) ? $resources->types : false;
82
-	$categories = isset($resources->categories) ? $resources->categories : false;
83
-
84
-	if(!$itemsPerCategory) {
85
-		return $_lang['no_results'];
86
-	}
87
-
88
-	$tpl = array(
89
-		'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'),
90
-		'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'),
91
-		'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'),
92
-		'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl'),
93
-	);
94
-
95
-	// Easily loop through $itemsPerCategory-Array
96
-	$panelGroup = '';
97
-	foreach($categories as $catid => $category) {
98
-		// Prepare collapse content / elements-list
99
-		$panelCollapse = '';
100
-		foreach($itemsPerCategory[$catid] as $el) {
101
-			$resourceTable = $el['type'];
102
-			$ph = prepareElementRowPh($el, $resourceTable, $resources);
103
-			$panelCollapse .= parsePh($tpl['elementsRow'], $ph);
104
-		}
105
-
106
-		// Add panel-heading / button
107
-		$panelGroup .= parsePh($tpl['panelHeading'], array(
108
-			'tab' => 'categories_list',
109
-			'category' => $categories[$catid],
110
-			'categoryid' => $catid != '' ? ' <small>(' . $catid . ')</small>' : '',
111
-			'catid' => $catid,
112
-		));
113
-
114
-		// Add panel
115
-		$panelGroup .= parsePh($tpl['panelCollapse'], array(
116
-			'tab' => 'categories_list',
117
-			'catid' => $catid,
118
-			'wrapper' => $panelCollapse,
119
-		));
120
-	}
121
-
122
-	return parsePh($tpl['panelGroup'], array(
123
-		'resourceTable' => 'categories_list',
124
-		'wrapper' => $panelGroup
125
-	));
78
+    global $modx, $_lang, $_style, $modx_textdir;
79
+
80
+    $itemsPerCategory = isset($resources->itemsPerCategory) ? $resources->itemsPerCategory : false;
81
+    $types = isset($resources->types) ? $resources->types : false;
82
+    $categories = isset($resources->categories) ? $resources->categories : false;
83
+
84
+    if(!$itemsPerCategory) {
85
+        return $_lang['no_results'];
86
+    }
87
+
88
+    $tpl = array(
89
+        'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'),
90
+        'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'),
91
+        'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'),
92
+        'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl'),
93
+    );
94
+
95
+    // Easily loop through $itemsPerCategory-Array
96
+    $panelGroup = '';
97
+    foreach($categories as $catid => $category) {
98
+        // Prepare collapse content / elements-list
99
+        $panelCollapse = '';
100
+        foreach($itemsPerCategory[$catid] as $el) {
101
+            $resourceTable = $el['type'];
102
+            $ph = prepareElementRowPh($el, $resourceTable, $resources);
103
+            $panelCollapse .= parsePh($tpl['elementsRow'], $ph);
104
+        }
105
+
106
+        // Add panel-heading / button
107
+        $panelGroup .= parsePh($tpl['panelHeading'], array(
108
+            'tab' => 'categories_list',
109
+            'category' => $categories[$catid],
110
+            'categoryid' => $catid != '' ? ' <small>(' . $catid . ')</small>' : '',
111
+            'catid' => $catid,
112
+        ));
113
+
114
+        // Add panel
115
+        $panelGroup .= parsePh($tpl['panelCollapse'], array(
116
+            'tab' => 'categories_list',
117
+            'catid' => $catid,
118
+            'wrapper' => $panelCollapse,
119
+        ));
120
+    }
121
+
122
+    return parsePh($tpl['panelGroup'], array(
123
+        'resourceTable' => 'categories_list',
124
+        'wrapper' => $panelGroup
125
+    ));
126 126
 }
127 127
 
128 128
 function prepareElementRowPh($row, $resourceTable, $resources) {
129
-	global $modx, $modx_textdir, $_style, $_lang;
130
-
131
-	$types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false;
132
-
133
-	$class = '';
134
-	$_lang["confirm_delete"] = $_lang["delete"];
135
-
136
-	if($resourceTable == 'site_templates') {
137
-		$class = $row['selectable'] ? '' : 'disabledPlugin';
138
-		$lockElementType = 1;
139
-		$_lang["confirm_delete"] = $_lang["confirm_delete_template"];
140
-	}
141
-	if($resourceTable == 'site_tmplvars') {
142
-		$class = $row['reltpl'] ? '' : 'disabledPlugin';
143
-		$lockElementType = 2;
144
-		$_lang["confirm_delete"] = $_lang["confirm_delete_tmplvars"];
145
-	}
146
-	if($resourceTable == 'site_htmlsnippets') {
129
+    global $modx, $modx_textdir, $_style, $_lang;
130
+
131
+    $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false;
132
+
133
+    $class = '';
134
+    $_lang["confirm_delete"] = $_lang["delete"];
135
+
136
+    if($resourceTable == 'site_templates') {
137
+        $class = $row['selectable'] ? '' : 'disabledPlugin';
138
+        $lockElementType = 1;
139
+        $_lang["confirm_delete"] = $_lang["confirm_delete_template"];
140
+    }
141
+    if($resourceTable == 'site_tmplvars') {
142
+        $class = $row['reltpl'] ? '' : 'disabledPlugin';
143
+        $lockElementType = 2;
144
+        $_lang["confirm_delete"] = $_lang["confirm_delete_tmplvars"];
145
+    }
146
+    if($resourceTable == 'site_htmlsnippets') {
147 147
         $class = $row['disabled'] ? 'disabledPlugin' : '';
148
-		$lockElementType = 3;
149
-		$_lang["confirm_delete"] = $_lang["confirm_delete_htmlsnippet"];
150
-	}
151
-	if($resourceTable == 'site_snippets') {
148
+        $lockElementType = 3;
149
+        $_lang["confirm_delete"] = $_lang["confirm_delete_htmlsnippet"];
150
+    }
151
+    if($resourceTable == 'site_snippets') {
152 152
         $class = $row['disabled'] ? 'disabledPlugin' : '';
153
-		$lockElementType = 4;
154
-		$_lang["confirm_delete"] = $_lang["confirm_delete_snippet"];
155
-	}
156
-	if($resourceTable == 'site_plugins') {
157
-		$class = $row['disabled'] ? 'disabledPlugin' : '';
158
-		$lockElementType = 5;
159
-		$_lang["confirm_delete"] = $_lang["confirm_delete_plugin"];
160
-	}
161
-	if($resourceTable == 'site_modules') {
153
+        $lockElementType = 4;
154
+        $_lang["confirm_delete"] = $_lang["confirm_delete_snippet"];
155
+    }
156
+    if($resourceTable == 'site_plugins') {
157
+        $class = $row['disabled'] ? 'disabledPlugin' : '';
158
+        $lockElementType = 5;
159
+        $_lang["confirm_delete"] = $_lang["confirm_delete_plugin"];
160
+    }
161
+    if($resourceTable == 'site_modules') {
162 162
         $class = $row['disabled'] ? '' : 'disabledPlugin';
163
-		$_lang["confirm_delete"] = $_lang["confirm_delete_module"];
164
-	}
165
-
166
-	// Prepare displaying user-locks
167
-	$lockedByUser = '';
168
-	$rowLock = $modx->elementIsLocked($lockElementType, $row['id'], true);
169
-	if($rowLock && $modx->hasPermission('display_locks')) {
170
-		if($rowLock['sid'] == $modx->sid) {
171
-			$title = $modx->parseText($_lang["lock_element_editing"], array(
172
-				'element_type' => $_lang["lock_element_type_" . $lockElementType],
173
-				'lasthit_df' => $rowLock['lasthit_df']
174
-			));
175
-			$lockedByUser = '<span title="' . $title . '" class="editResource" style="cursor:context-menu;">' . $_style['tree_preview_resource'] . '</span>&nbsp;';
176
-		} else {
177
-			$title = $modx->parseText($_lang["lock_element_locked_by"], array(
178
-				'element_type' => $_lang["lock_element_type_" . $lockElementType],
179
-				'username' => $rowLock['username'],
180
-				'lasthit_df' => $rowLock['lasthit_df']
181
-			));
182
-			if($modx->hasPermission('remove_locks')) {
183
-				$lockedByUser = '<a href="javascript:;" onclick="unlockElement(' . $lockElementType . ', ' . $row['id'] . ', this);return false;" title="' . $title . '" class="lockedResource"><i class="' . $_style['icons_secured'] . '"></i></a>';
184
-			} else {
185
-				$lockedByUser = '<span title="' . $title . '" class="lockedResource" style="cursor:context-menu;"><i class="' . $_style['icons_secured'] . '"></i></span>';
186
-			}
187
-		}
188
-	}
189
-	if($lockedByUser) {
190
-		$lockedByUser = '<div class="lockCell">' . $lockedByUser . '</div>';
191
-	}
192
-
193
-	// Caption
194
-	if($resourceTable == 'site_tmplvars') {
195
-		$caption = !empty($row['description']) ? ' ' . $row['caption'] . ' &nbsp; <small>(' . $row['description'] . ')</small>' : ' ' . $row['caption'];
196
-	} else {
197
-		$caption = !empty($row['description']) ? ' ' . $row['description'] : '';
198
-	}
199
-
200
-	// Special marks
201
-	$tplInfo = array();
202
-	if($row['locked']) {
203
-		$tplInfo[] = $_lang['locked'];
204
-	}
205
-	if($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') {
206
-		$tplInfo[] = $_lang['defaulttemplate_title'];
207
-	}
208
-	$marks = !empty($tplInfo) ? ' <em>(' . join(', ', $tplInfo) . ')</em>' : '';
209
-
210
-	/* row buttons */
211
-	$buttons = '';
212
-	if($modx->hasPermission($types['actions']['edit'][1])) {
213
-		$buttons .= '<li><a title="' . $_lang["edit_resource"] . '" href="index.php?a=' . $types['actions']['edit'][0] . '&amp;id=' . $row['id'] . '"><i class="fa fa-edit fa-fw"></i></a></li>';
214
-	}
215
-	if($modx->hasPermission($types['actions']['duplicate'][1])) {
216
-		$buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_duplicate_record"] . '\')" title="' . $_lang["resource_duplicate"] . '" href="index.php?a=' . $types['actions']['duplicate'][0] . '&amp;id=' . $row['id'] . '"><i class="fa fa-clone fa-fw"></i></a></li>';
217
-	}
218
-	if($modx->hasPermission($types['actions']['remove'][1])) {
219
-		$buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_delete"] . '\')" title="' . $_lang["delete"] . '" href="index.php?a=' . $types['actions']['remove'][0] . '&amp;id=' . $row['id'] . '"><i class="fa fa-trash fa-fw"></i></a></li>';
220
-	}
221
-	$buttons = $buttons ? '<div class="btnCell"><ul class="elements_buttonbar">' . $buttons . '</ul></div>' : '';
222
-
223
-	$catid = $row['catid'] ? $row['catid'] : 0;
224
-
225
-	// Placeholders for elements-row
226
-	return array(
227
-		'class' => $class ? ' class="' . $class . '"' : '',
228
-		'lockedByUser' => $lockedByUser,
229
-		'name' => $row['name'],
230
-		'caption' => $caption,
231
-		'buttons' => $buttons,
232
-		'marks' => $marks,
233
-		'id' => $row['id'],
234
-		'resourceTable' => $resourceTable,
235
-		'actionEdit' => $types['actions']['edit'][0],
236
-		'catid' => $catid,
237
-		'textdir' => $modx_textdir ? '&rlm;' : '',
238
-	);
163
+        $_lang["confirm_delete"] = $_lang["confirm_delete_module"];
164
+    }
165
+
166
+    // Prepare displaying user-locks
167
+    $lockedByUser = '';
168
+    $rowLock = $modx->elementIsLocked($lockElementType, $row['id'], true);
169
+    if($rowLock && $modx->hasPermission('display_locks')) {
170
+        if($rowLock['sid'] == $modx->sid) {
171
+            $title = $modx->parseText($_lang["lock_element_editing"], array(
172
+                'element_type' => $_lang["lock_element_type_" . $lockElementType],
173
+                'lasthit_df' => $rowLock['lasthit_df']
174
+            ));
175
+            $lockedByUser = '<span title="' . $title . '" class="editResource" style="cursor:context-menu;">' . $_style['tree_preview_resource'] . '</span>&nbsp;';
176
+        } else {
177
+            $title = $modx->parseText($_lang["lock_element_locked_by"], array(
178
+                'element_type' => $_lang["lock_element_type_" . $lockElementType],
179
+                'username' => $rowLock['username'],
180
+                'lasthit_df' => $rowLock['lasthit_df']
181
+            ));
182
+            if($modx->hasPermission('remove_locks')) {
183
+                $lockedByUser = '<a href="javascript:;" onclick="unlockElement(' . $lockElementType . ', ' . $row['id'] . ', this);return false;" title="' . $title . '" class="lockedResource"><i class="' . $_style['icons_secured'] . '"></i></a>';
184
+            } else {
185
+                $lockedByUser = '<span title="' . $title . '" class="lockedResource" style="cursor:context-menu;"><i class="' . $_style['icons_secured'] . '"></i></span>';
186
+            }
187
+        }
188
+    }
189
+    if($lockedByUser) {
190
+        $lockedByUser = '<div class="lockCell">' . $lockedByUser . '</div>';
191
+    }
192
+
193
+    // Caption
194
+    if($resourceTable == 'site_tmplvars') {
195
+        $caption = !empty($row['description']) ? ' ' . $row['caption'] . ' &nbsp; <small>(' . $row['description'] . ')</small>' : ' ' . $row['caption'];
196
+    } else {
197
+        $caption = !empty($row['description']) ? ' ' . $row['description'] : '';
198
+    }
199
+
200
+    // Special marks
201
+    $tplInfo = array();
202
+    if($row['locked']) {
203
+        $tplInfo[] = $_lang['locked'];
204
+    }
205
+    if($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') {
206
+        $tplInfo[] = $_lang['defaulttemplate_title'];
207
+    }
208
+    $marks = !empty($tplInfo) ? ' <em>(' . join(', ', $tplInfo) . ')</em>' : '';
209
+
210
+    /* row buttons */
211
+    $buttons = '';
212
+    if($modx->hasPermission($types['actions']['edit'][1])) {
213
+        $buttons .= '<li><a title="' . $_lang["edit_resource"] . '" href="index.php?a=' . $types['actions']['edit'][0] . '&amp;id=' . $row['id'] . '"><i class="fa fa-edit fa-fw"></i></a></li>';
214
+    }
215
+    if($modx->hasPermission($types['actions']['duplicate'][1])) {
216
+        $buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_duplicate_record"] . '\')" title="' . $_lang["resource_duplicate"] . '" href="index.php?a=' . $types['actions']['duplicate'][0] . '&amp;id=' . $row['id'] . '"><i class="fa fa-clone fa-fw"></i></a></li>';
217
+    }
218
+    if($modx->hasPermission($types['actions']['remove'][1])) {
219
+        $buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_delete"] . '\')" title="' . $_lang["delete"] . '" href="index.php?a=' . $types['actions']['remove'][0] . '&amp;id=' . $row['id'] . '"><i class="fa fa-trash fa-fw"></i></a></li>';
220
+    }
221
+    $buttons = $buttons ? '<div class="btnCell"><ul class="elements_buttonbar">' . $buttons . '</ul></div>' : '';
222
+
223
+    $catid = $row['catid'] ? $row['catid'] : 0;
224
+
225
+    // Placeholders for elements-row
226
+    return array(
227
+        'class' => $class ? ' class="' . $class . '"' : '',
228
+        'lockedByUser' => $lockedByUser,
229
+        'name' => $row['name'],
230
+        'caption' => $caption,
231
+        'buttons' => $buttons,
232
+        'marks' => $marks,
233
+        'id' => $row['id'],
234
+        'resourceTable' => $resourceTable,
235
+        'actionEdit' => $types['actions']['edit'][0],
236
+        'catid' => $catid,
237
+        'textdir' => $modx_textdir ? '&rlm;' : '',
238
+    );
239 239
 }
Please login to merge, or discard this patch.
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -1,23 +1,23 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
6 6
 $tpl = array(
7
-	'viewForm' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_viewForm.tpl'),
8
-	'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'),
9
-	'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'),
10
-	'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'),
11
-	'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl')
7
+	'viewForm' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_viewForm.tpl'),
8
+	'panelGroup' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_panelGroup.tpl'),
9
+	'panelHeading' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_panelHeading.tpl'),
10
+	'panelCollapse' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_panelCollapse.tpl'),
11
+	'elementsRow' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_elementsRow.tpl')
12 12
 );
13 13
 
14
-function parsePh($tpl, $ph) {
14
+function parsePh($tpl, $ph){
15 15
 	global $modx, $_lang;
16 16
 	$tpl = $modx->parseText($tpl, $_lang, '[%', '%]');
17 17
 	return $modx->parseText($tpl, $ph);
18 18
 }
19 19
 
20
-function renderViewSwitchButtons($cssId) {
20
+function renderViewSwitchButtons($cssId){
21 21
 	global $modx, $_lang, $tpl;
22 22
 
23 23
 	return parsePh($tpl['viewForm'], array(
@@ -25,19 +25,19 @@  discard block
 block discarded – undo
25 25
 	));
26 26
 }
27 27
 
28
-function createResourceList($resourceTable, $resources) {
28
+function createResourceList($resourceTable, $resources){
29 29
 	global $modx, $_lang, $_style, $modx_textdir, $tpl;
30 30
 
31 31
 	$items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false;
32 32
 
33
-	if( ! is_array($items) || empty($items)) {
33
+	if (!is_array($items) || empty($items)) {
34 34
 		return $_lang['no_results'];
35 35
 	}
36 36
 
37 37
 	// Prepare elements- and categories-list
38 38
 	$elements = array();
39 39
 	$categories = array();
40
-	foreach($items as $row) {
40
+	foreach ($items as $row) {
41 41
 		$catid = $row['catid'] ? $row['catid'] : 0;
42 42
 		$categories[$catid] = array('name' => stripslashes($row['category']));
43 43
 		$elements[$catid][] = prepareElementRowPh($row, $resourceTable, $resources);
@@ -45,18 +45,18 @@  discard block
 block discarded – undo
45 45
 
46 46
 	// Now render categories / panel-collapse
47 47
 	$panelGroup = '';
48
-	foreach($elements as $catid => $elList) {
48
+	foreach ($elements as $catid => $elList) {
49 49
 		// Add panel-heading / category-collapse to output
50 50
 		$panelGroup .= parsePh($tpl['panelHeading'], array(
51 51
 			'tab' => $resourceTable,
52 52
 			'category' => $categories[$catid]['name'],
53
-			'categoryid' => $catid != '' ? ' <small>(' . $catid . ')</small>' : '',
53
+			'categoryid' => $catid != '' ? ' <small>('.$catid.')</small>' : '',
54 54
 			'catid' => $catid,
55 55
 		));
56 56
 
57 57
 		// Prepare content for panel-collapse
58 58
 		$panelCollapse = '';
59
-		foreach($elList as $el) {
59
+		foreach ($elList as $el) {
60 60
 			$panelCollapse .= parsePh($tpl['elementsRow'], $el);
61 61
 		}
62 62
 
@@ -74,30 +74,30 @@  discard block
 block discarded – undo
74 74
 	));
75 75
 }
76 76
 
77
-function createCombinedView($resources) {
77
+function createCombinedView($resources){
78 78
 	global $modx, $_lang, $_style, $modx_textdir;
79 79
 
80 80
 	$itemsPerCategory = isset($resources->itemsPerCategory) ? $resources->itemsPerCategory : false;
81 81
 	$types = isset($resources->types) ? $resources->types : false;
82 82
 	$categories = isset($resources->categories) ? $resources->categories : false;
83 83
 
84
-	if(!$itemsPerCategory) {
84
+	if (!$itemsPerCategory) {
85 85
 		return $_lang['no_results'];
86 86
 	}
87 87
 
88 88
 	$tpl = array(
89
-		'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'),
90
-		'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'),
91
-		'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'),
92
-		'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl'),
89
+		'panelGroup' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_panelGroup.tpl'),
90
+		'panelHeading' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_panelHeading.tpl'),
91
+		'panelCollapse' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_panelCollapse.tpl'),
92
+		'elementsRow' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_elementsRow.tpl'),
93 93
 	);
94 94
 
95 95
 	// Easily loop through $itemsPerCategory-Array
96 96
 	$panelGroup = '';
97
-	foreach($categories as $catid => $category) {
97
+	foreach ($categories as $catid => $category) {
98 98
 		// Prepare collapse content / elements-list
99 99
 		$panelCollapse = '';
100
-		foreach($itemsPerCategory[$catid] as $el) {
100
+		foreach ($itemsPerCategory[$catid] as $el) {
101 101
 			$resourceTable = $el['type'];
102 102
 			$ph = prepareElementRowPh($el, $resourceTable, $resources);
103 103
 			$panelCollapse .= parsePh($tpl['elementsRow'], $ph);
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 		$panelGroup .= parsePh($tpl['panelHeading'], array(
108 108
 			'tab' => 'categories_list',
109 109
 			'category' => $categories[$catid],
110
-			'categoryid' => $catid != '' ? ' <small>(' . $catid . ')</small>' : '',
110
+			'categoryid' => $catid != '' ? ' <small>('.$catid.')</small>' : '',
111 111
 			'catid' => $catid,
112 112
 		));
113 113
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 	));
126 126
 }
127 127
 
128
-function prepareElementRowPh($row, $resourceTable, $resources) {
128
+function prepareElementRowPh($row, $resourceTable, $resources){
129 129
 	global $modx, $modx_textdir, $_style, $_lang;
130 130
 
131 131
 	$types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false;
@@ -133,32 +133,32 @@  discard block
 block discarded – undo
133 133
 	$class = '';
134 134
 	$_lang["confirm_delete"] = $_lang["delete"];
135 135
 
136
-	if($resourceTable == 'site_templates') {
136
+	if ($resourceTable == 'site_templates') {
137 137
 		$class = $row['selectable'] ? '' : 'disabledPlugin';
138 138
 		$lockElementType = 1;
139 139
 		$_lang["confirm_delete"] = $_lang["confirm_delete_template"];
140 140
 	}
141
-	if($resourceTable == 'site_tmplvars') {
141
+	if ($resourceTable == 'site_tmplvars') {
142 142
 		$class = $row['reltpl'] ? '' : 'disabledPlugin';
143 143
 		$lockElementType = 2;
144 144
 		$_lang["confirm_delete"] = $_lang["confirm_delete_tmplvars"];
145 145
 	}
146
-	if($resourceTable == 'site_htmlsnippets') {
146
+	if ($resourceTable == 'site_htmlsnippets') {
147 147
         $class = $row['disabled'] ? 'disabledPlugin' : '';
148 148
 		$lockElementType = 3;
149 149
 		$_lang["confirm_delete"] = $_lang["confirm_delete_htmlsnippet"];
150 150
 	}
151
-	if($resourceTable == 'site_snippets') {
151
+	if ($resourceTable == 'site_snippets') {
152 152
         $class = $row['disabled'] ? 'disabledPlugin' : '';
153 153
 		$lockElementType = 4;
154 154
 		$_lang["confirm_delete"] = $_lang["confirm_delete_snippet"];
155 155
 	}
156
-	if($resourceTable == 'site_plugins') {
156
+	if ($resourceTable == 'site_plugins') {
157 157
 		$class = $row['disabled'] ? 'disabledPlugin' : '';
158 158
 		$lockElementType = 5;
159 159
 		$_lang["confirm_delete"] = $_lang["confirm_delete_plugin"];
160 160
 	}
161
-	if($resourceTable == 'site_modules') {
161
+	if ($resourceTable == 'site_modules') {
162 162
         $class = $row['disabled'] ? '' : 'disabledPlugin';
163 163
 		$_lang["confirm_delete"] = $_lang["confirm_delete_module"];
164 164
 	}
@@ -166,65 +166,65 @@  discard block
 block discarded – undo
166 166
 	// Prepare displaying user-locks
167 167
 	$lockedByUser = '';
168 168
 	$rowLock = $modx->elementIsLocked($lockElementType, $row['id'], true);
169
-	if($rowLock && $modx->hasPermission('display_locks')) {
170
-		if($rowLock['sid'] == $modx->sid) {
169
+	if ($rowLock && $modx->hasPermission('display_locks')) {
170
+		if ($rowLock['sid'] == $modx->sid) {
171 171
 			$title = $modx->parseText($_lang["lock_element_editing"], array(
172
-				'element_type' => $_lang["lock_element_type_" . $lockElementType],
172
+				'element_type' => $_lang["lock_element_type_".$lockElementType],
173 173
 				'lasthit_df' => $rowLock['lasthit_df']
174 174
 			));
175
-			$lockedByUser = '<span title="' . $title . '" class="editResource" style="cursor:context-menu;">' . $_style['tree_preview_resource'] . '</span>&nbsp;';
175
+			$lockedByUser = '<span title="'.$title.'" class="editResource" style="cursor:context-menu;">'.$_style['tree_preview_resource'].'</span>&nbsp;';
176 176
 		} else {
177 177
 			$title = $modx->parseText($_lang["lock_element_locked_by"], array(
178
-				'element_type' => $_lang["lock_element_type_" . $lockElementType],
178
+				'element_type' => $_lang["lock_element_type_".$lockElementType],
179 179
 				'username' => $rowLock['username'],
180 180
 				'lasthit_df' => $rowLock['lasthit_df']
181 181
 			));
182
-			if($modx->hasPermission('remove_locks')) {
183
-				$lockedByUser = '<a href="javascript:;" onclick="unlockElement(' . $lockElementType . ', ' . $row['id'] . ', this);return false;" title="' . $title . '" class="lockedResource"><i class="' . $_style['icons_secured'] . '"></i></a>';
182
+			if ($modx->hasPermission('remove_locks')) {
183
+				$lockedByUser = '<a href="javascript:;" onclick="unlockElement('.$lockElementType.', '.$row['id'].', this);return false;" title="'.$title.'" class="lockedResource"><i class="'.$_style['icons_secured'].'"></i></a>';
184 184
 			} else {
185
-				$lockedByUser = '<span title="' . $title . '" class="lockedResource" style="cursor:context-menu;"><i class="' . $_style['icons_secured'] . '"></i></span>';
185
+				$lockedByUser = '<span title="'.$title.'" class="lockedResource" style="cursor:context-menu;"><i class="'.$_style['icons_secured'].'"></i></span>';
186 186
 			}
187 187
 		}
188 188
 	}
189
-	if($lockedByUser) {
190
-		$lockedByUser = '<div class="lockCell">' . $lockedByUser . '</div>';
189
+	if ($lockedByUser) {
190
+		$lockedByUser = '<div class="lockCell">'.$lockedByUser.'</div>';
191 191
 	}
192 192
 
193 193
 	// Caption
194
-	if($resourceTable == 'site_tmplvars') {
195
-		$caption = !empty($row['description']) ? ' ' . $row['caption'] . ' &nbsp; <small>(' . $row['description'] . ')</small>' : ' ' . $row['caption'];
194
+	if ($resourceTable == 'site_tmplvars') {
195
+		$caption = !empty($row['description']) ? ' '.$row['caption'].' &nbsp; <small>('.$row['description'].')</small>' : ' '.$row['caption'];
196 196
 	} else {
197
-		$caption = !empty($row['description']) ? ' ' . $row['description'] : '';
197
+		$caption = !empty($row['description']) ? ' '.$row['description'] : '';
198 198
 	}
199 199
 
200 200
 	// Special marks
201 201
 	$tplInfo = array();
202
-	if($row['locked']) {
202
+	if ($row['locked']) {
203 203
 		$tplInfo[] = $_lang['locked'];
204 204
 	}
205
-	if($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') {
205
+	if ($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') {
206 206
 		$tplInfo[] = $_lang['defaulttemplate_title'];
207 207
 	}
208
-	$marks = !empty($tplInfo) ? ' <em>(' . join(', ', $tplInfo) . ')</em>' : '';
208
+	$marks = !empty($tplInfo) ? ' <em>('.join(', ', $tplInfo).')</em>' : '';
209 209
 
210 210
 	/* row buttons */
211 211
 	$buttons = '';
212
-	if($modx->hasPermission($types['actions']['edit'][1])) {
213
-		$buttons .= '<li><a title="' . $_lang["edit_resource"] . '" href="index.php?a=' . $types['actions']['edit'][0] . '&amp;id=' . $row['id'] . '"><i class="fa fa-edit fa-fw"></i></a></li>';
212
+	if ($modx->hasPermission($types['actions']['edit'][1])) {
213
+		$buttons .= '<li><a title="'.$_lang["edit_resource"].'" href="index.php?a='.$types['actions']['edit'][0].'&amp;id='.$row['id'].'"><i class="fa fa-edit fa-fw"></i></a></li>';
214 214
 	}
215
-	if($modx->hasPermission($types['actions']['duplicate'][1])) {
216
-		$buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_duplicate_record"] . '\')" title="' . $_lang["resource_duplicate"] . '" href="index.php?a=' . $types['actions']['duplicate'][0] . '&amp;id=' . $row['id'] . '"><i class="fa fa-clone fa-fw"></i></a></li>';
215
+	if ($modx->hasPermission($types['actions']['duplicate'][1])) {
216
+		$buttons .= '<li><a onclick="return confirm(\''.$_lang["confirm_duplicate_record"].'\')" title="'.$_lang["resource_duplicate"].'" href="index.php?a='.$types['actions']['duplicate'][0].'&amp;id='.$row['id'].'"><i class="fa fa-clone fa-fw"></i></a></li>';
217 217
 	}
218
-	if($modx->hasPermission($types['actions']['remove'][1])) {
219
-		$buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_delete"] . '\')" title="' . $_lang["delete"] . '" href="index.php?a=' . $types['actions']['remove'][0] . '&amp;id=' . $row['id'] . '"><i class="fa fa-trash fa-fw"></i></a></li>';
218
+	if ($modx->hasPermission($types['actions']['remove'][1])) {
219
+		$buttons .= '<li><a onclick="return confirm(\''.$_lang["confirm_delete"].'\')" title="'.$_lang["delete"].'" href="index.php?a='.$types['actions']['remove'][0].'&amp;id='.$row['id'].'"><i class="fa fa-trash fa-fw"></i></a></li>';
220 220
 	}
221
-	$buttons = $buttons ? '<div class="btnCell"><ul class="elements_buttonbar">' . $buttons . '</ul></div>' : '';
221
+	$buttons = $buttons ? '<div class="btnCell"><ul class="elements_buttonbar">'.$buttons.'</ul></div>' : '';
222 222
 
223 223
 	$catid = $row['catid'] ? $row['catid'] : 0;
224 224
 
225 225
 	// Placeholders for elements-row
226 226
 	return array(
227
-		'class' => $class ? ' class="' . $class . '"' : '',
227
+		'class' => $class ? ' class="'.$class.'"' : '',
228 228
 		'lockedByUser' => $lockedByUser,
229 229
 		'name' => $row['name'],
230 230
 		'caption' => $caption,
Please login to merge, or discard this patch.
Braces   +37 added lines, -32 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
@@ -11,13 +11,15 @@  discard block
 block discarded – undo
11 11
 	'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl')
12 12
 );
13 13
 
14
-function parsePh($tpl, $ph) {
14
+function parsePh($tpl, $ph)
15
+{
15 16
 	global $modx, $_lang;
16 17
 	$tpl = $modx->parseText($tpl, $_lang, '[%', '%]');
17 18
 	return $modx->parseText($tpl, $ph);
18 19
 }
19 20
 
20
-function renderViewSwitchButtons($cssId) {
21
+function renderViewSwitchButtons($cssId)
22
+{
21 23
 	global $modx, $_lang, $tpl;
22 24
 
23 25
 	return parsePh($tpl['viewForm'], array(
@@ -25,19 +27,20 @@  discard block
 block discarded – undo
25 27
 	));
26 28
 }
27 29
 
28
-function createResourceList($resourceTable, $resources) {
30
+function createResourceList($resourceTable, $resources)
31
+{
29 32
 	global $modx, $_lang, $_style, $modx_textdir, $tpl;
30 33
 
31 34
 	$items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false;
32 35
 
33
-	if( ! is_array($items) || empty($items)) {
36
+	if( ! is_array($items) || empty($items)) {
34 37
 		return $_lang['no_results'];
35 38
 	}
36 39
 
37 40
 	// Prepare elements- and categories-list
38 41
 	$elements = array();
39 42
 	$categories = array();
40
-	foreach($items as $row) {
43
+	foreach($items as $row) {
41 44
 		$catid = $row['catid'] ? $row['catid'] : 0;
42 45
 		$categories[$catid] = array('name' => stripslashes($row['category']));
43 46
 		$elements[$catid][] = prepareElementRowPh($row, $resourceTable, $resources);
@@ -45,7 +48,7 @@  discard block
 block discarded – undo
45 48
 
46 49
 	// Now render categories / panel-collapse
47 50
 	$panelGroup = '';
48
-	foreach($elements as $catid => $elList) {
51
+	foreach($elements as $catid => $elList) {
49 52
 		// Add panel-heading / category-collapse to output
50 53
 		$panelGroup .= parsePh($tpl['panelHeading'], array(
51 54
 			'tab' => $resourceTable,
@@ -56,7 +59,7 @@  discard block
 block discarded – undo
56 59
 
57 60
 		// Prepare content for panel-collapse
58 61
 		$panelCollapse = '';
59
-		foreach($elList as $el) {
62
+		foreach($elList as $el) {
60 63
 			$panelCollapse .= parsePh($tpl['elementsRow'], $el);
61 64
 		}
62 65
 
@@ -74,14 +77,15 @@  discard block
 block discarded – undo
74 77
 	));
75 78
 }
76 79
 
77
-function createCombinedView($resources) {
80
+function createCombinedView($resources)
81
+{
78 82
 	global $modx, $_lang, $_style, $modx_textdir;
79 83
 
80 84
 	$itemsPerCategory = isset($resources->itemsPerCategory) ? $resources->itemsPerCategory : false;
81 85
 	$types = isset($resources->types) ? $resources->types : false;
82 86
 	$categories = isset($resources->categories) ? $resources->categories : false;
83 87
 
84
-	if(!$itemsPerCategory) {
88
+	if(!$itemsPerCategory) {
85 89
 		return $_lang['no_results'];
86 90
 	}
87 91
 
@@ -94,10 +98,10 @@  discard block
 block discarded – undo
94 98
 
95 99
 	// Easily loop through $itemsPerCategory-Array
96 100
 	$panelGroup = '';
97
-	foreach($categories as $catid => $category) {
101
+	foreach($categories as $catid => $category) {
98 102
 		// Prepare collapse content / elements-list
99 103
 		$panelCollapse = '';
100
-		foreach($itemsPerCategory[$catid] as $el) {
104
+		foreach($itemsPerCategory[$catid] as $el) {
101 105
 			$resourceTable = $el['type'];
102 106
 			$ph = prepareElementRowPh($el, $resourceTable, $resources);
103 107
 			$panelCollapse .= parsePh($tpl['elementsRow'], $ph);
@@ -125,7 +129,8 @@  discard block
 block discarded – undo
125 129
 	));
126 130
 }
127 131
 
128
-function prepareElementRowPh($row, $resourceTable, $resources) {
132
+function prepareElementRowPh($row, $resourceTable, $resources)
133
+{
129 134
 	global $modx, $modx_textdir, $_style, $_lang;
130 135
 
131 136
 	$types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false;
@@ -133,32 +138,32 @@  discard block
 block discarded – undo
133 138
 	$class = '';
134 139
 	$_lang["confirm_delete"] = $_lang["delete"];
135 140
 
136
-	if($resourceTable == 'site_templates') {
141
+	if($resourceTable == 'site_templates') {
137 142
 		$class = $row['selectable'] ? '' : 'disabledPlugin';
138 143
 		$lockElementType = 1;
139 144
 		$_lang["confirm_delete"] = $_lang["confirm_delete_template"];
140 145
 	}
141
-	if($resourceTable == 'site_tmplvars') {
146
+	if($resourceTable == 'site_tmplvars') {
142 147
 		$class = $row['reltpl'] ? '' : 'disabledPlugin';
143 148
 		$lockElementType = 2;
144 149
 		$_lang["confirm_delete"] = $_lang["confirm_delete_tmplvars"];
145 150
 	}
146
-	if($resourceTable == 'site_htmlsnippets') {
151
+	if($resourceTable == 'site_htmlsnippets') {
147 152
         $class = $row['disabled'] ? 'disabledPlugin' : '';
148 153
 		$lockElementType = 3;
149 154
 		$_lang["confirm_delete"] = $_lang["confirm_delete_htmlsnippet"];
150 155
 	}
151
-	if($resourceTable == 'site_snippets') {
156
+	if($resourceTable == 'site_snippets') {
152 157
         $class = $row['disabled'] ? 'disabledPlugin' : '';
153 158
 		$lockElementType = 4;
154 159
 		$_lang["confirm_delete"] = $_lang["confirm_delete_snippet"];
155 160
 	}
156
-	if($resourceTable == 'site_plugins') {
161
+	if($resourceTable == 'site_plugins') {
157 162
 		$class = $row['disabled'] ? 'disabledPlugin' : '';
158 163
 		$lockElementType = 5;
159 164
 		$_lang["confirm_delete"] = $_lang["confirm_delete_plugin"];
160 165
 	}
161
-	if($resourceTable == 'site_modules') {
166
+	if($resourceTable == 'site_modules') {
162 167
         $class = $row['disabled'] ? '' : 'disabledPlugin';
163 168
 		$_lang["confirm_delete"] = $_lang["confirm_delete_module"];
164 169
 	}
@@ -166,56 +171,56 @@  discard block
 block discarded – undo
166 171
 	// Prepare displaying user-locks
167 172
 	$lockedByUser = '';
168 173
 	$rowLock = $modx->elementIsLocked($lockElementType, $row['id'], true);
169
-	if($rowLock && $modx->hasPermission('display_locks')) {
170
-		if($rowLock['sid'] == $modx->sid) {
174
+	if($rowLock && $modx->hasPermission('display_locks')) {
175
+		if($rowLock['sid'] == $modx->sid) {
171 176
 			$title = $modx->parseText($_lang["lock_element_editing"], array(
172 177
 				'element_type' => $_lang["lock_element_type_" . $lockElementType],
173 178
 				'lasthit_df' => $rowLock['lasthit_df']
174 179
 			));
175 180
 			$lockedByUser = '<span title="' . $title . '" class="editResource" style="cursor:context-menu;">' . $_style['tree_preview_resource'] . '</span>&nbsp;';
176
-		} else {
181
+		} else {
177 182
 			$title = $modx->parseText($_lang["lock_element_locked_by"], array(
178 183
 				'element_type' => $_lang["lock_element_type_" . $lockElementType],
179 184
 				'username' => $rowLock['username'],
180 185
 				'lasthit_df' => $rowLock['lasthit_df']
181 186
 			));
182
-			if($modx->hasPermission('remove_locks')) {
187
+			if($modx->hasPermission('remove_locks')) {
183 188
 				$lockedByUser = '<a href="javascript:;" onclick="unlockElement(' . $lockElementType . ', ' . $row['id'] . ', this);return false;" title="' . $title . '" class="lockedResource"><i class="' . $_style['icons_secured'] . '"></i></a>';
184
-			} else {
189
+			} else {
185 190
 				$lockedByUser = '<span title="' . $title . '" class="lockedResource" style="cursor:context-menu;"><i class="' . $_style['icons_secured'] . '"></i></span>';
186 191
 			}
187 192
 		}
188 193
 	}
189
-	if($lockedByUser) {
194
+	if($lockedByUser) {
190 195
 		$lockedByUser = '<div class="lockCell">' . $lockedByUser . '</div>';
191 196
 	}
192 197
 
193 198
 	// Caption
194
-	if($resourceTable == 'site_tmplvars') {
199
+	if($resourceTable == 'site_tmplvars') {
195 200
 		$caption = !empty($row['description']) ? ' ' . $row['caption'] . ' &nbsp; <small>(' . $row['description'] . ')</small>' : ' ' . $row['caption'];
196
-	} else {
201
+	} else {
197 202
 		$caption = !empty($row['description']) ? ' ' . $row['description'] : '';
198 203
 	}
199 204
 
200 205
 	// Special marks
201 206
 	$tplInfo = array();
202
-	if($row['locked']) {
207
+	if($row['locked']) {
203 208
 		$tplInfo[] = $_lang['locked'];
204 209
 	}
205
-	if($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') {
210
+	if($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') {
206 211
 		$tplInfo[] = $_lang['defaulttemplate_title'];
207 212
 	}
208 213
 	$marks = !empty($tplInfo) ? ' <em>(' . join(', ', $tplInfo) . ')</em>' : '';
209 214
 
210 215
 	/* row buttons */
211 216
 	$buttons = '';
212
-	if($modx->hasPermission($types['actions']['edit'][1])) {
217
+	if($modx->hasPermission($types['actions']['edit'][1])) {
213 218
 		$buttons .= '<li><a title="' . $_lang["edit_resource"] . '" href="index.php?a=' . $types['actions']['edit'][0] . '&amp;id=' . $row['id'] . '"><i class="fa fa-edit fa-fw"></i></a></li>';
214 219
 	}
215
-	if($modx->hasPermission($types['actions']['duplicate'][1])) {
220
+	if($modx->hasPermission($types['actions']['duplicate'][1])) {
216 221
 		$buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_duplicate_record"] . '\')" title="' . $_lang["resource_duplicate"] . '" href="index.php?a=' . $types['actions']['duplicate'][0] . '&amp;id=' . $row['id'] . '"><i class="fa fa-clone fa-fw"></i></a></li>';
217 222
 	}
218
-	if($modx->hasPermission($types['actions']['remove'][1])) {
223
+	if($modx->hasPermission($types['actions']['remove'][1])) {
219 224
 		$buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_delete"] . '\')" title="' . $_lang["delete"] . '" href="index.php?a=' . $types['actions']['remove'][0] . '&amp;id=' . $row['id'] . '"><i class="fa fa-trash fa-fw"></i></a></li>';
220 225
 	}
221 226
 	$buttons = $buttons ? '<div class="btnCell"><ul class="elements_buttonbar">' . $buttons . '</ul></div>' : '';
Please login to merge, or discard this patch.