/** * Responds to implement a custom part of the "Settings" - FORM_UPLOAD = "wc_ip_fileupload"; * * @param array|mixed $value Value to display in <tr>...<tr> */ public function set_upload_file_field($value = null) { if(empty ($value)) return; $up = new inoplugs_plupload(self::ID_PLUPLOAD_UNIQUE); $upload = $up->get_element_html(); ?> <div id="wc_plupload_container" ><span><?php echo $upload ?></span></div> <div id="<?php echo $value['id'].'refresh' ?>" class="button"><span><?php echo $value['refresh'] ?><span></div> <div style="clear: both;"><span id="status" ></span></div> <ul id="files" ></ul> <?php }
/** * This function must be called immediatly after loading the class. * It forces to attach the appropriate handlers to load the .css and .js * files. */ static public function activate($needed = self::ADMINPAGE_ONLY) { $obj = null; isset($this) ? $obj = $this : $obj = new self(); switch($needed) { case self::PAGES_ONLY: case self::ALL_PAGES: self::$show_on_pages = $needed; break; case self::ADMINPAGE_ONLY: default: self::$show_on_pages = self::ADMINPAGE_ONLY; } // currently only this is supported self::$show_on_pages = self::ADMINPAGE_ONLY; add_action('admin_init', array(&$obj, 'handler_wp_admin_init' )); }