You are here

function theme_homebox_admin_new_page in Homebox 6.2

Same name and namespace in other branches
  1. 6.3 homebox.admin.inc \theme_homebox_admin_new_page()
  2. 6 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 152
Homebox admin file, takes care admin interface for homebox

Code

function theme_homebox_admin_new_page($form) {

  // Check PHP version
  if (!_homebox_check_php()) {
    drupal_set_message(t('Homebox 2 requires PHP version 5.2 or higher. You are currently running PHP !version.', array(
      '!version' => phpversion(),
    )), 'error');
  }

  // Make sure that Homebox 2 was installed clean since
  // there is no upgrade path between 1.x and 2.x
  if (variable_get('homebox_version', 0) != HOMEBOX_VERSION) {
    drupal_set_message(t('Homebox 2 was not properly installed. You must completely uninstall and install Homebox 2 now.'), 'error');
  }
  $pages = homebox_pages();
  $output = drupal_render($form);
  $header = array(
    t('Name'),
    array(
      'data' => t('Operations'),
      'colspan' => 5,
    ),
  );
  if (is_array($pages) && !empty($pages)) {
    foreach ($pages as $page) {
      $link = l($page->settings['title'], $page->settings['path']);
      $edit = l(t('Edit'), 'admin/build/homebox/edit/' . $page->name);
      $layout = l(t('Layout'), 'admin/build/homebox/layout/' . $page->name);
      $settings = l(t('Settings'), 'admin/build/homebox/settings/' . $page->name);
      $flush = l(t('Flush'), 'admin/build/homebox/flush/' . $page->name);
      $export = l(t('Export'), 'admin/build/homebox/export/' . $page->name);
      $rows[] = array(
        $link,
        $edit,
        $layout,
        $settings,
        $flush,
        $export,
      );
    }
  }
  $output .= theme('table', $header, $rows);
  return $output;
}