public function __construct() { foreach (Doctrine::getTable('Property')->findAll() as $property) { $value = $property->value; switch ($property->keey) { case 'company_logo': $value = str_replace("\\", "/", GlobalSettingsForm::getUploadsDir()) . "/{$value}"; break; } $this->tags[$property->keey] = $value; } }
/** * undocumented function * * @return void * @author Carlos Escribano <*****@*****.**> **/ public function executeSettings(sfWebRequest $request) { $user = $this->getUser(); $i18n = $this->getContext()->getI18N(); $form = new GlobalSettingsForm(array(), null, array('culture' => $user->getCulture())); if ($request->isMethod('post')) { $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName())); if ($form->isValid()) { $form->save(); $user->info($i18n->__('Your settings were successfully saved.')); $user->loadUserSettings(); $this->redirect('@settings'); } else { $user->error($i18n->__('Settings could not be saved. Please, check entered values and try to correct them.'), false); } } $this->form = $form; }