[ Index ]

MailPress 7.1

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-admin/ -> import.php (source)

   1  <?php
   2  class MP_AdminPage extends MP_WP_Admin_page_list_
   3  {
   4      const screen         = MailPress_page_import;
   5      const capability     = 'MailPress_import';
   6      const help_url        = 'http://blog.mailpress.org/tutorials/add-ons/import/';
   7      const file            = __FILE__;
   8  
   9      const per_page         = false;
  10  
  11  ////  Title  ////
  12  
  13  	public static function title() 
  14      {
  15          new MP_Import_importers();
  16      }
  17  
  18  //// Help ////
  19  
  20  	public static function add_help_tab() 
  21      {
  22          global $current_screen;
  23  
  24          $content = '';
  25          $content .= '<p><strong>' . __( 'Import :', 'MailPress' ) . '</strong></p>';
  26          $content .= '<p>' . __( 'This screen lists a serie of importers/exporters to import/export data into/out of MailPress. ', 'MailPress' ) . '</p>';
  27  
  28          $current_screen->add_help_tab( array(     'id'        => 'overview',
  29                                          'title'        => __( 'Overview' ),
  30                                          'content'    => $content )
  31          );
  32      }
  33  
  34  //// List ////
  35  
  36  	public static function get_list( $args = array() ) 
  37      {
  38          $importers = MP_Import_importers::get_all();
  39  
  40          return ( empty( $importers ) ) ? false : $importers;
  41      }
  42  
  43  ////  Row  ////
  44  
  45  	public static function get_row( $id, $data ) 
  46      {
  47  
  48  // url's
  49          $url_parms = array();
  50          $url_parms['mp_import']     = $id;
  51          $import_url = esc_url( self::url( MailPress_import, $url_parms ) );
  52  // actions
  53          $actions = array();
  54          $actions['import'] = '<a href="' . $import_url . '" title="' . esc_attr( wptexturize( strip_tags( $data[1] ) ) ) . '">' . ( ( strpos( $id, 'export' ) !== false ) ?  __( 'Export', 'MailPress' ) : __( 'Import', 'MailPress' ) ) . '</a>';
  55  
  56          $out = '';
  57          $out .= '<tr class="importer-item">';
  58          $out .= '<td class="importer-system">';
  59          $out .= '<span class="importer-title">' . ucfirst( $data[0] ) . '</span>';
  60          $out .= '<span class="importer-action">' . $actions['import'] . '</span>';
  61          $out .= '</td>';
  62          $out .= '<td class="desc">' . $data[1] . '</td>';
  63          $out .= '</tr>';
  64  
  65          return $out;
  66      }
  67  }


Generated: Mon Mar 11 18:33:33 2019 Cross-referenced by PHPXref 0.7.1