Exemple #1
0
 protected static function _modify(Wpjb_Model_Job $job)
 {
     $arr = $job->allToArray();
     foreach (Wpjb_Utility_Registry::getCategories() as $category) {
         if ($category->id == $job->job_category) {
             break;
         }
     }
     foreach (Wpjb_Utility_Registry::getJobTypes() as $type) {
         if ($type->id == $job->job_type) {
             break;
         }
     }
     $public = array("id", "company_name", "company_website", "job_type", "job_category", "job_country", "job_state", "job_zip_code", "job_location", "job_limit_to_country", "job_title", "job_slug", "job_created_at", "job_expires_at", "job_description", "is_active", "is_filled", "is_featured", "stat_view", "stat_unique", "stat_apply");
     $publish = new stdClass();
     foreach ($public as $k) {
         $publish->{$k} = $job->{$k};
     }
     $arr = $job->allToArray();
     foreach ($arr as $k => $a) {
         if (substr($k, 0, 6) == "field_") {
             $publish->{$k} = $a;
         }
     }
     $publish->url = wpjb_link_to("job", $job);
     $publish->image = $job->getImageUrl();
     $publish->formatted_created_at = wpjb_date("M, d", $job->job_created_at);
     $publish->location = $job->locationToString();
     $publish->category = $category->toArray();
     $publish->type = $type->toArray();
     $publish->is_new = $job->isNew();
     $publish->is_free = $job->isFree();
     return $publish;
 }
 public function init()
 {
     global $wp_rewrite;
     if (!$wp_rewrite->using_permalinks()) {
         $e = new Daq_Form_Element("job_resumes", Daq_Form_Element::TYPE_HIDDEN);
         $e->setValue("find");
         $this->addElement($e);
         $e = new Daq_Form_Element("page_id", Daq_Form_Element::TYPE_HIDDEN);
         $e->setValue(Wpjb_Project::getInstance()->conf("link_resumes"));
         $this->addElement($e);
     }
     $e = new Daq_Form_Element("query");
     $e->setLabel(__("Search", WPJB_DOMAIN));
     $e->setValue(__("title, experience, education ...", WPJB_DOMAIN));
     $e->addClass("wpjb-auto-clear");
     $this->addElement($e, "search");
     $e = new Daq_Form_Element("degree", Daq_Form_Element::TYPE_SELECT);
     $e->setLabel(__("Degree", WPJB_DOMAIN));
     foreach (Wpjb_Form_Admin_Resume::getDegrees() as $k => $v) {
         $e->addOption($k, $k, $v);
     }
     $this->addElement($e, "search");
     $e = new Daq_Form_Element("experience", Daq_Form_Element::TYPE_SELECT);
     $e->setLabel(__("Years of Experience", WPJB_DOMAIN));
     foreach (Wpjb_Form_Admin_Resume::getExperience() as $k => $v) {
         $e->addOption($k, $k, $v);
     }
     $this->addElement($e, "search");
     $e = new Daq_Form_Element("category", Daq_Form_Element::TYPE_SELECT);
     $e->setLabel(__("Category", WPJB_DOMAIN));
     $e->addOption(null, null, " ");
     foreach (Wpjb_Utility_Registry::getCategories() as $obj) {
         $e->addOption($obj->id, $obj->id, $obj->title);
     }
     if (count(Wpjb_Utility_Registry::getCategories()) > 0) {
         $this->addElement($e, "search");
     }
     $e = new Daq_Form_Element("posted", Daq_Form_Element::TYPE_SELECT);
     $e->setLabel(__("Last updated", WPJB_DOMAIN));
     $e->addOption(null, null, " ");
     $e->addOption(1, 1, __("Today", WPJB_DOMAIN));
     $e->addOption(2, 2, __("Yesterday", WPJB_DOMAIN));
     $e->addOption(7, 7, __("Less than 7 days ago", WPJB_DOMAIN));
     $e->addOption(30, 30, __("Less than 30 days ago", WPJB_DOMAIN));
     $this->addElement($e, "search");
     apply_filters("wpjr_form_init_search", $this);
 }
 public function init()
 {
     global $wp_rewrite;
     if (!$wp_rewrite->using_permalinks()) {
         $e = new Daq_Form_Element("job_board", Daq_Form_Element::TYPE_HIDDEN);
         $e->setValue("find");
         $this->addElement($e);
         $e = new Daq_Form_Element("page_id", Daq_Form_Element::TYPE_HIDDEN);
         $e->setValue(Wpjb_Project::getInstance()->conf("link_jobs"));
         $this->addElement($e);
     }
     $e = new Daq_Form_Element("query");
     $e->setLabel(__("Search", WPJB_DOMAIN));
     $e->setValue(__("keyword, location, company ...", WPJB_DOMAIN));
     $e->addClass("wpjb-auto-clear");
     $this->addElement($e, "search");
     $e = new Daq_Form_Element("type", Daq_Form_Element::TYPE_SELECT);
     $e->setLabel(__("Job Type", WPJB_DOMAIN));
     $e->addOption(null, null, " ");
     foreach (Wpjb_Utility_Registry::getJobTypes() as $obj) {
         $e->addOption($obj->id, $obj->id, $obj->title);
     }
     if (count(Wpjb_Utility_Registry::getJobTypes()) > 0) {
         $this->addElement($e, "search");
     }
     $e = new Daq_Form_Element("category", Daq_Form_Element::TYPE_SELECT);
     $e->setLabel(__("Job Category", WPJB_DOMAIN));
     $e->addOption(null, null, " ");
     foreach (Wpjb_Utility_Registry::getCategories() as $obj) {
         $e->addOption($obj->id, $obj->id, $obj->title);
     }
     if (count(Wpjb_Utility_Registry::getCategories()) > 0) {
         $this->addElement($e, "search");
     }
     $e = new Daq_Form_Element("posted", Daq_Form_Element::TYPE_SELECT);
     $e->setLabel(__("Posted", WPJB_DOMAIN));
     $e->addOption(null, null, " ");
     $e->addOption(1, 1, __("Today", WPJB_DOMAIN));
     $e->addOption(2, 2, __("Yesterday", WPJB_DOMAIN));
     $e->addOption(7, 7, __("Less then 7 days ago", WPJB_DOMAIN));
     $e->addOption(30, 30, __("Less then 30 days ago", WPJB_DOMAIN));
     $this->addElement($e, "search");
     apply_filters("wpjb_form_init_search", $this);
 }
