You are here

function homebox_admin_form_to_page in Homebox 7.3

Same name and namespace in other branches
  1. 6.3 homebox.admin.inc \homebox_admin_form_to_page()
  2. 6.2 homebox.admin.inc \homebox_admin_form_to_page()
  3. 7.2 homebox.admin.inc \homebox_admin_form_to_page()

Map settings from the form homebox_admin_page to a page object

Parameters

$page: A page object

$form_state: The form state on form submission

2 calls to homebox_admin_form_to_page()
homebox_admin_page_submit in ./homebox.admin.inc
Submit function for the admin page form.
homebox_clone_page_submit in ./homebox.admin.inc
Submit callback for clone form.

File

./homebox.admin.inc, line 346
Homebox admin file, takes care admin interface for homebox

Code

function homebox_admin_form_to_page(&$page, $form_state) {
  $page->settings['title'] = $form_state['values']['title'];
  $page->settings['path'] = $form_state['values']['path'];
  $page->settings['menu'] = (int) $form_state['values']['menu'];
  $page->settings['enabled'] = (int) $form_state['values']['enabled'];
  $page->settings['auto_save'] = (int) $form_state['values']['auto_save'];
  $page->settings['full'] = (int) $form_state['values']['full'];
  $page->settings['roles'] = array();
  foreach ($form_state['values']['roles'] as $role) {
    if ($role) {
      $page->settings['roles'][] = $role;
    }
  }
}