og_forums.module File Reference

Go to the source code of this file.

Enumerations

Functions


Detailed Description

Creates one or more forums per organic group and restricts viewing forum nodes by group membership.

This module is the redeveloped version of Paul Booker's OG Forum module. This module comes with the name "OG Forum Reloded" - OGFR.

Definition in file og_forums.module.


Enumeration Type Documentation

Constant to define the publicity of a forum.

Definition at line 15 of file og_forums.module.

Constant to define the publicity of a forum.

Definition at line 20 of file og_forums.module.

Constant to define the publicity of a forum.

Definition at line 25 of file og_forums.module.

Constant to define the publicity of a forum.

Definition at line 30 of file og_forums.module.


Function Documentation

og_forums_help ( path,
arg 
)

Implementation of hook_help().

Definition at line 35 of file og_forums.module.

og_forums_perm (  ) 

Implementation of hook_perm().

Definition at line 58 of file og_forums.module.

og_forums_menu (  ) 

Implementation of hook_menu().

Definition at line 65 of file og_forums.module.

og_forums_menu_alter ( &$  callbacks  ) 

Implementation of hook_menu_alter().

Definition at line 143 of file og_forums.module.

og_forums_form_alter ( &$  form,
&$  form_state,
form_id 
)

og_forums_group_type_load ( arg  ) 

Wildcard loader function.

See also:
og_forums_menu()
Wildcard Loader Arguments: http://drupal.org/node/224170

Definition at line 316 of file og_forums.module.

References og_forums_get_forum_container(), and og_forums_is_public_all().

og_forums_block ( op = 'list',
delta = 0,
edit = array() 
)

Implementation of hook_block().

Creates a block to display forum information for a group.

Definition at line 346 of file og_forums.module.

References og_forums_get_forum_container().

og_forums_access_privileges_1 ( gid  ) 

Access callback.

See also:
og_forums_menu()

Definition at line 426 of file og_forums.module.

References og_forums_is_admin().

og_forums_access_privileges_2 ( gid  ) 

Access callback.

See also:
og_forums_menu()

Definition at line 438 of file og_forums.module.

References og_forums_is_admin().

og_forums_access_privileges_3 ( gid,
tid 
)

Access callback.

See also:
og_forums_menu()

Definition at line 449 of file og_forums.module.

References og_forums_forum_limit_reached(), and og_forums_is_admin().

og_forums_public ( gid,
tid 
)

Set a forum as public, and its container as well.

Parameters:
$gid The group ID of the forum.
$tid The term ID of the forum.

Definition at line 466 of file og_forums.module.

References og_forums_get_forum_container().

Referenced by og_forums_taxonomy().

og_forums_private ( gid,
tid 
)

Set forum as private, and its container if no other forums in it are public.

See also:
og_forums_menu()

og_forums_taxonomy()

Parameters:
$gid The group ID of the forum.
$tid The term ID of the forum.

Definition at line 501 of file og_forums.module.

References og_forums_get_forum_container().

Referenced by og_forums_taxonomy().

og_forums_reset ( gid,
tid 
)

Reset forum to default of PRIVATE_DEFAULT, and its container if no other forums in it are public.

See also:
og_forums_menu()
Parameters:
$gid The group ID of the forum.
$tid The term ID of the forum.

Definition at line 544 of file og_forums.module.

References og_forums_get_forum_container().

og_forums_manage ( gid  ) 

_og_forums_manage_row ( manage,
op 
)

Helper funtion to build container and forum rows.

See also:
og_forums_manage()
Parameters:
$manage An associative array contain the following parameters:
  • 'limit_reached' The quota status to add forums.
  • 'default_container_yn' Status to use groups forums default container.
  • 'all_tids' An associative array contains terms with their public status.
  • 'group' An group node object.
  • 'term' An term object.
  • 'term_link' HTML formatted link to forum.
  • 'i' An counter value.
$op Possible values:
  • 'container'
  • 'forum'
Returns:
An array contain the table cell values of an row.

Definition at line 728 of file og_forums.module.

Referenced by og_forums_manage().

og_forums_forum_availability ( form_state  ) 

Provide the form to allow group managers toggle the forums availability.

See also:
og_forums_manage()
Returns:
The form array.

Definition at line 835 of file og_forums.module.

og_forums_forum_availability_submit ( form,
&$  form_state 
)

