You are here

function custompage_ui_admin_settings in Custom Page 6

Same name and namespace in other branches
  1. 7 custompage_ui/custompage_ui.module \custompage_ui_admin_settings()
1 string reference to 'custompage_ui_admin_settings'
custompage_ui_menu in custompage_ui/custompage_ui.module
@file Custom Page Admin UI

File

custompage_ui/custompage_ui.module, line 66
Custom Page Admin UI

Code

function custompage_ui_admin_settings() {
  $settings = $settings = variable_get('CUSTOMPAGE_UI_CONFIG', array());
  $out = "\n<table>\n  <tr>\n    <th>" . t("Title") . "</th>\n    <th>" . t("Type") . "</th>    \n    <th>" . t("Key") . "</th>\n    <th>" . t("Path") . "</th>\n    <th>" . t("Enabled") . "</th>     \n    <th colspan=\"2\" align=\"center\">" . t("Control") . "</th>                      \n  </tr>\n  ";
  foreach ($settings as $obj) {
    $options = array(
      'attributes' => array(
        'target' => '_blank',
      ),
    );
    $url = l($obj->path, $obj->path, $options);
    $out .= "<tr>";
    $out .= "<td>" . $obj->title . "</td>";
    $obj->type = empty($obj->type) ? t('Page') : $obj->type;
    $out .= "<td>" . ucfirst($obj->type) . "</td>";
    $out .= "<td>" . $obj->key . "</td>";
    $out .= "<td>" . $url . "</td>";
    $enabled = $obj->enabled ? t("Yes") : t("No");
    $out .= "<td>" . $enabled . "</td>";
    $out .= "<td>" . l(t('Edit'), 'admin/build/custompage/edit/' . $obj->key) . "</td>";
    $out .= "<td>" . l(t('Delete'), 'admin/build/custompage/delete/' . $obj->key) . "</td>";
    $out .= "</tr>";
  }
  $out .= "</table>";
  $out .= custompage_clearcache_message();
  return $out;
}