Beispiel #1
0
 /**
  * Perform back-end administrative functions
  * @since 3.0
  */
 function admin_init()
 {
     global $wpi_settings;
     //** Handle backup */
     if (isset($_FILES['wpi_settings']['tmp_name']['settings_from_backup']) && ($backup_file = $_FILES['wpi_settings']['tmp_name']['settings_from_backup'])) {
         $backup_contents = file_get_contents($backup_file);
         if (!empty($backup_contents)) {
             $decoded_settings = json_decode($backup_contents, true);
         }
         if (!empty($decoded_settings)) {
             $_REQUEST['wpi_settings'] = $decoded_settings;
         }
     }
     if (!empty($_REQUEST['wpi_settings']) && is_array($_REQUEST['wpi_settings'])) {
         $this->Settings->SaveSettings($_REQUEST['wpi_settings']);
         WPI_Functions::settings_action();
     }
     //** Add metaboxes */
     if (isset($wpi_settings['pages']) && is_array($wpi_settings['pages'])) {
         $this->add_metaboxes($wpi_settings['pages']);
     }
     //** Check for updates */
     WPI_Functions::manual_activation();
 }
 /**
  * Perform back-end administrative functions
  *
  *
  * @since 3.0
  */
 function admin_init() {
   global $wpi_settings;
   /*if (isset($_REQUEST['wpi_do'])) {
     $this->Functions->DoFunction($_REQUEST['wpi_do']);
   }*/
   
   if ( !empty( $_REQUEST['wpi_settings'] ) && is_array($_REQUEST['wpi_settings']) ) {
     $this->Settings->SaveSettings($_REQUEST['wpi_settings']);
     WPI_Functions::settings_action();
   }
   
   add_filter("manage_{$wpi_settings['pages']['main']}_columns", array( 'WPI_UI', 'overview_columns' ), 10, 3 );
   
   /* Add metaboxes */
   if(isset($wpi_settings['pages']) && is_array($wpi_settings['pages'])) {
     $this->add_metaboxes($wpi_settings['pages']);
   }
   
   /** Check for updates */
   WPI_Functions::manual_activation();
   
 }