Submit callback.

Saves availability of the forums from a group in the user object of the group manager.

See also:
og_forums_forum_availability()
Todo:
In place of the user object using the database table og_terms to save the groups forums availability.

Definition at line 905 of file og_forums.module.

og_forums_form_main ( type,
group_id,
tid 
)

Select the right form to display.

See also:
og_forums_forum_get_parent()
Parameters:
$type Possible values:
  • 'add' Add an forum.
  • 'edit' Edit an forum.
$group_id An group ID.
$tid An term ID.
Returns:
2 different forms:
  • Confirmation form
  • Add/edit form

Definition at line 929 of file og_forums.module.

References og_forums_forum_get_parent().

og_forums_set_og_group_context_from_tid ( tid = 0  ) 

og_forums_gid_from_tid ( tid = 0  ) 

og_forums_tid_from_gid ( gid  ) 

Using the group ID, get the term ID.

The requested term id is the id of the groups name term - the container of the group.

See also:
_og_forums_parent_select()
Parameters:
$gid An group ID.
Returns:
An term ID or 0.

Definition at line 1006 of file og_forums.module.

Referenced by _og_forums_parent_select(), and og_forums_manage().

og_forums_db_rewrite_sql ( query,
primary_table = 'n',
primary_field = 'nid',
args = array() 
)

Implementation of hook_db_rewrite_sql().

Definition at line 1020 of file og_forums.module.

og_forums_nodeapi ( &$  node,
op,
teaser = NULL,
page = NULL 
)

Implementation of hook_nodeapi().

Automatically creates a forum container and forum each time an organic group is added.

og_forums_set_og_group_context_from_tid()

See also:
og_forums_manage_terms()

og_forums_get_group_forums()

og_forums_gid_from_tid()

og_forums_retroactively_apply()

Warning:
The Opera browser can not be used! If this browser adds new groups, there are mistakes: Group nodes are created double or triple. In consequence of which the terms of the taxonomy created will be double or triple.
Todo:
Operator 'delete', action group forum availability: In place of the user object using the database table og_terms to manage the groups forums availability.

Definition at line 1078 of file og_forums.module.

References _og_forums_no_forums_message(), _og_forums_set_breadcrumb(), og_forums_get_forum_container(), og_forums_get_group_forums(), og_forums_gid_from_tid(), og_forums_is_admin(), and og_forums_set_og_group_context_from_tid().

Referenced by og_forums_retroactively_apply().

og_forums_manage_terms ( &$  node,
op 
)

Manage terms and access templates.

  • Save taxonomy terms.
  • Save OGFR terms.
  • Save OGFR forum access templates.

See also:
og_forums_nodeapi()

og_forums_get_vid()

_og_forums_clean_forum_names()

Parameters:
$node An node object.
$op Possible values:
  • 'og_forums_default_container_yn_yes'
  • 'og_forums_default_container_yn_no'

Definition at line 1343 of file og_forums.module.

References _og_forums_access_template_container_default(), _og_forums_access_template_forum_default(), _og_forums_clean_forum_names(), og_forums_access_template(), and og_forums_get_vid().

og_forums_comment ( &$  a1,
op 
)

Implementation of hook_comment().

Definition at line 1565 of file og_forums.module.

References _og_forums_set_breadcrumb(), og_forums_gid_from_tid(), and og_forums_set_og_group_context_from_tid().

og_forums_get_forum_container ( gid  ) 

Retrieve container for given group.

Parameters:
$gid Organic group ID.
Returns:
Forum container's term ID.

Definition at line 1591 of file og_forums.module.

Referenced by og_forums_block(), og_forums_group_type_load(), og_forums_nodeapi(), og_forums_og_create_links(), og_forums_private(), og_forums_public(), og_forums_reset(), and og_forums_settings_submit().

og_forums_is_admin ( group  ) 

Check if a user is a group manager of the given group.

Parameters:
$group The node object of a group.
Returns:
TRUE or FALSE.

Definition at line 1604 of file og_forums.module.

Referenced by og_forums_access_privileges_1(), og_forums_access_privileges_2(), og_forums_access_privileges_3(), og_forums_form_validate(), og_forums_manage(), og_forums_nodeapi(), and og_forums_og_create_links().

og_forums_og_create_links ( group  ) 

Implementation of hook_og_create_links().

Create additional OG Forums links to display in the OG administer block.

