/** * init hooks */ private function setup_actions() { HW_HOANGWEB::register_ajax('hw_installer', array(&$this, '_ajax_installer_handle')); HW_HOANGWEB::register_ajax('hw_logger', array(&$this, '_ajax_logs_handle')); HW_HOANGWEB::register_ajax('hw_load_wpcli_commands', array(&$this, '_ajax_load_cli_commands')); HW_HOANGWEB::register_ajax('hw_run_cli', array(&$this, '_ajax_run_cli_command')); //HW_HOANGWEB::register_ajax('hw_list_to_do', array(&$this, '_ajax_show_list_to_do')); }
/** * main class construct method */ public function __construct() { parent::__construct(); $this->setMenuItem(array('title' => 'Cài Modules', 'page_slug' => 'hw-install-module')); //$this->enable_submit_button(); $this->support_fields(array('hw_html', 'hw_upload')); add_action('admin_enqueue_scripts', array(&$this, 'admin_enqueue_scripts')); add_action('hw_upload_file_success', array($this, 'success_upload_callback')); add_action('hw_upload_file_error', array($this, 'fail_upload_callback')); HW_HOANGWEB::register_ajax('search_module', array(&$this, '_ajax_search_package_modules')); if (class_exists('APF_hw_upload_field') && APF_hw_upload_field::is_success()) { //do something } }