? .dialog_example.module.swp
Index: dialog_example.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/dialog/example/dialog_example.module,v
retrieving revision 1.1
diff -u -p -r1.1 dialog_example.module
--- dialog_example.module	7 Dec 2009 01:47:59 -0000	1.1
+++ dialog_example.module	31 Jan 2011 20:55:06 -0000
@@ -35,11 +35,19 @@ function dialog_example_menu() {
 }
 
 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')));
-  $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')));
+  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);
 }
 
@@ -51,7 +59,7 @@ function dialog_example_ajax_callback($a
       'position' => 'center',
     );
     dialog_ajax_render('test', dialog_example_page(), $options);
-    return;    
+    return;
   }
 
   return 'hello world';
@@ -90,7 +98,7 @@ function dialog_login_callback($type, $j
         if ($command['command'] == 'dialog_display') {
           $output[$i]['options']['height'] = 'auto';
           $output[$i]['options']['width'] = 600;
-          
+
           $output[$i]['options']['position'] = 'center';
           $output[$i]['options']['resizable'] = FALSE;
         }
@@ -110,5 +118,5 @@ function dialog_example_form_alter(&$for
   elseif ($form_id == 'user_register' && !empty($form_state['ajax'])) {
     $form['submit']['#attributes']['class'] = 'ctools-dialog-button';
   }
-  
-}
\ No newline at end of file
+
+}