Returns:
An array contains the links.

Definition at line 1629 of file og_forums.module.

References og_forums_get_forum_container(), and og_forums_is_admin().

og_forums_retroactively_apply (  ) 

Creates forums for all groups that don't have any yet.

See also:
og_forums_nodeapi()

Definition at line 1659 of file og_forums.module.

References og_forums_nodeapi().

Referenced by og_forums_settings_submit().

og_forums_form_forum ( &$  form_state,
edit,
gid = 0,
tid = 0 
)

og_forums_form_validate ( form,
&$  form_state 
)

Validate group id, default container and term id values.

See also:
og_forums_form_forum()

Definition at line 1803 of file og_forums.module.

References _og_forums_ogterms(), and og_forums_is_admin().

og_forums_form_submit ( form,
&$  form_state 
)

Store created/updated forum on the database.

See also:
og_forums_form_forum()

Definition at line 1834 of file og_forums.module.

og_forums_taxonomy ( op,
type,
obj 
)

Implementation of hook_taxonomy().

This should replace og_forums's own management of terms which bypasses regular taxonomy. Using this function allows group forums to be managed both from within the group and at the site-wide forum admin pages.

See also:
og_forums_forum_limit_reached()

og_forums_forum_access_get_settings()

og_forums_access_template()

og_forums_public()

og_forums_private()

Parameters:
$op What is being done to $array. Possible values:
  • 'insert'
  • 'update'
  • 'delete'
$type What manner of item $array is. Possible values:
  • 'term'
  • 'vocabulary'
$obj The item on which $op is being performed. Possible values:
  • 'update' op: $form_state['values'] from taxonomy_form_term_submit()
  • 'delete' op: $term from taxonomy_get_term() cast to an array

Definition at line 1885 of file og_forums.module.

References _og_forums_access_template_container_default(), _og_forums_access_template_forum_default(), og_forums_access_template(), og_forums_forum_limit_reached(), og_forums_private(), and og_forums_public().

og_forums_confirm_delete ( form_state,
tid,
gid 
)

Create a confirmation form for deleting a forum.

See also:
og_forums_form_main()
Parameters:
$tid The ID of the term to be deleted.
$gid An group ID.
Returns:
The confirmation form.

Definition at line 1959 of file og_forums.module.

og_forums_confirm_delete_submit ( form,
&$  form_state 
)

Implementation of forms api _submit call. Deletes a forum after confirmation.

See also:
og_forums_gid_from_tid()

Definition at line 1990 of file og_forums.module.

og_forums_node_delete_confirm_submit ( form,
&$  form_state 
)

Submit callback.

See also:
og_forums_form_alter()

Definition at line 2007 of file og_forums.module.

og_forums_forum_limit_reached ( nid,
corrector = 1 
)

Find out if the limit has been reached for groups forums in a particular group.

Parameters:
$nid ID of an group.
Returns:
TRUE or FALSE.

Definition at line 2026 of file og_forums.module.

Referenced by og_forums_access_privileges_3(), og_forums_manage(), and og_forums_taxonomy().

og_forums_is_public ( tid  ) 

Test whether a tid (forum or container) is public and return results.

Parameters:
$tid ID of an term.
Returns:
FALSE or TRUE.

Definition at line 2063 of file og_forums.module.

Referenced by og_forums_form_alter(), og_forums_form_forum(), and og_forums_preprocess_forum_list().

og_forums_is_public_all ( nid  ) 

Test whether all tids (forums or container) is public.

Returns:
TRUE or FALSE.

Definition at line 2084 of file og_forums.module.

Referenced by og_forums_group_type_load().

og_forums_is_og_forums ( tid  ) 

Test whether a tid is an OGFR forum.

Returns:
FALSE or TRUE.

Definition at line 2108 of file og_forums.module.

og_forums_get_vid (  ) 

Get the forums vocabulary.

Returns:
  • The forums vocabulary ID if it exists.
  • FALSE if the forums vocabulary ID not defined.

Definition at line 2127 of file og_forums.module.

Referenced by og_forums_form_alter(), og_forums_form_forum(), og_forums_manage(), and og_forums_manage_terms().

og_forums_get_parents_all ( tid  ) 

Find all ancestors of a given term ID.

Returns:
An array contains the parent terms as term object.

Definition at line 2137 of file og_forums.module.

