示例#1
0
 /**
  * Initialize plugin enviroment
  */
 public static function init()
 {
     if (is_admin()) {
         add_action('admin_enqueue_scripts', array('WPRC_Installer', 'enqueue_scripts'));
         add_action('admin_enqueue_scripts', array('WPRC_Installer', 'enqueue_styles'));
         add_action('admin_print_scripts', array('WPRC_Installer', 'inlineJSSettings'));
         /**
          * Print language texts for javascript
          */
         //add_action('wp_print_scripts', array('WPRC_Installer', 'printJsLanguage'));
         /**
          * Add plugin menu items
          */
         //add_action('admin_menu', array('WPRC_Installer', 'addMenuItems'));
         // load translations from locale
         load_plugin_textdomain('installer', false, WPRC_LOCALE_FOLDER);
         if (!defined('ICL_WPML_ORG_REPO_ID')) {
             $wpml_repo = self::getRepoID(array('repository_name' => '%wpml%', 'repository_endpoint_url' => '%wpml%'));
             define('ICL_WPML_ORG_REPO_ID', $wpml_repo);
         }
         // include router
         WPRC_Loader::includeRouter();
         WPRC_Router::execute();
     }
     self::executeScheduledTasks();
 }