Changeset 145062
- Timestamp:
- 08/12/2009 07:38:14 AM (17 years ago)
- File:
-
- 1 edited
-
wp-media-player/trunk/wp-media-player.php (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-media-player/trunk/wp-media-player.php
r145043 r145062 77 77 var $post_needs_meta = false; 78 78 var $content_save_pre_count = 0; 79 79 80 /** 81 * Constructor where all the WP hook handlers are assigned 82 * @return nothing 83 */ 80 84 function wp_media_player() 81 85 { … … 94 98 } 95 99 100 /** 101 * Initialization of the plugin's configuration parameters 102 * @return nothing 103 */ 96 104 function initialize() 97 105 { … … 121 129 load_plugin_textdomain('wp-media-player', '/wp-content/plugins/wp-media-player/languages'); 122 130 } 131 123 132 /** 124 133 * Creates the database table for storing video views data. 125 134 * Also adds plugin options 126 135 * 127 * @return 136 * @return nothing 128 137 */ 129 138 function create_playerstats_table() … … 171 180 add_option('wp_media_player_show_on_home_page', 0); 172 181 } 182 173 183 /** 174 184 * Create a 2D array from a CSV string … … 178 188 * @param string $enclosure Field enclosure 179 189 * @param string $newline Line seperator 180 * @return 190 * @return 2D array 181 191 */ 182 192 function str_parse_csv($data, $delimiter = ',', $enclosure = '"', $newline = '\n'){ … … 333 343 } 334 344 345 /** 346 * Updates player's dimensions to ensure aspect ratio is maintained 347 * @return updated dimensions 348 * @param object $width 349 * @param object $height 350 */ 335 351 function process_dimensions($width, $height) 336 352 { … … 366 382 } 367 383 384 /** 385 * Repaces all the [mediaplayer] tags within a post or a page with 386 * the JavaScript code for rendering media player 387 * @return updated content 388 * @param object $content 389 */ 368 390 function replace_tag_to_html( $content ) 369 391 { … … 476 498 } 477 499 500 /** 501 * Checks if content contains the [mediaplayer] tag 502 * @return unmodified content 503 * @param object $content 504 */ 478 505 function check_for_tag( $content ) 479 506 { … … 498 525 } 499 526 527 /** 528 * Adds a meta tag to a post or a page to indicate that the post contains 529 * [mediaplayer] tags. 530 * @return nothing 531 * @param object $id 532 */ 500 533 function post_meta_tag( $id ) 501 534 { … … 519 552 } 520 553 554 /** 555 * Enqueues all the JavaScript references necessary for the player to work 556 * @return nothing 557 */ 521 558 function load_javascripts() 522 559 { … … 535 572 } 536 573 } 537 574 575 /** 576 * Enqueues the CSS for the adming page 577 * @return nothing 578 * @param object $hook_suffix 579 */ 538 580 function load_admin_style($hook_suffix) { 539 581 $player_admin_pages = array('wp-media-player/player-stats.php', 'wp-media-player/player-settings.php', 'wp-media-player/player-about.php'); … … 543 585 } 544 586 587 /** 588 * Creates the HTML markup for the styles drop down box 589 * @return HTML markup string 590 * @param object $default[optional] 591 */ 545 592 function dropdown_styles( $default = 1 ) 546 593 { … … 556 603 } 557 604 605 /** 606 * Registers the player's admin menus 607 * @return nothing 608 */ 558 609 function player_menu() { 559 610 if (function_exists('add_menu_page')) { … … 567 618 } 568 619 620 /** 621 * Adds a button to a post or page edit UI that is used to insert 622 * the media player tag into the content 623 * @return 624 */ 569 625 function add_media_button() { 570 626 global $post; … … 574 630 echo '<a href="../wp-content/plugins/wp-media-player/uploader.php?post_id='.$postid.'&tab=choose&TB_iframe=true&height=500&width=640" class="thickbox" title="'.__('Silverlight Video','wp-media-player').'"><img src="'.get_bloginfo('wpurl').'/wp-content/plugins/wp-media-player/images/silverlight-button-download.gif" alt="'.__('Silverlight Video','wp-media-player').'"></a>'; 575 631 } 576 632 633 /** 634 * Logs the tracking data about player playback. 635 * @return nothing 636 */ 577 637 function process_ajax_stats_request() 578 638 { … … 626 686 if ( !isset($mp_plugin) ) 627 687 $mp_plugin = new wp_media_player(); 628 688 // Run the function to process the AJAX call. 629 689 $mp_plugin -> process_ajax_stats_request(); 630 690 }
Note: See TracChangeset
for help on using the changeset viewer.