og_forums_access_template ( tid,
grant,
op 
)

Insert/update/delete the forum_access database entries for the OGFR access template permissions by a given term and for the two roles anonymous user and authenticated user.

See also:
og_forums_taxonomy()
Parameters:
$tid ID of an term.
$grant An array contain the permission values.
$op The item on which $op is being performed. Possible values:
  • 'insert'
  • 'update'
  • 'delete'

Definition at line 2170 of file og_forums.module.

Referenced by og_forums_manage_terms(), and og_forums_taxonomy().

og_forums_preprocess_node ( &$  variables  ) 

For OGFR forums content - make a correct breadcrumb.

See also:
og_forums_preprocess_forums()

_og_forums_set_breadcrumb()

Definition at line 2202 of file og_forums.module.

References _og_forums_set_breadcrumb().

og_forums_get_forums_availability ( node,
user 
)

Check groups forums availability, configured by group manager.

Returns:
TRUE or FALSE.

Definition at line 2214 of file og_forums.module.

og_forums_access_forum_page ( tid = 0  ) 

og_forums_preprocess_forums ( &$  variables  ) 

Preprocess variables to format the forums.

Alter the "Post new forum topic" link to "Post new Group forum topic".

See also:
og_forums_gid_from_tid()

og_forums_forum_empty()

_og_forums_set_group_context()

_og_forums_set_breadcrumb()

Definition at line 2285 of file og_forums.module.

References _og_forums_set_breadcrumb(), _og_forums_set_group_context(), og_forums_forum_empty(), and og_forums_gid_from_tid().

og_forums_preprocess_forum_topic_list ( &$  variables  ) 

Preprocess variables to format the forum topic listing.

Hide the table header if a forum has no topics.

Definition at line 2318 of file og_forums.module.

og_forums_preprocess_forum_list ( &$  variables  ) 

Process variables to format a forum listing.

Hide private groups forums in the main forum list. Administrators and group members can see private groups forums in the main forum list.

See also:
og_forums_get_group_forums()

og_forums_gid_from_tid()

og_forums_is_public()

Definition at line 2335 of file og_forums.module.

References _og_forums_forum_list_hide(), og_forums_get_group_forums(), og_forums_gid_from_tid(), and og_forums_is_public().

og_forums_get_group_forums ( gid = FALSE,
op = 'all' 
)

Returns all group container and forums or only forums by a given group.

If no group will be given back all group container and forums.

See also:
og_forums_nodeapi()

og_forums_preprocess_forum_list()

_og_forums_parent_select()

Parameters:
$gid ID of an group.
$op Optional; Return container and forums or only forums. Possible values:
  • 'all' Container and forums.
  • 'forum' Only forums.
Returns:
An associative array contains the group container and forum terms or only the forum terms.

Definition at line 2398 of file og_forums.module.

Referenced by _og_forums_forum_list_hide(), og_forums_manage(), og_forums_nodeapi(), and og_forums_preprocess_forum_list().

og_forums_forum_get_parent ( tid  ) 

Returns parent term by a given term.

See also:
og_forums_manage()

og_forums_form_main()

Parameters:
$tid ID of an term.
Returns:
An object contains the parent term or FALSE.

Definition at line 2442 of file og_forums.module.

Referenced by og_forums_form_main(), and og_forums_manage().

og_forums_get_tree ( vid,
parent = 0,
depth = -1,
max_depth = NULL 
)

Create a hierarchical representation of a vocabulary.

OGFR used this function mainly to produce the tree of a group.

Parameters:
$vid Which vocabulary to generate the tree for.
$parent The term ID under which to generate the tree. If 0, generate the tree for the entire vocabulary.
$depth Internal use only.
$max_depth The number of levels of the tree to return. Leave NULL to return all levels.
Returns:
An array of all term objects in the tree. Each term object is extended to have "depth" and "parents" attributes in addition to its normal ones. Results are statically cached.

Definition at line 2470 of file og_forums.module.

Referenced by _og_forums_parent_select(), and og_forums_manage().

og_forums_forum_empty ( node  ) 

Display different messages when all the forums of a group are private and if the visitor is not a member of the group.

See also:
og_forums_preprocess_forums()

Definition at line 2488 of file og_forums.module.

Referenced by og_forums_preprocess_forums().

og_forums_forum_access_get_settings ( tid = NULL,
rid = DRUPAL_AUTHENTICATED_RID 
)

