$form->freeze(); $values = $form->process(array(&$this, 'formValues')); $ushop_ini = new Admin_Config($this->registry, array('path' => $this->registry->ini_dir . '/ushop.ini.php')); if ($values['information']) { $ftp = new File_FTP($this->registry); foreach ($values['information'] as $key => $value) { $message = file_put_contents($_SERVER['DOCUMENT_ROOT'] . '/tmp/' . $key . '.html', stripslashes(str_replace('\\r\\n', '', $value))); $ftp->put($_SERVER['DOCUMENT_ROOT'] . '/tmp/' . $key . '.html', $ftp->public_html . '/' . $this->registry->get('settings.resolve') . '/file/' . $key . '.html', true); unlink($_SERVER['DOCUMENT_ROOT'] . '/tmp/' . $key . '.html'); } unset($values['information']); $ftp->disconnect(); } foreach ($values as $section => $value) { foreach ($value as $key => $value) { $ushop_ini->set($key, $value, $section); } } $saved = $ushop_ini->save(); $menuBar['back'] = '/ushop/overview'; //check then enter the record. if ($saved) { $params['TYPE'] = 'pass'; $params['MESSAGE'] = '<h2>Params was successfully updated.</h2>'; } else { $params['TYPE'] = 'error'; $params['MESSAGE'] = '<h2>Params could not be updated.</h2>'; } // done! } else { $paramsBar = array('back' => '/ushop/overview', 'cancel' => '/ushop/overview', 'save' => '');
$template = $templates[$_POST['template']]; $template_name = $_POST['template']; } else { $template = $templates[$this->registry->admin_config->get('admin_template', 'SERVER')]; $template_name = $this->registry->admin_config->get('admin_template', 'SERVER'); } $template_files = new Admin_Config($this->registry, array('path' => $template . '/ini/template.ini.php')); $template_files->public_html = true; //print_rr($template_files); if (isset($_POST['files'])) { $c = 0; $ini = array('cache' => $template_files->get('cache'), 'css' => $template_files->get('css'), 'js_ini_files' => $template_files->get('js_ini_files')); $template_files->removeAllSections(); foreach ($ini as $section => $value) { foreach ($value as $key => $value) { $template_files->set($key, $value, $section); } } foreach ($_POST['files'] as $file) { $file = split('/', $file); $files[$file[1]][] = $file[2]; $template_files->set($c, '/Common/javascript/Source/' . $file[0] . '/' . $file[1] . '/' . $file[2], 'mootools_js'); $c++; } foreach ($files as $section => $values) { foreach ($values as $key => $value) { $value = str_replace('.js', '', $value); $template_files->set($key, $value, $section); } } $template_files->save();