From: Steve Sutton Date: Mon, 4 Jan 2016 20:47:17 +0000 (-0500) Subject: online apply setting from theme X-Git-Tag: v1.3.0^2~1 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=6970c96ac63edbdb972ed8ba216782f6cce64f2c;p=WP-Plugins%2Fglm-employment.git online apply setting from theme --- diff --git a/controllers/front.php b/controllers/front.php index 12524f5..610053b 100644 --- a/controllers/front.php +++ b/controllers/front.php @@ -30,12 +30,12 @@ class glm_employment_front public $appId; public $formId; public $jobTitle; + public $finalFormPage; // class constants const FORM_VAR = 'applyOnline'; const FORM_SETTINGS_DIR = 'config'; const FORM_VIEW_DIR = 'views'; - const FINAL_FORM = 8; const FORM_TEMPLATE = 'formTemplate.php'; const SUCCESS_TEMPLATE = 'thankYou.php'; @@ -56,6 +56,29 @@ class glm_employment_front $this->adminViewDir = $this->viewDir . '/admin'; $this->frontViewDir = $this->viewDir . '/front'; $this->settingDir = $this->pluginDirName . self::FORM_SETTINGS_DIR; + $this->setThemeSettings(); + } + + /** + * setThemeSettings + * + * This will check the current theme folder for a glm-emp-config + * directory and if it finds one it will setup the config class variable for it. + * If not found it will default back to the plugins config directory. + * + * @access public + * @return void + */ + public function setThemeSettings() + { + if ( file_exists( get_template_directory() . '/glm-emp-config/application.ini' ) ) { + $theme_settings = parse_ini_file( + get_template_directory() . '/glm-emp-config/application.ini', + true + ); + $this->finalFormPage = $theme_settings['main_section']['final_form_page']; + } + $this->settingDir = get_template_directory() . '/glm-emp-config'; } /** @@ -235,7 +258,7 @@ class glm_employment_front $this->store_form_data($form, $formPart); // next form part ++$formPart; - if ($formPart == self::FINAL_FORM) { + if ($formPart == $this->finalFormPage) { $plugin_options = get_option(GLM_EMP_SETTING_NAME); include $this->frontViewDir . '/' . self::SUCCESS_TEMPLATE; unset($_SESSION['glmJobsApplication'], $_SESSION['glmJobsAppForm']);