base_url = get_bloginfo('wpurl').'/'.Str_Replace("\\", '/', SubStr(RealPath(DirName(__FILE__)), Strlen(ABSPATH))); // Hooks Add_Action ('init', Array($this, 'Load_TextDomain')); If (Is_Admin()){ Add_Action ('admin_menu', Array($this, 'Register_Options_Page')); } Else { WP_Enqueue_Script('audio-link-player', $this->base_url . '/player-js.php', Array('jquery', 'swfobject'), $this->version, ($this->Get_Option('script_position') != 'header')); } // Add this to GLOBALS $GLOBALS[__CLASS__] = $this; } Function Load_TextDomain(){ $locale = Apply_Filters( 'plugin_locale', get_locale(), __CLASS__ ); Load_TextDomain (__CLASS__, DirName(__FILE__).'/language/' . $locale . '.mo'); } Function t ($text, $context = ''){ // Translates the string $text with context $context If ($context == '') return Translate ($text, __CLASS__); Else return Translate_With_GetText_Context ($text, $context, __CLASS__); } Function Register_Options_Page(){ $handle = Add_Options_Page( $this->t('Audio Link Player Settings'), $this->t('Audio Link Player'), 'manage_options', __CLASS__, Array($this, 'Print_Options_Page') ); Add_Action ('load-' . $handle, Array($this, 'Load_Options_Page')); } Function Load_Options_Page(){ WP_Enqueue_Script('farbtastic'); WP_Enqueue_Style('farbtastic'); WP_Enqueue_Script('audio-link-player-options', $this->base_url . '/options-page.js'); } Function Print_Options_Page(){ ?>