You are here

function beautytips_manager_tips_manager_page in BeautyTips 6.2

Same name and namespace in other branches
  1. 7.2 beautytips_manager.admin.inc \beautytips_manager_tips_manager_page()

Listing of all beautytips available.

1 string reference to 'beautytips_manager_tips_manager_page'
beautytips_manager_menu in ./beautytips_manager.module
Implementation of hook_menu().

File

./beautytips_manager.module, line 40

Code

function beautytips_manager_tips_manager_page() {
  $rows = array();
  $empty = '';
  $header = array(
    t('Element'),
    t('Style'),
    t('Visibility'),
    t('Pages'),
    t('operations'),
  );
  $tips = beautytips_manager_get_custom_tips();
  $link = l(t('Add New Custom Beautytip'), 'admin/settings/beautytips/manager/add');
  if (count($tips)) {
    $visibility = array(
      t('Show on every page except the listed pages.'),
      t('Show on only the listed pages.'),
    );
    foreach ($tips as $tip) {
      $tip->pages = check_plain($tip->pages);
      $pages = $tip->pages != substr($tip->pages, 0, 40) ? substr($tip->pages, 0, 40) . '...' : substr($tip->pages, 0, 40);
      $rows[$tip->bid]['element'] = check_plain($tip->element);
      $rows[$tip->bid]['style'] = $tip->style;
      $rows[$tip->bid]['visibility'] = $visibility[$tip->visibility];
      $rows[$tip->bid]['pages'] = $pages;
      $rows[$tip->bid]['edit'] = l(t('edit'), "admin/settings/beautytips/manager/{$tip->bid}/edit");
      $rows[$tip->bid]['delete'] = l(t('delete'), "admin/settings/beautytips/manager/{$tip->bid}/delete");
    }
  }
  else {
    $empty = t('There are no custom beautytips yet.');
  }
  return $link . theme('table', $header, $rows) . $empty;
}