Beispiel #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));
 }
 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;
     }
 }