You are here

function theme_homebox_admin_new_page in Homebox 6

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

Theme the new-page form.

File

./homebox.admin.inc, line 95
Home box admin file, takes care admin interface for homebox

Code

function theme_homebox_admin_new_page($form) {
  $pages = homebox_pages();
  $header = array(
    t('Name'),
    array(
      'data' => t('Operations'),
      'colspan' => 3,
    ),
  );
  if (is_array($pages) && !empty($pages)) {
    foreach ($pages as $page) {
      $layout = l(t('layout'), 'admin/build/homebox/layout/' . $page->pid);
      $settings = l(t('settings'), 'admin/build/homebox/settings/' . $page->pid);
      $rows[] = array(
        l($page->name, 'homebox/' . $page->pid),
        l(t('edit'), 'admin/build/homebox/edit/' . $page->pid),
        $layout,
        $settings,
      );
    }
  }
  $rows[] = array(
    drupal_render($form['name']),
    array(
      'data' => drupal_render($form['submit']),
      'colspan' => 3,
    ),
  );
  $output = drupal_render($form);
  $output .= theme('table', $header, $rows);
  return $output;
}