Retrieve the settings for a forum by an role.

See also:
og_forums_taxonomy()
Parameters:
$tid ID of an term.
$rid ID of an role.
Returns:
An associative array contains access values.

Definition at line 2528 of file og_forums.module.

og_forums_error ( tid = NULL,
nid = NULL,
term_title = NULL 
)

Log errors to watchdog.

See also:
og_forums_manage_terms()
Parameters:
$tid An term ID.
$nid An node ID.

Definition at line 2565 of file og_forums.module.

_og_forums_set_breadcrumb ( tid,
is_forum_post = FALSE 
)

Helper function to create the breadcrumb for OG Forums.

See also:
og_forums_preprocess_node()

og_forums_preprocess_forums()

Definition at line 2580 of file og_forums.module.

References og_forums_gid_from_tid().

Referenced by og_forums_comment(), og_forums_nodeapi(), og_forums_preprocess_forums(), and og_forums_preprocess_node().

_og_forums_manage_breadcrumb ( group,
op = NULL 
)

Set a nice breadcrumb for the manage pages.

See also:
og_forums_manage()

og_forums_form_forum()

Definition at line 2625 of file og_forums.module.

Referenced by og_forums_form_forum(), and og_forums_manage().

_og_forums_forum_list_hide ( &$  variables  ) 

Helper function to hide container if they contains no (public) forums.

See also:
og_forums_preprocess_forum_list()

Definition at line 2656 of file og_forums.module.

References og_forums_get_group_forums(), and og_forums_gid_from_tid().

Referenced by og_forums_preprocess_forum_list().

_og_forums_ogterms ( group  ) 

Returns an array containing terms associated to this og.

Parameters:
$group An group node object.

Definition at line 2697 of file og_forums.module.

Referenced by og_forums_form_validate(), and og_forums_manage().

_og_forums_set_group_context ( group  ) 

Set the theme for the current request. Set the language for the page based on group's language. Set the group context for the current request.

See also:
og_forums_preprocess_forums()

Definition at line 2715 of file og_forums.module.

Referenced by og_forums_preprocess_forums().

_og_forums_parent_select ( tid,
title,
child_type,
gid 
)

Returns a select box for available parent terms.

See also:
og_forums_form_forum()

og_forums_get_group_forums()

og_forums_tid_from_gid()

og_forums_get_tree()

Parameters:
$tid ID of the term which is being added or edited.
$title Title to display the select box with.
$child_type Whether the child is forum or container.
$gid An group ID.

Definition at line 2738 of file og_forums.module.

References og_forums_get_tree(), and og_forums_tid_from_gid().

Referenced by og_forums_form_forum().

_og_forums_access_template_container_default (  ) 

Provisioning of the default values of the system-variable og_forums_access_template_container.

Returns:
An associative array contains access values.

Definition at line 2798 of file og_forums.module.

Referenced by _og_forums_access_template_form(), _og_forums_template_value(), og_forums_manage_terms(), and og_forums_taxonomy().

_og_forums_access_template_forum_default (  ) 

Provisioning of the default values of the system-variable og_forums_access_template_forum.

Returns:
An associative array contains access values.

Definition at line 2814 of file og_forums.module.

Referenced by _og_forums_access_template_form(), _og_forums_template_value(), og_forums_manage_terms(), and og_forums_taxonomy().

_og_forums_no_forums_message ( op = 'member',
path 
)

Create an status message if no forums exists for a group.

See also:
og_forums_manage()
Parameters:
$op Possible values:
  • 'member' An group member.
  • 'manager' An group manager.
Returns:
The formatted message.

Definition at line 2844 of file og_forums.module.

Referenced by og_forums_manage(), and og_forums_nodeapi().

_og_forums_clean_forum_names ( forum_names  ) 

Clean form input.

See also:
og_forums_manage_terms()
$param $forum_names An forum name.
Returns:
The cleaned forum name.

Definition at line 2871 of file og_forums.module.

Referenced by og_forums_admin_settings_validate(), and og_forums_manage_terms().

og_forum_migrate (  ) 

Todo:
Integration of a function to migrate from "OG Forum" to "OG Forum Reloaded".

Definition at line 2887 of file og_forums.module.


Generated on Mon Jan 18 18:53:54 2010 for OG Forum Reloaded by  doxygen 1.5.5