__construct(); } function __construct(){ $this->settings = get_option( $this->settings_name ); $installed_version = get_option( $this->version_name ); $this->url = trailingslashit( plugins_url( '', __FILE__ ) ); $this->dir = trailingslashit( dirname( __FILE__ ) ); $this->mod_dir = $this->dir . 'modules/'; if( empty( $this->settings ) ) $this->install(); elseif ( 0 !== version_compare( $installed_version, $this->version ) ) $this->update( $installed_version ); foreach( array( 'init', 'admin_menu', 'admin_init' ) as $hook ) add_action( $hook, array( &$this, $hook ), 1 ); $this->td[] = basename(dirname(__FILE__)); $this->td[] = trailingslashit($this->td[0]) . 'languages'; } function install(){ $this->settings = array( 'modules' => array( 'easter_eggs' => false, 'bottom_corner' => false, ), ); update_option( $this->settings_name, $this->settings ); update_option( $this->version_name, $this->version ); } function update( $installed ){ switch( $installed ){ case '1.0': default: break; } update_option( $this->settings_name, $this->settings ); update_option( $this->version_name, $this->version ); } function init(){ load_plugin_textdomain( $this->td[0], null, $this->td[1] ); foreach( $this->settings['modules'] as $module => $include ){ if( $include && file_exists( $this->mod_dir . $module . '.php' ) ) include_once( $this->mod_dir . $module . '.php' ); } } function admin_init(){ $this->settings_group = $this->slug . '_settings_group'; register_setting( $this->settings_group, $this->settings_name, array( &$this, 'settings_san' ) ); add_settings_section( $this->settings_group . '_mods', _x( 'Modules', 'Section title', $this->td[0] ), '__return_false', $this->slug ); add_settings_field( $this->settings_group . '_modules', _x( 'Modules Available', 'option name', $this->td[0] ), array( &$this, 'mods_available' ), $this->slug, $this->settings_group . '_mods' ); do_action( 'alot_settings' ); } function admin_menu(){ $this->admin_page_title = $page_title = sprintf( __( '%s of Options', $this->td[0] ), 'Alot' ); add_options_page( $page_title, $page_title, 'manage_options', $this->slug, array( &$this, 'menu' ) ); } function menu(){ ?>
Easter Eggs across the whole site.', $this->td[0] ); ?>
td[0] ), 'Hyperbole and a Half' ); ?>