Page callbacks (Menu System)

Functions registered in planet_menu(). More...


Functions

 planet_call_refresh ()
 @Menu page: 'admin/settings/planet/refresh/%' ( planet refresh )
 planet_toggle_frozen ()
 Freeze or unfreeze selected feed.
 planet_user_feeds ()
 @Menu page: 'user/%user/planet' ( Planet Feeds )
 _planet_settings ()
 @Menu page: 'admin/settings/planet' ( Planet Settings )
 planet_page_last ()
 @Menu page: 'planet' ( Planet )
 planet_feed ()
 @Menu page: 'planet/feed' ( Planet )
 planet_page ($a=NULL, $b=NULL)
 Menu callback; displays a Drupal page containing recent planet entries.
 planet_page_user ($uid)
 @Menu page: 'planet/%' ( planet )


Detailed Description

Functions registered in planet_menu().


Function Documentation

_planet_settings (  ) 

@Menu page: 'admin/settings/planet' ( Planet Settings )

DB @CRUD: planet_items[R]

DB @CRUD: planet_feeds[R]

@Invokes: planet_multiple_delete_confirm() ( through drupal_get_form() )

@Invokes: planet_multiple_delete_confirm_submit() ( through drupal_get_form() )

@Invokes: planet_feed_form() ( through drupal_get_form() )

@Invokes: planet_settings_form() ( through drupal_get_form() )

00457                             {
00458   if ($_POST) {  
00459     planet__update($_POST, 'admin/settings/planet');
00460   } else {    
00461     $fid = intval(arg(3)); // @deprecated arg()
00462     if ($fid > 0) {      
00463       $edit = db_fetch_array(db_query('SELECT * FROM {planet_feeds} WHERE fid = %d', $fid));
00464       $output .= drupal_get_form('planet_feed_form', $edit, true);
00465     }
00466     else {
00467     
00468       $output .= drupal_get_form('planet_settings_form');  
00469 
00470       $output .= drupal_get_form('planet_feed_form', $edit);
00471     
00472       $output .= '<h2>Feeds</h2>';
00473       $output .= planet__build_admin_feeds_table();
00474     }
00475     print theme('page', $output);    
00476   }
00477 }

Here is the call graph for this function:

planet_call_refresh (  ) 

@Menu page: 'admin/settings/planet/refresh/%' ( planet refresh )

00214                                {  
00215   $title = planet_refresh();
00216   watchdog('planet', 'Feed "'. $title .'" refreshed.');
00217   drupal_set_message('Feed "'. $title .'" refreshed.');
00218   drupal_goto('admin/settings/planet');
00219 }

Here is the call graph for this function:

planet_feed (  ) 

@Menu page: 'planet/feed' ( Planet )

DB @CRUD: node[R]

DB @CRUD: menu_links[R]

00856                        {
00857   $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'planet' AND n.status = 1 ORDER BY n.created DESC"), 0, 15);
00858   $title = db_fetch_array(db_query("SELECT link_title FROM {menu_links} WHERE link_path = 'planet'"));
00859   
00860   $channel['title'] = $title['link_title'];
00861   $channel['link'] = url('planet', array('absolute' => TRUE));
00862   $channel['description'] = 'Planet feed';
00863   
00864   $items = array();
00865   while ($row = db_fetch_object($result)) {
00866     $items[] = $row->nid;
00867   }
00868   // generate RSS feed from $items set of nodes.
00869   node_feed($items, $channel);
00870 }

Here is the call graph for this function:

planet_page ( a = NULL,
b = NULL 
)

Menu callback; displays a Drupal page containing recent planet entries.

Todo:
remove orphan function, or reuse it
00901                                            {
00902   // @DIFFINFO I keep this for now to keep showing, in API doc, historic relation between called functions  
00903   if (is_numeric($a)) { // $a is a user ID
00904     if ($b == 'feed') {
00905       return planet_feed_user($a);
00906     }
00907     else {
00908       return planet_page_user($a);
00909     }
00910   }
00911   else if ($a == 'feed') {
00912     return planet_feed_last();
00913   }
00914   else {
00915     return planet_page_last();
00916   }
00917 }

Here is the call graph for this function:

planet_page_last (  ) 

@Menu page: 'planet' ( Planet )

DB @CRUD: node[R]

