fasttoggle_modr8.module in Fasttoggle 7
Moder8 specific fasttoggle hook implementations.
File
module/fasttoggle_modr8/fasttoggle_modr8.moduleView source
<?php
/**
* @file
* Moder8 specific fasttoggle hook implementations.
*/
/**
* Implements hook_perm().
*/
function fasttoggle_modr8_permission() {
return array(
'moderate posts' => array(
'title' => t('Moderate posts'),
),
);
}
/**
* Check access to moder8 fasttoggle link.
*
* @return int
* Tristate access result.
*/
function fasttoggle_modr8_moder8_access() {
return fasttoggle_allow_access_if(user_access("moderate posts"));
}
/**
* Implements hook_fasttoggle_labels().
*/
function fasttoggle_modr8_fasttoggle_available_links($type = NULL, $obj = NULL) {
if (!is_null($type) && $type != "node") {
return array();
}
$result = array(
'node' => array(
'fields' => array(
'status' => array(
'instances' => array(
'moderate' => array(
'description' => t('Moderated <small>(in the moderation queue)</small>'),
'access' => array(
'fasttoggle_modr8_moder8_access',
),
'labels' => array(
FASTTOGGLE_LABEL_ACTION => array(
0 => t('unmoderate'),
1 => t('moderate'),
),
FASTTOGGLE_LABEL_STATUS => array(
0 => t('not moderated'),
1 => t('moderated'),
),
),
),
),
),
),
),
);
return $result;
}
/**
* Implements hook_views_api().
*/
function fasttoggle_modr8_views_api() {
return array(
'api' => 3,
'path' => drupal_get_path('module', 'fasttoggle_modr8') . '/views',
);
}
Functions
Name![]() |
Description |
---|---|
fasttoggle_modr8_fasttoggle_available_links | Implements hook_fasttoggle_labels(). |
fasttoggle_modr8_moder8_access | Check access to moder8 fasttoggle link. |
fasttoggle_modr8_permission | Implements hook_perm(). |
fasttoggle_modr8_views_api | Implements hook_views_api(). |