示例#1
0
 /**
  * Show actions to do on the list
  * @param  array $item The item displayed
  * @return array       Array of actions to perform
  */
 function column_title($item)
 {
     $wpfav = Wpfavs_Admin::get_instance();
     $actions = array('edit' => sprintf('<a href="' . $wpfav->api_url . 'my-wpfavs/edit/%s/" target="_blank">Edit Wp Fav</a>', $item['id']), 'run' => sprintf('<a href="?page=%s&action=%s&wpfav=%s">Run this list</a>', $wpfav->plugin_slug, 'run-wpfav', $item['id']));
     //If we are importing wp user favorites remove edit from actions
     if (7331 === $item['id']) {
         unset($actions['edit']);
     }
     return sprintf('%1$s %2$s', $item['title'], $this->row_actions($actions));
 }
示例#2
0
 /**
  * Return an instance of this class.
  *
  * @since     1.0.0
  *
  * @return    object    A single instance of this class.
  */
 public static function get_instance()
 {
     /*
      * @TODO :
      *
      * - Uncomment following lines if the admin class should only be available for super admins
      */
     /* if( ! is_super_admin() ) {
     			return;
     		} */
     // If the single instance hasn't been set, set it now.
     if (null == self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
示例#3
0
文件: main.php 项目: RobinCee/wpfavs
" class="regular-text" value="<?php 
echo $this->wp_user;
?>
" />
		<input class="button-primary wpfav_apikey-button" data-what="wp_username" type="submit" value="<?php 
_e('Load Favorites', $this->plugin_slug);
?>
" name="Submit">
	</form>

	<div id="wplists">
		<div class="loading">
			<?php 
_e('Establishing connection to remote server, please wait', $this->plugin_slug);
?>
			<img src="<?php 
echo site_url('wp-admin/images/wpspin_light.gif');
?>
" alt="loading" class="spin"/>
		</div>
		<div id="wpfav-response">
			<?php 
if (!empty($this->api_key_response)) {
    Wpfavs_Admin::print_table($this->api_key_response);
}
?>
		</div>

	</div><!--wplists-->

</div><!--post-body-->	
示例#4
0
 * @link      http://wp.timersys.com/wpfavs
 * @copyright 2014 Timersys
 */
?>




<a href="<?php 
echo admin_url('tools.php?page=' . $this->plugin_slug);
?>
">&larr; Go Back</a>
<div id="wpfav-response">
	<form id="wpfavs" method="post">
	<?php 
if (!empty($_GET['wpfav'])) {
    //We are showing Wp favorites
    if ('7331' == $_GET['wpfav']) {
        Wpfavs_Admin::print_plugins_table($this->wp_response[$_GET['wpfav']]['plugins']);
    } else {
        Wpfavs_Admin::print_plugins_table($this->api_key_response[$_GET['wpfav']]['plugins']);
    }
} else {
    echo $this->message_box('error', __("You didn't selected a Wp Fav to show", $this->plugin_slug));
}
?>
	</form>
</div>


示例#5
0
 function column_status($item)
 {
     $wpfav = Wpfavs_Admin::get_instance();
     switch ($item['status']) {
         case 'not-installed':
             return '<span class="not-installed">' . __("Not Installed", $wpfav->plugin_slug) . '</span>';
             break;
         case 'active':
             return '<span class="active">' . __("Active", $wpfav->plugin_slug) . '</span>';
             break;
         case 'inactive':
             return '<span class="inactive">' . __("Inactive", $wpfav->plugin_slug) . '</span>';
             break;
         default:
             return '<span class="not-installed">' . __("Not Installed", $wpfav->plugin_slug) . '</span>';
             break;
     }
 }