array( 'country' => 'Japan', 'url' => 'http://wpist.me/', ), 'Felix Kern' => array( 'country' => 'Germany', 'url' => 'http://twitter.com/#!/kernfel', ), 'Mako' => array( 'country' => 'Japan', 'url' => 'http://profiles.wordpress.org/users/mako09', ), ); private $translators = array( 'Takayuki Miyauchi' => array( 'lang' => 'Japanese', 'url' => 'http://wpist.me/', ), 'Andrea Bersi' => array( 'lang' => 'Italian', 'url' => 'http://www.andreabersi.com/', ), 'LiVsI' => array( 'lang' => 'Russian', 'url' => 'http://lezhnevs.ru/', ), 'Serkan Algur' => array( 'lang' => 'Turkish', 'url' => 'http://www.kaisercrazy.com/', ), 'Felix Kern' => array( 'lang' => 'German', 'url' => 'http://twitter.com/#!/kernfel', ), 'Guy Steyaert' => array( 'lang' => 'Dutch', 'url' => 'https://twitter.com/#!/ideosky/' ), 'missingPig' => array( 'lang' => 'Chinese', 'url' => 'https://github.com/missingPig' ), 'Alexander Ovsov' => array( 'lang' => 'Belarusian', 'url' => 'http://webhostinggeeks.com/science/' ), ); private $role = 'manage_options'; private $plugin_url = ''; private $page_title = 'WP Total Hacks'; private $params = array(); private $widgets = array( 'dashboard_right_now' => array( 'position' => 'normal', 'title' => 'Right Now' ), 'dashboard_recent_comments' => array( 'position' => 'normal', 'title' => 'Recent Comments' ), 'dashboard_incoming_links' => array( 'position' => 'normal', 'title' => 'Incoming Links' ), 'dashboard_plugins' => array( 'position' => 'normal', 'title' => 'Plugins' ), 'dashboard_quick_press' => array( 'position' => 'normal', 'title' => 'QuickPress' ), 'dashboard_recent_drafts' => array( 'position' => 'normal', 'title' => 'Recent Drafts' ), 'dashboard_primary' => array( 'position' => 'normal', 'title' => 'WordPress Blog' ), 'dashboard_secondary' => array( 'position' => 'normal', 'title' => 'Other WordPress News' ), ); private $post_metas = array( 'commentstatusdiv' => array( 'title' => 'Discussion' ), 'commentsdiv' => array( 'title' => 'Comments' ), 'slugdiv' => array( 'title' => 'Slug' ), 'authordiv' => array( 'title' => 'Author' ), 'postcustom' => array( 'title' => 'Custom Fields' ), 'postexcerpt' => array( 'title' => 'Excerpt' ), 'trackbacksdiv' => array( 'title' => 'Send Trackbacks' ), 'formatdiv' => array( 'title' => 'Format' ), 'tagsdiv-post_tag' => array( 'title' => 'Post Tags' ), 'categorydiv' => array( 'title' => 'Categories' ), ); private $page_metas = array( 'commentstatusdiv' => array( 'title' => 'Discussion' ), 'commentsdiv' => array( 'title' => 'Comments' ), 'slugdiv' => array( 'title' => 'Slug' ), 'authordiv' => array( 'title' => 'Author' ), 'postcustom' => array( 'title' => 'Custom Fields' ), ); private $contact_methods = array( 'aim' => 'AIM', 'yim' => 'Yahoo IM', 'jabber' => 'Jabber / Google Talk', ); function __construct($url, $params) { $this->plugin_url = $url; $this->params = $params; add_action('admin_menu', array(&$this, 'admin_menu')); add_filter('gettext', array(&$this, 'replace_text_in_thickbox'), 1, 3); } public function tiny_mce_before_init($init) { $init['plugins'] = str_replace( array('wpfullscreen',',,'), array('', ','), $init['plugins'] ); return $init; } public function admin_styles() { $style = $this->plugin_url.'/css/style.css'; printf( '', $style ); $tabstyle = $this->plugin_url.'/css/ui.tabs.css'; printf( '', $tabstyle ); } public function admin_scripts() { wp_enqueue_script('jquery-ui-tabs'); wp_enqueue_script('editor'); add_thickbox(); wp_register_script( 'wp-total-hacks-upload', $this->plugin_url.'/js/wp-total-hacks-upload.js', array('thickbox') ); wp_enqueue_script('wp-total-hacks-upload'); } public function admin_menu() { $hook = add_options_page( $this->page_title, 'WP Total Hacks', $this->role, 'wp-total-hacks', array(&$this, 'options') ); add_action("admin_head-".$hook, array(&$this, 'admin_head')); add_action('admin_print_scripts-'.$hook, array(&$this, 'admin_scripts')); add_action('admin_print_styles-'.$hook, array(&$this, 'admin_styles')); add_action("admin_init", array(&$this, 'admin_init')); } public function admin_head() { printf( "", $this->plugin_url ); if (isset($_GET['err']) && $_GET['err']) { add_action("admin_notices", array(&$this, "admin_notice")); } wp_admin_css(); do_action("admin_print_styles-post-php"); do_action('admin_print_styles'); add_filter('tiny_mce_before_init', array(&$this, 'tiny_mce_before_init'), 999); } public function replace_text_in_thickbox($translated_text, $source_text, $domain) { if (isset($_GET['post_id']) && !$_GET['post_id'] && 'Insert into Post' == $source_text) { return __('Select File', 'wp-total-hacks'); } return $translated_text; } public function admin_notice() { if (isset($_GET['err']) && $_GET['err']) { echo "
"; echo "Security failure!"; echo "