You are here

function dialog_example_page in Dialog 6

Same name and namespace in other branches
  1. 7 example/dialog_example.module \dialog_example_page()
1 call to dialog_example_page()
dialog_example_ajax_callback in example/dialog_example.module
1 string reference to 'dialog_example_page'
dialog_example_menu in example/dialog_example.module
Implementation of hook_menu().

File

example/dialog_example.module, line 36

Code

function dialog_example_page() {
  global $user;
  dialog_add_js();
  $links = array();
  $links[] = l('Simple test', 'dialog/nojs/example', array(
    'attributes' => array(
      'class' => 'ctools-use-dialog',
    ),
  ));
  if (!$user->uid) {
    $links[] = l('User login', 'user/login/nojs', array(
      'attributes' => array(
        'class' => 'ctools-use-dialog',
      ),
    ));
    $links[] = l('User registration', 'user/register/nojs', array(
      'attributes' => array(
        'class' => 'ctools-use-dialog',
      ),
    ));
  }
  else {
    $links[] = l(t('Logout'), 'logout', array(
      '@logout' => url('logout', array(
        'query' => array(
          'destination' => 'dialog/example',
        ),
      )),
    ));
  }
  return theme('item_list', $links);
}