@@ -1,5 +1,5 @@ |
||
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 | ?> |
@@ -1,5 +1,5 @@ |
||
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 | ?> |
@@ -1,5 +1,5 @@ |
||
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 | ?> |
@@ -1,5 +1,5 @@ |
||
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 | ?> |
@@ -1,22 +1,22 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -switch($modx->getManagerApi()->action) { |
|
5 | +switch ($modx->getManagerApi()->action) { |
|
6 | 6 | case 107: |
7 | - if(!$modx->hasPermission('new_module')) { |
|
7 | + if (!$modx->hasPermission('new_module')) { |
|
8 | 8 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
9 | 9 | } |
10 | 10 | break; |
11 | 11 | case 108: |
12 | - if(!$modx->hasPermission('edit_module')) { |
|
12 | + if (!$modx->hasPermission('edit_module')) { |
|
13 | 13 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
14 | 14 | } |
15 | 15 | break; |
16 | 16 | default: |
17 | 17 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
18 | 18 | } |
19 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
19 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
20 | 20 | // Get table names (alphabetical) |
21 | 21 | $tbl_membergroup_names = $modx->getDatabase()->getFullTableName('membergroup_names'); |
22 | 22 | $tbl_site_content = $modx->getDatabase()->getFullTableName('site_content'); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | |
33 | 33 | // check to see the module editor isn't locked |
34 | -if($lockedEl = $modx->elementIsLocked(6, $id)) { |
|
34 | +if ($lockedEl = $modx->elementIsLocked(6, $id)) { |
|
35 | 35 | $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); |
36 | 36 | } |
37 | 37 | // end check for lock |
@@ -39,29 +39,29 @@ discard block |
||
39 | 39 | // Lock snippet for other users to edit |
40 | 40 | $modx->lockElement(6, $id); |
41 | 41 | |
42 | -if(isset($_GET['id'])) { |
|
42 | +if (isset($_GET['id'])) { |
|
43 | 43 | $rs = $modx->getDatabase()->select('*', $tbl_site_modules, "id='{$id}'"); |
44 | 44 | $content = $modx->getDatabase()->getRow($rs); |
45 | - if(!$content) { |
|
45 | + if (!$content) { |
|
46 | 46 | $modx->webAlertAndQuit("Module not found for id '{$id}'."); |
47 | 47 | } |
48 | 48 | $content['properties'] = str_replace("&", "&", $content['properties']); |
49 | 49 | $_SESSION['itemname'] = $content['name']; |
50 | - if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
50 | + if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
51 | 51 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
52 | 52 | } |
53 | 53 | } else { |
54 | 54 | $_SESSION['itemname'] = $_lang["new_module"]; |
55 | 55 | $content['wrap'] = '1'; |
56 | 56 | } |
57 | -if($modx->getManagerApi()->hasFormValues()) { |
|
57 | +if ($modx->getManagerApi()->hasFormValues()) { |
|
58 | 58 | $modx->getManagerApi()->loadFormValues(); |
59 | 59 | } |
60 | 60 | |
61 | 61 | // Add lock-element JS-Script |
62 | 62 | $lockElementId = $id; |
63 | 63 | $lockElementType = 6; |
64 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
64 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
65 | 65 | ?> |
66 | 66 | <script type="text/javascript"> |
67 | 67 | function loadDependencies() { |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | function BrowseServer() { |
409 | 409 | var w = screen.width * 0.7; |
410 | 410 | var h = screen.height * 0.7; |
411 | - OpenServerBrowser("<?= MODX_MANAGER_URL;?>media/browser/<?= $which_browser;?>/browser.php?Type=images", w, h); |
|
411 | + OpenServerBrowser("<?= MODX_MANAGER_URL; ?>media/browser/<?= $which_browser; ?>/browser.php?Type=images", w, h); |
|
412 | 412 | } |
413 | 413 | |
414 | 414 | function SetUrl(url, width, height, alt) { |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | <?php |
429 | 429 | // invoke OnModFormPrerender event |
430 | 430 | $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id)); |
431 | - if(is_array($evtOut)) { |
|
431 | + if (is_array($evtOut)) { |
|
432 | 432 | echo implode('', $evtOut); |
433 | 433 | } |
434 | 434 | |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | <input type="hidden" name="mode" value="<?= $modx->getManagerApi()->action ?>"> |
443 | 443 | |
444 | 444 | <h1> |
445 | - <i class="<?= ($content['icon'] != '' ? $content['icon'] : $_style['icons_module']) ?>"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_module']) ?><i class="fa fa-question-circle help"></i> |
|
445 | + <i class="<?= ($content['icon'] != '' ? $content['icon'] : $_style['icons_module']) ?>"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_module']) ?><i class="fa fa-question-circle help"></i> |
|
446 | 446 | </h1> |
447 | 447 | |
448 | 448 | <?= ManagerTheme::getStyle('actionbuttons.dynamic.element') ?> |
@@ -467,8 +467,8 @@ discard block |
||
467 | 467 | <div class="col-md-9 col-lg-10"> |
468 | 468 | <div class="form-control-name clearfix"> |
469 | 469 | <input name="name" type="text" maxlength="100" value="<?= $modx->getPhpCompat()->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" /> |
470 | - <?php if($modx->hasPermission('save_role')): ?> |
|
471 | - <label class="custom-control" title="<?= $_lang['lock_module'] . "\n" . $_lang['lock_module_msg'] ?>" tooltip> |
|
470 | + <?php if ($modx->hasPermission('save_role')): ?> |
|
471 | + <label class="custom-control" title="<?= $_lang['lock_module']."\n".$_lang['lock_module_msg'] ?>" tooltip> |
|
472 | 472 | <input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> /> |
473 | 473 | <i class="fa fa-lock"></i> |
474 | 474 | </label> |
@@ -490,9 +490,9 @@ 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"; |
|
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 | 496 | } |
497 | 497 | ?> |
498 | 498 | </select> |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | <div class="form-group"> |
525 | 525 | <div class="form-row"> |
526 | 526 | <label for="disabled"><input name="disabled" id="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> |
527 | - <?= ($content['disabled'] == 1 ? '<span class="text-danger">' . $_lang['module_disabled'] . '</span>' : $_lang['module_disabled']) ?></label> |
|
527 | + <?= ($content['disabled'] == 1 ? '<span class="text-danger">'.$_lang['module_disabled'].'</span>' : $_lang['module_disabled']) ?></label> |
|
528 | 528 | </div> |
529 | 529 | <div class="form-row"> |
530 | 530 | <label for="parse_docblock"> |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | </div> |
590 | 590 | <!-- HTML text editor end --> |
591 | 591 | </div> |
592 | - <?php if($modx->getManagerApi()->action == '108'): ?> |
|
592 | + <?php if ($modx->getManagerApi()->action == '108'): ?> |
|
593 | 593 | <!-- Dependencies --> |
594 | 594 | <div class="tab-page" id="tabDepend"> |
595 | 595 | <h2 class="tab"><?= $_lang['settings_dependencies'] ?></h2> |
@@ -623,7 +623,7 @@ discard block |
||
623 | 623 | $grd->columnHeaderClass = 'gridHeader'; |
624 | 624 | $grd->itemClass = 'gridItem'; |
625 | 625 | $grd->altItemClass = 'gridAltItem'; |
626 | - $grd->columns = $_lang['element_name'] . " ," . $_lang['type']; |
|
626 | + $grd->columns = $_lang['element_name']." ,".$_lang['type']; |
|
627 | 627 | $grd->fields = "name,type"; |
628 | 628 | echo $grd->render(); |
629 | 629 | ?> |
@@ -636,13 +636,13 @@ discard block |
||
636 | 636 | <h2 class="tab"><?= $_lang['access_permissions'] ?></h2> |
637 | 637 | <script type="text/javascript">tp.addTabPage(document.getElementById("tabPermissions"));</script> |
638 | 638 | <div class="container container-body"> |
639 | - <?php if($modx->getConfig('use_udperms')) : ?> |
|
639 | + <?php if ($modx->getConfig('use_udperms')) : ?> |
|
640 | 640 | <?php |
641 | 641 | // fetch user access permissions for the module |
642 | 642 | $rs = $modx->getDatabase()->select('usergroup', $tbl_site_module_access, "module='{$id}'"); |
643 | 643 | $groupsarray = $modx->getDatabase()->getColumn('usergroup', $rs); |
644 | 644 | |
645 | - if($modx->hasPermission('access_permissions')) { |
|
645 | + if ($modx->hasPermission('access_permissions')) { |
|
646 | 646 | ?> |
647 | 647 | <!-- User Group Access Permissions --> |
648 | 648 | <script type="text/javascript"> |
@@ -670,22 +670,22 @@ discard block |
||
670 | 670 | } |
671 | 671 | $chk = ''; |
672 | 672 | $rs = $modx->getDatabase()->select('name, id', $tbl_membergroup_names, '', 'name'); |
673 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
673 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
674 | 674 | $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); |
675 | 675 | $checked = in_array($row['id'], $groupsarray); |
676 | - if($modx->hasPermission('access_permissions')) { |
|
677 | - if($checked) { |
|
676 | + if ($modx->hasPermission('access_permissions')) { |
|
677 | + if ($checked) { |
|
678 | 678 | $notPublic = true; |
679 | 679 | } |
680 | - $chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n"; |
|
680 | + $chks .= '<label><input type="checkbox" name="usrgroups[]" value="'.$row['id'].'"'.($checked ? ' checked="checked"' : '').' onclick="makePublic(false)" /> '.$row['name']."</label><br />\n"; |
|
681 | 681 | } else { |
682 | - if($checked) { |
|
683 | - $chks = '<input type="hidden" name="usrgroups[]" value="' . $row['id'] . '" />' . "\n" . $chks; |
|
682 | + if ($checked) { |
|
683 | + $chks = '<input type="hidden" name="usrgroups[]" value="'.$row['id'].'" />'."\n".$chks; |
|
684 | 684 | } |
685 | 685 | } |
686 | 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; |
|
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 | 689 | } |
690 | 690 | echo $chks; |
691 | 691 | ?> |
@@ -706,7 +706,7 @@ discard block |
||
706 | 706 | <?php |
707 | 707 | // invoke OnModFormRender event |
708 | 708 | $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id)); |
709 | - if(is_array($evtOut)) { |
|
709 | + if (is_array($evtOut)) { |
|
710 | 710 | echo implode('', $evtOut); |
711 | 711 | } |
712 | 712 | ?> |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | if (!$modx->hasPermission('edit_document') || !$modx->hasPermission('save_document')) { |
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : null; |
|
9 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : null; |
|
10 | 10 | $reset = isset($_POST['reset']) && $_POST['reset'] == 'true' ? 1 : 0; |
11 | 11 | $items = isset($_POST['list']) ? $_POST['list'] : ''; |
12 | 12 | $ressourcelist = ''; |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | if (isset($_POST['listSubmitted'])) { |
26 | - $updateMsg .= '<div class="text-success" id="updated">' . $_lang['sort_updated'] . '</div>'; |
|
26 | + $updateMsg .= '<div class="text-success" id="updated">'.$_lang['sort_updated'].'</div>'; |
|
27 | 27 | if (strlen($items) > 0) { |
28 | 28 | $items = explode(';', $items); |
29 | 29 | foreach ($items as $key => $value) { |
@@ -43,15 +43,15 @@ discard block |
||
43 | 43 | $tblsc = $modx->getDatabase()->getFullTableName('site_content'); |
44 | 44 | $tbldg = $modx->getDatabase()->getFullTableName('document_groups'); |
45 | 45 | |
46 | - $rs = $modx->getDatabase()->select('pagetitle', $tblsc, 'id=' . $id . ''); |
|
46 | + $rs = $modx->getDatabase()->select('pagetitle', $tblsc, 'id='.$id.''); |
|
47 | 47 | $pagetitle = $modx->getDatabase()->getValue($rs); |
48 | 48 | |
49 | 49 | $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; |
50 | 50 | $docgrp_cond = $docgrp ? "OR dg.document_group IN ({$docgrp})" : ''; |
51 | - $mgrRole = (isset ($_SESSION['mgrRole']) && (string)$_SESSION['mgrRole'] === '1') ? '1' : '0'; |
|
52 | - $access = " AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
51 | + $mgrRole = (isset ($_SESSION['mgrRole']) && (string) $_SESSION['mgrRole'] === '1') ? '1' : '0'; |
|
52 | + $access = " AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
53 | 53 | |
54 | - $rs = $modx->getDatabase()->select('sc.id, sc.pagetitle, sc.parent, sc.menuindex, sc.published, sc.hidemenu, sc.deleted, sc.isfolder', $tblsc . 'AS sc LEFT JOIN ' . $tbldg . ' dg ON dg.document=sc.id', 'sc.parent=' . $id . $access . ' GROUP BY sc.id', 'menuindex ASC'); |
|
54 | + $rs = $modx->getDatabase()->select('sc.id, sc.pagetitle, sc.parent, sc.menuindex, sc.published, sc.hidemenu, sc.deleted, sc.isfolder', $tblsc.'AS sc LEFT JOIN '.$tbldg.' dg ON dg.document=sc.id', 'sc.parent='.$id.$access.' GROUP BY sc.id', 'menuindex ASC'); |
|
55 | 55 | |
56 | 56 | if ($modx->getDatabase()->getRecordCount($rs)) { |
57 | 57 | $ressourcelist .= '<div class="clearfix"><ul id="sortlist" class="sortableList">'; |
@@ -60,12 +60,12 @@ discard block |
||
60 | 60 | $classes .= ($row['hidemenu']) ? ' notInMenuNode ' : ' inMenuNode'; |
61 | 61 | $classes .= ($row['published']) ? ' publishedNode ' : ' unpublishedNode '; |
62 | 62 | $classes = ($row['deleted']) ? ' deletedNode ' : $classes; |
63 | - $icon = $row['isfolder'] ? '<i class="' . $_style['files_folder'] . '"></i> ' : ' <i class="' . $_style['files_page_html'] . '"></i> '; |
|
64 | - $ressourcelist .= '<li id="item_' . $row['id'] . '" class="' . $classes . '">' . $icon . $row['pagetitle'] . ' <small>(' . $row['id'] . ')</small></li>'; |
|
63 | + $icon = $row['isfolder'] ? '<i class="'.$_style['files_folder'].'"></i> ' : ' <i class="'.$_style['files_page_html'].'"></i> '; |
|
64 | + $ressourcelist .= '<li id="item_'.$row['id'].'" class="'.$classes.'">'.$icon.$row['pagetitle'].' <small>('.$row['id'].')</small></li>'; |
|
65 | 65 | } |
66 | 66 | $ressourcelist .= '</ul></div>'; |
67 | 67 | } else { |
68 | - $updateMsg = '<p class="text-danger">' . $_lang['sort_nochildren'] . '</p>'; |
|
68 | + $updateMsg = '<p class="text-danger">'.$_lang['sort_nochildren'].'</p>'; |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | </script> |
149 | 149 | |
150 | 150 | <h1> |
151 | - <i class="fa fa-sort-numeric-asc"></i><?= ($pagetitle ? $modx->getPhpCompat()->entities($pagetitle) . '<small>(' . $id . ')</small>' : $_lang['sort_menuindex']) ?> |
|
151 | + <i class="fa fa-sort-numeric-asc"></i><?= ($pagetitle ? $modx->getPhpCompat()->entities($pagetitle).'<small>('.$id.')</small>' : $_lang['sort_menuindex']) ?> |
|
152 | 152 | </h1> |
153 | 153 | |
154 | 154 | <?= ManagerTheme::getStyle('actionbuttons.dynamic.save') ?> |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | |
6 | -if(!$modx->hasPermission('category_manager')) { |
|
6 | +if (!$modx->hasPermission('category_manager')) { |
|
7 | 7 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
8 | 8 | } |
9 | 9 | |
@@ -15,11 +15,11 @@ discard block |
||
15 | 15 | 'native_language' => 'de', |
16 | 16 | 'name' => $_lang['manage_categories'], |
17 | 17 | 'dirname' => $site_manager_url, |
18 | - 'url' => 'index.php?a=120&id=' . $_GET['id'], |
|
19 | - 'path' => realpath( __DIR__ ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR, |
|
20 | - 'inc_dir' => realpath( __DIR__ ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR, |
|
21 | - 'languages_dir' => realpath( __DIR__ ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR, |
|
22 | - 'views_dir' => realpath( __DIR__ ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'skin' . DIRECTORY_SEPARATOR, |
|
18 | + 'url' => 'index.php?a=120&id='.$_GET['id'], |
|
19 | + 'path' => realpath(__DIR__).DIRECTORY_SEPARATOR.'category_mgr'.DIRECTORY_SEPARATOR, |
|
20 | + 'inc_dir' => realpath(__DIR__).DIRECTORY_SEPARATOR.'category_mgr'.DIRECTORY_SEPARATOR.'inc'.DIRECTORY_SEPARATOR, |
|
21 | + 'languages_dir' => realpath(__DIR__).DIRECTORY_SEPARATOR.'category_mgr'.DIRECTORY_SEPARATOR.'lang'.DIRECTORY_SEPARATOR, |
|
22 | + 'views_dir' => realpath(__DIR__).DIRECTORY_SEPARATOR.'category_mgr'.DIRECTORY_SEPARATOR.'skin'.DIRECTORY_SEPARATOR, |
|
23 | 23 | 'request_key' => 'module_categories_manager', |
24 | 24 | 'messages' => array() |
25 | 25 | ); |
@@ -27,19 +27,19 @@ discard block |
||
27 | 27 | $cm = new EvolutionCMS\Legacy\ModuleCategoriesManager(); |
28 | 28 | |
29 | 29 | // assign module_params to internal params |
30 | -foreach( $_module_params as $param => $value ) |
|
30 | +foreach ($_module_params as $param => $value) |
|
31 | 31 | { |
32 | - $cm->set( $param, $value ); |
|
32 | + $cm->set($param, $value); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | // catch the request actions |
36 | -include_once $cm->get('inc_dir') . 'request_trigger.inc.php'; |
|
36 | +include_once $cm->get('inc_dir').'request_trigger.inc.php'; |
|
37 | 37 | |
38 | -if( !$categories = $cm->getCategories() ) |
|
38 | +if (!$categories = $cm->getCategories()) |
|
39 | 39 | { |
40 | - setcookie('webfxtab_manage-categories-pane', 0 ); |
|
41 | - $cm->addMessage( $cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global' ); |
|
40 | + setcookie('webfxtab_manage-categories-pane', 0); |
|
41 | + $cm->addMessage($cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global'); |
|
42 | 42 | } |
43 | 43 | |
44 | -$cm->renderView('main', $categories ); |
|
44 | +$cm->renderView('main', $categories); |
|
45 | 45 | return; |
@@ -1,30 +1,30 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /********************/ |
3 | -$sd = isset($_REQUEST['dir']) ? '&dir=' . $_REQUEST['dir'] : '&dir=DESC'; |
|
4 | -$sb = isset($_REQUEST['sort']) ? '&sort=' . $_REQUEST['sort'] : '&sort=createdon'; |
|
5 | -$pg = isset($_REQUEST['page']) ? '&page=' . (int) $_REQUEST['page'] : ''; |
|
6 | -$add_path = $sd . $sb . $pg; |
|
3 | +$sd = isset($_REQUEST['dir']) ? '&dir='.$_REQUEST['dir'] : '&dir=DESC'; |
|
4 | +$sb = isset($_REQUEST['sort']) ? '&sort='.$_REQUEST['sort'] : '&sort=createdon'; |
|
5 | +$pg = isset($_REQUEST['page']) ? '&page='.(int) $_REQUEST['page'] : ''; |
|
6 | +$add_path = $sd.$sb.$pg; |
|
7 | 7 | /*******************/ |
8 | 8 | |
9 | 9 | // check permissions |
10 | -switch($modx->getManagerApi()->action) { |
|
10 | +switch ($modx->getManagerApi()->action) { |
|
11 | 11 | case 27: |
12 | - if(!$modx->hasPermission('edit_document')) { |
|
12 | + if (!$modx->hasPermission('edit_document')) { |
|
13 | 13 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
14 | 14 | } |
15 | 15 | break; |
16 | 16 | case 85: |
17 | 17 | case 72: |
18 | 18 | case 4: |
19 | - if(!$modx->hasPermission('new_document')) { |
|
19 | + if (!$modx->hasPermission('new_document')) { |
|
20 | 20 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
21 | - } elseif(isset($_REQUEST['pid']) && $_REQUEST['pid'] != '0') { |
|
21 | + } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '0') { |
|
22 | 22 | // check user has permissions for parent |
23 | 23 | $udperms = new EvolutionCMS\Legacy\Permissions(); |
24 | 24 | $udperms->user = $modx->getLoginUserID(); |
25 | 25 | $udperms->document = empty($_REQUEST['pid']) ? 0 : $_REQUEST['pid']; |
26 | 26 | $udperms->role = $_SESSION['mgrRole']; |
27 | - if(!$udperms->checkPermissions()) { |
|
27 | + if (!$udperms->checkPermissions()) { |
|
28 | 28 | $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
29 | 29 | } |
30 | 30 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
34 | 34 | } |
35 | 35 | |
36 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
36 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
37 | 37 | |
38 | 38 | // Get table names (alphabetical) |
39 | 39 | $tbl_categories = $modx->getDatabase()->getFullTableName('categories'); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $tbl_site_tmplvar_templates = $modx->getDatabase()->getFullTableName('site_tmplvar_templates'); |
49 | 49 | $tbl_site_tmplvars = $modx->getDatabase()->getFullTableName('site_tmplvars'); |
50 | 50 | |
51 | -if($modx->getManagerApi()->action == 27) { |
|
51 | +if ($modx->getManagerApi()->action == 27) { |
|
52 | 52 | //editing an existing document |
53 | 53 | // check permissions on the document |
54 | 54 | $udperms = new EvolutionCMS\Legacy\Permissions(); |
@@ -56,13 +56,13 @@ discard block |
||
56 | 56 | $udperms->document = $id; |
57 | 57 | $udperms->role = $_SESSION['mgrRole']; |
58 | 58 | |
59 | - if(!$udperms->checkPermissions()) { |
|
59 | + if (!$udperms->checkPermissions()) { |
|
60 | 60 | $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
64 | 64 | // check to see if resource isn't locked |
65 | -if($lockedEl = $modx->elementIsLocked(7, $id)) { |
|
65 | +if ($lockedEl = $modx->elementIsLocked(7, $id)) { |
|
66 | 66 | $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['resource'])); |
67 | 67 | } |
68 | 68 | // end check for lock |
@@ -71,27 +71,27 @@ discard block |
||
71 | 71 | $modx->lockElement(7, $id); |
72 | 72 | |
73 | 73 | // get document groups for current user |
74 | -if($_SESSION['mgrDocgroups']) { |
|
74 | +if ($_SESSION['mgrDocgroups']) { |
|
75 | 75 | $docgrp = implode(',', $_SESSION['mgrDocgroups']); |
76 | 76 | } |
77 | 77 | |
78 | -if(!empty ($id)) { |
|
78 | +if (!empty ($id)) { |
|
79 | 79 | $access = sprintf("1='%s' OR sc.privatemgr=0", $_SESSION['mgrRole']); |
80 | - if($docgrp) { |
|
80 | + if ($docgrp) { |
|
81 | 81 | $access .= " OR dg.document_group IN ({$docgrp})"; |
82 | 82 | } |
83 | 83 | $rs = $modx->getDatabase()->select('sc.*', "{$tbl_site_content} AS sc LEFT JOIN {$tbl_document_groups} AS dg ON dg.document=sc.id", "sc.id='{$id}' AND ({$access})"); |
84 | 84 | $content = array(); |
85 | 85 | $content = $modx->getDatabase()->getRow($rs); |
86 | 86 | $modx->documentObject = &$content; |
87 | - if(!$content) { |
|
87 | + if (!$content) { |
|
88 | 88 | $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
89 | 89 | } |
90 | 90 | $_SESSION['itemname'] = $content['pagetitle']; |
91 | 91 | } else { |
92 | 92 | $content = array(); |
93 | 93 | |
94 | - if(isset($_REQUEST['newtemplate'])) { |
|
94 | + if (isset($_REQUEST['newtemplate'])) { |
|
95 | 95 | $content['template'] = $_REQUEST['newtemplate']; |
96 | 96 | } else { |
97 | 97 | $content['template'] = getDefaultTemplate(); |
@@ -102,22 +102,22 @@ discard block |
||
102 | 102 | |
103 | 103 | // restore saved form |
104 | 104 | $formRestored = $modx->getManagerApi()->loadFormValues(); |
105 | -if(isset($_REQUEST['newtemplate'])) { |
|
105 | +if (isset($_REQUEST['newtemplate'])) { |
|
106 | 106 | $formRestored = true; |
107 | 107 | } |
108 | 108 | |
109 | 109 | // retain form values if template was changed |
110 | 110 | // edited to convert pub_date and unpub_date |
111 | 111 | // sottwell 02-09-2006 |
112 | -if($formRestored == true) { |
|
112 | +if ($formRestored == true) { |
|
113 | 113 | $content = array_merge($content, $_POST); |
114 | 114 | $content['content'] = $_POST['ta']; |
115 | - if(empty ($content['pub_date'])) { |
|
115 | + if (empty ($content['pub_date'])) { |
|
116 | 116 | unset ($content['pub_date']); |
117 | 117 | } else { |
118 | 118 | $content['pub_date'] = $modx->toTimeStamp($content['pub_date']); |
119 | 119 | } |
120 | - if(empty ($content['unpub_date'])) { |
|
120 | + if (empty ($content['unpub_date'])) { |
|
121 | 121 | unset ($content['unpub_date']); |
122 | 122 | } else { |
123 | 123 | $content['unpub_date'] = $modx->toTimeStamp($content['unpub_date']); |
@@ -125,12 +125,12 @@ discard block |
||
125 | 125 | } |
126 | 126 | |
127 | 127 | // increase menu index if this is a new document |
128 | -if(!isset ($_REQUEST['id'])) { |
|
129 | - if(!isset ($modx->config['auto_menuindex'])) { |
|
128 | +if (!isset ($_REQUEST['id'])) { |
|
129 | + if (!isset ($modx->config['auto_menuindex'])) { |
|
130 | 130 | $modx->config['auto_menuindex'] = 1; |
131 | 131 | } |
132 | - if($modx->config['auto_menuindex']) { |
|
133 | - $pid = (int)$_REQUEST['pid']; |
|
132 | + if ($modx->config['auto_menuindex']) { |
|
133 | + $pid = (int) $_REQUEST['pid']; |
|
134 | 134 | $rs = $modx->getDatabase()->select('count(*)', $tbl_site_content, "parent='{$pid}'"); |
135 | 135 | $content['menuindex'] = $modx->getDatabase()->getValue($rs); |
136 | 136 | } else { |
@@ -138,14 +138,14 @@ discard block |
||
138 | 138 | } |
139 | 139 | } |
140 | 140 | |
141 | -if(isset ($_POST['which_editor'])) { |
|
141 | +if (isset ($_POST['which_editor'])) { |
|
142 | 142 | $modx->config['which_editor'] = $_POST['which_editor']; |
143 | 143 | } |
144 | 144 | |
145 | 145 | // Add lock-element JS-Script |
146 | 146 | $lockElementId = $id; |
147 | 147 | $lockElementType = 7; |
148 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
148 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
149 | 149 | ?> |
150 | 150 | <script type="text/javascript"> |
151 | 151 | /* <![CDATA[ */ |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | }, |
176 | 176 | cancel: function() { |
177 | 177 | documentDirty = false; |
178 | - document.location.href = 'index.php?<?=($id == 0 ? 'a=2' : 'a=3&r=1&id=' . $id . $add_path) ?>'; |
|
178 | + document.location.href = 'index.php?<?=($id == 0 ? 'a=2' : 'a=3&r=1&id='.$id.$add_path) ?>'; |
|
179 | 179 | }, |
180 | 180 | duplicate: function() { |
181 | 181 | if(confirm("<?= $_lang['confirm_resource_duplicate']?>") === true) { |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | } |
184 | 184 | }, |
185 | 185 | view: function() { |
186 | - window.open('<?= ($modx->config['friendly_urls'] == '1') ? $modx->makeUrl($id) : MODX_SITE_URL . 'index.php?id=' . $id ?>', 'previeWin'); |
|
186 | + window.open('<?= ($modx->config['friendly_urls'] == '1') ? $modx->makeUrl($id) : MODX_SITE_URL.'index.php?id='.$id ?>', 'previeWin'); |
|
187 | 187 | } |
188 | 188 | }; |
189 | 189 | |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | 'template' => $content['template'] |
546 | 546 | )); |
547 | 547 | |
548 | - if(is_array($evtOut)) { |
|
548 | + if (is_array($evtOut)) { |
|
549 | 549 | echo implode('', $evtOut); |
550 | 550 | } |
551 | 551 | |
@@ -569,8 +569,8 @@ discard block |
||
569 | 569 | <fieldset id="create_edit"> |
570 | 570 | |
571 | 571 | <h1> |
572 | - <i class="fa fa-pencil-square-o"></i><?php if(isset($_REQUEST['id'])) { |
|
573 | - echo entities(iconv_substr($content['pagetitle'], 0, 50, $modx->getConfig('modx_charset')), $modx->getConfig('modx_charset')) . (iconv_strlen($content['pagetitle'], $modx->getConfig('modx_charset')) > 50 ? '...' : '') . '<small>(' . (int)$_REQUEST['id'] . ')</small>'; |
|
572 | + <i class="fa fa-pencil-square-o"></i><?php if (isset($_REQUEST['id'])) { |
|
573 | + echo entities(iconv_substr($content['pagetitle'], 0, 50, $modx->getConfig('modx_charset')), $modx->getConfig('modx_charset')).(iconv_strlen($content['pagetitle'], $modx->getConfig('modx_charset')) > 50 ? '...' : '').'<small>('.(int) $_REQUEST['id'].')</small>'; |
|
574 | 574 | } else { |
575 | 575 | if ($modx->getManagerApi()->action == '4') { |
576 | 576 | echo $_lang['add_resource']; |
@@ -586,36 +586,36 @@ discard block |
||
586 | 586 | |
587 | 587 | <?php |
588 | 588 | // breadcrumbs |
589 | - if($modx->config['use_breadcrumbs']) { |
|
589 | + if ($modx->config['use_breadcrumbs']) { |
|
590 | 590 | $temp = array(); |
591 | 591 | $title = isset($content['pagetitle']) ? $content['pagetitle'] : $_lang['create_resource_title']; |
592 | 592 | |
593 | - if(isset($_REQUEST['id']) && $content['parent'] != 0) { |
|
593 | + if (isset($_REQUEST['id']) && $content['parent'] != 0) { |
|
594 | 594 | $bID = (int) $_REQUEST['id']; |
595 | 595 | $temp = $modx->getParentIds($bID); |
596 | - } else if(isset($_REQUEST['pid'])) { |
|
596 | + } else if (isset($_REQUEST['pid'])) { |
|
597 | 597 | $bID = (int) $_REQUEST['pid']; |
598 | 598 | $temp = $modx->getParentIds($bID); |
599 | 599 | array_unshift($temp, $bID); |
600 | 600 | } |
601 | 601 | |
602 | - if($temp) { |
|
602 | + if ($temp) { |
|
603 | 603 | $parents = implode(',', $temp); |
604 | 604 | |
605 | - if(!empty($parents)) { |
|
605 | + if (!empty($parents)) { |
|
606 | 606 | $where = "FIND_IN_SET(id,'{$parents}') DESC"; |
607 | 607 | $rs = $modx->getDatabase()->select('id, pagetitle', $tbl_site_content, "id IN ({$parents})", $where); |
608 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
608 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
609 | 609 | $out .= '<li class="breadcrumbs__li"> |
610 | - <a href="index.php?a=27&id=' . $row['id'] . '" class="breadcrumbs__a">' . htmlspecialchars($row['pagetitle'], ENT_QUOTES, $modx->getConfig('modx_charset')) . '</a> |
|
610 | + <a href="index.php?a=27&id=' . $row['id'].'" class="breadcrumbs__a">'.htmlspecialchars($row['pagetitle'], ENT_QUOTES, $modx->getConfig('modx_charset')).'</a> |
|
611 | 611 | <span class="breadcrumbs__sep">></span> |
612 | 612 | </li>'; |
613 | 613 | } |
614 | 614 | } |
615 | 615 | } |
616 | 616 | |
617 | - $out .= '<li class="breadcrumbs__li breadcrumbs__li_current">' . $title . '</li>'; |
|
618 | - echo '<ul class="breadcrumbs">' . $out . '</ul>'; |
|
617 | + $out .= '<li class="breadcrumbs__li breadcrumbs__li_current">'.$title.'</li>'; |
|
618 | + echo '<ul class="breadcrumbs">'.$out.'</ul>'; |
|
619 | 619 | } |
620 | 620 | ?> |
621 | 621 | |
@@ -632,19 +632,19 @@ discard block |
||
632 | 632 | $evtOut = $modx->invokeEvent('OnDocFormTemplateRender', array( |
633 | 633 | 'id' => $id |
634 | 634 | )); |
635 | - if(is_array($evtOut)) { |
|
635 | + if (is_array($evtOut)) { |
|
636 | 636 | echo implode('', $evtOut); |
637 | 637 | } else { |
638 | 638 | ?> |
639 | 639 | <div class="tab-page" id="tabGeneral"> |
640 | - <h2 class="tab"><?=ManagerTheme::getLexicon('settings_general');?></h2> |
|
640 | + <h2 class="tab"><?=ManagerTheme::getLexicon('settings_general'); ?></h2> |
|
641 | 641 | <script type="text/javascript">tpSettings.addTabPage(document.getElementById("tabGeneral"));</script> |
642 | 642 | |
643 | 643 | <table> |
644 | 644 | <tr> |
645 | 645 | <td> |
646 | - <span class="warning"><?=ManagerTheme::getLexicon('resource_title');?></span> |
|
647 | - <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_title_help');?>"></i> |
|
646 | + <span class="warning"><?=ManagerTheme::getLexicon('resource_title'); ?></span> |
|
647 | + <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_title_help'); ?>"></i> |
|
648 | 648 | </td> |
649 | 649 | <td> |
650 | 650 | <input name="pagetitle" type="text" maxlength="255" value="<?= $modx->getPhpCompat()->htmlspecialchars(stripslashes($content['pagetitle'])) ?>" class="inputBox" onchange="documentDirty=true;" spellcheck="true" /> |
@@ -653,8 +653,8 @@ discard block |
||
653 | 653 | </tr> |
654 | 654 | <tr> |
655 | 655 | <td> |
656 | - <span class="warning"><?=ManagerTheme::getLexicon('long_title');?></span> |
|
657 | - <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_long_title_help');?>"></i> |
|
656 | + <span class="warning"><?=ManagerTheme::getLexicon('long_title'); ?></span> |
|
657 | + <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_long_title_help'); ?>"></i> |
|
658 | 658 | </td> |
659 | 659 | <td> |
660 | 660 | <input name="longtitle" type="text" maxlength="255" value="<?= $modx->getPhpCompat()->htmlspecialchars(stripslashes($content['longtitle'])) ?>" class="inputBox" onchange="documentDirty=true;" spellcheck="true" /> |
@@ -662,8 +662,8 @@ discard block |
||
662 | 662 | </tr> |
663 | 663 | <tr> |
664 | 664 | <td> |
665 | - <span class="warning"><?=ManagerTheme::getLexicon('resource_description');?></span> |
|
666 | - <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_description_help');?>"></i> |
|
665 | + <span class="warning"><?=ManagerTheme::getLexicon('resource_description'); ?></span> |
|
666 | + <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_description_help'); ?>"></i> |
|
667 | 667 | </td> |
668 | 668 | <td> |
669 | 669 | <input name="description" type="text" maxlength="255" value="<?= $modx->getPhpCompat()->htmlspecialchars(stripslashes($content['description'])) ?>" class="inputBox" onchange="documentDirty=true;" spellcheck="true" /> |
@@ -671,8 +671,8 @@ discard block |
||
671 | 671 | </tr> |
672 | 672 | <tr> |
673 | 673 | <td> |
674 | - <span class="warning"><?=ManagerTheme::getLexicon('resource_alias');?></span> |
|
675 | - <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_alias_help');?>"></i> |
|
674 | + <span class="warning"><?=ManagerTheme::getLexicon('resource_alias'); ?></span> |
|
675 | + <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_alias_help'); ?>"></i> |
|
676 | 676 | </td> |
677 | 677 | <td> |
678 | 678 | <input name="alias" type="text" maxlength="100" value="<?= stripslashes($content['alias']) ?>" class="inputBox" onchange="documentDirty=true;" /> |
@@ -680,23 +680,23 @@ discard block |
||
680 | 680 | </tr> |
681 | 681 | <tr> |
682 | 682 | <td> |
683 | - <span class="warning"><?=ManagerTheme::getLexicon('link_attributes');?></span> |
|
684 | - <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('link_attributes_help');?>"></i> |
|
683 | + <span class="warning"><?=ManagerTheme::getLexicon('link_attributes'); ?></span> |
|
684 | + <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('link_attributes_help'); ?>"></i> |
|
685 | 685 | </td> |
686 | 686 | <td> |
687 | 687 | <input name="link_attributes" type="text" maxlength="255" value="<?= $modx->getPhpCompat()->htmlspecialchars(stripslashes($content['link_attributes'])) ?>" class="inputBox" onchange="documentDirty=true;" /> |
688 | 688 | </td> |
689 | 689 | </tr> |
690 | 690 | |
691 | - <?php if($content['type'] == 'reference' || $modx->getManagerApi()->action == '72') { // Web Link specific ?> |
|
691 | + <?php if ($content['type'] == 'reference' || $modx->getManagerApi()->action == '72') { // Web Link specific ?> |
|
692 | 692 | |
693 | 693 | <tr> |
694 | - <td><span class="warning"><?=ManagerTheme::getLexicon('weblink');?></span> |
|
695 | - <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_weblink_help');?>"></i> |
|
694 | + <td><span class="warning"><?=ManagerTheme::getLexicon('weblink'); ?></span> |
|
695 | + <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_weblink_help'); ?>"></i> |
|
696 | 696 | </td> |
697 | 697 | <td> |
698 | 698 | <i id="llock" class="<?= $_style["actions_chain"] ?>" onclick="enableLinkSelection(!allowLinkSelection);"></i> |
699 | - <input name="ta" id="ta" type="text" maxlength="255" value="<?= (!empty($content['content']) ? entities(stripslashes($content['content']), $modx->getConfig('modx_charset')) : 'http://') ?>" class="inputBox" onchange="documentDirty=true;" /><input type="button" value="<?=ManagerTheme::getLexicon('insert');?>" onclick="BrowseFileServer('ta')" /> |
|
699 | + <input name="ta" id="ta" type="text" maxlength="255" value="<?= (!empty($content['content']) ? entities(stripslashes($content['content']), $modx->getConfig('modx_charset')) : 'http://') ?>" class="inputBox" onchange="documentDirty=true;" /><input type="button" value="<?=ManagerTheme::getLexicon('insert'); ?>" onclick="BrowseFileServer('ta')" /> |
|
700 | 700 | </td> |
701 | 701 | </tr> |
702 | 702 | |
@@ -704,8 +704,8 @@ discard block |
||
704 | 704 | |
705 | 705 | <tr> |
706 | 706 | <td valign="top"> |
707 | - <span class="warning"><?=ManagerTheme::getLexicon('resource_summary');?></span> |
|
708 | - <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_summary_help');?>" spellcheck="true"></i> |
|
707 | + <span class="warning"><?=ManagerTheme::getLexicon('resource_summary'); ?></span> |
|
708 | + <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_summary_help'); ?>" spellcheck="true"></i> |
|
709 | 709 | </td> |
710 | 710 | <td valign="top"> |
711 | 711 | <textarea id="introtext" name="introtext" class="inputBox" rows="3" cols="" onchange="documentDirty=true;"><?= $modx->getPhpCompat()->htmlspecialchars(stripslashes($content['introtext'])) ?></textarea> |
@@ -713,8 +713,8 @@ discard block |
||
713 | 713 | </tr> |
714 | 714 | <tr> |
715 | 715 | <td> |
716 | - <span class="warning"><?=ManagerTheme::getLexicon('page_data_template');?></span> |
|
717 | - <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('page_data_template_help');?>"></i> |
|
716 | + <span class="warning"><?=ManagerTheme::getLexicon('page_data_template'); ?></span> |
|
717 | + <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('page_data_template_help'); ?>"></i> |
|
718 | 718 | </td> |
719 | 719 | <td> |
720 | 720 | <select id="template" name="template" class="inputBox" onchange="templateWarning();"> |
@@ -724,17 +724,17 @@ discard block |
||
724 | 724 | $from = "{$tbl_site_templates} AS t LEFT JOIN {$tbl_categories} AS c ON t.category = c.id"; |
725 | 725 | $rs = $modx->getDatabase()->select($field, $from, '', 'c.category, t.templatename ASC'); |
726 | 726 | $currentCategory = ''; |
727 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
728 | - if($row['selectable'] != 1 && $row['id'] != $content['template']) { |
|
727 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
728 | + if ($row['selectable'] != 1 && $row['id'] != $content['template']) { |
|
729 | 729 | continue; |
730 | 730 | }; |
731 | 731 | // Skip if not selectable but show if selected! |
732 | 732 | $thisCategory = $row['category']; |
733 | - if($thisCategory == null) { |
|
733 | + if ($thisCategory == null) { |
|
734 | 734 | $thisCategory = $_lang["no_category"]; |
735 | 735 | } |
736 | - if($thisCategory != $currentCategory) { |
|
737 | - if($closeOptGroup) { |
|
736 | + if ($thisCategory != $currentCategory) { |
|
737 | + if ($closeOptGroup) { |
|
738 | 738 | echo "\t\t\t\t\t</optgroup>\n"; |
739 | 739 | } |
740 | 740 | echo "\t\t\t\t\t<optgroup label=\"$thisCategory\">\n"; |
@@ -743,10 +743,10 @@ discard block |
||
743 | 743 | |
744 | 744 | $selectedtext = ($row['id'] == $content['template']) ? ' selected="selected"' : ''; |
745 | 745 | |
746 | - echo "\t\t\t\t\t" . '<option value="' . $row['id'] . '"' . $selectedtext . '>' . $row['templatename'] . "</option>\n"; |
|
746 | + echo "\t\t\t\t\t".'<option value="'.$row['id'].'"'.$selectedtext.'>'.$row['templatename']."</option>\n"; |
|
747 | 747 | $currentCategory = $thisCategory; |
748 | 748 | } |
749 | - if($thisCategory != '') { |
|
749 | + if ($thisCategory != '') { |
|
750 | 750 | echo "\t\t\t\t\t</optgroup>\n"; |
751 | 751 | } |
752 | 752 | ?> |
@@ -755,8 +755,8 @@ discard block |
||
755 | 755 | </tr> |
756 | 756 | <tr> |
757 | 757 | <td> |
758 | - <span class="warning"><?=ManagerTheme::getLexicon('resource_opt_menu_title');?></span> |
|
759 | - <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_opt_menu_title_help');?>"></i> |
|
758 | + <span class="warning"><?=ManagerTheme::getLexicon('resource_opt_menu_title'); ?></span> |
|
759 | + <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_opt_menu_title_help'); ?>"></i> |
|
760 | 760 | </td> |
761 | 761 | <td> |
762 | 762 | <input name="menutitle" type="text" maxlength="255" value="<?= $modx->getPhpCompat()->htmlspecialchars(stripslashes($content['menutitle'])) ?>" class="inputBox" onchange="documentDirty=true;" /> |
@@ -764,8 +764,8 @@ discard block |
||
764 | 764 | </tr> |
765 | 765 | <tr> |
766 | 766 | <td> |
767 | - <span class="warning"><?=ManagerTheme::getLexicon('resource_opt_menu_index');?></span> |
|
768 | - <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_opt_menu_index_help');?>"></i> |
|
767 | + <span class="warning"><?=ManagerTheme::getLexicon('resource_opt_menu_index'); ?></span> |
|
768 | + <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_opt_menu_index_help'); ?>"></i> |
|
769 | 769 | </td> |
770 | 770 | <td> |
771 | 771 | <input name="menuindex" type="text" maxlength="6" value="<?= $content['menuindex'] ?>" class="inputBox" onchange="documentDirty=true;" /> |
@@ -775,8 +775,8 @@ discard block |
||
775 | 775 | </tr> |
776 | 776 | <tr> |
777 | 777 | <td> |
778 | - <span class="warning"><?=ManagerTheme::getLexicon('resource_opt_show_menu');?></span> |
|
779 | - <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_opt_show_menu_help');?>"></i> |
|
778 | + <span class="warning"><?=ManagerTheme::getLexicon('resource_opt_show_menu'); ?></span> |
|
779 | + <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_opt_show_menu_help'); ?>"></i> |
|
780 | 780 | </td> |
781 | 781 | <td> |
782 | 782 | <input name="hidemenucheck" type="checkbox" class="checkbox" <?= ($content['hidemenu'] != 1 ? 'checked="checked"' : '') ?> onclick="changestate(document.mutate.hidemenu);" /><input type="hidden" name="hidemenu" class="hidden" value="<?= ($content['hidemenu'] == 1 ? 1 : 0) ?>" /> |
@@ -784,26 +784,26 @@ discard block |
||
784 | 784 | </tr> |
785 | 785 | <tr> |
786 | 786 | <td valign="top"> |
787 | - <span class="warning"><?=ManagerTheme::getLexicon('resource_parent');?></span> |
|
788 | - <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_parent_help');?>"></i> |
|
787 | + <span class="warning"><?=ManagerTheme::getLexicon('resource_parent'); ?></span> |
|
788 | + <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_parent_help'); ?>"></i> |
|
789 | 789 | </td> |
790 | 790 | <td valign="top"> |
791 | 791 | <?php |
792 | 792 | $parentlookup = false; |
793 | - if(isset ($_REQUEST['id'])) { |
|
794 | - if($content['parent'] == 0) { |
|
793 | + if (isset ($_REQUEST['id'])) { |
|
794 | + if ($content['parent'] == 0) { |
|
795 | 795 | $parentname = $modx->getConfig('site_name'); |
796 | 796 | } else { |
797 | 797 | $parentlookup = $content['parent']; |
798 | 798 | } |
799 | - } elseif(isset ($_REQUEST['pid'])) { |
|
800 | - if($_REQUEST['pid'] == 0) { |
|
799 | + } elseif (isset ($_REQUEST['pid'])) { |
|
800 | + if ($_REQUEST['pid'] == 0) { |
|
801 | 801 | $parentname = $modx->getConfig('site_name'); |
802 | 802 | } else { |
803 | 803 | $parentlookup = $_REQUEST['pid']; |
804 | 804 | } |
805 | - } elseif(isset($_POST['parent'])) { |
|
806 | - if($_POST['parent'] == 0) { |
|
805 | + } elseif (isset($_POST['parent'])) { |
|
806 | + if ($_POST['parent'] == 0) { |
|
807 | 807 | $parentname = $modx->getConfig('site_name'); |
808 | 808 | } else { |
809 | 809 | $parentlookup = $_POST['parent']; |
@@ -812,10 +812,10 @@ discard block |
||
812 | 812 | $parentname = $modx->getConfig('site_name'); |
813 | 813 | $content['parent'] = 0; |
814 | 814 | } |
815 | - if($parentlookup !== false && is_numeric($parentlookup)) { |
|
815 | + if ($parentlookup !== false && is_numeric($parentlookup)) { |
|
816 | 816 | $rs = $modx->getDatabase()->select('pagetitle', $tbl_site_content, "id='{$parentlookup}'"); |
817 | 817 | $parentname = $modx->getDatabase()->getValue($rs); |
818 | - if(!$parentname) { |
|
818 | + if (!$parentname) { |
|
819 | 819 | $modx->webAlertAndQuit($_lang["error_no_parent"]); |
820 | 820 | } |
821 | 821 | } |
@@ -857,21 +857,21 @@ discard block |
||
857 | 857 | }*/ |
858 | 858 | ?> |
859 | 859 | |
860 | - <?php if($content['type'] == 'document' || $modx->getManagerApi()->action == '4') { ?> |
|
860 | + <?php if ($content['type'] == 'document' || $modx->getManagerApi()->action == '4') { ?> |
|
861 | 861 | <tr> |
862 | 862 | <td colspan="2"> |
863 | 863 | <hr> |
864 | 864 | <!-- Content --> |
865 | 865 | <div class="clearfix"> |
866 | - <span id="content_header"><?=ManagerTheme::getLexicon('resource_content');?></span> |
|
867 | - <label class="float-xs-right"><?=ManagerTheme::getLexicon('which_editor_title');?> |
|
866 | + <span id="content_header"><?=ManagerTheme::getLexicon('resource_content'); ?></span> |
|
867 | + <label class="float-xs-right"><?=ManagerTheme::getLexicon('which_editor_title'); ?> |
|
868 | 868 | <select id="which_editor" class="form-control form-control-sm" size="1" name="which_editor" onchange="changeRTE();"> |
869 | - <option value="none"><?=ManagerTheme::getLexicon('none');?></option> |
|
869 | + <option value="none"><?=ManagerTheme::getLexicon('none'); ?></option> |
|
870 | 870 | <?php |
871 | 871 | // invoke OnRichTextEditorRegister event |
872 | 872 | $evtOut = $modx->invokeEvent("OnRichTextEditorRegister"); |
873 | - if(is_array($evtOut)) { |
|
874 | - for($i = 0; $i < count($evtOut); $i++) { |
|
873 | + if (is_array($evtOut)) { |
|
874 | + for ($i = 0; $i < count($evtOut); $i++) { |
|
875 | 875 | $editor = $evtOut[$i]; |
876 | 876 | echo "\t\t\t", '<option value="', $editor, '"', ($modx->config['which_editor'] == $editor ? ' selected="selected"' : ''), '>', $editor, "</option>\n"; |
877 | 877 | } |
@@ -882,7 +882,7 @@ discard block |
||
882 | 882 | </div> |
883 | 883 | <div id="content_body"> |
884 | 884 | <?php |
885 | - if(($content['richtext'] == 1 || $modx->getManagerApi()->action == '4') && $use_editor == 1) { |
|
885 | + if (($content['richtext'] == 1 || $modx->getManagerApi()->action == '4') && $use_editor == 1) { |
|
886 | 886 | $htmlContent = $content['content']; |
887 | 887 | ?> |
888 | 888 | <div class="section-editor clearfix"> |
@@ -895,7 +895,7 @@ discard block |
||
895 | 895 | $richtexteditorIds[$modx->config['which_editor']][] = 'ta'; |
896 | 896 | $richtexteditorOptions[$modx->config['which_editor']]['ta'] = ''; |
897 | 897 | } else { |
898 | - echo "\t" . '<div><textarea class="phptextarea" id="ta" name="ta" rows="20" wrap="soft" onchange="documentDirty=true;">', $modx->getPhpCompat()->htmlspecialchars($content['content']), '</textarea></div>' . "\n"; |
|
898 | + echo "\t".'<div><textarea class="phptextarea" id="ta" name="ta" rows="20" wrap="soft" onchange="documentDirty=true;">', $modx->getPhpCompat()->htmlspecialchars($content['content']), '</textarea></div>'."\n"; |
|
899 | 899 | } |
900 | 900 | ?> |
901 | 901 | </div> |
@@ -912,7 +912,7 @@ discard block |
||
912 | 912 | |
913 | 913 | if (($content['type'] == 'document' || $modx->getManagerApi()->action == '4') || ($content['type'] == 'reference' || $modx->getManagerApi()->action == 72)) { |
914 | 914 | $template = $default_template; |
915 | - $group_tvs = empty($modx->config['group_tvs']) ? 0 : (int)$modx->config['group_tvs']; |
|
915 | + $group_tvs = empty($modx->config['group_tvs']) ? 0 : (int) $modx->config['group_tvs']; |
|
916 | 916 | if (isset ($_REQUEST['newtemplate'])) { |
917 | 917 | $template = $_REQUEST['newtemplate']; |
918 | 918 | } else { |
@@ -940,10 +940,10 @@ discard block |
||
940 | 940 | ); |
941 | 941 | $sort = 'tvtpl.rank,tv.rank, tv.id'; |
942 | 942 | if ($group_tvs) { |
943 | - $field .= ', IFNULL(cat.id,0) AS category_id, IFNULL(cat.category,"' . $_lang['no_category'] . '") AS category, IFNULL(cat.rank,0) AS category_rank'; |
|
943 | + $field .= ', IFNULL(cat.id,0) AS category_id, IFNULL(cat.category,"'.$_lang['no_category'].'") AS category, IFNULL(cat.rank,0) AS category_rank'; |
|
944 | 944 | $from .= ' |
945 | - LEFT JOIN ' . $tbl_categories . ' AS cat ON cat.id=tv.category'; |
|
946 | - $sort = 'category_rank,category_id,' . $sort; |
|
945 | + LEFT JOIN ' . $tbl_categories.' AS cat ON cat.id=tv.category'; |
|
946 | + $sort = 'category_rank,category_id,'.$sort; |
|
947 | 947 | } |
948 | 948 | $where = vsprintf("tvtpl.templateid='%s' AND (1='%s' OR ISNULL(tva.documentgroup) %s)", $vs); |
949 | 949 | $rs = $modx->getDatabase()->select($field, $from, $where, $sort); |
@@ -961,8 +961,8 @@ discard block |
||
961 | 961 | if ($group_tvs == 1 || $group_tvs == 3) { |
962 | 962 | if ($i === 0) { |
963 | 963 | $templateVariablesOutput .= ' |
964 | - <div class="tab-section" id="tabTV_' . $row['category_id'] . '"> |
|
965 | - <div class="tab-header">' . $row['category'] . '</div> |
|
964 | + <div class="tab-section" id="tabTV_' . $row['category_id'].'"> |
|
965 | + <div class="tab-header">' . $row['category'].'</div> |
|
966 | 966 | <div class="tab-body tmplvars"> |
967 | 967 | <table>' . "\n"; |
968 | 968 | } else { |
@@ -971,17 +971,17 @@ discard block |
||
971 | 971 | </div> |
972 | 972 | </div> |
973 | 973 | |
974 | - <div class="tab-section" id="tabTV_' . $row['category_id'] . '"> |
|
975 | - <div class="tab-header">' . $row['category'] . '</div> |
|
974 | + <div class="tab-section" id="tabTV_' . $row['category_id'].'"> |
|
975 | + <div class="tab-header">' . $row['category'].'</div> |
|
976 | 976 | <div class="tab-body tmplvars"> |
977 | 977 | <table>'; |
978 | 978 | } |
979 | 979 | } else if ($group_tvs == 2 || $group_tvs == 4) { |
980 | 980 | if ($i === 0) { |
981 | 981 | $templateVariablesOutput .= ' |
982 | - <div id="tabTV_' . $row['category_id'] . '" class="tab-page tmplvars"> |
|
983 | - <h2 class="tab">' . $row['category'] . '</h2> |
|
984 | - <script type="text/javascript">tpTemplateVariables.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'] . '\'));</script> |
|
982 | + <div id="tabTV_' . $row['category_id'].'" class="tab-page tmplvars"> |
|
983 | + <h2 class="tab">' . $row['category'].'</h2> |
|
984 | + <script type="text/javascript">tpTemplateVariables.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'].'\'));</script> |
|
985 | 985 | |
986 | 986 | <div class="tab-body tmplvars"> |
987 | 987 | <table>'; |
@@ -991,9 +991,9 @@ discard block |
||
991 | 991 | </div> |
992 | 992 | </div> |
993 | 993 | |
994 | - <div id="tabTV_' . $row['category_id'] . '" class="tab-page tmplvars"> |
|
995 | - <h2 class="tab">' . $row['category'] . '</h2> |
|
996 | - <script type="text/javascript">tpTemplateVariables.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'] . '\'));</script> |
|
994 | + <div id="tabTV_' . $row['category_id'].'" class="tab-page tmplvars"> |
|
995 | + <h2 class="tab">' . $row['category'].'</h2> |
|
996 | + <script type="text/javascript">tpTemplateVariables.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'].'\'));</script> |
|
997 | 997 | |
998 | 998 | <div class="tab-body tmplvars"> |
999 | 999 | <table>'; |
@@ -1001,18 +1001,18 @@ discard block |
||
1001 | 1001 | } else if ($group_tvs == 5) { |
1002 | 1002 | if ($i === 0) { |
1003 | 1003 | $templateVariablesOutput .= ' |
1004 | - <div id="tabTV_' . $row['category_id'] . '" class="tab-page tmplvars"> |
|
1005 | - <h2 class="tab">' . $row['category'] . '</h2> |
|
1006 | - <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'] . '\'));</script> |
|
1004 | + <div id="tabTV_' . $row['category_id'].'" class="tab-page tmplvars"> |
|
1005 | + <h2 class="tab">' . $row['category'].'</h2> |
|
1006 | + <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'].'\'));</script> |
|
1007 | 1007 | <table>'; |
1008 | 1008 | } else { |
1009 | 1009 | $templateVariablesOutput .= ' |
1010 | 1010 | </table> |
1011 | 1011 | </div> |
1012 | 1012 | |
1013 | - <div id="tabTV_' . $row['category_id'] . '" class="tab-page tmplvars"> |
|
1014 | - <h2 class="tab">' . $row['category'] . '</h2> |
|
1015 | - <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'] . '\'));</script> |
|
1013 | + <div id="tabTV_' . $row['category_id'].'" class="tab-page tmplvars"> |
|
1014 | + <h2 class="tab">' . $row['category'].'</h2> |
|
1015 | + <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'].'\'));</script> |
|
1016 | 1016 | |
1017 | 1017 | <table>'; |
1018 | 1018 | } |
@@ -1032,8 +1032,8 @@ discard block |
||
1032 | 1032 | $editor = isset($tvOptions['editor']) ? $tvOptions['editor'] : $modx->config['which_editor']; |
1033 | 1033 | }; |
1034 | 1034 | // Add richtext editor to the list |
1035 | - $richtexteditorIds[$editor][] = "tv" . $row['id']; |
|
1036 | - $richtexteditorOptions[$editor]["tv" . $row['id']] = $tvOptions; |
|
1035 | + $richtexteditorIds[$editor][] = "tv".$row['id']; |
|
1036 | + $richtexteditorOptions[$editor]["tv".$row['id']] = $tvOptions; |
|
1037 | 1037 | } |
1038 | 1038 | |
1039 | 1039 | $templateVariablesTmp = ''; |
@@ -1050,24 +1050,24 @@ discard block |
||
1050 | 1050 | } |
1051 | 1051 | |
1052 | 1052 | // post back value |
1053 | - if (array_key_exists('tv' . $row['id'], $_POST)) { |
|
1054 | - if (is_array($_POST['tv' . $row['id']])) { |
|
1055 | - $tvPBV = implode('||', $_POST['tv' . $row['id']]); |
|
1053 | + if (array_key_exists('tv'.$row['id'], $_POST)) { |
|
1054 | + if (is_array($_POST['tv'.$row['id']])) { |
|
1055 | + $tvPBV = implode('||', $_POST['tv'.$row['id']]); |
|
1056 | 1056 | } else { |
1057 | - $tvPBV = $_POST['tv' . $row['id']]; |
|
1057 | + $tvPBV = $_POST['tv'.$row['id']]; |
|
1058 | 1058 | } |
1059 | 1059 | } else { |
1060 | 1060 | $tvPBV = $row['value']; |
1061 | 1061 | } |
1062 | 1062 | |
1063 | - $tvDescription = (!empty($row['description'])) ? '<br /><span class="comment">' . $row['description'] . '</span>' : ''; |
|
1064 | - $tvInherited = (substr($tvPBV, 0, 8) == '@INHERIT') ? '<br /><span class="comment inherited">(' . $_lang['tmplvars_inherited'] . ')</span>' : ''; |
|
1065 | - $tvName = $modx->hasPermission('edit_template') ? '<br/><small class="protectedNode">[*' . $row['name'] . '*]</small>' : ''; |
|
1063 | + $tvDescription = (!empty($row['description'])) ? '<br /><span class="comment">'.$row['description'].'</span>' : ''; |
|
1064 | + $tvInherited = (substr($tvPBV, 0, 8) == '@INHERIT') ? '<br /><span class="comment inherited">('.$_lang['tmplvars_inherited'].')</span>' : ''; |
|
1065 | + $tvName = $modx->hasPermission('edit_template') ? '<br/><small class="protectedNode">[*'.$row['name'].'*]</small>' : ''; |
|
1066 | 1066 | |
1067 | 1067 | $templateVariablesTmp .= ' |
1068 | 1068 | <tr> |
1069 | - <td><span class="warning">' . $row['caption'] . $tvName . '</span>' . $tvDescription . $tvInherited . '</td> |
|
1070 | - <td><div style="position:relative;' . ($row['type'] == 'date' ? '' : '') . '">' . renderFormElement($row['type'], $row['id'], $row['default_text'], $row['elements'], $tvPBV, '', $row, $tvsArray) . '</div></td> |
|
1069 | + <td><span class="warning">' . $row['caption'].$tvName.'</span>'.$tvDescription.$tvInherited.'</td> |
|
1070 | + <td><div style="position:relative;' . ($row['type'] == 'date' ? '' : '').'">'.renderFormElement($row['type'], $row['id'], $row['default_text'], $row['elements'], $tvPBV, '', $row, $tvsArray).'</div></td> |
|
1071 | 1071 | </tr>'; |
1072 | 1072 | |
1073 | 1073 | if ($group_tvs && $row['category_id'] == 0) { |
@@ -1081,37 +1081,37 @@ discard block |
||
1081 | 1081 | } |
1082 | 1082 | |
1083 | 1083 | if ($templateVariablesGeneral) { |
1084 | - echo '<table id="tabTV_0" class="tmplvars"><tbody>' . $templateVariablesGeneral . '</tbody></table>'; |
|
1084 | + echo '<table id="tabTV_0" class="tmplvars"><tbody>'.$templateVariablesGeneral.'</tbody></table>'; |
|
1085 | 1085 | } |
1086 | 1086 | |
1087 | 1087 | $templateVariables .= ' |
1088 | 1088 | <!-- Template Variables -->' . "\n"; |
1089 | 1089 | if (!$group_tvs) { |
1090 | 1090 | $templateVariables .= ' |
1091 | - <div class="sectionHeader" id="tv_header">' . $_lang['settings_templvars'] . '</div> |
|
1091 | + <div class="sectionHeader" id="tv_header">' . $_lang['settings_templvars'].'</div> |
|
1092 | 1092 | <div class="sectionBody tmplvars"> |
1093 | 1093 | <table>'; |
1094 | 1094 | } else if ($group_tvs == 2) { |
1095 | 1095 | $templateVariables .= ' |
1096 | 1096 | <div class="tab-section"> |
1097 | - <div class="tab-header" id="tv_header">' . $_lang['settings_templvars'] . '</div> |
|
1097 | + <div class="tab-header" id="tv_header">' . $_lang['settings_templvars'].'</div> |
|
1098 | 1098 | <div class="tab-pane" id="paneTemplateVariables"> |
1099 | 1099 | <script type="text/javascript"> |
1100 | - tpTemplateVariables = new WebFXTabPane(document.getElementById(\'paneTemplateVariables\'), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false') . '); |
|
1100 | + tpTemplateVariables = new WebFXTabPane(document.getElementById(\'paneTemplateVariables\'), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false').'); |
|
1101 | 1101 | </script>'; |
1102 | 1102 | } else if ($group_tvs == 3) { |
1103 | 1103 | $templateVariables .= ' |
1104 | 1104 | <div id="templateVariables" class="tab-page tmplvars"> |
1105 | - <h2 class="tab">' . $_lang['settings_templvars'] . '</h2> |
|
1105 | + <h2 class="tab">' . $_lang['settings_templvars'].'</h2> |
|
1106 | 1106 | <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'templateVariables\'));</script>'; |
1107 | 1107 | } else if ($group_tvs == 4) { |
1108 | 1108 | $templateVariables .= ' |
1109 | 1109 | <div id="templateVariables" class="tab-page tmplvars"> |
1110 | - <h2 class="tab">' . $_lang['settings_templvars'] . '</h2> |
|
1110 | + <h2 class="tab">' . $_lang['settings_templvars'].'</h2> |
|
1111 | 1111 | <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'templateVariables\'));</script> |
1112 | 1112 | <div class="tab-pane" id="paneTemplateVariables"> |
1113 | 1113 | <script type="text/javascript"> |
1114 | - tpTemplateVariables = new WebFXTabPane(document.getElementById(\'paneTemplateVariables\'), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false') . '); |
|
1114 | + tpTemplateVariables = new WebFXTabPane(document.getElementById(\'paneTemplateVariables\'), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false').'); |
|
1115 | 1115 | </script>'; |
1116 | 1116 | } |
1117 | 1117 | if ($templateVariablesOutput) { |
@@ -1149,15 +1149,15 @@ discard block |
||
1149 | 1149 | |
1150 | 1150 | <!-- Settings --> |
1151 | 1151 | <div class="tab-page" id="tabSettings"> |
1152 | - <h2 class="tab"><?=ManagerTheme::getLexicon('settings_page_settings');?></h2> |
|
1152 | + <h2 class="tab"><?=ManagerTheme::getLexicon('settings_page_settings'); ?></h2> |
|
1153 | 1153 | <script type="text/javascript">tpSettings.addTabPage(document.getElementById("tabSettings"));</script> |
1154 | 1154 | |
1155 | 1155 | <table> |
1156 | 1156 | <?php $mx_can_pub = $modx->hasPermission('publish_document') ? '' : 'disabled="disabled" ' ?> |
1157 | 1157 | <tr> |
1158 | 1158 | <td> |
1159 | - <span class="warning"><?=ManagerTheme::getLexicon('resource_opt_published');?></span> |
|
1160 | - <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_opt_published_help');?>"></i> |
|
1159 | + <span class="warning"><?=ManagerTheme::getLexicon('resource_opt_published'); ?></span> |
|
1160 | + <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_opt_published_help'); ?>"></i> |
|
1161 | 1161 | </td> |
1162 | 1162 | <td> |
1163 | 1163 | <input <?= $mx_can_pub ?>name="publishedcheck" type="checkbox" class="checkbox" <?= (isset($content['published']) && $content['published'] == 1) || (!isset($content['published']) && $publish_default == 1) ? "checked" : '' ?> onclick="changestate(document.mutate.published);" /> |
@@ -1166,13 +1166,13 @@ discard block |
||
1166 | 1166 | </tr> |
1167 | 1167 | <tr> |
1168 | 1168 | <td> |
1169 | - <span class="warning"><?=ManagerTheme::getLexicon('page_data_publishdate');?></span> |
|
1170 | - <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('page_data_publishdate_help');?>"></i> |
|
1169 | + <span class="warning"><?=ManagerTheme::getLexicon('page_data_publishdate'); ?></span> |
|
1170 | + <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('page_data_publishdate_help'); ?>"></i> |
|
1171 | 1171 | </td> |
1172 | 1172 | <td> |
1173 | 1173 | <input type="text" id="pub_date" <?= $mx_can_pub ?>name="pub_date" class="DatePicker" value="<?= ($content['pub_date'] == "0" || !isset($content['pub_date']) ? '' : $modx->toDateFormat($content['pub_date'])) ?>" onblur="documentDirty=true;" /> |
1174 | - <a href="javascript:" onclick="document.mutate.pub_date.value=''; return true;" onmouseover="window.status='<?=ManagerTheme::getLexicon('remove_date');?>'; return true;" onmouseout="window.status=''; return true;"> |
|
1175 | - <i class="<?= $_style["actions_calendar_delete"] ?>" title="<?=ManagerTheme::getLexicon('remove_date');?>"></i></a> |
|
1174 | + <a href="javascript:" onclick="document.mutate.pub_date.value=''; return true;" onmouseover="window.status='<?=ManagerTheme::getLexicon('remove_date'); ?>'; return true;" onmouseout="window.status=''; return true;"> |
|
1175 | + <i class="<?= $_style["actions_calendar_delete"] ?>" title="<?=ManagerTheme::getLexicon('remove_date'); ?>"></i></a> |
|
1176 | 1176 | </td> |
1177 | 1177 | </tr> |
1178 | 1178 | <tr> |
@@ -1182,13 +1182,13 @@ discard block |
||
1182 | 1182 | </tr> |
1183 | 1183 | <tr> |
1184 | 1184 | <td> |
1185 | - <span class="warning"><?=ManagerTheme::getLexicon('page_data_unpublishdate');?></span> |
|
1186 | - <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('page_data_unpublishdate_help');?>"></i> |
|
1185 | + <span class="warning"><?=ManagerTheme::getLexicon('page_data_unpublishdate'); ?></span> |
|
1186 | + <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('page_data_unpublishdate_help'); ?>"></i> |
|
1187 | 1187 | </td> |
1188 | 1188 | <td> |
1189 | 1189 | <input type="text" id="unpub_date" <?= $mx_can_pub ?>name="unpub_date" class="DatePicker" value="<?= ($content['unpub_date'] == "0" || !isset($content['unpub_date']) ? '' : $modx->toDateFormat($content['unpub_date'])) ?>" onblur="documentDirty=true;" /> |
1190 | - <a href="javascript:" onclick="document.mutate.unpub_date.value=''; return true;" onmouseover="window.status='<?=ManagerTheme::getLexicon('remove_date');?>'; return true;" onmouseout="window.status=''; return true;"> |
|
1191 | - <i class="<?= $_style["actions_calendar_delete"] ?>" title="<?=ManagerTheme::getLexicon('remove_date');?>"></i></a> |
|
1190 | + <a href="javascript:" onclick="document.mutate.unpub_date.value=''; return true;" onmouseover="window.status='<?=ManagerTheme::getLexicon('remove_date'); ?>'; return true;" onmouseout="window.status=''; return true;"> |
|
1191 | + <i class="<?= $_style["actions_calendar_delete"] ?>" title="<?=ManagerTheme::getLexicon('remove_date'); ?>"></i></a> |
|
1192 | 1192 | </td> |
1193 | 1193 | </tr> |
1194 | 1194 | <tr> |
@@ -1205,36 +1205,36 @@ discard block |
||
1205 | 1205 | |
1206 | 1206 | <?php |
1207 | 1207 | |
1208 | - if($_SESSION['mgrRole'] == 1 || $modx->getManagerApi()->action != '27' || $_SESSION['mgrInternalKey'] == $content['createdby'] || $modx->hasPermission('change_resourcetype')) { |
|
1208 | + if ($_SESSION['mgrRole'] == 1 || $modx->getManagerApi()->action != '27' || $_SESSION['mgrInternalKey'] == $content['createdby'] || $modx->hasPermission('change_resourcetype')) { |
|
1209 | 1209 | ?> |
1210 | 1210 | <tr> |
1211 | 1211 | <td> |
1212 | - <span class="warning"><?=ManagerTheme::getLexicon('resource_type');?></span> |
|
1213 | - <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_type_message');?>"></i> |
|
1212 | + <span class="warning"><?=ManagerTheme::getLexicon('resource_type'); ?></span> |
|
1213 | + <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_type_message'); ?>"></i> |
|
1214 | 1214 | </td> |
1215 | 1215 | <td> |
1216 | 1216 | <select name="type" class="inputBox" onchange="documentDirty=true;"> |
1217 | - <option value="document"<?= (($content['type'] == "document" || $modx->getManagerApi()->action == '85' || $modx->getManagerApi()->action == '4') ? ' selected="selected"' : "") ?> ><?=ManagerTheme::getLexicon('resource_type_webpage');?></option> |
|
1218 | - <option value="reference"<?= (($content['type'] == "reference" || $modx->getManagerApi()->action == '72') ? ' selected="selected"' : "") ?> ><?=ManagerTheme::getLexicon('resource_type_weblink');?></option> |
|
1217 | + <option value="document"<?= (($content['type'] == "document" || $modx->getManagerApi()->action == '85' || $modx->getManagerApi()->action == '4') ? ' selected="selected"' : "") ?> ><?=ManagerTheme::getLexicon('resource_type_webpage'); ?></option> |
|
1218 | + <option value="reference"<?= (($content['type'] == "reference" || $modx->getManagerApi()->action == '72') ? ' selected="selected"' : "") ?> ><?=ManagerTheme::getLexicon('resource_type_weblink'); ?></option> |
|
1219 | 1219 | </select> |
1220 | 1220 | </td> |
1221 | 1221 | </tr> |
1222 | 1222 | |
1223 | 1223 | <tr> |
1224 | 1224 | <td> |
1225 | - <span class="warning"><?=ManagerTheme::getLexicon('page_data_contentType');?></span> |
|
1226 | - <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('page_data_contentType_help');?>"></i> |
|
1225 | + <span class="warning"><?=ManagerTheme::getLexicon('page_data_contentType'); ?></span> |
|
1226 | + <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('page_data_contentType_help'); ?>"></i> |
|
1227 | 1227 | </td> |
1228 | 1228 | <td> |
1229 | 1229 | <select name="contentType" class="inputBox" onchange="documentDirty=true;"> |
1230 | 1230 | <?php |
1231 | - if(!$content['contentType']) { |
|
1231 | + if (!$content['contentType']) { |
|
1232 | 1232 | $content['contentType'] = 'text/html'; |
1233 | 1233 | } |
1234 | 1234 | $custom_contenttype = (isset ($custom_contenttype) ? $custom_contenttype : "text/html,text/plain,text/xml"); |
1235 | 1235 | $ct = explode(",", $custom_contenttype); |
1236 | - for($i = 0; $i < count($ct); $i++) { |
|
1237 | - echo "\t\t\t\t\t" . '<option value="' . $ct[$i] . '"' . ($content['contentType'] == $ct[$i] ? ' selected="selected"' : '') . '>' . $ct[$i] . "</option>\n"; |
|
1236 | + for ($i = 0; $i < count($ct); $i++) { |
|
1237 | + echo "\t\t\t\t\t".'<option value="'.$ct[$i].'"'.($content['contentType'] == $ct[$i] ? ' selected="selected"' : '').'>'.$ct[$i]."</option>\n"; |
|
1238 | 1238 | } |
1239 | 1239 | ?> |
1240 | 1240 | </select> |
@@ -1242,13 +1242,13 @@ discard block |
||
1242 | 1242 | </tr> |
1243 | 1243 | <tr> |
1244 | 1244 | <td> |
1245 | - <span class="warning"><?=ManagerTheme::getLexicon('resource_opt_contentdispo');?></span> |
|
1246 | - <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_opt_contentdispo_help');?>"></i> |
|
1245 | + <span class="warning"><?=ManagerTheme::getLexicon('resource_opt_contentdispo'); ?></span> |
|
1246 | + <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_opt_contentdispo_help'); ?>"></i> |
|
1247 | 1247 | </td> |
1248 | 1248 | <td> |
1249 | 1249 | <select name="content_dispo" class="inputBox" size="1" onchange="documentDirty=true;"> |
1250 | - <option value="0"<?= (!$content['content_dispo'] ? ' selected="selected"' : '') ?>><?=ManagerTheme::getLexicon('inline');?></option> |
|
1251 | - <option value="1"<?= ($content['content_dispo'] == 1 ? ' selected="selected"' : '') ?>><?=ManagerTheme::getLexicon('attachment');?></option> |
|
1250 | + <option value="0"<?= (!$content['content_dispo'] ? ' selected="selected"' : '') ?>><?=ManagerTheme::getLexicon('inline'); ?></option> |
|
1251 | + <option value="1"<?= ($content['content_dispo'] == 1 ? ' selected="selected"' : '') ?>><?=ManagerTheme::getLexicon('attachment'); ?></option> |
|
1252 | 1252 | </select> |
1253 | 1253 | </td> |
1254 | 1254 | </tr> |
@@ -1260,7 +1260,7 @@ discard block |
||
1260 | 1260 | </tr> |
1261 | 1261 | <?php |
1262 | 1262 | } else { |
1263 | - if($content['type'] != 'reference' && $modx->getManagerApi()->action != '72') { |
|
1263 | + if ($content['type'] != 'reference' && $modx->getManagerApi()->action != '72') { |
|
1264 | 1264 | // non-admin managers creating or editing a document resource |
1265 | 1265 | ?> |
1266 | 1266 | <input type="hidden" name="contentType" value="<?= (isset($content['contentType']) ? $content['contentType'] : "text/html") ?>" /> |
@@ -1279,8 +1279,8 @@ discard block |
||
1279 | 1279 | |
1280 | 1280 | <tr> |
1281 | 1281 | <td> |
1282 | - <span class="warning"><?=ManagerTheme::getLexicon('resource_opt_folder');?></span> |
|
1283 | - <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_opt_folder_help');?>"></i> |
|
1282 | + <span class="warning"><?=ManagerTheme::getLexicon('resource_opt_folder'); ?></span> |
|
1283 | + <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_opt_folder_help'); ?>"></i> |
|
1284 | 1284 | </td> |
1285 | 1285 | <td> |
1286 | 1286 | <input name="isfoldercheck" type="checkbox" class="checkbox" <?= (($content['isfolder'] == 1 || $modx->getManagerApi()->action == '85') ? "checked" : '') ?> onclick="changestate(document.mutate.isfolder);" /> |
@@ -1290,8 +1290,8 @@ discard block |
||
1290 | 1290 | |
1291 | 1291 | <tr> |
1292 | 1292 | <td> |
1293 | - <span class="warning"><?=ManagerTheme::getLexicon('resource_opt_alvisibled');?></span> |
|
1294 | - <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_opt_alvisibled_help');?>"></i> |
|
1293 | + <span class="warning"><?=ManagerTheme::getLexicon('resource_opt_alvisibled'); ?></span> |
|
1294 | + <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_opt_alvisibled_help'); ?>"></i> |
|
1295 | 1295 | </td> |
1296 | 1296 | <td> |
1297 | 1297 | <input name="alias_visible_check" type="checkbox" class="checkbox" <?= ((!isset($content['alias_visible']) || $content['alias_visible'] == 1) ? "checked" : '') ?> onclick="changestate(document.mutate.alias_visible);" /><input type="hidden" name="alias_visible" value="<?= ((!isset($content['alias_visible']) || $content['alias_visible'] == 1) ? 1 : 0) ?>" /> |
@@ -1300,8 +1300,8 @@ discard block |
||
1300 | 1300 | |
1301 | 1301 | <tr> |
1302 | 1302 | <td> |
1303 | - <span class="warning"><?=ManagerTheme::getLexicon('resource_opt_richtext');?></span> |
|
1304 | - <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_opt_richtext_help');?>"></i> |
|
1303 | + <span class="warning"><?=ManagerTheme::getLexicon('resource_opt_richtext'); ?></span> |
|
1304 | + <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_opt_richtext_help'); ?>"></i> |
|
1305 | 1305 | </td> |
1306 | 1306 | <td> |
1307 | 1307 | <input name="richtextcheck" type="checkbox" class="checkbox" <?= ($content['richtext'] == 0 && $modx->getManagerApi()->action == '27' ? '' : "checked") ?> onclick="changestate(document.mutate.richtext);" /> |
@@ -1310,8 +1310,8 @@ discard block |
||
1310 | 1310 | </tr> |
1311 | 1311 | <tr> |
1312 | 1312 | <td> |
1313 | - <span class="warning"><?=ManagerTheme::getLexicon('track_visitors_title');?></span> |
|
1314 | - <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_opt_trackvisit_help');?>"></i> |
|
1313 | + <span class="warning"><?=ManagerTheme::getLexicon('track_visitors_title'); ?></span> |
|
1314 | + <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_opt_trackvisit_help'); ?>"></i> |
|
1315 | 1315 | </td> |
1316 | 1316 | <td> |
1317 | 1317 | <input name="donthitcheck" type="checkbox" class="checkbox" <?= ($content['donthit'] != 1 ? 'checked="checked"' : '') ?> onclick="changestate(document.mutate.donthit);" /><input type="hidden" name="donthit" value="<?= ($content['donthit'] == 1 ? 1 : 0) ?>" onchange="documentDirty=true;" /> |
@@ -1319,8 +1319,8 @@ discard block |
||
1319 | 1319 | </tr> |
1320 | 1320 | <tr> |
1321 | 1321 | <td> |
1322 | - <span class="warning"><?=ManagerTheme::getLexicon('page_data_searchable');?></span> |
|
1323 | - <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('page_data_searchable_help');?>"></i> |
|
1322 | + <span class="warning"><?=ManagerTheme::getLexicon('page_data_searchable'); ?></span> |
|
1323 | + <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('page_data_searchable_help'); ?>"></i> |
|
1324 | 1324 | </td> |
1325 | 1325 | <td> |
1326 | 1326 | <input name="searchablecheck" type="checkbox" class="checkbox" <?= (isset($content['searchable']) && $content['searchable'] == 1) || (!isset($content['searchable']) && $search_default == 1) ? "checked" : '' ?> onclick="changestate(document.mutate.searchable);" /><input type="hidden" name="searchable" value="<?= ((isset($content['searchable']) && $content['searchable'] == 1) || (!isset($content['searchable']) && $search_default == 1) ? 1 : 0) ?>" onchange="documentDirty=true;" /> |
@@ -1328,8 +1328,8 @@ discard block |
||
1328 | 1328 | </tr> |
1329 | 1329 | <tr> |
1330 | 1330 | <td> |
1331 | - <span class="warning"><?=ManagerTheme::getLexicon('page_data_cacheable');?></span> |
|
1332 | - <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('page_data_cacheable_help');?>"></i> |
|
1331 | + <span class="warning"><?=ManagerTheme::getLexicon('page_data_cacheable'); ?></span> |
|
1332 | + <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('page_data_cacheable_help'); ?>"></i> |
|
1333 | 1333 | </td> |
1334 | 1334 | <td> |
1335 | 1335 | <input name="cacheablecheck" type="checkbox" class="checkbox" <?= ((isset($content['cacheable']) && $content['cacheable'] == 1) || (!isset($content['cacheable']) && $cache_default == 1) ? "checked" : '') ?> onclick="changestate(document.mutate.cacheable);" /> |
@@ -1338,9 +1338,9 @@ discard block |
||
1338 | 1338 | </tr> |
1339 | 1339 | <tr> |
1340 | 1340 | <td> |
1341 | - <span class="warning"><?=ManagerTheme::getLexicon('resource_opt_emptycache');?></span> |
|
1341 | + <span class="warning"><?=ManagerTheme::getLexicon('resource_opt_emptycache'); ?></span> |
|
1342 | 1342 | <input type="hidden" name="syncsite" value="1" /> |
1343 | - <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_opt_emptycache_help');?>"></i> |
|
1343 | + <i class="<?= $_style["icons_tooltip"] ?>" data-tooltip="<?=ManagerTheme::getLexicon('resource_opt_emptycache_help'); ?>"></i> |
|
1344 | 1344 | </td> |
1345 | 1345 | <td> |
1346 | 1346 | <input name="syncsitecheck" type="checkbox" class="checkbox" checked="checked" onclick="changestate(document.mutate.syncsite);" /> |
@@ -1360,15 +1360,15 @@ discard block |
||
1360 | 1360 | <?php |
1361 | 1361 | /******************************* |
1362 | 1362 | * Document Access Permissions */ |
1363 | - if($modx->getConfig('use_udperms')) { |
|
1363 | + if ($modx->getConfig('use_udperms')) { |
|
1364 | 1364 | $groupsarray = array(); |
1365 | 1365 | $sql = ''; |
1366 | 1366 | |
1367 | 1367 | $documentId = ($modx->getManagerApi()->action == '27' ? $id : (!empty($_REQUEST['pid']) ? $_REQUEST['pid'] : $content['parent'])); |
1368 | - if($documentId > 0) { |
|
1368 | + if ($documentId > 0) { |
|
1369 | 1369 | // Load up, the permissions from the parent (if new document) or existing document |
1370 | 1370 | $rs = $modx->getDatabase()->select('id, document_group', $tbl_document_groups, "document='{$documentId}'"); |
1371 | - while($currentgroup = $modx->getDatabase()->getRow($rs)) $groupsarray[] = $currentgroup['document_group'] . ',' . $currentgroup['id']; |
|
1371 | + while ($currentgroup = $modx->getDatabase()->getRow($rs)) $groupsarray[] = $currentgroup['document_group'].','.$currentgroup['id']; |
|
1372 | 1372 | |
1373 | 1373 | // Load up the current permissions and names |
1374 | 1374 | $vs = array( |
@@ -1384,7 +1384,7 @@ discard block |
||
1384 | 1384 | } |
1385 | 1385 | |
1386 | 1386 | // retain selected doc groups between post |
1387 | - if(isset($_POST['docgroups'])) { |
|
1387 | + if (isset($_POST['docgroups'])) { |
|
1388 | 1388 | $groupsarray = array_merge($groupsarray, $_POST['docgroups']); |
1389 | 1389 | } |
1390 | 1390 | |
@@ -1403,26 +1403,26 @@ discard block |
||
1403 | 1403 | $permissions_no = 0; // count permissions the current mgr user doesn't have |
1404 | 1404 | |
1405 | 1405 | // Loop through the permissions list |
1406 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
1406 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
1407 | 1407 | |
1408 | 1408 | // Create an inputValue pair (group ID and group link (if it exists)) |
1409 | - $inputValue = $row['id'] . ',' . ($row['link_id'] ? $row['link_id'] : 'new'); |
|
1410 | - $inputId = 'group-' . $row['id']; |
|
1409 | + $inputValue = $row['id'].','.($row['link_id'] ? $row['link_id'] : 'new'); |
|
1410 | + $inputId = 'group-'.$row['id']; |
|
1411 | 1411 | |
1412 | 1412 | $checked = in_array($inputValue, $groupsarray); |
1413 | - if($checked) { |
|
1413 | + if ($checked) { |
|
1414 | 1414 | $notPublic = true; |
1415 | 1415 | } // Mark as private access (either web or manager) |
1416 | 1416 | |
1417 | 1417 | // Skip the access permission if the user doesn't have access... |
1418 | - if((!$isManager && $row['private_memgroup'] == '1') || (!$isWeb && $row['private_webgroup'] == '1')) { |
|
1418 | + if ((!$isManager && $row['private_memgroup'] == '1') || (!$isWeb && $row['private_webgroup'] == '1')) { |
|
1419 | 1419 | continue; |
1420 | 1420 | } |
1421 | 1421 | |
1422 | 1422 | // Setup attributes for this Input box |
1423 | 1423 | $inputAttributes['id'] = $inputId; |
1424 | 1424 | $inputAttributes['value'] = $inputValue; |
1425 | - if($checked) { |
|
1425 | + if ($checked) { |
|
1426 | 1426 | $inputAttributes['checked'] = 'checked'; |
1427 | 1427 | } else { |
1428 | 1428 | unset($inputAttributes['checked']); |
@@ -1430,10 +1430,10 @@ discard block |
||
1430 | 1430 | |
1431 | 1431 | // Create attribute string list |
1432 | 1432 | $inputString = array(); |
1433 | - foreach($inputAttributes as $k => $v) $inputString[] = $k . '="' . $v . '"'; |
|
1433 | + foreach ($inputAttributes as $k => $v) $inputString[] = $k.'="'.$v.'"'; |
|
1434 | 1434 | |
1435 | 1435 | // Make the <input> HTML |
1436 | - $inputHTML = '<input ' . implode(' ', $inputString) . ' />'; |
|
1436 | + $inputHTML = '<input '.implode(' ', $inputString).' />'; |
|
1437 | 1437 | |
1438 | 1438 | // does user have this permission? |
1439 | 1439 | $from = "{$tbl_membergroup_access} AS mga, {$tbl_member_groups} AS mg"; |
@@ -1444,29 +1444,29 @@ discard block |
||
1444 | 1444 | $where = vsprintf("mga.membergroup=mg.user_group AND mga.documentgroup=%s AND mg.member=%s", $vs); |
1445 | 1445 | $rsp = $modx->getDatabase()->select('COUNT(mg.id)', $from, $where); |
1446 | 1446 | $count = $modx->getDatabase()->getValue($rsp); |
1447 | - if($count > 0) { |
|
1447 | + if ($count > 0) { |
|
1448 | 1448 | ++$permissions_yes; |
1449 | 1449 | } else { |
1450 | 1450 | ++$permissions_no; |
1451 | 1451 | } |
1452 | - $permissions[] = "\t\t" . '<li>' . $inputHTML . '<label for="' . $inputId . '">' . $row['name'] . '</label></li>'; |
|
1452 | + $permissions[] = "\t\t".'<li>'.$inputHTML.'<label for="'.$inputId.'">'.$row['name'].'</label></li>'; |
|
1453 | 1453 | } |
1454 | 1454 | // if mgr user doesn't have access to any of the displayable permissions, forget about them and make doc public |
1455 | - if($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0)) { |
|
1455 | + if ($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0)) { |
|
1456 | 1456 | $permissions = array(); |
1457 | 1457 | } |
1458 | 1458 | |
1459 | 1459 | // See if the Access Permissions section is worth displaying... |
1460 | - if(!empty($permissions)) { |
|
1460 | + if (!empty($permissions)) { |
|
1461 | 1461 | // Add the "All Document Groups" item if we have rights in both contexts |
1462 | - if($isManager && $isWeb) { |
|
1463 | - array_unshift($permissions, "\t\t" . '<li><input type="checkbox" class="checkbox" name="chkalldocs" id="groupall"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true);" /><label for="groupall" class="warning">' . $_lang['all_doc_groups'] . '</label></li>'); |
|
1462 | + if ($isManager && $isWeb) { |
|
1463 | + array_unshift($permissions, "\t\t".'<li><input type="checkbox" class="checkbox" name="chkalldocs" id="groupall"'.(!$notPublic ? ' checked="checked"' : '').' onclick="makePublic(true);" /><label for="groupall" class="warning">'.$_lang['all_doc_groups'].'</label></li>'); |
|
1464 | 1464 | } |
1465 | 1465 | // Output the permissions list... |
1466 | 1466 | ?> |
1467 | 1467 | <!-- Access Permissions --> |
1468 | 1468 | <div class="tab-page" id="tabAccess"> |
1469 | - <h2 class="tab" id="tab_access_header"><?=ManagerTheme::getLexicon('access_permissions');?></h2> |
|
1469 | + <h2 class="tab" id="tab_access_header"><?=ManagerTheme::getLexicon('access_permissions'); ?></h2> |
|
1470 | 1470 | <script type="text/javascript">tpSettings.addTabPage(document.getElementById("tabAccess"));</script> |
1471 | 1471 | <script type="text/javascript"> |
1472 | 1472 | /* <![CDATA[ */ |
@@ -1491,16 +1491,16 @@ discard block |
||
1491 | 1491 | |
1492 | 1492 | /* ]]> */ |
1493 | 1493 | </script> |
1494 | - <p><?=ManagerTheme::getLexicon('access_permissions_docs_message');?></p> |
|
1494 | + <p><?=ManagerTheme::getLexicon('access_permissions_docs_message'); ?></p> |
|
1495 | 1495 | <ul> |
1496 | - <?= implode("\n", $permissions) . "\n" ?> |
|
1496 | + <?= implode("\n", $permissions)."\n" ?> |
|
1497 | 1497 | </ul> |
1498 | 1498 | </div><!--div class="tab-page" id="tabAccess"--> |
1499 | 1499 | <?php |
1500 | 1500 | } // !empty($permissions) |
1501 | - elseif($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0) && ($_SESSION['mgrPermissions']['access_permissions'] == 1 || $_SESSION['mgrPermissions']['web_access_permissions'] == 1)) { |
|
1501 | + elseif ($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0) && ($_SESSION['mgrPermissions']['access_permissions'] == 1 || $_SESSION['mgrPermissions']['web_access_permissions'] == 1)) { |
|
1502 | 1502 | ?> |
1503 | - <p><?=ManagerTheme::getLexicon('access_permissions_docs_collision');?></p> |
|
1503 | + <p><?=ManagerTheme::getLexicon('access_permissions_docs_collision'); ?></p> |
|
1504 | 1504 | <?php |
1505 | 1505 | |
1506 | 1506 | } |
@@ -1518,7 +1518,7 @@ discard block |
||
1518 | 1518 | 'template' => $content['template'] |
1519 | 1519 | )); |
1520 | 1520 | |
1521 | - if(is_array($evtOut)) { |
|
1521 | + if (is_array($evtOut)) { |
|
1522 | 1522 | echo implode('', $evtOut); |
1523 | 1523 | } |
1524 | 1524 | ?> |
@@ -1531,16 +1531,16 @@ discard block |
||
1531 | 1531 | storeCurTemplate(); |
1532 | 1532 | </script> |
1533 | 1533 | <?php |
1534 | -if(($content['richtext'] == 1 || $modx->getManagerApi()->action == '4' || $modx->getManagerApi()->action == '72') && $use_editor == 1) { |
|
1535 | - if(is_array($richtexteditorIds)) { |
|
1536 | - foreach($richtexteditorIds as $editor => $elements) { |
|
1534 | +if (($content['richtext'] == 1 || $modx->getManagerApi()->action == '4' || $modx->getManagerApi()->action == '72') && $use_editor == 1) { |
|
1535 | + if (is_array($richtexteditorIds)) { |
|
1536 | + foreach ($richtexteditorIds as $editor => $elements) { |
|
1537 | 1537 | // invoke OnRichTextEditorInit event |
1538 | 1538 | $evtOut = $modx->invokeEvent('OnRichTextEditorInit', array( |
1539 | 1539 | 'editor' => $editor, |
1540 | 1540 | 'elements' => $elements, |
1541 | 1541 | 'options' => $richtexteditorOptions[$editor] |
1542 | 1542 | )); |
1543 | - if(is_array($evtOut)) { |
|
1543 | + if (is_array($evtOut)) { |
|
1544 | 1544 | echo implode('', $evtOut); |
1545 | 1545 | } |
1546 | 1546 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | if (!$modx->hasPermission('messages')) { |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | <div class="container container-body" id="lyr3"> |
17 | 17 | <b><?= $_lang['messages_read_message'] ?></b> |
18 | 18 | <?php |
19 | - $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('user_messages'), "id='" . (int)$_REQUEST['id'] . "'"); |
|
19 | + $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('user_messages'), "id='".(int) $_REQUEST['id']."'"); |
|
20 | 20 | $message = $modx->getDatabase()->getRow($rs); |
21 | 21 | if (!$message) { |
22 | 22 | echo "Wrong number of messages returned!"; |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | <p><b><?= $_lang['messages_inbox'] ?></b></p> |
88 | 88 | <?php |
89 | 89 | // Get number of rows |
90 | - $rs = $modx->getDatabase()->select('count(id)', $modx->getDatabase()->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID() . ""); |
|
90 | + $rs = $modx->getDatabase()->select('count(id)', $modx->getDatabase()->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID().""); |
|
91 | 91 | $num_rows = $modx->getDatabase()->getValue($rs); |
92 | 92 | |
93 | 93 | // ============================================================== |
@@ -100,11 +100,11 @@ discard block |
||
100 | 100 | if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) { |
101 | 101 | $int_cur_position = 0; |
102 | 102 | } else { |
103 | - $int_cur_position = (int)$_REQUEST['int_cur_position']; |
|
103 | + $int_cur_position = (int) $_REQUEST['int_cur_position']; |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | // Number of result to display on the page, will be in the LIMIT of the sql query also |
107 | - $int_num_result = isset($number_of_messages) ? (int)$number_of_messages : 10; |
|
107 | + $int_num_result = isset($number_of_messages) ? (int) $number_of_messages : 10; |
|
108 | 108 | |
109 | 109 | $extargv = "&a=10"; // extra argv here (could be anything depending on your page) |
110 | 110 | |
@@ -116,21 +116,21 @@ discard block |
||
116 | 116 | $array_row_paging = $p->getPagingRowArray(); |
117 | 117 | |
118 | 118 | // Display the result as you like... |
119 | - $pager .= $_lang['showing'] . " " . $array_paging['lower']; |
|
120 | - $pager .= " " . $_lang['to'] . " " . $array_paging['upper']; |
|
121 | - $pager .= " (" . $array_paging['total'] . " " . $_lang['total'] . ")"; |
|
122 | - $pager .= "<br />" . $array_paging['previous_link'] . "<<" . (isset($array_paging['previous_link']) ? "</a> " : " "); |
|
119 | + $pager .= $_lang['showing']." ".$array_paging['lower']; |
|
120 | + $pager .= " ".$_lang['to']." ".$array_paging['upper']; |
|
121 | + $pager .= " (".$array_paging['total']." ".$_lang['total'].")"; |
|
122 | + $pager .= "<br />".$array_paging['previous_link']."<<".(isset($array_paging['previous_link']) ? "</a> " : " "); |
|
123 | 123 | for ($i = 0; $i < sizeof($array_row_paging); $i++) { |
124 | - $pager .= $array_row_paging[$i] . " "; |
|
124 | + $pager .= $array_row_paging[$i]." "; |
|
125 | 125 | } |
126 | - $pager .= $array_paging['next_link'] . ">>" . (isset($array_paging['next_link']) ? "</a>" : ""); |
|
126 | + $pager .= $array_paging['next_link'].">>".(isset($array_paging['next_link']) ? "</a>" : ""); |
|
127 | 127 | |
128 | 128 | // The above exemple print somethings like: |
129 | 129 | // Results 1 to 20 of 597 <<< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 >>> |
130 | 130 | // Of course you can now play with array_row_paging in order to print |
131 | 131 | // only the results you would like... |
132 | 132 | |
133 | - $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID() . "", 'postdate DESC', "{$int_cur_position}, {$int_num_result}"); |
|
133 | + $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID()."", 'postdate DESC', "{$int_cur_position}, {$int_num_result}"); |
|
134 | 134 | $limit = $modx->getDatabase()->getRecordCount($rs); |
135 | 135 | if ($limit < 1) { |
136 | 136 | echo $_lang['messages_no_messages']; |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | <p><b><?= $_lang['messages_compose'] ?></b></p> |
189 | 189 | <?php |
190 | 190 | if (($_REQUEST['m'] == 'rp' || $_REQUEST['m'] == 'f') && isset($_REQUEST['id'])) { |
191 | - $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('user_messages'), "id='" . $_REQUEST['id'] . "'"); |
|
191 | + $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('user_messages'), "id='".$_REQUEST['id']."'"); |
|
192 | 192 | $message = $modx->getDatabase()->getRow($rs); |
193 | 193 | if (!$message) { |
194 | 194 | echo "Wrong number of messages returned!"; |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | } |
208 | 208 | $subjecttext = $_REQUEST['m'] == 'rp' ? "Re: " : "Fwd: "; |
209 | 209 | $subjecttext .= $message['subject']; |
210 | - $messagetext = "\n\n\n-----\n" . $_lang['messages_from'] . ": $sendername\n" . $_lang['messages_sent'] . ": " . $modx->toDateFormat($message['postdate'] + $server_offset_time) . "\n" . $_lang['messages_subject'] . ": " . $message['subject'] . "\n\n" . $message['message']; |
|
210 | + $messagetext = "\n\n\n-----\n".$_lang['messages_from'].": $sendername\n".$_lang['messages_sent'].": ".$modx->toDateFormat($message['postdate'] + $server_offset_time)."\n".$_lang['messages_subject'].": ".$message['subject']."\n\n".$message['message']; |
|
211 | 211 | if ($_REQUEST['m'] == 'rp') { |
212 | 212 | $recipientindex = $message['sender']; |
213 | 213 | } |
@@ -294,9 +294,9 @@ discard block |
||
294 | 294 | |
295 | 295 | <?php |
296 | 296 | // count messages again, as any action on the messages page may have altered the message count |
297 | -$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getDatabase()->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID() . " and messageread=0"); |
|
297 | +$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getDatabase()->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID()." and messageread=0"); |
|
298 | 298 | $_SESSION['nrnewmessages'] = $modx->getDatabase()->getValue($rs); |
299 | -$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getDatabase()->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID() . ""); |
|
299 | +$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getDatabase()->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID().""); |
|
300 | 300 | $_SESSION['nrtotalmessages'] = $modx->getDatabase()->getValue($rs); |
301 | 301 | $messagesallowed = $modx->hasPermission('messages'); |
302 | 302 | ?> |