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';
$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';
}
/**
$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']);