static public function activate_plugin()
{
- staffords_employment_admin::add_capability();
+ glmjobs_employment_admin::add_capability();
}
static public function deactivate_plugin()
{
- staffords_employment_admin::remove_capability();
+ glmjobs_employment_admin::remove_capability();
}
static public function add_capability()
}
}
- public function staffords_settings_exist()
+ public function glmjobs_settings_exist()
{
if (false == get_option(GLM_EMP_SETTINGS)) {
add_option(GLM_EMP_SETTINGS);
public function job_settings_init()
{
+ //add_settings_section(
+ //'glmjobsjobs_setting_section_two',
+ //'Edit Settings',
+ //array($this, 'glmjobs_settings_two_section_callback'),
+ //'glmjobsjobs_settings'
+ //);
+ //add_settings_field(
+ //'thank_you_text',
+ //'Thank You Message',
+ //array($this, 'render_textarea_field'),
+ //'glmjobsjobs_settings',
+ //'glmjobsjobs_setting_section_two',
+ //'thank_you_text'
+ //);
add_settings_section(
- 'staffordsjobs_setting_section_two',
- 'Edit Confirmations',
- array($this, 'staffords_settings_two_section_callback'),
- 'staffordsjobs_settings'
- );
- add_settings_field(
- 'thank_you_text',
- 'Thank You Message',
- array($this, 'render_textarea_field'),
- 'staffordsjobs_settings',
- 'staffordsjobs_setting_section_two',
- 'thank_you_text'
- );
- add_settings_section(
- 'staffordsjobs_setting_section',
- 'Edit Notifications',
- array($this, 'staffords_settings_section_callback'),
- 'staffordsjobs_settings'
+ 'glmjobsjobs_setting_section',
+ 'Edit Form Settings',
+ array($this, 'glmjobs_settings_section_callback'),
+ 'glmjobsjobs_settings'
);
$fieldNames = array(
array(
- 'name' => 'notification_name',
- 'label' => 'Online Form Notify: Name',
- 'type' => 'text'
- ),
- array(
- 'name' => 'notification_email',
- 'label' => 'Online Form Notify: Email',
- 'type' => 'text'
- ),
- array(
- 'name' => 'from_name',
- 'label' => 'From: Name',
- 'type' => 'text'
- ),
- array(
- 'name' => 'from_email',
- 'label' => 'From: Email',
- 'type' => 'text'
- ),
- array(
- 'name' => 'replyto_name',
- 'label' => 'Reply-To: Name',
- 'type' => 'text'
- ),
- array(
- 'name' => 'replyto_email',
- 'label' => 'Reply-To: Email',
- 'type' => 'text'
- ),
- array(
- 'name' => 'notification_message',
- 'label' => 'Notification Message',
- 'type' => 'textarea'
- ),
+ 'name' => 'employment_form_page',
+ 'label' => 'Page for the Form',
+ 'type' => 'page'
+ )
+ //array(
+ //'name' => 'notification_name',
+ //'label' => 'Online Form Notify: Name',
+ //'type' => 'text'
+ //),
+ //array(
+ //'name' => 'notification_email',
+ //'label' => 'Online Form Notify: Email',
+ //'type' => 'text'
+ //),
+ //array(
+ //'name' => 'from_name',
+ //'label' => 'From: Name',
+ //'type' => 'text'
+ //),
+ //array(
+ //'name' => 'from_email',
+ //'label' => 'From: Email',
+ //'type' => 'text'
+ //),
+ //array(
+ //'name' => 'replyto_name',
+ //'label' => 'Reply-To: Name',
+ //'type' => 'text'
+ //),
+ //array(
+ //'name' => 'replyto_email',
+ //'label' => 'Reply-To: Email',
+ //'type' => 'text'
+ //),
+ //array(
+ //'name' => 'notification_message',
+ //'label' => 'Notification Message',
+ //'type' => 'textarea'
+ //),
);
foreach ($fieldNames as $field) {
- $this->staffords_add_setting_text_field(
+ $this->glmjobs_add_setting_text_field(
$field['name'],
$field['label'],
$field['type']
return true;
}
- public function staffords_add_setting_text_field($name, $label, $type)
+ public function glmjobs_add_setting_text_field($name, $label, $type)
{
switch ($type) {
case 'text':
case 'textarea':
$callback = 'render_textarea_field';
break;
- case 'state':
- $callback = 'glmclientinfoRenderStateSelect';
+ case 'page':
+ $callback = 'render_page_field';
break;
default:
return false;
$name,
$label,
array($this, $callback),
- 'staffordsjobs_settings',
- 'staffordsjobs_setting_section',
+ 'glmjobsjobs_settings',
+ 'glmjobsjobs_setting_section',
$name
);
}
+ public function render_page_field($fieldName)
+ {
+ static $options;
+ if (!$options) {
+ $options = get_option(GLM_EMP_SETTINGS);
+ }
+ include $this->pluginDirName . 'views/page.php';
+ }
+
public function render_text_field($fieldName)
{
static $options;
include $this->pluginDirName . 'views/textArea.php';
}
- public function staffords_settings_section_callback()
+ public function glmjobs_settings_section_callback()
{
- echo __('Employment Form Email Notification', 'wordpress');
+ echo __('Employment Form Page', 'wordpress');
}
- public function staffords_settings_two_section_callback()
+ public function glmjobs_settings_two_section_callback()
{
echo __('Employment Form Thank You', 'wordpress');
}
- public function staffords_option_page_capability()
+ public function glmjobs_option_page_capability()
{
return GLM_EMP_NEW_CAPABILITY;
}
$name = $plugin_options['replyto_name'];
$email = $plugin_options['replyto_email'];
$message = $plugin_options['notification_message'] . "\n";
- $message .= '<a href="' . admin_url() . 'edit.php?post_type=staffords_jobs&page=applications">' . get_bloginfo('name') . ' Admin Area</a>.' . "\n\n";
+ $message .= '<a href="' . admin_url() . 'edit.php?post_type=glmjobs_jobs&page=applications">' . get_bloginfo('name') . ' Admin Area</a>.' . "\n\n";
$headers = array();
$headers[] = "From: {$fromName} <{$from}>";
$headers[] = "Reply-To: {$name} <{$email}>";
$job->glm_jobs_code = $custom['glm_jobs_code'][0];
$job->glm_jobs_property = $deps;
$job->glm_jobs_category = $cats;
- $current_url = esc_url(add_query_arg($wp->query_string, '', home_url($wp->request)));
- $applyOnlineHref = $current_url
- . ((strpos($current_url, '?')) ? '&' : '?')
- . self::FORM_VAR . "=1&job=" . $job->ID;
+ //$current_url = esc_url(add_query_arg($wp->query_string, '', home_url($wp->request)));
+ $plugin_options = get_option(GLM_EMP_SETTING_NAME);
+ $applyOnlineHref = (isset($plugin_options['employment_form_page']))
+ ? get_permalink( $plugin_options['employment_form_page'] )
+ . '?current_date=' . urlencode( date( 'm/d/Y' ) )
+ . '&position_name=' . urlencode( $job->post_title )
+ : false;
+ //$applyOnlineHref = $current_url
+ //. ((strpos($current_url, '?')) ? '&' : '?')
+ //. self::FORM_VAR . "=1&job=" . $job->ID;
include $this->frontViewDir . '/jobDetail.php';
return;
}