Plugin Directory

Changeset 145062


Ignore:
Timestamp:
08/12/2009 07:38:14 AM (17 years ago)
Author:
ruslany
Message:

Added more comments in the code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-media-player/trunk/wp-media-player.php

    r145043 r145062  
    7777        var $post_needs_meta = false;
    7878        var $content_save_pre_count = 0;
    79 
     79       
     80        /**
     81         * Constructor where all the WP hook handlers are assigned
     82         * @return nothing
     83         */
    8084        function wp_media_player()
    8185        {
     
    9498        }
    9599
     100        /**
     101         * Initialization of the plugin's configuration parameters
     102         * @return nothing
     103         */
    96104        function initialize()
    97105        {   
     
    121129            load_plugin_textdomain('wp-media-player', '/wp-content/plugins/wp-media-player/languages');
    122130        }
     131
    123132        /**
    124133         * Creates the database table for storing video views data.
    125134         * Also adds plugin options
    126135         *
    127          * @return
     136         * @return nothing
    128137         */
    129138        function create_playerstats_table()
     
    171180            add_option('wp_media_player_show_on_home_page', 0);
    172181        }
     182
    173183        /**
    174184         * Create a 2D array from a CSV string
     
    178188         * @param string $enclosure Field enclosure
    179189         * @param string $newline Line seperator
    180         * @return
     190        * @return 2D array
    181191        */
    182192        function str_parse_csv($data, $delimiter = ',', $enclosure = '"', $newline = '\n'){
     
    333343        }
    334344       
     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         */
    335351        function process_dimensions($width, $height)
    336352        {   
     
    366382        }
    367383
     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         */
    368390        function replace_tag_to_html( $content )
    369391        {
     
    476498        }
    477499
     500        /**
     501         * Checks if content contains the [mediaplayer] tag
     502         * @return unmodified content
     503         * @param object $content
     504         */
    478505        function check_for_tag( $content )
    479506        {
     
    498525        }
    499526
     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         */
    500533        function post_meta_tag( $id )
    501534        {
     
    519552        }
    520553
     554        /**
     555         * Enqueues all the JavaScript references necessary for the player to work
     556         * @return nothing
     557         */
    521558        function load_javascripts()
    522559        {   
     
    535572            }
    536573        }
    537        
     574
     575        /**
     576         * Enqueues the CSS for the adming page
     577         * @return nothing
     578         * @param object $hook_suffix
     579         */
    538580        function load_admin_style($hook_suffix) {
    539581            $player_admin_pages = array('wp-media-player/player-stats.php', 'wp-media-player/player-settings.php', 'wp-media-player/player-about.php');
     
    543585        }
    544586
     587        /**
     588         * Creates the HTML markup for the styles drop down box
     589         * @return HTML markup string
     590         * @param object $default[optional]
     591         */
    545592        function dropdown_styles( $default = 1 )
    546593        {
     
    556603        }
    557604
     605        /**
     606         * Registers the player's admin menus
     607         * @return nothing
     608         */
    558609        function player_menu() {
    559610            if (function_exists('add_menu_page')) {
     
    567618        }
    568619
     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         */
    569625        function add_media_button() {
    570626            global $post;
     
    574630            echo '<a href="../wp-content/plugins/wp-media-player/uploader.php?post_id='.$postid.'&tab=choose&TB_iframe=true&amp;height=500&amp;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>';
    575631        }
    576                
     632
     633        /**
     634         * Logs the tracking data about player playback.
     635         * @return nothing
     636         */
    577637        function process_ajax_stats_request()
    578638        {
     
    626686    if ( !isset($mp_plugin) )
    627687        $mp_plugin = new wp_media_player();
    628    
     688    // Run the function to process the AJAX call.
    629689    $mp_plugin -> process_ajax_stats_request();
    630690}
Note: See TracChangeset for help on using the changeset viewer.