@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | if(!$modx->hasPermission('edit_module')) { |
7 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
8 | 8 | } |
9 | 9 | |
10 | 10 | $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
@@ -26,91 +26,91 @@ discard block |
||
26 | 26 | // check to see the editor isn't locked |
27 | 27 | $rs = $modx->getDatabase()->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
28 | 28 | if($username = $modx->getDatabase()->getValue($rs)) { |
29 | - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $username, 'module')); |
|
29 | + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $username, 'module')); |
|
30 | 30 | } |
31 | 31 | // end check for lock |
32 | 32 | |
33 | 33 | // take action |
34 | 34 | switch($_REQUEST['op']) { |
35 | - case 'add': |
|
36 | - // convert ids to numbers |
|
37 | - $opids = array_filter(array_map('intval', explode(',', $_REQUEST['newids']))); |
|
38 | - |
|
39 | - if(count($opids) > 0) { |
|
40 | - // 1-snips, 2-tpls, 3-tvs, 4-chunks, 5-plugins, 6-docs |
|
41 | - $rt = strtolower($_REQUEST["rt"]); |
|
42 | - if($rt == 'chunk') { |
|
43 | - $type = 10; |
|
44 | - } |
|
45 | - if($rt == 'doc') { |
|
46 | - $type = 20; |
|
47 | - } |
|
48 | - if($rt == 'plug') { |
|
49 | - $type = 30; |
|
50 | - } |
|
51 | - if($rt == 'snip') { |
|
52 | - $type = 40; |
|
53 | - } |
|
54 | - if($rt == 'tpl') { |
|
55 | - $type = 50; |
|
56 | - } |
|
57 | - if($rt == 'tv') { |
|
58 | - $type = 60; |
|
59 | - } |
|
60 | - $modx->getDatabase()->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'"); |
|
61 | - foreach($opids as $opid) { |
|
62 | - $modx->getDatabase()->insert(array( |
|
63 | - 'module' => $id, |
|
64 | - 'resource' => $opid, |
|
65 | - 'type' => $type, |
|
66 | - ), $tbl_site_module_depobj); |
|
67 | - } |
|
68 | - } |
|
69 | - break; |
|
70 | - case 'del': |
|
71 | - // convert ids to numbers |
|
72 | - $opids = array_filter(array_map('intval', $_REQUEST['depid'])); |
|
73 | - |
|
74 | - // get resources that needs to be removed |
|
75 | - $ds = $modx->getDatabase()->select('*', $tbl_site_module_depobj, "id IN (" . implode(",", $opids) . ")"); |
|
76 | - // loop through resources and look for plugins and snippets |
|
77 | - $plids = array(); |
|
78 | - $snid = array(); |
|
79 | - while($row = $modx->getDatabase()->getRow($ds)) { |
|
80 | - if($row['type'] == '30') { |
|
81 | - $plids[$i] = $row['resource']; |
|
82 | - } |
|
83 | - if($row['type'] == '40') { |
|
84 | - $snids[$i] = $row['resource']; |
|
85 | - } |
|
86 | - } |
|
87 | - // get guid |
|
88 | - $ds = $modx->getDatabase()->select('guid', $tbl_site_modules, "id='{$id}'"); |
|
89 | - $guid = $modx->getDatabase()->getValue($ds); |
|
90 | - // reset moduleguid for deleted resources |
|
91 | - if(($cp = count($plids)) || ($cs = count($snids))) { |
|
92 | - if($cp) { |
|
93 | - $modx->getDatabase()->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $plids) . ") AND moduleguid='{$guid}'"); |
|
94 | - } |
|
95 | - if($cs) { |
|
96 | - $modx->getDatabase()->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'"); |
|
97 | - } |
|
98 | - // reset cache |
|
99 | - $modx->clearCache('full'); |
|
100 | - } |
|
101 | - $modx->getDatabase()->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")"); |
|
102 | - break; |
|
35 | + case 'add': |
|
36 | + // convert ids to numbers |
|
37 | + $opids = array_filter(array_map('intval', explode(',', $_REQUEST['newids']))); |
|
38 | + |
|
39 | + if(count($opids) > 0) { |
|
40 | + // 1-snips, 2-tpls, 3-tvs, 4-chunks, 5-plugins, 6-docs |
|
41 | + $rt = strtolower($_REQUEST["rt"]); |
|
42 | + if($rt == 'chunk') { |
|
43 | + $type = 10; |
|
44 | + } |
|
45 | + if($rt == 'doc') { |
|
46 | + $type = 20; |
|
47 | + } |
|
48 | + if($rt == 'plug') { |
|
49 | + $type = 30; |
|
50 | + } |
|
51 | + if($rt == 'snip') { |
|
52 | + $type = 40; |
|
53 | + } |
|
54 | + if($rt == 'tpl') { |
|
55 | + $type = 50; |
|
56 | + } |
|
57 | + if($rt == 'tv') { |
|
58 | + $type = 60; |
|
59 | + } |
|
60 | + $modx->getDatabase()->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'"); |
|
61 | + foreach($opids as $opid) { |
|
62 | + $modx->getDatabase()->insert(array( |
|
63 | + 'module' => $id, |
|
64 | + 'resource' => $opid, |
|
65 | + 'type' => $type, |
|
66 | + ), $tbl_site_module_depobj); |
|
67 | + } |
|
68 | + } |
|
69 | + break; |
|
70 | + case 'del': |
|
71 | + // convert ids to numbers |
|
72 | + $opids = array_filter(array_map('intval', $_REQUEST['depid'])); |
|
73 | + |
|
74 | + // get resources that needs to be removed |
|
75 | + $ds = $modx->getDatabase()->select('*', $tbl_site_module_depobj, "id IN (" . implode(",", $opids) . ")"); |
|
76 | + // loop through resources and look for plugins and snippets |
|
77 | + $plids = array(); |
|
78 | + $snid = array(); |
|
79 | + while($row = $modx->getDatabase()->getRow($ds)) { |
|
80 | + if($row['type'] == '30') { |
|
81 | + $plids[$i] = $row['resource']; |
|
82 | + } |
|
83 | + if($row['type'] == '40') { |
|
84 | + $snids[$i] = $row['resource']; |
|
85 | + } |
|
86 | + } |
|
87 | + // get guid |
|
88 | + $ds = $modx->getDatabase()->select('guid', $tbl_site_modules, "id='{$id}'"); |
|
89 | + $guid = $modx->getDatabase()->getValue($ds); |
|
90 | + // reset moduleguid for deleted resources |
|
91 | + if(($cp = count($plids)) || ($cs = count($snids))) { |
|
92 | + if($cp) { |
|
93 | + $modx->getDatabase()->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $plids) . ") AND moduleguid='{$guid}'"); |
|
94 | + } |
|
95 | + if($cs) { |
|
96 | + $modx->getDatabase()->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'"); |
|
97 | + } |
|
98 | + // reset cache |
|
99 | + $modx->clearCache('full'); |
|
100 | + } |
|
101 | + $modx->getDatabase()->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")"); |
|
102 | + break; |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | // load record |
106 | 106 | $rs = $modx->getDatabase()->select('*', $tbl_site_modules, "id = '{$id}'"); |
107 | 107 | $content = $modx->getDatabase()->getRow($rs); |
108 | 108 | if(!$content) { |
109 | - $modx->webAlertAndQuit("Module not found for id '{$id}'."); |
|
109 | + $modx->webAlertAndQuit("Module not found for id '{$id}'."); |
|
110 | 110 | } |
111 | 111 | $_SESSION['itemname'] = $content['name']; |
112 | 112 | if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
113 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
113 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | ?> |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | <tr> |
204 | 204 | <td valign="top" align="left"> |
205 | 205 | <?php |
206 | - $ds = $modx->getDatabase()->select("smd.id,COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) as name, |
|
206 | + $ds = $modx->getDatabase()->select("smd.id,COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) as name, |
|
207 | 207 | CASE smd.type |
208 | 208 | WHEN 10 THEN 'Chunk' |
209 | 209 | WHEN 20 THEN 'Document' |
@@ -218,17 +218,17 @@ discard block |
||
218 | 218 | LEFT JOIN {$tbl_site_snippets} AS ss ON ss.id = smd.resource AND smd.type = '40' |
219 | 219 | LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = '50' |
220 | 220 | LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = '60'", "smd.module={$id}", "smd.type,name"); |
221 | - $grd = new \EvolutionCMS\Support\DataGrid('', $ds, 0); // set page size to 0 t show all items |
|
222 | - $grd->noRecordMsg = $_lang["no_records_found"]; |
|
223 | - $grd->cssClass = "grid"; |
|
224 | - $grd->columnHeaderClass = "gridHeader"; |
|
225 | - $grd->itemClass = "gridItem"; |
|
226 | - $grd->altItemClass = "gridAltItem"; |
|
227 | - $grd->columns = $_lang["element_name"] . " ," . $_lang["type"]; |
|
228 | - $grd->colTypes = "template:<input type='checkbox' name='depid[]' value='[+id+]'> [+value+]"; |
|
229 | - $grd->fields = "name,type"; |
|
230 | - echo $grd->render(); |
|
231 | - ?> |
|
221 | + $grd = new \EvolutionCMS\Support\DataGrid('', $ds, 0); // set page size to 0 t show all items |
|
222 | + $grd->noRecordMsg = $_lang["no_records_found"]; |
|
223 | + $grd->cssClass = "grid"; |
|
224 | + $grd->columnHeaderClass = "gridHeader"; |
|
225 | + $grd->itemClass = "gridItem"; |
|
226 | + $grd->altItemClass = "gridAltItem"; |
|
227 | + $grd->columns = $_lang["element_name"] . " ," . $_lang["type"]; |
|
228 | + $grd->colTypes = "template:<input type='checkbox' name='depid[]' value='[+id+]'> [+value+]"; |
|
229 | + $grd->fields = "name,type"; |
|
230 | + echo $grd->render(); |
|
231 | + ?> |
|
232 | 232 | </td> |
233 | 233 | <td valign="top" style="width: 150px;"> |
234 | 234 | <a class="btn btn-block btn-danger text-left" style="margin-bottom:10px;" href="javascript:;" onclick="removeDependencies();return false;"><i class="<?php echo $_style["actions_delete"] ?>"></i> <?php echo $_lang['remove']; ?></a> |
@@ -1,20 +1,20 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | 4 | } |
5 | 5 | switch($modx->getManagerApi()->action) { |
6 | - case 107: |
|
7 | - if(!$modx->hasPermission('new_module')) { |
|
8 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
9 | - } |
|
10 | - break; |
|
11 | - case 108: |
|
12 | - if(!$modx->hasPermission('edit_module')) { |
|
13 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
14 | - } |
|
15 | - break; |
|
16 | - default: |
|
17 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + case 107: |
|
7 | + if(!$modx->hasPermission('new_module')) { |
|
8 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
9 | + } |
|
10 | + break; |
|
11 | + case 108: |
|
12 | + if(!$modx->hasPermission('edit_module')) { |
|
13 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
14 | + } |
|
15 | + break; |
|
16 | + default: |
|
17 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
18 | 18 | } |
19 | 19 | $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
20 | 20 | // Get table names (alphabetical) |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | // check to see the module editor isn't locked |
34 | 34 | if($lockedEl = $modx->elementIsLocked(6, $id)) { |
35 | - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); |
|
35 | + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); |
|
36 | 36 | } |
37 | 37 | // end check for lock |
38 | 38 | |
@@ -40,22 +40,22 @@ discard block |
||
40 | 40 | $modx->lockElement(6, $id); |
41 | 41 | |
42 | 42 | if(isset($_GET['id'])) { |
43 | - $rs = $modx->getDatabase()->select('*', $tbl_site_modules, "id='{$id}'"); |
|
44 | - $content = $modx->getDatabase()->getRow($rs); |
|
45 | - if(!$content) { |
|
46 | - $modx->webAlertAndQuit("Module not found for id '{$id}'."); |
|
47 | - } |
|
48 | - $content['properties'] = str_replace("&", "&", $content['properties']); |
|
49 | - $_SESSION['itemname'] = $content['name']; |
|
50 | - if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
51 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
52 | - } |
|
43 | + $rs = $modx->getDatabase()->select('*', $tbl_site_modules, "id='{$id}'"); |
|
44 | + $content = $modx->getDatabase()->getRow($rs); |
|
45 | + if(!$content) { |
|
46 | + $modx->webAlertAndQuit("Module not found for id '{$id}'."); |
|
47 | + } |
|
48 | + $content['properties'] = str_replace("&", "&", $content['properties']); |
|
49 | + $_SESSION['itemname'] = $content['name']; |
|
50 | + if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
51 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
52 | + } |
|
53 | 53 | } else { |
54 | - $_SESSION['itemname'] = $_lang["new_module"]; |
|
55 | - $content['wrap'] = '1'; |
|
54 | + $_SESSION['itemname'] = $_lang["new_module"]; |
|
55 | + $content['wrap'] = '1'; |
|
56 | 56 | } |
57 | 57 | if($modx->getManagerApi()->hasFormValues()) { |
58 | - $modx->getManagerApi()->loadFormValues(); |
|
58 | + $modx->getManagerApi()->loadFormValues(); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | // Add lock-element JS-Script |
@@ -426,18 +426,18 @@ discard block |
||
426 | 426 | |
427 | 427 | <form name="mutate" id="mutate" class="module" method="post" action="index.php?a=109"> |
428 | 428 | <?php |
429 | - // invoke OnModFormPrerender event |
|
430 | - $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id)); |
|
431 | - if(is_array($evtOut)) { |
|
432 | - echo implode('', $evtOut); |
|
433 | - } |
|
434 | - |
|
435 | - // Prepare internal params & info-tab via parseDocBlock |
|
436 | - $modulecode = isset($content['modulecode']) ? $modx->getDatabase()->escape($content['modulecode']) : ''; |
|
437 | - $docBlock = $modx->parseDocBlockFromString($modulecode); |
|
438 | - $docBlockList = $modx->convertDocBlockIntoList($docBlock); |
|
439 | - $internal = array(); |
|
440 | - ?> |
|
429 | + // invoke OnModFormPrerender event |
|
430 | + $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id)); |
|
431 | + if(is_array($evtOut)) { |
|
432 | + echo implode('', $evtOut); |
|
433 | + } |
|
434 | + |
|
435 | + // Prepare internal params & info-tab via parseDocBlock |
|
436 | + $modulecode = isset($content['modulecode']) ? $modx->getDatabase()->escape($content['modulecode']) : ''; |
|
437 | + $docBlock = $modx->parseDocBlockFromString($modulecode); |
|
438 | + $docBlockList = $modx->convertDocBlockIntoList($docBlock); |
|
439 | + $internal = array(); |
|
440 | + ?> |
|
441 | 441 | <input type="hidden" name="id" value="<?= $content['id'] ?>"> |
442 | 442 | <input type="hidden" name="mode" value="<?= $modx->getManagerApi()->action ?>"> |
443 | 443 | |
@@ -490,11 +490,11 @@ discard block |
||
490 | 490 | <select name="categoryid" class="form-control" onchange="documentDirty=true;"> |
491 | 491 | <option> </option> |
492 | 492 | <?php |
493 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
494 | - foreach(getCategories() as $n => $v) { |
|
495 | - echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($v['category']) . "</option>\n"; |
|
496 | - } |
|
497 | - ?> |
|
493 | + include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
494 | + foreach(getCategories() as $n => $v) { |
|
495 | + echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($v['category']) . "</option>\n"; |
|
496 | + } |
|
497 | + ?> |
|
498 | 498 | </select> |
499 | 499 | </div> |
500 | 500 | </div> |
@@ -601,7 +601,7 @@ discard block |
||
601 | 601 | <i class="<?= $_style["actions_save"] ?>"></i> <?= $_lang['manage_depends'] ?></a> |
602 | 602 | </div> |
603 | 603 | <?php |
604 | - $ds = $modx->getDatabase()->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, |
|
604 | + $ds = $modx->getDatabase()->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, |
|
605 | 605 | CASE smd.type |
606 | 606 | WHEN 10 THEN 'Chunk' |
607 | 607 | WHEN 20 THEN 'Document' |
@@ -617,16 +617,16 @@ discard block |
||
617 | 617 | LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = 50 |
618 | 618 | LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = 60", "smd.module='{$id}'", 'smd.type,name'); |
619 | 619 | |
620 | - $grd = new \EvolutionCMS\Support\DataGrid('', $ds, 0); // set page size to 0 t show all items |
|
621 | - $grd->noRecordMsg = $_lang['no_records_found']; |
|
622 | - $grd->cssClass = 'grid'; |
|
623 | - $grd->columnHeaderClass = 'gridHeader'; |
|
624 | - $grd->itemClass = 'gridItem'; |
|
625 | - $grd->altItemClass = 'gridAltItem'; |
|
626 | - $grd->columns = $_lang['element_name'] . " ," . $_lang['type']; |
|
627 | - $grd->fields = "name,type"; |
|
628 | - echo $grd->render(); |
|
629 | - ?> |
|
620 | + $grd = new \EvolutionCMS\Support\DataGrid('', $ds, 0); // set page size to 0 t show all items |
|
621 | + $grd->noRecordMsg = $_lang['no_records_found']; |
|
622 | + $grd->cssClass = 'grid'; |
|
623 | + $grd->columnHeaderClass = 'gridHeader'; |
|
624 | + $grd->itemClass = 'gridItem'; |
|
625 | + $grd->altItemClass = 'gridAltItem'; |
|
626 | + $grd->columns = $_lang['element_name'] . " ," . $_lang['type']; |
|
627 | + $grd->fields = "name,type"; |
|
628 | + echo $grd->render(); |
|
629 | + ?> |
|
630 | 630 | </div> |
631 | 631 | </div> |
632 | 632 | <?php endif; ?> |
@@ -638,12 +638,12 @@ discard block |
||
638 | 638 | <div class="container container-body"> |
639 | 639 | <?php if($use_udperms == 1) : ?> |
640 | 640 | <?php |
641 | - // fetch user access permissions for the module |
|
642 | - $rs = $modx->getDatabase()->select('usergroup', $tbl_site_module_access, "module='{$id}'"); |
|
643 | - $groupsarray = $modx->getDatabase()->getColumn('usergroup', $rs); |
|
641 | + // fetch user access permissions for the module |
|
642 | + $rs = $modx->getDatabase()->select('usergroup', $tbl_site_module_access, "module='{$id}'"); |
|
643 | + $groupsarray = $modx->getDatabase()->getColumn('usergroup', $rs); |
|
644 | 644 | |
645 | - if($modx->hasPermission('access_permissions')) { |
|
646 | - ?> |
|
645 | + if($modx->hasPermission('access_permissions')) { |
|
646 | + ?> |
|
647 | 647 | <!-- User Group Access Permissions --> |
648 | 648 | <script type="text/javascript"> |
649 | 649 | function makePublic(b) { |
@@ -667,28 +667,28 @@ discard block |
||
667 | 667 | </script> |
668 | 668 | <p><?= $_lang['module_group_access_msg'] ?></p> |
669 | 669 | <?php |
670 | - } |
|
671 | - $chk = ''; |
|
672 | - $rs = $modx->getDatabase()->select('name, id', $tbl_membergroup_names, '', 'name'); |
|
673 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
674 | - $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); |
|
675 | - $checked = in_array($row['id'], $groupsarray); |
|
676 | - if($modx->hasPermission('access_permissions')) { |
|
677 | - if($checked) { |
|
678 | - $notPublic = true; |
|
679 | - } |
|
680 | - $chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n"; |
|
681 | - } else { |
|
682 | - if($checked) { |
|
683 | - $chks = '<input type="hidden" name="usrgroups[]" value="' . $row['id'] . '" />' . "\n" . $chks; |
|
684 | - } |
|
685 | - } |
|
686 | - } |
|
687 | - if($modx->hasPermission('access_permissions')) { |
|
688 | - $chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks; |
|
689 | - } |
|
690 | - echo $chks; |
|
691 | - ?> |
|
670 | + } |
|
671 | + $chk = ''; |
|
672 | + $rs = $modx->getDatabase()->select('name, id', $tbl_membergroup_names, '', 'name'); |
|
673 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
674 | + $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); |
|
675 | + $checked = in_array($row['id'], $groupsarray); |
|
676 | + if($modx->hasPermission('access_permissions')) { |
|
677 | + if($checked) { |
|
678 | + $notPublic = true; |
|
679 | + } |
|
680 | + $chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n"; |
|
681 | + } else { |
|
682 | + if($checked) { |
|
683 | + $chks = '<input type="hidden" name="usrgroups[]" value="' . $row['id'] . '" />' . "\n" . $chks; |
|
684 | + } |
|
685 | + } |
|
686 | + } |
|
687 | + if($modx->hasPermission('access_permissions')) { |
|
688 | + $chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks; |
|
689 | + } |
|
690 | + echo $chks; |
|
691 | + ?> |
|
692 | 692 | <?php endif; ?> |
693 | 693 | </div> |
694 | 694 | </div> |
@@ -704,11 +704,11 @@ discard block |
||
704 | 704 | |
705 | 705 | <input type="submit" name="save" style="display:none;"> |
706 | 706 | <?php |
707 | - // invoke OnModFormRender event |
|
708 | - $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id)); |
|
709 | - if(is_array($evtOut)) { |
|
710 | - echo implode('', $evtOut); |
|
711 | - } |
|
712 | - ?> |
|
707 | + // invoke OnModFormRender event |
|
708 | + $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id)); |
|
709 | + if(is_array($evtOut)) { |
|
710 | + echo implode('', $evtOut); |
|
711 | + } |
|
712 | + ?> |
|
713 | 713 | </form> |
714 | 714 | <script type="text/javascript">setTimeout('showParameters();', 10);</script> |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | 4 | } |
5 | 5 | if(!$modx->hasPermission('edit_web_user')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | // initialize page view state - the $_PAGE object |
@@ -11,12 +11,12 @@ discard block |
||
11 | 11 | |
12 | 12 | // get and save search string |
13 | 13 | if($_REQUEST['op'] == 'reset') { |
14 | - $query = ''; |
|
15 | - $_PAGE['vs']['search'] = ''; |
|
14 | + $query = ''; |
|
15 | + $_PAGE['vs']['search'] = ''; |
|
16 | 16 | } else { |
17 | - $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; |
|
18 | - $sqlQuery = $modx->getDatabase()->escape($query); |
|
19 | - $_PAGE['vs']['search'] = $query; |
|
17 | + $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; |
|
18 | + $sqlQuery = $modx->getDatabase()->escape($query); |
|
19 | + $_PAGE['vs']['search'] = $query; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | // get & save listmode |
@@ -119,29 +119,29 @@ discard block |
||
119 | 119 | <div class="row"> |
120 | 120 | <div class="table-responsive"> |
121 | 121 | <?php |
122 | - $ds = $modx->getDatabase()->select("wu.id, wu.username, wua.fullname, wua.email, wua.lastlogin, wua.logincount, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu |
|
122 | + $ds = $modx->getDatabase()->select("wu.id, wu.username, wua.fullname, wua.email, wua.lastlogin, wua.logincount, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu |
|
123 | 123 | INNER JOIN " . $modx->getFullTableName("web_user_attributes") . " wua ON wua.internalKey=wu.id", ($sqlQuery ? "(wu.username LIKE '{$sqlQuery}%') OR (wua.fullname LIKE '%{$sqlQuery}%') OR (wua.email LIKE '%{$sqlQuery}%')" : ""), 'username'); |
124 | - $grd = new \EvolutionCMS\Support\DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items |
|
125 | - $grd->noRecordMsg = $_lang["no_records_found"]; |
|
126 | - $grd->cssClass = "table data"; |
|
127 | - $grd->columnHeaderClass = "tableHeader"; |
|
128 | - $grd->itemClass = "tableItem"; |
|
129 | - $grd->altItemClass = "tableAltItem"; |
|
130 | - $grd->fields = "id,username,fullname,email,lastlogin,logincount,blocked"; |
|
131 | - $grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["user_full_name"] . " ," . $_lang["email"] . " ," . $_lang["user_prevlogin"] . " ," . $_lang["user_logincount"] . " ," . $_lang["user_block"]; |
|
132 | - $grd->colWidths = "1%,,,,1%,1%,1%"; |
|
133 | - $grd->colAligns = "center,,,,right' nowrap='nowrap,right,center"; |
|
134 | - $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang["click_to_context"] . "'><i class='" . $_style["icons_user"] . "'></i></a>||template:<a href='index.php?a=88&id=[+id+]' title='" . $_lang["click_to_edit_title"] . "'>[+value+]</a>||template:[+fullname+]||template:[+email+]||date: " . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . |
|
135 | - " %H:%M"; |
|
136 | - if($listmode == '1') { |
|
137 | - $grd->pageSize = 0; |
|
138 | - } |
|
139 | - if($_REQUEST['op'] == 'reset') { |
|
140 | - $grd->pageNumber = 1; |
|
141 | - } |
|
142 | - // render grid |
|
143 | - echo $grd->render(); |
|
144 | - ?> |
|
124 | + $grd = new \EvolutionCMS\Support\DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items |
|
125 | + $grd->noRecordMsg = $_lang["no_records_found"]; |
|
126 | + $grd->cssClass = "table data"; |
|
127 | + $grd->columnHeaderClass = "tableHeader"; |
|
128 | + $grd->itemClass = "tableItem"; |
|
129 | + $grd->altItemClass = "tableAltItem"; |
|
130 | + $grd->fields = "id,username,fullname,email,lastlogin,logincount,blocked"; |
|
131 | + $grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["user_full_name"] . " ," . $_lang["email"] . " ," . $_lang["user_prevlogin"] . " ," . $_lang["user_logincount"] . " ," . $_lang["user_block"]; |
|
132 | + $grd->colWidths = "1%,,,,1%,1%,1%"; |
|
133 | + $grd->colAligns = "center,,,,right' nowrap='nowrap,right,center"; |
|
134 | + $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang["click_to_context"] . "'><i class='" . $_style["icons_user"] . "'></i></a>||template:<a href='index.php?a=88&id=[+id+]' title='" . $_lang["click_to_edit_title"] . "'>[+value+]</a>||template:[+fullname+]||template:[+email+]||date: " . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . |
|
135 | + " %H:%M"; |
|
136 | + if($listmode == '1') { |
|
137 | + $grd->pageSize = 0; |
|
138 | + } |
|
139 | + if($_REQUEST['op'] == 'reset') { |
|
140 | + $grd->pageNumber = 1; |
|
141 | + } |
|
142 | + // render grid |
|
143 | + echo $grd->render(); |
|
144 | + ?> |
|
145 | 145 | </div> |
146 | 146 | </div> |
147 | 147 | </div> |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | 4 | } |
5 | 5 | if(!$modx->hasPermission('edit_user')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | // initialize page view state - the $_PAGE object |
@@ -11,12 +11,12 @@ discard block |
||
11 | 11 | |
12 | 12 | // get and save search string |
13 | 13 | if($_REQUEST['op'] == 'reset') { |
14 | - $query = ''; |
|
15 | - $_PAGE['vs']['search'] = ''; |
|
14 | + $query = ''; |
|
15 | + $_PAGE['vs']['search'] = ''; |
|
16 | 16 | } else { |
17 | - $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; |
|
18 | - $sqlQuery = $modx->getDatabase()->escape($query); |
|
19 | - $_PAGE['vs']['search'] = $query; |
|
17 | + $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; |
|
18 | + $sqlQuery = $modx->getDatabase()->escape($query); |
|
19 | + $_PAGE['vs']['search'] = $query; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | // get & save listmode |
@@ -119,54 +119,54 @@ discard block |
||
119 | 119 | <div class="row"> |
120 | 120 | <div class="table-responsive"> |
121 | 121 | <?php |
122 | - $where = ""; |
|
123 | - if(!$modx->hasPermission('save_role')) { |
|
124 | - $where .= (empty($where) ? "" : " AND ") . "mua.role != 1"; |
|
125 | - } |
|
126 | - if(!empty($sqlQuery)) { |
|
127 | - $where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))"; |
|
128 | - } |
|
129 | - $ds = $modx->getDatabase()->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin, mua.logincount", $modx->getFullTableName('manager_users') . " AS mu |
|
122 | + $where = ""; |
|
123 | + if(!$modx->hasPermission('save_role')) { |
|
124 | + $where .= (empty($where) ? "" : " AND ") . "mua.role != 1"; |
|
125 | + } |
|
126 | + if(!empty($sqlQuery)) { |
|
127 | + $where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))"; |
|
128 | + } |
|
129 | + $ds = $modx->getDatabase()->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin, mua.logincount", $modx->getFullTableName('manager_users') . " AS mu |
|
130 | 130 | INNER JOIN " . $modx->getFullTableName('user_attributes') . " AS mua ON mua.internalKey=mu.id |
131 | 131 | LEFT JOIN " . $modx->getFullTableName('user_roles') . " AS rname ON mua.role=rname.id", $where, 'mua.blocked ASC, mua.thislogin DESC'); |
132 | - $grd = new \EvolutionCMS\Support\DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items |
|
133 | - $grd->noRecordMsg = $_lang["no_records_found"]; |
|
134 | - $grd->cssClass = "table data"; |
|
135 | - $grd->columnHeaderClass = "tableHeader"; |
|
136 | - $grd->itemClass = "tableItem"; |
|
137 | - $grd->altItemClass = "tableAltItem"; |
|
138 | - $grd->fields = "id,username,fullname,role,email,thislogin,logincount,blocked"; |
|
139 | - $grd->columns = implode(',', array( |
|
140 | - $_lang["icon"], |
|
141 | - $_lang["name"], |
|
142 | - $_lang["user_full_name"], |
|
143 | - $_lang['role'], |
|
144 | - $_lang["email"], |
|
145 | - $_lang["user_prevlogin"], |
|
146 | - $_lang["user_logincount"], |
|
147 | - $_lang["user_block"] |
|
148 | - )); |
|
149 | - $grd->colWidths = "1%,,,,,1%,1%,1%"; |
|
150 | - $grd->colAligns = "center,,,,,right' nowrap='nowrap,right,center"; |
|
151 | - $grd->colTypes = implode('||', array( |
|
152 | - 'template:<a class="gridRowIcon" href="javascript:;" onclick="return showContentMenu([+id+],event);" title="' . $_lang['click_to_context'] . '"><i class="' . $_style['icons_user'] . '"></i></a>', |
|
153 | - 'template:<a href="index.php?a=12&id=[+id+]" title="' . $_lang['click_to_edit_title'] . '">[+value+]</a>', |
|
154 | - 'template:[+fullname+]', |
|
155 | - 'template:[+role+]', |
|
156 | - 'template:[+email+]', |
|
157 | - 'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M', |
|
158 | - 'template:[+logincount+]', |
|
159 | - 'template:[+blocked+]' |
|
160 | - )); |
|
161 | - if($listmode == '1') { |
|
162 | - $grd->pageSize = 0; |
|
163 | - } |
|
164 | - if($_REQUEST['op'] == 'reset') { |
|
165 | - $grd->pageNumber = 1; |
|
166 | - } |
|
167 | - // render grid |
|
168 | - echo $grd->render(); |
|
169 | - ?> |
|
132 | + $grd = new \EvolutionCMS\Support\DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items |
|
133 | + $grd->noRecordMsg = $_lang["no_records_found"]; |
|
134 | + $grd->cssClass = "table data"; |
|
135 | + $grd->columnHeaderClass = "tableHeader"; |
|
136 | + $grd->itemClass = "tableItem"; |
|
137 | + $grd->altItemClass = "tableAltItem"; |
|
138 | + $grd->fields = "id,username,fullname,role,email,thislogin,logincount,blocked"; |
|
139 | + $grd->columns = implode(',', array( |
|
140 | + $_lang["icon"], |
|
141 | + $_lang["name"], |
|
142 | + $_lang["user_full_name"], |
|
143 | + $_lang['role'], |
|
144 | + $_lang["email"], |
|
145 | + $_lang["user_prevlogin"], |
|
146 | + $_lang["user_logincount"], |
|
147 | + $_lang["user_block"] |
|
148 | + )); |
|
149 | + $grd->colWidths = "1%,,,,,1%,1%,1%"; |
|
150 | + $grd->colAligns = "center,,,,,right' nowrap='nowrap,right,center"; |
|
151 | + $grd->colTypes = implode('||', array( |
|
152 | + 'template:<a class="gridRowIcon" href="javascript:;" onclick="return showContentMenu([+id+],event);" title="' . $_lang['click_to_context'] . '"><i class="' . $_style['icons_user'] . '"></i></a>', |
|
153 | + 'template:<a href="index.php?a=12&id=[+id+]" title="' . $_lang['click_to_edit_title'] . '">[+value+]</a>', |
|
154 | + 'template:[+fullname+]', |
|
155 | + 'template:[+role+]', |
|
156 | + 'template:[+email+]', |
|
157 | + 'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M', |
|
158 | + 'template:[+logincount+]', |
|
159 | + 'template:[+blocked+]' |
|
160 | + )); |
|
161 | + if($listmode == '1') { |
|
162 | + $grd->pageSize = 0; |
|
163 | + } |
|
164 | + if($_REQUEST['op'] == 'reset') { |
|
165 | + $grd->pageNumber = 1; |
|
166 | + } |
|
167 | + // render grid |
|
168 | + echo $grd->render(); |
|
169 | + ?> |
|
170 | 170 | </div> |
171 | 171 | </div> |
172 | 172 | </div> |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | 4 | } |
5 | 5 | if(!$modx->hasPermission('view_eventlog')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | // Get table Names (alphabetical) |
@@ -16,14 +16,14 @@ discard block |
||
16 | 16 | |
17 | 17 | // get and save search string |
18 | 18 | if($_REQUEST['op'] == 'reset') { |
19 | - $sqlQuery = $query = ''; |
|
20 | - $_PAGE['vs']['search'] = ''; |
|
19 | + $sqlQuery = $query = ''; |
|
20 | + $_PAGE['vs']['search'] = ''; |
|
21 | 21 | } else { |
22 | - $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; |
|
23 | - if(!is_numeric($sqlQuery)) { |
|
24 | - $sqlQuery = $modx->getDatabase()->escape($query); |
|
25 | - } |
|
26 | - $_PAGE['vs']['search'] = $query; |
|
22 | + $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; |
|
23 | + if(!is_numeric($sqlQuery)) { |
|
24 | + $sqlQuery = $modx->getDatabase()->escape($query); |
|
25 | + } |
|
26 | + $_PAGE['vs']['search'] = $query; |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | // get & save listmode |
@@ -124,32 +124,32 @@ discard block |
||
124 | 124 | <div class="row"> |
125 | 125 | <div class="table-responsive"> |
126 | 126 | <?php |
127 | - $ds = $modx->getDatabase()->select("el.id, ELT(el.type , 'text-info {$_style['actions_info']}' , 'text-warning {$_style['actions_triangle']}' , 'text-danger {$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el |
|
127 | + $ds = $modx->getDatabase()->select("el.id, ELT(el.type , 'text-info {$_style['actions_info']}' , 'text-warning {$_style['actions_triangle']}' , 'text-danger {$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el |
|
128 | 128 | LEFT JOIN {$tbl_manager_users} AS mu ON mu.id=el.user AND el.usertype=0 |
129 | 129 | LEFT JOIN {$tbl_web_users} AS wu ON wu.id=el.user AND el.usertype=1", ($sqlQuery ? "" . (is_numeric($sqlQuery) ? "(eventid='{$sqlQuery}') OR " : '') . "(source LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "createdon DESC"); |
130 | - $grd = new \EvolutionCMS\Support\DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items |
|
131 | - $grd->pagerClass = ''; |
|
132 | - $grd->pageClass = 'page-item'; |
|
133 | - $grd->selPageClass = 'page-item active'; |
|
134 | - $grd->noRecordMsg = $_lang['no_records_found']; |
|
135 | - $grd->cssClass = "table data nowrap"; |
|
136 | - $grd->columnHeaderClass = "tableHeader"; |
|
137 | - $grd->itemClass = "tableItem"; |
|
138 | - $grd->altItemClass = "tableAltItem"; |
|
139 | - $grd->fields = "type,source,createdon,eventid,username"; |
|
140 | - $grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid']; |
|
141 | - $grd->colWidths = "1%,,1%,1%,1%"; |
|
142 | - $grd->colAligns = "center,,,center,center"; |
|
143 | - $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang['click_to_context'] . "'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='" . $_lang['click_to_view_details'] . "'>[+source+]</a>||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p'; |
|
144 | - if($listmode == '1') { |
|
145 | - $grd->pageSize = 0; |
|
146 | - } |
|
147 | - if($_REQUEST['op'] == 'reset') { |
|
148 | - $grd->pageNumber = 1; |
|
149 | - } |
|
150 | - // render grid |
|
151 | - echo $grd->render(); |
|
152 | - ?> |
|
130 | + $grd = new \EvolutionCMS\Support\DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items |
|
131 | + $grd->pagerClass = ''; |
|
132 | + $grd->pageClass = 'page-item'; |
|
133 | + $grd->selPageClass = 'page-item active'; |
|
134 | + $grd->noRecordMsg = $_lang['no_records_found']; |
|
135 | + $grd->cssClass = "table data nowrap"; |
|
136 | + $grd->columnHeaderClass = "tableHeader"; |
|
137 | + $grd->itemClass = "tableItem"; |
|
138 | + $grd->altItemClass = "tableAltItem"; |
|
139 | + $grd->fields = "type,source,createdon,eventid,username"; |
|
140 | + $grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid']; |
|
141 | + $grd->colWidths = "1%,,1%,1%,1%"; |
|
142 | + $grd->colAligns = "center,,,center,center"; |
|
143 | + $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang['click_to_context'] . "'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='" . $_lang['click_to_view_details'] . "'>[+source+]</a>||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p'; |
|
144 | + if($listmode == '1') { |
|
145 | + $grd->pageSize = 0; |
|
146 | + } |
|
147 | + if($_REQUEST['op'] == 'reset') { |
|
148 | + $grd->pageNumber = 1; |
|
149 | + } |
|
150 | + // render grid |
|
151 | + echo $grd->render(); |
|
152 | + ?> |
|
153 | 153 | </div> |
154 | 154 | </div> |
155 | 155 | </div> |