You are here

public function Application::submitAdminForm in Module Object Oriented Programming API 6.2

Same name and namespace in other branches
  1. 6 component/moopapi.component.inc \Application::submitAdminForm()
  2. 7.2 component/moopapi.component.inc \Application::submitAdminForm()
  3. 7 component/moopapi.component.inc \Application::submitAdminForm()

File

component/moopapi.component.inc, line 189

Class

Application
@todo Desc for Application.

Code

public function submitAdminForm($form, &$form_state) {
  $form_name = $form['#form_name']['#value'];

  // Decorators handling.
  switch ($form_name) {
    case 'general':

      // @todo Refactor it.
      $decs = array(
        'logger' => 'Logger',
        'cacher' => 'Cacher',
      );
      $app_name = strtolower($this->app_name);
      $decorators = array();
      foreach ($decs as $field_name => $decorator_id) {
        if ($form_state['values'][$field_name]) {
          $decorators[$field_name] = $decorator_id;
        }
      }
      variable_set("{$app_name}_decorators", serialize($decorators));
  }
}