@@ -8,19 +8,19 @@ discard block |
||
| 8 | 8 | * Version: 1.1 |
| 9 | 9 | * MODX version: 1.0.3 |
| 10 | 10 | */ |
| 11 | -$style_path = 'media/style/' . $modx->config['manager_theme'] . '/images/'; |
|
| 11 | +$style_path = 'media/style/'.$modx->config['manager_theme'].'/images/'; |
|
| 12 | 12 | $modx->config['mgr_date_picker_path'] = 'media/calendar/datepicker.inc.php'; |
| 13 | -if(!$modx->config['lang_code']) {
|
|
| 13 | +if (!$modx->config['lang_code']) {
|
|
| 14 | 14 | global $modx_lang_attribute; |
| 15 | 15 | $modx->config['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute; |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | -if($_GET['a'] == 2) {
|
|
| 18 | +if ($_GET['a'] == 2) {
|
|
| 19 | 19 | include_once('welcome.php');
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | // Favicon |
| 23 | -$_style['favicon'] = (file_exists(MODX_BASE_PATH . 'favicon.ico') ? MODX_SITE_URL . 'favicon.ico' : 'media/style/' . $modx->config['manager_theme'] . '/images/favicon.ico'); |
|
| 23 | +$_style['favicon'] = (file_exists(MODX_BASE_PATH.'favicon.ico') ? MODX_SITE_URL . 'favicon.ico' : 'media/style/'.$modx->config['manager_theme'].'/images/favicon.ico'); |
|
| 24 | 24 | |
| 25 | 25 | //Main Menu |
| 26 | 26 | $_style['menu_search'] = '<i class="fa fa-search"></i>'; |
@@ -99,10 +99,10 @@ discard block |
||
| 99 | 99 | $_style['tree_page_word'] = "<i class='fa fa-file-word-o'></i>"; |
| 100 | 100 | $_style['tree_page_excel'] = "<i class='fa fa-file-excel-o'></i>"; |
| 101 | 101 | |
| 102 | -$_style['tree_minusnode'] = "<i class='fa fa-angle-down'></i>";//$style_path.'tree/angle-down.png'; |
|
| 103 | -$_style['tree_plusnode'] = "<i class='fa fa-angle-right'></i>";//$style_path.'tree/angle-right.png'; |
|
| 102 | +$_style['tree_minusnode'] = "<i class='fa fa-angle-down'></i>"; //$style_path.'tree/angle-down.png'; |
|
| 103 | +$_style['tree_plusnode'] = "<i class='fa fa-angle-right'></i>"; //$style_path.'tree/angle-right.png'; |
|
| 104 | 104 | $_style['tree_weblink'] = $style_path.'tree/link.png'; |
| 105 | -$_style['tree_preview_resource'] = "<i class='fa fa-eye'></i>";//$style_path.'icons/eye.png'; |
|
| 105 | +$_style['tree_preview_resource'] = "<i class='fa fa-eye'></i>"; //$style_path.'icons/eye.png'; |
|
| 106 | 106 | |
| 107 | 107 | $_style['tree_showtree'] = '<i class="fa fa-sitemap"></i>'; |
| 108 | 108 | $_style['tree_working'] = '<i class="fa fa-warning"></i>'; |
@@ -137,8 +137,8 @@ discard block |
||
| 137 | 137 | $_style['icons_edit_document'] = $style_path.'icons/save.png'; |
| 138 | 138 | $_style['icons_delete_document'] = $style_path.'icons/trash.png'; |
| 139 | 139 | //locks |
| 140 | -$_style['icons_preview_resource'] = $style_path.'icons/eye.png';//$style_path.'icons/eye.png'; |
|
| 141 | -$_style['icons_secured'] = "<i class='fa fa-lock'></i>";//$style_path.'icons/lock.png'; |
|
| 140 | +$_style['icons_preview_resource'] = $style_path.'icons/eye.png'; //$style_path.'icons/eye.png'; |
|
| 141 | +$_style['icons_secured'] = "<i class='fa fa-lock'></i>"; //$style_path.'icons/lock.png'; |
|
| 142 | 142 | |
| 143 | 143 | //file manager icons |
| 144 | 144 | $_style['files_save'] = 'fa fa-floppy-o'; |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | $_style['icons_set_parent'] = $style_path.'icons/folder-open.png'; |
| 214 | 214 | |
| 215 | 215 | //modules |
| 216 | -$_style['icons_module'] = 'fa fa-cube'; |
|
| 216 | +$_style['icons_module'] = 'fa fa-cube'; |
|
| 217 | 217 | $_style['icons_modules'] = 'fa fa-cubes'; //$style_path.'icons/modules.png'; |
| 218 | 218 | $_style['icons_run'] = $style_path.'icons/play.png'; |
| 219 | 219 | |
@@ -273,57 +273,57 @@ discard block |
||
| 273 | 273 | $stay = isset($_REQUEST['stay']) ? $_REQUEST['stay'] : ''; |
| 274 | 274 | $addnew = 0; |
| 275 | 275 | $run = 0; |
| 276 | -switch($action) {
|
|
| 276 | +switch ($action) {
|
|
| 277 | 277 | case '3': |
| 278 | 278 | case '4': |
| 279 | 279 | case '27': |
| 280 | 280 | case '72': |
| 281 | - if($modx->hasPermission('new_document')) {
|
|
| 281 | + if ($modx->hasPermission('new_document')) {
|
|
| 282 | 282 | $addnew = 1; |
| 283 | 283 | } |
| 284 | 284 | break; |
| 285 | 285 | case '16': |
| 286 | 286 | case '19': |
| 287 | - if($modx->hasPermission('new_template')) {
|
|
| 287 | + if ($modx->hasPermission('new_template')) {
|
|
| 288 | 288 | $addnew = 1; |
| 289 | 289 | } |
| 290 | 290 | break; |
| 291 | 291 | case '300': |
| 292 | 292 | case '301': |
| 293 | - if($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) {
|
|
| 293 | + if ($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) {
|
|
| 294 | 294 | $addnew = 1; |
| 295 | 295 | } |
| 296 | 296 | break; |
| 297 | 297 | case '77': |
| 298 | 298 | case '78': |
| 299 | - if($modx->hasPermission('new_chunk')) {
|
|
| 299 | + if ($modx->hasPermission('new_chunk')) {
|
|
| 300 | 300 | $addnew = 1; |
| 301 | 301 | } |
| 302 | 302 | break; |
| 303 | 303 | case '22': |
| 304 | 304 | case '23': |
| 305 | - if($modx->hasPermission('new_snippet')) {
|
|
| 305 | + if ($modx->hasPermission('new_snippet')) {
|
|
| 306 | 306 | $addnew = 1; |
| 307 | 307 | } |
| 308 | 308 | break; |
| 309 | 309 | case '101': |
| 310 | 310 | case '102': |
| 311 | - if($modx->hasPermission('new_plugin')) {
|
|
| 311 | + if ($modx->hasPermission('new_plugin')) {
|
|
| 312 | 312 | $addnew = 1; |
| 313 | 313 | } |
| 314 | 314 | break; |
| 315 | 315 | case '106': |
| 316 | 316 | case '107': |
| 317 | 317 | case '108': |
| 318 | - if($modx->hasPermission('new_module')) {
|
|
| 318 | + if ($modx->hasPermission('new_module')) {
|
|
| 319 | 319 | $addnew = 1; |
| 320 | 320 | } |
| 321 | - if($modx->hasPermission('exec_module')) {
|
|
| 321 | + if ($modx->hasPermission('exec_module')) {
|
|
| 322 | 322 | $run = 1; |
| 323 | 323 | } |
| 324 | 324 | break; |
| 325 | 325 | case '88': |
| 326 | - if($modx->hasPermission('new_web_user')) {
|
|
| 326 | + if ($modx->hasPermission('new_web_user')) {
|
|
| 327 | 327 | $addnew = 1; |
| 328 | 328 | } |
| 329 | 329 | break; |
@@ -337,30 +337,30 @@ discard block |
||
| 337 | 337 | <div class="btn-group"> |
| 338 | 338 | <div class="btn-group"> |
| 339 | 339 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
| 340 | - <i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span> |
|
| 340 | + <i class="' . $_style["actions_save"].'"></i><span>'.$_lang['save'].'</span> |
|
| 341 | 341 | </a> |
| 342 | 342 | <span class="btn btn-success plus dropdown-toggle"></span> |
| 343 | 343 | <select id="stay" name="stay"> |
| 344 | 344 | ' . ($addnew ? ' |
| 345 | - <option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '') . '>' . $_lang['stay_new'] . '</option> |
|
| 346 | - ' : '') . ' |
|
| 347 | - <option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '') . '>' . $_lang['stay'] . '</option> |
|
| 348 | - <option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '') . '>' . $_lang['close'] . '</option> |
|
| 345 | + <option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '').'>'.$_lang['stay_new'].'</option> |
|
| 346 | + ' : '').' |
|
| 347 | + <option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '').'>'.$_lang['stay'].'</option> |
|
| 348 | + <option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '').'>'.$_lang['close'].'</option> |
|
| 349 | 349 | </select> |
| 350 | 350 | </div>' . |
| 351 | 351 | ($addnew ? ' |
| 352 | - <a id="Button6" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.duplicate();"> |
|
| 353 | - <i class="' . $_style["actions_duplicate"] . '"></i><span>' . $_lang['duplicate'] . '</span> |
|
| 352 | + <a id="Button6" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.duplicate();"> |
|
| 353 | + <i class="' . $_style["actions_duplicate"].'"></i><span>'.$_lang['duplicate'].'</span> |
|
| 354 | 354 | </a> |
| 355 | - ' : '') . ' |
|
| 356 | - <a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();"> |
|
| 357 | - <i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span> |
|
| 355 | + ' : '').' |
|
| 356 | + <a id="Button3" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.delete();"> |
|
| 357 | + <i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span> |
|
| 358 | 358 | </a> |
| 359 | 359 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
| 360 | - <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
|
| 360 | + <i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span> |
|
| 361 | 361 | </a> |
| 362 | 362 | <a id="Button4" class="btn btn-secondary" href="javascript:;" onclick="actions.view();"> |
| 363 | - <i class="' . $_style["actions_preview"] . '"></i><span>' . $_lang['preview'] . '</span> |
|
| 363 | + <i class="' . $_style["actions_preview"].'"></i><span>'.$_lang['preview'].'</span> |
|
| 364 | 364 | </a> |
| 365 | 365 | </div> |
| 366 | 366 | </div>', |
@@ -368,22 +368,22 @@ discard block |
||
| 368 | 368 | <div class="btn-group"> |
| 369 | 369 | <div class="btn-group"> |
| 370 | 370 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
| 371 | - <i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span> |
|
| 371 | + <i class="' . $_style["actions_save"].'"></i><span>'.$_lang['save'].'</span> |
|
| 372 | 372 | </a> |
| 373 | 373 | <span class="btn btn-success plus dropdown-toggle"></span> |
| 374 | 374 | <select id="stay" name="stay"> |
| 375 | 375 | ' . ($addnew ? ' |
| 376 | - <option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '') . '>' . $_lang['stay_new'] . '</option> |
|
| 377 | - ' : '') . ' |
|
| 378 | - <option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '') . '>' . $_lang['stay'] . '</option> |
|
| 379 | - <option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '') . '>' . $_lang['close'] . '</option> |
|
| 376 | + <option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '').'>'.$_lang['stay_new'].'</option> |
|
| 377 | + ' : '').' |
|
| 378 | + <option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '').'>'.$_lang['stay'].'</option> |
|
| 379 | + <option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '').'>'.$_lang['close'].'</option> |
|
| 380 | 380 | </select> |
| 381 | 381 | </div> |
| 382 | - <a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();"> |
|
| 383 | - <i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span> |
|
| 382 | + <a id="Button3" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.delete();"> |
|
| 383 | + <i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span> |
|
| 384 | 384 | </a> |
| 385 | 385 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
| 386 | - <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
|
| 386 | + <i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span> |
|
| 387 | 387 | </a> |
| 388 | 388 | </div> |
| 389 | 389 | </div>', |
@@ -391,86 +391,86 @@ discard block |
||
| 391 | 391 | <div class="btn-group"> |
| 392 | 392 | <div class="btn-group"> |
| 393 | 393 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
| 394 | - <i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span> |
|
| 394 | + <i class="' . $_style["actions_save"].'"></i><span>'.$_lang['save'].'</span> |
|
| 395 | 395 | </a> |
| 396 | 396 | <span class="btn btn-success plus dropdown-toggle"></span> |
| 397 | 397 | <select id="stay" name="stay"> |
| 398 | 398 | ' . ($addnew ? ' |
| 399 | - <option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '') . '>' . $_lang['stay_new'] . '</option> |
|
| 400 | - ' : '') . ' |
|
| 401 | - <option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '') . '>' . $_lang['stay'] . '</option> |
|
| 402 | - <option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '') . '>' . $_lang['close'] . '</option> |
|
| 399 | + <option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '').'>'.$_lang['stay_new'].'</option> |
|
| 400 | + ' : '').' |
|
| 401 | + <option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '').'>'.$_lang['stay'].'</option> |
|
| 402 | + <option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '').'>'.$_lang['close'].'</option> |
|
| 403 | 403 | </select> |
| 404 | 404 | </div> |
| 405 | 405 | ' . ($addnew ? ' |
| 406 | - <a id="Button6" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.duplicate();"> |
|
| 407 | - <i class="' . $_style["actions_duplicate"] . '"></i><span>' . $_lang['duplicate'] . '</span> |
|
| 406 | + <a id="Button6" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.duplicate();"> |
|
| 407 | + <i class="' . $_style["actions_duplicate"].'"></i><span>'.$_lang['duplicate'].'</span> |
|
| 408 | 408 | </a> |
| 409 | - ' : '') . ' |
|
| 410 | - <a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();"> |
|
| 411 | - <i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span> |
|
| 409 | + ' : '').' |
|
| 410 | + <a id="Button3" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.delete();"> |
|
| 411 | + <i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span> |
|
| 412 | 412 | </a> |
| 413 | 413 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
| 414 | - <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
|
| 414 | + <i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span> |
|
| 415 | 415 | </a> |
| 416 | 416 | ' . ($run ? ' |
| 417 | - <a id="Button4" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.run();"> |
|
| 418 | - <i class="' . $_style["actions_run"] . '"></i><span>' . $_lang['run_module'] . '</span> |
|
| 417 | + <a id="Button4" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.run();"> |
|
| 418 | + <i class="' . $_style["actions_run"].'"></i><span>'.$_lang['run_module'].'</span> |
|
| 419 | 419 | </a> |
| 420 | - ' : '') . ' |
|
| 420 | + ' : '').' |
|
| 421 | 421 | </div> |
| 422 | 422 | </div>', |
| 423 | 423 | 'newmodule' => ($addnew ? '<div id="actions"> |
| 424 | 424 | <div class="btn-group"> |
| 425 | 425 | <a id="newModule" class="btn btn-secondary" href="javascript:;" onclick="actions.new();"> |
| 426 | - <i class="' . $_style["actions_new"] . '"></i><span>' . $_lang['new_module'] . '</span> |
|
| 426 | + <i class="' . $_style["actions_new"].'"></i><span>'.$_lang['new_module'].'</span> |
|
| 427 | 427 | </a> |
| 428 | 428 | </div> |
| 429 | 429 | </div>' : ''), |
| 430 | 430 | 'close' => '<div id="actions"> |
| 431 | 431 | <div class="btn-group"> |
| 432 | 432 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.close();"> |
| 433 | - <i class="' . $_style["actions_close"] . '"></i><span>' . $_lang['close'] . '</span> |
|
| 433 | + <i class="' . $_style["actions_close"].'"></i><span>'.$_lang['close'].'</span> |
|
| 434 | 434 | </a> |
| 435 | 435 | </div> |
| 436 | 436 | </div>', |
| 437 | 437 | 'save' => '<div id="actions"> |
| 438 | 438 | <div class="btn-group"> |
| 439 | 439 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
| 440 | - <i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span> |
|
| 440 | + <i class="' . $_style["actions_save"].'"></i><span>'.$_lang['save'].'</span> |
|
| 441 | 441 | </a> |
| 442 | 442 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
| 443 | - <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
|
| 443 | + <i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span> |
|
| 444 | 444 | </a> |
| 445 | 445 | </div> |
| 446 | 446 | </div>', |
| 447 | 447 | 'savedelete' => '<div id="actions"> |
| 448 | 448 | <div class="btn-group"> |
| 449 | 449 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
| 450 | - <i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span> |
|
| 450 | + <i class="' . $_style["actions_save"].'"></i><span>'.$_lang['save'].'</span> |
|
| 451 | 451 | </a> |
| 452 | - <a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();"> |
|
| 453 | - <i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span> |
|
| 452 | + <a id="Button3" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.delete();"> |
|
| 453 | + <i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span> |
|
| 454 | 454 | </a> |
| 455 | 455 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
| 456 | - <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
|
| 456 | + <i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span> |
|
| 457 | 457 | </a> |
| 458 | 458 | </div> |
| 459 | 459 | </div>', |
| 460 | 460 | 'cancel' => '<div id="actions"> |
| 461 | 461 | <div class="btn-group"> |
| 462 | 462 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
| 463 | - <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
|
| 463 | + <i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span> |
|
| 464 | 464 | </a> |
| 465 | 465 | </div> |
| 466 | 466 | </div>', |
| 467 | 467 | 'canceldelete' => '<div id="actions"> |
| 468 | 468 | <div class="btn-group"> |
| 469 | - <a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();"> |
|
| 470 | - <i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span> |
|
| 469 | + <a id="Button3" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.delete();"> |
|
| 470 | + <i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span> |
|
| 471 | 471 | </a> |
| 472 | 472 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
| 473 | - <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
|
| 473 | + <i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span> |
|
| 474 | 474 | </a> |
| 475 | 475 | </div> |
| 476 | 476 | </div>', |
@@ -480,33 +480,33 @@ discard block |
||
| 480 | 480 | <div class="btn-group">' . |
| 481 | 481 | ($addnew ? ' |
| 482 | 482 | <a class="btn btn-secondary" href="javascript:;" onclick="actions.new();"> |
| 483 | - <i class="' . $_style["icons_new_document"] . '"></i><span>' . $_lang['create_resource_here'] . '</span> |
|
| 483 | + <i class="' . $_style["icons_new_document"].'"></i><span>'.$_lang['create_resource_here'].'</span> |
|
| 484 | 484 | </a> |
| 485 | 485 | <a class="btn btn-secondary" href="javascript:;" onclick="actions.newlink();"> |
| 486 | - <i class="' . $_style["icons_new_weblink"] . '"></i><span>' . $_lang['create_weblink_here'] . '</span> |
|
| 486 | + <i class="' . $_style["icons_new_weblink"].'"></i><span>'.$_lang['create_weblink_here'].'</span> |
|
| 487 | 487 | </a> |
| 488 | - ' : '') . ' |
|
| 488 | + ' : '').' |
|
| 489 | 489 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.edit();"> |
| 490 | - <i class="' . $_style["actions_edit"] . '"></i><span>' . $_lang['edit'] . '</span> |
|
| 490 | + <i class="' . $_style["actions_edit"].'"></i><span>'.$_lang['edit'].'</span> |
|
| 491 | 491 | </a> |
| 492 | 492 | <a id="Button2" class="btn btn-secondary" href="javascript:;" onclick="actions.move();"> |
| 493 | - <i class="' . $_style["actions_move"] . '"></i><span>' . $_lang['move'] . '</span> |
|
| 493 | + <i class="' . $_style["actions_move"].'"></i><span>'.$_lang['move'].'</span> |
|
| 494 | 494 | </a> |
| 495 | 495 | <a id="Button6" class="btn btn-secondary" href="javascript:;" onclick="actions.duplicate();"> |
| 496 | - <i class="' . $_style["actions_duplicate"] . '"></i><span>' . $_lang['duplicate'] . '</span> |
|
| 496 | + <i class="' . $_style["actions_duplicate"].'"></i><span>'.$_lang['duplicate'].'</span> |
|
| 497 | 497 | </a> |
| 498 | 498 | <a id="Button3" class="btn btn-secondary" href="javascript:;" onclick="actions.delete();"> |
| 499 | - <i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span> |
|
| 499 | + <i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span> |
|
| 500 | 500 | </a> |
| 501 | 501 | <a id="Button4" class="btn btn-secondary" href="javascript:;" onclick="actions.view();"> |
| 502 | - <i class="' . $_style["actions_preview"] . '"></i><span>' . $_lang['preview'] . '</span> |
|
| 502 | + <i class="' . $_style["actions_preview"].'"></i><span>'.$_lang['preview'].'</span> |
|
| 503 | 503 | </a> |
| 504 | 504 | </div> |
| 505 | 505 | </div>', |
| 506 | 506 | 'cancel' => '<div id="actions"> |
| 507 | 507 | <div class="btn-group"> |
| 508 | 508 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
| 509 | - <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
|
| 509 | + <i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span> |
|
| 510 | 510 | </a> |
| 511 | 511 | </div> |
| 512 | 512 | </div>', |
@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <?php |
| 2 | -class DATEPICKER { |
|
| 3 | - function __construct() { |
|
| 2 | +class DATEPICKER{ |
|
| 3 | + function __construct(){ |
|
| 4 | 4 | } |
| 5 | - function getDP() { |
|
| 6 | - global $modx,$_lang; |
|
| 5 | + function getDP(){ |
|
| 6 | + global $modx, $_lang; |
|
| 7 | 7 | |
| 8 | 8 | $tpl = file_get_contents(dirname(__FILE__).'/datepicker.tpl'); |
| 9 | - return $modx->parseText($tpl,$_lang,'[%','%]'); |
|
| 9 | + return $modx->parseText($tpl, $_lang, '[%', '%]'); |
|
| 10 | 10 | } |
| 11 | 11 | } |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | // using proxy, send entire URI |
| 150 | 150 | $this->_httprequest($URI, $fp, $URI, $this->_httpmethod); |
| 151 | 151 | } else { |
| 152 | - $path = $URI_PARTS["path"] . ($URI_PARTS["query"] ? "?" . $URI_PARTS["query"] : ""); |
|
| 152 | + $path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : ""); |
|
| 153 | 153 | // no proxy, send only the path |
| 154 | 154 | $this->_httprequest($path, $fp, $URI, $this->_httpmethod); |
| 155 | 155 | } |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | /* url was redirected, check if we've hit the max depth */ |
| 161 | 161 | if ($this->maxredirs > $this->_redirectdepth) { |
| 162 | 162 | // only follow redirect if it's on this site, or offsiteok is true |
| 163 | - if (preg_match("|^https?://" . preg_quote($this->host) . "|i", $this->_redirectaddr) || $this->offsiteok) { |
|
| 163 | + if (preg_match("|^https?://".preg_quote($this->host)."|i", $this->_redirectaddr) || $this->offsiteok) { |
|
| 164 | 164 | /* follow the redirect */ |
| 165 | 165 | $this->_redirectdepth++; |
| 166 | 166 | $this->lastredirectaddr = $this->_redirectaddr; |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | break; |
| 189 | 189 | default: |
| 190 | 190 | // not a valid protocol |
| 191 | - $this->error = 'Invalid protocol "' . $URI_PARTS["scheme"] . '"\n'; |
|
| 191 | + $this->error = 'Invalid protocol "'.$URI_PARTS["scheme"].'"\n'; |
|
| 192 | 192 | return false; |
| 193 | 193 | break; |
| 194 | 194 | } |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | // using proxy, send entire URI |
| 240 | 240 | $this->_httprequest($URI, $fp, $URI, $this->_submit_method, $this->_submit_type, $postdata); |
| 241 | 241 | } else { |
| 242 | - $path = $URI_PARTS["path"] . ($URI_PARTS["query"] ? "?" . $URI_PARTS["query"] : ""); |
|
| 242 | + $path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : ""); |
|
| 243 | 243 | // no proxy, send only the path |
| 244 | 244 | $this->_httprequest($path, $fp, $URI, $this->_submit_method, $this->_submit_type, $postdata); |
| 245 | 245 | } |
@@ -249,11 +249,11 @@ discard block |
||
| 249 | 249 | if ($this->_redirectaddr) { |
| 250 | 250 | /* url was redirected, check if we've hit the max depth */ |
| 251 | 251 | if ($this->maxredirs > $this->_redirectdepth) { |
| 252 | - if (!preg_match("|^" . $URI_PARTS["scheme"] . "://|", $this->_redirectaddr)) |
|
| 253 | - $this->_redirectaddr = $this->_expandlinks($this->_redirectaddr, $URI_PARTS["scheme"] . "://" . $URI_PARTS["host"]); |
|
| 252 | + if (!preg_match("|^".$URI_PARTS["scheme"]."://|", $this->_redirectaddr)) |
|
| 253 | + $this->_redirectaddr = $this->_expandlinks($this->_redirectaddr, $URI_PARTS["scheme"]."://".$URI_PARTS["host"]); |
|
| 254 | 254 | |
| 255 | 255 | // only follow redirect if it's on this site, or offsiteok is true |
| 256 | - if (preg_match("|^https?://" . preg_quote($this->host) . "|i", $this->_redirectaddr) || $this->offsiteok) { |
|
| 256 | + if (preg_match("|^https?://".preg_quote($this->host)."|i", $this->_redirectaddr) || $this->offsiteok) { |
|
| 257 | 257 | /* follow the redirect */ |
| 258 | 258 | $this->_redirectdepth++; |
| 259 | 259 | $this->lastredirectaddr = $this->_redirectaddr; |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | break; |
| 286 | 286 | default: |
| 287 | 287 | // not a valid protocol |
| 288 | - $this->error = 'Invalid protocol "' . $URI_PARTS["scheme"] . '"\n'; |
|
| 288 | + $this->error = 'Invalid protocol "'.$URI_PARTS["scheme"].'"\n'; |
|
| 289 | 289 | return false; |
| 290 | 290 | break; |
| 291 | 291 | } |
@@ -585,9 +585,9 @@ discard block |
||
| 585 | 585 | $match = preg_replace("|/$|", "", $match); |
| 586 | 586 | $match_part = parse_url($match); |
| 587 | 587 | $match_root = |
| 588 | - $match_part["scheme"] . "://" . $match_part["host"]; |
|
| 588 | + $match_part["scheme"]."://".$match_part["host"]; |
|
| 589 | 589 | |
| 590 | - $search = array("|^http://" . preg_quote($this->host) . "|i", |
|
| 590 | + $search = array("|^http://".preg_quote($this->host)."|i", |
|
| 591 | 591 | "|^(\/)|i", |
| 592 | 592 | "|^(?!http://)(?!mailto:)|i", |
| 593 | 593 | "|/\./|", |
@@ -595,8 +595,8 @@ discard block |
||
| 595 | 595 | ); |
| 596 | 596 | |
| 597 | 597 | $replace = array("", |
| 598 | - $match_root . "/", |
|
| 599 | - $match . "/", |
|
| 598 | + $match_root."/", |
|
| 599 | + $match."/", |
|
| 600 | 600 | "/", |
| 601 | 601 | "/" |
| 602 | 602 | ); |
@@ -625,17 +625,17 @@ discard block |
||
| 625 | 625 | $URI_PARTS = parse_url($URI); |
| 626 | 626 | if (empty($url)) |
| 627 | 627 | $url = "/"; |
| 628 | - $headers = $http_method . " " . $url . " " . $this->_httpversion . "\r\n"; |
|
| 628 | + $headers = $http_method." ".$url." ".$this->_httpversion."\r\n"; |
|
| 629 | 629 | if (!empty($this->host) && !isset($this->rawheaders['Host'])) { |
| 630 | - $headers .= "Host: " . $this->host; |
|
| 630 | + $headers .= "Host: ".$this->host; |
|
| 631 | 631 | if (!empty($this->port) && $this->port != '80') |
| 632 | - $headers .= ":" . $this->port; |
|
| 632 | + $headers .= ":".$this->port; |
|
| 633 | 633 | $headers .= "\r\n"; |
| 634 | 634 | } |
| 635 | 635 | if (!empty($this->agent)) |
| 636 | - $headers .= "User-Agent: " . $this->agent . "\r\n"; |
|
| 636 | + $headers .= "User-Agent: ".$this->agent."\r\n"; |
|
| 637 | 637 | if (!empty($this->accept)) |
| 638 | - $headers .= "Accept: " . $this->accept . "\r\n"; |
|
| 638 | + $headers .= "Accept: ".$this->accept."\r\n"; |
|
| 639 | 639 | if ($this->use_gzip) { |
| 640 | 640 | // make sure PHP was built with --with-zlib |
| 641 | 641 | // and we can handle gzipp'ed data |
@@ -643,46 +643,46 @@ discard block |
||
| 643 | 643 | $headers .= "Accept-encoding: gzip\r\n"; |
| 644 | 644 | } else { |
| 645 | 645 | trigger_error( |
| 646 | - "use_gzip is on, but PHP was built without zlib support." . |
|
| 646 | + "use_gzip is on, but PHP was built without zlib support.". |
|
| 647 | 647 | " Requesting file(s) without gzip encoding.", |
| 648 | 648 | E_USER_NOTICE); |
| 649 | 649 | } |
| 650 | 650 | } |
| 651 | 651 | if (!empty($this->referer)) |
| 652 | - $headers .= "Referer: " . $this->referer . "\r\n"; |
|
| 652 | + $headers .= "Referer: ".$this->referer."\r\n"; |
|
| 653 | 653 | if (!empty($this->cookies)) { |
| 654 | 654 | if (!is_array($this->cookies)) |
| 655 | - $this->cookies = (array)$this->cookies; |
|
| 655 | + $this->cookies = (array) $this->cookies; |
|
| 656 | 656 | |
| 657 | 657 | reset($this->cookies); |
| 658 | 658 | if (count($this->cookies) > 0) { |
| 659 | 659 | $cookie_headers .= 'Cookie: '; |
| 660 | 660 | foreach ($this->cookies as $cookieKey => $cookieVal) { |
| 661 | - $cookie_headers .= $cookieKey . "=" . urlencode($cookieVal) . "; "; |
|
| 661 | + $cookie_headers .= $cookieKey."=".urlencode($cookieVal)."; "; |
|
| 662 | 662 | } |
| 663 | - $headers .= substr($cookie_headers, 0, -2) . "\r\n"; |
|
| 663 | + $headers .= substr($cookie_headers, 0, -2)."\r\n"; |
|
| 664 | 664 | } |
| 665 | 665 | } |
| 666 | 666 | if (!empty($this->rawheaders)) { |
| 667 | 667 | if (!is_array($this->rawheaders)) |
| 668 | - $this->rawheaders = (array)$this->rawheaders; |
|
| 668 | + $this->rawheaders = (array) $this->rawheaders; |
|
| 669 | 669 | while (list($headerKey, $headerVal) = each($this->rawheaders)) |
| 670 | - $headers .= $headerKey . ": " . $headerVal . "\r\n"; |
|
| 670 | + $headers .= $headerKey.": ".$headerVal."\r\n"; |
|
| 671 | 671 | } |
| 672 | 672 | if (!empty($content_type)) { |
| 673 | 673 | $headers .= "Content-type: $content_type"; |
| 674 | 674 | if ($content_type == "multipart/form-data") |
| 675 | - $headers .= "; boundary=" . $this->_mime_boundary; |
|
| 675 | + $headers .= "; boundary=".$this->_mime_boundary; |
|
| 676 | 676 | $headers .= "\r\n"; |
| 677 | 677 | } |
| 678 | 678 | if (!empty($body)) |
| 679 | - $headers .= "Content-length: " . strlen($body) . "\r\n"; |
|
| 679 | + $headers .= "Content-length: ".strlen($body)."\r\n"; |
|
| 680 | 680 | if (!empty($this->user) || !empty($this->pass)) |
| 681 | - $headers .= "Authorization: Basic " . base64_encode($this->user . ":" . $this->pass) . "\r\n"; |
|
| 681 | + $headers .= "Authorization: Basic ".base64_encode($this->user.":".$this->pass)."\r\n"; |
|
| 682 | 682 | |
| 683 | 683 | //add proxy auth headers |
| 684 | 684 | if (!empty($this->proxy_user)) |
| 685 | - $headers .= 'Proxy-Authorization: ' . 'Basic ' . base64_encode($this->proxy_user . ':' . $this->proxy_pass) . "\r\n"; |
|
| 685 | + $headers .= 'Proxy-Authorization: '.'Basic '.base64_encode($this->proxy_user.':'.$this->proxy_pass)."\r\n"; |
|
| 686 | 686 | |
| 687 | 687 | |
| 688 | 688 | $headers .= "\r\n"; |
@@ -692,7 +692,7 @@ discard block |
||
| 692 | 692 | socket_set_timeout($fp, $this->read_timeout); |
| 693 | 693 | $this->timed_out = false; |
| 694 | 694 | |
| 695 | - fwrite($fp, $headers . $body, strlen($headers . $body)); |
|
| 695 | + fwrite($fp, $headers.$body, strlen($headers.$body)); |
|
| 696 | 696 | |
| 697 | 697 | $this->_redirectaddr = false; |
| 698 | 698 | unset($this->headers); |
@@ -716,10 +716,10 @@ discard block |
||
| 716 | 716 | // look for :// in the Location header to see if hostname is included |
| 717 | 717 | if (!preg_match("|\:\/\/|", $matches[2])) { |
| 718 | 718 | // no host in the path, so prepend |
| 719 | - $this->_redirectaddr = $URI_PARTS["scheme"] . "://" . $this->host . ":" . $this->port; |
|
| 719 | + $this->_redirectaddr = $URI_PARTS["scheme"]."://".$this->host.":".$this->port; |
|
| 720 | 720 | // eliminate double slash |
| 721 | 721 | if (!preg_match("|^/|", $matches[2])) |
| 722 | - $this->_redirectaddr .= "/" . $matches[2]; |
|
| 722 | + $this->_redirectaddr .= "/".$matches[2]; |
|
| 723 | 723 | else |
| 724 | 724 | $this->_redirectaddr .= $matches[2]; |
| 725 | 725 | } else |
@@ -771,7 +771,7 @@ discard block |
||
| 771 | 771 | if (($this->_framedepth < $this->maxframes) && preg_match_all("'<frame\s+.*src[\s]*=[\'\"]?([^\'\"\>]+)'i", $results, $match)) { |
| 772 | 772 | $this->results[] = $results; |
| 773 | 773 | for ($x = 0; $x < count($match[1]); $x++) |
| 774 | - $this->_frameurls[] = $this->_expandlinks($match[1][$x], $URI_PARTS["scheme"] . "://" . $this->host); |
|
| 774 | + $this->_frameurls[] = $this->_expandlinks($match[1][$x], $URI_PARTS["scheme"]."://".$this->host); |
|
| 775 | 775 | } // have we already fetched framed content? |
| 776 | 776 | elseif (is_array($this->results)) |
| 777 | 777 | $this->results[] = $results; |
@@ -858,14 +858,14 @@ discard block |
||
| 858 | 858 | $context_opts['ssl']['capath'] = $this->capath; |
| 859 | 859 | } |
| 860 | 860 | |
| 861 | - $host = 'ssl://' . $host; |
|
| 861 | + $host = 'ssl://'.$host; |
|
| 862 | 862 | } |
| 863 | 863 | |
| 864 | 864 | $context = stream_context_create($context_opts); |
| 865 | 865 | |
| 866 | 866 | if (version_compare(PHP_VERSION, '5.0.0', '>')) { |
| 867 | - if($this->scheme == 'http') |
|
| 868 | - $host = "tcp://" . $host; |
|
| 867 | + if ($this->scheme == 'http') |
|
| 868 | + $host = "tcp://".$host; |
|
| 869 | 869 | $fp = stream_socket_client( |
| 870 | 870 | "$host:$port", |
| 871 | 871 | $errno, |
@@ -897,7 +897,7 @@ discard block |
||
| 897 | 897 | case -5: |
| 898 | 898 | $this->error = "connection refused or timed out (-5)"; |
| 899 | 899 | default: |
| 900 | - $this->error = "connection failed (" . $errno . ")"; |
|
| 900 | + $this->error = "connection failed (".$errno.")"; |
|
| 901 | 901 | } |
| 902 | 902 | return false; |
| 903 | 903 | } |
@@ -938,26 +938,26 @@ discard block |
||
| 938 | 938 | while (list($key, $val) = each($formvars)) { |
| 939 | 939 | if (is_array($val) || is_object($val)) { |
| 940 | 940 | while (list($cur_key, $cur_val) = each($val)) { |
| 941 | - $postdata .= urlencode($key) . "[]=" . urlencode($cur_val) . "&"; |
|
| 941 | + $postdata .= urlencode($key)."[]=".urlencode($cur_val)."&"; |
|
| 942 | 942 | } |
| 943 | 943 | } else |
| 944 | - $postdata .= urlencode($key) . "=" . urlencode($val) . "&"; |
|
| 944 | + $postdata .= urlencode($key)."=".urlencode($val)."&"; |
|
| 945 | 945 | } |
| 946 | 946 | break; |
| 947 | 947 | |
| 948 | 948 | case "multipart/form-data": |
| 949 | - $this->_mime_boundary = "Snoopy" . md5(uniqid(microtime())); |
|
| 949 | + $this->_mime_boundary = "Snoopy".md5(uniqid(microtime())); |
|
| 950 | 950 | |
| 951 | 951 | reset($formvars); |
| 952 | 952 | while (list($key, $val) = each($formvars)) { |
| 953 | 953 | if (is_array($val) || is_object($val)) { |
| 954 | 954 | while (list($cur_key, $cur_val) = each($val)) { |
| 955 | - $postdata .= "--" . $this->_mime_boundary . "\r\n"; |
|
| 955 | + $postdata .= "--".$this->_mime_boundary."\r\n"; |
|
| 956 | 956 | $postdata .= "Content-Disposition: form-data; name=\"$key\[\]\"\r\n\r\n"; |
| 957 | 957 | $postdata .= "$cur_val\r\n"; |
| 958 | 958 | } |
| 959 | 959 | } else { |
| 960 | - $postdata .= "--" . $this->_mime_boundary . "\r\n"; |
|
| 960 | + $postdata .= "--".$this->_mime_boundary."\r\n"; |
|
| 961 | 961 | $postdata .= "Content-Disposition: form-data; name=\"$key\"\r\n\r\n"; |
| 962 | 962 | $postdata .= "$val\r\n"; |
| 963 | 963 | } |
@@ -974,12 +974,12 @@ discard block |
||
| 974 | 974 | fclose($fp); |
| 975 | 975 | $base_name = basename($file_name); |
| 976 | 976 | |
| 977 | - $postdata .= "--" . $this->_mime_boundary . "\r\n"; |
|
| 977 | + $postdata .= "--".$this->_mime_boundary."\r\n"; |
|
| 978 | 978 | $postdata .= "Content-Disposition: form-data; name=\"$field_name\"; filename=\"$base_name\"\r\n\r\n"; |
| 979 | 979 | $postdata .= "$file_content\r\n"; |
| 980 | 980 | } |
| 981 | 981 | } |
| 982 | - $postdata .= "--" . $this->_mime_boundary . "--\r\n"; |
|
| 982 | + $postdata .= "--".$this->_mime_boundary."--\r\n"; |
|
| 983 | 983 | break; |
| 984 | 984 | } |
| 985 | 985 | |
@@ -5,7 +5,7 @@ discard block |
||
| 5 | 5 | */ |
| 6 | 6 | |
| 7 | 7 | // Added by Raymond 20-Jan-2005 |
| 8 | -function getTVDisplayFormat($name, $value, $format, $paramstring = "", $tvtype = "", $docid = "", $sep = '') { |
|
| 8 | +function getTVDisplayFormat($name, $value, $format, $paramstring = "", $tvtype = "", $docid = "", $sep = ''){ |
|
| 9 | 9 | |
| 10 | 10 | global $modx; |
| 11 | 11 | |
@@ -14,29 +14,29 @@ discard block |
||
| 14 | 14 | $value = ProcessTVCommand($value, $name, $docid); |
| 15 | 15 | |
| 16 | 16 | $params = array(); |
| 17 | - if($paramstring) { |
|
| 17 | + if ($paramstring) { |
|
| 18 | 18 | $cp = explode("&", $paramstring); |
| 19 | - foreach($cp as $p => $v) { |
|
| 19 | + foreach ($cp as $p => $v) { |
|
| 20 | 20 | $v = trim($v); // trim |
| 21 | 21 | $ar = explode("=", $v); |
| 22 | - if(is_array($ar) && count($ar) == 2) { |
|
| 22 | + if (is_array($ar) && count($ar) == 2) { |
|
| 23 | 23 | $params[$ar[0]] = decodeParamValue($ar[1]); |
| 24 | 24 | } |
| 25 | 25 | } |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | $id = "tv$name"; |
| 29 | - switch($format) { |
|
| 29 | + switch ($format) { |
|
| 30 | 30 | case 'image': |
| 31 | 31 | $images = parseInput($value, '||', 'array'); |
| 32 | 32 | $o = ''; |
| 33 | - foreach($images as $image) { |
|
| 34 | - if(!is_array($image)) { |
|
| 33 | + foreach ($images as $image) { |
|
| 34 | + if (!is_array($image)) { |
|
| 35 | 35 | $image = explode('==', $image); |
| 36 | 36 | } |
| 37 | 37 | $src = $image[0]; |
| 38 | 38 | |
| 39 | - if($src) { |
|
| 39 | + if ($src) { |
|
| 40 | 40 | // We have a valid source |
| 41 | 41 | $attributes = ''; |
| 42 | 42 | $attr = array( |
@@ -46,14 +46,14 @@ discard block |
||
| 46 | 46 | 'alt' => $modx->htmlspecialchars($params['alttext']), |
| 47 | 47 | 'style' => $params['style'] |
| 48 | 48 | ); |
| 49 | - if(isset($params['align']) && $params['align'] != 'none') { |
|
| 49 | + if (isset($params['align']) && $params['align'] != 'none') { |
|
| 50 | 50 | $attr['align'] = $params['align']; |
| 51 | 51 | } |
| 52 | - foreach($attr as $k => $v) $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); |
|
| 53 | - $attributes .= ' ' . $params['attrib']; |
|
| 52 | + foreach ($attr as $k => $v) $attributes .= ($v ? ' '.$k.'="'.$v.'"' : ''); |
|
| 53 | + $attributes .= ' '.$params['attrib']; |
|
| 54 | 54 | |
| 55 | 55 | // Output the image with attributes |
| 56 | - $o .= '<img' . rtrim($attributes) . ' />'; |
|
| 56 | + $o .= '<img'.rtrim($attributes).' />'; |
|
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | break; |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | case "delim": // display as delimitted list |
| 62 | 62 | $value = parseInput($value, "||"); |
| 63 | 63 | $p = $params['format'] ? $params['format'] : " "; |
| 64 | - if($p == "\\n") { |
|
| 64 | + if ($p == "\\n") { |
|
| 65 | 65 | $p = "\n"; |
| 66 | 66 | } |
| 67 | 67 | $o = str_replace("||", $p, $value); |
@@ -70,13 +70,13 @@ discard block |
||
| 70 | 70 | case "string": |
| 71 | 71 | $value = parseInput($value); |
| 72 | 72 | $format = strtolower($params['format']); |
| 73 | - if($format == 'upper case') { |
|
| 73 | + if ($format == 'upper case') { |
|
| 74 | 74 | $o = strtoupper($value); |
| 75 | - } else if($format == 'lower case') { |
|
| 75 | + } else if ($format == 'lower case') { |
|
| 76 | 76 | $o = strtolower($value); |
| 77 | - } else if($format == 'sentence case') { |
|
| 77 | + } else if ($format == 'sentence case') { |
|
| 78 | 78 | $o = ucfirst($value); |
| 79 | - } else if($format == 'capitalize') { |
|
| 79 | + } else if ($format == 'capitalize') { |
|
| 80 | 80 | $o = ucwords($value); |
| 81 | 81 | } else { |
| 82 | 82 | $o = $value; |
@@ -84,8 +84,8 @@ discard block |
||
| 84 | 84 | break; |
| 85 | 85 | |
| 86 | 86 | case "date": |
| 87 | - if($value != '' || $params['default'] == 'Yes') { |
|
| 88 | - if(empty($value)) { |
|
| 87 | + if ($value != '' || $params['default'] == 'Yes') { |
|
| 88 | + if (empty($value)) { |
|
| 89 | 89 | $value = 'now'; |
| 90 | 90 | } |
| 91 | 91 | $timestamp = getUnixtimeFromDateString($value); |
@@ -99,13 +99,13 @@ discard block |
||
| 99 | 99 | case "hyperlink": |
| 100 | 100 | $value = parseInput($value, "||", "array"); |
| 101 | 101 | $o = ''; |
| 102 | - for($i = 0; $i < count($value); $i++) { |
|
| 102 | + for ($i = 0; $i < count($value); $i++) { |
|
| 103 | 103 | list($name, $url) = is_array($value[$i]) ? $value[$i] : explode("==", $value[$i]); |
| 104 | - if(!$url) { |
|
| 104 | + if (!$url) { |
|
| 105 | 105 | $url = $name; |
| 106 | 106 | } |
| 107 | - if($url) { |
|
| 108 | - if($o) { |
|
| 107 | + if ($url) { |
|
| 108 | + if ($o) { |
|
| 109 | 109 | $o .= '<br />'; |
| 110 | 110 | } |
| 111 | 111 | $attributes = ''; |
@@ -117,11 +117,11 @@ discard block |
||
| 117 | 117 | 'style' => $params['style'], |
| 118 | 118 | 'target' => $params['target'], |
| 119 | 119 | ); |
| 120 | - foreach($attr as $k => $v) $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); |
|
| 121 | - $attributes .= ' ' . $params['attrib']; // add extra |
|
| 120 | + foreach ($attr as $k => $v) $attributes .= ($v ? ' '.$k.'="'.$v.'"' : ''); |
|
| 121 | + $attributes .= ' '.$params['attrib']; // add extra |
|
| 122 | 122 | |
| 123 | 123 | // Output the link |
| 124 | - $o .= '<a' . rtrim($attributes) . '>' . ($params['text'] ? $modx->htmlspecialchars($params['text']) : $name) . '</a>'; |
|
| 124 | + $o .= '<a'.rtrim($attributes).'>'.($params['text'] ? $modx->htmlspecialchars($params['text']) : $name).'</a>'; |
|
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | break; |
@@ -132,9 +132,9 @@ discard block |
||
| 132 | 132 | $tagname = ($params['tagname']) ? $params['tagname'] : 'div'; |
| 133 | 133 | $o = ''; |
| 134 | 134 | // Loop through a list of tags |
| 135 | - for($i = 0; $i < count($value); $i++) { |
|
| 135 | + for ($i = 0; $i < count($value); $i++) { |
|
| 136 | 136 | $tagvalue = is_array($value[$i]) ? implode(' ', $value[$i]) : $value[$i]; |
| 137 | - if(!$tagvalue) { |
|
| 137 | + if (!$tagvalue) { |
|
| 138 | 138 | continue; |
| 139 | 139 | } |
| 140 | 140 | |
@@ -145,11 +145,11 @@ discard block |
||
| 145 | 145 | 'class' => $params['class'], |
| 146 | 146 | 'style' => $params['style'], |
| 147 | 147 | ); |
| 148 | - foreach($attr as $k => $v) $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); |
|
| 149 | - $attributes .= ' ' . $params['attrib']; // add extra |
|
| 148 | + foreach ($attr as $k => $v) $attributes .= ($v ? ' '.$k.'="'.$v.'"' : ''); |
|
| 149 | + $attributes .= ' '.$params['attrib']; // add extra |
|
| 150 | 150 | |
| 151 | 151 | // Output the HTML Tag |
| 152 | - $o .= '<' . $tagname . rtrim($attributes) . '>' . $tagvalue . '</' . $tagname . '>'; |
|
| 152 | + $o .= '<'.$tagname.rtrim($attributes).'>'.$tagvalue.'</'.$tagname.'>'; |
|
| 153 | 153 | } |
| 154 | 154 | break; |
| 155 | 155 | |
@@ -158,12 +158,12 @@ discard block |
||
| 158 | 158 | $w = $params['w'] ? $params['w'] : '100%'; |
| 159 | 159 | $h = $params['h'] ? $params['h'] : '400px'; |
| 160 | 160 | $richtexteditor = $params['edt'] ? $params['edt'] : ""; |
| 161 | - $o = '<div class="MODX_RichTextWidget"><textarea id="' . $id . '" name="' . $id . '" style="width:' . $w . '; height:' . $h . ';">'; |
|
| 161 | + $o = '<div class="MODX_RichTextWidget"><textarea id="'.$id.'" name="'.$id.'" style="width:'.$w.'; height:'.$h.';">'; |
|
| 162 | 162 | $o .= $modx->htmlspecialchars($value); |
| 163 | 163 | $o .= '</textarea></div>'; |
| 164 | 164 | $replace_richtext = array($id); |
| 165 | 165 | // setup editors |
| 166 | - if(!empty($replace_richtext) && !empty($richtexteditor)) { |
|
| 166 | + if (!empty($replace_richtext) && !empty($richtexteditor)) { |
|
| 167 | 167 | // invoke OnRichTextEditorInit event |
| 168 | 168 | $evtOut = $modx->invokeEvent("OnRichTextEditorInit", array( |
| 169 | 169 | 'editor' => $richtexteditor, |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | 'width' => $w, |
| 173 | 173 | 'height' => $h |
| 174 | 174 | )); |
| 175 | - if(is_array($evtOut)) { |
|
| 175 | + if (is_array($evtOut)) { |
|
| 176 | 176 | $o .= implode("", $evtOut); |
| 177 | 177 | } |
| 178 | 178 | } |
@@ -185,8 +185,8 @@ discard block |
||
| 185 | 185 | |
| 186 | 186 | case "viewport": |
| 187 | 187 | $value = parseInput($value); |
| 188 | - $id = '_' . time(); |
|
| 189 | - if(!$params['vpid']) { |
|
| 188 | + $id = '_'.time(); |
|
| 189 | + if (!$params['vpid']) { |
|
| 190 | 190 | $params['vpid'] = $id; |
| 191 | 191 | } |
| 192 | 192 | $sTag = "<iframe"; |
@@ -194,42 +194,42 @@ discard block |
||
| 194 | 194 | $autoMode = "0"; |
| 195 | 195 | $w = $params['width']; |
| 196 | 196 | $h = $params['height']; |
| 197 | - if($params['stretch'] == 'Yes') { |
|
| 197 | + if ($params['stretch'] == 'Yes') { |
|
| 198 | 198 | $w = "100%"; |
| 199 | 199 | $h = "100%"; |
| 200 | 200 | } |
| 201 | - if($params['asize'] == 'Yes' || ($params['awidth'] == 'Yes' && $params['aheight'] == 'Yes')) { |
|
| 202 | - $autoMode = "3"; //both |
|
| 203 | - } else if($params['awidth'] == 'Yes') { |
|
| 201 | + if ($params['asize'] == 'Yes' || ($params['awidth'] == 'Yes' && $params['aheight'] == 'Yes')) { |
|
| 202 | + $autoMode = "3"; //both |
|
| 203 | + } else if ($params['awidth'] == 'Yes') { |
|
| 204 | 204 | $autoMode = "1"; //width only |
| 205 | - } else if($params['aheight'] == 'Yes') { |
|
| 206 | - $autoMode = "2"; //height only |
|
| 205 | + } else if ($params['aheight'] == 'Yes') { |
|
| 206 | + $autoMode = "2"; //height only |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | - $modx->regClientStartupScript(MODX_MANAGER_URL . "media/script/bin/viewport.js", array( |
|
| 209 | + $modx->regClientStartupScript(MODX_MANAGER_URL."media/script/bin/viewport.js", array( |
|
| 210 | 210 | 'name' => 'viewport', |
| 211 | 211 | 'version' => '0', |
| 212 | 212 | 'plaintext' => false |
| 213 | 213 | )); |
| 214 | - $o = $sTag . " id='" . $params['vpid'] . "' name='" . $params['vpid'] . "' "; |
|
| 215 | - if($params['class']) { |
|
| 216 | - $o .= " class='" . $params['class'] . "' "; |
|
| 214 | + $o = $sTag." id='".$params['vpid']."' name='".$params['vpid']."' "; |
|
| 215 | + if ($params['class']) { |
|
| 216 | + $o .= " class='".$params['class']."' "; |
|
| 217 | 217 | } |
| 218 | - if($params['style']) { |
|
| 219 | - $o .= " style='" . $params['style'] . "' "; |
|
| 218 | + if ($params['style']) { |
|
| 219 | + $o .= " style='".$params['style']."' "; |
|
| 220 | 220 | } |
| 221 | - if($params['attrib']) { |
|
| 222 | - $o .= $params['attrib'] . " "; |
|
| 221 | + if ($params['attrib']) { |
|
| 222 | + $o .= $params['attrib']." "; |
|
| 223 | 223 | } |
| 224 | - $o .= "scrolling='" . ($params['sbar'] == 'No' ? "no" : ($params['sbar'] == 'Yes' ? "yes" : "auto")) . "' "; |
|
| 225 | - $o .= "src='" . $value . "' frameborder='" . $params['borsize'] . "' "; |
|
| 226 | - $o .= "onload=\"window.setTimeout('ResizeViewPort(\\'" . $params['vpid'] . "\\'," . $autoMode . ")',100);\" width='" . $w . "' height='" . $h . "' "; |
|
| 224 | + $o .= "scrolling='".($params['sbar'] == 'No' ? "no" : ($params['sbar'] == 'Yes' ? "yes" : "auto"))."' "; |
|
| 225 | + $o .= "src='".$value."' frameborder='".$params['borsize']."' "; |
|
| 226 | + $o .= "onload=\"window.setTimeout('ResizeViewPort(\\'".$params['vpid']."\\',".$autoMode.")',100);\" width='".$w."' height='".$h."' "; |
|
| 227 | 227 | $o .= ">"; |
| 228 | 228 | $o .= $eTag; |
| 229 | 229 | break; |
| 230 | 230 | |
| 231 | 231 | case "datagrid": |
| 232 | - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; |
|
| 232 | + include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php"; |
|
| 233 | 233 | $grd = new DataGrid('', $value); |
| 234 | 234 | |
| 235 | 235 | $grd->noRecordMsg = $params['egmsg']; |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | |
| 265 | 265 | case 'htmlentities': |
| 266 | 266 | $value = parseInput($value); |
| 267 | - if($tvtype == 'checkbox' || $tvtype == 'listbox-multiple') { |
|
| 267 | + if ($tvtype == 'checkbox' || $tvtype == 'listbox-multiple') { |
|
| 268 | 268 | // remove delimiter from checkbox and listbox-multiple TVs |
| 269 | 269 | $value = str_replace('||', '', $value); |
| 270 | 270 | } |
@@ -275,33 +275,33 @@ discard block |
||
| 275 | 275 | $widget_output = ''; |
| 276 | 276 | $o = ''; |
| 277 | 277 | /* If we are loading a file */ |
| 278 | - if(substr($params['output'], 0, 5) == "@FILE") { |
|
| 279 | - $file_name = MODX_BASE_PATH . trim(substr($params['output'], 6)); |
|
| 280 | - if(!file_exists($file_name)) { |
|
| 281 | - $widget_output = $file_name . ' does not exist'; |
|
| 278 | + if (substr($params['output'], 0, 5) == "@FILE") { |
|
| 279 | + $file_name = MODX_BASE_PATH.trim(substr($params['output'], 6)); |
|
| 280 | + if (!file_exists($file_name)) { |
|
| 281 | + $widget_output = $file_name.' does not exist'; |
|
| 282 | 282 | } else { |
| 283 | 283 | $widget_output = file_get_contents($file_name); |
| 284 | 284 | } |
| 285 | - } elseif(substr($params['output'], 0, 8) == '@INCLUDE') { |
|
| 286 | - $file_name = MODX_BASE_PATH . trim(substr($params['output'], 9)); |
|
| 287 | - if(!file_exists($file_name)) { |
|
| 288 | - $widget_output = $file_name . ' does not exist'; |
|
| 285 | + } elseif (substr($params['output'], 0, 8) == '@INCLUDE') { |
|
| 286 | + $file_name = MODX_BASE_PATH.trim(substr($params['output'], 9)); |
|
| 287 | + if (!file_exists($file_name)) { |
|
| 288 | + $widget_output = $file_name.' does not exist'; |
|
| 289 | 289 | } else { |
| 290 | 290 | /* The included file needs to set $widget_output. Can be string, array, object */ |
| 291 | 291 | include $file_name; |
| 292 | 292 | } |
| 293 | - } elseif(substr($params['output'], 0, 6) == '@CHUNK' && $value !== '') { |
|
| 293 | + } elseif (substr($params['output'], 0, 6) == '@CHUNK' && $value !== '') { |
|
| 294 | 294 | $chunk_name = trim(substr($params['output'], 7)); |
| 295 | 295 | $widget_output = $modx->getChunk($chunk_name); |
| 296 | - } elseif(substr($params['output'], 0, 5) == '@EVAL' && $value !== '') { |
|
| 296 | + } elseif (substr($params['output'], 0, 5) == '@EVAL' && $value !== '') { |
|
| 297 | 297 | $eval_str = trim(substr($params['output'], 6)); |
| 298 | 298 | $widget_output = eval($eval_str); |
| 299 | - } elseif($value !== '') { |
|
| 299 | + } elseif ($value !== '') { |
|
| 300 | 300 | $widget_output = $params['output']; |
| 301 | 301 | } else { |
| 302 | 302 | $widget_output = ''; |
| 303 | 303 | } |
| 304 | - if(is_string($widget_output)) { |
|
| 304 | + if (is_string($widget_output)) { |
|
| 305 | 305 | $_ = $modx->config['enable_filter']; |
| 306 | 306 | $modx->config['enable_filter'] = 1; |
| 307 | 307 | $widget_output = $modx->parseText($widget_output, array('value' => $value)); |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | |
| 315 | 315 | default: |
| 316 | 316 | $value = parseInput($value); |
| 317 | - if($tvtype == 'checkbox' || $tvtype == 'listbox-multiple') { |
|
| 317 | + if ($tvtype == 'checkbox' || $tvtype == 'listbox-multiple') { |
|
| 318 | 318 | // add separator |
| 319 | 319 | $value = explode('||', $value); |
| 320 | 320 | $value = implode($sep, $value); |
@@ -325,23 +325,23 @@ discard block |
||
| 325 | 325 | return $o; |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | -function decodeParamValue($s) { |
|
| 328 | +function decodeParamValue($s){ |
|
| 329 | 329 | $s = str_replace("%3D", '=', $s); // = |
| 330 | 330 | $s = str_replace("%26", '&', $s); // & |
| 331 | 331 | return $s; |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | // returns an array if a delimiter is present. returns array is a recordset is present |
| 335 | -function parseInput($src, $delim = "||", $type = "string", $columns = true) { // type can be: string, array |
|
| 335 | +function parseInput($src, $delim = "||", $type = "string", $columns = true){ // type can be: string, array |
|
| 336 | 336 | global $modx; |
| 337 | - if($modx->db->isResult($src)) { |
|
| 337 | + if ($modx->db->isResult($src)) { |
|
| 338 | 338 | // must be a recordset |
| 339 | 339 | $rows = array(); |
| 340 | - while($cols = $modx->db->getRow($src, 'num')) $rows[] = ($columns) ? $cols : implode(" ", $cols); |
|
| 340 | + while ($cols = $modx->db->getRow($src, 'num')) $rows[] = ($columns) ? $cols : implode(" ", $cols); |
|
| 341 | 341 | return ($type == "array") ? $rows : implode($delim, $rows); |
| 342 | 342 | } else { |
| 343 | 343 | // must be a text |
| 344 | - if($type == "array") { |
|
| 344 | + if ($type == "array") { |
|
| 345 | 345 | return explode($delim, $src); |
| 346 | 346 | } else { |
| 347 | 347 | return $src; |
@@ -349,21 +349,21 @@ discard block |
||
| 349 | 349 | } |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | -function getUnixtimeFromDateString($value) { |
|
| 352 | +function getUnixtimeFromDateString($value){ |
|
| 353 | 353 | $timestamp = false; |
| 354 | 354 | // Check for MySQL or legacy style date |
| 355 | 355 | $date_match_1 = '/^([0-9]{2})-([0-9]{2})-([0-9]{4})\ ([0-9]{2}):([0-9]{2}):([0-9]{2})$/'; |
| 356 | 356 | $date_match_2 = '/^([0-9]{4})-([0-9]{2})-([0-9]{2})\ ([0-9]{2}):([0-9]{2}):([0-9]{2})$/'; |
| 357 | 357 | $matches = array(); |
| 358 | - if(strpos($value, '-') !== false) { |
|
| 359 | - if(preg_match($date_match_1, $value, $matches)) { |
|
| 358 | + if (strpos($value, '-') !== false) { |
|
| 359 | + if (preg_match($date_match_1, $value, $matches)) { |
|
| 360 | 360 | $timestamp = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[1], $matches[3]); |
| 361 | - } elseif(preg_match($date_match_2, $value, $matches)) { |
|
| 361 | + } elseif (preg_match($date_match_2, $value, $matches)) { |
|
| 362 | 362 | $timestamp = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]); |
| 363 | 363 | } |
| 364 | 364 | } |
| 365 | 365 | // If those didn't work, use strtotime to figure out the date |
| 366 | - if($timestamp === false || $timestamp === -1) { |
|
| 366 | + if ($timestamp === false || $timestamp === -1) { |
|
| 367 | 367 | $timestamp = strtotime($value); |
| 368 | 368 | } |
| 369 | 369 | return $timestamp; |
@@ -29,33 +29,33 @@ discard block |
||
| 29 | 29 | // include MagPieRSS |
| 30 | 30 | require_once(MODX_MANAGER_PATH.'media/rss/rss_fetch.inc'); |
| 31 | 31 | // Convert relative path into absolute url |
| 32 | -function rel2abs( $rel, $base ) { |
|
| 32 | +function rel2abs($rel, $base){ |
|
| 33 | 33 | // parse base URL and convert to local variables: $scheme, $host, $path |
| 34 | - extract( parse_url( $base ) ); |
|
| 35 | - if ( strpos( $rel,"//" ) === 0 ) { |
|
| 36 | - return $scheme . ':' . $rel; |
|
| 34 | + extract(parse_url($base)); |
|
| 35 | + if (strpos($rel, "//") === 0) { |
|
| 36 | + return $scheme.':'.$rel; |
|
| 37 | 37 | } |
| 38 | 38 | // return if already absolute URL |
| 39 | - if ( parse_url( $rel, PHP_URL_SCHEME ) != '' ) { |
|
| 39 | + if (parse_url($rel, PHP_URL_SCHEME) != '') { |
|
| 40 | 40 | return $rel; |
| 41 | 41 | } |
| 42 | 42 | // queries and anchors |
| 43 | - if ( $rel[0] == '#' || $rel[0] == '?' ) { |
|
| 44 | - return $base . $rel; |
|
| 43 | + if ($rel[0] == '#' || $rel[0] == '?') { |
|
| 44 | + return $base.$rel; |
|
| 45 | 45 | } |
| 46 | 46 | // remove non-directory element from path |
| 47 | - $path = preg_replace( '#/[^/]*$#', '', $path ); |
|
| 47 | + $path = preg_replace('#/[^/]*$#', '', $path); |
|
| 48 | 48 | // destroy path if relative url points to root |
| 49 | - if ( $rel[0] == '/' ) { |
|
| 49 | + if ($rel[0] == '/') { |
|
| 50 | 50 | $path = ''; |
| 51 | 51 | } |
| 52 | 52 | // dirty absolute URL |
| 53 | - $abs = $host . $path . "/" . $rel; |
|
| 53 | + $abs = $host.$path."/".$rel; |
|
| 54 | 54 | // replace '//' or '/./' or '/foo/../' with '/' |
| 55 | - $abs = preg_replace( "/(\/\.?\/)/", "/", $abs ); |
|
| 56 | - $abs = preg_replace( "/\/(?!\.\.)[^\/]+\/\.\.\//", "/", $abs ); |
|
| 55 | + $abs = preg_replace("/(\/\.?\/)/", "/", $abs); |
|
| 56 | + $abs = preg_replace("/\/(?!\.\.)[^\/]+\/\.\.\//", "/", $abs); |
|
| 57 | 57 | // absolute URL is ready! |
| 58 | - return $scheme . '://' . $abs; |
|
| 58 | + return $scheme.'://'.$abs; |
|
| 59 | 59 | } |
| 60 | 60 | $feedData = array(); |
| 61 | 61 | |
@@ -63,15 +63,15 @@ discard block |
||
| 63 | 63 | foreach ($urls as $section=>$url) { |
| 64 | 64 | $output = ''; |
| 65 | 65 | $rss = @fetch_rss($url); |
| 66 | - if( !$rss ){ |
|
| 67 | - $feedData[$section] = 'Failed to retrieve ' . $url; |
|
| 66 | + if (!$rss) { |
|
| 67 | + $feedData[$section] = 'Failed to retrieve '.$url; |
|
| 68 | 68 | continue; |
| 69 | 69 | } |
| 70 | 70 | $output .= '<ul>'; |
| 71 | 71 | |
| 72 | 72 | $items = array_slice($rss->items, 0, $itemsNumber); |
| 73 | 73 | foreach ($items as $item) { |
| 74 | - $href = rel2abs($item['link'],'https://github.com'); |
|
| 74 | + $href = rel2abs($item['link'], 'https://github.com'); |
|
| 75 | 75 | $title = $item['title']; |
| 76 | 76 | $pubdate = $item['pubdate']; |
| 77 | 77 | $pubdate = $modx->toDateFormat(strtotime($pubdate)); |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$c = &$settings; |
|
| 3 | +$c = &$settings; |
|
| 4 | 4 | |
| 5 | 5 | $c['site_name'] = 'My MODX Site'; |
| 6 | 6 | $c['site_start'] = 1; |
@@ -65,26 +65,26 @@ |
||
| 65 | 65 | $_['macintosh'] = 'Western European (Mac) - macintosh'; |
| 66 | 66 | $_['Windows-1252'] = 'Western European (Windows) - Windows-1252'; |
| 67 | 67 | |
| 68 | -if($modx_charset == 'euc-jp') $_['euc-jp'] = 'Japanese (EUC) - euc-jp'; |
|
| 69 | -elseif($modx_charset == 'shift_jis') $_['shift_jis'] = 'Japanese (Shift-JIS) - shift_jis'; |
|
| 70 | -elseif($modx_charset == 'iso-2022-jp') $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp'; |
|
| 71 | -elseif($modx_charset == 'csISO2022JP') $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP'; |
|
| 72 | -elseif($modx_charset == 'EUC-CN') $_['EUC-CN'] = 'Chinese Simplified (EUC) - EUC-CN'; |
|
| 73 | -elseif($modx_charset == 'hz-gb-2312') $_['hz-gb-2312'] = 'Chinese Simplified (HZ) - hz-gb-2312'; |
|
| 74 | -elseif($modx_charset == 'x-mac-chinesesimp') $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp'; |
|
| 75 | -elseif($modx_charset == 'x-Chinese-CNS') $_['x-Chinese-CNS'] = 'Chinese Traditional (CNS) - x-Chinese-CNS'; |
|
| 76 | -elseif($modx_charset == 'x-Chinese-Eten') $_['x-Chinese-Eten'] = 'Chinese Traditional (Eten) - x-Chinese-Eten'; |
|
| 77 | -elseif($modx_charset == 'x-mac-chinesetrad') $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad'; |
|
| 78 | -elseif($modx_charset == 'ks_c_5601-1987') $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987'; |
|
| 79 | -elseif($modx_charset == 'euc-kr') $_['euc-kr'] = 'Korean (EUC) - euc-kr'; |
|
| 80 | -elseif($modx_charset == 'iso-2022-kr') $_['iso-2022-kr'] = 'Korean (ISO) - iso-2022-kr'; |
|
| 81 | -elseif($modx_charset == 'Johab') $_['Johab'] = 'Korean (Johab) - Johab'; |
|
| 82 | -elseif($modx_charset == 'x-mac-korean') $_['x-mac-korean'] = 'Korean (Mac) - x-mac-korean'; |
|
| 68 | +if ($modx_charset == 'euc-jp') $_['euc-jp'] = 'Japanese (EUC) - euc-jp'; |
|
| 69 | +elseif ($modx_charset == 'shift_jis') $_['shift_jis'] = 'Japanese (Shift-JIS) - shift_jis'; |
|
| 70 | +elseif ($modx_charset == 'iso-2022-jp') $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp'; |
|
| 71 | +elseif ($modx_charset == 'csISO2022JP') $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP'; |
|
| 72 | +elseif ($modx_charset == 'EUC-CN') $_['EUC-CN'] = 'Chinese Simplified (EUC) - EUC-CN'; |
|
| 73 | +elseif ($modx_charset == 'hz-gb-2312') $_['hz-gb-2312'] = 'Chinese Simplified (HZ) - hz-gb-2312'; |
|
| 74 | +elseif ($modx_charset == 'x-mac-chinesesimp') $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp'; |
|
| 75 | +elseif ($modx_charset == 'x-Chinese-CNS') $_['x-Chinese-CNS'] = 'Chinese Traditional (CNS) - x-Chinese-CNS'; |
|
| 76 | +elseif ($modx_charset == 'x-Chinese-Eten') $_['x-Chinese-Eten'] = 'Chinese Traditional (Eten) - x-Chinese-Eten'; |
|
| 77 | +elseif ($modx_charset == 'x-mac-chinesetrad') $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad'; |
|
| 78 | +elseif ($modx_charset == 'ks_c_5601-1987') $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987'; |
|
| 79 | +elseif ($modx_charset == 'euc-kr') $_['euc-kr'] = 'Korean (EUC) - euc-kr'; |
|
| 80 | +elseif ($modx_charset == 'iso-2022-kr') $_['iso-2022-kr'] = 'Korean (ISO) - iso-2022-kr'; |
|
| 81 | +elseif ($modx_charset == 'Johab') $_['Johab'] = 'Korean (Johab) - Johab'; |
|
| 82 | +elseif ($modx_charset == 'x-mac-korean') $_['x-mac-korean'] = 'Korean (Mac) - x-mac-korean'; |
|
| 83 | 83 | |
| 84 | 84 | $tpl = '<option value="%s" %s>%s</option>'; |
| 85 | 85 | $options = array(); |
| 86 | -foreach($_ as $value=>$label) { |
|
| 87 | - $selected = $value===$modx_charset ? 'selected' : ''; |
|
| 86 | +foreach ($_ as $value=>$label) { |
|
| 87 | + $selected = $value === $modx_charset ? 'selected' : ''; |
|
| 88 | 88 | $options[] = sprintf($tpl, $value, $selected, $label); |
| 89 | 89 | } |
| 90 | 90 | echo join("\n", $options); |
@@ -3,10 +3,10 @@ discard block |
||
| 3 | 3 | global $site_sessionname; |
| 4 | 4 | $site_sessionname = genEvoSessionName(); // For legacy extras not using startCMSSession |
| 5 | 5 | |
| 6 | -function genEvoSessionName() {
|
|
| 6 | +function genEvoSessionName(){
|
|
| 7 | 7 | $_ = crc32(__FILE__); |
| 8 | 8 | $_ = sprintf('%u', $_);
|
| 9 | - return 'evo' . base_convert($_,10,36); |
|
| 9 | + return 'evo'.base_convert($_, 10, 36); |
|
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | function startCMSSession(){
|
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | session_name($site_sessionname); |
| 17 | 17 | removeInvalidCmsSessionIds($site_sessionname); |
| 18 | - $cookieExpiration= 0; |
|
| 18 | + $cookieExpiration = 0; |
|
| 19 | 19 | $secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port); |
| 20 | 20 | $cookiePath = !empty($session_cookie_path) ? $session_cookie_path : MODX_BASE_URL; |
| 21 | 21 | $cookieDomain = !empty($session_cookie_domain) ? $session_cookie_domain : ''; |
@@ -24,8 +24,8 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | $key = "modx.{$context}.session.cookie.lifetime";
|
| 26 | 26 | if (isset($_SESSION[$key]) && is_numeric($_SESSION[$key])) {
|
| 27 | - $cookieLifetime= intval($_SESSION[$key]); |
|
| 28 | - if($cookieLifetime) $cookieExpiration = $_SERVER['REQUEST_TIME']+$cookieLifetime; |
|
| 27 | + $cookieLifetime = intval($_SESSION[$key]); |
|
| 28 | + if ($cookieLifetime) $cookieExpiration = $_SERVER['REQUEST_TIME'] + $cookieLifetime; |
|
| 29 | 29 | setcookie(session_name(), session_id(), $cookieExpiration, $cookiePath, $cookieDomain, $secure, true); |
| 30 | 30 | } |
| 31 | 31 | if (!isset($_SESSION['modx.session.created.time'])) {
|
@@ -33,14 +33,14 @@ discard block |
||
| 33 | 33 | } |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | -function removeInvalidCmsSessionFromStorage(&$storage, $session_name) {
|
|
| 36 | +function removeInvalidCmsSessionFromStorage(&$storage, $session_name){
|
|
| 37 | 37 | if (isset($storage[$session_name]) && ($storage[$session_name] === '' || $storage[$session_name] === 'deleted')) |
| 38 | 38 | {
|
| 39 | 39 | unset($storage[$session_name]); |
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | -function removeInvalidCmsSessionIds($session_name) {
|
|
| 43 | +function removeInvalidCmsSessionIds($session_name){
|
|
| 44 | 44 | // session ids is invalid iff it is empty string |
| 45 | 45 | // storage priorioty can see in PHP source ext/session/session.c |
| 46 | 46 | removeInvalidCmsSessionFromStorage($_COOKIE, $session_name); |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | //Kyle Jaebker - 08/07/06 |
| 4 | 4 | |
| 5 | 5 | //Create a new category |
| 6 | -function newCategory($newCat) { |
|
| 6 | +function newCategory($newCat){ |
|
| 7 | 7 | global $modx; |
| 8 | 8 | $useTable = $modx->getFullTableName('categories'); |
| 9 | 9 | $categoryId = $modx->db->insert( |
@@ -14,36 +14,36 @@ discard block |
||
| 14 | 14 | return $categoryId; |
| 15 | 15 | } |
| 16 | 16 | //check if new category already exists |
| 17 | -function checkCategory($newCat = '') { |
|
| 17 | +function checkCategory($newCat = ''){ |
|
| 18 | 18 | global $modx; |
| 19 | 19 | $useTable = $modx->getFullTableName('categories'); |
| 20 | 20 | $newCat = $modx->db->escape($newCat); |
| 21 | 21 | $cats = $modx->db->select('id', $modx->getFullTableName('categories'), "category='{$newCat}'"); |
| 22 | - if($cat = $modx->db->getValue($cats)) { |
|
| 22 | + if ($cat = $modx->db->getValue($cats)) { |
|
| 23 | 23 | return $cat; |
| 24 | 24 | } |
| 25 | 25 | return 0; |
| 26 | 26 | } |
| 27 | 27 | //Check for category, create new if not exists |
| 28 | -function getCategory($category='') { |
|
| 28 | +function getCategory($category = ''){ |
|
| 29 | 29 | $categoryId = checkCategory($category); |
| 30 | - if(!$categoryId) $categoryId = newCategory($category); |
|
| 30 | + if (!$categoryId) $categoryId = newCategory($category); |
|
| 31 | 31 | return $categoryId; |
| 32 | 32 | } |
| 33 | 33 | //Get all categories |
| 34 | -function getCategories() { |
|
| 34 | +function getCategories(){ |
|
| 35 | 35 | global $modx; |
| 36 | 36 | $useTable = $modx->getFullTableName('categories'); |
| 37 | 37 | $cats = $modx->db->select('id, category', $modx->getFullTableName('categories'), '', 'category'); |
| 38 | 38 | $resourceArray = array(); |
| 39 | - while($row = $modx->db->getRow($cats)) { |
|
| 39 | + while ($row = $modx->db->getRow($cats)) { |
|
| 40 | 40 | $row['category'] = stripslashes($row['category']); |
| 41 | 41 | $resourceArray[] = $row; |
| 42 | 42 | } |
| 43 | 43 | return $resourceArray; |
| 44 | 44 | } |
| 45 | 45 | //Delete category & associations |
| 46 | -function deleteCategory($catId=0) { |
|
| 46 | +function deleteCategory($catId = 0){ |
|
| 47 | 47 | global $modx; |
| 48 | 48 | if ($catId) { |
| 49 | 49 | $resetTables = array('site_plugins', 'site_snippets', 'site_htmlsnippets', 'site_templates', 'site_tmplvars', 'site_modules'); |