WW
Showing
4 changed files
with
164 additions
and
125 deletions
| 1 | <?php | 1 | <?php |
| 2 | namespace Tz\WordPress\Tools\Branding; | 2 | namespace Tz\WordPress\Tools\Branding; |
| 3 | |||
| 3 | use Tz\WordPress\Tools; | 4 | use Tz\WordPress\Tools; |
| 4 | 5 | ||
| 5 | require_once('wp-admin-menu-classes.php'); | 6 | require_once 'wp-admin-menu-classes.php'; |
| 6 | 7 | ||
| 7 | call_user_func(function() { | 8 | call_user_func(function () { |
| 8 | Tools\add_actions(__NAMESPACE__ . '\Actions'); | 9 | Tools\add_actions(__NAMESPACE__ . '\Actions'); |
| 9 | }); | 10 | }); |
| 10 | 11 | ||
| 11 | class Actions { | 12 | class Actions |
| 13 | { | ||
| 12 | 14 | ||
| 13 | public static function admin_print_styles() { | 15 | public static function admin_print_styles() |
| 16 | { | ||
| 14 | _enqueue_style('branding-style', Tools\url('css/tenzing.css', __FILE__)); | 17 | _enqueue_style('branding-style', Tools\url('css/tenzing.css', __FILE__)); |
| 15 | } | 18 | } |
| 16 | 19 | ||
| 17 | public static function admin_print_scripts() { | 20 | public static function admin_print_scripts() |
| 18 | wp_enqueue_script('jquery-alerts', Tools\url('jquery_alerts/jquery.alerts.js', __FILE__), Array('jquery'), '1.1'); | 21 | { |
| 19 | wp_enqueue_script('colorbox', Tools\url('scripts/jquery.colorbox.js', __FILE__), Array('jquery')); | 22 | wp_enqueue_script('jquery-alerts', Tools\url('jquery_alerts/jquery.alerts.js', __FILE__), array('jquery'), '1.1'); |
| 23 | wp_enqueue_script('colorbox', Tools\url('scripts/jquery.colorbox.js', __FILE__), array('jquery')); | ||
| 20 | 24 | ||
| 21 | wp_enqueue_script('date', Tools\url('scripts/date.js', __FILE__)); | 25 | wp_enqueue_script('date', Tools\url('scripts/date.js', __FILE__)); |
| 22 | wp_enqueue_script('jquery-ui-datepicker'); | 26 | wp_enqueue_script('jquery-ui-datepicker'); |
| 23 | wp_enqueue_script('jquery-admin-uploadify', Tools\url('uploadify/jquery.uploadify.v2.1.4.js', __FILE__), Array('jquery','swfobject')); | 27 | wp_enqueue_script('jquery-admin-uploadify', Tools\url('uploadify/jquery.uploadify.v2.1.4.js', __FILE__), array('jquery', 'swfobject')); |
| 24 | } | 28 | } |
| 25 | 29 | ||
| 26 | public static function admin_head() { | 30 | public static function admin_head() |
| 31 | { | ||
| 27 | ?> | 32 | ?> |
| 28 | <style type="text/css" media="screen"> | 33 | <style type="text/css" media="screen"> |
| 29 | #toplevel_page_cbvreport .wp-menu-image a img { display:none; } | 34 | #toplevel_page_cbvreport .wp-menu-image a img { display:none; } |
| ... | @@ -41,37 +46,36 @@ class Actions { | ... | @@ -41,37 +46,36 @@ class Actions { |
| 41 | #toplevel_page_cbv_options:hover .wp-menu-image, #menu-posts-POSTTYPE.wp-has-current-submenu .wp-menu-image { | 46 | #toplevel_page_cbv_options:hover .wp-menu-image, #menu-posts-POSTTYPE.wp-has-current-submenu .wp-menu-image { |
| 42 | background-position:6px 7px!important; | 47 | background-position:6px 7px!important; |
| 43 | } | 48 | } |
| 44 | |||
| 45 | |||
| 46 | |||
| 47 | </style> | 49 | </style> |
| 48 | <?php | 50 | <?php |
| 49 | 51 | ||
| 50 | |||
| 51 | /* | 52 | /* |
| 52 | global $current_user; | 53 | global $current_user; |
| 53 | get_currentuserinfo(); | 54 | get_currentuserinfo(); |
| 54 | 55 | ||
| 55 | include('views/header.php'); | 56 | include('views/header.php'); |
| 56 | */ | 57 | */ |
| 57 | } | 58 | } |
| 58 | 59 | ||
| 59 | public static function admin_footer_text() { | 60 | public static function admin_footer_text() |
| 61 | { | ||
| 60 | echo '© ' . date('Y') . ' Tenzing Communications Inc.'; | 62 | echo '© ' . date('Y') . ' Tenzing Communications Inc.'; |
| 61 | } | 63 | } |
| 62 | 64 | ||
| 63 | public static function login_head() { | 65 | public static function login_head() |
| 66 | { | ||
| 64 | echo '<link rel="stylesheet" type="text/css" href="' . Tools\url('css/tz_login.css', __FILE__) . '" />'; | 67 | echo '<link rel="stylesheet" type="text/css" href="' . Tools\url('css/tz_login.css', __FILE__) . '" />'; |
| 68 | echo '<script src="' . Tools\url('scripts/tz_login.js', __FILE__) . '" ></script>'; | ||
| 65 | } | 69 | } |
| 66 | 70 | ||
| 67 | public static function admin_menu() { | 71 | public static function admin_menu() |
| 68 | rename_admin_menu_section('Posts','Publications'); | 72 | { |
| 69 | swap_admin_menu_sections('CBV Options','Publications'); | 73 | rename_admin_menu_section('Posts', 'Publications'); |
| 74 | swap_admin_menu_sections('CBV Options', 'Publications'); | ||
| 70 | } | 75 | } |
| 71 | 76 | ||
| 72 | |||
| 73 | } | 77 | } |
| 74 | 78 | ||
| 75 | //Tools\add_actions(__NAMESPACE__ . '\Actions'); | 79 | //Tools\add_actions(__NAMESPACE__ . '\Actions'); |
| 76 | 80 | ||
| 77 | ?> | 81 | ?> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | html, | 1 | html, |
| 2 | body { | 2 | body { |
| 3 | overflow: hidden; | 3 | overflow: hidden; |
| 4 | width:100%; | 4 | width: 100%; |
| 5 | } | 5 | } |
| 6 | 6 | ||
| 7 | #login { | 7 | #login { |
| ... | @@ -39,9 +39,10 @@ body.login { | ... | @@ -39,9 +39,10 @@ body.login { |
| 39 | 39 | ||
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | #login_error, .message { | 42 | #login_error, |
| 43 | .message { | ||
| 43 | position: absolute; | 44 | position: absolute; |
| 44 | bottom:0; | 45 | bottom: 0; |
| 45 | } | 46 | } |
| 46 | 47 | ||
| 47 | .login #nav a { | 48 | .login #nav a { |
| ... | @@ -52,15 +53,17 @@ body.login { | ... | @@ -52,15 +53,17 @@ body.login { |
| 52 | 53 | ||
| 53 | text-decoration: underline; | 54 | text-decoration: underline; |
| 54 | } | 55 | } |
| 56 | |||
| 55 | @media(min-width:601px) { | 57 | @media(min-width:601px) { |
| 56 | #login h1 { | 58 | #login h1 { |
| 57 | /* display: none; */ | 59 | |
| 60 | font-size: 32px; | ||
| 58 | position: absolute; | 61 | position: absolute; |
| 59 | width: auto; | 62 | width: auto; |
| 60 | min-height: 250px; | 63 | min-height: 250px; |
| 61 | padding: 60px 100px 100px 240px; | 64 | |
| 62 | margin-left: 32%; | 65 | margin-left: 35%; |
| 63 | margin-top: 6%; | 66 | margin-top: 9%; |
| 64 | pointer-events: none; | 67 | pointer-events: none; |
| 65 | } | 68 | } |
| 66 | } | 69 | } |
| ... | @@ -79,39 +82,41 @@ body.login { | ... | @@ -79,39 +82,41 @@ body.login { |
| 79 | 82 | ||
| 80 | @media(max-width:600px) { | 83 | @media(max-width:600px) { |
| 81 | #backtoblog:before { | 84 | #backtoblog:before { |
| 82 | margin-top:39px; | 85 | margin-top: 39px; |
| 83 | margin-left:-10px; | 86 | margin-left: -10px; |
| 84 | } | 87 | } |
| 85 | } | 88 | } |
| 86 | 89 | ||
| 87 | #login h1 span { | 90 | |
| 88 | display:block; | 91 | h1.login_h1 { |
| 89 | position: absolute; | 92 | color: #221d58 !important; |
| 90 | left:0; | 93 | text-transform: uppercase; |
| 91 | font-size:24px; | 94 | font-size: 40px; |
| 92 | color:#221D58 !important; | 95 | font-family: "MyanmarMN"; |
| 93 | pointer-events: none; | 96 | line-height: 50px !important; |
| 94 | max-width: 220px; | 97 | text-align: left; |
| 95 | min-width: 220px; | 98 | } |
| 96 | line-height: 1.2; | 99 | |
| 97 | text-align: center; | 100 | h1.login_h1 .dark { |
| 101 | color: #3BA3A2 !important; | ||
| 98 | } | 102 | } |
| 99 | 103 | ||
| 100 | 104 | ||
| 101 | @media(max-width:1000px) and (min-width:601px) { | 105 | @media(max-width:1000px) and (min-width:601px) { |
| 102 | #login h1 span { | 106 | #login h1 span { |
| 103 | left:0; | 107 | left: 0; |
| 104 | min-width: auto; | 108 | min-width: auto; |
| 105 | } | 109 | } |
| 106 | } | 110 | } |
| 107 | 111 | ||
| 108 | @media(max-width:800px) and (min-width:601px) { | 112 | @media(max-width:800px) and (min-width:601px) { |
| 109 | #login h1 span { | 113 | #login h1 span { |
| 110 | left:0; | 114 | left: 0; |
| 111 | top:200px; | 115 | top: 200px; |
| 112 | } | 116 | } |
| 113 | #login { | 117 | |
| 114 | padding:10% 0 0; | 118 | #login { |
| 119 | padding: 10% 0 0; | ||
| 115 | } | 120 | } |
| 116 | } | 121 | } |
| 117 | 122 | ||
| ... | @@ -229,10 +234,11 @@ label { | ... | @@ -229,10 +234,11 @@ label { |
| 229 | } | 234 | } |
| 230 | 235 | ||
| 231 | @media(max-width: 700px) { | 236 | @media(max-width: 700px) { |
| 237 | |||
| 232 | #user_pass, | 238 | #user_pass, |
| 233 | #user_login, | 239 | #user_login, |
| 234 | #user_email { | 240 | #user_email { |
| 235 | width:250px; | 241 | width: 250px; |
| 236 | } | 242 | } |
| 237 | } | 243 | } |
| 238 | 244 | ||
| ... | @@ -295,8 +301,8 @@ label { | ... | @@ -295,8 +301,8 @@ label { |
| 295 | 301 | ||
| 296 | } | 302 | } |
| 297 | 303 | ||
| 298 | #login h1 { | 304 | #login h1 { |
| 299 | margin-left:17%; | 305 | margin-left: 17%; |
| 300 | } | 306 | } |
| 301 | 307 | ||
| 302 | #login h1 span { | 308 | #login h1 span { |
| ... | @@ -308,36 +314,37 @@ label { | ... | @@ -308,36 +314,37 @@ label { |
| 308 | } | 314 | } |
| 309 | 315 | ||
| 310 | @media (max-width: 1000px) { | 316 | @media (max-width: 1000px) { |
| 311 | #login h1 { | 317 | #login h1 { |
| 312 | margin-left:17%; | 318 | margin-left: 17%; |
| 313 | } | 319 | } |
| 314 | } | 320 | } |
| 315 | 321 | ||
| 316 | @media (max-width: 900px) { | 322 | @media (max-width: 900px) { |
| 317 | 323 | ||
| 318 | #backtoblog { | 324 | #backtoblog { |
| 319 | top:150px; | 325 | top: 150px; |
| 320 | } | 326 | } |
| 321 | 327 | ||
| 322 | #login form { | 328 | #login form { |
| 323 | margin-top: 18%; | 329 | margin-top: 18%; |
| 324 | width: 40%; | 330 | width: 40%; |
| 325 | } | 331 | } |
| 326 | #login h1 { | 332 | |
| 327 | margin-left:20%; | 333 | #login h1 { |
| 328 | margin-top:20%; | 334 | margin-left: 20%; |
| 335 | margin-top: 20%; | ||
| 329 | } | 336 | } |
| 330 | } | 337 | } |
| 331 | 338 | ||
| 332 | @media (max-width: 800px) { | 339 | @media (max-width: 800px) { |
| 333 | #login h1 { | 340 | #login h1 { |
| 334 | margin-top:0; | 341 | margin-top: 0; |
| 335 | } | 342 | } |
| 336 | } | 343 | } |
| 337 | 344 | ||
| 338 | @media (max-width: 700px) { | 345 | @media (max-width: 700px) { |
| 339 | #backtoblog { | 346 | #backtoblog { |
| 340 | top:120px; | 347 | top: 120px; |
| 341 | } | 348 | } |
| 342 | 349 | ||
| 343 | } | 350 | } |
| ... | @@ -404,9 +411,9 @@ label { | ... | @@ -404,9 +411,9 @@ label { |
| 404 | } | 411 | } |
| 405 | 412 | ||
| 406 | #login h1 { | 413 | #login h1 { |
| 407 | width:auto; | 414 | width: auto; |
| 408 | position: absolute; | 415 | position: absolute; |
| 409 | top:120px; | 416 | top: 120px; |
| 410 | } | 417 | } |
| 411 | 418 | ||
| 412 | 419 | ||
| ... | @@ -432,34 +439,34 @@ label { | ... | @@ -432,34 +439,34 @@ label { |
| 432 | } | 439 | } |
| 433 | 440 | ||
| 434 | 441 | ||
| 435 | #login h1 span { | 442 | #login h1 span { |
| 436 | left:0; | 443 | left: 0; |
| 437 | top:20px; | 444 | top: 20px; |
| 438 | min-width: auto; | 445 | min-width: auto; |
| 439 | max-width: none; | 446 | max-width: none; |
| 440 | white-space: nowrap; | 447 | white-space: nowrap; |
| 441 | } | 448 | } |
| 442 | 449 | ||
| 443 | #login form { | 450 | #login form { |
| 444 | padding:15% !important; | 451 | padding: 15% !important; |
| 445 | margin-top:80px !important; | 452 | margin-top: 80px !important; |
| 446 | } | 453 | } |
| 447 | 454 | ||
| 448 | h1 { | 455 | h1 { |
| 449 | margin-left:15% !important; | 456 | margin-left: 15% !important; |
| 450 | width:100%; | 457 | width: 100%; |
| 451 | 458 | ||
| 452 | } | 459 | } |
| 453 | 460 | ||
| 454 | label { | 461 | label { |
| 455 | margin-left:0 !important; | 462 | margin-left: 0 !important; |
| 456 | } | 463 | } |
| 457 | 464 | ||
| 458 | #backtoblog { | 465 | #backtoblog { |
| 459 | 466 | ||
| 460 | left:auto; | 467 | left: auto; |
| 461 | right:0; | 468 | right: 0; |
| 462 | top:0; | 469 | top: 0; |
| 463 | 470 | ||
| 464 | } | 471 | } |
| 465 | 472 | ||
| ... | @@ -467,7 +474,7 @@ label { | ... | @@ -467,7 +474,7 @@ label { |
| 467 | 474 | ||
| 468 | } | 475 | } |
| 469 | 476 | ||
| 470 | @media(max-height:500px){ | 477 | @media(max-height:500px) { |
| 471 | body.login { | 478 | body.login { |
| 472 | background-position: bottom left !important; | 479 | background-position: bottom left !important; |
| 473 | } | 480 | } |
| ... | @@ -478,6 +485,7 @@ label { | ... | @@ -478,6 +485,7 @@ label { |
| 478 | background: url(../images/LogIn@15x.png) no-repeat -220px; | 485 | background: url(../images/LogIn@15x.png) no-repeat -220px; |
| 479 | background-size: auto 100%; | 486 | background-size: auto 100%; |
| 480 | } | 487 | } |
| 488 | |||
| 481 | #login form { | 489 | #login form { |
| 482 | width: 100%; | 490 | width: 100%; |
| 483 | background-size: 872px 398px !important; | 491 | background-size: 872px 398px !important; |
| ... | @@ -489,9 +497,7 @@ label { | ... | @@ -489,9 +497,7 @@ label { |
| 489 | background-size: 100px 55px !important; | 497 | background-size: 100px 55px !important; |
| 490 | } | 498 | } |
| 491 | 499 | ||
| 492 | .login #nav { | 500 | .login #nav {} |
| 493 | |||
| 494 | } | ||
| 495 | 501 | ||
| 496 | #backtoblog { | 502 | #backtoblog { |
| 497 | top: -10px; | 503 | top: -10px; |
| ... | @@ -501,15 +507,15 @@ label { | ... | @@ -501,15 +507,15 @@ label { |
| 501 | 507 | ||
| 502 | #login_error, | 508 | #login_error, |
| 503 | .message { | 509 | .message { |
| 504 | position: relative; | 510 | position: relative; |
| 505 | top:80px; | 511 | top: 80px; |
| 506 | } | 512 | } |
| 507 | } | 513 | } |
| 508 | 514 | ||
| 509 | @media (max-width: 380px) { | 515 | @media (max-width: 380px) { |
| 510 | #login form { | 516 | #login form { |
| 511 | width: 140%; | 517 | width: 140%; |
| 512 | margin-left:0; | 518 | margin-left: 0; |
| 513 | background-size: 872px 398px !important; | 519 | background-size: 872px 398px !important; |
| 514 | } | 520 | } |
| 515 | 521 | ||
| ... | @@ -519,8 +525,7 @@ label { | ... | @@ -519,8 +525,7 @@ label { |
| 519 | background-size: 100px 55px !important; | 525 | background-size: 100px 55px !important; |
| 520 | } | 526 | } |
| 521 | 527 | ||
| 522 | .login #nav { | 528 | .login #nav {} |
| 523 | } | ||
| 524 | 529 | ||
| 525 | #backtoblog { | 530 | #backtoblog { |
| 526 | top: 30px; | 531 | top: 30px; | ... | ... |
com/Branding/scripts/tz_login.js
0 → 100644
| 1 | jQuery(document).ready(function ($) { | ||
| 2 | var first = $(location).attr('pathname'); | ||
| 3 | if (getUrlVars()["action"]) { | ||
| 4 | first = 'lostpassword'; | ||
| 5 | } | ||
| 6 | |||
| 7 | first.indexOf(1); | ||
| 8 | |||
| 9 | first.toLowerCase(); | ||
| 10 | |||
| 11 | first = first.split("/")[1]; | ||
| 12 | |||
| 13 | if (first == "wp-login.php") { | ||
| 14 | $('h1').addClass('login_h1'); | ||
| 15 | $('h1').html('LOG <span class="dark">IN:</span>'); | ||
| 16 | } else if (first = 'lostpassword') { | ||
| 17 | $('h1').addClass('login_h1'); | ||
| 18 | $('h1').html('RESET</br> <span class="dark">PASSWORD:</span>'); | ||
| 19 | } | ||
| 20 | |||
| 21 | |||
| 22 | function getUrlVars() { | ||
| 23 | var vars = [], hash; | ||
| 24 | var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); | ||
| 25 | for (var i = 0; i < hashes.length; i++) { | ||
| 26 | hash = hashes[i].split('='); | ||
| 27 | vars.push(hash[0]); | ||
| 28 | vars[hash[0]] = hash[1]; | ||
| 29 | } | ||
| 30 | return vars; | ||
| 31 | } | ||
| 32 | }); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -4,7 +4,7 @@ Plugin Name: Tenzing Tools | ... | @@ -4,7 +4,7 @@ Plugin Name: Tenzing Tools |
| 4 | Version: 0.4b | 4 | Version: 0.4b |
| 5 | Description: Various classes and functions to help out with stuff | 5 | Description: Various classes and functions to help out with stuff |
| 6 | Author: Tenzing | 6 | Author: Tenzing |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | namespace Tz\WordPress\Tools; | 9 | namespace Tz\WordPress\Tools; |
| 10 | 10 | ||
| ... | @@ -13,33 +13,33 @@ use ReflectionClass; | ... | @@ -13,33 +13,33 @@ use ReflectionClass; |
| 13 | use ReflectionMethod; | 13 | use ReflectionMethod; |
| 14 | use Tz\WordPress\Tools\ShortCodes; | 14 | use Tz\WordPress\Tools\ShortCodes; |
| 15 | 15 | ||
| 16 | spl_autoload_register(__NAMESPACE__.'\autoloader'); | 16 | spl_autoload_register(__NAMESPACE__ . '\autoloader'); |
| 17 | 17 | ||
| 18 | add_action( 'login_headertext', function($title) { | 18 | add_action('login_headertext', function ($title) { |
| 19 | if($_REQUEST['action'] == 'lostpassword') { | 19 | if ($_REQUEST['action'] == 'lostpassword') { |
| 20 | return "RESET PASSWORD:"; | 20 | return "RESET PASSWORD:"; |
| 21 | } | 21 | } |
| 22 | return "LOG IN:"; | 22 | return "LOG IN:"; |
| 23 | } ); | 23 | }); |
| 24 | 24 | ||
| 25 | add_filter( 'gettext_with_context', function($translated) { | 25 | add_filter('gettext_with_context', function ($translated) { |
| 26 | // Use the text string exactly as it is in the translation file | 26 | // Use the text string exactly as it is in the translation file |
| 27 | if ( $translated == "← Back to %s" ) { | 27 | if ($translated == "← Back to %s") { |
| 28 | $translated = "Back to %s"; | 28 | $translated = "Back to %s"; |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | return $translated; | 31 | return $translated; |
| 32 | } ); | 32 | }); |
| 33 | 33 | ||
| 34 | // Code to prevent PHP from parsing Symlinks | 34 | // Code to prevent PHP from parsing Symlinks |
| 35 | if (defined(__NAMESPACE__.'\DIR')) { | 35 | if (defined(__NAMESPACE__ . '\DIR')) { |
| 36 | define(__NAMESPACE__.'\OVERRIDE', 1); | 36 | define(__NAMESPACE__ . '\OVERRIDE', 1); |
| 37 | } else { | 37 | } else { |
| 38 | define(__NAMESPACE__.'\DIR', __DIR__); | 38 | define(__NAMESPACE__ . '\DIR', __DIR__); |
| 39 | } | 39 | } |
| 40 | define(__NAMESPACE__.'\FILE', DIR.DIRECTORY_SEPARATOR.basename(__FILE__)); | 40 | define(__NAMESPACE__ . '\FILE', DIR . DIRECTORY_SEPARATOR . basename(__FILE__)); |
| 41 | 41 | ||
| 42 | require_once(DIR.DIRECTORY_SEPARATOR.'wp_functions.php'); | 42 | require_once DIR . DIRECTORY_SEPARATOR . 'wp_functions.php'; |
| 43 | 43 | ||
| 44 | _register_script('addEvent', url('scripts/addEvent.js', FILE)); | 44 | _register_script('addEvent', url('scripts/addEvent.js', FILE)); |
| 45 | _register_script('xmlhttpHandler', url('scripts/xmlhttpHandler.js', FILE)); | 45 | _register_script('xmlhttpHandler', url('scripts/xmlhttpHandler.js', FILE)); |
| ... | @@ -55,28 +55,28 @@ if (defined('Tz\DEBUG') && Tz\DEBUG === true) { | ... | @@ -55,28 +55,28 @@ if (defined('Tz\DEBUG') && Tz\DEBUG === true) { |
| 55 | 55 | ||
| 56 | function import($com) | 56 | function import($com) |
| 57 | { | 57 | { |
| 58 | $dir = DIR.DIRECTORY_SEPARATOR.'com'.DIRECTORY_SEPARATOR.$com.DIRECTORY_SEPARATOR; | 58 | $dir = DIR . DIRECTORY_SEPARATOR . 'com' . DIRECTORY_SEPARATOR . $com . DIRECTORY_SEPARATOR; |
| 59 | $file = $dir.$com.'.php'; | 59 | $file = $dir . $com . '.php'; |
| 60 | if (is_dir($dir) && is_file($file)) { | 60 | if (is_dir($dir) && is_file($file)) { |
| 61 | require_once($file); | 61 | require_once $file; |
| 62 | Vars::$loaded[$com] = 1; | 62 | Vars::$loaded[$com] = 1; |
| 63 | } | 63 | } |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | function autoloader($class) | 66 | function autoloader($class) |
| 67 | { | 67 | { |
| 68 | $a = explode('\\', $class); | 68 | $a = explode('\\', $class); |
| 69 | $class = array_pop($a); | 69 | $class = array_pop($a); |
| 70 | 70 | ||
| 71 | $file = DIR.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.$class.'.php'; | 71 | $file = DIR . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . $class . '.php'; |
| 72 | if (is_file($file)) { | 72 | if (is_file($file)) { |
| 73 | include($file); | 73 | include $file; |
| 74 | } | 74 | } |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | function url($script, $base_file = false) | 77 | function url($script, $base_file = false) |
| 78 | { | 78 | { |
| 79 | if (defined(__NAMESPACE__.'\OVERRIDE')) { | 79 | if (defined(__NAMESPACE__ . '\OVERRIDE')) { |
| 80 | $info = [pathinfo(DIR), pathinfo(__DIR__)]; | 80 | $info = [pathinfo(DIR), pathinfo(__DIR__)]; |
| 81 | 81 | ||
| 82 | // This should replace link for tz-tools com components | 82 | // This should replace link for tz-tools com components |
| ... | @@ -86,16 +86,16 @@ function url($script, $base_file = false) | ... | @@ -86,16 +86,16 @@ function url($script, $base_file = false) |
| 86 | $base_file = str_replace($info[1]['dirname'], $info[0]['dirname'], $base_file, $r); | 86 | $base_file = str_replace($info[1]['dirname'], $info[0]['dirname'], $base_file, $r); |
| 87 | 87 | ||
| 88 | // This should replace for theme files | 88 | // This should replace for theme files |
| 89 | $theme_dir = get_theme_root().DIRECTORY_SEPARATOR.get_template(); | 89 | $theme_dir = get_theme_root() . DIRECTORY_SEPARATOR . get_template(); |
| 90 | if (is_link($theme_dir)) { | 90 | if (is_link($theme_dir)) { |
| 91 | $base_file = str_replace(readlink($theme_dir), $theme_dir.DIRECTORY_SEPARATOR, $base_file); | 91 | $base_file = str_replace(readlink($theme_dir), $theme_dir . DIRECTORY_SEPARATOR, $base_file); |
| 92 | } | 92 | } |
| 93 | // I probably will need to add another replace for plugins (if we use plugins w/ tz-tools, prolly won't come to think of it) | 93 | // I probably will need to add another replace for plugins (if we use plugins w/ tz-tools, prolly won't come to think of it) |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | $base_dir = (false === $base_file ? DIR : dirname($base_file)); | 96 | $base_dir = (false === $base_file ? DIR : dirname($base_file)); |
| 97 | $rel_path = str_replace(ABSPATH, '', $base_dir); | 97 | $rel_path = str_replace(ABSPATH, '', $base_dir); |
| 98 | $script = site_url().'/'.$rel_path.'/'.$script; | 98 | $script = site_url() . '/' . $rel_path . '/' . $script; |
| 99 | 99 | ||
| 100 | return $script; | 100 | return $script; |
| 101 | } | 101 | } |
| ... | @@ -103,7 +103,7 @@ function url($script, $base_file = false) | ... | @@ -103,7 +103,7 @@ function url($script, $base_file = false) |
| 103 | function tools_url() | 103 | function tools_url() |
| 104 | { | 104 | { |
| 105 | $args = func_get_args(); | 105 | $args = func_get_args(); |
| 106 | call_user_func_array(__NAMESPACE__.'\url', $args); | 106 | call_user_func_array(__NAMESPACE__ . '\url', $args); |
| 107 | } | 107 | } |
| 108 | 108 | ||
| 109 | /** | 109 | /** |
| ... | @@ -161,7 +161,7 @@ function add_actions($class) | ... | @@ -161,7 +161,7 @@ function add_actions($class) |
| 161 | throw new Exception("{$class} does not exist"); | 161 | throw new Exception("{$class} does not exist"); |
| 162 | } | 162 | } |
| 163 | 163 | ||
| 164 | $ref = new ReflectionClass($class); | 164 | $ref = new ReflectionClass($class); |
| 165 | $actions = $ref->getMethods(ReflectionMethod::IS_STATIC); | 165 | $actions = $ref->getMethods(ReflectionMethod::IS_STATIC); |
| 166 | foreach ($actions as $action) { | 166 | foreach ($actions as $action) { |
| 167 | add_action($action->name, [$class, $action->name]); | 167 | add_action($action->name, [$class, $action->name]); |
| ... | @@ -174,7 +174,7 @@ function add_filters($class) | ... | @@ -174,7 +174,7 @@ function add_filters($class) |
| 174 | throw new Exception("{$class} does not exist"); | 174 | throw new Exception("{$class} does not exist"); |
| 175 | } | 175 | } |
| 176 | 176 | ||
| 177 | $ref = new ReflectionClass($class); | 177 | $ref = new ReflectionClass($class); |
| 178 | $methods = $ref->getMethods(ReflectionMethod::IS_STATIC); | 178 | $methods = $ref->getMethods(ReflectionMethod::IS_STATIC); |
| 179 | foreach ($methods as $method) { | 179 | foreach ($methods as $method) { |
| 180 | add_filter($method->name, [$class, $method->name]); | 180 | add_filter($method->name, [$class, $method->name]); |
| ... | @@ -192,7 +192,7 @@ function add_settings_fields($class, $page = 'general', $section = 'default') | ... | @@ -192,7 +192,7 @@ function add_settings_fields($class, $page = 'general', $section = 'default') |
| 192 | throw new Exception("{$class} does not exist"); | 192 | throw new Exception("{$class} does not exist"); |
| 193 | } | 193 | } |
| 194 | 194 | ||
| 195 | $ref = new ReflectionClass($class); | 195 | $ref = new ReflectionClass($class); |
| 196 | $methods = $ref->getMethods(ReflectionMethod::IS_STATIC); | 196 | $methods = $ref->getMethods(ReflectionMethod::IS_STATIC); |
| 197 | foreach ($methods as $method) { | 197 | foreach ($methods as $method) { |
| 198 | add_settings_field( | 198 | add_settings_field( |
| ... | @@ -218,12 +218,12 @@ function TzSuperPaginationBar( | ... | @@ -218,12 +218,12 @@ function TzSuperPaginationBar( |
| 218 | 218 | ||
| 219 | $bar = '<div class="TzSuperPaginationBar">'; | 219 | $bar = '<div class="TzSuperPaginationBar">'; |
| 220 | if ($show_search) { | 220 | if ($show_search) { |
| 221 | $bar .= '<div class="pagination-search"><form id="TzPaginationSearch"><input type="hidden" name="post_type" value="'.$post_type.'" /><input name="search_criteria" type="input" /></form></div>'; | 221 | $bar .= '<div class="pagination-search"><form id="TzPaginationSearch"><input type="hidden" name="post_type" value="' . $post_type . '" /><input name="search_criteria" type="input" /></form></div>'; |
| 222 | } | 222 | } |
| 223 | if ($show_advanced) { | 223 | if ($show_advanced) { |
| 224 | $bar .= '<div class="pagination-advanced"><a href="#" onclick="return false;">Advanced</a></div>'; | 224 | $bar .= '<div class="pagination-advanced"><a href="#" onclick="return false;">Advanced</a></div>'; |
| 225 | } | 225 | } |
| 226 | $bar .= '<div class="pagination-paging">'.pagination($posts, $pages, $range, $before, $after, false).'</div>'; | 226 | $bar .= '<div class="pagination-paging">' . pagination($posts, $pages, $range, $before, $after, false) . '</div>'; |
| 227 | $bar .= '<div style="clear:both;"></div>'; | 227 | $bar .= '<div style="clear:both;"></div>'; |
| 228 | $bar .= '</div>'; | 228 | $bar .= '</div>'; |
| 229 | 229 | ||
| ... | @@ -251,27 +251,27 @@ function pagination($posts, $pages, $range = 2, $before = '', $after = '', $echo | ... | @@ -251,27 +251,27 @@ function pagination($posts, $pages, $range = 2, $before = '', $after = '', $echo |
| 251 | $p .= $before; | 251 | $p .= $before; |
| 252 | 252 | ||
| 253 | if ($paged > 2 && $paged > $range + 1 && $showitems < $pages) { | 253 | if ($paged > 2 && $paged > $range + 1 && $showitems < $pages) { |
| 254 | $p .= "<a href='".get_pagenum_link(1)."'>«</a>"; | 254 | $p .= "<a href='" . get_pagenum_link(1) . "'>«</a>"; |
| 255 | } | 255 | } |
| 256 | if ($paged > 1 && $showitems < $pages) { | 256 | if ($paged > 1 && $showitems < $pages) { |
| 257 | $p .= "<a href='".get_pagenum_link($paged - 1)."'>‹</a>"; | 257 | $p .= "<a href='" . get_pagenum_link($paged - 1) . "'>‹</a>"; |
| 258 | } | 258 | } |
| 259 | 259 | ||
| 260 | for ($i = 1; $i <= $pages; $i++) { | 260 | for ($i = 1; $i <= $pages; $i++) { |
| 261 | if (1 != $pages && (!($i >= $paged + $range + 1 || $i <= $paged - $range - 1) || $pages <= $showitems)) { | 261 | if (1 != $pages && (!($i >= $paged + $range + 1 || $i <= $paged - $range - 1) || $pages <= $showitems)) { |
| 262 | $p .= ($paged == $i) | 262 | $p .= ($paged == $i) |
| 263 | ? "<span class='current'>".$i."</span>" | 263 | ? "<span class='current'>" . $i . "</span>" |
| 264 | : "<a href='".get_pagenum_link( | 264 | : "<a href='" . get_pagenum_link( |
| 265 | $i | 265 | $i |
| 266 | )."' class='inactive' >".$i."</a>"; | 266 | ) . "' class='inactive' >" . $i . "</a>"; |
| 267 | } | 267 | } |
| 268 | } | 268 | } |
| 269 | 269 | ||
| 270 | if ($paged < $pages && $showitems < $pages) { | 270 | if ($paged < $pages && $showitems < $pages) { |
| 271 | $p .= "<a href='".get_pagenum_link($paged + 1)."'>›</a>"; | 271 | $p .= "<a href='" . get_pagenum_link($paged + 1) . "'>›</a>"; |
| 272 | } | 272 | } |
| 273 | if ($paged < $pages - 1 && $paged + $range - 1 < $pages && $showitems < $pages) { | 273 | if ($paged < $pages - 1 && $paged + $range - 1 < $pages && $showitems < $pages) { |
| 274 | $p .= "<a href='".get_pagenum_link($pages)."'>»</a>"; | 274 | $p .= "<a href='" . get_pagenum_link($pages) . "'>»</a>"; |
| 275 | } | 275 | } |
| 276 | 276 | ||
| 277 | $p .= $after; | 277 | $p .= $after; |
| ... | @@ -288,5 +288,3 @@ class Vars | ... | @@ -288,5 +288,3 @@ class Vars |
| 288 | { | 288 | { |
| 289 | public static $loaded = []; | 289 | public static $loaded = []; |
| 290 | } | 290 | } |
| 291 | |||
| 292 | ?> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment