You are here

function theme_login_destination_pages in Login Destination 7

Render a page type of login destination rule.

1 theme call to theme_login_destination_pages()
login_destination_overview_form in ./login_destination.admin.inc
Form for editing an entire login destination at once.

File

./login_destination.admin.inc, line 299
Admin page callback file for the Login Destination module.

Code

function theme_login_destination_pages($variables) {
  $type = $variables['pages_type'];
  if ($type == LOGIN_DESTINATION_REDIRECT_PHP) {
    return nl2br(check_plain($variables['pages']));
  }
  $pages = trim($variables['pages']);
  if (empty($pages)) {
    if ($type == LOGIN_DESTINATION_REDIRECT_NOTLISTED) {
      return '<i>' . t('All pages') . '</i>';
    }
    else {
      return '<i>' . t('No pages') . '</i>';
    }
  }
  $pages = explode("\n", preg_replace('/\\r/', '', check_plain($variables['pages'])));
  $output = '';
  foreach ($pages as &$page) {
    if ($type == LOGIN_DESTINATION_REDIRECT_NOTLISTED) {
      $output .= "~ ";
    }
    $output .= $page . "<br/>";
  }
  return $output;
}