@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | -if(!function_exists('duplicateDocument')) { |
|
| 39 | +if (!function_exists('duplicateDocument')) { |
|
| 40 | 40 | /** |
| 41 | 41 | * @param int $docid |
| 42 | 42 | * @param null|int $parent |
@@ -90,12 +90,12 @@ discard block |
||
| 90 | 90 | $count = $modx->db->getRecordCount($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), |
| 91 | 91 | "pagetitle LIKE '{$pagetitle} Duplicate%'")); |
| 92 | 92 | if ($count >= 1) { |
| 93 | - $count = ' ' . ($count + 1); |
|
| 93 | + $count = ' '.($count + 1); |
|
| 94 | 94 | } else { |
| 95 | 95 | $count = ''; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - $content['pagetitle'] = $_lang['duplicated_el_suffix'] . $count . ' ' . $content['pagetitle']; |
|
| 98 | + $content['pagetitle'] = $_lang['duplicated_el_suffix'].$count.' '.$content['pagetitle']; |
|
| 99 | 99 | $content['alias'] = null; |
| 100 | 100 | } elseif ($modx->config['friendly_urls'] == 0 || $modx->config['allow_duplicate_alias'] == 0) { |
| 101 | 101 | $content['alias'] = null; |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | } |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | -if(!function_exists('duplicateTVs')) { |
|
| 156 | +if (!function_exists('duplicateTVs')) { |
|
| 157 | 157 | /** |
| 158 | 158 | * Duplicate Document TVs |
| 159 | 159 | * |
@@ -166,8 +166,8 @@ discard block |
||
| 166 | 166 | |
| 167 | 167 | $tbltvc = $modx->getFullTableName('site_tmplvar_contentvalues'); |
| 168 | 168 | |
| 169 | - $newid = (int)$newid; |
|
| 170 | - $oldid = (int)$oldid; |
|
| 169 | + $newid = (int) $newid; |
|
| 170 | + $oldid = (int) $oldid; |
|
| 171 | 171 | |
| 172 | 172 | $modx->db->insert( |
| 173 | 173 | array('contentid' => '', 'tmplvarid' => '', 'value' => ''), $tbltvc, // Insert into |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | -if(!function_exists('duplicateAccess')) { |
|
| 179 | +if (!function_exists('duplicateAccess')) { |
|
| 180 | 180 | /** |
| 181 | 181 | * Duplicate Document Access Permissions |
| 182 | 182 | * |
@@ -189,8 +189,8 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | $tbldg = $modx->getFullTableName('document_groups'); |
| 191 | 191 | |
| 192 | - $newid = (int)$newid; |
|
| 193 | - $oldid = (int)$oldid; |
|
| 192 | + $newid = (int) $newid; |
|
| 193 | + $oldid = (int) $oldid; |
|
| 194 | 194 | |
| 195 | 195 | $modx->db->insert( |
| 196 | 196 | array('document' => '', 'document_group' => ''), $tbldg, // Insert into |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | } |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | -if(!function_exists('evalModule')) { |
|
| 202 | +if (!function_exists('evalModule')) { |
|
| 203 | 203 | /** |
| 204 | 204 | * evalModule |
| 205 | 205 | * |
@@ -235,17 +235,17 @@ discard block |
||
| 235 | 235 | } |
| 236 | 236 | if ($modx->config['error_reporting'] === '99' || 2 < $error_level) { |
| 237 | 237 | $modx->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], |
| 238 | - $_SESSION['itemname'] . ' - Module', $error_info['message'], $error_info['line'], $msg); |
|
| 238 | + $_SESSION['itemname'].' - Module', $error_info['message'], $error_info['line'], $msg); |
|
| 239 | 239 | $modx->event->alert("An error occurred while loading. Please see the event log for more information<p>{$msg}</p>"); |
| 240 | 240 | } |
| 241 | 241 | } |
| 242 | 242 | unset($modx->event->params); |
| 243 | 243 | |
| 244 | - return $mod . $msg; |
|
| 244 | + return $mod.$msg; |
|
| 245 | 245 | } |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | -if(!function_exists('allChildren')) { |
|
| 248 | +if (!function_exists('allChildren')) { |
|
| 249 | 249 | /** |
| 250 | 250 | * @param int $currDocID |
| 251 | 251 | * @return array |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | } |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | -if(!function_exists('jsAlert')) { |
|
| 268 | +if (!function_exists('jsAlert')) { |
|
| 269 | 269 | /** |
| 270 | 270 | * show javascript alert |
| 271 | 271 | * |
@@ -275,14 +275,14 @@ discard block |
||
| 275 | 275 | { |
| 276 | 276 | $modx = evolutionCMS(); |
| 277 | 277 | if ($_POST['ajax'] != 1) { |
| 278 | - echo "<script>window.setTimeout(\"alert('" . addslashes($modx->db->escape($msg)) . "')\",10);history.go(-1)</script>"; |
|
| 278 | + echo "<script>window.setTimeout(\"alert('".addslashes($modx->db->escape($msg))."')\",10);history.go(-1)</script>"; |
|
| 279 | 279 | } else { |
| 280 | - echo $msg . "\n"; |
|
| 280 | + echo $msg."\n"; |
|
| 281 | 281 | } |
| 282 | 282 | } |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | -if(!function_exists('login')) { |
|
| 285 | +if (!function_exists('login')) { |
|
| 286 | 286 | /** |
| 287 | 287 | * @param string $username |
| 288 | 288 | * @param string $givenPassword |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | } |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | -if(!function_exists('loginV1')) { |
|
| 300 | +if (!function_exists('loginV1')) { |
|
| 301 | 301 | /** |
| 302 | 302 | * @param int $internalKey |
| 303 | 303 | * @param string $givenPassword |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | } |
| 331 | 331 | } |
| 332 | 332 | |
| 333 | -if(!function_exists('loginMD5')) { |
|
| 333 | +if (!function_exists('loginMD5')) { |
|
| 334 | 334 | /** |
| 335 | 335 | * @param int $internalKey |
| 336 | 336 | * @param string $givenPassword |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | } |
| 352 | 352 | } |
| 353 | 353 | |
| 354 | -if(!function_exists('updateNewHash')) { |
|
| 354 | +if (!function_exists('updateNewHash')) { |
|
| 355 | 355 | /** |
| 356 | 356 | * @param string $username |
| 357 | 357 | * @param string $password |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | } |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | -if(!function_exists('incrementFailedLoginCount')) { |
|
| 369 | +if (!function_exists('incrementFailedLoginCount')) { |
|
| 370 | 370 | /** |
| 371 | 371 | * @param int $internalKey |
| 372 | 372 | * @param int $failedlogins |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | |
| 390 | 390 | if ($failedlogins < $failed_allowed) { |
| 391 | 391 | //sleep to help prevent brute force attacks |
| 392 | - $sleep = (int)$failedlogins / 2; |
|
| 392 | + $sleep = (int) $failedlogins / 2; |
|
| 393 | 393 | if ($sleep > 5) { |
| 394 | 394 | $sleep = 5; |
| 395 | 395 | } |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | } |
| 403 | 403 | } |
| 404 | 404 | |
| 405 | -if (! function_exists('rmdirRecursive')) { |
|
| 405 | +if (!function_exists('rmdirRecursive')) { |
|
| 406 | 406 | /** |
| 407 | 407 | * rmdirRecursive - detects symbollic links on unix |
| 408 | 408 | * |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | } |
| 427 | 427 | } |
| 428 | 428 | |
| 429 | -if(!function_exists('saveUserGroupAccessPermissons')) { |
|
| 429 | +if (!function_exists('saveUserGroupAccessPermissons')) { |
|
| 430 | 430 | /** |
| 431 | 431 | * saves module user group access |
| 432 | 432 | */ |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | } |
| 458 | 458 | } |
| 459 | 459 | |
| 460 | -if(!function_exists('saveEventListeners')) { |
|
| 460 | +if (!function_exists('saveEventListeners')) { |
|
| 461 | 461 | # Save Plugin Event Listeners |
| 462 | 462 | function saveEventListeners($id, $sysevents, $mode) |
| 463 | 463 | { |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | } |
| 511 | 511 | } |
| 512 | 512 | |
| 513 | -if(!function_exists('getEventIdByName')) { |
|
| 513 | +if (!function_exists('getEventIdByName')) { |
|
| 514 | 514 | /** |
| 515 | 515 | * @param string $name |
| 516 | 516 | * @return string|int |
@@ -533,7 +533,7 @@ discard block |
||
| 533 | 533 | } |
| 534 | 534 | } |
| 535 | 535 | |
| 536 | -if(!function_exists('saveTemplateAccess')) { |
|
| 536 | +if (!function_exists('saveTemplateAccess')) { |
|
| 537 | 537 | /** |
| 538 | 538 | * @param int $id |
| 539 | 539 | */ |
@@ -572,7 +572,7 @@ discard block |
||
| 572 | 572 | } |
| 573 | 573 | } |
| 574 | 574 | |
| 575 | -if(!function_exists('saveTemplateVarAccess')) { |
|
| 575 | +if (!function_exists('saveTemplateVarAccess')) { |
|
| 576 | 576 | /** |
| 577 | 577 | * @return void |
| 578 | 578 | */ |
@@ -611,7 +611,7 @@ discard block |
||
| 611 | 611 | } |
| 612 | 612 | } |
| 613 | 613 | |
| 614 | -if(!function_exists('saveDocumentAccessPermissons')) { |
|
| 614 | +if (!function_exists('saveDocumentAccessPermissons')) { |
|
| 615 | 615 | function saveDocumentAccessPermissons() |
| 616 | 616 | { |
| 617 | 617 | global $id, $newid; |
@@ -780,10 +780,10 @@ discard block |
||
| 780 | 780 | } |
| 781 | 781 | |
| 782 | 782 | foreach ($defaults as $k) { |
| 783 | - if (isset($settings['default_' . $k]) && $settings['default_' . $k] == '1') { |
|
| 783 | + if (isset($settings['default_'.$k]) && $settings['default_'.$k] == '1') { |
|
| 784 | 784 | unset($settings[$k]); |
| 785 | 785 | } |
| 786 | - unset($settings['default_' . $k]); |
|
| 786 | + unset($settings['default_'.$k]); |
|
| 787 | 787 | } |
| 788 | 788 | |
| 789 | 789 | $modx->db->delete($tbl_user_settings, "user='{$id}'"); |
@@ -815,7 +815,7 @@ discard block |
||
| 815 | 815 | global $id, $modx; |
| 816 | 816 | $mode = $_POST['mode']; |
| 817 | 817 | $modx->manager->saveFormValues($mode); |
| 818 | - $modx->webAlertAndQuit($msg, "index.php?a={$mode}" . ($mode === $action ? "&id={$id}" : '')); |
|
| 818 | + $modx->webAlertAndQuit($msg, "index.php?a={$mode}".($mode === $action ? "&id={$id}" : '')); |
|
| 819 | 819 | } |
| 820 | 820 | } |
| 821 | 821 | |
@@ -831,7 +831,7 @@ discard block |
||
| 831 | 831 | global $deltime; |
| 832 | 832 | |
| 833 | 833 | $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), |
| 834 | - "parent='" . (int)$parent . "' AND deleted=1 AND deletedon='" . (int)$deltime . "'"); |
|
| 834 | + "parent='".(int) $parent."' AND deleted=1 AND deletedon='".(int) $deltime."'"); |
|
| 835 | 835 | // the document has children documents, we'll need to delete those too |
| 836 | 836 | while ($row = $modx->db->getRow($rs)) { |
| 837 | 837 | $children[] = $row['id']; |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if(!function_exists('createGUID')) { |
|
| 3 | +if (!function_exists('createGUID')) { |
|
| 4 | 4 | /** |
| 5 | 5 | * create globally unique identifiers (guid) |
| 6 | 6 | * |
@@ -8,22 +8,22 @@ discard block |
||
| 8 | 8 | */ |
| 9 | 9 | function createGUID() |
| 10 | 10 | { |
| 11 | - srand((double)microtime() * 1000000); |
|
| 11 | + srand((double) microtime() * 1000000); |
|
| 12 | 12 | $r = rand(); |
| 13 | - $u = uniqid(getmypid() . $r . (double)microtime() * 1000000, 1); |
|
| 13 | + $u = uniqid(getmypid().$r.(double) microtime() * 1000000, 1); |
|
| 14 | 14 | $m = md5($u); |
| 15 | 15 | |
| 16 | 16 | return $m; |
| 17 | 17 | } |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | -if(!function_exists('generate_password')) { |
|
| 20 | +if (!function_exists('generate_password')) { |
|
| 21 | 21 | // Generate password |
| 22 | 22 | function generate_password($length = 10) |
| 23 | 23 | { |
| 24 | 24 | $allowable_characters = "abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"; |
| 25 | 25 | $ps_len = strlen($allowable_characters); |
| 26 | - mt_srand((double)microtime() * 1000000); |
|
| 26 | + mt_srand((double) microtime() * 1000000); |
|
| 27 | 27 | $pass = ""; |
| 28 | 28 | for ($i = 0; $i < $length; $i++) { |
| 29 | 29 | $pass .= $allowable_characters[mt_rand(0, $ps_len - 1)]; |
@@ -1,3 +1,3 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -include_once MODX_BASE_PATH . 'functions/tv.php'; |
|
| 3 | +include_once MODX_BASE_PATH.'functions/tv.php'; |
|