tft_og_archive.module in Taxonomy File Tree 7.2
Hook implementations and module logic.
File
modules/tft_og_archive/tft_og_archive.moduleView source
<?php
/**
* @file
* Hook implementations and module logic.
*/
/**
* Implements hook_rules_action_info().
*/
function tft_og_archive_rules_action_info() {
return array(
'tft_og_archive_rules_create_og_archive_folder' => array(
'label' => t('Create an archive folder for a group'),
'group' => t('Taxonomy File Tree'),
'parameter' => array(
'group' => array(
'type' => 'node',
'label' => t('Group'),
),
),
),
);
}
/**
* Implements hook_tft_term_access().
*/
function tft_og_archive_tft_term_access($tid, $account = NULL, $op = 'view') {
if (!isset($account)) {
global $user;
$account = $user;
}
if ($op === 'archive') {
if ($og_nid = tft_og_get_og_nid($tid)) {
return og_user_access('node', $og_nid, TFT_ARCHIVE_PERM__ARCHIVE_TERMS, $account);
}
}
}
/**
* Implements hook_og_permission().
*/
function tft_og_archive_og_permission() {
return tft_archive_permission();
}
/**
* Action callback: add an archive folder for newly created groups.
*/
function tft_og_archive_rules_create_og_archive_folder($group) {
$tid = tft_og_get_og_tid($group->nid);
tft_archive_create_archive_folder($tid);
}
Functions
Name | Description |
---|---|
tft_og_archive_og_permission | Implements hook_og_permission(). |
tft_og_archive_rules_action_info | Implements hook_rules_action_info(). |
tft_og_archive_rules_create_og_archive_folder | Action callback: add an archive folder for newly created groups. |
tft_og_archive_tft_term_access | Implements hook_tft_term_access(). |