Beispiel #1
0
 public function admin_init()
 {
     register_setting($this->settings_key, CF_DEPLOY_SETTINGS, array($this, 'validate_settings'));
     if (is_cfd_page()) {
         include $this->basedir . '/lib/cf-admin/cf-admin.php';
         wp_enqueue_style('cfd_admin_css', $this->baseurl . '/css/admin.css', array(), CF_DEPLOY_VERSION, 'all');
         CF_Admin::load_css();
         // 			wp_enqueue_style('cf_styles', $this->baseurl.'/lib/admin-ui/css/styles.css', array(), CF_DEPLOY_VERSION, 'all');
         // 			wp_enqueue_style('cf_form_elements', $this->baseurl.'/lib/admin-ui/css/form-elements.css', array(), CF_DEPLOY_VERSION, 'all');
         // 			wp_enqueue_style('cf_utility', $this->baseurl.'/lib/admin-ui/css/utility.css', array(), CF_DEPLOY_VERSION, 'all');
         if ($_GET['page'] == 'cf-ramp-batch-send') {
             wp_enqueue_script('cfd_admin_ajax_queue', $this->baseurl . '/js/ajaxQueue.js', array('jquery'), CF_DEPLOY_VERSION);
         }
         wp_enqueue_script('cfd_admin_js', $this->baseurl . '/js/admin.js', array('jquery'), CF_DEPLOY_VERSION);
         wp_localize_script('cfd_admin_js', 'cfd_admin_settings', array('rollback_confirm' => __('Are you sure you want to rollback this import? This action cannot be undone.', 'cf-deploy'), 'batch_delete_confirm' => __('Are you sure you want to delete this batch? This cannot be undone.', 'cf-deploy'), 'new_key_fail' => __('New key generation failed.', 'cf-deploy'), 'invalid_ajax_response' => __('Invalid response from server during Ajax Request', 'cf-deploy'), 'ajax_parse_error' => __('Parse Error in data returned from server', 'cf-deploy'), 'loading' => __('loading…', 'cf-deploy'), 'toggle' => __('toggle', 'cf-deploy')));
     }
 }
 /**
  * Add our test JS @init
  *
  * @return void
  */
 public function admin_init()
 {
     parent::admin_init();
     if (is_cfd_page()) {
         wp_enqueue_script('cfd_tests_js', $this->baseurl . '/js/tests.js', array('cfd_admin_js'), CF_DEPLOY_VERSION);
         wp_enqueue_style('cfd_tests_css', $this->baseurl . '/css/tests.css', array('cfd_admin_css'), CF_DEPLOY_VERSION, 'all');
     }
 }
Beispiel #3
0
/**
 * Load in the Revision Management core
 *
 * @return void
 */
function cfd_get_libs()
{
    if (!function_exists('cfr_register_metadata')) {
        include_once 'lib/cf-revision-manager/cf-revision-manager.php';
    }
    if (!defined('ADMIN_UI_VERSION') && is_cfd_page()) {
        remove_action('admin_menu', 'admin_ui_plugin_menu');
        remove_action('admin_head', 'admin_ui_plugin_css');
        remove_action('admin_head', 'admin_ui_plugin_js');
    }
}