18 require_once SQ_LIB_PATH.
'/config/config.inc';
38 var $config_vars = Array(
39 'SQ_HIPO_USE_SERVER' => Array(
'editable' => 1,
'default' => FALSE),
40 'SQ_HIPO_SERVER_STATUS_CHECK_THRESHOLD' => Array(
'editable' => 1,
'default' => 30),
41 'SQ_HIPO_TOTAL_THRESHOLD' => Array(
'editable' => 1,
'default' => 80),
51 parent::__construct();
52 $this->config_file = SQ_DATA_PATH.
'/private/conf/hipo.inc';
68 if (!file_exists($this->config_file))
return;
71 $packages = $GLOBALS[
'SQ_SYSTEM']->getInstalledPackages();
73 foreach($packages as $package) {
74 if ($package[
'code_name'] ==
'__core__') {
75 $hipo_job_path = SQ_SYSTEM_ROOT.
'/core/hipo/jobs';
77 $hipo_job_path = SQ_SYSTEM_ROOT.
'/packages/'.strtolower($package[
'code_name']).
'/hipo_jobs';
80 if (is_dir($hipo_job_path)) {
81 require_once SQ_FUDGE_PATH.
'/general/file_system.inc';
82 $d = dir($hipo_job_path);
83 while (FALSE !== ($file = $d->read())) {
84 if ($file ==
'.' || $file ==
'..') {
88 if (strpos($file,
'.') == 0)
continue;
90 if (!is_dir($hipo_job_path.
'/'.$file)) {
91 if (get_file_type($file) !=
'inc')
continue;
92 require_once $hipo_job_path.
'/'.$file;
93 $type_code = substr($file, 0, strpos($file,
'.'));
96 $vars = call_user_func(Array($type_code,
'getConfigVars'));
97 $this->config_vars = array_merge($this->config_vars, $vars);
122 function save($vars, $backup_existing=FALSE)
125 if (file_exists($this->config_file)) {
126 return parent::save($vars, $backup_existing);
133 if (!parent::save($vars, FALSE))
return FALSE;
137 return parent::save($vars, FALSE);
154 return $GLOBALS[
'SQ_SYSTEM']->userRoot();
167 if (!parent::writeAccess())
return FALSE;
168 if (!$GLOBALS[
'SQ_SYSTEM']->runLevelEnables(SQ_SECURITY_PERMISSIONS)) {
173 return $GLOBALS[
'SQ_SYSTEM']->userRoot();
192 parent::paintBackend($o);
195 $class = get_class_lower($this);
197 $o->openSection(translate(
'hipo_server_configuration'));
200 $o->openField(translate(
'run_on_squiz_server'));
202 combo_box($class.
'[SQ_HIPO_USE_SERVER]', Array(
'1' => translate(
'yes'),
'0' => translate(
'no')), FALSE, SQ_HIPO_USE_SERVER);
204 echo (SQ_HIPO_USE_SERVER) ? translate(
'yes') : translate(
'no');
209 $o->openField(translate(
'hipo_status_check_threshold'));
211 text_box($class.
'[SQ_HIPO_SERVER_STATUS_CHECK_THRESHOLD]', SQ_HIPO_SERVER_STATUS_CHECK_THRESHOLD, 5);
214 echo SQ_HIPO_SERVER_STATUS_CHECK_THRESHOLD;
216 echo translate(
'hipo_status_check_threshold_note');
220 $o->openField(translate(
'hipo_freestyle_threashold'));
222 text_box($class.
'[SQ_HIPO_TOTAL_THRESHOLD]', SQ_HIPO_TOTAL_THRESHOLD, 5);
225 echo SQ_HIPO_TOTAL_THRESHOLD;
227 echo translate(
'hipo_threshold_note');
235 if ($write_access) $o->commitButton(
'', TRUE);
251 $packages = $GLOBALS[
'SQ_SYSTEM']->getInstalledPackages();
253 foreach($packages as $package) {
254 if ($package[
'code_name'] ==
'__core__') {
255 $hipo_job_path = SQ_SYSTEM_ROOT.
'/core/hipo/jobs';
257 $hipo_job_path = SQ_SYSTEM_ROOT.
'/packages/'.$package[
'code_name'].
'/hipo_jobs';
259 $GLOBALS[
'SQ_SYSTEM']->lm->includePackageStrings($package[
'code_name']);
262 if (is_dir($hipo_job_path)) {
263 $d = dir($hipo_job_path);
265 while (FALSE !== ($file = $d->read())) {
266 if ($file ==
'.' || $file ==
'..') {
270 if (strpos($file,
'.') == 0)
continue;
272 if (!is_dir($hipo_job_path.
'/'.$file)) {
273 if (get_file_type($file) !=
'inc')
continue;
274 require_once $hipo_job_path.
'/'.$file;
275 $type_code = substr($file, 0, strpos($file,
'.'));
279 eval($type_code.
'::paintConfig($o, $class, $write_access);');