@@ -515,6 +515,9 @@ discard block |
||
| 515 | 515 | $this->setDroptables(false); |
| 516 | 516 | } |
| 517 | 517 | |
| 518 | + /** |
|
| 519 | + * @param boolean $state |
|
| 520 | + */ |
|
| 518 | 521 | public function setDroptables($state) |
| 519 | 522 | { |
| 520 | 523 | $this->_isDroptables = $state; |
@@ -722,6 +725,9 @@ discard block |
||
| 722 | 725 | $_SESSION['result_msg'] = $result_code; |
| 723 | 726 | } |
| 724 | 727 | |
| 728 | +/** |
|
| 729 | + * @param string $dumpstring |
|
| 730 | + */ |
|
| 725 | 731 | function dumpSql(&$dumpstring) |
| 726 | 732 | { |
| 727 | 733 | global $modx; |
@@ -741,6 +747,9 @@ discard block |
||
| 741 | 747 | return true; |
| 742 | 748 | } |
| 743 | 749 | |
| 750 | +/** |
|
| 751 | + * @param string $dumpstring |
|
| 752 | + */ |
|
| 744 | 753 | function snapshot(&$dumpstring) |
| 745 | 754 | { |
| 746 | 755 | global $path; |
@@ -447,6 +447,10 @@ discard block |
||
| 447 | 447 | /** |
| 448 | 448 | * return XML parser, and possibly re-encoded source |
| 449 | 449 | * |
| 450 | + * @param string $source |
|
| 451 | + * @param string $out_enc |
|
| 452 | + * @param string|null $in_enc |
|
| 453 | + * @param boolean $detect |
|
| 450 | 454 | */ |
| 451 | 455 | function create_parser($source, $out_enc, $in_enc, $detect) { |
| 452 | 456 | if ( substr(phpversion(),0,1) == 5) { |
@@ -556,6 +560,9 @@ discard block |
||
| 556 | 560 | } |
| 557 | 561 | } |
| 558 | 562 | |
| 563 | + /** |
|
| 564 | + * @param integer $lvl |
|
| 565 | + */ |
|
| 559 | 566 | function error ($errormsg, $lvl=E_USER_WARNING) { |
| 560 | 567 | // append PHP's error message if track_errors enabled |
| 561 | 568 | if ( isset($php_errormsg) ) { |
@@ -591,6 +598,9 @@ discard block |
||
| 591 | 598 | define('CASE_LOWER', 0); |
| 592 | 599 | |
| 593 | 600 | |
| 601 | + /** |
|
| 602 | + * @param integer $case |
|
| 603 | + */ |
|
| 594 | 604 | function array_change_key_case($array, $case=CASE_LOWER) { |
| 595 | 605 | $output = array(); |
| 596 | 606 | switch($case){ |
@@ -98,8 +98,8 @@ discard block |
||
| 98 | 98 | # |
| 99 | 99 | if (!function_exists('xml_parser_create')) { |
| 100 | 100 | $this->error( "Failed to load PHP's XML Extension. " . |
| 101 | - "http://www.php.net/manual/en/ref.xml.php", |
|
| 102 | - E_USER_ERROR ); |
|
| 101 | + "http://www.php.net/manual/en/ref.xml.php", |
|
| 102 | + E_USER_ERROR ); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | list($parser, $source) = $this->create_parser($source, |
@@ -108,8 +108,8 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | if (!is_resource($parser)) { |
| 110 | 110 | $this->error( "Failed to create an instance of PHP's XML parser. " . |
| 111 | - "http://www.php.net/manual/en/ref.xml.php", |
|
| 112 | - E_USER_ERROR ); |
|
| 111 | + "http://www.php.net/manual/en/ref.xml.php", |
|
| 112 | + E_USER_ERROR ); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | |
@@ -445,9 +445,9 @@ discard block |
||
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | /** |
| 448 | - * return XML parser, and possibly re-encoded source |
|
| 449 | - * |
|
| 450 | - */ |
|
| 448 | + * return XML parser, and possibly re-encoded source |
|
| 449 | + * |
|
| 450 | + */ |
|
| 451 | 451 | function create_parser($source, $out_enc, $in_enc, $detect) { |
| 452 | 452 | if ( substr(phpversion(),0,1) == 5) { |
| 453 | 453 | $parser = $this->php5_create_parser($in_enc, $detect); |
@@ -464,14 +464,14 @@ discard block |
||
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 466 | /** |
| 467 | - * Instantiate an XML parser under PHP5 |
|
| 468 | - * |
|
| 469 | - * PHP5 will do a fine job of detecting input encoding |
|
| 470 | - * if passed an empty string as the encoding. |
|
| 471 | - * |
|
| 472 | - * All hail libxml2! |
|
| 473 | - * |
|
| 474 | - */ |
|
| 467 | + * Instantiate an XML parser under PHP5 |
|
| 468 | + * |
|
| 469 | + * PHP5 will do a fine job of detecting input encoding |
|
| 470 | + * if passed an empty string as the encoding. |
|
| 471 | + * |
|
| 472 | + * All hail libxml2! |
|
| 473 | + * |
|
| 474 | + */ |
|
| 475 | 475 | function php5_create_parser($in_enc, $detect) { |
| 476 | 476 | // by default php5 does a fine job of detecting input encodings |
| 477 | 477 | if(!$detect && $in_enc) { |
@@ -483,20 +483,20 @@ discard block |
||
| 483 | 483 | } |
| 484 | 484 | |
| 485 | 485 | /** |
| 486 | - * Instaniate an XML parser under PHP4 |
|
| 487 | - * |
|
| 488 | - * Unfortunately PHP4's support for character encodings |
|
| 489 | - * and especially XML and character encodings sucks. As |
|
| 490 | - * long as the documents you parse only contain characters |
|
| 491 | - * from the ISO-8859-1 character set (a superset of ASCII, |
|
| 492 | - * and a subset of UTF-8) you're fine. However once you |
|
| 493 | - * step out of that comfy little world things get mad, bad, |
|
| 494 | - * and dangerous to know. |
|
| 495 | - * |
|
| 496 | - * The following code is based on SJM's work with FoF |
|
| 497 | - * @see http://minutillo.com/steve/weblog/2004/6/17/php-xml-and-character-encodings-a-tale-of-sadness-rage-and-data-loss |
|
| 498 | - * |
|
| 499 | - */ |
|
| 486 | + * Instaniate an XML parser under PHP4 |
|
| 487 | + * |
|
| 488 | + * Unfortunately PHP4's support for character encodings |
|
| 489 | + * and especially XML and character encodings sucks. As |
|
| 490 | + * long as the documents you parse only contain characters |
|
| 491 | + * from the ISO-8859-1 character set (a superset of ASCII, |
|
| 492 | + * and a subset of UTF-8) you're fine. However once you |
|
| 493 | + * step out of that comfy little world things get mad, bad, |
|
| 494 | + * and dangerous to know. |
|
| 495 | + * |
|
| 496 | + * The following code is based on SJM's work with FoF |
|
| 497 | + * @see http://minutillo.com/steve/weblog/2004/6/17/php-xml-and-character-encodings-a-tale-of-sadness-rage-and-data-loss |
|
| 498 | + * |
|
| 499 | + */ |
|
| 500 | 500 | function php4_create_parser($source, $in_enc, $detect) { |
| 501 | 501 | if ( !$detect ) { |
| 502 | 502 | return array(xml_parser_create($in_enc), $source); |
@@ -540,8 +540,8 @@ discard block |
||
| 540 | 540 | |
| 541 | 541 | // else |
| 542 | 542 | $this->error("Feed is in an unsupported character encoding. ($in_enc) " . |
| 543 | - "You may see strange artifacts, and mangled characters.", |
|
| 544 | - E_USER_NOTICE); |
|
| 543 | + "You may see strange artifacts, and mangled characters.", |
|
| 544 | + E_USER_NOTICE); |
|
| 545 | 545 | |
| 546 | 546 | return array(xml_parser_create(), $source); |
| 547 | 547 | } |
@@ -587,26 +587,26 @@ discard block |
||
| 587 | 587 | // courtesy, Ryan Currie, [email protected] |
| 588 | 588 | |
| 589 | 589 | if (!function_exists('array_change_key_case')) { |
| 590 | - define('CASE_UPPER', 1); |
|
| 591 | - define('CASE_LOWER', 0); |
|
| 590 | + define('CASE_UPPER', 1); |
|
| 591 | + define('CASE_LOWER', 0); |
|
| 592 | 592 | |
| 593 | 593 | |
| 594 | - function array_change_key_case($array, $case=CASE_LOWER) { |
|
| 594 | + function array_change_key_case($array, $case=CASE_LOWER) { |
|
| 595 | 595 | $output = array(); |
| 596 | 596 | switch($case){ |
| 597 | - case CASE_LOWER: |
|
| 597 | + case CASE_LOWER: |
|
| 598 | 598 | $cmd='strtolower'; |
| 599 | - break; |
|
| 600 | - case CASE_UPPER: |
|
| 599 | + break; |
|
| 600 | + case CASE_UPPER: |
|
| 601 | 601 | $cmd='strtoupper'; |
| 602 | - break; |
|
| 603 | - default: |
|
| 602 | + break; |
|
| 603 | + default: |
|
| 604 | 604 | $cmd = ''; |
| 605 | 605 | } |
| 606 | 606 | foreach($array as $key=>$value) { |
| 607 | 607 | $output[empty($cmd) ? $key : $cmd($key)] = $value; |
| 608 | 608 | } |
| 609 | 609 | return $output; |
| 610 | - } |
|
| 610 | + } |
|
| 611 | 611 | |
| 612 | 612 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | $autoloader = __DIR__.'/vendor/autoload.php'; |
| 49 | 49 | if (file_exists($autoloader) && is_readable($autoloader)) { |
| 50 | - include_once($autoloader); |
|
| 50 | + include_once($autoloader); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | if(!isset($_SERVER['REQUEST_TIME_FLOAT'])) $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true); |
@@ -56,11 +56,11 @@ discard block |
||
| 56 | 56 | if(is_file($base_path . 'assets/cache/siteManager.php')) |
| 57 | 57 | include_once($base_path . 'assets/cache/siteManager.php'); |
| 58 | 58 | if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) |
| 59 | - define('MGR_DIR', 'manager'); |
|
| 59 | + define('MGR_DIR', 'manager'); |
|
| 60 | 60 | if(is_file($base_path . 'assets/cache/siteHostnames.php')) |
| 61 | 61 | include_once($base_path . 'assets/cache/siteHostnames.php'); |
| 62 | 62 | if(!defined('MODX_SITE_HOSTNAMES')) |
| 63 | - define('MODX_SITE_HOSTNAMES', ''); |
|
| 63 | + define('MODX_SITE_HOSTNAMES', ''); |
|
| 64 | 64 | |
| 65 | 65 | // get start time |
| 66 | 66 | $mstart = memory_get_usage(); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | define('IN_PARSER_MODE', true); |
| 86 | 86 | if ( ! defined('IN_MANAGER_MODE')) { |
| 87 | - define('IN_MANAGER_MODE', false); |
|
| 87 | + define('IN_MANAGER_MODE', false); |
|
| 88 | 88 | } |
| 89 | 89 | if (!defined('MODX_API_MODE')) { |
| 90 | 90 | define('MODX_API_MODE', false); |
@@ -92,12 +92,12 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | // get the required includes |
| 94 | 94 | if(!isset($database_user) || $database_user=="") { |
| 95 | - $rt = @include_once(dirname(__FILE__).'/'.MGR_DIR.'/includes/config.inc.php'); |
|
| 96 | - // Be sure config.inc.php is there and that it contains some important values |
|
| 97 | - if(!$rt || !$database_type || !$database_server || !$database_user || !$dbase) { |
|
| 98 | - readfile('install/not_installed.tpl'); |
|
| 99 | - exit; |
|
| 100 | - } |
|
| 95 | + $rt = @include_once(dirname(__FILE__).'/'.MGR_DIR.'/includes/config.inc.php'); |
|
| 96 | + // Be sure config.inc.php is there and that it contains some important values |
|
| 97 | + if(!$rt || !$database_type || !$database_server || !$database_user || !$dbase) { |
|
| 98 | + readfile('install/not_installed.tpl'); |
|
| 99 | + exit; |
|
| 100 | + } |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | // start session |
@@ -105,11 +105,11 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | // initiate a new document parser |
| 107 | 107 | if (isset($coreClass) && class_exists($coreClass)) { |
| 108 | - $modx = new $coreClass; |
|
| 108 | + $modx = new $coreClass; |
|
| 109 | 109 | } |
| 110 | 110 | if (!isset($modx) || !($modx instanceof \DocumentParser)) { |
| 111 | - include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php'); |
|
| 112 | - $modx = new \DocumentParser; |
|
| 111 | + include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php'); |
|
| 112 | + $modx = new \DocumentParser; |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | // set some parser options |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | echo "<span class=\"notok\" style='color:#707070'>".$_lang['setup_database_selection_failed']."</span>".$_lang['setup_database_selection_failed_note']."</p>"; |
| 86 | 86 | $create = true; |
| 87 | 87 | } else { |
| 88 | - if (function_exists('mysqli_set_charset')) mysqli_set_charset($conn, $database_charset); |
|
| 88 | + if (function_exists('mysqli_set_charset')) mysqli_set_charset($conn, $database_charset); |
|
| 89 | 89 | mysqli_query($conn, "{$database_connection_method} {$database_connection_charset}"); |
| 90 | 90 | echo '<span class="ok">'.$_lang['ok']."</span></p>"; |
| 91 | 91 | } |
@@ -280,23 +280,23 @@ discard block |
||
| 280 | 280 | |
| 281 | 281 | // Reset database for installation of demo-site |
| 282 | 282 | if ($installData && $moduleSQLDataFile && $moduleSQLResetFile) { |
| 283 | - echo "<p>" . $_lang['resetting_database']; |
|
| 284 | - $sqlParser->process($moduleSQLResetFile); |
|
| 285 | - // display database results |
|
| 286 | - if ($sqlParser->installFailed == true) { |
|
| 287 | - $errors += 1; |
|
| 288 | - echo "<span class=\"notok\"><b>" . $_lang['database_alerts'] . "</span></p>"; |
|
| 289 | - echo "<p>" . $_lang['setup_couldnt_install'] . "</p>"; |
|
| 290 | - echo "<p>" . $_lang['installation_error_occured'] . "<br /><br />"; |
|
| 291 | - for ($i = 0; $i < count($sqlParser->mysqlErrors); $i++) { |
|
| 292 | - echo "<em>" . $sqlParser->mysqlErrors[$i]["error"] . "</em>" . $_lang['during_execution_of_sql'] . "<span class='mono'>" . strip_tags($sqlParser->mysqlErrors[$i]["sql"]) . "</span>.<hr />"; |
|
| 293 | - } |
|
| 294 | - echo "</p>"; |
|
| 295 | - echo "<p>" . $_lang['some_tables_not_updated'] . "</p>"; |
|
| 296 | - return; |
|
| 297 | - } else { |
|
| 298 | - echo '<span class="ok">'.$_lang['ok']."</span></p>"; |
|
| 299 | - } |
|
| 283 | + echo "<p>" . $_lang['resetting_database']; |
|
| 284 | + $sqlParser->process($moduleSQLResetFile); |
|
| 285 | + // display database results |
|
| 286 | + if ($sqlParser->installFailed == true) { |
|
| 287 | + $errors += 1; |
|
| 288 | + echo "<span class=\"notok\"><b>" . $_lang['database_alerts'] . "</span></p>"; |
|
| 289 | + echo "<p>" . $_lang['setup_couldnt_install'] . "</p>"; |
|
| 290 | + echo "<p>" . $_lang['installation_error_occured'] . "<br /><br />"; |
|
| 291 | + for ($i = 0; $i < count($sqlParser->mysqlErrors); $i++) { |
|
| 292 | + echo "<em>" . $sqlParser->mysqlErrors[$i]["error"] . "</em>" . $_lang['during_execution_of_sql'] . "<span class='mono'>" . strip_tags($sqlParser->mysqlErrors[$i]["sql"]) . "</span>.<hr />"; |
|
| 293 | + } |
|
| 294 | + echo "</p>"; |
|
| 295 | + echo "<p>" . $_lang['some_tables_not_updated'] . "</p>"; |
|
| 296 | + return; |
|
| 297 | + } else { |
|
| 298 | + echo '<span class="ok">'.$_lang['ok']."</span></p>"; |
|
| 299 | + } |
|
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | // Install Templates |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | $tRow = mysqli_fetch_assoc($ts); |
| 419 | 419 | $templateId = $tRow['id']; |
| 420 | 420 | mysqli_query($sqlParser->conn, "INSERT INTO $dbase.`" . $table_prefix . "site_tmplvar_templates` (tmplvarid, templateid) VALUES($id, $templateId)"); |
| 421 | - } |
|
| 421 | + } |
|
| 422 | 422 | } |
| 423 | 423 | } |
| 424 | 424 | } |
@@ -687,51 +687,51 @@ discard block |
||
| 687 | 687 | |
| 688 | 688 | // Install Dependencies |
| 689 | 689 | foreach ($moduleDependencies as $dependency) { |
| 690 | - $ds = mysqli_query($sqlParser->conn, 'SELECT id, guid FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_modules` WHERE name="' . $dependency['module'] . '"'); |
|
| 691 | - if (!$ds) { |
|
| 692 | - echo "<p>" . mysqli_error($sqlParser->conn) . "</p>"; |
|
| 693 | - return; |
|
| 694 | - } else { |
|
| 695 | - $row = mysqli_fetch_assoc($ds); |
|
| 696 | - $moduleId = $row["id"]; |
|
| 697 | - $moduleGuid = $row["guid"]; |
|
| 698 | - } |
|
| 699 | - // get extra id |
|
| 700 | - $ds = mysqli_query($sqlParser->conn, 'SELECT id FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` WHERE ' . $dependency['column'] . '="' . $dependency['name'] . '"'); |
|
| 701 | - if (!$ds) { |
|
| 702 | - echo "<p>" . mysqli_error($sqlParser->conn) . "</p>"; |
|
| 703 | - return; |
|
| 704 | - } else { |
|
| 705 | - $row = mysqli_fetch_assoc($ds); |
|
| 706 | - $extraId = $row["id"]; |
|
| 707 | - } |
|
| 708 | - // setup extra as module dependency |
|
| 709 | - $ds = mysqli_query($sqlParser->conn, 'SELECT module FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` WHERE module=' . $moduleId . ' AND resource=' . $extraId . ' AND type=' . $dependency['type'] . ' LIMIT 1'); |
|
| 710 | - if (!$ds) { |
|
| 711 | - echo "<p>" . mysqli_error($sqlParser->conn) . "</p>"; |
|
| 712 | - return; |
|
| 713 | - } else { |
|
| 714 | - if (mysqli_num_rows($ds) === 0) { |
|
| 715 | - mysqli_query($sqlParser->conn, 'INSERT INTO ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` (module, resource, type) VALUES(' . $moduleId . ',' . $extraId . ',' . $dependency['type'] . ')'); |
|
| 716 | - echo '<p> ' . $dependency['module'] . ' Module: <span class="ok">' . $_lang['depedency_create'] . '</span></p>'; |
|
| 717 | - } else { |
|
| 718 | - mysqli_query($sqlParser->conn, 'UPDATE ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` SET module = ' . $moduleId . ', resource = ' . $extraId . ', type = ' . $dependency['type'] . ' WHERE module=' . $moduleId . ' AND resource=' . $extraId . ' AND type=' . $dependency['type']); |
|
| 719 | - echo '<p> ' . $dependency['module'] . ' Module: <span class="ok">' . $_lang['depedency_update'] . '</span></p>'; |
|
| 720 | - } |
|
| 721 | - if ($dependency['type'] == 30 || $dependency['type'] == 40) { |
|
| 722 | - // set extra guid for plugins and snippets |
|
| 723 | - $ds = mysqli_query($sqlParser->conn, 'SELECT id FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` WHERE id=' . $extraId . ' LIMIT 1'); |
|
| 724 | - if (!$ds) { |
|
| 725 | - echo "<p>" . mysqli_error($sqlParser->conn) . "</p>"; |
|
| 726 | - return; |
|
| 727 | - } else { |
|
| 728 | - if (mysqli_num_rows($ds) != 0) { |
|
| 729 | - mysqli_query($sqlParser->conn, 'UPDATE ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` SET moduleguid = ' . $moduleGuid . ' WHERE id=' . $extraId); |
|
| 730 | - echo '<p> ' . $dependency['name'] . ': <span class="ok">' . $_lang['guid_set'] . '</span></p>'; |
|
| 731 | - } |
|
| 732 | - } |
|
| 733 | - } |
|
| 734 | - } |
|
| 690 | + $ds = mysqli_query($sqlParser->conn, 'SELECT id, guid FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_modules` WHERE name="' . $dependency['module'] . '"'); |
|
| 691 | + if (!$ds) { |
|
| 692 | + echo "<p>" . mysqli_error($sqlParser->conn) . "</p>"; |
|
| 693 | + return; |
|
| 694 | + } else { |
|
| 695 | + $row = mysqli_fetch_assoc($ds); |
|
| 696 | + $moduleId = $row["id"]; |
|
| 697 | + $moduleGuid = $row["guid"]; |
|
| 698 | + } |
|
| 699 | + // get extra id |
|
| 700 | + $ds = mysqli_query($sqlParser->conn, 'SELECT id FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` WHERE ' . $dependency['column'] . '="' . $dependency['name'] . '"'); |
|
| 701 | + if (!$ds) { |
|
| 702 | + echo "<p>" . mysqli_error($sqlParser->conn) . "</p>"; |
|
| 703 | + return; |
|
| 704 | + } else { |
|
| 705 | + $row = mysqli_fetch_assoc($ds); |
|
| 706 | + $extraId = $row["id"]; |
|
| 707 | + } |
|
| 708 | + // setup extra as module dependency |
|
| 709 | + $ds = mysqli_query($sqlParser->conn, 'SELECT module FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` WHERE module=' . $moduleId . ' AND resource=' . $extraId . ' AND type=' . $dependency['type'] . ' LIMIT 1'); |
|
| 710 | + if (!$ds) { |
|
| 711 | + echo "<p>" . mysqli_error($sqlParser->conn) . "</p>"; |
|
| 712 | + return; |
|
| 713 | + } else { |
|
| 714 | + if (mysqli_num_rows($ds) === 0) { |
|
| 715 | + mysqli_query($sqlParser->conn, 'INSERT INTO ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` (module, resource, type) VALUES(' . $moduleId . ',' . $extraId . ',' . $dependency['type'] . ')'); |
|
| 716 | + echo '<p> ' . $dependency['module'] . ' Module: <span class="ok">' . $_lang['depedency_create'] . '</span></p>'; |
|
| 717 | + } else { |
|
| 718 | + mysqli_query($sqlParser->conn, 'UPDATE ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` SET module = ' . $moduleId . ', resource = ' . $extraId . ', type = ' . $dependency['type'] . ' WHERE module=' . $moduleId . ' AND resource=' . $extraId . ' AND type=' . $dependency['type']); |
|
| 719 | + echo '<p> ' . $dependency['module'] . ' Module: <span class="ok">' . $_lang['depedency_update'] . '</span></p>'; |
|
| 720 | + } |
|
| 721 | + if ($dependency['type'] == 30 || $dependency['type'] == 40) { |
|
| 722 | + // set extra guid for plugins and snippets |
|
| 723 | + $ds = mysqli_query($sqlParser->conn, 'SELECT id FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` WHERE id=' . $extraId . ' LIMIT 1'); |
|
| 724 | + if (!$ds) { |
|
| 725 | + echo "<p>" . mysqli_error($sqlParser->conn) . "</p>"; |
|
| 726 | + return; |
|
| 727 | + } else { |
|
| 728 | + if (mysqli_num_rows($ds) != 0) { |
|
| 729 | + mysqli_query($sqlParser->conn, 'UPDATE ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` SET moduleguid = ' . $moduleGuid . ' WHERE id=' . $extraId); |
|
| 730 | + echo '<p> ' . $dependency['name'] . ': <span class="ok">' . $_lang['guid_set'] . '</span></p>'; |
|
| 731 | + } |
|
| 732 | + } |
|
| 733 | + } |
|
| 734 | + } |
|
| 735 | 735 | } |
| 736 | 736 | |
| 737 | 737 | // call back function |
@@ -13,227 +13,227 @@ |
||
| 13 | 13 | |
| 14 | 14 | class fastImage |
| 15 | 15 | { |
| 16 | - private $strpos = 0; |
|
| 17 | - private $str; |
|
| 18 | - private $uri; |
|
| 19 | - private $type; |
|
| 20 | - private $handle; |
|
| 16 | + private $strpos = 0; |
|
| 17 | + private $str; |
|
| 18 | + private $uri; |
|
| 19 | + private $type; |
|
| 20 | + private $handle; |
|
| 21 | 21 | |
| 22 | - public function __construct($uri = null) |
|
| 23 | - { |
|
| 24 | - if ($uri) $this->load($uri); |
|
| 25 | - } |
|
| 22 | + public function __construct($uri = null) |
|
| 23 | + { |
|
| 24 | + if ($uri) $this->load($uri); |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | 27 | |
| 28 | - public function load($uri) |
|
| 29 | - { |
|
| 30 | - if ($this->handle) $this->close(); |
|
| 31 | - |
|
| 32 | - $this->uri = $uri; |
|
| 33 | - $this->handle = fopen($uri, 'r'); |
|
| 34 | - } |
|
| 35 | - |
|
| 36 | - |
|
| 37 | - public function close() |
|
| 38 | - { |
|
| 39 | - if (is_resource($this->handle)) fclose($this->handle); |
|
| 40 | - } |
|
| 28 | + public function load($uri) |
|
| 29 | + { |
|
| 30 | + if ($this->handle) $this->close(); |
|
| 31 | + |
|
| 32 | + $this->uri = $uri; |
|
| 33 | + $this->handle = fopen($uri, 'r'); |
|
| 34 | + } |
|
| 35 | + |
|
| 36 | + |
|
| 37 | + public function close() |
|
| 38 | + { |
|
| 39 | + if (is_resource($this->handle)) fclose($this->handle); |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | 42 | |
| 43 | - public function getSize() |
|
| 44 | - { |
|
| 45 | - $this->strpos = 0; |
|
| 46 | - if ($this->getType()) |
|
| 47 | - { |
|
| 48 | - return array_values($this->parseSize()); |
|
| 49 | - } |
|
| 50 | - |
|
| 51 | - return false; |
|
| 52 | - } |
|
| 53 | - |
|
| 54 | - |
|
| 55 | - public function getType() |
|
| 56 | - { |
|
| 57 | - $this->strpos = 0; |
|
| 58 | - |
|
| 59 | - if (!$this->type) |
|
| 60 | - { |
|
| 61 | - switch ($this->getChars(2)) |
|
| 62 | - { |
|
| 63 | - case "BM": |
|
| 64 | - return $this->type = 'bmp'; |
|
| 65 | - case "GI": |
|
| 66 | - return $this->type = 'gif'; |
|
| 67 | - case chr(0xFF).chr(0xd8): |
|
| 68 | - return $this->type = 'jpeg'; |
|
| 69 | - case chr(0x89).'P': |
|
| 70 | - return $this->type = 'png'; |
|
| 71 | - default: |
|
| 72 | - return false; |
|
| 73 | - } |
|
| 74 | - } |
|
| 75 | - |
|
| 76 | - return $this->type; |
|
| 77 | - } |
|
| 78 | - |
|
| 79 | - |
|
| 80 | - private function parseSize() |
|
| 81 | - { |
|
| 82 | - $this->strpos = 0; |
|
| 83 | - |
|
| 84 | - switch ($this->type) |
|
| 85 | - { |
|
| 86 | - case 'png': |
|
| 87 | - return $this->parseSizeForPNG(); |
|
| 88 | - case 'gif': |
|
| 89 | - return $this->parseSizeForGIF(); |
|
| 90 | - case 'bmp': |
|
| 91 | - return $this->parseSizeForBMP(); |
|
| 92 | - case 'jpeg': |
|
| 93 | - return $this->parseSizeForJPEG(); |
|
| 94 | - } |
|
| 95 | - |
|
| 96 | - return null; |
|
| 97 | - } |
|
| 98 | - |
|
| 99 | - |
|
| 100 | - private function parseSizeForPNG() |
|
| 101 | - { |
|
| 102 | - $chars = $this->getChars(25); |
|
| 103 | - |
|
| 104 | - return unpack("N*", substr($chars, 16, 8)); |
|
| 105 | - } |
|
| 106 | - |
|
| 107 | - |
|
| 108 | - private function parseSizeForGIF() |
|
| 109 | - { |
|
| 110 | - $chars = $this->getChars(11); |
|
| 111 | - |
|
| 112 | - return unpack("S*", substr($chars, 6, 4)); |
|
| 113 | - } |
|
| 114 | - |
|
| 115 | - |
|
| 116 | - private function parseSizeForBMP() |
|
| 117 | - { |
|
| 118 | - $chars = $this->getChars(29); |
|
| 119 | - $chars = substr($chars, 14, 14); |
|
| 120 | - $type = unpack('C', $chars); |
|
| 121 | - |
|
| 122 | - return (reset($type) == 40) ? unpack('L*', substr($chars, 4)) : unpack('L*', substr($chars, 4, 8)); |
|
| 123 | - } |
|
| 124 | - |
|
| 125 | - |
|
| 126 | - private function parseSizeForJPEG() |
|
| 127 | - { |
|
| 128 | - $state = null; |
|
| 129 | - |
|
| 130 | - while (true) |
|
| 131 | - { |
|
| 132 | - switch ($state) |
|
| 133 | - { |
|
| 134 | - default: |
|
| 135 | - $this->getChars(2); |
|
| 136 | - $state = 'started'; |
|
| 137 | - break; |
|
| 138 | - |
|
| 139 | - case 'started': |
|
| 140 | - $b = $this->getByte(); |
|
| 141 | - if ($b === false) return false; |
|
| 142 | - |
|
| 143 | - $state = $b == 0xFF ? 'sof' : 'started'; |
|
| 144 | - break; |
|
| 145 | - |
|
| 146 | - case 'sof': |
|
| 147 | - $b = $this->getByte(); |
|
| 148 | - if (in_array($b, range(0xe0, 0xef))) |
|
| 149 | - { |
|
| 150 | - $state = 'skipframe'; |
|
| 151 | - } |
|
| 152 | - elseif (in_array($b, array_merge(range(0xC0,0xC3), range(0xC5,0xC7), range(0xC9,0xCB), range(0xCD,0xCF)))) |
|
| 153 | - { |
|
| 154 | - $state = 'readsize'; |
|
| 155 | - } |
|
| 156 | - elseif ($b == 0xFF) |
|
| 157 | - { |
|
| 158 | - $state = 'sof'; |
|
| 159 | - } |
|
| 160 | - else |
|
| 161 | - { |
|
| 162 | - $state = 'skipframe'; |
|
| 163 | - } |
|
| 164 | - break; |
|
| 165 | - |
|
| 166 | - case 'skipframe': |
|
| 167 | - $skip = $this->readInt($this->getChars(2)) - 2; |
|
| 168 | - $state = 'doskip'; |
|
| 169 | - break; |
|
| 170 | - |
|
| 171 | - case 'doskip': |
|
| 172 | - $this->getChars($skip); |
|
| 173 | - $state = 'started'; |
|
| 174 | - break; |
|
| 175 | - |
|
| 176 | - case 'readsize': |
|
| 177 | - $c = $this->getChars(7); |
|
| 178 | - |
|
| 179 | - return array($this->readInt(substr($c, 5, 2)), $this->readInt(substr($c, 3, 2))); |
|
| 180 | - } |
|
| 181 | - } |
|
| 182 | - } |
|
| 183 | - |
|
| 184 | - |
|
| 185 | - private function getChars($n) |
|
| 186 | - { |
|
| 187 | - $response = null; |
|
| 188 | - |
|
| 189 | - // do we need more data? |
|
| 190 | - if ($this->strpos + $n -1 >= strlen($this->str)) |
|
| 191 | - { |
|
| 192 | - $end = ($this->strpos + $n); |
|
| 193 | - |
|
| 194 | - while (strlen($this->str) < $end && $response !== false) |
|
| 195 | - { |
|
| 196 | - // read more from the file handle |
|
| 197 | - $need = $end - ftell($this->handle); |
|
| 198 | - |
|
| 199 | - if ($response = fread($this->handle, $need)) |
|
| 200 | - { |
|
| 201 | - $this->str .= $response; |
|
| 202 | - } |
|
| 203 | - else |
|
| 204 | - { |
|
| 205 | - return false; |
|
| 206 | - } |
|
| 207 | - } |
|
| 208 | - } |
|
| 209 | - |
|
| 210 | - $result = substr($this->str, $this->strpos, $n); |
|
| 211 | - $this->strpos += $n; |
|
| 212 | - |
|
| 213 | - // we are dealing with bytes here, so force the encoding |
|
| 214 | - return mb_convert_encoding($result, "8BIT"); |
|
| 215 | - } |
|
| 216 | - |
|
| 217 | - |
|
| 218 | - private function getByte() |
|
| 219 | - { |
|
| 220 | - $c = $this->getChars(1); |
|
| 221 | - $b = unpack("C", $c); |
|
| 222 | - |
|
| 223 | - return reset($b); |
|
| 224 | - } |
|
| 225 | - |
|
| 226 | - |
|
| 227 | - private function readInt($str) |
|
| 228 | - { |
|
| 229 | - $size = unpack("C*", $str); |
|
| 230 | - |
|
| 231 | - return ($size[1] << 8) + $size[2]; |
|
| 232 | - } |
|
| 233 | - |
|
| 234 | - |
|
| 235 | - public function __destruct() |
|
| 236 | - { |
|
| 237 | - $this->close(); |
|
| 238 | - } |
|
| 43 | + public function getSize() |
|
| 44 | + { |
|
| 45 | + $this->strpos = 0; |
|
| 46 | + if ($this->getType()) |
|
| 47 | + { |
|
| 48 | + return array_values($this->parseSize()); |
|
| 49 | + } |
|
| 50 | + |
|
| 51 | + return false; |
|
| 52 | + } |
|
| 53 | + |
|
| 54 | + |
|
| 55 | + public function getType() |
|
| 56 | + { |
|
| 57 | + $this->strpos = 0; |
|
| 58 | + |
|
| 59 | + if (!$this->type) |
|
| 60 | + { |
|
| 61 | + switch ($this->getChars(2)) |
|
| 62 | + { |
|
| 63 | + case "BM": |
|
| 64 | + return $this->type = 'bmp'; |
|
| 65 | + case "GI": |
|
| 66 | + return $this->type = 'gif'; |
|
| 67 | + case chr(0xFF).chr(0xd8): |
|
| 68 | + return $this->type = 'jpeg'; |
|
| 69 | + case chr(0x89).'P': |
|
| 70 | + return $this->type = 'png'; |
|
| 71 | + default: |
|
| 72 | + return false; |
|
| 73 | + } |
|
| 74 | + } |
|
| 75 | + |
|
| 76 | + return $this->type; |
|
| 77 | + } |
|
| 78 | + |
|
| 79 | + |
|
| 80 | + private function parseSize() |
|
| 81 | + { |
|
| 82 | + $this->strpos = 0; |
|
| 83 | + |
|
| 84 | + switch ($this->type) |
|
| 85 | + { |
|
| 86 | + case 'png': |
|
| 87 | + return $this->parseSizeForPNG(); |
|
| 88 | + case 'gif': |
|
| 89 | + return $this->parseSizeForGIF(); |
|
| 90 | + case 'bmp': |
|
| 91 | + return $this->parseSizeForBMP(); |
|
| 92 | + case 'jpeg': |
|
| 93 | + return $this->parseSizeForJPEG(); |
|
| 94 | + } |
|
| 95 | + |
|
| 96 | + return null; |
|
| 97 | + } |
|
| 98 | + |
|
| 99 | + |
|
| 100 | + private function parseSizeForPNG() |
|
| 101 | + { |
|
| 102 | + $chars = $this->getChars(25); |
|
| 103 | + |
|
| 104 | + return unpack("N*", substr($chars, 16, 8)); |
|
| 105 | + } |
|
| 106 | + |
|
| 107 | + |
|
| 108 | + private function parseSizeForGIF() |
|
| 109 | + { |
|
| 110 | + $chars = $this->getChars(11); |
|
| 111 | + |
|
| 112 | + return unpack("S*", substr($chars, 6, 4)); |
|
| 113 | + } |
|
| 114 | + |
|
| 115 | + |
|
| 116 | + private function parseSizeForBMP() |
|
| 117 | + { |
|
| 118 | + $chars = $this->getChars(29); |
|
| 119 | + $chars = substr($chars, 14, 14); |
|
| 120 | + $type = unpack('C', $chars); |
|
| 121 | + |
|
| 122 | + return (reset($type) == 40) ? unpack('L*', substr($chars, 4)) : unpack('L*', substr($chars, 4, 8)); |
|
| 123 | + } |
|
| 124 | + |
|
| 125 | + |
|
| 126 | + private function parseSizeForJPEG() |
|
| 127 | + { |
|
| 128 | + $state = null; |
|
| 129 | + |
|
| 130 | + while (true) |
|
| 131 | + { |
|
| 132 | + switch ($state) |
|
| 133 | + { |
|
| 134 | + default: |
|
| 135 | + $this->getChars(2); |
|
| 136 | + $state = 'started'; |
|
| 137 | + break; |
|
| 138 | + |
|
| 139 | + case 'started': |
|
| 140 | + $b = $this->getByte(); |
|
| 141 | + if ($b === false) return false; |
|
| 142 | + |
|
| 143 | + $state = $b == 0xFF ? 'sof' : 'started'; |
|
| 144 | + break; |
|
| 145 | + |
|
| 146 | + case 'sof': |
|
| 147 | + $b = $this->getByte(); |
|
| 148 | + if (in_array($b, range(0xe0, 0xef))) |
|
| 149 | + { |
|
| 150 | + $state = 'skipframe'; |
|
| 151 | + } |
|
| 152 | + elseif (in_array($b, array_merge(range(0xC0,0xC3), range(0xC5,0xC7), range(0xC9,0xCB), range(0xCD,0xCF)))) |
|
| 153 | + { |
|
| 154 | + $state = 'readsize'; |
|
| 155 | + } |
|
| 156 | + elseif ($b == 0xFF) |
|
| 157 | + { |
|
| 158 | + $state = 'sof'; |
|
| 159 | + } |
|
| 160 | + else |
|
| 161 | + { |
|
| 162 | + $state = 'skipframe'; |
|
| 163 | + } |
|
| 164 | + break; |
|
| 165 | + |
|
| 166 | + case 'skipframe': |
|
| 167 | + $skip = $this->readInt($this->getChars(2)) - 2; |
|
| 168 | + $state = 'doskip'; |
|
| 169 | + break; |
|
| 170 | + |
|
| 171 | + case 'doskip': |
|
| 172 | + $this->getChars($skip); |
|
| 173 | + $state = 'started'; |
|
| 174 | + break; |
|
| 175 | + |
|
| 176 | + case 'readsize': |
|
| 177 | + $c = $this->getChars(7); |
|
| 178 | + |
|
| 179 | + return array($this->readInt(substr($c, 5, 2)), $this->readInt(substr($c, 3, 2))); |
|
| 180 | + } |
|
| 181 | + } |
|
| 182 | + } |
|
| 183 | + |
|
| 184 | + |
|
| 185 | + private function getChars($n) |
|
| 186 | + { |
|
| 187 | + $response = null; |
|
| 188 | + |
|
| 189 | + // do we need more data? |
|
| 190 | + if ($this->strpos + $n -1 >= strlen($this->str)) |
|
| 191 | + { |
|
| 192 | + $end = ($this->strpos + $n); |
|
| 193 | + |
|
| 194 | + while (strlen($this->str) < $end && $response !== false) |
|
| 195 | + { |
|
| 196 | + // read more from the file handle |
|
| 197 | + $need = $end - ftell($this->handle); |
|
| 198 | + |
|
| 199 | + if ($response = fread($this->handle, $need)) |
|
| 200 | + { |
|
| 201 | + $this->str .= $response; |
|
| 202 | + } |
|
| 203 | + else |
|
| 204 | + { |
|
| 205 | + return false; |
|
| 206 | + } |
|
| 207 | + } |
|
| 208 | + } |
|
| 209 | + |
|
| 210 | + $result = substr($this->str, $this->strpos, $n); |
|
| 211 | + $this->strpos += $n; |
|
| 212 | + |
|
| 213 | + // we are dealing with bytes here, so force the encoding |
|
| 214 | + return mb_convert_encoding($result, "8BIT"); |
|
| 215 | + } |
|
| 216 | + |
|
| 217 | + |
|
| 218 | + private function getByte() |
|
| 219 | + { |
|
| 220 | + $c = $this->getChars(1); |
|
| 221 | + $b = unpack("C", $c); |
|
| 222 | + |
|
| 223 | + return reset($b); |
|
| 224 | + } |
|
| 225 | + |
|
| 226 | + |
|
| 227 | + private function readInt($str) |
|
| 228 | + { |
|
| 229 | + $size = unpack("C*", $str); |
|
| 230 | + |
|
| 231 | + return ($size[1] << 8) + $size[2]; |
|
| 232 | + } |
|
| 233 | + |
|
| 234 | + |
|
| 235 | + public function __destruct() |
|
| 236 | + { |
|
| 237 | + $this->close(); |
|
| 238 | + } |
|
| 239 | 239 | } |
@@ -1,9 +1,9 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
| 3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
|
| 3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
|
| 4 | 4 | } |
| 5 | 5 | if(!$modx->hasPermission('view_eventlog')) {
|
| 6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 7 | 7 | } |
| 8 | 8 | ?> |
| 9 | 9 | <script type="text/javascript" src="media/script/tablesort.js"></script> |
@@ -17,14 +17,14 @@ discard block |
||
| 17 | 17 | <div class="form-group" id="lyr1"> |
| 18 | 18 | <b><?= $_lang["publish_events"] ?></b> |
| 19 | 19 | <?php |
| 20 | - $rs = $modx->db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC');
|
|
| 21 | - $limit = $modx->db->getRecordCount($rs); |
|
| 22 | - if($limit < 1) {
|
|
| 23 | - ?> |
|
| 20 | + $rs = $modx->db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC');
|
|
| 21 | + $limit = $modx->db->getRecordCount($rs); |
|
| 22 | + if($limit < 1) {
|
|
| 23 | + ?> |
|
| 24 | 24 | <p><?= $_lang["no_docs_pending_publishing"] ?></p> |
| 25 | 25 | <?php |
| 26 | - } else {
|
|
| 27 | - ?> |
|
| 26 | + } else {
|
|
| 27 | + ?> |
|
| 28 | 28 | <div class="table-responsive"> |
| 29 | 29 | <table class="grid sortabletable" id="table-1"> |
| 30 | 30 | <thead> |
@@ -36,34 +36,34 @@ discard block |
||
| 36 | 36 | </thead> |
| 37 | 37 | <tbody> |
| 38 | 38 | <?php |
| 39 | - while($row = $modx->db->getRow($rs)) {
|
|
| 40 | - ?> |
|
| 39 | + while($row = $modx->db->getRow($rs)) {
|
|
| 40 | + ?> |
|
| 41 | 41 | <tr> |
| 42 | 42 | <td class="text-right"><?= $row['id'] ?></td> |
| 43 | 43 | <td><a href="index.php?a=3&id=<?= $row['id'] ?>"><?= $row['pagetitle'] ?></a></td> |
| 44 | 44 | <td class="text-nowrap text-right"><?= $modx->toDateFormat($row['pub_date'] + $server_offset_time) ?></td> |
| 45 | 45 | </tr> |
| 46 | 46 | <?php |
| 47 | - } |
|
| 48 | - ?> |
|
| 47 | + } |
|
| 48 | + ?> |
|
| 49 | 49 | </tbody> |
| 50 | 50 | </table> |
| 51 | 51 | </div> |
| 52 | 52 | <?php |
| 53 | - } |
|
| 54 | - ?> |
|
| 53 | + } |
|
| 54 | + ?> |
|
| 55 | 55 | </div> |
| 56 | 56 | <div class="form-group" id="lyr2"> |
| 57 | 57 | <b><?= $_lang["unpublish_events"] ?></b> |
| 58 | 58 | <?php |
| 59 | - $rs = $modx->db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC');
|
|
| 60 | - $limit = $modx->db->getRecordCount($rs); |
|
| 61 | - if($limit < 1) {
|
|
| 62 | - ?> |
|
| 59 | + $rs = $modx->db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC');
|
|
| 60 | + $limit = $modx->db->getRecordCount($rs); |
|
| 61 | + if($limit < 1) {
|
|
| 62 | + ?> |
|
| 63 | 63 | <p><?= $_lang["no_docs_pending_unpublishing"] ?></p> |
| 64 | 64 | <?php |
| 65 | - } else {
|
|
| 66 | - ?> |
|
| 65 | + } else {
|
|
| 66 | + ?> |
|
| 67 | 67 | <div class="table-responsive"> |
| 68 | 68 | <table class="grid sortabletable" id="table-2"> |
| 69 | 69 | <thead> |
@@ -75,34 +75,34 @@ discard block |
||
| 75 | 75 | </thead> |
| 76 | 76 | <tbody> |
| 77 | 77 | <?php |
| 78 | - while($row = $modx->db->getRow($rs)) {
|
|
| 79 | - ?> |
|
| 78 | + while($row = $modx->db->getRow($rs)) {
|
|
| 79 | + ?> |
|
| 80 | 80 | <tr> |
| 81 | 81 | <td class="text-right"><?= $row['id'] ?></td> |
| 82 | 82 | <td><a href="index.php?a=3&id=<?= $row['id'] ?>"><?= $row['pagetitle'] ?></a></td> |
| 83 | 83 | <td class="text-nowrap text-right"><?= $modx->toDateFormat($row['unpub_date'] + $server_offset_time) ?></td> |
| 84 | 84 | </tr> |
| 85 | 85 | <?php |
| 86 | - } |
|
| 87 | - ?> |
|
| 86 | + } |
|
| 87 | + ?> |
|
| 88 | 88 | </tbody> |
| 89 | 89 | </table> |
| 90 | 90 | </div> |
| 91 | 91 | <?php |
| 92 | - } |
|
| 93 | - ?> |
|
| 92 | + } |
|
| 93 | + ?> |
|
| 94 | 94 | </div> |
| 95 | 95 | <div class="form-group"> |
| 96 | 96 | <b><?= $_lang["all_events"] ?></b> |
| 97 | 97 | <?php |
| 98 | - $rs = $modx->db->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC");
|
|
| 99 | - $limit = $modx->db->getRecordCount($rs); |
|
| 100 | - if($limit < 1) {
|
|
| 101 | - ?> |
|
| 98 | + $rs = $modx->db->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC");
|
|
| 99 | + $limit = $modx->db->getRecordCount($rs); |
|
| 100 | + if($limit < 1) {
|
|
| 101 | + ?> |
|
| 102 | 102 | <p><?= $_lang["no_docs_pending_pubunpub"] ?></p> |
| 103 | 103 | <?php |
| 104 | - } else {
|
|
| 105 | - ?> |
|
| 104 | + } else {
|
|
| 105 | + ?> |
|
| 106 | 106 | <div class="table-responsive"> |
| 107 | 107 | <table class="grid sortabletable" id="table-3"> |
| 108 | 108 | <thead> |
@@ -115,8 +115,8 @@ discard block |
||
| 115 | 115 | </thead> |
| 116 | 116 | <tbody> |
| 117 | 117 | <?php |
| 118 | - while($row = $modx->db->getRow($rs)) {
|
|
| 119 | - ?> |
|
| 118 | + while($row = $modx->db->getRow($rs)) {
|
|
| 119 | + ?> |
|
| 120 | 120 | <tr> |
| 121 | 121 | <td class="text-right"><?= $row['id'] ?></td> |
| 122 | 122 | <td><a href="index.php?a=3&id=<?= $row['id'] ?>"><?= $row['pagetitle'] ?></a></td> |
@@ -124,14 +124,14 @@ discard block |
||
| 124 | 124 | <td class="text-nowrap text-right"><?= $row['unpub_date'] == 0 ? "" : $modx->toDateFormat($row['unpub_date'] + $server_offset_time) ?></td> |
| 125 | 125 | </tr> |
| 126 | 126 | <?php |
| 127 | - } |
|
| 128 | - ?> |
|
| 127 | + } |
|
| 128 | + ?> |
|
| 129 | 129 | </tbody> |
| 130 | 130 | </table> |
| 131 | 131 | </div> |
| 132 | 132 | <?php |
| 133 | - } |
|
| 134 | - ?> |
|
| 133 | + } |
|
| 134 | + ?> |
|
| 135 | 135 | </div> |
| 136 | 136 | </div> |
| 137 | 137 | </div> |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
| 3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 4 | 4 | } |
| 5 | 5 | |
| 6 | 6 | // (un)publishing of documents, version 2! |
@@ -32,9 +32,9 @@ discard block |
||
| 32 | 32 | <?php if($num_rows_pub) printf('<p>' . $_lang["refresh_published"] . '</p>', $num_rows_pub) ?> |
| 33 | 33 | <?php if($num_rows_unpub) printf('<p>' . $_lang["refresh_unpublished"] . '</p>', $num_rows_unpub) ?> |
| 34 | 34 | <?php |
| 35 | - $modx->clearCache('full', true); |
|
| 36 | - // invoke OnSiteRefresh event |
|
| 37 | - $modx->invokeEvent("OnSiteRefresh"); |
|
| 38 | - ?> |
|
| 35 | + $modx->clearCache('full', true); |
|
| 36 | + // invoke OnSiteRefresh event |
|
| 37 | + $modx->invokeEvent("OnSiteRefresh"); |
|
| 38 | + ?> |
|
| 39 | 39 | </div> |
| 40 | 40 | </div> |
@@ -1,6 +1,6 @@ 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 | $helpBasePath = "actions/help/"; |
| 6 | 6 | ?> |
@@ -16,36 +16,36 @@ discard block |
||
| 16 | 16 | </script> |
| 17 | 17 | |
| 18 | 18 | <?php |
| 19 | - if($handle = opendir('actions/help')) {
|
|
| 20 | - while(false !== ($file = readdir($handle))) {
|
|
| 21 | - if($file != "." && $file != ".." && $file != ".svn" && $file != 'index.html' && !is_dir($helpBasePath . $file)) {
|
|
| 22 | - $help[] = $file; |
|
| 23 | - } |
|
| 24 | - } |
|
| 25 | - closedir($handle); |
|
| 26 | - } |
|
| 27 | - |
|
| 28 | - natcasesort($help); |
|
| 29 | - |
|
| 30 | - foreach($help as $k => $v) {
|
|
| 31 | - |
|
| 32 | - $helpname = substr($v, 0, strrpos($v, '.')); |
|
| 33 | - |
|
| 34 | - $prefix = substr($helpname, 0, 2); |
|
| 35 | - if(is_numeric($prefix)) {
|
|
| 36 | - $helpname = substr($helpname, 2, strlen($helpname) - 1); |
|
| 37 | - } |
|
| 38 | - |
|
| 39 | - $hnLower = strtolower($helpname); |
|
| 40 | - $helpname = isset($_lang[$hnLower]) ? $_lang[$hnLower] : str_replace('_', ' ', $helpname);
|
|
| 41 | - |
|
| 42 | - echo '<div class="tab-page" id="tab' . $k . 'Help">'; |
|
| 43 | - echo '<h2 class="tab">' . $helpname . '</h2>'; |
|
| 44 | - echo '<script type="text/javascript">tp.addTabPage( document.getElementById( "tab' . $k . 'Help" ) );</script>'; |
|
| 45 | - include_once($helpBasePath . "{$v}");
|
|
| 46 | - echo '</div>'; |
|
| 47 | - } |
|
| 48 | - ?> |
|
| 19 | + if($handle = opendir('actions/help')) {
|
|
| 20 | + while(false !== ($file = readdir($handle))) {
|
|
| 21 | + if($file != "." && $file != ".." && $file != ".svn" && $file != 'index.html' && !is_dir($helpBasePath . $file)) {
|
|
| 22 | + $help[] = $file; |
|
| 23 | + } |
|
| 24 | + } |
|
| 25 | + closedir($handle); |
|
| 26 | + } |
|
| 27 | + |
|
| 28 | + natcasesort($help); |
|
| 29 | + |
|
| 30 | + foreach($help as $k => $v) {
|
|
| 31 | + |
|
| 32 | + $helpname = substr($v, 0, strrpos($v, '.')); |
|
| 33 | + |
|
| 34 | + $prefix = substr($helpname, 0, 2); |
|
| 35 | + if(is_numeric($prefix)) {
|
|
| 36 | + $helpname = substr($helpname, 2, strlen($helpname) - 1); |
|
| 37 | + } |
|
| 38 | + |
|
| 39 | + $hnLower = strtolower($helpname); |
|
| 40 | + $helpname = isset($_lang[$hnLower]) ? $_lang[$hnLower] : str_replace('_', ' ', $helpname);
|
|
| 41 | + |
|
| 42 | + echo '<div class="tab-page" id="tab' . $k . 'Help">'; |
|
| 43 | + echo '<h2 class="tab">' . $helpname . '</h2>'; |
|
| 44 | + echo '<script type="text/javascript">tp.addTabPage( document.getElementById( "tab' . $k . 'Help" ) );</script>'; |
|
| 45 | + include_once($helpBasePath . "{$v}");
|
|
| 46 | + echo '</div>'; |
|
| 47 | + } |
|
| 48 | + ?> |
|
| 49 | 49 | </div> |
| 50 | 50 | </div> |
| 51 | 51 | <script> |
@@ -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->manager->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->manager->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']) ? intval($_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->db->select('*', $tbl_site_tmplvars, "id='{$id}'"); |
|
| 34 | - $content = $modx->db->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->db->select('*', $tbl_site_tmplvars, "id='{$id}'"); |
|
| 34 | + $content = $modx->db->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'] = intval($_REQUEST['catid']); |
|
| 46 | + $_SESSION['itemname'] = $_lang["new_tmplvars"]; |
|
| 47 | + $content['category'] = intval($_REQUEST['catid']); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | if($modx->manager->hasFormValues()) { |
| 51 | - $modx->manager->loadFormValues(); |
|
| 51 | + $modx->manager->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->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->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->db->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->db->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->db->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->manager->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>(' . join(', ', $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->db->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->manager->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>(' . join(', ', $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->db->select('documentgroup', $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); |
|
| 512 | - $groupsarray = $modx->db->getColumn('documentgroup', $rs); |
|
| 509 | + if($use_udperms == 1) { |
|
| 510 | + // fetch permissions for the variable |
|
| 511 | + $rs = $modx->db->select('documentgroup', $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); |
|
| 512 | + $groupsarray = $modx->db->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->db->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->db->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->db->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->db->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> |