@@ -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,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('save_document')) { |
@@ -7,13 +7,13 @@ discard block |
||
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | if (isset($_REQUEST['id'])) { |
| 10 | - $id = (int)$_REQUEST['id']; |
|
| 10 | + $id = (int) $_REQUEST['id']; |
|
| 11 | 11 | } else { |
| 12 | 12 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | // check permissions on the document |
| 16 | -include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php"; |
|
| 16 | +include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php"; |
|
| 17 | 17 | $udperms = new udperms(); |
| 18 | 18 | $udperms->user = $modx->getLoginUserID(); |
| 19 | 19 | $udperms->document = $id; |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | }, |
| 40 | 40 | cancel: function() { |
| 41 | 41 | documentDirty = false; |
| 42 | - <?= ($id == 0 ? 'document.location.href="index.php?a=2";' : 'document.location.href="index.php?a=3&id=' . $id . '";') ?> |
|
| 42 | + <?= ($id == 0 ? 'document.location.href="index.php?a=2";' : 'document.location.href="index.php?a=3&id='.$id.'";') ?> |
|
| 43 | 43 | } |
| 44 | 44 | }; |
| 45 | 45 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | </script> |
| 81 | 81 | |
| 82 | 82 | <h1> |
| 83 | - <i class="fa fa-arrows"></i><?= ($pagetitle ? $pagetitle . '<small>(' . $id . ')</small>' : $_lang['move_resource_title']) ?> |
|
| 83 | + <i class="fa fa-arrows"></i><?= ($pagetitle ? $pagetitle.'<small>('.$id.')</small>' : $_lang['move_resource_title']) ?> |
|
| 84 | 84 | </h1> |
| 85 | 85 | |
| 86 | 86 | <?= $_style['actionbuttons']['dynamic']['save'] ?> |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | |
| 12 | 12 | $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
| 13 | 13 | $origin = isset($_REQUEST['or']) ? (int)$_REQUEST['or'] : 76; |
| 14 | -$originId = isset($_REQUEST['oid']) ? (int)$_REQUEST['oid'] : NULL; |
|
| 14 | +$originId = isset($_REQUEST['oid']) ? (int)$_REQUEST['oid'] : null; |
|
| 15 | 15 | |
| 16 | 16 | $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); |
| 17 | 17 | $tbl_site_templates = $modx->getFullTableName('site_templates'); |
@@ -1,12 +1,12 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
| 3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 4 | 4 | } |
| 5 | 5 | if(!$modx->hasPermission('edit_template') && $modx->getManagerApi()->action == '301') { |
| 6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 7 | 7 | } |
| 8 | 8 | if(!$modx->hasPermission('new_template') && $modx->getManagerApi()->action == '300') { |
| 9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | // check to see the snippet editor isn't locked |
| 22 | 22 | if($lockedEl = $modx->elementIsLocked(2, $id)) { |
| 23 | - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar'])); |
|
| 23 | + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar'])); |
|
| 24 | 24 | } |
| 25 | 25 | // end check for lock |
| 26 | 26 | |
@@ -30,25 +30,25 @@ discard block |
||
| 30 | 30 | global $content; |
| 31 | 31 | $content = array(); |
| 32 | 32 | if(isset($_GET['id'])) { |
| 33 | - $rs = $modx->getDatabase()->select('*', $tbl_site_tmplvars, "id='{$id}'"); |
|
| 34 | - $content = $modx->getDatabase()->getRow($rs); |
|
| 35 | - if(!$content) { |
|
| 36 | - header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}"); |
|
| 37 | - } |
|
| 38 | - |
|
| 39 | - $_SESSION['itemname'] = $content['caption']; |
|
| 40 | - if($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) { |
|
| 41 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 42 | - } |
|
| 33 | + $rs = $modx->getDatabase()->select('*', $tbl_site_tmplvars, "id='{$id}'"); |
|
| 34 | + $content = $modx->getDatabase()->getRow($rs); |
|
| 35 | + if(!$content) { |
|
| 36 | + header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}"); |
|
| 37 | + } |
|
| 38 | + |
|
| 39 | + $_SESSION['itemname'] = $content['caption']; |
|
| 40 | + if($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) { |
|
| 41 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 42 | + } |
|
| 43 | 43 | } else if(isset($_REQUEST['itemname'])) { |
| 44 | - $content['name'] = $_REQUEST['itemname']; |
|
| 44 | + $content['name'] = $_REQUEST['itemname']; |
|
| 45 | 45 | } else { |
| 46 | - $_SESSION['itemname'] = $_lang["new_tmplvars"]; |
|
| 47 | - $content['category'] = (int)$_REQUEST['catid']; |
|
| 46 | + $_SESSION['itemname'] = $_lang["new_tmplvars"]; |
|
| 47 | + $content['category'] = (int)$_REQUEST['catid']; |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | if($modx->getManagerApi()->hasFormValues()) { |
| 51 | - $modx->getManagerApi()->loadFormValues(); |
|
| 51 | + $modx->getManagerApi()->loadFormValues(); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | $content = array_merge($content, $_POST); |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $RTEditors = ''; |
| 63 | 63 | $evtOut = $modx->invokeEvent('OnRichTextEditorRegister', array('forfrontend' => 1)); |
| 64 | 64 | if(is_array($evtOut)) { |
| 65 | - $RTEditors = implode(',', $evtOut); |
|
| 65 | + $RTEditors = implode(',', $evtOut); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | ?> |
@@ -277,12 +277,12 @@ discard block |
||
| 277 | 277 | |
| 278 | 278 | <form name="mutate" method="post" action="index.php" enctype="multipart/form-data"> |
| 279 | 279 | <?php |
| 280 | - // invoke OnTVFormPrerender event |
|
| 281 | - $evtOut = $modx->invokeEvent('OnTVFormPrerender', array('id' => $id)); |
|
| 282 | - if(is_array($evtOut)) { |
|
| 283 | - echo implode("", $evtOut); |
|
| 284 | - } |
|
| 285 | - ?> |
|
| 280 | + // invoke OnTVFormPrerender event |
|
| 281 | + $evtOut = $modx->invokeEvent('OnTVFormPrerender', array('id' => $id)); |
|
| 282 | + if(is_array($evtOut)) { |
|
| 283 | + echo implode("", $evtOut); |
|
| 284 | + } |
|
| 285 | + ?> |
|
| 286 | 286 | <input type="hidden" name="id" value="<?= $content['id'] ?>"> |
| 287 | 287 | <input type="hidden" name="a" value="302"> |
| 288 | 288 | <input type="hidden" name="or" value="<?= $origin ?>"> |
@@ -343,11 +343,11 @@ discard block |
||
| 343 | 343 | <select name="categoryid" class="form-control" onChange="documentDirty=true;"> |
| 344 | 344 | <option> </option> |
| 345 | 345 | <?php |
| 346 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
| 347 | - foreach(getCategories() as $n => $v) { |
|
| 348 | - echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->getPhpCompat()->htmlspecialchars($v["category"]) . "</option>"; |
|
| 349 | - } |
|
| 350 | - ?> |
|
| 346 | + include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
| 347 | + foreach(getCategories() as $n => $v) { |
|
| 348 | + echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->getPhpCompat()->htmlspecialchars($v["category"]) . "</option>"; |
|
| 349 | + } |
|
| 350 | + ?> |
|
| 351 | 351 | </select> |
| 352 | 352 | </div> |
| 353 | 353 | </div> |
@@ -383,14 +383,14 @@ discard block |
||
| 383 | 383 | <optgroup label="Custom Type"> |
| 384 | 384 | <option value="custom_tv" <?= ($content['type'] == 'custom_tv' ? "selected='selected'" : "") ?>>Custom Input</option> |
| 385 | 385 | <?php |
| 386 | - $custom_tvs = scandir(MODX_BASE_PATH . 'assets/tvs'); |
|
| 387 | - foreach($custom_tvs as $ctv) { |
|
| 388 | - if(strpos($ctv, '.') !== 0 && $ctv != 'index.html') { |
|
| 389 | - $selected = ($content['type'] == 'custom_tv:' . $ctv ? "selected='selected'" : ""); |
|
| 390 | - echo '<option value="custom_tv:' . $ctv . '" ' . $selected . '>' . $ctv . '</option>'; |
|
| 391 | - } |
|
| 392 | - } |
|
| 393 | - ?> |
|
| 386 | + $custom_tvs = scandir(MODX_BASE_PATH . 'assets/tvs'); |
|
| 387 | + foreach($custom_tvs as $ctv) { |
|
| 388 | + if(strpos($ctv, '.') !== 0 && $ctv != 'index.html') { |
|
| 389 | + $selected = ($content['type'] == 'custom_tv:' . $ctv ? "selected='selected'" : ""); |
|
| 390 | + echo '<option value="custom_tv:' . $ctv . '" ' . $selected . '>' . $ctv . '</option>'; |
|
| 391 | + } |
|
| 392 | + } |
|
| 393 | + ?> |
|
| 394 | 394 | </optgroup> |
| 395 | 395 | </select> |
| 396 | 396 | </div> |
@@ -455,63 +455,63 @@ discard block |
||
| 455 | 455 | <a class="btn btn-secondary btn-sm" href="javascript:;" onClick="check_toggle(); return false;"><?= $_lang['check_toggle'] ?></a> |
| 456 | 456 | </div> |
| 457 | 457 | <?php |
| 458 | - $rs = $modx->getDatabase()->select(sprintf("tpl.id AS id, templatename, tpl.description AS tpldescription, tpl.locked AS tpllocked, tpl.selectable AS selectable, tmplvarid, if(isnull(cat.category),'%s',cat.category) AS category, cat.id AS catid", $_lang['no_category']), sprintf("%s as tpl |
|
| 458 | + $rs = $modx->getDatabase()->select(sprintf("tpl.id AS id, templatename, tpl.description AS tpldescription, tpl.locked AS tpllocked, tpl.selectable AS selectable, tmplvarid, if(isnull(cat.category),'%s',cat.category) AS category, cat.id AS catid", $_lang['no_category']), sprintf("%s as tpl |
|
| 459 | 459 | LEFT JOIN %s as stt ON stt.templateid=tpl.id AND stt.tmplvarid='%s' |
| 460 | 460 | LEFT JOIN %s as cat ON tpl.category=cat.id", $modx->getFullTableName('site_templates'), $modx->getFullTableName('site_tmplvar_templates'), $id, $modx->getFullTableName('categories')), '', "category, templatename"); |
| 461 | 461 | |
| 462 | - $tplList = '<ul>'; |
|
| 463 | - $preCat = ''; |
|
| 464 | - $insideUl = 0; |
|
| 465 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
| 466 | - $row['category'] = stripslashes($row['category']); //pixelchutes |
|
| 467 | - if($preCat !== $row['category']) { |
|
| 468 | - $tplList .= $insideUl ? '</ul>' : ''; |
|
| 469 | - $tplList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>'; |
|
| 470 | - $insideUl = 1; |
|
| 471 | - } |
|
| 472 | - |
|
| 473 | - if($modx->getManagerApi()->action == '300' && $modx->config['default_template'] == $row['id']) { |
|
| 474 | - $checked = true; |
|
| 475 | - } elseif(isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) { |
|
| 476 | - $checked = true; |
|
| 477 | - } elseif($id == 0 && is_array($_POST['template'])) { |
|
| 478 | - $checked = in_array($row['id'], $_POST['template']); |
|
| 479 | - } else { |
|
| 480 | - $checked = $row['tmplvarid']; |
|
| 481 | - } |
|
| 482 | - $selectable = !$row['selectable'] ? ' class="disabled"' : ''; |
|
| 483 | - $checked = $checked ? ' checked="checked"' : ''; |
|
| 484 | - $tplId = ' <small>(' . $row['id'] . ')</small>'; |
|
| 485 | - $desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : ''; |
|
| 486 | - |
|
| 487 | - $tplInfo = array(); |
|
| 488 | - if($row['tpllocked']) { |
|
| 489 | - $tplInfo[] = $_lang['locked']; |
|
| 490 | - } |
|
| 491 | - if($row['id'] == $modx->config['default_template']) { |
|
| 492 | - $tplInfo[] = $_lang['defaulttemplate_title']; |
|
| 493 | - } |
|
| 494 | - $tplInfo = !empty($tplInfo) ? ' <em>(' . implode(', ', $tplInfo) . ')</em>' : ''; |
|
| 495 | - |
|
| 496 | - $tplList .= sprintf('<li><label%s><input name="template[]" value="%s" type="checkbox" %s onchange="documentDirty=true;"> %s%s%s%s</label></li>', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo); |
|
| 497 | - $tplList .= '</li>'; |
|
| 498 | - |
|
| 499 | - $preCat = $row['category']; |
|
| 500 | - } |
|
| 501 | - $tplList .= $insideUl ? '</ul>' : ''; |
|
| 502 | - $tplList .= '</ul>'; |
|
| 503 | - echo $tplList; |
|
| 504 | - |
|
| 505 | - ?> |
|
| 462 | + $tplList = '<ul>'; |
|
| 463 | + $preCat = ''; |
|
| 464 | + $insideUl = 0; |
|
| 465 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
| 466 | + $row['category'] = stripslashes($row['category']); //pixelchutes |
|
| 467 | + if($preCat !== $row['category']) { |
|
| 468 | + $tplList .= $insideUl ? '</ul>' : ''; |
|
| 469 | + $tplList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>'; |
|
| 470 | + $insideUl = 1; |
|
| 471 | + } |
|
| 472 | + |
|
| 473 | + if($modx->getManagerApi()->action == '300' && $modx->config['default_template'] == $row['id']) { |
|
| 474 | + $checked = true; |
|
| 475 | + } elseif(isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) { |
|
| 476 | + $checked = true; |
|
| 477 | + } elseif($id == 0 && is_array($_POST['template'])) { |
|
| 478 | + $checked = in_array($row['id'], $_POST['template']); |
|
| 479 | + } else { |
|
| 480 | + $checked = $row['tmplvarid']; |
|
| 481 | + } |
|
| 482 | + $selectable = !$row['selectable'] ? ' class="disabled"' : ''; |
|
| 483 | + $checked = $checked ? ' checked="checked"' : ''; |
|
| 484 | + $tplId = ' <small>(' . $row['id'] . ')</small>'; |
|
| 485 | + $desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : ''; |
|
| 486 | + |
|
| 487 | + $tplInfo = array(); |
|
| 488 | + if($row['tpllocked']) { |
|
| 489 | + $tplInfo[] = $_lang['locked']; |
|
| 490 | + } |
|
| 491 | + if($row['id'] == $modx->config['default_template']) { |
|
| 492 | + $tplInfo[] = $_lang['defaulttemplate_title']; |
|
| 493 | + } |
|
| 494 | + $tplInfo = !empty($tplInfo) ? ' <em>(' . implode(', ', $tplInfo) . ')</em>' : ''; |
|
| 495 | + |
|
| 496 | + $tplList .= sprintf('<li><label%s><input name="template[]" value="%s" type="checkbox" %s onchange="documentDirty=true;"> %s%s%s%s</label></li>', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo); |
|
| 497 | + $tplList .= '</li>'; |
|
| 498 | + |
|
| 499 | + $preCat = $row['category']; |
|
| 500 | + } |
|
| 501 | + $tplList .= $insideUl ? '</ul>' : ''; |
|
| 502 | + $tplList .= '</ul>'; |
|
| 503 | + echo $tplList; |
|
| 504 | + |
|
| 505 | + ?> |
|
| 506 | 506 | |
| 507 | 507 | <!-- Access Permissions --> |
| 508 | 508 | <?php |
| 509 | - if($use_udperms == 1) { |
|
| 510 | - // fetch permissions for the variable |
|
| 511 | - $rs = $modx->getDatabase()->select('documentgroup', $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); |
|
| 512 | - $groupsarray = $modx->getDatabase()->getColumn('documentgroup', $rs); |
|
| 509 | + if($use_udperms == 1) { |
|
| 510 | + // fetch permissions for the variable |
|
| 511 | + $rs = $modx->getDatabase()->select('documentgroup', $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); |
|
| 512 | + $groupsarray = $modx->getDatabase()->getColumn('documentgroup', $rs); |
|
| 513 | 513 | |
| 514 | - ?> |
|
| 514 | + ?> |
|
| 515 | 515 | <?php if($modx->hasPermission('access_permissions')) { ?> |
| 516 | 516 | <script type="text/javascript"> |
| 517 | 517 | function makePublic(b) { |
@@ -539,29 +539,29 @@ discard block |
||
| 539 | 539 | <!--<b><?php /*echo $_lang['access_permissions']; */ ?></b>--> |
| 540 | 540 | <p><?= $_lang['tmplvar_access_msg'] ?></p> |
| 541 | 541 | <?php |
| 542 | - $chk = ''; |
|
| 543 | - $rs = $modx->getDatabase()->select('name, id', $tbl_documentgroup_names); |
|
| 544 | - if(empty($groupsarray) && is_array($_POST['docgroups']) && empty($_POST['id'])) { |
|
| 545 | - $groupsarray = $_POST['docgroups']; |
|
| 546 | - } |
|
| 547 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
| 548 | - $checked = in_array($row['id'], $groupsarray); |
|
| 549 | - if($modx->hasPermission('access_permissions')) { |
|
| 550 | - if($checked) { |
|
| 551 | - $notPublic = true; |
|
| 552 | - } |
|
| 553 | - $chks .= "<li><label><input type='checkbox' name='docgroups[]' value='" . $row['id'] . "' " . ($checked ? "checked='checked'" : '') . " onclick=\"makePublic(false)\" /> " . $row['name'] . "</label></li>"; |
|
| 554 | - } else { |
|
| 555 | - if($checked) { |
|
| 556 | - echo "<input type='hidden' name='docgroups[]' value='" . $row['id'] . "' />"; |
|
| 557 | - } |
|
| 558 | - } |
|
| 559 | - } |
|
| 560 | - if($modx->hasPermission('access_permissions')) { |
|
| 561 | - $chks = "<li><label><input type='checkbox' name='chkalldocs' " . (!$notPublic ? "checked='checked'" : '') . " onclick=\"makePublic(true)\" /> <span class='warning'>" . $_lang['all_doc_groups'] . "</span></label></li>" . $chks; |
|
| 562 | - } |
|
| 563 | - echo '<ul>' . $chks . '</ul>'; |
|
| 564 | - ?> |
|
| 542 | + $chk = ''; |
|
| 543 | + $rs = $modx->getDatabase()->select('name, id', $tbl_documentgroup_names); |
|
| 544 | + if(empty($groupsarray) && is_array($_POST['docgroups']) && empty($_POST['id'])) { |
|
| 545 | + $groupsarray = $_POST['docgroups']; |
|
| 546 | + } |
|
| 547 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
| 548 | + $checked = in_array($row['id'], $groupsarray); |
|
| 549 | + if($modx->hasPermission('access_permissions')) { |
|
| 550 | + if($checked) { |
|
| 551 | + $notPublic = true; |
|
| 552 | + } |
|
| 553 | + $chks .= "<li><label><input type='checkbox' name='docgroups[]' value='" . $row['id'] . "' " . ($checked ? "checked='checked'" : '') . " onclick=\"makePublic(false)\" /> " . $row['name'] . "</label></li>"; |
|
| 554 | + } else { |
|
| 555 | + if($checked) { |
|
| 556 | + echo "<input type='hidden' name='docgroups[]' value='" . $row['id'] . "' />"; |
|
| 557 | + } |
|
| 558 | + } |
|
| 559 | + } |
|
| 560 | + if($modx->hasPermission('access_permissions')) { |
|
| 561 | + $chks = "<li><label><input type='checkbox' name='chkalldocs' " . (!$notPublic ? "checked='checked'" : '') . " onclick=\"makePublic(true)\" /> <span class='warning'>" . $_lang['all_doc_groups'] . "</span></label></li>" . $chks; |
|
| 562 | + } |
|
| 563 | + echo '<ul>' . $chks . '</ul>'; |
|
| 564 | + ?> |
|
| 565 | 565 | <?php } ?> |
| 566 | 566 | <?php } ?> |
| 567 | 567 | |
@@ -571,12 +571,12 @@ discard block |
||
| 571 | 571 | <input type="submit" name="save" style="display:none"> |
| 572 | 572 | |
| 573 | 573 | <?php |
| 574 | - // invoke OnTVFormRender event |
|
| 575 | - $evtOut = $modx->invokeEvent('OnTVFormRender', array('id' => $id)); |
|
| 576 | - if(is_array($evtOut)) { |
|
| 577 | - echo implode('', $evtOut); |
|
| 578 | - } |
|
| 579 | - ?> |
|
| 574 | + // invoke OnTVFormRender event |
|
| 575 | + $evtOut = $modx->invokeEvent('OnTVFormRender', array('id' => $id)); |
|
| 576 | + if(is_array($evtOut)) { |
|
| 577 | + echo implode('', $evtOut); |
|
| 578 | + } |
|
| 579 | + ?> |
|
| 580 | 580 | </div> |
| 581 | 581 | </form> |
| 582 | 582 | <script type="text/javascript">setTimeout('showParameters()', 10);</script> |
@@ -1,17 +1,17 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | -if(!$modx->hasPermission('edit_template') && $modx->getManagerApi()->action == '301') { |
|
| 5 | +if (!$modx->hasPermission('edit_template') && $modx->getManagerApi()->action == '301') { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | -if(!$modx->hasPermission('new_template') && $modx->getManagerApi()->action == '300') { |
|
| 8 | +if (!$modx->hasPermission('new_template') && $modx->getManagerApi()->action == '300') { |
|
| 9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 10 | 10 | } |
| 11 | 11 | |
| 12 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
| 13 | -$origin = isset($_REQUEST['or']) ? (int)$_REQUEST['or'] : 76; |
|
| 14 | -$originId = isset($_REQUEST['oid']) ? (int)$_REQUEST['oid'] : NULL; |
|
| 12 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
| 13 | +$origin = isset($_REQUEST['or']) ? (int) $_REQUEST['or'] : 76; |
|
| 14 | +$originId = isset($_REQUEST['oid']) ? (int) $_REQUEST['oid'] : NULL; |
|
| 15 | 15 | |
| 16 | 16 | $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); |
| 17 | 17 | $tbl_site_templates = $modx->getFullTableName('site_templates'); |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | $tbl_documentgroup_names = $modx->getFullTableName('documentgroup_names'); |
| 20 | 20 | |
| 21 | 21 | // check to see the snippet editor isn't locked |
| 22 | -if($lockedEl = $modx->elementIsLocked(2, $id)) { |
|
| 22 | +if ($lockedEl = $modx->elementIsLocked(2, $id)) { |
|
| 23 | 23 | $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar'])); |
| 24 | 24 | } |
| 25 | 25 | // end check for lock |
@@ -29,25 +29,25 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | global $content; |
| 31 | 31 | $content = array(); |
| 32 | -if(isset($_GET['id'])) { |
|
| 32 | +if (isset($_GET['id'])) { |
|
| 33 | 33 | $rs = $modx->getDatabase()->select('*', $tbl_site_tmplvars, "id='{$id}'"); |
| 34 | 34 | $content = $modx->getDatabase()->getRow($rs); |
| 35 | - if(!$content) { |
|
| 36 | - header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}"); |
|
| 35 | + if (!$content) { |
|
| 36 | + header("Location: ".MODX_SITE_URL."index.php?id={$site_start}"); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | $_SESSION['itemname'] = $content['caption']; |
| 40 | - if($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) { |
|
| 40 | + if ($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) { |
|
| 41 | 41 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 42 | 42 | } |
| 43 | -} else if(isset($_REQUEST['itemname'])) { |
|
| 43 | +} else if (isset($_REQUEST['itemname'])) { |
|
| 44 | 44 | $content['name'] = $_REQUEST['itemname']; |
| 45 | 45 | } else { |
| 46 | 46 | $_SESSION['itemname'] = $_lang["new_tmplvars"]; |
| 47 | - $content['category'] = (int)$_REQUEST['catid']; |
|
| 47 | + $content['category'] = (int) $_REQUEST['catid']; |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | -if($modx->getManagerApi()->hasFormValues()) { |
|
| 50 | +if ($modx->getManagerApi()->hasFormValues()) { |
|
| 51 | 51 | $modx->getManagerApi()->loadFormValues(); |
| 52 | 52 | } |
| 53 | 53 | |
@@ -56,12 +56,12 @@ discard block |
||
| 56 | 56 | // Add lock-element JS-Script |
| 57 | 57 | $lockElementId = $id; |
| 58 | 58 | $lockElementType = 2; |
| 59 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
| 59 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
| 60 | 60 | |
| 61 | 61 | // get available RichText Editors |
| 62 | 62 | $RTEditors = ''; |
| 63 | 63 | $evtOut = $modx->invokeEvent('OnRichTextEditorRegister', array('forfrontend' => 1)); |
| 64 | -if(is_array($evtOut)) { |
|
| 64 | +if (is_array($evtOut)) { |
|
| 65 | 65 | $RTEditors = implode(',', $evtOut); |
| 66 | 66 | } |
| 67 | 67 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | }, |
| 108 | 108 | cancel: function() { |
| 109 | 109 | documentDirty = false; |
| 110 | - document.location.href = 'index.php?a=<?= $origin ?><?=(empty($originId) ? '' : '&id=' . $originId) ?>'; |
|
| 110 | + document.location.href = 'index.php?a=<?= $origin ?><?=(empty($originId) ? '' : '&id='.$originId) ?>'; |
|
| 111 | 111 | } |
| 112 | 112 | }; |
| 113 | 113 | |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | <?php |
| 280 | 280 | // invoke OnTVFormPrerender event |
| 281 | 281 | $evtOut = $modx->invokeEvent('OnTVFormPrerender', array('id' => $id)); |
| 282 | - if(is_array($evtOut)) { |
|
| 282 | + if (is_array($evtOut)) { |
|
| 283 | 283 | echo implode("", $evtOut); |
| 284 | 284 | } |
| 285 | 285 | ?> |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | <input type="hidden" name="params" value="<?= $modx->getPhpCompat()->htmlspecialchars($content['display_params']) ?>"> |
| 292 | 292 | |
| 293 | 293 | <h1> |
| 294 | - <i class="fa fa-list-alt"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_tmplvars']) ?><i class="fa fa-question-circle help"></i> |
|
| 294 | + <i class="fa fa-list-alt"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_tmplvars']) ?><i class="fa fa-question-circle help"></i> |
|
| 295 | 295 | </h1> |
| 296 | 296 | |
| 297 | 297 | <?= $_style['actionbuttons']['dynamic']['element'] ?> |
@@ -314,8 +314,8 @@ discard block |
||
| 314 | 314 | <div class="col-md-9 col-lg-10"> |
| 315 | 315 | <div class="form-control-name clearfix"> |
| 316 | 316 | <input name="name" type="text" maxlength="50" value="<?= $modx->getPhpCompat()->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" /> |
| 317 | - <?php if($modx->hasPermission('save_role')): ?> |
|
| 318 | - <label class="custom-control" title="<?= $_lang['lock_tmplvars'] . "\n" . $_lang['lock_tmplvars_msg'] ?>" tooltip> |
|
| 317 | + <?php if ($modx->hasPermission('save_role')): ?> |
|
| 318 | + <label class="custom-control" title="<?= $_lang['lock_tmplvars']."\n".$_lang['lock_tmplvars_msg'] ?>" tooltip> |
|
| 319 | 319 | <input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> /> |
| 320 | 320 | <i class="fa fa-lock"></i> |
| 321 | 321 | </label> |
@@ -343,9 +343,9 @@ discard block |
||
| 343 | 343 | <select name="categoryid" class="form-control" onChange="documentDirty=true;"> |
| 344 | 344 | <option> </option> |
| 345 | 345 | <?php |
| 346 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
| 347 | - foreach(getCategories() as $n => $v) { |
|
| 348 | - echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->getPhpCompat()->htmlspecialchars($v["category"]) . "</option>"; |
|
| 346 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
| 347 | + foreach (getCategories() as $n => $v) { |
|
| 348 | + echo "<option value='".$v['id']."'".($content["category"] == $v["id"] ? " selected='selected'" : "").">".$modx->getPhpCompat()->htmlspecialchars($v["category"])."</option>"; |
|
| 349 | 349 | } |
| 350 | 350 | ?> |
| 351 | 351 | </select> |
@@ -383,11 +383,11 @@ discard block |
||
| 383 | 383 | <optgroup label="Custom Type"> |
| 384 | 384 | <option value="custom_tv" <?= ($content['type'] == 'custom_tv' ? "selected='selected'" : "") ?>>Custom Input</option> |
| 385 | 385 | <?php |
| 386 | - $custom_tvs = scandir(MODX_BASE_PATH . 'assets/tvs'); |
|
| 387 | - foreach($custom_tvs as $ctv) { |
|
| 388 | - if(strpos($ctv, '.') !== 0 && $ctv != 'index.html') { |
|
| 389 | - $selected = ($content['type'] == 'custom_tv:' . $ctv ? "selected='selected'" : ""); |
|
| 390 | - echo '<option value="custom_tv:' . $ctv . '" ' . $selected . '>' . $ctv . '</option>'; |
|
| 386 | + $custom_tvs = scandir(MODX_BASE_PATH.'assets/tvs'); |
|
| 387 | + foreach ($custom_tvs as $ctv) { |
|
| 388 | + if (strpos($ctv, '.') !== 0 && $ctv != 'index.html') { |
|
| 389 | + $selected = ($content['type'] == 'custom_tv:'.$ctv ? "selected='selected'" : ""); |
|
| 390 | + echo '<option value="custom_tv:'.$ctv.'" '.$selected.'>'.$ctv.'</option>'; |
|
| 391 | 391 | } |
| 392 | 392 | } |
| 393 | 393 | ?> |
@@ -462,36 +462,36 @@ discard block |
||
| 462 | 462 | $tplList = '<ul>'; |
| 463 | 463 | $preCat = ''; |
| 464 | 464 | $insideUl = 0; |
| 465 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
| 465 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
| 466 | 466 | $row['category'] = stripslashes($row['category']); //pixelchutes |
| 467 | - if($preCat !== $row['category']) { |
|
| 467 | + if ($preCat !== $row['category']) { |
|
| 468 | 468 | $tplList .= $insideUl ? '</ul>' : ''; |
| 469 | - $tplList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>'; |
|
| 469 | + $tplList .= '<li><strong>'.$row['category'].($row['catid'] != '' ? ' <small>('.$row['catid'].')</small>' : '').'</strong><ul>'; |
|
| 470 | 470 | $insideUl = 1; |
| 471 | 471 | } |
| 472 | 472 | |
| 473 | - if($modx->getManagerApi()->action == '300' && $modx->config['default_template'] == $row['id']) { |
|
| 473 | + if ($modx->getManagerApi()->action == '300' && $modx->config['default_template'] == $row['id']) { |
|
| 474 | 474 | $checked = true; |
| 475 | - } elseif(isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) { |
|
| 475 | + } elseif (isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) { |
|
| 476 | 476 | $checked = true; |
| 477 | - } elseif($id == 0 && is_array($_POST['template'])) { |
|
| 477 | + } elseif ($id == 0 && is_array($_POST['template'])) { |
|
| 478 | 478 | $checked = in_array($row['id'], $_POST['template']); |
| 479 | 479 | } else { |
| 480 | 480 | $checked = $row['tmplvarid']; |
| 481 | 481 | } |
| 482 | 482 | $selectable = !$row['selectable'] ? ' class="disabled"' : ''; |
| 483 | 483 | $checked = $checked ? ' checked="checked"' : ''; |
| 484 | - $tplId = ' <small>(' . $row['id'] . ')</small>'; |
|
| 485 | - $desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : ''; |
|
| 484 | + $tplId = ' <small>('.$row['id'].')</small>'; |
|
| 485 | + $desc = !empty($row['tpldescription']) ? ' - '.$row['tpldescription'] : ''; |
|
| 486 | 486 | |
| 487 | 487 | $tplInfo = array(); |
| 488 | - if($row['tpllocked']) { |
|
| 488 | + if ($row['tpllocked']) { |
|
| 489 | 489 | $tplInfo[] = $_lang['locked']; |
| 490 | 490 | } |
| 491 | - if($row['id'] == $modx->config['default_template']) { |
|
| 491 | + if ($row['id'] == $modx->config['default_template']) { |
|
| 492 | 492 | $tplInfo[] = $_lang['defaulttemplate_title']; |
| 493 | 493 | } |
| 494 | - $tplInfo = !empty($tplInfo) ? ' <em>(' . implode(', ', $tplInfo) . ')</em>' : ''; |
|
| 494 | + $tplInfo = !empty($tplInfo) ? ' <em>('.implode(', ', $tplInfo).')</em>' : ''; |
|
| 495 | 495 | |
| 496 | 496 | $tplList .= sprintf('<li><label%s><input name="template[]" value="%s" type="checkbox" %s onchange="documentDirty=true;"> %s%s%s%s</label></li>', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo); |
| 497 | 497 | $tplList .= '</li>'; |
@@ -506,13 +506,13 @@ discard block |
||
| 506 | 506 | |
| 507 | 507 | <!-- Access Permissions --> |
| 508 | 508 | <?php |
| 509 | - if($use_udperms == 1) { |
|
| 509 | + if ($use_udperms == 1) { |
|
| 510 | 510 | // fetch permissions for the variable |
| 511 | 511 | $rs = $modx->getDatabase()->select('documentgroup', $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); |
| 512 | 512 | $groupsarray = $modx->getDatabase()->getColumn('documentgroup', $rs); |
| 513 | 513 | |
| 514 | 514 | ?> |
| 515 | - <?php if($modx->hasPermission('access_permissions')) { ?> |
|
| 515 | + <?php if ($modx->hasPermission('access_permissions')) { ?> |
|
| 516 | 516 | <script type="text/javascript"> |
| 517 | 517 | function makePublic(b) { |
| 518 | 518 | var notPublic = false; |
@@ -541,26 +541,26 @@ discard block |
||
| 541 | 541 | <?php |
| 542 | 542 | $chk = ''; |
| 543 | 543 | $rs = $modx->getDatabase()->select('name, id', $tbl_documentgroup_names); |
| 544 | - if(empty($groupsarray) && is_array($_POST['docgroups']) && empty($_POST['id'])) { |
|
| 544 | + if (empty($groupsarray) && is_array($_POST['docgroups']) && empty($_POST['id'])) { |
|
| 545 | 545 | $groupsarray = $_POST['docgroups']; |
| 546 | 546 | } |
| 547 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
| 547 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
| 548 | 548 | $checked = in_array($row['id'], $groupsarray); |
| 549 | - if($modx->hasPermission('access_permissions')) { |
|
| 550 | - if($checked) { |
|
| 549 | + if ($modx->hasPermission('access_permissions')) { |
|
| 550 | + if ($checked) { |
|
| 551 | 551 | $notPublic = true; |
| 552 | 552 | } |
| 553 | - $chks .= "<li><label><input type='checkbox' name='docgroups[]' value='" . $row['id'] . "' " . ($checked ? "checked='checked'" : '') . " onclick=\"makePublic(false)\" /> " . $row['name'] . "</label></li>"; |
|
| 553 | + $chks .= "<li><label><input type='checkbox' name='docgroups[]' value='".$row['id']."' ".($checked ? "checked='checked'" : '')." onclick=\"makePublic(false)\" /> ".$row['name']."</label></li>"; |
|
| 554 | 554 | } else { |
| 555 | - if($checked) { |
|
| 556 | - echo "<input type='hidden' name='docgroups[]' value='" . $row['id'] . "' />"; |
|
| 555 | + if ($checked) { |
|
| 556 | + echo "<input type='hidden' name='docgroups[]' value='".$row['id']."' />"; |
|
| 557 | 557 | } |
| 558 | 558 | } |
| 559 | 559 | } |
| 560 | - if($modx->hasPermission('access_permissions')) { |
|
| 561 | - $chks = "<li><label><input type='checkbox' name='chkalldocs' " . (!$notPublic ? "checked='checked'" : '') . " onclick=\"makePublic(true)\" /> <span class='warning'>" . $_lang['all_doc_groups'] . "</span></label></li>" . $chks; |
|
| 560 | + if ($modx->hasPermission('access_permissions')) { |
|
| 561 | + $chks = "<li><label><input type='checkbox' name='chkalldocs' ".(!$notPublic ? "checked='checked'" : '')." onclick=\"makePublic(true)\" /> <span class='warning'>".$_lang['all_doc_groups']."</span></label></li>".$chks; |
|
| 562 | 562 | } |
| 563 | - echo '<ul>' . $chks . '</ul>'; |
|
| 563 | + echo '<ul>'.$chks.'</ul>'; |
|
| 564 | 564 | ?> |
| 565 | 565 | <?php } ?> |
| 566 | 566 | <?php } ?> |
@@ -573,7 +573,7 @@ discard block |
||
| 573 | 573 | <?php |
| 574 | 574 | // invoke OnTVFormRender event |
| 575 | 575 | $evtOut = $modx->invokeEvent('OnTVFormRender', array('id' => $id)); |
| 576 | - if(is_array($evtOut)) { |
|
| 576 | + if (is_array($evtOut)) { |
|
| 577 | 577 | echo implode('', $evtOut); |
| 578 | 578 | } |
| 579 | 579 | ?> |
@@ -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 | -$lockElementId = (int)$lockElementId; |
|
| 6 | +$lockElementId = (int) $lockElementId; |
|
| 7 | 7 | |
| 8 | 8 | if ($lockElementId > 0) { |
| 9 | 9 | ?> |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | var stay = document.getElementById('stay'); |
| 19 | 19 | // Trigger unlock |
| 20 | 20 | if ((stay && stay.value !== '2') || !form_save) { |
| 21 | - var url = '<?php echo MODX_MANAGER_URL; ?>?a=67&type=<?php echo $lockElementType;?>&id=<?php echo $lockElementId;?>&o=' + Math.random(); |
|
| 21 | + var url = '<?php echo MODX_MANAGER_URL; ?>?a=67&type=<?php echo $lockElementType; ?>&id=<?php echo $lockElementId; ?>&o=' + Math.random(); |
|
| 22 | 22 | if (navigator.sendBeacon) { |
| 23 | 23 | navigator.sendBeacon(url) |
| 24 | 24 | } else { |
@@ -1,13 +1,13 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | -if(!$modx->hasPermission('delete_plugin')) { |
|
| 5 | +if (!$modx->hasPermission('delete_plugin')) { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -$id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
|
| 10 | -if($id==0) { |
|
| 9 | +$id = isset($_GET['id']) ? (int) $_GET['id'] : 0; |
|
| 10 | +if ($id == 0) { |
|
| 11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
| 12 | 12 | } |
| 13 | 13 | |
@@ -37,5 +37,5 @@ discard block |
||
| 37 | 37 | $modx->clearCache('full'); |
| 38 | 38 | |
| 39 | 39 | // finished emptying cache - redirect |
| 40 | -$header="Location: index.php?a=76&r=2"; |
|
| 40 | +$header = "Location: index.php?a=76&r=2"; |
|
| 41 | 41 | header($header); |
@@ -3,12 +3,12 @@ discard block |
||
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | if(!$modx->hasPermission('delete_plugin')) { |
| 6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | $id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
| 10 | 10 | if($id==0) { |
| 11 | - $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
| 11 | + $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | // Set the item name for logger |
@@ -17,9 +17,9 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | // invoke OnBeforePluginFormDelete event |
| 19 | 19 | $modx->invokeEvent("OnBeforePluginFormDelete", |
| 20 | - array( |
|
| 21 | - "id" => $id |
|
| 22 | - )); |
|
| 20 | + array( |
|
| 21 | + "id" => $id |
|
| 22 | + )); |
|
| 23 | 23 | |
| 24 | 24 | // delete the plugin. |
| 25 | 25 | $modx->getDatabase()->delete($modx->getFullTableName('site_plugins'), "id='{$id}'"); |
@@ -29,9 +29,9 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | // invoke OnPluginFormDelete event |
| 31 | 31 | $modx->invokeEvent("OnPluginFormDelete", |
| 32 | - array( |
|
| 33 | - "id" => $id |
|
| 34 | - )); |
|
| 32 | + array( |
|
| 33 | + "id" => $id |
|
| 34 | + )); |
|
| 35 | 35 | |
| 36 | 36 | // empty cache |
| 37 | 37 | $modx->clearCache('full'); |
@@ -1,13 +1,13 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | -if(!$modx->hasPermission('delete_snippet')) { |
|
| 5 | +if (!$modx->hasPermission('delete_snippet')) { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -$id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
|
| 10 | -if($id==0) { |
|
| 9 | +$id = isset($_GET['id']) ? (int) $_GET['id'] : 0; |
|
| 10 | +if ($id == 0) { |
|
| 11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
| 12 | 12 | } |
| 13 | 13 | |
@@ -34,5 +34,5 @@ discard block |
||
| 34 | 34 | $modx->clearCache('full'); |
| 35 | 35 | |
| 36 | 36 | // finished emptying cache - redirect |
| 37 | -$header="Location: index.php?a=76&r=2"; |
|
| 37 | +$header = "Location: index.php?a=76&r=2"; |
|
| 38 | 38 | header($header); |
@@ -3,12 +3,12 @@ discard block |
||
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | if(!$modx->hasPermission('delete_snippet')) { |
| 6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | $id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
| 10 | 10 | if($id==0) { |
| 11 | - $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
| 11 | + $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | // Set the item name for logger |
@@ -17,18 +17,18 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | // invoke OnBeforeChunkFormDelete event |
| 19 | 19 | $modx->invokeEvent("OnBeforeChunkFormDelete", |
| 20 | - array( |
|
| 21 | - "id" => $id |
|
| 22 | - )); |
|
| 20 | + array( |
|
| 21 | + "id" => $id |
|
| 22 | + )); |
|
| 23 | 23 | |
| 24 | 24 | // delete the chunk. |
| 25 | 25 | $modx->getDatabase()->delete($modx->getFullTableName('site_htmlsnippets'), "id='{$id}'"); |
| 26 | 26 | |
| 27 | 27 | // invoke OnChunkFormDelete event |
| 28 | 28 | $modx->invokeEvent("OnChunkFormDelete", |
| 29 | - array( |
|
| 30 | - "id" => $id |
|
| 31 | - )); |
|
| 29 | + array( |
|
| 30 | + "id" => $id |
|
| 31 | + )); |
|
| 32 | 32 | |
| 33 | 33 | // empty cache |
| 34 | 34 | $modx->clearCache('full'); |