mypage.module File Reference

This module provides the core functionality for implemented modules and components. More...


Functions

 mypage_init ()
 Implementation of hook_init().
 mypage_menu ($may_cache)
 Implementation of hook_menu().
 mypage_module_invoke ($type, &$page, $uid)
 Allows other modules to hook into the mypage process.
 mypage_admin_user ($uid)
 Provides the administrative settings to the mypage user.
 mypage_admin_user_validate ($form_id, $form_values)
 Companion function handles submission of user settings page. Called by Drupal core.
 mypage_admin_user_submit ($form_id, $form_values)
 Companion function handles submission of user settings page. Called by Drupal core.
 mypage_admin ()
 Provides the administration settings for the MyPage module and enabled components.
 mypage_get_page ($id_name=NULL)
 returns a custom page
 mypage_mypage ($type, &$data, $uid)
 Implements our own hook.
 mypage_page_build ($data)
 Builds the page based on the data collected from the mypage hook.
 mypage_variable_get ($component, $variable, $default=NULL, $uid=0)
 Returns a variable for a component.
 mypage_variable_set ($component, $variable, $value, $uid=0)
 Sets a variable for a mypage componen.
 mypage_component_administration ($uid)
 Returns the administration component for the page.
 _mypage_get_id ($id_name=NULL)
 Returns user id.
 _mypage_sort_row ($a, $b)
 Called by uasort() to sort the page elements by row.
 _mypage_sort_col ($a, $b)
 Called by uasort() to sort the columns.


Detailed Description

This module provides the core functionality for implemented modules and components.

Date:
2008/03/11
Author:
Jacob Steelsmith 'jacob@steelsmith.org'
Bug:
The module returns a profile for non-existant user. The user should be informed the requested profile does not exist.
Todo:
Implement the positionable components.
Todo:
Implement specifiable styles.

Function Documentation

int _mypage_get_id ( id_name = NULL  ) 

Returns user id.

Date:
2008/03/11
Parameters:
$id_name string containing user name or uid
Returns:
the corresponding, verified user id
Returns a verified uid for the given user name or password, or returns 0 if not found or if null is passed.

int _mypage_sort_col ( a,
b 
)

Called by uasort() to sort the columns.

Date:
2008/03/21
Parameters:
$a Array element for comparison.
$b Array element for comparison.
Returns:
Returns zero if the two are equal, -1 if $a is less than $b and 1 if $a is greater than $b.

int _mypage_sort_row ( a,
b 
)

Called by uasort() to sort the page elements by row.

Date:
2008/03/21
Parameters:
$a Array element for comparison.
$b Array element for comparison.
Returns:
Returns zero if the two are equal, -1 if $a is less than $b and 1 if $a is greater than $b.

string mypage_admin (  ) 

Provides the administration settings for the MyPage module and enabled components.

Author:
Jacob Steelsmith jacob@steelsmith.org
Date:
2008/04/04
Returns:
A form with the administration settings.
Callback for drupal menu hook /admin/settings/mypage.

Issues a type 'settings' from any implemented mypage hook, passing the form to be returned to the user.

string mypage_admin_user ( uid  ) 

Provides the administrative settings to the mypage user.

Author:
Jacob Steelsmith 'jacob@steelsmith.org'
Date:
2008/04/04
Parameters:
$uid The user id of the user we're getting the settings for.
Returns:
A form with the user's page settings.

bool mypage_admin_user_submit ( form_id,
form_values 
)

Companion function handles submission of user settings page. Called by Drupal core.

Author:
Jacob Steelsmith 'jacob@steelsmith.org'
Date:
2008/04/04
Parameters:
$form_id The form id.
$form_values The values of the form after submission.
Returns:
The function returns the path the user is sent to after submission, currently mypage/settings.

Issue a mypage hook request for the type 'user settings submit' to allow any modules the opportunity to work on the validated, submitted data from the user settings.

null mypage_admin_user_validate ( form_id,
form_values 
)

Companion function handles submission of user settings page. Called by Drupal core.

Author:
Jacob Steelsmith 'jacob@steelsmith.org'
Date:
2008/04/04
Parameters:
$form_id The form id.
$form_values The values of the form after submission.
This function is called by the Drupal core after submission. It will trigger an error if detected.

For validation, we want to pass the form values as an element of the data array. Another element will be return which will be blank. This will contain any errors (form element name and error).

string mypage_component_administration ( uid  ) 

Returns the administration component for the page.

Date:
2008/04/04
Parameters:
$uid The user id of the page requsted.
Returns:
Returns and array for processing in the page.

string mypage_get_page ( id_name = NULL  ) 

returns a custom page

Author:
Jacob Steelsmith
Date:
2008/03/11
Parameters:
$id_name uid or user name
Returns:
html for page.
Returns a custom page for the given user id or user name.

Issues a mypage hook type 'page load' so any other components or modules can manipulate the page before it is rendered.

null mypage_init (  ) 

Implementation of hook_init().

Date:
2008/04/04
Provides setup tasks for the module.

array mypage_menu ( may_cache  ) 

Implementation of hook_menu().

Author:
Jacob Steelsmith 'jacob@steelsmith.org'
Date:
2008/03/11
Parameters:
@may_cache If Drupal is going to cache the returned links or not.

null mypage_module_invoke ( type,
&$  page,
uid 
)

Allows other modules to hook into the mypage process.

Author:
Jacob Steelsmith 'jacob@steelsmith.org'
Date:
2008/03/11
Parameters:
$type Type of action being taken by the module for the call.
&$page The page being created. Passed by reference.
$uid The user id being worked on.
Returns:
Does not return a value.
This module creates the mypage hook. any module that has a function x_mypage(), where x is the name of the module implements this hook. This function is called throughout the core to perform various functions.

null mypage_mypage ( type,
&$  data,
uid 
)

Implements our own hook.

Author:
Jacob Steelsmith
Date:
2008/03/11
Parameters:
$type The type of operation being performed.
$data The page being constructed. Passed by reference.
$uid The user id of the user we're operating on now.
Returns:
Function returns nothing. This function sets elements of the data variable (passed by ref).

string mypage_page_build ( data  ) 

Builds the page based on the data collected from the mypage hook.

Author:
Jacob Steelsmith
Date:
2008/03/17
Parameters:
$data Data returned by the mypage hook. Should be an associative array.
Returns:
Returns a rendered page.

string mypage_variable_get ( component,
variable,
default = NULL,
uid = 0 
)

Returns a variable for a component.

Date:
2008/04/04
Parameters:
$component The component requesting the variable.
$variable The name of the variable.
$uid The uid we are querying for.
$default The default value returned if the variable isn't found.
Returns:
This function returns the variable value or the value specified in the $default variable, or null as a default.
This is an accessor function that provides abstraction for getting a variable. This will be good for caching.

bool mypage_variable_set ( component,
variable,
value,
uid = 0 
)

Sets a variable for a mypage componen.

Date:
2008/04/04
Parameters:
$component The component setting the variable.
$variable The name of the variable.
$value The value we're setting the variable to.
$uid The uid we are setting for.
Returns:
Function always returns true.
This is an accessor function that provides abstraction for setting a variable.


Generated on Sun Apr 13 23:02:21 2008 for mypage by  doxygen 1.5.3