DB @CRUD: variables[R]

00832                             {
00833   global $user;
00834 
00835   $output = '<br />';
00836 
00837   $result = pager_query(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'planet' AND n.status = 1 ORDER BY n.created DESC"), variable_get('default_nodes_main', 10));
00838 
00839   while ($node = db_fetch_object($result)) {
00840     $node = node_load($node->nid);
00841     $node->format = variable_get('planet_filter_formats', 1);
00842     $output .= node_view($node);
00843   }
00844   $output .= theme('pager', NULL, variable_get('default_nodes_main', 10));
00845   $output .= theme('xml_icon', url('planet/feed'));
00846   
00847   print theme('page', $output);
00848 }

Here is the call graph for this function:

Here is the caller graph for this function:

planet_page_user ( uid  ) 

@Menu page: 'planet/%' ( planet )

DB @CRUD: node[R]

DB @CRUD: variables[R]

00926                                 {
00927   global $user;
00928 
00929   $account = user_load(array((is_numeric($uid) ? 'uid' : 'name') => $uid, 'status' => 1));
00930 
00931   if ($account->uid) {
00932     drupal_set_title($title = t("%name's planet", array('%name' => $account->name)));
00933 
00934     if ($output) {
00935       $output = '<ul>'. $output .'</ul>';
00936     }
00937     else {
00938       $output = '';
00939     }
00940      $result = pager_query(db_rewrite_sql("SELECT n.nid, n.sticky, n.created FROM {node} n WHERE type = 'planet' AND n.uid = %d AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC"), variable_get('default_nodes_main', 10), 0, NULL, $account->uid);
00941     while ($node = db_fetch_object($result)) {
00942       $output .= node_view(node_load($node->nid), 1);
00943     }
00944     $output .= theme('pager', NULL, variable_get('default_nodes_main', 10));
00945     $output .= theme('feed_icon', url("planet/$account->uid/feed"));
00946 
00947     drupal_add_link(array('rel' => 'alternate',
00948                           'type' => 'application/rss+xml',
00949                           'title' => t('RSS - %title', array('%title' => $title)),
00950                           'href' => url("planet/$account->uid/feed")));
00951     return $output;
00952   }
00953   else {
00954     drupal_not_found();
00955   }
00956 }

Here is the call graph for this function:

Here is the caller graph for this function:

planet_toggle_frozen (  ) 

Freeze or unfreeze selected feed.

Frozen feeds are excluded from automatic updates, but are still updatable on request.

@Menu page: 'admin/settings/planet/*/%' ( planet freeze )

DB @CRUD: planet_feeds[U]

00229                                 {
00230   
00231   $fid = intval(arg(4));
00232   db_query('UPDATE {planet_feeds} SET frozen = %d WHERE fid = %d', arg(3) == 'unfreeze' ? 0 : 1, $fid);
00233   drupal_set_message('Feed '. (arg(3) == 'unfreeze' ? 'un' : '') .'frozen.');
00234   drupal_goto('admin/settings/planet');
00235 }

Here is the call graph for this function:

planet_user_feeds (  ) 

@Menu page: 'user/%user/planet' ( Planet Feeds )

DB @CRUD: planet_feeds[R]

@Invokes: planet_multiple_delete_confirm_submit() ( through drupal_get_form() )

@Invokes: planet_feed_form() ( through drupal_get_form() )

00268                              {
00269   global $user;
00270   if ($_POST) {  
00271     return planet__update($_POST, 'user/'. $user->uid .'/planet');
00272   }
00273   $fid = intval(arg(3));      // @deprecated: arg()
00274   if ($fid > 0) {      
00275     $edit = db_fetch_array(db_query('SELECT * FROM {planet_feeds} WHERE fid = %d', $fid));
00276     $output .= drupal_get_form('planet_feed_form', $edit, true, $user);
00277   }
00278   else {
00279     
00280     $output .= drupal_get_form('planet_feed_form', $edit, false, $user);
00281     
00282     $output .= '<h2>Feeds</h2>';
00283     $output .= planet__build_user_feeds_table();
00284   }
00285   print theme('page', $output);
00286 }

Here is the call graph for this function:


Generated on Tue Mar 24 20:27:25 2009 for ubuntu-drupal by  doxygen 1.5.8