Basic Definitions for Planet Module
[All Implemented Hooks]

Main user interface. More...

Collaboration diagram for Basic Definitions for Planet Module:

Functions

 planet_perm ()
 Implementation of hook_perm - Defines user permissions.
 planet_help ($path, $arg)
 Implementation of hook_help - Provides online user help.
 planet_menu ()
 Implementation of hook_menu() - Defines menu items and page callbacks.

Detailed Description

Main user interface.

Function Documentation

planet_help ( path,
arg 
)

Implementation of hook_help - Provides online user help.

Parameters:
$path A Drupal menu router path the help is being requested for
$arg 
Returns:
A localized string containing the help text.
00054                                   {
00055   switch ($path) {
00056     case 'admin/help#planet':
00057       // The module's help text, displayed on the admin/help page and through the module's individual help link. 
00058       $output = '<p>Planet is an aggregator that allows you to aggregate your users blogs and to display them in a "planet" fashion. Associating content with the users rather than as a detached feed.</p>';
00059       $output .= '<p>To use planet, go to admin/settings/planet and note the following sections:</p>';
00060       $output .= '<ul>';
00061       $output .= '<li><strong>General Settings</strong>. The filter format drop down will allow you to select the filter format that will be used to show planet entry nodes.</li>';
00062       $output .= '<li><strong>Feeds</strong>. This section lets you add a new feed. Give it a title, select an author, provide the feed url, and you\'re off. You\'ll have to manually refresh it or wait for a cron run for items to be imported.</li>';
00063       $output .= '<li><strong>Feeds</strong>. This section lists current feeds, when they were last updated, how many items they have, and it allows you to edit, refresh, or freeze them. Freezing is a quick way to temporarily suspend updates from the given feed.</li>';
00064       // @DIFFGROUP output syntax
00065       $output .= '</ul>';
00066       return $output;
00067       // @DIFFINFO in D6, admin/modules#description is moved to .info file
00068   }
00069 }

planet_menu (  ) 

Implementation of hook_menu() - Defines menu items and page callbacks.

Returns:
An array of menu items. Each menu item has a key corresponding to the Drupal path being registered.
@Invokes: _planet_settings() ( through page callback() )

@Invokes: planet_user_feeds() ( through page callback() )

@Invokes: planet_page_user() ( through page callback() )

@Invokes: planet_call_refresh() ( through page callback() )

@Invokes: planet_toggle_frozen() ( through page callback() )

@Invokes: planet_page_last() ( through page callback() )

@Invokes: planet_feed() ( through page callback() )

This diagram shows how requests are handled. Each arrow is labeled with the permission required to access link. The menu item colors reflect the item type. pages.dot

Menus and Pages

00150                        {
00151   $items['admin/settings/planet'] = array(
00152     'title' => 'Planet Settings',
00153     'description' => 'Configure settings for the planet module.',
00154     'page callback' => '_planet_settings',
00155     'access arguments' => array('administer nodes'),
00156     'type' => MENU_NORMAL_ITEM);
00157   
00158   $items['user/%user/planet'] = array(
00159     'title' => 'Planet Feeds',
00160     'page callback' => 'planet_user_feeds',
00161     'page arguments' => array(1),
00162     'access arguments' => array('administer own planet feeds'),
00163     'type' => MENU_LOCAL_TASK,
00164   );
00165   
00166   //  if (arg(0) == 'planet' && is_numeric(arg(1))) {
00167   // FIXME access denied http://localhost/drupal/?q=planet/1
00168   $items['planet/'. '%'] = array(
00169     'title' => 'planet',
00170     'page callback' => 'planet_page_user',
00171     'page arguments' => array(arg(1))
00172   );
00173 
00174   //   if (arg(3) == 'refresh' && is_numeric(arg(4))) {
00175   $items['admin/settings/planet/refresh/%'] = array(
00176     'title' => 'planet refresh',
00177     'page callback' => 'planet_call_refresh',
00178     'access arguments' => array('administer nodes'),
00179     'type' => MENU_CALLBACK
00180   );
00181 
00182   //  if (is_numeric(arg(4)) && (arg(3) == 'freeze' || arg(3) == 'unfreeze')) {
00183   $items['admin/settings/planet/'. arg(3) .'/%'] = array(
00184     'title' => 'planet freeze',
00185     'page callback' => 'planet_toggle_frozen',
00186     'access arguments' => array('administer nodes'),
00187     'type' => MENU_CALLBACK
00188   );
00189 
00190   $items['planet'] = array(
00191     'title' => 'Planet',
00192     'description' => 'Planet Page',
00193     'page callback' => 'planet_page_last',
00194     'access arguments' => array('access content'),
00195     'type' => MENU_NORMAL_ITEM
00196   );
00197     
00198   $items['planet/feed'] = array(
00199     'title' => 'Planet',
00200     'page callback' => 'planet_feed',
00201     'access arguments' => array('access content'),
00202     'type' => MENU_CALLBACK
00203   );  
00204       
00205   return $items;
00206 }

Here is the call graph for this function:

planet_perm (  ) 

Implementation of hook_perm - Defines user permissions.

The suggested naming convention for permissions is "action_verb modulename".

Returns:
An array of permissions strings.
00041                        {
00042   return array('administer planet', 'administer own planet feeds', 'view all planet nodes');
00043 }


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