Exemple #4
0
 public function run()
 {
     add_action("edit_user_profile", array(self::$_instance, "editUserProfile"));
     add_action("edit_user_profile_update", array(self::$_instance, "saveUserProfile"));
     add_filter("init", array(self::$_instance, "init"));
     add_filter("wp_title", array(self::$_instance, "injectTitle"));
     add_filter("single_post_title", array(self::$_instance, "injectTitle"));
     add_filter('rewrite_rules_array', array(self::$_instance, "rewrite"));
     add_filter('the_title', array(self::$_instance, "theTitle"), 10, 2);
     add_filter('the_content', array(self::$_instance, "theContent"));
     add_filter('wp', array(self::$_instance, "execute"));
     add_filter('redirect_canonical', array(self::$_instance, "redirectCanonical"));
     add_action('delete_user', array(self::$_instance, "removeUser"));
     add_action('admin_menu', array(self::$_instance, "addAdminMenu"));
     add_action('admin_print_scripts', array(self::$_instance, "addScripts"));
     add_action('wp_print_scripts', array(self::$_instance, "addScriptsFront"));
     add_action('admin_notices', array(self::$_instance, "adminNotices"));
     add_action('wp_dashboard_setup', array(self::$_instance, "addDashboardWidgets"));
     add_filter('query_vars', array(self::$_instance, "queryVars"));
     add_action("wp_footer", array(self::$_instance, "shutdown"));
     add_action("wp_enqueue_scripts", array(self::$_instance, "enqueueScripts"));
     add_action("admin_bar_menu", array($this, "adminBarMenu"), 1000);
     add_shortcode('wpjb_search', 'wpjb_search_form');
     $this->_init();
     $directory = $this->env("directory");
     $logo = site_url() . "/wp-content/plugins/{$directory}";
     $logo .= $this->pathRaw("admin_public") . "/wpjb-midi.gif";
     $this->getAdmin()->getView()->slot("midi_logo", $logo);
     $paymentFactory = new Wpjb_Payment_Factory();
     foreach ((array) glob($this->getBaseDir() . "/application/libraries/Payment/*.php") as $ajax) {
         $ctrl = basename($ajax, ".php");
         if (in_array($ctrl, array("Factory", "Interface"))) {
             continue;
         }
         $payment = "Wpjb_Payment_" . $ctrl;
         $payment = new $payment();
         if ($payment instanceof Wpjb_Payment_Interface) {
             $paymentFactory->register($payment);
         }
     }
     Wpjb_Utility_Registry::set("payment_factory", $paymentFactory);
 }
Exemple #5
0
function wpjb_get_jobtypes($options = null)
{
    return Wpjb_Utility_Registry::getJobTypes();
}